mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 02:40:26 +00:00
* use ug --capabilities for querying * support for webcams on Windows and MacOS * support for decklink capturers and modes * query v4l2 through UltraGrid * don't store state in ui widgets (preparation for saving/loading settings) * automatic FEC
34 lines
767 B
C++
34 lines
767 B
C++
#include <functional>
|
|
#include "widget_ui.hpp"
|
|
|
|
WidgetUi::WidgetUi(Settings *settings, const std::string &opt) :
|
|
settings(settings),
|
|
opt(opt)
|
|
{
|
|
|
|
}
|
|
|
|
void WidgetUi::setOpt(const std::string &opt){
|
|
this->opt = opt;
|
|
updateUiState();
|
|
registerCallback();
|
|
}
|
|
|
|
void WidgetUi::registerCallback(const std::string &option){
|
|
if(option == "" || registeredCallbacks.find(option) != registeredCallbacks.end())
|
|
return;
|
|
|
|
settings->getOption(option).addOnChangeCallback(
|
|
std::bind(
|
|
&WidgetUi::optChangeCallback,
|
|
this,
|
|
std::placeholders::_1,
|
|
std::placeholders::_2));
|
|
|
|
registeredCallbacks.insert(option);
|
|
}
|
|
|
|
void WidgetUi::registerCallback(){
|
|
registerCallback(opt);
|
|
}
|