minor improvements

This commit is contained in:
itsmattkc
2018-09-22 21:58:16 +10:00
parent b1c3f44b04
commit d6c8f3844f
33 changed files with 563 additions and 300 deletions
+7 -2
View File
@@ -21,7 +21,8 @@ Config::Config()
timecode_view(TIMECODE_DROP),
show_title_safe_area(false),
use_custom_title_safe_ratio(false),
custom_title_safe_ratio(1)
custom_title_safe_ratio(1),
enable_drag_files_to_timeline(false)
{
}
@@ -76,7 +77,10 @@ void Config::load(QString path) {
} else if (stream.name() == "CustomTitleSafeRatio") {
stream.readNext();
custom_title_safe_ratio = stream.text().toDouble();
}
} else if (stream.name() == "EnableDragFilesToTimeline") {
stream.readNext();
enable_drag_files_to_timeline = (stream.text() == "1");;
}
}
}
if (stream.hasError()) {
@@ -136,6 +140,7 @@ void Config::save(QString path) {
stream.writeTextElement("ShowTitleSafeArea", QString::number(show_title_safe_area));
stream.writeTextElement("UseCustomTitleSafeRatio", QString::number(use_custom_title_safe_ratio));
stream.writeTextElement("CustomTitleSafeRatio", QString::number(custom_title_safe_ratio));
stream.writeTextElement("EnableDragFilesToTimeline", QString::number(enable_drag_files_to_timeline));
stream.writeEndElement();
stream.writeEndDocument(); // doc
+1
View File
@@ -25,6 +25,7 @@ struct Config {
bool show_title_safe_area;
bool use_custom_title_safe_ratio;
double custom_title_safe_ratio;
bool enable_drag_files_to_timeline;
void load(QString path);
void save(QString path);
+4 -4
View File
@@ -345,10 +345,10 @@ void ExportThread::run() {
long file_audio_samples = 0;
while (panel_timeline->playhead < end_frame && continueEncode) {
while (sequence->playhead < end_frame && continueEncode) {
panel_viewer->viewer_widget->paintGL();
double timecode_secs = (double) (panel_timeline->playhead-start_frame) / sequence->frame_rate;
double timecode_secs = (double) (sequence->playhead-start_frame) / sequence->frame_rate;
if (video_enabled) {
// get image from opengl
glReadPixels(0, 0, video_frame->linesize[0]/4, sequence->height, GL_RGBA, GL_UNSIGNED_BYTE, video_frame->data[0]);
@@ -387,8 +387,8 @@ void ExportThread::run() {
file_audio_samples += swr_frame->nb_samples;
}
}
emit progress_changed(((double) (panel_timeline->playhead-start_frame) / (double) (end_frame-start_frame)) * 100);
panel_timeline->playhead++;
emit progress_changed(((double) (sequence->playhead-start_frame) / (double) (end_frame-start_frame)) * 100);
sequence->playhead++;
}
panel_viewer->viewer_widget->default_fbo = NULL;
+1 -1
View File
@@ -55,7 +55,7 @@ void PreviewGenerator::parse_media() {
ms->video_frame_rate = 0;
} else {
ms->infinite_length = false;
ms->video_frame_rate = av_q2d(fmt_ctx->streams[i]->avg_frame_rate);
ms->video_frame_rate = av_q2d(fmt_ctx->streams[i]->avg_frame_rate)*0.5;
}
ms->video_width = fmt_ctx->streams[i]->codecpar->width;
ms->video_height = fmt_ctx->streams[i]->codecpar->height;