15 #pragma warning(disable: 4800) 21 #define AUDFAIL(__x__) AJA_sERROR (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 22 #define AUDWARN(__x__) AJA_sWARNING(AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 23 #define AUDNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 24 #define AUDINFO(__x__) AJA_sINFO (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 25 #define AUDDBUG(__x__) AJA_sDEBUG (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 150 if (regAudControl == 0)
152 else if (inNumChannels == 6 || inNumChannels == 8)
160 else if (inNumChannels == 16)
172 size_t numFailures(0);
174 if (!SetNumberAudioChannels (inNumChannels, *it))
176 return numFailures == 0;
186 if (regAudControl == 0)
236 if ((rateLow == 0) && (rateHigh == 0))
238 else if ((rateLow == 1) && (rateHigh == 0))
240 else if ((rateLow == 0) && (rateHigh == 1))
260 size_t numFailures(0);
262 if (!SetAudioBufferSize (inMode, *it))
264 return numFailures == 0;
313 size_t numFailures(0);
315 if (!SetAudioLoopBack (inMode, *it))
317 return numFailures == 0;
357 switch (inAudioInput)
367 default:
return false;
390 ULWord sparse1(0), sparse2(0);
393 if (!sparse1 && !sparse2)
395 else if (sparse1 && !sparse2)
397 else if (!sparse1 && sparse2)
399 else if (sparse1 && sparse2)
436 if (!GetAudioBufferSize (bufferSize, inAudioSystem))
452 if (!GetAudioBufferSize (bufferSize, inAudioSystem))
479 #if !defined(NTV2_DEPRECATE_16_0) 482 #endif // !defined(NTV2_DEPRECATE_16_0) 490 static const ULWord sAudioSourceToRegValues [] = { 0x1,
499 sAudioSourceToRegValues [inAudioSource],
504 if (SetEmbeddedAudioInput (inEmbeddedSource, inAudioSystem))
528 switch (regValue & 0x0000000F)
535 default:
return false;
539 GetEmbeddedAudioInput(outEmbeddedSource, inAudioSystem);
648 vector<uint32_t> & outLevels)
660 if (inChannelPairs.empty())
663 chanPairs.insert(chPr);
666 chanPairs = inChannelPairs;
670 std::set<ULWord> regsToRead;
676 uint32_t regNum(gAudMxrMainOutLvlRegs[chanPair]);
677 regsToRead.insert(regNum);
679 for (std::set<ULWord>::const_iterator it(regsToRead.begin()); it != regsToRead.end(); ++it)
683 const bool result(ReadRegisters(regs));
687 ULWord rawLevels(it->IsValid() ? it->registerValue : 0);
692 while (outLevels.size() < chanPairs.size() * 2)
693 outLevels.push_back(0);
720 unsigned long ulongvalue(0);
761 vector<uint32_t> & outLevels)
775 if (inChannelPairs.empty())
781 chanPairs.insert(chPr);
784 chanPairs = inChannelPairs;
788 std::set<ULWord> regsToRead;
794 uint32_t regNum(gAudMxrMainInLvlRegs[chanPair]);
803 regsToRead.insert(regNum);
805 for (std::set<ULWord>::const_iterator it(regsToRead.begin()); it != regsToRead.end(); ++it)
809 const bool result(ReadRegisters(regs));
813 ULWord rawLevels(it->IsValid() ? it->registerValue : 0);
818 while (outLevels.size() < chanPairs.size() * 2)
819 outLevels.push_back(0);
828 outSampleCount = 1 << outSampleCount;
836 if (inSampleCount > 0x00008000)
838 ULWord result(0), sampleCount(inSampleCount);
839 while (sampleCount >>= 1)
850 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
861 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
878 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
880 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
884 ULWord channelSelect =
static_cast<ULWord>(inValue) % 4;
892 const ULWord encoding ((
ULWord (inAudioSystem) << 4) | inValue);
906 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
908 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
911 ULWord engineSelect (0), channelSelect(0), bankSelect(0);
945 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
947 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
977 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
979 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
982 ULWord engineSelect (0), channelSelect(0);
1002 outAudioSystem = static_cast <
NTV2AudioSystem> ((encoding & 0xC) >> 2);
1013 if (!GetHDMIOutInputControlRegNum(reg, inWhichHDMIOut))
1024 if (!GetHDMIOutInputControlRegNum(reg, inWhichHDMIOut))
1035 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
1046 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
1059 const ULWord encoding ((
ULWord(inAudioSystem) << 4) | inChannelPair);
1097 for (
size_t ndx(0); ndx < badRgns.size(); ndx++)
1098 {
const ULWord rgnInfo(badRgns.at(ndx));
1099 const UWord startBlk(rgnInfo >> 16), numBlks(
UWord(rgnInfo & 0x0000FFFF));
1102 const string infoStr (
aja::join(tags,
", "));
1103 ostringstream acLabel; acLabel <<
"Aud" <<
DEC(inAudioSystem+1);
1104 if (infoStr.find(acLabel.str()) != string::npos)
1105 { ostringstream warning;
1107 warning <<
"8MB Frms " <<
DEC0N(startBlk,3) <<
"-" <<
DEC0N(startBlk+numBlks-1,3);
1109 warning <<
"8MB Frm " <<
DEC0N(startBlk,3);
1110 AUDWARN(
"Aud" <<
DEC(inAudioSystem+1) <<
" memory overlap/interference: " << warning.str() <<
": " << infoStr);
1125 bool isStopped (
true);
1130 outIsRunning = !isStopped;
1186 for (
size_t ndx(0); ndx < badRgns.size(); ndx++)
1187 {
const ULWord rgnInfo(badRgns.at(ndx));
1188 const UWord startBlk(rgnInfo >> 16), numBlks(
UWord(rgnInfo & 0x0000FFFF));
1191 const string infoStr (
aja::join(tags,
", "));
1192 ostringstream acLabel; acLabel <<
"Aud" <<
DEC(inAudioSystem+1);
1193 if (infoStr.find(acLabel.str()) != string::npos)
1194 { ostringstream warning;
1196 warning <<
"8MB Frms " <<
DEC0N(startBlk,3) <<
"-" <<
DEC0N(startBlk+numBlks-1,3);
1198 warning <<
"8MB Frm " <<
DEC0N(startBlk,3);
1199 AUDWARN(
"Aud" <<
DEC(inAudioSystem+1) <<
" memory overlap/interference: " << warning.str() <<
": " << infoStr);
1216 bool isStopped (
true);
1221 outIsRunning = !isStopped;
1324 const bool isNonPCM (inNonPCMChannelPairs.find (chanPair) != inNonPCMChannelPairs.end ());
1349 ULWord numAudioChannels (0);
1350 bool isNonPCM (
false);
1352 outNonPCMChannelPairs.clear ();
1355 if (!GetNumberAudioChannels (numAudioChannels, inAudioSystem))
1359 if (!GetAudioPCMControl (inAudioSystem, isNonPCM))
1364 for (
UWord chPair (0); chPair <= maxPair; chPair++)
1375 if (regVal &
BIT(inAudioSystem * 8 + chanPair))
1376 outNonPCMChannelPairs.insert (chanPair);
1395 outIsPresent =
false;
1396 if (!GetDetectedAudioChannelPairs (inAudioSystem, activeChannelPairs))
1398 if (activeChannelPairs.find (inChannelPair) != activeChannelPairs.end ())
1399 outIsPresent =
true;
1406 outDetectedChannelPairs.clear ();
1416 if (detectBits &
BIT(bitGroup * 8 + chanPair))
1417 outDetectedChannelPairs.insert (chanPair);
1424 uint32_t valLo8(0), valHi8(0);
1425 outDetectedChannelPairs.clear ();
1433 const uint32_t detectBits (((valLo8 >> 24) & 0x0000000F) | ((valHi8 >> 24) & 0x000000F0));
1435 if (!(detectBits &
BIT(chPair)))
1436 outDetectedChannelPairs.insert(chPair);
1491 const ULWord maxNumAudioChannelsForQuad ((inAESAudioChannels + 1) * 4);
1496 if (numAESAudioOutputChannels < 4)
1498 if (maxNumAudioChannelsForQuad > numAESAudioOutputChannels)
1530 if (inBitMask &
BIT (channelPair))
1531 result.insert (channelPair);
1532 if (inExtendedBitMask)
1534 if (inExtendedBitMask &
BIT (channelPair))
1535 result.insert (channelPair);
1551 if (!GetInputAudioChannelPairsWithPCM (inSDIInputChannel, withPCMs))
1554 outHasPCM = withPCMs.find (inAudioChannelPair) != withPCMs.end ();
1561 outPCMPairs.clear ();
1571 const bool isExtended (numChannels > 16);
1575 if (!ReadRegister (regNum, mask))
1578 if (!ReadRegister (regNum + 1, extMask))
1589 outNonPCMPairs.clear ();
1599 const bool isExtended (numChannels > 16);
1603 if (!ReadRegister (regNum, mask))
1606 if (!ReadRegister (regNum + 1, extMask))
1625 outIsEnabled =
true;
1636 outIsEnabled = value ?
false :
true;
1655 outEraseModeEnabled =
false;
1691 outXmitEnabled =
false;
1701 outXmitEnabled = !outXmitEnabled;
1720 #if !defined(NTV2_DEPRECATE_16_1) 1731 bool xlr14Xmit(
false), xlr58Xmit(
false);
1736 if (xlr14Xmit && xlr58Xmit)
1738 else if (xlr14Xmit && !xlr58Xmit)
1740 else if (!xlr14Xmit && xlr58Xmit)
1746 #endif // !defined(NTV2_DEPRECATE_16_1) 1757 outAESSyncModeBitSet = regValue ?
true :
false;
1786 outAbsByteOffset = 0;
1793 const ULWord EIGHT_MEGABYTES (0x800000);
1795 const ULWord engineOffset (memSize - EIGHT_MEGABYTES *
ULWord(inAudioSystem+1));
1796 outAbsByteOffset = inOffsetBytes + engineOffset;
1802 if (!GetFrameGeometry (fg,
NTV2Channel(inAudioSystem)) || !GetFrameBufferFormat (
NTV2Channel(inAudioSystem), fbf))
1809 if (inCaptureBuffer)
1810 {
ULWord rdBufOffset(0x400000);
1811 GetAudioReadOffset (rdBufOffset, inAudioSystem);
1812 outAbsByteOffset += rdBufOffset;
1818 #pragma warning(default: 4800)
virtual bool GetAudioPCMControl(const NTV2AudioSystem inAudioSystem, bool &outIsNonPCM)
Answers whether or not all outgoing audio channel pairs are currently being flagged as non-PCM for th...
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
This selects the Audio Mixer's 1st Auxiliary input.
virtual bool GetAudioWrapAddress(ULWord &outWrapAddress, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the wrap address, the threshold at which input/record or out...
virtual bool GetAudioOutputPause(const NTV2AudioSystem inAudioSystem, bool &outIsPaused)
Answers if the device's Audio System is currently paused or not.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
virtual bool SetAudioAnalogLevel(const NTV2AudioLevel value, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
virtual bool GetHDMIOutAudioRate(NTV2AudioRate &outValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Answers with the HDMI output's current audio rate.
virtual bool SetMultiLinkAudioMode(const NTV2AudioSystem inAudioSystem, const bool inEnable)
Sets the multi-link audio mode for the given audio system.
bool GetBadRegions(ULWordSequence &outBlks) const
Answers with the list of colliding and illegal memory regions.
virtual bool SetHDMIOutAudioSource2Channel(const NTV2AudioChannelPair inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output's 2-channel audio source.
virtual bool GetAudioLoopBack(NTV2AudioLoopBack &outMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers if NTV2AudioLoopBack mode is currently on or off for the given NTV2AudioSystem.
virtual bool SetAudioLoopBack(const NTV2AudioLoopBack inMode, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Enables or disables NTV2AudioLoopBack mode for the given NTV2AudioSystem.
virtual bool GetDetectedAESChannelPairs(NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which AES/EBU audio channel pairs are present on the device.
static const ULWord gAudioPlayCaptureModeMasks[]
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
This selects audio channels 5 thru 8.
#define DEC0N(__x__, __n__)
virtual bool EnableBOBAnalogAudioIn(bool inEnable)
Enables breakout board analog audio XLR inputs.
virtual bool GetAudioMixerInputLevels(const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelPairs &inChannelPairs, std::vector< uint32_t > &outLevels)
Answers with the Audio Mixer's current audio input levels.
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
The number of AES/EBU audio output channels on the device.
PCM_CONTROL_INFO(ULWord regNum, ULWord mask, ULWord shift)
virtual bool GetAudioOutputAESSyncModeBit(const NTV2AudioSystem inAudioSystem, bool &outAESSyncModeBitSet)
Answers with the current state of the AES Sync Mode bit for the given Audio System's output...
Obtain audio samples from the device AES inputs, if available.
virtual bool GetHDMIOutAudioChannels(NTV2HDMIAudioChannels &outValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Answers with the audio channel count for the given HDMI output (2 or 8).
bool AssessDevice(CNTV2Card &inDevice, const bool inIgnoreStoppedAudioBuffers=(0))
Assesses the given device.
Declares the AJADebug class.
static const ULWord sAudioDetectRegs[]
Obtain audio samples from the device HDMI input, if available.
virtual bool GetAudioInputDelay(const NTV2AudioSystem inAudioSystem, ULWord &outDelay)
Answers with the audio input delay for the given Audio System on the device.
virtual bool SetAudioCaptureEnable(const NTV2AudioSystem inAudioSystem, const bool inEnable)
Enables or disables the writing of incoming audio into the given Audio System's capture buffer...
virtual bool SetAudioMixerOutputChannelsMute(const NTV2AudioChannelsMuted16 inMutes)
Mutes or enables the individual output audio channels of the Audio Mixer.
Audits an NTV2 device's SDRAM utilization, and can report contiguous regions of SDRAM, whether unused/free, those being read/written by AutoCirculate, those being read/written by non-AutoCirculating FrameStores, those that are in conflict (AutoCirculate, FrameStore and/or Audio collisions), plus invalid/out-of-bounds regions being accessed.
The number of independent Audio Systems on the device.
virtual bool SetAudioOutputEraseMode(const NTV2AudioSystem inAudioSystem, const bool &inEraseModeEnabled)
Enables or disables output erase mode for the given Audio System, which, when enabled, automatically writes zeroes into the audio output buffer behind the output read head.
virtual bool GetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, NTV2AudioSource &outAudioSource, NTV2EmbeddedAudioInput &outEmbeddedSource)
Answers with the device's current NTV2AudioSource (and also possibly its NTV2EmbeddedAudioInput) for ...
static const ULWord kAudCtrlRegsForSDIOutputs[]
virtual bool GetHDMIOutAudioSource2Channel(NTV2AudioChannelPair &outValue, NTV2AudioSystem &outAudioSystem, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Answers with the HDMI output's current 2-channel audio source.
virtual bool GetAudioRate(NTV2AudioRate &outRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current NTV2AudioRate for the given Audio System.
virtual bool GetEncodedAudioMode(NTV2EncodedAudioMode &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
True if device can detect which audio channel pairs are not carrying PCM (Pulse Code Modulation) audi...
virtual bool GetAudioMixerOutputGain(ULWord &outGainValue)
Answers with the current gain setting for the Audio Mixer's output.
virtual bool ReadAudioSource(ULWord &outValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
virtual bool SetAudioOutputDelay(const NTV2AudioSystem inAudioSystem, const ULWord inDelay)
Sets the audio output delay for the given Audio System on the device.
virtual bool SetAudioOutputMonitorSource(const NTV2AudioChannelPair inChannelPair, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the audio monitor output source to a specified audio system and channel pair. The audio output monitor is typically a pair of RCA jacks (white + red) and/or a headphone jack.
virtual bool GetInputAudioChannelPairsWithoutPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
std::bitset< 16 > NTV2AudioChannelsMuted16
Per-audio-channel mute state for up to 16 audio channels.
Obtain audio samples from the audio that's embedded in the video HANC.
NTV2EmbeddedAudioClock
This enum value determines/states the device audio clock reference source. It was important to set th...
#define NTV2_IS_EXTENDED_AUDIO_CHANNEL_PAIR(__p__)
True if device has SFP connectors.
#define NTV2_IS_VALID_AUDIO_CHANNEL_OCTET(__p__)
This selects audio channels 9 thru 16.
static const ULWord gAudioRateHighShift[]
virtual bool GetAudioOutputDelay(const NTV2AudioSystem inAudioSystem, ULWord &outDelay)
Answers with the audio output delay for the given Audio System on the device.
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
virtual bool SetAudioRate(const NTV2AudioRate inRate, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2AudioRate for the given Audio System.
virtual bool IsAudioInputRunning(const NTV2AudioSystem inAudioSystem, bool &outIsRunning)
Answers whether or not the capture side of the given NTV2AudioSystem is currently running...
virtual bool IsAudioChannelPairPresent(const NTV2AudioSystem inAudioSystem, const NTV2AudioChannelPair inChannelPair, bool &outIsPresent)
Answers whether or not the given NTV2AudioChannelPair in the given NTV2AudioSystem on the device is p...
Declares common audio macros and structs used in the SDK.
static const ULWord sAudioMixerInputMuteShifts[]
#define NTV2_IS_AUDIO_MIXER_CHANNELS_1_OR_2(__p__)
Embeds SDI input source audio into the data stream.
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
True if Audio System(s) support an adjustable delay.
True if device supports an AJA breakout board. (New in SDK 17.0)
virtual bool SetAnalogAudioIOConfiguration(const NTV2AnalogAudioIO inConfig)
std::set< NTV2AudioChannelPair > NTV2AudioChannelPairs
A set of distinct NTV2AudioChannelPair values.
virtual bool SetHDMIOutAudioChannels(const NTV2HDMIAudioChannels inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the audio channel count to use for the given HDMI output.
static const ULWord sAudioMixerInputMuteMasks[]
This identifies the 5th Audio System.
True if device supports grouped audio system control.
virtual bool SetAudioMixerOutputGain(const ULWord inGainValue)
Sets the gain for the output of the Audio Mixer.
virtual bool StartAudioOutput(const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI=(0))
Starts the playout side of the given NTV2AudioSystem, reading outgoing audio samples from the Audio S...
#define NTV2_ASSERT(_expr_)
The number of SDI video outputs on the device.
#define NTV2_AUDIO_WRAPADDRESS
Obtain audio samples from the device analog input(s), if available.
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
This selects audio channels 15 and 16 (Group 4 channels 3 and 4)
The total number of audio systems on the device, including host audio and mixer audio systems...
True if device can mark specific audio channel pairs as not carrying PCM (Pulse Code Modulation) audi...
virtual bool SetAudioPlayCaptureModeEnable(const NTV2AudioSystem inAudioSystem, const bool inEnable)
Enables or disables a special mode for the given Audio System whereby its embedder and deembedder bot...
virtual bool SetAudioSystemInputSource(const NTV2AudioSystem inAudioSystem, const NTV2AudioSource inAudioSource, const NTV2EmbeddedAudioInput inEmbeddedInput)
Sets the audio source for the given NTV2AudioSystem on the device.
virtual bool SetHDMIOutAudioRate(const NTV2AudioRate inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output's audio rate.
This selects audio channels 1 thru 8.
static const unsigned sAudioDetectGroups[]
virtual bool GetAudioMixerOutputLevels(const NTV2AudioChannelPairs &inChannelPairs, std::vector< uint32_t > &outLevels)
Answers with the Audio Mixer's current audio output levels.
virtual bool IsAudioOutputRunning(const NTV2AudioSystem inAudioSystem, bool &outIsRunning)
Answers whether or not the playout side of the given NTV2AudioSystem is currently running...
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
virtual bool SetAudioMixerInputChannelSelect(const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelPair inChannelPair)
Specifies the Audio Channel Pair that will drive the given input of the Audio Mixer.
virtual bool GetAudioMixerInputChannelSelect(const NTV2AudioMixerInput inMixerInput, NTV2AudioChannelPair &outChannelPair)
Answers with the Audio Channel Pair that's currently driving the given input of the Audio Mixer...
virtual bool GetAudioMixerOutputChannelsMute(NTV2AudioChannelsMuted16 &outMutes)
Answers with a std::bitset that indicates which output audio channels of the Audio Mixer are currentl...
virtual bool GetAudioCaptureEnable(const NTV2AudioSystem inAudioSystem, bool &outEnable)
Answers whether or not the Audio System is configured to write captured audio samples into device aud...
virtual bool GetAudioAnalogLevel(NTV2AudioLevel &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
static const ULWord gChannelToAudioOutLastAddrRegNum[]
True if device has attached breakout board. (New in SDK 17.0)
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...
virtual bool StartAudioInput(const NTV2AudioSystem inAudioSystem, const bool inWaitForVBI=(0))
Starts the capture side of the given NTV2AudioSystem, writing incoming audio samples into the Audio S...
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
virtual bool GetHDMIOutAudioFormat(NTV2AudioFormat &outValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Answers with the HDMI output's current audio format.
This selects audio channels 1 thru 4.
#define NTV2_IS_AUDIO_MIXER_INPUT_MAIN(__p__)
This selects audio channels 1 and 2 (Group 1 channels 1 and 2)
True if device uses a "stacked" arrangement of its audio buffers.
This selects audio channels 9 thru 12.
virtual bool GetHDMIOutAudioSource8Channel(NTV2Audio8ChannelSelect &outValue, NTV2AudioSystem &outAudioSystem, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Answers with the HDMI output's current 8-channel audio source.
NTV2AudioChannelPair
Identifies a pair of audio channels.
virtual bool GetAnalogAudioIOConfiguration(NTV2AnalogAudioIO &outConfig)
virtual bool ReadAudioLastIn(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset to the last byte of the latest chunk of 4-by...
virtual bool SetEmbeddedAudioInput(const NTV2EmbeddedAudioInput inEmbeddedSource, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the embedded (SDI) audio source for the given NTV2AudioSystem on the device. ...
NTV2RegWrites NTV2RegisterReads
virtual bool GetAudioOutputMonitorSource(NTV2AudioChannelPair &outChannelPair, NTV2AudioSystem &outAudioSystem)
Answers with the current audio monitor source. The audio output monitor is typically a pair of RCA ja...
virtual bool GetAudioOutputEraseMode(const NTV2AudioSystem inAudioSystem, bool &outEraseModeEnabled)
Answers with the current state of the audio output erase mode for the given Audio System...
virtual bool InputAudioChannelPairHasPCM(const NTV2Channel inSDIInputConnector, const NTV2AudioChannelPair inAudioChannelPair, bool &outIsPCM)
For the given SDI input (specified as a channel number), answers if the specified audio channel pair ...
The maximum number of audio channels that a single Audio System can support on the device...
std::set< NTV2AudioSystem > NTV2AudioSystemSet
A set of distinct NTV2AudioSystem values. New in SDK 16.2.
virtual bool GetAudioBufferSize(NTV2AudioBufferSize &outSize, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Retrieves the size of the input or output audio buffer being used for a given Audio System on the AJA...
static const ULWord gAudioRateHighMask[]
#define NTV2_AUDIO_WRAPADDRESS_BIG
static const ULWord sAudioMixerInputGainCh1Regs[]
virtual bool WriteAudioSource(const ULWord inValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
virtual bool SetAudio20BitMode(const NTV2AudioSystem inAudioSystem, const bool inEnable)
Enables or disables 20-bit mode for the NTV2AudioSystem.
virtual bool GetRawAudioTimer(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers with the current value of the 48kHz audio clock counter.
virtual bool GetAnalogAudioTransmitEnable(const NTV2Audio4ChannelSelect inChannelQuad, bool &outEnabled)
Answers whether or not the specified bidirectional XLR audio connectors are collectively acting as in...
virtual bool GetDetectedAudioChannelPairs(const NTV2AudioSystem inAudioSystem, NTV2AudioChannelPairs &outDetectedChannelPairs)
Answers which audio channel pairs are present in the given Audio System's input stream.
virtual bool GetAudioPlayCaptureModeEnable(const NTV2AudioSystem inAudioSystem, bool &outEnable)
Answers whether or not the device's Audio System is currently operating in a special mode in which it...
ULWord NTV2DeviceGetNumberFrameBuffers(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
virtual bool GetAESOutputSource(const NTV2Audio4ChannelSelect inAESAudioChannels, NTV2AudioSystem &outSrcAudioSystem, NTV2Audio4ChannelSelect &outSrcAudioChannels)
Answers with the current audio source for a given quad of AES audio output channels. By default, at power-up, for AJA devices that support AES audio output, the content of AES audio output channels 1/2/3/4 reflect what's being output from audio channels 1/2/3/4 from NTV2_AUDIOSYSTEM_1, likewise with audio channels 5/6/7/8, etc.
#define NTV2_IS_VALID_AUDIO_LOOPBACK(_x_)
static const ULWord gAudioPlayCaptureModeShifts[]
#define NTV2_IS_VALID_AUDIO_MIXER_INPUT(__p__)
#define NTV2_IS_VALID_CHANNEL(__x__)
virtual bool SetEncodedAudioMode(const NTV2EncodedAudioMode value, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
virtual bool GetAudioMixerLevelsSampleCount(ULWord &outSampleCount)
Answers with the Audio Mixer's current sample count used for measuring audio levels.
virtual bool GetAudioReadOffset(ULWord &outReadOffset, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset from the start of the audio buffer to the fi...
virtual bool SetAudioBufferSize(const NTV2AudioBufferSize inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Changes the size of the audio buffer that is used for a given Audio System in the AJA device...
virtual bool ReadAudioLastOut(ULWord &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given Audio System, answers with the byte offset of the tail end of the last chunk of audio s...
virtual bool GetNumberAudioChannels(ULWord &outNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Returns the current number of audio channels being captured or played by a given Audio System on the ...
static NTV2AudioChannelPairs BitMasksToNTV2AudioChannelPairs(const ULWord inBitMask, const ULWord inExtendedBitMask)
This selects audio channels 13 thru 16.
static const ULWord gChannelToAudioInLastAddrRegNum[]
This selects audio channels 17 and 18.
NTV2FrameGeometry
Identifies a particular video frame geometry.
This identifies the first Audio System.
The total number of audio systems on the device that can read/write audio buffer memory. Includes host audio system, if present. (New in SDK 17.0)
static const unsigned gAESChannelMappingShifts[4]
Declares numerous NTV2 utility functions.
#define NTV2_AUDIO_READBUFFEROFFSET_BIG
virtual bool SetHDMIOutAudioSource8Channel(const NTV2Audio8ChannelSelect inNewValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Changes the HDMI output's 8-channel audio source.
static const ULWord sAudioMixerInputSelectShifts[]
virtual bool SetHDMIOutAudioFormat(const NTV2AudioFormat inNewValue, const NTV2Channel inWhichHDMIOut=NTV2_CHANNEL1)
Sets the HDMI output's audio format.
virtual bool SetHeadphoneOutputGain(const ULWord inGainValue)
Sets the gain for the headphone out.
virtual bool GetSuspendHostAudio(bool &outIsSuspended)
Answers as to whether or not the host OS audio services for the AJA device (e.g. CoreAudio on MacOS) ...
virtual bool GetEmbeddedAudioClock(NTV2EmbeddedAudioClock &outValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
For the given NTV2AudioSystem, answers with the current NTV2EmbeddedAudioClock setting.
Obtain audio samples from the device microphone input, if available.
virtual bool SetAudioMixerInputAudioSystem(const NTV2AudioMixerInput inMixerInput, const NTV2AudioSystem inAudioSystem)
Sets the Audio System that will drive the given input of the Audio Mixer.
virtual bool SetAudioMixerInputGain(const NTV2AudioMixerInput inMixerInput, const NTV2AudioMixerChannel inChannel, const ULWord inGainValue)
Sets the gain for the given input of the Audio Mixer.
virtual bool GetSDIOutputAudioEnabled(const NTV2Channel inSDIOutput, bool &outIsEnabled)
Answers with the current state of the audio output embedder for the given SDI output connector (speci...
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
bool GetTagsForFrameIndex(const UWord inIndex, NTV2StringSet &outTags) const
Answers with the list of tags for the given frame number.
#define NTV2_IS_VALID_AUDIO_SOURCE(_x_)
static const ULWord gAudioSystemToAudioControlRegNum[]
NTV2AudioSystemSet::const_iterator NTV2AudioSystemSetConstIter
A handy const iterator into an NTV2AudioSystemSet. New in SDK 16.2.
virtual bool SetSDIOutputAudioEnabled(const NTV2Channel inSDIOutput, const bool &inEnable)
Enables or disables the audio output embedder for the given SDI output connector (specified as a chan...
virtual bool SetAudioInputDelay(const NTV2AudioSystem inAudioSystem, const ULWord inDelay)
Sets the audio input delay for the given Audio System on the device.
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
Declares the CNTV2Card class.
virtual bool GetInputAudioChannelPairsWithPCM(const NTV2Channel inSDIInputConnector, NTV2AudioChannelPairs &outChannelPairs)
For the given SDI input (specified as a channel number), returns the set of audio channel pairs that ...
#define NTV2_IS_WITHIN_AUDIO_CHANNELS_1_TO_16(__p__)
virtual bool GetEmbeddedAudioInput(NTV2EmbeddedAudioInput &outEmbeddedSource, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Answers with the device's current embedded (SDI) audio source for the given NTV2AudioSystem.
virtual bool SetAudioMixerLevelsSampleCount(const ULWord inSampleCount)
Sets the Audio Mixer's sample count it uses for measuring audio levels.
virtual bool SetAnalogAudioTransmitEnable(const NTV2Audio4ChannelSelect inChannelQuad, const bool inEnable)
Sets the specified bidirectional XLR audio connectors to collectively act as inputs or outputs...
ULWord NTV2DeviceGetFrameBufferSize(NTV2DeviceID id, NTV2FrameGeometry fg, NTV2FrameBufferFormat fbf)
virtual bool SetAudioPCMControl(const NTV2AudioSystem inAudioSystem, const bool inIsNonPCM)
Determines whether or not all outgoing audio channel pairs are to be flagged as non-PCM for the given...
Private include file for all ajabase sources.
The version number of the HDMI chipset on the device.
True if device audio systems can wait for VBI before starting. (New in SDK 17.0)
std::vector< uint32_t > ULWordSequence
An ordered sequence of ULWord (uint32_t) values.
virtual bool GetHeadphoneOutputGain(ULWord &outGainValue)
Answers with the current gain setting for the headphone out.
std::string join(const std::vector< std::string > &parts, const std::string &delim)
#define NTV2_AUDIO_READBUFFEROFFSET
True if device has a firmware audio mixer.
virtual bool GetAudioMixerInputChannelsMute(const NTV2AudioMixerInput inMixerInput, NTV2AudioChannelsMuted16 &outMutes)
Answers with a std::bitset that indicates which input audio channels of the given Audio Mixer input a...
Audio clock derived from the device reference.
NTV2Audio4ChannelSelect
Identifies a contiguous, adjacent group of four audio channels.
virtual bool SetAudioOutputAESSyncModeBit(const NTV2AudioSystem inAudioSystem, const bool &inAESSyncModeBitSet)
Sets or clears the AES Sync Mode bit for the given Audio System's output.
True if device has a bi-directional analog audio connector.
static const ULWord gAudioSystemToSrcSelectRegNum[]
True if device has a rotary encoder volume control.
virtual bool GetAudio20BitMode(const NTV2AudioSystem inAudioSystem, bool &outEnable)
Answers whether or not the device's NTV2AudioSystem is currently operating in 20-bit mode...
NTV2AudioChannelPairs::const_iterator NTV2AudioChannelPairsConstIter
Handy const iterator to iterate over a set of distinct NTV2AudioChannelPair values.
virtual bool GetAudioMixerInputGain(const NTV2AudioMixerInput inMixerInput, const NTV2AudioMixerChannel inChannel, ULWord &outGainValue)
Answers with the current gain setting for the Audio Mixer's given input.
This selects audio channels 9 and 10 (Group 3 channels 1 and 2)
#define NTV2_IS_NORMAL_AUDIO_CHANNEL_QUAD(__p__)
virtual bool SetAESOutputSource(const NTV2Audio4ChannelSelect inAESAudioChannels, const NTV2AudioSystem inSrcAudioSystem, const NTV2Audio4ChannelSelect inSrcAudioChannels)
Changes the audio source for the given quad of AES audio output channels. By default, at power-up, for AJA devices that support AES audio output, the content of AES audio output channels 1/2/3/4 reflect what's being output from audio channels 1/2/3/4 from NTV2_AUDIOSYSTEM_1, likewise with audio channels 5/6/7/8, etc.
static const ULWord sAudioMixerInputSelectMasks[]
virtual bool StopAudioOutput(const NTV2AudioSystem inAudioSystem)
Stops the playout side of the given NTV2AudioSystem, parking the "Read Head" at the start of the play...
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
virtual bool SetNumberAudioChannels(const ULWord inNumChannels, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the number of audio channels to be concurrently captured or played for a given Audio System on t...
virtual bool StopAudioInput(const NTV2AudioSystem inAudioSystem)
Stops the capture side of the given NTV2AudioSystem, and resets the capture position (i...
#define NTV2_IS_VALID_AUDIO_CHANNEL_PAIR(__p__)
The number of SDI video inputs on the device.
static const ULWord gAudioDelayRegisterNumbers[]
virtual bool SetSuspendHostAudio(const bool inSuspend)
Suspends or resumes host OS audio (e.g. CoreAudio on MacOS) for the AJA device.
Declares device capability functions.
virtual bool SetAudioMixerInputChannelsMute(const NTV2AudioMixerInput inMixerInput, const NTV2AudioChannelsMuted16 inMutes)
Mutes (or enables) the given output audio channel of the Audio Mixer.
NTV2Audio8ChannelSelect
Identifies a contiguous, adjacent group of eight audio channels.
The size, in bytes, of the device's active RAM available for video and audio.
virtual bool GetAudioMixerInputAudioSystem(const NTV2AudioMixerInput inMixerInput, NTV2AudioSystem &outAudioSystem)
Answers with the Audio System that's currently driving the given input of the Audio Mixer...
std::set< std::string > NTV2StringSet
True if device has any AES audio inputs or outputs.
static const ULWord sAudioMixerInputGainCh2Regs[]
static NTV2RegisterNumber GetNonPCMDetectRegisterNumber(const NTV2Channel inSDIInputChannel, const bool inIsExtended=(0))
Audio clock derived from the video input.
virtual bool GetMultiLinkAudioMode(const NTV2AudioSystem inAudioSystem, bool &outEnabled)
Answers with the current multi-link audio mode for the given audio system.
virtual bool SetEmbeddedAudioClock(const NTV2EmbeddedAudioClock inValue, const NTV2AudioSystem inAudioSystem=NTV2_AUDIOSYSTEM_1)
Sets the NTV2EmbeddedAudioClock setting for the given NTV2AudioSystem.
virtual bool SetAudioOutputPause(const NTV2AudioSystem inAudioSystem, const bool inPausePlayout)
Pauses or resumes output of audio samples and advancement of the audio buffer pointer ("play head") o...
The number of HDMI video inputs on the device.
static const PCM_CONTROL_INFO gAudioEngineChannelPairToFieldInformation[][8]
virtual bool GetAudioMemoryOffset(const ULWord inOffsetBytes, ULWord &outAbsByteOffset, const NTV2AudioSystem inAudioSystem, const bool inCaptureBuffer=(0))
Answers with the byte offset in device SDRAM into the specified Audio System's audio buffer...
NTV2AudioMixerInput
Identifies the Audio Mixer's audio inputs.