diff options
author | Christian <zerov83@gmail.com> | 2016-04-02 23:28:44 +0200 |
---|---|---|
committer | Christian <zerov83@gmail.com> | 2016-04-02 23:28:44 +0200 |
commit | f94b31e13127247160815c5902e75f7bcbf3d393 (patch) | |
tree | 2f3baa9733d9a56473930152c5af097c0a271763 | |
parent | 893c0af051a0832b3bea59a1db4276c938e6211e (diff) | |
download | vdr-plugin-plex-f94b31e13127247160815c5902e75f7bcbf3d393.tar.gz vdr-plugin-plex-f94b31e13127247160815c5902e75f7bcbf3d393.tar.bz2 |
Code cleanup
-rw-r--r-- | MediaContainer.cpp | 6 | ||||
-rw-r--r-- | MediaContainer.h | 4 | ||||
-rw-r--r-- | PVideo.cpp | 26 | ||||
-rw-r--r-- | PVideo.h | 8 | ||||
-rw-r--r-- | PlexServer.h | 1 | ||||
-rw-r--r-- | Plexservice.cpp | 2 | ||||
-rw-r--r-- | Plexservice.h | 3 | ||||
-rw-r--r-- | SubscriptionManager.cpp | 20 | ||||
-rw-r--r-- | SubscriptionManager.h | 8 | ||||
-rw-r--r-- | browserGrid.cpp | 8 | ||||
-rw-r--r-- | cPlexOsdItem.cpp | 4 | ||||
-rw-r--r-- | cPlexOsdItem.h | 6 | ||||
-rw-r--r-- | detailView.cpp | 8 | ||||
-rw-r--r-- | detailView.h | 6 | ||||
-rw-r--r-- | displayReplaySD.cpp | 2 | ||||
-rw-r--r-- | displayReplaySD.h | 2 | ||||
-rw-r--r-- | hlsPlayer.cpp | 10 | ||||
-rw-r--r-- | hlsPlayer.h | 8 | ||||
-rw-r--r-- | hlsPlayerControl.cpp | 8 | ||||
-rw-r--r-- | hlsPlayerControl.h | 10 | ||||
-rw-r--r-- | pictureCache.cpp | 1 | ||||
-rw-r--r-- | plex.cpp | 4 | ||||
-rw-r--r-- | plex.h | 4 | ||||
-rw-r--r-- | plexOsd.cpp | 4 | ||||
-rw-r--r-- | plexOsd.h | 5 | ||||
-rw-r--r-- | plexSdOsd.cpp | 18 | ||||
-rw-r--r-- | plexSdOsd.h | 5 | ||||
-rw-r--r-- | plexgdm.h | 6 | ||||
-rw-r--r-- | po/de_DE.po | 40 |
29 files changed, 108 insertions, 129 deletions
diff --git a/MediaContainer.cpp b/MediaContainer.cpp index c7d4e5c..264d33b 100644 --- a/MediaContainer.cpp +++ b/MediaContainer.cpp @@ -47,7 +47,7 @@ MediaContainer::MediaContainer(std::istream* response, PlexServer* Server) } else if(Poco::icompare(pNode->nodeName(), "Directory") == 0) { m_vDirectories.push_back(Directory(pNode, m_pServer, this)); } else if(Poco::icompare(pNode->nodeName(), "Video") == 0) { - m_vVideos.push_back(Video(pNode, m_pServer, this)); + m_vVideos.push_back(cVideo(pNode, m_pServer, this)); } else if(Poco::icompare(pNode->nodeName(), "Device") == 0) { m_vDevices.push_back(Device(pNode, this)); } else if(Poco::icompare(pNode->nodeName(), "Playlist") == 0) { @@ -75,10 +75,10 @@ std::string MediaContainer::ThumbUri() } #ifdef SKINDESIGNER -void MediaContainer::PreCache() +void MediaContainer::PreCache() { bool foo; - for(std::vector<plexclient::Video>::iterator it = m_vVideos.begin(); it != m_vVideos.end(); ++it) { + for(std::vector<plexclient::cVideo>::iterator it = m_vVideos.begin(); it != m_vVideos.end(); ++it) { if(!it->m_sThumb.empty()) cPictureCache::GetInstance().GetPath(it->ThumbUri(), 1280, 720, foo); if(!it->m_sArt.empty()) cPictureCache::GetInstance().GetPath(it->ArtUri(), 1920, 1080, foo); } diff --git a/MediaContainer.h b/MediaContainer.h index 0f385be..c6cb14e 100644 --- a/MediaContainer.h +++ b/MediaContainer.h @@ -33,7 +33,7 @@ using Poco::Exception; namespace plexclient { -class Video; +class cVideo; class Directory; class Device; class Playlist; @@ -49,7 +49,7 @@ protected: public: std::vector<Directory> m_vDirectories; - std::vector<Video> m_vVideos; + std::vector<cVideo> m_vVideos; std::vector<Device> m_vDevices; std::vector<Playlist> m_vPlaylists; @@ -11,7 +11,7 @@ namespace plexclient { -Video::Video(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent) +cVideo::cVideo(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent) { m_iMyPlayOffset = 0; m_lViewoffset = 0; @@ -25,7 +25,7 @@ Video::Video(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent) } } -bool Video::UpdateFromServer() +bool cVideo::UpdateFromServer() { try { Poco::URI fileuri(Poco::format("%s/library/metadata/%d?includeExtras=1", m_pServer->GetUri(), m_iRatingKey)); @@ -69,7 +69,7 @@ bool Video::UpdateFromServer() return false; } -void Video::Parse(Poco::XML::Node* pNode) +void cVideo::Parse(Poco::XML::Node* pNode) { NodeIterator it(pNode, Poco::XML::NodeFilter::SHOW_ALL); Poco::XML::Node* pChildNode = it.nextNode(); @@ -146,20 +146,20 @@ void Video::Parse(Poco::XML::Node* pNode) } } -void Video::ParseExtras(Poco::XML::Node* pNode) +void cVideo::ParseExtras(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(), "Video") == 0) { - m_vExtras.push_back(Video(pChildNode, m_pServer, NULL)); + m_vExtras.push_back(cVideo(pChildNode, m_pServer, NULL)); } pChildNode = it.nextNode(); } } -std::string Video::GetTitle() +std::string cVideo::GetTitle() { std::string res = m_sTitle; @@ -184,7 +184,7 @@ std::string Video::GetTitle() return res; } -bool Video::SetStream(Stream* stream) +bool cVideo::SetStream(Stream* stream) { try { Poco::Net::HTTPClientSession session(m_pServer->GetHost(), m_pServer->GetPort()); @@ -207,7 +207,7 @@ bool Video::SetStream(Stream* stream) } } -bool Video::SetUnwatched() +bool cVideo::SetUnwatched() { try { std::string uri = Poco::format("/:/unscrobble?key=%d&identifier=com.plexapp.plugins.library", m_iRatingKey); @@ -228,7 +228,7 @@ bool Video::SetUnwatched() } } -bool Video::SetWatched() +bool cVideo::SetWatched() { try { std::string uri = Poco::format("/:/scrobble?key=%d&identifier=com.plexapp.plugins.library", m_iRatingKey); @@ -248,7 +248,7 @@ bool Video::SetWatched() } #ifdef SKINDESIGNER -void Video::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool clear, std::function<void(cGridElement*)> OnCached) +void cVideo::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool clear, std::function<void(cGridElement*)> OnCached) { if(clear) grid->ClearTokens(); grid->AddIntToken((int)(eTokenGridInt::viewmode), Config::GetInstance().DefaultViewMode); @@ -347,21 +347,21 @@ void Video::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool c } #endif -std::string Video::ArtUri() +std::string cVideo::ArtUri() { if(m_sArt.find("http://") != std::string::npos) return m_sArt; if(m_sArt[0] == '/') return m_pServer->GetUri() + m_sArt; return m_pServer->GetUri() + '/' + m_sArt; } -std::string Video::ThumbUri() +std::string cVideo::ThumbUri() { if(m_sThumb.find("http://") != std::string::npos) return m_sThumb; if(m_sThumb[0] == '/') return m_pServer->GetUri() + m_sThumb; return m_pServer->GetUri() + '/' + m_sThumb; } -std::string Video::GetSubtitleUrl() +std::string cVideo::GetSubtitleUrl() { // /video/:/transcode/universal/subtitles // Argument? m_sKey? @@ -39,7 +39,7 @@ namespace plexclient { class MediaContainer; -class Video: private XmlObject +class cVideo: private XmlObject #ifdef SKINDESIGNER ,public cGridElement #endif @@ -50,8 +50,8 @@ private: void ParseExtras(Poco::XML::Node* pNode); public: - Video(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent); - Video() {}; + cVideo(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent); + cVideo() {}; public: int m_iRatingKey; @@ -89,7 +89,7 @@ public: int m_iMyPlayOffset; int m_iIndex; int m_iParentIndex; - std::vector<Video> m_vExtras; + std::vector<cVideo> m_vExtras; ExtraType m_eExtraType; virtual std::string GetTitle(); diff --git a/PlexServer.h b/PlexServer.h index 917f035..273df28 100644 --- a/PlexServer.h +++ b/PlexServer.h @@ -75,7 +75,6 @@ class PlexServer std::shared_ptr<Poco::Net::HTTPClientSession> GetClientSession(); - void DiscoverSettings(); bool Offline; protected: diff --git a/Plexservice.cpp b/Plexservice.cpp index a0c1f7f..1e76bef 100644 --- a/Plexservice.cpp +++ b/Plexservice.cpp @@ -247,7 +247,7 @@ std::shared_ptr<MediaContainer> Plexservice::GetMediaContainer(std::string fullU } } -std::string Plexservice::GetUniversalTranscodeUrl(Video* video, int offset, PlexServer* server, bool http) +std::string Plexservice::GetUniversalTranscodeUrl(cVideo* video, int offset, PlexServer* server, bool http) { PlexServer* pSrv = server ? server : video->m_pServer; Poco::URI transcodeUri(pSrv->GetUri()); diff --git a/Plexservice.h b/Plexservice.h index 097106f..a40525c 100644 --- a/Plexservice.h +++ b/Plexservice.h @@ -42,14 +42,13 @@ public: Plexservice(PlexServer *server); Plexservice(PlexServer *server, std::string startUri); - void DisplaySections(); std::shared_ptr<MediaContainer> GetSection(std::string section, bool putOnStack = true); std::shared_ptr<MediaContainer> GetLastSection(bool current = false); bool IsRoot(); PlexServer* GetServer(); void Authenticate(); - static std::string GetUniversalTranscodeUrl(Video* video, int offset = 0, PlexServer* server = 0, bool http = false); + static std::string GetUniversalTranscodeUrl(cVideo* video, int offset = 0, PlexServer* server = 0, bool http = false); static std::string GetMyPlexToken(); static std::shared_ptr<MediaContainer> GetMediaContainer(std::string fullUrl); //static std::string encode(std::string message); diff --git a/SubscriptionManager.cpp b/SubscriptionManager.cpp index dbdea3e..4d90a58 100644 --- a/SubscriptionManager.cpp +++ b/SubscriptionManager.cpp @@ -78,7 +78,7 @@ void SubscriptionManager::NotifyServer() try { int current, total, speed; bool play, forward; - Video *pVid = NULL; + cVideo *pVid = NULL; if(!m_pStatus->PlayerStopped && m_pStatus->pControl) { m_pStatus->pControl->GetIndex(current, total); current = current / m_pStatus->pControl->FramesPerSecond() * 1000; @@ -116,13 +116,9 @@ void SubscriptionManager::NotifyServer() Poco::Net::HTTPResponse response; bool ok; auto cSession = pServer->MakeRequest(ok, "/:/timeline", queryMap); - - if(m_pStatus->PlayerStopped) { - m_bStoppedSent = true; - } else { - m_bStoppedSent = false; - } + + m_bStoppedSent = m_pStatus->PlayerStopped ? true : false; } catch (Poco::Exception& e) {} } @@ -168,9 +164,9 @@ std::string SubscriptionManager::GetMsg(std::string commandId) std::string SubscriptionManager::GetTimelineXml() { - int current, total, speed; - bool play, forward; - Video *pVid = NULL; + int current = 0, total = 0, speed; + bool play = false, forward; + cVideo *pVid = NULL; if(!m_pStatus->PlayerStopped && m_pStatus->pControl) { m_pStatus->pControl->GetIndex(current, total); current = current / m_pStatus->pControl->FramesPerSecond() * 1000; @@ -251,14 +247,14 @@ void Subscriber::SendUpdate(std::string msg, bool isNav) ActionManager::ActionManager() {} -void ActionManager::AddAction(Video video) +void ActionManager::AddAction(cVideo video) { m_myLock.Lock(&m_myMutex); m_Action = video; m_isAction = true; } -Video ActionManager::GetAction() +cVideo ActionManager::GetAction() { m_myLock.Lock(&m_myMutex); m_isAction = false; diff --git a/SubscriptionManager.h b/SubscriptionManager.h index 3da053c..55facef 100644 --- a/SubscriptionManager.h +++ b/SubscriptionManager.h @@ -24,7 +24,7 @@ public: bool PlayerPaused; bool PlayerStopped; cControl* pControl; - Video* pVideo; + cVideo* pVideo; int Volume; }; @@ -91,15 +91,15 @@ public: static ActionManager instance; return instance; } - void AddAction(Video video); - Video GetAction(); + void AddAction(cVideo video); + cVideo GetAction(); bool IsAction(); private: cMutexLock m_myLock; cMutex m_myMutex; ActionManager(); - Video m_Action; + cVideo m_Action; bool m_isAction; }; diff --git a/browserGrid.cpp b/browserGrid.cpp index b132d24..4fcbb2f 100644 --- a/browserGrid.cpp +++ b/browserGrid.cpp @@ -181,8 +181,8 @@ void cBrowserGrid::ProcessData() } if(m_pContainer->m_vVideos.size() > 0) { - for(std::vector<plexclient::Video>::iterator it = m_pContainer->m_vVideos.begin(); it != m_pContainer->m_vVideos.end(); ++it) { - plexclient::Video *elem = &(*it); + for(std::vector<plexclient::cVideo>::iterator it = m_pContainer->m_vVideos.begin(); it != m_pContainer->m_vVideos.end(); ++it) { + plexclient::cVideo *elem = &(*it); m_vElements.push_back(elem); } } @@ -223,7 +223,7 @@ eOSState cBrowserGrid::NavigateSelect() m_vServerElements.clear(); ProcessData(); return eOSState::osContinue; - } else if(dynamic_cast<plexclient::Video*>(SelectedObject())) { + } else if(dynamic_cast<plexclient::cVideo*>(SelectedObject())) { return eOSState::osUser1; } else return eOSState::osEnd; } @@ -306,7 +306,7 @@ void cBrowserGrid::DrawFooter() string textRed = ""; string textBlue = tr("Switch View"); - if(auto vid = dynamic_cast<plexclient::Video*>(SelectedObject()) ) { + if(auto vid = dynamic_cast<plexclient::cVideo*>(SelectedObject()) ) { if(vid->m_iViewCount > 0) textRed = tr("Unscrobble"); else textRed = tr("Scrobble"); } diff --git a/cPlexOsdItem.cpp b/cPlexOsdItem.cpp index b2e00a8..4e4272f 100644 --- a/cPlexOsdItem.cpp +++ b/cPlexOsdItem.cpp @@ -11,7 +11,7 @@ cPlexOsdItem::cPlexOsdItem(const char* title, std::shared_ptr<plexclient::Plexse m_bDir = false; } -cPlexOsdItem::cPlexOsdItem(const char* title, plexclient::Video* obj) :cOsdItem(title) { +cPlexOsdItem::cPlexOsdItem(const char* title, plexclient::cVideo* obj) :cOsdItem(title) { item = obj; m_bVideo = true; m_bDir = false; @@ -32,7 +32,7 @@ cPlexOsdItem::cPlexOsdItem(const char* title, plexclient::Stream* obj) :cOsdItem m_bDir = false; } -plexclient::Video* cPlexOsdItem::GetAttachedVideo() { +plexclient::cVideo* cPlexOsdItem::GetAttachedVideo() { return item; } diff --git a/cPlexOsdItem.h b/cPlexOsdItem.h index 2e34581..b5e834f 100644 --- a/cPlexOsdItem.h +++ b/cPlexOsdItem.h @@ -15,7 +15,7 @@ class cPlexOsdItem : public cOsdItem { private: - plexclient::Video* item; + plexclient::cVideo* item; plexclient::Directory* dir; plexclient::Stream stream; std::shared_ptr<plexclient::Plexservice> pservice; @@ -25,7 +25,7 @@ private: public: cPlexOsdItem(const char* title); cPlexOsdItem(const char* title, std::shared_ptr<plexclient::Plexservice> service); - cPlexOsdItem(const char* title, plexclient::Video* obj); + cPlexOsdItem(const char* title, plexclient::cVideo* obj); cPlexOsdItem(const char* title, plexclient::Directory* obj); /** * @brief @@ -33,7 +33,7 @@ public: * @param obj will be copied */ cPlexOsdItem(const char* title, plexclient::Stream* obj); - plexclient::Video* GetAttachedVideo(); + plexclient::cVideo* GetAttachedVideo(); plexclient::Directory* GetAttachedDirectory(); plexclient::Stream& GetAttachedStream() { return stream; } std::shared_ptr<plexclient::Plexservice> GetAttachedService(); diff --git a/detailView.cpp b/detailView.cpp index 83152b0..3055cb0 100644 --- a/detailView.cpp +++ b/detailView.cpp @@ -1,7 +1,7 @@ #include "detailView.h" #include "Config.h" -cDetailView::cDetailView(std::shared_ptr<skindesignerapi::cOsdView> detailView, plexclient::Video *video) +cDetailView::cDetailView(std::shared_ptr<skindesignerapi::cOsdView> detailView, plexclient::cVideo *video) : cViewGridNavigator(detailView) { m_pBackground = std::shared_ptr<skindesignerapi::cViewElement>(detailView->GetViewElement((int)eViewElementsDetail::background)); @@ -21,7 +21,7 @@ cDetailView::cDetailView(std::shared_ptr<skindesignerapi::cOsdView> detailView, int pos = 0; for(auto it = m_pVideo->m_vExtras.begin(); it != m_pVideo->m_vExtras.end(); ++it) { - plexclient::Video *elem = &(*it); + plexclient::cVideo *elem = &(*it); elem->AbsolutePosition = pos++;; m_vElements.push_back(elem); } @@ -76,7 +76,7 @@ void cDetailView::DrawBackground() bool cover = m_pVideo->m_sThumb.empty() == false; m_pBackground->AddIntToken((int)eTokenDetailBackgroundInt::hascover, cover); - if(Cover) m_pBackground->AddStringToken((int)eTokenDetailBackgroundStr::coverpath, m_pVideo->m_sThumb.c_str()); + if(cover) m_pBackground->AddStringToken((int)eTokenDetailBackgroundStr::coverpath, m_pVideo->m_sThumb.c_str()); } void cDetailView::DrawFooter() @@ -203,7 +203,7 @@ eOSState cDetailView::NavigateSelect() { if(m_setIterator) return eOSState::osContinue; - if(dynamic_cast<plexclient::Video*>(SelectedObject())) { + if(dynamic_cast<plexclient::cVideo*>(SelectedObject())) { return eOSState::osUser1; } else return eOSState::osBack; } diff --git a/detailView.h b/detailView.h index 9398fc2..67f3234 100644 --- a/detailView.h +++ b/detailView.h @@ -11,13 +11,13 @@ class cDetailView : public cViewGridNavigator { public: - cDetailView(std::shared_ptr<skindesignerapi::cOsdView> detailView, plexclient::Video *video); + cDetailView(std::shared_ptr<skindesignerapi::cOsdView> detailView, plexclient::cVideo *video); void Draw(); virtual void Flush(); virtual eOSState NavigateSelect(); virtual eOSState NavigateBack(); - plexclient::Video* GetVideo() { return m_pVideo; }; + plexclient::cVideo* GetVideo() { return m_pVideo; }; virtual void Clear(); bool DrawTime(); @@ -28,7 +28,7 @@ private: std::shared_ptr<skindesignerapi::cViewElement> m_pScrollbar; std::shared_ptr<skindesignerapi::cViewElement> m_pWatch; - plexclient::Video *m_pVideo; + plexclient::cVideo *m_pVideo; bool m_drawall; int m_lastsecond; diff --git a/displayReplaySD.cpp b/displayReplaySD.cpp index 87ac511..0e4d01c 100644 --- a/displayReplaySD.cpp +++ b/displayReplaySD.cpp @@ -1,6 +1,6 @@ #include "displayReplaySD.h" -cDisplayReplaySD::cDisplayReplaySD(plexclient::Video* video) : cSkindesignerOsdObject(GetPluginStruct()) +cDisplayReplaySD::cDisplayReplaySD(plexclient::cVideo* video) : cSkindesignerOsdObject(GetPluginStruct()) { } diff --git a/displayReplaySD.h b/displayReplaySD.h index 8961921..8fc4593 100644 --- a/displayReplaySD.h +++ b/displayReplaySD.h @@ -20,7 +20,7 @@ private: std::shared_ptr<skindesignerapi::cViewElement> m_pTranscodeinfo; public: - cDisplayReplaySD(plexclient::Video* video); + cDisplayReplaySD(plexclient::cVideo* video); ~cDisplayReplaySD(); virtual void Show(void); diff --git a/hlsPlayer.cpp b/hlsPlayer.cpp index 515ff93..1ef8ada 100644 --- a/hlsPlayer.cpp +++ b/hlsPlayer.cpp @@ -21,7 +21,7 @@ const int BUFFERSIZE = 8192; //--- cHlsSegmentLoader -cHlsSegmentLoader::cHlsSegmentLoader(std::string startm3u8, plexclient::Video* pVideo) +cHlsSegmentLoader::cHlsSegmentLoader(std::string startm3u8, plexclient::cVideo* pVideo) { m_pVideo = pVideo; m_newList = false; @@ -67,7 +67,7 @@ bool cHlsSegmentLoader::LoadM3u8(std::string uri) { //LOCK_THREAD; m_startUri = Poco::URI(uri); - return m_newList = true; + return (m_newList = true); } void cHlsSegmentLoader::Action(void) @@ -329,7 +329,7 @@ bool cHlsSegmentLoader::DoLoad(void) if(m_lastLoadedSegment < m_indexParser.vPlaylistItems.size()) { std::string segmentUri = GetSegmentUri(m_lastLoadedSegment); - if(result = LoadSegment(segmentUri)) { + if((result = LoadSegment(segmentUri))) { m_lastLoadedSegment++; } else { // transcoder may be died, plex bug, restart transcode session @@ -355,7 +355,7 @@ bool cHlsSegmentLoader::DoLoad(void) } else { result = false; } - return recover ? true : result; + return recover || result; } bool cHlsSegmentLoader::BufferFilled(void) @@ -443,7 +443,7 @@ int cHlsSegmentLoader::GetStreamLenght() //--- cHlsPlayer -cHlsPlayer::cHlsPlayer(std::string startm3u8, plexclient::Video Video, int offset) +cHlsPlayer::cHlsPlayer(std::string startm3u8, plexclient::cVideo Video, int offset) { dsyslog("[plex]: '%s'", __FUNCTION__); m_Video = Video; diff --git a/hlsPlayer.h b/hlsPlayer.h index ed5a80e..21e6651 100644 --- a/hlsPlayer.h +++ b/hlsPlayer.h @@ -33,7 +33,7 @@ private: uchar* m_pBuffer; Poco::Net::HTTPClientSession* m_pClientSession; - plexclient::Video* m_pVideo; + plexclient::cVideo* m_pVideo; Poco::URI m_startUri; std::string m_sessionUriPart; std::string m_segmentUriPart; @@ -60,7 +60,7 @@ protected: bool DoLoad(void); public: - cHlsSegmentLoader(std::string startm3u8, plexclient::Video* pVideo); + cHlsSegmentLoader(std::string startm3u8, plexclient::cVideo* pVideo); ~cHlsSegmentLoader(); cRingBufferLinear* m_pRingbuffer; @@ -79,7 +79,7 @@ private: std::ofstream* m_pDebugFile; int AudioIndexOffset; cHlsSegmentLoader* m_pSegmentLoader; - plexclient::Video m_Video; + plexclient::cVideo m_Video; int m_jumpOffset; int m_timeOffset; @@ -113,7 +113,7 @@ protected: public: //static cMutex s_mutex; - cHlsPlayer(std::string startm3u8, plexclient::Video Video, int offset = 0); + cHlsPlayer(std::string startm3u8, plexclient::cVideo Video, int offset = 0); ~cHlsPlayer(); virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false); diff --git a/hlsPlayerControl.cpp b/hlsPlayerControl.cpp index 7a2467b..50ba441 100644 --- a/hlsPlayerControl.cpp +++ b/hlsPlayerControl.cpp @@ -13,7 +13,7 @@ #include "cPlexOsdItem.h" // static -cControl* cHlsPlayerControl::Create(plexclient::Video Video) +cControl* cHlsPlayerControl::Create(plexclient::cVideo Video) { // Stop already playing stream cHlsPlayerControl* c = dynamic_cast<cHlsPlayerControl*>(cControl::Control(true)); @@ -32,7 +32,7 @@ cControl* cHlsPlayerControl::Create(plexclient::Video Video) return playerControl; } -cHlsPlayerControl::cHlsPlayerControl(cHlsPlayer* Player, plexclient::Video Video) :cControl(Player) +cHlsPlayerControl::cHlsPlayerControl(cHlsPlayer* Player, plexclient::cVideo Video) :cControl(Player) { dsyslog("[plex]: '%s'", __FUNCTION__); player = Player; @@ -243,7 +243,7 @@ void cHlsPlayerControl::JumpRelative(int offset) void cHlsPlayerControl::ShowMode(void) { //dsyslog("[plex]: '%s'\n", __FUNCTION__); - if (visible || Setup.ShowReplayMode && !cOsd::IsOpen()) { + if (visible || (Setup.ShowReplayMode && !cOsd::IsOpen())) { bool Play, Forward; int Speed; if (GetReplayMode(Play, Forward, Speed) && (!visible || Play != lastPlay || Forward != lastForward || Speed != lastSpeed)) { @@ -315,7 +315,7 @@ void cHlsPlayerControl::ShowTimed(int Seconds) timeoutShow = time(NULL) + Seconds; } -cStreamSelectMenu::cStreamSelectMenu(plexclient::Video* Video) : cOsdMenu("StreamSelect") +cStreamSelectMenu::cStreamSelectMenu(plexclient::cVideo* Video) : cOsdMenu("StreamSelect") { pVideo = Video; CreateMenu(); diff --git a/hlsPlayerControl.h b/hlsPlayerControl.h index fb2ba3f..c208502 100644 --- a/hlsPlayerControl.h +++ b/hlsPlayerControl.h @@ -11,12 +11,12 @@ class cStreamSelectMenu : public cOsdMenu { private: - plexclient::Video* pVideo; + plexclient::cVideo* pVideo; void CreateMenu(); bool SelectStream(); public: - cStreamSelectMenu(plexclient::Video* Video); + cStreamSelectMenu(plexclient::cVideo* Video); virtual eOSState ProcessKey(eKeys Keys); }; @@ -43,10 +43,10 @@ protected: //void ShowMode(); public: - plexclient::Video m_Video; + plexclient::cVideo m_Video; - static cControl* Create(plexclient::Video Video); - cHlsPlayerControl(cHlsPlayer* Player, plexclient::Video Video); + static cControl* Create(plexclient::cVideo Video); + cHlsPlayerControl(cHlsPlayer* Player, plexclient::cVideo Video); virtual ~cHlsPlayerControl(); virtual void Show(void); diff --git a/pictureCache.cpp b/pictureCache.cpp index f821806..2fcc6eb 100644 --- a/pictureCache.cpp +++ b/pictureCache.cpp @@ -143,7 +143,6 @@ std::string cPictureCache::GetPath(std::string uri, int width, int height, bool& } catch (std::out_of_range) { } std::string transcodeUri = TranscodeUri(uri, width, height); - std::string file = FileName(uri, width); m_mCached[file] = false; @@ -21,7 +21,7 @@ volatile bool cMyPlugin::CalledFromCode = false; bool cMyPlugin::bSkindesigner = false; #endif -plexclient::Video cMyPlugin::CurrentVideo; +plexclient::cVideo cMyPlugin::CurrentVideo; bool cMyPlugin::PlayingFile = false; /** @@ -251,7 +251,7 @@ bool cMyPlugin::SetupParse(const char *name, const char *value) ** ** @param filename path and file name */ -void cMyPlugin::PlayFile(plexclient::Video Vid) +void cMyPlugin::PlayFile(plexclient::cVideo Vid) { if(Vid.m_iMyPlayOffset == 0 && Vid.m_lViewoffset > 0 ) { cString message = cString::sprintf(tr("To start from %ld minutes, press Ok."), Vid.m_lViewoffset / 60000); @@ -64,9 +64,9 @@ public: virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *, const char *); - static plexclient::Video CurrentVideo; + static plexclient::cVideo CurrentVideo; static bool PlayingFile; - static void PlayFile(plexclient::Video Vid); + static void PlayFile(plexclient::cVideo Vid); public: static volatile bool CalledFromCode; diff --git a/plexOsd.cpp b/plexOsd.cpp index c74153e..0d89041 100644 --- a/plexOsd.cpp +++ b/plexOsd.cpp @@ -46,8 +46,8 @@ void cPlexBrowser::CreateMenu() } if(pCont && pCont->m_vVideos.size() > 0) { - for(std::vector<plexclient::Video>::iterator it = pCont->m_vVideos.begin(); it != pCont->m_vVideos.end(); ++it) { - plexclient::Video *vid = &(*it); // cast raw pointer + for(std::vector<plexclient::cVideo>::iterator it = pCont->m_vVideos.begin(); it != pCont->m_vVideos.end(); ++it) { + plexclient::cVideo *vid = &(*it); // cast raw pointer Add(new cPlexOsdItem( vid->GetTitle().c_str(), vid) ); } } @@ -31,7 +31,7 @@ class cPlexBrowser :public cOsdMenu private: std::shared_ptr<plexclient::Plexservice> pService; std::shared_ptr<plexclient::MediaContainer> pCont; - std::vector<plexclient::Video> *v_Vid; + std::vector<plexclient::cVideo> *v_Vid; std::vector<plexclient::Directory> *v_Dir; std::vector<std::string> m_vStack; std::string m_sSection; @@ -60,9 +60,6 @@ public: */ class cPlexMenu:public cOsdMenu { - -private: - void SetRootMenu(); public: cPlexMenu(const char *, int = 0, int = 0, int = 0, int = 0, int = 0); virtual eOSState ProcessKey(eKeys); diff --git a/plexSdOsd.cpp b/plexSdOsd.cpp index b976af4..ac699f2 100644 --- a/plexSdOsd.cpp +++ b/plexSdOsd.cpp @@ -81,7 +81,6 @@ eOSState cPlexSdOsd::ProcessKey(eKeys Key) case kOk: case kBack: return eOSState::osEnd; - break; default: return eOSState::osContinue; } @@ -96,7 +95,7 @@ eOSState cPlexSdOsd::ProcessKey(eKeys Key) eOSState cPlexSdOsd::ProcessKeyDetailView(eKeys Key) { eOSState state = eOSState::osContinue; - plexclient::Video* vid = NULL; + plexclient::cVideo* vid = NULL; switch (Key & ~k_Repeat) { case kUp: @@ -113,7 +112,7 @@ eOSState cPlexSdOsd::ProcessKeyDetailView(eKeys Key) break; case kOk: state = m_pDetailGrid->NavigateSelect(); - vid = dynamic_cast<plexclient::Video*>(m_pDetailGrid->SelectedObject()); + vid = dynamic_cast<plexclient::cVideo*>(m_pDetailGrid->SelectedObject()); Flush(); break; case kBack: @@ -153,7 +152,7 @@ eOSState cPlexSdOsd::ProcessKeyDetailView(eKeys Key) state = eOSState::osEnd; } - if (state != osEnd && m_pDetailsView && m_pDetailGrid->DrawTime()) m_pDetailGrid->Flush(); + if (state != osEnd && m_pDetailGrid && m_pDetailGrid->DrawTime()) m_pDetailGrid->Flush(); return state; } @@ -161,7 +160,7 @@ eOSState cPlexSdOsd::ProcessKeyDetailView(eKeys Key) eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) { eOSState state = eOSState::osContinue; - plexclient::Video* vid = NULL; + plexclient::cVideo* vid = NULL; switch (Key & ~k_Repeat) { case kUp: @@ -180,7 +179,7 @@ eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) // Play movie or change dir state = m_pBrowserGrid->NavigateSelect(); if(state == eOSState::osUser1) { - vid = dynamic_cast<plexclient::Video*>(m_pBrowserGrid->SelectedObject()); + vid = dynamic_cast<plexclient::cVideo*>(m_pBrowserGrid->SelectedObject()); vid->m_iMyPlayOffset = vid->m_lViewoffset/1000; } Flush(); @@ -194,7 +193,7 @@ eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) Flush(); break; case kRed: - vid = dynamic_cast<plexclient::Video*>(m_pBrowserGrid->SelectedObject()); + vid = dynamic_cast<plexclient::cVideo*>(m_pBrowserGrid->SelectedObject()); if(vid) { if(vid->m_iViewCount > 0) vid->SetUnwatched(); else vid->SetWatched(); @@ -203,7 +202,7 @@ eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) } break; case kGreen: // Show Details OSD - vid = dynamic_cast<plexclient::Video*>(m_pBrowserGrid->SelectedObject()); + vid = dynamic_cast<plexclient::cVideo*>(m_pBrowserGrid->SelectedObject()); if(vid) { vid->UpdateFromServer(); ShowDetails(vid); @@ -227,7 +226,7 @@ eOSState cPlexSdOsd::ProcessKeyBrowserView(eKeys Key) return state; } -void cPlexSdOsd::ShowDetails(plexclient::Video *vid) +void cPlexSdOsd::ShowDetails(plexclient::cVideo *vid) { if(m_detailsActive) return; @@ -278,7 +277,6 @@ void cPlexSdOsd::DefineTokens(eViewElementsRoot ve, skindesignerapi::cTokenConta tk->DefineIntToken("{height}", (int)eTokenScrollbarInt::height); tk->DefineIntToken("{offset}", (int)eTokenScrollbarInt::offset); tk->DefineIntToken("{hasscrollbar}", (int)eTokenScrollbarInt::hasscrollbar); - default: break; } } diff --git a/plexSdOsd.h b/plexSdOsd.h index fe1b69b..4549400 100644 --- a/plexSdOsd.h +++ b/plexSdOsd.h @@ -35,12 +35,9 @@ private: std::shared_ptr<skindesignerapi::cOsdView> m_pDetailsView; void Flush(); - //void SwitchGrid(ePlexMenuTab currentTab); - void DrawBackground(); - void DrawFooter(); void DrawMessage(std::string message); - void ShowDetails(plexclient::Video *vid); + void ShowDetails(plexclient::cVideo *vid); public: cPlexSdOsd(skindesignerapi::cPluginStructure *plugStruct); @@ -32,20 +32,14 @@ public: ~plexgdm(); void clientDetails(std::string c_id, std::string c_name, std::string c_port, std::string c_product, std::string c_version); std::string getClientDetails(); - PlexServer* getServerList(); PlexServer* GetServer(std::string ip, int port); PlexServer* GetServer(std::string uuid); bool AddServer(PlexServer server); PlexServer* GetFirstServer(); void discover(); - void checkClientRegistration(); void Action(void); - //void startAll(); - void startRegistration(); - - //void stopAll(); void stopRegistration(); std::vector<PlexServer> &GetPlexservers() { diff --git a/po/de_DE.po b/po/de_DE.po index 4a1a03d..54b63a4 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-plex 0.1.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2016-03-28 18:32+0200\n" +"POT-Creation-Date: 2016-04-02 23:09+0200\n" "PO-Revision-Date: 2016-03-09 21:24+0200\n" "Last-Translator: Chris <zerov83@gmail.com>\n" "Language-Team: chriszero\n" @@ -18,6 +18,21 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Virtaal 0.7.1\n" +msgid "Library" +msgstr "Bibliothek" + +msgid "No Plex Media Server found." +msgstr "Kein Plexmediaserver gefunden." + +msgid "Switch View" +msgstr "Ansicht wechseln" + +msgid "Unscrobble" +msgstr "Ungesehen" + +msgid "Scrobble" +msgstr "Gesehen" + msgid "Hide main menu entry" msgstr "Verstecke Hauptmenüeintrag" @@ -87,31 +102,16 @@ msgstr "" msgid "Current UUID" msgstr "Aktuelle UUID" -#, c-format -msgid "%s - Season %d" -msgstr "%s - Staffel %d" - -msgid "Library" -msgstr "Bibliothek" - -msgid "No Plex Media Server found." -msgstr "Kein Plexmediaserver gefunden." - -msgid "Switch View" -msgstr "Ansicht wechseln" - -msgid "Unscrobble" -msgstr "Ungesehen" - -msgid "Scrobble" -msgstr "Gesehen" - msgid "Play" msgstr "Wiedergeben" msgid "Rewind" msgstr "Anfang" +#, c-format +msgid "%s - Season %d" +msgstr "%s - Staffel %d" + msgid "Skip Back" msgstr "Vorspringen" |