Switch to unified view

a/src/ohinfo.cxx b/src/ohinfo.cxx
...
...
59
    bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) || 
59
    bool is_song = (mpds.state == MpdStatus::MPDS_PLAY) || 
60
        (mpds.state == MpdStatus::MPDS_PAUSE);
60
        (mpds.state == MpdStatus::MPDS_PAUSE);
61
61
62
    if (is_song) {
62
    if (is_song) {
63
        uri = mpds.currentsong.uri;
63
        uri = mpds.currentsong.uri;
64
        // If somebody (e.g. ohradio) took care to set the metatext, use it.
65
        // Metatext is reset by OHProduct::setSourceIndex.
66
        if (!m_metatext.empty()) {
67
            metadata = m_metatext;
68
        } else {
69
            // Playlist or AVTransport playing, probably.
64
        // Prefer metadata from cache (copy from media server) to
70
            // Prefer metadata from cache (copy from media server) to
65
        // whatever comes from mpd
71
            // whatever comes from mpd.
66
        if (m_ohpl && m_ohpl->cacheFind(uri, metadata)) {
72
            if (m_ohpl && m_ohpl->cacheFind(uri, metadata)) {
67
            return;
73
                return;
74
            }
75
            metadata = didlmake(mpds.currentsong);
68
        }
76
        }
69
        metadata = didlmake(mpds.currentsong);
70
    } else {
77
    } else {
71
        uri.clear();
78
        uri.clear();
72
        metadata.clear();
79
        metadata.clear();
73
    }
80
    }
74
}
81
}
...
...
97
104
98
    st["TrackCount"] = SoapHelp::i2s(m_dev->m_mpds ? 
105
    st["TrackCount"] = SoapHelp::i2s(m_dev->m_mpds ? 
99
                                     m_dev->m_mpds->trackcounter : 0);
106
                                     m_dev->m_mpds->trackcounter : 0);
100
    st["DetailsCount"] = SoapHelp::i2s(m_dev->m_mpds ? 
107
    st["DetailsCount"] = SoapHelp::i2s(m_dev->m_mpds ? 
101
                                       m_dev->m_mpds->detailscounter : 0);
108
                                       m_dev->m_mpds->detailscounter : 0);
102
    st["MetatextCount"] = "0";
109
    st["MetatextCount"] = SoapHelp::i2s(m_metatextcnt);
103
    string uri, metadata;
110
    string uri, metadata;
104
    urimetadata(uri, metadata);
111
    urimetadata(uri, metadata);
105
    st["Uri"] = uri;
112
    st["Uri"] = uri;
106
    st["Metadata"] = metadata;
113
    st["Metadata"] = metadata;
107
    makedetails(st["Duration"], st["BitRate"], st["BitDepth"],st["SampleRate"]);
114
    makedetails(st["Duration"], st["BitRate"], st["BitDepth"],st["SampleRate"]);
...
...
117
    
124
    
118
    data.addarg("TrackCount", SoapHelp::i2s(m_dev->m_mpds ?
125
    data.addarg("TrackCount", SoapHelp::i2s(m_dev->m_mpds ?
119
                                            m_dev->m_mpds->trackcounter : 0));
126
                                            m_dev->m_mpds->trackcounter : 0));
120
    data.addarg("DetailsCount", SoapHelp::i2s(m_dev->m_mpds ?
127
    data.addarg("DetailsCount", SoapHelp::i2s(m_dev->m_mpds ?
121
                                              m_dev->m_mpds->detailscounter:0));
128
                                              m_dev->m_mpds->detailscounter:0));
122
    data.addarg("MetatextCount", "0");
129
    data.addarg("MetatextCount", SoapHelp::i2s(m_metatextcnt));
123
    return UPNP_E_SUCCESS;
130
    return UPNP_E_SUCCESS;
124
}
131
}
125
132
126
int OHInfo::track(const SoapIncoming& sc, SoapOutgoing& data)
133
int OHInfo::track(const SoapIncoming& sc, SoapOutgoing& data)
127
{
134
{
...
...
157
}
164
}
158
165
159
void OHInfo::setMetatext(const string& metatext)
166
void OHInfo::setMetatext(const string& metatext)
160
{
167
{
161
    //LOGDEB1("OHInfo::setMetatext: " << metatext << endl);
168
    //LOGDEB1("OHInfo::setMetatext: " << metatext << endl);
169
    if (metatext.compare(m_metatext)) {
162
    m_metatext = metatext;
170
        m_metatext = metatext;
171
        m_metatextcnt++;
172
    }
163
}
173
}