[next] OpenRGB 1.0 Rework - APIv5, SDKv6, Profiles, Hotplug Support

Change Overview:

  • Switch to Qt6 for official builds
    • Linux packages updated to Qt6
      • Main AppImages now use Qt6, with extra Qt5 builds for testing backwards compatibility
      • Debian packages now use Qt6
      • Fedora packages now use Qt6
      • openrgb-next-git PKGBUILD (unpublished) using Qt6 on Arch Linux
    • Main Windows builds now use Qt6, with extra Qt5 builds for testing backwards compatibility
      • MSI Installer now uses Qt6
      • Windows builds now deploy Qt6OpenGL.dll and Qt6Core5Compat.dll which are used by plugins
    • Main MacOS builds now use Qt6, with extra Qt5 builds for testing backwards compatibility
  • PluginManager Updates, update Plugin API version to 5
    • ResourceManager, RGBController changes necessitate API version bump
    • Added PluginManagerInterface, an interface class to PluginManager that does not require pulling in Qt dependencies
    • Added profile load/save and about to load functions to plugin API interface
    • Removed network plugins, replaced with OnSDKCommand function in plugin API interface for handling SDK integration
  • Update SDK Protocol version to 6
    • Server Name added to SDK
    • Controllers are now addressed by a unique 32-bit ID that represents a specific controller instance on the server.
      • The NET_PACKET_ID_REQUEST_CONTROLLER_COUNT packet now returns a list of IDs in addition to the count
      • The order of the IDs in this response matches the order of the controllers on the server
      • The client only has to download IDs it doesn't already know about, and it only has to remove IDs that no longer exist in the server list
      • This new ID is used for all RGBController packets in the header device ID field in place of the index
      • For protocols < 6, the index is still used, so handling for both index and ID must be implemented
    • ProfileManager functionality
      • NET_PACKET_ID_PROFILEMANAGER_GET_PROFILE_LIST
        • Renamed from existing command, no functional change
      • NET_PACKET_ID_PROFILEMANAGER_SAVE_PROFILE
        • Renamed from existing command, no functional change
      • NET_PACKET_ID_PROFILEMANAGER_LOAD_PROFILE
        • Renamed from existing command, no functional change
      • NET_PACKET_ID_PROFILEMANAGER_DELETE_PROFILE
        • Renamed from existing command, no functional change
      • NET_PACKET_ID_PROFILEMANAGER_UPLOAD_PROFILE
        • Uploads a JSON-format OpenRGB profile from the client to the server
        • Request: Null terminated JSON string containing the profile contents, the Name field of the profile should be used for the filename
        • No response
      • NET_PACKET_ID_PROFILEMANAGER_DOWNLOAD_PROFILE
        • Downloads a JSON-format OpenRGB from the server to the client
        • Request: Null terminated profile name string
        • Response: Null terminated JSON string containing the profile contents
      • NET_PACKET_ID_PROFILEMANAGER_GET_ACTIVE_PROFILE
        • Gets the active profile name, or empty string if no profile is currently active
        • Request: No data
        • Response: Null terminated profile name string
    • SettingsManager functionality
      • NET_PACKET_ID_SETTINGSMANAGER_GET_SETTINGS
        • Get settings from server's SettingsManager from the given settings key, empty string should return complete settings file
        • Request: Null terminated settings key string, or null terminated empty string to request entire settings file contents
        • Response: Null terminated JSON string
      • NET_PACKET_ID_SETTINGSMANAGER_SET_SETTINGS
        • Set settings from client to server's SettingsManager for one or more settings keys
        • Request: Null terminated JSON string, with the top level JSON keys being the settings keys to set
        • No response
      • NET_PACKET_ID_SETTINGSMANAGER_SAVE_SETTINGS
        • Call SettingsManager::SaveSettings on the server
        • Request: No data
        • No response
    • RGBController description functions cleaned up
    • Added segment.matrix_map to segment description
    • Added zone.active_mode and zone.modes to zone description
    • NET_PACKET_ID_RGBCONTROLLER_UPDATEZONEMODE
      • Call RGBController::UpdateZoneMode on the server
      • Contains zone index, zone active mode, and mode description if active mode indicates a per zone mode is active
    • NET_PACKET_ID_RGBCONTROLLER_SIGNALUPDATE
      • Call RGBController::SignalUpdate on the client
      • This packet is sent from the server to the client when the RGBController on the server calls its SignalUpdate callback
      • Packet contains the update reason code
        • For UpdateLEDs update reason, packet also contains color description (to ensure color synchronization)
        • For everything else, packet also contains entire controller description (to ensure entire controller synchronization)
    • Add a flags field to client and server indicating which feature sets are supported and for requesting/granting local client status
    • Implemented LogManager SDK integration so that the local client can display the server's log entries in the log console
  • ProfileManager Updates
    • Reworked profiles to save in JSON format rather than binary format
    • Plugin integration with JSON profiles
      • Plugins can save/load a chunk of their own JSON data in OpenRGB profiles rather than having to make their own profile systems independent from OpenRGB's.
      • Reworked ProfileManager to store .json profiles in "profiles" directory
      • Reworked ProfileManager to store sizes in sizes.json in main configuration directory
      • Reworked ProfileManager to handle auto-load profiles (Open, Exit, Resume, Suspend) and reworked settings json to group these under ProfileManager
    • If local connection is active, the following functions are routed through the server:
      • DeleteProfile
      • LoadProfile
      • SaveProfile
      • UpdateProfileList
    • Handle profile changes on server side and then notify active local client of profile load so it can handle plugins
    • Track active profile
    • Ability to select what saves in a profile:
      • Controller states
      • Single color to all devices
      • Plugins
    • Keep controller states that are not currently present when overwriting a profile/sizes file and not using profile editor dialog
  • ResourceManager Updates
    • NetworkClient/NetworkServer removed from ResourceManagerInterface
    • LogManager added to ResourceManagerInterface
    • Functions to check if in local client mode and to get the local client pointer if so
    • Split out detection functionality into DetectionManager
    • Consolidated callbacks into a single ResourceManagerCallback with update reason codes
  • DetectionManager
    • Reworked detector functions to return DetectedControllers type, which is std::vector<RGBController *>
    • Detectors no longer call DetectionManager/ResourceManager::RegisterRGBController, they just return detected controller pointers
    • DetectionManager has the ability to perform additional processing on the set of controllers returned from each detector
    • Merge HID hotplug functionality into DetectionManager !3162 (merged)
    • Load zone configuration (sizes) when hotplugging
    • Load active profile when hotplugging
  • RGBController API Updates
    • Added CONTROLLER_FLAG_HIDDEN to indicate a controller should be hidden from select user interface lists
      • Should be hidden from anything that would change the controller (i.e. effects)
      • Can still be shown for informational/setup purposes (i.e. Information tab, list of VisualMap devices)
      • New RGBController members GetHidden and SetHidden
    • Added reason code to RGBController update callback
    • Made ResizeZone, UpdateSingleLED, and UpdateZoneLEDs device-specific (DeviceResizeZone, DeviceUpdateSingleLED, DeviceUpdateZoneLEDs) so that the common implementations can call callback
    • Protected previously-public RGBController members
      • Information strings (name, vendor, description, version, serial location)
      • Device type
      • Active mode
      • Flags
      • LEDs vector
      • LED alternate names vector
      • Modes vector
      • Colors vector
      • Zones vector
    • Cleaned up binary descriptions for SDK version 6
    • JSON controller descriptions for JSON profiles
    • Zone Updates
      • Add ZONE_TYPE_SEGMENTED to indicate zone should use its segments rather than its base configuration, linear for SDK < 6.
      • Add ZONE_TYPE_LINEAR_LOOP, ZONE_TYPE_MATRIX_LOOP_X, and ZONE_TYPE_MATRIX_LOOP_Y to describe zones that have both ends connected in a loop, for backwards compatibility the server should interpret these back to basic linear/matrix types for SDK < 6.
      • Add matrix map pointer to segment type, allow matrix segments
      • Add ZONE_FLAG_MANUALLY_CONFIGURED
      • Update Edit Zone dialog to allow configuring matrix type and loop types, import feature for JSON matrix maps
      • Matrix map editor allows automatically creating basic matrix layouts (rows, columns, zigzag)
    • Add a shared_mutex that gets exclusive locked on any operation that changes member size/pointer
    • Per-zone modes
      • Each zone now has a modes vector and an active_mode value, if active_mode is negative that indicates no per-zone mode is active, otherwise the per-zone active_mode overrides the entire device active_mode
      • A mode flag that indicates a top level mode cannot be overridden prevents zones from using per-zone modes

To-do:

  • Hide the SDK Server tab when connected to local server by default, with an option to bypass
  • Segment groups - segment flags and flag for group start, group member
  • zone RGB order support flags (one for each RGB order supported) and member value holding selected RGB order
  • zone Gen2 ARGB support flag and Gen2 selected flag
  • allow zone configuration for other fixed-size ARGB controllers
  • zone editor should handle effects-only resizable zones (don't show segments, instead show a message explaining effects-only
  • SDK authentication system

Plugin MRs for this API update:

Edited by Adam Honse

Merge request reports

Loading