a/v per track data height, boxblur power fix, add french expanders
authorGood Guy <good1.2guy@gmail.com>
Thu, 14 May 2020 23:23:11 +0000 (17:23 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 14 May 2020 23:23:11 +0000 (17:23 -0600)
31 files changed:
cinelerra-5.1/cinelerra/atrack.C
cinelerra-5.1/cinelerra/atrack.h
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/edl.inc
cinelerra-5.1/cinelerra/indexfile.C
cinelerra-5.1/cinelerra/localsession.C
cinelerra-5.1/cinelerra/localsession.h
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowmove.C
cinelerra-5.1/cinelerra/patchgui.C
cinelerra-5.1/cinelerra/patchgui.h
cinelerra-5.1/cinelerra/resourcepixmap.C
cinelerra-5.1/cinelerra/resourcepixmap.h
cinelerra-5.1/cinelerra/strack.C
cinelerra-5.1/cinelerra/strack.h
cinelerra-5.1/cinelerra/theme.C
cinelerra-5.1/cinelerra/theme.h
cinelerra-5.1/cinelerra/track.C
cinelerra-5.1/cinelerra/track.h
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/trackcanvas.h
cinelerra-5.1/cinelerra/tracks.C
cinelerra-5.1/cinelerra/vtrack.C
cinelerra-5.1/cinelerra/vtrack.h
cinelerra-5.1/cinelerra/vtransition.C
cinelerra-5.1/cinelerra/zoombar.C
cinelerra-5.1/cinelerra/zoombar.h
cinelerra-5.1/cinelerra/zoombar.inc
cinelerra-5.1/cinelerra/zoompanel.C
cinelerra-5.1/expanders.fr [new file with mode: 0644]
cinelerra-5.1/plugins/boxblur/boxblur.C

index 5ba270e69d928fd6b29e37bcbdeb2bdd1d455cc4..2e18bdf7f8edc19a3e6030b295e5ac1357dc020e 100644 (file)
@@ -51,6 +51,7 @@ ATrack::ATrack(EDL *edl, Tracks *tracks)
  : Track(edl, tracks)
 {
        data_type = TRACK_AUDIO;
+       data_h = edl->local_session->zoom_atrack;
 }
 
 ATrack::~ATrack()
index 0295697f03fe9e6abff39a35c8a49407d1d319dd..31910f0c2bd98815faeafa2a91da83a39f03292a 100644 (file)
@@ -37,7 +37,6 @@ class ATrack : public Track
 {
 public:
        ATrack(EDL *edl, Tracks *tracks);
-       ATrack() { };
        ~ATrack();
 
        void create_objects();
index 56329af3caecc76d71c32c7092bad0429ee6e57c..f06194f8a1de251b2472662176155ac76a1efeaa 100644 (file)
@@ -379,12 +379,12 @@ double Edit::picon_w()
                w = nested_edl->session->output_w;
                h = nested_edl->session->output_h;
        }
-       return w>0 && h>0 ? ((double)edl->local_session->zoom_track*w)/h : 0;
+       return w>0 && h>0 ? ((double)track->data_h*w)/h : 0;
 }
 
 int Edit::picon_h()
 {
-       return edl->local_session->zoom_track;
+       return track->data_h;
 }
 
 
index 2d7256885bf6219eecdbc806759ebf777e293ca3..9f08c29b6dce0764f88dd62c52764248bbfbd9d5 100644 (file)
@@ -159,9 +159,9 @@ class EDL;
 #define MAX_ZOOM_TIME 0x100000
 #define DEFAULT_ZOOM_TIME 1024
 #define MIN_AMP_ZOOM 8
-#define MAX_AMP_ZOOM 262144
-#define MIN_TRACK_ZOOM 32
-#define MAX_TRACK_ZOOM 1024
+#define MAX_AMP_ZOOM 8192
+#define MIN_TRACK_ZOOM 8
+#define MAX_TRACK_ZOOM 8192
 
 #define MAX_PAN 1.0
 #define PAN_RADIUS 50
index e73a87100a8fa56cd769ffc28807e3c2eeec60c0..0e6469e2c1d5e3fe64aebcc853d7a8738a564a98 100644 (file)
@@ -707,10 +707,9 @@ SET_TRACE
 // Start and length of fragment to read from file in bytes.
        float *buffer = 0;
        int buffer_shared = 0;
-       int rect_audio = mwindow->preferences->rectify_audio;;
-       int center_pixel = !rect_audio ?
-               mwindow->edl->local_session->zoom_track / 2 :
-               mwindow->edl->local_session->zoom_track;
+       int rect_audio = mwindow->preferences->rectify_audio;
+       int data_h = edit->track->data_h;
+       int center_pixel = !rect_audio ? data_h/2 : data_h;
        if( edit->track->show_titles() )
                center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
 
@@ -747,9 +746,9 @@ SET_TRACE
        int prev_y1 = center_pixel;
        int prev_y2 = center_pixel;
        int first_frame = 1;
-       int zoom_y = !rect_audio ?
-               mwindow->edl->local_session->zoom_y / 2 :
-               mwindow->edl->local_session->zoom_y;
+       int zoom_y = mwindow->edl->local_session->zoom_y * data_h /
+                       mwindow->edl->local_session->zoom_atrack;
+       if( !rect_audio ) zoom_y /= 2;
        int max_y = center_pixel + zoom_y - 1;
        edit_position = (x + pixmap->pixmap_x - virtual_edit_x) * project_zoom;
        int64_t speed_position = edit->startsource;
index e0e8efa87c4f2dfbc7de39d34e6c6061051aacc7..7e1f50eaeb030eede38dd7bff30822f6e2d6d66d 100644 (file)
@@ -72,7 +72,8 @@ LocalSession::LocalSession(EDL *edl)
        preview_start = 0;  preview_end = -1;
        zoom_sample = DEFAULT_ZOOM_TIME;
        zoom_y = 0;
-       zoom_track = 0;
+       zoom_atrack = 0;
+       zoom_vtrack = 0;
        x_pane = y_pane = -1;
 
        for(int i = 0; i < TOTAL_PANES; i++) {
@@ -128,7 +129,8 @@ void LocalSession::copy_from(LocalSession *that)
 
        zoom_sample = that->zoom_sample;
        zoom_y = that->zoom_y;
-       zoom_track = that->zoom_track;
+       zoom_atrack = that->zoom_atrack;
+       zoom_vtrack = that->zoom_vtrack;
        preview_start = that->preview_start;
        preview_end = that->preview_end;
        red = that->red;
@@ -175,8 +177,8 @@ void LocalSession::save_xml(FileXML *file, double start)
        file->tag.set_property("ZOOM_SAMPLE", zoom_sample);
 //printf("EDLSession::save_session 1\n");
        file->tag.set_property("ZOOMY", zoom_y);
-//printf("EDLSession::save_session 1 %d\n", zoom_track);
-       file->tag.set_property("ZOOM_TRACK", zoom_track);
+       file->tag.set_property("ZOOM_ATRACK", zoom_atrack);
+       file->tag.set_property("ZOOM_VTRACK", zoom_vtrack);
 
        double preview_start = this->preview_start - start;
        if( preview_start < 0 ) preview_start = 0;
@@ -277,7 +279,10 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags)
 
                zoom_sample = file->tag.get_property("ZOOM_SAMPLE", zoom_sample);
                zoom_y = file->tag.get_property("ZOOMY", zoom_y);
-               zoom_track = file->tag.get_property("ZOOM_TRACK", zoom_track);
+               int64_t zoom_track = file->tag.get_property("ZOOM_TRACK", 0);
+               if( zoom_track > 0 ) zoom_atrack = zoom_vtrack = zoom_track;
+               zoom_atrack = file->tag.get_property("ZOOM_ATRACK", zoom_atrack);
+               zoom_vtrack = file->tag.get_property("ZOOM_VTRACK", zoom_vtrack);
                preview_start = file->tag.get_property("PREVIEW_START", preview_start);
                preview_end = file->tag.get_property("PREVIEW_END", preview_end);
                red = file->tag.get_property("RED", red);
@@ -341,7 +346,10 @@ int LocalSession::load_defaults(BC_Hash *defaults)
 //     view_start = defaults->get("VIEW_START", 0);
        zoom_sample = defaults->get("ZOOM_SAMPLE", DEFAULT_ZOOM_TIME);
        zoom_y = defaults->get("ZOOMY", 64);
-       zoom_track = defaults->get("ZOOM_TRACK", 64);
+       int64_t zoom_track = defaults->get("ZOOM_TRACK", 0);
+       if( zoom_track == 0 ) zoom_track = 64;
+       zoom_atrack = defaults->get("ZOOM_ATRACK", zoom_track);
+       zoom_vtrack = defaults->get("ZOOM_VTRACK", zoom_track);
        red = defaults->get("RED", 0.0);
        green = defaults->get("GREEN", 0.0);
        blue = defaults->get("BLUE", 0.0);
@@ -375,7 +383,8 @@ int LocalSession::save_defaults(BC_Hash *defaults)
 //     defaults->update("VIEW_START", view_start);
        defaults->update("ZOOM_SAMPLE", zoom_sample);
        defaults->update("ZOOMY", zoom_y);
-       defaults->update("ZOOM_TRACK", zoom_track);
+       defaults->update("ZOOM_ATRACK", zoom_atrack);
+       defaults->update("ZOOM_VTRACK", zoom_vtrack);
        defaults->update("RED", red);
        defaults->update("GREEN", green);
        defaults->update("BLUE", blue);
index 1fa25f0c16fd502a2819e2e5e4c0f5a1d929eff4..9b962456f55079cdffae0213729a47822b38ecaa 100644 (file)
@@ -100,7 +100,8 @@ public:
 // Amplitude zoom
        int64_t zoom_y;
 // Track zoom
-       int64_t zoom_track;
+       int64_t zoom_atrack;
+       int64_t zoom_vtrack;
 // Vertical automation scale
 
        float automation_mins[AUTOGROUPTYPE_COUNT];
index 74717d8ce6b4cd033af299c60d91c106d973879b..826ca600abb693afc81a294323ec94b4273051b2 100644 (file)
@@ -303,7 +303,8 @@ public:
        int zoom_sample(int64_t zoom_sample);
        void zoom_autos(float min, float max);
        void zoom_amp(int64_t zoom_amp);
-       void zoom_track(int64_t zoom_track);
+       void zoom_atrack(int64_t zoom);
+       void zoom_vtrack(int64_t zoom);
        int fit_sample();
        int move_left(int64_t distance = 0);
        int move_right(int64_t distance = 0);
index dedf96e87671af9b5f7ec099d986cf4a25c58de0..5abe4e6c20b15cf77c96a46d198f0856b19a085f 100644 (file)
@@ -353,26 +353,43 @@ void MWindow::zoom_amp(int64_t zoom_amp)
        gui->flush();
 }
 
-void MWindow::zoom_track(int64_t zoom_track)
+void MWindow::zoom_atrack(int64_t zoom)
 {
+       int64_t old_zoom = edl->local_session->zoom_atrack;
 // scale waveforms
        edl->local_session->zoom_y = (int64_t)((float)edl->local_session->zoom_y *
-               zoom_track /
-               edl->local_session->zoom_track);
+                       zoom / old_zoom);
        CLAMP(edl->local_session->zoom_y, MIN_AMP_ZOOM, MAX_AMP_ZOOM);
 
 // scale tracks
-       double scale = (double)zoom_track / edl->local_session->zoom_track;
-       edl->local_session->zoom_track = zoom_track;
-
+       edl->local_session->zoom_atrack = zoom;
+       for( Track *track= edl->tracks->first; track; track=track->next ) {
+               if( track->data_type != TRACK_AUDIO ) continue;
+               track->data_h = track->data_h * zoom / old_zoom;
+               bclamp(track->data_h, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
+       }
 // shift row position
-       for(int i = 0; i < TOTAL_PANES; i++)
-       {
-               edl->local_session->track_start[i] *= scale;
+       for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
+               (edl->local_session->track_start[i] * zoom) / old_zoom;
+       edl->tracks->update_y_pixels(theme);
+       gui->draw_trackmovement();
+}
+
+void MWindow::zoom_vtrack(int64_t zoom)
+{
+       int64_t old_zoom = edl->local_session->zoom_vtrack;
+// scale tracks
+       edl->local_session->zoom_vtrack = zoom;
+       for( Track *track= edl->tracks->first; track; track=track->next ) {
+               if( track->data_type != TRACK_VIDEO ) continue;
+               track->data_h = track->data_h * zoom / old_zoom;
+               bclamp(track->data_h, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
        }
+// shift row position
+       for( int i=0; i<TOTAL_PANES; ++i ) edl->local_session->track_start[i] =
+               (edl->local_session->track_start[i] * zoom) / old_zoom;
        edl->tracks->update_y_pixels(theme);
        gui->draw_trackmovement();
-//printf("MWindow::zoom_track %d %d\n", edl->local_session->zoom_y, edl->local_session->zoom_track);
 }
 
 void MWindow::trackmovement(int offset, int pane_number)
@@ -405,16 +422,14 @@ void MWindow::trackmovement(int offset, int pane_number)
 void MWindow::move_up(int64_t distance)
 {
        TimelinePane *pane = gui->get_focused_pane();
-       if(distance == 0) distance = edl->local_session->zoom_track;
-
+       if(distance == 0) distance = pane->canvas->get_h() / 10;
        trackmovement(-distance, pane->number);
 }
 
 void MWindow::move_down(int64_t distance)
 {
        TimelinePane *pane = gui->get_focused_pane();
-       if(distance == 0) distance = edl->local_session->zoom_track;
-
+       if(distance == 0) distance = pane->canvas->get_h() / 10;
        trackmovement(distance, pane->number);
 }
 
@@ -423,10 +438,8 @@ int MWindow::goto_end()
        TimelinePane *pane = gui->get_focused_pane();
        int64_t old_view_start = edl->local_session->view_start[pane->number];
 
-       if(edl->tracks->total_length() > (double)pane->canvas->get_w() *
-               edl->local_session->zoom_sample /
-               edl->session->sample_rate)
-       {
+       if( edl->tracks->total_length() > (double)pane->canvas->get_w() *
+               edl->local_session->zoom_sample / edl->session->sample_rate ) {
                edl->local_session->view_start[pane->number] =
                        Units::round(edl->tracks->total_length() *
                                edl->session->sample_rate /
@@ -785,18 +798,24 @@ int MWindow::zoom_in_y()
 
 int MWindow::expand_t()
 {
-       int result = edl->local_session->zoom_track * 2;
-       result = MIN(result, MAX_TRACK_ZOOM);
-       zoom_track(result);
+       int zoom = edl->local_session->zoom_atrack * 2;
+       zoom = MIN(zoom, MAX_TRACK_ZOOM);
+       zoom_atrack(zoom);
+       zoom = edl->local_session->zoom_vtrack * 2;
+       zoom = MIN(zoom, MAX_TRACK_ZOOM);
+       zoom_vtrack(zoom);
        gui->zoombar->update();
        return 0;
 }
 
 int MWindow::zoom_in_t()
 {
-       int result = edl->local_session->zoom_track / 2;
-       result = MAX(result, MIN_TRACK_ZOOM);
-       zoom_track(result);
+       int zoom = edl->local_session->zoom_atrack / 2;
+       zoom = MAX(zoom, MIN_TRACK_ZOOM);
+       zoom_atrack(zoom);
+       zoom = edl->local_session->zoom_vtrack / 2;
+       zoom = MAX(zoom, MIN_TRACK_ZOOM);
+       zoom_vtrack(zoom);
        gui->zoombar->update();
        return 0;
 }
index e77c7db509603b31a79fa402cb2391c956bcde8b..cb2c240307a5568f94b886e0bc94652c02947c5a 100644 (file)
@@ -63,6 +63,7 @@ PatchGUI::PatchGUI(MWindow *mwindow,
        gang = 0;
        draw = 0;
        mute = 0;
+       zoom = 0;
        expand = 0;
        nudge = 0;
        mix = 0;
@@ -80,6 +81,7 @@ PatchGUI::~PatchGUI()
        delete gang;
        delete draw;
        delete mute;
+       delete zoom;
        delete expand;
        delete nudge;
        delete mix;
@@ -118,6 +120,7 @@ int PatchGUI::reposition(int x, int y)
                        x1 += draw->get_w();
                        mute->reposition_window(mute->get_x(), y1 + y);
                        x1 += mute->get_w();
+                       zoom->reposition_window(zoom->get_x(), y1 + y);
                }
                y1 += mwindow->theme->play_h;
        }
@@ -171,6 +174,7 @@ int PatchGUI::update(int x, int y)
                        delete gang;    gang = 0;
                        delete draw;    draw = 0;
                        delete mute;    mute = 0;
+                       delete zoom;    zoom = 0;
                }
                else {
                        play->update(track->play);
@@ -192,6 +196,7 @@ int PatchGUI::update(int x, int y)
                x1 += draw->get_w();
                patchbay->add_subwindow(mute = new MutePatch(mwindow, this, x1 + x, y1 + y));
                x1 += mute->get_w();
+               patchbay->add_subwindow(zoom = new ZoomPatch(mwindow, this, x1 + x, y1 + y));
        }
        if( play )
                y1 = y2;
@@ -574,6 +579,31 @@ int MutePatch::button_release_event()
 }
 
 
+ZoomPatch::ZoomPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
+ : BC_Tumbler(x, y)
+{
+       this->mwindow = mwindow;
+       this->patch = patch;
+       set_tooltip(_("Track Data Height"));
+}
+
+int ZoomPatch::handle_up_event()
+{
+       patch->track->data_h *= 2;
+       bclamp(patch->track->data_h,  MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
+       mwindow->edl->tracks->update_y_pixels(mwindow->theme);
+       mwindow->gui->draw_trackmovement();
+       return 1;
+}
+int ZoomPatch::handle_down_event()
+{
+       patch->track->data_h /= 2;
+       bclamp(patch->track->data_h,  MIN_TRACK_ZOOM, MAX_TRACK_ZOOM);
+       mwindow->edl->tracks->update_y_pixels(mwindow->theme);
+       mwindow->gui->draw_trackmovement();
+       return 1;
+}
+
 
 ExpandPatch::ExpandPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
  : BC_Toggle(x,
index 53ba9d20f3d617cc9b996c47da94134675777102..a120beed07dcd21e7cbb09e284c670ca6c64c71e 100644 (file)
@@ -38,6 +38,7 @@ class AutoPatch;
 class GangPatch;
 class DrawPatch;
 class MutePatch;
+class ZoomPatch;
 class ExpandPatch;
 class NudgePatch;
 class MixPatch;
@@ -82,6 +83,7 @@ public:
        GangPatch *gang;
        DrawPatch *draw;
        MutePatch *mute;
+       ZoomPatch *zoom;
        ExpandPatch *expand;
        NudgePatch *nudge;
        MixPatch *mix;
@@ -160,6 +162,16 @@ public:
        PatchGUI *patch;
 };
 
+class ZoomPatch : public BC_Tumbler
+{
+public:
+       ZoomPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
+       int handle_up_event();
+       int handle_down_event();
+       MWindow *mwindow;
+       PatchGUI *patch;
+};
+
 class ExpandPatch : public BC_Toggle
 {
 public:
index 53c116d6bf93f2a1994398d97c7cd9c5286e4212..991b85d4c65eb0ee89a9ec62d8478bf3c8df8a6d 100644 (file)
@@ -85,7 +85,7 @@ ResourcePixmap::ResourcePixmap(MWindow *mwindow,
                source_framerate = edit->nested_edl->session->frame_rate;
                source_samplerate = edit->nested_edl->session->sample_rate;
        }
-
+       data_h = edit->track->data_h;
        project_framerate = edit->edl->session->frame_rate;
        project_samplerate = edit->edl->session->sample_rate;
        edit_id = edit->id;  pixmap_w = w;  pixmap_h = h;
@@ -103,8 +103,6 @@ void ResourcePixmap::reset()
        pixmap_w = 0;
        pixmap_h = 0;
        zoom_sample = 0;
-       zoom_track = 0;
-       zoom_y = 0;
        visible = 1;
 }
 
@@ -140,8 +138,6 @@ void ResourcePixmap::update_settings(Edit *edit,
        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,
@@ -192,20 +188,20 @@ void ResourcePixmap::draw_data(TrackCanvas *canvas,
 // Redraw everything
        refresh_x = 0;
        refresh_w = pixmap_w;
+       Track *track = edit->track;
 
 // Draw background image
        if( refresh_w > 0 ) {
                int x1 = refresh_x, x2 = x1 + refresh_w;
-               int y1 = y, y2 = y1 + mwindow->edl->local_session->zoom_track;
+               int y1 = y, y2 = y1 + track->data_h;
                int color = mwindow->get_title_color(edit);
                mwindow->theme->draw_resource_bg(canvas, this, color,
-                       edit_x, edit_w, pixmap_x, x1,y1, x2,y2);
+                       edit, edit_x, edit_w, pixmap_x, x1,y1, x2,y2);
        }
 //printf("ResourcePixmap::draw_data 70\n");
 
 
 // Draw media which already exists
-       Track *track = edit->track;
        if( track->draw ) {
                switch( track->data_type )
                {
@@ -406,10 +402,9 @@ SET_TRACE
 
 int ResourcePixmap::calculate_center_pixel(Track *track)
 {
+       int data_h = track->data_h;
        int rect_audio = mwindow->preferences->rectify_audio;
-       int center_pixel = !rect_audio ?
-               mwindow->edl->local_session->zoom_track / 2 :
-               mwindow->edl->local_session->zoom_track ;
+       int center_pixel = !rect_audio ? data_h/2 : data_h;
        if( track->show_titles() )
                center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
        return center_pixel;
@@ -421,9 +416,10 @@ void ResourcePixmap::draw_audio_source(TrackCanvas *canvas, Edit *edit, int x, i
        Indexable *indexable = edit->get_source();
        int center_pixel = calculate_center_pixel(edit->track);
        int rect_audio = mwindow->preferences->rectify_audio;
-       int64_t scale_y = !rect_audio ?
-               mwindow->edl->local_session->zoom_y :
-               mwindow->edl->local_session->zoom_y * 2;
+       int data_h = edit->track->data_h;
+       int zoom_y = mwindow->edl->local_session->zoom_y * data_h /
+                       mwindow->edl->local_session->zoom_atrack;
+       int64_t scale_y = !rect_audio ? zoom_y : zoom_y*2;
        int y_max = center_pixel + scale_y / 2 - 1;
 
        double project_zoom = mwindow->edl->local_session->zoom_sample;
@@ -591,19 +587,17 @@ void ResourcePixmap::draw_audio_source(TrackCanvas *canvas, Edit *edit, int x, i
 }
 
 void ResourcePixmap::draw_wave(TrackCanvas *canvas,
-       int x, double high, double low)
+               int x, double high, double low)
 {
        int rect_audio = mwindow->preferences->rectify_audio;
        if( rect_audio ) { low = fabs(low);  high = fabs(high); }
        int top_pixel = !mwindow->edl->session->show_titles ? 0 :
                mwindow->theme->get_image("title_bg_data")->get_h();
-       int center_pixel = !rect_audio ?
-               mwindow->edl->local_session->zoom_track / 2 + top_pixel :
-               mwindow->edl->local_session->zoom_track + top_pixel ;
-       int scale_y = !rect_audio ?
-               mwindow->edl->local_session->zoom_y / 2 :
-               mwindow->edl->local_session->zoom_y ;
-       int bottom_pixel = top_pixel + mwindow->edl->local_session->zoom_track;
+       int center_pixel = !rect_audio ? data_h/2 + top_pixel : data_h + top_pixel;
+       int zoom_y = mwindow->edl->local_session->zoom_y * (int64_t)data_h /
+                       mwindow->edl->local_session->zoom_atrack;
+       int scale_y = !rect_audio ? zoom_y/2 : zoom_y;
+       int bottom_pixel = top_pixel + data_h;
        int y1 = (int)(center_pixel - low * scale_y);
        int y2 = (int)(center_pixel - high * scale_y);
        CLAMP(y1, top_pixel, bottom_pixel);
@@ -695,21 +689,18 @@ void ResourcePixmap::draw_subttl_resource(TrackCanvas *canvas, Edit *edit, int x
        SEdit *sedit = (SEdit *)edit;
        char *text = sedit->get_text();
        if( !*text || w < xS(10) ) return;
-       int center_pixel = canvas->resource_h() / 2;
+       int data_h = edit->track->data_h, center_pixel = data_h/2;
        if( edit->track->show_titles() )
                center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
-       int64_t scale_y = mwindow->edl->local_session->zoom_y;
        int x0 = edit_x;
        if( x0 < 0 ) x0 = -x0;
        int x1 = (int)(pixmap_x - x0 + x);
-       int y_max = center_pixel + scale_y / 2 - 1;
-       int font = MEDIUMFONT, color = WHITE;
+       int font = data_h >= yS(24) ? MEDIUMFONT : SMALLFONT, color = WHITE;
+       int ascent = canvas->get_text_ascent(font);
+       int y1 = center_pixel + ascent/2;
+       if( y1 < 0 ) y1 = 0;
        canvas->set_font(font);
        canvas->set_color(color);
-       int ch = canvas->get_text_height(font);
-       int hh = canvas->get_text_height(font,text) + ch/2;
-       int y1 = y_max - hh - yS(10);
-       if( y1 < 0 ) y1 = 0;
        canvas->draw_text(x1, y1, text, -1, this);
 }
 
index 3610c7a29d989a621980f3d006c847b054b2ce16..9b4e7d76b9871c591e936b5397a9ab6a65151bfc 100644 (file)
@@ -77,11 +77,12 @@ public:
        MWindowGUI *gui;
 // Visible in entire track canvas
        int visible;
+       int data_h;
 // Section drawn
        int64_t edit_id;
        int pane_number;
        int64_t edit_x, pixmap_x, pixmap_w, pixmap_h;
-       int64_t zoom_sample, zoom_track, zoom_y;
+       int64_t zoom_sample;
        int64_t startsource;
        double source_framerate, project_framerate;
        int64_t source_samplerate, project_samplerate;
index ffa6a5b1e1f5c29f80b3b8986ea9062ce9cd1267..bdd4f59a469c47b2244735b9a46fcccf8d1daf35 100644 (file)
@@ -18,6 +18,7 @@ STrack::STrack(EDL *edl, Tracks *tracks)
  : Track(edl, tracks)
 {
        data_type = TRACK_SUBTITLE;
+       data_h = edl->local_session->zoom_atrack;
 }
 
 STrack::~STrack()
@@ -65,8 +66,10 @@ void STrack::create_objects()
 int STrack::vertical_span(Theme *theme)
 {
        int track_h = Track::vertical_span(theme);
-       int patch_h = 0;
-       return track_h + patch_h;
+       int patch_h = theme->title_h;
+       if( expand_view )
+               patch_h += theme->play_h;
+       return MAX(track_h, patch_h);
 }
 
 
index f7fdee5d0433dc18b10740746d89f7a2bf45c9fc..eb908a8d9cdb2502213d028e23fcd68a3220f5c8 100644 (file)
@@ -46,7 +46,6 @@ class STrack : public Track
 {
 public:
        STrack(EDL *edl, Tracks *tracks);
-       STrack() {};
        ~STrack();
 
        int load_defaults(BC_Hash *defaults);
index 1700a5b371ea91257d4ae738d381aeb4174ef283..c1847b78edb95f22b4b6ef8229dd24fa1e168cb9 100644 (file)
@@ -24,6 +24,7 @@
 #include "clip.h"
 #include "bccolors.h"
 #include "cwindowgui.h"
+#include "edit.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "keyframegui.h"
@@ -46,6 +47,7 @@
 #include "resourcepixmap.h"
 #include "statusbar.h"
 #include "theme.h"
+#include "track.h"
 #include "timebar.h"
 #include "trackcanvas.h"
 #include "vframe.h"
@@ -871,12 +873,13 @@ void Theme::draw_rwindow_bg(RecordGUI *gui)
 }
 
 
-void Theme::draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap, int color,
-       int edit_x, int edit_w, int pixmap_x, int x1, int y1, int x2, int y2)
+void Theme::draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap,
+               int color, Edit *edit, int edit_x, int edit_w,
+               int pixmap_x, int x1, int y1, int x2, int y2)
 {
        VFrame *image = 0;
-
-       switch(mwindow->edl->local_session->zoom_track) {
+       int data_h = edit->track->data_h;
+       switch( data_h ) {
                case 1024: image = get_image("resource1024");  break;
                case 512: image = get_image("resource512");  break;
                case 256: image = get_image("resource256");  break;
index f0eb5cf2299bc3ca28729d3c5b34c5609c457545..b5b2d0599930f9baa2164f118b5470911e9dcf99 100644 (file)
@@ -27,6 +27,7 @@
 #include "bctheme.h"
 #include "compressortools.inc"
 #include "cwindowgui.inc"
+#include "edit.inc"
 #include "guicast.h"
 #include "keyframegui.inc"
 #include "levelwindowgui.inc"
@@ -105,8 +106,9 @@ public:
        virtual void draw_lwindow_bg(LevelWindowGUI *gui);
        virtual void draw_mwindow_bg(MWindowGUI *gui);
        virtual void draw_vwindow_bg(VWindowGUI *gui);
-       virtual void draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap, int color,
-               int edit_x, int edit_w, int pixmap_x, int x1, int y1, int x2, int y2);
+       virtual void draw_resource_bg(TrackCanvas *canvas, ResourcePixmap *pixmap,
+                       int color, Edit *edit, int edit_x, int edit_w,
+                       int pixmap_x, int x1, int y1, int x2, int y2);
 
        virtual void get_preferences_sizes();
        virtual void draw_preferences_bg(PreferencesWindow *gui);
index 1bffff714ff8693569a681d05138ab4e3487ea27..27cd96b5076e5f7126bee7ad59556909ff4bab98 100644 (file)
@@ -57,6 +57,7 @@ Track::Track(EDL *edl, Tracks *tracks) : ListItem<Track>()
        this->edl = edl;
        this->tracks = tracks;
        y_pixel = 0;
+       data_h = 64;
        expand_view = 0;
        draw = 1;
        gang = 1;
@@ -92,6 +93,7 @@ int Track::copy_settings(Track *track)
        this->nudge = track->nudge;
        this->mixer_id = track->mixer_id;
        this->play = track->play;
+       this->data_h = track->data_h;
        this->track_w = track->track_w;
        this->track_h = track->track_h;
        this->masks = track->masks;
@@ -207,7 +209,7 @@ int Track::vertical_span(Theme *theme)
        if( show_titles() )
                result += theme->get_image("title_bg_data")->get_h();
        if( show_assets() )
-               result += edl->local_session->zoom_track;
+               result += data_h;
        if( expand_view )
                result += plugin_set.total * theme->get_image("plugin_bg_data")->get_h();
        result = MAX(result, theme->title_h);
@@ -321,6 +323,7 @@ int Track::load(FileXML *file, int track_offset, uint32_t load_flags)
        nudge = file->tag.get_property("NUDGE", nudge);
        mixer_id = file->tag.get_property("MIXER_ID", mixer_id);
        expand_view = file->tag.get_property("EXPAND", expand_view);
+       data_h = file->tag.get_property("DATA_H", data_h);
        track_w = file->tag.get_property("TRACK_W", track_w);
        track_h = file->tag.get_property("TRACK_H", track_h);
        masks = file->tag.get_property("MASKS", masks);
@@ -856,12 +859,6 @@ int Track::dump(FILE *fp)
        return 0;
 }
 
-
-Track::Track() : ListItem<Track>()
-{
-       y_pixel = 0;
-}
-
 // ======================================== accounting
 
 int Track::number_of()
@@ -871,16 +868,6 @@ int Track::number_of()
 
 
 
-
-
-
-
-
-
-
-
-
-
 // ================================================= editing
 
 int Track::select_auto(AutoConf *auto_conf, int cursor_x, int cursor_y)
@@ -1025,6 +1012,7 @@ int Track::copy(int copy_flags, double start, double end,
        file->tag.set_property("GANG", gang);
        file->tag.set_property("DRAW", draw);
        file->tag.set_property("EXPAND", expand_view);
+       file->tag.set_property("DATA_H", data_h);
        file->tag.set_property("TRACK_W", track_w);
        file->tag.set_property("TRACK_H", track_h);
        file->tag.set_property("MASKS", masks);
index 679c3a4997aeda50662464f5cbbdc5d113d721b0..f59e989804905f877a08a25ca1cad5bf5caf8edd 100644 (file)
@@ -57,7 +57,6 @@ class Track : public ListItem<Track>
 {
 public:
        Track(EDL *edl, Tracks *tracks);
-       Track();
        virtual ~Track();
 
        void create_objects();
@@ -177,6 +176,8 @@ public:
 
 // Vertical offset from top of timeline
        int y_pixel;
+// Vertical height of the track asset
+       int data_h;
        int expand_view;
        int draw;
 // There is some debate on whether to expand gang from faders to
index fa52b9c08e8d1bc0be19a82f333a7d88c6ad857f..7d2da1e210463fe55eeef9ddab4d33572cc48495 100644 (file)
@@ -1013,8 +1013,8 @@ void TrackCanvas::get_pixmap_size(Edit *edit,
 //             }
 //     }
 
-       pixmap_h = mwindow->edl->local_session->zoom_track;
        Track *track = edit->edits->track;
+       pixmap_h = track->data_h;
        if( track->show_titles() )
                pixmap_h += mwindow->theme->get_image("title_bg_data")->get_h();
 //printf("get_pixmap_size %d %d %d %d\n", edit_x, edit_w, pixmap_x, pixmap_w);
@@ -1041,7 +1041,7 @@ void TrackCanvas::edit_dimensions(Edit *edit,
        if( edit->track->show_titles() )
                edit_h += mwindow->theme->get_image("title_bg_data")->get_h();
        if( edit->track->show_assets() )
-               edit_h += resource_h();
+               edit_h += edit->track->data_h;
        h = edit_h;
 }
 
@@ -1297,16 +1297,12 @@ void TrackCanvas::plugin_dimensions(Plugin *plugin, int64_t &x, int64_t &y, int6
        if( plugin->track->show_titles() )
                y += mwindow->theme->get_image("title_bg_data")->get_h();
        if( plugin->track->show_assets() )
-               y += resource_h();
+               y += plugin->track->data_h;
        y += plugin->plugin_set->get_number() *
                        mwindow->theme->get_image("plugin_bg_data")->get_h();
        h = mwindow->theme->get_image("plugin_bg_data")->get_h();
 }
 
-int TrackCanvas::resource_h()
-{
-       return mwindow->edl->local_session->zoom_track;
-}
 
 void TrackCanvas::draw_highlight_rectangle(int x, int y, int w, int h)
 {
@@ -1434,11 +1430,11 @@ void TrackCanvas::get_transition_coords(Edit *edit,
        int has_titles = edit->track->show_titles();
        int has_assets = edit->track->show_assets();
        double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h();
-       double asset_h = resource_h();
-       double ys = has_assets ? asset_h : has_titles ? title_bg_h : 0;
+       int data_h = edit->track->data_h;
+       double ys = has_assets ? data_h : has_titles ? title_bg_h : 0;
        double dy = has_titles ?
-               ( has_assets ? title_bg_h + asset_h/2 : title_bg_h/2 ) :
-               ( has_assets ? asset_h/2 : 0) ;
+               ( has_assets ? title_bg_h + data_h/2 : title_bg_h/2 ) :
+               ( has_assets ? data_h/2 : 0) ;
        double title_h = mwindow->theme->title_h;
        if( dy < title_h / 2 ) { ys = title_h;  dy = ys / 2; }
        y += dy;
@@ -1906,7 +1902,7 @@ void TrackCanvas::draw_hard_edges()
                        if( track->show_titles() )
                                y1 += mwindow->theme->get_image("title_bg_data")->get_h();
                        if( track->show_assets() )
-                               y1 += resource_h();
+                               y1 += track->data_h;
                        if( y1 == y )
                                y1 += mwindow->theme->title_h;
                        if( edit->hard_left ) {
@@ -2388,11 +2384,8 @@ void TrackCanvas::draw_keyframe_reticle()
        }
 }
 
-void TrackCanvas::draw_auto(Auto *current,
-       int x,
-       int y,
-       int center_pixel,
-       int zoom_track)
+void TrackCanvas::draw_auto(Auto *current, int x, int y,
+               int center_pixel, int data_h)
 {
        int x1, y1, x2, y2;
 
@@ -2401,8 +2394,8 @@ void TrackCanvas::draw_auto(Auto *current,
        y1 = center_pixel + y - HANDLE_W / 2;
        y2 = center_pixel + y + HANDLE_W / 2;
 
-       if(y1 < center_pixel + -zoom_track / 2) y1 = center_pixel + -zoom_track / 2;
-       if(y2 > center_pixel + zoom_track / 2) y2 = center_pixel + zoom_track / 2;
+       if( y1 < center_pixel - data_h/2 ) y1 = center_pixel - data_h/2;
+       if( y2 > center_pixel + data_h/2 ) y2 = center_pixel + data_h/2;
 
        draw_box(x1, y1, x2 - x1, y2 - y1);
 }
@@ -2455,23 +2448,16 @@ void TrackCanvas::draw_cropped_line(int x1,
 }
 
 
-void TrackCanvas::draw_floatauto(FloatAuto *current,
-       int x,
-       int y,
-       int in_x,
-       int in_y,
-       int out_x,
-       int out_y,
-       int center_pixel,
-       int zoom_track,
-       int color)
+void TrackCanvas::draw_floatauto(FloatAuto *current, int x, int y,
+               int in_x, int in_y, int out_x, int out_y,
+               int center_pixel, int data_h, int color)
 {
        int x1 = x - HANDLE_W / 2; // Center
        int x2 = x + HANDLE_W / 2;
        int y1 = center_pixel + y - HANDLE_H / 2;
        int y2 = center_pixel + y + HANDLE_H / 2;
-       int ymin = center_pixel - zoom_track / 2;
-       int ymax = center_pixel + zoom_track / 2;
+       int ymin = center_pixel - data_h / 2;
+       int ymax = center_pixel + data_h / 2;
        CLAMP(y1, ymin, ymax);
        CLAMP(y2, ymin, ymax);
 
@@ -2501,22 +2487,22 @@ void TrackCanvas::draw_floatauto(FloatAuto *current,
                return;
 
        if(in_x != x)
-               draw_floatauto_ctrlpoint(x, y, in_x, in_y, center_pixel, zoom_track, color);
+               draw_floatauto_ctrlpoint(x, y, in_x, in_y, center_pixel, data_h, color);
        if(out_x != x)
-               draw_floatauto_ctrlpoint(x, y, out_x, out_y, center_pixel, zoom_track, color);
+               draw_floatauto_ctrlpoint(x, y, out_x, out_y, center_pixel, data_h, color);
 }
 
 inline int quantize(float f) { return (int)floor(f + 0.5); }
 
 inline void TrackCanvas::draw_floatauto_ctrlpoint(
-       int x, int y, int cp_x, int cp_y, int center_pixel,
-       int zoom_track, int color)
+               int x, int y, int cp_x, int cp_y, int center_pixel,
+               int data_h, int color)
 // draw the tangent and a handle for given bézier ctrl point
 {
-       bool handle_visible = (abs(cp_y) <= zoom_track / 2);
+       bool handle_visible = (abs(cp_y) <= data_h/2);
 
        float slope = (float)(cp_y - y)/(cp_x - x);
-       CLAMP(cp_y, -zoom_track / 2, zoom_track / 2);
+       CLAMP(cp_y, -data_h/2, data_h/2);
        if(slope != 0)
                cp_x = x + quantize((cp_y - y) / slope);
 
@@ -2558,7 +2544,7 @@ inline void TrackCanvas::draw_floatauto_ctrlpoint(
 
 
 int TrackCanvas::test_auto(Auto *current,
-       int x, int y, int center_pixel, int zoom_track,
+       int x, int y, int center_pixel, int data_h,
        int cursor_x, int cursor_y, int buttonpress)
 {
        int x1, y1, x2, y2;
@@ -2568,8 +2554,8 @@ int TrackCanvas::test_auto(Auto *current,
        x2 = x + HANDLE_W / 2;
        y1 = center_pixel + y - HANDLE_H / 2;
        y2 = center_pixel + y + HANDLE_H / 2;
-       int ymin = center_pixel - zoom_track / 2;
-       int ymax = center_pixel + zoom_track / 2;
+       int ymin = center_pixel - data_h/2;
+       int ymax = center_pixel + data_h/2;
        CLAMP(y1, ymin, ymax);
        CLAMP(y2, ymin, ymax);
 
@@ -2645,7 +2631,7 @@ float TrackCanvas::value_to_percentage(float auto_value, int autogrouptype)
 
 
 int TrackCanvas::test_floatauto(FloatAuto *current, int x, int y, int in_x,
-       int in_y, int out_x, int out_y, int center_pixel, int zoom_track,
+       int in_y, int out_x, int out_y, int center_pixel, int data_h,
        int cursor_x, int cursor_y, int buttonpress, int autogrouptype)
 {
        int result = 0;
@@ -2654,8 +2640,8 @@ int TrackCanvas::test_floatauto(FloatAuto *current, int x, int y, int in_x,
        int x2 = x + HANDLE_W / 2;
        int y1 = center_pixel + y - HANDLE_W / 2;
        int y2 = center_pixel + y + HANDLE_W / 2;
-       int ymin = center_pixel - zoom_track / 2;
-       int ymax = center_pixel + zoom_track / 2;
+       int ymin = center_pixel - data_h/2;
+       int ymax = center_pixel + data_h/2;
        CLAMP(y1, ymin, ymax);
        CLAMP(y2, ymin, ymax);
 
@@ -3084,12 +3070,12 @@ void TrackCanvas::calculate_viewport(Track *track,
        int has_titles = track->show_titles();
        int has_assets = track->show_assets();
        double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h();
-       double asset_h = resource_h();
        double title_h = mwindow->theme->title_h;
-       double ys = has_assets ? asset_h : has_titles ? title_bg_h : 0;
+       double data_h = track->data_h;
+       double ys = has_assets ? data_h : has_titles ? title_bg_h : 0;
        double dy = has_titles ?
-               ( has_assets ? title_bg_h + asset_h/2 : title_bg_h/2) :
-               ( has_assets ? asset_h/2 : 0) ;
+               ( has_assets ? title_bg_h + data_h/2 : title_bg_h/2) :
+               ( has_assets ? data_h/2 : 0) ;
        if( dy < title_h/2 ) { ys = title_h;  dy = ys / 2; }
        yscale = ys;
        center_pixel = y + dy;
@@ -3590,7 +3576,7 @@ int TrackCanvas::do_plugin_autos(Track *track, int cursor_x, int cursor_y,
                if( track->show_titles() )
                        center_pixel += mwindow->theme->get_image("title_bg_data")->get_h();
                if( track->show_assets() )
-                       center_pixel += resource_h();
+                       center_pixel += track->data_h;
                center_pixel += (i + 0.5) * mwindow->theme->get_image("plugin_bg_data")->get_h();
 
                for(Plugin *plugin = (Plugin*)plugin_set->first;
index 4b9c4eba22736a68f8c5be3f8fd9013260ea6f44..006b7805eb3201bcbb5455742d43da8081513d99 100644 (file)
@@ -99,41 +99,18 @@ public:
        void draw_automation();
        void draw_hard_edges();
        void draw_inout_points();
-       void draw_auto(Auto *current,
-               int x,
-               int y,
-               int center_pixel,
-               int zoom_track);
-       void draw_floatauto(FloatAuto *current,
-               int x,
-               int y,
-               int in_x,
-               int in_y,
-               int out_x,
-               int out_y,
-               int center_pixel,
-               int zoom_track,
-               int color);
-       int test_auto(Auto *current,
-               int x,
-               int y,
-               int center_pixel,
-               int zoom_track,
-               int cursor_x,
-               int cursor_y,
-               int buttonpress);
-       int test_floatauto(FloatAuto *current,
-               int x,
-               int y,
-               int in_x,
-               int in_y,
-               int out_x,
-               int out_y,
-               int center_pixel,
-               int zoom_track,
-               int cursor_x,
-               int cursor_y,
-               int buttonpress,
+       void draw_auto(Auto *current, int x, int y,
+               int center_pixel, int data_h);
+       void draw_floatauto(FloatAuto *current, int x, int y,
+               int in_x, int in_y, int out_x, int out_y,
+               int center_pixel, int data_h, int color);
+       int test_auto(Auto *current, int x, int y,
+               int center_pixel, int data_h,
+               int cursor_x, int cursor_y, int buttonpress);
+       int test_floatauto(FloatAuto *current, int x, int y,
+               int in_x, int in_y, int out_x, int out_y,
+               int center_pixel, int data_h,
+               int cursor_x, int cursor_y, int buttonpress,
                int autogrouptype);
        void draw_floatline(int center_pixel,
                FloatAuto *previous,
@@ -366,7 +343,6 @@ public:
        void update_drag_caption();
 
        int get_title_h();
-       int resource_h();
 
 // Display hourglass if timer expired
        void test_timer();
index 7fdf492124b4a03808bbc7931d65b07a874b837c..c8a6abd4df022c43c730f092492a71f232926974 100644 (file)
@@ -652,7 +652,7 @@ int Tracks::totalpixels()
        int result = 0;
        for(Track* current = first; current; current = NEXT)
        {
-               result += edl->local_session->zoom_track;
+               result += current->data_h;
        }
        return result;
 }
index 826144ad4121b2646d00a68d84914743be51e294..d99f913e1ab77bc785f08742b37ff8a19591f68d 100644 (file)
@@ -52,6 +52,7 @@ VTrack::VTrack(EDL *edl, Tracks *tracks)
  : Track(edl, tracks)
 {
        data_type = TRACK_VIDEO;
+       data_h = edl->local_session->zoom_vtrack;
        draw = 1;
 }
 
index cdc4badd3a4cd663b0487f2c3d2e90d8cc6b60e4..a54b808570fd470c13a335a3afe090597a25d912 100644 (file)
@@ -57,18 +57,10 @@ public:
        double to_doubleunits(double position);
        double from_units(int64_t position);
 
-       void calculate_input_transfer(int asset_w,
-               int asset_h,
-               int64_t position,
-               int direction,
-               float &in_x,
-               float &in_y,
-               float &in_w,
-               float &in_h,
-               float &out_x,
-               float &out_y,
-               float &out_w,
-               float &out_h);
+       void calculate_input_transfer(int asset_w, int asset_h,
+               int64_t position, int direction,
+               float &in_x, float &in_y, float &in_w, float &in_h,
+               float &out_x, float &out_y, float &out_w, float &out_h);
 
        void calculate_output_transfer(int64_t position, int direction,
                float &in_x, float &in_y, float &in_w, float &in_h,
@@ -83,7 +75,6 @@ public:
 
 
 // ====================================== initialization
-       VTrack() {};
        int create_derived_objs(int flash);
 
 
index 733e5bc7132151f37801bd7990843ca69f558e82..04db03688d85ab3d58add849b97aabd6e7515916 100644 (file)
@@ -53,21 +53,11 @@ int VTrack::create_derived_objs(int flash)
 {
        int i;
        edits = new VEdits(mwindow, this);
-       camera_autos = new BezierAutos(this,
-                                                                       WHITE,
-                                                                       0,
-                                                                       0,
-                                                                       1,
-                                                                       mwindow->track_w,
-                                                                       mwindow->track_h);
-
-       projector_autos = new BezierAutos(this,
-                                                                       WHITE,
-                                                                       0,
-                                                                       0,
-                                                                       1,
-                                                                       mwindow->output_w,
-                                                                       mwindow->output_h);
+       camera_autos = new BezierAutos(this, WHITE,
+               0, 0, 1, mwindow->track_w, mwindow->track_h);
+
+       projector_autos = new BezierAutos(this, WHITE,
+               0, 0, 1, mwindow->output_w, mwindow->output_h);
 
        fade_autos = new FloatAutos(this, LTGREY, -100, 100);
        fade_autos->create_objects();
@@ -75,9 +65,9 @@ int VTrack::create_derived_objs(int flash)
        if(mwindow->gui)
        {
                if(mwindow->session->tracks_vertical)
-               draw(pixel, mwindow->zoom_track, 0, tracks->canvas->h, flash);
+                       draw(pixel, data_h, 0, tracks->canvas->h, flash);
                else
-               draw(0, tracks->canvas->w, pixel, mwindow->zoom_track, flash);
+                       draw(0, tracks->canvas->w, pixel, data_h, flash);
        }
 }
 
@@ -243,20 +233,12 @@ int VTrack::paste_auto_silence_derived(long start, long end)
 int VTrack::draw_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf)
 {
                if(auto_conf->camera)
-                       camera_autos->draw(tracks->canvas,
-                                                       pixel,
-                                                       mwindow->zoom_track,
-                                                       zoom_units,
-                                                       view_start,
-                                                       mwindow->session->tracks_vertical);
+                       camera_autos->draw(tracks->canvas, pixel, data_h,
+                               zoom_units, view_start, mwindow->session->tracks_vertical);
 
                if(auto_conf->projector)
-                       projector_autos->draw(tracks->canvas,
-                                                       pixel,
-                                                       mwindow->zoom_track,
-                                                       zoom_units,
-                                                       view_start,
-                                                       mwindow->session->tracks_vertical);
+                       projector_autos->draw(tracks->canvas, pixel, data_h,
+                               zoom_units, view_start, mwindow->session->tracks_vertical);
 }
 
 int VTrack::select_translation(int cursor_x, int cursor_y)
@@ -266,7 +248,7 @@ int VTrack::select_translation(int cursor_x, int cursor_y)
        float view_start, view_units, zoom_units;
        get_dimensions(view_start, view_units, zoom_units);
 
-       if(cursor_y > pixel && cursor_y < pixel + mwindow->zoom_track)
+       if(cursor_y > pixel && cursor_y < pixel + data_h)
        {
                for(Edit* current = edits->first; current && !result; current = NEXT)
                {
@@ -316,30 +298,16 @@ int VTrack::select_auto_derived(float zoom_units, float view_start, AutoConf *au
        int result = 0;
 
        if(auto_conf->camera)
-               result = camera_autos->select_auto(tracks->canvas,
-                                               pixel,
-                                               mwindow->zoom_track,
-                                               zoom_units,
-                                               view_start,
-                                               cursor_x,
-                                               cursor_y,
-                                               tracks->canvas->shift_down(),
-                                               tracks->canvas->ctrl_down(),
-                                               tracks->canvas->get_buttonpress(),
-                                               mwindow->session->tracks_vertical);
+               result = camera_autos->select_auto(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, cursor_x, cursor_y,
+                       tracks->canvas->shift_down(), tracks->canvas->ctrl_down(),
+                       tracks->canvas->get_buttonpress(), mwindow->session->tracks_vertical);
 
        if(auto_conf->projector && !result)
-               result = projector_autos->select_auto(tracks->canvas,
-                                               pixel,
-                                               mwindow->zoom_track,
-                                               zoom_units,
-                                               view_start,
-                                               cursor_x,
-                                               cursor_y,
-                                               tracks->canvas->shift_down(),
-                                               tracks->canvas->ctrl_down(),
-                                               tracks->canvas->get_buttonpress(),
-                                               mwindow->session->tracks_vertical);
+               result = projector_autos->select_auto(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, cursor_x, cursor_y,
+                       tracks->canvas->shift_down(), tracks->canvas->ctrl_down(),
+                       tracks->canvas->get_buttonpress(), mwindow->session->tracks_vertical);
 
        return result;
 }
@@ -351,26 +319,14 @@ int VTrack::move_auto_derived(float zoom_units, float view_start, AutoConf *auto
        result = 0;
 
        if(auto_conf->camera)
-               result = camera_autos->move_auto(tracks->canvas,
-                                       pixel,
-                                       mwindow->zoom_track,
-                                       zoom_units,
-                                       view_start,
-                                       cursor_x,
-                                       cursor_y,
-                                       shift_down,
-                                       mwindow->session->tracks_vertical);
+               result = camera_autos->move_auto(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, cursor_x, cursor_y,
+                       shift_down, mwindow->session->tracks_vertical);
 
        if(auto_conf->projector && !result)
-               result = projector_autos->move_auto(tracks->canvas,
-                                       pixel,
-                                       mwindow->zoom_track,
-                                       zoom_units,
-                                       view_start,
-                                       cursor_x,
-                                       cursor_y,
-                                       shift_down,
-                                       mwindow->session->tracks_vertical);
+               result = projector_autos->move_auto(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, cursor_x, cursor_y,
+                       shift_down, mwindow->session->tracks_vertical);
 
        if(result)
        {
@@ -386,20 +342,12 @@ int VTrack::move_auto_derived(float zoom_units, float view_start, AutoConf *auto
 int VTrack::draw_floating_autos_derived(float view_start, float zoom_units, AutoConf *auto_conf, int flash)
 {
        if(auto_conf->camera)
-               camera_autos->draw_floating_autos(tracks->canvas,
-                               pixel,
-                               mwindow->zoom_track,
-                               zoom_units,
-                               view_start,
-                               mwindow->session->tracks_vertical, flash);
+               camera_autos->draw_floating_autos(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, mwindow->session->tracks_vertical, flash);
 
        if(auto_conf->projector)
-               projector_autos->draw_floating_autos(tracks->canvas,
-                               pixel,
-                               mwindow->zoom_track,
-                               zoom_units,
-                               view_start,
-                               mwindow->session->tracks_vertical, flash);
+               projector_autos->draw_floating_autos(tracks->canvas, pixel, data_h,
+                       zoom_units, view_start, mwindow->session->tracks_vertical, flash);
 }
 
 int VTrack::release_auto_derived()
index 20e4a9ae47f263a6e5a93da440cc4b1a59d97175..79d862fb2c0237406b5098a60f29db105f95801a 100644 (file)
@@ -56,7 +56,8 @@ ZoomBar::~ZoomBar()
 {
        delete sample_zoom;
        delete amp_zoom;
-       delete track_zoom;
+       delete atrack_zoom;
+       delete vtrack_zoom;
 }
 
 void ZoomBar::create_objects()
@@ -74,10 +75,14 @@ void ZoomBar::create_objects()
        amp_zoom->create_objects();
        amp_zoom->set_tooltip(_("Audio waveform scale"));
        x += amp_zoom->get_w();
-       track_zoom = new TrackZoomPanel(mwindow, this, x, y);
-       track_zoom->create_objects();
-       track_zoom->set_tooltip(_("Height of tracks in the timeline"));
-       x += track_zoom->get_w() + xs10;
+       atrack_zoom = new ATrackZoomPanel(mwindow, this, x, y);
+       atrack_zoom->create_objects();
+       atrack_zoom->set_tooltip(_("Height of audio tracks in the timeline"));
+       x += atrack_zoom->get_w() + xs10;
+       vtrack_zoom = new VTrackZoomPanel(mwindow, this, x, y);
+       vtrack_zoom->create_objects();
+       vtrack_zoom->set_tooltip(_("Height of video tracks in the timeline"));
+       x += vtrack_zoom->get_w() + xs10;
 
        int wid = xS(120);
        for( int i=AUTOGROUPTYPE_AUDIO_FADE; i<=AUTOGROUPTYPE_Y; ++i ) {
@@ -90,12 +95,7 @@ void ZoomBar::create_objects()
 #define DEFAULT_TEXT "000.00 to 000.00"
        add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 0));
        x += auto_zoom->get_w();
-       add_subwindow(auto_zoom_text = new ZoomTextBox(
-               mwindow,
-               this,
-               x,
-               y,
-               DEFAULT_TEXT));
+       add_subwindow(auto_zoom_text = new ZoomTextBox(mwindow, this, x, y, DEFAULT_TEXT));
        x += auto_zoom_text->get_w() + xs5;
        add_subwindow(auto_zoom = new AutoZoom(mwindow, this, x, y, 1));
        update_autozoom();
@@ -209,7 +209,8 @@ int ZoomBar::update()
 {
        sample_zoom->update(mwindow->edl->local_session->zoom_sample);
        amp_zoom->update(mwindow->edl->local_session->zoom_y);
-       track_zoom->update(mwindow->edl->local_session->zoom_track);
+       atrack_zoom->update(mwindow->edl->local_session->zoom_atrack);
+       vtrack_zoom->update(mwindow->edl->local_session->zoom_vtrack);
        update_autozoom();
        update_clocks();
        return 0;
@@ -380,7 +381,7 @@ int SampleZoomPanel::handle_event()
 
 AmpZoomPanel::AmpZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
  : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_y,
-               x, y, xS(100), MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG)
+               x, y, xS(80), MIN_AMP_ZOOM, MAX_AMP_ZOOM, ZOOM_LONG)
 {
        this->mwindow = mwindow;
        this->zoombar = zoombar;
@@ -391,21 +392,32 @@ int AmpZoomPanel::handle_event()
        return 1;
 }
 
-TrackZoomPanel::TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
- : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_track,
-               x, y, xS(90), MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG)
+ATrackZoomPanel::ATrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+ : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_atrack,
+               x, y, xS(64), MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG)
 {
        this->mwindow = mwindow;
        this->zoombar = zoombar;
 }
-int TrackZoomPanel::handle_event()
+int ATrackZoomPanel::handle_event()
 {
-       mwindow->zoom_track((int64_t)get_value());
+       mwindow->zoom_atrack((int64_t)get_value());
        zoombar->amp_zoom->update(mwindow->edl->local_session->zoom_y);
        return 1;
 }
 
-
+VTrackZoomPanel::VTrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y)
+ : ZoomPanel(mwindow, zoombar, mwindow->edl->local_session->zoom_vtrack,
+               x, y, xS(64), MIN_TRACK_ZOOM, MAX_TRACK_ZOOM, ZOOM_LONG)
+{
+       this->mwindow = mwindow;
+       this->zoombar = zoombar;
+}
+int VTrackZoomPanel::handle_event()
+{
+       mwindow->zoom_vtrack((int64_t)get_value());
+       return 1;
+}
 
 
 AutoZoom::AutoZoom(MWindow *mwindow, ZoomBar *zoombar, int x, int y, int changemax)
index 107500e0aa3707e660598a4204220616b488bb1e..7d717a99f59e083ac3dced4d675934ed91ba005c 100644 (file)
@@ -53,7 +53,8 @@ public:
        MWindowGUI *gui;
        SampleZoomPanel *sample_zoom;
        AmpZoomPanel *amp_zoom;
-       TrackZoomPanel *track_zoom;
+       ATrackZoomPanel *atrack_zoom;
+       VTrackZoomPanel *vtrack_zoom;
        AutoZoom *auto_zoom;
        AutoTypeMenu *auto_type;
        ZoomTextBox *auto_zoom_text;
@@ -84,10 +85,19 @@ public:
        ZoomBar *zoombar;
 };
 
-class TrackZoomPanel : public ZoomPanel
+class ATrackZoomPanel : public ZoomPanel
 {
 public:
-       TrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
+       ATrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
+       int handle_event();
+       MWindow *mwindow;
+       ZoomBar *zoombar;
+};
+
+class VTrackZoomPanel : public ZoomPanel
+{
+public:
+       VTrackZoomPanel(MWindow *mwindow, ZoomBar *zoombar, int x, int y);
        int handle_event();
        MWindow *mwindow;
        ZoomBar *zoombar;
index 29c89aa76e94b754bae7fac7c11a15b752f2414a..a61d58c20801d2034161dc35b1e882599a67d997 100644 (file)
@@ -25,7 +25,8 @@
 class ZoomBar;
 class SampleZoomPanel;
 class AmpZoomPanel;
-class TrackZoomPanel;
+class ATrackZoomPanel;
+class VTrackZoomPanel;
 class AutoZoom;
 class AutoTypeMenu;
 class ZoomTextBox;
index fb5a9fbaee1bd967c911a7ea22f92d8855ad88bf..1c08f7f1837d7c56f94de25b5978d50dca245015 100644 (file)
@@ -120,7 +120,7 @@ void ZoomPanel::update_menu()
 void ZoomPanel::create_objects()
 {
        subwindow->add_subwindow(zoom_text = new ZoomPopup(mwindow, this, x, y));
-       x += zoom_text->get_w();
+       x += zoom_text->get_w() - xS(3);
        subwindow->add_subwindow(zoom_tumbler = new ZoomTumbler(mwindow, this, x, y));
        calculate_menu();
 }
@@ -267,7 +267,7 @@ double ZoomPanel::text_to_zoom(char *text, int use_table)
 
 ZoomPopup::ZoomPopup(MWindow *mwindow, ZoomPanel *panel, int x, int y)
  : BC_PopupMenu(x, y, panel->w, panel->value_to_text(panel->value, 0),
-       1, mwindow->theme->get_image_set("zoombar_menu", 0))
+       1, mwindow->theme->get_image_set("zoombar_menu", 0), 0)
 {
        this->mwindow = mwindow;
        this->panel = panel;
diff --git a/cinelerra-5.1/expanders.fr b/cinelerra-5.1/expanders.fr
new file mode 100644 (file)
index 0000000..57119ca
--- /dev/null
@@ -0,0 +1,258 @@
+Video Effects
+       - Correction de couleurs
+               Blue Banana
+               Brightness/Contrast
+               C41
+               Color 3 Way
+               Color Balance
+               ColorSpace
+               Gamma
+               Gradient
+               HistEq
+               Histogram
+               Histogram Bezier
+               Hue saturation
+               Interpolate Bayer
+               Invert Video
+               RGBShift
+               RGB - 601
+               Reroute
+               Sketcher
+               Swap channels
+               Threshold
+               VideoScope
+               YUV
+               YUV411
+               YUVShift
+       - FF Correction de couleurs
+               F_chromahold
+               F_colorbalance
+               F_colorchannelmixer
+               F_colorkey
+               F_colorlevels
+               F_colormatrix
+               F_colorspace
+               F_curves
+               F_elbg
+               F_eq
+               F_fftfilt
+               F_floodfill
+               F_greyedge
+               F_haldclutsrc
+               F_histeq
+               F_histogram
+               F_limiter
+               F_lut
+               F_lut1d
+               F_lut3d
+               F_lutrgb
+               F_lutyuv
+               F_negate
+               F_normalize
+               F_pseudocolor
+               F_separatefields
+               F_setparams
+               F_setrange
+               F_shuffleplanes
+               F_swapuv
+               F_tlut2
+               F_vignette
+               F_vibrance
+       - Motion
+               Motion
+               Motion 2 Point
+               Motion51
+               MotionCV
+               MotionHV
+               F_dejudder
+               F_deshake
+       - Flou
+               Blur
+               BoxBlur
+               Edge
+               Linear Blur
+               Motion Blur
+               Radial Blur
+               Sharpen
+               Unsharp
+               Zoom Blur
+               F_avgblur
+               F_boxblur
+               F_deband
+               F_deblock
+               F_edgedetect
+               F_gblur
+               F_sab
+               F_smartblur
+               F_unsharp
+       - Débruitage
+               DeScratch
+               Denoise video
+               DotTV
+               Selective Temporal Averaging
+               Time Average
+               F_atadenoise
+               F_bitplanenoise
+               F_dctdnoiz
+               F_fftdnoiz
+               F_hqdn3d
+               F_nlmeans
+               F_noise
+               F_owdenoise
+               F_removegrain
+               F_vaguedenoiser
+       - Extract Keys
+               Blue Banana
+               Chroma key
+               Chroma key (HSV)
+               CriKey
+               Difference key
+               F_chromakey
+               F_despill
+               F_lumakey
+       - Géométrie
+               Auto Scale
+               Crop & Position
+               Flip
+               Lens
+               Perspective
+               Polar
+               Rotate
+               Rumbler
+               Scale
+               Scale Ratio
+               Sketcher
+               Sphere Cam
+               Translate
+               Whirl
+               Wave
+               F_cropdetect
+               F_crop
+               F_cover_rect
+               F_drawbox
+               F_drawgraph
+               F_drawgrid
+               F_fillborders
+               F_hflip
+               F_lenscorrection
+               F_pad
+               F_perspective
+               F_rotate
+               F_scale
+               F_super2xsai
+               F_swaprect
+               F_tile
+               F_vflip
+       - Échelle
+               Auto Scale
+               Downsample
+               F_hqx
+               F_scale
+               F_super2xsai
+               F_xbr
+               Scale
+               Scale Ratio
+       - Gestion Temporelle
+               Decimate
+               Delay Video
+               Freeze Frame
+               Loop video
+               Interpolate Video
+               ReframeRT
+               Reverse video
+               Time Average
+               TimeFront
+               F_amplify
+               F_deflicker
+               F_framerate
+               F_framestep
+               F_loop
+               F_mpdecimate
+               F_realtime
+               F_tblend
+               F_tinterlace
+               F_tmix
+               F_vfrdet
+       - Test
+               F_bench
+               F_bbox
+               F_ciescope
+               F_color
+               F_datascope
+               F_entropy
+               F_graphmonitor
+               F_mptestsrc
+               F_oscilloscope
+               F_pal100bars
+               F_pal75bars
+               F_pixscope
+               F_rgbtestsrc
+               F_showpalette
+               F_signalstats
+               F_smptebars
+               F_smptehdbars
+               F_testsrc
+               F_testsrc2
+               F_vectorscope
+               F_yuvtestsrc
+               F_waveform
+Audio Effects
+       - Calf
+               - Instruments / Générateurs 
+                       L2_Calf Organ
+                       L2_Calf Monosynth
+                       L2_Calf Fluidsynth
+                       L2_Calf Wavetable
+               - Effets de modulation 
+                       L2_Calf Multi Chorus
+                       L2_Calf Phaser
+                       L2_Calf Flanger
+                       L2_Calf Rotary Speaker
+                       L2_Calf Pulsator
+                       L2_Calf Ring Modulator
+               - Effets de délais 
+                       L2_Calf Reverb
+                       L2_Calf Vintage Delay
+                       L2_Calf Compensation Delay Line
+                       L2_Calf Reverse Delay
+               - Processeurs dynamiques 
+                       L2_Calf Compressor
+                       L2_Calf Sidechain Compressor
+                       L2_Calf Multiband Compressor
+                       L2_Calf Mono Compressor
+                       L2_Calf Deeser
+                       L2_Calf Gate
+                       L2_Calf Sidechain Gate
+                       L2_Calf Multiband Gate
+                       L2_Calf Limiter
+                       L2_Calf Multiband Limiter
+                       L2_Calf Sidechain Limiter
+                       L2_Calf Transient Designer
+               - Filtres et égalisateurs 
+                       L2_Calf Filter
+                       L2_Calf Filterclavier
+                       L2_Calf Envelope Filter
+                       L2_Calf Emphasis
+                       L2_Calf Vocoder
+                       L2_Calf 5-Band Equalizer
+                       L2_Calf 8-Band Equalizer
+                       L2_Calf 12-Band Equalizer
+                       L2_Calf 30-Band Equalizer
+               - Effets de distorsion 
+                       L2_Calf Saturator
+                       L2_Calf Exciter
+                       L2_Calf Bass Enhancer
+                       L2_Calf Tape Simulator
+                       L2_Calf Vinyl
+                       L2_Calf Crusher
+               - Outils
+                       L2_Calf Mono Input
+                       L2_Calf Pitch Tools
+                       L2_Calf Stereo Tools
+                       L2_Calf Haas Stereo Enhancer
+                       L2_Calf Multi Spread
+                       L2_Calf Multiband Enhancer
+                       L2_Calf X-Over 2 Band
+                       L2_Calf X-Over 3 Band
+                       L2_Calf X-Over 4 Band
+                       L2_Calf Analyzer
index 9c5d5bcf3cdd78f9e97b1e3dc6083d061ffd8da8..7c8fb1e96f5fc531c761d0699764c545bc5754e2 100644 (file)
@@ -291,12 +291,12 @@ void BoxBlurConfig::interpolate(BoxBlurConfig &prev, BoxBlurConfig &next,
        double v = 1. - u;
        this->horz_radius = u*prev.horz_radius + v*next.horz_radius;
        this->vert_radius = u*prev.vert_radius + v*next.vert_radius;
-       this->power = u*prev.power + v*next.power;
+       this->power = u*prev.power + v*next.power + 1e-6; // avoid truncation jitter
        this->drag = prev.drag;
        this->box_x = u*prev.box_x + v*next.box_x;
        this->box_y = u*prev.box_y + v*next.box_y;
-       this->box_w = u*prev.box_w + v*next.box_w;
-       this->box_h = u*prev.box_h + v*next.box_h;
+       this->box_w = u*prev.box_w + v*next.box_w + 1e-6;
+       this->box_h = u*prev.box_h + v*next.box_h + 1e-6;
 }