版本

    其他文档

menu_open
Wwise SDK 2018.1.11
ak.wwise.ui.commands.register


Register an array of add-on UI commands.

Supported by

Graphical User Interface.

Arguments

Name Type Description
commands * array Data for the commands to be registered.

(Required *)

Arguments Details


commands

description : Data for the commands to be registered.
type : array

argsSchema / commands / ...

items

type : object

Name Type Description
id * string Defines a human readable unique ID for the command. To reduce risk of ID conflicts, please use a concatenation of the author name, the product name and the command name.
displayName * string Defines the name displayed in the user interface.
program string Defines the program or script to run when the command is executed. Arguments are specified in 'args'.
startMode string Specifies how to expand variables in the arguments field in case of multiple selection in Wwise user interface. SingleSelectionSingleProcess: only support single selection, will start the program once. MultipleSelectionSingleProcessSpaceSeparated: program is started once with variables expanded to space separated arguments, each enclosed in double-quotes. MultipleSelectionMultipleProcesses: program is started once per item selected, in parallel. Each running instance receives one selected item.
Possible values : "SingleSelectionSingleProcess", "MultipleSelectionSingleProcessSpaceSeparated", "MultipleSelectionMultipleProcesses"
args string Defines the arguments. Refer to documentation for the built-in variables supported. Note that in case of multiple selection, the variables are expanded based on the startMode field.
cwd string Defines the current working directory to execute the program.
defaultShortcut string Defines the shortcut to use by default for this command. If the shortcut conflicts, it won't be used. This shortcut can be changed in the Keyboard Shortcut Manager.
contextMenu object  
mainMenu object  

(Required *)

argsSchema / commands / items / ...

id

type : string
description : Defines a human readable unique ID for the command. To reduce risk of ID conflicts, please use a concatenation of the author name, the product name and the command name.

argsSchema / commands / items / ...

displayName

type : string
description : Defines the name displayed in the user interface.

argsSchema / commands / items / ...

program

type : string
description : Defines the program or script to run when the command is executed. Arguments are specified in 'args'.

argsSchema / commands / items / ...

startMode

type : string
Possible values : "SingleSelectionSingleProcess", "MultipleSelectionSingleProcessSpaceSeparated", "MultipleSelectionMultipleProcesses"
description : Specifies how to expand variables in the arguments field in case of multiple selection in Wwise user interface. SingleSelectionSingleProcess: only support single selection, will start the program once. MultipleSelectionSingleProcessSpaceSeparated: program is started once with variables expanded to space separated arguments, each enclosed in double-quotes. MultipleSelectionMultipleProcesses: program is started once per item selected, in parallel. Each running instance receives one selected item.

argsSchema / commands / items / ...

args

type : string
description : Defines the arguments. Refer to documentation for the built-in variables supported. Note that in case of multiple selection, the variables are expanded based on the startMode field.

argsSchema / commands / items / ...

cwd

type : string
description : Defines the current working directory to execute the program.

argsSchema / commands / items / ...

defaultShortcut

type : string
description : Defines the shortcut to use by default for this command. If the shortcut conflicts, it won't be used. This shortcut can be changed in the Keyboard Shortcut Manager.

argsSchema / commands / items / ...

contextMenu

type : object

Name Type Description
basePath string Defines a forward-separated path for the parent sub menus. If empty, the menu is insert at first level.
visibleFor string Defines a comma-separated list of the object types for which the item is visible. Refer to Wwise Objects Reference for the list of types supported. If empty, any type is allowed.
enabledFor string Defines a comma-separated list of the object types for which the item is enabled. Refer to Wwise Objects Reference for the list of types supported. If empty, any type is allowed.


argsSchema / commands / items / ...

mainMenu

type : object

Name Type Description
basePath * string Defines a forward-separated path for the parent sub menus. It must at least define one level, which is associated to the top menu.

(Required *)


Examples :

Programless registration

Registers a command that has no program. Typically used as a callback in Waapi. Simplest example.

Arguments:

{
"commands": [
{
"id": "sample.programlessregistration",
"displayName": "Programless registration"
}
]
}

Result:

{}

Edit in Visual Studio Code

Registering a command that's shown in a new Extra menu.

Arguments:

{
"commands": [
{
"id": "ak.edit_in_vscode",
"displayName": "Edit in Visual Studio Code",
"defaultShortcut": "C",
"program": "code",
"startMode": "MultipleSelectionSingleProcessSpaceSeparated",
"args": "${filePath}",
"cwd": "",
"contextMenu": {
"basePath": "Editors",
"enabledFor": "Sound,ActorMixer,SwitchContainer,RandomSequenceContainer"
},
"mainMenu": {
"basePath": "Extra"
}
}
]
}

Result:

{}

Edit in Wavosaur

Registering a command that's shown in the contextual menu only

Arguments:

{
"commands": [
{
"id": "ak.open_in_wavosaur",
"displayName": "Edit in Wavosaur",
"defaultShortcut": "W",
"program": "c:\\Wavosaur.1.1.0.0-x64(en)\\Wavosaur.exe",
"args": "${sound:originalWavFilePath}",
"cwd": "",
"contextMenu": {}
}
]
}

Result:

{}


Detailed JSON Schema


Arguments :

{
"type": "object",
"properties": {
"commands": {
"description": "Data for the commands to be registered.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Defines a human readable unique ID for the command. To reduce risk of ID conflicts, please use a concatenation of the author name, the product name and the command name."
},
"displayName": {
"type": "string",
"description": "Defines the name displayed in the user interface."
},
"program": {
"type": "string",
"description": "Defines the program or script to run when the command is executed. Arguments are specified in 'args'."
},
"startMode": {
"type": "string",
"enum": [
"SingleSelectionSingleProcess",
"MultipleSelectionSingleProcessSpaceSeparated",
"MultipleSelectionMultipleProcesses"
],
"description": "Specifies how to expand variables in the arguments field in case of multiple selection in Wwise user interface. SingleSelectionSingleProcess: only support single selection, will start the program once. MultipleSelectionSingleProcessSpaceSeparated: program is started once with variables expanded to space separated arguments, each enclosed in double-quotes. MultipleSelectionMultipleProcesses: program is started once per item selected, in parallel. Each running instance receives one selected item."
},
"args": {
"type": "string",
"description": "Defines the arguments. Refer to documentation for the built-in variables supported. Note that in case of multiple selection, the variables are expanded based on the startMode field."
},
"cwd": {
"type": "string",
"description": "Defines the current working directory to execute the program."
},
"defaultShortcut": {
"type": "string",
"description": "Defines the shortcut to use by default for this command. If the shortcut conflicts, it won't be used. This shortcut can be changed in the Keyboard Shortcut Manager."
},
"contextMenu": {
"type": "object",
"properties": {
"basePath": {
"type": "string",
"description": "Defines a forward-separated path for the parent sub menus. If empty, the menu is insert at first level."
},
"visibleFor": {
"type": "string",
"description": "Defines a comma-separated list of the object types for which the item is visible." If empty, any type is allowed."
},
"enabledFor": {
"type": "string",
"description": "Defines a comma-separated list of the object types for which the item is enabled." If empty, any type is allowed."
}
},
"additionalProperties": false
},
"mainMenu": {
"type": "object",
"properties": {
"basePath": {
"type": "string",
"description": "Defines a forward-separated path for the parent sub menus. It must at least define one level, which is associated to the top menu."
}
},
"required": [
"basePath"
],
"additionalProperties": false
}
},
"required": [
"id",
"displayName"
],
"additionalProperties": false
}
}
},
"required": [
"commands"
],
"additionalProperties": false
}


Options :

{
"type": "object",
"properties": {},
"additionalProperties": false
}


Response :

{
"type": "object",
"properties": {},
"additionalProperties": false
}

Document version : 1


此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅