예제 #1
0
파일: engine.cpp 프로젝트: sssunsha/music
void Engine::spectrumChanged(const FrequencySpectrum &spectrum)
{
    ENGINE_DEBUG << "Engine::spectrumChanged" << "pos" << m_spectrumPosition;
    m_spectrum = spectrum;
    updateBars();
    //    emit spectrumChanged(m_spectrumPosition, m_spectrumBufferLength, spectrum);
}
void Spectrograph::setParams(int numBars, qreal lowFreq, qreal highFreq)
{
    Q_ASSERT(numBars > 0);
    Q_ASSERT(highFreq > lowFreq);
    m_bars.resize(numBars);
    m_lowFreq = lowFreq;
    m_highFreq = highFreq;
    updateBars();
}
예제 #3
0
파일: kernel.cpp 프로젝트: edmondas/ncwm
void Kernel::handleKeyPress(XKeyEvent *event) {

    event->state &= Binder::instance()->validModMask();

    if (isInputMode()) {
        focusedMonitor()->inputBar()->handleInput(event);
    }
    else {
        Binder::instance()->handleKey(event->root, event);
        updateBars();
    }
}
bool Plot3DDialog::updatePlot()
{
	int axis=-1;

	if (generalDialog->currentWidget()==(QWidget*)bars)
	{
		emit updateBars(boxBarsRad->text().toDouble());
	}

	if (generalDialog->currentWidget()==(QWidget*)points)
	{
		if (boxPointStyle->currentItem() == 0)
			emit updatePoints(boxSize->text().toDouble(), boxSmooth->isChecked());
		else if (boxPointStyle->currentItem() == 1)
			emit updateCross(boxCrossRad->text().toDouble(), boxCrossLinewidth->text().toDouble(),
					boxCrossSmooth->isChecked(), boxBoxed->isChecked());
		else if (boxPointStyle->currentItem() == 2)
			emit updateCones(boxConesRad->text().toDouble(), boxQuality->value());
	}

	if (generalDialog->currentWidget()==(QWidget*)title)
	{
		emit updateTitle(boxTitle->text(),titleColor,titleFont);
	}

	if (generalDialog->currentWidget()==(QWidget*)colors)
	{
		emit updateTransparency(boxTransparency->value()*0.01);
		emit updateDataColors(fromColor,toColor);
		emit updateColors(meshColor,axesColor,numColor,labelColor,bgColor,gridColor);
	}

	if (generalDialog->currentWidget()==(QWidget*)general)
	{
		emit showColorLegend(boxLegend->isChecked());
		emit updateMeshLineWidth(boxMeshLineWidth->value());
		emit adjustLabels(boxDistance->value());
		emit updateResolution (boxResolution->value());
		emit showColorLegend(boxLegend->isChecked());
		emit setNumbersFont(numbersFont);
		emit updateZoom(boxZoom->value()*0.01);
		emit updateScaling(boxXScale->value()*0.01,boxYScale->value()*0.01,
				boxZScale->value()*0.01);
	}

	if (generalDialog->currentWidget()==(QWidget*)scale)
	{
		axis=axesList->currentRow();
		QString from=boxFrom->text().toLower();
		QString to=boxTo->text().toLower();
		double start,end;
		bool error=false;
		try
		{
			MyParser parser;
			parser.SetExpr(from.toAscii().constData());
			start=parser.Eval();
		}
		catch(mu::ParserError &e)
		{
			QMessageBox::critical(0,tr("Start limit error"),  QString::fromStdString(e.GetMsg()));
			boxFrom->setFocus();
			error=true;
			return false;
		}
		try
		{
			MyParser parser;
			parser.SetExpr(to.toAscii().constData());
			end=parser.Eval();
		}
		catch(mu::ParserError &e)
		{
			QMessageBox::critical(0,tr("End limit error"), QString::fromStdString(e.GetMsg()));
			boxTo->setFocus();
			error=true;
			return false;
		}

		if (start>=end)
		{
			QMessageBox::critical(0,tr("Input error"),
					tr("Please enter scale limits that satisfy: from < to!"));
			boxTo->setFocus();
			return false;
		}

		if (! error)
			emit updateScale(axis,scaleOptions(axis, start, end,
						boxMajors->text(), boxMinors->text()));
	}

	if (generalDialog->currentWidget()==(QWidget*)axes)
	{
		axis=axesList2->currentRow();
		labels[axis] = boxLabel->text();
		emit updateLabel(axis, boxLabel->text(),axisFont(axis));
		emit updateTickLength(axis,boxMajorLength->text().toDouble(),
				boxMinorLength->text().toDouble());
	}

	return true;
}
void Spectrograph::spectrumChanged(const FrequencySpectrum &spectrum)
{
    m_spectrum = spectrum;
    updateBars();
}
예제 #6
0
MiniStatusWindow::MiniStatusWindow() :
    Window("MiniStatus", false, nullptr, "ministatus.xml"),
    InventoryListener(),
    AttributeListener(),
    StatListener(),
    ArrowsListener(),
    UpdateStatusListener(),
    mBars(),
    mBarNames(),
    mIcons(),
    // TRANSLATORS: status bar name
    mHpBar(createBar(0, 100, 0, Theme::HP_BAR, Theme::PROG_HP,
        "hpprogressbar.xml", "hpprogressbar_fill.xml",
        "hp bar", _("health bar"))),
    mMpBar(Net::getGameHandler()->canUseMagicBar()
        ? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic()
        ? Theme::MP_BAR : Theme::NO_MP_BAR,
        Net::getPlayerHandler()->canUseMagic()
        ? Theme::PROG_MP : Theme::PROG_NO_MP,
        Net::getPlayerHandler()->canUseMagic()
        ? "mpprogressbar.xml" : "nompprogressbar.xml",
        Net::getPlayerHandler()->canUseMagic()
        ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "mp bar", _("mana bar")) : nullptr),
    mXpBar(createBar(0, 100, 0, Theme::XP_BAR, Theme::PROG_EXP,
        "xpprogressbar.xml", "xpprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "xp bar", _("experience bar"))),
    mJobBar(nullptr),
    mWeightBar(createBar(0, 140, 0, Theme::WEIGHT_BAR, Theme::PROG_WEIGHT,
        "weightprogressbar.xml", "weightprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "weight bar", _("weight bar"))),
    mInvSlotsBar(createBar(0, 45, 0,
        Theme::SLOTS_BAR, Theme::PROG_INVY_SLOTS,
        "slotsprogressbar.xml", "slotsprogressbar_fill.xml",
        "inventory slots bar",
        // TRANSLATORS: status bar name
        _("inventory slots bar"))),
    mMoneyBar(createBar(0, 130, 0, Theme::MONEY_BAR, Theme::PROG_MONEY,
        "moneyprogressbar.xml", "moneyprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "money bar", _("money bar"))),
    mArrowsBar(createBar(0, 50, 0, Theme::ARROWS_BAR, Theme::PROG_ARROWS,
        "arrowsprogressbar.xml", "arrowsprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "arrows bar", _("arrows bar"))),
    mStatusBar(createBar(100, (config.getIntValue("fontSize") > 16
        ? 250 : 165), 0, Theme::STATUS_BAR, Theme::PROG_STATUS,
        "statusprogressbar.xml", "statusprogressbar_fill.xml",
        // TRANSLATORS: status bar name
        "status bar", _("status bar"))),
    mTextPopup(new TextPopup),
    mStatusPopup(new StatusPopup),
    mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3),
    mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3),
    mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2),
    mMaxX(0)
{
    mTextPopup->postInit();
    mStatusPopup->postInit();

    StatusWindow::updateHPBar(mHpBar);

    if (Net::getGameHandler()->canUseMagicBar() && statusWindow)
        statusWindow->updateMPBar(mMpBar);

    const int job = Net::getPlayerHandler()->getJobLocation()
        && serverConfig.getValueBool("showJob", true);

    StatusWindow::updateXPBar(mXpBar);

    if (job)
    {
        mJobBar = createBar(0, 100, 0, Theme::JOB_BAR, Theme::PROG_JOB,
            // TRANSLATORS: status bar name
            "jobprogressbar.xml", "jobprogressbar_fill.xml",
            "job bar", _("job bar"));
        StatusWindow::updateJobBar(mJobBar);
    }

    loadBars();
    updateBars();

    setVisible(true);
    addMouseListener(this);
    Inventory *const inv = PlayerInfo::getInventory();
    if (inv)
        inv->addInventoyListener(this);

    StatusWindow::updateMoneyBar(mMoneyBar);
    StatusWindow::updateArrowsBar(mArrowsBar);
    updateStatus();
}