2015-02-25 21:23:57 -08:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2015 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <memory>
|
|
|
|
#include <obs.hpp>
|
|
|
|
|
|
|
|
#include "properties-view.hpp"
|
|
|
|
|
|
|
|
class OBSBasic;
|
|
|
|
class QMenu;
|
|
|
|
|
|
|
|
#include "ui_OBSBasicFilters.h"
|
|
|
|
|
|
|
|
class OBSBasicFilters : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
OBSBasic *main;
|
|
|
|
|
|
|
|
std::unique_ptr<Ui::OBSBasicFilters> ui;
|
|
|
|
OBSSource source;
|
|
|
|
OBSPropertiesView *view = nullptr;
|
|
|
|
|
|
|
|
OBSSignal addSignal;
|
|
|
|
OBSSignal removeSignal;
|
|
|
|
OBSSignal reorderSignal;
|
|
|
|
|
|
|
|
OBSSignal removeSourceSignal;
|
|
|
|
OBSSignal renameSourceSignal;
|
2017-09-28 10:08:27 -07:00
|
|
|
OBSSignal updatePropertiesSignal;
|
2015-02-25 21:23:57 -08:00
|
|
|
|
|
|
|
inline OBSSource GetFilter(int row, bool async);
|
|
|
|
|
|
|
|
void UpdateFilters();
|
|
|
|
void UpdatePropertiesView(int row, bool async);
|
|
|
|
|
|
|
|
static void OBSSourceFilterAdded(void *param, calldata_t *data);
|
|
|
|
static void OBSSourceFilterRemoved(void *param, calldata_t *data);
|
|
|
|
static void OBSSourceReordered(void *param, calldata_t *data);
|
|
|
|
static void SourceRemoved(void *param, calldata_t *data);
|
|
|
|
static void SourceRenamed(void *param, calldata_t *data);
|
2017-09-28 10:08:27 -07:00
|
|
|
static void UpdateProperties(void *data, calldata_t *params);
|
2015-02-25 21:23:57 -08:00
|
|
|
static void DrawPreview(void *data, uint32_t cx, uint32_t cy);
|
|
|
|
|
|
|
|
QMenu *CreateAddFilterPopupMenu(bool async);
|
|
|
|
|
|
|
|
void AddNewFilter(const char *id);
|
|
|
|
void ReorderFilter(QListWidget *list, obs_source_t *filter, size_t idx);
|
|
|
|
|
|
|
|
void CustomContextMenu(const QPoint &pos, bool async);
|
|
|
|
void EditItem(QListWidgetItem *item, bool async);
|
|
|
|
|
|
|
|
void FilterNameEdited(QWidget *editor, QListWidget *list);
|
|
|
|
|
2017-04-09 03:39:53 -07:00
|
|
|
bool isAsync;
|
|
|
|
|
2018-06-14 15:56:18 -07:00
|
|
|
int noPreviewMargin;
|
|
|
|
|
2020-03-12 14:07:05 -07:00
|
|
|
bool editActive = false;
|
|
|
|
|
2015-02-25 21:23:57 -08:00
|
|
|
private slots:
|
|
|
|
void AddFilter(OBSSource filter);
|
|
|
|
void RemoveFilter(OBSSource filter);
|
|
|
|
void ReorderFilters();
|
|
|
|
void RenameAsyncFilter();
|
|
|
|
void RenameEffectFilter();
|
2017-04-09 03:39:53 -07:00
|
|
|
void ResetFilters();
|
2015-02-25 21:23:57 -08:00
|
|
|
|
|
|
|
void AddFilterFromAction();
|
|
|
|
|
|
|
|
void on_addAsyncFilter_clicked();
|
|
|
|
void on_removeAsyncFilter_clicked();
|
|
|
|
void on_moveAsyncFilterUp_clicked();
|
|
|
|
void on_moveAsyncFilterDown_clicked();
|
|
|
|
void on_asyncFilters_currentRowChanged(int row);
|
|
|
|
void on_asyncFilters_customContextMenuRequested(const QPoint &pos);
|
|
|
|
void on_asyncFilters_GotFocus();
|
|
|
|
|
|
|
|
void on_addEffectFilter_clicked();
|
|
|
|
void on_removeEffectFilter_clicked();
|
|
|
|
void on_moveEffectFilterUp_clicked();
|
|
|
|
void on_moveEffectFilterDown_clicked();
|
|
|
|
void on_effectFilters_currentRowChanged(int row);
|
|
|
|
void on_effectFilters_customContextMenuRequested(const QPoint &pos);
|
|
|
|
void on_effectFilters_GotFocus();
|
|
|
|
|
2018-08-28 20:06:38 -07:00
|
|
|
void on_actionRemoveFilter_triggered();
|
2018-08-28 20:34:09 -07:00
|
|
|
void on_actionMoveUp_triggered();
|
|
|
|
void on_actionMoveDown_triggered();
|
2018-08-28 20:06:38 -07:00
|
|
|
|
2015-02-25 21:23:57 -08:00
|
|
|
void AsyncFilterNameEdited(QWidget *editor,
|
2019-06-22 22:13:45 -07:00
|
|
|
QAbstractItemDelegate::EndEditHint endHint);
|
2015-02-25 21:23:57 -08:00
|
|
|
void EffectFilterNameEdited(QWidget *editor,
|
2019-06-22 22:13:45 -07:00
|
|
|
QAbstractItemDelegate::EndEditHint endHint);
|
2015-02-25 21:23:57 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
OBSBasicFilters(QWidget *parent, OBSSource source_);
|
|
|
|
~OBSBasicFilters();
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent *event) override;
|
|
|
|
};
|