diff --git a/src/ANT/ANT.cpp b/src/ANT/ANT.cpp index 1db37e8ca..e11370183 100644 --- a/src/ANT/ANT.cpp +++ b/src/ANT/ANT.cpp @@ -75,7 +75,7 @@ const ant_sensor_type_t ANT::ant_sensor_types[] = { { true, ANTChannel::CHANNEL_TYPE_TEMPE, ANT_SPORT_TEMPE_PERIOD, ANT_SPORT_TEMPE_TYPE, ANT_SPORT_FREQUENCY, ANT_SPORT_NETWORK_NUMBER, "Tempe", 't', ":images/IconTemp.png" }, { true, ANTChannel::CHANNEL_TYPE_CORETEMP, ANT_SPORT_CORETEMP_PERIOD, ANT_SPORT_CORETEMP_TYPE, - ANT_SPORT_FREQUENCY, ANT_SPORT_NETWORK_NUMBER, "CoreTemp", 't', ":images/IconCore.png" }, + ANT_SPORT_FREQUENCY, ANT_SPORT_NETWORK_NUMBER, "CoreTemp", 'e', ":images/IconCore.png" }, { false, ANTChannel::CHANNEL_TYPE_GUARD, 0, 0, 0, 0, "", '\0', "" } }; diff --git a/src/ANT/ANTChannel.cpp b/src/ANT/ANTChannel.cpp index c1eec76ef..eda13de31 100644 --- a/src/ANT/ANTChannel.cpp +++ b/src/ANT/ANTChannel.cpp @@ -904,7 +904,6 @@ void ANTChannel::broadcastEvent(unsigned char *ant_message) case CHANNEL_TYPE_CORETEMP: { - // Quality alternates messages so will need to remember last quality message // only use core temp if data is 'good' or better (just use >0 for now) if ( antMessage.coreTemp > 0 ) { diff --git a/src/ANT/ANTMessage.cpp b/src/ANT/ANTMessage.cpp index d0eed5848..3731ddd26 100644 --- a/src/ANT/ANTMessage.cpp +++ b/src/ANT/ANTMessage.cpp @@ -621,12 +621,15 @@ ANTMessage::ANTMessage(ANT *parent, const unsigned char *message) { case ANTChannel::CHANNEL_TYPE_CORETEMP: { + static int tmpQual=0; switch (data_page) { case 0: - tempQual = (message[6]&0x3); + // Quality only on intermittent messages so need to remember last quality message + tmpQual = (message[6]&0x3); break; case 1: + tempQual = tmpQual; uint16_t val=(message[7]+((message[8] & 0xf0)<<4)); if (val>0 && val != 0x800) skinTemp = val/20.0; diff --git a/src/Gui/GcCrashDialog.cpp b/src/Gui/GcCrashDialog.cpp index e4762f5a9..e3f937b13 100644 --- a/src/Gui/GcCrashDialog.cpp +++ b/src/Gui/GcCrashDialog.cpp @@ -286,6 +286,8 @@ QString GcCrashDialog::versionHTML() .arg("quicktime") #elif defined GC_VIDEO_QT5 .arg("qt5") +#elif defined GC_VIDEO_QT6 + .arg("qt6") #elif defined GC_VIDEO_VLC .arg("vlc") #else diff --git a/src/Train/RealtimeData.cpp b/src/Train/RealtimeData.cpp index 3e7070907..68090f53b 100644 --- a/src/Train/RealtimeData.cpp +++ b/src/Train/RealtimeData.cpp @@ -45,6 +45,7 @@ RealtimeData::RealtimeData() trainerConfigRequired = false; trainerBrakeFault = false; memset(spinScan, 0, 24); + temp = 0.0; } void RealtimeData::setName(char *name) @@ -530,7 +531,7 @@ double RealtimeData::value(DataSeries series) const case Temp: return temp; break; - + case CoreTemp: return coreTemp; break; diff --git a/src/Train/VideoLayoutParser.cpp b/src/Train/VideoLayoutParser.cpp index b6673c84f..8c4c1975a 100644 --- a/src/Train/VideoLayoutParser.cpp +++ b/src/Train/VideoLayoutParser.cpp @@ -23,11 +23,13 @@ #include #include +#include "Context.h" + #include "VideoLayoutParser.h" #include "MeterWidget.h" -VideoLayoutParser::VideoLayoutParser (QList* metersWidget, QList* layoutNames, QWidget* VideoContainer) - : metersWidget(metersWidget), layoutNames(layoutNames), VideoContainer(VideoContainer) +VideoLayoutParser::VideoLayoutParser (QList* metersWidget, QList* layoutNames, QWidget* VideoContainer, Context* context) + : metersWidget(metersWidget), layoutNames(layoutNames), VideoContainer(VideoContainer), context(context) { nonameindex = 0; skipLayout = false; @@ -191,7 +193,7 @@ bool VideoLayoutParser::startElement( const QString&, const QString&, } else if (meterType == QString("LiveMap")) { - meterWidget = new LiveMapWidget(meterName, containerWidget, source); + meterWidget = new LiveMapWidget(meterName, containerWidget, source, context); } else { diff --git a/src/Train/VideoLayoutParser.h b/src/Train/VideoLayoutParser.h index 70b99378d..d5e835cc7 100644 --- a/src/Train/VideoLayoutParser.h +++ b/src/Train/VideoLayoutParser.h @@ -23,6 +23,7 @@ #ifndef _VideoLayoutParser_h #define _VideoLayoutParser_h #include "GoldenCheetah.h" +class Context; #include #include @@ -32,7 +33,7 @@ class VideoLayoutParser : public QXmlDefaultHandler { public: - VideoLayoutParser(QList* metersWidget, QList* layoutNames, QWidget* VideoContainer); + VideoLayoutParser(QList* metersWidget, QList* layoutNames, QWidget* VideoContainer, Context* context); bool startElement( const QString&, const QString&, const QString&, const QXmlAttributes& ); bool endElement( const QString&, const QString&, const QString& ); @@ -42,6 +43,8 @@ public: int layoutPositionSelected; private: + Context *context; + QList* metersWidget; QList* layoutNames; QWidget* VideoContainer; diff --git a/src/Train/VideoWindow.cpp b/src/Train/VideoWindow.cpp index 1994d58f7..0a9c8c187 100644 --- a/src/Train/VideoWindow.cpp +++ b/src/Train/VideoWindow.cpp @@ -142,7 +142,7 @@ VideoWindow::VideoWindow(Context *context) : } #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // USE QT VIDEO PLAYER wd = new QVideoWidget(this); wd->show(); @@ -198,7 +198,7 @@ VideoWindow::~VideoWindow() vlcDispatch.Drain(); #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // QT MEDIA delete mp; delete wd; @@ -225,6 +225,10 @@ bool VideoWindow::hasActiveVideo() const if (mp->state() != QMediaPlayer::StoppedState) return true; #endif +#ifdef GC_VIDEO_QT6 + if (mp->playbackState() != QMediaPlayer::StoppedState) + return true; +#endif return false; } @@ -267,7 +271,7 @@ void VideoWindow::readVideoLayout(int pos, bool useDefault) } layoutNames.clear(); - VideoLayoutParser handler(&m_metersWidget, &layoutNames, container); + VideoLayoutParser handler(&m_metersWidget, &layoutNames, container, context); QXmlInputSource source(&file); QXmlSimpleReader reader; handler.layoutPositionSelected = pos; @@ -342,7 +346,7 @@ void VideoWindow::startPlayback() m_MediaChanged = false; #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // open the media object mp->play(); #endif @@ -398,7 +402,7 @@ void VideoWindow::startPlayback() } } #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // QT doesn't expose media frame rate so make due with duration. double videoSyncDuration = currentVideoSyncFile->duration(); if (videoSyncDuration > 0) { @@ -455,7 +459,7 @@ void VideoWindow::stopPlayback() vlcDispatch.AsyncCall([capture_mp]{ libvlc_media_player_stop(capture_mp); }); #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) mp->stop(); #endif } @@ -476,7 +480,7 @@ void VideoWindow::pausePlayback() vlcDispatch.AsyncCall([capture_mp]{libvlc_media_player_set_pause(capture_mp, true); }); #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) mp->pause(); #endif } @@ -499,7 +503,7 @@ void VideoWindow::resumePlayback() } #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) mp->play(); #endif @@ -798,7 +802,7 @@ void VideoWindow::telemetryUpdate(RealtimeData rtd) } #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) //TODO // // seek to ms position in current file // mp->setPosition(ms); @@ -831,7 +835,7 @@ void VideoWindow::seekPlayback(long ms) } #endif -#ifdef GC_VIDEO_QT5 +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) Q_UNUSED(ms) //TODO // // seek to ms position in current file @@ -891,6 +895,10 @@ void VideoWindow::mediaSelected(QString filename) // QT MEDIA mc = QMediaContent(QUrl::fromLocalFile(filename)); mp->setMedia(mc); +#endif +#ifdef GC_VIDEO_QT6 + // QT MEDIA + mp->setSource(QUrl::fromLocalFile(filename)); #endif if(context->isRunning) startPlayback(); } diff --git a/src/Train/VideoWindow.h b/src/Train/VideoWindow.h index 076ea6aa4..40c9ff391 100644 --- a/src/Train/VideoWindow.h +++ b/src/Train/VideoWindow.h @@ -40,7 +40,7 @@ #ifdef Q_OS_MAC // if we aint chosen one or the other then use quicktime -#if !defined GC_VIDEO_QUICKTIME && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_VLC +#if !defined GC_VIDEO_QUICKTIME && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC #define GC_VIDEO_QUICKTIME #endif @@ -50,8 +50,8 @@ #endif // but qt5 *is* supported, but use at your own risk! -#if defined GC_VIDEO_QT5 -#warning "QT 5 video is supported experimentally in this version" +#if defined (GC_VIDEO_QT5) || defined (GC_VIDEO_QT6) +#warning "QT 5/6 video is supported experimentally in this version" #endif #endif //Q_OS_MAC @@ -63,14 +63,14 @@ #if defined Q_OS_LINUX || defined Q_OS_WIN // did the user specify location for VLC but not GC_VIDEO_XXXX -#if defined GC_HAVE_VLC && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 +#if defined GC_HAVE_VLC && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 #if !defined GC_VIDEO_VLC #define GC_VIDEO_VLC #endif #endif // if we aint chosen one or the other then use QT5 -#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_VLC +#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC #define GC_VIDEO_QT5 #endif @@ -103,9 +103,12 @@ extern "C" { #endif // VLC -#ifdef GC_VIDEO_QT5 // QT5 Video Stuff +#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // QT5/6 Video Stuff #include #include +#endif + +#ifdef GC_VIDEO_QT5 #include #endif @@ -308,8 +311,10 @@ class VideoWindow : public GcChartWindow #endif #ifdef GC_VIDEO_QT5 - // QT native QMediaContent mc; +#endif +#if defined(GC_VIDEO_QT5) || defined(GC_VIDEO_QT6) + // QT native QVideoWidget *wd; QMediaPlayer *mp; #endif diff --git a/src/gcconfig.pri.in b/src/gcconfig.pri.in index 0c8846a79..c75138bc9 100644 --- a/src/gcconfig.pri.in +++ b/src/gcconfig.pri.in @@ -246,6 +246,7 @@ macx { DEFINES += GC_VIDEO_NONE # dont add any video playback support #DEFINES += GC_VIDEO_QUICKTIME # mac only and the default #DEFINES += GC_VIDEO_QT5 # use QT5 qvideowidget if QT > 5.2.1 +#DEFINES += GC_VIDEO_QT6 # qt6 videowidget #DEFINES += GC_VIDEO_VLC # use VideoLan library needs VLC_INSTALL defined above #DEFINES += GC_VIDEO_AV # use AV Foundation on Mac now QTKit is deprecated