-
Notifications
You must be signed in to change notification settings - Fork 1
Extend input command group #7
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
base: main
Are you sure you want to change the base?
Conversation
|
Demo |
|
The main question I still have is around device property names. I've only observed two here, |
|
@onyx-and-iris check it out when you get a chance! |
onyx-and-iris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the rest of the CLI, let's keep command struct definitions next to the Run methods that hang off them.
For example:
// InputCreateCmd provides a command to create an input.
type InputCreateCmd struct {
Name string `arg:"" help:"Name for the input." required:""`
Kind string `arg:"" help:"Input kind (e.g., coreaudio_input_capture, macos-avcapture)." required:""`
}
// Run executes the command to create an input.
func (cmd *InputCreateCmd) Run(ctx *context) error {
currentScene, err := ctx.Client.Scenes.GetCurrentProgramScene()
if err != nil {
return err
}
...
}
So I've taken a look into this, I think the way to do it is to fetch the input settings for the input in question, then match it's device id against the device ids returned by GetInputPropertiesListPropertyItems and finally return the device name. Check out this gist. Note, I've modified the device function too because it was raising an unparam warning. As well as that, err was always nil. Have a fiddle around with it let me know what you think. |
Fixes #5