Add option to enable or disable multicast receiving

This commit is contained in:
Adam Honse 2021-01-07 00:38:25 -06:00
parent 00bc8684c2
commit d7d57834a1
2 changed files with 25 additions and 7 deletions

View file

@ -187,14 +187,19 @@ void OpenRGBE131ReceiverDialog::E131ReceiverThreadFunction()
}
/*-----------------------------------------------------*\
| Join the configured universes |
| Join the configured universes if multicast enabled |
\*-----------------------------------------------------*/
bool multicast = ui->EnableMulticastBox->checkState() == Qt::Checked;
for(unsigned int universe_idx = 0; universe_idx < universe_list.size(); universe_idx++)
{
if(e131_multicast_join(sockfd, universe_list[universe_idx].universe) < 0)
if(multicast)
{
printf("Join error\r\n");
return;
if(e131_multicast_join(sockfd, universe_list[universe_idx].universe) < 0)
{
printf("Join error\r\n");
return;
}
}
}

View file

@ -36,6 +36,13 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="ReceiverSourceValue">
<property name="text">
<string>Source</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="ReceiverStatusValue">
<property name="text">
@ -78,10 +85,16 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="ReceiverSourceValue">
<item row="3" column="3">
<widget class="QCheckBox" name="EnableMulticastBox">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Source</string>
<string>Enable Multicast</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>