MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / MacroSegmentScriptEdit

Method MacroSegmentScriptEdit

plugins/scripting/macro-segment-script.cpp:232–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232MacroSegmentScriptEdit::MacroSegmentScriptEdit(
233 QWidget *parent, std::shared_ptr<MacroSegmentScript> entryData)
234 : QWidget(parent),
235 _timeout(new DurationSelection(this))
236{
237 QWidget::connect(_timeout, &DurationSelection::DurationChanged, this,
238 &MacroSegmentScriptEdit::TimeoutChanged);
239
240 auto timeoutLayout = new QHBoxLayout();
241 PlaceWidgets(obs_module_text("AdvSceneSwitcher.script.timeout"),
242 timeoutLayout, {{"{{timeout}}", _timeout}});
243
244 auto layout = new QVBoxLayout();
245
246 auto properties = entryData->GetProperties();
247 if (!!properties) {
248 obs_properties_destroy(properties);
249
250 // We need a separate OBSData object here as we can't risk
251 // entryData->_settings being modified while it is currently used
252 OBSDataAutoRelease data = obs_data_create();
253 obs_data_apply(data, entryData->GetSettings());
254
255#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(30, 0, 0)
256 auto propertiesView =
257 new OBSPropertiesView(data.Get(), this, GetProperties,
258 nullptr, UpdateSettings);
259 layout->addWidget(propertiesView);
260 connect(propertiesView, &OBSPropertiesView::PropertiesResized,
261 this, [this]() {
262 adjustSize();
263 updateGeometry();
264 });
265#else
266 layout->addWidget(new QLabel(
267 "Displaying script properties not supported when compiled for OBS 29!"));
268#endif
269 }
270
271 layout->addLayout(timeoutLayout);
272 setLayout(layout);
273
274 _entryData = entryData;
275 UpdateEntryData();
276 _loading = false;
277
278 adjustSize();
279 updateGeometry();
280}
281
282void MacroSegmentScriptEdit::UpdateEntryData()
283{

Callers

nothing calls this directly

Calls 5

PlaceWidgetsFunction · 0.85
obs_module_textFunction · 0.85
GetPropertiesMethod · 0.80
GetMethod · 0.80
GetSettingsMethod · 0.45

Tested by

no test coverage detected