From c374c8478626bb75c3730c5885aeb6eb37e1b529 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 30 Dec 2018 20:08:13 -0500 Subject: [PATCH] Fixed a bug that caused playback system to send according to file upon start up even though combobox said bus 0. --- frameplaybackobject.cpp | 3 ++- frameplaybackwindow.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frameplaybackobject.cpp b/frameplaybackobject.cpp index 5d41774..e6acd84 100644 --- a/frameplaybackobject.cpp +++ b/frameplaybackobject.cpp @@ -12,7 +12,7 @@ FramePlaybackObject::FramePlaybackObject() playbackActive = false; playbackForward = true; useOrigTiming = false; - whichBusSend = -1; + whichBusSend = 0; } FramePlaybackObject::~FramePlaybackObject() @@ -289,6 +289,7 @@ void FramePlaybackObject::setUseOriginalTiming(bool state) void FramePlaybackObject::setSendingBus(int bus) { + qDebug() << "Setting sending bus to " << bus; whichBusSend = bus; } diff --git a/frameplaybackwindow.cpp b/frameplaybackwindow.cpp index f303f9b..7cada2d 100644 --- a/frameplaybackwindow.cpp +++ b/frameplaybackwindow.cpp @@ -296,9 +296,14 @@ void FramePlaybackWindow::calculateWhichBus() { int idx = ui->comboCANBus->currentIndex(); int maxIdx = ui->comboCANBus->count() - 1; + if (maxIdx == 0) maxIdx = 2; int out = idx; + + qDebug() << idx << "***" << maxIdx; + if (idx == (maxIdx - 1) ) out = -1; if (idx == maxIdx) out = -2; + if (idx < 0) out = 0; playbackObject.setSendingBus(out); }