Ejemplo n.º 1
0
void VoxSynth::setVol( byte vol )
{
   super::setVol( vol );
   if ( ! muted() )
      for ( byte i = 0; i < numVox; i++ )   
         vox[i]->setGlobVol( vol );
}
void MediaStreamTrack::trackMutedChanged()
{
    if (stopped())
        return;

    if (muted())
        scheduleEventDispatch(Event::create(eventNames().muteEvent, false, false));
    else
        scheduleEventDispatch(Event::create(eventNames().unmuteEvent, false, false));

    configureTrackRendering();
}
Ejemplo n.º 3
0
void TelegramGui::setMute(int id, bool stt)
{
    if( p->userdata->isMuted(id) == stt )
        return;

    if( stt )
        p->userdata->addMute(id);
    else
        p->userdata->removeMute(id);

    emit muted(id, stt);
}
Ejemplo n.º 4
0
/*
 * Mute/unmute volume
 */
bool
Control::mute()
{
	if (muted()) {
		if (setvolume(mutevolume)) {
			mutevolume = 0;
		}
	} else {
		if (setvolume(0)) {
			mutevolume = st->volume;
		}
	}

	return get_error_bool();
}
Ejemplo n.º 5
0
int Y8950Adpcm::calcSample()
{
	// This table values are from ymdelta.c by Tatsuyuki Satoh.
	static const int F1[16] = { 1,   3,   5,   7,   9,  11,  13,  15,
				   -1,  -3,  -5,  -7,  -9, -11, -13, -15};
	static const int F2[16] = {57,  57,  57,  57,  77, 102, 128, 153,
				   57,  57,  57,  57,  77, 102, 128, 153};
	
	if (muted()) {
		return 0;
	}
	nowStep += step;
	if (nowStep >= MAX_STEP) {
		int nowLeveling;
		do {
			nowStep -= MAX_STEP;
			unsigned long val;
			if (!(playAddr & 1)) {
				// n-th nibble
				int tmp = playAddr / 2;
				if (romBank || (tmp >= ramSize)) {
					reg15 = 0xFF;
				} else {
					reg15 = ramBank[tmp];
				}
				val = reg15 >> 4;
			} else {
				// (n+1)-th nibble
				val = reg15 & 0x0F;
			}
			int prevOut = out;
			out = CLAP(DECODE_MIN, out + (diff * F1[val]) / 8,
			           DECODE_MAX);
			diff = CLAP(DMIN, (diff * F2[val]) / 64, DMAX);
			int deltaNext = out - prevOut;
			nowLeveling = nextLeveling;
			nextLeveling = prevOut + deltaNext / 2;
		
			playAddr++;
			if (playAddr > stopAddr) {
				if (reg7 & R07_REPEAT) {
					restart();
				} else {
					playing = false;
					//y8950.setStatus(Y8950::STATUS_EOS);
				}
			}
		} while (nowStep >= MAX_STEP);
Ejemplo n.º 6
0
TrayIcon::TrayIcon()
: restore_(new QAction(tr("&Restore"), this)),
  settings_(new QAction(tr("&Settings"), this)),
  mute_(new QAction(tr("&Mute"), this)),
  about_(new QAction(tr("&About..."), this)),
  aboutQt_(new QAction(tr("About Qt"), this)),
  exit_(new QAction(tr("&Quit"), this)),
  trayMenu_(new QMenu()),
  currentIcon_(QString()),
  geometery_(QRect()),
  iconPosition_(QCursor::pos()),
#ifdef HAVE_KDE
  newTrayIcon_(KStatusNotifierItemPtr()),
#endif
  legacyTrayIcon_(QSystemTrayIconPtr())
{
	bool newInterface(false);
#ifdef HAVE_KDE
	QDBusInterface iface(KSNI_SERVICE, KSNI_PATH, KSNI_IFACE);
	if (iface.isValid()) {
		newInterface = true;
		newTrayIcon_ = KStatusNotifierItemPtr(new KStatusNotifierItem(APP_NAME, this));
		newTrayIcon_->setStatus(KStatusNotifierItem::Active);
		newTrayIcon_->setTitle(ICON_TITLE);
#ifdef KDE_4
		newTrayIcon_->setContextMenu(static_cast<KMenu*>(trayMenu_));
#else
		newTrayIcon_->setContextMenu(trayMenu_);
#endif
		connect(newTrayIcon_.data(), &KStatusNotifierItem::activateRequested, this, &TrayIcon::kdeIconActivated);
		connect(newTrayIcon_.data(), &KStatusNotifierItem::secondaryActivateRequested, this, &TrayIcon::iconActivatedSecondary);
		connect(newTrayIcon_.data(), &KStatusNotifierItem::scrollRequested, this, &TrayIcon::onScroll);
	}
#endif
#ifdef ISDEBUG
	qDebug() << "NewIcon " << newInterface;
#endif
	if (!newInterface) {
		legacyTrayIcon_ = QSystemTrayIconPtr(new QSystemTrayIcon(this));
		connect(legacyTrayIcon_.data(), &QSystemTrayIcon::activated,
			this, &TrayIcon::iconActivated);
		legacyTrayIcon_->setContextMenu(trayMenu_);
		legacyTrayIcon_->installEventFilter(this);
	}
	trayMenu_->addAction(restore_.data());
	connect(restore_.data(), &QAction::triggered, this, [this]{
								if (!legacyTrayIcon_) {
									iconPosition_ = QCursor::pos();
								}
								emit activated(RESTORE);});
	trayMenu_->addSeparator();
	trayMenu_->addAction(settings_.data());
	connect(settings_.data(), &QAction::triggered, this, [this]{emit activated(SETTINGS);});
	trayMenu_->addAction(mute_.data());
	mute_->setCheckable(true);
	connect(mute_.data(), &QAction::toggled, this, [this]{emit muted(mute_->isChecked());});
	trayMenu_->addSeparator();
	trayMenu_->addAction(about_.data());
	connect(about_.data(), &QAction::triggered, this, [this]{emit activated(ABOUT);});
	trayMenu_->addAction(aboutQt_.data());
	connect(aboutQt_.data(), &QAction::triggered, this, [this]{emit activated(ABOUTQT);});
	if (legacyTrayIcon_) {
		trayMenu_->addSeparator();
		trayMenu_->addAction(exit_.data());
		connect(exit_.data(), &QAction::triggered, this, [this]{emit activated(EXIT);});
	}
}
Ejemplo n.º 7
0
void Player::UnMute()
    {
        audioOutput->setVolume(volLevel);
        emit muted(false);
    }
Ejemplo n.º 8
0
void Player::Mute()
    {
        volLevel = audioOutput->volume();
        audioOutput->setVolume(0);
        emit muted(true);
    }