示例#1
0
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);

}
示例#2
0
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);
}
示例#3
0
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));
}
示例#4
0
/*
 * 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;
}
示例#5
0
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;
}
示例#6
0
bool TriDMXOutputPort::WriteDMX(const DmxBuffer &buffer,
                                OLA_UNUSED uint8_t priority) {
  m_widget->SendDMX(PortId(), buffer);
  return true;
}
示例#7
0
std::string TriDMXOutputPort::Description() const {
  std::ostringstream desc;
  desc << "TriDMX Output Port " << PortId();
  return desc.str();
}
示例#8
0
PortId FilterPortWidget::portId() const
{
    return PortId(filterId(), portName());
}
示例#9
0
bool ShowNetOutputPort::WriteDMX(const DmxBuffer &buffer,
                                 uint8_t priority) {
  return !m_node->SendDMX(PortId(), buffer);
  (void) priority;
}
示例#10
0
string ShowNetOutputPort::Description() const {
  std::stringstream str;
  str << "ShowNet " << PortId() * DMX_UNIVERSE_SIZE + 1 << "-" <<
    (PortId() + 1) * DMX_UNIVERSE_SIZE;
  return str.str();
}