HulaLoop
Simple cross-platform audio loopback and recording.
InteractiveCLI.h
1 #ifndef HL_INTERACTIVE_CLI_H
2 #define HL_INTERACTIVE_CLI_H
3 
4 #include <hlcontrol/hlcontrol.h>
5 
6 #include <QCoreApplication>
7 
8 namespace hula
9 {
15  {
16  HULA_CLI_SUCCESS,
17  HULA_CLI_FAILURE,
18  HULA_CLI_EXIT
19  };
20 
25 
26  Q_DECLARE_TR_FUNCTIONS(CLI)
27 
28  private:
29  QCoreApplication *app;
30  Transport *t;
31  HulaSettings *settings;
32 
33  double delay = 0;
34  double duration = HL_INFINITE_RECORD;
35  std::string outputFilePath;
36 
37  public:
38  InteractiveCLI(QCoreApplication *app);
39 
40  void unusedArgs(const std::vector<std::string> &args, int numUsed) const;
41  void missingArg(const std::string &argName) const;
42  void malformedArg(const std::string &argName, const std::string &val, const std::string &type) const;
43 
44  void start();
45  HulaCliStatus processCommand(const std::string &command, const std::vector<std::string> &args);
47  void setOutputFilePath(const std::string &path);
48 
50  };
51 }
52 
53 #endif // END HL_INTERACTIVE_CLI_H
<hlcontrol/hlcontrol.h>
Extra class for managing the state of the application and all audio related processes.
Definition: Transport.h:33
void malformedArg(const std::string &argName, const std::string &val, const std::string &type) const
Print a warning about a malformed argument.
Definition: InteractiveCLI.cpp:58
Definition: CLICommon.h:49
~InteractiveCLI()
Destructor for InteractiveCLI.
Definition: InteractiveCLI.cpp:484
HulaCliStatus
Status returned by calls to processCommand.
Definition: InteractiveCLI.h:14
Class containing the interactive CLI.
Definition: InteractiveCLI.h:24
InteractiveCLI(QCoreApplication *app)
Constuct a new instance of InteractiveCLI.
Definition: InteractiveCLI.cpp:19
void start()
Start taking in commands.
Definition: InteractiveCLI.cpp:69
Wrapper around translation functions for Qt.
Definition: Controller.h:10
Singleton class containing all settings for the application.
Definition: HulaSettings.h:23
void setOutputFilePath(const std::string &path)
Set the default output file path used by the CLI.
Definition: InteractiveCLI.cpp:476
HulaCliStatus processCommand(const std::string &command, const std::vector< std::string > &args)
Proccess the command entered by the user.
Definition: InteractiveCLI.cpp:117
TransportState getState()
Fetch the state of the internal Transport.
Definition: InteractiveCLI.cpp:466
void unusedArgs(const std::vector< std::string > &args, int numUsed) const
Print a warning to the user detailing extra arguments that they provided.
Definition: InteractiveCLI.cpp:33
void missingArg(const std::string &argName) const
Print a warning about missing args to the specified command.
Definition: InteractiveCLI.cpp:46
TransportState
Available states for the recording/playback logic of the application.
Definition: Transport.h:19