16 #pragma warning(disable: 4800) 22 #define AUDFAIL(__x__) AJA_sERROR (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 23 #define AUDWARN(__x__) AJA_sWARNING(AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 24 #define AUDNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 25 #define AUDINFO(__x__) AJA_sINFO (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 26 #define AUDDBUG(__x__) AJA_sDEBUG (AJA_DebugUnit_AudioGeneric, " " << HEX0N(uint64_t(this),16) << "::" << AJAFUNC << ": " << __x__) 151 if (regAudControl == 0)
153 else if (inNumChannels == 6 || inNumChannels == 8)
161 else if (inNumChannels == 16)
173 size_t numFailures(0);
175 if (!SetNumberAudioChannels (inNumChannels, *it))
177 return numFailures == 0;
187 if (regAudControl == 0)
237 if ((rateLow == 0) && (rateHigh == 0))
239 else if ((rateLow == 1) && (rateHigh == 0))
241 else if ((rateLow == 0) && (rateHigh == 1))
261 size_t numFailures(0);
263 if (!SetAudioBufferSize (inMode, *it))
265 return numFailures == 0;
314 size_t numFailures(0);
316 if (!SetAudioLoopBack (inMode, *it))
318 return numFailures == 0;
358 switch (inAudioInput)
368 default:
return false;
391 ULWord sparse1(0), sparse2(0);
394 if (!sparse1 && !sparse2)
396 else if (sparse1 && !sparse2)
398 else if (!sparse1 && sparse2)
400 else if (sparse1 && sparse2)
437 if (!GetAudioBufferSize (bufferSize, inAudioSystem))
453 if (!GetAudioBufferSize (bufferSize, inAudioSystem))
480 #if !defined(NTV2_DEPRECATE_16_0) 483 #endif // !defined(NTV2_DEPRECATE_16_0) 491 static const ULWord sAudioSourceToRegValues [] = { 0x1,
500 sAudioSourceToRegValues [inAudioSource],
505 if (SetEmbeddedAudioInput (inEmbeddedSource, inAudioSystem))
529 switch (regValue & 0x0000000F)
536 default:
return false;
540 GetEmbeddedAudioInput(outEmbeddedSource, inAudioSystem);
649 vector<uint32_t> & outLevels)
661 if (inChannelPairs.empty())
664 chanPairs.insert(chPr);
667 chanPairs = inChannelPairs;
671 std::set<ULWord> regsToRead;
677 uint32_t regNum(gAudMxrMainOutLvlRegs[chanPair]);
678 regsToRead.insert(regNum);
680 for (std::set<ULWord>::const_iterator it(regsToRead.begin()); it != regsToRead.end(); ++it)
684 const bool result(ReadRegisters(regs));
688 ULWord rawLevels(it->IsValid() ? it->registerValue : 0);
693 while (outLevels.size() < chanPairs.size() * 2)
694 outLevels.push_back(0);
721 unsigned long ulongvalue(0);
762 vector<uint32_t> & outLevels)
776 if (inChannelPairs.empty())
782 chanPairs.insert(chPr);
785 chanPairs = inChannelPairs;
789 std::set<ULWord> regsToRead;
795 uint32_t regNum(gAudMxrMainInLvlRegs[chanPair]);
804 regsToRead.insert(regNum);
806 for (std::set<ULWord>::const_iterator it(regsToRead.begin()); it != regsToRead.end(); ++it)
810 const bool result(ReadRegisters(regs));
814 ULWord rawLevels(it->IsValid() ? it->registerValue : 0);
819 while (outLevels.size() < chanPairs.size() * 2)
820 outLevels.push_back(0);
829 outSampleCount = 1 << outSampleCount;
837 if (inSampleCount > 0x00008000)
839 ULWord result(0), sampleCount(inSampleCount);
840 while (sampleCount >>= 1)
851 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
862 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
879 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
881 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
885 ULWord channelSelect =
static_cast<ULWord>(inValue) % 4;
893 const ULWord encoding ((
ULWord (inAudioSystem) << 4) | inValue);
907 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
909 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
912 ULWord engineSelect (0), channelSelect(0), bankSelect(0);
946 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
948 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
978 if (!GetHDMIOutInputControlRegNum(regIC, inWhichHDMIOut))
980 if (!GetHDMIOutControlReg(regOC, inWhichHDMIOut))
983 ULWord engineSelect (0), channelSelect(0);
1003 outAudioSystem = static_cast <
NTV2AudioSystem> ((encoding & 0xC) >> 2);
1014 if (!GetHDMIOutInputControlRegNum(reg, inWhichHDMIOut))
1025 if (!GetHDMIOutInputControlRegNum(reg, inWhichHDMIOut))
1036 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
1047 if (!GetHDMIOutControlReg(reg, inWhichHDMIOut))
1060 const ULWord encoding ((
ULWord(inAudioSystem) << 4) | inChannelPair);
1088 else if (inWaitForVBI)
1089 {inWaitForVBI =
false;
AUDWARN(
"Aud" <<
DEC(inAudSys+1) <<
" wait-for-VBI requested but not supported on " << GetDescription());}
1093 AUDINFO(
"Aud" <<
DEC(inAudSys+1) <<
" output started" << (inWaitForVBI ?
" at VBI" :
"") <<
" on " << GetDescription());
1096 #if defined(NTV2_CHECK_SDRAM_COLLISIONS) 1102 for (
size_t ndx(0); ndx < badRgns.size(); ndx++)
1103 {
const ULWord rgnInfo(badRgns.at(ndx));
1104 const UWord startBlk(rgnInfo >> 16), numBlks(
UWord(rgnInfo & 0x0000FFFF));
1107 const string infoStr (
aja::join(tags,
", "));
1108 ostringstream acLabel; acLabel <<
"Aud" <<
DEC(inAudSys+1);
1109 if (infoStr.find(acLabel.str()) != string::npos)
1110 { ostringstream warning;
1112 warning <<
"8MB Frms " <<
DEC0N(startBlk,3) <<
"-" <<
DEC0N(startBlk+numBlks-1,3);
1114 warning <<
"8MB Frm " <<
DEC0N(startBlk,3);
1115 AUDWARN(
"Aud" <<
DEC(inAudSys+1) <<
" memory overlap/interference: " << warning.str() <<
": " << infoStr);
1118 #endif // defined(NTV2_CHECK_SDRAM_COLLISIONS) 1128 AUDINFO(
"Aud" <<
DEC(inAudSys+1) <<
" output stopped on " << GetDescription());
1134 bool isStopped (
true);
1139 outIsRunning = !isStopped;
1185 else if (inWaitForVBI)
1186 AUDWARN(
"Aud" <<
DEC(inAudSys+1) <<
" wait-for-VBI requested but not supported on " << GetDescription());
1190 AUDINFO(
"Aud" <<
DEC(inAudSys+1) <<
" input started" << (inWaitForVBI ?
" at VBI" :
"") <<
" on " << GetDescription());
1193 #if defined(NTV2_CHECK_SDRAM_COLLISIONS) 1199 for (
size_t ndx(0); ndx < badRgns.size(); ndx++)
1200 {
const ULWord rgnInfo(badRgns.at(ndx));
1201 const UWord startBlk(rgnInfo >> 16), numBlks(
UWord(rgnInfo & 0x0000FFFF));
1204 const string infoStr (
aja::join(tags,
", "));
1205 ostringstream acLabel; acLabel <<
"Aud" <<
DEC(inAudSys+1);
1206 if (infoStr.find(acLabel.str()) != string::npos)
1207 { ostringstream warning;
1209 warning <<
"8MB Frms " <<
DEC0N(startBlk,3) <<
"-" <<
DEC0N(startBlk+numBlks-1,3);
1211 warning <<
"8MB Frm " <<
DEC0N(startBlk,3);
1212 AUDWARN(
"Aud" <<
DEC(inAudSys+1) <<
" memory overlap/interference: " << warning.str() <<
": " << infoStr);
1215 #endif // defined(NTV2_CHECK_SDRAM_COLLISIONS) 1226 AUDINFO(
"Aud" <<
DEC(inAudSys+1) <<
" input stopped on " << GetDescription());
1233 bool isStopped (
true);
1238 outIsRunning = !isStopped;
1341 const bool isNonPCM (inNonPCMChannelPairs.find (chanPair) != inNonPCMChannelPairs.end ());
1366 ULWord numAudioChannels (0);
1367 bool isNonPCM (
false);
1369 outNonPCMChannelPairs.clear ();
1372 if (!GetNumberAudioChannels (numAudioChannels, inAudioSystem))
1376 if (!GetAudioPCMControl (inAudioSystem, isNonPCM))
1381 for (
UWord chPair (0); chPair <= maxPair; chPair++)
1392 if (regVal &
BIT(inAudioSystem * 8 + chanPair))
1393 outNonPCMChannelPairs.insert (chanPair);
1412 outIsPresent =
false;
1413 if (!GetDetectedAudioChannelPairs (inAudioSystem, activeChannelPairs))
1415 if (activeChannelPairs.find (inChannelPair) != activeChannelPairs.end ())
1416 outIsPresent =
true;
1423 outDetectedChannelPairs.clear ();
1433 if (detectBits &
BIT(bitGroup * 8 + chanPair))
1434 outDetectedChannelPairs.insert (chanPair);
1441 uint32_t valLo8(0), valHi8(0);
1442 outDetectedChannelPairs.clear ();
1450 const uint32_t detectBits (((valLo8 >> 24) & 0x0000000F) | ((valHi8 >> 24) & 0x000000F0));
1452 if (!(detectBits &
BIT(chPair)))
1453 outDetectedChannelPairs.insert(chPair);
1508 const ULWord maxNumAudioChannelsForQuad ((inAESAudioChannels + 1) * 4);
1513 if (numAESAudioOutputChannels < 4)
1515 if (maxNumAudioChannelsForQuad > numAESAudioOutputChannels)
1547 if (inBitMask &
BIT (channelPair))
1548 result.insert (channelPair);
1549 if (inExtendedBitMask)
1551 if (inExtendedBitMask &
BIT (channelPair))
1552 result.insert (channelPair);
1568 if (!GetInputAudioChannelPairsWithPCM (inSDIInputChannel, withPCMs))
1571 outHasPCM = withPCMs.find (inAudioChannelPair) != withPCMs.end ();
1578 outPCMPairs.clear ();
1588 const bool isExtended (numChannels > 16);
1592 if (!ReadRegister (regNum, mask))
1595 if (!ReadRegister (regNum + 1, extMask))
1606 outNonPCMPairs.clear ();
1616 const bool isExtended (numChannels > 16);
1620 if (!ReadRegister (regNum, mask))
1623 if (!ReadRegister (regNum + 1, extMask))
1642 outIsEnabled =
true;
1653 outIsEnabled = value ?
false :
true;
1672 outEraseModeEnabled =
false;
1708 outXmitEnabled =
false;
1718 outXmitEnabled = !outXmitEnabled;
1737 #if !defined(NTV2_DEPRECATE_16_1) 1748 bool xlr14Xmit(
false), xlr58Xmit(
false);
1753 if (xlr14Xmit && xlr58Xmit)
1755 else if (xlr14Xmit && !xlr58Xmit)
1757 else if (!xlr14Xmit && xlr58Xmit)
1763 #endif // !defined(NTV2_DEPRECATE_16_1) 1774 outAESSyncModeBitSet = regValue ?
true :
false;
1803 outAbsByteOffset = 0;
1810 const ULWord EIGHT_MEGABYTES (0x800000);
1812 const ULWord engineOffset (memSize - EIGHT_MEGABYTES *
ULWord(inAudioSystem+1));
1813 outAbsByteOffset = inOffsetBytes + engineOffset;
1819 if (!GetFrameGeometry (fg,
NTV2Channel(inAudioSystem)) || !GetFrameBufferFormat (
NTV2Channel(inAudioSystem), fbf))
1826 if (inCaptureBuffer)
1827 {
ULWord rdBufOffset(0x400000);
1828 GetAudioReadOffset (rdBufOffset, inAudioSystem);
1829 outAbsByteOffset += rdBufOffset;
1835 #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.
Declares the AJATime class.
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...
std::set< std::string > NTV2StringSet
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__)
static void Sleep(const int32_t inMilliseconds)
Suspends execution of the current thread for a given number of milliseconds.
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...
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.