Ardour  9.0-pre0-582-g084a23a80d
video_image_frame.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 #pragma once
20 
21 #include <string>
22 #include <glib.h>
23 
24 #include <sigc++/signal.h>
25 #include <pthread.h>
26 
27 #include "ardour/ardour.h"
28 #include "pbd/signals.h"
29 
30 #include "canvas/container.h"
31 #include "canvas/pixbuf.h"
32 #include "canvas/image.h"
33 
34 namespace ARDOUR {
35  class TempoSection;
36  class MeterSection;
37 }
38 
39 class PublicEditor;
40 
44 class VideoImageFrame : public sigc::trackable
45 {
46  public:
47  VideoImageFrame (PublicEditor&, ArdourCanvas::Container&, int, int, std::string, std::string);
48  virtual ~VideoImageFrame ();
49 
53 
54  int get_height () {return clip_height;}
55  int get_width () {return clip_width;}
56  int get_rightend() { return rightend;}
58  std::string get_video_server_url () {return video_server_url;}
59  std::string get_video_filename () {return video_filename;}
60 
61  void http_download_done (char *);
63 
64  protected:
65 
69  std::shared_ptr<ArdourCanvas::Image::Data> img;
70 
73  int rightend;
74 
75  std::string video_server_url;
76  std::string video_filename;
77 
78  double unit_position;
81 
82  void reposition ();
83  void exposeimg ();
84 
85  void fill_frame (const uint8_t r, const uint8_t g, const uint8_t b);
86  void draw_line ();
87  void draw_x ();
88  void cut_rightend ();
89 
90 
91  void http_get (samplepos_t fn);
93 
97 
98  pthread_mutex_t request_lock;
99  pthread_mutex_t queue_lock;
100 
101  pthread_t thread_id_tt;
103 
104 };
105 
Representation of the interface of the Editor class.
a single video-frame to be displayed in the video timeline
samplepos_t video_frame_number
pthread_mutex_t queue_lock
std::string video_filename
samplepos_t req_video_frame_number
samplepos_t get_req_frame()
void set_position(samplepos_t)
void http_download_done(char *)
PublicEditor & editor
samplepos_t get_video_frame_number()
samplepos_t sample_position
std::string get_video_filename()
samplepos_t want_video_frame_number
void http_get_again(samplepos_t fn)
void http_get(samplepos_t fn)
void set_videoframe(samplepos_t, int rightend=-1)
std::string get_video_server_url()
ArdourCanvas::Image * image
virtual ~VideoImageFrame()
VideoImageFrame(PublicEditor &, ArdourCanvas::Container &, int, int, std::string, std::string)
std::shared_ptr< ArdourCanvas::Image::Data > img
ArdourCanvas::Container * _parent
PBD::Signal< void()> ImgChanged
std::string video_server_url
pthread_mutex_t request_lock
void fill_frame(const uint8_t r, const uint8_t g, const uint8_t b)
Temporal::samplepos_t samplepos_t