X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowmove.C;h=89aaaee1d457e997842141d6e96316a1ce95db33;hb=c9c0e07706fad701a70ee0d1ffb0fcb6304f138c;hp=5abe4e6c20b15cf77c96a46d198f0856b19a085f;hpb=fbdd13b462256ed4f3b35dc114385fe0b0de0dcd;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 5abe4e6c..89aaaee1 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -356,17 +356,13 @@ void MWindow::zoom_amp(int64_t zoom_amp) 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 / old_zoom); - CLAMP(edl->local_session->zoom_y, MIN_AMP_ZOOM, MAX_AMP_ZOOM); + CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM); + edl->local_session->zoom_atrack = zoom; -// scale tracks 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); + track->data_h = zoom; } // shift row position for( int i=0; ilocal_session->track_start[i] = @@ -378,12 +374,12 @@ void MWindow::zoom_atrack(int64_t zoom) void MWindow::zoom_vtrack(int64_t zoom) { int64_t old_zoom = edl->local_session->zoom_vtrack; -// scale tracks + CLAMP(zoom, MIN_TRACK_ZOOM, MAX_TRACK_ZOOM); 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); + track->data_h = zoom; } // shift row position for( int i=0; ilocal_session->track_start[i] = @@ -660,7 +656,7 @@ int MWindow::nearest_plugin_keyframe(int shift_down, int dir) double position = dir == PLAY_FORWARD ? end : start; double new_position = dir == PLAY_FORWARD ? start : end; for( Track *track=edl->tracks->first; track; track=track->next ) { - if( !track->record ) continue; + if( !track->is_armed() ) continue; for( int i=0; iplugin_set.size(); ++i ) { PluginSet *plugin_set = track->plugin_set[i]; int64_t pos = track->to_units(position, 0); @@ -698,7 +694,7 @@ int MWindow::nearest_auto_keyframe(int shift_down, int dir) double position = dir == PLAY_FORWARD ? end : start; double new_position = dir == PLAY_FORWARD ? start : end; for( Track *track=edl->tracks->first; track; track=track->next ) { - if( !track->record ) continue; + if( !track->is_armed() ) continue; int64_t pos = track->to_units(position, 0); for( int i=0; iautomation->autos[i]; @@ -760,21 +756,37 @@ int MWindow::find_selection(double position, int scroll_display) double MWindow::get_position() { - return edl->local_session->get_selectionstart(1); + return edl->local_session->get_selectionstart(1); } void MWindow::set_position(double position) { - if( position != get_position() ) { - if( position < 0 ) position = 0; - edl->local_session->set_selectionstart(position); - edl->local_session->set_selectionend(position); - gui->lock_window(); - find_cursor(); - gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); - gui->unlock_window(); - cwindow->update(1, 0, 0, 0, 0); - } + if( position != get_position() ) { + if( position < 0 ) position = 0; + edl->local_session->set_selectionstart(position); + edl->local_session->set_selectionend(position); + gui->lock_window(); + find_cursor(); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); + gui->unlock_window(); + cwindow->update(1, 0, 0, 0, 0); + } +} + + +double MWindow::get_timecode_offset() +{ + return edl->session->timecode_offset; +} + +void MWindow::set_timecode_offset(double offset) +{ + edl->session->time_format = TIME_TIMECODE; + edl->session->timecode_offset = offset; + gui->lock_window(); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); + gui->unlock_window(); + cwindow->update(1, 0, 0, 0, 0); }