various: adding files missing in last commit

Oddly some files didn't commit previously. This commit adds those.
This commit is contained in:
itsmattkc
2020-05-27 03:24:37 +10:00
parent 3e3cacbc85
commit 14ac1ada6e
9 changed files with 49 additions and 41 deletions
+19 -19
View File
@@ -73,20 +73,20 @@ void RenderTask::Render(const TimeRangeList& video_range,
backend.SetAudioParams(audio_params_);
backend.SetVideoDownloadMatrix(mat);
QLinkedList<RangeSampleFuturePair> audio_lookup_table;
std::list<RangeSampleFuturePair> audio_lookup_table;
if (!audio_range.isEmpty()) {
foreach (const TimeRange& r, audio_range) {
QList<TimeRange> ranges = RenderBackend::SplitRangeIntoChunks(r);
foreach (const TimeRange& split, ranges) {
audio_lookup_table.append({split, backend.RenderAudio(split)});
audio_lookup_table.push_back({split, backend.RenderAudio(split)});
}
}
}
// Get hashes for each frame and group likes together
QMap< QByteArray, QLinkedList<rational> > times_to_render;
QLinkedList<HashFrameFuturePair> render_lookup_table;
QMap< QByteArray, std::list<rational> > times_to_render;
std::list<HashFrameFuturePair> render_lookup_table;
if (!video_range.isEmpty()) {
{
@@ -105,7 +105,7 @@ void RenderTask::Render(const TimeRangeList& video_range,
// Already exists, no need to render it again
FrameDownloaded(hash, {time});
} else {
times_to_render[hash].append(time);
times_to_render[hash].push_back(time);
}
index++;
@@ -114,14 +114,14 @@ void RenderTask::Render(const TimeRangeList& video_range,
// Render all frames necessary
{
QLinkedList<HashTimePair> sorted_times;
QLinkedList<HashTimePair>::iterator sorted_iterator;
std::list<HashTimePair> sorted_times;
std::list<HashTimePair>::iterator sorted_iterator;
// Rendering is more efficient if we cache in order, so here we sort
QMap< QByteArray, QLinkedList<rational> >::const_iterator i;
QMap< QByteArray, std::list<rational> >::const_iterator i;
for (i=times_to_render.constBegin(); i!=times_to_render.constEnd(); i++) {
const QByteArray& hash = i.key();
const rational& time = i.value().first();
const rational& time = i.value().front();
bool inserted = false;
@@ -134,12 +134,12 @@ void RenderTask::Render(const TimeRangeList& video_range,
}
if (!inserted) {
sorted_times.append({time, hash});
sorted_times.push_back({time, hash});
}
}
foreach (const HashTimePair& p, sorted_times) {
render_lookup_table.append({p.hash, backend.RenderFrame(p.time)});
render_lookup_table.push_back({p.hash, backend.RenderFrame(p.time)});
}
}
}
@@ -149,17 +149,17 @@ void RenderTask::Render(const TimeRangeList& video_range,
int counter = 0;
int nb_frames = render_lookup_table.size();
QLinkedList<HashDownloadFuturePair> download_futures;
std::list<HashDownloadFuturePair> download_futures;
// Iterators
QLinkedList<HashFrameFuturePair>::iterator i;
QLinkedList<HashDownloadFuturePair>::iterator j;
QLinkedList<RangeSampleFuturePair>::iterator k;
std::list<HashFrameFuturePair>::iterator i;
std::list<HashDownloadFuturePair>::iterator j;
std::list<RangeSampleFuturePair>::iterator k;
while (!IsCancelled()
&& (!render_lookup_table.isEmpty()
|| !download_futures.isEmpty()
|| !audio_lookup_table.isEmpty())) {
&& (!render_lookup_table.empty()
|| !download_futures.empty()
|| !audio_lookup_table.empty())) {
i = render_lookup_table.begin();
@@ -168,7 +168,7 @@ void RenderTask::Render(const TimeRangeList& video_range,
FramePtr f = i->frame_future->Get().value<FramePtr>();
// Start multithreaded download here
download_futures.append({i->hash, DownloadFrame(f, i->hash)});
download_futures.push_back({i->hash, DownloadFrame(f, i->hash)});
i = render_lookup_table.erase(i);
} else {
+2 -2
View File
@@ -238,8 +238,8 @@ void CurveView::VerticalScaleChangedEvent(double scale)
void CurveView::wheelEvent(QWheelEvent *event)
{
if (WheelEventIsAZoomEvent(event)) {
if (event->delta() != 0) {
if (event->delta() > 0) {
if (!event->angleDelta().isNull()) {
if (event->angleDelta().x() + event->angleDelta().y() > 0) {
emit ScaleChanged(GetScale() * 1.1);
SetYScale(GetYScale() * 1.1);
} else {
+1 -1
View File
@@ -114,7 +114,7 @@ QLayoutItem *FlowLayout::takeAt(int index)
Qt::Orientations FlowLayout::expandingDirections() const
{
return 0;
return Qt::Horizontal | Qt::Vertical;
}
bool FlowLayout::hasHeightForWidth() const
+1 -1
View File
@@ -445,7 +445,7 @@ void NodeView::wheelEvent(QWheelEvent *event)
{
if (event->modifiers() & Qt::ControlModifier) {
// FIXME: Hardcoded divider (0.001)
qreal multiplier = 1.0 + (static_cast<qreal>(event->delta()) * 0.001);
qreal multiplier = 1.0 + (static_cast<qreal>(event->angleDelta().x() + event->angleDelta().y()) * 0.001);
scale(multiplier, multiplier);
} else {
+4 -4
View File
@@ -149,7 +149,7 @@ void SliderBase::SetMinimumInternal(const QVariant &v)
has_min_ = true;
// Limit value by this new minimum value
if (value_ < min_value_) {
if (value_.toDouble() < min_value_.toDouble()) {
SetValue(min_value_);
}
}
@@ -160,7 +160,7 @@ void SliderBase::SetMaximumInternal(const QVariant &v)
has_max_ = true;
// Limit value by this new maximum value
if (value_ > max_value_) {
if (value_.toDouble() > max_value_.toDouble()) {
SetValue(max_value_);
}
}
@@ -175,11 +175,11 @@ void SliderBase::changeEvent(QEvent *e)
const QVariant &SliderBase::ClampValue(const QVariant &v)
{
if (has_min_ && v < min_value_) {
if (has_min_ && v.toDouble() < min_value_.toDouble()) {
return min_value_;
}
if (has_max_ && v > max_value_) {
if (has_max_ && v.toDouble() > max_value_.toDouble()) {
return max_value_;
}
@@ -131,16 +131,24 @@ void TimelineView::wheelEvent(QWheelEvent *event)
{
if (HandleZoomFromScroll(event)) {
return;
} else if (Config::Current()["InvertTimelineScrollAxes"].toBool()) {
QWheelEvent e(event->pos(),
event->delta(),
} else {
QPoint angle_delta = event->angleDelta();
if (Config::Current()["InvertTimelineScrollAxes"].toBool()) {
angle_delta = QPoint(angle_delta.y(), angle_delta.x());
}
QWheelEvent e(event->position(),
event->globalPosition(),
event->pixelDelta(),
angle_delta,
event->buttons(),
event->modifiers(),
event->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
event->phase(),
event->inverted(),
event->source());
QGraphicsView::wheelEvent(&e);
} else {
QGraphicsView::wheelEvent(event);
}
}
@@ -203,8 +203,8 @@ bool TimelineViewBase::HandleZoomFromScroll(QWheelEvent *event)
{
if (WheelEventIsAZoomEvent(event)) {
// If CTRL is held (or a preference is set to swap CTRL behavior), we zoom instead of scrolling
if (event->delta() != 0) {
if (event->delta() > 0) {
if (!event->angleDelta().isNull()) {
if (event->angleDelta().x() + event->angleDelta().y() > 0) {
emit ScaleChanged(GetScale() * 1.1);
} else {
emit ScaleChanged(GetScale() * 0.9);
+3 -3
View File
@@ -441,9 +441,9 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
// Check playback queue for a frame
if (IsPlaying()) {
while (!playback_queue_.isEmpty()) {
while (!playback_queue_.empty()) {
const ViewerPlaybackFrame& pf = playback_queue_.first();
const ViewerPlaybackFrame& pf = playback_queue_.front();
if (pf.timestamp == time) {
@@ -454,7 +454,7 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
} else {
// Skip this frame
playback_queue_.removeFirst();
playback_queue_.pop_front();
RequestNextFrameForQueue();
}
+3 -3
View File
@@ -102,15 +102,15 @@ void ViewerWindow::UpdateFromQueue()
rational time = Timecode::timestamp_to_time(t, playback_timebase_);
while (!queue_.isEmpty()) {
const ViewerPlaybackFrame& pf = queue_.first();
while (!queue_.empty()) {
const ViewerPlaybackFrame& pf = queue_.front();
if (pf.timestamp == time) {
// Frame was in queue, no need to decode anything
display_widget_->SetImage(pf.frame);
return;
} else {
queue_.removeFirst();
queue_.pop_front();
}
}
}