Skip to content

Commit

Permalink
fix astyle 3.1 check
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Nov 5, 2024
1 parent 0564aba commit 7fa11cc
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 54 deletions.
9 changes: 6 additions & 3 deletions src/dialogs/transcribeaudiodialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
auto path = QFileDialog::getOpenFileName(this, tr("Find Whisper.cpp"), Settings.whisperExe(),
QString(),
nullptr, Util::getFileDialogOptions());
if (QFileInfo(path).isExecutable()) {
if (QFileInfo(path).isExecutable())
{
Settings.setWhisperExe(path);
updateWhisperStatus();
}
Expand All @@ -212,11 +213,13 @@ TranscribeAudioDialog::TranscribeAudioDialog(const QString &trackName, QWidget *
auto path = QFileDialog::getOpenFileName(this, tr("Find Whisper.cpp"), Settings.whisperModel(),
"*.bin",
nullptr, Util::getFileDialogOptions());
if (QFileInfo(path).exists()) {
if (QFileInfo(path).exists())
{
LOG_INFO() << "Model found" << path;
Settings.setWhisperModel(path);
updateWhisperStatus();
} else {
} else
{
LOG_INFO() << "Model not found" << path;
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/docks/playlistdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,8 +816,8 @@ void PlaylistDock::replaceClipsWithHash(const QString &hash, Mlt::Producer &prod
for (auto &clip : producers) {
Util::applyCustomProperties(producer, clip.parent(), clip.get_in(), clip.get_out());
MAIN.undoStack()->push(
new Playlist::ReplaceCommand(m_model, MLT.XML(&producer),
clip.get_int(kPlaylistIndexProperty) - 1));
new Playlist::ReplaceCommand(m_model, MLT.XML(&producer),
clip.get_int(kPlaylistIndexProperty) - 1));
}
if (n > 1) {
MAIN.undoStack()->endMacro();
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void PlaylistDock::onAppendCutActionTriggered()
if (!MLT.isLiveProducer(&producer)) {
ProxyManager::generateIfNotExists(producer);
MAIN.undoStack()->push(
new Playlist::AppendCommand(m_model, MLT.XML(&producer)));
new Playlist::AppendCommand(m_model, MLT.XML(&producer)));
setPlaylistIndex(&producer, m_model.playlist()->count() - 1);
emit enableUpdate(true);
} else {
Expand Down
86 changes: 43 additions & 43 deletions src/docks/timelinedock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,10 +1557,10 @@ void TimelineDock::addTrackIfNeeded(int trackIndex, Mlt::Producer *srcTrack)
if (srcTrack->get_int(kAudioTrackProperty) || (n > 0
&& m_model.trackList()[n - 1].type == AudioTrackType)) {
MAIN.undoStack()->push(
new Timeline::InsertTrackCommand(m_model, trackIndex, AudioTrackType));
new Timeline::InsertTrackCommand(m_model, trackIndex, AudioTrackType));
} else {
MAIN.undoStack()->push(
new Timeline::InsertTrackCommand(m_model, trackIndex, VideoTrackType));
new Timeline::InsertTrackCommand(m_model, trackIndex, VideoTrackType));
}
}
}
Expand Down Expand Up @@ -1820,8 +1820,8 @@ void TimelineDock::trimClipAtPlayhead(TrimLocation location, bool ripple)

if (location == TrimInPoint) {
MAIN.undoStack()->push(
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex, clipIndex,
m_position - info->start, ripple));
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex, clipIndex,
m_position - info->start, ripple));
if (ripple)
setPosition(info->start);
if (m_updateCommand && m_updateCommand->trackIndex() == trackIndex
Expand All @@ -1831,8 +1831,8 @@ void TimelineDock::trimClipAtPlayhead(TrimLocation location, bool ripple)
emit MAIN.serviceInChanged(m_position - info->start, info->producer);
} else {
MAIN.undoStack()->push(
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex,
info->start + info->frame_count - m_position, ripple));
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex,
info->start + info->frame_count - m_position, ripple));
if (m_updateCommand && m_updateCommand->trackIndex() == trackIndex
&& m_updateCommand->clipIndex() == clipIndex)
m_updateCommand->setPosition(trackIndex, clipIndex, -1);
Expand Down Expand Up @@ -1870,31 +1870,31 @@ void TimelineDock::insertTrack()
if (m_selection.selectedTrack != -1)
setSelection();
MAIN.undoStack()->push(
new Timeline::InsertTrackCommand(m_model, currentTrack()));
new Timeline::InsertTrackCommand(m_model, currentTrack()));
}

void TimelineDock::insertAudioTrack()
{
if (m_selection.selectedTrack != -1)
setSelection();
MAIN.undoStack()->push(
new Timeline::InsertTrackCommand(m_model, currentTrack(), AudioTrackType));
new Timeline::InsertTrackCommand(m_model, currentTrack(), AudioTrackType));
}

void TimelineDock::insertVideoTrack()
{
if (m_selection.selectedTrack != -1)
setSelection();
MAIN.undoStack()->push(
new Timeline::InsertTrackCommand(m_model, currentTrack(), VideoTrackType));
new Timeline::InsertTrackCommand(m_model, currentTrack(), VideoTrackType));
}

void TimelineDock::removeTrack()
{
if (m_model.trackList().size() > 0) {
int trackIndex = currentTrack();
MAIN.undoStack()->push(
new Timeline::RemoveTrackCommand(m_model, trackIndex));
new Timeline::RemoveTrackCommand(m_model, trackIndex));
if (trackIndex >= m_model.trackList().count())
setCurrentTrack(m_model.trackList().count() - 1);
}
Expand Down Expand Up @@ -1983,7 +1983,7 @@ bool TimelineDock::mergeClipWithNext(int trackIndex, int clipIndex, bool dryrun)
return m_model.mergeClipWithNext(trackIndex, clipIndex, true);

MAIN.undoStack()->push(
new Timeline::MergeCommand(m_model, trackIndex, clipIndex));
new Timeline::MergeCommand(m_model, trackIndex, clipIndex));

return true;
}
Expand Down Expand Up @@ -2087,7 +2087,7 @@ int TimelineDock::addAudioTrack()
if (m_selection.selectedTrack != -1)
setSelection();
MAIN.undoStack()->push(
new Timeline::AddTrackCommand(m_model, false));
new Timeline::AddTrackCommand(m_model, false));
return m_model.trackList().size() - 1;
}

Expand All @@ -2096,7 +2096,7 @@ int TimelineDock::addVideoTrack()
if (m_selection.selectedTrack != -1)
setSelection();
MAIN.undoStack()->push(
new Timeline::AddTrackCommand(m_model, true));
new Timeline::AddTrackCommand(m_model, true));
return 0;
}

Expand Down Expand Up @@ -2212,7 +2212,7 @@ void TimelineDock::append(int trackIndex)
clip.set_in_and_out(info.frame_in, info.frame_out);
bool lastClip = mltTrackIndex == tractor.count() - 1 && mltClipIndex == playlist.count() - 1;
MAIN.undoStack()->push(
new Timeline::AppendCommand(m_model, trackIndex, MLT.XML(&clip), false, lastClip));
new Timeline::AppendCommand(m_model, trackIndex, MLT.XML(&clip), false, lastClip));
}
}
}
Expand All @@ -2226,7 +2226,7 @@ void TimelineDock::append(int trackIndex)
}

MAIN.undoStack()->push(
new Timeline::AppendCommand(m_model, trackIndex, xmlToUse));
new Timeline::AppendCommand(m_model, trackIndex, xmlToUse));
}

if (m_position < 0) {
Expand All @@ -2252,30 +2252,30 @@ void TimelineDock::remove(int trackIndex, int clipIndex, bool ignoreTransition)
MAIN.undoStack()->beginMacro(tr("Ripple delete transition"));
auto info = m_model.getClipInfo(trackIndex, clipIndex);
MAIN.undoStack()->push(
new Timeline::RemoveCommand(m_model, m_markersModel, trackIndex, clipIndex));
new Timeline::RemoveCommand(m_model, m_markersModel, trackIndex, clipIndex));
if (clipIndex > 0 && info->producer && info->producer->is_valid()) {
// verify the clip after belongs to transition
Mlt::Tractor transition(*info->producer);
std::unique_ptr<Mlt::Producer> transitionClip(transition.track(1));
auto neighborClip = producerForClip(trackIndex, clipIndex);
if (neighborClip.is_valid() && transitionClip && neighborClip.same_clip(*transitionClip))
MAIN.undoStack()->push(
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex, clipIndex,
-info->frame_count, true));
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex, clipIndex,
-info->frame_count, true));
// verify the clip before belongs to transition
transitionClip.reset(transition.track(0));
neighborClip = producerForClip(trackIndex, clipIndex - 1);
if (neighborClip.is_valid() && transitionClip && neighborClip.same_clip(*transitionClip))
MAIN.undoStack()->push(
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex - 1,
-info->frame_count, true));
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex - 1,
-info->frame_count, true));
}
MAIN.undoStack()->endMacro();
} else {
Mlt::Producer clip = producerForClip(trackIndex, clipIndex);
if (clip.is_valid()) {
MAIN.undoStack()->push(
new Timeline::RemoveCommand(m_model, m_markersModel, trackIndex, clipIndex));
new Timeline::RemoveCommand(m_model, m_markersModel, trackIndex, clipIndex));
}
}
}
Expand Down Expand Up @@ -2303,26 +2303,26 @@ void TimelineDock::lift(int trackIndex, int clipIndex, bool ignoreTransition)
auto duration = info->frame_count;

MAIN.undoStack()->push(
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));

if (clipBefore.is_valid() && clipAfter.is_valid()
&& !clipBefore.is_blank() && !clipAfter.is_blank())
duration /= 2;
if (clipAfter.is_valid() && transitionClip && clipAfter.same_clip(*transitionClip))
MAIN.undoStack()->push(
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex,
clipIndex + (clipBefore.is_blank() ? 0 : 1), -duration, false));
new Timeline::TrimClipInCommand(m_model, m_markersModel, trackIndex,
clipIndex + (clipBefore.is_blank() ? 0 : 1), -duration, false));
// verify the clip before belongs to transition
transitionClip.reset(transition.track(0));
if (duration < info->frame_count)
duration += info->frame_count % 2;
if (clipBefore.is_valid() && transitionClip && clipBefore.same_clip(*transitionClip))
MAIN.undoStack()->push(
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex - 1,
-duration, false));
new Timeline::TrimClipOutCommand(m_model, m_markersModel, trackIndex, clipIndex - 1,
-duration, false));
} else {
MAIN.undoStack()->push(
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
}
MAIN.undoStack()->endMacro();
} else {
Expand All @@ -2331,7 +2331,7 @@ void TimelineDock::lift(int trackIndex, int clipIndex, bool ignoreTransition)
if (clip.is_blank())
return;
MAIN.undoStack()->push(
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
new Timeline::LiftCommand(m_model, trackIndex, clipIndex));
setSelection();
}
}
Expand Down Expand Up @@ -2687,7 +2687,7 @@ void TimelineDock::detachAudio(int trackIndex, int clipIndex)
Mlt::Producer clip(MLT.profile(), "xml-string", MLT.XML(info->producer).toUtf8().constData());
clip.set_in_and_out(info->frame_in, info->frame_out);
MAIN.undoStack()->push(
new Timeline::DetachAudioCommand(*this, trackIndex, clipIndex, info->start, MLT.XML(&clip)));
new Timeline::DetachAudioCommand(*this, trackIndex, clipIndex, info->start, MLT.XML(&clip)));
}
}

Expand Down Expand Up @@ -2748,7 +2748,7 @@ void TimelineDock::replace(int trackIndex, int clipIndex, const QString &xml)
QString xmlToUse = !xml.isEmpty() ? xml
: MLT.XML(MLT.isClip() ? nullptr : MLT.savedProducer());
MAIN.undoStack()->push(
new Timeline::ReplaceCommand(m_model, trackIndex, clipIndex, xmlToUse));
new Timeline::ReplaceCommand(m_model, trackIndex, clipIndex, xmlToUse));
} else if (!MLT.isSeekableClip()) {
emitNonSeekableWarning();
}
Expand Down Expand Up @@ -3003,31 +3003,31 @@ void TimelineDock::onLoopChanged(int start, int end)
void TimelineDock::setTrackName(int trackIndex, const QString &value)
{
MAIN.undoStack()->push(
new Timeline::NameTrackCommand(m_model, trackIndex, value));
new Timeline::NameTrackCommand(m_model, trackIndex, value));
}

void TimelineDock::toggleTrackMute(int trackIndex)
{
MAIN.undoStack()->push(
new Timeline::MuteTrackCommand(m_model, trackIndex));
new Timeline::MuteTrackCommand(m_model, trackIndex));
}

void TimelineDock::toggleTrackHidden(int trackIndex)
{
MAIN.undoStack()->push(
new Timeline::HideTrackCommand(m_model, trackIndex));
new Timeline::HideTrackCommand(m_model, trackIndex));
}

void TimelineDock::setTrackComposite(int trackIndex, bool composite)
{
MAIN.undoStack()->push(
new Timeline::CompositeTrackCommand(m_model, trackIndex, composite));
new Timeline::CompositeTrackCommand(m_model, trackIndex, composite));
}

void TimelineDock::setTrackLock(int trackIndex, bool lock)
{
MAIN.undoStack()->push(
new Timeline::LockTrackCommand(m_model, trackIndex, lock));
new Timeline::LockTrackCommand(m_model, trackIndex, lock));
}

bool TimelineDock::moveClip(int fromTrack, int toTrack, int clipIndex, int position, bool ripple)
Expand Down Expand Up @@ -3317,8 +3317,8 @@ void TimelineDock::insert(int trackIndex, int position, const QString &xml, bool
clip.set_in_and_out(info.frame_in, info.frame_out);
bool lastClip = mltTrackIndex == tractor.count() - 1 && mltClipIndex == playlist.count() - 1;
MAIN.undoStack()->push(
new Timeline::InsertCommand(m_model, m_markersModel, trackIndex, position + info.start,
MLT.XML(&clip), lastClip));
new Timeline::InsertCommand(m_model, m_markersModel, trackIndex, position + info.start,
MLT.XML(&clip), lastClip));
}
}
}
Expand All @@ -3331,7 +3331,7 @@ void TimelineDock::insert(int trackIndex, int position, const QString &xml, bool
addVideoTrack();
}
MAIN.undoStack()->push(
new Timeline::InsertCommand(m_model, m_markersModel, trackIndex, position, xmlToUse, seek));
new Timeline::InsertCommand(m_model, m_markersModel, trackIndex, position, xmlToUse, seek));
}
if (m_position < 0) {
// This happens when pasting in a new session
Expand Down Expand Up @@ -3426,7 +3426,7 @@ void TimelineDock::overwrite(int trackIndex, int position, const QString &xml, b
clip.set_in_and_out(info.frame_in, info.frame_out);
bool lastClip = mltTrackIndex == tractor.count() - 1 && mltClipIndex == playlist.count() - 1;
MAIN.undoStack()->push(
new Timeline::OverwriteCommand(m_model, trackIndex, position + info.start, MLT.XML(&clip), false));
new Timeline::OverwriteCommand(m_model, trackIndex, position + info.start, MLT.XML(&clip), false));
}
}
}
Expand All @@ -3439,7 +3439,7 @@ void TimelineDock::overwrite(int trackIndex, int position, const QString &xml, b
addVideoTrack();
}
MAIN.undoStack()->push(
new Timeline::OverwriteCommand(m_model, trackIndex, position, xmlToUse, seek));
new Timeline::OverwriteCommand(m_model, trackIndex, position, xmlToUse, seek));
}
if (m_position < 0) {
// This happens when pasting in a new session
Expand Down Expand Up @@ -3485,7 +3485,7 @@ void TimelineDock::appendFromPlaylist(Mlt::Playlist *playlist, bool skipProxy, b
auto autoAddTracks = Settings.timelineAutoAddTracks();
Settings.setTimelineAutoAddTracks(false);
MAIN.undoStack()->push(
new Timeline::AppendCommand(m_model, trackIndex, MLT.XML(playlist), skipProxy));
new Timeline::AppendCommand(m_model, trackIndex, MLT.XML(playlist), skipProxy));
connect(&m_model, &MultitrackModel::appended, this, &TimelineDock::selectClip,
Qt::QueuedConnection);
Settings.setTimelineAutoAddTracks(autoAddTracks);
Expand All @@ -3501,7 +3501,7 @@ void TimelineDock::fadeIn(int trackIndex, int clipIndex, int duration)
if (duration < 0) return;
Q_ASSERT(trackIndex >= 0 && clipIndex >= 0);
MAIN.undoStack()->push(
new Timeline::FadeInCommand(m_model, trackIndex, clipIndex, duration));
new Timeline::FadeInCommand(m_model, trackIndex, clipIndex, duration));
emit fadeInChanged(duration);
}

Expand All @@ -3514,7 +3514,7 @@ void TimelineDock::fadeOut(int trackIndex, int clipIndex, int duration)
if (duration < 0) return;
Q_ASSERT(trackIndex >= 0 && clipIndex >= 0);
MAIN.undoStack()->push(
new Timeline::FadeOutCommand(m_model, trackIndex, clipIndex, duration));
new Timeline::FadeOutCommand(m_model, trackIndex, clipIndex, duration));
emit fadeOutChanged(duration);
}

Expand Down
Loading

0 comments on commit 7fa11cc

Please sign in to comment.