rework deglitch/optimize/stop_playback, sams ladspa icons, reticle color, tweak frame...
authorGood Guy <good1.2guy@gmail.com>
Tue, 14 Nov 2017 18:47:08 +0000 (11:47 -0700)
committerGood Guy <good1.2guy@gmail.com>
Tue, 14 Nov 2017 18:47:08 +0000 (11:47 -0700)
40 files changed:
cinelerra-5.1/cinelerra/atrack.C
cinelerra-5.1/cinelerra/atrack.h
cinelerra-5.1/cinelerra/cwindow.C
cinelerra-5.1/cinelerra/cwindow.h
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/edits.C
cinelerra-5.1/cinelerra/edits.h
cinelerra-5.1/cinelerra/edl.C
cinelerra-5.1/cinelerra/edl.h
cinelerra-5.1/cinelerra/maskauto.C
cinelerra-5.1/cinelerra/menueffects.C
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/playback3d.C
cinelerra-5.1/cinelerra/playbackengine.C
cinelerra-5.1/cinelerra/playbackengine.h
cinelerra-5.1/cinelerra/record.C
cinelerra-5.1/cinelerra/render.C
cinelerra-5.1/cinelerra/resourcethread.C
cinelerra-5.1/cinelerra/resourcethread.h
cinelerra-5.1/cinelerra/track.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/vwindow.C
cinelerra-5.1/cinelerra/vwindow.h
cinelerra-5.1/cinelerra/zwindow.C
cinelerra-5.1/cinelerra/zwindow.h
cinelerra-5.1/picon/cinfinity/impulse_1885.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/multivoice_chorus_1201.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/pitch_scale_1193.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/plate_1423.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/pointer_cast_1910.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/rate_shifter_1417.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/retro_flange_1208.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/revdelay_1605.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/ringmod_1188.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/sc1_1425.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/sc2_1426.png [new file with mode: 0644]
cinelerra-5.1/picon/cinfinity/sc3_1427.png [new file with mode: 0644]

index 9aceea0926604109c78a98e3dc5bc5cde2901086..ee39162ac00b6ceffd6987477d592b3c0d059807 100644 (file)
@@ -175,15 +175,3 @@ int ATrack::paste_derived(int64_t start, int64_t end, int64_t total_length, File
        return 0;
 }
 
-void ATrack::deglitch(double position, 
-       int edit_labels, int edit_plugins, int edit_autos)
-{
-       int64_t samples = to_units(position, 0);
-       edits->deglitch(samples);
-       if( edit_plugins ) {
-               for(int i = 0; i < plugin_set.size(); i++) {
-                       plugin_set.get(i)->deglitch(samples);
-               }
-       }
-}
-
index 74a4d935fe9e7202086ad250585d4561586804ed..0295697f03fe9e6abff39a35c8a49407d1d319dd 100644 (file)
@@ -33,8 +33,6 @@
 #include "track.h"
 
 
-
-
 class ATrack : public Track
 {
 public:
@@ -58,33 +56,15 @@ public:
        double to_doubleunits(double position);
        double from_units(int64_t position);
 
-
-
-
-
-
-
-
 // ====================================== initialization
        int create_derived_objs(int flash);
 
-
-
-
 // ===================================== editing
        int paste_derived(int64_t start, int64_t end, int64_t total_length, FileXML *xml, int &current_channel);
-
-
        int modify_handles(int64_t oldposition, int64_t newposition, int currentend);
-       void deglitch(double position, 
-               int edit_labels,
-               int edit_plugins,
-               int edit_autos);
 
        int64_t length();
-//     int get_dimensions(double &view_start,
-//             double &view_units,
-//             double &zoom_units);
+//     int get_dimensions(double &view_start, double &view_units, double &zoom_units);
 };
 
 #endif
index 176bf3c425b5cfc6e9de8ac1019fc6b6973185a0..c292d66db2650b55672fb1841d4d40424c3d8957 100644 (file)
@@ -215,12 +215,9 @@ void CWindow::calculate_affected_autos(FloatAuto **x_auto,
        }
 }
 
-void CWindow::stop_playback()
+void CWindow::stop_playback(int wait)
 {
-       int locked = gui->get_window_lock();
-       if( locked ) gui->unlock_window();
-       playback_engine->interrupt_playback(1);
-       if( locked ) gui->lock_window("CWindow::stop_playback");
+       playback_engine->stop_playback(wait);
 }
 
 void CWindow::run()
index 3d81ce09e4961f3665b165d56afb12d01933c0e8..33c43a1dae587d5fe34b9d6dc4c6242d950e47e0 100644 (file)
@@ -69,7 +69,7 @@ public:
        void show_window();
        void hide_window();
        int update_position(double position);
-       void stop_playback();
+       void stop_playback(int wait);
 
        int destination;
        MWindow *mwindow;
index 95bae3979ce8071ca20358da276f75e33ea4b67c..cb2dbac9d02fb4dc1a2b0707688b185a21401eb8 100644 (file)
@@ -604,7 +604,7 @@ int CWindowGUI::drag_stop()
                if(mwindow->session->drag_assets->total)
                {
                        mwindow->gui->lock_window("CWindowGUI::drag_stop 1");
-                       mwindow->clear(0, 1);
+                       mwindow->clear(0);
                        mwindow->load_assets(mwindow->session->drag_assets,
                                mwindow->edl->local_session->get_selectionstart(),
                                LOADMODE_PASTE,
@@ -619,7 +619,7 @@ int CWindowGUI::drag_stop()
                if(mwindow->session->drag_clips->total)
                {
                        mwindow->gui->lock_window("CWindowGUI::drag_stop 2");
-                       mwindow->clear(0, 1);
+                       mwindow->clear(0);
                        mwindow->paste_edls(mwindow->session->drag_clips,
                                LOADMODE_PASTE,
                                mwindow->session->track_highlighted,
index 6c512009ad0d3fbea04729f974e2d5919f988825..9024af904728c9d1653c275796a7841d7ed6cb7c 100644 (file)
@@ -295,25 +295,20 @@ void Edits::resample(double old_rate, double new_rate)
        }
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
+int Edits::is_glitch(Edit *edit)
+{
+       if( track->data_type != TRACK_AUDIO ) return 0;
+       int64_t threshold = edl->session->frame_rate > 0 ?
+               0.5 * edl->session->sample_rate / edl->session->frame_rate : 0;
+// audio edit shorter than .5 frames is a glitch
+       return edit->length < threshold ? 1 : 0;
+}
 
 int Edits::optimize()
 {
        int result = 1;
        Edit *current;
 
-
 //printf("Edits::optimize %d\n", __LINE__);
 // Sort edits by starting point
        while(result)
@@ -379,43 +374,55 @@ int Edits::optimize()
                        current = next;
                }
 
-//printf("Edits::optimize %d result=%d\n", __LINE__, result);
-// merge same files or transitions
-               if(track->data_type == TRACK_SUBTITLE ) continue;
-
-               for(current = first; !result && current && current->next; ) {
-                       Edit *next_edit = current->next;
-// printf("Edits::optimize %d %lld=%lld %d=%d %p=%p %p=%p\n",
-// __LINE__, current->startsource + current->length, next_edit->startsource,
-// current->channel, next_edit->channel, current->asset, next_edit->asset,
-// current->nested_edl, next_edit->nested_edl);
-
+// merge same files or transitions, and deglitch
+               if( !result && track->data_type != TRACK_SUBTITLE ) {
+                       current = first;
+                       if( current && !current->hard_right &&
+                           current->next && !current->next->hard_left &&
+                           is_glitch(current) ) {
+// if the first edit is a glitch, change it to silence
+                               current->asset = 0;
+                               current->nested_edl = 0;
+                       }
+                       Edit *next_edit = 0;
+                       for( ; current && (next_edit=current->next); current=NEXT ) {
 // both edges are not hard edges
+                               if( current->hard_right || next_edit->hard_left ) continue;
+// next edit is a glitch
+                               if( is_glitch(next_edit) )
+                                       break;
 // both edits are silence & not a plugin
-// source channels are identical, assets are identical
-                       if( !current->hard_right && !next_edit->hard_left && (
-                           (current->silence() && next_edit->silence() && !current->is_plugin) ||
-                           (current->startsource + current->length == next_edit->startsource &&
-                            current->channel == next_edit->channel &&
-                            current->asset == next_edit->asset &&
-                            current->nested_edl == next_edit->nested_edl)) ) {
-//printf("Edits::optimize %d\n", __LINE__);
-                               current->length += next_edit->length;
-                               remove(next_edit);
-                               result = 1;
-                               break;
-                       }
-
-                       current = current->next;
+                               if( !current->is_plugin && current->silence() &&
+                                   !next_edit->is_plugin && next_edit->silence() )
+                                       break;
+// source channels are identical & assets are identical
+                               if( !result && current->channel == next_edit->channel &&
+                                   current->asset == next_edit->asset &&
+                                   current->nested_edl == next_edit->nested_edl ) {
+//  and stop and start in the same frame
+                                       int64_t current_end = current->startsource + current->length;
+                                       int64_t next_start = next_edit->startsource;
+                                       if( current_end == next_start ||
+                                           EQUIV(edl->frame_align(track->from_units(current_end), 1),
+                                                 edl->frame_align(track->from_units(next_start), 1)) )
+                                               break;
+                               }
+                       }
+                       if( next_edit ) {
+                               int64_t current_start = current->startproject;
+                               int64_t next_end = next_edit->startproject + next_edit->length;
+                               current->length = next_end - current_start;
+                               remove(next_edit);
+                               result = 1;
+                       }
                }
 
-               if(last && last->silence() && !last->transition ) {
+               if( last && last->silence() && !last->transition ) {
                        delete last;
                        result = 1;
                }
        }
 
-//track->dump();
        return 0;
 }
 
@@ -593,7 +600,7 @@ void Edits::clear(int64_t start, int64_t end)
                end = this->length();
        }
 
-       if(edit1 != edit2)
+       if( edit1 && edit2 && edit1 != edit2)
        {
 // in different edits
 
@@ -844,124 +851,3 @@ void Edits::shift_effects_recursive(int64_t position, int64_t length, int edit_a
        track->shift_effects(position, length, edit_autos);
 }
 
-// only used for audio but also used for plugins which inherit from Edits
-void Edits::deglitch(int64_t position)
-{
-// range from the splice junk appears
-       int64_t threshold = (int64_t)((double)edl->session->sample_rate / 
-               edl->session->frame_rate) / 2;
-       Edit *current = 0;
-
-// the last edit before the splice
-       Edit *edit1 = 0;
-       if(first)
-       {
-               for(current = first; current; current = NEXT)
-               {
-                       if(current->startproject + current->length >= position - threshold)
-                       {
-                               edit1 = current;
-                               break;
-                       }
-               }
-
-// ignore if it ends after the splice
-               if(current && current->startproject + current->length >= position)
-               {
-                       edit1 = 0;
-               }
-       }
-
-// the first edit after the splice
-       Edit *edit2 = 0;
-       if(last)
-       {
-               for(current = last; current; current = PREVIOUS)
-               {
-                       if(current->startproject < position + threshold)
-                       {
-                               edit2 = current;
-                               break;
-                       }
-               }
-
-       // ignore if it starts before the splice
-               if(current && current->startproject < position)
-               {
-                       edit2 = 0;
-               }
-       }
-
-
-
-
-// printf("Edits::deglitch %d position=%ld edit1=%p edit2=%p\n", __LINE__,
-// position, 
-// edit1, 
-// edit2);
-// delete junk between the edits
-       if(edit1 != edit2)
-       {
-               if(edit1 != 0)
-               {
-// end the starting edit later
-                       current = edit1->next;
-                       while(current != 0 &&
-                               current != edit2 &&
-                               current->startproject < position)
-                       {
-                               Edit* next = NEXT;
-
-                               edit1->length += current->length;
-                               remove(current);
-
-                               current = next;
-                       }
-               }
-               
-               if(edit2 != 0)
-               {
-// start the ending edit earlier
-                       current = edit2->previous;
-                       while(current != 0 && 
-                               current != edit1 &&
-                               current->startproject >= position)
-                       {
-                               Edit *previous = PREVIOUS;
-
-                               int64_t length = current->length;
-//printf("Edits::deglitch %d length=%ld\n", __LINE__, length);
-                               if(!edit2->silence() && 
-                                       length > edit2->startsource)
-                               {
-                                       length = edit2->startsource;
-                               }
-
-                               // shift edit2 by using material from its source
-                               edit2->startproject -= length;
-                               edit2->startsource -= length;
-                               // assume enough is at the end
-                               edit2->length += length;
-
-                               // shift edit2 & its source earlier by remainder
-                               if(length < current->length)
-                               {
-                                       int64_t remainder = current->length - length;
-                                       edit2->startproject -= remainder;
-                                       // assume enough is at the end
-                                       edit2->length += remainder;
-                               }
-
-                               remove(current);
-
-
-                               current = previous;
-                       }
-               }
-       }
-       
-}
-
-
-
-
index 040c6bfa4cba746101b9d4269e3f12edf41106c4..c0f2cdf0bbfd753c4167f7d9c2a6b70cd84eefe4 100644 (file)
@@ -111,6 +111,8 @@ public:
        Edit* get_playable_edit(int64_t position, int use_nudge);
 //     int64_t total_length();
        int64_t length();         // end position of last edit
+// audio edit shorter than .5 frames is a glitch
+       int is_glitch(Edit *edit);
 
 // ==================================== editing
 
@@ -123,7 +125,6 @@ public:
                int edit_plugins,
                int edit_autos,
                Edits *trim_edits);
-       void deglitch(int64_t position);
        virtual int optimize();
 
        virtual int clone_derived(Edit* new_edit, Edit* old_edit) { return 0; }
index 12fe4f35ea2e6e93f5a69410a364078ed2eae229..9b4e9c142bf6358c4250d05dd98e981441ed2196 100644 (file)
@@ -825,24 +825,9 @@ void EDL::set_outpoint(double position)
        }
 }
 
-void EDL::deglitch(double position)
-{
-       if( !session->cursor_on_frames ) return;
-       Track *current_track = tracks->first; 
-       for( ; current_track; current_track=current_track->next ) {
-               if( !current_track->record ) continue;
-               if( current_track->data_type != TRACK_AUDIO ) continue;
-               ATrack *atrack = (ATrack*)current_track;
-               atrack->deglitch(position, 
-                       session->labels_follow_edits, 
-                       session->plugins_follow_edits, 
-                       session->autos_follow_edits);
-       }
-}
-
 int EDL::blade(double position)
 {
-       return tracks->blade(align_to_frame(position,0));
+       return tracks->blade(position);
 }
 
 int EDL::clear(double start, double end,
@@ -1334,15 +1319,20 @@ void EDL::get_shared_tracks(Track *track,
        }
 }
 
-// Convert position to frames if cursor alignment is enabled
+// aligned frame time
+double EDL::frame_align(double position, int round)
+{
+       double frame_pos = position * session->frame_rate;
+       frame_pos = (int64_t)(frame_pos + (round ? 0.5 : 1e-6));
+       position = frame_pos / session->frame_rate;
+       return position;
+}
+
+// Convert position to frames if alignment is enabled.
 double EDL::align_to_frame(double position, int round)
 {
-       if( session->cursor_on_frames && session->frame_rate > 0 ) {
-               double frame_no = position * session->frame_rate;
-               int64_t frame_pos = frame_no + (round ? 0.5 : 1e-6);
-               double pos = frame_pos / session->frame_rate;
-               if( !EQUIV(pos, position) ) position = pos;
-       }
+       if( session->cursor_on_frames )
+               position = frame_align(position, round);
        return position;
 }
 
index 00f31bb0aaa6f1f5f40881cb72f6c328ef4d2576..13fd8d5df61c41cbbd37f873cebb629334f36646 100644 (file)
@@ -95,7 +95,9 @@ public:
                int direction,
                PlayableTracks *playable_tracks);
 
-// Convert position to frames if cursor alignment is enabled
+// Convert position to frame boundry times
+       double frame_align(double position, int round);
+// frame align if cursor alignment is enabled
        double align_to_frame(double position, int round);
 
 // increase track w/h to at least session w/h
index b9681418f5297dbac53f575718f44549a21382c3..a4b64a849ad537ca796116d353ea9be937581123 100644 (file)
@@ -71,6 +71,7 @@ SubMask::SubMask(MaskAuto *keyframe)
 
 SubMask::~SubMask()
 {
+       points.remove_all_objects();
 }
 
 int SubMask::equivalent(SubMask& ptr)
index b1f8a050d6f1482c791ae9001cc8e91bb4b7ffd1..12f43384e0cb34d8ca7fc8c1bba19fb13cfdf90a 100644 (file)
@@ -516,7 +516,7 @@ void MenuEffectThread::run()
 
                mwindow->undo->update_undo_before("", 0);
                if(load_mode == LOADMODE_PASTE)
-                       mwindow->clear(0, 1);
+                       mwindow->clear(0);
 
                mwindow->load_assets(&assets, -1, load_mode, 0, 0,
                        mwindow->edl->session->labels_follow_edits,
index 448f37b659fefc58afcc22f0493b2ea1e4217e72..ae471267a903a2c8801aadff8fa68feff2b893ec 100644 (file)
@@ -237,10 +237,8 @@ MWindow::MWindow()
 MWindow::~MWindow()
 {
        run_lock->lock("MWindow::~MWindow");
-       stop_playback(1);
        in_destructor = 1;
 //printf("MWindow::~MWindow %d\n", __LINE__);
-       gui->stop_drawing();
        gui->remote_control->deactivate();
        gui->record->stop();
 #ifdef HAVE_DVB
@@ -1563,23 +1561,20 @@ int MWindow::put_commercial()
 
 void MWindow::stop_playback(int wait)
 {
-       int locked  = gui->get_window_lock();
-       if( locked ) gui->unlock_window();
        gui->stop_drawing();
 
-       cwindow->stop_playback();
+       cwindow->stop_playback(wait);
 
        for(int i = 0; i < vwindows.size(); i++) {
                VWindow *vwindow = vwindows[i];
                if( !vwindow->is_running() ) continue;
-               vwindow->stop_playback();
+               vwindow->stop_playback(wait);
        }
        for(int i = 0; i < zwindows.size(); i++) {
                ZWindow *zwindow = zwindows[i];
                if( !zwindow->is_running() ) continue;
-               zwindow->stop_playback();
+               zwindow->stop_playback(wait);
        }
-       if( locked ) gui->lock_window("MWindow::stop_playback");
 }
 
 int MWindow::load_filenames(ArrayList<char*> *filenames,
@@ -1597,7 +1592,9 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
 
 // Need to stop playback since tracking depends on the EDL not getting
 // deleted.
+       gui->unlock_window();
        stop_playback(1);
+       gui->lock_window("MWindow::load_filenames 0");
 
 if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
        undo->update_undo_before();
@@ -3376,17 +3373,10 @@ int MWindow::create_aspect_ratio(float &w, float &h, int width, int height)
 
 void MWindow::reset_caches()
 {
-       stop_playback(1);
-       int locked  = gui->get_window_lock();
-       if( locked ) gui->unlock_window();
-       gui->resource_thread->stop_draw(1);
-       gui->resource_thread->source_lock->lock("MWindow::reset_caches");
        frame_cache->remove_all();
        wave_cache->remove_all();
        audio_cache->remove_all();
        video_cache->remove_all();
-       gui->resource_thread->source_lock->unlock();
-       if( locked ) gui->lock_window("MWindow::reset_caches");
        if( cwindow->playback_engine ) {
                if( cwindow->playback_engine->audio_cache )
                        cwindow->playback_engine->audio_cache->remove_all();
@@ -3406,17 +3396,10 @@ void MWindow::reset_caches()
 
 void MWindow::remove_asset_from_caches(Asset *asset)
 {
-       stop_playback(1);
-       int locked  = gui->get_window_lock();
-       if( locked ) gui->unlock_window();
-       gui->resource_thread->stop_draw(1);
-       gui->resource_thread->source_lock->lock("MWindow::remove_asset_from_caches");
        frame_cache->remove_asset(asset);
        wave_cache->remove_asset(asset);
        audio_cache->delete_entry(asset);
        video_cache->delete_entry(asset);
-       gui->resource_thread->source_lock->unlock();
-       if( locked ) gui->lock_window("MWindow::remove_asset_from_caches");
        if( cwindow->playback_engine && cwindow->playback_engine->audio_cache )
                cwindow->playback_engine->audio_cache->delete_entry(asset);
        if( cwindow->playback_engine && cwindow->playback_engine->video_cache )
index 6bf48433fbd3dccd13934562128075295241c019..f15081b63b6adc296bbda43bd641198fed6420a8 100644 (file)
@@ -202,7 +202,7 @@ public:
        static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
        static int plugin_exists(char *plugin_path);
        void dump_plugindb(FILE *fp);
-       void stop_playback(int wait=0);
+       void stop_playback(int wait);
 
        void queue_mixers(EDL *edl, int command, int wait_tracking,
                int use_inout, int update_refresh, int toggle_audio);
@@ -324,7 +324,7 @@ public:
 // Clears active region in EDL.
 // If clear_handle, edit boundaries are cleared if the range is 0.
 // Called by paste, record, menueffects, render, and CWindow drop.
-       void clear(int clear_handle, int deglitch);
+       void clear(int clear_handle);
        void clear_labels();
        int clear_labels(double start, double end);
        void concatenate_tracks();
index 168b7c9320245bde8d47445ac7ea860803e5712a..e128a19bfdd68767466fd22ecaf1706fae82c107 100644 (file)
@@ -301,7 +301,7 @@ void MWindow::asset_to_rate()
 void MWindow::clear_entry()
 {
        undo->update_undo_before();
-       clear(1, 1);
+       clear(1);
 
        edl->optimize();
        save_backup();
@@ -315,7 +315,7 @@ void MWindow::clear_entry()
                send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
 }
 
-void MWindow::clear(int clear_handle, int deglitch)
+void MWindow::clear(int clear_handle)
 {
        double start = edl->local_session->get_selectionstart();
        double end = edl->local_session->get_selectionend();
@@ -326,12 +326,6 @@ void MWindow::clear(int clear_handle, int deglitch)
                        edl->session->plugins_follow_edits,
                        edl->session->autos_follow_edits);
        }
-       
-// always needed by paste operations
-       if(deglitch)
-       {
-               edl->deglitch(start);
-       }
 }
 
 void MWindow::set_automation_mode(int mode)
@@ -550,8 +544,6 @@ void MWindow::cut(double start, double end, double new_position)
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
-       edl->deglitch(start);
-
 
        edl->optimize();
        save_backup();
@@ -892,14 +884,12 @@ void MWindow::finish_modify_handles()
 //printf("MWindow::finish_modify_handles %d\n", __LINE__);
                edl->local_session->set_selectionstart(session->drag_position);
                edl->local_session->set_selectionend(session->drag_position);
-               edl->deglitch(session->drag_position);
        }
        else
        if( edit_mode != MOVE_NO_EDITS ) {
 //printf("MWindow::finish_modify_handles %d\n", __LINE__);
                edl->local_session->set_selectionstart(session->drag_start);
                edl->local_session->set_selectionend(session->drag_start);
-               edl->deglitch(session->drag_start);
        }
 
 // clamp the selection to 0
@@ -1081,10 +1071,7 @@ void MWindow::mute_selection()
                edl->paste_silence(start, end, 0,
                        edl->session->plugins_follow_edits,
                        edl->session->autos_follow_edits);
-               edl->deglitch(start);
-               edl->deglitch(end);
 
-               
                save_backup();
                undo->update_undo_after(_("mute"), LOAD_EDITS);
 
@@ -1146,7 +1133,7 @@ int MWindow::paste(double start,
        int edit_plugins,
        int edit_autos)
 {
-       clear(0, 1);
+       clear(0);
 
 // Want to insert with assets shared with the master EDL.
        insert(start, file,
@@ -1169,7 +1156,7 @@ void MWindow::paste()
                gui->from_clipboard(string, len, BC_PRIMARY_SELECTION);
                FileXML file;
                file.read_from_string(string);
-               clear(0, 1);
+               clear(0);
 
                insert(start, &file,
                        edl->session->labels_follow_edits,
@@ -1648,8 +1635,6 @@ void MWindow::paste_silence()
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
-       edl->deglitch(start);
-       edl->deglitch(end);
        edl->optimize();
        save_backup();
        undo->update_undo_after(_("silence"), LOAD_EDITS | LOAD_TIMEBAR);
@@ -1902,20 +1887,8 @@ void MWindow::set_transition_length(double length)
 
 void MWindow::redo_entry(BC_WindowBase *calling_window_gui)
 {
-
        calling_window_gui->unlock_window();
-
-       cwindow->playback_engine->que->
-               send_command(STOP, CHANGE_NONE, 0, 0);
-       cwindow->playback_engine->interrupt_playback(0);
-
-       for( int i = 0; i < vwindows.size(); i++ ) {
-               if( vwindows.get(i)->is_running() ) {
-                       vwindows.get(i)->playback_engine->que->
-                               send_command(STOP, CHANGE_NONE, 0, 0);
-                       vwindows.get(i)->playback_engine->interrupt_playback(0);
-               }
-       }
+       stop_playback(0);
 
        cwindow->gui->lock_window("MWindow::redo_entry");
        for( int i = 0; i < vwindows.size(); i++ ) {
@@ -2187,10 +2160,6 @@ void MWindow::trim_selection()
                edl->session->labels_follow_edits,
                edl->session->plugins_follow_edits,
                edl->session->autos_follow_edits);
-       edl->deglitch(0);
-       edl->deglitch(edl->local_session->get_selectionend() -
-               edl->local_session->get_selectionstart());
-       
 
        save_backup();
        undo->update_undo_after(_("trim selection"), LOAD_EDITS | LOAD_TIMEBAR);
@@ -2207,19 +2176,7 @@ void MWindow::trim_selection()
 void MWindow::undo_entry(BC_WindowBase *calling_window_gui)
 {
        calling_window_gui->unlock_window();
-
-       cwindow->playback_engine->que->
-               send_command(STOP, CHANGE_NONE, 0, 0);
-       cwindow->playback_engine->interrupt_playback(0);
-
-//printf("MWindow::undo_entry %d %d\n", __LINE__, vwindows.size());
-       for( int i = 0; i < vwindows.size(); i++ ) {
-               if( vwindows.get(i)->is_running() ) {
-                       vwindows.get(i)->playback_engine->que->
-                               send_command(STOP, CHANGE_NONE, 0, 0);
-                       vwindows.get(i)->playback_engine->interrupt_playback(0);
-               }
-       }
+       stop_playback(0);
 
        cwindow->gui->lock_window("MWindow::undo_entry 1");
        for( int i = 0; i < vwindows.size(); i++ ) {
index 14df0a12900a26add674d579d44724b05a327268..d157d58a4f34a7a4a9abaecf77d8c139e2a72dcd 100644 (file)
@@ -94,18 +94,7 @@ void New::create_new_edl()
 
 int New::create_new_project()
 {
-       mwindow->cwindow->playback_engine->que->send_command(STOP,
-               CHANGE_NONE, 0, 0);
-
-       for( int i=0; i<mwindow->vwindows.size(); ++i ) {
-               VWindow *vwindow = mwindow->vwindows.get(i);
-               if( !vwindow->is_running() ) continue;
-               vwindow->playback_engine->que->send_command(STOP, CHANGE_NONE, 0, 0);
-               vwindow->playback_engine->interrupt_playback(0);
-       }
-
-       mwindow->cwindow->playback_engine->interrupt_playback(0);
-
+       mwindow->stop_playback(0);
        mwindow->gui->lock_window();
        mwindow->reset_caches();
 
index 3dcb00df660075fdbea4983907ae5825aa1d6659..835d8a22898c4abe9f3a67674bac7f7b5bcf2b53 100644 (file)
@@ -1260,6 +1260,7 @@ void Playback3D::do_mask_sync(Playback3DCommand *command)
 // Need to tabulate every vertex in persistent memory because
 // gluTessVertex doesn't copy them.
                        ArrayList<GLdouble*> coords;
+                       coords.set_array_delete();
                        for(int i = 0; i < points->total; i++)
                        {
                                MaskPoint *point1 = points->values[i];
index 0918ead4e449ae1232459214f575698973ffdb2c..2842377a4f567bebca237e326308e227a8c8a1c0 100644 (file)
@@ -415,10 +415,10 @@ void PlaybackEngine::run()
 }
 
 
-void PlaybackEngine::stop_playback()
+void PlaybackEngine::stop_playback(int wait)
 {
        que->send_command(STOP, CHANGE_NONE, 0, 0);
-       interrupt_playback(1);
+       interrupt_playback(wait);
        renderengine_lock->lock("PlaybackEngine::stop_playback");
        if(render_engine)
                render_engine->wait_done();
index 1dd0482e3232218620c48e376be3aa04aa267d14..5d915877eece836e0345e683c100cb2934167263 100644 (file)
@@ -81,7 +81,7 @@ public:
        ChannelDB* get_channeldb();
 
        void run();
-       void stop_playback();
+       void stop_playback(int wait);
        void issue_command(EDL *edl, int command, int wait_tracking,
                int use_inout, int update_refresh, int toggle_audio);
 
index 3ea53a42ffa4a82da550707c819d252afc8c1ce1..ece6d088a3710079dad8afd721771c103ec9cb90 100644 (file)
@@ -405,7 +405,7 @@ void Record::run()
                        mwindow->undo->update_undo_before();
 // For pasting, clear the active region
                        if(load_mode == LOADMODE_PASTE)
-                               mwindow->clear(0, 1);
+                               mwindow->clear(0);
                        int loadmode = load_mode == LOADMODE_RESOURCESONLY ?
                                LOADMODE_ASSETSONLY : load_mode;
                        mwindow->paste_edls(&new_edls, loadmode, 0, -1,
index 433876bbdad6afd6871b18a5f28212c546316ee9..5ce0354170f9edfb2ad7fb301a853f4c79efaea4 100644 (file)
@@ -970,7 +970,7 @@ if(debug) printf("Render::render %d\n", __LINE__);
                ArrayList<Indexable*> *assets = render->packages->get_asset_list();
 if(debug) printf("Render::render %d\n", __LINE__);
                if(render->load_mode == LOADMODE_PASTE)
-                       mwindow->clear(0, 1);
+                       mwindow->clear(0);
 if(debug) printf("Render::render %d\n", __LINE__);
                mwindow->load_assets(assets, -1, render->load_mode, 0, 0,
                        mwindow->edl->session->labels_follow_edits,
index 62aee466094c33fdc751cc803bdcc969b5cd8d78..2e53c4da4f6415038793af88d6cbc373747c3a15 100644 (file)
@@ -164,7 +164,6 @@ ResourceThread::ResourceThread(MWindow *mwindow, MWindowGUI *gui)
        temp_picon = 0;
        temp_picon2 = 0;
        draw_lock = new Condition(0, "ResourceThread::draw_lock", 0);
-       source_lock = new Condition(1, "ResourceThread::source_lock", 0);
        item_lock = new Mutex("ResourceThread::item_lock");
        audio_buffer = 0;
        for(int i = 0; i < MAXCHANNELS; i++)
@@ -186,7 +185,6 @@ ResourceThread::~ResourceThread()
 {
        stop();
        delete draw_lock;
-       delete source_lock;
        delete item_lock;
        delete temp_picon;
        delete temp_picon2;
@@ -298,7 +296,6 @@ void ResourceThread::run()
        {
 
                draw_lock->lock("ResourceThread::run");
-               source_lock->lock("ResourceThread::run");
                while(!interrupted)
                {
 // Pull off item
@@ -329,7 +326,6 @@ void ResourceThread::run()
                get_audio_source(0);
                get_video_source(0);
                mwindow->age_caches();
-               source_lock->unlock();
        }
 }
 
index 34cb6c07c3d3aa879b34e84c181723d95d3356e6..0d165ff5ccf3b6105d78f13715da0e2811bc539e 100644 (file)
@@ -159,7 +159,6 @@ public:
        MWindow *mwindow;
        MWindowGUI *gui;
        Condition *draw_lock;
-       Condition *source_lock;
        Mutex *item_lock;
        ArrayList<ResourceThreadItem*> items;
        int interrupted;
index 1a11c434b6f2e4e978ee0203ee0a46a275b561ca..bfd53ecac49b3cdc63cd162d27f255bd58a13053 100644 (file)
@@ -1155,7 +1155,7 @@ int Track::copy_assets(double start,
 
 int Track::blade(double position)
 {
-       int64_t start = to_units(position, 1);
+       int64_t start = to_units(position, 0);
        Edit *edit = edits->split_edit(start);
        if( !edit ) return 1;
        edit->hard_left = 1;
index 00ca2b6392588eb75c9f2be0085f630100ffae4f..81537be29f3f9e1ce65397cb531cf277f8705379 100644 (file)
@@ -512,6 +512,7 @@ int64_t TrackCanvas::drop_edit_position(int *is_insertion, Edit *moved_edit, int
        int cursor_x = get_relative_cursor_x();
        double zoom_scale = (double)mwindow->edl->session->sample_rate / mwindow->edl->local_session->zoom_sample;
        double drop_time = (cursor_x + mwindow->edl->local_session->view_start[pane->number]) / zoom_scale;
+       drop_time = mwindow->edl->align_to_frame(drop_time, 0);
        // we use cursor position for affinity calculations
        int64_t cursor_position = track->to_units(drop_time, 0);
        if( cursor_position <= 0 ) {
@@ -520,7 +521,7 @@ int64_t TrackCanvas::drop_edit_position(int *is_insertion, Edit *moved_edit, int
        }
        if( moved_edit )  // relative cursor position depends upon drop point
                drop_time -= mwindow->session->drag_position - moved_edit->track->from_units(moved_edit->startproject);
-       int64_t drop_position = track->to_units(drop_time, 1);
+       int64_t drop_position = track->to_units(drop_time, 0);
        if( !moved_edit )  // for clips and assets acts as they were grabbed in the middle
                drop_position -= moved_edit_length / 2;
        Edit *last_edit = track->edits->last;
@@ -587,6 +588,7 @@ int64_t TrackCanvas::drop_plugin_position(PluginSet *plugin_set, Plugin *moved_p
        int cursor_x = get_relative_cursor_x();
        double zoom_scale = (double)mwindow->edl->session->sample_rate / mwindow->edl->local_session->zoom_sample;
        double drop_time = (cursor_x + mwindow->edl->local_session->view_start[pane->number]) / zoom_scale;
+       drop_time = mwindow->edl->align_to_frame(drop_time, 0);
        // we use cursor position for affinity calculations
        int64_t cursor_position = track->to_units(drop_time, 0);
        if( cursor_position <= 0 ) return 0;
@@ -2178,7 +2180,7 @@ void TrackCanvas::draw_keyframe_reticle()
                                if( !autos ) continue;
                                for( Auto *auto_keyframe=autos->first; auto_keyframe;
                                     auto_keyframe = auto_keyframe->next ) {
-                                       draw_hairline(auto_keyframe, GREEN);
+                                       draw_hairline(auto_keyframe, BLUE);
                                }
                        }
 
@@ -4418,15 +4420,21 @@ int TrackCanvas::do_edit_handles(int cursor_x, int cursor_y, int button_press,
                                if( left_edit ) {
                                        int64_t left_edge = left_edit->startproject;
                                        double left_position = track->from_units(left_edge);
-                                       if( EQUIV(edge_position, left_position) )
+                                       if( EQUIV(edge_position, left_position) ) {
                                                left_edit->hard_left = new_status;
+                                               if( left_edit->previous )
+                                                       left_edit->previous->hard_right = new_status;
+                                       }
                                }
                                Edit *right_edit = track->edits->editof(track_position, PLAY_REVERSE, 0);
                                if( right_edit ) {
                                        int64_t right_edge = right_edit->startproject + right_edit->length;
                                        double right_position = track->from_units(right_edge);
-                                       if( EQUIV(edge_position, right_position) )
+                                       if( EQUIV(edge_position, right_position) ) {
                                                right_edit->hard_right = new_status;
+                                               if( right_edit->next )
+                                                       right_edit->next->hard_left = new_status;
+                                       }
                                }
                        }
                }
index e22dcde06972f8b47a193c60ba12bbf8946fc051..717972a1e663a15554cca1c1cd011f4535e113c4 100644 (file)
@@ -340,12 +340,9 @@ void VWindow::update_position(int change_type,
        }
 }
 
-void VWindow::stop_playback()
+void VWindow::stop_playback(int wait)
 {
-       int locked = gui->get_window_lock();
-       if( locked ) gui->unlock_window();
-       playback_engine->interrupt_playback(1);
-       if( locked ) gui->lock_window("VWindow::stop_playback");
+       playback_engine->stop_playback(wait);
 }
 
 int VWindow::update_position(double position)
index 9029596e0bc64d62a425d3eec69122fee4fccd70..fb5268be679f480e9488fca7d4994d37a6e690c3 100644 (file)
@@ -76,7 +76,7 @@ public:
        void delete_source(int do_main_edl, int update_gui);
        void goto_start();
        void goto_end();
-       void stop_playback();
+       void stop_playback(int wait);
 
        VTracking *playback_cursor;
 
index 22c8250b78006ea5c1e31521fd1136d5e8e88221..46e00a91336f16338f7dba8326132b824f0b6109 100644 (file)
@@ -222,12 +222,9 @@ void ZWindow::change_source(EDL *edl)
        }
 }
 
-void ZWindow::stop_playback()
+void ZWindow::stop_playback(int wait)
 {
-       int locked = zgui->get_window_lock();
-       if( locked ) zgui->unlock_window();
-       zgui->playback_engine->interrupt_playback(1);
-       if( locked ) zgui->lock_window("ZWindow::stop_playback");
+       zgui->playback_engine->stop_playback(wait);
 }
 
 void ZWindow::issue_command(int command, int wait_tracking,
index 33babfd5036f8d1a1a99596cd2048bad952667f2..528d576dd0f7c8b7b19c122e484fcae86e2dfd08 100644 (file)
@@ -70,7 +70,7 @@ public:
        void handle_done_event(int result);
        void handle_close_event(int result);
        void change_source(EDL *edl);
-       void stop_playback();
+       void stop_playback(int wait);
        void issue_command(int command, int wait_tracking,
                int use_inout, int update_refresh, int toggle_audio);
        void update_mixer_ids();
diff --git a/cinelerra-5.1/picon/cinfinity/impulse_1885.png b/cinelerra-5.1/picon/cinfinity/impulse_1885.png
new file mode 100644 (file)
index 0000000..c7b0c5f
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/impulse_1885.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/multivoice_chorus_1201.png b/cinelerra-5.1/picon/cinfinity/multivoice_chorus_1201.png
new file mode 100644 (file)
index 0000000..baf91fb
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/multivoice_chorus_1201.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/pitch_scale_1193.png b/cinelerra-5.1/picon/cinfinity/pitch_scale_1193.png
new file mode 100644 (file)
index 0000000..86b7aef
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/pitch_scale_1193.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/plate_1423.png b/cinelerra-5.1/picon/cinfinity/plate_1423.png
new file mode 100644 (file)
index 0000000..708d28f
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/plate_1423.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/pointer_cast_1910.png b/cinelerra-5.1/picon/cinfinity/pointer_cast_1910.png
new file mode 100644 (file)
index 0000000..63f5a0c
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/pointer_cast_1910.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/rate_shifter_1417.png b/cinelerra-5.1/picon/cinfinity/rate_shifter_1417.png
new file mode 100644 (file)
index 0000000..fdc0f61
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/rate_shifter_1417.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/retro_flange_1208.png b/cinelerra-5.1/picon/cinfinity/retro_flange_1208.png
new file mode 100644 (file)
index 0000000..418cfeb
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/retro_flange_1208.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/revdelay_1605.png b/cinelerra-5.1/picon/cinfinity/revdelay_1605.png
new file mode 100644 (file)
index 0000000..a3e433b
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/revdelay_1605.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/ringmod_1188.png b/cinelerra-5.1/picon/cinfinity/ringmod_1188.png
new file mode 100644 (file)
index 0000000..f5d58ed
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/ringmod_1188.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/sc1_1425.png b/cinelerra-5.1/picon/cinfinity/sc1_1425.png
new file mode 100644 (file)
index 0000000..a38c69f
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/sc1_1425.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/sc2_1426.png b/cinelerra-5.1/picon/cinfinity/sc2_1426.png
new file mode 100644 (file)
index 0000000..9ffa90e
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/sc2_1426.png differ
diff --git a/cinelerra-5.1/picon/cinfinity/sc3_1427.png b/cinelerra-5.1/picon/cinfinity/sc3_1427.png
new file mode 100644 (file)
index 0000000..4f31af9
Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/sc3_1427.png differ