Example #1
0
void SigLabel::mousePressEvent(QMouseEvent* event)
{
    int button = event->button();
    bool zaehler = event->x() < width() / 2;

    int zz = z, nn = n;
    switch (button)
    {
        case Qt::LeftButton:
            return;
        case Qt::MidButton:
            incValue(zaehler, false, zz, nn);
            break;
        case Qt::RightButton:
            incValue(zaehler, true, zz, nn);
            break;
        default:
            break;
    }
    if ((zz != z) || (nn != n))
    {
        setValue(zz, nn);
        emit valueChanged(TimeSignature(zz, nn));
    }
}
Example #2
0
File: sig.cpp Project: faesong/oom
	void SigList::clear()
	{
		for (iSigEvent i = begin(); i != end(); ++i)
			delete i->second;
		SIGLIST::clear();
		insert(std::pair<const unsigned, SigEvent*> (MAX_TICK, new SigEvent(TimeSignature(4, 4), 0)));
	}
Example #3
0
File: sig.cpp Project: faesong/oom
	TimeSignature SigList::timesig(unsigned tick) const
	{
		ciSigEvent i = upper_bound(tick);
		if (i == end())
		{
			printf("timesig(%d): not found\n", tick);
			// abort();
			return TimeSignature(4, 4);
		}
		return i->second->sig;
	}
Example #4
0
void SigLabel::wheelEvent(QWheelEvent* event)
{
    bool zaehler = event->x() < width() / 2;
    int delta = event->delta();
    int zz = z, nn = n;

    bool inc = delta >= 0;
    incValue(zaehler, inc, zz, nn);
    if ((zz != z) || (nn != n))
    {
        setValue(zz, nn);
        emit valueChanged(TimeSignature(zz, nn));
    }
}