(API Change) Rename autoselect/default functions
For the sake of consistency, renamed these two functions to include _value at the end so they are consistent. Renamed: To: ------------------------------------------------------- obs_data_has_default obs_data_has_default_value obs_data_has_autoselect obs_data_has_autoselect_value obs_data_item_has_default obs_data_item_has_default_value obs_data_item_has_autoselect obs_data_item_has_autoselect_value
This commit is contained in:
parent
5780f3f177
commit
7608f77e8b
@ -1132,14 +1132,14 @@ bool obs_data_has_user_value(obs_data_t data, const char *name)
|
||||
return data && obs_data_item_has_user_value(get_item(data, name));
|
||||
}
|
||||
|
||||
bool obs_data_has_default(obs_data_t data, const char *name)
|
||||
bool obs_data_has_default_value(obs_data_t data, const char *name)
|
||||
{
|
||||
return data && obs_data_item_has_default(get_item(data, name));
|
||||
return data && obs_data_item_has_default_value(get_item(data, name));
|
||||
}
|
||||
|
||||
bool obs_data_has_autoselect(obs_data_t data, const char *name)
|
||||
bool obs_data_has_autoselect_value(obs_data_t data, const char *name)
|
||||
{
|
||||
return data && obs_data_item_has_autoselect(get_item(data, name));
|
||||
return data && obs_data_item_has_autoselect_value(get_item(data, name));
|
||||
}
|
||||
|
||||
bool obs_data_item_has_user_value(obs_data_item_t item)
|
||||
@ -1147,12 +1147,12 @@ bool obs_data_item_has_user_value(obs_data_item_t item)
|
||||
return item && item->data_size;
|
||||
}
|
||||
|
||||
bool obs_data_item_has_default(obs_data_item_t item)
|
||||
bool obs_data_item_has_default_value(obs_data_item_t item)
|
||||
{
|
||||
return item && item->default_size;
|
||||
}
|
||||
|
||||
bool obs_data_item_has_autoselect(obs_data_item_t item)
|
||||
bool obs_data_item_has_autoselect_value(obs_data_item_t item)
|
||||
{
|
||||
return item && item->autoselect_size;
|
||||
}
|
||||
|
@ -157,12 +157,12 @@ EXPORT void obs_data_array_erase(obs_data_array_t array, size_t idx);
|
||||
/* Item status inspection */
|
||||
|
||||
EXPORT bool obs_data_has_user_value(obs_data_t data, const char *name);
|
||||
EXPORT bool obs_data_has_default(obs_data_t data, const char *name);
|
||||
EXPORT bool obs_data_has_autoselect(obs_data_t data, const char *name);
|
||||
EXPORT bool obs_data_has_default_value(obs_data_t data, const char *name);
|
||||
EXPORT bool obs_data_has_autoselect_value(obs_data_t data, const char *name);
|
||||
|
||||
EXPORT bool obs_data_item_has_user_value(obs_data_item_t data);
|
||||
EXPORT bool obs_data_item_has_default(obs_data_item_t data);
|
||||
EXPORT bool obs_data_item_has_autoselect(obs_data_item_t data);
|
||||
EXPORT bool obs_data_item_has_default_value(obs_data_item_t data);
|
||||
EXPORT bool obs_data_item_has_autoselect_value(obs_data_item_t data);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Clearing data values */
|
||||
|
@ -281,7 +281,7 @@ QWidget *OBSPropertiesView::AddList(obs_property_t prop, bool &warning)
|
||||
if (idx != -1)
|
||||
combo->setCurrentIndex(idx);
|
||||
|
||||
if (obs_data_has_autoselect(settings, name)) {
|
||||
if (obs_data_has_autoselect_value(settings, name)) {
|
||||
string autoselect =
|
||||
from_obs_data_autoselect(settings, name, format);
|
||||
int id = combo->findData(QT_UTF8(autoselect.c_str()));
|
||||
|
@ -707,7 +707,7 @@ static bool autoselect_preset(AVCaptureDevice *dev, obs_data_t settings)
|
||||
{
|
||||
NSString *preset = get_string(settings, "preset");
|
||||
if (!dev || [dev supportsAVCaptureSessionPreset:preset]) {
|
||||
if (obs_data_has_autoselect(settings, "preset")) {
|
||||
if (obs_data_has_autoselect_value(settings, "preset")) {
|
||||
obs_data_unset_autoselect_value(settings, "preset");
|
||||
return true;
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ static bool DetermineResolution(int &cx, int &cy, obs_data_t settings,
|
||||
VideoDevice dev)
|
||||
{
|
||||
const char *res = obs_data_get_autoselect_string(settings, RESOLUTION);
|
||||
if (obs_data_has_autoselect(settings, RESOLUTION) &&
|
||||
if (obs_data_has_autoselect_value(settings, RESOLUTION) &&
|
||||
ConvertRes(cx, cy, res) &&
|
||||
ResolutionAvailable(dev, cx, cy))
|
||||
return true;
|
||||
@ -394,11 +394,14 @@ void DShowInput::Update(obs_data_t settings)
|
||||
VideoFormat format = VideoFormat::Any;
|
||||
|
||||
if (resType == ResType_Custom) {
|
||||
bool has_autosel_val;
|
||||
string resolution = obs_data_get_string(settings, RESOLUTION);
|
||||
if (!ResolutionValid(resolution, cx, cy))
|
||||
return;
|
||||
|
||||
interval = obs_data_has_autoselect(settings, FRAME_INTERVAL) ?
|
||||
has_autosel_val = obs_data_has_autoselect_value(settings,
|
||||
FRAME_INTERVAL);
|
||||
interval = has_autosel_val ?
|
||||
obs_data_get_autoselect_int(settings, FRAME_INTERVAL) :
|
||||
obs_data_get_int(settings, FRAME_INTERVAL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user