From: Good Guy Date: Sun, 28 May 2017 20:41:06 +0000 (-0600) Subject: add zoom slider, fix stop_playback on quit, new msg.txt, rework filelist X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=ed1cab1d6cbde6129bbd09b9609f7bba03ab610f;p=goodguy%2Fhistory.git add zoom slider, fix stop_playback on quit, new msg.txt, rework filelist --- diff --git a/cinelerra-5.1/cinelerra/cpanel.C b/cinelerra-5.1/cinelerra/cpanel.C index e6c5cff5..09c54b5a 100644 --- a/cinelerra-5.1/cinelerra/cpanel.C +++ b/cinelerra-5.1/cinelerra/cpanel.C @@ -19,15 +19,20 @@ * */ +#include "automation.h" #include "cpanel.h" +#include "cwindow.h" #include "cwindowgui.h" #include "cwindowtool.h" #include "edl.h" #include "edlsession.h" +#include "floatauto.h" #include "language.h" #include "mbuttons.h" #include "mwindow.h" +#include "mwindowgui.h" #include "theme.h" +#include "track.h" @@ -73,6 +78,9 @@ void CPanel::create_objects() subwindow->add_subwindow(operation[CWINDOW_TOOL_WINDOW] = new CPanelToolWindow(mwindow, this, x, y)); y += operation[CWINDOW_TOOL_WINDOW]->get_h(); subwindow->add_subwindow(operation[CWINDOW_TITLESAFE] = new CPanelTitleSafe(mwindow, this, x, y)); + y += operation[CWINDOW_TITLESAFE]->get_h(); + x += (w - BC_Slider::get_span(1)) / 2; + subwindow->add_subwindow(cpanel_zoom = new CPanelZoom(mwindow, this, x, y+15, h-y-15)); } void CPanel::reposition_buttons(int x, int y) @@ -85,6 +93,8 @@ void CPanel::reposition_buttons(int x, int y) operation[i]->reposition_window(x, y); y += operation[i]->get_h(); } + x += (w - BC_Slider::get_span(1)) / 2; + cpanel_zoom->reposition_window(x, y+15); } @@ -114,6 +124,13 @@ void CPanel::set_operation(int value) operation[i]->update(1); } } + if( operation[CWINDOW_ZOOM]->get_value() || + operation[CWINDOW_CAMERA]->get_value() || + operation[CWINDOW_PROJECTOR]->get_value() ) { + cpanel_zoom->set_shown(1); + } + else + cpanel_zoom->set_shown(0); } @@ -347,3 +364,78 @@ int CPanelTitleSafe::handle_event() return 1; } +CPanelZoom::CPanelZoom(MWindow *mwindow, CPanel *gui, int x, int y, int h) + : BC_FSlider(x, y, 1, h-30, h, -2., 2., 0, 0) +{ + this->mwindow = mwindow; + this->gui = gui; + set_precision(0.001); + set_tooltip(_("Zoom")); +} +CPanelZoom::~CPanelZoom() +{ +} +int CPanelZoom::handle_event() +{ + FloatAuto *z_auto = 0; + int aidx = -1; + float value = get_value(); + BC_FSlider::update(value); + double zoom = pow(10.,value); + switch( mwindow->edl->session->cwindow_operation ) { + case CWINDOW_ZOOM: + gui->subwindow->zoom_canvas(0, zoom, 1); + break; + case CWINDOW_CAMERA: + aidx = AUTOMATION_CAMERA_Z; + break; + case CWINDOW_PROJECTOR: + aidx = AUTOMATION_PROJECTOR_Z; + break; + } + if( aidx < 0 ) return 1; + Track *track = mwindow->cwindow->calculate_affected_track(); + if( !track ) return 1; + z_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto( + track->automation->autos[aidx], 1); + if( !z_auto ) return 1; + z_auto->set_value(zoom); + gui->subwindow->update_tool(); + mwindow->gui->lock_window("CPanelZoom::handle_event 1"); + mwindow->gui->draw_overlays(1); + mwindow->gui->unlock_window(); + mwindow->sync_parameters(CHANGE_PARAMS); + return 1; +} + +int CPanelZoom::set_shown(int shown) +{ + if( shown ) { + float zoom = gui->subwindow->canvas->get_zoom(); + gui->subwindow->zoom_canvas(0, zoom, 1); + show_window(); + } + else + hide_window(); + return 1; +} + +char *CPanelZoom::get_caption() +{ + double value = get_value(); + int frac = value >= 0. ? 1 : value >= -1. ? 2 : 3; + double zoom = pow(10., value); + char *caption = BC_Slider::get_caption(); + sprintf(caption, "%.*f", frac, zoom); + return caption; +} + +void CPanelZoom::update(float zoom) +{ + if( !is_hidden() ) { + if( zoom < 0.01 ) zoom = 0.01; + float value = log(zoom) / log(10.); + BC_FSlider::update(value); + } +} + diff --git a/cinelerra-5.1/cinelerra/cpanel.h b/cinelerra-5.1/cinelerra/cpanel.h index d78ae301..cbca255a 100644 --- a/cinelerra-5.1/cinelerra/cpanel.h +++ b/cinelerra-5.1/cinelerra/cpanel.h @@ -23,6 +23,7 @@ #define CPANEL_H #include "cwindowgui.inc" +#include "cpanel.inc" #include "edl.inc" #include "guicast.h" #include "mwindow.inc" @@ -39,6 +40,7 @@ public: MWindow *mwindow; CWindowGUI *subwindow; + CPanelZoom *cpanel_zoom; int x, y, w, h; @@ -166,6 +168,17 @@ public: CPanel *gui; }; - +class CPanelZoom : public BC_FSlider +{ +public: + CPanelZoom(MWindow *mwindow, CPanel *gui, int x, int y, int h); + ~CPanelZoom(); + char *get_caption(); + int handle_event(); + int set_shown(int shown); + void update(float zoom); + MWindow *mwindow; + CPanel *gui; +}; #endif diff --git a/cinelerra-5.1/cinelerra/cpanel.inc b/cinelerra-5.1/cinelerra/cpanel.inc index f9febccc..0c893074 100644 --- a/cinelerra-5.1/cinelerra/cpanel.inc +++ b/cinelerra-5.1/cinelerra/cpanel.inc @@ -23,5 +23,18 @@ #define CPANEL_INC class CPanel; +class CPanelMask; +class CPanelRuler; +class CPanelTitleSafe; +class CPanelErase; +class CPanelAntierase; +class CPanelProtect; +class CPanelMagnify; +class CPanelCamera; +class CPanelProj; +class CPanelCrop; +class CPanelEyedrop; +class CPanelToolWindow; +class CPanelZoom; #endif diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index a5cee351..4f899c57 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -359,44 +359,50 @@ void CWindowGUI::draw_status(int flush) flush); } +float CWindowGUI::get_auto_zoom() +{ + float conformed_w, conformed_h; + mwindow->edl->calculate_conformed_dimensions(0, conformed_w, conformed_h); + float zoom_x = canvas->w / conformed_w; + float zoom_y = canvas->h / conformed_h; + return zoom_x < zoom_y ? zoom_x : zoom_y; +} void CWindowGUI::zoom_canvas(int do_auto, double value, int update_menu) { - if(do_auto) - mwindow->edl->session->cwindow_scrollbars = 0; - else - mwindow->edl->session->cwindow_scrollbars = 1; - + EDL *edl = mwindow->edl; + float x = 0, y = 0; float old_zoom = mwindow->edl->session->cwindow_zoom; float new_zoom = value; - float x = canvas->w / 2.0; - float y = canvas->h / 2.0; - canvas->canvas_to_output(mwindow->edl, - 0, - x, - y); - x -= canvas->w_visible / 2 * old_zoom / new_zoom; - y -= canvas->h_visible / 2 * old_zoom / new_zoom; - if(update_menu) - { - if(do_auto) - { - zoom_panel->update(auto_zoom); + edl->session->cwindow_scrollbars = do_auto ? 0 : 1; + if( !do_auto && canvas->scrollbars_exist() ) { + float z = 1 - old_zoom / new_zoom; + x = canvas->get_xscroll() + 0.5f*canvas->w_visible * z; + y = canvas->get_yscroll() + 0.5f*canvas->h_visible * z; + } + + if( update_menu ) { + if( !do_auto ) { + int frac = new_zoom >= 1.0f ? 1 : + new_zoom >= 0.1f ? 2 : + new_zoom >= .01f ? 3 : 4; + char string[BCSTRLEN]; + sprintf(string,"x %.*f", frac, new_zoom); + zoom_panel->update(string); } - else - { - zoom_panel->update(value); + else { + zoom_panel->update(auto_zoom); + composite_panel->cpanel_zoom->update(new_zoom); } } + else if( mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM ) { + composite_panel->cpanel_zoom->update(new_zoom); + } - canvas->update_zoom((int)x, - (int)y, - new_zoom); + canvas->update_zoom((int)x, (int)y, new_zoom); canvas->reposition_window(mwindow->edl, - mwindow->theme->ccanvas_x, - mwindow->theme->ccanvas_y, - mwindow->theme->ccanvas_w, - mwindow->theme->ccanvas_h); + mwindow->theme->ccanvas_x, mwindow->theme->ccanvas_y, + mwindow->theme->ccanvas_w, mwindow->theme->ccanvas_h); canvas->draw_refresh(); } @@ -763,15 +769,8 @@ int CWindowMeters::change_status_event(int new_status) CWindowZoom::CWindowZoom(MWindow *mwindow, CWindowGUI *gui, int x, int y, int w) - : ZoomPanel(mwindow, - gui, - (double)mwindow->edl->session->cwindow_zoom, - x, - y, - w, - my_zoom_table, - total_zooms, - ZOOM_PERCENTAGE) + : ZoomPanel(mwindow, gui, (double)mwindow->edl->session->cwindow_zoom, + x, y, w, my_zoom_table, total_zooms, ZOOM_PERCENTAGE) { this->mwindow = mwindow; this->gui = gui; @@ -783,15 +782,9 @@ CWindowZoom::~CWindowZoom() int CWindowZoom::handle_event() { - if(!strcasecmp(gui->auto_zoom, get_text())) - { - gui->zoom_canvas(1, get_value(), 0); - } - else - { - gui->zoom_canvas(0, get_value(), 0); - } - + int do_auto = !strcasecmp(gui->auto_zoom, get_text()) ? 1 : 0; + float zoom = do_auto ? gui->get_auto_zoom() : get_value(); + gui->zoom_canvas(do_auto, zoom, 0); return 1; } @@ -973,7 +966,7 @@ void CWindowCanvas::update_zoom(int x, int y, float zoom) void CWindowCanvas::zoom_auto() { - gui->zoom_canvas(1, 1.0, 1); + gui->zoom_canvas(1, gui->get_auto_zoom(), 1); } int CWindowCanvas::get_xscroll() @@ -3018,6 +3011,9 @@ int CWindowCanvas::test_zoom(int &redraw) gui->zoom_panel->update(zoom); + if( gui->mwindow->edl->session->cwindow_operation == CWINDOW_ZOOM ) { + gui->composite_panel->cpanel_zoom->update(zoom); + } return result; } diff --git a/cinelerra-5.1/cinelerra/cwindowgui.h b/cinelerra-5.1/cinelerra/cwindowgui.h index 931047e5..a5d18926 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.h +++ b/cinelerra-5.1/cinelerra/cwindowgui.h @@ -60,8 +60,10 @@ public: CWindowGUI(MWindow *mwindow, CWindow *cwindow); ~CWindowGUI(); - void create_objects(); + void create_objects(); int resize_event(int w, int h); + void zoom_canvas(int do_auto, double value, int update_menu); + float get_auto_zoom(); // Events for the fullscreen canvas fall through to here. int button_press_event(); @@ -70,9 +72,6 @@ public: int button_release_event(); int cursor_motion_event(); - - void zoom_canvas(int do_auto, double value, int update_menu); - int close_event(); int keypress_event(); int translation_event(); diff --git a/cinelerra-5.1/cinelerra/cwindowtool.C b/cinelerra-5.1/cinelerra/cwindowtool.C index 026aa320..ee1c1044 100644 --- a/cinelerra-5.1/cinelerra/cwindowtool.C +++ b/cinelerra-5.1/cinelerra/cwindowtool.C @@ -812,9 +812,9 @@ void CWindowCameraGUI::handle_event() if(z_auto) { float zoom = atof(z->get_text()); - if(zoom > 10) zoom = 10; + if(zoom > 100.) zoom = 100.; else - if(zoom < 0) zoom = 0; + if(zoom < 0.01) zoom = 0.01; // Doesn't allow user to enter from scratch // if(zoom != atof(z->get_text())) // z->update(zoom); @@ -855,8 +855,11 @@ void CWindowCameraGUI::update() x->update(x_auto->get_value()); if(y_auto) y->update(y_auto->get_value()); - if(z_auto) - z->update(z_auto->get_value()); + if(z_auto) { + float value = z_auto->get_value(); + z->update(value); + thread->gui->composite_panel->cpanel_zoom->update(value); + } if( x_auto && y_auto && z_auto ) { @@ -1257,9 +1260,8 @@ void CWindowProjectorGUI::handle_event() if(z_auto) { float zoom = atof(z->get_text()); - if(zoom > 10000) zoom = 10000; - else - if(zoom < 0) zoom = 0; + if(zoom > 100.) zoom = 100.; + else if(zoom < 0.01) zoom = 0.01; // if (zoom != atof(z->get_text())) // z->update(zoom); z_auto->set_value(zoom); @@ -1299,8 +1301,11 @@ void CWindowProjectorGUI::update() x->update(x_auto->get_value()); if(y_auto) y->update(y_auto->get_value()); - if(z_auto) - z->update(z_auto->get_value()); + if(z_auto) { + float value = z_auto->get_value(); + z->update(value); + thread->gui->composite_panel->cpanel_zoom->update(value); + } if( x_auto && y_auto && z_auto ) { diff --git a/cinelerra-5.1/cinelerra/dcraw.c b/cinelerra-5.1/cinelerra/dcraw.c index 52c3f920..98106822 100644 --- a/cinelerra-5.1/cinelerra/dcraw.c +++ b/cinelerra-5.1/cinelerra/dcraw.c @@ -3325,7 +3325,8 @@ int CLASS foveon_fixed (void *ptr, int size, const char *name) { void *dp; unsigned dim[3]; - +// CINELERRA + memset (ptr, 0, size*4); if (!name) return 0; dp = foveon_camf_matrix (dim, name); if (!dp) return 0; diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index cf1d0968..3dc2153e 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -1022,19 +1022,10 @@ int64_t EDL::get_tracks_width() // Get the total output size scaled to aspect ratio void EDL::calculate_conformed_dimensions(int single_channel, float &w, float &h) { - w = session->output_w; - h = session->output_h; - if((float)session->output_w / session->output_h > get_aspect_ratio()) - { - h = (float)h * - (session->output_w / get_aspect_ratio() / session->output_h); - } + h = (w = session->output_w) / get_aspect_ratio(); else - { - w = (float)w * - (h * get_aspect_ratio() / session->output_w); - } + w = (h = session->output_h) * get_aspect_ratio(); } float EDL::get_aspect_ratio() diff --git a/cinelerra-5.1/cinelerra/filecr2.C b/cinelerra-5.1/cinelerra/filecr2.C index 0d36b26f..fdd5b2c7 100644 --- a/cinelerra-5.1/cinelerra/filecr2.C +++ b/cinelerra-5.1/cinelerra/filecr2.C @@ -132,7 +132,7 @@ int FileCR2::check_sig(Asset *asset) int FileCR2::read_frame_header(char *path) { int argc = 3; -printf("FileCR2::read_frame_header %d\n", __LINE__); +//printf("FileCR2::read_frame_header %d\n", __LINE__); const char *argv[4] = { "dcraw", @@ -144,7 +144,7 @@ printf("FileCR2::read_frame_header %d\n", __LINE__); int result = dcraw_run(argc, argv); if(!result) format_to_asset(); -printf("FileCR2::read_frame_header %d %d\n", __LINE__, result); +//printf("FileCR2::read_frame_header %d %d\n", __LINE__, result); return result; } @@ -216,7 +216,7 @@ int FileCR2::read_frame(VFrame *frame, char *path) argv[argc++] = (char*)"-d"; } -printf("FileCR2::read_frame %d %s\n", __LINE__, path); +//printf("FileCR2::read_frame %d %s\n", __LINE__, path); argv[argc++] = path; dcraw_data = (float**)frame->get_rows(); @@ -270,7 +270,7 @@ int FileCR2::get_best_colormodel(Asset *asset, int driver) // int64_t FileCR2::get_memory_usage() // { // int64_t result = asset->width * asset->height * sizeof(float) * 3; -// //printf("FileCR2::get_memory_usage %d " _LD "\n", __LINE__, result); +//printf("FileCR2::get_memory_usage %d " _LD "\n", __LINE__, result); // return result; // } diff --git a/cinelerra-5.1/cinelerra/filelist.C b/cinelerra-5.1/cinelerra/filelist.C index a7861e14..e910e8e8 100644 --- a/cinelerra-5.1/cinelerra/filelist.C +++ b/cinelerra-5.1/cinelerra/filelist.C @@ -21,6 +21,7 @@ #include "asset.h" #include "bcsignals.h" +#include "cstrdup.h" #include "file.h" #include "filelist.h" #include "guicast.h" @@ -207,59 +208,51 @@ int FileList::write_list_header() int FileList::read_list_header() { - char string[BCTEXTLEN], *new_entry; + char string[BCTEXTLEN]; FILE *stream = fopen(asset->path, "r"); - - - if(stream) - { + if( !stream ) return 1; // Get information about the frames - do - { - (void)fgets(string, BCTEXTLEN, stream); - }while(!feof(stream) && (string[0] == '#' || string[0] == ' ' || isalpha(string[0]))); + do { + if( feof(stream) || !fgets(string, BCTEXTLEN, stream) ) return 1; + } while(string[0] == '#' || string[0] == ' ' || isalpha(string[0])); // Don't want a user configured frame rate to get destroyed - if(asset->frame_rate == 0) - asset->frame_rate = atof(string); - - do - { - (void)fgets(string, BCTEXTLEN, stream); - }while(!feof(stream) && (string[0] == '#' || string[0] == ' ')); - asset->width = atol(string); - - do - { - (void)fgets(string, BCTEXTLEN, stream); - }while(!feof(stream) && (string[0] == '#' || string[0] == ' ')); - asset->height = atol(string); - - asset->interlace_mode = ILACE_MODE_UNDETECTED; // May be good to store the info in the list? - asset->layers = 1; - asset->audio_data = 0; - asset->video_data = 1; + if(asset->frame_rate == 0) + asset->frame_rate = atof(string); + + do { + if( feof(stream) || !fgets(string, BCTEXTLEN, stream) ) return 1; + } while(string[0] == '#' || string[0] == ' '); + if( (asset->width = atol(string)) <= 0 ) return 1; + + do { + if( feof(stream) || !fgets(string, BCTEXTLEN, stream) ) return 1; + } while(string[0] == '#' || string[0] == ' '); + if( (asset->height = atol(string)) <= 0 ) return 1; + + asset->interlace_mode = ILACE_MODE_UNDETECTED; + asset->layers = 1; + asset->audio_data = 0; + asset->video_data = 1; // Get all the paths - while(!feof(stream)) - { - (void)fgets(string, BCTEXTLEN, stream); - if(strlen(string) && string[0] != '#' && string[0] != ' ' && !feof(stream)) - { - string[strlen(string) - 1] = 0; - path_list.append(new_entry = new char[strlen(string) + 1]); - strcpy(new_entry, string); - } - } - -//for(int i = 0; i < path_list.total; i++) printf("%s\n", path_list.values[i]); - fclose(stream); - asset->video_length = path_list.total; + int missing = 0; + while(!feof(stream) && fgets(string, BCTEXTLEN, stream) ) { + int len = strlen(string); + if( !len || string[0] == '#' || string[0] == ' ') continue; + string[len-1] = 0; + if( access(string,R_OK) && !missing++ ) + eprintf(_("%s:no such file"), string); + path_list.append(cstrdup(string)); } - else - return 1; +//for(int i = 0; i < path_list.total; i++) printf("%s\n", path_list.values[i]); + fclose(stream); + if( !(asset->video_length = path_list.total) ) + eprintf(_("%s:\nlist empty"), asset->path); + if( missing ) + eprintf(_("%s:\n%d files not found"), asset->path, missing); return 0; } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 3887a8da..75dc29ac 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -231,6 +231,7 @@ MWindow::MWindow() MWindow::~MWindow() { run_lock->lock("MWindow::~MWindow"); + stop_playback(1); in_destructor = 1; //printf("MWindow::~MWindow %d\n", __LINE__); gui->stop_drawing(); @@ -1334,17 +1335,12 @@ void MWindow::stop_playback(int wait) int locked = gui->get_window_lock(); if( locked ) gui->unlock_window(); - cwindow->playback_engine->que->send_command(STOP, - CHANGE_NONE, - 0, - 0); - cwindow->playback_engine->interrupt_playback(wait); + cwindow->playback_engine->stop_playback(); for(int i = 0; i < vwindows.size(); i++) { VWindow *vwindow = vwindows[i]; if( !vwindow->is_running() ) continue; - vwindow->playback_engine->que->send_command(STOP, CHANGE_NONE, 0, 0); - vwindow->playback_engine->interrupt_playback(wait); + vwindow->playback_engine->stop_playback(); } if( locked ) gui->lock_window("MWindow::stop_playback"); } diff --git a/cinelerra-5.1/cinelerra/playbackengine.C b/cinelerra-5.1/cinelerra/playbackengine.C index 27d177c5..802b7b61 100644 --- a/cinelerra-5.1/cinelerra/playbackengine.C +++ b/cinelerra-5.1/cinelerra/playbackengine.C @@ -358,7 +358,6 @@ void PlaybackEngine::run() wait_render_engine(); - // Read the new command que->input_lock->lock("PlaybackEngine::run"); if(done) return; @@ -369,7 +368,6 @@ void PlaybackEngine::run() //printf("PlaybackEngine::run 1 %d\n", command->command); - switch(command->command) { // Parameter change only @@ -423,4 +421,13 @@ void PlaybackEngine::run() } +void PlaybackEngine::stop_playback() +{ + que->send_command(STOP, CHANGE_NONE, 0, 0); + interrupt_playback(1); + renderengine_lock->lock("PlaybackEngine::stop_playback"); + if(render_engine) + render_engine->wait_done(); + renderengine_lock->unlock(); +} diff --git a/cinelerra-5.1/cinelerra/playbackengine.h b/cinelerra-5.1/cinelerra/playbackengine.h index 1cbd24d3..9d2d35e3 100644 --- a/cinelerra-5.1/cinelerra/playbackengine.h +++ b/cinelerra-5.1/cinelerra/playbackengine.h @@ -81,6 +81,7 @@ public: ChannelDB* get_channeldb(); void run(); + void stop_playback(); // Maintain caches through console changes CICache *audio_cache, *video_cache; diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 4d1a4156..9393d435 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -63,7 +63,7 @@ #define WIDTH 770 -#define HEIGHT 690 +#define HEIGHT 720 PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) diff --git a/cinelerra-5.1/cinelerra/renderengine.C b/cinelerra-5.1/cinelerra/renderengine.C index 970a91b0..6ad6629c 100644 --- a/cinelerra-5.1/cinelerra/renderengine.C +++ b/cinelerra-5.1/cinelerra/renderengine.C @@ -76,6 +76,7 @@ RenderEngine::RenderEngine(PlaybackEngine *playback_engine, input_lock = new Condition(1, "RenderEngine::input_lock"); start_lock = new Condition(1, "RenderEngine::start_lock"); output_lock = new Condition(1, "RenderEngine::output_lock"); + render_active = new Condition(1,"RenderEngine::render_active"); interrupt_lock = new Mutex("RenderEngine::interrupt_lock"); first_frame_lock = new Condition(1, "RenderEngine::first_frame_lock"); } @@ -503,6 +504,7 @@ void RenderEngine::get_module_levels(ArrayList *module_levels, int64_t p void RenderEngine::run() { + render_active->lock("RenderEngine::run"); start_render_threads(); start_lock->unlock(); interrupt_lock->unlock(); @@ -555,7 +557,13 @@ void RenderEngine::run() input_lock->unlock(); interrupt_lock->unlock(); + render_active->unlock(); } +void RenderEngine::wait_done() +{ + render_active->lock("RenderEngine::wait_done"); + render_active->unlock(); +} diff --git a/cinelerra-5.1/cinelerra/renderengine.h b/cinelerra-5.1/cinelerra/renderengine.h index fd400c2d..b34fbf60 100644 --- a/cinelerra-5.1/cinelerra/renderengine.h +++ b/cinelerra-5.1/cinelerra/renderengine.h @@ -58,6 +58,7 @@ public: void start_render_threads(); void wait_render_threads(); void interrupt_playback(); + void wait_done(); int get_output_w(); int get_output_h(); int brender_available(int position, int direction); @@ -106,6 +107,7 @@ public: // Lock out interrupts until started Condition *start_lock; Condition *output_lock; + Condition *render_active; // Lock out audio and synchronization timers until first frame is done Condition *first_frame_lock; // Lock out interrupts before and after renderengine is active diff --git a/cinelerra-5.1/cinelerra/zoompanel.C b/cinelerra-5.1/cinelerra/zoompanel.C index 8b58f1a6..e826e30b 100644 --- a/cinelerra-5.1/cinelerra/zoompanel.C +++ b/cinelerra-5.1/cinelerra/zoompanel.C @@ -45,30 +45,8 @@ ZoomHash::~ZoomHash() } - - - - - - - - - - - - - - - -ZoomPanel::ZoomPanel(MWindow *mwindow, - BC_WindowBase *subwindow, - double value, - int x, - int y, - int w, - double min, - double max, - int zoom_type) +ZoomPanel::ZoomPanel(MWindow *mwindow, BC_WindowBase *subwindow, double value, + int x, int y, int w, double min, double max, int zoom_type) { this->mwindow = mwindow; this->subwindow = subwindow; @@ -83,15 +61,8 @@ ZoomPanel::ZoomPanel(MWindow *mwindow, this->user_size = 0; } -ZoomPanel::ZoomPanel(MWindow *mwindow, - BC_WindowBase *subwindow, - double value, - int x, - int y, - int w, - double *user_table, - int user_size, - int zoom_type) +ZoomPanel::ZoomPanel(MWindow *mwindow, BC_WindowBase *subwindow, double value, + int x, int y, int w, double *user_table, int user_size, int zoom_type) { this->mwindow = mwindow; this->subwindow = subwindow; diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C index 6cde612d..26ccf9a4 100644 --- a/cinelerra-5.1/guicast/thread.C +++ b/cinelerra-5.1/guicast/thread.C @@ -127,9 +127,14 @@ int Thread::join() // join this thread { if( !exists() ) return 0; if( synchronous ) { -// NOTE: this does not do anything if the thread is not synchronous +// NOTE: this fails if the thread is not synchronous or +// or another thread is already waiting to join. int ret = pthread_join(tid, 0); - if( ret ) strerror(ret); + if( ret ) { + fflush(stdout); + fprintf(stderr, "Thread %p: %s\n", (void*)tid, strerror(ret)); + fflush(stderr); + } CLEAR_LOCKS_TID(tid); TheList::dbg_del(tid); tid = ((pthread_t)-1); diff --git a/cinelerra-5.1/msg.txt b/cinelerra-5.1/msg.txt index ca4de10a..036b40a3 100644 --- a/cinelerra-5.1/msg.txt +++ b/cinelerra-5.1/msg.txt @@ -1,7 +1,49 @@ -Email cinelerra@lists.cinelerra-cv.org for bugs or help -Check the manual https://cinelerra-cv.org/docs/cinelerra_cv_manual_en.html -Testers are welcome to report and supply examples; join at cinelerra-cv.org -If logged in as root, can capture crashes and email /tmp/cin*.dmp file -Volunteer to help with language translations which will help you -Helpful videos: http://beccatoria.dreamwidth.org/144288.html#cutid2 -Also see: http://g-raffa.eu/Cinelerra/HOWTO/basics.html +Email cinelerra@lists.cinelerra-cv.org 4 help. +Join Mailing List at cinelerra-cv.org. +Testers/programmers/translators needed. +Use root, to capture crashes in /tmp/cin*.dmp file. +For usage help, refer to the following: + https://cinelerra-cv.org/docs/cinelerra_cv_manual_en.html + https://cinelerra-cv.org/five/Features5.pdf + http://beccatoria.dreamwidth.org/144288.html#cutid2 + http://g-raffa.eu/Cinelerra/HOWTO/basics.html +May 2017 Release/Changes of note: + Title plugin allows for 3071 characters now. + Horizontal scrollbar added to Title plugin. + Number of chars. used/remaining show in Titler. + Faststart option added for Mp4/ffmpeg format. + Probe Order preference added for flexibility. + Dcraw program updated to latest Coffin version. + NOTE: to use raw mode, must enable CR2 probe. + Equalizer plugin lock problem fixed + others. + Gif files now correctly handled by ffmpeg. + Zoom bar in compositor handles any size. +April 2017 Release/Changes of note: + Upgraded FFMPEG to 3.3 + other 3rd party libraries. + Blue Banana plugin improvements - End Mask +. + New OGG option file / Ubuntu 17 build added. + Fixed Background Rendering / added G HotKey. + Aspect Ratio when not 1 to 1, is now correct. +March 2017 Release/Changes of note: + Title plugin major changes to include: + ColorPicker added, fast Font selection, + Stroker for fonts added, BC_FONT_PATH. + 32-bit Debian build now available. + New Quicktime options for v308/v410/16mmto264. + Added C_/D_ for ambiguous translations. + Fixed Fade/curve not copying correctly backward. +February 2017 Release/Changes of note: + Title plugin major changes to include: + Drag with 9 different handles, Background + video, individual character attributes of + Color, Size, Font, Underline, Bold, Italic, + Caps, Blink, Alpha, Nudge, Sup(erscript, + subscript), and PNG inclusion + Rt. Click. + Text focus policy choice preference added. + Bluray creation allowing for non-root usage. +January 2017 Release/Changes of note: + Motion51 plugin added with easier usage. + Unicode characters can be put into textbox. + Smooth Lines create near-perfect circles/curves. + Bluray creation improved to cover more area. + H265 options file added for mp4 rendering. diff --git a/cinelerra-5.1/plugins/theme_blond/blondtheme.C b/cinelerra-5.1/plugins/theme_blond/blondtheme.C index bffbcdcb..e208269a 100644 --- a/cinelerra-5.1/plugins/theme_blond/blondtheme.C +++ b/cinelerra-5.1/plugins/theme_blond/blondtheme.C @@ -337,6 +337,16 @@ void BlondTheme::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index e4e4460f..ff4bef77 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -118,6 +118,16 @@ void BlondCVTheme::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_blue/bluetheme.C b/cinelerra-5.1/plugins/theme_blue/bluetheme.C index 8bc27de9..254a10b8 100644 --- a/cinelerra-5.1/plugins/theme_blue/bluetheme.C +++ b/cinelerra-5.1/plugins/theme_blue/bluetheme.C @@ -337,6 +337,16 @@ void BlueDotTheme::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_bright/brighttheme.C b/cinelerra-5.1/plugins/theme_bright/brighttheme.C index 2c6da4c6..05388641 100644 --- a/cinelerra-5.1/plugins/theme_bright/brighttheme.C +++ b/cinelerra-5.1/plugins/theme_bright/brighttheme.C @@ -340,6 +340,16 @@ void BrightTheme::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C index 90c94ae0..57ada334 100644 --- a/cinelerra-5.1/plugins/theme_hulk/hulktheme.C +++ b/cinelerra-5.1/plugins/theme_hulk/hulktheme.C @@ -338,6 +338,16 @@ void HULKTHEME::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C index 97234bc6..926b9429 100644 --- a/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C +++ b/cinelerra-5.1/plugins/theme_pinklady/pinkladytheme.C @@ -323,6 +323,16 @@ void PINKLADY::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_suv/suv.C b/cinelerra-5.1/plugins/theme_suv/suv.C index b45a18e4..bd7a163f 100644 --- a/cinelerra-5.1/plugins/theme_suv/suv.C +++ b/cinelerra-5.1/plugins/theme_suv/suv.C @@ -336,6 +336,16 @@ void SUV::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png"); diff --git a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C index 27140de1..699ae0b6 100644 --- a/cinelerra-5.1/plugins/theme_unflat/unflattheme.C +++ b/cinelerra-5.1/plugins/theme_unflat/unflattheme.C @@ -332,6 +332,16 @@ void UNFLATTHEME::initialize() "hslider_bg_up.png", "hslider_bg_hi.png", "hslider_bg_dn.png"); + resources->vertical_slider_data = new_image_set(6, + "hslider_fg_up.png", + "hslider_fg_hi.png", + "hslider_fg_dn.png", + "hslider_bg_up.png", + "hslider_bg_hi.png", + "hslider_bg_dn.png"); + for( int i=0; i<6; ++i ) + resources->vertical_slider_data[i]->rotate90(); + resources->progress_images = new_image_set(2, "progress_bg.png", "progress_hi.png");