MythTV master
mythnvcontrol.h
Go to the documentation of this file.
1#ifndef MYTHNVCONTROL_H
2#define MYTHNVCONTROL_H
3
4// MythTV
5#include "mythvrr.h"
6
7// Qt
8#include <QLibrary>
9
10// Std
11#include <tuple>
12#include <memory>
13
14// X headers always last
16
17using NVControl = std::shared_ptr<class MythNVControl>;
18using QueryTargetBinary = bool(*)(Display*,int,int,unsigned int,unsigned int, unsigned char**,int*);
19using QueryScreenAttrib = bool(*)(Display*,int,unsigned int,unsigned int,int*);
20using QueryTargetAttrib = bool(*)(Display*,int,int,unsigned int,unsigned int,int*);
21using SetAttribute = void(*)(Display*,int,unsigned int,unsigned int,int);
22
23class MythGSync : public MythVRR
24{
25 public:
26 static inline bool s_gsyncResetOnExit = false;
27 static inline bool s_gsyncDefaultValue = false;
28 static void ForceGSync(bool Enable);
30 ~MythGSync() override;
31 void SetEnabled(bool Enable = true) override;
32
33 protected:
36};
37
39{
40 public:
41 static NVControl Create();
43
44 int GetDisplayID() const;
45
46 protected:
47 MythNVControl(const QString& Path, MythXDisplay* MDisplay);
48 QLibrary m_lib;
49
50 public:
51 MythXDisplay* m_display { nullptr };
56};
57#endif
A device containing images (ie. USB stick, CD, storage group etc)
A wrapper around NVidia GSync support (when using X11 and a Display Port connection).
Definition: mythnvcontrol.h:24
MythGSync(NVControl Device, VRRType Type, bool Enabled, MythVRRRange Range)
void SetEnabled(bool Enable=true) override
static bool s_gsyncResetOnExit
Definition: mythnvcontrol.h:26
static MythVRRPtr CreateGSync(const NVControl &Device, MythVRRRange Range)
static bool s_gsyncDefaultValue
Definition: mythnvcontrol.h:27
~MythGSync() override
NVControl m_nvControl
Definition: mythnvcontrol.h:35
static void ForceGSync(bool Enable)
Enable or disable GSync before the main window is created.
A simple wrapper around libXNVCtrl - which is dynamically loaded on demand.
Definition: mythnvcontrol.h:39
static NVControl Create()
Create a valid instance of MythNVControl.
SetAttribute m_setAttrib
Definition: mythnvcontrol.h:55
QLibrary m_lib
Definition: mythnvcontrol.h:48
MythXDisplay * m_display
Definition: mythnvcontrol.h:51
MythNVControl(const QString &Path, MythXDisplay *MDisplay)
QueryTargetBinary m_queryBinary
Definition: mythnvcontrol.h:52
int GetDisplayID() const
QueryScreenAttrib m_queryScreen
Definition: mythnvcontrol.h:53
QueryTargetAttrib m_queryTarget
Definition: mythnvcontrol.h:54
VRRType
Definition: mythvrr.h:19
bool Enabled() const
Definition: mythvrr.cpp:107
std::tuple< int, int, bool > MythVRRRange
Definition: mythedid.h:19
std::shared_ptr< class MythNVControl > NVControl
Definition: mythnvcontrol.h:17
bool(*)(Display *, int, int, unsigned int, unsigned int, unsigned char **, int *) QueryTargetBinary
Definition: mythnvcontrol.h:18
bool(*)(Display *, int, int, unsigned int, unsigned int, int *) QueryTargetAttrib
Definition: mythnvcontrol.h:20
void(*)(Display *, int, unsigned int, unsigned int, int) SetAttribute
Definition: mythnvcontrol.h:21
bool(*)(Display *, int, unsigned int, unsigned int, int *) QueryScreenAttrib
Definition: mythnvcontrol.h:19
std::shared_ptr< class MythVRR > MythVRRPtr
Definition: mythvrr.h:12
bool
Definition: pxsup2dast.c:31