From 906ab0702171a1b343ba04821dc9fed1f855775a Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Tue, 13 May 2025 12:30:32 +0200 Subject: [PATCH 1/4] Add a new interface to be used in the JSON generator --- interfaces/IInputSwitch.h | 38 +++++++++++++++++++++++++++++++++++++- interfaces/Ids.h | 2 ++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/interfaces/IInputSwitch.h b/interfaces/IInputSwitch.h index e9aa3e91..aef4c8ce 100644 --- a/interfaces/IInputSwitch.h +++ b/interfaces/IInputSwitch.h @@ -18,9 +18,13 @@ */ #pragma once + #include "Module.h" +// @insert + namespace Thunder { + namespace Exchange { // This interface gives direct access to a time synchronize / update @@ -40,5 +44,37 @@ namespace Exchange { virtual uint32_t Select(const string& name) = 0; }; + // @json 1.0.0 @text:legacy_lowercase + struct EXTERNAL IInputSwitchChannel : virtual public Core::IUnknown { + + enum { ID = ID_INPUT_SWITCH_CHANNEL }; + + struct Channel { + string name /* @brief Callsign associated with this channel (e.g. WebKitBrowser) */; + bool enabled /* @brief Is the channel enabled to receive info (e.g. true) */; + }; + + typedef RPC::IIteratorType IChannelIterator; + + // @brief Enable or Disable the throughput through the given channel + // @param name: Callsign that is the owner of this channel (e.g. WebKitBrowser) + // @param enabled: Enable or disable the throughput of data through this channel (e.g. true) + // @retval ERROR_UNKNOWN_KEY: Failed to scan + virtual Core::hresult Channel(const string& name, const bool enabled) = 0; + + // @brief Enable the given channel, disabling all other not immune channels + // @param name: Callsign that is the owner of this channel (e.g. WebKitBrowser) + // @retval ERROR_UNKNOWN_KEY: Failed to scan + virtual Core::hresult Select(const string& name) = 0; + + // @property + // @brief Check the status of the requested channel + // @param name: Server name, if omitted, status of all configured channels is returned (e.g. WebKitBrowser) + // @param servers: List of configured servers + // @retval ERROR_UNKNOWN_KEY: Could not find the designated channel + virtual Core::hresult Status(const Core::OptionalType& name /* @index */, IChannelIterator*& channels /* @out @extract */) const = 0; + }; + } // namespace Exchange -} // namespace Thunder + +} diff --git a/interfaces/Ids.h b/interfaces/Ids.h index f367d646..83297b2a 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -236,6 +236,8 @@ namespace Exchange { ID_AVSCONTROLLER_NOTIFICATION = ID_AVSCLIENT + 2, ID_INPUT_SWITCH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x310, + ID_INPUT_SWITCH_CHANNEL = ID_INPUT_SWITCH + 1, + ID_INPUT_SWITCH_CHANNEL_CHANNELS = ID_INPUT_SWITCH + 2, ID_DOLBY_OUTPUT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x320, ID_DOLBY_OUTPUT_NOTIFICATION = ID_DOLBY_OUTPUT + 1, From d3e420cf503cee6a07b08f5cef81d1ea4f0aa716 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Thu, 15 May 2025 11:01:28 +0200 Subject: [PATCH 2/4] Use the IInputSwitch interface instead of creating a new one, as Select has to stay on it for BC --- interfaces/IInputSwitch.h | 36 ++++++------- interfaces/Ids.h | 3 +- jsonrpc/InputSwitch.json | 105 -------------------------------------- 3 files changed, 17 insertions(+), 127 deletions(-) delete mode 100644 jsonrpc/InputSwitch.json diff --git a/interfaces/IInputSwitch.h b/interfaces/IInputSwitch.h index aef4c8ce..a47f1c8d 100644 --- a/interfaces/IInputSwitch.h +++ b/interfaces/IInputSwitch.h @@ -28,6 +28,7 @@ namespace Thunder { namespace Exchange { // This interface gives direct access to a time synchronize / update + // @json 1.0.0 @text:legacy_lowercase struct EXTERNAL IInputSwitch : virtual public Core::IUnknown { enum { ID = ID_INPUT_SWITCH }; @@ -37,36 +38,31 @@ namespace Exchange { SLAVE }; - virtual RPC::IStringIterator* Consumers() const = 0; - virtual bool Consumer(const string& name) const = 0; - virtual uint32_t Consumer(const string& name, const mode value) = 0; - - virtual uint32_t Select(const string& name) = 0; - }; - - // @json 1.0.0 @text:legacy_lowercase - struct EXTERNAL IInputSwitchChannel : virtual public Core::IUnknown { - - enum { ID = ID_INPUT_SWITCH_CHANNEL }; - - struct Channel { + struct ChannelData { string name /* @brief Callsign associated with this channel (e.g. WebKitBrowser) */; bool enabled /* @brief Is the channel enabled to receive info (e.g. true) */; }; - typedef RPC::IIteratorType IChannelIterator; + typedef RPC::IIteratorType IChannelIterator; - // @brief Enable or Disable the throughput through the given channel - // @param name: Callsign that is the owner of this channel (e.g. WebKitBrowser) - // @param enabled: Enable or disable the throughput of data through this channel (e.g. true) - // @retval ERROR_UNKNOWN_KEY: Failed to scan - virtual Core::hresult Channel(const string& name, const bool enabled) = 0; + // @json:omit + virtual RPC::IStringIterator* Consumers() const = 0; + // @json:omit + virtual bool Consumer(const string& name) const = 0; + // @json:omit + virtual uint32_t Consumer(const string& name, const mode value) = 0; // @brief Enable the given channel, disabling all other not immune channels // @param name: Callsign that is the owner of this channel (e.g. WebKitBrowser) - // @retval ERROR_UNKNOWN_KEY: Failed to scan + // @retval ERROR_UNKNOWN_KEY: Failed to find a channel with the given name virtual Core::hresult Select(const string& name) = 0; + // @brief Enable or Disable the throughput through the given channel + // @param name: Callsign that is the owner of this channel (e.g. WebKitBrowser) + // @param enabled: Enable or disable the throughput of data through this channel (e.g. true) + // @retval ERROR_UNKNOWN_KEY: Failed to find a channel with the given name + virtual Core::hresult Channel(const string& name, const bool enabled) = 0; + // @property // @brief Check the status of the requested channel // @param name: Server name, if omitted, status of all configured channels is returned (e.g. WebKitBrowser) diff --git a/interfaces/Ids.h b/interfaces/Ids.h index 83297b2a..ff3859df 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -236,8 +236,7 @@ namespace Exchange { ID_AVSCONTROLLER_NOTIFICATION = ID_AVSCLIENT + 2, ID_INPUT_SWITCH = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x310, - ID_INPUT_SWITCH_CHANNEL = ID_INPUT_SWITCH + 1, - ID_INPUT_SWITCH_CHANNEL_CHANNELS = ID_INPUT_SWITCH + 2, + ID_INPUT_SWITCH_CHANNELS = ID_INPUT_SWITCH + 1, ID_DOLBY_OUTPUT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x320, ID_DOLBY_OUTPUT_NOTIFICATION = ID_DOLBY_OUTPUT + 1, diff --git a/jsonrpc/InputSwitch.json b/jsonrpc/InputSwitch.json deleted file mode 100644 index b37e9940..00000000 --- a/jsonrpc/InputSwitch.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Input Switch API", - "class": "InputSwitch", - "description": "InputSwitch JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "methods": { - "channel": { - "summary": "Enable or Disable the throughput through the given channel", - "params": { - "type": "object", - "properties": { - "name": { - "description": "Callsign that is the owner of this channel", - "example": "WebKitBrowser", - "type": "string" - }, - "enabled": { - "description": "Enable or disable the throughput of data through this channel", - "type": "boolean" - } - }, - "required": [ "name", "enabled" ] - }, - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "Failed to scan", - "$ref": "#/common/errors/unknownkey" - } - ] - }, - "select": { - "summary": "Enable the given channel, disabling all othe channels, whish are not immune", - "params": { - "type": "object", - "properties": { - "name": { - "description": "Callsign that is the owner of this channel", - "example": "WebKitBrowser", - "type": "string" - } - }, - "required": [ "name" ] - }, - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "Failed to scan", - "$ref": "#/common/errors/unknownkey" - } - ] - }, - "status": { - "summary": "Check the status of the requested channel", - "params": { - "type": "object", - "properties": { - "name": { - "description": "Callsign that is the owner of this channel", - "example": "WebKitBrowser", - "type": "string" - } - } - }, - "result": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Callsign associated with this channel", - "type": "string", - "example": "WebKitBrowser" - }, - "enabled": { - "description": "Is the channel enabled to receive info", - "type": "boolean" - } - }, - "required": [ - "name", - "enabled" - ] - } - }, - "errors": [ - { - "description": "Could not find the designated channel", - "$ref": "#/common/errors/unknownkey" - } - ] - } - } - } From 06b10c2a76cac177f0be7610ecae0a11839c3a9b Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Thu, 15 May 2025 11:36:34 +0200 Subject: [PATCH 3/4] Adjust the Windows files: --- definitions/Definitions.vcxproj | 17 ++++++++++++++--- definitions/Definitions.vcxproj.filters | 13 ++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/definitions/Definitions.vcxproj b/definitions/Definitions.vcxproj index aa5b652b..a375ea4b 100644 --- a/definitions/Definitions.vcxproj +++ b/definitions/Definitions.vcxproj @@ -206,6 +206,20 @@ $(ProjectDir)../interfaces/json/JIOConnector.h $(ProjectDir)../interfaces/json/JIOConnector.h + + ClInclude + ClInclude + ClInclude + ClInclude + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force + $(ProjectDir)../interfaces/json/JInputSwitch.h + $(ProjectDir)../interfaces/json/JInputSwitch.h + $(ProjectDir)../interfaces/json/JInputSwitch.h + $(ProjectDir)../interfaces/json/JInputSwitch.h + $(ProjectDir)../interfaces/json/JMath.h @@ -382,9 +396,6 @@ Document - - Document - Document diff --git a/definitions/Definitions.vcxproj.filters b/definitions/Definitions.vcxproj.filters index 54122634..3299598b 100644 --- a/definitions/Definitions.vcxproj.filters +++ b/definitions/Definitions.vcxproj.filters @@ -79,9 +79,6 @@ Generated Files - - Generated Files - Generated Files @@ -215,9 +212,6 @@ JSON Files - - JSON Files - JSON Files @@ -230,9 +224,6 @@ JSON Files - - JSON Files - JSON Files @@ -260,6 +251,10 @@ Interface Files + + + Interface Files + From ae9f39d61f7ac228ae491d3a9fae72e746152dc6 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Tue, 10 Jun 2025 10:40:48 +0200 Subject: [PATCH 4/4] Fix the project file formatting to make it build again --- definitions/Definitions.vcxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/definitions/Definitions.vcxproj b/definitions/Definitions.vcxproj index de633aa7..48f66b4b 100644 --- a/definitions/Definitions.vcxproj +++ b/definitions/Definitions.vcxproj @@ -234,7 +234,6 @@ $(ProjectDir)../interfaces/json/JSubsystemControl.h $(ProjectDir)../interfaces/json/JSubsystemControl.h - $(ProjectDir)../interfaces/json/JMath.h