C++/CLI Sample
Demonstrates how to create a C++/CLI library using the VideoXpert SDK
CPPCli::Monitor Class Reference

The Monitor class represents a display for view data (typically video). More...

#include <Monitor.h>

Public Types

enum  Layouts {
  Layouts::CellLayout1x1,
  Layouts::CellLayout1x2,
  Layouts::CellLayout2x1,
  Layouts::CellLayout2x2,
  Layouts::CellLayout2x3,
  Layouts::CellLayout3x2,
  Layouts::CellLayout3x3,
  Layouts::CellLayout4x3,
  Layouts::CellLayout4x4,
  Layouts::CellLayout1plus12,
  Layouts::CellLayout2plus8,
  Layouts::CellLayout3plus4,
  Layouts::CellLayout1plus5,
  Layouts::CellLayout1plus7,
  Layouts::CellLayout12plus1,
  Layouts::CellLayout8plus2,
  Layouts::CellLayout1plus4tall,
  Layouts::CellLayout1plus4wide
}
 Values that represent the layouts of a monitor. More...
 

Public Member Functions

 Monitor (VxSdk::IVxMonitor *vxMonitor)
 Constructor. More...
 
virtual ~Monitor ()
 Destructor. More...
 
 !Monitor ()
 Finaliser. More...
 
Results::Value Refresh ()
 Refreshes this instances properties. More...
 

Package Functions

System::Collections::Generic::List< MonitorCell^ >^ _GetMonitorCells ()
 
System::Collections::Generic::List< CPPCli::Monitor::Layouts >^ _GetAvailableLayouts ()
 
CPPCli::Device_GetHostDevice ()
 

Package Attributes

VxSdk::IVxMonitor_monitor
 

Properties

System::Collections::Generic::List< CPPCli::Monitor::Layouts >^ AvailableLayouts [get]
 Gets the layouts available for this monitor. More...
 
CPPCli::Device^  HostDevice [get]
 Gets the device that hosts this monitor. More...
 
System::String^  Id [get]
 Gets the unique monitor identifier. More...
 
Layouts Layout [get, set]
 Gets or sets the current layout for this monitor. More...
 
System::Collections::Generic::List< MonitorCell^ >^ MonitorCells [get]
 Gets the cells currently active on this monitor. More...
 
System::String^  Name [get, set]
 Gets or sets the friendly name of this monitor. More...
 
int Number [get, set]
 Gets or sets the number used to designate this monitor. More...
 

Detailed Description

The Monitor class represents a display for view data (typically video).

Definition at line 15 of file Monitor.h.

Member Enumeration Documentation

Values that represent the layouts of a monitor.

Enumerator
CellLayout1x1 

A 1x1 monitor layout.

CellLayout1x2 

A 1x2 monitor layout.

CellLayout2x1 

A 2x1 monitor layout.

CellLayout2x2 

A 2x2 monitor layout.

CellLayout2x3 

A 2x3 monitor layout.

CellLayout3x2 

A 3x2 monitor layout.

CellLayout3x3 

A 3x3 monitor layout.

CellLayout4x3 

A 4x3 monitor layout.

CellLayout4x4 

A 4x4 monitor layout.

CellLayout1plus12 

A 1 plus 12 monitor layout.

CellLayout2plus8 

A 2 plus 8 monitor layout.

CellLayout3plus4 

A 3 plus 4 monitor layout.

CellLayout1plus5 

A 1 plus 5 monitor layout.

CellLayout1plus7 

A 1 plus 7 monitor layout.

CellLayout12plus1 

A 12 plus 1 monitor layout.

CellLayout8plus2 

A 8 plus 2 monitor layout.

CellLayout1plus4tall 

A 1 plus 4 tall monitor layout.

CellLayout1plus4wide 

A 1 plus 4 wide monitor layout.

Definition at line 21 of file Monitor.h.

21  {
23  CellLayout1x1,
24 
26  CellLayout1x2,
27 
29  CellLayout2x1,
30 
32  CellLayout2x2,
33 
35  CellLayout2x3,
36 
38  CellLayout3x2,
39 
41  CellLayout3x3,
42 
44  CellLayout4x3,
45 
47  CellLayout4x4,
48 
50  CellLayout1plus12,
51 
53  CellLayout2plus8,
54 
56  CellLayout3plus4,
57 
59  CellLayout1plus5,
60 
62  CellLayout1plus7,
63 
65  CellLayout12plus1,
66 
68  CellLayout8plus2,
69 
71  CellLayout1plus4tall,
72 
74  CellLayout1plus4wide
75  };

Constructor & Destructor Documentation

CPPCli::Monitor::Monitor ( VxSdk::IVxMonitor vxMonitor)

Constructor.

Parameters
vxMonitorThe vx monitor.

Definition at line 10 of file Monitor.cpp.

10  {
11  _monitor = vxMonitor;
12 }
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170
virtual CPPCli::Monitor::~Monitor ( )
inlinevirtual

Destructor.

Definition at line 86 of file Monitor.h.

86  {
87  this->!Monitor();
88  }
Monitor(VxSdk::IVxMonitor *vxMonitor)
Constructor.
Definition: Monitor.cpp:10
CPPCli::Monitor::!Monitor ( )

Finaliser.

Definition at line 14 of file Monitor.cpp.

14  {
15  _monitor->Delete();
16  _monitor = nullptr;
17 }
virtual VxResult::Value Delete() const =0
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170

Member Function Documentation

List< CPPCli::Monitor::Layouts > CPPCli::Monitor::_GetAvailableLayouts ( )
package

Definition at line 59 of file Monitor.cpp.

59  {
60  // Create a list of managed layout objects
61  List<CPPCli::Monitor::Layouts>^ mlist = gcnew List<CPPCli::Monitor::Layouts>();
62  // Create a collection of unmanaged layout objects
64 
65  // Make the call, which will return with the total count of available layouts, this allows the client to allocate memory.
66  VxSdk::VxResult::Value result = _monitor->GetAvailableLayouts(availableLayouts);
67  // Unless there are no available layouts for the monitor, this should return VxSdk::VxResult::kInsufficientSize
68  if (result == VxSdk::VxResult::kInsufficientSize) {
69  // An array of pointers is allocated using the size returned by the previous GetAvailableLayouts call
70  availableLayouts.collection = new VxSdk::VxCellLayout::Value[availableLayouts.collectionSize];
71  result = _monitor->GetAvailableLayouts(availableLayouts);
72  // The result should now be kOK since we have allocated enough space
73  if (result == VxSdk::VxResult::kOK) {
74  for (int i = 0; i < availableLayouts.collectionSize; i++)
75  {
76  CPPCli::Monitor::Layouts limit = (CPPCli::Monitor::Layouts)availableLayouts.collection[i];
77  mlist->Add(limit);
78  }
79  }
80  // Remove the memory we previously allocated to the collection
81  delete[] availableLayouts.collection;
82  }
83  return mlist;
84 }
virtual VxResult::Value GetAvailableLayouts(VxCollection< VxCellLayout::Value * > &layoutCollection) const =0
Layouts
Values that represent the layouts of a monitor.
Definition: Monitor.h:21
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170
CPPCli::Device CPPCli::Monitor::_GetHostDevice ( )
package

Definition at line 23 of file Monitor.cpp.

23  {
24  // Get the device which hosts this monitor
25  VxSdk::IVxDevice* device = nullptr;
27 
28  // Return the device if GetHostDevice was successful
29  if (result == VxSdk::VxResult::kOK)
30  return gcnew Device(device);
31 
32  return nullptr;
33 }
virtual VxResult::Value GetHostDevice(IVxDevice *&hostDevice) const =0
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170
List< CPPCli::MonitorCell^ > CPPCli::Monitor::_GetMonitorCells ( )
package

Definition at line 35 of file Monitor.cpp.

35  {
36  // Create a list of managed monitor cell objects
37  List<MonitorCell^>^ mlist = gcnew List<MonitorCell^>();
38  // Create a collection of unmanaged monitor cell objects
40 
41  // Make the call, which will return with the total count of monitor cells, this allows the client to allocate memory.
42  VxSdk::VxResult::Value result = _monitor->GetMonitorCells(monitorCells);
43  // Unless there are no monitor cells on the monitor, this should return VxSdk::VxResult::kInsufficientSize
44  if (result == VxSdk::VxResult::kInsufficientSize) {
45  // An array of pointers is allocated using the size returned by the previous GetMonitorCells call
46  monitorCells.collection = new VxSdk::IVxMonitorCell*[monitorCells.collectionSize];
47  result = _monitor->GetMonitorCells(monitorCells);
48  // The result should now be kOK since we have allocated enough space
49  if (result == VxSdk::VxResult::kOK) {
50  for (int i = 0; i < monitorCells.collectionSize; i++)
51  mlist->Add(gcnew CPPCli::MonitorCell(monitorCells.collection[i]));
52  }
53  // Remove the memory we previously allocated to the collection
54  delete[] monitorCells.collection;
55  }
56  return mlist;
57 }
The MonitorCell class represents a single viewport, hosted on a monitor, that can play media from a d...
Definition: MonitorCell.h:13
virtual VxResult::Value GetMonitorCells(VxCollection< IVxMonitorCell ** > &cellCollection)=0
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170
CPPCli::Results::Value CPPCli::Monitor::Refresh ( )

Refreshes this instances properties.

Returns
The Result of updating the properties.

Definition at line 19 of file Monitor.cpp.

19  {
21 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
virtual VxResult::Value Refresh()=0
VxSdk::IVxMonitor * _monitor
Definition: Monitor.h:170

Member Data Documentation

VxSdk::IVxMonitor* CPPCli::Monitor::_monitor
package

Definition at line 170 of file Monitor.h.

Property Documentation

System:: Collections:: Generic:: List< CPPCli:: Monitor:: Layouts>^ CPPCli::Monitor::AvailableLayouts
get

Gets the layouts available for this monitor.

A List of the available layouts.

Definition at line 105 of file Monitor.h.

CPPCli:: Device^ CPPCli::Monitor::HostDevice
get

Gets the device that hosts this monitor.

The host device.

Definition at line 114 of file Monitor.h.

System:: String^ CPPCli::Monitor::Id
get

Gets the unique monitor identifier.

The unique identifier.

Definition at line 123 of file Monitor.h.

Layouts CPPCli::Monitor::Layout
getset

Gets or sets the current layout for this monitor.

The cell layout.

Definition at line 132 of file Monitor.h.

System:: Collections:: Generic:: List< MonitorCell^>^ CPPCli::Monitor::MonitorCells
get

Gets the cells currently active on this monitor.

A List of the currently active cells.

Definition at line 142 of file Monitor.h.

System:: String^ CPPCli::Monitor::Name
getset

Gets or sets the friendly name of this monitor.

The friendly name.

Definition at line 151 of file Monitor.h.

int CPPCli::Monitor::Number
getset

Gets or sets the number used to designate this monitor.

The monitor number.

Definition at line 163 of file Monitor.h.


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