Ejemplo n.º 1
0
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
	: QDialog (parent),
	  ui      (new Ui::OBSBasicTransform),
	  main    (parent)
{
	ui->setupUi(this);

	HookWidget(ui->positionX,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->positionY,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->rotation,     DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeX,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeY,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->align,        COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsType,   COMBO_CHANGED,   SLOT(OnBoundsType(int)));
	HookWidget(ui->boundsAlign,  COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsWidth,  DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->boundsHeight, DSCROLL_CHANGED, SLOT(OnControlChanged()));

	OBSScene curScene = main->GetCurrentScene();
	SetScene(curScene);
	SetItem(FindASelectedItem(curScene));

	channelChangedSignal.Connect(obs_get_signal_handler(), "channel_change",
			OBSChannelChanged, this);
}
Ejemplo n.º 2
0
void OBSBasicTransform::OBSSceneItemDeselect(void *param, calldata_t *data)
{
	OBSBasicTransform *window = reinterpret_cast<OBSBasicTransform*>(param);
	OBSScene     scene = (obs_scene_t*)calldata_ptr(data, "scene");
	OBSSceneItem item  = (obs_sceneitem_t*)calldata_ptr(data, "item");

	if (item == window->item)
		window->SetItem(FindASelectedItem(scene));
}
Ejemplo n.º 3
0
void OBSBasicTransform::OBSChannelChanged(void *param, calldata_t *data)
{
	OBSBasicTransform *window = reinterpret_cast<OBSBasicTransform*>(param);
	uint32_t channel = (uint32_t)calldata_int(data, "channel");
	OBSSource source = (obs_source_t*)calldata_ptr(data, "source");

	if (channel == 0) {
		OBSScene scene = obs_scene_from_source(source);
		window->SetScene(scene);

		if (!scene)
			window->SetItem(nullptr);
		else
			window->SetItem(FindASelectedItem(scene));
	}
}
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
	: QDialog (parent),
	  ui      (new Ui::OBSBasicTransform),
	  main    (parent)
{
	ui->setupUi(this);

	HookWidget(ui->positionX,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->positionY,    DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->rotation,     DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeX,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->sizeY,        DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->align,        COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsType,   COMBO_CHANGED,   SLOT(OnBoundsType(int)));
	HookWidget(ui->boundsAlign,  COMBO_CHANGED,   SLOT(OnControlChanged()));
	HookWidget(ui->boundsWidth,  DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->boundsHeight, DSCROLL_CHANGED, SLOT(OnControlChanged()));
	HookWidget(ui->cropLeft,     ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropRight,    ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropTop,      ISCROLL_CHANGED, SLOT(OnCropChanged()));
	HookWidget(ui->cropBottom,   ISCROLL_CHANGED, SLOT(OnCropChanged()));

	connect(ui->buttonBox->button(QDialogButtonBox::Reset),
		SIGNAL(clicked()), this, SLOT(on_resetButton_clicked()));
	connect(ui->buttonBox,
		SIGNAL(rejected()), this, SLOT(close()));

	installEventFilter(CreateShortcutFilter());

	OBSScene curScene = main->GetCurrentScene();
	SetScene(curScene);
	SetItem(FindASelectedItem(curScene));

	channelChangedSignal.Connect(obs_get_signal_handler(), "channel_change",
			OBSChannelChanged, this);
}