added seeking to import (#113)
This commit is contained in:
+7
-2
@@ -23,9 +23,10 @@ Config::Config()
|
||||
show_title_safe_area(false),
|
||||
use_custom_title_safe_ratio(false),
|
||||
custom_title_safe_ratio(1),
|
||||
enable_drag_files_to_timeline(false),
|
||||
enable_drag_files_to_timeline(true),
|
||||
autoscale_by_default(false),
|
||||
recording_mode(2)
|
||||
recording_mode(2),
|
||||
enable_seek_to_import(false)
|
||||
{}
|
||||
|
||||
void Config::load(QString path) {
|
||||
@@ -87,6 +88,9 @@ void Config::load(QString path) {
|
||||
} else if (stream.name() == "RecordingMode") {
|
||||
stream.readNext();
|
||||
recording_mode = stream.text().toInt();
|
||||
} else if (stream.name() == "EnableSeekToImport") {
|
||||
stream.readNext();
|
||||
enable_seek_to_import = (stream.text() == "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,6 +132,7 @@ void Config::save(QString path) {
|
||||
stream.writeTextElement("EnableDragFilesToTimeline", QString::number(enable_drag_files_to_timeline));
|
||||
stream.writeTextElement("AutoscaleByDefault", QString::number(autoscale_by_default));
|
||||
stream.writeTextElement("RecordingMode", QString::number(recording_mode));
|
||||
stream.writeTextElement("EnableSeekToImport", QString::number(enable_seek_to_import));
|
||||
|
||||
stream.writeEndElement(); // configuration
|
||||
stream.writeEndDocument(); // doc
|
||||
|
||||
@@ -32,6 +32,7 @@ struct Config {
|
||||
bool enable_drag_files_to_timeline;
|
||||
bool autoscale_by_default;
|
||||
int recording_mode;
|
||||
bool enable_seek_to_import;
|
||||
|
||||
void load(QString path);
|
||||
void save(QString path);
|
||||
|
||||
@@ -646,6 +646,7 @@ void MainWindow::toolMenu_About_To_Be_Shown() {
|
||||
ui->actionRectified_Waveforms->setChecked(config.rectified_waveforms);
|
||||
ui->actionEnable_Drag_Files_to_Timeline->setChecked(config.enable_drag_files_to_timeline);
|
||||
ui->actionAuto_scale_by_Default->setChecked(config.autoscale_by_default);
|
||||
ui->actionEnable_Seek_to_Import->setChecked(config.enable_seek_to_import);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEdit_Tool_Selects_Links_triggered() {
|
||||
@@ -864,3 +865,7 @@ void MainWindow::on_actionEnable_Disable_Clip_triggered() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEnable_Seek_to_Import_triggered() {
|
||||
config.enable_seek_to_import = !config.enable_seek_to_import;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,8 @@ private slots:
|
||||
|
||||
void on_actionEnable_Disable_Clip_triggered();
|
||||
|
||||
void on_actionEnable_Seek_to_Import_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
void setup_layout();
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
<addaction name="actionRectified_Waveforms"/>
|
||||
<addaction name="actionEnable_Drag_Files_to_Timeline"/>
|
||||
<addaction name="actionAuto_scale_by_Default"/>
|
||||
<addaction name="actionEnable_Seek_to_Import"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionPreferences"/>
|
||||
<addaction name="actionCrash"/>
|
||||
@@ -797,6 +798,14 @@
|
||||
<string>Shift+E</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEnable_Seek_to_Import">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable Seek to Import</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
|
||||
@@ -591,9 +591,12 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
}
|
||||
|
||||
// add clips
|
||||
long earliest_point = LONG_MAX;
|
||||
for (int i=0;i<panel_timeline->ghosts.size();i++) {
|
||||
const Ghost& g = panel_timeline->ghosts.at(i);
|
||||
|
||||
earliest_point = qMin(earliest_point, g.in);
|
||||
|
||||
Clip* c = new Clip(s);
|
||||
c->media = g.media;
|
||||
c->media_type = g.media_type;
|
||||
@@ -665,6 +668,8 @@ void TimelineWidget::dropEvent(QDropEvent* event) {
|
||||
setFocus();
|
||||
|
||||
update_ui(true);
|
||||
|
||||
if (config.enable_seek_to_import) panel_sequence_viewer->seek(earliest_point);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user