29 : QDialog (parent, flags)
31 ULWord initialBoardIndex (0);
35 ::memset (mDeviceInputCounts, 0,
sizeof (mDeviceInputCounts));
36 ::memset (mFrameGrabbers, 0,
sizeof (mFrameGrabbers));
41 mDeviceChoicePopupMenu =
new QComboBox;
42 if (numDevicesFound == 0)
43 mDeviceChoicePopupMenu->addItem (tr (
"No Devices Found"));
50 mDeviceChoicePopupMenu->addItem (tr (iter->deviceIdentifier.c_str ()));
57 uint32_t numInputs = 4;
59 for (
ULWord ndx (0); ndx < numDevicesFound; ndx++)
60 if (mDeviceInputCounts [ndx] == 8)
62 initialBoardIndex = 0;
63 QObject::connect (mDeviceChoicePopupMenu, SIGNAL (currentIndexChanged (
int)),
this, SLOT (
RequestDeviceChange (
const int)));
64 mDeviceChoicePopupMenu->setCurrentIndex (initialBoardIndex);
69 QSignalMapper * signalMapper =
new QSignalMapper (
this);
70 for (uint32_t inputNumber = 0; inputNumber < numInputs; inputNumber++)
72 mPreviewGroupBoxes [inputNumber] =
new QGroupBox (
this);
77 mPreviewWidgets [inputNumber]->setSizePolicy(QSizePolicy ::Expanding, QSizePolicy ::Expanding);
80 mInputLabels [inputNumber] =
new QLabel(
"",
this);
81 mWithAudioCheckBoxes [inputNumber] =
new QCheckBox (
"Audio",
this);
82 signalMapper->setMapping (mWithAudioCheckBoxes [inputNumber], inputNumber);
83 #if defined (INCLUDE_AJACC)
84 mWithCaptionsCheckBoxes [inputNumber] =
new QCheckBox (
"CC",
this);
87 QVBoxLayout * layout =
new QVBoxLayout;
88 layout->addWidget (mPreviewWidgets [inputNumber]);
89 layout->addWidget (mInputLabels [inputNumber]);
91 QHBoxLayout * bottomLayout (
new QHBoxLayout);
92 bottomLayout->setContentsMargins (0, 0, 0, 0);
93 bottomLayout->addWidget (mWithAudioCheckBoxes [inputNumber]);
94 #if defined (INCLUDE_AJACC)
95 bottomLayout->addWidget (mWithCaptionsCheckBoxes [inputNumber]);
97 layout->addLayout (bottomLayout);
99 mPreviewGroupBoxes [inputNumber]->setLayout (layout);
101 connect (mFrameGrabbers [inputNumber], SIGNAL (newFrame (
const QImage &,
bool)),
102 mPreviewWidgets [inputNumber], SLOT (updateFrame (
const QImage &,
bool)));
104 connect (mFrameGrabbers [inputNumber], SIGNAL (newStatusString (
const QString)),
105 mInputLabels [inputNumber], SLOT (setText (
const QString)));
107 connect (mWithAudioCheckBoxes [inputNumber], SIGNAL (clicked ()), signalMapper, SLOT (map ()));
108 #if defined (INCLUDE_AJACC)
116 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
117 connect (signalMapper, SIGNAL (mappedInt (
int)),
this, SLOT (
SlotAudioCheckBox (
int)));
119 connect (signalMapper, SIGNAL (mapped (
int)),
this, SLOT (
SlotAudioCheckBox (
int)));
125 QGridLayout * glayout =
new QGridLayout;
128 glayout->addWidget (mPreviewGroupBoxes [0], 0, 0);
129 glayout->addWidget (mPreviewGroupBoxes [1], 0, 1);
130 glayout->addWidget (mPreviewGroupBoxes [2], 1, 0);
131 glayout->addWidget (mPreviewGroupBoxes [3], 1, 1);
135 glayout->addWidget (mPreviewGroupBoxes [0], 0, 0);
136 glayout->addWidget (mPreviewGroupBoxes [1], 0, 1);
137 glayout->addWidget (mPreviewGroupBoxes [2], 0, 2);
138 glayout->addWidget (mPreviewGroupBoxes [3], 0, 3);
139 glayout->addWidget (mPreviewGroupBoxes [4], 1, 0);
140 glayout->addWidget (mPreviewGroupBoxes [5], 1, 1);
141 glayout->addWidget (mPreviewGroupBoxes [6], 1, 2);
142 glayout->addWidget (mPreviewGroupBoxes [7], 1, 3);
145 QVBoxLayout * vlayout =
new QVBoxLayout;
146 vlayout->addWidget (mDeviceChoicePopupMenu);
147 vlayout->addLayout (glayout);
155 for (uint32_t inputNumber (0); inputNumber < numInputs; inputNumber++)
159 mFrameGrabbers [inputNumber]->start ();
169 qDebug (
"## NOTE: Leaving");
175 mFrameGrabbers [inputNum]->
SetWithAudio (mWithAudioCheckBoxes [inputNum]->isChecked ());
195 for (uint32_t inputNumber (0); inputNumber < mDeviceInputCounts [inDeviceIndexNum]; inputNumber++)
196 if (mFrameGrabbers [inputNumber])
198 qDebug (
"## NOTE: Device changed to %d", inDeviceIndexNum);