本文整理汇总了C++中MyRect::setVol方法的典型用法代码示例。如果您正苦于以下问题:C++ MyRect::setVol方法的具体用法?C++ MyRect::setVol怎么用?C++ MyRect::setVol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyRect
的用法示例。
在下文中一共展示了MyRect::setVol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_sndVol_valueChanged
void MainWindow::on_sndVol_valueChanged(int value)
{
ScreenQGV::EditorType edType = ui->graphicsView->editorType();
if(edType == ScreenQGV::MAP || edType == ScreenQGV::SCENE)
{
MyRect * r = MyRect::m_selectedRect;
r->setVol(value);
}
else
{
ui->graphicsView->setRewardSoundVolume(value);
}
}
示例2: on_addSnd_clicked
void MainWindow::on_addSnd_clicked()
{
ScreenQGV::EditorType edType = ui->graphicsView->editorType();
QString selfilter = tr("All files (*.wav)");
QString filename = QFileDialog::getOpenFileName(
this,
QString("Select Sound"),
QString(""),
tr("All files (*.wav)" ),
&selfilter
);
if(filename.isEmpty())
return;
QString newFile = m_fileManager.copyFile(filename, FileManager::OTHERSND);
if(edType == ScreenQGV::MAP || edType == ScreenQGV::SCENE)
{
MyRect * r = MyRect::m_selectedRect;
r->setSndFilepath(newFile);
r->setVol(50);
r->setPitch(1);
}
else
{
cout << "sound file is " << filename.toStdString() << endl;
ui->graphicsView->setRewardSoundFile(newFile.toStdWString());
ui->graphicsView->setRewardSoundVolume(ui->sndVol->value());
ui->graphicsView->setRewardSoundPitch(1);
QString qS = QString::fromStdWString(ui->graphicsView->getRewardSoundFile());
cout << "screen's sound file is " << qS.toStdString() << endl;
}
ui->addSnd->setHidden(true);
ui->delSnd->setHidden(false);
ui->sndVolWidg->setHidden(false);
}