| 928 | } |
| 929 | |
| 930 | ObjectDetectEdit::ObjectDetectEdit( |
| 931 | QWidget *parent, PreviewDialog *previewDialog, |
| 932 | const std::shared_ptr<MacroConditionVideo> &data) |
| 933 | : QWidget(parent), |
| 934 | _modelDataPath(new FileSelection()), |
| 935 | _objectScaleThreshold(new SliderSpinBox( |
| 936 | 1.1, 5., |
| 937 | obs_module_text( |
| 938 | "AdvSceneSwitcher.condition.video.objectScaleThreshold"), |
| 939 | obs_module_text( |
| 940 | "AdvSceneSwitcher.condition.video.objectScaleThresholdDescription"))), |
| 941 | _minNeighbors(new QSpinBox()), |
| 942 | _minNeighborsDescription(new QLabel(obs_module_text( |
| 943 | "AdvSceneSwitcher.condition.video.minNeighborDescription"))), |
| 944 | _minSize(new SizeSelection(0, 1024)), |
| 945 | _maxSize(new SizeSelection(0, 4096)), |
| 946 | _previewDialog(previewDialog), |
| 947 | _entryData(data) |
| 948 | { |
| 949 | _minNeighbors->setMinimum(minMinNeighbors); |
| 950 | _minNeighbors->setMaximum(maxMinNeighbors); |
| 951 | |
| 952 | QWidget::connect( |
| 953 | _objectScaleThreshold, |
| 954 | SIGNAL(DoubleValueChanged(const NumberVariable<double> &)), |
| 955 | this, |
| 956 | SLOT(ObjectScaleThresholdChanged( |
| 957 | const NumberVariable<double> &))); |
| 958 | QWidget::connect(_minNeighbors, SIGNAL(valueChanged(int)), this, |
| 959 | SLOT(MinNeighborsChanged(int))); |
| 960 | QWidget::connect(_minSize, SIGNAL(SizeChanged(Size)), this, |
| 961 | SLOT(MinSizeChanged(Size))); |
| 962 | QWidget::connect(_maxSize, SIGNAL(SizeChanged(Size)), this, |
| 963 | SLOT(MaxSizeChanged(Size))); |
| 964 | QWidget::connect(_modelDataPath, SIGNAL(PathChanged(const QString &)), |
| 965 | this, SLOT(ModelPathChanged(const QString &))); |
| 966 | |
| 967 | std::unordered_map<std::string, QWidget *> widgetPlaceholders = { |
| 968 | {"{{minNeighbors}}", _minNeighbors}, |
| 969 | {"{{minSize}}", _minSize}, |
| 970 | {"{{maxSize}}", _maxSize}, |
| 971 | {"{{modelDataPath}}", _modelDataPath}, |
| 972 | }; |
| 973 | |
| 974 | auto pathLayout = new QHBoxLayout; |
| 975 | pathLayout->setContentsMargins(0, 0, 0, 0); |
| 976 | PlaceWidgets( |
| 977 | obs_module_text( |
| 978 | "AdvSceneSwitcher.condition.video.layout.modelPath"), |
| 979 | pathLayout, widgetPlaceholders); |
| 980 | |
| 981 | auto neighborsLayout = new QHBoxLayout; |
| 982 | neighborsLayout->setContentsMargins(0, 0, 0, 0); |
| 983 | PlaceWidgets( |
| 984 | obs_module_text( |
| 985 | "AdvSceneSwitcher.condition.video.layout.minNeighbor"), |
| 986 | neighborsLayout, widgetPlaceholders); |
| 987 |
nothing calls this directly
no test coverage detected