|
a/libupnpp/control/avtransport.cxx |
|
b/libupnpp/control/avtransport.cxx |
|
... |
|
... |
167 |
UPnPDirContent meta;
|
167 |
UPnPDirContent meta;
|
168 |
if (!meta.parse(entry1.second)) {
|
168 |
if (!meta.parse(entry1.second)) {
|
169 |
LOGERR("AVTransport event: bad metadata: [" <<
|
169 |
LOGERR("AVTransport event: bad metadata: [" <<
|
170 |
entry1.second << "]" << endl);
|
170 |
entry1.second << "]" << endl);
|
171 |
} else {
|
171 |
} else {
|
172 |
LOGDEB1("AVTransport event: metadata: " <<
|
172 |
LOGDEB1("AVTransport event: good metadata: [" <<
|
173 |
meta.m_items.size() << " items " << endl);
|
173 |
entry1.second << "]" << endl);
|
|
|
174 |
if (meta.m_items.size() > 0) {
|
|
|
175 |
m_reporter->changed(entry1.first.c_str(),
|
|
|
176 |
meta.m_items[0]);
|
|
|
177 |
}
|
174 |
}
|
178 |
}
|
175 |
|
|
|
176 |
m_reporter->changed(entry1.first.c_str(), meta);
|
|
|
177 |
|
|
|
178 |
} else if (!entry1.first.compare("PlaybackStorageMedium") ||
|
179 |
} else if (!entry1.first.compare("PlaybackStorageMedium") ||
|
179 |
!entry1.first.compare("PossiblePlaybackStorageMedium") ||
|
180 |
!entry1.first.compare("PossiblePlaybackStorageMedium") ||
|
180 |
!entry1.first.compare("RecordStorageMedium") ||
|
181 |
!entry1.first.compare("RecordStorageMedium") ||
|
181 |
!entry1.first.compare("PossibleRecordStorageMedium") ||
|
182 |
!entry1.first.compare("PossibleRecordStorageMedium") ||
|
182 |
!entry1.first.compare("RecordMediumWriteStatus") ||
|
183 |
!entry1.first.compare("RecordMediumWriteStatus") ||
|
|
... |
|
... |
292 |
data.getString("TrackMetaData", &s);
|
293 |
data.getString("TrackMetaData", &s);
|
293 |
UPnPDirContent meta;
|
294 |
UPnPDirContent meta;
|
294 |
meta.parse(s);
|
295 |
meta.parse(s);
|
295 |
if (meta.m_items.size() > 0) {
|
296 |
if (meta.m_items.size() > 0) {
|
296 |
info.trackmeta = meta.m_items[0];
|
297 |
info.trackmeta = meta.m_items[0];
|
297 |
LOGDEB("AVTransport::getPositionInfo: size " <<
|
298 |
LOGDEB("AVTransport::getPositionInfo: size " <<
|
298 |
meta.m_items.size() << " current title: " << meta.m_items[0].m_title
|
299 |
meta.m_items.size() << " current title: "
|
299 |
<< endl);
|
300 |
<< meta.m_items[0].m_title << endl);
|
300 |
}
|
301 |
}
|
301 |
meta.clear();
|
|
|
302 |
data.getString("TrackURI", &info.trackuri);
|
302 |
data.getString("TrackURI", &info.trackuri);
|
303 |
data.getString("RelTime", &s);
|
303 |
data.getString("RelTime", &s);
|
304 |
info.reltime = upnpdurationtos(s);
|
304 |
info.reltime = upnpdurationtos(s);
|
305 |
data.getString("AbsTime", &s);
|
305 |
data.getString("AbsTime", &s);
|
306 |
info.abstime = upnpdurationtos(s);
|
306 |
info.abstime = upnpdurationtos(s);
|
|
... |
|
... |
379 |
}
|
379 |
}
|
380 |
|
380 |
|
381 |
int AVTransport::seek(SeekMode mode, int target, int instanceID)
|
381 |
int AVTransport::seek(SeekMode mode, int target, int instanceID)
|
382 |
{
|
382 |
{
|
383 |
string sm;
|
383 |
string sm;
|
|
|
384 |
string value = SoapHelp::i2s(target);
|
384 |
switch (mode) {
|
385 |
switch (mode) {
|
385 |
case SEEK_TRACK_NR: sm = "TRACK_NR"; break;
|
386 |
case SEEK_TRACK_NR: sm = "TRACK_NR"; break;
|
386 |
case SEEK_ABS_TIME: sm = "ABS_TIME"; break;
|
387 |
case SEEK_ABS_TIME: sm = "ABS_TIME";value = upnpduration(target*1000);break;
|
387 |
case SEEK_REL_TIME: sm = "REL_TIME"; break;
|
388 |
case SEEK_REL_TIME: sm = "REL_TIME";value = upnpduration(target*1000);break;
|
388 |
case SEEK_ABS_COUNT: sm = "ABS_COUNT"; break;
|
389 |
case SEEK_ABS_COUNT: sm = "ABS_COUNT"; break;
|
389 |
case SEEK_REL_COUNT: sm = "REL_COUNT"; break;
|
390 |
case SEEK_REL_COUNT: sm = "REL_COUNT"; break;
|
390 |
case SEEK_CHANNEL_FREQ: sm = "CHANNEL_FREQ"; break;
|
391 |
case SEEK_CHANNEL_FREQ: sm = "CHANNEL_FREQ"; break;
|
391 |
case SEEK_TAPE_INDEX: sm = "TAPE-INDEX"; break;
|
392 |
case SEEK_TAPE_INDEX: sm = "TAPE-INDEX"; break;
|
392 |
case SEEK_FRAME: sm = "FRAME"; break;
|
393 |
case SEEK_FRAME: sm = "FRAME"; break;
|
393 |
default:
|
394 |
default:
|
394 |
return UPNP_E_INVALID_PARAM;
|
395 |
return UPNP_E_INVALID_PARAM;
|
395 |
}
|
396 |
}
|
396 |
|
397 |
|
397 |
SoapEncodeInput args(m_serviceType, "Play");
|
398 |
SoapEncodeInput args(m_serviceType, "Seek");
|
398 |
args("InstanceID", SoapHelp::i2s(instanceID))
|
399 |
args("InstanceID", SoapHelp::i2s(instanceID))
|
399 |
("Unit", sm)
|
400 |
("Unit", sm)
|
400 |
("Target", SoapHelp::i2s(target));
|
401 |
("Target", value);
|
401 |
SoapDecodeOutput data;
|
402 |
SoapDecodeOutput data;
|
402 |
return runAction(args, data);
|
403 |
return runAction(args, data);
|
403 |
}
|
404 |
}
|
404 |
|
405 |
|
405 |
int AVTransport::next(int instanceID)
|
406 |
int AVTransport::next(int instanceID)
|