| 1 |
/* |
| 2 |
* Copyright (C) 2010-2021 Team Kodi (https://kodi.tv) |
| 3 |
* Copyright (C) 2010 Alwin Esch (Team Kodi) |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSE.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "Channels.h" |
| 12 |
#include "ClientInstance.h" |
| 13 |
|
| 14 |
#include <kodi/gui/ListItem.h> |
| 15 |
#include <kodi/gui/Window.h> |
| 16 |
#include <kodi/gui/controls/RadioButton.h> |
| 17 |
#include <kodi/gui/controls/Rendering.h> |
| 18 |
#include <kodi/gui/controls/Spin.h> |
| 19 |
|
| 20 |
class cOSDRender; |
| 21 |
|
| 22 |
class ATTR_DLL_LOCAL cVNSIAdmin : public cVNSISession, public kodi::gui::CWindow |
| 23 |
{ |
| 24 |
public: |
| 25 |
cVNSIAdmin(kodi::addon::CInstancePVRClient& instance); |
| 26 |
~cVNSIAdmin() = default; |
| 27 |
|
| 28 |
bool Open(const std::string& hostname, |
| 29 |
int port, |
| 30 |
const std::string& mac, |
| 31 |
const char* name = "XBMC osd client"); |
| 32 |
|
| 33 |
bool OnInit() override; |
| 34 |
bool OnFocus(int controlId) override; |
| 35 |
bool OnClick(int controlId) override; |
| 36 |
bool OnAction(ADDON_ACTION actionId) override; |
| 37 |
|
| 38 |
bool Create(int x, int y, int w, int h, void* device); |
| 39 |
void Render(); |
| 40 |
void Stop(); |
| 41 |
bool Dirty(); |
| 42 |
|
| 43 |
static bool CreateCB(kodi::gui::ClientHandle cbhdl, int x, int y, int w, int h, void* device); |
| 44 |
static void RenderCB(kodi::gui::ClientHandle cbhdl); |
| 45 |
static void StopCB(kodi::gui::ClientHandle cbhdl); |
| 46 |
static bool DirtyCB(kodi::gui::ClientHandle cbhdl); |
| 47 |
|
| 48 |
private: |
| 49 |
bool OnResponsePacket(cResponsePacket* resp); |
| 50 |
bool ConnectOSD(); |
| 51 |
bool IsVdrAction(int action); |
| 52 |
bool ReadChannelList(bool radio); |
| 53 |
bool ReadChannelWhitelist(bool radio); |
| 54 |
bool ReadChannelBlacklist(bool radio); |
| 55 |
bool SaveChannelWhitelist(bool radio); |
| 56 |
bool SaveChannelBlacklist(bool radio); |
| 57 |
void ClearListItems(); |
| 58 |
void LoadListItemsProviders(); |
| 59 |
void LoadListItemsChannels(); |
| 60 |
|
| 61 |
kodi::gui::controls::CRendering m_renderControl; |
| 62 |
kodi::gui::controls::CSpin m_spinTimeshiftMode; |
| 63 |
kodi::gui::controls::CSpin m_spinTimeshiftBufferRam; |
| 64 |
kodi::gui::controls::CSpin m_spinTimeshiftBufferFile; |
| 65 |
kodi::gui::controls::CRadioButton m_ratioIsRadio; |
| 66 |
std::vector<std::shared_ptr<kodi::gui::CListItem>> m_listItems; |
| 67 |
|
| 68 |
CVNSIChannels m_channels; |
| 69 |
bool m_bIsOsdControl; |
| 70 |
bool m_bIsOsdDirty = false; |
| 71 |
int m_width, m_height; |
| 72 |
int m_osdWidth, m_osdHeight; |
| 73 |
cOSDRender* m_osdRender = nullptr; |
| 74 |
std::string m_wolMac; |
| 75 |
}; |