cmd

package
v0.0.0-...-c66ceb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "controller",
	Short: "Stage automatic controlling, triggering state changes.",
	Long:  `Automatic stage controlling, including midi and DMX, by analyzing audio signals and pre defined light scenes`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		ctx = exitcontext.New()
		logger = createLogger(logLevel)
		storage = createStorage(logger, storagePath)
		controller = createController(logger, disableController)
		loader = disk.NewLoader(storage)

		if err := portaudio.Initialize(); err != nil {
			logger.Fatalf("failed to initialize portaudio: %v", err)
		}
		go func() {
			<-ctx.Done()
			terminateAudio()
		}()
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		terminateAudio()
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL