|
a/upmpd/avtransport.cxx |
|
b/upmpd/avtransport.cxx |
|
... |
|
... |
141 |
// To be all bundled inside: LastChange
|
141 |
// To be all bundled inside: LastChange
|
142 |
|
142 |
|
143 |
// Translate MPD state to UPnP AVTransport state variables
|
143 |
// Translate MPD state to UPnP AVTransport state variables
|
144 |
bool UpMpdAVTransport::tpstateMToU(unordered_map<string, string>& status)
|
144 |
bool UpMpdAVTransport::tpstateMToU(unordered_map<string, string>& status)
|
145 |
{
|
145 |
{
|
146 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
146 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
147 |
//DEBOUT << "UpMpdAVTransport::tpstateMToU: curpos: " << mpds.songpos <<
|
147 |
//DEBOUT << "UpMpdAVTransport::tpstateMToU: curpos: " << mpds.songpos <<
|
148 |
// " qlen " << mpds.qlen << endl;
|
148 |
// " qlen " << mpds.qlen << endl;
|
149 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
149 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
150 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
150 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
151 |
|
151 |
|
|
... |
|
... |
293 |
// from growing if upmpdcli restarts. If the option is not set, the
|
293 |
// from growing if upmpdcli restarts. If the option is not set, the
|
294 |
// user prefers to live with the issue.
|
294 |
// user prefers to live with the issue.
|
295 |
m_dev->m_mpdcli->clearQueue();
|
295 |
m_dev->m_mpdcli->clearQueue();
|
296 |
}
|
296 |
}
|
297 |
|
297 |
|
298 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
298 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
299 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
299 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
300 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
300 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
301 |
int curpos = mpds.songpos;
|
301 |
int curpos = mpds.songpos;
|
302 |
LOGDEB("UpMpdAVTransport::set" << (setnext?"Next":"") <<
|
302 |
LOGDEB("UpMpdAVTransport::set" << (setnext?"Next":"") <<
|
303 |
"AVTransportURI: curpos: " <<
|
303 |
"AVTransportURI: curpos: " <<
|
|
... |
|
... |
371 |
return UPNP_E_SUCCESS;
|
371 |
return UPNP_E_SUCCESS;
|
372 |
}
|
372 |
}
|
373 |
|
373 |
|
374 |
int UpMpdAVTransport::getPositionInfo(const SoapArgs& sc, SoapData& data)
|
374 |
int UpMpdAVTransport::getPositionInfo(const SoapArgs& sc, SoapData& data)
|
375 |
{
|
375 |
{
|
376 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
376 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
377 |
//LOGDEB("UpMpdAVTransport::getPositionInfo. State: " << mpds.state <<endl);
|
377 |
//LOGDEB("UpMpdAVTransport::getPositionInfo. State: " << mpds.state <<endl);
|
378 |
|
378 |
|
379 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
379 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
380 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
380 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
381 |
|
381 |
|
|
... |
|
... |
424 |
return UPNP_E_SUCCESS;
|
424 |
return UPNP_E_SUCCESS;
|
425 |
}
|
425 |
}
|
426 |
|
426 |
|
427 |
int UpMpdAVTransport::getTransportInfo(const SoapArgs& sc, SoapData& data)
|
427 |
int UpMpdAVTransport::getTransportInfo(const SoapArgs& sc, SoapData& data)
|
428 |
{
|
428 |
{
|
429 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
429 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
430 |
//LOGDEB("UpMpdAVTransport::getTransportInfo. State: " << mpds.state<<endl);
|
430 |
//LOGDEB("UpMpdAVTransport::getTransportInfo. State: " << mpds.state<<endl);
|
431 |
|
431 |
|
432 |
string tstate("STOPPED");
|
432 |
string tstate("STOPPED");
|
433 |
switch(mpds.state) {
|
433 |
switch(mpds.state) {
|
434 |
case MpdStatus::MPDS_PLAY: tstate = "PLAYING"; break;
|
434 |
case MpdStatus::MPDS_PLAY: tstate = "PLAYING"; break;
|
|
... |
|
... |
450 |
return UPNP_E_SUCCESS;
|
450 |
return UPNP_E_SUCCESS;
|
451 |
}
|
451 |
}
|
452 |
|
452 |
|
453 |
int UpMpdAVTransport::getMediaInfo(const SoapArgs& sc, SoapData& data)
|
453 |
int UpMpdAVTransport::getMediaInfo(const SoapArgs& sc, SoapData& data)
|
454 |
{
|
454 |
{
|
455 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
455 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
456 |
LOGDEB("UpMpdAVTransport::getMediaInfo. State: " << mpds.state << endl);
|
456 |
LOGDEB("UpMpdAVTransport::getMediaInfo. State: " << mpds.state << endl);
|
457 |
|
457 |
|
458 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
458 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
459 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
459 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
460 |
|
460 |
|
|
... |
|
... |
497 |
return UPNP_E_SUCCESS;
|
497 |
return UPNP_E_SUCCESS;
|
498 |
}
|
498 |
}
|
499 |
|
499 |
|
500 |
int UpMpdAVTransport::playcontrol(const SoapArgs& sc, SoapData& data, int what)
|
500 |
int UpMpdAVTransport::playcontrol(const SoapArgs& sc, SoapData& data, int what)
|
501 |
{
|
501 |
{
|
502 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
502 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
503 |
LOGDEB("UpMpdAVTransport::playcontrol State: " << mpds.state <<
|
503 |
LOGDEB("UpMpdAVTransport::playcontrol State: " << mpds.state <<
|
504 |
" what "<<what<< endl);
|
504 |
" what "<<what<< endl);
|
505 |
|
505 |
|
506 |
if ((what & ~0x3)) {
|
506 |
if ((what & ~0x3)) {
|
507 |
LOGERR("UpMPd::playcontrol: bad control " << what << endl);
|
507 |
LOGERR("UpMPd::playcontrol: bad control " << what << endl);
|
|
... |
|
... |
538 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
538 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
539 |
}
|
539 |
}
|
540 |
|
540 |
|
541 |
int UpMpdAVTransport::seqcontrol(const SoapArgs& sc, SoapData& data, int what)
|
541 |
int UpMpdAVTransport::seqcontrol(const SoapArgs& sc, SoapData& data, int what)
|
542 |
{
|
542 |
{
|
543 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
543 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
544 |
LOGDEB("UpMpdAVTransport::seqcontrol State: " << mpds.state << " what "
|
544 |
LOGDEB("UpMpdAVTransport::seqcontrol State: " << mpds.state << " what "
|
545 |
<<what<< endl);
|
545 |
<<what<< endl);
|
546 |
|
546 |
|
547 |
if ((what & ~0x1)) {
|
547 |
if ((what & ~0x1)) {
|
548 |
LOGERR("UpMPd::seqcontrol: bad control " << what << endl);
|
548 |
LOGERR("UpMPd::seqcontrol: bad control " << what << endl);
|
|
... |
|
... |
594 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
594 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
595 |
}
|
595 |
}
|
596 |
|
596 |
|
597 |
int UpMpdAVTransport::getTransportSettings(const SoapArgs& sc, SoapData& data)
|
597 |
int UpMpdAVTransport::getTransportSettings(const SoapArgs& sc, SoapData& data)
|
598 |
{
|
598 |
{
|
599 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
599 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
600 |
string playmode = mpdsToPlaymode(mpds);
|
600 |
string playmode = mpdsToPlaymode(mpds);
|
601 |
data.addarg("PlayMode", playmode);
|
601 |
data.addarg("PlayMode", playmode);
|
602 |
data.addarg("RecQualityMode", "NOT_IMPLEMENTED");
|
602 |
data.addarg("RecQualityMode", "NOT_IMPLEMENTED");
|
603 |
return UPNP_E_SUCCESS;
|
603 |
return UPNP_E_SUCCESS;
|
604 |
}
|
604 |
}
|
605 |
|
605 |
|
606 |
int UpMpdAVTransport::getCurrentTransportActions(const SoapArgs& sc,
|
606 |
int UpMpdAVTransport::getCurrentTransportActions(const SoapArgs& sc,
|
607 |
SoapData& data)
|
607 |
SoapData& data)
|
608 |
{
|
608 |
{
|
609 |
const MpdStatus &mpds = m_dev->m_mpdcli->getStatus();
|
609 |
const MpdStatus &mpds = m_dev->getMpdStatus();
|
610 |
string tactions("Next,Previous");
|
610 |
string tactions("Next,Previous");
|
611 |
switch(mpds.state) {
|
611 |
switch(mpds.state) {
|
612 |
case MpdStatus::MPDS_PLAY:
|
612 |
case MpdStatus::MPDS_PLAY:
|
613 |
tactions += ",Pause,Stop,Seek";
|
613 |
tactions += ",Pause,Stop,Seek";
|
614 |
break;
|
614 |
break;
|