|
a/upmpd/ohinfo.cxx |
|
b/upmpd/ohinfo.cxx |
|
... |
|
... |
78 |
|
78 |
|
79 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
79 |
bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) ||
|
80 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
80 |
(mpds.state == MpdStatus::MPDS_PAUSE);
|
81 |
|
81 |
|
82 |
if (is_song) {
|
82 |
if (is_song) {
|
83 |
duration = SoapArgs::i2s(mpds.songlenms / 1000);
|
83 |
duration = SoapHelp::i2s(mpds.songlenms / 1000);
|
84 |
bitrate = SoapArgs::i2s(mpds.kbrate * 1000);
|
84 |
bitrate = SoapHelp::i2s(mpds.kbrate * 1000);
|
85 |
bitdepth = SoapArgs::i2s(mpds.bitdepth);
|
85 |
bitdepth = SoapHelp::i2s(mpds.bitdepth);
|
86 |
samplerate = SoapArgs::i2s(mpds.sample_rate);
|
86 |
samplerate = SoapHelp::i2s(mpds.sample_rate);
|
87 |
} else {
|
87 |
} else {
|
88 |
duration = bitrate = bitdepth = samplerate = "0";
|
88 |
duration = bitrate = bitdepth = samplerate = "0";
|
89 |
}
|
89 |
}
|
90 |
}
|
90 |
}
|
91 |
|
91 |
|
92 |
bool OHInfo::makestate(unordered_map<string, string> &st)
|
92 |
bool OHInfo::makestate(unordered_map<string, string> &st)
|
93 |
{
|
93 |
{
|
94 |
st.clear();
|
94 |
st.clear();
|
95 |
|
95 |
|
96 |
st["TrackCount"] = SoapArgs::i2s(m_dev->m_mpds ?
|
96 |
st["TrackCount"] = SoapHelp::i2s(m_dev->m_mpds ?
|
97 |
m_dev->m_mpds->trackcounter : 0);
|
97 |
m_dev->m_mpds->trackcounter : 0);
|
98 |
st["DetailsCount"] = SoapArgs::i2s(m_dev->m_mpds ?
|
98 |
st["DetailsCount"] = SoapHelp::i2s(m_dev->m_mpds ?
|
99 |
m_dev->m_mpds->detailscounter : 0);
|
99 |
m_dev->m_mpds->detailscounter : 0);
|
100 |
st["MetatextCount"] = "0";
|
100 |
st["MetatextCount"] = "0";
|
101 |
string uri, metadata;
|
101 |
string uri, metadata;
|
102 |
urimetadata(uri, metadata);
|
102 |
urimetadata(uri, metadata);
|
103 |
st["Uri"] = uri;
|
103 |
st["Uri"] = uri;
|
|
... |
|
... |
133 |
|
133 |
|
134 |
int OHInfo::counters(const SoapArgs& sc, SoapData& data)
|
134 |
int OHInfo::counters(const SoapArgs& sc, SoapData& data)
|
135 |
{
|
135 |
{
|
136 |
LOGDEB("OHInfo::counters" << endl);
|
136 |
LOGDEB("OHInfo::counters" << endl);
|
137 |
|
137 |
|
138 |
data.addarg("TrackCount", SoapArgs::i2s(m_dev->m_mpds ?
|
138 |
data.addarg("TrackCount", SoapHelp::i2s(m_dev->m_mpds ?
|
139 |
m_dev->m_mpds->trackcounter : 0));
|
139 |
m_dev->m_mpds->trackcounter : 0));
|
140 |
data.addarg("DetailsCount", SoapArgs::i2s(m_dev->m_mpds ?
|
140 |
data.addarg("DetailsCount", SoapHelp::i2s(m_dev->m_mpds ?
|
141 |
m_dev->m_mpds->detailscounter:0));
|
141 |
m_dev->m_mpds->detailscounter:0));
|
142 |
data.addarg("MetatextCount", "0");
|
142 |
data.addarg("MetatextCount", "0");
|
143 |
return UPNP_E_SUCCESS;
|
143 |
return UPNP_E_SUCCESS;
|
144 |
}
|
144 |
}
|
145 |
|
145 |
|