mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 06:40:26 +00:00
decklink_set_profile: handle help
This commit is contained in:
@@ -399,6 +399,12 @@ bool decklink_set_profile(IDeckLink *deckLink, bmd_option const &req_profile, bo
|
||||
return true;
|
||||
}
|
||||
|
||||
if (req_profile.is_help()) {
|
||||
printf("Available profiles:\n");
|
||||
print_bmd_device_profiles("\t");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = true;
|
||||
IDeckLinkProfileManager *manager = nullptr;
|
||||
IDeckLinkProfileIterator *it = nullptr;
|
||||
@@ -695,6 +701,10 @@ const char *bmd_option::get_string() const {
|
||||
bool bmd_option::is_default() const {
|
||||
return m_type == type_tag::t_default;
|
||||
}
|
||||
bool bmd_option::is_help() const {
|
||||
return m_type == type_tag::t_string &&
|
||||
strcmp(get_string(), "help") == 0;
|
||||
}
|
||||
bool bmd_option::is_user_set() const {
|
||||
return m_user_specified;
|
||||
}
|
||||
@@ -727,6 +737,11 @@ void bmd_option::parse(const char *val)
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(val, "help") == 0) {
|
||||
set_string(val);
|
||||
return;
|
||||
}
|
||||
|
||||
// explicitly typed (either "str" or 'fcc')
|
||||
if ((val[0] == '"' && val[strlen(val) - 1] == '"') || (val[0] == '\'' && val[strlen(val) - 1] == '\'')) {
|
||||
string raw_val(val + 1);
|
||||
|
||||
@@ -98,6 +98,7 @@ public:
|
||||
explicit bmd_option(int64_t val, bool user_spec = true);
|
||||
explicit bmd_option(bool val, bool user_spec = true);
|
||||
bool is_default() const;
|
||||
[[nodiscard]] bool is_help() const;
|
||||
bool is_user_set() const;
|
||||
void set_keep();
|
||||
bool keep() const;
|
||||
|
||||
Reference in New Issue
Block a user