Exemplo n.º 1
0
void VCDockSliderProperties::init()
{
  //
  // Fill elements
  //
  fillBusCombo();
  fillChannelList();

  //
  // Bus stuff
  //
  t_bus_value buslo, bushi;
  m_slider->busRange(buslo, bushi);
  m_lowBusValueSpin->setValue(buslo);
  m_highBusValueSpin->setValue(bushi);

  //
  // Level stuff
  //
  t_value levello, levelhi;
  m_slider->levelRange(levello, levelhi);
  m_lowChannelValueSpin->setValue(levello);
  m_highChannelValueSpin->setValue(levelhi);
  
  //
  // Mode
  //
  m_behaviourGroup->setButton(m_slider->mode());
  slotBehaviourSelected(m_slider->mode());

}
Exemplo n.º 2
0
void VCSliderProperties::init()
{
	Q_ASSERT(m_slider != NULL);

	/* Generic page */
	m_nameEdit->setText(m_slider->caption());
	m_modeGroup->setButton(m_slider->sliderMode());
	slotSliderModeClicked(static_cast<int> (m_slider->sliderMode()));
	m_valueDisplayStyleGroup->setButton(static_cast<int>
					    (m_slider->valueDisplayStyle()));

	/* Bus page */
	fillBusCombo();
	m_busLowLimitSpin->setValue(m_slider->busLowLimit());
	m_busHighLimitSpin->setValue(m_slider->busHighLimit());

	/* Level page */
	m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
	m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

	m_levelList->addColumn("Name");
	m_levelList->addColumn("Type");
	m_levelList->addColumn("Range");
	m_levelList->setSorting(KColumnRange);
	m_levelList->setRootIsDecorated(true);
	m_levelList->setResizeMode(QListView::LastColumn);
	levelUpdateFixtures();
	levelUpdateChannelSelections();
}
Exemplo n.º 3
0
void EFXEditor::initGeneralPage()
{
	m_addFixtureButton->setIcon(QIcon(":/edit_add.png"));
	m_removeFixtureButton->setIcon(QIcon(":/edit_remove.png"));
	m_raiseFixtureButton->setIcon(QIcon(":/up.png"));
	m_lowerFixtureButton->setIcon(QIcon(":/down.png"));

	connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotNameEdited(const QString&)));

	connect(m_addFixtureButton, SIGNAL(clicked()),
		this, SLOT(slotAddFixtureClicked()));
	connect(m_removeFixtureButton, SIGNAL(clicked()),
		this, SLOT(slotRemoveFixtureClicked()));

	connect(m_raiseFixtureButton, SIGNAL(clicked()),
		this, SLOT(slotRaiseFixtureClicked()));
	connect(m_lowerFixtureButton, SIGNAL(clicked()),
		this, SLOT(slotLowerFixtureClicked()));

	connect(m_parallelRadio, SIGNAL(toggled(bool)),
		this, SLOT(slotParallelRadioToggled(bool)));

	connect(m_busCombo, SIGNAL(activated(int)),
		this, SLOT(slotBusComboActivated(int)));

	/* Set the EFX's name to the name field */
	m_nameEdit->setText(m_efx->name());
	slotNameEdited(m_efx->name());

	/* Put all of the EFX's fixtures to the tree view */
	QListIterator <t_fixture_id> it(*m_efx->fixtures());
	while (it.hasNext() == true)
		addFixtureItem(_app->doc()->fixture(it.next()));

	/* Set propagation mode */
	if (m_efx->propagationMode() == EFX::Serial)
		m_serialRadio->setChecked(true);
	else
		m_parallelRadio->setChecked(true);

	/* Init bus combo and select the EFX's bus */
	fillBusCombo();
}
Exemplo n.º 4
0
VCSliderProperties::VCSliderProperties(VCSlider* slider, Doc* doc, OutputMap* outputMap,
                                       InputMap* inputMap, MasterTimer* masterTimer)
    : QDialog(slider)
    , m_doc(doc)
    , m_outputMap(outputMap)
    , m_inputMap(inputMap)
    , m_masterTimer(masterTimer)
{
    Q_ASSERT(doc != NULL);
    Q_ASSERT(outputMap != NULL);
    Q_ASSERT(inputMap != NULL);
    Q_ASSERT(masterTimer != NULL);
    Q_ASSERT(slider != NULL);
    m_slider = slider;

    setupUi(this);

    QAction* action = new QAction(this);
    action->setShortcut(QKeySequence(QKeySequence::Close));
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
    addAction(action);

    /* Bus page connections */
    connect(m_switchToBusModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeBusClicked()));

    /* Level page connections */
    connect(m_levelLowLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelLowSpinChanged(int)));
    connect(m_levelHighLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelHighSpinChanged(int)));
    connect(m_levelCapabilityButton, SIGNAL(clicked()),
            this, SLOT(slotLevelCapabilityClicked()));
    connect(m_levelList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotLevelListClicked(QTreeWidgetItem*)));
    connect(m_levelAllButton, SIGNAL(clicked()),
            this, SLOT(slotLevelAllClicked()));
    connect(m_levelNoneButton, SIGNAL(clicked()),
            this, SLOT(slotLevelNoneClicked()));
    connect(m_levelInvertButton, SIGNAL(clicked()),
            this, SLOT(slotLevelInvertClicked()));
    connect(m_levelByGroupButton, SIGNAL(clicked()),
            this, SLOT(slotLevelByGroupClicked()));
    connect(m_switchToLevelModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeLevelClicked()));

    /* Playback page connections */
    connect(m_switchToPlaybackModeButton, SIGNAL(clicked()),
            this, SLOT(slotModePlaybackClicked()));
    connect(m_attachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotAttachPlaybackFunctionClicked()));
    connect(m_detachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotDetachPlaybackFunctionClicked()));

    /*********************************************************************
     * General page
     *********************************************************************/

    /* Name */
    m_nameEdit->setText(m_slider->caption());

    /* Slider mode */
    m_sliderMode = m_slider->sliderMode();
    switch (m_sliderMode)
    {
    default:
    case VCSlider::Bus:
        slotModeBusClicked();
        break;
    case VCSlider::Level:
        slotModeLevelClicked();
        break;
    case VCSlider::Playback:
        slotModePlaybackClicked();
        break;
    }

    /* Slider movement (Qt understands inverted appearance vice versa) */
    if (m_slider->invertedAppearance() == true)
        m_sliderMovementInvertedRadio->setChecked(true);
    else
        m_sliderMovementNormalRadio->setChecked(true);

    /* Value display style */
    switch (m_slider->valueDisplayStyle())
    {
    default:
    case VCSlider::ExactValue:
        m_valueExactRadio->setChecked(true);
        break;
    case VCSlider::PercentageValue:
        m_valuePercentageRadio->setChecked(true);
        break;
    }

    /********************************************************************
     * External input
     ********************************************************************/
    m_inputUniverse = m_slider->inputUniverse();
    m_inputChannel = m_slider->inputChannel();
    updateInputSource();

    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    /*********************************************************************
     * Bus page
     *********************************************************************/

    /* Bus combo contents */
    fillBusCombo();

    /* Bus value limit spins */
    m_busLowLimitSpin->setValue(m_slider->busLowLimit());
    m_busHighLimitSpin->setValue(m_slider->busHighLimit());

    /*********************************************************************
     * Level page
     *********************************************************************/

    /* Level limit spins */
    m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
    m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

    /* Tree widget columns */
    m_levelList->header()->setResizeMode(QHeaderView::ResizeToContents);

    /* Tree widget contents */
    levelUpdateFixtures();
    levelUpdateChannelSelections();

    /*********************************************************************
     * Playback page
     *********************************************************************/

    /* Function */
    m_playbackFunctionId = m_slider->playbackFunction();
    updatePlaybackFunctionName();
}
Exemplo n.º 5
0
void SceneEditor::init()
{
    QToolBar* toolBar;

    /* Actions */
    m_enableCurrentAction = new QAction(QIcon(":/check.png"),
                                        tr("Enable all channels in current fixture"), this);
    m_disableCurrentAction = new QAction(QIcon(":/uncheck.png"),
                                         tr("Disable all channels in current fixture"), this);
    m_copyAction = new QAction(QIcon(":/editcopy.png"),
                               tr("Copy current values to clipboard"), this);
    m_pasteAction = new QAction(QIcon(":/editpaste.png"),
                                tr("Paste clipboard values to current fixture"), this);
    m_copyToAllAction = new QAction(QIcon(":/editcopyall.png"),
                                    tr("Copy current values to all fixtures"), this);
    m_colorToolAction = new QAction(QIcon(":/color.png"),
                                    tr("Color tool for CMY/RGB-capable fixtures"), this);

    connect(m_enableCurrentAction, SIGNAL(triggered(bool)),
            this, SLOT(slotEnableCurrent()));
    connect(m_disableCurrentAction, SIGNAL(triggered(bool)),
            this, SLOT(slotDisableCurrent()));
    connect(m_copyAction, SIGNAL(triggered(bool)),
            this, SLOT(slotCopy()));
    connect(m_pasteAction, SIGNAL(triggered(bool)),
            this, SLOT(slotPaste()));
    connect(m_copyToAllAction, SIGNAL(triggered(bool)),
            this, SLOT(slotCopyToAll()));
    connect(m_colorToolAction, SIGNAL(triggered(bool)),
            this, SLOT(slotColorTool()));

    /* Toolbar */
    toolBar = new QToolBar(this);
    layout()->setMenuBar(toolBar);
    toolBar->addAction(m_enableCurrentAction);
    toolBar->addAction(m_disableCurrentAction);
    toolBar->addSeparator();
    toolBar->addAction(m_copyAction);
    toolBar->addAction(m_pasteAction);
    toolBar->addAction(m_copyToAllAction);
    toolBar->addSeparator();
    toolBar->addAction(m_colorToolAction);

    /* Tab widget */
    connect(m_tab, SIGNAL(currentChanged(int)),
            this, SLOT(slotTabChanged(int)));

    /* Add & remove buttons */
    connect(m_addFixtureButton, SIGNAL(clicked()),
            this, SLOT(slotAddFixtureClicked()));
    connect(m_removeFixtureButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveFixtureClicked()));

    m_nameEdit->setText(m_scene->name());
    connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(slotNameEdited(const QString&)));
    slotNameEdited(m_scene->name());

    /* Bus */
    connect(m_busCombo, SIGNAL(activated(int)),
            this, SLOT(slotBusComboActivated(int)));
    fillBusCombo();

    m_initializing = true;

    QListIterator <SceneValue> it(m_scene->values());
    while (it.hasNext() == true)
    {
        SceneValue scv(it.next());

        if (fixtureItem(scv.fxi) == NULL)
        {
            Fixture* fixture = _app->doc()->fixture(scv.fxi);
            if (fixture == NULL)
                continue;

            addFixtureItem(fixture);
            addFixtureTab(fixture);
        }

        setSceneValue(scv);
    }

    m_initializing = false;
}
Exemplo n.º 6
0
ChaserEditor::ChaserEditor(QWidget* parent, Chaser* chaser) : QDialog(parent)
{
	Q_ASSERT(chaser != NULL);

	setupUi(this);

	/* Resize columns to fit contents */
	m_tree->header()->setResizeMode(QHeaderView::ResizeToContents);

	/* Connect UI controls */
	connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotNameEdited(const QString&)));
	connect(m_add, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
	connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
	connect(m_raise, SIGNAL(clicked()), this, SLOT(slotRaiseClicked()));
	connect(m_lower, SIGNAL(clicked()), this, SLOT(slotLowerClicked()));
	
	/* Create a copy of the original chaser so that we can freely modify
	   it and keep a pointer to the original so that we can move the
	   contents from the copied chaser to the original when OK is clicked */
	m_chaser = new Chaser(this);
	m_chaser->copyFrom(chaser);
	Q_ASSERT(m_chaser != NULL);
	m_original = chaser;

	/* Name edit */
	m_nameEdit->setText(m_chaser->name());
	m_nameEdit->setSelection(0, m_nameEdit->text().length());
	setWindowTitle(tr("Chaser - %1").arg(m_chaser->name()));

	/* Bus */
	connect(m_busCombo, SIGNAL(activated(int)),
		this, SLOT(slotBusComboActivated(int)));
	fillBusCombo();

	/* Running order */
	switch (m_chaser->runOrder())
	{
	default:
	case Chaser::Loop:
		m_loop->setChecked(true);
		break;
	case Chaser::PingPong:
		m_pingPong->setChecked(true);
		break;
	case Chaser::SingleShot:
		m_singleShot->setChecked(true);
		break;
	}

	/* Running direction */
	switch (m_chaser->direction())
	{
	default:
	case Chaser::Forward:
		m_forward->setChecked(true);
		break;
	case Chaser::Backward:
		m_backward->setChecked(true);
		break;
	}

	/* Chaser steps */
	updateStepList(0);
}
Exemplo n.º 7
0
VCSliderProperties::VCSliderProperties(QWidget* parent, VCSlider* slider)
	: QDialog(parent)
{
	Q_ASSERT(slider != NULL);
	m_slider = slider;

	setupUi(this);

	/* General page connections */
	connect(m_modeBusRadio, SIGNAL(clicked()),
		this, SLOT(slotModeBusClicked()));
	connect(m_modeLevelRadio, SIGNAL(clicked()),
		this, SLOT(slotModeLevelClicked()));
	connect(m_modeSubmasterRadio, SIGNAL(clicked()),
		this, SLOT(slotModeSubmasterClicked()));

	/* Level page connections */
	connect(m_levelLowLimitSpin, SIGNAL(valueChanged(int)),
		this, SLOT(slotLevelLowSpinChanged(int)));
	connect(m_levelHighLimitSpin, SIGNAL(valueChanged(int)),
		this, SLOT(slotLevelHighSpinChanged(int)));
	connect(m_levelCapabilityButton, SIGNAL(clicked()),
		this, SLOT(slotLevelCapabilityButtonClicked()));
	connect(m_levelList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
		this, SLOT(slotLevelListClicked(QTreeWidgetItem*)));
	connect(m_levelAllButton, SIGNAL(clicked()),
		this, SLOT(slotLevelAllClicked()));
	connect(m_levelNoneButton, SIGNAL(clicked()),
		this, SLOT(slotLevelNoneClicked()));
	connect(m_levelInvertButton, SIGNAL(clicked()),
		this, SLOT(slotLevelInvertClicked()));
	connect(m_levelByGroupButton, SIGNAL(clicked()),
		this, SLOT(slotLevelByGroupClicked()));

	/*********************************************************************
	 * General page
	 *********************************************************************/

	/* Name */
	m_nameEdit->setText(m_slider->caption());

	/* Slider mode */
	switch (m_slider->sliderMode())
	{
	default:
	case VCSlider::Bus:
		m_modeBusRadio->setChecked(true);
		slotModeBusClicked();
		break;
	case VCSlider::Level:
		m_modeLevelRadio->setChecked(true);
		slotModeLevelClicked();
		break;
	case VCSlider::Submaster:
		m_modeSubmasterRadio->setChecked(true);
		slotModeLevelClicked();
		break;
	}

	/* Slider movement (Qt understands inverted appearance vice versa) */
	if (m_slider->invertedAppearance() == true)
		m_sliderMovementInvertedRadio->setChecked(true);
	else
		m_sliderMovementNormalRadio->setChecked(true);

	/* Value display style */
	switch (m_slider->valueDisplayStyle())
	{
	default:
	case VCSlider::ExactValue:
		m_valueExactRadio->setChecked(true);
		break;
	case VCSlider::PercentageValue:
		m_valuePercentageRadio->setChecked(true);
		break;
	}

	/********************************************************************
	 * External input
	 ********************************************************************/
	m_inputUniverse = m_slider->inputUniverse();
	m_inputChannel = m_slider->inputChannel();
	updateInputUniverseChannel();

	connect(m_chooseInputButton, SIGNAL(clicked()),
		this, SLOT(slotChooseInputClicked()));

	/*********************************************************************
	 * Bus page
	 *********************************************************************/

	/* Bus combo contents */
	fillBusCombo();

	/* Bus value limit spins */
	m_busLowLimitSpin->setValue(m_slider->busLowLimit());
	m_busHighLimitSpin->setValue(m_slider->busHighLimit());

	/*********************************************************************
	 * Level page
	 *********************************************************************/

	/* Level limit spins */
	m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
	m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

	/* Tree widget columns */
	QStringList labels;
	labels << "Name" << "Type" << "Range";
	m_levelList->setHeaderLabels(labels);
	m_levelList->header()->setResizeMode(QHeaderView::ResizeToContents);

	/* Tree widget contents */
	levelUpdateFixtures();
	levelUpdateChannelSelections();
}