wave effect axis, fixed folder bugs, timecode to frame number, drag from footage viewer, track resizing bug
This commit is contained in:
+7
-2
@@ -1060,7 +1060,8 @@ void Project::save_folder(QXmlStreamWriter& stream, QTreeWidgetItem* parent, int
|
||||
int len = root ? ui->treeWidget->topLevelItemCount() : parent->childCount();
|
||||
for (int i=0;i<len;i++) {
|
||||
QTreeWidgetItem* item = root ? ui->treeWidget->topLevelItem(i) : parent->child(i);
|
||||
int item_type = get_type_from_tree(item);
|
||||
int item_type = get_type_from_tree(item);
|
||||
|
||||
if (type == item_type) {
|
||||
if (item_type == MEDIA_TYPE_FOLDER) {
|
||||
if (set_ids_only) {
|
||||
@@ -1078,7 +1079,7 @@ void Project::save_folder(QXmlStreamWriter& stream, QTreeWidgetItem* parent, int
|
||||
}
|
||||
stream.writeEndElement();
|
||||
}
|
||||
save_folder(stream, item, type, set_ids_only);
|
||||
// save_folder(stream, item, type, set_ids_only);
|
||||
} else {
|
||||
int folder = root ? 0 : parent->data(0, Qt::UserRole + 3).toInt();
|
||||
if (type == MEDIA_TYPE_FOOTAGE) {
|
||||
@@ -1202,6 +1203,10 @@ void Project::save_folder(QXmlStreamWriter& stream, QTreeWidgetItem* parent, int
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item_type == MEDIA_TYPE_FOLDER) {
|
||||
save_folder(stream, item, type, set_ids_only);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ extern "C" {
|
||||
#include <QtMath>
|
||||
#include <QAudioOutput>
|
||||
#include <QPainter>
|
||||
#include <QStringList>
|
||||
|
||||
Viewer::Viewer(QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
@@ -87,6 +88,48 @@ void Viewer::reset_all_audio() {
|
||||
clear_audio_ibuffer();
|
||||
}
|
||||
|
||||
long timecode_to_frame(const QString& s, int view, double frame_rate) {
|
||||
QList<QString> list = s.split(QRegExp("[:;]"));
|
||||
|
||||
for (int i=0;i<list.size();i++) {
|
||||
qDebug() << "list" << i << list.at(i);
|
||||
}
|
||||
|
||||
if (view == TIMECODE_FRAMES || list.size() == 1) {
|
||||
return s.toLong();
|
||||
}
|
||||
|
||||
int frRound = qRound(frame_rate);
|
||||
int hours = ((list.size() > 0) ? list.at(0).toInt() : 0) * frRound * 3600;
|
||||
int minutes = ((list.size() > 1) ? list.at(1).toInt() : 0) * frRound * 60;
|
||||
int seconds = ((list.size() > 2) ? list.at(2).toInt() : 0) * frRound;
|
||||
int frames = (list.size() > 3) ? list.at(3).toInt() : 0;
|
||||
|
||||
int f = (frames + seconds + minutes + hours);
|
||||
|
||||
if (view == TIMECODE_DROP && frame_rate_is_droppable(frame_rate)) {
|
||||
// return drop
|
||||
int d;
|
||||
int m;
|
||||
|
||||
int dropFrames = round(frame_rate * .066666); //Number of frames to drop on the minute marks is the nearest integer to 6% of the framerate
|
||||
int framesPer10Minutes = round(frame_rate * 60 * 10); //Number of frames per ten minutes
|
||||
int framesPerMinute = (round(frame_rate)*60)- dropFrames; //Number of frames per minute is the round of the framerate * 60 minus the number of dropped frames
|
||||
|
||||
d = f / framesPer10Minutes;
|
||||
f -= dropFrames*9*d;
|
||||
|
||||
m = f % framesPer10Minutes;
|
||||
|
||||
if (m > dropFrames) {
|
||||
f -= (dropFrames * ((m - dropFrames) / framesPerMinute));
|
||||
}
|
||||
}
|
||||
|
||||
// return non-drop
|
||||
return f;
|
||||
}
|
||||
|
||||
QString frame_to_timecode(long f, int view, double frame_rate) {
|
||||
if (view == TIMECODE_FRAMES) {
|
||||
return QString::number(f);
|
||||
|
||||
@@ -13,6 +13,7 @@ class Viewer;
|
||||
}
|
||||
|
||||
bool frame_rate_is_droppable(float rate);
|
||||
long timecode_to_frame(const QString& s, int view, double frame_rate);
|
||||
QString frame_to_timecode(long f, int view, double frame_rate);
|
||||
|
||||
class Viewer : public QDockWidget
|
||||
|
||||
Reference in New Issue
Block a user