format: reformatting files
This commit is contained in:
@@ -19,14 +19,14 @@ add_subdirectory(tool)
|
||||
add_subdirectory(view)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/timelineandtrackview.cpp
|
||||
widget/timelinewidget/timelineandtrackview.h
|
||||
widget/timelinewidget/timelinewidget.cpp
|
||||
widget/timelinewidget/timelinewidget.h
|
||||
widget/timelinewidget/timelinewidgetselections.cpp
|
||||
widget/timelinewidget/timelinewidgetselections.h
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.cpp
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/timelineandtrackview.cpp
|
||||
widget/timelinewidget/timelineandtrackview.h
|
||||
widget/timelinewidget/timelinewidget.cpp
|
||||
widget/timelinewidget/timelinewidget.h
|
||||
widget/timelinewidget/timelinewidgetselections.cpp
|
||||
widget/timelinewidget/timelinewidgetselections.h
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.cpp
|
||||
widget/timelinewidget/timelinewidgetwaveformsync.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -79,7 +79,8 @@ namespace olive
|
||||
|
||||
using namespace TimelineWaveformSync;
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
|
||||
struct SourceSyncClip {
|
||||
ClipBlock *clip = nullptr;
|
||||
@@ -107,8 +108,8 @@ bool GetSourceSyncClip(Block *block, SourceSyncClip *out)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<SourceSyncClip> GetSelectedSourceSyncClips(
|
||||
const QVector<Block *> &blocks)
|
||||
QVector<SourceSyncClip>
|
||||
GetSelectedSourceSyncClips(const QVector<Block *> &blocks)
|
||||
{
|
||||
QVector<SourceSyncClip> clips;
|
||||
for (Block *block : blocks) {
|
||||
@@ -1061,13 +1062,13 @@ void TimelineWidget::SynchronizeSelectedClipsByWaveform()
|
||||
continue;
|
||||
}
|
||||
|
||||
const QVector<double> candidate_envelope =
|
||||
ExtractWaveformCacheEnvelope(sync_clip, sample_rate,
|
||||
window_samples);
|
||||
const QVector<double> candidate_envelope = ExtractWaveformCacheEnvelope(
|
||||
sync_clip, sample_rate, window_samples);
|
||||
const AudioWaveformSync::OffsetResult offset =
|
||||
AudioWaveformSync::EstimateEnvelopeOffset(
|
||||
reference_envelope, candidate_envelope, window_samples,
|
||||
max_offset_windows);
|
||||
AudioWaveformSync::EstimateEnvelopeOffset(reference_envelope,
|
||||
candidate_envelope,
|
||||
window_samples,
|
||||
max_offset_windows);
|
||||
if (!offset.valid) {
|
||||
continue;
|
||||
}
|
||||
@@ -1105,23 +1106,28 @@ void TimelineWidget::SynchronizeSelectedClipsByWaveform()
|
||||
command->add_child(
|
||||
new SetSelectionsCommand(this, new_selections, GetSelections()));
|
||||
|
||||
Core::instance()->undo_stack()->push(
|
||||
command, tr("Synchronize Clips by Waveform"));
|
||||
Core::instance()->undo_stack()->push(command,
|
||||
tr("Synchronize Clips by Waveform"));
|
||||
}
|
||||
|
||||
void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
{
|
||||
if (!ProxyManager::instance() || !sequence()) {
|
||||
qWarning() << "GenerateProxiesForSelectedClips: ProxyManager or sequence unavailable";
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedClips: ProxyManager or sequence unavailable";
|
||||
return;
|
||||
}
|
||||
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: starting proxy generation for" << footage.size() << "footage item(s)";
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: starting proxy generation for"
|
||||
<< footage.size() << "footage item(s)";
|
||||
for (Footage *item : footage) {
|
||||
const VideoParams video = item->GetFirstEnabledVideoStream();
|
||||
if (!video.is_valid()) {
|
||||
qWarning() << "GenerateProxiesForSelectedClips: skipping item with no valid video stream" << item->filename();
|
||||
qWarning()
|
||||
<< "GenerateProxiesForSelectedClips: skipping item with no valid video stream"
|
||||
<< item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1134,7 +1140,8 @@ void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
ProxyManager::instance()->GetOrStartProxy(
|
||||
item->project()->cache_path(), item->filename(),
|
||||
video.stream_index(), params);
|
||||
qDebug() << "GenerateProxiesForSelectedClips: proxy state=" << ProxyManager::ProxyStateToString(proxy.state)
|
||||
qDebug() << "GenerateProxiesForSelectedClips: proxy state="
|
||||
<< ProxyManager::ProxyStateToString(proxy.state)
|
||||
<< "file=" << proxy.filename
|
||||
<< "cache=" << item->project()->cache_path();
|
||||
item->SetProxy(proxy.filename, proxy.state, video.stream_index(),
|
||||
@@ -1145,13 +1152,14 @@ void TimelineWidget::GenerateProxiesForSelectedClips()
|
||||
|
||||
void TimelineWidget::SetSelectedClipsProxyEnabled(bool enabled)
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
qDebug() << "TimelineWidget::SetSelectedClipsProxyEnabled:" << enabled
|
||||
<< "footage count=" << footage.size();
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
qDebug() << " skipping item with empty proxy path"
|
||||
<< item->filename();
|
||||
qDebug()
|
||||
<< " skipping item with empty proxy path" << item->filename();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1162,7 +1170,8 @@ void TimelineWidget::SetSelectedClipsProxyEnabled(bool enabled)
|
||||
|
||||
void TimelineWidget::RevealProxyForSelectedClips()
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
continue;
|
||||
@@ -1193,15 +1202,16 @@ void TimelineWidget::RevealProxyForSelectedClips()
|
||||
|
||||
void TimelineWidget::DeleteProxiesForSelectedClips()
|
||||
{
|
||||
const QVector<Footage *> footage = GetSelectedProxyFootage(selected_blocks_);
|
||||
const QVector<Footage *> footage =
|
||||
GetSelectedProxyFootage(selected_blocks_);
|
||||
for (Footage *item : footage) {
|
||||
if (item->proxy_path().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
QFile::remove(item->proxy_path());
|
||||
QFile::remove(ProxyManager::GetWorkingProxyFilename(
|
||||
item->proxy_path()));
|
||||
QFile::remove(
|
||||
ProxyManager::GetWorkingProxyFilename(item->proxy_path()));
|
||||
item->ClearProxy();
|
||||
item->InvalidateAll(Footage::kFilenameInput);
|
||||
}
|
||||
@@ -1734,21 +1744,21 @@ void TimelineWidget::ShowContextMenu()
|
||||
|
||||
QAction *reveal_proxy =
|
||||
proxy_menu->addAction(tr("Reveal Proxy"));
|
||||
reveal_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
reveal_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(reveal_proxy, &QAction::triggered, this,
|
||||
&TimelineWidget::RevealProxyForSelectedClips);
|
||||
|
||||
QAction *delete_proxy =
|
||||
proxy_menu->addAction(tr("Delete Proxy"));
|
||||
delete_proxy->setEnabled(std::any_of(
|
||||
proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
delete_proxy->setEnabled(
|
||||
std::any_of(proxy_footage.cbegin(), proxy_footage.cend(),
|
||||
[](const Footage *footage) {
|
||||
return !footage->proxy_path().isEmpty();
|
||||
}));
|
||||
connect(delete_proxy, &QAction::triggered, this,
|
||||
&TimelineWidget::DeleteProxiesForSelectedClips);
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ bool GetWaveformSyncClip(Block *block, WaveformSyncClip *out)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
const QVector<Block *> &blocks)
|
||||
QVector<WaveformSyncClip>
|
||||
GetSelectedWaveformSyncClips(const QVector<Block *> &blocks)
|
||||
{
|
||||
QVector<WaveformSyncClip> clips;
|
||||
for (Block *block : blocks) {
|
||||
@@ -108,7 +108,8 @@ QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
const AudioVisualWaveform::Sample summary =
|
||||
clip.waveform->GetSummaryFromTime(t, length);
|
||||
|
||||
for (const AudioVisualWaveform::SamplePerChannel &channel : summary) {
|
||||
for (const AudioVisualWaveform::SamplePerChannel &channel :
|
||||
summary) {
|
||||
const double channel_peak =
|
||||
std::max(std::abs(static_cast<double>(channel.min)),
|
||||
std::abs(static_cast<double>(channel.max)));
|
||||
@@ -121,6 +122,6 @@ QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
return envelope;
|
||||
}
|
||||
|
||||
} // namespace TimelineWaveformSync
|
||||
} // namespace TimelineWaveformSync
|
||||
|
||||
} // namespace olive
|
||||
} // namespace olive
|
||||
|
||||
@@ -38,10 +38,10 @@ class ClipBlock;
|
||||
* @brief Data required to synchronize a clip using its cached audio waveform.
|
||||
*/
|
||||
struct WaveformSyncClip {
|
||||
ClipBlock *clip = nullptr;
|
||||
const AudioWaveformCache *waveform = nullptr;
|
||||
TimeRange media_range;
|
||||
int sample_rate = 0;
|
||||
ClipBlock *clip = nullptr;
|
||||
const AudioWaveformCache *waveform = nullptr;
|
||||
TimeRange media_range;
|
||||
int sample_rate = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -64,8 +64,8 @@ bool GetWaveformSyncClip(Block *block, WaveformSyncClip *out);
|
||||
/**
|
||||
* @brief Return all selected blocks that can be synchronized by waveform.
|
||||
*/
|
||||
QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
const QVector<Block *> &blocks);
|
||||
QVector<WaveformSyncClip>
|
||||
GetSelectedWaveformSyncClips(const QVector<Block *> &blocks);
|
||||
|
||||
/**
|
||||
* @brief Extract a peak envelope from the validated regions of a waveform cache.
|
||||
@@ -74,11 +74,11 @@ QVector<WaveformSyncClip> GetSelectedWaveformSyncClips(
|
||||
* envelope stays aligned to the same absolute timeline.
|
||||
*/
|
||||
QVector<double> ExtractWaveformCacheEnvelope(const WaveformSyncClip &clip,
|
||||
int sample_rate,
|
||||
size_t window_samples);
|
||||
int sample_rate,
|
||||
size_t window_samples);
|
||||
|
||||
} // namespace TimelineWaveformSync
|
||||
} // namespace TimelineWaveformSync
|
||||
|
||||
} // namespace olive
|
||||
} // namespace olive
|
||||
|
||||
#endif // TIMELINEWIDGETWAVEFORMSYNC_H
|
||||
#endif // TIMELINEWIDGETWAVEFORMSYNC_H
|
||||
|
||||
@@ -15,36 +15,36 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/tool/add.cpp
|
||||
widget/timelinewidget/tool/add.h
|
||||
widget/timelinewidget/tool/beam.cpp
|
||||
widget/timelinewidget/tool/beam.h
|
||||
widget/timelinewidget/tool/edit.cpp
|
||||
widget/timelinewidget/tool/edit.h
|
||||
widget/timelinewidget/tool/import.cpp
|
||||
widget/timelinewidget/tool/import.h
|
||||
widget/timelinewidget/tool/pointer.cpp
|
||||
widget/timelinewidget/tool/pointer.h
|
||||
widget/timelinewidget/tool/razor.cpp
|
||||
widget/timelinewidget/tool/razor.h
|
||||
widget/timelinewidget/tool/record.cpp
|
||||
widget/timelinewidget/tool/record.h
|
||||
widget/timelinewidget/tool/ripple.cpp
|
||||
widget/timelinewidget/tool/ripple.h
|
||||
widget/timelinewidget/tool/rolling.cpp
|
||||
widget/timelinewidget/tool/rolling.h
|
||||
widget/timelinewidget/tool/slide.cpp
|
||||
widget/timelinewidget/tool/slide.h
|
||||
widget/timelinewidget/tool/slip.cpp
|
||||
widget/timelinewidget/tool/slip.h
|
||||
widget/timelinewidget/tool/trackselect.cpp
|
||||
widget/timelinewidget/tool/trackselect.h
|
||||
widget/timelinewidget/tool/transition.cpp
|
||||
widget/timelinewidget/tool/transition.h
|
||||
widget/timelinewidget/tool/tool.cpp
|
||||
widget/timelinewidget/tool/tool.h
|
||||
widget/timelinewidget/tool/zoom.cpp
|
||||
widget/timelinewidget/tool/zoom.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/tool/add.cpp
|
||||
widget/timelinewidget/tool/add.h
|
||||
widget/timelinewidget/tool/beam.cpp
|
||||
widget/timelinewidget/tool/beam.h
|
||||
widget/timelinewidget/tool/edit.cpp
|
||||
widget/timelinewidget/tool/edit.h
|
||||
widget/timelinewidget/tool/import.cpp
|
||||
widget/timelinewidget/tool/import.h
|
||||
widget/timelinewidget/tool/pointer.cpp
|
||||
widget/timelinewidget/tool/pointer.h
|
||||
widget/timelinewidget/tool/razor.cpp
|
||||
widget/timelinewidget/tool/razor.h
|
||||
widget/timelinewidget/tool/record.cpp
|
||||
widget/timelinewidget/tool/record.h
|
||||
widget/timelinewidget/tool/ripple.cpp
|
||||
widget/timelinewidget/tool/ripple.h
|
||||
widget/timelinewidget/tool/rolling.cpp
|
||||
widget/timelinewidget/tool/rolling.h
|
||||
widget/timelinewidget/tool/slide.cpp
|
||||
widget/timelinewidget/tool/slide.h
|
||||
widget/timelinewidget/tool/slip.cpp
|
||||
widget/timelinewidget/tool/slip.h
|
||||
widget/timelinewidget/tool/trackselect.cpp
|
||||
widget/timelinewidget/tool/trackselect.h
|
||||
widget/timelinewidget/tool/transition.cpp
|
||||
widget/timelinewidget/tool/transition.h
|
||||
widget/timelinewidget/tool/tool.cpp
|
||||
widget/timelinewidget/tool/tool.h
|
||||
widget/timelinewidget/tool/zoom.cpp
|
||||
widget/timelinewidget/tool/zoom.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/trackview/trackview.h
|
||||
widget/timelinewidget/trackview/trackview.cpp
|
||||
widget/timelinewidget/trackview/trackviewitem.h
|
||||
widget/timelinewidget/trackview/trackviewitem.cpp
|
||||
widget/timelinewidget/trackview/trackviewsplitter.h
|
||||
widget/timelinewidget/trackview/trackviewsplitter.cpp
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/trackview/trackview.h
|
||||
widget/timelinewidget/trackview/trackview.cpp
|
||||
widget/timelinewidget/trackview/trackviewitem.h
|
||||
widget/timelinewidget/trackview/trackviewitem.cpp
|
||||
widget/timelinewidget/trackview/trackviewsplitter.h
|
||||
widget/timelinewidget/trackview/trackviewsplitter.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/view/timelineview.cpp
|
||||
widget/timelinewidget/view/timelineview.h
|
||||
widget/timelinewidget/view/timelineviewmouseevent.h
|
||||
widget/timelinewidget/view/timelineviewghostitem.h
|
||||
PARENT_SCOPE
|
||||
${OLIVE_SOURCES}
|
||||
widget/timelinewidget/view/timelineview.cpp
|
||||
widget/timelinewidget/view/timelineview.h
|
||||
widget/timelinewidget/view/timelineviewmouseevent.h
|
||||
widget/timelinewidget/view/timelineviewghostitem.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user