ardour
video_image_frame.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Paul Davis
3  Author: 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
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 #ifndef __ardour_video_image_frame_h__
21 #define __ardour_video_image_frame_h__
22 
23 #include <string>
24 #include <glib.h>
25 
26 #include <sigc++/signal.h>
27 #include <pthread.h>
28 
29 #include "ardour/ardour.h"
30 #include "pbd/signals.h"
31 
32 #include "canvas/container.h"
33 #include "canvas/pixbuf.h"
34 #include "canvas/image.h"
35 
36 namespace ARDOUR {
37  class TempoSection;
38  class MeterSection;
39 }
40 
41 class PublicEditor;
42 
46 class VideoImageFrame : public sigc::trackable
47 {
48  public:
49  VideoImageFrame (PublicEditor&, ArdourCanvas::Container&, int, int, std::string, std::string);
50  virtual ~VideoImageFrame ();
51 
52  void set_position (framepos_t);
53  void set_videoframe (framepos_t, int rightend = -1);
55 
56  int get_height () {return clip_height;}
57  int get_width () {return clip_width;}
58  int get_rightend() { return rightend;}
60  std::string get_video_server_url () {return video_server_url;}
61  std::string get_video_filename () {return video_filename;}
62 
63  void http_download_done (char *);
64  PBD::Signal0<void> ImgChanged;
65 
66  protected:
67 
69  ArdourCanvas::Container *_parent;
70  ArdourCanvas::Image *image;
72 
75  int rightend;
76 
77  std::string video_server_url;
78  std::string video_filename;
79 
80  double unit_position;
83 
84  void reposition ();
85  void exposeimg ();
86 
87  void fill_frame (const uint8_t r, const uint8_t g, const uint8_t b);
88  void draw_line ();
89  void draw_x ();
90  void cut_rightend ();
91 
92 
93  void http_get(framepos_t fn);
94  void http_get_again(framepos_t fn);
95 
99 
100  pthread_mutex_t request_lock;
101  pthread_mutex_t queue_lock;
102 
103  pthread_t thread_id_tt;
105 
106 };
107 
108 #endif /* __ardour_video_image_frame_h__ */
virtual ~VideoImageFrame()
std::string get_video_server_url()
ArdourCanvas::Image * image
std::string video_server_url
void set_videoframe(framepos_t, int rightend=-1)
Representation of the interface of the Editor class.
std::string get_video_filename()
a single video-frame to be displayed in the video timeline
pthread_mutex_t queue_lock
boost::shared_ptr< ArdourCanvas::Image::Data > img
pthread_mutex_t request_lock
framepos_t get_video_frame_number()
void http_download_done(char *)
void http_get_again(framepos_t fn)
Definition: amp.h:29
PBD::Signal0< void > ImgChanged
framepos_t want_video_frame_number
PublicEditor & editor
void http_get(framepos_t fn)
framepos_t video_frame_number
std::string video_filename
framepos_t get_req_frame()
VideoImageFrame(PublicEditor &, ArdourCanvas::Container &, int, int, std::string, std::string)
void set_position(framepos_t)
framepos_t req_video_frame_number
int64_t framepos_t
void fill_frame(const uint8_t r, const uint8_t g, const uint8_t b)
framepos_t sample_position
ArdourCanvas::Container * _parent