AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2registerexpert.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2REGEXPERT_H
9 #define NTV2REGEXPERT_H
10 
11 #include "ajaexport.h"
12 #include "ajatypes.h"
13 #include "ntv2enums.h"
14 #include "ntv2publicinterface.h"
15 #include "ntv2utils.h"
16 #include <string>
17 #include <iostream>
18 #include <vector>
19 #if defined (AJALinux)
20  #include <stdint.h>
21 #endif
22 
23 
24 // Streaming Helpers
25 #define YesNo(__x__) ((__x__) ? "Y" : "N")
26 #define OnOff(__x__) ((__x__) ? "On" : "Off")
27 #define SetNotset(__x__) ((__x__) ? "Set" : "Not Set")
28 #define EnabDisab(__x__) ((__x__) ? "Enabled" : "Disabled")
29 #define OddEven(__x__) ((__x__) ? "Odd" : "Even")
30 #define DisabEnab(__x__) ((__x__) ? "Disabled" : "Enabled")
31 #define ActInact(__x__) ((__x__) ? "Active" : "Inactive")
32 #define SuppNotsupp(__x__) ((__x__) ? "Supported" : "Unsupported")
33 #define PresNotPres(__x__) ((__x__) ? "Present" : "Not Present")
34 #define ThruDeviceOrBypassed(__x__) ((__x__) ? "Thru Device" : "Device Bypassed")
35 
36 
37 // Register classifier keys
38 #define kRegClass_NULL std::string ()
39 #define kRegClass_AES std::string ("kRegClass_AES")
40 #define kRegClass_Analog std::string ("kRegClass_Analog")
41 #define kRegClass_Anc std::string ("kRegClass_Anc")
42 #define kRegClass_Audio std::string ("kRegClass_Audio")
43 #define kRegClass_Channel1 std::string ("kRegClass_Channel1")
44 #define kRegClass_Channel2 std::string ("kRegClass_Channel2")
45 #define kRegClass_Channel3 std::string ("kRegClass_Channel3")
46 #define kRegClass_Channel4 std::string ("kRegClass_Channel4")
47 #define kRegClass_Channel5 std::string ("kRegClass_Channel5")
48 #define kRegClass_Channel6 std::string ("kRegClass_Channel6")
49 #define kRegClass_Channel7 std::string ("kRegClass_Channel7")
50 #define kRegClass_Channel8 std::string ("kRegClass_Channel8")
51 #define kRegClass_CSC std::string ("kRegClass_CSC")
52 #define kRegClass_DMA std::string ("kRegClass_DMA")
53 #define kRegClass_HDMI std::string ("kRegClass_HDMI")
54 #define kRegClass_HDR std::string ("kRegClass_HDR")
55 #define kRegClass_Input std::string ("kRegClass_Input")
56 #define kRegClass_Info std::string ("kRegClass_Info")
57 #define kRegClass_Interrupt std::string ("kRegClass_Interrupt")
58 #define kRegClass_IP std::string ("kRegClass_IP")
59 #define kRegClass_LUT std::string ("kRegClass_LUT")
60 #define kRegClass_Mixer std::string ("kRegClass_Mixer")
61 #define kRegClass_Output std::string ("kRegClass_Output")
62 #define kRegClass_ReadOnly std::string ("kRegClass_ReadOnly")
63 #define kRegClass_Routing std::string ("kRegClass_Routing")
64 #define kRegClass_SDIError std::string ("kRegClass_SDIError")
65 #define kRegClass_Serial std::string ("kRegClass_Serial")
66 #define kRegClass_Timecode std::string ("kRegClass_Timecode")
67 #define kRegClass_Timing std::string ("kRegClass_Timing")
68 #define kRegClass_Video std::string ("kRegClass_Video")
69 #define kRegClass_Virtual std::string ("kRegClass_Virtual")
70 #define kRegClass_VPID std::string ("kRegClass_VPID")
71 #define kRegClass_WriteOnly std::string ("kRegClass_WriteOnly")
72 #define kRegClass_XptROM std::string ("kRegClass_XptROM")
73 #define kRegClass_NTV4FrameStore std::string ("kRegClass_NTV4FrameStore")
74 
75 
76 #define kIncludeOtherRegs_None 0
77 #define kIncludeOtherRegs_VRegs 1 // Also include virtual regs
78 #define kIncludeOtherRegs_XptROM 2 // Also include crosspoint ROM regs
79 
80 
87 {
88  public:
93  static std::string GetDisplayName (const uint32_t inRegNum);
94 
102  static std::string GetDisplayValue (const uint32_t inRegNum, const uint32_t inRegValue, const NTV2DeviceID inDeviceID = DEVICE_ID_NOTFOUND);
103 
109  static bool IsRegisterInClass (const uint32_t inRegNum, const std::string & inClassName);
110 
115  static inline bool IsReadOnly (const uint32_t inRegNum) {return IsRegisterInClass (inRegNum, kRegClass_ReadOnly);}
116 
121  static inline bool IsWriteOnly (const uint32_t inRegNum) {return IsRegisterInClass (inRegNum, kRegClass_WriteOnly);}
122 
126  static NTV2StringSet GetAllRegisterClasses (void);
127 
131  static NTV2StringSet GetRegisterClasses (const uint32_t inRegNum, const bool inRemovePrefix = false);
132 
137  static NTV2RegNumSet GetRegistersForClass (const std::string & inClassName);
138 
144  static NTV2RegNumSet GetRegistersForChannel (const NTV2Channel inChannel);
145 
154  static NTV2RegNumSet GetRegistersForDevice (const NTV2DeviceID inDeviceID, const int inOtherRegsToInclude = kIncludeOtherRegs_None);
155 
164  static NTV2RegNumSet GetRegistersWithName (const std::string & inName, const int inSearchStyle = EXACTMATCH);
165 
175  static NTV2InputCrosspointID GetInputCrosspointID (const uint32_t inXptRegNum, const uint32_t inMaskIndex);
176 
184  static bool GetCrosspointSelectGroupRegisterInfo (const NTV2InputCrosspointID inInputXpt, uint32_t & outXptRegNum, uint32_t & outMaskIndex);
185 
186  static const int CONTAINS = 0;
187  static const int STARTSWITH = 1;
188  static const int ENDSWITH = 2;
189  static const int EXACTMATCH = 3;
190  static bool IsAllocated(void);
191 
198  static bool Allocate(void);
199 
206  static bool Deallocate(void);
207 
208 }; // CNTV2RegisterExpert
209 
210 #endif // NTV2REGEXPERT_H
CNTV2RegisterExpert::IsReadOnly
static bool IsReadOnly(const uint32_t inRegNum)
Definition: ntv2registerexpert.h:115
ajaexport.h
Defines the import/export macros for producing DLLs or LIBs.
kIncludeOtherRegs_None
#define kIncludeOtherRegs_None
Definition: ntv2registerexpert.h:76
NTV2StringSet
std::set< std::string > NTV2StringSet
Definition: ntv2utils.h:1137
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
Definition: ntv2enums.h:1305
NTV2DeviceID
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
Definition: ntv2enums.h:20
kRegClass_WriteOnly
#define kRegClass_WriteOnly
Definition: ntv2registerexpert.h:71
CNTV2RegisterExpert::IsWriteOnly
static bool IsWriteOnly(const uint32_t inRegNum)
Definition: ntv2registerexpert.h:121
ajatypes.h
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
NTV2RegNumSet
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
Definition: ntv2publicinterface.h:7327
ntv2enums.h
Enumerations for controlling NTV2 devices.
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2InputCrosspointID
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget's output (...
Definition: ntv2enums.h:2685
kRegClass_ReadOnly
#define kRegClass_ReadOnly
Definition: ntv2registerexpert.h:62
CNTV2RegisterExpert
I provide "one-stop shopping" for information about registers and their values.
Definition: ntv2registerexpert.h:86
AJAExport
#define AJAExport
Definition: export.h:33
ntv2publicinterface.h
Declares enums and structs used by all platform drivers and the SDK.
DEVICE_ID_NOTFOUND
@ DEVICE_ID_NOTFOUND
Invalid or "not found".
Definition: ntv2enums.h:90