extraParams.insert("projecttreefilter", "1");
QString keyword("%count");
extraParams.insert("resultmessage", i18n("Found %1 scenes.", keyword));
+ if (ui.zone_only->isChecked()) {
+ // We want to create markers
+ extraParams.insert("zoneonly", "1");
+ }
if (ui.add_markers->isChecked()) {
// We want to create markers
extraParams.insert("addmarkers", QString::number(ui.marker_type->currentIndex()));
ProjectItem *item = getItemById(id);
if (!item) continue;
QStringList jobArgs;
+ if (extraParams.contains("zoneonly")) {
+ // Analyse clip zone only, remove in / out and replace with zone
+ preParams.takeFirst();
+ preParams.takeFirst();
+ QPoint zone = item->referencedClip()->zone();
+ jobArgs << QString::number(zone.x()) << QString::number(zone.y());
+ }
jobArgs << preParams;
if (ids.count() == 1) {
jobArgs << consumer + ':' + destination;
}
bool dataProcessed = false;
QString key = filterInfo.value("key");
+ int offset = filterInfo.value("offset").toInt();
QStringList value = results.value(key).split(';', QString::SkipEmptyParts);
kDebug()<<"// RESULT; "<<key<<" = "<<value;
if (filterInfo.contains("resultmessage")) {
int newPos = pos.section("=", 0, 0).toInt();
// Don't use scenes shorter than 1 second
if (newPos - cutPos < 24) continue;
- (void) new AddClipCutCommand(this, id, cutPos, newPos, QString(), true, false, command);
+ (void) new AddClipCutCommand(this, id, cutPos + offset, newPos + offset, QString(), true, false, command);
cutPos = newPos;
}
if (command->childCount() == 0)
int newPos = pos.section("=", 0, 0).toInt();
// Don't use scenes shorter than 1 second
if (newPos - cutPos < 24) continue;
- CommentedTime m(GenTime(newPos, m_fps), QString::number(index), markersType);
+ CommentedTime m(GenTime(newPos + offset, m_fps), QString::number(index), markersType);
markersList << m;
index++;
cutPos = newPos;
return;
}
int in = m_params.takeFirst().toInt();
+ if (in > 0 && !m_extra.contains("offset")) m_extra.insert("offset", QString::number(in));
int out = m_params.takeFirst().toInt();
QString producerParams =m_params.takeFirst();
QString filter = m_params.takeFirst();
}
if (out == -1) {
prod = new Mlt::Producer(*m_profile, m_url.toUtf8().constData());
+ m_length = prod->get_length();
}
else {
Mlt::Producer *tmp = new Mlt::Producer(*m_profile, m_url.toUtf8().constData());
prod = tmp->cut(in, out);
delete tmp;
+ m_length = prod->get_playtime();
}
if (m_extra.contains("producer_profile")) {
m_profile->from_producer(*prod);
Mlt::Playlist playlist;
playlist.append(*prod);
tractor.set_track(playlist, 0);
- m_length = prod->get_length();
m_consumer->connect(tractor);
prod->set_speed(0);
prod->seek(0);
<rect>
<x>0</x>
<y>0</y>
- <width>352</width>
- <height>90</height>
+ <width>282</width>
+ <height>115</height>
</rect>
</property>
<property name="windowTitle">
<string>Scene Cut</string>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="3" column="0" colspan="3">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>218</width>
- <height>2</height>
- </size>
- </property>
- </spacer>
+ <item row="0" column="1" colspan="2">
+ <widget class="QComboBox" name="marker_type"/>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="add_markers">
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2">
- <widget class="QComboBox" name="marker_type"/>
+ <item row="2" column="0" colspan="3">
+ <widget class="QCheckBox" name="zone_only">
+ <property name="text">
+ <string>Analyse only selected zone</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="3">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="cut_scenes">
</property>
</widget>
</item>
+ <item row="3" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<resources/>