diff --git a/icons/dirup-disabled.png b/icons/dirup-disabled.png
new file mode 100644
index 000000000..f23fa3f68
Binary files /dev/null and b/icons/dirup-disabled.png differ
diff --git a/icons/dirup.png b/icons/dirup.png
new file mode 100644
index 000000000..f67b44672
Binary files /dev/null and b/icons/dirup.png differ
diff --git a/icons/icons.qrc b/icons/icons.qrc
index 711fdcdc0..ac37d6339 100644
--- a/icons/icons.qrc
+++ b/icons/icons.qrc
@@ -49,5 +49,7 @@
transition-tool.png
transition-tool-disabled.png
error.png
+ dirup.png
+ dirup-disabled.png
diff --git a/io/config.cpp b/io/config.cpp
index bd0882f68..2ecb744ba 100644
--- a/io/config.cpp
+++ b/io/config.cpp
@@ -32,7 +32,8 @@ Config::Config()
autoscroll(AUTOSCROLL_PAGE_SCROLL),
audio_rate(48000),
fast_seeking(false),
- hover_focus(false)
+ hover_focus(false),
+ project_view_type(PROJECT_VIEW_TREE)
{}
void Config::load(QString path) {
@@ -115,6 +116,9 @@ void Config::load(QString path) {
} else if (stream.name() == "HoverFocus") {
stream.readNext();
hover_focus = (stream.text() == "1");
+ } else if (stream.name() == "ProjectViewType") {
+ stream.readNext();
+ project_view_type = stream.text().toInt();
}
}
}
@@ -163,6 +167,7 @@ void Config::save(QString path) {
stream.writeTextElement("AudioRate", QString::number(audio_rate));
stream.writeTextElement("FastSeeking", QString::number(fast_seeking));
stream.writeTextElement("HoverFocus", QString::number(hover_focus));
+ stream.writeTextElement("ProjectViewType", QString::number(project_view_type));
stream.writeEndElement(); // configuration
stream.writeEndDocument(); // doc
diff --git a/io/config.h b/io/config.h
index 4092204ff..4972c9dd3 100644
--- a/io/config.h
+++ b/io/config.h
@@ -18,6 +18,9 @@
#define AUTOSCROLL_PAGE_SCROLL 1
#define AUTOSCROLL_SMOOTH_SCROLL 2
+#define PROJECT_VIEW_TREE 0
+#define PROJECT_VIEW_ICON 1
+
struct Config {
Config();
bool saved_layout;
@@ -44,6 +47,7 @@ struct Config {
int audio_rate;
bool fast_seeking;
bool hover_focus;
+ int project_view_type;
void load(QString path);
void save(QString path);
diff --git a/io/exportthread.cpp b/io/exportthread.cpp
index 52e6e6999..5715ce9f0 100644
--- a/io/exportthread.cpp
+++ b/io/exportthread.cpp
@@ -97,8 +97,8 @@ bool ExportThread::setupVideo() {
}
// allocate context
- vcodec_ctx = video_stream->codec;
-// vcodec_ctx = avcodec_alloc_context3(vcodec);
+// vcodec_ctx = video_stream->codec;
+ vcodec_ctx = avcodec_alloc_context3(vcodec);
if (!vcodec_ctx) {
dout << "[ERROR] Could not allocate video encoding context";
ed->export_error = "could not allocate video encoding context";
@@ -125,7 +125,7 @@ bool ExportThread::setupVideo() {
itoa(vcodec_ctx, buffer, 10);*/
//av_opt_set(vcodec_ctx->priv_data, "preset", "fast", AV_OPT_SEARCH_CHILDREN);
- av_opt_set(vcodec_ctx->priv_data, "x264opts", "opencl", AV_OPT_SEARCH_CHILDREN);
+ //av_opt_set(vcodec_ctx->priv_data, "x264opts", "opencl", AV_OPT_SEARCH_CHILDREN);
switch (video_compression_type) {
case COMPRESSION_TYPE_CFR:
@@ -203,8 +203,8 @@ bool ExportThread::setupAudio() {
}
// allocate context
- acodec_ctx = audio_stream->codec;
-// acodec_ctx = avcodec_alloc_context3(acodec);
+// acodec_ctx = audio_stream->codec;
+ acodec_ctx = avcodec_alloc_context3(acodec);
if (!acodec_ctx) {
dout << "[ERROR] Could not find allocate audio encoding context";
ed->export_error = "could not allocate audio encoding context";
@@ -448,14 +448,14 @@ void ExportThread::run() {
avcodec_close(vcodec_ctx);
av_packet_unref(&video_pkt);
av_frame_free(&video_frame);
-// avcodec_free_context(&vcodec_ctx);
+ avcodec_free_context(&vcodec_ctx);
}
if (audio_enabled) {
avcodec_close(acodec_ctx);
av_packet_unref(&audio_pkt);
av_frame_free(&audio_frame);
-// avcodec_free_context(&acodec_ctx);
+ avcodec_free_context(&acodec_ctx);
}
avformat_free_context(fmt_ctx);
diff --git a/io/previewgenerator.cpp b/io/previewgenerator.cpp
index 696c7987a..bb24f3cbd 100644
--- a/io/previewgenerator.cpp
+++ b/io/previewgenerator.cpp
@@ -128,6 +128,7 @@ bool PreviewGenerator::retrieve_preview(const QString& hash) {
QFile f(thumb_path);
if (f.exists() && ms->video_preview.load(thumb_path)) {
//dout << "loaded thumb" << ms->file_index << "from" << thumb_path;
+ ms->make_square_thumb();
ms->preview_done = true;
} else {
found = false;
@@ -255,7 +256,7 @@ void PreviewGenerator::generate_waveform() {
if (!s->preview_done) {
int dstH = 120;
int dstW = dstH * ((float)temp_frame->width/(float)temp_frame->height);
- uint8_t* data = new uint8_t[dstW*dstH*3];
+ uint8_t* data = new uint8_t[dstW*dstH*4];
sws_ctx = sws_getContext(
temp_frame->width,
@@ -263,7 +264,7 @@ void PreviewGenerator::generate_waveform() {
static_cast(temp_frame->format),
dstW,
dstH,
- static_cast(AV_PIX_FMT_RGB24),
+ static_cast(AV_PIX_FMT_RGBA),
SWS_FAST_BILINEAR,
NULL,
NULL,
@@ -271,10 +272,11 @@ void PreviewGenerator::generate_waveform() {
);
int linesize[AV_NUM_DATA_POINTERS];
- linesize[0] = dstW*3;
+ linesize[0] = dstW*4;
sws_scale(sws_ctx, temp_frame->data, temp_frame->linesize, 0, temp_frame->height, &data, linesize);
- s->video_preview = QImage(data, dstW, dstH, linesize[0], QImage::Format_RGB888);
+ s->video_preview = QImage(data, dstW, dstH, linesize[0], QImage::Format_RGBA8888);
+ s->make_square_thumb();
// is video interlaced?
s->video_auto_interlacing = (temp_frame->interlaced_frame) ? ((temp_frame->top_field_first) ? VIDEO_TOP_FIELD_FIRST : VIDEO_BOTTOM_FIELD_FIRST) : VIDEO_PROGRESSIVE;
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 404a6dc9b..adc24850e 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -130,15 +130,6 @@ MainWindow::MainWindow(QWidget *parent) :
layout()->invalidate();
- // TODO maybe replace these with non-pointers later on?
- panel_sequence_viewer = new Viewer(this);
- panel_footage_viewer = new Viewer(this);
- panel_project = new Project(this);
- panel_effect_controls = new EffectControls(this);
- panel_timeline = new Timeline(this);
-
- setup_layout(false);
-
connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowMenu_About_To_Be_Shown()));
connect(ui->menu_View, SIGNAL(aboutToShow()), this, SLOT(viewMenu_About_To_Be_Shown()));
connect(ui->menu_Tools, SIGNAL(aboutToShow()), this, SLOT(toolMenu_About_To_Be_Shown()));
@@ -215,6 +206,15 @@ MainWindow::MainWindow(QWidget *parent) :
}
}
+ // TODO maybe replace these with non-pointers later on?
+ panel_sequence_viewer = new Viewer(this);
+ panel_footage_viewer = new Viewer(this);
+ panel_project = new Project(this);
+ panel_effect_controls = new EffectControls(this);
+ panel_timeline = new Timeline(this);
+
+ setup_layout(false);
+
init_audio();
connect(ui->action_Undo, SIGNAL(triggered(bool)), this, SLOT(undo()));
@@ -439,7 +439,7 @@ void MainWindow::new_project() {
panel_project->new_project();
updateTitle("");
update_ui(false);
- panel_project->source_table->update();
+ panel_project->tree_view->update();
}
}
diff --git a/mainwindow.ui b/mainwindow.ui
index 61cc110c8..6533a2453 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -33,7 +33,7 @@
0
0
653
- 25
+ 16