basic #56 support added
This commit is contained in:
+2
-2
@@ -84,7 +84,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
setup_layout();
|
||||
|
||||
connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(on_windowMenu_About_To_Be_Shown()));
|
||||
connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowMenu_About_To_Be_Shown()));
|
||||
|
||||
QString data_dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
if (!data_dir.isEmpty()) {
|
||||
@@ -446,7 +446,7 @@ void MainWindow::on_actionDecrease_Track_Height_triggered()
|
||||
panel_timeline->decrease_track_height();
|
||||
}
|
||||
|
||||
void MainWindow::on_windowMenu_About_To_Be_Shown() {
|
||||
void MainWindow::windowMenu_About_To_Be_Shown() {
|
||||
ui->actionProject_2->setChecked(panel_project->isVisible());
|
||||
ui->actionEffect_Controls->setChecked(panel_effect_controls->isVisible());
|
||||
ui->actionTimeline->setChecked(panel_timeline->isVisible());
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ private slots:
|
||||
|
||||
void on_actionDecrease_Track_Height_triggered();
|
||||
|
||||
void on_windowMenu_About_To_Be_Shown();
|
||||
void windowMenu_About_To_Be_Shown();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.6.2, 2018-06-23T14:26:22. -->
|
||||
<!-- Written by QtCreator 4.6.2, 2018-06-24T07:08:29. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
+66
-28
@@ -16,16 +16,8 @@ EffectControls::EffectControls(QWidget *parent) :
|
||||
ui(new Ui::EffectControls)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
init_effects();
|
||||
|
||||
clip = NULL;
|
||||
set_clip(NULL);
|
||||
}
|
||||
|
||||
void EffectControls::menu_select(QAction* q) {
|
||||
clip->effects.append(create_effect(q->data().toInt(), clip));
|
||||
set_clip(clip);
|
||||
init_effects();
|
||||
clear_effects();
|
||||
}
|
||||
|
||||
EffectControls::~EffectControls()
|
||||
@@ -33,11 +25,22 @@ EffectControls::~EffectControls()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void EffectControls::on_pushButton_clicked()
|
||||
{
|
||||
void EffectControls::menu_select(QAction* q) {
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
Clip* clip = selected_clips.at(i);
|
||||
if ((clip->track < 0 && video_menu) || (clip->track >= 0 && !video_menu)) {
|
||||
clip->effects.append(create_effect(q->data().toInt(), clip));
|
||||
}
|
||||
}
|
||||
reload_clips();
|
||||
}
|
||||
|
||||
void EffectControls::show_menu(bool video) {
|
||||
video_menu = video;
|
||||
|
||||
int lim;
|
||||
QVector<QString>* effect_names;
|
||||
if (clip->track < 0) {
|
||||
if (video) {
|
||||
lim = VIDEO_EFFECT_COUNT;
|
||||
effect_names = &video_effect_names;
|
||||
} else {
|
||||
@@ -59,19 +62,54 @@ void EffectControls::on_pushButton_clicked()
|
||||
effects_menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void EffectControls::set_clip(Clip* c) {
|
||||
// clear ui->scrollAreaWidgetContents
|
||||
if (clip != NULL) {
|
||||
for (int i=0;i<clip->effects.size();i++) {
|
||||
clip->effects.at(i)->container->setParent(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
ui->pushButton->setEnabled(c != NULL);
|
||||
if (c != NULL) {
|
||||
for (int i=0;i<c->effects.size();i++) {
|
||||
static_cast<QVBoxLayout*>(ui->scrollAreaWidgetContents->layout())->insertWidget(i, c->effects.at(i)->container);
|
||||
}
|
||||
}
|
||||
clip = c;
|
||||
void EffectControls::clear_effects() {
|
||||
// clear existing clips
|
||||
QVBoxLayout* video_layout = static_cast<QVBoxLayout*>(ui->video_effect_area->layout());
|
||||
QVBoxLayout* audio_layout = static_cast<QVBoxLayout*>(ui->audio_effect_area->layout());
|
||||
QLayoutItem* item;
|
||||
while ((item = video_layout->takeAt(0))) {item->widget()->setParent(NULL);}
|
||||
while ((item = audio_layout->takeAt(0))) {item->widget()->setParent(NULL);}
|
||||
ui->vcontainer->setVisible(false);
|
||||
ui->acontainer->setVisible(false);
|
||||
}
|
||||
|
||||
void EffectControls::load_effects() {
|
||||
// load in new clips
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
Clip* c = selected_clips.at(i);
|
||||
for (int j=0;j<c->effects.size();j++) {
|
||||
CollapsibleWidget* container = c->effects.at(j)->container;
|
||||
if (c->track < 0) {
|
||||
static_cast<QVBoxLayout*>(ui->video_effect_area->layout())->addWidget(container);
|
||||
ui->vcontainer->setVisible(true);
|
||||
} else {
|
||||
static_cast<QVBoxLayout*>(ui->audio_effect_area->layout())->addWidget(container);
|
||||
ui->acontainer->setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffectControls::reload_clips() {
|
||||
// clear_effects();
|
||||
load_effects();
|
||||
}
|
||||
|
||||
void EffectControls::set_clips(QVector<Clip*>& clips) {
|
||||
clear_effects();
|
||||
|
||||
// replace clip vector
|
||||
selected_clips = clips;
|
||||
|
||||
load_effects();
|
||||
}
|
||||
|
||||
void EffectControls::on_add_video_effect_button_clicked()
|
||||
{
|
||||
show_menu(true);
|
||||
}
|
||||
|
||||
void EffectControls::on_add_audio_effect_button_clicked()
|
||||
{
|
||||
show_menu(false);
|
||||
}
|
||||
|
||||
+12
-3
@@ -17,15 +17,24 @@ class EffectControls : public QDockWidget
|
||||
public:
|
||||
explicit EffectControls(QWidget *parent = 0);
|
||||
~EffectControls();
|
||||
void set_clip(Clip* c);
|
||||
// void set_clip(Clip* c);
|
||||
void set_clips(QVector<Clip*>& clips);
|
||||
void clear_effects();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
void menu_select(QAction* q);
|
||||
|
||||
void on_add_video_effect_button_clicked();
|
||||
|
||||
void on_add_audio_effect_button_clicked();
|
||||
|
||||
private:
|
||||
Ui::EffectControls *ui;
|
||||
Clip* clip;
|
||||
QVector<Clip*> selected_clips;
|
||||
void show_menu(bool video);
|
||||
void load_effects();
|
||||
void reload_clips();
|
||||
bool video_menu;
|
||||
};
|
||||
|
||||
#endif // EFFECTCONTROLS_H
|
||||
|
||||
+158
-11
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>621</width>
|
||||
<height>510</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -49,11 +49,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>398</width>
|
||||
<height>253</height>
|
||||
<width>619</width>
|
||||
<height>482</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -66,6 +69,157 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="vcontainer" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">padding: 5px;
|
||||
background: rgba(0, 0, 0, 0.25);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>VIDEO EFFECTS</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="video_effect_area" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_video_effect_button">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>[+] Add Video Effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="acontainer" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">padding: 5px;
|
||||
background: rgba(0, 0, 0, 0.25);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AUDIO EFFECTS</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="audio_effect_area" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_audio_effect_button">
|
||||
<property name="text">
|
||||
<string>[+] Add Audio Effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
@@ -83,13 +237,6 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>[+] Add Effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
+2
-2
@@ -274,7 +274,7 @@ void Timeline::select_all() {
|
||||
|
||||
void Timeline::delete_selection(bool ripple_delete) {
|
||||
if (selections.size() > 0) {
|
||||
panel_effect_controls->set_clip(NULL);
|
||||
panel_effect_controls->clear_effects();
|
||||
|
||||
long ripple_point = selections.at(0).in;
|
||||
long ripple_length = selections.at(0).out - selections.at(0).in;
|
||||
@@ -471,7 +471,7 @@ void Timeline::split_clip_and_relink(Clip* pre_clip, long frame, bool relink) {
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::delete_areas_and_relink(QVector<Selection> areas) {
|
||||
void Timeline::delete_areas_and_relink(QVector<Selection>& areas) {
|
||||
QVector<Clip*> pre_clips;
|
||||
QVector<Clip*> post_clips;
|
||||
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public:
|
||||
bool split_selection();
|
||||
void split_at_playhead();
|
||||
void split_clip_and_relink(Clip* clip, long frame, bool relink);
|
||||
void delete_areas_and_relink(QVector<Selection> areas);
|
||||
void delete_areas_and_relink(QVector<Selection>& areas);
|
||||
void update_sequence();
|
||||
void increase_track_height();
|
||||
void decrease_track_height();
|
||||
|
||||
+39
-14
@@ -259,6 +259,8 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
c->timeline_out = g.out;
|
||||
c->track = g.track;
|
||||
|
||||
delete_areas.append({g.in, g.out, g.track});
|
||||
|
||||
copy_clips.append(c);
|
||||
}
|
||||
panel_timeline->delete_areas_and_relink(delete_areas);
|
||||
@@ -342,27 +344,50 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
|
||||
// panel_timeline->repaint_timeline();
|
||||
|
||||
// SEND CLIPS TO EFFECT CONTROLS
|
||||
// find out how many clips are selected
|
||||
bool single_select = false;
|
||||
int selected_clip = 0;
|
||||
bool got_vclip = false;
|
||||
bool got_aclip = false;
|
||||
Clip* vclip = NULL;
|
||||
Clip* aclip = NULL;
|
||||
for (int i=0;i<sequence->clip_count();i++) {
|
||||
if (panel_timeline->is_clip_selected(sequence->get_clip(i))) {
|
||||
if (!single_select) {
|
||||
// found ONE selected clip
|
||||
selected_clip = i;
|
||||
single_select = true;
|
||||
Clip* clip = sequence->get_clip(i);
|
||||
if (panel_timeline->is_clip_selected(clip)) {
|
||||
if (clip->track < 0) {
|
||||
if (got_vclip) {
|
||||
vclip = NULL;
|
||||
} else {
|
||||
vclip = clip;
|
||||
got_vclip = true;
|
||||
}
|
||||
} else {
|
||||
// more than one clip is selected
|
||||
single_select = false;
|
||||
break;
|
||||
if (got_aclip) {
|
||||
aclip = NULL;
|
||||
} else {
|
||||
aclip = clip;
|
||||
got_aclip = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (single_select) {
|
||||
panel_effect_controls->set_clip(sequence->get_clip(selected_clip));
|
||||
} else {
|
||||
panel_effect_controls->set_clip(NULL);
|
||||
// check if aclip is linked to vclip
|
||||
QVector<Clip*> selected_clips;
|
||||
if (vclip != NULL) selected_clips.append(vclip);
|
||||
if (aclip != NULL) selected_clips.append(aclip);
|
||||
if (vclip != NULL && aclip != NULL) {
|
||||
bool found = false;
|
||||
for (int i=0;i<vclip->linked.size();i++) {
|
||||
if (vclip->linked.at(i) == aclip) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
// only display multiple clips if they're linked
|
||||
selected_clips.clear();
|
||||
}
|
||||
}
|
||||
panel_effect_controls->set_clips(selected_clips);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user