For context, this is part of my custom workflow, and I’m adding this into an action in src/docks/timelinedock.cpp.
I’m opening an image like this (not sure if there is a better way):
QString path = "/tmp/test.ping"
QList<QUrl> urls{path};
MainWindow *mainWin = qobject_cast<MainWindow *>(window());
mainWin->openMultiple(urls);
Then I add it to the timeline like this:
this->overwrite(currentTrack(), -1, QString(), false);
This works, and it gets added to the timeline like I expect, but the clip starts playing automatically. Am I supposed to be calling the pause function right after adding the clip? If not, what am I doing wrong that is causing it to play? Is it because of the empty string instead of XML?
brian
April 19, 2025, 1:36pm
2
cipherpunk:
openMultiple
The auto play is being caused by the openMultiple call. You could try the open() function instead and set “play = false”.
QDateTime m_sourceUpdatedAt;
MarkersDock *m_markersDock;
NotesDock *m_notesDock;
SubtitlesDock *m_subtitlesDock;
std::unique_ptr<QWidget> m_producerWidget;
FilesDock *m_filesDock;
public slots:
bool isCompatibleWithGpuMode(MltXmlChecker &checker);
bool isXmlRepaired(MltXmlChecker &checker, QString &fileName);
bool open(QString url,
const Mlt::Properties * = nullptr,
bool play = true,
bool skipConvert = false);
void openMultiple(const QStringList &paths);
void openMultiple(const QList<QUrl> &urls);
void openVideo();
void openCut(Mlt::Producer *producer, bool play = false);
void hideProducer();
void closeProducer();
void showStatusMessage(QAction *action, int timeoutSeconds = 5);
1 Like