AJA NTV2 SDK  18.1.0.2439
NTV2 SDK 18.1.0.2439
ntv2interrupts.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2card.h"
9 
10 
13 
14 
16 {
18 }
19 
21 {
22 #if defined(NTV2_NUB_CLIENT_SUPPORT)
23  if (IsRemote())
24  { NTV2ConfigureInterrupt msg(this);
25  return _pRPCAPI->NTV2MessageRemote(msg.doEnable(id)) && msg.isSuccess();
26  }
27 #endif// defined(NTV2_NUB_CLIENT_SUPPORT)
28  return ConfigureInterrupt (true, id);
29 }
30 
32 {
33  return NTV2_IS_VALID_CHANNEL(inChannel) && EnableInterrupt (gChannelToOutputInterrupt [inChannel]);
34 }
35 
37 {
38  return NTV2_IS_VALID_CHANNEL(inChannel) && EnableInterrupt (gChannelToInputInterrupt [inChannel]);
39 }
40 
41 bool CNTV2Card::EnableInputInterrupt (const NTV2ChannelSet & inFrameStores)
42 {
43  UWord failures(0);
44  for (NTV2ChannelSetConstIter it(inFrameStores.begin()); it != inFrameStores.end(); ++it)
45  if (!EnableInputInterrupt(*it))
46  failures++;
47  return failures == 0;
48 }
49 
51 {
53  return true; // Can't disable input/output interrupts
54 #if defined(NTV2_NUB_CLIENT_SUPPORT)
55  if (IsRemote())
56  { NTV2ConfigureInterrupt msg(this);
57  return _pRPCAPI->NTV2MessageRemote(msg.doDisable(id)) && msg.isSuccess();
58  }
59 #endif// defined(NTV2_NUB_CLIENT_SUPPORT)
60  return ConfigureInterrupt (false, id);
61 }
62 
64 {
65  return NTV2_IS_VALID_CHANNEL(inChannel) && DisableInterrupt (gChannelToOutputInterrupt [inChannel]);
66 }
67 
69 {
70  return NTV2_IS_VALID_CHANNEL(inChannel) && DisableInterrupt (gChannelToInputInterrupt [inChannel]);
71 }
72 
74 {
75  UWord failures(0);
76  for (NTV2ChannelSetConstIter it(inFrameStores.begin()); it != inFrameStores.end(); ++it)
77  if (!DisableInputInterrupt(*it))
78  failures++;
79  return failures == 0;
80 }
NTV2ChannelSet::const_iterator NTV2ChannelSetConstIter
A handy const iterator into an NTV2ChannelSet.
bool isSuccess(void) const
virtual bool DisableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Prevents the CNTV2Card instance from waiting for and responding to vertical blanking interrupts origi...
Configure interrupt (subscribe/unsubscribe, enable/disable, query subscribed interrupts, query enabled interrupts, etc.).
NTV2InterruptMask
Definition: ntv2enums.h:1532
virtual bool EnableInputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to input vertical blanking interrupts originati...
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1361
virtual bool EnableOutputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Allows the CNTV2Card instance to wait for and respond to output vertical blanking interrupts originat...
NTV2ConfigInterrupt & doEnable(const INTERRUPT_ENUMS id)
Enable given interruptID.
virtual bool IsRemote(void) const
virtual CNTV2DriverInterface & driverInterface(void)
Definition: ntv2card.h:6540
virtual bool EnableInterrupt(const INTERRUPT_ENUMS inEventCode)
virtual bool GetCurrentInterruptMasks(NTV2InterruptMask &mask1, NTV2Interrupt2Mask &mask2)
virtual bool NTV2MessageRemote(NTV2_HEADER *pInMessage)
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device...
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
#define NTV2_IS_OUTPUT_INTERRUPT(__e__)
static const INTERRUPT_ENUMS gChannelToInputInterrupt[]
#define NTV2_IS_VALID_CHANNEL(__x__)
Definition: ntv2enums.h:1375
std::set< NTV2Channel > NTV2ChannelSet
A set of distinct NTV2Channel values.
static const INTERRUPT_ENUMS gChannelToOutputInterrupt[]
NTV2ConfigInterrupt & doDisable(const INTERRUPT_ENUMS id)
Disable given interruptID.
uint16_t UWord
Definition: ajatypes.h:234
Declares the CNTV2Card class.
virtual bool ConfigureInterrupt(bool, INTERRUPT_ENUMS)
NTV2Interrupt2Mask
Definition: ntv2enums.h:1605
NTV2RPCAPI * _pRPCAPI
Points to remote or software device interface; otherwise NULL for local physical device.
#define NTV2_IS_INPUT_INTERRUPT(__e__)
virtual bool DisableOutputInterrupt(const NTV2Channel channel=NTV2_CHANNEL1)
Prevents the CNTV2Card instance from waiting for and responding to vertical blanking interrupts origi...
virtual bool DisableInterrupt(const INTERRUPT_ENUMS inEventCode)