[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/kmid/src
From: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas () gmail ! com>
Date: 2010-07-31 10:24:54
Message-ID: 20100731102454.12CCEAC783 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1157511 by pedrol:
kmid_part fix: dbus signals tick() and tempoEvent()
M +9 -3 kmid_part.cpp
M +3 -3 kmid_part.h
--- trunk/extragear/multimedia/kmid/src/kmid_part.cpp #1157510:1157511
@@ -69,7 +69,8 @@
m_autoStart(true),
m_volfactor(1.0),
m_playerReady(false),
- m_playPending(false)
+ m_playPending(false),
+ m_tempo(0.0)
{
if (parentWidget != 0)
m_view = new KMidPartView(parentWidget);
@@ -100,6 +101,7 @@
bool m_playerReady;
bool m_playPending;
QMutex m_connmutex;
+ double m_tempo;
};
KMidPart::KMidPart( QWidget *parentWidget, QObject *parent, const QVariantList& args )
@@ -288,8 +290,6 @@
SLOT(slotSourceChanged(QString)));
connect(d->m_midiobj, SIGNAL(beat(int,int,int)),
SIGNAL(beat(int,int,int)));
- connect(d->m_midiobj, SIGNAL(tempoChanged(qreal)),
- SIGNAL(tempoEvent(qreal)));
connect(d->m_midiobj, SIGNAL(timeSignatureChanged(int,int)),
SIGNAL(timeSignatureEvent(int,int)));
connect(d->m_midiobj, SIGNAL(midiText(int,const QString&)),
@@ -417,7 +417,12 @@
if (d->m_view != 0)
d->m_view->setPosition(ticks);
emit tick(ticks);
+ double rtempo = d->m_midiobj->currentTempo();
+ if (rtempo != d->m_tempo) {
+ d->m_tempo = rtempo;
+ emit tempoEvent(rtempo);
}
+}
void KMidPart::slotFinished()
{
@@ -522,6 +527,7 @@
QMutexLocker locker(&d->m_connmutex);
if (d->m_view != 0)
d->m_view->setPosition(0);
+ d->m_tempo = 0;
if (d->m_autoStart) {
if (d->m_playerReady) {
locker.unlock();
--- trunk/extragear/multimedia/kmid/src/kmid_part.h #1157510:1157511
@@ -258,7 +258,7 @@
*
* @param changed tempo, including the applied tempo factor
*/
- void tempoEvent(qreal tempo);
+ void tempoEvent(double tempo);
/**
* Emitted when a time signature (rhythm specification) is played
@@ -349,7 +349,7 @@
*
* @param time The position of the media file in ticks.
*/
- void tick(qint64 time);
+ void tick(qlonglong time);
/**
* Emitted when the track has finished playback.
@@ -361,7 +361,7 @@
*
* @param source the new loaded track
*/
- void sourceChanged(QString source);
+ void sourceChanged(const QString& source);
private slots:
void slotLoaded(Backend *backend, const QString& library, const QString& name);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic