pluginclient cr=apply in option value textbox, add loop_mode for vwdw
authorGood Guy <good1.2guy@gmail.com>
Sat, 4 Jul 2020 03:55:56 +0000 (21:55 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sat, 4 Jul 2020 03:55:56 +0000 (21:55 -0600)
playback, add swap track up/dn, change reset_cache to use ref counts,
change gang_media,gang_chans pngs, add shift switch gang mode btn, tweak
mask_engine for high cpu count, change patchbay btn layout, fix track
redraw interrupted by index builder, fix scollable textbox resize
positioning, wsiwyg gang_master tweak.

56 files changed:
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/cache.C
cinelerra-5.1/cinelerra/cache.h
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/fileref.C
cinelerra-5.1/cinelerra/indexfile.C
cinelerra-5.1/cinelerra/mainmenu.C
cinelerra-5.1/cinelerra/mainmenu.h
cinelerra-5.1/cinelerra/maskengine.C
cinelerra-5.1/cinelerra/module.C
cinelerra-5.1/cinelerra/module.h
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/packagerenderer.C
cinelerra-5.1/cinelerra/patchgui.C
cinelerra-5.1/cinelerra/playbackengine.C
cinelerra-5.1/cinelerra/playtransport.C
cinelerra-5.1/cinelerra/playtransport.h
cinelerra-5.1/cinelerra/pluginarray.C
cinelerra-5.1/cinelerra/pluginfclient.C
cinelerra-5.1/cinelerra/proxy.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/trackpopup.C
cinelerra-5.1/cinelerra/trackpopup.h
cinelerra-5.1/cinelerra/tracks.h
cinelerra-5.1/cinelerra/tracksedit.C
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/guicast/bctextbox.C
cinelerra-5.1/plugins/theme_blond/data/gang1.png
cinelerra-5.1/plugins/theme_blond/data/gang2.png
cinelerra-5.1/plugins/theme_blond_cv/data/gang1.png
cinelerra-5.1/plugins/theme_blond_cv/data/gang2.png
cinelerra-5.1/plugins/theme_blue/data/gang1.png
cinelerra-5.1/plugins/theme_blue/data/gang2.png
cinelerra-5.1/plugins/theme_blue_dot/data/gang1.png
cinelerra-5.1/plugins/theme_blue_dot/data/gang2.png
cinelerra-5.1/plugins/theme_bright/data/gang1.png
cinelerra-5.1/plugins/theme_bright/data/gang2.png
cinelerra-5.1/plugins/theme_cakewalk/data/gang1.png
cinelerra-5.1/plugins/theme_cakewalk/data/gang2.png
cinelerra-5.1/plugins/theme_hulk/data/gang1.png
cinelerra-5.1/plugins/theme_hulk/data/gang2.png
cinelerra-5.1/plugins/theme_neophyte/data/gang1.png
cinelerra-5.1/plugins/theme_neophyte/data/gang2.png
cinelerra-5.1/plugins/theme_pinklady/data/gang1.png
cinelerra-5.1/plugins/theme_pinklady/data/gang2.png
cinelerra-5.1/plugins/theme_suv/data/gang1.png
cinelerra-5.1/plugins/theme_suv/data/gang2.png
cinelerra-5.1/plugins/theme_unflat/data/gang1.png
cinelerra-5.1/plugins/theme_unflat/data/gang2.png
cinelerra-5.1/plugins/titler/titler.C

index 56832ca9100e8e994cbf8e0f5446a2b0783b588e..bc4281642a3563acd1bfb4c671c72ae77d4a0849 100644 (file)
@@ -951,8 +951,8 @@ int SnapshotMenuItem::handle_event()
                command.realtime = 0;
 
                RenderEngine render_engine(0, preferences, 0, 0);
-               CICache video_cache(preferences);
-               render_engine.set_vcache(&video_cache);
+               CICache *video_cache = new CICache(preferences);
+               render_engine.set_vcache(video_cache);
                render_engine.arm_command(&command);
 
                double position = edl->local_session->get_selectionstart(1);
@@ -962,6 +962,7 @@ int SnapshotMenuItem::handle_event()
                if( !ret )
                        ret = file.write_video_buffer(1);
                file.close_file();
+               video_cache->remove_user();
        }
        if( !ret ) {
                asset->folder_no = AW_MEDIA_FOLDER;
index 3a0d118e0397f01a28b227d6d2796c186df6e97b..80bf347b677a49d9aee95d011514719aa814f799 100644 (file)
@@ -37,7 +37,7 @@
 
 // edl came from a command which won't exist anymore
 CICache::CICache(Preferences *preferences)
- : List<CICacheItem>()
+ : Garbage("CICache"), List<CICacheItem>()
 {
        this->preferences = preferences;
        edl = 0;
@@ -69,11 +69,11 @@ File* CICache::check_out(Asset *asset, EDL *edl, int block)
        CICacheItem *current = 0;
        long tid = (long)Thread::get_self();
        if( !tid ) tid = 1;
+       total_lock->lock("CICache::check_out");
+       add_user();
 
-       while(1)
-       {
+       while( users > 1 ) {
                File *file = 0;
-               total_lock->lock("CICache::check_out");
 // Scan directory for item
                current = first;
                while(current && strcmp(current->asset->path, asset->path) != 0)
@@ -108,12 +108,21 @@ File* CICache::check_out(Asset *asset, EDL *edl, int block)
                        else
                                current = 0;
                }
-               total_lock->unlock();
                if( current || !file || !block ) break;
 // Try again after blocking
+               total_lock->unlock();
                check_out_lock->lock("CICache::check_out");
+               total_lock->lock("CICache::check_out");
+       }
+
+// cache deleted during checkout, destroy this
+       if( users == 1 ) {
+               remove_user();
+               return 0;
        }
 
+       remove_user();
+       total_lock->unlock();
 //printf("check out %p %lx %s\n", current, tid, asset->path);
        return current ? current->file : 0;
 }
index 8ab4457f982ad370ae1bd3d3431260b921533572..15329e6964199024c96ba8c1174f062ca0925bf2 100644 (file)
@@ -61,7 +61,7 @@ private:
        CICache *cache;
 };
 
-class CICache : public List<CICacheItem>
+class CICache : public Garbage, public List<CICacheItem>
 {
 public:
        CICache(Preferences *preferences);
index ddc7595a82ab269c5a91175d0f4879a3a33353b9..41394277fc1de8aa66199a9567005c8e821c5089 100644 (file)
@@ -1355,10 +1355,11 @@ void EditPanelGangTracks::update(int gang)
 int EditPanelGangTracks::handle_event()
 {
        int gang = mwindow->edl->session->gang_tracks;
-       switch( gang ) {
-       case GANG_NONE:      gang = GANG_CHANNELS;  break;
-       case GANG_CHANNELS:  gang = GANG_MEDIA;     break;
-       case GANG_MEDIA:     gang = GANG_NONE;      break;
+       if( !shift_down() ) {
+               if( ++gang > GANG_MEDIA ) gang = GANG_NONE;
+       }
+       else {
+               if( --gang < GANG_NONE ) gang = GANG_MEDIA;
        }
        update(gang);
        panel->panel_set_gang_tracks(gang);
index ab8ecd7f05acd7357c27658947df85bf9876a467..ade91c481613cbf6f9f698935248ebac22c4eeef 100644 (file)
@@ -101,8 +101,8 @@ int FileREF::close_file()
        ref = 0;
        delete render_engine;  render_engine = 0;
        delete command;  command = 0;
-       delete acache;   acache = 0;
-       delete vcache;   vcache = 0;
+       if( acache ) { acache->remove_user();  acache = 0; }
+       if( vcache ) { vcache->remove_user();  vcache = 0; }
        delete temp;     temp = 0;
        for( int i=0; i<MAX_CHANNELS; ++i ) {
                delete samples[i];  samples[i] = 0;
index 0e6469e2c1d5e3fe64aebcc853d7a8738a564a98..b8c0af6957a57b2c7eb96df02678e5977e24a8cb 100644 (file)
@@ -374,9 +374,10 @@ void IndexFile::close_source()
 
        delete render_engine;
        render_engine = 0;
-
-       delete cache;
-       cache = 0;
+       if( cache ) {
+               cache->remove_user();
+               cache = 0;
+       }
 }
 
 int64_t IndexFile::get_required_scale()
index de902545f4d2a9c6977469b021287effe5b55233..64e90885255df6e2dea596e1a150d58a6cd1629a 100644 (file)
@@ -209,6 +209,8 @@ void MainMenu::create_objects()
        trackmenu->add_item(new DeleteFirstTrack(mwindow));
        trackmenu->add_item(new DeleteLastTrack(mwindow));
        trackmenu->add_item(new ConcatenateTracks(mwindow));
+       trackmenu->add_item(new SwapTracksUp(mwindow));
+       trackmenu->add_item(new SwapTracksDown(mwindow));
        AppendTracks *append_tracks;
        trackmenu->add_item(append_tracks = new AppendTracks(mwindow));
        append_tracks->create_objects();
@@ -1290,6 +1292,34 @@ int MoveTracksDown::handle_event()
 }
 
 
+SwapTracksUp::SwapTracksUp(MWindow *mwindow)
+ : BC_MenuItem(_("Swap tracks up"), 0, UP)
+{
+       this->mwindow = mwindow;
+       set_shift();
+}
+
+int SwapTracksUp::handle_event()
+{
+       if( mwindow->session->current_operation == NO_OPERATION )
+               mwindow->swap_tracks_up();
+       return 1;
+}
+
+SwapTracksDown::SwapTracksDown(MWindow *mwindow)
+ : BC_MenuItem(_("Swap tracks down"), 0, DOWN)
+{
+       set_shift(); this->mwindow = mwindow;
+}
+
+int SwapTracksDown::handle_event()
+{
+       if( mwindow->session->current_operation == NO_OPERATION )
+               mwindow->swap_tracks_down();
+       return 1;
+}
+
+
 
 
 ConcatenateTracks::ConcatenateTracks(MWindow *mwindow)
index 681ba38459927d37921fa2c77a5cf2a12c673440..bf14888f3296ad0d7ab223c5a32339a4e1fc30e9 100644 (file)
@@ -655,6 +655,22 @@ public:
        MWindow *mwindow;
 };
 
+class SwapTracksUp : public BC_MenuItem
+{
+public:
+       SwapTracksUp(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
+class SwapTracksDown : public BC_MenuItem
+{
+public:
+       SwapTracksDown(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
 class DeleteTracks : public BC_MenuItem
 {
 public:
index 564d1fe895287b66f5e4ddca8bf3c145123af81e..efe37ccccf2204120c935530a25373cb85a82a55 100644 (file)
@@ -301,7 +301,6 @@ void MaskUnit::process_package(LoadPackage *package)
        pkg = (MaskPackage*)package;
        start_x = pkg->start_x;  end_x = pkg->end_x;
        start_y = pkg->start_y;  end_y = pkg->end_y;
-       if( start_y >= end_y ) return;
        MaskEdge *edge = engine->edge;
        float r = engine->r, v = engine->v;
        VFrame *in = engine->in;
index 01f3095f1c69d2e8d0b87ee726d1128fb9dd216d..c6990275851b087474cc839214c18ce7cd144dec 100644 (file)
@@ -59,7 +59,6 @@ Module::Module(RenderEngine *renderengine,
        nested_edl = 0;
        nested_renderengine = 0;
        nested_command = 0;
-       private_cache = 0;
        cache = 0;
 }
 
@@ -86,7 +85,6 @@ Module::~Module()
 
        delete nested_renderengine;
        delete nested_command;
-       if(private_cache) delete cache;
 }
 
 void Module::create_objects()
index 85b506774823e1507b881b578c5d9d23e8e8a05d..1203f3b61912d538d1f8065917e64c7e4430c532 100644 (file)
@@ -82,8 +82,6 @@ public:
 
 // CICache used during effect & nested EDL
        CICache *cache;
-// If the cache was allocated by the module
-       int private_cache;
 // Parent EDL of this module when used for effect rendering.
 // Used by APluginArray.
        EDL *edl;
index 702bd8a7c6fde6bb0aaa68bbe0354f74b607efd2..1466b4451275c4b0529af43647787a70dae5db74 100644 (file)
@@ -349,8 +349,9 @@ MWindow::~MWindow()
        delete gui;             gui = 0;
        delete mainindexes;     mainindexes = 0;
        delete mainprogress;    mainprogress = 0;
-       delete audio_cache;     audio_cache = 0;  // delete the cache after the assets
-       delete video_cache;     video_cache = 0;  // delete the cache after the assets
+ // delete the caches after the assets
+       if( audio_cache ) { audio_cache->remove_user();  audio_cache = 0; }
+       if( video_cache ) { video_cache->remove_user();  video_cache = 0; }
        delete frame_cache;     frame_cache = 0;
        delete wave_cache;      wave_cache = 0;
        delete plugin_guis;     plugin_guis = 0;
index 049694ed3ef1c057d8436c1622848e5e1e1587ee..8f80280f13ef45a412969db698e89a0b6e35bf03 100644 (file)
@@ -500,6 +500,10 @@ public:
        void move_tracks_down();
        void move_track_up(Track *track);
        void move_tracks_up();
+       void swap_track_down(Track *track);
+       void swap_tracks_down();
+       void swap_track_up(Track *track);
+       void swap_tracks_up();
        void mute_selection();
        void new_folder(const char *new_folder, int is_clips);
        void delete_folder(char *folder);
index 5e4b797be1f96ead14415d179af9467b3f04116b..6242b788bc027a81b389e66075b923c27febae55 100644 (file)
@@ -1205,6 +1205,56 @@ void MWindow::move_tracks_up()
 }
 
 
+void MWindow::swap_track_down(Track *track)
+{
+       undo_before();
+       edl->tracks->swap_track_down(track);
+       save_backup();
+       undo_after(_("swap track down"), LOAD_ALL);
+
+       restart_brender();
+       gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
+       sync_parameters(CHANGE_EDL);
+       save_backup();
+}
+
+void MWindow::swap_tracks_down()
+{
+       undo_before();
+       edl->tracks->swap_tracks_down();
+       save_backup();
+       undo_after(_("swap tracks down"), LOAD_ALL);
+
+       restart_brender();
+       gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
+       sync_parameters(CHANGE_EDL);
+       save_backup();
+}
+
+void MWindow::swap_track_up(Track *track)
+{
+       undo_before();
+       edl->tracks->swap_track_up(track);
+       save_backup();
+       undo_after(_("swap track up"), LOAD_ALL);
+       restart_brender();
+       gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
+       sync_parameters(CHANGE_EDL);
+       save_backup();
+}
+
+void MWindow::swap_tracks_up()
+{
+       undo_before();
+       edl->tracks->swap_tracks_up();
+       save_backup();
+       undo_after(_("swap tracks up"), LOAD_ALL);
+       restart_brender();
+       gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
+       sync_parameters(CHANGE_EDL);
+}
+
+
 void MWindow::mute_selection()
 {
        double start = edl->local_session->get_selectionstart();
index d60a5be0ae17acc5c7aa3102aea5128251c97586..a76d736ae5839f9f03f87329bcd45238af6ad19b 100644 (file)
@@ -101,8 +101,10 @@ PackageRenderer::PackageRenderer()
 PackageRenderer::~PackageRenderer()
 {
        delete command;
-       delete audio_cache;
-       delete video_cache;
+       if( audio_cache )
+               audio_cache->remove_user();
+       if( video_cache )
+               video_cache->remove_user();
        delete vconfig;
        delete aconfig;
        delete timer;
index dc518b5cf9a002f5107714d1af56be18901aa533..f99601c1178f91db5306f1d3680d95efd986bf39 100644 (file)
@@ -60,11 +60,11 @@ PatchGUI::PatchGUI(MWindow *mwindow,
        record = 0;
        play = 0;
 //     automate = 0;
-       gang = 0;
        draw = 0;
        mute = 0;
-       zoom = 0;
+       gang = 0;
        master = 0;
+       zoom = 0;
        expand = 0;
        nudge = 0;
        mix = 0;
@@ -79,11 +79,11 @@ PatchGUI::~PatchGUI()
        delete record;
        delete play;
 //     delete automate;
-       delete gang;
        delete draw;
        delete mute;
-       delete zoom;
+       delete gang;
        delete master;
+       delete zoom;
        delete expand;
        delete nudge;
        delete mix;
@@ -117,15 +117,16 @@ int PatchGUI::reposition(int x, int y)
                        x1 += record->get_w();
 //                     automate->reposition_window(x1, y1 + y);
 //                     x1 += automate->get_w();
-                       gang->reposition_window(gang->get_x(), y1 + y);
-                       x1 += gang->get_w();
                        draw->reposition_window(draw->get_x(), y1 + 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);
-                       x1 += zoom->get_w();
+                       gang->reposition_window(gang->get_x(), y1 + y);
+                       x1 += gang->get_w();
                        master->reposition_window(master->get_x(), y1 + y);
+                       x1 += master->get_w();
+                       zoom->reposition_window(zoom->get_x(), y1 + y);
+//                     x1 += zoom->get_w();
                }
                y1 += mwindow->theme->play_h;
        }
@@ -177,18 +178,19 @@ int PatchGUI::update(int x, int y)
                if( h < y2 ) {
                        delete play;    play = 0;
                        delete record;  record = 0;
-                       delete gang;    gang = 0;
                        delete draw;    draw = 0;
                        delete mute;    mute = 0;
-                       delete zoom;    zoom = 0;
+                       delete gang;    gang = 0;
                        delete master;  master = 0;
+                       delete zoom;    zoom = 0;
                }
                else {
                        play->update(track->play);
                        record->update(track->armed);
-                       gang->update(track->ganged);
                        draw->update(track->draw);
                        mute->update(mwindow->get_int_auto(this, AUTOMATION_MUTE)->value);
+                       gang->update(track->ganged);
+                       master->update(track->master);
                }
        }
        else if( h >= y2 ) {
@@ -197,15 +199,16 @@ int PatchGUI::update(int x, int y)
                x1 += play->get_w();
                patchbay->add_subwindow(record = new RecordPatch(mwindow, this, x1 + x, y1 + y));
                x1 += record->get_w();
-               patchbay->add_subwindow(gang = new GangPatch(mwindow, this, x1 + x, y1 + y));
-               x1 += gang->get_w();
                patchbay->add_subwindow(draw = new DrawPatch(mwindow, this, x1 + x, y1 + 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));
-               x1 += zoom->get_w();
+               patchbay->add_subwindow(gang = new GangPatch(mwindow, this, x1 + x, y1 + y));
+               x1 += gang->get_w();
                patchbay->add_subwindow(master = new MasterPatch(mwindow, this, x1 + x, y1 + y));
+               x1 += master->get_w();
+               patchbay->add_subwindow(zoom = new ZoomPatch(mwindow, this, x1 + x, y1 + y));
+//             x1 += zoom->get_w();
        }
        if( play )
                y1 = y2;
index 8ce98234c3ffc7ed2b0ed6e4c00b4f6e3fa749ee..82bd7bb6587b930b77caa7f4da7673255539b3a3 100644 (file)
@@ -85,8 +85,10 @@ PlaybackEngine::~PlaybackEngine()
        Thread::join();
        delete preferences;
        delete_render_engine();
-       delete audio_cache;
-       delete video_cache;
+       if( audio_cache )
+               audio_cache->remove_user();
+       if( video_cache )
+               video_cache->remove_user();
        delete tracking_lock;
        delete tracking_done;
        delete pause_lock;
@@ -162,10 +164,12 @@ void PlaybackEngine::wait_render_engine()
 
 void PlaybackEngine::create_cache()
 {
-       if(audio_cache) { delete audio_cache;  audio_cache = 0; }
-       if(video_cache) { delete video_cache;  video_cache = 0; }
-       if(!audio_cache) audio_cache = new CICache(preferences);
-       if(!video_cache) video_cache = new CICache(preferences);
+       if( audio_cache )
+               audio_cache->remove_user();
+       if( video_cache )
+               video_cache->remove_user();
+       audio_cache = new CICache(preferences);
+       video_cache = new CICache(preferences);
 }
 
 
index d9d9a48af851b5ed30df9bb1cdd323dac2e60a7a..8caf4678bb3493ff5b7e0326ab6d82c5bf5d8d3e 100644 (file)
@@ -30,6 +30,7 @@
 #include "preferences.h"
 #include "shuttle.h"
 #include "theme.h"
+#include "tracks.h"
 #include "transportque.h"
 #include "vframe.h"
 
@@ -329,21 +330,14 @@ EDL* PlayTransport::get_edl()
        return mwindow->edl;
 }
 
-int PlayTransport::pause_transport()
+int PlayTransport::set_transport(int mode)
 {
-       if(active_button) active_button->set_mode(PLAY_MODE);
-       return 0;
-}
-
-
-int PlayTransport::reset_transport()
-{
-       fast_reverse->set_mode(PLAY_MODE);
-       reverse_play->set_mode(PLAY_MODE);
-       forward_play->set_mode(PLAY_MODE);
-       frame_reverse_play->set_mode(PLAY_MODE);
-       frame_forward_play->set_mode(PLAY_MODE);
-       fast_play->set_mode(PLAY_MODE);
+       fast_reverse->set_mode(mode);
+       reverse_play->set_mode(mode);
+       forward_play->set_mode(mode);
+       frame_reverse_play->set_mode(mode);
+       frame_forward_play->set_mode(mode);
+       fast_play->set_mode(mode);
        return 0;
 }
 
@@ -358,10 +352,29 @@ PTransportButton::~PTransportButton()
 {
 }
 
-int PTransportButton::set_mode(int mode)
+void PTransportButton::set_mode(int mode)
 {
        this->mode = mode;
-       return 0;
+}
+
+void PTransportButton::loop_mode(int dir)
+{
+       if( mode != LOOP_MODE ) return;
+       EDL *edl = transport->get_edl();
+       if( !edl ) return;
+       PlaybackEngine *engine = transport->engine;
+       if( !engine || engine->is_playing_back ) return;
+       double position = engine->get_tracking_position();
+       switch( dir ) {
+       case PLAY_FORWARD:
+               if( position >= edl->tracks->total_playable_length() )
+                       transport->goto_start();
+               break;
+       case PLAY_REVERSE:
+               if( position <= 0 )
+                       transport->goto_end();
+               break;
+       }
 }
 
 int PTransportButton::play_command(const char *lock_msg, int command)
@@ -398,6 +411,7 @@ FastReverseButton::FastReverseButton(MWindow *mwindow, PlayTransport *transport,
 }
 int FastReverseButton::handle_event()
 {
+       loop_mode(PLAY_REVERSE);
        return play_command("FastReverseButton::handle_event", FAST_REWIND);
 }
 
@@ -410,6 +424,7 @@ ReverseButton::ReverseButton(MWindow *mwindow, PlayTransport *transport, int x,
 }
 int ReverseButton::handle_event()
 {
+       loop_mode(PLAY_REVERSE);
        return play_command("ReverseButton::handle_event", NORMAL_REWIND);
 }
 
@@ -437,6 +452,7 @@ PlayButton::PlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y)
 }
 int PlayButton::handle_event()
 {
+       loop_mode(PLAY_FORWARD);
        return play_command("PlayButton::handle_event", NORMAL_FWD);
 }
 
@@ -466,6 +482,7 @@ FastPlayButton::FastPlayButton(MWindow *mwindow, PlayTransport *transport, int x
 }
 int FastPlayButton::handle_event()
 {
+       loop_mode(PLAY_FORWARD);
        return play_command("FastPlayButton::handle_event", FAST_FWD);
 }
 
index 20d989997b31058ebaeb086b21b8a63131086707..791a801ff0c6493f1602b46420bfc40af04d7674 100644 (file)
@@ -29,8 +29,7 @@
 #include "playtransport.inc"
 
 #define PLAY_MODE 0
-#define PAUSE_MODE 1
-#define PAUSEDOWN_MODE 2
+#define LOOP_MODE 1
 
 class PlayTransport
 {
@@ -62,8 +61,7 @@ public:
 // speed - play speed for SLOW/FAST playback, zero defaults to slow=.5,fast=2.
        void handle_transport(int command, int wait_tracking=0,
                int use_inout=0, int toggle_audio=0, int loop_play=0, float speed=0);
-       int pause_transport();
-       int reset_transport();
+       int set_transport(int mode);
        int get_w();
        int is_stopped();
 // Get the EDL to play back with default to mwindow->edl
@@ -100,7 +98,8 @@ class PTransportButton : public BC_Button
 public:
        PTransportButton(MWindow *mwindow, PlayTransport *transport, int x, int y, VFrame **data);
        virtual ~PTransportButton();
-       virtual int set_mode(int mode);
+       void set_mode(int mode);
+       void loop_mode(int dir);
        int play_command(const char *lock_msg, int command);
 
        int mode;
index a04e9858a5cf5ebfcb657dbd92c52a7e1cc0a279..7d971a691c361771b36a3aa9fe68c1d4f956a77a 100644 (file)
@@ -266,8 +266,10 @@ int PluginArray::stop_plugins()
                        values[i]->close_plugin();
                }
        }
-
-       delete cache;
+       if( cache ) {
+               cache->remove_user();
+               cache = 0;
+       }
        return 0;
 }
 
index 2cc12d62737625feec8a15602b2ffbea57fe6d95..486d73195d0c4605f055638f1aab9ec7adfa24f1 100644 (file)
@@ -8,6 +8,7 @@
 #include "bcwindowbase.h"
 #include "bctitle.h"
 #include "cstrdup.h"
+#include "keys.h"
 #include "language.h"
 #include "mwindow.h"
 #include "pluginfclient.h"
@@ -186,6 +187,10 @@ PluginFClientText::
 
 int PluginFClientText::handle_event()
 {
+       if( get_keypress() == RETURN ) {
+               fwin->update();
+               activate();
+       }
        return 0;
 }
 
index 34f833fbbc6d18cb3693454cdb54f574afdd41e3..fff64f37fb1eb850e8df5505f818f3abc4bcc871 100644 (file)
@@ -657,7 +657,8 @@ ProxyClient::ProxyClient(MWindow *mwindow,
 ProxyClient::~ProxyClient()
 {
        delete render_engine;
-       delete video_cache;
+       if( video_cache )
+               video_cache->remove_user();
        delete src_file;
 }
 
index 746b41879f3fd25bdb4c92d63f897d6f031a1bc0..741d6ff3747c0ef55dbbe5e5aeddf00584c09fe0 100644 (file)
@@ -882,8 +882,8 @@ printf("Render::render_single: Session finished.\n");
                mwindow->restart_brender();
        if( farm_server ) delete farm_server;
        delete command;
-       delete audio_cache;
-       delete video_cache;
+       audio_cache->remove_user();
+       video_cache->remove_user();
 // Must delete packages after server
        delete render->packages;
 
index 308e902d81ae56f6685780778af4e15de5d8f67d..4c28c0325a66a7723b2f7866132fed540a302d52 100644 (file)
@@ -670,10 +670,11 @@ void ResourceThread::stop()
        video_thread->stop();
 }
 
-void ResourceThread::reset(int pane_number)
+void ResourceThread::reset(int pane_number, int indexes_only)
 {
        audio_thread->reset(pane_number);
-       video_thread->reset(pane_number);
+       if( !indexes_only )
+               video_thread->reset(pane_number);
 }
 
 void ResourceThread::close_indexable(Indexable *idxbl)
index 1f8fada53dfbe31e69aa3a541b20807666770545..8434553d13e9d9add53405844c46b71e99e71f31 100644 (file)
@@ -205,7 +205,7 @@ public:
 
        void run();
        void stop();
-       void reset(int pane_number);
+       void reset(int pane_number, int indexes_only);
        void close_indexable(Indexable*);
 
        MWindow *mwindow;
index 264bd95f829da34765232284043c585bd2e55f9b..9e86481c8df919e4d01f441b2a60ce8ff292368f 100644 (file)
@@ -1793,10 +1793,25 @@ void Track::set_camera(float x, float y, float z)
 
 Track *Track::gang_master()
 {
-       if( edl->session->gang_tracks == GANG_NONE ) return this;
        Track *track = this;
-       while( track && !track->master ) track = track->previous;
-       return !track ? tracks->first : track;
+       switch( edl->session->gang_tracks ) {
+       case GANG_NONE:
+               return track;
+       case GANG_CHANNELS: {
+               Track *current = track;
+               int data_type = track->data_type;
+               while( current && !track->master ) {
+                       if( !(current = current->previous) ) break;
+                       if( current->data_type == data_type ) track = current;
+                       if( track->master ) break;
+               }
+               break; }
+       case GANG_MEDIA: {
+               while( track && !track->master ) track = track->previous;
+               break; }
+       }
+       if( !track ) track = tracks->first;
+       return track;
 }
 
 int Track::is_hidden()
@@ -1815,6 +1830,7 @@ int Track::is_armed()
 {
        return gang_master()->armed;
 }
+
 int Track::is_ganged()
 {
        return gang_master()->ganged;
index dda88761e8547bfc9633e3573a84d938d8ac1689..c0f8f995d3453504ef4fc830c5cf9d55c7189e8a 100644 (file)
@@ -781,7 +781,7 @@ void TrackCanvas::draw_resources(int mode,
 
        if(debug) PRINT_TRACE
        if(mode != IGNORE_THREAD)
-               gui->resource_thread->reset(pane->number);
+               gui->resource_thread->reset(pane->number, indexes_only);
 
 // Search every edit
        for(Track *current = mwindow->edl->tracks->first;
@@ -3902,7 +3902,7 @@ int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode)
                        !vrender->process_buffer(&vlt, left, 0) &&
                        !vrender->process_buffer(&vrt, pos , 0) ? 0 : 1;
                delete render_engine;
-               delete video_cache;
+               video_cache->remove_user();
                mwindow->cwindow->gui->lock_window("TrackCanvas::render_handle_frame 0");
                Canvas *canvas = mwindow->cwindow->gui->canvas;
                float ox1, oy1, ox2, oy2, cx1, cy1, cx2, cy2;
index 077fa9cb23cd208ea90fe20feb77f9a35257f0c4..6dd1512e1584f7eb296ab97dc066cfef80065af8 100644 (file)
@@ -72,6 +72,8 @@ void TrackPopup::create_objects()
        add_item(new TrackPopupShow(mwindow, this));
        add_item(new TrackPopupUserTitle(mwindow, this));
        add_item(new TrackPopupTitleColor(mwindow, this));
+       add_item(new TrackSwapUp(mwindow, this));
+       add_item(new TrackSwapDown(mwindow, this));
        resize_option = 0;
        matchsize_option = 0;
 }
@@ -135,8 +137,6 @@ int TrackMoveUp::handle_event()
        return 1;
 }
 
-
-
 TrackMoveDown::TrackMoveDown(MWindow *mwindow, TrackPopup *popup)
  : BC_MenuItem(_("Move down"))
 {
@@ -153,6 +153,37 @@ int TrackMoveDown::handle_event()
 }
 
 
+TrackSwapUp::TrackSwapUp(MWindow *mwindow, TrackPopup *popup)
+ : BC_MenuItem(_("Swap up"))
+{
+       this->mwindow = mwindow;
+       this->popup = popup;
+}
+TrackSwapUp::~TrackSwapUp()
+{
+}
+int TrackSwapUp::handle_event()
+{
+       mwindow->swap_track_up(popup->track);
+       return 1;
+}
+
+TrackSwapDown::TrackSwapDown(MWindow *mwindow, TrackPopup *popup)
+ : BC_MenuItem(_("Swap down"))
+{
+       this->mwindow = mwindow;
+       this->popup = popup;
+}
+TrackSwapDown::~TrackSwapDown()
+{
+}
+int TrackSwapDown::handle_event()
+{
+       mwindow->swap_track_down(popup->track);
+       return 1;
+}
+
+
 TrackPopupResize::TrackPopupResize(MWindow *mwindow, TrackPopup *popup)
  : BC_MenuItem(_("Resize track..."))
 {
index b8042f34db4fbdb719b3eaf021a8b8fa2f7f5eb1..b44a62d5a88ca48010e08e7460eaeaebac0220bd 100644 (file)
@@ -130,6 +130,30 @@ public:
        TrackPopup *popup;
 };
 
+class TrackSwapUp : public BC_MenuItem
+{
+public:
+       TrackSwapUp(MWindow *mwindow, TrackPopup *popup);
+       ~TrackSwapUp();
+
+       int handle_event();
+
+       MWindow *mwindow;
+       TrackPopup *popup;
+};
+
+class TrackSwapDown : public BC_MenuItem
+{
+public:
+       TrackSwapDown(MWindow *mwindow, TrackPopup *popup);
+       ~TrackSwapDown();
+
+       int handle_event();
+
+       MWindow *mwindow;
+       TrackPopup *popup;
+};
+
 class TrackPopupFindAsset : public BC_MenuItem
 {
 public:
index 3d67671310a455997dd0faca1eca451cc5ab0612..dd1a92f6d4c761d280a1685cd73be39dcd96cf00 100644 (file)
@@ -73,10 +73,14 @@ public:
        void equivalent_output(Tracks *tracks, double *result);
 
        void move_tracks(Track *src, Track *dst, int n);
-       int move_track_up(Track *track);        // move recordable tracks up
-       int move_track_down(Track *track);      // move recordable tracks down
-       int move_tracks_up();                   // move recordable tracks up
-       int move_tracks_down();                 // move recordable tracks down
+       int move_track_up(Track *track);
+       int move_track_down(Track *track);
+       int move_tracks_up();
+       int move_tracks_down();
+       int swap_track_up(Track *track);
+       int swap_track_down(Track *track);
+       int swap_tracks_up();
+       int swap_tracks_down();
        void paste_audio_transition(PluginServer *server);
        void paste_video_transition(PluginServer *server, int first_track = 0);
 
index f1684204d4fdb8d9f74296e7e41c000825b3789c..29584b239f4db4368773154e4facc556979d40ec 100644 (file)
@@ -922,6 +922,61 @@ int Tracks::move_tracks_down()
 }
 
 
+int Tracks::swap_track_up(Track *track)
+{
+       Track *next_track = track->previous;
+       if(!next_track) next_track = last;
+
+       change_modules(number_of(track), number_of(next_track), 1);
+       swap(track, next_track);
+       return 0;
+}
+
+int Tracks::swap_track_down(Track *track)
+{
+       Track *next_track = track->next;
+       if(!next_track) next_track = first;
+
+       change_modules(number_of(track), number_of(next_track), 1);
+       swap(track, next_track);
+       return 0;
+}
+
+
+int Tracks::swap_tracks_up()
+{
+       int result = 0;
+       Track *next = first;
+       while( next ) {
+               Track *track = next;  next = track->next;
+               if( !track->armed ) continue;
+               if( track->previous ) {
+                       change_modules(number_of(track->previous), number_of(track), 1);
+                       swap(track->previous, track);
+                       result = 1;
+               }
+       }
+
+       return result;
+}
+
+int Tracks::swap_tracks_down()
+{
+       int result = 0;
+       Track *prev = last;
+       while( prev ) {
+               Track *track = prev;  prev = track->previous;
+               if( !track->armed ) continue;
+               if( track->next ) {
+                       change_modules(number_of(track), number_of(track->next), 1);
+                       swap(track, track->next);
+                       result = 1;
+               }
+       }
+
+       return result;
+}
+
 void Tracks::paste_audio_transition(PluginServer *server)
 {
        for(Track *current = first; current; current = NEXT)
index 1217633f0cdb4fd9a0896c15a97e07a1292094ed..09d3e6f52b60cceb83ec8840625754ccaa1ecd14 100644 (file)
@@ -129,7 +129,7 @@ void VWindowGUI::draw_wave()
 
        for( int i=channels; --i>=0; ) delete samples[i];
        delete render_engine;
-       delete cache;
+       cache->remove_user();
        delete canvas->refresh_frame;
        canvas->refresh_frame = vframe;
        canvas->refresh(1);
@@ -227,6 +227,7 @@ void VWindowGUI::create_objects()
                mwindow->theme->vtransport_x,
                mwindow->theme->vtransport_y);
        transport->create_objects();
+       transport->set_transport(LOOP_MODE);
 
 //printf("VWindowGUI::create_objects 1\n");
 //     add_subwindow(fps_title = new BC_Title(mwindow->theme->vedit_x, y, ""));
index f300e66ce80b9358db1e796fa72b65834587c39e..b81da1fb35e261568755a89d4c09e7dd766a3280 100644 (file)
@@ -2377,7 +2377,8 @@ void BC_ScrollTextBox::update_scrollbars()
                delete yscroll;  yscroll = 0;
        }
 
-       if( view_rows != text->get_rows() || view_w != text->get_w() ) {
+       if( view_rows != text->get_rows() || view_w != text->get_w() ||
+           x != text->get_x() || y != text->get_y() ) {
                text->reposition_window(x, y, view_w, view_rows);
        }
        if( need_xscroll && !xscroll ) {
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond/data/gang1.png and b/cinelerra-5.1/plugins/theme_blond/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond/data/gang2.png and b/cinelerra-5.1/plugins/theme_blond/data/gang2.png differ
index e3bbd85b91a370ed94dba1b135fb4b9b4aa95c8b..3537b41b2f6602e2ab2a08c26d50f1ac892e2ac7 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond_cv/data/gang1.png and b/cinelerra-5.1/plugins/theme_blond_cv/data/gang1.png differ
index 4d99ae1a282e9c20889f1c1b0a82ce325c0fd093..e1f564c53a20496cd3aec77301de28db5619a702 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blond_cv/data/gang2.png and b/cinelerra-5.1/plugins/theme_blond_cv/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue/data/gang1.png and b/cinelerra-5.1/plugins/theme_blue/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue/data/gang2.png and b/cinelerra-5.1/plugins/theme_blue/data/gang2.png differ
index 8bfbdf4487f2a96d8e47e8ff47d147e6bbc7ca8b..f95d56353ddd5c2f081d69792e00f502aed312ad 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue_dot/data/gang1.png and b/cinelerra-5.1/plugins/theme_blue_dot/data/gang1.png differ
index a2346a166d9d3c57a05796dc3a8fea13121bd391..2ad644ee161993755fc25cdf628d08c189f2bf3f 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_blue_dot/data/gang2.png and b/cinelerra-5.1/plugins/theme_blue_dot/data/gang2.png differ
index 70c3bdbbd0d9258c954bdadd26cd41e59261988c..f5a95e554176f89fae85fe967edfd62a5dc59e4b 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_bright/data/gang1.png and b/cinelerra-5.1/plugins/theme_bright/data/gang1.png differ
index cdcc5c152506131cdaa597f6ff9dfd02e1a5e81c..4d989dd746536b4f654094930605b3f74bcddb36 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_bright/data/gang2.png and b/cinelerra-5.1/plugins/theme_bright/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_cakewalk/data/gang1.png and b/cinelerra-5.1/plugins/theme_cakewalk/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_cakewalk/data/gang2.png and b/cinelerra-5.1/plugins/theme_cakewalk/data/gang2.png differ
index a99c6263c26d790ea1217e09d4a71a60bb6a7c56..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_hulk/data/gang1.png and b/cinelerra-5.1/plugins/theme_hulk/data/gang1.png differ
index f6738f0c254293e2a6033c436f06fa7ca54ddf77..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_hulk/data/gang2.png and b/cinelerra-5.1/plugins/theme_hulk/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_neophyte/data/gang1.png and b/cinelerra-5.1/plugins/theme_neophyte/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_neophyte/data/gang2.png and b/cinelerra-5.1/plugins/theme_neophyte/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_pinklady/data/gang1.png and b/cinelerra-5.1/plugins/theme_pinklady/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_pinklady/data/gang2.png and b/cinelerra-5.1/plugins/theme_pinklady/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_suv/data/gang1.png and b/cinelerra-5.1/plugins/theme_suv/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_suv/data/gang2.png and b/cinelerra-5.1/plugins/theme_suv/data/gang2.png differ
index ac658091a9190062cb6a5b7c7fc229ac99d3c164..0d9ffe8421bdfd5a8608fe4e3ad490cca35d48fb 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_unflat/data/gang1.png and b/cinelerra-5.1/plugins/theme_unflat/data/gang1.png differ
index 483afee9b584f48f8877481b015efdedf92c7a82..b845849ed745ec5257cb54d3635f447cffa4f185 100644 (file)
Binary files a/cinelerra-5.1/plugins/theme_unflat/data/gang2.png and b/cinelerra-5.1/plugins/theme_unflat/data/gang2.png differ
index 11e454ec855c0812dec82ca2835c1d35b1fab04d..6722704d2ed0567ac86a6df571c997e72e811d5b 100644 (file)
@@ -944,7 +944,8 @@ TitleMain::~TitleMain()
                background = 0;
        }
        delete render_engine;
-       delete video_cache;
+       if( video_cache )
+               video_cache->remove_user(); 
        delete overlay_frame;
        delete bg_file;
        delete bg_frame;
@@ -1186,7 +1187,7 @@ int TitleMain::load_font(BC_FontEntry *font)
 Indexable *TitleMain::open_background(const char *filename)
 {
        delete render_engine;  render_engine = 0;
-       delete video_cache;    video_cache = 0;
+       if( video_cache ) { video_cache->remove_user();  video_cache = 0; }
        delete bg_file;        bg_file = new File;
 
        Asset *asset = new Asset(filename);