2 Copyright (C) 2010 Paul Davis
3 Author: Robin Gareus <robin@gareus.org>
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.
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.
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.
20 #ifndef __ardour_video_image_frame_h__
21 #define __ardour_video_image_frame_h__
23 #define ARDOUR_USER_AGENT (PROGRAM_NAME VERSIONSTRING)
24 #define ARDOUR_CURL_TIMEOUT (60)
29 #include <libgnomecanvasmm/pixbuf.h>
30 #include <sigc++/signal.h>
33 #include "ardour/ardour.h"
34 #include "pbd/signals.h"
45 /** @class VideoImageFrame
46 * @brief a single video-frame to be displayed in the video timeline
48 class VideoImageFrame : public sigc::trackable
51 VideoImageFrame (PublicEditor&, ArdourCanvas::Group&, int, int, std::string, std::string);
52 virtual ~VideoImageFrame ();
54 void set_position (framepos_t);
55 void set_videoframe (framepos_t, int rightend = -1);
56 framepos_t get_video_frame_number() {return video_frame_number;}
58 int get_height () {return clip_height;}
59 int get_width () {return clip_width;}
60 int get_rightend() { return rightend;}
61 framepos_t get_req_frame () {return req_video_frame_number;}
62 std::string get_video_server_url () {return video_server_url;}
63 std::string get_video_filename () {return video_filename;}
65 void http_download_done (char *);
66 PBD::Signal0<void> ImgChanged;
71 ArdourCanvas::Group *_parent;
72 ArdourCanvas::Group *group;
73 ArdourCanvas::Pixbuf *img_pixbuf;
79 std::string video_server_url;
80 std::string video_filename;
83 framepos_t frame_position;
84 framepos_t video_frame_number;
93 void http_get(framepos_t fn);
94 void http_get_again(framepos_t fn);
96 framepos_t req_video_frame_number;
97 framepos_t want_video_frame_number;
100 pthread_mutex_t request_lock;
101 pthread_mutex_t queue_lock;
103 pthread_t thread_id_tt;
109 char *curl_http_get (const char *u, int *status);
112 #endif /* __ardour_video_image_frame_h__ */