BC_Pixmap::resize(new_w, new_h);
}
+void ResourcePixmap::update_settings(Edit *edit,
+ int64_t edit_x, int64_t edit_w,
+ int64_t pixmap_x, int64_t pixmap_w, int64_t pixmap_h)
+{
+ this->edit_id = edit->id;
+ this->edit_x = edit_x;
+ this->pixmap_x = pixmap_x;
+ this->pixmap_w = pixmap_w;
+ this->pixmap_h = pixmap_h;
+
+ startsource = edit->startsource;
+ if( edit->asset )
+ source_framerate = edit->asset->frame_rate;
+ else
+ if( edit->nested_edl )
+ source_framerate = edit->nested_edl->session->frame_rate;
+ if( edit->asset )
+ source_samplerate = edit->asset->sample_rate;
+ else if( edit->nested_edl )
+ source_samplerate = edit->nested_edl->session->sample_rate;
+
+ project_framerate = edit->edl->session->frame_rate;
+ project_samplerate = edit->edl->session->sample_rate;
+ zoom_sample = mwindow->edl->local_session->zoom_sample;
+ zoom_track = mwindow->edl->local_session->zoom_track;
+ zoom_y = mwindow->edl->local_session->zoom_y;
+}
void ResourcePixmap::draw_data(TrackCanvas *canvas,
Edit *edit, int64_t edit_x, int64_t edit_w,
if( edit->track->show_titles() )
y += mwindow->theme->get_image("title_bg_data")->get_h();
-
// If want indexes only & index can't be drawn, don't do anything.
int need_redraw = 0;
int64_t index_zoom = 0;
return;
}
-
-// Redraw everything
/* Incremental drawing is not possible with resource thread */
- if( 1 )
-// edit->startsource != this->startsource ||
-// mwindow->edl->session->sample_rate != project_samplerate ||
-// !EQUIV(mwindow->edl->session->frame_rate, project_framerate) ||
-// mwindow->edl->local_session->zoom_sample != zoom_sample ||
-// mwindow->edl->local_session->zoom_track != zoom_track ||
-// this->pixmap_h != pixmap_h ||
-// (data_type == TRACK_AUDIO &&
-// mwindow->edl->local_session->zoom_y != zoom_y) ||
-// (mode == 2) ||
-// need_redraw)
- {
-// Redraw the whole thing.
- refresh_x = 0;
- refresh_w = pixmap_w;
- }
- else {
-// Start translated right
- if( pixmap_w == this->pixmap_w && edit_x < this->edit_x && edit_w != pixmap_w ) {
- refresh_w = this->edit_x - edit_x;
- refresh_x = this->pixmap_w - refresh_w;
-
-// Moved completely off the pixmap
- if( refresh_w > this->pixmap_w ) {
- refresh_w = this->pixmap_w;
- refresh_x = 0;
- }
- else {
- copy_area(refresh_w,
- y,
- refresh_x,
- mwindow->edl->local_session->zoom_track,
- 0,
- y);
- }
- }
- else
-// Start translated left
- if( pixmap_w == this->pixmap_w && edit_x > this->edit_x && edit_w != pixmap_w ) {
- refresh_x = 0;
- refresh_w = edit_x - this->edit_x;
-
-// Moved completely off the pixmap
- if( refresh_w > this->pixmap_w ) {
- refresh_w = this->pixmap_w;
- }
- else {
- copy_area(0,
- y,
- this->pixmap_w - refresh_w,
- mwindow->edl->local_session->zoom_track,
- refresh_w,
- y);
- }
- }
- else
-// Start translated right and pixmap came off of right side
- if( pixmap_w < this->pixmap_w && edit_x < this->edit_x &&
- this->edit_x + edit_w > this->pixmap_x + this->pixmap_w ) {
- refresh_w = (this->edit_x + edit_w) - (this->pixmap_x + this->pixmap_w);
- refresh_x = pixmap_w - refresh_w;
-
- if( refresh_w >= pixmap_w ) {
- refresh_x = 0;
- refresh_w = pixmap_w;
- }
- else {
- copy_area(this->edit_x - edit_x,
- y,
- pixmap_w - refresh_w,
- mwindow->edl->local_session->zoom_track,
- 0,
- y);
- }
- }
- else
-// Start translated right and reduced in size on the right.
- if( pixmap_w < this->pixmap_w && edit_x < this->edit_x ) {
- refresh_x = 0;
- refresh_w = 0;
-
- copy_area(this->pixmap_w - pixmap_w,
- y,
- pixmap_w,
- mwindow->edl->local_session->zoom_track,
- 0,
- y);
- }
- else
-// Start translated left and pixmap came off left side
- if( edit_x >= 0 && this->edit_x < 0 ) {
- refresh_x = 0;
- refresh_w = -this->edit_x;
-
- if( refresh_w > pixmap_w ) {
- refresh_w = pixmap_w;
- }
- else {
- copy_area(0,
- y,
- this->pixmap_w,
- mwindow->edl->local_session->zoom_track,
- refresh_w,
- y);
- }
- }
- else
-// Start translated left and reduced in size on the right
- if( pixmap_w < this->pixmap_w && edit_x > this->edit_x ) {
- refresh_x = 0;
- refresh_w = 0;
- }
- else
-// Start translated right and left went into left side.
- if( pixmap_w > this->pixmap_w && edit_x < 0 && this->edit_x > 0 ) {
- refresh_w = pixmap_w - (edit_x + this->pixmap_w);
- refresh_x = pixmap_w - refresh_w;
-
-// Moved completely off new pixmap
- if( refresh_w > pixmap_w ) {
- refresh_w = pixmap_w;
- refresh_x = 0;
- }
- else {
- copy_area(-edit_x,
- y,
- refresh_x,
- mwindow->edl->local_session->zoom_track,
- 0,
- y);
- }
- }
- else
-// Start translated right and increased in size on the right
- if( pixmap_w > this->pixmap_w && edit_x <= this->edit_x ) {
- refresh_w = pixmap_w - this->pixmap_w;
- refresh_x = pixmap_w - refresh_w;
- }
- else
-// Start translated left and increased in size on the right
- if( pixmap_w > this->pixmap_w && edit_x > this->edit_x ) {
- refresh_x = 0;
- refresh_w = edit_x - this->edit_x;
-
-// Moved completely off new pixmap
- if( refresh_w > this->pixmap_w ) {
- refresh_w = pixmap_w;
- refresh_x = 0;
- }
-// Shift and insert
- else {
- copy_area(0,
- y,
- this->pixmap_w,
- mwindow->edl->local_session->zoom_track,
- refresh_w,
- y);
- }
- }
- }
-
-// Update pixmap settings
- this->edit_id = edit->id;
- this->startsource = edit->startsource;
-
- if( edit->asset )
- this->source_framerate = edit->asset->frame_rate;
- else
- if( edit->nested_edl )
- this->source_framerate = edit->nested_edl->session->frame_rate;
-
- if( edit->asset )
- this->source_samplerate = edit->asset->sample_rate;
- else
- if( edit->nested_edl )
- this->source_samplerate = edit->nested_edl->session->sample_rate;
-
- this->project_framerate = edit->edl->session->frame_rate;
- this->project_samplerate = edit->edl->session->sample_rate;
- this->edit_x = edit_x;
- this->pixmap_x = pixmap_x;
- this->pixmap_w = pixmap_w;
- this->pixmap_h = pixmap_h;
- this->zoom_sample = mwindow->edl->local_session->zoom_sample;
- this->zoom_track = mwindow->edl->local_session->zoom_track;
- this->zoom_y = mwindow->edl->local_session->zoom_y;
-
-
+// Redraw everything
+ refresh_x = 0;
+ refresh_w = pixmap_w;
// Draw background image
if( refresh_w > 0 )