id
int64
0
755k
file_name
stringlengths
3
109
file_path
stringlengths
13
185
content
stringlengths
31
9.38M
size
int64
31
9.38M
language
stringclasses
1 value
extension
stringclasses
11 values
total_lines
int64
1
340k
avg_line_length
float64
2.18
149k
max_line_length
int64
7
2.22M
alphanum_fraction
float64
0
1
repo_name
stringlengths
6
65
repo_stars
int64
100
47.3k
repo_forks
int64
0
12k
repo_open_issues
int64
0
3.4k
repo_license
stringclasses
9 values
repo_extraction_date
stringclasses
92 values
exact_duplicates_redpajama
bool
2 classes
near_duplicates_redpajama
bool
2 classes
exact_duplicates_githubcode
bool
2 classes
exact_duplicates_stackv2
bool
1 class
exact_duplicates_stackv1
bool
2 classes
near_duplicates_githubcode
bool
2 classes
near_duplicates_stackv1
bool
2 classes
near_duplicates_stackv2
bool
1 class
19,233
channellayoutcombobox.h
olive-editor_olive/app/widget/standardcombos/channellayoutcombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef CHANNELLAYOUTCOMBOBOX_H #define CHANNELLAYOUTCOMBOBOX_H #include <olive/core/core.h> #include <QComboBox> #include "ui/humanstrings.h" namespace olive { using namespace core; class ChannelLayoutComboBox : public QComboBox { Q_OBJECT public: ChannelLayoutComboBox(QWidget* parent = nullptr) : QComboBox(parent) { foreach (const uint64_t& ch_layout, AudioParams::kSupportedChannelLayouts) { this->addItem(HumanStrings::ChannelLayoutToString(ch_layout), QVariant::fromValue(ch_layout)); } } uint64_t GetChannelLayout() const { return this->currentData().toULongLong(); } void SetChannelLayout(uint64_t ch) { for (int i=0; i<this->count(); i++) { if (this->itemData(i).toULongLong() == ch) { this->setCurrentIndex(i); break; } } } }; } #endif // CHANNELLAYOUTCOMBOBOX_H
1,594
C++
.h
49
28.714286
80
0.731197
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,234
sampleratecombobox.h
olive-editor_olive/app/widget/standardcombos/sampleratecombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SAMPLERATECOMBOBOX_H #define SAMPLERATECOMBOBOX_H #include <olive/core/core.h> #include <QComboBox> #include "ui/humanstrings.h" namespace olive { using namespace core; class SampleRateComboBox : public QComboBox { Q_OBJECT public: SampleRateComboBox(QWidget* parent = nullptr) : QComboBox(parent) { foreach (int sr, AudioParams::kSupportedSampleRates) { this->addItem(HumanStrings::SampleRateToString(sr), sr); } } int GetSampleRate() const { return this->currentData().toInt(); } void SetSampleRate(int rate) { for (int i=0; i<this->count(); i++) { if (this->itemData(i).toInt() == rate) { this->setCurrentIndex(i); break; } } } }; } #endif // SAMPLERATECOMBOBOX_H
1,475
C++
.h
48
27.270833
71
0.730687
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,235
standardcombos.h
olive-editor_olive/app/widget/standardcombos/standardcombos.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef STANDARDCOMBOS_H #define STANDARDCOMBOS_H #include "channellayoutcombobox.h" #include "frameratecombobox.h" #include "interlacedcombobox.h" #include "pixelaspectratiocombobox.h" #include "pixelformatcombobox.h" #include "sampleformatcombobox.h" #include "sampleratecombobox.h" #include "videodividercombobox.h" #endif // STANDARDCOMBOS_H
1,060
C++
.h
25
40.12
71
0.795521
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,236
frameratecombobox.h
olive-editor_olive/app/widget/standardcombos/frameratecombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef FRAMERATECOMBOBOX_H #define FRAMERATECOMBOBOX_H #include <QComboBox> #include <QEvent> #include <QHBoxLayout> #include <QInputDialog> #include <QMessageBox> #include "render/videoparams.h" namespace olive { class FrameRateComboBox : public QWidget { Q_OBJECT public: FrameRateComboBox(QWidget* parent = nullptr) : QWidget(parent) { inner_ = new QComboBox(); QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(inner_); RepopulateList(); old_index_ = 0; connect(inner_, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &FrameRateComboBox::IndexChanged); } rational GetFrameRate() const { if (inner_->currentIndex() == inner_->count() - 1) { return custom_rate_; } else { return inner_->currentData().value<rational>(); } } void SetFrameRate(const rational& r) { int standard_rates = inner_->count() - 1; for (int i=0; i<standard_rates; i++) { if (inner_->itemData(i).value<rational>() == r) { // Set standard frame rate old_index_ = i; SetInnerIndexWithoutSignal(i); return; } } // If we're here, set a custom rate custom_rate_ = r; old_index_ = inner_->count()-1; SetInnerIndexWithoutSignal(old_index_); RepopulateList(); } signals: void FrameRateChanged(const rational& frame_rate); protected: virtual void changeEvent(QEvent* event) override { QWidget::changeEvent(event); if (event->type() == QEvent::LanguageChange) { RepopulateList(); } } private slots: void IndexChanged(int index) { if (index == inner_->count() - 1) { // Custom QString s; bool ok; if (!custom_rate_.isNull()) { s = QString::number(custom_rate_.toDouble()); } while (true) { s = QInputDialog::getText(this, tr("Custom Frame Rate"), tr("Enter custom frame rate:"), QLineEdit::Normal, s, &ok); if (ok) { rational r; // Try converting to double, assuming most users will input frame rates this way double d = s.toDouble(&ok); if (ok) { // Try converting from double r = rational::fromDouble(d, &ok); } else { // Try converting to rational in case someone formatted that way r = rational::fromString(s.toStdString(), &ok); } if (ok) { custom_rate_ = r; emit FrameRateChanged(r); old_index_ = index; RepopulateList(); break; } else { // Show message and continue loop QMessageBox::critical(this, tr("Invalid Input"), tr("Failed to convert \"%1\" to a frame rate.").arg(s)); } } else { // User cancelled, revert to original value SetInnerIndexWithoutSignal(old_index_); break; } } } else { old_index_ = index; emit FrameRateChanged(GetFrameRate()); } } private: void RepopulateList() { int temp_index = inner_->currentIndex(); inner_->blockSignals(true); inner_->clear(); foreach (const rational& fr, VideoParams::kSupportedFrameRates) { inner_->addItem(VideoParams::FrameRateToString(fr), QVariant::fromValue(fr)); } if (custom_rate_.isNull()) { inner_->addItem(tr("Custom...")); } else { inner_->addItem(tr("Custom (%1)").arg(VideoParams::FrameRateToString(custom_rate_))); } inner_->setCurrentIndex(temp_index); inner_->blockSignals(false); } void SetInnerIndexWithoutSignal(int index) { inner_->blockSignals(true); inner_->setCurrentIndex(index); inner_->blockSignals(false); } QComboBox* inner_; rational custom_rate_; int old_index_; }; } #endif // FRAMERATECOMBOBOX_H
4,674
C++
.h
148
25.594595
132
0.638616
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,237
videodividercombobox.h
olive-editor_olive/app/widget/standardcombos/videodividercombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef VIDEODIVIDERCOMBOBOX_H #define VIDEODIVIDERCOMBOBOX_H #include <QComboBox> #include "render/videoparams.h" namespace olive { class VideoDividerComboBox : public QComboBox { Q_OBJECT public: VideoDividerComboBox(QWidget* parent = nullptr) : QComboBox(parent) { foreach (int d, VideoParams::kSupportedDividers) { this->addItem(VideoParams::GetNameForDivider(d), d); } } int GetDivider() const { return this->currentData().toInt(); } void SetDivider(int d) { for (int i=0; i<this->count(); i++) { if (this->itemData(i).toInt() == d) { this->setCurrentIndex(i); break; } } } }; } #endif // VIDEODIVIDERCOMBOBOX_H
1,416
C++
.h
46
27.23913
71
0.726937
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,238
sampleformatcombobox.h
olive-editor_olive/app/widget/standardcombos/sampleformatcombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SAMPLEFORMATCOMBOBOX_H #define SAMPLEFORMATCOMBOBOX_H #include <olive/core/core.h> #include <QComboBox> #include "ui/humanstrings.h" namespace olive { using namespace core; class SampleFormatComboBox : public QComboBox { Q_OBJECT public: SampleFormatComboBox(QWidget* parent = nullptr) : QComboBox(parent), attempt_to_restore_format_(true) { } void SetAttemptToRestoreFormat(bool e) { attempt_to_restore_format_ = e; } void SetAvailableFormats(const std::vector<SampleFormat> &formats) { SampleFormat tmp = SampleFormat::INVALID; if (attempt_to_restore_format_) { tmp = GetSampleFormat(); } clear(); foreach (const SampleFormat &of, formats) { AddFormatItem(of); } if (attempt_to_restore_format_) { SetSampleFormat(tmp); } } void SetPackedFormats() { SampleFormat tmp = SampleFormat::INVALID; if (attempt_to_restore_format_) { tmp = GetSampleFormat(); } clear(); for (int i=SampleFormat::PACKED_START; i<SampleFormat::PACKED_END; i++) { AddFormatItem(static_cast<SampleFormat::Format>(i)); } if (attempt_to_restore_format_) { SetSampleFormat(tmp); } } SampleFormat GetSampleFormat() const { return static_cast<SampleFormat::Format>(this->currentData().toInt()); } void SetSampleFormat(SampleFormat fmt) { for (int i=0; i<this->count(); i++) { if (this->itemData(i).toInt() == fmt) { this->setCurrentIndex(i); break; } } } private: void AddFormatItem(SampleFormat f) { this->addItem(HumanStrings::FormatToString(f), static_cast<SampleFormat::Format>(f)); } bool attempt_to_restore_format_; }; } #endif // SAMPLEFORMATCOMBOBOX_H
2,462
C++
.h
81
26.37037
89
0.712829
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,239
pixelaspectratiocombobox.h
olive-editor_olive/app/widget/standardcombos/pixelaspectratiocombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PIXELASPECTRATIOCOMBOBOX_H #define PIXELASPECTRATIOCOMBOBOX_H #include <QComboBox> #include "common/ratiodialog.h" #include "render/videoparams.h" namespace olive { class PixelAspectRatioComboBox : public QComboBox { Q_OBJECT public: PixelAspectRatioComboBox(QWidget* parent = nullptr) : QComboBox(parent), dont_prompt_custom_par_(false) { QStringList par_names = VideoParams::GetStandardPixelAspectRatioNames(); for (int i=0; i<VideoParams::kStandardPixelAspects.size(); i++) { const rational& ratio = VideoParams::kStandardPixelAspects.at(i); this->addItem(par_names.at(i), QVariant::fromValue(ratio)); } // Always add custom item last, much of the logic relies on this. Set this to the current AR so // that if none of the above are ==, it will eventually select this item this->addItem(QString()); UpdateCustomItem(rational()); // Pick up index signal to query for custom aspect ratio if requested connect(this, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &PixelAspectRatioComboBox::IndexChanged); } rational GetPixelAspectRatio() const { return this->currentData().value<rational>(); } void SetPixelAspectRatio(const rational& r) { // Determine which index to select on startup for (int i=0; i<this->count(); i++) { if (this->itemData(i).value<rational>() == r) { this->setCurrentIndex(i); return; } } // Must not have found the ratio, so it must be custom UpdateCustomItem(r); dont_prompt_custom_par_ = true; this->setCurrentIndex(this->count() - 1); dont_prompt_custom_par_ = false; } private slots: void IndexChanged(int index) { if (dont_prompt_custom_par_) { return; } // Detect if custom was selected, in which case query what the new AR should be if (index == this->count() - 1) { // Query for custom pixel aspect ratio bool ok; double custom_ratio = GetFloatRatioFromUser(this, tr("Set Custom Pixel Aspect Ratio"), &ok); if (ok) { UpdateCustomItem(rational::fromDouble(custom_ratio)); } } } private: void UpdateCustomItem(const rational &ratio) { const int custom_index = this->count() - 1; if (ratio.isNull()) { this->setItemText(custom_index, tr("Custom...")); // Use 1:1 to prevent any real chance of the PAR being set to 0 this->setItemData(custom_index, QVariant::fromValue(rational(1))); } else { this->setItemText(custom_index, VideoParams::FormatPixelAspectRatioString(tr("Custom (%1)"), ratio)); this->setItemData(custom_index, QVariant::fromValue(ratio)); } } bool dont_prompt_custom_par_; }; } #endif // PIXELASPECTRATIOCOMBOBOX_H
3,736
C++
.h
100
30.78
99
0.663342
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,240
pixelformatcombobox.h
olive-editor_olive/app/widget/standardcombos/pixelformatcombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PIXELFORMATCOMBOBOX_H #define PIXELFORMATCOMBOBOX_H #include <QComboBox> #include "render/videoparams.h" namespace olive { class PixelFormatComboBox : public QComboBox { Q_OBJECT public: PixelFormatComboBox(bool float_only, QWidget* parent = nullptr) : QComboBox(parent) { // Set up preview formats for (int i=0;i<PixelFormat::COUNT;i++) { PixelFormat pix_fmt = static_cast<PixelFormat::Format>(i); if (!float_only || pix_fmt.is_float()) { this->addItem(VideoParams::GetFormatName(pix_fmt), static_cast<PixelFormat::Format>(pix_fmt)); } } } PixelFormat GetPixelFormat() const { return static_cast<PixelFormat::Format>(this->currentData().toInt()); } void SetPixelFormat(PixelFormat fmt) { for (int i=0; i<this->count(); i++) { if (this->itemData(i).toInt() == fmt) { this->setCurrentIndex(i); break; } } } }; } #endif // PIXELFORMATCOMBOBOX_H
1,675
C++
.h
50
29.66
102
0.717837
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,241
historywidget.h
olive-editor_olive/app/widget/history/historywidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2023 Olive Studios LLC 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 3 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/>. ***/ #ifndef HISTORYWIDGET_H #define HISTORYWIDGET_H #include <QTreeView> #include "undo/undostack.h" namespace olive { class HistoryWidget : public QTreeView { Q_OBJECT public: HistoryWidget(QWidget *parent = nullptr); private: UndoStack *stack_; size_t current_row_; private slots: void indexChanged(int i); void currentRowChanged(const QModelIndex &current, const QModelIndex &previous); }; } #endif // HISTORYWIDGET_H
1,159
C++
.h
33
32.515152
82
0.779982
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,242
nodeviewminimap.h
olive-editor_olive/app/widget/nodeview/nodeviewminimap.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEWMINIMAP_H #define NODEVIEWMINIMAP_H #include <QGraphicsView> #include "nodeviewscene.h" namespace olive { class NodeViewMiniMap : public QGraphicsView { Q_OBJECT public: NodeViewMiniMap(NodeViewScene *scene, QWidget *parent = nullptr); public slots: void SetViewportRect(const QPolygonF &rect); signals: void Resized(); void MoveToScenePoint(const QPointF &pos); protected: virtual void drawForeground(QPainter *painter, const QRectF &rect) override; virtual void resizeEvent(QResizeEvent *event) override; virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseMoveEvent(QMouseEvent *event) override; virtual void mouseReleaseEvent(QMouseEvent *event) override; virtual void mouseDoubleClickEvent(QMouseEvent *event) override{} private slots: void SceneChanged(const QRectF &bounding); void SetDefaultSize(); private: bool MouseInsideResizeTriangle(QMouseEvent *event); void EmitMoveSignal(QMouseEvent *event); int resize_triangle_sz_; QPolygonF viewport_rect_; bool resizing_; QPoint resize_anchor_; }; } #endif // NODEVIEWMINIMAP_H
1,844
C++
.h
49
34.816327
78
0.795814
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,243
nodeviewcommon.h
olive-editor_olive/app/widget/nodeview/nodeviewcommon.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEWCOMMON_H #define NODEVIEWCOMMON_H #include <QtGlobal> #include "common/define.h" namespace olive { class NodeViewCommon { public: enum FlowDirection { kInvalidDirection = -1, kTopToBottom, kBottomToTop, kLeftToRight, kRightToLeft }; static Qt::Orientation GetFlowOrientation(FlowDirection dir) { if (dir == kTopToBottom || dir == kBottomToTop) { return Qt::Vertical; } else { return Qt::Horizontal; } } static bool IsFlowVertical(FlowDirection dir) { return dir == kTopToBottom || dir == kBottomToTop; } static bool IsFlowHorizontal(FlowDirection dir) { return dir == kLeftToRight || dir == kRightToLeft; } static bool DirectionsAreOpposing(FlowDirection a, FlowDirection b) { return ((a == NodeViewCommon::kLeftToRight && b == NodeViewCommon::kRightToLeft) || (a == NodeViewCommon::kRightToLeft && b == NodeViewCommon::kLeftToRight) || (a == NodeViewCommon::kTopToBottom && b == NodeViewCommon::kBottomToTop) || (a == NodeViewCommon::kBottomToTop && b == NodeViewCommon::kTopToBottom)); } }; } #endif // NODEVIEWCOMMON_H
1,877
C++
.h
52
32.076923
89
0.725111
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,244
nodeviewtoolbar.h
olive-editor_olive/app/widget/nodeview/nodeviewtoolbar.h
#ifndef NODEVIEWTOOLBAR_H #define NODEVIEWTOOLBAR_H #include <QPushButton> #include <QWidget> namespace olive { class NodeViewToolBar : public QWidget { Q_OBJECT public: NodeViewToolBar(QWidget *parent = nullptr); public slots: void SetMiniMapEnabled(bool e) { minimap_btn_->setChecked(e); } signals: void AddNodeClicked(); void MiniMapEnabledToggled(bool e); protected: virtual void changeEvent(QEvent *e) override; private: void Retranslate(); void UpdateIcons(); QPushButton *add_node_btn_; QPushButton *minimap_btn_; }; } #endif // NODEVIEWTOOLBAR_H
596
C++
.h
28
18.785714
47
0.776173
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,245
nodeview.h
olive-editor_olive/app/widget/nodeview/nodeview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEW_H #define NODEVIEW_H #include <QGraphicsView> #include <QTimer> #include "core.h" #include "node/group/group.h" #include "nodeviewedge.h" #include "nodeviewcontext.h" #include "nodeviewminimap.h" #include "nodeviewscene.h" #include "widget/handmovableview/handmovableview.h" #include "widget/menu/menu.h" namespace olive { /** * @brief A widget for viewing and editing node graphs * * This widget takes a NodeGraph object and constructs a QGraphicsScene representing its data, viewing and allowing * the user to make modifications to it. */ class NodeView : public HandMovableView { Q_OBJECT public: NodeView(QWidget* parent = nullptr); virtual ~NodeView() override; void SetContexts(const QVector<Node *> &nodes); const QVector<Node*> &GetContexts() const { if (overlay_view_) { return overlay_view_->GetContexts(); } else { return contexts_; } } bool IsGroupOverlay() const { return overlay_view_; } void CloseContextsBelongingToProject(Project *project); void ClearGraph(); /** * @brief Delete selected nodes from graph (user-friendly/undoable) */ void DeleteSelected(); void SelectAll(); void DeselectAll(); void Select(const QVector<Node::ContextPair> &nodes, bool center_view_on_item); void CopySelected(bool cut); void Paste(); void Duplicate(); void SetColorLabel(int index); void ZoomIn(); void ZoomOut(); const QVector<Node*> &GetCurrentContexts() const { return contexts_; } public slots: void SetMiniMapEnabled(bool e) { minimap_->setVisible(e); } void ShowAddMenu() { Menu *m = CreateAddMenu(nullptr); m->exec(QCursor::pos()); delete m; } void CenterOnItemsBoundingRect(); void CenterOnNode(olive::Node *n); void LabelSelectedNodes(); signals: void NodesSelected(const QVector<Node*>& nodes); void NodesDeselected(const QVector<Node*>& nodes); void NodeSelectionChanged(const QVector<Node*>& nodes); void NodeSelectionChangedWithContexts(const QVector<Node::ContextPair>& nodes); void NodeGroupOpened(NodeGroup *group); void NodeGroupClosed(); void EscPressed(); protected: virtual void keyPressEvent(QKeyEvent *event) override; virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseMoveEvent(QMouseEvent *event) override; virtual void mouseReleaseEvent(QMouseEvent* event) override; virtual void mouseDoubleClickEvent(QMouseEvent* event) override; virtual void dragEnterEvent(QDragEnterEvent *event) override; virtual void dragMoveEvent(QDragMoveEvent *event) override; virtual void dropEvent(QDropEvent *event) override; virtual void dragLeaveEvent(QDragLeaveEvent *event) override; virtual void resizeEvent(QResizeEvent *event) override; virtual void ZoomIntoCursorPosition(QWheelEvent *event, double multiplier, const QPointF &cursor_pos) override; virtual bool event(QEvent *event) override; virtual bool eventFilter(QObject *object, QEvent *event) override; virtual void changeEvent(QEvent *e) override; private: void DetachItemsFromCursor(bool delete_nodes_too = true); void SetFlowDirection(NodeViewCommon::FlowDirection dir); void MoveAttachedNodesToCursor(const QPoint &p); void ProcessMovingAttachedNodes(const QPoint &pos); QVector<Node*> ProcessDroppingAttachedNodes(MultiUndoCommand *command, Node *select_context, const QPoint &pos); Node *GetContextAtMousePos(const QPoint &p); void ConnectSelectionChangedSignal(); void DisconnectSelectionChangedSignal(); void ZoomFromKeyboard(double multiplier); void ClearCreateEdgeInputIfNecessary(); QPointF GetEstimatedPositionForContext(NodeViewItem *item, Node *context) const; NodeViewItem *GetAssumedItemForSelectedNode(Node *node); bool GetAssumedPositionForSelectedNode(Node *node, Node::Position *pos); Menu *CreateAddMenu(Menu *parent); void PositionNewEdge(const QPoint &pos); void AddContext(Node *n); void RemoveContext(Node *n); bool IsItemAttachedToCursor(NodeViewItem *item) const; void ExpandItem(NodeViewItem *item); void CollapseItem(NodeViewItem *item); void EndEdgeDrag(bool cancel = false); void PostPaste(const QVector<Node*> &new_nodes, const Node::PositionMap &map); void ResizeOverlay(); NodeViewMiniMap *minimap_; NodeViewContext *GetContextItemFromNodeItem(NodeViewItem *item); struct AttachedItem { NodeViewItem* item; Node *node; QPointF original_pos; }; void SetAttachedItems(const QVector<AttachedItem> &items); QVector<AttachedItem> attached_items_; NodeViewEdge* drop_edge_; NodeInput drop_input_; NodeViewEdge* create_edge_; NodeViewItem* create_edge_output_item_; NodeViewItem* create_edge_input_item_; NodeInput create_edge_input_; bool create_edge_already_exists_; bool create_edge_from_output_; QVector<NodeViewItem*> create_edge_expanded_items_; NodeViewScene scene_; QVector<Node*> selected_nodes_; QVector<Node*> contexts_; QVector<Node*> last_set_filter_nodes_; QMap<Node*, QPointF> context_offsets_; QMap<NodeViewItem*, QPointF> dragging_items_; NodeView* overlay_view_; double scale_; bool dont_emit_selection_signals_; static const double kMinimumScale; static const int kMaximumContexts; private slots: /** * @brief Receiver for when the scene's selected items change */ void UpdateSelectionCache(); /** * @brief Receiver for when the user right clicks (or otherwise requests a context menu) */ void ShowContextMenu(const QPoint &pos); /** * @brief Receiver for when the user requests a new node from the add menu */ void CreateNodeSlot(QAction* action); /** * @brief Receiver for setting the direction from the context menu */ void ContextMenuSetDirection(QAction* action); /** * @brief Opens the selected node in a Viewer */ void OpenSelectedNodeInViewer(); void UpdateSceneBoundingRect(); void RepositionMiniMap(); void UpdateViewportOnMiniMap(); void MoveToScenePoint(const QPointF &pos); void NodeRemovedFromGraph(); void GroupNodes(); void UngroupNodes(); void ShowNodeProperties(); void ItemAboutToBeDeleted(NodeViewItem *item); void CloseOverlay(); }; } #endif // NODEVIEW_H
6,989
C++
.h
195
32.430769
115
0.769816
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,246
nodeviewcontext.h
olive-editor_olive/app/widget/nodeview/nodeviewcontext.h
#ifndef NODEVIEWCONTEXT_H #define NODEVIEWCONTEXT_H #include <QGraphicsRectItem> #include <QGraphicsTextItem> #include "node/node.h" #include "node/nodeundo.h" #include "nodeviewcommon.h" #include "nodeviewedge.h" namespace olive { class NodeViewContext : public QObject, public QGraphicsRectItem { Q_OBJECT public: NodeViewContext(Node *context, QGraphicsItem *item = nullptr); virtual ~NodeViewContext() override; Node *GetContext() const { return context_; } void UpdateRect(); void SetFlowDirection(NodeViewCommon::FlowDirection dir); void SetCurvedEdges(bool e); int DeleteSelected(NodeViewDeleteCommand *command); void Select(const QVector<Node*> &nodes); QVector<NodeViewItem*> GetSelectedItems() const; QPointF MapScenePosToNodePosInContext(const QPointF &pos) const; NodeViewItem *GetItemFromMap(Node *node) const { return item_map_.value(node); } virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; public slots: void AddChild(Node *node); void SetChildPosition(Node *node, const QPointF &pos); void RemoveChild(Node *node); void ChildInputConnected(Node *output, const NodeInput& input); bool ChildInputDisconnected(Node *output, const NodeInput& input); signals: void ItemAboutToBeDeleted(NodeViewItem *item); protected: virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override; virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override; private: void AddNodeInternal(Node *node, NodeViewItem *item); void AddEdgeInternal(Node *output, const NodeInput& input, NodeViewItem *from, NodeViewItem *to); Node *context_; QString lbl_; NodeViewCommon::FlowDirection flow_dir_; bool curved_edges_; int last_titlebar_height_; QMap<Node*, NodeViewItem*> item_map_; QVector<NodeViewEdge*> edges_; private slots: void GroupAddedNode(Node *node); void GroupRemovedNode(Node *node); }; } #endif // NODEVIEWCONTEXT_H
2,052
C++
.h
58
32.362069
116
0.790496
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,247
nodewidget.h
olive-editor_olive/app/widget/nodeview/nodewidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEWIDGET_H #define NODEWIDGET_H #include <QWidget> #include "nodeview.h" #include "nodeviewtoolbar.h" namespace olive { class NodeWidget : public QWidget { Q_OBJECT public: NodeWidget(QWidget *parent = nullptr); NodeView *view() const { return node_view_; } void SetContexts(const QVector<Node*> &nodes) { node_view_->SetContexts(nodes); toolbar_->setEnabled(!nodes.isEmpty()); } private: NodeView *node_view_; NodeViewToolBar *toolbar_; }; } #endif // NODEWIDGET_H
1,231
C++
.h
40
27.95
71
0.755537
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,248
nodeviewedge.h
olive-editor_olive/app/widget/nodeview/nodeviewedge.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEEDGEITEM_H #define NODEEDGEITEM_H #include <QGraphicsPathItem> #include <QPalette> #include "nodeviewcommon.h" #include "node/node.h" namespace olive { class NodeViewItem; /** * @brief A graphical representation of a NodeEdge to be used in NodeView * * A fairly simple line widget use to visualize a connection between two node parameters (a NodeEdge). */ class NodeViewEdge : public QGraphicsPathItem { public: NodeViewEdge(Node *output, const NodeInput& input, NodeViewItem* from_item, NodeViewItem* to_item, QGraphicsItem* parent = nullptr); NodeViewEdge(QGraphicsItem* parent = nullptr); virtual ~NodeViewEdge() override; Node *output() const { return output_; } const NodeInput& input() const { return input_; } int element() const { return element_; } NodeViewItem* from_item() const { return from_item_; } NodeViewItem* to_item() const { return to_item_; } void set_from_item(NodeViewItem *i); void set_to_item(NodeViewItem *i); void Adjust(); /** * @brief Set the connected state of this line * * When the edge is not connected, it visually depicts this by coloring the line grey. When an edge is connected or * a potential connection is valid, the line is colored white. This function sets whether the line should be grey * (false) or white (true). * * Using SetEdge() automatically sets this to true. Under most circumstances this should be left alone, and only * be set when an edge is being created/dragged. */ void SetConnected(bool c); bool IsConnected() const { return connected_; } /** * @brief Set highlighted state * * Changes color of edge. */ void SetHighlighted(bool e); /** * @brief Set points to create curve from */ void SetPoints(const QPointF& start, const QPointF& end); /** * @brief Set whether edges should be drawn as curved or as straight lines */ void SetCurved(bool e); protected: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; private: void Init(); void UpdateCurve(); Node *output_; NodeInput input_; int element_; NodeViewItem* from_item_; NodeViewItem* to_item_; int edge_width_; bool connected_; bool highlighted_; bool curved_; QPointF cached_start_; QPointF cached_end_; }; } #endif // NODEEDGEITEM_H
3,170
C++
.h
106
26.386792
117
0.727664
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,249
nodeviewitem.h
olive-editor_olive/app/widget/nodeview/nodeviewitem.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEWITEM_H #define NODEVIEWITEM_H #include <QFontMetrics> #include <QGraphicsRectItem> #include <QLinearGradient> #include <QWidget> #include "node/node.h" #include "nodeviewcommon.h" #include "nodeviewitemconnector.h" namespace olive { class NodeViewItem; class NodeViewEdge; /** * @brief A visual widget representation of a Node object to be used in a NodeView * * This widget can be collapsed or expanded to show/hide the node's various parameters. * * To retrieve the NodeViewItem for a certain Node, use NodeView::NodeToUIObject(). */ class NodeViewItem : public QObject, public QGraphicsRectItem { Q_OBJECT public: NodeViewItem(Node *node, const QString &input, int element, Node *context, QGraphicsItem* parent = nullptr); NodeViewItem(Node *node, Node *context, QGraphicsItem* parent = nullptr) : NodeViewItem(node, QString(), -1, context, parent) { } virtual ~NodeViewItem() override; Node::Position GetNodePositionData() const; QPointF GetNodePosition() const; void SetNodePosition(const QPointF& pos); void SetNodePosition(const Node::Position& pos); QVector<NodeViewEdge*> GetAllEdgesRecursively() const; /** * @brief Get currently attached node */ Node* GetNode() const { return node_; } NodeInput GetInput() const { return NodeInput(node_, input_, element_); } Node *GetContext() const { return context_; } /** * @brief Get expanded state */ bool IsExpanded() const { return expanded_; } const QVector<NodeViewEdge*> &edges() const { return edges_; } /** * @brief Set expanded state */ void SetExpanded(bool e, bool hide_titlebar = false); void ToggleExpanded(); QPointF GetInputPoint() const; QPointF GetOutputPoint() const; /** * @brief Sets the direction nodes are flowing */ void SetFlowDirection(NodeViewCommon::FlowDirection dir); NodeViewCommon::FlowDirection GetFlowDirection() const { return flow_dir_; } static int DefaultTextPadding(); static int DefaultItemHeight(); static int DefaultItemWidth(); static int DefaultItemBorder(); static QPointF NodeToScreenPoint(QPointF p, NodeViewCommon::FlowDirection direction); static QPointF ScreenToNodePoint(QPointF p, NodeViewCommon::FlowDirection direction); static qreal DefaultItemHorizontalPadding(NodeViewCommon::FlowDirection dir); static qreal DefaultItemVerticalPadding(NodeViewCommon::FlowDirection dir); qreal DefaultItemHorizontalPadding() const; qreal DefaultItemVerticalPadding() const; void AddEdge(NodeViewEdge* edge); void RemoveEdge(NodeViewEdge* edge); bool IsLabelledAsOutputOfContext() const { return label_as_output_; } void SetLabelAsOutput(bool e); void SetHighlighted(bool e); NodeViewItem *GetItemForInput(NodeInput input); bool IsOutputItem() const { return input_.isEmpty(); } void ReadjustAllEdges(); void UpdateFlowDirectionOfInputItem(NodeViewItem *child); bool CanBeExpanded() const; protected: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override; virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override; private: void UpdateContextRect(); void DrawNodeTitle(QPainter *painter, QString text, const QRectF &rect, Qt::Alignment vertical_align, int icon_full_size); int DrawExpandArrow(QPainter *painter); /** * @brief Internal update function when logical position changes */ void UpdateNodePosition(); void UpdateInputConnectorPosition(); void UpdateOutputConnectorPosition(); bool IsInputValid(const QString &input); void SetRectSize(int height_units = 1); void UpdateChildrenPositions(); int GetLogicalHeightWithChildren() const; /** * @brief Reference to attached Node */ Node *node_; QString input_; int element_; Node *context_; /** * @brief Cached list of node inputs */ QVector<NodeViewItem*> children_; /// Sizing variables to use when drawing int node_border_width_; /** * @brief Expanded state */ bool expanded_; bool highlighted_; NodeViewCommon::FlowDirection flow_dir_; QVector<NodeViewEdge*> edges_; QPointF cached_node_pos_; QRect last_arrow_rect_; bool arrow_click_; NodeViewItemConnector *input_connector_; NodeViewItemConnector *output_connector_; bool has_connectable_inputs_; bool label_as_output_; private slots: void NodeAppearanceChanged(); void RepopulateInputs(); void InputArraySizeChanged(const QString &input); }; } #endif // NODEVIEWITEM_H
5,573
C++
.h
169
29.686391
124
0.766635
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,250
nodeviewscene.h
olive-editor_olive/app/widget/nodeview/nodeviewscene.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEWSCENE_H #define NODEVIEWSCENE_H #include <QGraphicsScene> #include <QTimer> #include "node/project.h" #include "nodeviewcontext.h" #include "nodeviewedge.h" #include "nodeviewitem.h" #include "undo/undostack.h" namespace olive { class NodeViewScene : public QGraphicsScene { Q_OBJECT public: NodeViewScene(QObject *parent = nullptr); void SelectAll(); void DeselectAll(); QVector<NodeViewItem*> GetSelectedItems() const; const QHash<Node*, NodeViewContext*> &context_map() const { return context_map_; } Qt::Orientation GetFlowOrientation() const; NodeViewCommon::FlowDirection GetFlowDirection() const { return direction_; } void SetFlowDirection(NodeViewCommon::FlowDirection direction); bool GetEdgesAreCurved() const { return curved_edges_; } public slots: NodeViewContext *AddContext(Node *node); void RemoveContext(Node *node); /** * @brief Set whether edges in this scene should be curved or not */ void SetEdgesAreCurved(bool curved); private: QHash<Node*, NodeViewContext*> context_map_; Project* graph_; NodeViewCommon::FlowDirection direction_; bool curved_edges_; }; } #endif // NODEVIEWSCENE_H
1,921
C++
.h
61
28.590164
71
0.767721
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,251
nodeviewitemconnector.h
olive-editor_olive/app/widget/nodeview/nodeviewitemconnector.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEVIEWITEMCONNECTOR_H #define NODEVIEWITEMCONNECTOR_H #include <QGraphicsPolygonItem> #include "nodeviewcommon.h" namespace olive { class NodeViewItemConnector : public QGraphicsPolygonItem { public: NodeViewItemConnector(bool is_output, QGraphicsItem *parent = nullptr); void SetFlowDirection(NodeViewCommon::FlowDirection dir); bool IsOutput() const { return output_; } virtual QPainterPath shape() const override; virtual QRectF boundingRect() const override; private: bool output_; }; } #endif // NODEVIEWITEMCONNECTOR_H
1,278
C++
.h
35
33.771429
73
0.78956
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,252
nodetreeview.h
olive-editor_olive/app/widget/nodetreeview/nodetreeview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODETREEVIEW_H #define NODETREEVIEW_H #include <QTreeWidget> #include "node/node.h" namespace olive { class NodeTreeView : public QTreeWidget { Q_OBJECT public: NodeTreeView(QWidget *parent = nullptr); bool IsNodeEnabled(Node* n) const; bool IsInputEnabled(const NodeKeyframeTrackReference& ref) const; void SetCheckBoxesEnabled(bool e) { checkboxes_enabled_ = e; } void SetKeyframeTrackColor(const NodeKeyframeTrackReference& ref, const QColor& color); void SetOnlyShowKeyframable(bool e) { only_show_keyframable_ = e; } void SetShowKeyframeTracksAsRows(bool e) { show_keyframe_tracks_as_rows_ = e; } public slots: void SetNodes(const QVector<Node *> &nodes); signals: void NodeEnableChanged(Node* n, bool e); void InputEnableChanged(const NodeKeyframeTrackReference& ref, bool e); void InputSelectionChanged(const NodeKeyframeTrackReference& ref); void InputDoubleClicked(const NodeKeyframeTrackReference& ref); protected: virtual void changeEvent(QEvent* e) override; virtual void mouseDoubleClickEvent(QMouseEvent* e) override; private: void Retranslate(); NodeKeyframeTrackReference GetSelectedInput(); QTreeWidgetItem *CreateItem(QTreeWidgetItem* parent, const NodeKeyframeTrackReference& ref); void CreateItemsForTracks(QTreeWidgetItem* parent, const NodeInput& input, int track_count); static bool UseRGBAOverXYZW(const NodeKeyframeTrackReference &ref); enum ItemType { kItemTypeNode, kItemTypeInput }; static const int kItemType = Qt::UserRole; static const int kItemInputReference = Qt::UserRole + 1; static const int kItemNodePointer = Qt::UserRole + 1; QVector<Node*> nodes_; QVector<Node*> disabled_nodes_; QVector<NodeKeyframeTrackReference> disabled_inputs_; QHash<NodeKeyframeTrackReference, QTreeWidgetItem*> item_map_; bool only_show_keyframable_; bool show_keyframe_tracks_as_rows_; QHash<NodeKeyframeTrackReference, QColor> keyframe_colors_; bool checkboxes_enabled_; private slots: void ItemCheckStateChanged(QTreeWidgetItem* item, int column); void SelectionChanged(); }; } #endif // NODETREEVIEW_H
2,880
C++
.h
76
34.671053
94
0.78812
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,253
floatslider.h
olive-editor_olive/app/widget/slider/floatslider.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef FLOATSLIDER_H #define FLOATSLIDER_H #include "base/decimalsliderbase.h" namespace olive { class FloatSlider : public DecimalSliderBase { Q_OBJECT public: FloatSlider(QWidget* parent = nullptr); enum DisplayType { kNormal, kDecibel, kPercentage }; double GetValue() const; void SetValue(const double& d); void SetDefaultValue(const double& d); void SetMinimum(const double& d); void SetMaximum(const double& d); void SetDisplayType(const DisplayType& type); static double TransformValueToDisplay(double val, DisplayType display); static double TransformDisplayToValue(double val, DisplayType display); static QString ValueToString(double val, DisplayType display, int decimal_places, bool autotrim_decimal_places); protected: virtual QString ValueToString(const QVariant& v) const override; virtual QVariant StringToValue(const QString& s, bool* ok) const override; virtual QVariant AdjustDragDistanceInternal(const QVariant &start, const double &drag) const override; virtual void ValueSignalEvent(const QVariant &value) override; signals: void ValueChanged(double); private: DisplayType display_type_; }; } #endif // FLOATSLIDER_H
1,924
C++
.h
49
36.183673
114
0.788847
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,254
rationalslider.h
olive-editor_olive/app/widget/slider/rationalslider.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef RATIONALSLIDER_H #define RATIONALSLIDER_H #include <olive/core/core.h> #include <QMouseEvent> #include "base/decimalsliderbase.h" namespace olive { using namespace core; /** * @brief A olive::rational based slider * * A slider that can display rationals as either timecode (drop or non-drop), a timestamp (frames), * or a float (seconds). */ class RationalSlider : public DecimalSliderBase { Q_OBJECT public: /** * @brief enum containing the possibly display types */ enum DisplayType { kTime, kFloat, kRational }; RationalSlider(QWidget* parent = nullptr); /** * @brief Returns the sliders value as a rational */ rational GetValue(); /** * @brief Sets the sliders default value */ void SetDefaultValue(const rational& r); /** * @brief Sets the sliders minimum value */ void SetMinimum(const rational& d); /** * @brief Sets the sliders maximum value */ void SetMaximum(const rational& d); /** * @brief Sets the display type of the slider */ void SetDisplayType(const DisplayType& type); /** * @brief Set whether the user can change the display type or not */ void SetLockDisplayType(bool e); /** * @brief Get whether the user can change the display type or not */ bool GetLockDisplayType(); /** * @brief Hide display type in menu */ void DisableDisplayType(DisplayType type); public slots: /** * @brief Sets the sliders timebase which is also the minimum increment of the slider */ void SetTimebase(const rational& timebase); /** * @brief Sets the sliders value */ void SetValue(const rational& d); protected: virtual QString ValueToString(const QVariant& v) const override; virtual QVariant StringToValue(const QString& s, bool* ok) const override; virtual QVariant AdjustDragDistanceInternal(const QVariant &start, const double &drag) const override; virtual void ValueSignalEvent(const QVariant& v) override; virtual bool ValueGreaterThan(const QVariant& lhs, const QVariant& rhs) const override; virtual bool ValueLessThan(const QVariant& lhs, const QVariant& rhs) const override; signals: void ValueChanged(rational); private slots: void ShowDisplayTypeMenu(); void SetDisplayTypeFromMenu(); private: DisplayType display_type_; rational timebase_; bool lock_display_type_; QVector<DisplayType> disabled_; }; } #endif // RATIONALSLIDER_H
3,154
C++
.h
101
28.029703
104
0.745937
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,255
stringslider.h
olive-editor_olive/app/widget/slider/stringslider.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef STRINGSLIDER_H #define STRINGSLIDER_H #include "base/sliderbase.h" namespace olive { class StringSlider : public SliderBase { Q_OBJECT public: StringSlider(QWidget* parent = nullptr); void SetDragMultiplier(const double& d) = delete; QString GetValue() const; void SetValue(const QString& v); void SetDefaultValue(const QString& v); signals: void ValueChanged(const QString& str); protected: virtual QString ValueToString(const QVariant& value) const override; virtual QVariant StringToValue(const QString &s, bool *ok) const override; virtual void ValueSignalEvent(const QVariant &value) override; }; } #endif // STRINGSLIDER_H
1,383
C++
.h
36
35.638889
76
0.782216
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,256
integerslider.h
olive-editor_olive/app/widget/slider/integerslider.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef INTEGERSLIDER_H #define INTEGERSLIDER_H #include "base/numericsliderbase.h" namespace olive { class IntegerSlider : public NumericSliderBase { Q_OBJECT public: IntegerSlider(QWidget* parent = nullptr); int64_t GetValue(); void SetValue(const int64_t& v); void SetMinimum(const int64_t& d); void SetMaximum(const int64_t& d); void SetDefaultValue(const int64_t& d); protected: virtual QString ValueToString(const QVariant& v) const override; virtual QVariant StringToValue(const QString& s, bool* ok) const override; virtual void ValueSignalEvent(const QVariant &value) override; virtual QVariant AdjustDragDistanceInternal(const QVariant &start, const double &drag) const override; signals: void ValueChanged(int64_t); }; } #endif // INTEGERSLIDER_H
1,510
C++
.h
38
36.894737
104
0.783448
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,257
numericsliderbase.h
olive-editor_olive/app/widget/slider/base/numericsliderbase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NUMERICSLIDERBASE_H #define NUMERICSLIDERBASE_H #include "sliderbase.h" namespace olive { class NumericSliderBase : public SliderBase { Q_OBJECT public: NumericSliderBase(QWidget *parent = nullptr); void SetLadderElementCount(int b) { ladder_element_count_ = b; } void SetDragMultiplier(const double& d); void SetOffset(const QVariant& v); bool IsDragging() const; protected: const QVariant& GetOffset() const { return offset_; } virtual QVariant AdjustDragDistanceInternal(const QVariant &start, const double &drag) const; void SetMinimumInternal(const QVariant& v); void SetMaximumInternal(const QVariant& v); virtual bool ValueGreaterThan(const QVariant& lhs, const QVariant& rhs) const; virtual bool ValueLessThan(const QVariant& lhs, const QVariant& rhs) const; virtual bool CanSetValue() const override; private: bool UsingLadders() const; virtual QVariant AdjustValue(const QVariant& value) const override; SliderLadder* drag_ladder_; int ladder_element_count_; bool dragged_; bool has_min_; QVariant min_value_; bool has_max_; QVariant max_value_; double dragged_diff_; QVariant drag_start_value_; QVariant offset_; double drag_multiplier_; bool setting_drag_value_; /** * @brief An effects slider somewhere is being dragged */ static bool effects_slider_is_being_dragged_; private slots: void LabelPressed(); void RepositionLadder(); void LadderDragged(int value, double multiplier); void LadderReleased(); }; } #endif // NUMERICSLIDERBASE_H
2,293
C++
.h
68
30.485294
95
0.769794
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,258
sliderbase.h
olive-editor_olive/app/widget/slider/base/sliderbase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SLIDERBASE_H #define SLIDERBASE_H #include <QStackedWidget> #include "sliderlabel.h" #include "sliderladder.h" #include "widget/focusablelineedit/focusablelineedit.h" namespace olive { class SliderBase : public QStackedWidget { Q_OBJECT public: SliderBase(QWidget* parent = nullptr); void SetAlignment(Qt::Alignment alignment); bool IsTristate() const; void SetTristate(); void SetFormat(const QString& s, const bool plural = false); void ClearFormat(); bool IsFormatPlural() const; void SetDefaultValue(const QVariant& v); QString GetFormattedValueToString(const QVariant& v) const; void InsertLabelSubstitution(const QVariant &value, const QString &label) { label_substitutions_.append({value, label}); UpdateLabel(); } void SetColor(const QColor &c) { label_->SetColor(c); } public slots: void ShowEditor(); protected slots: void UpdateLabel(); protected: const QVariant& GetValueInternal() const; void SetValueInternal(const QVariant& v); QString GetFormat() const; QString GetFormattedValueToString() const; SliderLabel* label() { return label_; } virtual QString ValueToString(const QVariant &v) const = 0; virtual QVariant StringToValue(const QString& s, bool* ok) const = 0; virtual QVariant AdjustValue(const QVariant& value) const; virtual bool CanSetValue() const; virtual void ValueSignalEvent(const QVariant& value) = 0; virtual void changeEvent(QEvent* e) override; private: bool GetLabelSubstitution(const QVariant &v, QString *out) const; SliderLabel* label_; FocusableLineEdit* editor_; QVariant value_; QVariant default_value_; bool tristate_; QString custom_format_; bool format_plural_; QVector<QPair<QVariant, QString> > label_substitutions_; private slots: void LineEditConfirmed(); void LineEditCancelled(); void ResetValue(); }; } #endif // SLIDERBASE_H
2,631
C++
.h
76
31.473684
75
0.770518
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,259
decimalsliderbase.h
olive-editor_olive/app/widget/slider/base/decimalsliderbase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef DECIMALSLIDERBASE_H #define DECIMALSLIDERBASE_H #include "numericsliderbase.h" namespace olive { class DecimalSliderBase : public NumericSliderBase { public: DecimalSliderBase(QWidget* parent = nullptr); int GetDecimalPlaces() const { return decimal_places_; } void SetDecimalPlaces(int i); bool GetAutoTrimDecimalPlaces() const { return autotrim_decimal_places_; }; void SetAutoTrimDecimalPlaces(bool e); static QString FloatToString(double val, int decimal_places, bool autotrim_decimal_places); private: int decimal_places_; bool autotrim_decimal_places_; }; } #endif // DECIMALSLIDERBASE_H
1,341
C++
.h
33
37.909091
93
0.786987
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,260
sliderlabel.h
olive-editor_olive/app/widget/slider/base/sliderlabel.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SLIDERLABEL_H #define SLIDERLABEL_H #include <QLabel> #include "common/define.h" namespace olive { class SliderLabel : public QLabel { Q_OBJECT public: SliderLabel(QWidget* parent); void SetColor(const QColor &c); protected: virtual void mousePressEvent(QMouseEvent *e) override; virtual void mouseReleaseEvent(QMouseEvent *e) override; virtual void focusInEvent(QFocusEvent *event) override; virtual void changeEvent(QEvent *event) override; signals: void LabelPressed(); void LabelReleased(); void focused(); void RequestReset(); void ChangeSliderType(); private: bool override_color_enabled_; QColor override_color_; }; } #endif // SLIDERLABEL_H
1,415
C++
.h
42
30.880952
71
0.779096
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,261
sliderladder.h
olive-editor_olive/app/widget/slider/base/sliderladder.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SLIDERLADDER_H #define SLIDERLADDER_H #include <QLabel> #include <QTimer> #include <QWidget> #include "common/define.h" namespace olive { class SliderLadderElement : public QWidget { Q_OBJECT public: SliderLadderElement(const double& multiplier, QString width_hint, QWidget* parent = nullptr); void SetHighlighted(bool e); void SetValue(const QString& value); void SetMultiplierVisible(bool e); double GetMultiplier() const { return multiplier_; } private: void UpdateLabel(); QLabel* label_; double multiplier_; QString value_; bool highlighted_; bool multiplier_visible_; }; class SliderLadder : public QFrame { Q_OBJECT public: SliderLadder(double drag_multiplier, int nb_outer_values, QString width_hint, QWidget* parent = nullptr); virtual ~SliderLadder() override; void SetValue(const QString& s); void StartListeningToMouseInput(); protected: virtual void mouseReleaseEvent(QMouseEvent *event) override; virtual void closeEvent(QCloseEvent* event) override; signals: void DraggedByValue(int value, double multiplier); void Released(); private: bool UsingLadders() const; int drag_start_x_; int drag_start_y_; int wrap_count_; QList<SliderLadderElement*> elements_; int active_element_; QTimer drag_timer_; QScreen *screen_; private slots: void TimerUpdate(); }; } #endif // SLIDERLADDER_H
2,116
C++
.h
69
27.782609
107
0.772524
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,262
clickablelabel.h
olive-editor_olive/app/widget/clickablelabel/clickablelabel.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef CLICKABLELABEL_H #define CLICKABLELABEL_H #include <QLabel> #include "common/define.h" namespace olive { class ClickableLabel : public QLabel { Q_OBJECT public: ClickableLabel(const QString& text, QWidget* parent = nullptr); ClickableLabel(QWidget* parent = nullptr); protected: virtual void mouseReleaseEvent(QMouseEvent* event) override; virtual void mouseDoubleClickEvent(QMouseEvent* event) override; signals: void MouseClicked(); void MouseDoubleClicked(); }; } #endif // CLICKABLELABEL_H
1,237
C++
.h
34
33.823529
71
0.785354
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,263
collapsebutton.h
olive-editor_olive/app/widget/collapsebutton/collapsebutton.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLLAPSEBUTTON_H #define COLLAPSEBUTTON_H #include <QPushButton> #include "common/define.h" namespace olive { class CollapseButton : public QPushButton { Q_OBJECT public: CollapseButton(QWidget* parent = nullptr); private slots: void UpdateIcon(bool e); }; } #endif // COLLAPSEBUTTON_H
1,020
C++
.h
29
32.655172
71
0.779939
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,264
timeruler.h
olive-editor_olive/app/widget/timeruler/timeruler.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMERULER_H #define TIMERULER_H #include <QTimer> #include <QWidget> #include "seekablewidget.h" #include "render/playbackcache.h" namespace olive { class TimeRuler : public SeekableWidget { Q_OBJECT public: TimeRuler(bool text_visible = true, bool cache_status_visible = false, QWidget* parent = nullptr); void SetCenteredText(bool c); void SetPlaybackCache(PlaybackCache* cache); protected: virtual void drawForeground(QPainter *painter, const QRectF &rect) override; virtual void TimebaseChangedEvent(const rational& tb) override; protected slots: virtual bool ShowContextMenu(const QPoint &p) override; private: void UpdateHeight(); int CacheStatusHeight() const; int minimum_gap_between_lines_; bool text_visible_; bool centered_text_; double timebase_flipped_dbl_; bool show_cache_status_; PlaybackCache* playback_cache_; }; } #endif // TIMERULER_H
1,625
C++
.h
45
33.333333
100
0.78121
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,265
seekablewidget.h
olive-editor_olive/app/widget/timeruler/seekablewidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SEEKABLEWIDGET_H #define SEEKABLEWIDGET_H #include <QHBoxLayout> #include <QScrollBar> #include "widget/menu/menu.h" #include "widget/timebased/timebasedviewselectionmanager.h" namespace olive { class SeekableWidget : public TimeBasedView { Q_OBJECT public: SeekableWidget(QWidget *parent = nullptr); int GetScroll() const { return horizontalScrollBar()->value(); } TimelineMarkerList *GetMarkers() const { return markers_; } TimelineWorkArea *GetWorkArea() const { return workarea_; } void SetMarkers(TimelineMarkerList *markers); void SetWorkArea(TimelineWorkArea *workarea); virtual bool IsDraggingPlayhead() const override { return dragging_; } bool IsMarkerEditingEnabled() const { return marker_editing_enabled_; } void SetMarkerEditingEnabled(bool e) { marker_editing_enabled_ = e; } void DeleteSelected(); bool CopySelected(bool cut); bool PasteMarkers(); void DeselectAllMarkers(); void SeekToScenePoint(qreal scene); bool HasItemsSelected() const { return !selection_manager_.GetSelectedObjects().empty(); } const std::vector<TimelineMarker*> &GetSelectedMarkers() const { return selection_manager_.GetSelectedObjects(); } virtual void SelectionManagerSelectEvent(void *obj) override; virtual void SelectionManagerDeselectEvent(void *obj) override; virtual void CatchUpScrollEvent() override; public slots: void SetScroll(int i) { horizontalScrollBar()->setValue(i); } virtual void TimebaseChangedEvent(const rational &) override; signals: void DragMoved(int x, int y); void DragReleased(); protected: virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseMoveEvent(QMouseEvent *event) override; virtual void mouseReleaseEvent(QMouseEvent *event) override; virtual void mouseDoubleClickEvent(QMouseEvent *event) override; virtual void focusOutEvent(QFocusEvent *event) override; void DrawMarkers(QPainter *p, int marker_bottom = 0); void DrawWorkArea(QPainter *p); void DrawPlayhead(QPainter* p, int x, int y); inline const int& text_height() const { return text_height_; } inline const int& playhead_width() const { return playhead_width_; } int GetLeftLimit() const; int GetRightLimit() const; protected slots: virtual bool ShowContextMenu(const QPoint &p); private: enum ResizeMode { kResizeNone, kResizeIn, kResizeOut }; bool FindResizeHandle(QMouseEvent *event); void ClearResizeHandle(); void DragResizeHandle(const QPointF &scene_pos); void CommitResizeHandle(); TimelineMarkerList* markers_; TimelineWorkArea* workarea_; int text_height_; int playhead_width_; bool dragging_; bool ignore_next_focus_out_; TimeBasedViewSelectionManager<TimelineMarker> selection_manager_; QObject *resize_item_; ResizeMode resize_mode_; TimeRange resize_item_range_; QPointF resize_start_; uint32_t resize_snap_mask_; int marker_top_; int marker_bottom_; bool marker_editing_enabled_; QPolygon last_playhead_shape_; private slots: void SetMarkerColor(int c); void ShowMarkerProperties(); }; } #endif // SEEKABLEWIDGET_H
3,899
C++
.h
116
30.318966
73
0.772739
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,266
nodetablewidget.h
olive-editor_olive/app/widget/nodetableview/nodetablewidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODETABLEWIDGET_H #define NODETABLEWIDGET_H #include "nodetableview.h" #include "widget/timebased/timebasedwidget.h" namespace olive { class NodeTableWidget : public TimeBasedWidget { public: NodeTableWidget(QWidget* parent = nullptr); void SelectNodes(const QVector<Node*>& nodes) { view_->SelectNodes(nodes); } void DeselectNodes(const QVector<Node*>& nodes) { view_->DeselectNodes(nodes); } protected: virtual void TimeChangedEvent(const rational &time) override { view_->SetTime(time); } private: NodeTableView* view_; }; } #endif // NODETABLEWIDGET_H
1,320
C++
.h
41
29.390244
71
0.768013
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,267
nodetableview.h
olive-editor_olive/app/widget/nodetableview/nodetableview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODETABLEVIEW_H #define NODETABLEVIEW_H #include <QTreeWidget> #include "node/node.h" namespace olive { class NodeTableView : public QTreeWidget { Q_OBJECT public: NodeTableView(QWidget* parent = nullptr); void SelectNodes(const QVector<Node *> &nodes); void DeselectNodes(const QVector<Node*>& nodes); void SetTime(const rational& time); private: QMap<Node*, QTreeWidgetItem*> top_level_item_map_; rational last_time_; }; } #endif // NODETABLEVIEW_H
1,197
C++
.h
33
33.575758
71
0.772251
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,268
filefield.h
olive-editor_olive/app/widget/filefield/filefield.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef FILEFIELD_H #define FILEFIELD_H #include <QLineEdit> #include <QPushButton> namespace olive { class FileField : public QWidget { Q_OBJECT public: FileField(QWidget* parent = nullptr); QString GetFilename() const { return line_edit_->text(); } void SetFilename(const QString& s) { line_edit_->setText(s); } void SetPlaceholder(const QString& s) { line_edit_->setPlaceholderText(s); } void SetDirectoryMode(bool e) { directory_mode_ = e; } signals: void FilenameChanged(const QString& filename); private: QLineEdit* line_edit_; QPushButton* browse_btn_; bool directory_mode_; private slots: void BrowseBtnClicked(); void LineEditChanged(const QString &text); }; } #endif // FILEFIELD_H
1,476
C++
.h
52
25.423077
71
0.751783
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,269
elapsedcounterwidget.h
olive-editor_olive/app/widget/taskview/elapsedcounterwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef ELAPSEDCOUNTERWIDGET_H #define ELAPSEDCOUNTERWIDGET_H #include <QLabel> #include <QTimer> #include <QWidget> #include "common/define.h" namespace olive { class ElapsedCounterWidget : public QWidget { Q_OBJECT public: ElapsedCounterWidget(QWidget* parent = nullptr); void SetProgress(double d); public slots: void Start(qint64 start_time); void Start(); public slots: void Stop(); private: QLabel* elapsed_lbl_; QLabel* remaining_lbl_; double last_progress_; QTimer elapsed_timer_; qint64 start_time_; private slots: void UpdateTimers(); }; } #endif // ELAPSEDCOUNTERWIDGET_H
1,335
C++
.h
43
28.418605
71
0.774803
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,270
taskviewitem.h
olive-editor_olive/app/widget/taskview/taskviewitem.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TASKVIEWITEM_H #define TASKVIEWITEM_H #include <QLabel> #include <QProgressBar> #include <QPushButton> #include <QStackedWidget> #include <QWidget> #include "elapsedcounterwidget.h" #include "task/task.h" namespace olive { /** * @brief A widget that visually represents the status of a Task * * The TaskViewItem widget shows a description of the Task (Task::text(), a progress bar (updated by * Task::ProgressChanged), the Task's status (text generated from Task::status() or Task::error()), and provides * a cancel button (triggering Task::Cancel()) for cancelling a Task before it finishes. * * The main entry point is SetTask() after a Task and TaskViewItem objects are created. */ class TaskViewItem : public QFrame { Q_OBJECT public: TaskViewItem(Task *task, QWidget* parent = nullptr); void Failed(); signals: void TaskCancelled(Task* t); private: QLabel* task_name_lbl_; QProgressBar* progress_bar_; QPushButton* cancel_btn_; QStackedWidget* status_stack_; ElapsedCounterWidget* elapsed_timer_lbl_; QLabel* task_error_lbl_; Task* task_; private slots: void UpdateProgress(double d); }; } #endif // TASKVIEWITEM_H
1,885
C++
.h
54
32.518519
112
0.765453
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,271
taskview.h
olive-editor_olive/app/widget/taskview/taskview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TASKVIEW_H #define TASKVIEW_H #include <QScrollArea> #include <QVBoxLayout> #include "widget/taskview/taskviewitem.h" namespace olive { /** * @brief A widget that shows a list of Tasks * * TaskView is a fairly simple widget for showing TaskViewItem widgets that each represent a Task object. The main * entry point is the slot AddTask() which should be connected to a TaskManager's TaskAdded() signal. No more connecting * is necessary since TaskViewItem will automatically delete itself (thus removing itself from the TaskView) when the * Task finishes. */ class TaskView : public QScrollArea { Q_OBJECT public: TaskView(QWidget* parent); signals: void TaskCancelled(Task* t); public slots: /** * @brief Creates a TaskViewItem, connects it to a Task, and adds it to this widget * * Connect this to TaskManager::TaskAdded(). */ void AddTask(Task* t); void TaskFailed(Task* t); void RemoveTask(Task* t); private: QWidget* central_widget_; QVBoxLayout* layout_; QHash<Task*, TaskViewItem*> items_; }; } #endif // TASKVIEW_H
1,795
C++
.h
51
32.568627
120
0.762761
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,272
resizablescrollbar.h
olive-editor_olive/app/widget/resizablescrollbar/resizablescrollbar.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef RESIZABLESCROLLBAR_H #define RESIZABLESCROLLBAR_H #include <QScrollBar> #include "common/define.h" namespace olive { class ResizableScrollBar : public QScrollBar { Q_OBJECT public: ResizableScrollBar(QWidget* parent = nullptr); ResizableScrollBar(Qt::Orientation orientation, QWidget* parent = nullptr); signals: void ResizeBegan(int old_bar_width, bool top_handle); void ResizeMoved(int movement); void ResizeEnded(); protected: virtual void mousePressEvent(QMouseEvent* event) override; virtual void mouseMoveEvent(QMouseEvent* event) override; virtual void mouseReleaseEvent(QMouseEvent* event) override; private: QRect GetScrollBarRect(); static const int kHandleWidth; enum MouseHandleState { kNotInHandle, kInTopHandle, kInBottomHandle }; void Init(); int GetActiveMousePos(QMouseEvent* event); int GetActiveBarSize(); MouseHandleState mouse_handle_state_; bool dragging_; int drag_start_point_; }; } #endif // RESIZABLESCROLLBAR_H
1,730
C++
.h
50
31.56
77
0.785714
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,273
resizabletimelinescrollbar.h
olive-editor_olive/app/widget/resizablescrollbar/resizabletimelinescrollbar.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef RESIZABLETIMELINESCROLLBAR_H #define RESIZABLETIMELINESCROLLBAR_H #include "resizablescrollbar.h" #include "timeline/timelinemarker.h" #include "timeline/timelineworkarea.h" #include "widget/timebased/timescaledobject.h" namespace olive { class ResizableTimelineScrollBar : public ResizableScrollBar, public TimeScaledObject { Q_OBJECT public: ResizableTimelineScrollBar(QWidget* parent = nullptr); ResizableTimelineScrollBar(Qt::Orientation orientation, QWidget* parent = nullptr); void ConnectMarkers(TimelineMarkerList *markers); void ConnectWorkArea(TimelineWorkArea *workarea); void SetScale(double d); protected: virtual void paintEvent(QPaintEvent* event) override; private: TimelineMarkerList* markers_; TimelineWorkArea* workarea_; double scale_; }; } #endif // RESIZABLETIMELINESCROLLBAR_H
1,552
C++
.h
39
37.205128
85
0.80602
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,274
colorcodingcombobox.h
olive-editor_olive/app/widget/colorlabelmenu/colorcodingcombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORCODINGCOMBOBOX_H #define COLORCODINGCOMBOBOX_H #include <QComboBox> #include "widget/colorlabelmenu/colorlabelmenu.h" namespace olive { class ColorCodingComboBox : public QComboBox { Q_OBJECT public: ColorCodingComboBox(QWidget* parent = nullptr); virtual void showPopup() override; void SetColor(int index); int GetSelectedColor() const { return index_; } private: int index_; }; } #endif // COLORCODINGCOMBOBOX_H
1,171
C++
.h
35
30.714286
71
0.779267
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,275
colorlabelmenu.h
olive-editor_olive/app/widget/colorlabelmenu/colorlabelmenu.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORLABELMENU_H #define COLORLABELMENU_H #include "widget/menu/menu.h" namespace olive { class ColorLabelMenu : public Menu { Q_OBJECT public: ColorLabelMenu(QWidget* parent = nullptr); virtual void changeEvent(QEvent* event) override; signals: void ColorSelected(int i); private: void Retranslate(); QVector<QAction*> color_items_; private slots: void ActionTriggered(); }; } #endif // COLORLABELMENU_H
1,150
C++
.h
34
31.205882
71
0.77707
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,276
focusablelineedit.h
olive-editor_olive/app/widget/focusablelineedit/focusablelineedit.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SLIDERLINEEDIT_H #define SLIDERLINEEDIT_H #include <QLineEdit> #include "common/define.h" namespace olive { class FocusableLineEdit : public QLineEdit { Q_OBJECT public: FocusableLineEdit(QWidget* parent = nullptr); signals: void Confirmed(); void Cancelled(); protected: void keyPressEvent(QKeyEvent *) override; void focusOutEvent(QFocusEvent *) override; }; } #endif // SLIDERLINEEDIT_H
1,134
C++
.h
33
31.727273
71
0.78024
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,277
colorbutton.h
olive-editor_olive/app/widget/colorbutton/colorbutton.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORBUTTON_H #define COLORBUTTON_H #include <QPushButton> #include "node/color/colormanager/colormanager.h" #include "render/managedcolor.h" namespace olive { class ColorButton : public QPushButton { Q_OBJECT public: ColorButton(ColorManager* color_manager, bool show_dialog_on_click, QWidget* parent = nullptr); ColorButton(ColorManager* color_manager, QWidget* parent = nullptr) : ColorButton(color_manager, true, parent) { } const ManagedColor& GetColor() const; public slots: void SetColor(const ManagedColor& c); signals: void ColorChanged(const ManagedColor& c); private slots: void ShowColorDialog(); void ColorDialogFinished(int e); private: void UpdateColor(); ColorManager* color_manager_; ManagedColor color_; ColorProcessorPtr color_processor_; bool dialog_open_; }; } #endif // COLORBUTTON_H
1,577
C++
.h
46
31.521739
97
0.778515
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,278
pathwidget.h
olive-editor_olive/app/widget/path/pathwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PATHWIDGET_H #define PATHWIDGET_H #include <QLineEdit> #include <QPushButton> #include "common/define.h" namespace olive { class PathWidget : public QWidget { Q_OBJECT public: PathWidget(const QString& path, QWidget* parent = nullptr); QString text() const { return path_edit_->text(); } private slots: void BrowseClicked(); void LineEditChanged(); private: QLineEdit* path_edit_; QPushButton* browse_btn_; }; } #endif // PATHWIDGET_H
1,202
C++
.h
39
27.846154
71
0.755459
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,279
colorspacechooser.h
olive-editor_olive/app/widget/colorwheel/colorspacechooser.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORSPACECHOOSER_H #define COLORSPACECHOOSER_H #include <QComboBox> #include <QGroupBox> #include "node/color/colormanager/colormanager.h" namespace olive { class ColorSpaceChooser : public QGroupBox { Q_OBJECT public: ColorSpaceChooser(ColorManager* color_manager, bool enable_input_field = true, bool enable_display_fields = true, QWidget* parent = nullptr); QString input() const; ColorTransform output() const; void set_input(const QString& s); void set_output(const ColorTransform& out); signals: void InputColorSpaceChanged(const QString& input); void OutputColorSpaceChanged(const ColorTransform& out); void ColorSpaceChanged(const QString& input, const ColorTransform& out); private slots: void UpdateViews(const QString &display); private: ColorManager* color_manager_; QComboBox* input_combobox_; QComboBox* display_combobox_; QComboBox* view_combobox_; QComboBox* look_combobox_; private slots: void ComboBoxChanged(); }; } #endif // COLORSPACECHOOSER_H
1,737
C++
.h
46
35
143
0.786915
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,280
colorswatchchooser.h
olive-editor_olive/app/widget/colorwheel/colorswatchchooser.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORSWATCHCHOOSER_H #define COLORSWATCHCHOOSER_H #include "node/color/colormanager/colormanager.h" #include "widget/colorbutton/colorbutton.h" namespace olive { class ColorSwatchChooser : public QWidget { Q_OBJECT public: ColorSwatchChooser(ColorManager *manager, QWidget *parent = nullptr); public slots: void SetCurrentColor(const ManagedColor &c) { current_ = c; } signals: void ColorClicked(const ManagedColor &c); private: void SetDefaultColor(int index); static QString GetSwatchFilename(); void LoadSwatches(); void SaveSwatches(); static const int kRowCount = 4; static const int kColCount = 8; static const int kBtnCount = kRowCount*kColCount; ColorButton *buttons_[kBtnCount]; ManagedColor current_; ColorButton *menu_btn_; private slots: void HandleButtonClick(); void HandleContextMenu(); void SaveCurrentColor(); void ResetMenuButton(); }; } #endif // COLORSWATCHCHOOSER_H
1,668
C++
.h
50
30.54
71
0.779937
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,281
colorswatchwidget.h
olive-editor_olive/app/widget/colorwheel/colorswatchwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORSWATCHWIDGET_H #define COLORSWATCHWIDGET_H #include <QOpenGLWidget> #include "render/colorprocessor.h" namespace olive { class ColorSwatchWidget : public QWidget { Q_OBJECT public: ColorSwatchWidget(QWidget* parent = nullptr); const Color& GetSelectedColor() const; void SetColorProcessor(ColorProcessorPtr to_linear, ColorProcessorPtr to_display); public slots: void SetSelectedColor(const Color& c); signals: void SelectedColorChanged(const Color& c); protected: virtual void mousePressEvent(QMouseEvent* e) override; virtual void mouseMoveEvent(QMouseEvent* e) override; virtual Color GetColorFromScreenPos(const QPoint& p) const = 0; virtual void SelectedColorChangedEvent(const Color& c, bool external); Qt::GlobalColor GetUISelectorColor() const; Color GetManagedColor(const Color& input) const; private: void SetSelectedColorInternal(const Color& c, bool external); Color selected_color_; ColorProcessorPtr to_linear_processor_; ColorProcessorPtr to_display_processor_; }; } #endif // COLORSWATCHWIDGET_H
1,790
C++
.h
45
36.933333
84
0.797439
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,282
colorvalueswidget.h
olive-editor_olive/app/widget/colorwheel/colorvalueswidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORVALUESWIDGET_H #define COLORVALUESWIDGET_H #include <QCheckBox> #include <QPushButton> #include <QWidget> #include "colorpreviewbox.h" #include "node/color/colormanager/colormanager.h" #include "widget/slider/floatslider.h" #include "widget/slider/stringslider.h" namespace olive { class ColorValuesTab : public QWidget { Q_OBJECT public: ColorValuesTab(bool with_legacy_option = false, QWidget* parent = nullptr); Color GetColor() const; void SetColor(const Color& c); double GetRed() const; double GetGreen() const; double GetBlue() const; void SetRed(double r); void SetGreen(double g); void SetBlue(double b); signals: void ColorChanged(const Color& c); private: static const double kLegacyMultiplier; double GetValueInternal(FloatSlider *slider) const; void SetValueInternal(FloatSlider *slider, double v); bool AreSlidersLegacyValues() const; FloatSlider* CreateColorSlider(); FloatSlider* red_slider_; FloatSlider* green_slider_; FloatSlider* blue_slider_; QLabel *hex_lbl_; StringSlider *hex_slider_; QVector<FloatSlider*> sliders_; QCheckBox *legacy_box_; private slots: void SliderChanged(); void LegacyChanged(bool e); void UpdateHex(); void HexChanged(const QString &s); }; class ColorValuesWidget : public QWidget { Q_OBJECT public: ColorValuesWidget(ColorManager* manager, QWidget* parent = nullptr); Color GetColor() const; void SetColorProcessor(ColorProcessorPtr input_to_ref, ColorProcessorPtr ref_to_display, ColorProcessorPtr display_to_ref, ColorProcessorPtr ref_to_input); virtual bool eventFilter(QObject *watcher, QEvent *event) override; void IgnorePickFrom(QWidget *w) { ignore_pick_from_.append(w); } public slots: void SetColor(const Color& c); void SetReferenceColor(const Color& c); signals: void ColorChanged(const Color& c); private: void UpdateInputFromRef(); void UpdateDisplayFromRef(); void UpdateRefFromInput(); void UpdateRefFromDisplay(); ColorManager* manager_; ColorPreviewBox* preview_; ColorValuesTab* input_tab_; ColorValuesTab* reference_tab_; ColorValuesTab* display_tab_; ColorProcessorPtr input_to_ref_; ColorProcessorPtr ref_to_display_; ColorProcessorPtr display_to_ref_; ColorProcessorPtr ref_to_input_; QPushButton *color_picker_btn_; Color picker_end_color_; QVector<QWidget *> ignore_pick_from_; private slots: void UpdateValuesFromInput(); void UpdateValuesFromRef(); void UpdateValuesFromDisplay(); void ColorPickedBtnToggled(bool e); }; } #endif // COLORVALUESWIDGET_H
3,398
C++
.h
103
29.300971
77
0.762743
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,283
colorgradientwidget.h
olive-editor_olive/app/widget/colorwheel/colorgradientwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORGRADIENTGLWIDGET_H #define COLORGRADIENTGLWIDGET_H #include "colorswatchwidget.h" namespace olive { class ColorGradientWidget : public ColorSwatchWidget { Q_OBJECT public: ColorGradientWidget(Qt::Orientation orientation, QWidget* parent = nullptr); protected: virtual Color GetColorFromScreenPos(const QPoint& p) const override; virtual void paintEvent(QPaintEvent* e) override; virtual void SelectedColorChangedEvent(const Color& c, bool external) override; private: static Color LerpColor(const Color& a, const Color& b, int i, int max); QPixmap cached_gradient_; Qt::Orientation orientation_; Color start_; Color end_; float val_; }; } #endif // COLORGRADIENTGLWIDGET_H
1,435
C++
.h
37
35.972973
81
0.787219
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,284
colorpreviewbox.h
olive-editor_olive/app/widget/colorwheel/colorpreviewbox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORPREVIEWBOX_H #define COLORPREVIEWBOX_H #include <QWidget> #include "render/colorprocessor.h" namespace olive { class ColorPreviewBox : public QWidget { Q_OBJECT public: ColorPreviewBox(QWidget* parent = nullptr); void SetColorProcessor(ColorProcessorPtr to_ref, ColorProcessorPtr to_display); public slots: void SetColor(const Color& c); protected: virtual void paintEvent(QPaintEvent* e) override; private: Color color_; ColorProcessorPtr to_ref_processor_; ColorProcessorPtr to_display_processor_; }; } #endif // COLORPREVIEWBOX_H
1,287
C++
.h
36
33.111111
81
0.788961
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,285
colorwheelwidget.h
olive-editor_olive/app/widget/colorwheel/colorwheelwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLORWHEELWIDGET_H #define COLORWHEELWIDGET_H #include <QOpenGLWidget> #include "colorswatchwidget.h" namespace olive { class ColorWheelWidget : public ColorSwatchWidget { Q_OBJECT public: ColorWheelWidget(QWidget* parent = nullptr); signals: void DiameterChanged(int radius); protected: virtual Color GetColorFromScreenPos(const QPoint& p) const override; virtual void resizeEvent(QResizeEvent* e) override; virtual void paintEvent(QPaintEvent* e) override; virtual void SelectedColorChangedEvent(const Color& c, bool external) override; private: int GetDiameter() const; qreal GetRadius() const; struct Triangle { qreal opposite; qreal adjacent; qreal hypotenuse; }; Triangle GetTriangleFromCoords(const QPoint &center, const QPoint& p) const; Triangle GetTriangleFromCoords(const QPoint &center, qreal y, qreal x) const; Color GetColorFromTriangle(const Triangle& tri) const; QPoint GetCoordsFromColor(const Color& c) const; QPixmap cached_wheel_; float val_; bool force_redraw_; }; } #endif // COLORWHEELWIDGET_H
1,805
C++
.h
49
33.836735
81
0.786127
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,286
nodevaluetree.h
olive-editor_olive/app/widget/nodevaluetree/nodevaluetree.h
#ifndef NODEVALUETREE_H #define NODEVALUETREE_H #include <QRadioButton> #include <QTreeWidget> #include "node/node.h" namespace olive { class NodeValueTree : public QTreeWidget { Q_OBJECT public: NodeValueTree(QWidget *parent = nullptr); void SetNode(const NodeInput &input, const rational &time); protected: virtual void changeEvent(QEvent *event) override; private: void Retranslate(); private slots: void RadioButtonChecked(bool e); }; } #endif // NODEVALUETREE_H
490
C++
.h
21
21.238095
61
0.796943
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,287
projectexplorerlistviewbase.h
olive-editor_olive/app/widget/projectexplorer/projectexplorerlistviewbase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERLISTVIEWBASE_H #define PROJECTEXPLORERLISTVIEWBASE_H #include <QListView> #include "common/define.h" namespace olive { /** * @brief A QListView derivative that contains functionality used by both List view and Icon view (which are both based * on QListView) */ class ProjectExplorerListViewBase : public QListView { Q_OBJECT public: ProjectExplorerListViewBase(QWidget* parent); protected: /** * @brief Double click event override * * Function that signals DoubleClickedView(). * * FIXME: This code is the same as the code in ProjectExplorerTreeView. Is there a way to merge these two through * subclassing? */ virtual void mouseDoubleClickEvent(QMouseEvent *event) override; signals: /** * @brief Unconditional double click signal * * Emits a signal when the view is double clicked but not on any particular item */ void DoubleClickedEmptyArea(); }; } #endif // PROJECTEXPLORERLISTVIEWBASE_H
1,684
C++
.h
48
32.291667
119
0.772503
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,289
projectexplorernavigation.h
olive-editor_olive/app/widget/projectexplorer/projectexplorernavigation.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERLISTVIEWTOOLBAR_H #define PROJECTEXPLORERLISTVIEWTOOLBAR_H #include <QLabel> #include <QPushButton> #include <QSlider> #include <QWidget> #include "common/define.h" namespace olive { /** * @brief A navigation bar widget for ProjectExplorer's Icon and List views * * Unlike the Tree view, Icon and List don't follow a hierarchical view of information. This means there is no direct * way of navigating in and out of folders in those view types. We solve this in two ways: * * * Double clicking a Folder in those views will enter that folder * * This navigation bar offers a "directory up" button for leaving a folder * * This navbar also provides an icon size slider for those views (between kProjectIconSizeMinimum and * kProjectIconSizeMaximum) as well as text that's intended to be set to the current Folder's name (or * empty for the root folder). * * This widget does not actually communicate to Project or ProjectExplorer classes. It is simply UI widgets that are * intended to be connected in ways that do. This is the primarily responsibility of ProjectExplorer. * * By default, the directory up button is disabled (assuming root folder), the text is empty, and the icon size slider * is set to kProjectIconSizeDefault. */ class ProjectExplorerNavigation : public QWidget { Q_OBJECT public: ProjectExplorerNavigation(QWidget* parent); /** * @brief Sets the text string * * This text is intended to be set to the current Folder's name * * @param s */ void set_text(const QString& s); /** * @brief Set whether the "directory up" button is enabled or not * * @param e */ void set_dir_up_enabled(bool e); /** * @brief Set the current value of the size slider * * NOTE: Does NOT emit SizeChanged(). * * @param s * * New size value to set to */ void set_size_value(int s); signals: /** * @brief Signal emitted when the directory up button is clicked */ void DirectoryUpClicked(); /** * @brief Signal emitted when the icon size slider changes value * * @param size * * New size set in the slider */ void SizeChanged(int size); protected: virtual void changeEvent(QEvent *) override; private: void Retranslate(); void UpdateIcons(); QPushButton* dir_up_btn_; QLabel* dir_lbl_; QSlider* size_slider_; }; } #endif // PROJECTEXPLORERLISTVIEWTOOLBAR_H
3,131
C++
.h
94
30.404255
118
0.744857
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,291
projectexplorertreeview.h
olive-editor_olive/app/widget/projectexplorer/projectexplorertreeview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERTREEVIEW_H #define PROJECTEXPLORERTREEVIEW_H #include <QTreeView> #include "common/define.h" namespace olive { /** * @brief The view widget used when ProjectExplorer is in Tree View * * A fairly simple subclass of QTreeView that provides a double clicked signal whether the index is valid or not * (QAbstractItemView has a doubleClicked() signal but it's only emitted with a valid index). */ class ProjectExplorerTreeView : public QTreeView { Q_OBJECT public: ProjectExplorerTreeView(QWidget* parent); protected: /** * @brief Double click event override * * Function that signals DoubleClickedView(). * * FIXME: This code is the same as the code in ProjectExplorerListViewBase. Is there a way to merge these two through * */ virtual void mouseDoubleClickEvent(QMouseEvent *event) override; signals: /** * @brief Unconditional double click signal * * Emits a signal when the view is double clicked but not on any particular item */ void DoubleClickedEmptyArea(); }; } #endif // PROJECTEXPLORERTREEVIEW_H
1,796
C++
.h
50
33.16
119
0.770785
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,292
projectexplorericonview.h
olive-editor_olive/app/widget/projectexplorer/projectexplorericonview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERICONVIEW_H #define PROJECTEXPLORERICONVIEW_H #include "projectexplorerlistviewbase.h" #include "projectexplorericonviewitemdelegate.h" namespace olive { /** * @brief The view widget used when ProjectExplorer is in Icon View */ class ProjectExplorerIconView : public ProjectExplorerListViewBase { Q_OBJECT public: ProjectExplorerIconView(QWidget* parent); private: ProjectExplorerIconViewItemDelegate delegate_; }; } #endif // PROJECTEXPLORERICONVIEW_H
1,201
C++
.h
32
35.15625
71
0.802074
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,293
projectexplorer.h
olive-editor_olive/app/widget/projectexplorer/projectexplorer.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORER_H #define PROJECTEXPLORER_H #include <QSortFilterProxyModel> #include <QStackedWidget> #include <QTimer> #include <QTreeView> #include "node/project.h" #include "projectviewmodel.h" #include "widget/projectexplorer/projectexplorericonview.h" #include "widget/projectexplorer/projectexplorerlistview.h" #include "widget/projectexplorer/projectexplorertreeview.h" #include "widget/projectexplorer/projectexplorernavigation.h" #include "widget/projecttoolbar/projecttoolbar.h" namespace olive { /** * @brief A widget for browsing through a Project structure. * * ProjectExplorer automatically handles the view<->model system using a ProjectViewModel. Therefore, all that needs to * be provided is the Project structure itself. * * This widget contains three views, tree view, list view, and icon view. These can be switched at any time. */ class ProjectExplorer : public QWidget { Q_OBJECT public: ProjectExplorer(QWidget* parent); const ProjectToolbar::ViewType& view_type() const; Project* project() const; void set_project(Project* p); Folder *get_root() const; void set_root(Folder *item); QVector<Node *> SelectedItems() const; /** * @brief Use a heuristic to determine which (if any) folder is selected * * Generally for some import/adding processes, we assume that if a folder is selected, the user probably wants to * create the new object in it rather than in the root. If, however, more than one folder is selected, we can't * truly determine any folder from this and just return the root instead. * * @return * * A folder that's heuristically been determined as "selected", or the root directory if none, or nullptr if no * project is open. */ Folder* GetSelectedFolder() const; /** * @brief Access the ViewModel model of the project */ ProjectViewModel* model(); void SelectAll(); void DeselectAll(); void DeleteSelected(); bool SelectItem(Node *n, bool deselect_all_first = true); public slots: void set_view_type(ProjectToolbar::ViewType type); void Edit(Node* item); void RenameSelectedItem(); void SetSearchFilter(const QString &s); signals: /** * @brief Emitted when an Item is double clicked * * @param item * * The Item that was double clicked, or nullptr if empty area was double clicked */ void DoubleClickedItem(Node* item); void SelectionChanged(const QVector<Node *> &selected); private: /** * @brief Get all the blocks that solely rely on an input node * * Ignores blocks that depend on multiple inputs */ QList<Block*> GetFootageBlocks(QList<Node*> nodes); /** * @brief Simple convenience function for adding a view to this stacked widget * * Mainly for use in the constructor. Adds the view, connects its signals/slots, and sets the model. * * @param view * * View to add to the stack */ void AddView(QAbstractItemView* view); /** * @brief Browse to a specific folder index in the model * * Only affects list_view_ and icon_view_. * * @param index * * Either an invalid index to return to the project root, or an index to a valid Folder object. */ void BrowseToFolder(const QModelIndex& index); int ConfirmItemDeletion(Node *item); bool DeleteItemsInternal(const QVector<Node *> &selected, bool &check_if_item_is_in_use, MultiUndoCommand *command); static QString GetHumanReadableNodeName(Node* node); void UpdateNavBarText(); /** * @brief Get the currently active QAbstractItemView */ QAbstractItemView* CurrentView() const; QStackedWidget* stacked_widget_; ProjectExplorerNavigation* nav_bar_; ProjectExplorerIconView* icon_view_; ProjectExplorerListView* list_view_; ProjectExplorerTreeView* tree_view_; ProjectToolbar::ViewType view_type_; QSortFilterProxyModel sort_model_; ProjectViewModel model_; QVector<Node*> context_menu_items_; private slots: void ViewEmptyAreaDoubleClickedSlot(); void ItemDoubleClickedSlot(const QModelIndex& index); void SizeChangedSlot(int s); void DirUpSlot(); void ShowContextMenu(); void ShowItemPropertiesDialog(); void RevealSelectedFootage(); void ReplaceSelectedFootage(); void OpenContextMenuItemInNewTab(); void OpenContextMenuItemInNewWindow(); void ContextMenuStartProxy(QAction* a); void ViewSelectionChanged(); }; } #endif // PROJECTEXPLORER_H
5,141
C++
.h
143
32.706294
119
0.758851
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,294
projectviewmodel.h
olive-editor_olive/app/widget/projectexplorer/projectviewmodel.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef VIEWMODEL_H #define VIEWMODEL_H #include <QAbstractItemModel> #include "node/block/block.h" #include "node/project.h" #include "undo/undocommand.h" namespace olive { /** * @brief An adapter that interprets the data in a Project into a Qt item model for usage in ViewModel Views. * * Assuming a Project is currently "open" (i.e. the Project is connected to a ProjectExplorer/ProjectPanel through * a ProjectViewModel), it may be better to make modifications (e.g. additions/removals/renames) through the * ProjectViewModel so that the views can be efficiently and correctly updated. ProjectViewModel contains several * "wrapper" functions for Project and Item functions that also signal any connected views to update accordingly. */ class ProjectViewModel : public QAbstractItemModel { Q_OBJECT public: enum ColumnType { /// Media name kName, /// Media duration kDuration, /// Media rate (frame rate for video, sample rate for audio) kRate, /// Last modified time (for footage/files) kLastModified, /// Creation time (for footage/files) kCreatedTime, /// Count kColumnCount }; static const int kInnerTextRole = Qt::UserRole + 1; /** * @brief ProjectViewModel Constructor * * @param parent * Parent object for memory handling */ ProjectViewModel(QObject* parent); /** * @brief Get currently active project * * @return * * Currently active project or nullptr if there is none */ Project* project() const; /** * @brief Set the project to adapt * * Any views attached to this model will get updated by this function. * * @param p * * Project to adapt, can be set to nullptr to "close" the project (will show an empty model that cannot be modified) */ void set_project(Project* p); /** Compulsory Qt QAbstractItemModel overrides */ virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; virtual QModelIndex parent(const QModelIndex &child) const override; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; /** Optional Qt QAbstractItemModel overrides */ virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; virtual bool canFetchMore(const QModelIndex &parent) const override; /** Drag and drop support */ virtual Qt::ItemFlags flags(const QModelIndex &index) const override; virtual QStringList mimeTypes() const override; virtual QMimeData * mimeData(const QModelIndexList &indexes) const override; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; /** * @brief Convenience function for creating QModelIndexes from an Item object */ QModelIndex CreateIndexFromItem(Node *item, int column = 0); private: /** * @brief Retrieve the index of `item` in its parent * * This function will return the index of a specified item in its parent according to whichever sorting algorithm * is currently active. * * @return * * Index of the specified item, or -1 if the item is root (in which case it has no parent). */ int IndexOfChild(Node* item) const; /** * @brief Retrieves the Item object from a given index * * A convenience function for retrieving Item objects. If the index is not valid, this returns the root Item. */ Node* GetItemObjectFromIndex(const QModelIndex& index) const; /** * @brief Check if an Item is a parent of a Child * * Checks entire "parent hierarchy" of `child` to see if `parent` is one of its parents. */ bool ItemIsParentOfChild(Folder *parent, Node* child) const; void ConnectItem(Node* n); void DisconnectItem(Node *n); Project* project_; private slots: void FolderBeginInsertItem(Node *n, int insert_index); void FolderEndInsertItem(); void FolderBeginRemoveItem(Node* n, int child_index); void FolderEndRemoveItem(); void ItemRenamed(); }; } #endif // VIEWMODEL_H
5,170
C++
.h
129
36.643411
131
0.747602
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,295
projectexplorerundo.h
olive-editor_olive/app/widget/projectexplorer/projectexplorerundo.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERUNDO_H #define PROJECTEXPLORERUNDO_H #include "undo/undocommand.h" namespace olive { } #endif // PROJECTEXPLORERUNDO_H
858
C++
.h
20
40.2
71
0.782609
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,296
projectexplorerlistview.h
olive-editor_olive/app/widget/projectexplorer/projectexplorerlistview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTEXPLORERLISTVIEW_H #define PROJECTEXPLORERLISTVIEW_H #include "projectexplorerlistviewbase.h" #include "projectexplorerlistviewitemdelegate.h" namespace olive { /** * @brief The view widget used when ProjectExplorer is in List View */ class ProjectExplorerListView : public ProjectExplorerListViewBase { Q_OBJECT public: ProjectExplorerListView(QWidget* parent); private: ProjectExplorerListViewItemDelegate delegate_; }; } #endif // PROJECTEXPLORERLISTVIEW_H
1,201
C++
.h
32
35.15625
71
0.802074
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,297
projecttoolbar.h
olive-editor_olive/app/widget/projecttoolbar/projecttoolbar.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PROJECTTOOLBAR_H #define PROJECTTOOLBAR_H #include <QWidget> #include <QLineEdit> #include <QPushButton> #include "common/define.h" namespace olive { /** * @brief The ProjectToolbar class * * A toolbar consisting of project functions (new/open/save), edit functions (undo/redo), a search field, and a * project view selector (tree/icon/list). * * This object's signals can be connected to various functions in the application for better user experience. */ class ProjectToolbar : public QWidget { Q_OBJECT public: ProjectToolbar(QWidget* parent); enum ViewType { TreeView, ListView, IconView }; public slots: void SetView(ViewType type); protected: void changeEvent(QEvent *) override; signals: void NewClicked(); void OpenClicked(); void SaveClicked(); void SearchChanged(const QString&); void ViewChanged(ViewType type); private: void Retranslate(); void UpdateIcons(); QPushButton* new_button_; QPushButton* open_button_; QPushButton* save_button_; QLineEdit* search_field_; QPushButton* tree_button_; QPushButton* list_button_; QPushButton* icon_button_; private slots: void ViewButtonClicked(); }; } #endif // PROJECTTOOLBAR_H
1,930
C++
.h
64
27.46875
111
0.7656
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,298
timetarget.h
olive-editor_olive/app/widget/timetarget/timetarget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMETARGETOBJECT_H #define TIMETARGETOBJECT_H #include "node/output/viewer/viewer.h" namespace olive { class TimeTargetObject { public: TimeTargetObject(); ViewerOutput* GetTimeTarget() const; void SetTimeTarget(ViewerOutput* target); void SetPathIndex(int index); rational GetAdjustedTime(Node* from, Node* to, const rational& r, Node::TransformTimeDirection dir) const; TimeRange GetAdjustedTime(Node* from, Node* to, const TimeRange& r, Node::TransformTimeDirection dir) const; //int GetNumberOfPathAdjustments(Node* from, NodeParam::Type direction) const; protected: virtual void TimeTargetDisconnectEvent(ViewerOutput *){} virtual void TimeTargetChangedEvent(ViewerOutput *){} virtual void TimeTargetConnectEvent(ViewerOutput *){} private: ViewerOutput* time_target_; int path_index_; }; } #endif // TIMETARGETOBJECT_H
1,581
C++
.h
38
38.842105
110
0.788714
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,299
timebasedviewselectionmanager.h
olive-editor_olive/app/widget/timebased/timebasedviewselectionmanager.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMEBASEDVIEWSELECTIONMANAGER_H #define TIMEBASEDVIEWSELECTIONMANAGER_H #include <QGraphicsView> #include <QMouseEvent> #include <QRubberBand> #include <QToolTip> #include "common/qtutils.h" #include "timebasedview.h" #include "timebasedwidget.h" #include "widget/timetarget/timetarget.h" namespace olive { template <typename T> class TimeBasedViewSelectionManager { public: TimeBasedViewSelectionManager(TimeBasedView *view) : view_(view), rubberband_(nullptr), snap_mask_(TimeBasedWidget::kSnapAll) {} void SetSnapMask(TimeBasedWidget::SnapMask e) { snap_mask_ = e; } void ClearDrawnObjects() { drawn_objects_.clear(); } void DeclareDrawnObject(T *object, const QRectF &rect) { QRectF r(view_->UnscalePoint(rect.topLeft()), view_->UnscalePoint(rect.bottomRight())); drawn_objects_.push_back({object, r}); } bool Select(T *key) { Q_ASSERT(key); if (!IsSelected(key)) { selected_.push_back(key); return true; } return false; } bool Deselect(T *key) { Q_ASSERT(key); auto it = std::find(selected_.cbegin(), selected_.cend(), key); if (it == selected_.cend()) { return false; } else { selected_.erase(it); return true; } } void ClearSelection() { selected_.clear(); } bool IsSelected(T *key) const { return std::find(selected_.cbegin(), selected_.cend(), key) != selected_.cend(); } const std::vector<T*> &GetSelectedObjects() const { return selected_; } void SetTimebase(const rational &tb) { timebase_ = tb; } T *GetObjectAtPoint(const QPointF &scene_pt) { // Iterate in reverse order because the objects drawn later will appear on top to the user QPointF unscaled = view_->UnscalePoint(scene_pt); for (auto it=drawn_objects_.crbegin(); it!=drawn_objects_.crend(); it++) { const DrawnObject &kp = *it; if (kp.second.contains(unscaled)) { return kp.first; } } return nullptr; } T *GetObjectAtPoint(const QPoint &pt) { return GetObjectAtPoint(view_->mapToScene(pt)); } T *MousePress(QMouseEvent *event) { T *key_under_cursor = nullptr; if (event->button() == Qt::LeftButton || event->button() == Qt::RightButton) { // See if there's a keyframe in this position key_under_cursor = GetObjectAtPoint(event->pos()); bool holding_shift = event->modifiers() & Qt::ShiftModifier; if (!key_under_cursor || !IsSelected(key_under_cursor)) { if (!holding_shift) { // If not already selecting and not holding shift, clear the current selection ClearSelection(); } // Add item to selection, either nothing if shift wasn't held, or the existing selection if (key_under_cursor) { Select(key_under_cursor); view_->SelectionManagerSelectEvent(key_under_cursor); } } else if (holding_shift) { // If selected and holding shift, de-select this item but do nothing else Deselect(key_under_cursor); view_->SelectionManagerDeselectEvent(key_under_cursor); key_under_cursor = nullptr; } } return key_under_cursor; } bool IsDragging() const { return !dragging_.empty(); } void DragStart(T *initial_item, QMouseEvent *event, TimeTargetObject *target = nullptr) { if (event->button() != Qt::LeftButton) { return; } time_target_ = target; initial_drag_item_ = initial_item; dragging_.resize(selected_.size()); if constexpr (std::is_same_v<T, TimelineMarker>) { snap_points_.resize(selected_.size()*2); } else { snap_points_.resize(selected_.size()); } if (target) { time_targets_.resize(snap_points_.size()); memset(time_targets_.data(), 0, time_targets_.size() * sizeof(Node*)); } else { time_targets_.clear(); } for (size_t i=0; i<selected_.size(); i++) { T *obj = selected_.at(i); if constexpr (std::is_same_v<T, TimelineMarker>) { dragging_[i] = obj->time().in(); snap_points_[i] = obj->time().in(); snap_points_[i+selected_.size()] = obj->time().out(); if (target) { time_targets_[i] = time_targets_[i+selected_.size()] = QtUtils::GetParentOfType<Node>(obj); } } else { dragging_[i] = obj->time(); snap_points_[i] = obj->time(); if (target) { time_targets_[i] = QtUtils::GetParentOfType<Node>(obj); } } } drag_mouse_start_ = view_->UnscalePoint(view_->mapToScene(event->pos())); } void SnapPoints(rational *movement) { std::vector<rational> copy = snap_points_; if (time_target_) { for (size_t i=0; i<copy.size(); i++) { if (Node *parent = time_targets_[i]) { copy[i] = time_target_->GetAdjustedTime(parent, time_target_->GetTimeTarget(), copy[i], Node::kTransformTowardsOutput); } } } if (Core::instance()->snapping() && view_->GetSnapService()) { view_->GetSnapService()->SnapPoint(copy, movement, snap_mask_); } } void Unsnap() { if (view_->GetSnapService()) { view_->GetSnapService()->HideSnaps(); } } void DragMove(const QPoint &local_pos, const QString &tip_format = QString()) { rational time_diff = view_->SceneToTimeNoGrid(view_->mapToScene(local_pos).x() - view_->ScalePoint(drag_mouse_start_).x()); // Snap points rational presnap_time_diff = time_diff; SnapPoints(&time_diff); // Validate snapping if (Core::instance()->snapping() && view_->GetSnapService()) { for (size_t i=0; i<selected_.size(); i++) { rational proposed_time = dragging_.at(i) + time_diff; T *sel = selected_.at(i); if (sel->has_sibling_at_time(proposed_time)) { // Unsnap time_diff = presnap_time_diff; if (view_->GetSnapService()) { view_->GetSnapService()->HideSnaps(); } break; } } } // Validate movement for (size_t i=0; i<selected_.size(); i++) { rational proposed_time = dragging_.at(i) + time_diff; T *sel = selected_.at(i); // Magic number: use interval of 1ms to avoid collisions rational adj(1, 1000); if (dragging_.at(i) < proposed_time) { // Negate adjustment value if origin is less than proposed time adj = -adj; } bool loop; do { loop = false; while (sel->has_sibling_at_time(proposed_time)) { proposed_time += adj; Unsnap(); } if (proposed_time < 0) { // Prevent any object from going below zero proposed_time = 0; Unsnap(); // Setting our proposed time to zero may (re)introduce a conflict that we just avoided // with the sibling check above, so we request it to happen again. To avoid a negative // adj bringing us back below zero, we force adj to positive so it'll only nudge higher adj = qAbs(adj); loop = true; } } while (loop); time_diff = proposed_time - dragging_.at(i); } // Apply movement for (size_t i=0; i<selected_.size(); i++) { selected_.at(i)->set_time(dragging_.at(i) + time_diff); } // Show information about this keyframe rational display_time; if constexpr (std::is_same_v<T, TimelineMarker>) { display_time = initial_drag_item_->time().in(); } else { display_time = initial_drag_item_->time(); } QString tip = QString::fromStdString(Timecode::time_to_timecode( display_time, timebase_, Core::instance()->GetTimecodeDisplay(), false)); last_used_tip_format_ = tip_format; if (!tip_format.isEmpty()) { tip = tip_format.arg(tip); } QToolTip::hideText(); QToolTip::showText(QCursor::pos(), tip); } void DragStop(MultiUndoCommand *command) { QToolTip::hideText(); for (size_t i=0; i<selected_.size(); i++) { rational current; if constexpr (std::is_same_v<T, TimelineMarker>) { current = selected_.at(i)->time().in(); } else { current = selected_.at(i)->time(); } command->add_child(new SetTimeCommand(selected_.at(i), current, dragging_.at(i))); } dragging_.clear(); Unsnap(); } void RubberBandStart(QMouseEvent *event) { if (event->button() == Qt::LeftButton || event->button() == Qt::RightButton) { rubberband_scene_start_ = view_->UnscalePoint(view_->mapToScene(event->pos())); rubberband_ = new QRubberBand(QRubberBand::Rectangle, view_); rubberband_->setGeometry(QRect(event->pos().x(), event->pos().y(), 0, 0)); rubberband_->show(); rubberband_preselected_ = selected_; } } void RubberBandMove(const QPoint &pos) { if (IsRubberBanding()) { QRectF band_rect = QRectF(view_->mapFromScene(view_->ScalePoint(rubberband_scene_start_)), pos).normalized(); rubberband_->setGeometry(band_rect.toRect()); QPointF current = view_->UnscalePoint(view_->mapToScene(pos)); QRectF scene_rect = QRectF(rubberband_scene_start_, current).normalized(); selected_ = rubberband_preselected_; foreach (const DrawnObject &kp, drawn_objects_) { if (scene_rect.intersects(kp.second)) { Select(kp.first); } } } } void RubberBandStop() { if (IsRubberBanding()) { delete rubberband_; rubberband_ = nullptr; } } bool IsRubberBanding() const { return rubberband_; } void ForceDragUpdate() { if (IsRubberBanding() || IsDragging()) { QPoint local_pos = view_->viewport()->mapFromGlobal(QCursor::pos()); if (IsRubberBanding()) { RubberBandMove(local_pos); } else { DragMove(local_pos, last_used_tip_format_); } } } private: class SetTimeCommand : public UndoCommand { public: SetTimeCommand(T* key, const rational& time) { key_ = key; new_time_ = time; old_time_ = key_->time(); } SetTimeCommand(T* key, const rational& new_time, const rational& old_time) { key_ = key; new_time_ = new_time; old_time_ = old_time; } virtual Project* GetRelevantProject() const override { return Project::GetProjectFromObject(key_); } protected: virtual void redo() override { key_->set_time(new_time_); } virtual void undo() override { key_->set_time(old_time_); } private: T* key_; rational old_time_; rational new_time_; }; TimeBasedView *view_; using DrawnObject = QPair<T*, QRectF>; std::vector<DrawnObject> drawn_objects_; std::vector<T*> selected_; std::vector<rational> dragging_; std::vector<rational> snap_points_; std::vector<Node*> time_targets_; T *initial_drag_item_; QPointF drag_mouse_start_; rational timebase_; QRubberBand *rubberband_; QPointF rubberband_scene_start_; std::vector<T*> rubberband_preselected_; TimeBasedWidget::SnapMask snap_mask_; TimeTargetObject *time_target_; QString last_used_tip_format_; }; } #endif // TIMEBASEDVIEWSELECTIONMANAGER_H
12,040
C++
.h
374
26.304813
129
0.62889
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,300
timebasedview.h
olive-editor_olive/app/widget/timebased/timebasedview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMELINEVIEWBASE_H #define TIMELINEVIEWBASE_H #include <QGraphicsView> #include <vector> #include "core.h" #include "timescaledobject.h" #include "widget/handmovableview/handmovableview.h" namespace olive { class TimeBasedWidget; class TimeBasedView : public HandMovableView, public TimeScaledObject { Q_OBJECT public: TimeBasedView(QWidget* parent = nullptr); void EnableSnap(const std::vector<rational> &points); void DisableSnap(); bool IsSnapped() const { return snapped_; } TimeBasedWidget *GetSnapService() const { return snap_service_; } void SetSnapService(TimeBasedWidget* service) { snap_service_ = service; } const double& GetYScale() const; void SetYScale(const double& y_scale); virtual bool IsDraggingPlayhead() const { return dragging_playhead_; } // To be called only by selection managers virtual void SelectionManagerSelectEvent(void *obj){} virtual void SelectionManagerDeselectEvent(void *obj){} ViewerOutput *GetViewerNode() const { return viewer_; } void SetViewerNode(ViewerOutput *v); QPointF ScalePoint(const QPointF &p) const; QPointF UnscalePoint(const QPointF &p) const; public slots: void SetEndTime(const rational& length); /** * @brief Slot called whenever the view resizes or the scene contents change to enforce minimum scene sizes */ void UpdateSceneRect(); signals: void ScaleChanged(double scale); protected: virtual void drawForeground(QPainter *painter, const QRectF &rect) override; virtual void resizeEvent(QResizeEvent *event) override; virtual void ScaleChangedEvent(const double& scale) override; virtual void SceneRectUpdateEvent(QRectF&){} virtual void VerticalScaleChangedEvent(double scale); virtual void ZoomIntoCursorPosition(QWheelEvent *event, double multiplier, const QPointF &cursor_pos) override; bool PlayheadPress(QMouseEvent* event); bool PlayheadMove(QMouseEvent* event); bool PlayheadRelease(QMouseEvent* event); virtual void TimebaseChangedEvent(const rational &) override; bool IsYAxisEnabled() const { return y_axis_enabled_; } void SetYAxisEnabled(bool e) { y_axis_enabled_ = e; } private: qreal GetPlayheadX(); double playhead_scene_left_; double playhead_scene_right_; bool dragging_playhead_; QGraphicsScene scene_; bool snapped_; std::vector<rational> snap_time_; rational end_time_; TimeBasedWidget* snap_service_; bool y_axis_enabled_; double y_scale_; ViewerOutput *viewer_; }; } #endif // TIMELINEVIEWBASE_H
3,266
C++
.h
92
32.358696
113
0.776286
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,301
timebasedwidget.h
olive-editor_olive/app/widget/timebased/timebasedwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMEBASEDWIDGET_H #define TIMEBASEDWIDGET_H #include <QWidget> #include "node/output/viewer/viewer.h" #include "timeline/timelinecommon.h" #include "widget/keyframeview/keyframeviewinputconnection.h" #include "widget/resizablescrollbar/resizabletimelinescrollbar.h" #include "widget/timebased/timescaledobject.h" #include "widget/timelinewidget/view/timelineview.h" #include "widget/timetarget/timetarget.h" namespace olive { class TimeRuler; class TimeBasedWidget : public TimelineScaledWidget { Q_OBJECT public: TimeBasedWidget(bool ruler_text_visible = true, bool ruler_cache_status_visible = false, QWidget* parent = nullptr); void ZoomIn(); void ZoomOut(); ViewerOutput* GetConnectedNode() const; void ConnectViewerNode(ViewerOutput *node); TimelineWorkArea *GetConnectedWorkArea() const { return workarea_; } TimelineMarkerList *GetConnectedMarkers() const { return markers_; } void ConnectWorkArea(TimelineWorkArea *workarea); void ConnectMarkers(TimelineMarkerList *markers); void SetScaleAndCenterOnPlayhead(const double& scale); TimeRuler* ruler() const; using SnapMask = uint32_t; enum SnapPoints { kSnapToClips = 0x1, kSnapToPlayhead = 0x2, kSnapToMarkers = 0x4, kSnapToKeyframes = 0x8, kSnapToWorkarea = 0x10, kSnapAll = UINT32_MAX }; /** * @brief Snaps point `start_point` that is moving by `movement` to currently existing clips */ bool SnapPoint(const std::vector<rational> &start_times, rational *movement, SnapMask snap_points = kSnapAll); void ShowSnaps(const std::vector<rational> &times); void HideSnaps(); virtual bool CopySelected(bool cut); virtual bool Paste(); public slots: void SetTimebase(const rational& timebase); void SetScale(const double& scale); void GoToStart(); void PrevFrame(); void NextFrame(); void GoToEnd(); void GoToPrevCut(); void GoToNextCut(); void SetInAtPlayhead(); void SetOutAtPlayhead(); void ResetIn(); void ResetOut(); void ClearInOutPoints(); void SetMarker(); void ToggleShowAll(); void GoToIn(); void GoToOut(); void DeleteSelected(); protected: ResizableTimelineScrollBar* scrollbar() const; virtual void TimebaseChangedEvent(const rational&) override; virtual void TimeChangedEvent(const rational&){} virtual void ScaleChangedEvent(const double &) override; virtual void ConnectedNodeChangeEvent(ViewerOutput*){} virtual void ConnectedWorkAreaChangeEvent(TimelineWorkArea *){} virtual void ConnectedMarkersChangeEvent(TimelineMarkerList *){} virtual void ConnectNodeEvent(ViewerOutput*){} virtual void DisconnectNodeEvent(ViewerOutput*){} void SetAutoMaxScrollBar(bool e); virtual void resizeEvent(QResizeEvent *event) override; void ConnectTimelineView(TimeBasedView* base); void SetCatchUpScrollValue(QScrollBar *b, int v, int maximum); void StopCatchUpScrollTimer(QScrollBar *b); virtual const QVector<Block*> *GetSnapBlocks() const { return nullptr; } virtual const QVector<KeyframeViewInputConnection*> *GetSnapKeyframes() const { return nullptr; } virtual const TimeTargetObject *GetKeyframeTimeTarget() const { return nullptr; } virtual const std::vector<NodeKeyframe*> *GetSnapIgnoreKeyframes() const { return nullptr; } virtual const std::vector<TimelineMarker*> *GetSnapIgnoreMarkers() const { return nullptr; } protected slots: /** * @brief Slot to center the horizontal scroll bar on the playhead's current position */ void CenterScrollOnPlayhead(); /** * @brief By default, TimeBasedWidget will set the timebase to the viewer node's video timebase. * Set this to false if you want to set your own timebase. */ void SetAutoSetTimebase(bool e); static void PageScrollInternal(QScrollBar* bar, int maximum, int screen_position, bool whole_page_scroll); void StopCatchUpScrollTimer() { StopCatchUpScrollTimer(scrollbar_); } void SetCatchUpScrollValue(int v); signals: void TimebaseChanged(const rational&); void ConnectedNodeChanged(ViewerOutput* old, ViewerOutput* now); protected slots: virtual void SendCatchUpScrollEvent(); private: /** * @brief Set either in or out point to the current playhead * * @param m * * Set to kTrimIn or kTrimOut for setting the in point or out point respectively. */ void SetPoint(Timeline::MovementMode m, const rational &time); /** * @brief Reset either the in or out point * * Sets either the in point to 0 or the out point to `RATIONAL_MAX`. * * @param m * * Set to kTrimIn or kTrimOut for setting the in point or out point respectively. */ void ResetPoint(Timeline::MovementMode m); void PageScrollInternal(int screen_position, bool whole_page_scroll); bool UserIsDraggingPlayhead() const; ViewerOutput* viewer_node_; TimeRuler* ruler_; ResizableTimelineScrollBar* scrollbar_; bool auto_max_scrollbar_; QList<TimeBasedView*> timeline_views_; bool toggle_show_all_; double toggle_show_all_old_scale_; int toggle_show_all_old_scroll_; bool auto_set_timebase_; int scrollbar_start_width_; double scrollbar_start_value_; double scrollbar_start_scale_; bool scrollbar_top_handle_; TimelineWorkArea *workarea_; TimelineMarkerList *markers_; QTimer *catchup_scroll_timer_; struct CatchUpScrollData { qint64 last_forced = 0; int maximum; int value; }; QMap<QScrollBar*, CatchUpScrollData> catchup_scroll_values_; private slots: void UpdateMaximumScroll(); void ScrollBarResizeBegan(int current_bar_width, bool top_handle); void ScrollBarResizeMoved(int new_bar_width); /** * @brief Slot to handle page scrolling of the playhead * * If the playhead is outside the current scroll bounds, this function will scroll to where it is. Otherwise it will * do nothing. */ void PageScrollToPlayhead(); void CatchUpScrollToPlayhead(); void CatchUpScrollToPoint(int point); void CatchUpTimerTimeout(); void AutoUpdateTimebase(); void ConnectedNodeRemovedFromGraph(); void PlayheadTimeChanged(const rational &time); }; } #endif // TIMEBASEDWIDGET_H
6,867
C++
.h
181
34.491713
118
0.770502
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,302
timescaledobject.h
olive-editor_olive/app/widget/timebased/timescaledobject.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TIMELINESCALEDOBJECT_H #define TIMELINESCALEDOBJECT_H #include <olive/core/core.h> #include <QWidget> #include "node/block/block.h" namespace olive { /** * @brief Provides base functionality for any object that uses time and scale */ class TimeScaledObject { public: TimeScaledObject(); virtual ~TimeScaledObject() = default; void SetTimebase(const rational &timebase); const rational& timebase() const; const double& timebase_dbl() const; static rational SceneToTime(const double &x, const double& x_scale, const rational& timebase, bool round = false); static rational SceneToTimeNoGrid(const double &x, const double& x_scale); const double& GetScale() const; const double &GetMaximumScale() const { return max_scale_; } void SetScale(const double& scale); void SetScaleFromDimensions(double viewport_width, double content_width); static double CalculateScaleFromDimensions(double viewport_sz, double content_sz); static double CalculatePaddingFromDimensionScale(double viewport_sz); double TimeToScene(const rational& time) const; rational SceneToTime(const double &x, bool round = false) const; rational SceneToTimeNoGrid(const double &x) const; protected: virtual void TimebaseChangedEvent(const rational&){} virtual void ScaleChangedEvent(const double&){} void SetMaximumScale(const double& max); void SetMinimumScale(const double& min); private: rational timebase_; double timebase_dbl_; double scale_; double min_scale_; double max_scale_; static const int kCalculateDimensionsPadding; }; class TimelineScaledWidget : public QWidget, public TimeScaledObject { Q_OBJECT public: TimelineScaledWidget(QWidget* parent = nullptr); }; } #endif // TIMELINESCALEDOBJECT_H
2,475
C++
.h
63
36.492063
116
0.786644
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,303
menu.h
olive-editor_olive/app/widget/menu/menu.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef WIDGETMENU_H #define WIDGETMENU_H #include <QMenuBar> #include <QMenu> #include <QMetaMethod> #include "common/define.h" namespace olive { /** * @brief A menu widget for context menus and menu bars * * A QMenu subclass with functions for creating menus and menu items that conform to Olive's menu and keyboard shortcut * system. * * In Olive, menu items in the menu bar are also responsible for keyboard shortcuts throughout the application. To allow * these to be configurable and these configurations saveable, every item needs a unique ID. This ID gets linked to the * keyboard shortcuts in config files. The ID doesn't get translated so it can also persist through language changes. * * The ID gets stored in the QAction's "id" property. If a keyboard shortcut is provided, it gets stored in the * QAction's "keydefault" property. * * It is always recommended to use this over QMenu in any situation. */ class Menu : public QMenu { public: Menu(QMenuBar* bar); template <typename Func> /** * @brief Construct a Menu and add it to a QMenuBar * * This Menu can be connected to a slot that's triggered when the Menu is "about to show". Use `receiver` and * `member` to connect this (same syntax as QObject::connect) or leave as nullptr to not. */ Menu(QMenuBar* bar, const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member) { bar->addMenu(this); Init(); ConnectAboutToShow(receiver, member); } Menu(Menu* menu); template <typename Func> /** * @brief Construct a Menu and add it as a submenu to another Menu * * This Menu can be connected to a slot that's triggered when the Menu is "about to show". Use `receiver` and * `member` to connect this (same syntax as QObject::connect) or leave as nullptr to not. */ Menu(Menu* menu, const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member) { menu->addMenu(this); Init(); ConnectAboutToShow(receiver, member); } /** * @brief Construct a popup menu */ Menu(QWidget* parent = nullptr); /** * @brief Construct a popup menu */ Menu(const QString& s, QWidget* parent = nullptr); template <typename Func> /** * @brief Create a menu item and add it to this menu * * @param id * * The action's unique ID * * @param receiver * * The QObject to receive the signal when this item is triggered * * @param member * * The QObject slot to connect this action's triggered signal to * * @param key * * Default keyboard sequence * * @return * * The QAction that was created and added to this Menu */ QAction* AddItem(const QString& id, const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member, const QKeySequence &key = QKeySequence()) { QAction* a = CreateItem(this, id, receiver, member, key); addAction(a); return a; } QAction* AddActionWithData(const QString& text, const QVariant& d, const QVariant& compare); QAction *InsertAlphabetically(const QString& s); void InsertAlphabetically(QAction* entry); void InsertAlphabetically(Menu* menu); template <typename Func> /** * @brief Create a menu item * * @param parent * * The QAction's parent * * @param id * * The action's unique ID * * @param receiver * * The QObject to receive the signal when this item is triggered * * @param member * * The QObject slot to connect this action's triggered signal to * * @param key * * Default keyboard sequence * * @return * * The QAction that was created and added to this Menu */ static QAction* CreateItem(QObject* parent, const QString& id, const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member, const QKeySequence &key = QKeySequence()) { QAction* a = new QAction(parent); ConformItem(a, id, receiver, member, key); return a; } template <typename Func> /** * @brief Conform a QAction to Olive's ID/keydefault system * * If a QAction was created elsewhere (e.g. through QUndoStack::createUndoAction()), this function will give it * properties conforming it to Olive's menu item system * * @param a * * The QAction's to conform * * @param id * * The action's unique ID * * @param receiver * * The QObject to receive the signal when this item is triggered * * @param member * * The QObject slot to connect this action's triggered signal to * * @param key * * Default keyboard sequence */ static void ConformItem(QAction *a, const QString& id, const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member, const QKeySequence &key = QKeySequence()) { ConformItem(a, id, key); connect(a, &QAction::triggered, receiver, member); } static void ConformItem(QAction *a, const QString& id, const QKeySequence &key = QKeySequence()); private: void Init(); template <typename Func> void ConnectAboutToShow(const typename QtPrivate::FunctionPointer<Func>::Object *receiver, Func member) { connect(this, &Menu::aboutToShow, receiver, member); } }; } #endif // WIDGETMENU_H
6,434
C++
.h
209
25.22488
120
0.661337
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,304
menushared.h
olive-editor_olive/app/widget/menu/menushared.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef MENUSHARED_H #define MENUSHARED_H #include <olive/core/core.h> #include "widget/colorlabelmenu/colorlabelmenu.h" #include "widget/menu/menu.h" namespace olive { using namespace core; /** * @brief A static object that provides various "stock" menus for use throughout the application */ class MenuShared : public QObject { Q_OBJECT public: MenuShared(); virtual ~MenuShared() override; static void CreateInstance(); static void DestroyInstance(); void Retranslate(); void AddItemsForNewMenu(Menu* m); void AddItemsForEditMenu(Menu* m, bool for_clips); void AddItemsForAddableObjectsMenu(Menu* m); void AddItemsForInOutMenu(Menu* m); void AddColorCodingMenu(Menu* m); void AddItemsForClipEditMenu(Menu* m); void AddItemsForTimeRulerMenu(Menu* m); void AboutToShowTimeRulerActions(const rational& timebase); static MenuShared* instance(); QAction* edit_delete_item() { return edit_delete_item_; } public slots: void DeleteSelectedTriggered(); private: // "New" menu shared items QAction* new_project_item_; QAction* new_sequence_item_; QAction* new_folder_item_; // "Edit" menu shared items QAction* edit_cut_item_; QAction* edit_copy_item_; QAction* edit_paste_item_; QAction* edit_paste_insert_item_; QAction* edit_duplicate_item_; QAction* edit_rename_item_; QAction* edit_delete_item_; QAction* edit_ripple_delete_item_; QAction* edit_split_item_; QAction* edit_speedduration_item_; // List of addable items QVector<QAction*> addable_items_; // "In/Out" menu shared items QAction* inout_set_in_item_; QAction* inout_set_out_item_; QAction* inout_reset_in_item_; QAction* inout_reset_out_item_; QAction* inout_clear_inout_item_; // "Clip Edit" menu shared items QAction* clip_add_default_transition_item_; QAction* clip_link_unlink_item_; QAction* clip_enable_disable_item_; QAction* clip_nest_item_; // TimeRuler menu shared items QActionGroup* frame_view_mode_group_; QAction* view_timecode_view_dropframe_item_; QAction* view_timecode_view_nondropframe_item_; QAction* view_timecode_view_seconds_item_; QAction* view_timecode_view_frames_item_; QAction* view_timecode_view_milliseconds_item_; // Color coding menu items ColorLabelMenu* color_coding_menu_; static MenuShared* instance_; private slots: void SplitAtPlayheadTriggered(); void RippleDeleteTriggered(); void SetInTriggered(); void SetOutTriggered(); void ResetInTriggered(); void ResetOutTriggered(); void ClearInOutTriggered(); void ToggleLinksTriggered(); void CutTriggered(); void CopyTriggered(); void PasteTriggered(); void PasteInsertTriggered(); void DuplicateTriggered(); void RenameSelectedTriggered(); void EnableDisableTriggered(); void NestTriggered(); void DefaultTransitionTriggered(); /** * @brief A slot for the timecode display menu items * * Assumes a QAction* sender() and its data() is a member of enum Timecode::Display. Uses the data() to signal a * timecode change throughout the rest of the application. */ void TimecodeDisplayTriggered(); void ColorLabelTriggered(int color_index); void SpeedDurationTriggered(); void AddableItemTriggered(); }; } #endif // MENUSHARED_H
4,001
C++
.h
118
30.771186
114
0.760824
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,305
toolbar.h
olive-editor_olive/app/widget/toolbar/toolbar.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TOOLBAR_H #define TOOLBAR_H #include <QPushButton> #include "widget/flowlayout/flowlayout.h" #include "widget/toolbar/toolbarbutton.h" #include "tool/tool.h" namespace olive { /** * @brief A widget containing buttons for all of Olive's application-wide tools. * * Buttons are displayed in a FlowLayout that * adjusts and wraps (like text) depending on the widget's size. * * By default, this Toolbar is not connected to anything. It's recommended to connect SLOT(SetTool()) and * SIGNAL(ToolChanged()) to Core (corresponding SIGNAL(ToolChanged()) and SLOT(SetTool()) respectively) so that the * Toolbar updates the current tool application-wide, and is also automatically updated when the tool is changed * elsewhere. */ class Toolbar : public QWidget { Q_OBJECT public: /** * @brief Toolbar Constructor * * Creates and connects all the Toolbar buttons * * @param parent * * QWidget parent. */ Toolbar(QWidget* parent); public slots: /** * @brief Set the tool to be displayed as "selected" * * This function does not set the application-wide tool, it only sets which tool show as selected in this widget. * It's recommended to use this function only as a slot connected to Core::ToolChanged() so that it automatically * updates whenever the application-wide tool is changed. * * @param tool * * Tool to show as selected */ void SetTool(const Tool::Item &tool); /** * @brief Set snapping checked value * * Similar to SetTool(), this does not set anything application-wide, it only changes the displayed button appearance. * In this case, whether the snapping button should show as snapping enabled or disabled. * * @param snapping */ void SetSnapping(const bool &snapping); protected: /** * @brief Qt changeEvent * * Overridden to catch language change events (see Retranslate()) * * @param e */ virtual void changeEvent(QEvent* e) override; virtual void resizeEvent(QResizeEvent *e) override; signals: /** * @brief Emitted whenever a tool is selected using this widget * * @param t * * Tool that was selected */ void ToolChanged(const Tool::Item& t); /** * @brief Emitted whenever the snapping setting is changed * * @param b * * New snapping enabled setting */ void SnappingChanged(const bool& b); /** * @brief Emitted when the selected transition is changed from the transition tool menu */ void SelectedTransitionChanged(const QString& id); private: /** * @brief Reset all strings based on the currently selected language */ void Retranslate(); /** * @brief Update icons after a style change */ void UpdateIcons(); /** * @brief Internal convenience function for creating tool buttons quickly * * This function will create a ToolbarButton object, set the icon to `icon`, set its tool value to `tool`, add it to * the widget layout, add it to toolbar_btns_ so the buttons can be iterated (done in various functions), and connect * the button to ToolButtonClicked(). * * If you need a non-tool but similarly styled button, use CreateNonToolButton(). * * @return * * The created ToolbarButton. The button parent is automatically set to `this`. */ ToolbarButton* CreateToolButton(const Tool::Item& tool); /** * @brief Internal convenience function for creating buttons quickly * * Similar to CreateToolButton() but doesn't add the button to toolbar_btns_ and doesn't connect the button to * ToolButtonClicked(). This is to create a button that is similarly styled but doesn't actually represent a tool * per se. * * @return * * The created ToolbarButton. The button parent is automatically set to `this`. */ ToolbarButton* CreateNonToolButton(); /** * @brief Internal layout used for buttons */ FlowLayout* layout_; /** * @brief Array/list of toolbar buttons * * This list is automatically appended by CreateToolButton(). It's used to iterate through the toolbar buttons * quickly with for loops, etc. See SetTool() for example usage. */ QList<ToolbarButton*> toolbar_btns_; ToolbarButton* btn_pointer_tool_; ToolbarButton* btn_trackselect_tool_; ToolbarButton* btn_edit_tool_; ToolbarButton* btn_ripple_tool_; ToolbarButton* btn_rolling_tool_; ToolbarButton* btn_razor_tool_; ToolbarButton* btn_slip_tool_; ToolbarButton* btn_slide_tool_; ToolbarButton* btn_hand_tool_; ToolbarButton* btn_transition_tool_; ToolbarButton* btn_zoom_tool_; ToolbarButton* btn_record_; ToolbarButton* btn_add_; ToolbarButton* btn_snapping_toggle_; private slots: /** * @brief Slot for a ToolbarButton being clicked * * ToolbarButtons created from CreateToolButton() are automatically connected to this slot. * This slot will receive the ToolbarButton's tool value * and emit a signal indicating that the tool has changed to the newly selected tool. This function static_casts * the sender to ToolbarButton so you should not connect any other class type to this slot. */ void ToolButtonClicked(); /** * @brief Receiver for the snapping toggle button * * This function's primary purpose is to emit SnappingChanged() and should be connected to the ToolbarButton's * SIGNAL(clicked(bool)). * * @param b * * The new snapping value received from the sender's clicked signal */ void SnappingButtonClicked(bool b); /** * @brief Receiver for the add button * * The add button pops up a list for which object to create. */ void AddButtonClicked(); /** * @brief Receiver for the transition button * * The transition button pops up a list for which transition to create. */ void TransitionButtonClicked(); /** * @brief Receiver for the menu created by TransitionButtonClicked() */ void TransitionMenuItemTriggered(QAction* a); }; } #endif // TOOLBAR_H
6,692
C++
.h
199
30.201005
120
0.730031
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,306
toolbarbutton.h
olive-editor_olive/app/widget/toolbar/toolbarbutton.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef TOOLBARBUTTON_H #define TOOLBARBUTTON_H #include <QPushButton> #include "tool/tool.h" namespace olive { /** * @brief Simple derived class of QPushButton to contain an Tool ID. Used as the main widget through Toolbar. */ class ToolbarButton : public QPushButton { public: /** * @brief ToolbarButton Constructor * * @param parent * * QWidget parent. Almost always an instance of Toolbar. * * @param tool * * Tool object. Must be a member of enum Tool::Item, including kNone if this button does not represent a tool. */ ToolbarButton(QWidget* parent, const Tool::Item& tool); /** * @brief Retrieve tool ID that this button represents * * Set in the constructor and shouldn't change throughout its lifetime. */ const Tool::Item& tool(); private: /** * @brief Internal tool value */ Tool::Item tool_; }; } #endif // TOOLBARBUTTON_H
1,616
C++
.h
51
28.745098
112
0.738402
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,307
multicamwidget.h
olive-editor_olive/app/widget/multicam/multicamwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef MULTICAMWIDGET_H #define MULTICAMWIDGET_H #include "multicamdisplay.h" #include "node/input/multicam/multicamnode.h" #include "widget/viewer/viewer.h" namespace olive { class MulticamWidget : public TimeBasedWidget { Q_OBJECT public: explicit MulticamWidget(QWidget *parent = nullptr); MulticamDisplay *GetDisplayWidget() const { return display_; } void SetMulticamNode(ViewerOutput *viewer, MultiCamNode *n, ClipBlock *clip, const rational &time); protected: virtual void ConnectNodeEvent(ViewerOutput *n) override; virtual void DisconnectNodeEvent(ViewerOutput *n) override; virtual void TimeChangedEvent(const rational &t) override; signals: void Switched(); private: void SetMulticamNodeInternal(ViewerOutput *viewer, MultiCamNode *n, ClipBlock *clip); void Switch(int source, bool split_clip); ViewerSizer *sizer_; MulticamDisplay *display_; MultiCamNode *node_; ClipBlock *clip_; struct MulticamNodeQueue { rational time; ViewerOutput *viewer; MultiCamNode *node; ClipBlock *clip; }; std::list<MulticamNodeQueue> play_queue_; private slots: void DisplayClicked(const QPoint &p); }; } #endif // MULTICAMWIDGET_H
1,910
C++
.h
53
33.09434
101
0.780568
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,308
multicamdisplay.h
olive-editor_olive/app/widget/multicam/multicamdisplay.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef MULTICAMDISPLAY_H #define MULTICAMDISPLAY_H #include "node/input/multicam/multicamnode.h" #include "widget/viewer/viewerdisplay.h" namespace olive { class MulticamDisplay : public ViewerDisplayWidget { Q_OBJECT public: explicit MulticamDisplay(QWidget *parent = nullptr); void SetMulticamNode(MultiCamNode *n); protected: virtual void OnPaint() override; virtual void OnDestroy() override; virtual TexturePtr LoadCustomTextureFromFrame(const QVariant &v) override; private: static QString GenerateShaderCode(int rows, int cols); MultiCamNode *node_; QVariant shader_; int rows_; int cols_; }; } #endif // MULTICAMDISPLAY_H
1,378
C++
.h
38
33.552632
76
0.787282
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,309
handmovableview.h
olive-editor_olive/app/widget/handmovableview/handmovableview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef HANDMOVABLEVIEW_H #define HANDMOVABLEVIEW_H #include <QGraphicsView> #include <QMenu> #include "tool/tool.h" namespace olive { class HandMovableView : public QGraphicsView { Q_OBJECT public: HandMovableView(QWidget* parent = nullptr); static bool WheelEventIsAZoomEvent(QWheelEvent* event); static qreal GetScrollZoomMultiplier(QWheelEvent* event); virtual void CatchUpScrollEvent(){} protected: virtual void ToolChangedEvent(Tool::Item tool){Q_UNUSED(tool)} bool HandPress(QMouseEvent* event); bool HandMove(QMouseEvent* event); bool HandRelease(QMouseEvent* event); void SetDefaultDragMode(DragMode mode); const DragMode& GetDefaultDragMode() const; virtual void wheelEvent(QWheelEvent* event) override; virtual void ZoomIntoCursorPosition(QWheelEvent* event, double multiplier, const QPointF &cursor_pos); void SetIsTimelineAxes(bool e) { is_timeline_axes_ = e; } private: bool dragging_hand_; DragMode pre_hand_drag_mode_; DragMode default_drag_mode_; QPointF transformed_pos_; bool is_timeline_axes_; private slots: void ApplicationToolChanged(Tool::Item tool); }; } #endif // HANDMOVABLEVIEW_H
1,881
C++
.h
49
35.530612
104
0.787812
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,310
audiomonitor.h
olive-editor_olive/app/widget/audiomonitor/audiomonitor.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef AUDIOMONITORWIDGET_H #define AUDIOMONITORWIDGET_H #include <QFile> #include <QOpenGLWidget> #include <QTimer> #include "audio/audiovisualwaveform.h" #include "common/define.h" #include "render/audiowaveformcache.h" namespace olive { class AudioMonitor : public QOpenGLWidget { Q_OBJECT public: AudioMonitor(QWidget *parent = nullptr); virtual ~AudioMonitor() override; bool IsPlaying() const { return waveform_; } static void StartWaveformOnAll(const AudioWaveformCache *waveform, const rational& start, int playback_speed) { foreach (AudioMonitor *m, instances_) { m->StartWaveform(waveform, start, playback_speed); } } static void StopOnAll() { foreach (AudioMonitor *m, instances_) { m->Stop(); } } static void PushSampleBufferOnAll(const SampleBuffer &d) { foreach (AudioMonitor *m, instances_) { m->PushSampleBuffer(d); } } public slots: void SetParams(const AudioParams& params); void Stop(); void PushSampleBuffer(const SampleBuffer &samples); void StartWaveform(const AudioWaveformCache *waveform, const rational& start, int playback_speed); protected: virtual void paintGL() override; virtual void mousePressEvent(QMouseEvent* event) override; private: void SetUpdateLoop(bool e); void UpdateValuesFromWaveform(QVector<double> &v, qint64 delta_time); void AudioVisualWaveformSampleToInternalValues(const AudioVisualWaveform::Sample &in, QVector<double> &out); void PushValue(const QVector<double>& v); void BytesToSampleSummary(const QByteArray& bytes, QVector<double>& v); QVector<double> GetAverages() const; AudioParams params_; qint64 last_time_; const AudioWaveformCache* waveform_; rational waveform_time_; rational waveform_length_; int playback_speed_; QVector< QVector<double> > values_; QVector<bool> peaked_; QPixmap cached_background_; int cached_channels_; static QVector<AudioMonitor*> instances_; }; } #endif // AUDIOMONITORWIDGET_H
2,730
C++
.h
80
30.8375
111
0.766169
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,311
pixelsampler.h
olive-editor_olive/app/widget/pixelsampler/pixelsampler.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PIXELSAMPLERWIDGET_H #define PIXELSAMPLERWIDGET_H #include <QLabel> #include <QGroupBox> #include <QWidget> #include "widget/colorwheel/colorpreviewbox.h" namespace olive { class PixelSamplerWidget : public QGroupBox { Q_OBJECT public: PixelSamplerWidget(QWidget* parent = nullptr); public slots: void SetValues(const Color& color); private: void UpdateLabelInternal(); Color color_; ColorPreviewBox *box_; QLabel* label_; }; class ManagedPixelSamplerWidget : public QWidget { Q_OBJECT public: ManagedPixelSamplerWidget(QWidget* parent = nullptr); public slots: void SetValues(const Color& reference, const Color& display); private: PixelSamplerWidget* reference_view_; PixelSamplerWidget* display_view_; }; } #endif // PIXELSAMPLERWIDGET_H
1,502
C++
.h
47
29.446809
71
0.788408
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,312
histogram.h
olive-editor_olive/app/widget/scope/histogram/histogram.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef HISTOGRAMSCOPE_H #define HISTOGRAMSCOPE_H #include "widget/scope/scopebase/scopebase.h" namespace olive { class HistogramScope : public ScopeBase { Q_OBJECT public: HistogramScope(QWidget* parent = nullptr); MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(HistogramScope) protected slots: virtual void OnInit() override; virtual void OnDestroy() override; protected: virtual ShaderCode GenerateShaderCode() override; QVariant CreateSecondaryShader(); virtual void DrawScope(TexturePtr managed_tex, QVariant pipeline) override; private: QVariant pipeline_secondary_; TexturePtr texture_row_sums_; }; } #endif // HISTOGRAMSCOPE_H
1,372
C++
.h
37
34.405405
77
0.794989
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,313
scopebase.h
olive-editor_olive/app/widget/scope/scopebase/scopebase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef SCOPEBASE_H #define SCOPEBASE_H #include "codec/frame.h" #include "render/colorprocessor.h" #include "widget/manageddisplay/manageddisplay.h" namespace olive { class ScopeBase : public ManagedDisplayWidget { public: ScopeBase(QWidget* parent = nullptr); MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(ScopeBase) public slots: void SetBuffer(TexturePtr frame); protected slots: virtual void OnInit() override; virtual void OnPaint() override; virtual void OnDestroy() override; protected: virtual void showEvent(QShowEvent* e) override; virtual ShaderCode GenerateShaderCode() = 0; /** * @brief Draw function * * Override this if your sub-class scope needs extra drawing. */ virtual void DrawScope(TexturePtr managed_tex, QVariant pipeline); private: QVariant pipeline_; TexturePtr texture_; TexturePtr managed_tex_; bool managed_tex_up_to_date_; }; } #endif // SCOPEBASE_H
1,644
C++
.h
48
31.416667
71
0.77799
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,314
waveform.h
olive-editor_olive/app/widget/scope/waveform/waveform.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef WAVEFORMSCOPE_H #define WAVEFORMSCOPE_H #include "widget/scope/scopebase/scopebase.h" namespace olive { class WaveformScope : public ScopeBase { Q_OBJECT public: WaveformScope(QWidget* parent = nullptr); MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(WaveformScope) protected: virtual ShaderCode GenerateShaderCode() override; virtual void DrawScope(TexturePtr managed_tex, QVariant pipeline) override; }; } #endif // WAVEFORMSCOPE_H
1,166
C++
.h
30
36.233333
77
0.793042
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,315
bezierwidget.h
olive-editor_olive/app/widget/bezier/bezierwidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef BEZIERWIDGET_H #define BEZIERWIDGET_H #include <olive/core/core.h> #include <QCheckBox> #include <QWidget> #include "widget/slider/floatslider.h" namespace olive { using namespace core; class BezierWidget : public QWidget { Q_OBJECT public: explicit BezierWidget(QWidget *parent = nullptr); Bezier GetValue() const; void SetValue(const Bezier &b); FloatSlider *x_slider() const { return x_slider_; } FloatSlider *y_slider() const { return y_slider_; } FloatSlider *cp1_x_slider() const { return cp1_x_slider_; } FloatSlider *cp1_y_slider() const { return cp1_y_slider_; } FloatSlider *cp2_x_slider() const { return cp2_x_slider_; } FloatSlider *cp2_y_slider() const { return cp2_y_slider_; } signals: void ValueChanged(); private: FloatSlider *x_slider_; FloatSlider *y_slider_; FloatSlider *cp1_x_slider_; FloatSlider *cp1_y_slider_; FloatSlider *cp2_x_slider_; FloatSlider *cp2_y_slider_; }; } #endif // BEZIERWIDGET_H
1,698
C++
.h
47
33.276596
71
0.752158
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,316
keyframeview.h
olive-editor_olive/app/widget/keyframeview/keyframeview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef KEYFRAMEVIEWBASE_H #define KEYFRAMEVIEWBASE_H #include <functional> #include "keyframeviewinputconnection.h" #include "node/keyframe.h" #include "widget/menu/menu.h" #include "widget/timebased/timebasedview.h" #include "widget/timebased/timebasedviewselectionmanager.h" #include "widget/timetarget/timetarget.h" namespace olive { class KeyframeView : public TimeBasedView, public TimeTargetObject { Q_OBJECT public: KeyframeView(QWidget* parent = nullptr); void DeleteSelected(); using ElementConnections = QVector<KeyframeViewInputConnection *>; using InputConnections = QVector<ElementConnections>; using NodeConnections = QMap<QString, InputConnections>; NodeConnections AddKeyframesOfNode(Node* n); InputConnections AddKeyframesOfInput(Node *n, const QString &input); ElementConnections AddKeyframesOfElement(const NodeInput &input); KeyframeViewInputConnection *AddKeyframesOfTrack(const NodeKeyframeTrackReference &ref); void RemoveKeyframesOfTrack(KeyframeViewInputConnection *connection); void SelectAll(); void DeselectAll(); void Clear(); const std::vector<NodeKeyframe*> &GetSelectedKeyframes() const { return selection_manager_.GetSelectedObjects(); } const QVector<KeyframeViewInputConnection*> &GetKeyframeTracks() const { return tracks_; } virtual void SelectionManagerSelectEvent(void *obj) override; virtual void SelectionManagerDeselectEvent(void *obj) override; void SetMaxScroll(int i) { max_scroll_ = i; UpdateSceneRect(); } bool CopySelected(bool cut); bool Paste(std::function<Node *(const QString &)> find_node_function); virtual void CatchUpScrollEvent() override; signals: void Dragged(int current_x, int current_y); void SelectionChanged(); void Released(); protected: virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseMoveEvent(QMouseEvent *event) override; virtual void mouseReleaseEvent(QMouseEvent *event) override; virtual void drawForeground(QPainter *painter, const QRectF &rect) override; virtual void DrawKeyframe(QPainter *painter, NodeKeyframe *key, KeyframeViewInputConnection *track, const QRectF &key_rect); virtual void ScaleChangedEvent(const double& scale) override; virtual void TimeTargetChangedEvent(ViewerOutput *v) override; virtual void TimebaseChangedEvent(const rational &timebase) override; virtual void ContextMenuEvent(Menu &m); virtual bool FirstChanceMousePress(QMouseEvent *event){return false;} virtual void FirstChanceMouseMove(QMouseEvent *event){} virtual void FirstChanceMouseRelease(QMouseEvent *event){} virtual void KeyframeDragStart(QMouseEvent *event){} virtual void KeyframeDragMove(QMouseEvent *event, QString &tip){} virtual void KeyframeDragRelease(QMouseEvent *event, MultiUndoCommand *command){} void SelectKeyframe(NodeKeyframe *key); void DeselectKeyframe(NodeKeyframe *key); bool IsKeyframeSelected(NodeKeyframe *key) const { return selection_manager_.IsSelected(key); } rational GetUnadjustedKeyframeTime(NodeKeyframe *key, const rational &time); rational GetUnadjustedKeyframeTime(NodeKeyframe *key) { return GetUnadjustedKeyframeTime(key, key->time()); } rational GetAdjustedKeyframeTime(NodeKeyframe *key); double GetKeyframeSceneX(NodeKeyframe *key); virtual qreal GetKeyframeSceneY(KeyframeViewInputConnection *track, NodeKeyframe *key); void SetAutoSelectSiblings(bool e) { autoselect_siblings_ = e; } virtual void SceneRectUpdateEvent(QRectF& rect) override; protected slots: void Redraw(); private: rational CalculateNewTimeFromScreen(const rational& old_time, double cursor_diff); QVector<KeyframeViewInputConnection*> tracks_; TimeBasedViewSelectionManager<NodeKeyframe> selection_manager_; bool autoselect_siblings_; int max_scroll_; bool first_chance_mouse_event_; private slots: void ShowContextMenu(); void ShowKeyframePropertiesDialog(); void UpdateRubberBandForScroll(); }; } #endif // KEYFRAMEVIEWBASE_H
4,773
C++
.h
114
38.614035
126
0.802305
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,317
keyframeviewundo.h
olive-editor_olive/app/widget/keyframeview/keyframeviewundo.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef KEYFRAMEVIEWUNDO_H #define KEYFRAMEVIEWUNDO_H #include "node/keyframe.h" #include "undo/undocommand.h" namespace olive { class KeyframeSetTypeCommand : public UndoCommand { public: KeyframeSetTypeCommand(NodeKeyframe* key, NodeKeyframe::Type type); virtual Project* GetRelevantProject() const override; protected: virtual void redo() override; virtual void undo() override; private: NodeKeyframe* key_; NodeKeyframe::Type old_type_; NodeKeyframe::Type new_type_; }; class KeyframeSetBezierControlPoint : public UndoCommand { public: KeyframeSetBezierControlPoint(NodeKeyframe* key, NodeKeyframe::BezierType mode, const QPointF& point); KeyframeSetBezierControlPoint(NodeKeyframe* key, NodeKeyframe::BezierType mode, const QPointF& new_point, const QPointF& old_point); virtual Project* GetRelevantProject() const override; protected: virtual void redo() override; virtual void undo() override; private: NodeKeyframe* key_; NodeKeyframe::BezierType mode_; QPointF old_point_; QPointF new_point_; }; } #endif // KEYFRAMEVIEWUNDO_H
1,800
C++
.h
47
35.574468
134
0.790509
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,318
keyframeviewinputconnection.h
olive-editor_olive/app/widget/keyframeview/keyframeviewinputconnection.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef KEYFRAMEVIEWINPUTCONNECTION_H #define KEYFRAMEVIEWINPUTCONNECTION_H #include <QObject> #include "node/node.h" #include "node/param.h" namespace olive { class KeyframeView; class KeyframeViewInputConnection : public QObject { Q_OBJECT public: KeyframeViewInputConnection(const NodeKeyframeTrackReference &input, KeyframeView *parent); const int &GetKeyframeY() const { return y_; } void SetKeyframeY(int y); enum YBehavior { kSingleRow, kValueIsHeight }; void SetYBehavior(YBehavior e); const QVector<NodeKeyframe*> &GetKeyframes() const { return input_.input().node()->GetKeyframeTracks(input_.input()).at(input_.track()); } const QBrush &GetBrush() const { return brush_; } const NodeKeyframeTrackReference &GetReference() const { return input_; } void SetBrush(const QBrush &brush); signals: void RequireUpdate(); void TypeChanged(); private: KeyframeView *keyframe_view_; NodeKeyframeTrackReference input_; int y_; YBehavior y_behavior_; QBrush brush_; private slots: void AddKeyframe(NodeKeyframe *key); void RemoveKeyframe(NodeKeyframe *key); void KeyframeChanged(NodeKeyframe *key); void KeyframeTypeChanged(NodeKeyframe *key); }; } #endif // KEYFRAMEVIEWINPUTCONNECTION_H
2,010
C++
.h
66
27.318182
93
0.769231
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,319
nodeparamviewwidgetbridge.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewwidgetbridge.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWWIDGETBRIDGE_H #define NODEPARAMVIEWWIDGETBRIDGE_H #include <QObject> #include "node/inputdragger.h" #include "widget/slider/base/numericsliderbase.h" #include "widget/timetarget/timetarget.h" namespace olive { class NodeParamViewScrollBlocker : public QObject { Q_OBJECT public: virtual bool eventFilter(QObject* watched, QEvent* event) override; }; class NodeParamViewWidgetBridge : public QObject, public TimeTargetObject { Q_OBJECT public: NodeParamViewWidgetBridge(NodeInput input, QObject* parent); const QVector<QWidget*>& widgets() const { return widgets_; } // Set the timebase of certain Timebased widgets void SetTimebase(const rational& timebase); signals: void ArrayWidgetDoubleClicked(); void WidgetsRecreated(const NodeInput& input); void RequestEditTextInViewer(); protected: virtual void TimeTargetDisconnectEvent(ViewerOutput *v) override; virtual void TimeTargetConnectEvent(ViewerOutput *v) override; private: void CreateWidgets(); void SetInputValue(const QVariant& value, int track); void SetInputValueInternal(const QVariant& value, int track, MultiUndoCommand *command, bool insert_on_all_tracks_if_no_key); void ProcessSlider(NumericSliderBase* slider, int slider_track, const QVariant& value); void ProcessSlider(NumericSliderBase* slider, const QVariant& value) { ProcessSlider(slider, widgets_.indexOf(slider), value); } void SetProperty(const QString &key, const QVariant &value); template <typename T> void CreateSliders(int count, QWidget *parent); void UpdateWidgetValues(); rational GetCurrentTimeAsNodeTime() const; const NodeInput &GetOuterInput() const { return input_hierarchy_.first(); } const NodeInput &GetInnerInput() const { return input_hierarchy_.last(); } QString GetCommandName() const; NodeValue::Type GetDataType() const { return GetOuterInput().GetDataType(); } void UpdateProperties(); QVector<NodeInput> input_hierarchy_; QVector<QWidget*> widgets_; NodeInputDragger dragger_; NodeParamViewScrollBlocker scroll_filter_; private slots: void WidgetCallback(); void InputValueChanged(const NodeInput& input, const TimeRange& range); void InputDataTypeChanged(const QString& input, NodeValue::Type type); void PropertyChanged(const QString &input, const QString &key, const QVariant &value); }; } #endif // NODEPARAMVIEWWIDGETBRIDGE_H
3,160
C++
.h
85
34.117647
127
0.787409
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,320
nodeparamviewcontext.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewcontext.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWCONTEXT_H #define NODEPARAMVIEWCONTEXT_H #include "nodeparamviewdockarea.h" #include "nodeparamviewitembase.h" #include "nodeparamviewitem.h" namespace olive { class NodeParamViewContext : public NodeParamViewItemBase { Q_OBJECT public: NodeParamViewContext(QWidget *parent = nullptr); NodeParamViewDockArea *GetDockArea() const { return dock_area_; } const QVector<Node*> &GetContexts() const { return contexts_; } const QVector<NodeParamViewItem*> &GetItems() const { return items_; } NodeParamViewItem *GetItem(Node *node, Node *ctx); void AddNode(NodeParamViewItem *item); void RemoveNode(Node *node, Node *ctx); void RemoveNodesWithContext(Node *ctx); void SetInputChecked(const NodeInput &input, bool e); void SetTimebase(const rational &timebase); void SetTimeTarget(ViewerOutput *n); void SetEffectType(Track::Type type); signals: void AboutToDeleteItem(NodeParamViewItem *item); public slots: void AddContext(Node *node) { contexts_.append(node); } void RemoveContext(Node *node) { contexts_.removeOne(node); } protected slots: virtual void Retranslate() override; private: NodeParamViewDockArea *dock_area_; QVector<Node*> contexts_; QVector<NodeParamViewItem*> items_; Track::Type type_; private slots: void AddEffectButtonClicked(); void AddEffectMenuItemTriggered(QAction *a); }; } #endif // NODEPARAMVIEWCONTEXT_H
2,174
C++
.h
69
28.434783
71
0.772683
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,321
nodeparamviewarraywidget.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewarraywidget.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWARRAYWIDGET_H #define NODEPARAMVIEWARRAYWIDGET_H #include <QLabel> #include <QPushButton> #include <QWidget> #include "node/param.h" namespace olive { class NodeParamViewArrayButton : public QPushButton { Q_OBJECT public: enum Type { kAdd, kRemove }; NodeParamViewArrayButton(Type type, QWidget* parent = nullptr); protected: virtual void changeEvent(QEvent* event) override; private: void Retranslate(); Type type_; }; class NodeParamViewArrayWidget : public QWidget { Q_OBJECT public: NodeParamViewArrayWidget(Node* node, const QString& input, QWidget* parent = nullptr); signals: void DoubleClicked(); protected: virtual void mouseDoubleClickEvent(QMouseEvent* event) override; private: Node* node_; QString input_; QLabel* count_lbl_; private slots: void UpdateCounter(const QString &input, int old_size, int new_size); }; } #endif // NODEPARAMVIEWARRAYWIDGET_H
1,656
C++
.h
54
28.055556
88
0.78123
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,322
nodeparamviewconnectedlabel.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewconnectedlabel.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWCONNECTEDLABEL_H #define NODEPARAMVIEWCONNECTEDLABEL_H #include "node/param.h" #include "widget/clickablelabel/clickablelabel.h" #include "widget/nodevaluetree/nodevaluetree.h" namespace olive { class NodeParamViewConnectedLabel : public QWidget { Q_OBJECT public: NodeParamViewConnectedLabel(const NodeInput& input, QWidget* parent = nullptr); void SetViewerNode(ViewerOutput *viewer); signals: void RequestSelectNode(Node *n); private slots: void InputConnected(Node *output, const NodeInput &input); void InputDisconnected(Node *output, const NodeInput &input); void ShowLabelContextMenu(); void ConnectionClicked(); private: void UpdateLabel(); void UpdateValueTree(); void CreateTree(); ClickableLabel* connected_to_lbl_; NodeInput input_; Node *connected_node_; NodeValueTree *value_tree_; ViewerOutput *viewer_; private slots: void SetValueTreeVisible(bool e); }; } #endif // NODEPARAMVIEWCONNECTEDLABEL_H
1,701
C++
.h
46
34.130435
81
0.791155
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,323
nodeparamviewtextedit.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewtextedit.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWTEXTEDIT_H #define NODEPARAMVIEWTEXTEDIT_H #include <QPlainTextEdit> #include <QPushButton> #include <QWidget> #include "common/define.h" namespace olive { class NodeParamViewTextEdit : public QWidget { Q_OBJECT public: NodeParamViewTextEdit(QWidget* parent = nullptr); QString text() const { return line_edit_->toPlainText(); } void SetEditInViewerOnlyMode(bool on); public slots: void setText(const QString &s) { line_edit_->blockSignals(true); line_edit_->setPlainText(s); line_edit_->blockSignals(false); } void setTextPreservingCursor(const QString &s) { // Save cursor position int cursor_pos = line_edit_->textCursor().position(); // Set text this->setText(s); // Get new text cursor QTextCursor c = line_edit_->textCursor(); c.setPosition(cursor_pos); line_edit_->setTextCursor(c); } signals: void textEdited(const QString &); void RequestEditInViewer(); private: QPlainTextEdit* line_edit_; QPushButton* edit_btn_; QPushButton *edit_in_viewer_btn_; private slots: void ShowTextDialog(); void InnerWidgetTextChanged(); }; } #endif // NODEPARAMVIEWTEXTEDIT_H
1,905
C++
.h
62
27.532258
71
0.751238
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,324
nodeparamviewitemtitlebar.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewitemtitlebar.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWITEMTITLEBAR_H #define NODEPARAMVIEWITEMTITLEBAR_H #include <QCheckBox> #include <QLabel> #include <QWidget> #include "widget/collapsebutton/collapsebutton.h" namespace olive { class NodeParamViewItemTitleBar : public QWidget { Q_OBJECT public: NodeParamViewItemTitleBar(QWidget* parent = nullptr); bool IsExpanded() const { return collapse_btn_->isChecked(); } public slots: void SetExpanded(bool e); void SetText(const QString& s) { lbl_->setText(s); lbl_->setToolTip(s); lbl_->setMinimumWidth(1); } void SetPinButtonVisible(bool e) { pin_btn_->setVisible(e); } void SetAddEffectButtonVisible(bool e) { add_fx_btn_->setVisible(e); } void SetEnabledCheckBoxVisible(bool e) { enabled_checkbox_->setVisible(e); } void SetEnabledCheckBoxChecked(bool e) { enabled_checkbox_->setChecked(e); } signals: void ExpandedStateChanged(bool e); void PinToggled(bool e); void AddEffectButtonClicked(); void EnabledCheckBoxClicked(bool e); void Clicked(); protected: virtual void paintEvent(QPaintEvent *event) override; virtual void mousePressEvent(QMouseEvent *event) override; virtual void mouseDoubleClickEvent(QMouseEvent *event) override; private: bool draw_border_; QLabel* lbl_; CollapseButton* collapse_btn_; QPushButton *pin_btn_; QPushButton *add_fx_btn_; QCheckBox *enabled_checkbox_; }; } #endif // NODEPARAMVIEWITEMTITLEBAR_H
2,188
C++
.h
74
26.418919
71
0.763575
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,325
nodeparamviewitem.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewitem.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWITEM_H #define NODEPARAMVIEWITEM_H #include <QCheckBox> #include <QGridLayout> #include <QLabel> #include <QPushButton> #include <QVBoxLayout> #include <QWidget> #include "node/node.h" #include "nodeparamviewarraywidget.h" #include "nodeparamviewconnectedlabel.h" #include "nodeparamviewkeyframecontrol.h" #include "nodeparamviewitembase.h" #include "nodeparamviewwidgetbridge.h" #include "widget/clickablelabel/clickablelabel.h" #include "widget/collapsebutton/collapsebutton.h" #include "widget/keyframeview/keyframeview.h" namespace olive { enum NodeParamViewCheckBoxBehavior { kNoCheckBoxes, kCheckBoxesOn, kCheckBoxesOnNonConnected }; class NodeParamViewItemBody : public QWidget { Q_OBJECT public: NodeParamViewItemBody(Node* node, NodeParamViewCheckBoxBehavior create_checkboxes, QWidget* parent = nullptr); void SetTimeTarget(ViewerOutput *target); void Retranslate(); int GetElementY(NodeInput c) const; // Set the timebase of any timebased widgets contained here void SetTimebase(const rational& timebase); void SetInputChecked(const NodeInput &input, bool e); signals: void RequestSelectNode(Node *node); void ArrayExpandedChanged(bool e); void InputCheckedChanged(const NodeInput &input, bool e); void RequestEditTextInViewer(); private: void CreateWidgets(QGridLayout *layout, Node* node, const QString& input, int element, int row_index); void UpdateUIForEdgeConnection(const NodeInput &input); void PlaceWidgetsFromBridge(QGridLayout *layout, NodeParamViewWidgetBridge* bridge, int row); void InputArraySizeChangedInternal(Node *node, const QString &input, int size); struct InputUI { InputUI(); QLabel* main_label; NodeParamViewWidgetBridge* widget_bridge; NodeParamViewConnectedLabel* connected_label; NodeParamViewKeyframeControl* key_control; QGridLayout* layout; int row; QPushButton *extra_btn; QCheckBox *optional_checkbox; NodeParamViewArrayButton* array_insert_btn; NodeParamViewArrayButton* array_remove_btn; }; QHash<NodeInput, InputUI> input_ui_map_; struct ArrayUI { QWidget* widget; int count; NodeParamViewArrayButton* append_btn; }; void SetTimeTargetOnInputUI(const InputUI &ui); void SetTimebaseOnInputUI(const InputUI &ui); Node *node_; QHash<NodeInputPair, ArrayUI> array_ui_; QHash<NodeInputPair, CollapseButton*> array_collapse_buttons_; rational timebase_; ViewerOutput *time_target_; NodeParamViewCheckBoxBehavior create_checkboxes_; QHash<NodeInputPair, NodeInputPair> input_group_lookup_; /** * @brief The column to place the keyframe controls in * * Serves as an effective "maximum column" index because the keyframe button is always aligned * to the right edge. */ static const int kKeyControlColumn; static const int kArrayInsertColumn; static const int kArrayRemoveColumn; static const int kExtraButtonColumn; static const int kOptionalCheckBox; static const int kArrayCollapseBtnColumn; static const int kLabelColumn; static const int kWidgetStartColumn; static const int kMaxWidgetColumn; private slots: void EdgeChanged(Node *output, const NodeInput &input); void ArrayCollapseBtnPressed(bool checked); void InputArraySizeChanged(const QString &input, int old_sz, int size); void ArrayAppendClicked(); void ArrayInsertClicked(); void ArrayRemoveClicked(); void ToggleArrayExpanded(); void ReplaceWidgets(const NodeInput& input); void ShowSpeedDurationDialogForNode(); void OptionalCheckBoxClicked(bool e); }; class NodeParamViewItem : public NodeParamViewItemBase { Q_OBJECT public: NodeParamViewItem(Node* node, NodeParamViewCheckBoxBehavior create_checkboxes, QWidget* parent = nullptr); void SetTimeTarget(ViewerOutput* target) { time_target_ = target; body_->SetTimeTarget(target); } void SetTimebase(const rational& timebase) { timebase_ = timebase; body_->SetTimebase(timebase); } Node *GetContext() const { return ctx_; } void SetContext(Node *ctx) { ctx_ = ctx; } Node* GetNode() const { return node_; } int GetElementY(const NodeInput& c) const; void SetInputChecked(const NodeInput &input, bool e); KeyframeView::NodeConnections &GetKeyframeConnections() { return keyframe_connections_; } void SetKeyframeConnections(const KeyframeView::NodeConnections &c) { keyframe_connections_ = c; } signals: void RequestSelectNode(Node *node); void ArrayExpandedChanged(bool e); void InputCheckedChanged(const NodeInput &input, bool e); void RequestEditTextInViewer(); void InputArraySizeChanged(const QString &input, int old_size, int new_size); protected slots: virtual void Retranslate() override; private: NodeParamViewItemBody* body_; Node* node_; NodeParamViewCheckBoxBehavior create_checkboxes_; Node *ctx_; ViewerOutput *time_target_; rational timebase_; KeyframeView::NodeConnections keyframe_connections_; private slots: void RecreateBody(); }; } #endif // NODEPARAMVIEWITEM_H
5,832
C++
.h
170
30.982353
112
0.785561
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,326
nodeparamviewkeyframecontrol.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewkeyframecontrol.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWKEYFRAMECONTROL_H #define NODEPARAMVIEWKEYFRAMECONTROL_H #include <QPushButton> #include <QWidget> #include "node/param.h" #include "widget/timetarget/timetarget.h" namespace olive { class NodeParamViewKeyframeControl : public QWidget, public TimeTargetObject { Q_OBJECT public: NodeParamViewKeyframeControl(bool right_align, QWidget* parent = nullptr); NodeParamViewKeyframeControl(QWidget* parent = nullptr) : NodeParamViewKeyframeControl(true, parent) { } const NodeInput& GetConnectedInput() const { return input_; } void SetInput(const NodeInput& input); protected: virtual void TimeTargetDisconnectEvent(ViewerOutput *v) override; virtual void TimeTargetConnectEvent(ViewerOutput *v) override; private: QPushButton* CreateNewToolButton(const QIcon &icon) const; void SetButtonsEnabled(bool e); rational GetCurrentTimeAsNodeTime() const; rational ConvertToViewerTime(const rational& r) const; QPushButton* prev_key_btn_; QPushButton* toggle_key_btn_; QPushButton* next_key_btn_; QPushButton* enable_key_btn_; NodeInput input_; private slots: void ShowButtonsFromKeyframeEnable(bool e); void ToggleKeyframe(bool e); void UpdateState(); void GoToPreviousKey(); void GoToNextKey(); void KeyframeEnableBtnClicked(bool e); void KeyframeEnableChanged(const NodeInput& input, bool e); }; } #endif // NODEPARAMVIEWKEYFRAMECONTROL_H
2,147
C++
.h
59
33.440678
76
0.793103
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,327
nodeparamviewitembase.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewitembase.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWITEMBASE_H #define NODEPARAMVIEWITEMBASE_H #include <QDockWidget> #include "nodeparamviewitemtitlebar.h" #include "node/node.h" namespace olive { class NodeParamViewItemBase : public QDockWidget { Q_OBJECT public: NodeParamViewItemBase(QWidget* parent = nullptr); void SetHighlighted(bool e) { highlighted_ = e; update(); } bool IsHighlighted() const { return highlighted_; } bool IsExpanded() const; static QString GetTitleBarTextFromNode(Node *n); public slots: void SetExpanded(bool e); void ToggleExpanded() { SetExpanded(!IsExpanded()); } signals: void PinToggled(bool e); void ExpandedChanged(bool e); void Moved(); void Clicked(); protected: void SetBody(QWidget *body); virtual void paintEvent(QPaintEvent *event) override; NodeParamViewItemTitleBar* title_bar() const { return title_bar_; } virtual void changeEvent(QEvent *e) override; virtual void moveEvent(QMoveEvent *event) override; virtual void mousePressEvent(QMouseEvent *e) override; protected slots: virtual void Retranslate(){} private: NodeParamViewItemTitleBar* title_bar_; QWidget *body_; QWidget *hidden_body_; bool highlighted_; }; } #endif // NODEPARAMVIEWITEMBASE_H
1,980
C++
.h
64
27.859375
71
0.769803
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,328
nodeparamviewdockarea.h
olive-editor_olive/app/widget/nodeparamview/nodeparamviewdockarea.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEWDOCKAREA_H #define NODEPARAMVIEWDOCKAREA_H #include <QMainWindow> namespace olive { // This may look weird, but QMainWindow is just a QWidget with a fancy layout that allows // for docking QDockWidgets class NodeParamViewDockArea : public QMainWindow { Q_OBJECT public: explicit NodeParamViewDockArea(QWidget *parent = nullptr); virtual QMenu *createPopupMenu() override; void AddItem(QDockWidget *item); }; } #endif // NODEPARAMVIEWDOCKAREA_H
1,193
C++
.h
30
37.233333
89
0.789382
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,329
nodeparamview.h
olive-editor_olive/app/widget/nodeparamview/nodeparamview.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODEPARAMVIEW_H #define NODEPARAMVIEW_H #include <QVBoxLayout> #include <QWidget> #include "node/group/group.h" #include "node/node.h" #include "node/project/serializer/serializer.h" #include "nodeparamviewcontext.h" #include "nodeparamviewdockarea.h" #include "nodeparamviewitem.h" #include "widget/keyframeview/keyframeview.h" #include "widget/timebased/timebasedwidget.h" namespace olive { class NodeParamView : public TimeBasedWidget { Q_OBJECT public: NodeParamView(bool create_keyframe_view, QWidget* parent = nullptr); NodeParamView(QWidget* parent = nullptr) : NodeParamView(true, parent) { } virtual ~NodeParamView() override; void CloseContextsBelongingToProject(Project *p); void DeleteSelected(); void SelectAll() { keyframe_view_->SelectAll(); } void DeselectAll() { keyframe_view_->DeselectAll(); } void SetSelectedNodes(const QVector<NodeParamViewItem *> &nodes, bool handle_focused_node = true, bool emit_signal = true); void SetSelectedNodes(const QVector<Node::ContextPair> &nodes, bool emit_signal = true); Node *GetNodeWithID(const QString &id); Node *GetNodeWithIDAndIgnoreList(const QString &id, const QVector<Node*> &ignore); const QVector<Node*> &GetContexts() const { return contexts_; } virtual bool CopySelected(bool cut) override; virtual bool Paste() override; static bool Paste(QWidget *parent, std::function<QHash<Node *, Node*>(const ProjectSerializer::Result &)> get_existing_map_function); public slots: void SetContexts(const QVector<Node*> &contexts); void UpdateElementY(); signals: void FocusedNodeChanged(Node* n); void SelectedNodesChanged(const QVector<Node::ContextPair> &nodes); void RequestViewerToStartEditingText(); protected: virtual void resizeEvent(QResizeEvent *event) override; virtual void ScaleChangedEvent(const double &) override; virtual void TimebaseChangedEvent(const rational&) override; virtual void ConnectedNodeChangeEvent(ViewerOutput* n) override; virtual const QVector<KeyframeViewInputConnection*> *GetSnapKeyframes() const override { return keyframe_view_ ? &keyframe_view_->GetKeyframeTracks() : nullptr; } virtual const std::vector<NodeKeyframe*> *GetSnapIgnoreKeyframes() const override { return keyframe_view_ ? &keyframe_view_->GetSelectedKeyframes() : nullptr; } virtual const TimeTargetObject *GetKeyframeTimeTarget() const override { return keyframe_view_; } private: void QueueKeyframePositionUpdate(); void AddContext(Node *context); void RemoveContext(Node *context); void AddNode(Node* n, Node *ctx, NodeParamViewContext *context); void SortItemsInContext(NodeParamViewContext *context); NodeParamViewContext *GetContextItemFromContext(Node *context); bool IsGroupMode() const { return contexts_.size() == 1 && dynamic_cast<NodeGroup*>(contexts_.first()); } void ToggleSelect(NodeParamViewItem *item); QHash<Node *, Node *> GenerateExistingPasteMap(const ProjectSerializer::Result &r); KeyframeView* keyframe_view_; QVector<NodeParamViewContext*> context_items_; QScrollBar* vertical_scrollbar_; int last_scroll_val_; QScrollArea* param_scroll_area_; QWidget* param_widget_container_; NodeParamViewDockArea* param_widget_area_; QVector<Node*> pinned_nodes_; QVector<Node*> active_nodes_; NodeParamViewItem* focused_node_; QVector<NodeParamViewItem*> selected_nodes_; QVector<Node*> contexts_; QVector<Node*> current_contexts_; bool show_all_nodes_; private slots: void UpdateGlobalScrollBar(); void PinNode(bool pin); //void FocusChanged(QWidget *old, QWidget *now); void NodeAddedToContext(Node *n); void NodeRemovedFromContext(Node *n); void InputCheckBoxChanged(const NodeInput &input, bool e); void GroupInputPassthroughAdded(olive::NodeGroup *group, const olive::NodeInput &input); void GroupInputPassthroughRemoved(olive::NodeGroup *group, const olive::NodeInput &input); void UpdateContexts(); void ItemAboutToBeRemoved(NodeParamViewItem *item); void ItemClicked(); void SelectNodeFromConnectedLink(Node *node); void RequestEditTextInViewer(); void InputArraySizeChanged(const QString &input, int old_size, int new_size); }; } #endif // NODEPARAMVIEW_H
5,016
C++
.h
127
36.23622
135
0.777386
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,330
columnedgridlayout.h
olive-editor_olive/app/widget/columnedgridlayout/columnedgridlayout.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef COLUMNEDGRIDLAYOUT_H #define COLUMNEDGRIDLAYOUT_H #include <QGridLayout> #include "common/define.h" namespace olive { /** * @brief The ColumnedGridLayout class * * A simple derivative of QGridLayout that provides a automatic row/column layout based on a specified maximum * column count. */ class ColumnedGridLayout : public QGridLayout { Q_OBJECT public: ColumnedGridLayout(QWidget* parent = nullptr, int maximum_columns = 0); void Add(QWidget* widget); int MaximumColumns() const; void SetMaximumColumns(int maximum_columns); private: int maximum_columns_; }; } #endif // COLUMNEDGRIDLAYOUT_H
1,361
C++
.h
39
31.948718
110
0.769113
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,331
playbackcontrols.h
olive-editor_olive/app/widget/playbackcontrols/playbackcontrols.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef PLAYBACKCONTROLS_H #define PLAYBACKCONTROLS_H #include <QWidget> #include <QLabel> #include <QPushButton> #include <QStackedWidget> #include "dragbutton.h" #include "widget/slider/rationalslider.h" namespace olive { /** * @brief A playback controls widget providing buttons for navigating media * * This widget optionally features timecode displays for the current timecode and end timecode. */ class PlaybackControls : public QWidget { Q_OBJECT public: PlaybackControls(QWidget* parent = nullptr); /** * @brief Set whether the timecodes should be shown or not */ void SetTimecodeEnabled(bool enabled); void SetTimebase(const rational& r); void SetAudioVideoDragButtonsVisible(bool e); public slots: void SetTime(const rational &r); void SetEndTime(const rational &r); void ShowPauseButton(); void ShowPlayButton(); void StartPlayBlink() { play_blink_timer_->start(); SetButtonRecordingState(play_btn_, true); } void StopPlayBlink() { play_blink_timer_->stop(); SetButtonRecordingState(play_btn_, false); } void SetPauseButtonRecordingState(bool on) { SetButtonRecordingState(pause_btn_, on); } signals: /** * @brief Signal emitted when "Go to Start" is clicked */ void BeginClicked(); /** * @brief Signal emitted when "Previous Frame" is clicked */ void PrevFrameClicked(); /** * @brief Signal emitted when "Play" is clicked */ void PlayClicked(); /** * @brief Signal emitted when "Pause" is clicked */ void PauseClicked(); /** * @brief Signal emitted when "Next Frame" is clicked */ void NextFrameClicked(); /** * @brief Signal emitted when "Go to End" is clicked */ void EndClicked(); void AudioClicked(); void VideoClicked(); void AudioDragged(); void VideoDragged(); void TimeChanged(const rational& t); protected: virtual void changeEvent(QEvent *) override; private: void UpdateIcons(); static void SetButtonRecordingState(QPushButton *btn, bool on); QWidget* lower_left_container_; QWidget* lower_right_container_; RationalSlider* cur_tc_lbl_; QLabel* end_tc_lbl_; rational end_time_; rational time_base_; QPushButton* go_to_start_btn_; QPushButton* prev_frame_btn_; QPushButton* play_btn_; QPushButton* pause_btn_; QPushButton* next_frame_btn_; QPushButton* go_to_end_btn_; DragButton* video_drag_btn_; DragButton* audio_drag_btn_; QStackedWidget* playpause_stack_; QTimer *play_blink_timer_; private slots: void TimecodeChanged(); void PlayBlink(); }; } #endif // PLAYBACKCONTROLS_H
3,333
C++
.h
115
25.808696
95
0.741803
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,332
dragbutton.h
olive-editor_olive/app/widget/playbackcontrols/dragbutton.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2023 Olive Studios LLC 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 3 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/>. ***/ #ifndef DRAGBUTTON_H #define DRAGBUTTON_H #include <QPushButton> #include "common/define.h" namespace olive { class DragButton : public QPushButton { Q_OBJECT public: DragButton(QWidget* parent = nullptr); signals: void DragStarted(); protected: virtual void mousePressEvent(QMouseEvent* event) override; virtual void mouseMoveEvent(QMouseEvent* event) override; virtual void mouseReleaseEvent(QMouseEvent* event) override; private: bool dragging_; }; } #endif // DRAGBUTTON_H
1,222
C++
.h
35
32.314286
71
0.785287
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,334
nodecombobox.h
olive-editor_olive/app/widget/nodecombobox/nodecombobox.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef NODECOMBOBOX_H #define NODECOMBOBOX_H #include <QComboBox> #include "node/node.h" namespace olive { class NodeComboBox : public QComboBox { Q_OBJECT public: NodeComboBox(QWidget* parent = nullptr); virtual void showPopup() override; const QString& GetSelectedNode() const; public slots: void SetNode(const QString& id); protected: virtual void changeEvent(QEvent *e) override; signals: void NodeChanged(const QString& id); private: void UpdateText(); void SetNodeInternal(const QString& id, bool emit_signal); QString selected_id_; }; } #endif // FOOTAGECOMBOBOX_H
1,320
C++
.h
39
31.179487
71
0.776984
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
19,335
exportcodec.h
olive-editor_olive/app/codec/exportcodec.h
/*** Olive - Non-Linear Video Editor Copyright (C) 2022 Olive Team 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 3 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/>. ***/ #ifndef EXPORTCODEC_H #define EXPORTCODEC_H #include <QObject> #include <QString> #include "common/define.h" #include "render/subtitleparams.h" namespace olive { class ExportCodec : public QObject { Q_OBJECT public: // Only append to this list (never insert) because indexes are used in serialized files enum Codec { kCodecDNxHD, kCodecH264, kCodecH264rgb, kCodecH265, kCodecOpenEXR, kCodecPNG, kCodecProRes, kCodecCineform, kCodecTIFF, kCodecVP9, kCodecMP2, kCodecMP3, kCodecAAC, kCodecPCM, kCodecOpus, kCodecVorbis, kCodecFLAC, kCodecSRT, kCodecAV1, kCodecCount }; static QString GetCodecName(Codec c); static bool IsCodecAStillImage(Codec c); static bool IsCodecLossless(Codec c); }; } #endif // EXPORTCODEC_H
1,530
C++
.h
54
24.833333
89
0.754626
olive-editor/olive
8,144
552
131
GPL-3.0
9/20/2024, 9:26:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false