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