예제 #1
0
파일: vcslider.cpp 프로젝트: speakman/qlc
void VCSlider::setSliderMode(SliderMode mode)
{
	Q_ASSERT(mode >= Bus && mode <= Submaster);

	/* Disconnect these to prevent double callbacks and non-essential
	   signals (with Level & Submaster modes) */
	disconnect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)),
		   this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));	
	disconnect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)),
		   this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));

	m_sliderMode = mode;

	if (mode == Bus)
	{
		/* Set the slider range */
		m_slider->setRange(busLowLimit() * KFrequency, 
				   busHighLimit() * KFrequency);

		/* Reconnect to bus emitter */
		connect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)),
			this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));
		connect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)),
			this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));

		m_bottomLabel->hide();
		m_tapButton->show();

		m_time->start();
	}
예제 #2
0
void VCSlider::setSliderMode(SliderMode mode)
{
    Q_ASSERT(mode >= Bus && mode <= Submaster);

    /* Disconnect these to prevent double callbacks and non-needes signals */
    disconnect(Bus::instance(), SIGNAL(nameChanged(quint32, const QString&)),
               this, SLOT(slotBusNameChanged(quint32, const QString&)));
    disconnect(Bus::instance(), SIGNAL(valueChanged(quint32, quint32)),
               this, SLOT(slotBusValueChanged(quint32, quint32)));

    /* Unregister this as a DMX source if the new mode is not "Level" */
    if (m_sliderMode == Level && mode != Level)
        _app->masterTimer()->unregisterDMXSource(this);

    m_sliderMode = mode;

    if (mode == Bus)
    {
        /* Set the slider range */
        m_slider->setRange(busLowLimit() * MasterTimer::frequency(),
                           busHighLimit() * MasterTimer::frequency());
        setSliderValue(Bus::instance()->value(bus()));
        slotSliderMoved(sliderValue());

        /* Reconnect to bus emitter */
        connect(Bus::instance(), SIGNAL(nameChanged(quint32, const QString&)),
                this, SLOT(slotBusNameChanged(quint32, const QString&)));
        connect(Bus::instance(), SIGNAL(valueChanged(quint32, quint32)),
                this, SLOT(slotBusValueChanged(quint32, quint32)));

        m_bottomLabel->hide();
        m_tapButton->show();

        m_time->start();
    }
예제 #3
0
VCDockSlider::VCDockSlider(QWidget* parent, t_bus_id bus) : QFrame(parent)
{
	m_updateOnly = false;
	m_busLowLimit = 0;
	m_busHighLimit = 5;

	setupUi(this);
	layout()->setMargin(0);

	setBusID(bus);

	setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);

	// Receive bus name change signals
	connect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)),
		this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));
	
	// Receive bus value change signals
	connect(Bus::emitter(),	SIGNAL(valueChanged(t_bus_id, t_bus_value)),
		this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));

	/* Slider dragging */
	connect(m_slider, SIGNAL(valueChanged(int)),
		this, SLOT(slotSliderValueChanged(int)));

	/* Tap button clicks */
	connect(m_tapButton, SIGNAL(clicked()),
		this, SLOT(slotTapButtonClicked()));
	
	m_time.start();
}
예제 #4
0
int VCSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = VCWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotModeChanged((*reinterpret_cast< Doc::Mode(*)>(_a[1]))); break;
        case 1: slotBusValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2]))); break;
        case 2: slotBusNameChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 3: slotFixtureRemoved((*reinterpret_cast< t_fixture_id(*)>(_a[1]))); break;
        case 4: slotSliderMoved((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: slotTapButtonClicked(); break;
        case 6: slotInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2])),(*reinterpret_cast< uchar(*)>(_a[3]))); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
예제 #5
0
void VCDockSlider::setBusID(t_bus_id id)
{
	QString name;
	
	Q_ASSERT(id >= KBusIDMin && id < KBusCount);

	m_slider->setRange(m_busLowLimit * KFrequency,
			   m_busHighLimit * KFrequency);

	// Set slider value
	m_busID = id;
	slotBusValueChanged(m_busID, Bus::value(m_busID));

	// Set slider name to the tap button
	name = Bus::name(m_busID);
	if (name.simplified().isEmpty() == true)
		name.sprintf("Bus %.2d", m_busID + 1);

	m_tapButton->setText(name);
}
예제 #6
0
EFX::EFX(QObject* parent) : Function(parent, Function::EFX)
{
	pointFunc = NULL;

	m_width = 127;
	m_height = 127;
	m_xOffset = 127;
	m_yOffset = 127;
	m_rotation = 0;

	m_xFrequency = 2;
	m_yFrequency = 3;
	m_xPhase = 1.5707963267;
	m_yPhase = 0;

	m_propagationMode = Parallel;

	m_runOrder = EFX::Loop;
	m_direction = EFX::Forward;

	m_startSceneID = KNoID;
	m_startSceneEnabled = false;

	m_stopSceneID = KNoID;
	m_stopSceneEnabled = false;

	m_previewPointArray = NULL;

	m_algorithm = KCircleAlgorithmName;

	m_stepSize = 0;

	setName(tr("New EFX"));

	/* Set Default Fade as the speed bus */
	setBus(KBusIDDefaultFade);
	connect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id,t_bus_value)),
		this, SLOT(slotBusValueChanged(t_bus_id,t_bus_value)));
}
예제 #7
0
EFX::EFX(Doc* doc) : Function(doc)
{
	pointFunc = NULL;

	m_width = 127;
	m_height = 127;
	m_xOffset = 127;
	m_yOffset = 127;
	m_rotation = 0;

	m_xFrequency = 2;
	m_yFrequency = 3;
	m_xPhase = M_PI / 2.0;
	m_yPhase = 0;

	m_propagationMode = Parallel;

	m_startSceneID = Function::invalidId();
	m_startSceneEnabled = false;

	m_stopSceneID = Function::invalidId();
	m_stopSceneEnabled = false;

	m_algorithm = KCircleAlgorithmName;

	m_stepSize = 0;

	setName(tr("New EFX"));

	/* Set Default Fade as the speed bus */
	setBus(Bus::defaultFade());
	connect(Bus::instance(), SIGNAL(valueChanged(quint32,quint32)),
		this, SLOT(slotBusValueChanged(quint32,quint32)));

	// Listen to start/stop scene removals
	connect(doc, SIGNAL(functionRemoved(t_function_id)),
		this, SLOT(slotFunctionRemoved(t_function_id)));
}
예제 #8
0
void EFX::start()
{
	/* Set initial speed */
	slotBusValueChanged(m_busID, Bus::value(m_busID));
	Function::start();
}
예제 #9
0
void VCDockSlider::setMode(Mode m)
{
  m_mode = m;

  switch (m)
    {
    case Speed:
      {
	t_bus_value value;
	Bus::value(m_busID, value);
	//
	// Set name label
	//
	QString name = Bus::name(m_busID);
	if (name == QString::null)
	  {
	    name.sprintf("%.2d", m_busID + 1);
	  }
	
	m_tapInButton->setText(name);
	
	connect(Bus::emitter(), SIGNAL(nameChanged(t_bus_id, const QString&)),
		this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));
	
	connect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)),
		this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));
	
	m_slider->setRange(m_busLowLimit * KFrequency, 
			   m_busHighLimit * KFrequency);

	m_infoLabel->hide();
	m_tapInButton->show();

	m_time.start();

	slotBusValueChanged(m_busID, value);
      }
      break;

    case Level:
      {
	disconnect(Bus::emitter(),SIGNAL(nameChanged(t_bus_id,const QString&)),
		this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));
	
	disconnect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)),
		   this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));

	m_slider->setRange(m_levelLowLimit, m_levelHighLimit);
	slotSliderValueChanged(m_slider->value());

	m_infoLabel->show();
	m_tapInButton->hide();
      }
      break;

    case Submaster:
      {
	disconnect(Bus::emitter(),SIGNAL(nameChanged(t_bus_id,const QString&)),
		this, SLOT(slotBusNameChanged(t_bus_id, const QString&)));
	
	disconnect(Bus::emitter(), SIGNAL(valueChanged(t_bus_id, t_bus_value)),
		   this, SLOT(slotBusValueChanged(t_bus_id, t_bus_value)));

	m_slider->setRange(0, 100);
	slotSliderValueChanged(m_slider->value());

	m_infoLabel->show();
	m_tapInButton->hide();
      }
      break;
    }
}
예제 #10
0
void EFX::preRun(MasterTimer* timer)
{
	/* Set initial speed */
	slotBusValueChanged(m_busID, Bus::instance()->value(m_busID));
	Function::preRun(timer);
}