Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Oct 2, 2023
2 parents 1ecee4c + fd52300 commit 2e386ef
Show file tree
Hide file tree
Showing 12 changed files with 251 additions and 96 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,54 @@ jobs:
path: release.zip
if: ${{ ! matrix.config.python }}

# - name: Exit if not on master branch
# if: github.ref == 'refs/heads/main'
# run: exit 1

# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

# - name: Get previous tag
# id: previoustag
# uses: 'WyriHaximus/github-action-get-previous-tag@v1'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Create Release
# if: ${{ ! matrix.config.python }}
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.previoustag.outputs.tag }}
# release_name: Release ${{ steps.previoustag.outputs.tag }}
# draft: false
# prerelease: false

# - name: upload windows artifact
# uses: actions/upload-release-asset@v1
# if: ${{ ! matrix.config.python }}
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: release.zip
# asset_name: windows-binary-no-python.zip
# asset_content_type: application/zip

# - name: upload windows artifact
# uses: actions/upload-release-asset@v1
# if: ${{ matrix.config.python }}
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: release.zip
# asset_name: windows-binary.zip
# asset_content_type: application/zip

# window-steam-build:
# runs-on: windows-latest
#
Expand Down Expand Up @@ -280,6 +328,19 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: release
uses: actions/create-release@v1
if: startsWith(github.ref, 'refs/tags/')
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}

# - name: Cache Qt Linux Desktop
# id: cache-qt-linux-desktop
# uses: actions/cache@v1
Expand Down Expand Up @@ -583,6 +644,20 @@ jobs:
name: fdroid-android-trial
path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/

# - name: Exit if not on master branch
# if: github.ref == 'refs/heads/main'
# run: exit 1

# - name: upload windows artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk
# asset_name: fdroid-android-trial.zip
# asset_content_type: application/zip

ios-build:
# The type of runner that the job will run on
runs-on: macos-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3666,7 +3666,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -3834,7 +3834,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4038,7 +4038,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -4134,7 +4134,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -4226,7 +4226,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -4340,7 +4340,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 643;
CURRENT_PROJECT_VERSION = 645;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
Expand Down
111 changes: 57 additions & 54 deletions src/Home.qml
Original file line number Diff line number Diff line change
Expand Up @@ -291,72 +291,75 @@ HomeForm{
}

footer:

Rectangle {
id: chartFooterRectangle
visible: rootItem.chartFooterVisible
Item {
width: parent.width
height: parent.height / 4
ChartFooter {
anchors.fill: parent
height: (rootItem.chartFooterVisible ? parent.height / 4 : parent.height / 2)
anchors.top: gridView.bottom
visible: rootItem.chartFooterVisible || rootItem.videoVisible

Rectangle {
id: chartFooterRectangle
visible: rootItem.chartFooterVisible
anchors.fill: parent
ChartFooter {
anchors.fill: parent
visible: rootItem.chartFooterVisible
}
}
}

Rectangle {
objectName: "footerrectangle"
visible: rootItem.videoVisible
anchors.top: gridView.bottom
width: parent.width
height: parent.height / 2
// Removed Timer, Play/Pause/Resume is now done via Homeform.cpp
/*
Timer {
id: pauseTimer
interval: 1000; running: true; repeat: true
onTriggered: { if(visible == true) { (rootItem.currentSpeed > 0 ?
videoPlaybackHalf.play() :
videoPlaybackHalf.pause()) } }
}
*/

onVisibleChanged: {
if(visible === true) {
console.log("mediaPlayer onCompleted: " + rootItem.videoPath)
console.log("videoRate: " + rootItem.videoRate)
videoPlaybackHalf.source = rootItem.videoPath
//videoPlaybackHalf.playbackRate = rootItem.videoRate

videoPlaybackHalf.seek(rootItem.videoPosition)
videoPlaybackHalf.play()
videoPlaybackHalf.muted = rootItem.currentCoordinateValid
} else {
videoPlaybackHalf.stop()
Rectangle {
objectName: "footerrectangle"
visible: rootItem.videoVisible
anchors.fill: parent
// Removed Timer, Play/Pause/Resume is now done via Homeform.cpp
/*
Timer {
id: pauseTimer
interval: 1000; running: true; repeat: true
onTriggered: { if(visible == true) { (rootItem.currentSpeed > 0 ?
videoPlaybackHalf.play() :
videoPlaybackHalf.pause()) } }
}
*/

onVisibleChanged: {
if(visible === true) {
console.log("mediaPlayer onCompleted: " + rootItem.videoPath)
console.log("videoRate: " + rootItem.videoRate)
videoPlaybackHalf.source = rootItem.videoPath
//videoPlaybackHalf.playbackRate = rootItem.videoRate

videoPlaybackHalf.seek(rootItem.videoPosition)
videoPlaybackHalf.play()
videoPlaybackHalf.muted = rootItem.currentCoordinateValid
} else {
videoPlaybackHalf.stop()
}

}
}

MediaPlayer {
id: videoPlaybackHalf
objectName: "videoplaybackhalf"
autoPlay: false
playbackRate: rootItem.videoRate
MediaPlayer {
id: videoPlaybackHalf
objectName: "videoplaybackhalf"
autoPlay: false
playbackRate: rootItem.videoRate

onError: {
if (videoPlaybackHalf.NoError !== error) {
console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
onError: {
if (videoPlaybackHalf.NoError !== error) {
console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString)
}
}
}

}
}

VideoOutput {
id:videoPlayer
anchors.fill: parent
source: videoPlaybackHalf
}
VideoOutput {
id:videoPlayer
anchors.fill: parent
source: videoPlaybackHalf
}
}

}
}

MouseArea {
property int currentId: -1 // Original position in model
Expand Down
2 changes: 1 addition & 1 deletion src/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="org.cagnulen.qdomyoszwift" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionName="2.16.13" android:versionCode="642" android:installLocation="auto">
<manifest package="org.cagnulen.qdomyoszwift" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionName="2.16.15" android:versionCode="644" android:installLocation="auto">
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
Expand Down
2 changes: 2 additions & 0 deletions src/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
b.name().toUpper().startsWith(QStringLiteral("WALKINGPAD")) ||
!b.name().toUpper().compare(QStringLiteral("RE")) || // just "RE"
b.name().toUpper().startsWith(QStringLiteral("KS-H")) ||
b.name().toUpper().startsWith(QStringLiteral("KS-BLC")) || // Walkingpad C2 #1672
b.name().toUpper().startsWith(
QStringLiteral("KS-BLR"))) && // Treadmill KingSmith WalkingPad R2 Pro KS-HCR1AA
!kingsmithR1ProTreadmill &&
Expand Down Expand Up @@ -1303,6 +1304,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
npeCableBike->deviceDiscovered(b);
this->signalBluetoothDeviceConnected(npeCableBike);
} else if (((b.name().startsWith("FS-") && hammerRacerS) ||
(b.name().toUpper().startsWith("DI") && b.name().length() == 2) || // Elite smart trainer #1682
(b.name().toUpper().startsWith("DHZ-")) || // JK fitness 577
(b.name().toUpper().startsWith("MKSM")) || // MKSM3600036
(b.name().toUpper().startsWith("YS_C1_")) || // Yesoul C1H
Expand Down
8 changes: 4 additions & 4 deletions src/homeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ homeform::homeform(QQmlApplicationEngine *engine, bluetooth *bl) {
deviceConnected(b);
}

#ifdef Q_OS_ANDROID
#ifndef Q_OS_IOS
iphone_browser = new QMdnsEngine::Browser(&iphone_server, "_qz_iphone._tcp.local.", &iphone_cache);

QObject::connect(iphone_browser, &QMdnsEngine::Browser::serviceAdded, [](const QMdnsEngine::Service &service) {
Expand Down Expand Up @@ -2870,8 +2870,8 @@ void homeform::pelotonOffset_Minus() { Minus(QStringLiteral("peloton_offset"));
void homeform::bluetoothDeviceConnected(bluetoothdevice *b) {
this->innerTemplateManager->start(b);
this->userTemplateManager->start(b);
#ifdef Q_OS_ANDROID
// heart rate received from apple watch while QZ is running on android via TCP socket (iphone_socket)
#ifndef Q_OS_IOS
// heart rate received from apple watch while QZ is running on a different device via TCP socket (iphone_socket)
connect(this, SIGNAL(heartRate(uint8_t)), b, SLOT(heartRate(uint8_t)));
#endif
}
Expand Down Expand Up @@ -5064,7 +5064,7 @@ void homeform::update() {
lapTrigger = false;
}

#ifdef Q_OS_ANDROID
#ifndef Q_OS_IOS
if (iphone_socket && iphone_socket->state() == QAbstractSocket::ConnectedState) {
QString toSend =
"SENDER=PAD#HR=" + QString::number(bluetoothManager->device()->currentHeart().value()) +
Expand Down
2 changes: 2 additions & 0 deletions src/homeform.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ class homeform : public QObject {

#ifdef Q_OS_ANDROID
bool floating_open = false;
#endif

#ifndef Q_OS_IOS
QMdnsEngine::Browser* iphone_browser = nullptr;
QMdnsEngine::Resolver* iphone_resolver = nullptr;
QMdnsEngine::Server iphone_server;
Expand Down
2 changes: 1 addition & 1 deletion src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ ApplicationWindow {
}

ItemDelegate {
text: "version 2.16.13"
text: "version 2.16.15"
width: parent.width
}

Expand Down
4 changes: 4 additions & 0 deletions src/proformbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ void proformbike::characteristicChanged(const QLowEnergyCharacteristic &characte
m_pelotonResistance = 30;
break;
case 0x0b:
case 0x0c:
Resistance = 5;
m_pelotonResistance = 35;
break;
Expand All @@ -1050,6 +1051,7 @@ void proformbike::characteristicChanged(const QLowEnergyCharacteristic &characte
m_pelotonResistance = 40;
break;
case 0x10:
case 0x11:
Resistance = 7;
m_pelotonResistance = 45;
break;
Expand Down Expand Up @@ -1078,6 +1080,7 @@ void proformbike::characteristicChanged(const QLowEnergyCharacteristic &characte
m_pelotonResistance = 75;
break;
case 0x21:
case 0x22:
Resistance = 14;
m_pelotonResistance = 80;
break;
Expand All @@ -1086,6 +1089,7 @@ void proformbike::characteristicChanged(const QLowEnergyCharacteristic &characte
m_pelotonResistance = 85;
break;
case 0x26:
case 0x27:
Resistance = 16;
m_pelotonResistance = 100;
break;
Expand Down
Loading

0 comments on commit 2e386ef

Please sign in to comment.