format: reformatting files
This commit is contained in:
@@ -56,6 +56,6 @@ add_subdirectory(toolbar)
|
||||
add_subdirectory(viewer)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/audiomonitor/audiomonitor.h
|
||||
widget/audiomonitor/audiomonitor.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/audiomonitor/audiomonitor.h
|
||||
widget/audiomonitor/audiomonitor.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/bezier/bezierwidget.cpp
|
||||
widget/bezier/bezierwidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/bezier/bezierwidget.cpp
|
||||
widget/bezier/bezierwidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/clickablelabel/clickablelabel.h
|
||||
widget/clickablelabel/clickablelabel.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/clickablelabel/clickablelabel.h
|
||||
widget/clickablelabel/clickablelabel.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/collapsebutton/collapsebutton.h
|
||||
widget/collapsebutton/collapsebutton.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/collapsebutton/collapsebutton.h
|
||||
widget/collapsebutton/collapsebutton.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorbutton/colorbutton.h
|
||||
widget/colorbutton/colorbutton.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorbutton/colorbutton.h
|
||||
widget/colorbutton/colorbutton.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorlabelmenu/colorcodingcombobox.cpp
|
||||
widget/colorlabelmenu/colorcodingcombobox.h
|
||||
widget/colorlabelmenu/colorlabelmenu.cpp
|
||||
widget/colorlabelmenu/colorlabelmenu.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorlabelmenu/colorcodingcombobox.cpp
|
||||
widget/colorlabelmenu/colorcodingcombobox.h
|
||||
widget/colorlabelmenu/colorlabelmenu.cpp
|
||||
widget/colorlabelmenu/colorlabelmenu.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,20 +15,20 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorwheel/colorgradientwidget.h
|
||||
widget/colorwheel/colorgradientwidget.cpp
|
||||
widget/colorwheel/colorpreviewbox.h
|
||||
widget/colorwheel/colorpreviewbox.cpp
|
||||
widget/colorwheel/colorspacechooser.h
|
||||
widget/colorwheel/colorspacechooser.cpp
|
||||
widget/colorwheel/colorswatchchooser.h
|
||||
widget/colorwheel/colorswatchchooser.cpp
|
||||
widget/colorwheel/colorswatchwidget.h
|
||||
widget/colorwheel/colorswatchwidget.cpp
|
||||
widget/colorwheel/colorvalueswidget.h
|
||||
widget/colorwheel/colorvalueswidget.cpp
|
||||
widget/colorwheel/colorwheelwidget.h
|
||||
widget/colorwheel/colorwheelwidget.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/colorwheel/colorgradientwidget.h
|
||||
widget/colorwheel/colorgradientwidget.cpp
|
||||
widget/colorwheel/colorpreviewbox.h
|
||||
widget/colorwheel/colorpreviewbox.cpp
|
||||
widget/colorwheel/colorspacechooser.h
|
||||
widget/colorwheel/colorspacechooser.cpp
|
||||
widget/colorwheel/colorswatchchooser.h
|
||||
widget/colorwheel/colorswatchchooser.cpp
|
||||
widget/colorwheel/colorswatchwidget.h
|
||||
widget/colorwheel/colorswatchwidget.cpp
|
||||
widget/colorwheel/colorvalueswidget.h
|
||||
widget/colorwheel/colorvalueswidget.cpp
|
||||
widget/colorwheel/colorwheelwidget.h
|
||||
widget/colorwheel/colorwheelwidget.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/columnedgridlayout/columnedgridlayout.h
|
||||
widget/columnedgridlayout/columnedgridlayout.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/columnedgridlayout/columnedgridlayout.h
|
||||
widget/columnedgridlayout/columnedgridlayout.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/curvewidget/curveview.cpp
|
||||
widget/curvewidget/curveview.h
|
||||
widget/curvewidget/curvewidget.cpp
|
||||
widget/curvewidget/curvewidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/curvewidget/curveview.cpp
|
||||
widget/curvewidget/curveview.h
|
||||
widget/curvewidget/curvewidget.cpp
|
||||
widget/curvewidget/curvewidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/filefield/filefield.cpp
|
||||
widget/filefield/filefield.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/filefield/filefield.cpp
|
||||
widget/filefield/filefield.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/flowlayout/flowlayout.h
|
||||
widget/flowlayout/flowlayout.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/flowlayout/flowlayout.h
|
||||
widget/flowlayout/flowlayout.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/focusablelineedit/focusablelineedit.h
|
||||
widget/focusablelineedit/focusablelineedit.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/focusablelineedit/focusablelineedit.h
|
||||
widget/focusablelineedit/focusablelineedit.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/handmovableview/handmovableview.h
|
||||
widget/handmovableview/handmovableview.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/handmovableview/handmovableview.h
|
||||
widget/handmovableview/handmovableview.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/history/historywidget.cpp
|
||||
widget/history/historywidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/history/historywidget.cpp
|
||||
widget/history/historywidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/keyframeview/keyframeview.cpp
|
||||
widget/keyframeview/keyframeview.h
|
||||
widget/keyframeview/keyframeviewinputconnection.cpp
|
||||
widget/keyframeview/keyframeviewinputconnection.h
|
||||
widget/keyframeview/keyframeviewundo.cpp
|
||||
widget/keyframeview/keyframeviewundo.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/keyframeview/keyframeview.cpp
|
||||
widget/keyframeview/keyframeview.h
|
||||
widget/keyframeview/keyframeviewinputconnection.cpp
|
||||
widget/keyframeview/keyframeviewinputconnection.h
|
||||
widget/keyframeview/keyframeviewundo.cpp
|
||||
widget/keyframeview/keyframeviewundo.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/manageddisplay/manageddisplay.h
|
||||
widget/manageddisplay/manageddisplay.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/manageddisplay/manageddisplay.h
|
||||
widget/manageddisplay/manageddisplay.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -54,7 +54,8 @@ ManagedDisplayWidget::ManagedDisplayWidget(QWidget *parent)
|
||||
RenderManager::instance()->requested_backend()),
|
||||
this);
|
||||
if (!dynamic_renderer->Load()) {
|
||||
qWarning() << "Failed to load dynamic render backend for viewer, falling back to OpenGL";
|
||||
qWarning()
|
||||
<< "Failed to load dynamic render backend for viewer, falling back to OpenGL";
|
||||
delete dynamic_renderer;
|
||||
attached_renderer_ = new OpenGLRenderer(this);
|
||||
} else {
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/menu/menu.cpp
|
||||
widget/menu/menu.h
|
||||
widget/menu/menushared.cpp
|
||||
widget/menu/menushared.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/menu/menu.cpp
|
||||
widget/menu/menu.h
|
||||
widget/menu/menushared.cpp
|
||||
widget/menu/menushared.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/multicam/multicamdisplay.cpp
|
||||
widget/multicam/multicamdisplay.h
|
||||
widget/multicam/multicamwidget.cpp
|
||||
widget/multicam/multicamwidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/multicam/multicamdisplay.cpp
|
||||
widget/multicam/multicamdisplay.h
|
||||
widget/multicam/multicamwidget.cpp
|
||||
widget/multicam/multicamwidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodecombobox/nodecombobox.h
|
||||
widget/nodecombobox/nodecombobox.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodecombobox/nodecombobox.h
|
||||
widget/nodecombobox/nodecombobox.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -23,25 +23,25 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
class NodeParamButton : public QPushButton{
|
||||
Q_OBJECT
|
||||
class NodeParamButton : public QPushButton {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NodeParamButton(QString name, QWidget *parent = nullptr):QPushButton(parent)
|
||||
NodeParamButton(QString name, QWidget *parent = nullptr)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
this->name_=name;
|
||||
this->name_ = name;
|
||||
connect(this, &QPushButton::clicked, this, &NodeParamButton::pressed);
|
||||
}
|
||||
signals:
|
||||
void onPressed(QString name);
|
||||
private slots:
|
||||
void pressed(){
|
||||
void pressed()
|
||||
{
|
||||
emit onPressed(name_);
|
||||
}
|
||||
|
||||
private:
|
||||
QString name_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //NODEPARAMBUTTON_H
|
||||
|
||||
@@ -254,8 +254,11 @@ NodeParamViewItemBody::NodeParamViewItemBody(
|
||||
{ n, input });
|
||||
|
||||
if (!(n->GetInputFlags(input) & kInputFlagHidden)) {
|
||||
QString page_label = n->GetInputProperty(input, QStringLiteral("ui_page")).toString();
|
||||
QString group_label = n->GetInputProperty(input, QStringLiteral("ui_group")).toString();
|
||||
QString page_label =
|
||||
n->GetInputProperty(input, QStringLiteral("ui_page")).toString();
|
||||
QString group_label =
|
||||
n->GetInputProperty(input, QStringLiteral("ui_group"))
|
||||
.toString();
|
||||
if (!page_label.isEmpty() && page_label != current_page) {
|
||||
QLabel *page_title = new QLabel(page_label, this);
|
||||
QFont f = page_title->font();
|
||||
|
||||
@@ -120,8 +120,8 @@ void NodeParamViewWidgetBridge::CreateWidgets()
|
||||
QStringList items = GetInnerInput().GetComboBoxStrings();
|
||||
QStringList values =
|
||||
GetInnerInput().GetProperty("combo_value_str").toStringList();
|
||||
const bool use_value_data =
|
||||
(t == NodeValue::kStrCombo) && !values.isEmpty();
|
||||
const bool use_value_data = (t == NodeValue::kStrCombo) &&
|
||||
!values.isEmpty();
|
||||
for (int i = 0; i < items.size(); ++i) {
|
||||
const QString &label = items.at(i);
|
||||
if (use_value_data && i < values.size()) {
|
||||
@@ -146,17 +146,15 @@ void NodeParamViewWidgetBridge::CreateWidgets()
|
||||
break;
|
||||
}
|
||||
case NodeValue::kColor: {
|
||||
if (GetInnerInput().GetProperty("color_semantic")
|
||||
.toString() == QStringLiteral("scalar")) {
|
||||
if (GetInnerInput().GetProperty("color_semantic").toString() ==
|
||||
QStringLiteral("scalar")) {
|
||||
CreateSliders<FloatSlider>(4, parent);
|
||||
} else {
|
||||
ColorButton *color_button = new ColorButton(
|
||||
GetInnerInput().node()->project()->color_manager(),
|
||||
parent);
|
||||
GetInnerInput().node()->project()->color_manager(), parent);
|
||||
widgets_.append(color_button);
|
||||
connect(
|
||||
color_button, &ColorButton::ColorChanged, this,
|
||||
&NodeParamViewWidgetBridge::WidgetCallback);
|
||||
connect(color_button, &ColorButton::ColorChanged, this,
|
||||
&NodeParamViewWidgetBridge::WidgetCallback);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -203,11 +201,13 @@ void NodeParamViewWidgetBridge::CreateWidgets()
|
||||
break;
|
||||
}
|
||||
case NodeValue::kPushButton: {
|
||||
NodeInput input=GetInnerInput();
|
||||
NodeParamButton *button=new NodeParamButton(input.name(),parent);
|
||||
NodeInput input = GetInnerInput();
|
||||
NodeParamButton *button = new NodeParamButton(input.name(), parent);
|
||||
widgets_.append(button);
|
||||
plugin::PluginNode* plugin_node=dynamic_cast<plugin::PluginNode*>(input.node());
|
||||
connect(button, &NodeParamButton::onPressed, plugin_node, &plugin::PluginNode::pushButtonClicked);
|
||||
plugin::PluginNode *plugin_node =
|
||||
dynamic_cast<plugin::PluginNode *>(input.node());
|
||||
connect(button, &NodeParamButton::onPressed, plugin_node,
|
||||
&plugin::PluginNode::pushButtonClicked);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,15 +329,13 @@ void NodeParamViewWidgetBridge::WidgetCallback()
|
||||
break;
|
||||
}
|
||||
case NodeValue::kColor: {
|
||||
if (GetInnerInput().GetProperty("color_semantic")
|
||||
.toString() == QStringLiteral("scalar")) {
|
||||
FloatSlider *slider =
|
||||
static_cast<FloatSlider *>(sender());
|
||||
if (GetInnerInput().GetProperty("color_semantic").toString() ==
|
||||
QStringLiteral("scalar")) {
|
||||
FloatSlider *slider = static_cast<FloatSlider *>(sender());
|
||||
ProcessSlider(slider, slider->GetValue());
|
||||
} else {
|
||||
// Sender is a ColorButton
|
||||
ManagedColor c =
|
||||
static_cast<ColorButton *>(sender())->GetColor();
|
||||
ManagedColor c = static_cast<ColorButton *>(sender())->GetColor();
|
||||
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
|
||||
@@ -348,22 +346,20 @@ void NodeParamViewWidgetBridge::WidgetCallback()
|
||||
|
||||
Node *n = GetInnerInput().node();
|
||||
n->blockSignals(true);
|
||||
n->SetInputProperty(
|
||||
GetInnerInput().input(), QStringLiteral("col_input"),
|
||||
c.color_input());
|
||||
n->SetInputProperty(
|
||||
GetInnerInput().input(), QStringLiteral("col_display"),
|
||||
c.color_output().display());
|
||||
n->SetInputProperty(
|
||||
GetInnerInput().input(), QStringLiteral("col_view"),
|
||||
c.color_output().view());
|
||||
n->SetInputProperty(
|
||||
GetInnerInput().input(), QStringLiteral("col_look"),
|
||||
c.color_output().look());
|
||||
n->SetInputProperty(GetInnerInput().input(),
|
||||
QStringLiteral("col_input"), c.color_input());
|
||||
n->SetInputProperty(GetInnerInput().input(),
|
||||
QStringLiteral("col_display"),
|
||||
c.color_output().display());
|
||||
n->SetInputProperty(GetInnerInput().input(),
|
||||
QStringLiteral("col_view"),
|
||||
c.color_output().view());
|
||||
n->SetInputProperty(GetInnerInput().input(),
|
||||
QStringLiteral("col_look"),
|
||||
c.color_output().look());
|
||||
n->blockSignals(false);
|
||||
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
GetCommandName());
|
||||
Core::instance()->undo_stack()->push(command, GetCommandName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -496,7 +492,8 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues()
|
||||
case NodeValue::kBinary: {
|
||||
NodeParamViewTextEdit *e =
|
||||
static_cast<NodeParamViewTextEdit *>(widgets_.first());
|
||||
QByteArray bytes = GetInnerInput().GetValueAtTime(node_time).toByteArray();
|
||||
QByteArray bytes =
|
||||
GetInnerInput().GetValueAtTime(node_time).toByteArray();
|
||||
e->setTextPreservingCursor(QString::fromUtf8(bytes.toBase64()));
|
||||
break;
|
||||
}
|
||||
@@ -558,11 +555,9 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues()
|
||||
break;
|
||||
}
|
||||
case NodeValue::kColor: {
|
||||
if (GetInnerInput().GetProperty("color_semantic")
|
||||
.toString() == QStringLiteral("scalar")) {
|
||||
Color c = GetInnerInput()
|
||||
.GetValueAtTime(node_time)
|
||||
.value<Color>();
|
||||
if (GetInnerInput().GetProperty("color_semantic").toString() ==
|
||||
QStringLiteral("scalar")) {
|
||||
Color c = GetInnerInput().GetValueAtTime(node_time).value<Color>();
|
||||
static_cast<FloatSlider *>(widgets_.at(0))
|
||||
->SetValue(static_cast<double>(c.red()));
|
||||
static_cast<FloatSlider *>(widgets_.at(1))
|
||||
@@ -572,27 +567,19 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues()
|
||||
static_cast<FloatSlider *>(widgets_.at(3))
|
||||
->SetValue(static_cast<double>(c.alpha()));
|
||||
} else {
|
||||
ManagedColor mc = GetInnerInput()
|
||||
.GetValueAtTime(node_time)
|
||||
.value<Color>();
|
||||
ManagedColor mc =
|
||||
GetInnerInput().GetValueAtTime(node_time).value<Color>();
|
||||
|
||||
mc.set_color_input(
|
||||
GetInnerInput().GetProperty("col_input").toString());
|
||||
|
||||
QString d = GetInnerInput()
|
||||
.GetProperty("col_display")
|
||||
.toString();
|
||||
QString v = GetInnerInput()
|
||||
.GetProperty("col_view")
|
||||
.toString();
|
||||
QString l = GetInnerInput()
|
||||
.GetProperty("col_look")
|
||||
.toString();
|
||||
QString d = GetInnerInput().GetProperty("col_display").toString();
|
||||
QString v = GetInnerInput().GetProperty("col_view").toString();
|
||||
QString l = GetInnerInput().GetProperty("col_look").toString();
|
||||
|
||||
mc.set_color_output(ColorTransform(d, v, l));
|
||||
|
||||
static_cast<ColorButton *>(widgets_.first())
|
||||
->SetColor(mc);
|
||||
static_cast<ColorButton *>(widgets_.first())->SetColor(mc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -868,8 +855,8 @@ void NodeParamViewWidgetBridge::SetProperty(const QString &key,
|
||||
QStringList items = value.toStringList();
|
||||
QStringList values =
|
||||
GetInnerInput().GetProperty("combo_value_str").toStringList();
|
||||
const bool use_value_data =
|
||||
(data_type == NodeValue::kStrCombo) && !values.isEmpty();
|
||||
const bool use_value_data = (data_type == NodeValue::kStrCombo) &&
|
||||
!values.isEmpty();
|
||||
int index = 0;
|
||||
for (int i = 0; i < items.size(); ++i) {
|
||||
const QString &s = items.at(i);
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodetableview/nodetableview.cpp
|
||||
widget/nodetableview/nodetableview.h
|
||||
widget/nodetableview/nodetablewidget.cpp
|
||||
widget/nodetableview/nodetablewidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodetableview/nodetableview.cpp
|
||||
widget/nodetableview/nodetableview.h
|
||||
widget/nodetableview/nodetablewidget.cpp
|
||||
widget/nodetableview/nodetablewidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodetreeview/nodetreeview.h
|
||||
widget/nodetreeview/nodetreeview.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodetreeview/nodetreeview.h
|
||||
widget/nodetreeview/nodetreeview.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodevaluetree/nodevaluetree.cpp
|
||||
widget/nodevaluetree/nodevaluetree.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodevaluetree/nodevaluetree.cpp
|
||||
widget/nodevaluetree/nodevaluetree.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,25 +15,25 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodeview/nodeview.cpp
|
||||
widget/nodeview/nodeview.h
|
||||
widget/nodeview/nodeviewcommon.h
|
||||
widget/nodeview/nodeviewcontext.cpp
|
||||
widget/nodeview/nodeviewcontext.h
|
||||
widget/nodeview/nodeviewedge.cpp
|
||||
widget/nodeview/nodeviewedge.h
|
||||
widget/nodeview/nodeviewitem.cpp
|
||||
widget/nodeview/nodeviewitem.h
|
||||
widget/nodeview/nodeviewitemconnector.cpp
|
||||
widget/nodeview/nodeviewitemconnector.h
|
||||
widget/nodeview/nodeviewminimap.cpp
|
||||
widget/nodeview/nodeviewminimap.h
|
||||
widget/nodeview/nodeviewscene.cpp
|
||||
widget/nodeview/nodeviewscene.h
|
||||
widget/nodeview/nodeviewtoolbar.cpp
|
||||
widget/nodeview/nodeviewtoolbar.h
|
||||
widget/nodeview/nodewidget.cpp
|
||||
widget/nodeview/nodewidget.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/nodeview/nodeview.cpp
|
||||
widget/nodeview/nodeview.h
|
||||
widget/nodeview/nodeviewcommon.h
|
||||
widget/nodeview/nodeviewcontext.cpp
|
||||
widget/nodeview/nodeviewcontext.h
|
||||
widget/nodeview/nodeviewedge.cpp
|
||||
widget/nodeview/nodeviewedge.h
|
||||
widget/nodeview/nodeviewitem.cpp
|
||||
widget/nodeview/nodeviewitem.h
|
||||
widget/nodeview/nodeviewitemconnector.cpp
|
||||
widget/nodeview/nodeviewitemconnector.h
|
||||
widget/nodeview/nodeviewminimap.cpp
|
||||
widget/nodeview/nodeviewminimap.h
|
||||
widget/nodeview/nodeviewscene.cpp
|
||||
widget/nodeview/nodeviewscene.h
|
||||
widget/nodeview/nodeviewtoolbar.cpp
|
||||
widget/nodeview/nodeviewtoolbar.h
|
||||
widget/nodeview/nodewidget.cpp
|
||||
widget/nodeview/nodewidget.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -74,11 +74,15 @@ NodeView::NodeView(QWidget *parent)
|
||||
|
||||
SetFlowDirection(NodeViewCommon::kLeftToRight);
|
||||
|
||||
show_in_param_editor_action_ = new QAction(tr("Show in Parameter Editor"), this);
|
||||
Menu::ConformItem(show_in_param_editor_action_, QStringLiteral("shownodeparams"), QKeySequence(tr("Shift+P")));
|
||||
show_in_param_editor_action_ =
|
||||
new QAction(tr("Show in Parameter Editor"), this);
|
||||
Menu::ConformItem(show_in_param_editor_action_,
|
||||
QStringLiteral("shownodeparams"),
|
||||
QKeySequence(tr("Shift+P")));
|
||||
show_in_param_editor_action_->setShortcutContext(Qt::WindowShortcut);
|
||||
addAction(show_in_param_editor_action_);
|
||||
connect(show_in_param_editor_action_, &QAction::triggered, this, &NodeView::ShowSelectedNodeInParamEditor);
|
||||
connect(show_in_param_editor_action_, &QAction::triggered, this,
|
||||
&NodeView::ShowSelectedNodeInParamEditor);
|
||||
|
||||
UpdateSceneBoundingRect();
|
||||
connect(&scene_, &QGraphicsScene::changed, this,
|
||||
@@ -838,8 +842,7 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
|
||||
QVector<NodeViewItem *> selected = scene_.GetSelectedItems();
|
||||
|
||||
NodeViewItem *item_under_cursor =
|
||||
dynamic_cast<NodeViewItem *>(itemAt(pos));
|
||||
NodeViewItem *item_under_cursor = dynamic_cast<NodeViewItem *>(itemAt(pos));
|
||||
|
||||
if (item_under_cursor && !selected.contains(item_under_cursor)) {
|
||||
// Right-clicked a node that isn't part of the current selection,
|
||||
@@ -879,8 +882,8 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
m.addSeparator();
|
||||
|
||||
// Show in Parameter Editor
|
||||
QAction *show_in_param_editor_action = m.addAction(
|
||||
tr("Show in Parameter Editor"));
|
||||
QAction *show_in_param_editor_action =
|
||||
m.addAction(tr("Show in Parameter Editor"));
|
||||
show_in_param_editor_action->setShortcut(
|
||||
show_in_param_editor_action_->shortcut());
|
||||
connect(show_in_param_editor_action, &QAction::triggered, this,
|
||||
@@ -1673,8 +1676,8 @@ void NodeView::ShowSelectedNodeInParamEditor()
|
||||
selection_with_contexts.reserve(selected.size());
|
||||
foreach (NodeViewItem *item, selected) {
|
||||
if (item && item->GetNode()) {
|
||||
selection_with_contexts.append(Node::ContextPair{
|
||||
item->GetNode(), item->GetContext()});
|
||||
selection_with_contexts.append(
|
||||
Node::ContextPair{ item->GetNode(), item->GetContext() });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1684,7 +1687,7 @@ void NodeView::ShowSelectedNodeInParamEditor()
|
||||
|
||||
if (PanelManager::instance()) {
|
||||
if (PanelWidget *panel = PanelManager::instance()->GetPanelWithName(
|
||||
QStringLiteral("ParamPanel"))) {
|
||||
QStringLiteral("ParamPanel"))) {
|
||||
panel->show();
|
||||
QMetaObject::invokeMethod(panel, &PanelWidget::raise,
|
||||
Qt::QueuedConnection);
|
||||
|
||||
@@ -455,10 +455,9 @@ void NodeViewItem::paint(QPainter *painter,
|
||||
int badge_width = qMax(text_width + pad * 2, text_height + pad);
|
||||
int badge_height = text_height + pad;
|
||||
|
||||
QRectF badge_rect(
|
||||
single_unit_rect.right() - badge_width - 4,
|
||||
single_unit_rect.top() + 4,
|
||||
badge_width, badge_height);
|
||||
QRectF badge_rect(single_unit_rect.right() - badge_width - 4,
|
||||
single_unit_rect.top() + 4, badge_width,
|
||||
badge_height);
|
||||
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->setBrush(QColor(220, 50, 47));
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/path/pathwidget.h
|
||||
widget/path/pathwidget.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/path/pathwidget.h
|
||||
widget/path/pathwidget.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/pixelsampler/pixelsampler.h
|
||||
widget/pixelsampler/pixelsampler.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/pixelsampler/pixelsampler.h
|
||||
widget/pixelsampler/pixelsampler.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/playbackcontrols/dragbutton.h
|
||||
widget/playbackcontrols/dragbutton.cpp
|
||||
widget/playbackcontrols/playbackcontrols.h
|
||||
widget/playbackcontrols/playbackcontrols.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/playbackcontrols/dragbutton.h
|
||||
widget/playbackcontrols/dragbutton.cpp
|
||||
widget/playbackcontrols/playbackcontrols.h
|
||||
widget/playbackcontrols/playbackcontrols.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,25 +15,25 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/projectexplorer/projectexplorer.cpp
|
||||
widget/projectexplorer/projectexplorer.h
|
||||
widget/projectexplorer/projectexplorericonview.cpp
|
||||
widget/projectexplorer/projectexplorericonview.h
|
||||
widget/projectexplorer/projectexplorericonviewitemdelegate.cpp
|
||||
widget/projectexplorer/projectexplorericonviewitemdelegate.h
|
||||
widget/projectexplorer/projectexplorerlistview.cpp
|
||||
widget/projectexplorer/projectexplorerlistview.h
|
||||
widget/projectexplorer/projectexplorerlistviewbase.cpp
|
||||
widget/projectexplorer/projectexplorerlistviewbase.h
|
||||
widget/projectexplorer/projectexplorerlistviewitemdelegate.cpp
|
||||
widget/projectexplorer/projectexplorerlistviewitemdelegate.h
|
||||
widget/projectexplorer/projectexplorernavigation.cpp
|
||||
widget/projectexplorer/projectexplorernavigation.h
|
||||
widget/projectexplorer/projectexplorertreeview.cpp
|
||||
widget/projectexplorer/projectexplorertreeview.h
|
||||
widget/projectexplorer/projectexplorerundo.h
|
||||
widget/projectexplorer/projectviewmodel.cpp
|
||||
widget/projectexplorer/projectviewmodel.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/projectexplorer/projectexplorer.cpp
|
||||
widget/projectexplorer/projectexplorer.h
|
||||
widget/projectexplorer/projectexplorericonview.cpp
|
||||
widget/projectexplorer/projectexplorericonview.h
|
||||
widget/projectexplorer/projectexplorericonviewitemdelegate.cpp
|
||||
widget/projectexplorer/projectexplorericonviewitemdelegate.h
|
||||
widget/projectexplorer/projectexplorerlistview.cpp
|
||||
widget/projectexplorer/projectexplorerlistview.h
|
||||
widget/projectexplorer/projectexplorerlistviewbase.cpp
|
||||
widget/projectexplorer/projectexplorerlistviewbase.h
|
||||
widget/projectexplorer/projectexplorerlistviewitemdelegate.cpp
|
||||
widget/projectexplorer/projectexplorerlistviewitemdelegate.h
|
||||
widget/projectexplorer/projectexplorernavigation.cpp
|
||||
widget/projectexplorer/projectexplorernavigation.h
|
||||
widget/projectexplorer/projectexplorertreeview.cpp
|
||||
widget/projectexplorer/projectexplorertreeview.h
|
||||
widget/projectexplorer/projectexplorerundo.h
|
||||
widget/projectexplorer/projectviewmodel.cpp
|
||||
widget/projectexplorer/projectviewmodel.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
namespace olive
|
||||
{
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
QVector<Footage *> GetSelectedProxyFootage(const QVector<Node *> &items)
|
||||
{
|
||||
QVector<Footage *> footage;
|
||||
@@ -452,23 +453,21 @@ void ProjectExplorer::ShowContextMenu()
|
||||
connect(use_proxy, &QAction::triggered, this,
|
||||
&ProjectExplorer::SetSelectedFootageProxyEnabled);
|
||||
|
||||
QAction *reveal_proxy =
|
||||
proxy_menu->addAction(tr("Reveal Proxy"));
|
||||
reveal_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
QAction *reveal_proxy = proxy_menu->addAction(tr("Reveal Proxy"));
|
||||
reveal_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(reveal_proxy, &QAction::triggered, this,
|
||||
&ProjectExplorer::RevealProxyForSelectedFootage);
|
||||
|
||||
QAction *delete_proxy =
|
||||
proxy_menu->addAction(tr("Delete Proxy"));
|
||||
delete_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
QAction *delete_proxy = proxy_menu->addAction(tr("Delete Proxy"));
|
||||
delete_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(delete_proxy, &QAction::triggered, this,
|
||||
&ProjectExplorer::DeleteProxiesForSelectedFootage);
|
||||
}
|
||||
@@ -548,9 +547,9 @@ void ProjectExplorer::ReplaceSelectedFootage()
|
||||
{
|
||||
Footage *footage = static_cast<Footage *>(context_menu_items_.first());
|
||||
|
||||
QString file = QFileDialog::getOpenFileName(
|
||||
this, tr("Replace Footage"), QString(),
|
||||
Core::FootageFileDialogFilter());
|
||||
QString file =
|
||||
QFileDialog::getOpenFileName(this, tr("Replace Footage"), QString(),
|
||||
Core::FootageFileDialogFilter());
|
||||
if (!file.isEmpty()) {
|
||||
if (!Core::IsFootageExtensionAllowed(file)) {
|
||||
QMessageBox::warning(
|
||||
@@ -593,19 +592,22 @@ void ProjectExplorer::OpenContextMenuItemInNewWindow()
|
||||
void ProjectExplorer::GenerateProxiesForSelectedFootage()
|
||||
{
|
||||
if (!ProxyManager::instance() || !project()) {
|
||||
qWarning() << "GenerateProxiesForSelectedFootage: ProxyManager or project unavailable";
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedFootage: ProxyManager or project unavailable";
|
||||
return;
|
||||
}
|
||||
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(context_menu_items_);
|
||||
qDebug() << "GenerateProxiesForSelectedFootage: starting proxy generation for"
|
||||
<< footage.size() << "footage item(s)";
|
||||
qDebug()
|
||||
<< "GenerateProxiesForSelectedFootage: starting proxy generation for"
|
||||
<< footage.size() << "footage item(s)";
|
||||
for (Footage *item : footage) {
|
||||
const VideoParams video = item->GetFirstEnabledVideoStream();
|
||||
if (!video.is_valid()) {
|
||||
qWarning() << "GenerateProxiesForSelectedFootage: skipping item with no valid video stream"
|
||||
<< item->filename();
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedFootage: skipping item with no valid video stream"
|
||||
<< item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -619,9 +621,9 @@ void ProjectExplorer::GenerateProxiesForSelectedFootage()
|
||||
item->project()->cache_path(), item->filename(),
|
||||
video.stream_index(), params);
|
||||
qDebug() << "GenerateProxiesForSelectedFootage: proxy state="
|
||||
<< ProxyManager::ProxyStateToString(proxy.state)
|
||||
<< "file=" << proxy.filename
|
||||
<< "cache=" << item->project()->cache_path();
|
||||
<< ProxyManager::ProxyStateToString(proxy.state)
|
||||
<< "file=" << proxy.filename
|
||||
<< "cache=" << item->project()->cache_path();
|
||||
item->SetProxy(proxy.filename, proxy.state, video.stream_index(),
|
||||
params.version, true);
|
||||
item->InvalidateAll(Footage::kFilenameInput);
|
||||
@@ -633,11 +635,11 @@ void ProjectExplorer::SetSelectedFootageProxyEnabled(bool enabled)
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(context_menu_items_);
|
||||
qDebug() << "ProjectExplorer::SetSelectedFootageProxyEnabled:" << enabled
|
||||
<< "footage count=" << footage.size();
|
||||
<< "footage count=" << footage.size();
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
qDebug() << " skipping item with empty proxy path"
|
||||
<< item->filename();
|
||||
qDebug()
|
||||
<< " skipping item with empty proxy path" << item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/projecttoolbar/projecttoolbar.h
|
||||
widget/projecttoolbar/projecttoolbar.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/projecttoolbar/projecttoolbar.h
|
||||
widget/projecttoolbar/projecttoolbar.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/resizablescrollbar/resizablescrollbar.cpp
|
||||
widget/resizablescrollbar/resizablescrollbar.h
|
||||
widget/resizablescrollbar/resizabletimelinescrollbar.cpp
|
||||
widget/resizablescrollbar/resizabletimelinescrollbar.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/resizablescrollbar/resizablescrollbar.cpp
|
||||
widget/resizablescrollbar/resizablescrollbar.h
|
||||
widget/resizablescrollbar/resizabletimelinescrollbar.cpp
|
||||
widget/resizablescrollbar/resizabletimelinescrollbar.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -20,6 +20,6 @@ add_subdirectory(vectorscope)
|
||||
add_subdirectory(waveform)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/histogram/histogram.h
|
||||
widget/scope/histogram/histogram.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/histogram/histogram.h
|
||||
widget/scope/histogram/histogram.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -190,7 +190,8 @@ void HistogramScope::DrawScopeSoftware(QPainter &p, const QImage &image)
|
||||
max_count = qMax(max_count, b_counts[i]);
|
||||
}
|
||||
|
||||
auto draw_channel = [&](const std::array<int, 256> &counts, const QColor &color) {
|
||||
auto draw_channel = [&](const std::array<int, 256> &counts,
|
||||
const QColor &color) {
|
||||
QPen pen(color);
|
||||
pen.setWidth(2);
|
||||
p.setPen(pen);
|
||||
@@ -198,8 +199,8 @@ void HistogramScope::DrawScopeSoftware(QPainter &p, const QImage &image)
|
||||
QVector<QPointF> points;
|
||||
points.reserve(256);
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
float x = histogram_start_dim_x +
|
||||
(float(i) / 255.0f) * histogram_dim_x;
|
||||
float x =
|
||||
histogram_start_dim_x + (float(i) / 255.0f) * histogram_dim_x;
|
||||
float normalized = float(counts[i]) / float(max_count);
|
||||
float y = histogram_start_dim_y +
|
||||
histogram_dim_y *
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/scopebase/scopebase.h
|
||||
widget/scope/scopebase/scopebase.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/scopebase/scopebase.h
|
||||
widget/scope/scopebase/scopebase.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -96,16 +96,16 @@ void ScopeBase::UpdateSoftwareImage()
|
||||
const int texture_width = static_cast<int>(width() * devicePixelRatioF());
|
||||
const int texture_height = static_cast<int>(height() * devicePixelRatioF());
|
||||
|
||||
const VideoParams offscreen_params(
|
||||
texture_width, texture_height, PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount);
|
||||
const VideoParams offscreen_params(texture_width, texture_height,
|
||||
PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount);
|
||||
|
||||
if (!software_tex_ || software_tex_->params() != offscreen_params) {
|
||||
software_tex_ = renderer()->CreateTexture(offscreen_params);
|
||||
software_buffer_.resize(
|
||||
texture_width * texture_height *
|
||||
VideoParams::GetBytesPerPixel(PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount));
|
||||
VideoParams::kRGBAChannelCount));
|
||||
}
|
||||
|
||||
if (!software_tex_ || software_tex_->IsDummy()) {
|
||||
@@ -122,15 +122,15 @@ void ScopeBase::UpdateSoftwareImage()
|
||||
job.SetForceOpaque(true);
|
||||
|
||||
renderer()->BlitColorManaged(job, software_tex_.get());
|
||||
renderer()->DownloadFromTexture(software_tex_->id(), software_tex_->params(),
|
||||
software_buffer_.data(), 0);
|
||||
renderer()->DownloadFromTexture(software_tex_->id(),
|
||||
software_tex_->params(),
|
||||
software_buffer_.data(), 0);
|
||||
|
||||
software_image_ = QImage(
|
||||
reinterpret_cast<const uchar *>(software_buffer_.constData()),
|
||||
texture_width, texture_height,
|
||||
texture_width *
|
||||
VideoParams::GetBytesPerPixel(PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount),
|
||||
texture_width * VideoParams::GetBytesPerPixel(
|
||||
PixelFormat::U8, VideoParams::kRGBAChannelCount),
|
||||
QImage::Format_RGBA8888_Premultiplied);
|
||||
software_image_.setDevicePixelRatio(devicePixelRatioF());
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/vectorscope/vectorscope.h
|
||||
widget/scope/vectorscope/vectorscope.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/vectorscope/vectorscope.h
|
||||
widget/scope/vectorscope/vectorscope.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -160,14 +160,13 @@ void VectorscopeScope::DrawScopeSoftware(QPainter &p, const QImage &image)
|
||||
float g = src[1] / 255.0f;
|
||||
float b = src[2] / 255.0f;
|
||||
|
||||
float y = r * luma_coeffs[0] + g * luma_coeffs[1] +
|
||||
b * luma_coeffs[2];
|
||||
float y =
|
||||
r * luma_coeffs[0] + g * luma_coeffs[1] + b * luma_coeffs[2];
|
||||
float cb = (b - y) / qMax(2.0f * (1.0f - luma_coeffs[2]), 0.0001f);
|
||||
float cr = (r - y) / qMax(2.0f * (1.0f - luma_coeffs[0]), 0.0001f);
|
||||
|
||||
QPointF point = center +
|
||||
QPointF(cr * vectorscope_gain * radius,
|
||||
-cb * vectorscope_gain * radius);
|
||||
QPointF point = center + QPointF(cr * vectorscope_gain * radius,
|
||||
-cb * vectorscope_gain * radius);
|
||||
|
||||
int px = qRound(point.x());
|
||||
int py = qRound(point.y());
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/waveform/waveform.h
|
||||
widget/scope/waveform/waveform.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/scope/waveform/waveform.h
|
||||
widget/scope/waveform/waveform.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -157,13 +157,14 @@ void WaveformScope::DrawScopeSoftware(QPainter &p, const QImage &image)
|
||||
}
|
||||
|
||||
auto mark = [&](float value, int add_r, int add_g, int add_b) {
|
||||
int scope_y = waveform_start_dim_y +
|
||||
int((1.0f - value) * waveform_dim_y);
|
||||
int scope_y =
|
||||
waveform_start_dim_y + int((1.0f - value) * waveform_dim_y);
|
||||
if (scope_y < waveform_start_dim_y ||
|
||||
scope_y >= waveform_start_dim_y + waveform_dim_y) {
|
||||
return;
|
||||
}
|
||||
QRgb *dst_line = reinterpret_cast<QRgb *>(buf.scanLine(scope_y));
|
||||
QRgb *dst_line =
|
||||
reinterpret_cast<QRgb *>(buf.scanLine(scope_y));
|
||||
QRgb cur = dst_line[scope_x];
|
||||
int nr = qMin(255, qRed(cur) + add_r);
|
||||
int ng = qMin(255, qGreen(cur) + add_g);
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
add_subdirectory(base)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/slider/floatslider.h
|
||||
widget/slider/floatslider.cpp
|
||||
widget/slider/integerslider.h
|
||||
widget/slider/integerslider.cpp
|
||||
widget/slider/rationalslider.h
|
||||
widget/slider/rationalslider.cpp
|
||||
widget/slider/stringslider.h
|
||||
widget/slider/stringslider.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/slider/floatslider.h
|
||||
widget/slider/floatslider.cpp
|
||||
widget/slider/integerslider.h
|
||||
widget/slider/integerslider.cpp
|
||||
widget/slider/rationalslider.h
|
||||
widget/slider/rationalslider.cpp
|
||||
widget/slider/stringslider.h
|
||||
widget/slider/stringslider.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/slider/base/decimalsliderbase.h
|
||||
widget/slider/base/decimalsliderbase.cpp
|
||||
widget/slider/base/numericsliderbase.h
|
||||
widget/slider/base/numericsliderbase.cpp
|
||||
widget/slider/base/sliderbase.h
|
||||
widget/slider/base/sliderbase.cpp
|
||||
widget/slider/base/sliderlabel.h
|
||||
widget/slider/base/sliderlabel.cpp
|
||||
widget/slider/base/sliderladder.h
|
||||
widget/slider/base/sliderladder.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/slider/base/decimalsliderbase.h
|
||||
widget/slider/base/decimalsliderbase.cpp
|
||||
widget/slider/base/numericsliderbase.h
|
||||
widget/slider/base/numericsliderbase.cpp
|
||||
widget/slider/base/sliderbase.h
|
||||
widget/slider/base/sliderbase.cpp
|
||||
widget/slider/base/sliderlabel.h
|
||||
widget/slider/base/sliderlabel.cpp
|
||||
widget/slider/base/sliderladder.h
|
||||
widget/slider/base/sliderladder.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/standardcombos/channellayoutcombobox.h
|
||||
widget/standardcombos/frameratecombobox.h
|
||||
widget/standardcombos/interlacedcombobox.h
|
||||
widget/standardcombos/pixelaspectratiocombobox.h
|
||||
widget/standardcombos/pixelformatcombobox.h
|
||||
widget/standardcombos/sampleformatcombobox.h
|
||||
widget/standardcombos/sampleratecombobox.h
|
||||
widget/standardcombos/standardcombos.h
|
||||
widget/standardcombos/videodividercombobox.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/standardcombos/channellayoutcombobox.h
|
||||
widget/standardcombos/frameratecombobox.h
|
||||
widget/standardcombos/interlacedcombobox.h
|
||||
widget/standardcombos/pixelaspectratiocombobox.h
|
||||
widget/standardcombos/pixelformatcombobox.h
|
||||
widget/standardcombos/sampleformatcombobox.h
|
||||
widget/standardcombos/sampleratecombobox.h
|
||||
widget/standardcombos/standardcombos.h
|
||||
widget/standardcombos/videodividercombobox.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/taskview/elapsedcounterwidget.h
|
||||
widget/taskview/elapsedcounterwidget.cpp
|
||||
widget/taskview/taskview.h
|
||||
widget/taskview/taskview.cpp
|
||||
widget/taskview/taskviewitem.h
|
||||
widget/taskview/taskviewitem.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/taskview/elapsedcounterwidget.h
|
||||
widget/taskview/elapsedcounterwidget.cpp
|
||||
widget/taskview/taskview.h
|
||||
widget/taskview/taskview.cpp
|
||||
widget/taskview/taskviewitem.h
|
||||
widget/taskview/taskviewitem.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timebased/timebasedview.cpp
|
||||
widget/timebased/timebasedview.h
|
||||
widget/timebased/timebasedviewselectionmanager.cpp
|
||||
widget/timebased/timebasedviewselectionmanager.h
|
||||
widget/timebased/timebasedwidget.cpp
|
||||
widget/timebased/timebasedwidget.h
|
||||
widget/timebased/timescaledobject.cpp
|
||||
widget/timebased/timescaledobject.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timebased/timebasedview.cpp
|
||||
widget/timebased/timebasedview.h
|
||||
widget/timebased/timebasedviewselectionmanager.cpp
|
||||
widget/timebased/timebasedviewselectionmanager.h
|
||||
widget/timebased/timebasedwidget.cpp
|
||||
widget/timebased/timebasedwidget.h
|
||||
widget/timebased/timescaledobject.cpp
|
||||
widget/timebased/timescaledobject.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -19,14 +19,14 @@ add_subdirectory(tool)
|
||||
add_subdirectory(view)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/timelineandtrackview.cpp
|
||||
widget/timelinewidget/timelineandtrackview.h
|
||||
widget/timelinewidget/timelinewidget.cpp
|
||||
widget/timelinewidget/timelinewidget.h
|
||||
widget/timelinewidget/timelinewidgetselections.cpp
|
||||
widget/timelinewidget/timelinewidgetselections.h
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.cpp
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/timelineandtrackview.cpp
|
||||
widget/timelinewidget/timelineandtrackview.h
|
||||
widget/timelinewidget/timelinewidget.cpp
|
||||
widget/timelinewidget/timelinewidget.h
|
||||
widget/timelinewidget/timelinewidgetselections.cpp
|
||||
widget/timelinewidget/timelinewidgetselections.h
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.cpp
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -79,7 +79,8 @@ namespace olive
|
||||
|
||||
using namespace TimelineWaveformSync;
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
struct SourceSyncClip {
|
||||
ClipBlock *clip = nullptr;
|
||||
@@ -107,8 +108,8 @@ bool GetSourceSyncClip(Block *block, SourceSyncClip *out)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<SourceSyncClip> GetSelectedSourceSyncClips(
|
||||
const QVector<Block *> &blocks)
|
||||
QVector<SourceSyncClip>
|
||||
GetSelectedSourceSyncClips(const QVector<Block *> &blocks)
|
||||
{
|
||||
QVector<SourceSyncClip> clips;
|
||||
for (Block *block : blocks) {
|
||||
@@ -1061,13 +1062,13 @@ void TimelineWidget::SynchronizeSelectedClipsByWaveform()
|
||||
continue;
|
||||
}
|
||||
|
||||
const QVector<double> candidate_envelope =
|
||||
ExtractWaveformCacheEnvelope(sync_clip, sample_rate,
|
||||
window_samples);
|
||||
const QVector<double> candidate_envelope = ExtractWaveformCacheEnvelope(
|
||||
sync_clip, sample_rate, window_samples);
|
||||
const AudioWaveformSync::OffsetResult offset =
|
||||
AudioWaveformSync::EstimateEnvelopeOffset(
|
||||
reference_envelope, candidate_envelope, window_samples,
|
||||
max_offset_windows);
|
||||
AudioWaveformSync::EstimateEnvelopeOffset(reference_envelope,
|
||||
candidate_envelope,
|
||||
window_samples,
|
||||
max_offset_windows);
|
||||
if (!offset.valid) {
|
||||
continue;
|
||||
}
|
||||
@@ -1105,23 +1106,28 @@ void TimelineWidget::SynchronizeSelectedClipsByWaveform()
|
||||
command->add_child(
|
||||
new SetSelectionsCommand(this, new_selections, GetSelections()));
|
||||
|
||||
Core::instance()->undo_stack()->push(
|
||||
command, tr("Synchronize Clips by Waveform"));
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
tr("Synchronize Clips by Waveform"));
|
||||
}
|
||||
|
||||
void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
{
|
||||
if (!ProxyManager::instance() || !sequence()) {
|
||||
qWarning() << "GenerateProxiesForSelectedClips: ProxyManager or sequence unavailable";
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedClips: ProxyManager or sequence unavailable";
|
||||
return;
|
||||
}
|
||||
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: starting proxy generation for" << footage.size() << "footage item(s)";
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: starting proxy generation for"
|
||||
<< footage.size() << "footage item(s)";
|
||||
for (Footage *item : footage) {
|
||||
const VideoParams video = item->GetFirstEnabledVideoStream();
|
||||
if (!video.is_valid()) {
|
||||
qWarning() << "GenerateProxiesForSelectedClips: skipping item with no valid video stream" << item->filename();
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedClips: skipping item with no valid video stream"
|
||||
<< item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1134,7 +1140,8 @@ void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
ProxyManager::instance()->GetOrStartProxy(
|
||||
item->project()->cache_path(), item->filename(),
|
||||
video.stream_index(), params);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: proxy state=" << ProxyManager::ProxyStateToString(proxy.state)
|
||||
qDebug() << "GenerateProxiesForSelectedClips: proxy state="
|
||||
<< ProxyManager::ProxyStateToString(proxy.state)
|
||||
<< "file=" << proxy.filename
|
||||
<< "cache=" << item->project()->cache_path();
|
||||
item->SetProxy(proxy.filename, proxy.state, video.stream_index(),
|
||||
@@ -1145,13 +1152,14 @@ void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
|
||||
void TimelineWidget::SetSelectedClipsProxyEnabled(bool enabled)
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "TimelineWidget::SetSelectedClipsProxyEnabled:" << enabled
|
||||
<< "footage count=" << footage.size();
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
qDebug() << " skipping item with empty proxy path"
|
||||
<< item->filename();
|
||||
qDebug()
|
||||
<< " skipping item with empty proxy path" << item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1162,7 +1170,8 @@ void TimelineWidget::SetSelectedClipsProxyEnabled(bool enabled)
|
||||
|
||||
void TimelineWidget::RevealProxyForSelectedClips()
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
continue;
|
||||
@@ -1193,15 +1202,16 @@ void TimelineWidget::RevealProxyForSelectedClips()
|
||||
|
||||
void TimelineWidget::DeleteProxiesForSelectedClips()
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QFile::remove(item->proxy_path());
|
||||
QFile::remove(ProxyManager::GetWorkingProxyFilename(
|
||||
item->proxy_path()));
|
||||
QFile::remove(
|
||||
ProxyManager::GetWorkingProxyFilename(item->proxy_path()));
|
||||
item->ClearProxy();
|
||||
item->InvalidateAll(Footage::kFilenameInput);
|
||||
}
|
||||
@@ -1734,21 +1744,21 @@ void TimelineWidget::ShowContextMenu()
|
||||
|
||||
QAction *reveal_proxy =
|
||||
proxy_menu->addAction(tr("Reveal Proxy"));
|
||||
reveal_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
reveal_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(reveal_proxy, &QAction::triggered, this,
|
||||
&TimelineWidget::RevealProxyForSelectedClips);
|
||||
|
||||
QAction *delete_proxy =
|
||||
proxy_menu->addAction(tr("Delete Proxy"));
|
||||
delete_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
delete_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(delete_proxy, &QAction::triggered, this,
|
||||
&TimelineWidget::DeleteProxiesForSelectedClips);
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ bool GetWaveformSyncClip(Block *block, WaveformSyncClip *out)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
const QVector<Block *> &blocks)
|
||||
QVector<WaveformSyncClip>
|
||||
GetSelectedWaveformSyncClips(const QVector<Block *> &blocks)
|
||||
{
|
||||
QVector<WaveformSyncClip> clips;
|
||||
for (Block *block : blocks) {
|
||||
@@ -108,7 +108,8 @@ QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
const AudioVisualWaveform::Sample summary =
|
||||
clip.waveform->GetSummaryFromTime(t, length);
|
||||
|
||||
for (const AudioVisualWaveform::SamplePerChannel &channel : summary) {
|
||||
for (const AudioVisualWaveform::SamplePerChannel &channel :
|
||||
summary) {
|
||||
const double channel_peak =
|
||||
std::max(std::abs(static_cast<double>(channel.min)),
|
||||
std::abs(static_cast<double>(channel.max)));
|
||||
@@ -121,6 +122,6 @@ QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
return envelope;
|
||||
}
|
||||
|
||||
} // namespace TimelineWaveformSync
|
||||
} // namespace TimelineWaveformSync
|
||||
|
||||
} // namespace olive
|
||||
} // namespace olive
|
||||
|
||||
@@ -38,10 +38,10 @@ class ClipBlock;
|
||||
* @brief Data required to synchronize a clip using its cached audio waveform.
|
||||
*/
|
||||
struct WaveformSyncClip {
|
||||
ClipBlock *clip = nullptr;
|
||||
const AudioWaveformCache *waveform = nullptr;
|
||||
TimeRange media_range;
|
||||
int sample_rate = 0;
|
||||
ClipBlock *clip = nullptr;
|
||||
const AudioWaveformCache *waveform = nullptr;
|
||||
TimeRange media_range;
|
||||
int sample_rate = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -64,8 +64,8 @@ bool GetWaveformSyncClip(Block *block, WaveformSyncClip *out);
|
||||
/**
|
||||
* @brief Return all selected blocks that can be synchronized by waveform.
|
||||
*/
|
||||
QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
const QVector<Block *> &blocks);
|
||||
QVector<WaveformSyncClip>
|
||||
GetSelectedWaveformSyncClips(const QVector<Block *> &blocks);
|
||||
|
||||
/**
|
||||
* @brief Extract a peak envelope from the validated regions of a waveform cache.
|
||||
@@ -74,11 +74,11 @@ QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
* envelope stays aligned to the same absolute timeline.
|
||||
*/
|
||||
QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
int sample_rate,
|
||||
size_t window_samples);
|
||||
int sample_rate,
|
||||
size_t window_samples);
|
||||
|
||||
} // namespace TimelineWaveformSync
|
||||
} // namespace TimelineWaveformSync
|
||||
|
||||
} // namespace olive
|
||||
} // namespace olive
|
||||
|
||||
#endif // TIMELINEWIDGETWAVEFORMSYNC_H
|
||||
#endif // TIMELINEWIDGETWAVEFORMSYNC_H
|
||||
|
||||
@@ -15,36 +15,36 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/tool/add.cpp
|
||||
widget/timelinewidget/tool/add.h
|
||||
widget/timelinewidget/tool/beam.cpp
|
||||
widget/timelinewidget/tool/beam.h
|
||||
widget/timelinewidget/tool/edit.cpp
|
||||
widget/timelinewidget/tool/edit.h
|
||||
widget/timelinewidget/tool/import.cpp
|
||||
widget/timelinewidget/tool/import.h
|
||||
widget/timelinewidget/tool/pointer.cpp
|
||||
widget/timelinewidget/tool/pointer.h
|
||||
widget/timelinewidget/tool/razor.cpp
|
||||
widget/timelinewidget/tool/razor.h
|
||||
widget/timelinewidget/tool/record.cpp
|
||||
widget/timelinewidget/tool/record.h
|
||||
widget/timelinewidget/tool/ripple.cpp
|
||||
widget/timelinewidget/tool/ripple.h
|
||||
widget/timelinewidget/tool/rolling.cpp
|
||||
widget/timelinewidget/tool/rolling.h
|
||||
widget/timelinewidget/tool/slide.cpp
|
||||
widget/timelinewidget/tool/slide.h
|
||||
widget/timelinewidget/tool/slip.cpp
|
||||
widget/timelinewidget/tool/slip.h
|
||||
widget/timelinewidget/tool/trackselect.cpp
|
||||
widget/timelinewidget/tool/trackselect.h
|
||||
widget/timelinewidget/tool/transition.cpp
|
||||
widget/timelinewidget/tool/transition.h
|
||||
widget/timelinewidget/tool/tool.cpp
|
||||
widget/timelinewidget/tool/tool.h
|
||||
widget/timelinewidget/tool/zoom.cpp
|
||||
widget/timelinewidget/tool/zoom.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/tool/add.cpp
|
||||
widget/timelinewidget/tool/add.h
|
||||
widget/timelinewidget/tool/beam.cpp
|
||||
widget/timelinewidget/tool/beam.h
|
||||
widget/timelinewidget/tool/edit.cpp
|
||||
widget/timelinewidget/tool/edit.h
|
||||
widget/timelinewidget/tool/import.cpp
|
||||
widget/timelinewidget/tool/import.h
|
||||
widget/timelinewidget/tool/pointer.cpp
|
||||
widget/timelinewidget/tool/pointer.h
|
||||
widget/timelinewidget/tool/razor.cpp
|
||||
widget/timelinewidget/tool/razor.h
|
||||
widget/timelinewidget/tool/record.cpp
|
||||
widget/timelinewidget/tool/record.h
|
||||
widget/timelinewidget/tool/ripple.cpp
|
||||
widget/timelinewidget/tool/ripple.h
|
||||
widget/timelinewidget/tool/rolling.cpp
|
||||
widget/timelinewidget/tool/rolling.h
|
||||
widget/timelinewidget/tool/slide.cpp
|
||||
widget/timelinewidget/tool/slide.h
|
||||
widget/timelinewidget/tool/slip.cpp
|
||||
widget/timelinewidget/tool/slip.h
|
||||
widget/timelinewidget/tool/trackselect.cpp
|
||||
widget/timelinewidget/tool/trackselect.h
|
||||
widget/timelinewidget/tool/transition.cpp
|
||||
widget/timelinewidget/tool/transition.h
|
||||
widget/timelinewidget/tool/tool.cpp
|
||||
widget/timelinewidget/tool/tool.h
|
||||
widget/timelinewidget/tool/zoom.cpp
|
||||
widget/timelinewidget/tool/zoom.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/trackview/trackview.h
|
||||
widget/timelinewidget/trackview/trackview.cpp
|
||||
widget/timelinewidget/trackview/trackviewitem.h
|
||||
widget/timelinewidget/trackview/trackviewitem.cpp
|
||||
widget/timelinewidget/trackview/trackviewsplitter.h
|
||||
widget/timelinewidget/trackview/trackviewsplitter.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/trackview/trackview.h
|
||||
widget/timelinewidget/trackview/trackview.cpp
|
||||
widget/timelinewidget/trackview/trackviewitem.h
|
||||
widget/timelinewidget/trackview/trackviewitem.cpp
|
||||
widget/timelinewidget/trackview/trackviewsplitter.h
|
||||
widget/timelinewidget/trackview/trackviewsplitter.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/view/timelineview.cpp
|
||||
widget/timelinewidget/view/timelineview.h
|
||||
widget/timelinewidget/view/timelineviewmouseevent.h
|
||||
widget/timelinewidget/view/timelineviewghostitem.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/view/timelineview.cpp
|
||||
widget/timelinewidget/view/timelineview.h
|
||||
widget/timelinewidget/view/timelineviewmouseevent.h
|
||||
widget/timelinewidget/view/timelineviewghostitem.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timeruler/seekablewidget.h
|
||||
widget/timeruler/seekablewidget.cpp
|
||||
widget/timeruler/timeruler.h
|
||||
widget/timeruler/timeruler.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timeruler/seekablewidget.h
|
||||
widget/timeruler/seekablewidget.cpp
|
||||
widget/timeruler/timeruler.h
|
||||
widget/timeruler/timeruler.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timetarget/timetarget.h
|
||||
widget/timetarget/timetarget.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timetarget/timetarget.h
|
||||
widget/timetarget/timetarget.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/toolbar/toolbar.h
|
||||
widget/toolbar/toolbar.cpp
|
||||
widget/toolbar/toolbarbutton.h
|
||||
widget/toolbar/toolbarbutton.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/toolbar/toolbar.h
|
||||
widget/toolbar/toolbar.cpp
|
||||
widget/toolbar/toolbarbutton.h
|
||||
widget/toolbar/toolbarbutton.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,26 +15,26 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/viewer/audiowaveformview.cpp
|
||||
widget/viewer/audiowaveformview.h
|
||||
widget/viewer/footageviewer.cpp
|
||||
widget/viewer/footageviewer.h
|
||||
widget/viewer/viewer.cpp
|
||||
widget/viewer/viewer.h
|
||||
widget/viewer/viewerdisplay.cpp
|
||||
widget/viewer/viewerdisplay.h
|
||||
widget/viewer/viewerplaybacktimer.cpp
|
||||
widget/viewer/viewerplaybacktimer.h
|
||||
widget/viewer/viewerpreventsleep.cpp
|
||||
widget/viewer/viewerpreventsleep.h
|
||||
widget/viewer/viewerqueue.h
|
||||
widget/viewer/viewersafemargininfo.h
|
||||
widget/viewer/viewersizer.cpp
|
||||
widget/viewer/viewersizer.h
|
||||
widget/viewer/viewertexteditor.cpp
|
||||
widget/viewer/viewertexteditor.h
|
||||
widget/viewer/viewerwindow.cpp
|
||||
widget/viewer/viewerwindow.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/viewer/audiowaveformview.cpp
|
||||
widget/viewer/audiowaveformview.h
|
||||
widget/viewer/footageviewer.cpp
|
||||
widget/viewer/footageviewer.h
|
||||
widget/viewer/viewer.cpp
|
||||
widget/viewer/viewer.h
|
||||
widget/viewer/viewerdisplay.cpp
|
||||
widget/viewer/viewerdisplay.h
|
||||
widget/viewer/viewerplaybacktimer.cpp
|
||||
widget/viewer/viewerplaybacktimer.h
|
||||
widget/viewer/viewerpreventsleep.cpp
|
||||
widget/viewer/viewerpreventsleep.h
|
||||
widget/viewer/viewerqueue.h
|
||||
widget/viewer/viewersafemargininfo.h
|
||||
widget/viewer/viewersizer.cpp
|
||||
widget/viewer/viewersizer.h
|
||||
widget/viewer/viewertexteditor.cpp
|
||||
widget/viewer/viewertexteditor.h
|
||||
widget/viewer/viewerwindow.cpp
|
||||
widget/viewer/viewerwindow.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -69,7 +69,9 @@ void AudioWaveformView::SetViewer(ViewerOutput *playback)
|
||||
|
||||
rational tb = playback_->GetVideoParams().frame_rate_as_time_base();
|
||||
if (tb.isNull()) {
|
||||
tb = OLIVE_CONFIG("DefaultSequenceFrameRate").value<rational>().flipped();
|
||||
tb = OLIVE_CONFIG("DefaultSequenceFrameRate")
|
||||
.value<rational>()
|
||||
.flipped();
|
||||
}
|
||||
SetTimebase(tb);
|
||||
UpdateSceneRect();
|
||||
|
||||
@@ -97,11 +97,12 @@ ViewerWidget::ViewerWidget(ViewerDisplayWidget *display, QWidget *parent)
|
||||
&ViewerWidget::CursorColor);
|
||||
connect(display_widget_, &ViewerDisplayWidget::ColorProcessorChanged, this,
|
||||
&ViewerWidget::ColorProcessorChanged);
|
||||
connect(display_widget_, &ViewerDisplayWidget::ColorProcessorChanged, this,
|
||||
[](ColorProcessorPtr processor) {
|
||||
RenderManager::instance()->GetCacher()->SetDisplayColorProcessor(
|
||||
processor);
|
||||
});
|
||||
connect(
|
||||
display_widget_, &ViewerDisplayWidget::ColorProcessorChanged, this,
|
||||
[](ColorProcessorPtr processor) {
|
||||
RenderManager::instance()->GetCacher()->SetDisplayColorProcessor(
|
||||
processor);
|
||||
});
|
||||
RenderManager::instance()->GetCacher()->SetDisplayColorProcessor(
|
||||
display_widget_->GetCurrentColorProcessor());
|
||||
connect(display_widget_, &ViewerDisplayWidget::ColorManagerChanged, this,
|
||||
@@ -985,8 +986,7 @@ void ViewerWidget::ForceRequeueFromCurrentTime()
|
||||
// called from paintEvent paths (QueueStarved) where synchronously cancelling
|
||||
// watchers can re-enter the same RenderTicket mutex and deadlock.
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this]() { ForceRequeueFromCurrentTimeInternal(); },
|
||||
this, [this]() { ForceRequeueFromCurrentTimeInternal(); },
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
@@ -1001,7 +1001,7 @@ void ViewerWidget::ForceRequeueFromCurrentTimeInternal()
|
||||
playback_queue_next_frame_ =
|
||||
GetTimestamp() +
|
||||
playback_speed_ * Timecode::time_to_timestamp(
|
||||
kRequeueWaitTime, timebase(), Timecode::kFloor);
|
||||
kRequeueWaitTime, timebase(), Timecode::kFloor);
|
||||
;
|
||||
first_requeue_watcher_ = nullptr;
|
||||
for (int i = 0; i < queue; i++) {
|
||||
@@ -1130,7 +1130,8 @@ void ViewerWidget::PlayInternal(int speed, bool in_to_out_only)
|
||||
// Verify audio processor output params are valid before using them
|
||||
AudioParams output_params = audio_processor_.to();
|
||||
if (!output_params.is_valid()) {
|
||||
qWarning() << "Audio processor output params are invalid, skipping audio playback";
|
||||
qWarning()
|
||||
<< "Audio processor output params are invalid, skipping audio playback";
|
||||
} else {
|
||||
AudioManager::instance()->SetOutputNotifyInterval(
|
||||
output_params.time_to_bytes(kAudioPlaybackInterval));
|
||||
@@ -1138,7 +1139,8 @@ void ViewerWidget::PlayInternal(int speed, bool in_to_out_only)
|
||||
&ViewerWidget::QueueNextAudioBuffer);
|
||||
|
||||
static const int prequeue_count = 2;
|
||||
prequeuing_audio_ = prequeue_count; // Queue two buffers ahead of time
|
||||
prequeuing_audio_ =
|
||||
prequeue_count; // Queue two buffers ahead of time
|
||||
audio_playback_queue_time_ = GetConnectedNode()->GetPlayhead();
|
||||
for (int i = 0; i < prequeue_count; i++) {
|
||||
QueueNextAudioBuffer();
|
||||
@@ -1506,17 +1508,13 @@ void ViewerWidget::RendererGeneratedFrameForQueue()
|
||||
|
||||
// Ignore this signal if we've paused now
|
||||
if (IsPlaying() || prequeuing_video_) {
|
||||
const qint64 start_ms =
|
||||
watcher->property("start").toLongLong();
|
||||
const qint64 now_ms =
|
||||
QDateTime::currentMSecsSinceEpoch();
|
||||
const qint64 start_ms = watcher->property("start").toLongLong();
|
||||
const qint64 now_ms = QDateTime::currentMSecsSinceEpoch();
|
||||
const int playback_step = qMax(1, qAbs(playback_speed_));
|
||||
const double frame_interval_ms = qMax(
|
||||
1.0,
|
||||
timebase().toDouble() * 1000.0 /
|
||||
static_cast<double>(playback_step));
|
||||
if (start_ms > 0 &&
|
||||
(now_ms - start_ms) > frame_interval_ms) {
|
||||
const double frame_interval_ms =
|
||||
qMax(1.0, timebase().toDouble() * 1000.0 /
|
||||
static_cast<double>(playback_step));
|
||||
if (start_ms > 0 && (now_ms - start_ms) > frame_interval_ms) {
|
||||
// If the queue is nearly empty, keep the frame anyway
|
||||
// to prevent the viewer from freezing entirely when
|
||||
// rendering can't keep up with playback speed.
|
||||
@@ -1544,7 +1542,7 @@ void ViewerWidget::RendererGeneratedFrameForQueue()
|
||||
}
|
||||
|
||||
dw->queue()->AppendTimewise({ ts, push },
|
||||
playback_speed_);
|
||||
playback_speed_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,15 +385,15 @@ void ViewerDisplayWidget::OnPaint()
|
||||
// image itself will be rendered offscreen, downloaded, and painted below.
|
||||
bg_painter.begin(paint_device());
|
||||
bg_painter_active = true;
|
||||
bg_painter.fillRect(GetInnerRect(),
|
||||
show_widget_background_ ? palette().window().color() :
|
||||
Qt::black);
|
||||
bg_painter.fillRect(GetInnerRect(), show_widget_background_ ?
|
||||
palette().window().color() :
|
||||
Qt::black);
|
||||
} else {
|
||||
// Clear background to empty
|
||||
QColor bg_color = show_widget_background_ ? palette().window().color() :
|
||||
Qt::black;
|
||||
renderer()->ClearDestination(nullptr, bg_color.redF(), bg_color.greenF(),
|
||||
bg_color.blueF());
|
||||
renderer()->ClearDestination(nullptr, bg_color.redF(),
|
||||
bg_color.greenF(), bg_color.blueF());
|
||||
}
|
||||
|
||||
VideoParams device_params;
|
||||
@@ -412,13 +412,14 @@ void ViewerDisplayWidget::OnPaint()
|
||||
} else if (color_service()) {
|
||||
bool drew_backend_neutral_frame = false;
|
||||
if (FramePtr frame = load_frame_.value<FramePtr>()) {
|
||||
if (!drew_backend_neutral_frame && (!texture_ ||
|
||||
texture_->renderer() !=
|
||||
renderer() // Some implementations don't like it if we upload to a texture created in another (albeit shared) context
|
||||
|| texture_->width() != frame->width() ||
|
||||
texture_->height() != frame->height() ||
|
||||
texture_->format() != frame->format() ||
|
||||
texture_->channel_count() != frame->channel_count())) {
|
||||
if (!drew_backend_neutral_frame &&
|
||||
(!texture_ ||
|
||||
texture_->renderer() !=
|
||||
renderer() // Some implementations don't like it if we upload to a texture created in another (albeit shared) context
|
||||
|| texture_->width() != frame->width() ||
|
||||
texture_->height() != frame->height() ||
|
||||
texture_->format() != frame->format() ||
|
||||
texture_->channel_count() != frame->channel_count())) {
|
||||
texture_ = renderer()->CreateTexture(
|
||||
frame->video_params(), frame->data(),
|
||||
frame->linesize_pixels());
|
||||
@@ -427,9 +428,10 @@ void ViewerDisplayWidget::OnPaint()
|
||||
}
|
||||
} else if (TexturePtr texture = load_frame_.value<TexturePtr>()) {
|
||||
// This is a GPU texture, switch to it directly when possible.
|
||||
if (!drew_backend_neutral_frame && texture && texture->renderer() &&
|
||||
texture->renderer() != renderer()) {
|
||||
if (texture->renderer()->IsOpenGL() && renderer()->IsOpenGL()) {
|
||||
if (!drew_backend_neutral_frame && texture &&
|
||||
texture->renderer() && texture->renderer() != renderer()) {
|
||||
if (texture->renderer()->IsOpenGL() &&
|
||||
renderer()->IsOpenGL()) {
|
||||
// Shared OpenGL contexts can display the producer texture
|
||||
// directly. Avoid readback here because the producer
|
||||
// renderer may belong to a render thread whose context
|
||||
@@ -441,8 +443,8 @@ void ViewerDisplayWidget::OnPaint()
|
||||
frame->set_video_params(texture->params());
|
||||
if (frame->allocate()) {
|
||||
texture->renderer()->DownloadFromTexture(
|
||||
texture->id(), texture->params(),
|
||||
frame->data(), frame->linesize_pixels());
|
||||
texture->id(), texture->params(), frame->data(),
|
||||
frame->linesize_pixels());
|
||||
texture_ = renderer()->CreateTexture(
|
||||
frame->video_params(), frame->data(),
|
||||
frame->linesize_pixels());
|
||||
@@ -475,9 +477,11 @@ void ViewerDisplayWidget::OnPaint()
|
||||
} else {
|
||||
if (deinterlace_) {
|
||||
if (deinterlace_shader_.isNull()) {
|
||||
deinterlace_shader_ = renderer()->CreateNativeShader(
|
||||
ShaderCode(FileFunctions::ReadFileAsString(
|
||||
QStringLiteral(":/shaders/deinterlace.frag"))));
|
||||
deinterlace_shader_ =
|
||||
renderer()->CreateNativeShader(
|
||||
ShaderCode(FileFunctions::ReadFileAsString(
|
||||
QStringLiteral(
|
||||
":/shaders/deinterlace.frag"))));
|
||||
}
|
||||
|
||||
if (!deinterlace_texture_ ||
|
||||
@@ -489,13 +493,15 @@ void ViewerDisplayWidget::OnPaint()
|
||||
}
|
||||
|
||||
ShaderJob job;
|
||||
job.Insert(QStringLiteral("resolution_in"),
|
||||
NodeValue(NodeValue::kVec2,
|
||||
QVector2D(texture_to_draw->width(),
|
||||
texture_to_draw->height())));
|
||||
job.Insert(QStringLiteral("ove_maintex"),
|
||||
NodeValue(NodeValue::kTexture,
|
||||
QVariant::fromValue(texture_to_draw)));
|
||||
job.Insert(
|
||||
QStringLiteral("resolution_in"),
|
||||
NodeValue(NodeValue::kVec2,
|
||||
QVector2D(texture_to_draw->width(),
|
||||
texture_to_draw->height())));
|
||||
job.Insert(
|
||||
QStringLiteral("ove_maintex"),
|
||||
NodeValue(NodeValue::kTexture,
|
||||
QVariant::fromValue(texture_to_draw)));
|
||||
|
||||
renderer()->BlitToTexture(deinterlace_shader_, job,
|
||||
deinterlace_texture_.get());
|
||||
@@ -1453,28 +1459,30 @@ bool ViewerDisplayWidget::DrawBackendNeutralFrame(const FramePtr &frame,
|
||||
if (display_frame->format() == PixelFormat::U8 &&
|
||||
display_frame->channel_count() == VideoParams::kRGBAChannelCount) {
|
||||
backend_neutral_cpu_display_frame_ = display_frame;
|
||||
backend_neutral_cpu_image_ = QImage(
|
||||
reinterpret_cast<const uchar *>(display_frame->const_data()),
|
||||
display_frame->width(), display_frame->height(),
|
||||
display_frame->linesize_bytes(), QImage::Format_RGBA8888);
|
||||
backend_neutral_cpu_image_ =
|
||||
QImage(reinterpret_cast<const uchar *>(display_frame->const_data()),
|
||||
display_frame->width(), display_frame->height(),
|
||||
display_frame->linesize_bytes(), QImage::Format_RGBA8888);
|
||||
source_image = backend_neutral_cpu_image_;
|
||||
} else if (display_frame->format() == PixelFormat::U8 &&
|
||||
display_frame->channel_count() == VideoParams::kRGBChannelCount) {
|
||||
display_frame->channel_count() ==
|
||||
VideoParams::kRGBChannelCount) {
|
||||
backend_neutral_cpu_display_frame_ = display_frame;
|
||||
backend_neutral_cpu_image_ = QImage(
|
||||
reinterpret_cast<const uchar *>(display_frame->const_data()),
|
||||
display_frame->width(), display_frame->height(),
|
||||
display_frame->linesize_bytes(), QImage::Format_RGB888);
|
||||
backend_neutral_cpu_image_ =
|
||||
QImage(reinterpret_cast<const uchar *>(display_frame->const_data()),
|
||||
display_frame->width(), display_frame->height(),
|
||||
display_frame->linesize_bytes(), QImage::Format_RGB888);
|
||||
source_image = backend_neutral_cpu_image_;
|
||||
} else {
|
||||
backend_neutral_cpu_display_frame_.reset();
|
||||
const int bytes_per_pixel = display_frame->video_params().GetBytesPerPixel();
|
||||
const int bytes_per_pixel =
|
||||
display_frame->video_params().GetBytesPerPixel();
|
||||
if (backend_neutral_cpu_image_.size() !=
|
||||
QSize(display_frame->width(), display_frame->height()) ||
|
||||
QSize(display_frame->width(), display_frame->height()) ||
|
||||
backend_neutral_cpu_image_.format() != QImage::Format_RGBA8888) {
|
||||
backend_neutral_cpu_image_ =
|
||||
QImage(display_frame->width(), display_frame->height(),
|
||||
QImage::Format_RGBA8888);
|
||||
backend_neutral_cpu_image_ = QImage(display_frame->width(),
|
||||
display_frame->height(),
|
||||
QImage::Format_RGBA8888);
|
||||
}
|
||||
|
||||
for (int y = 0; y < display_frame->height(); ++y) {
|
||||
@@ -1547,20 +1555,18 @@ bool ViewerDisplayWidget::DrawBackendNeutralTexture(const TexturePtr &texture,
|
||||
// Renders a backend-neutral frame by drawing into an offscreen backend texture,
|
||||
// downloading it to CPU memory, then painting that image with QPainter.
|
||||
void ViewerDisplayWidget::DrawBackendNeutral(const ColorTransformJob &ctj,
|
||||
QPainter *painter)
|
||||
QPainter *painter)
|
||||
{
|
||||
if (!painter || !painter->isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int texture_width =
|
||||
static_cast<int>(width() * devicePixelRatioF());
|
||||
const int texture_height =
|
||||
static_cast<int>(height() * devicePixelRatioF());
|
||||
const int texture_width = static_cast<int>(width() * devicePixelRatioF());
|
||||
const int texture_height = static_cast<int>(height() * devicePixelRatioF());
|
||||
|
||||
const VideoParams offscreen_params(
|
||||
texture_width, texture_height, PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount);
|
||||
const VideoParams offscreen_params(texture_width, texture_height,
|
||||
PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount);
|
||||
|
||||
if (!backend_neutral_texture_ ||
|
||||
backend_neutral_texture_->params() != offscreen_params) {
|
||||
@@ -1570,7 +1576,7 @@ void ViewerDisplayWidget::DrawBackendNeutral(const ColorTransformJob &ctj,
|
||||
backend_neutral_buffer_.resize(
|
||||
texture_width * texture_height *
|
||||
VideoParams::GetBytesPerPixel(PixelFormat::U8,
|
||||
VideoParams::kRGBAChannelCount));
|
||||
VideoParams::kRGBAChannelCount));
|
||||
}
|
||||
|
||||
if (!backend_neutral_texture_ || backend_neutral_texture_->IsDummy()) {
|
||||
@@ -1589,11 +1595,10 @@ void ViewerDisplayWidget::DrawBackendNeutral(const ColorTransformJob &ctj,
|
||||
const int bytes_per_pixel = VideoParams::GetBytesPerPixel(
|
||||
PixelFormat::U8, VideoParams::kRGBAChannelCount);
|
||||
|
||||
QImage img(reinterpret_cast<const uchar *>(
|
||||
backend_neutral_buffer_.constData()),
|
||||
texture_width, texture_height,
|
||||
texture_width * bytes_per_pixel,
|
||||
QImage::Format_RGBA8888_Premultiplied);
|
||||
QImage img(
|
||||
reinterpret_cast<const uchar *>(backend_neutral_buffer_.constData()),
|
||||
texture_width, texture_height, texture_width * bytes_per_pixel,
|
||||
QImage::Format_RGBA8888_Premultiplied);
|
||||
img.setDevicePixelRatio(devicePixelRatioF());
|
||||
|
||||
// QImage references backend_neutral_buffer_ directly; draw it before the
|
||||
|
||||
@@ -336,7 +336,8 @@ private:
|
||||
|
||||
void DrawBackendNeutral(const ColorTransformJob &ctj, QPainter *painter);
|
||||
bool DrawBackendNeutralFrame(const FramePtr &frame, QPainter *painter);
|
||||
bool DrawBackendNeutralTexture(const TexturePtr &texture, QPainter *painter);
|
||||
bool DrawBackendNeutralTexture(const TexturePtr &texture,
|
||||
QPainter *painter);
|
||||
|
||||
/**
|
||||
* @brief Internal reference to the OpenGL texture to draw. Set in SetTexture() and used in paintGL().
|
||||
|
||||
@@ -38,10 +38,19 @@ struct ViewerPlaybackFrame {
|
||||
|
||||
class ViewerQueue : public std::list<ViewerPlaybackFrame> {
|
||||
public:
|
||||
ViewerQueue() : mutex_(new QMutex()) {}
|
||||
ViewerQueue()
|
||||
: mutex_(new QMutex())
|
||||
{
|
||||
}
|
||||
ViewerQueue(const ViewerQueue &other)
|
||||
: std::list<ViewerPlaybackFrame>(other), mutex_(new QMutex()) {}
|
||||
~ViewerQueue() { delete mutex_; }
|
||||
: std::list<ViewerPlaybackFrame>(other)
|
||||
, mutex_(new QMutex())
|
||||
{
|
||||
}
|
||||
~ViewerQueue()
|
||||
{
|
||||
delete mutex_;
|
||||
}
|
||||
ViewerQueue &operator=(const ViewerQueue &other)
|
||||
{
|
||||
std::list<ViewerPlaybackFrame>::operator=(other);
|
||||
|
||||
Reference in New Issue
Block a user