diff options
author | chriszero <zerov83@gmail.com> | 2014-11-15 19:43:07 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2014-11-15 19:43:07 +0100 |
commit | 23f9f7712bfa33b5a488a447a6fabe6035cc3240 (patch) | |
tree | 06bbe8e0bc52496c5ad3c41accc7524aa597e670 /Media.cpp | |
parent | a40adaf76fb1267d38b4c5e6386933ddb2d0d328 (diff) | |
download | vdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.gz vdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.bz2 |
initial commit
Diffstat (limited to 'Media.cpp')
-rw-r--r-- | Media.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Media.cpp b/Media.cpp new file mode 100644 index 0000000..d3c53a2 --- /dev/null +++ b/Media.cpp @@ -0,0 +1,54 @@ +#include "Media.h" + +namespace plexclient +{ + +Media::Media(Poco::XML::Node* pNode) +{ + NodeIterator it(pNode, Poco::XML::NodeFilter::SHOW_ALL); + Poco::XML::Node* pChildNode = it.nextNode(); + + while(pChildNode) { + if(Poco::icompare(pChildNode->nodeName(), "Media") == 0) { + + Poco::XML::AutoPtr<Poco::XML::NamedNodeMap> pAttribs = pChildNode->attributes(); + m_sVideoResolution = GetNodeValue(pAttribs->getNamedItem("videoResolution")); + m_iId = GetNodeValueAsInt(pAttribs->getNamedItem("id")); + m_lDuration = GetNodeValueAsLong(pAttribs->getNamedItem("duration")); + m_iBitrate = GetNodeValueAsInt(pAttribs->getNamedItem("bitrate")); + m_iWidth = GetNodeValueAsInt(pAttribs->getNamedItem("width")); + m_iHeight = GetNodeValueAsInt(pAttribs->getNamedItem("height")); + m_sAspectRatio = GetNodeValue(pAttribs->getNamedItem("aspectRatio")); + m_iAudioChannels = GetNodeValueAsInt(pAttribs->getNamedItem("audioChannels")); + m_sAudioCodec = GetNodeValue(pAttribs->getNamedItem("audioCodec")); + m_sVideoCodec = GetNodeValue(pAttribs->getNamedItem("videoCodec")); + m_sContainer = GetNodeValue(pAttribs->getNamedItem("container")); + m_sVideoFrameRate = GetNodeValue(pAttribs->getNamedItem("videoFrameRate")); + + + pAttribs->release(); + + } + if(Poco::icompare(pChildNode->nodeName(), "Part") == 0) { + + Poco::XML::AutoPtr<Poco::XML::NamedNodeMap> pAttribs = pChildNode->attributes(); + m_sPartKey = GetNodeValue(pAttribs->getNamedItem("key")); + m_iPartId = GetNodeValueAsInt(pAttribs->getNamedItem("id")); + m_lPartDuration = GetNodeValueAsLong(pAttribs->getNamedItem("duration")); + m_sPartFile = GetNodeValue(pAttribs->getNamedItem("file")); + m_lPartSize = GetNodeValueAsLong(pAttribs->getNamedItem("size")); + m_sPartContainer = GetNodeValue(pAttribs->getNamedItem("container")); + + pAttribs->release(); + } + pChildNode = it.nextNode(); + } +} + +Media::~Media() +{ +} + + +} + |