MadaoWindow::MadaoWindow() { audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); mediaObject = new Phonon::MediaObject(this); musicGetter = new Phonon::MediaObject(this); connect(mediaObject, SIGNAL(aboutToFinish()), this, SLOT(autoNext())); connect(musicGetter, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(metaStateChanged(Phonon::State,Phonon::State))); connect(mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(stateChanged(Phonon::State,Phonon::State))); connect(mediaObject, SIGNAL(currentSourceChanged(Phonon::MediaSource)), this, SLOT(sourceChanged(Phonon::MediaSource))); Phonon::createPath(mediaObject, audioOutput); setAllActions(); setGui(); resize(720,480); setMinimumSize(720,480); playing = false; set = false; currentSong = 0; songsNumber = 0; addToTable = 0; lastRow = 0; QIcon icon("Data/taizo_hasegawa_2564.jpg"); setWindowIcon(icon); }
void Widget::reverseStart() { //If last message, play hide animation. if (m_messageQueue.size() <= 1) { QPropertyAnimation* bounceAnim = qobject_cast<QPropertyAnimation*>(m_animation.animationAt(1)); if(bounceAnim) { if(bounceAnim->state() == QAbstractAnimation::Running){ return; } } if (!m_messageQueue.isEmpty()){ if(m_animation.animationAt(1)){ doneBounce(); } m_messageQueue.pop_front(); } unsigned int duration = m_settings.get("gui/out_animation_duration").toInt(); QPropertyAnimation* anim = qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0)); if (!anim) { return; } disconnect(anim, SIGNAL(valueChanged(QVariant)), this, m_activePositionSlot.c_str()); anim->setDirection(QAnimationGroup::Backward); anim->setEasingCurve(QEasingCurve::Type(m_settings.get("gui/out_animation").toInt())); anim->setDuration(duration); anim->setCurrentTime(duration); connect(anim, SIGNAL(valueChanged(QVariant)), this, m_activePositionSlot.c_str()); anim->start(); //m_shortcutGrabber.disableShortcuts(); } else { autoNext(); } }