void ProcessorInputPortWidget::mouseDoubleClickEvent(QMouseEvent *) { if(!mRenameAllowed) return; QString newName = QInputDialog::getText(0, tr("Change port name"), tr("Enter new name"), QLineEdit::Normal, mPortInfo.name); if(!newName.isEmpty()) emit rename(PortId(mPortInfo.filterId, mInfo.name), newName); }
void ConfigReader::addMakroInput() { QString portName = attributes().value("port").toString(); QString filterName = attributes().value("filter").toString(); int id = mInterface.getFilter(filterName).id; QString name = attributes().value("name").toString(); mInterface.connectProcessorInput(name, id, portName); mInterface.renameInput(PortId(id, portName), name); }
TriDMXInputPort::TriDMXInputPort( Device *parent, unsigned int id, PluginAdaptor *plugin_adaptor, TriDMX *widget) : BasicInputPort(parent, id, plugin_adaptor), m_widget(widget) { m_widget->SetDmxCallback(PortId(), NewCallback( static_cast<BasicInputPort*>(this), &BasicInputPort::DmxChanged)); }
/* * Check for loops. */ bool ShowNetOutputPort::PreSetUniverse(Universe *old_universe, Universe *new_universe) { (void) old_universe; (void) new_universe; AbstractDevice *device = GetDevice(); InputPort *input_port = device->GetInputPort(PortId()); if (input_port && input_port->GetUniverse()) { OLA_WARN << "Avoiding possible shownet loop on " << Description(); return false; } return true; }
int main() { Server server { ServerId("s1"), Interfaces { Interface { InterfaceId("i1"), Ports { { PortId("p11"), PortName("Jolly") }, { PortId("p12"), PortName("Billy") } } }, Interface { InterfaceId("i2"), Ports { { PortId("p21"), PortName("Bimbo") }, { PortId("p22"), PortName("Luffy") } } } } }; auto interfaces = server.get<Interfaces>(); std::cout << "InterfaceId: " << interfaces.at(0).get<InterfaceId>() << std::endl; auto ports = interfaces.at(0).get<Ports>(); std::cout << "Port name: " << ports.at(0).get<PortName>() << std::endl; Handy<ServerId, InterfaceId, PortId> handy(ServerId("s1"), InterfaceId("i1"), PortId("p1")); handy.get<ServerId>() = ServerId{"s2"}; handy.get<PortId>() = PortId {"p2"}; auto record = MakeRecord(ServerId("s1"), PortId("p2")); std::cout << Get<ServerId>(record) << std::endl; std::cout << Get<ServerId>(handy) << std::endl; std::cout << handy.get<PortId>() << std::endl; std::cout << handy.get(PortId {}) << std::endl; handy.get(PortId()) = PortId("Port2"); std::cout << handy.get(PortId {}) << std::endl; }
bool TriDMXOutputPort::WriteDMX(const DmxBuffer &buffer, OLA_UNUSED uint8_t priority) { m_widget->SendDMX(PortId(), buffer); return true; }
std::string TriDMXOutputPort::Description() const { std::ostringstream desc; desc << "TriDMX Output Port " << PortId(); return desc.str(); }
PortId FilterPortWidget::portId() const { return PortId(filterId(), portName()); }
bool ShowNetOutputPort::WriteDMX(const DmxBuffer &buffer, uint8_t priority) { return !m_node->SendDMX(PortId(), buffer); (void) priority; }
string ShowNetOutputPort::Description() const { std::stringstream str; str << "ShowNet " << PortId() * DMX_UNIVERSE_SIZE + 1 << "-" << (PortId() + 1) * DMX_UNIVERSE_SIZE; return str.str(); }