21 auto layout =
new QFormLayout{
this};
22 layout->setContentsMargins(0, 0, 0, 0);
24 m_remotePort =
new QSpinBox(
this);
25 m_remotePort->setRange(0, 65535);
26 m_remotePort->setValue(9996);
27 score::setHelp(m_remotePort,
28 tr(
"This is where the other software listens from incoming messages. Score will "
29 "send packets to this port."));
30 proto.checkForChanges(m_remotePort);
32 m_localPort =
new QSpinBox(
this);
33 m_localPort->setRange(0, 65535);
34 m_localPort->setValue(9997);
35 score::setHelp(m_localPort,
36 tr(
"This is where the other software sends feedback messages to. Score will "
37 "listen for incoming OSC messages on this port."));
38 proto.checkForChanges(m_localPort);
40 m_broadcast =
new QCheckBox{
this};
41 m_broadcast->setCheckState(Qt::Unchecked);
42 score::setHelp(m_broadcast, tr(
"Broadcast to every device in the IP broadcast range"));
44 m_host =
new QLineEdit(
this);
45 m_host->setText(
"127.0.0.1");
46 score::setHelp(m_host,
47 tr(
"This is the IP address of the computer the OSC-compatible software is "
48 "located on. You can use 127.0.0.1 if the software runs on the same machine "
51 layout->addRow(tr(
"Device listening port"), m_remotePort);
52 layout->addRow(tr(
"Broadcast"), m_broadcast);
53 layout->addRow(tr(
"Device host"), m_host);
54 layout->addRow(tr(
"score listening port"), m_localPort);
57 ossia::net::udp_configuration settings()
const noexcept
59 ossia::net::udp_configuration conf;
60 conf.local = ossia::net::inbound_socket_configuration{
61 "0.0.0.0", (uint16_t)m_localPort->value()};
62 conf.remote = ossia::net::outbound_socket_configuration{
63 m_host->text().toStdString(), (uint16_t)m_remotePort->value(),
64 m_broadcast->isChecked()};
68 void setSettings(
const ossia::net::udp_configuration& conf)
72 m_remotePort->setValue(conf.remote->port);
73 m_host->setText(QString::fromStdString(conf.remote->host));
74 m_broadcast->setChecked(conf.remote->broadcast);
78 m_localPort->setValue(conf.local->port);
83 QSpinBox* m_localPort{};
84 QSpinBox* m_remotePort{};
85 QCheckBox* m_broadcast{};