goMenu->clear();
double fps = m_document->fps();
for (int i = 0; i < m_guides.count(); i++) {
- act = goMenu->addAction(m_guides.at(i)->label() + "/" + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
+ act = goMenu->addAction(m_guides.at(i)->label() + '/' + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
act->setData(m_guides.at(i)->position().frames(m_document->fps()));
}
goMenu->setEnabled(!m_guides.isEmpty());
{
CommentedTime marker(GenTime(m_cursorPos, m_document->fps()), i18n("Guide"));
if (dialog) {
- MarkerDialog d(NULL, marker, m_document->timecode(), i18n("Add Guide"), this);
- if (d.exec() != QDialog::Accepted) return;
- marker = d.newMarker();
-
+ QPointer<MarkerDialog> d = new MarkerDialog(NULL, marker,
+ m_document->timecode(), i18n("Add Guide"), this);
+ if (d->exec() != QDialog::Accepted) {
+ delete d;
+ return;
+ }
+ marker = d->newMarker();
+ delete d;
} else {
marker.setComment(m_document->timecode().getDisplayTimecodeFromFrames(m_cursorPos, false));
}
void CustomTrackView::slotEditGuide(CommentedTime guide)
{
- MarkerDialog d(NULL, guide, m_document->timecode(), i18n("Edit Guide"), this);
- if (d.exec() == QDialog::Accepted) {
- EditGuideCommand *command = new EditGuideCommand(this, guide.time(), guide.comment(), d.newMarker().time(), d.newMarker().comment(), true);
+ QPointer<MarkerDialog> d = new MarkerDialog(NULL, guide, m_document->timecode(), i18n("Edit Guide"), this);
+ if (d->exec() == QDialog::Accepted) {
+ EditGuideCommand *command = new EditGuideCommand(this, guide.time(), guide.comment(), d->newMarker().time(), d->newMarker().comment(), true);
m_commandStack->push(command);
}
+ delete d;
}
{
if (m_dragGuide == NULL) return;
CommentedTime guide = m_dragGuide->info();
- MarkerDialog d(NULL, guide, m_document->timecode(), i18n("Edit Guide"), this);
- if (d.exec() == QDialog::Accepted) {
- EditGuideCommand *command = new EditGuideCommand(this, guide.time(), guide.comment(), d.newMarker().time(), d.newMarker().comment(), true);
+ QPointer<MarkerDialog> d = new MarkerDialog(NULL, guide,
+ m_document->timecode(), i18n("Edit Guide"), this);
+ if (d->exec() == QDialog::Accepted) {
+ EditGuideCommand *command = new EditGuideCommand(this, guide.time(), guide.comment(), d->newMarker().time(), d->newMarker().comment(), true);
m_commandStack->push(command);
}
+ delete d;
}
void CustomTrackView::slotDeleteGuide(int guidePos)
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
QString def = e.attribute("default");
// Effect has a keyframe type parameter, we need to adjust the values
- QStringList keys = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
+ QStringList keys = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
QStringList newKeyFrames;
foreach(const QString &str, keys) {
int pos = str.section(':', 0, 0).toInt();
void CustomTrackView::slotInsertTrack(int ix)
{
- TrackDialog d(m_document, parentWidget());
- d.comboTracks->setCurrentIndex(ix);
- d.label->setText(i18n("Insert track"));
- d.setWindowTitle(i18n("Insert New Track"));
+ QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget());
+ d->comboTracks->setCurrentIndex(ix);
+ d->label->setText(i18n("Insert track"));
+ d->setWindowTitle(i18n("Insert New Track"));
- if (d.exec() == QDialog::Accepted) {
- ix = d.comboTracks->currentIndex();
- if (d.before_select->currentIndex() == 1)
+ if (d->exec() == QDialog::Accepted) {
+ ix = d->comboTracks->currentIndex();
+ if (d->before_select->currentIndex() == 1)
ix++;
TrackInfo info;
info.duration = 0;
info.isMute = false;
info.isLocked = false;
info.effectsList = EffectsList(true);
- if (d.video_track->isChecked()) {
+ if (d->video_track->isChecked()) {
info.type = VIDEOTRACK;
info.isBlind = false;
} else {
m_commandStack->push(addTrack);
setDocumentModified();
}
+ delete d;
}
void CustomTrackView::slotDeleteTrack(int ix)
{
if (m_document->tracksCount() < 2) return;
- TrackDialog d(m_document, parentWidget());
- d.comboTracks->setCurrentIndex(ix);
- d.label->setText(i18n("Delete track"));
- d.before_select->setHidden(true);
- d.setWindowTitle(i18n("Delete Track"));
- d.video_track->setHidden(true);
- d.audio_track->setHidden(true);
- if (d.exec() == QDialog::Accepted) {
- ix = d.comboTracks->currentIndex();
+ QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget());
+ d->comboTracks->setCurrentIndex(ix);
+ d->label->setText(i18n("Delete track"));
+ d->before_select->setHidden(true);
+ d->setWindowTitle(i18n("Delete Track"));
+ d->video_track->setHidden(true);
+ d->audio_track->setHidden(true);
+ if (d->exec() == QDialog::Accepted) {
+ ix = d->comboTracks->currentIndex();
TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - ix - 1);
deleteTimelineTrack(ix, info);
setDocumentModified();
/*AddTrackCommand* command = new AddTrackCommand(this, ix, info, false);
m_commandStack->push(command);*/
}
+ delete d;
}
void CustomTrackView::slotConfigTracks(int ix)
{
- TracksConfigDialog d(m_document, ix, parentWidget());
- if (d.exec() == QDialog::Accepted) {
- ConfigTracksCommand *configTracks = new ConfigTracksCommand(this, m_document->tracksList(), d.tracksList());
+ QPointer<TracksConfigDialog> d = new TracksConfigDialog(m_document,
+ ix, parentWidget());
+ if (d->exec() == QDialog::Accepted) {
+ ConfigTracksCommand *configTracks = new ConfigTracksCommand(this, m_document->tracksList(), d->tracksList());
m_commandStack->push(configTracks);
- QList <int> toDelete = d.deletedTracks();
+ QList <int> toDelete = d->deletedTracks();
for (int i = 0; i < toDelete.count(); ++i) {
TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - toDelete.at(i) + i - 1);
deleteTimelineTrack(toDelete.at(i) - i, info);
}
setDocumentModified();
}
+ delete d;
}
void CustomTrackView::deleteTimelineTrack(int ix, TrackInfo trackinfo)
parameters.addParam("_sync_in_out", "1");
}
if (e.attribute("type") == "simplekeyframe") {
- QStringList values = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
+ QStringList values = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
double factor = e.attribute("factor", "1").toDouble();
double offset = e.attribute("offset", "0").toDouble();
for (int j = 0; j < values.count(); j++) {
QString pos = values.at(j).section(':', 0, 0);
double val = (values.at(j).section(':', 1, 1).toDouble() - offset) / factor;
- values[j] = pos + "=" + locale.toString(val);
+ values[j] = pos + '=' + locale.toString(val);
}
// kDebug() << "/ / / /SENDING KEYFR:" << values;
parameters.addParam(paramname, values.join(";"));