@@ -10,6 +10,7 @@
|
||||
#include "panels/timeline.h"
|
||||
#include "project/sequence.h"
|
||||
#include "project/effect.h"
|
||||
#include "effects/transition.h"
|
||||
#include "io/previewgenerator.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
@@ -467,6 +468,12 @@ void Project::load_project() {
|
||||
} else if (stream.name() == "track") {
|
||||
stream.readNext();
|
||||
temp_clip->track = stream.text().toInt();
|
||||
} else if (stream.name() == "opening") {
|
||||
stream.readNext();
|
||||
temp_clip->opening_transition = create_transition(stream.text().toInt(), temp_clip);
|
||||
} else if (stream.name() == "closing") {
|
||||
stream.readNext();
|
||||
temp_clip->closing_transition = create_transition(stream.text().toInt(), temp_clip);
|
||||
} else if (stream.name() == "color") {
|
||||
for (int j=0;j<stream.attributes().size();j++) {
|
||||
const QXmlStreamAttribute& attr = stream.attributes().at(j);
|
||||
@@ -585,6 +592,12 @@ void Project::save_project() {
|
||||
stream.writeTextElement("in", QString::number(c->timeline_in));
|
||||
stream.writeTextElement("out", QString::number(c->timeline_out));
|
||||
stream.writeTextElement("track", QString::number(c->track));
|
||||
if (c->opening_transition != NULL) {
|
||||
stream.writeTextElement("opening", QString::number(c->opening_transition->id));
|
||||
}
|
||||
if (c->closing_transition != NULL) {
|
||||
stream.writeTextElement("closing", QString::number(c->closing_transition->id));
|
||||
}
|
||||
stream.writeStartElement("color");
|
||||
stream.writeAttribute("r", QString::number(c->color_r));
|
||||
stream.writeAttribute("g", QString::number(c->color_g));
|
||||
|
||||
+30
-8
@@ -12,6 +12,7 @@
|
||||
#include "panels/viewer.h"
|
||||
#include "playback/cacher.h"
|
||||
#include "playback/playback.h"
|
||||
#include "effects/transition.h"
|
||||
#include "ui_viewer.h"
|
||||
|
||||
#include <QTime>
|
||||
@@ -126,6 +127,7 @@ void Timeline::reset_all_audio() {
|
||||
c->audio_buffer_write = 0;
|
||||
}
|
||||
}
|
||||
ui->audio_monitor->reset();
|
||||
clear_audio_ibuffer();
|
||||
}
|
||||
|
||||
@@ -173,6 +175,21 @@ int Timeline::get_track_height_size(bool video) {
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::add_transition() {
|
||||
for (int i=0;i<sequence->clip_count();i++) {
|
||||
Clip* c = sequence->get_clip(i);
|
||||
if (c != NULL && is_clip_selected(c)) {
|
||||
if (c->opening_transition == NULL) {
|
||||
c->opening_transition = create_transition(0, c);
|
||||
}
|
||||
if (c->closing_transition == NULL) {
|
||||
c->closing_transition = create_transition(0, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
redraw_all_clips(true);
|
||||
}
|
||||
|
||||
int Timeline::calculate_track_height(int track, int value) {
|
||||
int index = (track < 0) ? qAbs(track + 1) : track;
|
||||
QVector<int>& vector = (track < 0) ? video_track_heights : audio_track_heights;
|
||||
@@ -242,6 +259,7 @@ void Timeline::repaint_timeline() {
|
||||
ui->audio_area->update();
|
||||
if (last_frame != playhead) {
|
||||
panel_viewer->viewer_widget->update();
|
||||
ui->audio_monitor->update();
|
||||
last_frame = playhead;
|
||||
}
|
||||
panel_viewer->update_playhead_timecode();
|
||||
@@ -343,20 +361,24 @@ void Timeline::set_zoom(bool in) {
|
||||
}
|
||||
|
||||
void Timeline::ripple(long ripple_point, long ripple_length) {
|
||||
// ripple all clips around the ripple_point
|
||||
for (int i=0;i<sequence->clip_count();i++) {
|
||||
Clip* c = sequence->get_clip(i);
|
||||
if (c != NULL && c->timeline_in >= ripple_point) {
|
||||
c->timeline_in += ripple_length;
|
||||
c->timeline_out += ripple_length;
|
||||
}
|
||||
}
|
||||
for (int i=0;i<selections.size();i++) {
|
||||
Selection& s = selections[i];
|
||||
if (s.in >= ripple_point) {
|
||||
s.in += ripple_length;
|
||||
s.out += ripple_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ripple the selections
|
||||
for (int i=0;i<selections.size();i++) {
|
||||
Selection& s = selections[i];
|
||||
// only ripple the selection if it's within range of the ripple point
|
||||
if (s.old_in >= ripple_point) {
|
||||
s.in += ripple_length;
|
||||
s.out += ripple_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::decheck_tool_buttons(QObject* sender) {
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
void update_sequence();
|
||||
void increase_track_height();
|
||||
void decrease_track_height();
|
||||
void add_transition();
|
||||
|
||||
int get_snap_range();
|
||||
int getScreenPointFromFrame(long frame);
|
||||
|
||||
+17
-1
@@ -330,7 +330,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>458</width>
|
||||
<width>408</width>
|
||||
<height>314</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -396,6 +396,16 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="AudioMonitor" name="audio_monitor" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -412,6 +422,12 @@
|
||||
<header>ui/timelineheader.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AudioMonitor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ui/audiomonitor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons/icons.qrc"/>
|
||||
|
||||
Reference in New Issue
Block a user