1 #include "../stdafx.h"
\r
3 #include "draw_frame.h"
\r
5 #include "frame_shader.h"
\r
7 namespace caspar { namespace core {
\r
9 draw_frame::draw_frame() : type_(empty_tag){}
\r
10 draw_frame::draw_frame(const draw_frame& other) : impl_(other.impl_), type_(other.type_){}
\r
11 draw_frame::draw_frame(draw_frame&& other) : impl_(std::move(other.impl_)), type_(other.type_)
\r
13 other.type_ = empty_tag;
\r
16 const std::vector<short>& draw_frame::audio_data() const
\r
18 static std::vector<short> no_audio;
\r
19 return impl_ ? impl_->audio_data() : no_audio;
\r
22 void draw_frame::swap(draw_frame& other)
\r
24 impl_.swap(other.impl_);
\r
25 std::swap(type_, other.type_);
\r
28 void draw_frame::begin_write()
\r
31 impl_->begin_write();
\r
34 void draw_frame::end_write()
\r
40 void draw_frame::draw(frame_shader& shader)
\r
43 impl_->draw(shader);
\r
46 eof_frame draw_frame::eof(){return eof_frame();}
\r
47 empty_frame draw_frame::empty(){return empty_frame();}
\r
49 bool draw_frame::operator==(const eof_frame&){return type_ == eof_tag;}
\r
50 bool draw_frame::operator==(const empty_frame&){return type_ == empty_tag;}
\r
51 bool draw_frame::operator==(const draw_frame& other){return impl_ == other.impl_ && type_ == other.type_;}
\r
53 draw_frame& draw_frame::operator=(const draw_frame& other)
\r
55 draw_frame temp(other);
\r
59 draw_frame& draw_frame::operator=(draw_frame&& other)
\r
61 impl_ = std::move(other.impl_);
\r
62 type_ = other.type_;
\r
63 other.type_ = empty_tag;
\r
66 draw_frame& draw_frame::operator=(eof_frame&&)
\r
72 draw_frame& draw_frame::operator=(empty_frame&&)
\r