change: change code style to Linux style except indent.
This commit is contained in:
@@ -23,41 +23,41 @@
|
||||
|
||||
#include "codec/frame.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
struct ViewerPlaybackFrame
|
||||
namespace olive
|
||||
{
|
||||
rational timestamp;
|
||||
QVariant frame;
|
||||
|
||||
struct ViewerPlaybackFrame {
|
||||
rational timestamp;
|
||||
QVariant frame;
|
||||
};
|
||||
|
||||
class ViewerQueue : public std::list<ViewerPlaybackFrame>
|
||||
{
|
||||
class ViewerQueue : public std::list<ViewerPlaybackFrame> {
|
||||
public:
|
||||
ViewerQueue() = default;
|
||||
ViewerQueue() = default;
|
||||
|
||||
void AppendTimewise(const ViewerPlaybackFrame& f, int playback_speed)
|
||||
{
|
||||
if (this->empty() || (this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
|
||||
this->push_back(f);
|
||||
} else {
|
||||
for (auto i=this->begin(); i!=this->end(); i++) {
|
||||
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
|
||||
this->insert(i, f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PurgeBefore(const rational &time, int playback_speed)
|
||||
{
|
||||
while (!this->empty()
|
||||
&& ((playback_speed > 0 && this->front().timestamp < time) || (playback_speed < 0 && this->front().timestamp > time))) {
|
||||
this->pop_front();
|
||||
}
|
||||
}
|
||||
void AppendTimewise(const ViewerPlaybackFrame &f, int playback_speed)
|
||||
{
|
||||
if (this->empty() ||
|
||||
(this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
|
||||
this->push_back(f);
|
||||
} else {
|
||||
for (auto i = this->begin(); i != this->end(); i++) {
|
||||
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
|
||||
this->insert(i, f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PurgeBefore(const rational &time, int playback_speed)
|
||||
{
|
||||
while (!this->empty() &&
|
||||
((playback_speed > 0 && this->front().timestamp < time) ||
|
||||
(playback_speed < 0 && this->front().timestamp > time))) {
|
||||
this->pop_front();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user