1 #ifndef HULA_CLI_COMMON_H 2 #define HULA_CLI_COMMON_H 10 #include <HulaVersion.h> 14 #define HL_CLI_NAME "hulaloop-cli" 15 #define HL_CLI_ASCII_HEADER "\n" \ 17 " | | | | | | | |\n" \ 18 " | |__| |_ _| | __ _| | ___ ___ _ __\n" \ 19 " | __ | | | | |/ _` | | / _ \\ / _ \\| '_ \\\n" \ 20 " | | | | |_| | | (_| | |___| (_) | (_) | |_) |\n" \ 21 " |_| |_|\\__,_|_|\\__,_|______\\___/ \\___/| .__/\n" \ 24 "----------------------------------------------------\n\n" \ 35 std::vector<Device *> devices;
46 for (
size_t i = 0; i < devices.size(); i++)
48 printf(
"Device #%lu: %s\n", i, devices[i]->getName().c_str());
49 printf(
"Record: %s\n", (devices[i]->getType() & DeviceType::RECORD) ?
"true" :
"false");
50 printf(
"Loopback: %s\n", (devices[i]->getType() & DeviceType::LOOPBACK) ?
"true" :
"false");
51 printf(
"Output: %s\n", (devices[i]->getType() & DeviceType::PLAYBACK) ?
"true" :
"false");
69 inline Device *findDevice(
Transport *t,
const std::string &name, DeviceType type)
72 std::vector<Device *> devices;
82 id = std::stoi(name,
nullptr);
84 catch (std::invalid_argument &e)
90 for (
size_t i = 0; i < devices.size(); i++)
93 if (i ==
id || devices[i]->getName() == name)
103 device =
new Device(*device);
110 fprintf(stderr,
"\nCould not find input device matching: %s\n", name.c_str());
119 inline void printSettings()
128 printf(
"Encoding: %s\n",
"WAV");
134 #endif // END HULA_CLI_COMMON_H
Extra class for managing the state of the application and all audio related processes.
Definition: Transport.h:29
Controller * getController() const
Get the controller instance.
Definition: Transport.cpp:193
static void deleteDevices(std::vector< Device * > devices)
Delete all the device pointers inside the vector.
Definition: Device.cpp:54
std::vector< Device * > getDevices(DeviceType type) const
Fetch a list of devices for the given DeviceType.
Definition: Controller.cpp:129
static HulaSettings * getInstance()
Retreive the singular instance of HulaSettings or construct a new one if none exists.
Definition: HulaSettings.cpp:24
std::string getOutputFilePath()
Get the path of the output file specified at startup or during the file save routine.
Definition: HulaAudioSettings.cpp:129
double getRecordDuration()
Get the length of the record in seconds.
Definition: HulaAudioSettings.cpp:163
std::string getDefaultInputDeviceName()
Get the name of the device that should be initially selected for record.
Definition: HulaAudioSettings.cpp:107
int getSampleRate()
Get the number of channels for the current global device configuration.
Definition: HulaAudioSettings.cpp:83
Wrapper for OS specific device information.
Definition: Device.h:34
Definition: Controller.h:11
Singleton class containing all settings for the application.
Definition: HulaSettings.h:12
std::string getDefaultOutputDeviceName()
Get the name of the device that should be initially selected for playback.
Definition: HulaAudioSettings.cpp:118
bool getShowRecordDevices()
Getters.
Definition: HulaAudioSettings.cpp:57
double getDelayTimer()
Get the length of the delay timer in seconds.
Definition: HulaAudioSettings.cpp:152