Esempio n. 1
0
void VCSlider::sendFeedBack(int value)
{
    /* Send input feedback */
    QLCInputSource src = inputSource();
    if (src.isValid() == true)
    {
        if (invertedAppearance() == true)
            value = m_slider->maximum() - value;

        float fb = SCALE(float(value), float(m_slider->minimum()),
                         float(m_slider->maximum()), float(0),
                         float(UCHAR_MAX));

        m_doc->outputMap()->feedBack(src.universe(), src.channel(), int(fb));
    }
}
Esempio n. 2
0
bool InputMap::inputSourceNames(const QLCInputSource& src,
                                QString& uniName, QString& chName) const
{
    if (src.isValid() == false)
        return false;

    InputPatch* pat = this->patch(src.universe());
    if (pat == NULL)
    {
        /* There is no patch for the given universe */
        return false;
    }

    QLCInputProfile* profile = pat->profile();
    if (profile == NULL)
    {
        /* There is no profile. Display plugin name and channel number. */
        if (pat->plugin() != NULL)
            uniName = QString("%1: %2").arg(src.universe() + 1).arg(pat->plugin()->name());
        else
            uniName = QString("%1: ??").arg(src.universe() + 1);
        chName = QString("%1: ?").arg(src.channel() + 1);
    }
    else
    {
        QLCInputChannel* ich;
        QString name;

        /* Display profile name for universe */
        uniName = QString("%1: %2").arg(src.universe() + 1).arg(profile->name());

        /* User can input the channel number by hand, so put something
           rational to the channel name in those cases as well. */
        ich = profile->channel(src.channel());
        if (ich != NULL)
            name = ich->name();
        else
            name = QString("?");

        /* Display channel name */
        chName = QString("%1: %2").arg(src.channel() + 1).arg(name);
    }

    return true;
}