diff options
author | RJ Ryan <rryan@mixxx.org> | 2015-12-17 09:00:35 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2015-12-20 20:52:43 -0500 |
commit | 882a9e2605de86df7f50f8c2f8ea7bf09ba7bebb (patch) | |
tree | eb2ce100ac36f65fb58bf4e9741a689641610d3d /src/controllers/bulk/bulkcontroller.cpp | |
parent | a985599fab36d4abec507bfadcd5e00e872690e2 (diff) |
Add timestamps to controller messages.
* PortMIDI uses OS-provided millisecond-level timestamp.
* HSS1394, HID, and bulk use Mixxx's internal clock to timestamp
messages as they are received by Mixxx. We should work with these
library owners to get access to better timestamps.
Diffstat (limited to 'src/controllers/bulk/bulkcontroller.cpp')
-rw-r--r-- | src/controllers/bulk/bulkcontroller.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/controllers/bulk/bulkcontroller.cpp b/src/controllers/bulk/bulkcontroller.cpp index 5b6b446e8a..68ddd28e30 100644 --- a/src/controllers/bulk/bulkcontroller.cpp +++ b/src/controllers/bulk/bulkcontroller.cpp @@ -13,6 +13,7 @@ #include "controllers/controllerdebug.h" #include "util/compatibility.h" #include "util/trace.h" +#include "util/time.h" BulkReader::BulkReader(libusb_device_handle *handle, unsigned char in_epaddr) : QThread(), @@ -52,7 +53,7 @@ void BulkReader::run() { Trace process("BulkReader process packet"); //qDebug() << "Read" << result << "bytes, pointer:" << data; QByteArray outData((char*)data, transferred); - emit(incomingData(outData)); + emit(incomingData(outData, Time::elapsedDuration())); } } qDebug() << "Stopped Reader"; @@ -186,8 +187,8 @@ int BulkController::open() { m_pReader = new BulkReader(m_phandle, in_epaddr); m_pReader->setObjectName(QString("BulkReader %1").arg(getName())); - connect(m_pReader, SIGNAL(incomingData(QByteArray)), - this, SLOT(receive(QByteArray))); + connect(m_pReader, SIGNAL(incomingData(QByteArray, mixxx::Duration)), + this, SLOT(receive(QByteArray, mixxx::Duration))); // Controller input needs to be prioritized since it can affect the // audio directly, like when scratching @@ -210,8 +211,8 @@ int BulkController::close() { qWarning() << "BulkReader not present for" << getName() << "yet the device is open!"; } else { - disconnect(m_pReader, SIGNAL(incomingData(QByteArray)), - this, SLOT(receive(QByteArray))); + disconnect(m_pReader, SIGNAL(incomingData(QByteArray, mixxx::Duration)), + this, SLOT(receive(QByteArray, mixxx::Duration))); m_pReader->stop(); controllerDebug(" Waiting on reader to finish"); m_pReader->wait(); |