Beatmup
Beatmup::DRM::ModeConnector Class Reference

#include <drm.hpp>

Public Member Functions

 ModeConnector ()
 
 ModeConnector (Device &device, ModeResources &resources)
 
 ~ModeConnector ()
 
ModeConnectoroperator= (ModeConnector &&other)
 
drmModeConnector * getPointer ()
 
const drmModeModeInfo & getMode (int index) const
 

Private Member Functions

 ModeConnector (const ModeConnector &)=delete
 

Private Attributes

drmModeConnector * connector
 

Detailed Description

Definition at line 96 of file drm.hpp.

Constructor & Destructor Documentation

◆ ModeConnector() [1/3]

Beatmup::DRM::ModeConnector::ModeConnector ( const ModeConnector )
privatedelete

◆ ModeConnector() [2/3]

Beatmup::DRM::ModeConnector::ModeConnector ( )
inline

Definition at line 101 of file drm.hpp.

101 : connector(nullptr) {}
drmModeConnector * connector
Definition: drm.hpp:99

◆ ModeConnector() [3/3]

Beatmup::DRM::ModeConnector::ModeConnector ( Device device,
ModeResources resources 
)
inline

Definition at line 103 of file drm.hpp.

103  : connector(nullptr) {
104  auto* resPtr = resources.getPointer();
105  for (int i = 0; i < resPtr->count_connectors; ++i) {
106  connector = drmModeGetConnector(device.getHandle(), resPtr->connectors[i]);
107  if (connector->connection == DRM_MODE_CONNECTED)
108  break;
109  }
110  if (!connector)
111  throw DRMError("Cannot get DRM connector");
112  }

◆ ~ModeConnector()

Beatmup::DRM::ModeConnector::~ModeConnector ( )
inline

Definition at line 114 of file drm.hpp.

114  {
115  if (connector)
116  drmModeFreeConnector(connector);
117  }

Member Function Documentation

◆ operator=()

ModeConnector& Beatmup::DRM::ModeConnector::operator= ( ModeConnector &&  other)
inline

Definition at line 119 of file drm.hpp.

119  {
120  connector = other.connector;
121  other.connector = nullptr;
122  return *this;
123  }

◆ getPointer()

drmModeConnector* Beatmup::DRM::ModeConnector::getPointer ( )
inline

Definition at line 125 of file drm.hpp.

125 { return connector; }

◆ getMode()

const drmModeModeInfo& Beatmup::DRM::ModeConnector::getMode ( int  index) const
inline

Definition at line 127 of file drm.hpp.

127 { return connector->modes[index]; }
jlong jint index

Member Data Documentation

◆ connector

drmModeConnector* Beatmup::DRM::ModeConnector::connector
private

Definition at line 99 of file drm.hpp.


The documentation for this class was generated from the following file: