diff options
Diffstat (limited to 'xbmc/network/upnp/UPnPPlayer.h')
-rw-r--r-- | xbmc/network/upnp/UPnPPlayer.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/xbmc/network/upnp/UPnPPlayer.h b/xbmc/network/upnp/UPnPPlayer.h new file mode 100644 index 0000000..aafd8c4 --- /dev/null +++ b/xbmc/network/upnp/UPnPPlayer.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2006 elupus (Joakim Plate) + * Copyright (C) 2006-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "cores/IPlayer.h" +#include "guilib/DispResource.h" +#include "threads/SystemClock.h" +#include "utils/logtypes.h" + +#include <string> + +class PLT_MediaController; + +namespace UPNP +{ + +class CUPnPPlayerController; + +class CUPnPPlayer + : public IPlayer, public IRenderLoop +{ +public: + CUPnPPlayer(IPlayerCallback& callback, const char* uuid); + ~CUPnPPlayer() override; + + bool OpenFile(const CFileItem& file, const CPlayerOptions& options) override; + bool QueueNextFile(const CFileItem &file) override; + bool CloseFile(bool reopen = false) override; + bool IsPlaying() const override; + void Pause() override; + bool HasVideo() const override { return false; } + bool HasAudio() const override { return false; } + void Seek(bool bPlus, bool bLargeStep, bool bChapterOverride) override; + void SeekPercentage(float fPercent = 0) override; + void SetVolume(float volume) override; + + int SeekChapter(int iChapter) override { return -1; } + + void SeekTime(int64_t iTime = 0) override; + void SetSpeed(float speed = 0) override; + + bool IsCaching() const override { return false; } + int GetCacheLevel() const override { return -1; } + void DoAudioWork() override; + bool OnAction(const CAction &action) override; + + void FrameMove() override; + + int PlayFile(const CFileItem& file, + const CPlayerOptions& options, + XbmcThreads::EndTime<>& timeout); + +private: + bool IsPaused() const; + int64_t GetTime(); + int64_t GetTotalTime(); + float GetPercentage(); + + PLT_MediaController* m_control; + CUPnPPlayerController* m_delegate; + std::string m_current_uri; + std::string m_current_meta; + bool m_started; + bool m_stopremote; + XbmcThreads::EndTime<> m_updateTimer; + + Logger m_logger; +}; + +} /* namespace UPNP */ |