Exemple #1
0
void WaveformView::mouseReleaseEvent(QMouseEvent *event)
{
    if (fDoc && fDoc->GetAudioPlayer() && fAudioStopFrame < 0)
		fDoc->GetAudioPlayer()->stop();

    if (event->button() == Qt::RightButton && fSelectedPhrase)
    {
        // determine the mood for this sentence
        MoodDialog *dlog = new MoodDialog(this);
        if (dlog->exec() == QDialog::Accepted)
        {
            fSelectedPhrase->fMood = dlog->MoodString();
        }
        delete dlog;
    }
	if (event->button() == Qt::RightButton && fSelectedWord)
	{
		// manually enter the pronunciation for this word
		BreakdownDialog *dlog = new BreakdownDialog(fSelectedWord, this);
		if (dlog->exec() == QDialog::Accepted)
		{
			fDoc->fDirty = true;
			while (!fSelectedWord->fPhonemes.isEmpty())
				delete fSelectedWord->fPhonemes.takeFirst();
			QStringList phList = dlog->PhonemeString().split(' ', QString::SkipEmptyParts);
			for (int i = 0; i < phList.size(); i++)
			{
				QString phStr = phList.at(i);
				if (phStr.isEmpty())
					continue;
				LipsyncPhoneme *phoneme = new LipsyncPhoneme;
				phoneme->fText = phStr;
				fSelectedWord->fPhonemes << phoneme;
			}
			if (fParentPhrase)
				fParentPhrase->RepositionWord(fSelectedWord);
			update();
		}
		delete dlog;
	}
	fScrubFrame = -1;
	fCurFrame = -1;
	fDragging = false;
	fDraggingEnd = -1;
	fSelectedPhrase = NULL;
	fSelectedWord = NULL;
	fSelectedPhoneme = NULL;
	emit(frameChanged(0));
	update();
}
	void AccountActionsManager::handleAccountSetMood ()
	{
		IAccount *account = GetAccountFromSender (sender (), Q_FUNC_INFO);
		if (!account)
			return;

		QObject *obj = sender ()->property ("Azoth/AccountObject").value<QObject*> ();
		ISupportMood *mood = qobject_cast<ISupportMood*> (obj);
		if (!mood)
		{
			qWarning () << Q_FUNC_INFO
					<< obj
					<< "doesn't support mood";
			return;
		}

		MoodDialog dia (MW_);
		if (dia.exec () != QDialog::Accepted)
			return;

		mood->SetMood (dia.GetMood (), dia.GetText ());
	}