precision audio playback

This commit is contained in:
itsmattkc
2018-11-11 13:00:03 +11:00
parent 39fe0f726b
commit 5850f8bb59
13 changed files with 125 additions and 19 deletions
+37
View File
@@ -16,6 +16,9 @@
#include <QMessageBox>
#include <QFileInfo>
#include <QDebug>
#include <QDesktopServices>
#include <QDir>
#include <QProcess>
SourceTable::SourceTable(QWidget* parent) : QTreeWidget(parent) {
editing_item = NULL;
@@ -29,6 +32,8 @@ SourceTable::SourceTable(QWidget* parent) : QTreeWidget(parent) {
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(show_context_menu()));
}
void SourceTable::show_context_menu() {
QMenu menu(this);
@@ -45,6 +50,15 @@ void SourceTable::show_context_menu() {
if (type == MEDIA_TYPE_FOOTAGE) {
QAction* replace_action = menu.addAction("Replace/Relink Media");
connect(replace_action, SIGNAL(triggered(bool)), panel_project, SLOT(replace_selected_file()));
#if defined(Q_OS_WIN)
QAction* reveal_in_explorer = menu.addAction("Reveal in Explorer");
#elif defined(Q_OS_MAC)
QAction* reveal_in_explorer = menu.addAction("Reveal in Finder");
#else
QAction* reveal_in_explorer = menu.addAction("Reveal in File Manager");
#endif
connect(reveal_in_explorer, SIGNAL(triggered(bool)), this, SLOT(reveal_in_browser()));
}
if (type != MEDIA_TYPE_FOLDER) {
QAction* replace_clip_media = menu.addAction("Replace Clips Using This Media");
@@ -114,6 +128,29 @@ void SourceTable::create_seq_from_selected() {
}
}
void SourceTable::reveal_in_browser() {
Media* m = get_footage_from_tree(selectedItems().at(0));
#if defined(Q_OS_WIN)
QStringList args;
args << "/select," << QDir::toNativeSeparators(m->url);
QProcess::startDetached("explorer", args);
#elif defined(Q_OS_MAC)
QStringList args;
args << "-e";
args << "tell application \"Finder\"";
args << "-e";
args << "activate";
args << "-e";
args << "select POSIX file \""+m->url+"\"";
args << "-e";
args << "end tell";
QProcess::startDetached("osascript", args);
#else
QDesktopServices::openUrl(QUrl::fromLocalFile(m->url.left(m->url.lastIndexOf('/'))));
#endif
}
void SourceTable::item_renamed(QTreeWidgetItem* item) {
if (editing_item == item) {
MediaRename* mr = new MediaRename();
+1
View File
@@ -29,6 +29,7 @@ private slots:
void item_renamed(QTreeWidgetItem *item);
void show_context_menu();
void create_seq_from_selected();
void reveal_in_browser();
};
#endif // SOURCETABLE_H
+4 -1
View File
@@ -6,10 +6,10 @@
#include "project/undo.h"
#include "panels/viewer.h"
#include "io/config.h"
#include "debug.h"
#include <QPainter>
#include <QMouseEvent>
#include <QDebug>
#include <QScrollArea>
#include <QtMath>
@@ -82,6 +82,9 @@ void TimelineHeader::set_out_point(long new_out) {
} else if (new_in > new_out) {
new_in = 0;
}
dout << new_in << new_out;
undo_stack.push(new SetTimelineInOutCommand(viewer->seq, true, new_in, new_out));
update_parents();
}
+1 -1
View File
@@ -1488,7 +1488,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos) {
} else {
s.out = s.old_out + frame_diff;
}
} else {
} else if (clips_are_movable) {
for (int i=0;i<sequence->selections.size();i++) {
Selection& s = sequence->selections[i];
s.in = s.old_in + frame_diff;
+7
View File
@@ -235,6 +235,8 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
}
}
int audio_track_count = 0;
QVector<Clip*> current_clips;
for (int i=0;i<s->clips.size();i++) {
@@ -258,6 +260,7 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
open_clip(c, !rendering);
}
clip_is_active = true;
if (c->track >= 0) audio_track_count++;
} else if (c->open) {
close_clip(c);
}
@@ -486,6 +489,10 @@ GLuint ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio)
}
}
if (audio_track_count == 0) {
viewer->play_wake();
}
glPopMatrix();
if (!nests.isEmpty() && nests.last()->fbo != NULL) {