2013-03-12 17:00:09 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2013-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2013-03-12 17:00:09 -04:00
|
|
|
#ifndef __ardour_video_image_frame_h__
|
|
|
|
#define __ardour_video_image_frame_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <sigc++/signal.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
#include "ardour/ardour.h"
|
|
|
|
#include "pbd/signals.h"
|
|
|
|
|
2014-06-22 11:41:05 -04:00
|
|
|
#include "canvas/container.h"
|
2013-04-05 22:09:58 -04:00
|
|
|
#include "canvas/pixbuf.h"
|
2013-04-16 16:57:19 -04:00
|
|
|
#include "canvas/image.h"
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class TempoSection;
|
|
|
|
class MeterSection;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
|
|
|
|
/** @class VideoImageFrame
|
|
|
|
* @brief a single video-frame to be displayed in the video timeline
|
|
|
|
*/
|
|
|
|
class VideoImageFrame : public sigc::trackable
|
|
|
|
{
|
|
|
|
public:
|
2014-06-22 11:41:05 -04:00
|
|
|
VideoImageFrame (PublicEditor&, ArdourCanvas::Container&, int, int, std::string, std::string);
|
2013-03-12 17:00:09 -04:00
|
|
|
virtual ~VideoImageFrame ();
|
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
void set_position (samplepos_t);
|
|
|
|
void set_videoframe (samplepos_t, int rightend = -1);
|
|
|
|
samplepos_t get_video_frame_number() {return video_frame_number;}
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
int get_height () {return clip_height;}
|
|
|
|
int get_width () {return clip_width;}
|
|
|
|
int get_rightend() { return rightend;}
|
2017-12-19 13:14:33 -05:00
|
|
|
samplepos_t get_req_frame () {return req_video_frame_number;}
|
2013-03-12 17:00:09 -04:00
|
|
|
std::string get_video_server_url () {return video_server_url;}
|
|
|
|
std::string get_video_filename () {return video_filename;}
|
|
|
|
|
|
|
|
void http_download_done (char *);
|
|
|
|
PBD::Signal0<void> ImgChanged;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
PublicEditor& editor;
|
2014-06-22 11:41:05 -04:00
|
|
|
ArdourCanvas::Container *_parent;
|
2013-04-16 16:57:19 -04:00
|
|
|
ArdourCanvas::Image *image;
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ArdourCanvas::Image::Data> img;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
int clip_width;
|
|
|
|
int clip_height;
|
|
|
|
int rightend;
|
|
|
|
|
|
|
|
std::string video_server_url;
|
|
|
|
std::string video_filename;
|
|
|
|
|
|
|
|
double unit_position;
|
2017-09-18 12:39:17 -04:00
|
|
|
samplepos_t sample_position;
|
|
|
|
samplepos_t video_frame_number;
|
2013-03-12 17:00:09 -04:00
|
|
|
|
|
|
|
void reposition ();
|
|
|
|
void exposeimg ();
|
|
|
|
|
2017-12-19 13:14:33 -05:00
|
|
|
void fill_frame (const uint8_t r, const uint8_t g, const uint8_t b);
|
2013-03-12 17:00:09 -04:00
|
|
|
void draw_line ();
|
2013-04-16 16:57:19 -04:00
|
|
|
void draw_x ();
|
2013-03-12 17:00:09 -04:00
|
|
|
void cut_rightend ();
|
|
|
|
|
|
|
|
|
2017-12-19 13:14:33 -05:00
|
|
|
void http_get (samplepos_t fn);
|
|
|
|
void http_get_again (samplepos_t fn);
|
2013-03-12 17:00:09 -04:00
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
samplepos_t req_video_frame_number;
|
|
|
|
samplepos_t want_video_frame_number;
|
2013-03-12 17:00:09 -04:00
|
|
|
bool queued_request;
|
|
|
|
|
|
|
|
pthread_mutex_t request_lock;
|
|
|
|
pthread_mutex_t queue_lock;
|
|
|
|
|
|
|
|
pthread_t thread_id_tt;
|
|
|
|
bool thread_active;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_video_image_frame_h__ */
|