コード例 #1
0
ファイル: audiohandler.cpp プロジェクト: Kalarel/leechcraft
	void AudioHandler::Handle (const Entity&, const NotificationRule& rule)
	{
		if (!XmlSettingsManager::Instance ()
				.property ("EnableAudioNots").toBool ())
			return;

		QString fname = rule.GetAudioParams ().Filename_;
		if (fname.isEmpty ())
			return;

		if (!fname.contains ('/'))
		{
			const QString& option = XmlSettingsManager::Instance ()
					.property ("AudioTheme").toString ();
			const QString& base = option + '/' + fname;

			QStringList pathVariants;
			pathVariants << base + ".ogg"
					<< base + ".wav"
					<< base + ".flac"
					<< base + ".mp3";

			fname = Core::Instance ().GetAudioThemeLoader ()->GetPath (pathVariants);
		}

		const auto& now = QDateTime::currentDateTime ();
		if (LastNotify_ [fname].msecsTo (now) < 1000)
			return;

		LastNotify_ [fname] = now;

		const Entity& e = Util::MakeEntity (fname, QString (), Internal);
		Core::Instance ().SendEntity (e);
	}
コード例 #2
0
ファイル: audiohandler.cpp プロジェクト: devel29a/leechcraft
	void AudioHandler::Handle (const Entity&, const NotificationRule& rule)
	{
		if (!XmlSettingsManager::Instance ()
				.property ("EnableAudioNots").toBool ())
			return;

		const auto& fname = AudioThemeMgr_->GetAbsoluteFilePath (rule.GetAudioParams ().Filename_);

		const auto& now = QDateTime::currentDateTime ();
		if (LastNotify_ [fname].msecsTo (now) < 1000)
			return;

		LastNotify_ [fname] = now;

		const auto& e = Util::MakeEntity (fname, QString (), Internal);
		GH_->GetProxy ()->GetEntityManager ()->HandleEntity (e);
	}
コード例 #3
0
ファイル: audiohandler.cpp プロジェクト: ForNeVeR/leechcraft
	void AudioHandler::Handle (const Entity&, const NotificationRule& rule)
	{
		if (!XmlSettingsManager::Instance ()
				.property ("EnableAudioNots").toBool ())
			return;

		QString fname = rule.GetAudioParams ().Filename_;
		if (fname.isEmpty ())
			return;

		if (!fname.contains ('/'))
			fname = Core::Instance ().GetAbsoluteAudioPath (fname);

		const auto& now = QDateTime::currentDateTime ();
		if (LastNotify_ [fname].msecsTo (now) < 1000)
			return;

		LastNotify_ [fname] = now;

		const Entity& e = Util::MakeEntity (fname, QString (), Internal);
		Core::Instance ().SendEntity (e);
	}