diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index ecd2a08..3d05b64 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1425,6 +1425,18 @@ export default class ClientConnection { ); } + public async GetBlendingConfig(name: string) { + return await this.doRpc( + new Protocol.GetBlendingConfigRequestEntity(name) + ); + } + + public async SaveBlendingConfig(name: string) { + return await this.doRpc( + new Protocol.SaveBlendingConfigRequestEntity(name) + ); + } + public destory() { this.ws?.close(); if (this.ws) { diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index f691063..80036dc 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -635,6 +635,8 @@ export namespace Protocol { Commands.kSetBlendingGammaParam, Commands.kEnableBlending, Commands.kSetBlendingOverlap, + Commands.kGetBlendingConfig, + Commands.kSaveBlendingConfig, ]); public static get AllCommands() { return this._all_commands; @@ -3335,4 +3337,52 @@ export namespace Protocol { enable = false; width = 0; } + + export class GetBlendingConfigResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + config = ""; + } + + export class GetBlendingConfigRequestEntity extends PacketEntity { + constructor( + name: string, + rpc_id = 0 + ) { + super(); + super.command = Commands.kGetBlendingConfig + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.name = name ?? ""; + } + name = ""; + } + + export class SaveBlendingConfigResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + success = false; + } + + export class SaveBlendingConfigRequestEntity extends PacketEntity { + constructor( + name: string, + rpc_id = 0 + ) { + super(); + super.command = Commands.kSaveBlendingConfig; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.name = name ?? ""; + } + name = ""; + } }