void
TransportControlGroup::_UpdateVolume()
{
	if (IsMuted())
		SetMuted(false);
	VolumeChanged(Volume());
}
void wgt_QVideoPlayer::s_VolumeChanged(int newValue) {
    #if QT_VERSION >= 0x050000
    audio_outputStream->setVolume(qreal(newValue)/100);
    VolumeLabel->setNum(newValue);
    ApplicationConfig->PreviewSoundVolume=qreal(newValue)/100;
    emit VolumeChanged();
    #endif
}
示例#3
0
文件: Settings.cpp 项目: OrN/dolphin
void Settings::SetVolume(int volume)
{
  if (GetVolume() != volume)
  {
    SConfig::GetInstance().m_Volume = volume;
    emit VolumeChanged(volume);
  }
}
示例#4
0
文件: Settings.cpp 项目: OrN/dolphin
void Settings::DecreaseVolume(int volume)
{
  AudioCommon::DecreaseVolume(volume);
  emit VolumeChanged(GetVolume());
}
示例#5
0
文件: makert.cpp 项目: sinis/MakeRT
// Constructor
MakeRT::MakeRT(QWidget *parent):
    QWidget(parent),
    _ui(new Ui::MakeRT),
    _audioOutput(new Phonon::AudioOutput(Phonon::MusicCategory, this)),
    _player(new Phonon::MediaObject(this)),
    _timer(new QTimer(this)),
    _settings(new QSettings(this)),
    _textNotificationWidget(new TextNotificationWidget(this)),
    _soundNotificationWidget(new SoundNotificationWidget(this, _player)),
    _timerSettingsWidget(new TimerSettingsWidget(this)),
    _messageBox(new QMessageBox(QMessageBox::Information, tr("Make reality test!"), "", QMessageBox::Ok, this))
  #ifndef Q_OS_SYMBIAN
  , _trayIcon(new QSystemTrayIcon(QIcon(":/icon.png"), this))
  #else
  , _textNotificationAction(new QAction(tr("Text notifications"), this)),
    _soundNotificationAction(new QAction(tr("Sound notification"), this)),
    _timerSettingsAction(new QAction(tr("Timer settings"), this)),
    _vibrationsMenu(new QMenu(tr("Vibrations"), this)),
    _vibrationsOnAction(new QAction(tr("On"), this)),
    _vibrationsOffAction(new QAction(tr("Off"), this)),
    _aboutQtAction(new QAction(tr("About Qt4"), this)),
    _quitAction(new QAction(tr("Quit"), this)),
    _menu(new QMenu(this)),
    _menuAction(new QAction(tr("Menu"), this)),
    _hideAction(new QAction(tr("Hide"), this))
  #endif // Q_OS_SYMBIAN
{
    if (!_instance)
        _instance = this;
    else return;

    _ui->setupUi(this);

#ifdef Q_OS_SYMBIAN
    _vibrator = CHWRMVibra::NewL();

    _vibrationsOnAction->setCheckable(true);
    //_vibrationsOnAction->setChecked(true);
    _vibrationsOffAction->setCheckable(true);
    QActionGroup *group = new QActionGroup(this);
    group->addAction(_vibrationsOnAction);
    group->addAction(_vibrationsOffAction);
    _vibrationsMenu->addActions(group->actions());

    addAction(_menuAction);
    addAction(_hideAction);
    _menu->addAction(_textNotificationAction);
    _menu->addAction(_soundNotificationAction);
    _menu->addAction(_timerSettingsAction);
    _menu->addMenu(_vibrationsMenu);
    _menu->addAction(_aboutQtAction);
    _menu->addAction(_quitAction);
    _menuAction->setMenu(_menu);
    _menuAction->setSoftKeyRole(QAction::PositiveSoftKey);
    _hideAction->setSoftKeyRole(QAction::NegativeSoftKey);

    connect(_textNotificationAction, SIGNAL(triggered()), _textNotificationWidget, SLOT(showMaximized()));
    connect(_soundNotificationAction, SIGNAL(triggered()), _soundNotificationWidget, SLOT(showMaximized()));
    connect(_timerSettingsAction, SIGNAL(triggered()), _timerSettingsWidget, SLOT(showMaximized()));
    connect(_vibrationsOnAction, SIGNAL(triggered()), this, SLOT(VibrationsEnabled()));
    connect(_vibrationsOffAction, SIGNAL(triggered()), this, SLOT(VibrationsEnabled()));
    connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
    connect(_quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
    connect(_hideAction, SIGNAL(triggered()), this, SLOT(lower()));

    _ui->about->setFocus();
#else
    _ui->tabWidget->addTab(_textNotificationWidget, tr("Text notifications settings"));
    _ui->tabWidget->addTab(_soundNotificationWidget, tr("Sound notification settigns"));
    _ui->tabWidget->addTab(_timerSettingsWidget, tr("Timer settings"));

    connect(_ui->quit, SIGNAL(clicked()), qApp, SLOT(quit()));
    connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(TrayIconClicked()));
    connect(_ui->startup, SIGNAL(toggled(bool)), this, SLOT(RunAtStartupEnabled(bool)));
    connect(_ui->tray, SIGNAL(toggled(bool)), this, SLOT(RunInTrayEnabled(bool)));

    _trayIcon->show();
#endif // Q_OS_SYMBIAN

    connect(_textNotificationWidget, SIGNAL(ActivationChanged(bool)), this, SLOT(TextMessageActivationChanged(bool)));
    connect(_textNotificationWidget, SIGNAL(TextMessageChanged(QString)), this, SLOT(TextMessageChanged(QString)));
    connect(_textNotificationWidget, SIGNAL(MessageListChanged(QStringList&)), this, SLOT(MessageListChanged(QStringList&)));
    connect(_textNotificationWidget, SIGNAL(ModeChanged(TextNotificationWidget::Mode)), this, SLOT(TextMessageModeChanged(TextNotificationWidget::Mode)));
    connect(_soundNotificationWidget, SIGNAL(ActivationChanged(bool)), this, SLOT(SoundNotificationActivationChanged(bool)));
    connect(_soundNotificationWidget, SIGNAL(FileNameChanged(QString)), this, SLOT(AudioFileNameChanged(QString)));
    connect(_timerSettingsWidget, SIGNAL(ModeChanged(TimerSettingsWidget::Mode)), this, SLOT(TimerModeChanged(TimerSettingsWidget::Mode)));
    connect(_timerSettingsWidget, SIGNAL(FixedIntervalChanged(int)), this, SLOT(FixedIntervalChanged(int)));
    connect(_timerSettingsWidget, SIGNAL(RandomIntervalChanged(int,int)), this, SLOT(RandomIntervalChanged(int,int)));
    connect(_timerSettingsWidget, SIGNAL(ModeChanged(TimerSettingsWidget::Mode)), this, SLOT(SetTimer()));
    connect(_timerSettingsWidget, SIGNAL(FixedIntervalChanged(int)), this, SLOT(SetTimer()));
    connect(_timerSettingsWidget, SIGNAL(RandomIntervalChanged(int,int)), this, SLOT(SetTimer()));
    connect(_audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(VolumeChanged(qreal)));

    connect(_timer, SIGNAL(timeout()), this, SLOT(Alarm()));

    Phonon::createPath(_player, _audioOutput);
    SetTimer();
    _soundNotificationWidget->SetAudioOutput(_audioOutput);

#ifndef Q_OS_SYMBIAN
    _trayIcon->show();
#endif // Q_OS_SYMBIAN

    LoadSettings();
    _ui->about->setHtml(tr("<b>MakeRT</b> is a simple application dedicated to a newbie lucid dreamers (<a href=\"http://en.wikipedia.org/wiki/Lucid_dream\">http://en.wikipedia.org/wiki/Lucid_dream</a>). It helps to reach a lucid dream by forming a habit of making reality checks.<br><br>\n"
                           "<b>Features:</b>\n"
                           "<ul><li>text notifications (single or randomly selected from list)\n"
                           "<li>sound notification (by plaing audio file)\n"
                           "<li>vibrations (only on Symbian)\n"
                           "<li>fixed or random interval between following notifications</ul><br><br>\n"
                           "<a href=\"mailto:[email protected]\">[email protected]</a>"));
    this->adjustSize();
    this->setWindowIcon(QIcon(":/icon.png"));
    this->setWindowTitle(QString("MakeRT v.") + qApp->applicationVersion());
}
void SoundComponent::SetVolume(float volume) {
    if(mSound.GetVolume() != volume) {
        mSound.SetVolume(volume);
        emit VolumeChanged(volume);
    }
}