23 auto layout =
new QFormLayout{
this};
24 layout->setContentsMargins(0, 0, 0, 0);
26 m_remotePort =
new QSpinBox(
this);
27 m_remotePort->setRange(0, 65535);
28 m_remotePort->setValue(9996);
29 score::setHelp(m_remotePort,
30 tr(
"This is the communication port used for the TCP connection."));
31 proto.checkForChanges(m_remotePort);
33 m_host =
new QLineEdit(
this);
34 m_host->setText(
"127.0.0.1");
35 score::setHelp(m_host,
36 tr(
"This is the IP address of the computer the OSC-compatible software is "
37 "located on. You can use 127.0.0.1 if the software runs on the same machine "
40 layout->addRow(tr(
"Port"), m_remotePort);
41 layout->addRow(tr(
"Host"), m_host);
44 ossia::net::tcp_client_configuration settings()
const noexcept
46 ossia::net::tcp_client_configuration conf;
47 conf.port = m_remotePort->value();
48 conf.host = m_host->text().toStdString();
52 void setSettings(
const ossia::net::tcp_client_configuration& conf)
54 m_remotePort->setValue(conf.port);
55 m_host->setText(QString::fromStdString(conf.host));
59 QSpinBox* m_remotePort{};
69 auto layout =
new QFormLayout{
this};
70 layout->setContentsMargins(0, 0, 0, 0);
72 m_remotePort =
new QSpinBox(
this);
73 m_remotePort->setRange(0, 65535);
74 m_remotePort->setValue(9996);
75 score::setHelp(m_remotePort,
76 tr(
"This is the communication port used for the TCP connection."));
77 proto.checkForChanges(m_remotePort);
79 m_host =
new QLineEdit(
this);
80 m_host->setText(
"127.0.0.1");
81 score::setHelp(m_host,
82 tr(
"This is the IP address of the computer the OSC-compatible software is "
83 "located on. You can use 127.0.0.1 if the software runs on the same machine "
86 m_framing =
new QComboBox{
this};
87 m_framing->addItems({
"Size prefixing",
"SLIP"});
88 m_framing->setCurrentIndex(1);
90 layout->addRow(tr(
"Port"), m_remotePort);
91 layout->addRow(tr(
"Host"), m_host);
92 layout->addRow(tr(
"Framing"), m_framing);
95 framing_type framing()
const noexcept
97 return (framing_type)m_framing->currentIndex();
100 ossia::net::tcp_client_configuration settings()
const noexcept
102 ossia::net::tcp_client_configuration conf;
103 conf.port = m_remotePort->value();
104 conf.host = m_host->text().toStdString();
109 const ossia::net::osc_protocol_configuration& c,
110 const ossia::net::tcp_client_configuration& conf)
112 m_remotePort->setValue(conf.port);
113 m_framing->setCurrentIndex(c.framing);
114 m_host->setText(QString::fromStdString(conf.host));
118 QSpinBox* m_remotePort{};
119 QComboBox* m_framing{};