Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSC (Open Sound Control) integration for Heartrate intergration #96

Merged
merged 9 commits into from
Dec 10, 2024

Conversation

BoiHanny
Copy link
Owner

@BoiHanny BoiHanny commented Dec 9, 2024

PR Classification

New feature: OSC (Open Sound Control) integration and UI updates.

PR Summary

This pull request introduces OSC integration and updates the UI to support this new feature.

  • DataController.cs: Added a new integration toggle for "IntgrHeartRate_OSC".
  • OSCSender.cs: Introduced three new static methods SendOscParam for sending OSC parameters with different data types.
  • MainWindow.xaml: Added a new section to the UI for OSC integration, including various CheckBox elements and a ToggleButton.
  • ViewModel.cs: Added a new boolean property _IntgrHeartRate_OSC with corresponding getter and setter methods.

Introduced heart rate OSC integration, allowing heart rate data to be sent over OSC. Added new methods in `OSCSender.cs` for sending OSC parameters. Updated `PulsoidModule.cs` to handle heart rate data smoothing and OSC updates, including new properties, methods, and refactoring the heart rate monitoring loop. Corrected a typo in a log message. Updated trend symbol and statistics time range functionalities. Modified `MainWindow.xaml` to include new UI elements for heart rate smoothing and OSC settings. Added new property and bindings in `ViewModel.cs` to support the new UI elements.
Modified the key name in the dictionary within `DataController.cs`
to remove the leading underscore for consistency. Updated the
project version in `MagicChatbox.csproj` from `0.9.060` to `0.9.065`.
Added a new `disableLegacySupport` property to the `PulsoidModule` class
to toggle legacy OSC support. Updated `SendHRToOSC` method to conditionally
send additional OSC parameters based on this property. Introduced a new
checkbox in `MainWindow.xaml` to allow users to enable or disable legacy
OSC support through the UI.
Updated MagicChatbox.csproj to increment the project version from 0.9.065 to 0.9.066, reflecting recent changes and improvements.
Removed StatisticsTimeRange enum and PulsoidOAuthHandler class.
Added fields for state change debouncing in PulsoidModule.
Refactored ProcessData method for better state management:
- Removed initial heart rate check and logic.
- Added thread safety and debounce mechanism.
- Improved logging and early exit for offline state.
- Reorganized code for online state processing.
Updated heart rate icons and temperature text logic.
Ensured HeartRate property updates only on change.
Added OSC update check and ResetIntervalFlag method.
Updated MainWindow checkbox text for clarity.
Updated the version number in `MagicChatbox.csproj` from `0.9.066` to `0.9.067` to reflect the latest release or update.
Improved readability and functionality of PulsoidModule.cs by adding XML documentation, new methods for heart rate data and WebSocket handling, and modern C# features. Refactored PulsoidOAuthHandler for better formatting, removed unnecessary code, and simplified encoding.

Updated MainWindow.xaml to include a new section for OSC support with various UI elements like TextBlocks, CheckBoxes, and StackPanels. Added functionality to enable/disable OSC support and smooth heart rate updates, and removed the old section related to smooth heart rate checkbox.
Added observable properties `sentMCBHeartrateInfo` and `sentMCBHeartrateInfoLegacy` to `PulsoidModule`. Removed redundant methods and comments related to heart rate monitoring and data processing. Implemented clamping for heart rate statistics values within 0-255 range. Enhanced error handling for WebSocket connections. Refactored `ProcessData` method and added new methods for updating heart rate trend indicators and icons. Updated `SendHRToOSC` to send additional heart rate info if enabled. Improved `ValidateTokenAsync` with logging and exception handling. Updated XAML for new settings and better user guidance.
Updated the version number in `MagicChatbox.csproj` from `0.9.067` to `0.9.069`, indicating a minor update or patch.
@BoiHanny BoiHanny merged commit a4aa5b4 into master Dec 10, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant