From 57c56830ca0fbf4294117c877a5488c014747914 Mon Sep 17 00:00:00 2001 From: MrBeanCpp <64788865+MrBeanCpp@users.noreply.github.com> Date: Sun, 1 Oct 2023 21:54:54 +0800 Subject: [PATCH] Add support for AirPods Pro 2 (USB-C) (#91) --- Source/Core/AppleCP.cpp | 2 ++ Source/Core/Base.h | 3 +++ Source/Gui/MainWindow.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/Source/Core/AppleCP.cpp b/Source/Core/AppleCP.cpp index 9dcd3e2..8df43ee 100644 --- a/Source/Core/AppleCP.cpp +++ b/Source/Core/AppleCP.cpp @@ -52,6 +52,8 @@ Core::AirPods::Model AirPods::GetModel(uint16_t modelId) return Core::AirPods::Model::AirPods_Pro; case 0x2014: return Core::AirPods::Model::AirPods_Pro_2; + case 0x2024: + return Core::AirPods::Model::AirPods_Pro_2_USB_C; case 0x200A: return Core::AirPods::Model::AirPods_Max; // case 0x2003: diff --git a/Source/Core/Base.h b/Source/Core/Base.h index 001a995..4be28f3 100644 --- a/Source/Core/Base.h +++ b/Source/Core/Base.h @@ -69,6 +69,7 @@ enum class Model : uint32_t { AirPods_3, AirPods_Pro, AirPods_Pro_2, + AirPods_Pro_2_USB_C, AirPods_Max, Powerbeats_3, Beats_X, @@ -96,6 +97,8 @@ inline QString Helper::ToString(const Core::AirPods::Model return "AirPods Pro"; case Core::AirPods::Model::AirPods_Pro_2: return "AirPods Pro 2"; + case Core::AirPods::Model::AirPods_Pro_2_USB_C: + return "AirPods Pro 2 (USB-C)"; case Core::AirPods::Model::AirPods_Max: return "AirPods Max"; case Core::AirPods::Model::Powerbeats_3: diff --git a/Source/Gui/MainWindow.cpp b/Source/Gui/MainWindow.cpp index e60664f..a4d35dc 100644 --- a/Source/Gui/MainWindow.cpp +++ b/Source/Gui/MainWindow.cpp @@ -422,6 +422,7 @@ void MainWindow::SetAnimation(std::optional model) videoSize = QSize{900, 450}; break; case Core::AirPods::Model::AirPods_Pro_2: + case Core::AirPods::Model::AirPods_Pro_2_USB_C: media = "qrc:/Resource/Video/AirPods_Pro_2.avi"; videoSize = QSize{900, 450}; break;