29 : QDialog (parent, flags)
31 ::memset (mDeviceInputCounts, 0,
sizeof(mDeviceInputCounts));
32 ::memset (mFrameGrabbers, 0,
sizeof(mFrameGrabbers));
36 mDeviceChoicePopupMenu =
new QComboBox;
39 mDeviceInputCounts[ndx] = card.
features().GetNumVideoInputs();
42 if (!mDeviceChoicePopupMenu->count())
43 mDeviceChoicePopupMenu->addItem(
"No Devices Found");
46 uint32_t numInputs(4);
48 for (
ULWord ndx(0); ndx <
ULWord(mDeviceChoicePopupMenu->count()); ndx++)
49 if (mDeviceInputCounts[ndx] == 8)
51 QObject::connect (mDeviceChoicePopupMenu, SIGNAL(currentIndexChanged(
int)),
53 mDeviceChoicePopupMenu->setCurrentIndex(0);
56 QSignalMapper * signalMapper =
new QSignalMapper(
this);
57 for (uint32_t inputNumber(0); inputNumber < numInputs; inputNumber++)
59 mPreviewGroupBoxes[inputNumber] =
new QGroupBox(
this);
63 mPreviewWidgets[inputNumber]->setSizePolicy (QSizePolicy ::Expanding, QSizePolicy ::Expanding);
65 mInputLabels[inputNumber] =
new QLabel(
"",
this);
66 mWithAudioCheckBoxes[inputNumber] =
new QCheckBox(
"Audio",
this);
67 signalMapper->setMapping (mWithAudioCheckBoxes [inputNumber], inputNumber);
68 #if defined (INCLUDE_AJACC)
69 mWithCaptionsCheckBoxes [inputNumber] =
new QCheckBox (
"CC",
this);
72 QVBoxLayout * layout =
new QVBoxLayout;
73 layout->addWidget (mPreviewWidgets [inputNumber]);
74 layout->addWidget (mInputLabels [inputNumber]);
76 QHBoxLayout * bottomLayout (
new QHBoxLayout);
77 bottomLayout->setContentsMargins (0, 0, 0, 0);
78 bottomLayout->addWidget (mWithAudioCheckBoxes [inputNumber]);
79 #if defined (INCLUDE_AJACC)
80 bottomLayout->addWidget (mWithCaptionsCheckBoxes [inputNumber]);
82 layout->addLayout (bottomLayout);
84 mPreviewGroupBoxes[inputNumber]->setLayout (layout);
86 connect (mFrameGrabbers[inputNumber], SIGNAL(newFrame(
const QImage&,
bool)),
87 mPreviewWidgets[inputNumber], SLOT(updateFrame(
const QImage&,
bool)));
89 connect (mFrameGrabbers[inputNumber], SIGNAL(newStatusString(
const QString)),
90 mInputLabels[inputNumber], SLOT(setText(
const QString)));
92 connect (mWithAudioCheckBoxes [inputNumber], SIGNAL(clicked()),
93 signalMapper, SLOT(map()));
94 #if defined (INCLUDE_AJACC)
100 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
101 connect (signalMapper, SIGNAL (mappedInt (
int)),
this, SLOT (
SlotAudioCheckBox (
int)));
103 connect (signalMapper, SIGNAL (mapped (
int)),
this, SLOT (
SlotAudioCheckBox (
int)));
107 QGridLayout * glayout =
new QGridLayout;
110 glayout->addWidget (mPreviewGroupBoxes [0], 0, 0);
111 glayout->addWidget (mPreviewGroupBoxes [1], 0, 1);
112 glayout->addWidget (mPreviewGroupBoxes [2], 1, 0);
113 glayout->addWidget (mPreviewGroupBoxes [3], 1, 1);
117 glayout->addWidget (mPreviewGroupBoxes [0], 0, 0);
118 glayout->addWidget (mPreviewGroupBoxes [1], 0, 1);
119 glayout->addWidget (mPreviewGroupBoxes [2], 0, 2);
120 glayout->addWidget (mPreviewGroupBoxes [3], 0, 3);
121 glayout->addWidget (mPreviewGroupBoxes [4], 1, 0);
122 glayout->addWidget (mPreviewGroupBoxes [5], 1, 1);
123 glayout->addWidget (mPreviewGroupBoxes [6], 1, 2);
124 glayout->addWidget (mPreviewGroupBoxes [7], 1, 3);
127 QVBoxLayout * vlayout =
new QVBoxLayout;
128 vlayout->addWidget (mDeviceChoicePopupMenu);
129 vlayout->addLayout (glayout);
134 for (uint32_t inputNumber (0); inputNumber < numInputs; inputNumber++)
138 mFrameGrabbers [inputNumber]->start ();
148 qDebug (
"## NOTE: Leaving");
154 mFrameGrabbers [inputNum]->
SetWithAudio (mWithAudioCheckBoxes [inputNum]->isChecked ());
171 for (uint32_t inputNumber(0); inputNumber < mDeviceInputCounts[inDeviceIndexNum]; inputNumber++)
172 if (mFrameGrabbers[inputNumber])
173 mFrameGrabbers[inputNumber]->
SetDeviceIndex (dev.GetIndexNumber());
174 qDebug (
"## NOTE: Device changed to %d", inDeviceIndexNum);