UI: Add scaling filter options for scene items to UI
Adds scale filtering options to the scene item right-click context menu.
This commit is contained in:
parent
d49833830c
commit
44beb75b04
@ -168,6 +168,13 @@ Basic.DisplayCapture="Display Capture"
|
||||
# display context menu
|
||||
Basic.Main.PreviewConextMenu.Enable="Enable Preview"
|
||||
|
||||
# scale filtering
|
||||
ScaleFiltering="Scale Filtering"
|
||||
ScaleFiltering.Point="Point"
|
||||
ScaleFiltering.Bilinear="Bilinear"
|
||||
ScaleFiltering.Bicubic="Bicubic"
|
||||
ScaleFiltering.Lanczos="Lanczos"
|
||||
|
||||
# deinterlacing
|
||||
Deinterlacing="Deinterlacing"
|
||||
Deinterlacing.Discard="Discard"
|
||||
|
@ -2881,6 +2881,38 @@ QMenu *OBSBasic::AddDeinterlacingMenu(obs_source_t *source)
|
||||
return menu;
|
||||
}
|
||||
|
||||
void OBSBasic::SetScaleFilter()
|
||||
{
|
||||
QAction *action = reinterpret_cast<QAction*>(sender());
|
||||
obs_scale_type mode = (obs_scale_type)action->property("mode").toInt();
|
||||
OBSSceneItem sceneItem = GetCurrentSceneItem();
|
||||
|
||||
obs_sceneitem_set_scale_filter(sceneItem, mode);
|
||||
}
|
||||
|
||||
QMenu *OBSBasic::AddScaleFilteringMenu(obs_sceneitem_t *item)
|
||||
{
|
||||
QMenu *menu = new QMenu(QTStr("ScaleFiltering"));
|
||||
obs_scale_type scaleFilter = obs_sceneitem_get_scale_filter(item);
|
||||
QAction *action;
|
||||
|
||||
#define ADD_MODE(name, mode) \
|
||||
action = menu->addAction(QTStr("" name), this, \
|
||||
SLOT(SetScaleFilter())); \
|
||||
action->setProperty("mode", (int)mode); \
|
||||
action->setCheckable(true); \
|
||||
action->setChecked(scaleFilter == mode);
|
||||
|
||||
ADD_MODE("Disable", OBS_SCALE_DISABLE);
|
||||
ADD_MODE("ScaleFiltering.Point", OBS_SCALE_POINT);
|
||||
ADD_MODE("ScaleFiltering.Bilinear", OBS_SCALE_BILINEAR);
|
||||
ADD_MODE("ScaleFiltering.Bicubic", OBS_SCALE_BICUBIC);
|
||||
ADD_MODE("ScaleFiltering.Lanczos", OBS_SCALE_LANCZOS);
|
||||
#undef ADD_MODE
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
|
||||
{
|
||||
QMenu popup(this);
|
||||
@ -2939,6 +2971,10 @@ void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
|
||||
popup.addMenu(AddDeinterlacingMenu(source));
|
||||
popup.addSeparator();
|
||||
}
|
||||
|
||||
popup.addMenu(AddScaleFilteringMenu(sceneItem));
|
||||
popup.addSeparator();
|
||||
|
||||
popup.addMenu(sourceProjector);
|
||||
popup.addSeparator();
|
||||
|
||||
|
@ -333,6 +333,8 @@ private slots:
|
||||
void SetDeinterlacingMode();
|
||||
void SetDeinterlacingOrder();
|
||||
|
||||
void SetScaleFilter();
|
||||
|
||||
private:
|
||||
/* OBS Callbacks */
|
||||
static void SceneReordered(void *data, calldata_t *params);
|
||||
@ -400,6 +402,7 @@ public:
|
||||
void ReorderSceneItem(obs_sceneitem_t *item, size_t idx);
|
||||
|
||||
QMenu *AddDeinterlacingMenu(obs_source_t *source);
|
||||
QMenu *AddScaleFilteringMenu(obs_sceneitem_t *item);
|
||||
void CreateSourcePopupMenu(QListWidgetItem *item, bool preview);
|
||||
|
||||
void UpdateTitleBar();
|
||||
|
Loading…
x
Reference in New Issue
Block a user