From 95683646dce10ad3f6a8c8c9c9225c69f4841ec5 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sun, 16 Jul 2017 17:12:58 -0600 Subject: [PATCH] label edit deadlock, build openexr cfg option, code cleanup --- cinelerra-5.1/cinelerra/asset.C | 1 + cinelerra-5.1/cinelerra/assetedit.C | 224 +++++++--------- cinelerra-5.1/cinelerra/assetedit.h | 66 +++-- cinelerra-5.1/cinelerra/assetedit.inc | 2 +- cinelerra-5.1/cinelerra/assetpopup.C | 77 +++--- cinelerra-5.1/cinelerra/assetpopup.h | 15 +- cinelerra-5.1/cinelerra/awindowgui.C | 12 +- cinelerra-5.1/cinelerra/awindowgui.h | 6 +- cinelerra-5.1/cinelerra/clipedit.C | 66 ++--- cinelerra-5.1/cinelerra/clipedit.h | 5 +- cinelerra-5.1/cinelerra/clippopup.C | 27 +- cinelerra-5.1/cinelerra/ctimebar.C | 49 +--- cinelerra-5.1/cinelerra/file.C | 266 +++++++++---------- cinelerra-5.1/cinelerra/fileexr.C | 3 + cinelerra-5.1/cinelerra/fileexr.h | 1 + cinelerra-5.1/cinelerra/fileexr.inc | 5 + cinelerra-5.1/cinelerra/formatpopup.C | 2 + cinelerra-5.1/cinelerra/labeledit.C | 13 +- cinelerra-5.1/cinelerra/labeledit.h | 5 +- cinelerra-5.1/cinelerra/labelpopup.C | 8 +- cinelerra-5.1/cinelerra/mwindow.C | 12 +- cinelerra-5.1/cinelerra/mwindowedit.C | 4 +- cinelerra-5.1/cinelerra/timebar.C | 355 ++++++++++---------------- cinelerra-5.1/configure.ac | 66 +++-- cinelerra-5.1/doc/ShellCmds.html | 6 - 25 files changed, 591 insertions(+), 705 deletions(-) diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index 4665551c..af87bdbb 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -128,6 +128,7 @@ int Asset::init_values() ac3_bitrate = 128; png_use_alpha = 0; + exr_use_alpha = 0; exr_compression = 0; diff --git a/cinelerra-5.1/cinelerra/assetedit.C b/cinelerra-5.1/cinelerra/assetedit.C index eebc32af..ec9ad57a 100644 --- a/cinelerra-5.1/cinelerra/assetedit.C +++ b/cinelerra-5.1/cinelerra/assetedit.C @@ -76,22 +76,20 @@ AssetEdit::~AssetEdit() } -void AssetEdit::edit_asset(Indexable *indexable) +void AssetEdit::edit_asset(Indexable *indexable, int x, int y) { close_window(); this->indexable = indexable; this->indexable->add_user(); + this->x = x; this->y = y; // Copy asset parameters into temporary storage for editing. - if(indexable->is_asset) - { + if( indexable->is_asset ) { changed_params->copy_from((Asset*)indexable, 0); } - else - { + else { EDL *nested_edl = (EDL*)indexable; - - strcpy(changed_params->path, nested_edl->path); + strcpy(changed_params->path, nested_edl->path); changed_params->sample_rate = nested_edl->session->sample_rate; changed_params->channels = nested_edl->session->audio_channels; @@ -110,12 +108,12 @@ void AssetEdit::handle_done_event(int result) void AssetEdit::handle_close_event(int result) { - if(!result) { + if( !result ) { int changed = 0; Asset *asset = 0; EDL *nested_edl = 0; - if(indexable->is_asset) { + if( indexable->is_asset ) { asset = (Asset*)indexable; if( !changed_params->equivalent(*asset, 1, 1, mwindow->edl) ) changed = 1; @@ -123,18 +121,18 @@ void AssetEdit::handle_close_event(int result) else { nested_edl = (EDL*)indexable; if( strcmp(changed_params->path, nested_edl->path) -// || changed_params->sample_rate != nested_edl->session->sample_rate -// || !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate +// || changed_params->sample_rate != nested_edl->session->sample_rate +// || !EQUIV(changed_params->frame_rate, nested_edl->session->frame_rate ) changed = 1; } - if(changed) { + if( changed ) { mwindow->gui->lock_window(); //printf("AssetEdit::handle_close_event %d\n", __LINE__); // Omit index status from copy since an index rebuild may have been // happening when new_asset was created but not be happening anymore. - if(asset) { + if( asset ) { mwindow->remove_asset_from_caches(asset); //printf("AssetEdit::handle_close_event %d %f\n", __LINE__, asset->get_frame_rate()); asset->copy_from(changed_params, 0); @@ -143,8 +141,8 @@ void AssetEdit::handle_close_event(int result) else { strcpy(nested_edl->path, changed_params->path); // Other parameters can't be changed because they're defined in the other EDL -// nested_edl->session->frame_rate = changed_params->frame_rate; -// nested_edl->session->sample_rate = changed_params->sample_rate; +// nested_edl->session->frame_rate = changed_params->frame_rate; +// nested_edl->session->sample_rate = changed_params->sample_rate; } //printf("AssetEdit::handle_close_event %d\n", __LINE__); @@ -207,8 +205,7 @@ int AssetEdit::window_height() AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit) : BC_Window(_(PROGRAM_NAME ": Asset Info"), - mwindow->gui->get_abs_cursor_x(1) - 400 / 2, - mwindow->gui->get_abs_cursor_y(1) - asset_edit->window_height() / 2, + asset_edit->x - 450/2, asset_edit->y - asset_edit->window_height()/2, 450, asset_edit->window_height(), 0, 0, 1) { this->mwindow = mwindow; @@ -219,7 +216,7 @@ AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit) hilo = 0; lohi = 0; allow_edits = 0; - detail_thread = 0; + detail_dialog = 0; win_width = 0; win_height = 0; } @@ -231,8 +228,8 @@ AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit) AssetEditWindow::~AssetEditWindow() { lock_window("AssetEditWindow::~AssetEditWindow"); - if(bitspopup) delete bitspopup; - if(detail_thread) delete detail_thread; + delete bitspopup; + delete detail_dialog; unlock_window(); } @@ -252,33 +249,30 @@ void AssetEditWindow::create_objects() Asset *asset = 0; EDL *nested_edl = 0; - if(asset_edit->indexable->is_asset) + if( asset_edit->indexable->is_asset ) asset = (Asset*)asset_edit->indexable; else nested_edl = (EDL*)asset_edit->indexable; - if(asset && asset->format == FILE_PCM) + if( asset && asset->format == FILE_PCM ) allow_edits = 1; else allow_edits = 0; lock_window("AssetEditWindow::create_objects"); - if(allow_edits) + if( allow_edits ) vmargin = 30; else vmargin = 20; add_subwindow(path_text = new AssetEditPathText(this, y)); - add_subwindow(path_button = new AssetEditPath(mwindow, - this, - path_text, - y, - asset_edit->indexable->path, - _(PROGRAM_NAME ": Asset path"), _("Select a file for this asset:"))); + add_subwindow(path_button = new AssetEditPath(mwindow, this, + path_text, y, asset_edit->indexable->path, + _(PROGRAM_NAME ": Asset path"), + _("Select a file for this asset:"))); y += 30; - if(asset) - { + if( asset ) { add_subwindow(new BC_Title(x, y, _("File format:"))); x = x2; add_subwindow(new BC_Title(x, y, File::formattostr(mwindow->plugindb, @@ -295,9 +289,8 @@ void AssetEditWindow::create_objects() add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); - if(asset->format == FILE_MPEG || asset->format == FILE_FFMPEG) - { - detail_thread = new DetailAssetThread(mwindow); + if( asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) { + detail_dialog = new DetailAssetDialog(mwindow); BC_GenericButton *detail = new DetailAssetButton(this, x2+120, y); add_subwindow(detail); } @@ -309,12 +302,12 @@ void AssetEditWindow::create_objects() y += 20; x = x1; - if(asset->audio_length > 0) + if( asset->audio_length > 0 ) length = (double)asset->audio_length / asset->sample_rate; - if(asset->video_length > 0) + if( asset->video_length > 0 ) length = MAX(length, (double)asset->video_length / asset->frame_rate); int64_t bitrate; - if(!EQUIV(length, 0)) + if( !EQUIV(length, 0) ) bitrate = (int64_t)(bytes * 8 / length); else bitrate = bytes; @@ -328,8 +321,7 @@ void AssetEditWindow::create_objects() x = x1; } - if((asset && asset->audio_data) || nested_edl) - { + if( (asset && asset->audio_data) || nested_edl ) { add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); y += 5; @@ -337,10 +329,8 @@ void AssetEditWindow::create_objects() y += 30; - if(asset) - { - if(asset->get_compression_text(1, 0)) - { + if( asset ) { + if( asset->get_compression_text(1, 0) ) { add_subwindow(new BC_Title(x, y, _("Compression:"))); x = x2; add_subwindow(new BC_Title(x, @@ -357,8 +347,7 @@ void AssetEditWindow::create_objects() sprintf(string, "%d", asset_edit->changed_params->channels); x = x2; - if(allow_edits) - { + if( allow_edits ) { BC_TumbleTextBox *textbox = new AssetEditChannels(this, string, x, @@ -366,8 +355,7 @@ void AssetEditWindow::create_objects() textbox->create_objects(); y += vmargin; } - else - { + else { add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); y += 20; } @@ -377,36 +365,26 @@ void AssetEditWindow::create_objects() sprintf(string, "%d", asset_edit->changed_params->sample_rate); x = x2; - if(asset) - { + if( asset ) { BC_TextBox *textbox; add_subwindow(textbox = new AssetEditRate(this, string, x, y)); x += textbox->get_w(); add_subwindow(new SampleRatePulldown(mwindow, textbox, x, y)); } - else - { + else { add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); } y += 30; x = x1; - if(asset) - { + if( asset ) { add_subwindow(new BC_Title(x, y, _("Bits:"))); x = x2; - if(allow_edits) - { - bitspopup = new BitsPopup(this, - x, - y, + if( allow_edits ) { + bitspopup = new BitsPopup(this, x, y, &asset_edit->changed_params->bits, - 1, - 1, - 1, - 0, - 1); + 1, 1, 1, 0, 1); bitspopup->create_objects(); } else @@ -419,7 +397,7 @@ void AssetEditWindow::create_objects() sprintf(string, "%d", asset->header); x = x2; - if(allow_edits) + if( allow_edits ) add_subwindow(new AssetEditHeader(this, string, x, y)); else add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); @@ -429,7 +407,7 @@ void AssetEditWindow::create_objects() add_subwindow(new BC_Title(x, y, _("Byte order:"))); - if(allow_edits) + if( allow_edits ) { x = x2; @@ -444,10 +422,9 @@ void AssetEditWindow::create_objects() y)); y += vmargin; } - else - { + else { x = x2; - if(asset->byte_order) + if( asset->byte_order ) add_subwindow(new BC_Title(x, y, _("Lo-Hi"), MEDIUMFONT, mwindow->theme->assetedit_color)); else add_subwindow(new BC_Title(x, y, _("Hi-Lo"), MEDIUMFONT, mwindow->theme->assetedit_color)); @@ -456,14 +433,12 @@ void AssetEditWindow::create_objects() x = x1; - if(allow_edits) - { + if( allow_edits ) { // add_subwindow(new BC_Title(x, y, _("Values are signed:"))); add_subwindow(new AssetEditSigned(this, asset->signed_, x, y)); } - else - { - if(!asset->signed_ && asset->bits == 8) + else { + if( !asset->signed_ && asset->bits == 8 ) add_subwindow(new BC_Title(x, y, _("Values are unsigned"))); else add_subwindow(new BC_Title(x, y, _("Values are signed"))); @@ -474,8 +449,7 @@ void AssetEditWindow::create_objects() } x = x1; - if((asset && asset->video_data) || nested_edl) - { + if( (asset && asset->video_data) || nested_edl ) { add_subwindow(new BC_Bar(x, y, get_w() - x * 2)); y += 5; @@ -484,8 +458,7 @@ void AssetEditWindow::create_objects() x = x1; - if(asset && asset->get_compression_text(0,1)) - { + if( asset && asset->get_compression_text(0,1) ) { add_subwindow(new BC_Title(x, y, _("Compression:"))); x = x2; add_subwindow(new BC_Title(x, @@ -502,15 +475,13 @@ void AssetEditWindow::create_objects() sprintf(string, "%.4f", asset_edit->changed_params->frame_rate); //printf("AssetEditWindow::create_objects %d %f\n", __LINE__, asset_edit->changed_params->frame_rate); - if(asset) - { + if( asset ) { BC_TextBox *framerate; add_subwindow(framerate = new AssetEditFRate(this, string, x, y)); x += 105; add_subwindow(new FrameRatePulldown(mwindow, framerate, x, y)); } - else - { + else { add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->assetedit_color)); } @@ -531,8 +502,7 @@ void AssetEditWindow::create_objects() add_subwindow(win_height); y += win_height->get_h() + 5; - if(asset && (asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) ) - { + if( asset && (asset->format == FILE_MPEG || asset->format == FILE_FFMPEG ) ) { y += 5; x = x1; add_subwindow(new BC_Title(x, y, _("Actual width:"))); @@ -594,7 +564,9 @@ void AssetEditWindow::create_objects() void AssetEditWindow::show_info_detail() { - detail_thread->start((Asset*)asset_edit->indexable); + int cur_x, cur_y; + get_abs_cursor_xy(cur_x, cur_y, 0); + detail_dialog->start((Asset*)asset_edit->indexable, cur_x, cur_y); } @@ -672,24 +644,22 @@ void Interlaceautofix::showhideotherwidgets() int thevalue = get_value(); Asset *asset = fwindow->asset_edit->changed_params; - if (thevalue == ILACE_AUTOFIXOPTION_AUTO) - { - this->ilacemode_textbox->enable(); - this->ilacemode_listbox->enable(); - this->ilacefixmethod_textbox->disable(); - this->ilacefixmethod_listbox->disable(); - int xx = ilaceautofixmethod(mwindow->edl->session->interlace_mode,asset->interlace_mode); - ilacefixmethod_to_text(string,xx); - this->ilacefixmethod_textbox->update(string); - } - if (thevalue == ILACE_AUTOFIXOPTION_MANUAL) - { - this->ilacemode_textbox->disable(); - this->ilacemode_listbox->disable(); - this->ilacefixmethod_textbox->enable(); - this->ilacefixmethod_listbox->enable(); - ilacefixmethod_to_text(string,asset->interlace_fixmethod); - this->ilacefixmethod_textbox->update(string); + if( thevalue == ILACE_AUTOFIXOPTION_AUTO ) { + this->ilacemode_textbox->enable(); + this->ilacemode_listbox->enable(); + this->ilacefixmethod_textbox->disable(); + this->ilacefixmethod_listbox->disable(); + int xx = ilaceautofixmethod(mwindow->edl->session->interlace_mode,asset->interlace_mode); + ilacefixmethod_to_text(string, xx); + this->ilacefixmethod_textbox->update(string); + } + if( thevalue == ILACE_AUTOFIXOPTION_MANUAL ) { + this->ilacemode_textbox->disable(); + this->ilacemode_listbox->disable(); + this->ilacefixmethod_textbox->enable(); + this->ilacefixmethod_listbox->enable(); + ilacefixmethod_to_text(string, asset->interlace_fixmethod); + this->ilacefixmethod_textbox->update(string); } } @@ -929,8 +899,8 @@ int AssetEditFormat::handle_event() DetailAssetButton::DetailAssetButton(AssetEditWindow *fwindow, int x, int y) : BC_GenericButton(x, y, _("Detail")) { - this->fwindow = fwindow; - set_underline(0); + this->fwindow = fwindow; + set_underline(0); } DetailAssetButton::~DetailAssetButton() @@ -940,16 +910,16 @@ DetailAssetButton::~DetailAssetButton() int DetailAssetButton::handle_event() { fwindow->show_info_detail(); - return 1; + return 1; } -DetailAssetWindow::DetailAssetWindow(MWindow *mwindow, Asset *asset) +DetailAssetWindow::DetailAssetWindow(MWindow *mwindow, + DetailAssetDialog *detail_dialog, Asset *asset) : BC_Window(_("Asset Detail"), - mwindow->gui->get_abs_cursor_x(1) - 600/2, - mwindow->gui->get_abs_cursor_y(1) - 500/2, - 600, 500) + detail_dialog->x - 600/2, detail_dialog->y - 500/2, 600, 500) { this->mwindow = mwindow; + this->detail_dialog = detail_dialog; this->asset = asset; asset->add_user(); info[0] = 0; @@ -962,26 +932,16 @@ DetailAssetWindow::~DetailAssetWindow() delete text; } -DetailAssetThread::DetailAssetThread(MWindow *mwindow) - : Thread(1, 0, 0) +DetailAssetDialog::DetailAssetDialog(MWindow *mwindow) + : BC_DialogThread() { this->mwindow = mwindow; dwindow = 0; } -DetailAssetThread::~DetailAssetThread() -{ - stop(); -} - -void DetailAssetThread::stop() +DetailAssetDialog::~DetailAssetDialog() { - if( Thread::running() ) { - dwindow->lock_window("DetailAssetThread::stop"); - dwindow->set_done(1); - dwindow->unlock_window(); - } - Thread::join(); + close_window(); } void DetailAssetWindow::create_objects() @@ -1000,28 +960,24 @@ void DetailAssetWindow::create_objects() break; } } - lock_window("DetailAssetThread::create_objects"); text = new BC_ScrollTextBox(this, x, y, get_w()-32, 23, info, -len); text->create_objects(); text->set_text_row(0); add_subwindow(new BC_OKButton(this)); show_window(); - unlock_window(); } -void DetailAssetThread::start(Asset *asset) +void DetailAssetDialog::start(Asset *asset, int x, int y) { - stop(); delete dwindow; - dwindow = new DetailAssetWindow(mwindow, asset); - Thread::start(); + this->asset = asset; + this->x = x; this->y = y; + BC_DialogThread::start(); } -void DetailAssetThread::run() +BC_Window *DetailAssetDialog::new_gui() { -// Get length from TOC + dwindow = new DetailAssetWindow(mwindow, this, asset); dwindow->create_objects(); - dwindow->run_window(); - delete dwindow; - dwindow = 0; + return dwindow; } diff --git a/cinelerra-5.1/cinelerra/assetedit.h b/cinelerra-5.1/cinelerra/assetedit.h index a0070c81..d1f3c536 100644 --- a/cinelerra-5.1/cinelerra/assetedit.h +++ b/cinelerra-5.1/cinelerra/assetedit.h @@ -42,7 +42,7 @@ public: AssetEdit(MWindow *mwindow); ~AssetEdit(); - void edit_asset(Indexable *indexable); + void edit_asset(Indexable *indexable, int x, int y); int set_asset(Indexable *indexable); void handle_done_event(int result); void handle_close_event(int result); @@ -52,7 +52,7 @@ public: Indexable *indexable; MWindow *mwindow; AssetEditWindow *window; - + int x, y; // Changed parameters Asset *changed_params; @@ -80,7 +80,7 @@ public: AssetEdit *asset_edit; BC_Title *win_width; BC_Title *win_height; - DetailAssetThread *detail_thread; + DetailAssetDialog *detail_dialog; void show_info_detail(); }; @@ -128,7 +128,8 @@ public: class AssetEditChannels : public BC_TumbleTextBox { public: - AssetEditChannels(AssetEditWindow *fwindow, char *text, int x, int y); + AssetEditChannels(AssetEditWindow *fwindow, + char *text, int x, int y); int handle_event(); @@ -138,7 +139,8 @@ public: class AssetEditRate : public BC_TextBox { public: - AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y); + AssetEditRate(AssetEditWindow *fwindow, + char *text, int x, int y); int handle_event(); @@ -148,7 +150,8 @@ public: class AssetEditFRate : public BC_TextBox { public: - AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y); + AssetEditFRate(AssetEditWindow *fwindow, + char *text, int x, int y); int handle_event(); @@ -158,7 +161,8 @@ public: class Interlaceautofix : public BC_CheckBox { public: - Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y); + Interlaceautofix(MWindow *mwindow, AssetEditWindow *fwindow, + int x, int y); ~Interlaceautofix(); int handle_event(); @@ -178,7 +182,8 @@ private: class AssetEditILaceautofixoption : public BC_TextBox { public: - AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w); + AssetEditILaceautofixoption(AssetEditWindow *fwindow, + char *text, int thedefault, int x, int y, int w); int handle_event(); int thedefault; @@ -188,7 +193,8 @@ public: class AssetEditILacemode : public BC_TextBox { public: - AssetEditILacemode(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w); + AssetEditILacemode(AssetEditWindow *fwindow, + const char *text, int thedefault, int x, int y, int w); int handle_event(); int thedefault; AssetEditWindow *fwindow; @@ -198,12 +204,10 @@ class AssetEditInterlacemodePulldown : public BC_ListBox { public: AssetEditInterlacemodePulldown(MWindow *mwindow, - BC_TextBox *output_text, - int *output_value, - ArrayList *data, - Interlaceautofix *fixoption_chkbox, - int x, - int y); + BC_TextBox *output_text, int *output_value, + ArrayList *data, + Interlaceautofix *fixoption_chkbox, + int x, int y); int handle_event(); char* interlacemode_to_text(); MWindow *mwindow; @@ -217,7 +221,8 @@ private: class AssetEditILacefixmethod : public BC_TextBox { public: - AssetEditILacefixmethod(AssetEditWindow *fwindow, const char *text, int thedefault, int x, int y, int w); + AssetEditILacefixmethod(AssetEditWindow *fwindow, + const char *text, int thedefault, int x, int y, int w); int handle_event(); int thedefault; @@ -227,7 +232,8 @@ public: class AssetEditHeader : public BC_TextBox { public: - AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y); + AssetEditHeader(AssetEditWindow *fwindow, + char *text, int x, int y); int handle_event(); @@ -237,7 +243,8 @@ public: class AssetEditByteOrderLOHI : public BC_Radial { public: - AssetEditByteOrderLOHI(AssetEditWindow *fwindow, int value, int x, int y); + AssetEditByteOrderLOHI(AssetEditWindow *fwindow, + int value, int x, int y); int handle_event(); @@ -247,7 +254,8 @@ public: class AssetEditByteOrderHILO : public BC_Radial { public: - AssetEditByteOrderHILO(AssetEditWindow *fwindow, int value, int x, int y); + AssetEditByteOrderHILO(AssetEditWindow *fwindow, + int value, int x, int y); int handle_event(); @@ -257,7 +265,8 @@ public: class AssetEditSigned : public BC_CheckBox { public: - AssetEditSigned(AssetEditWindow *fwindow, int value, int x, int y); + AssetEditSigned(AssetEditWindow *fwindow, + int value, int x, int y); int handle_event(); @@ -271,22 +280,25 @@ class DetailAssetWindow : public BC_Window char info[65536]; BC_ScrollTextBox *text; public: - DetailAssetWindow(MWindow *mwindow, Asset *asset); + DetailAssetWindow(MWindow *mwindow, + DetailAssetDialog *detail_dialog, Asset *asset); ~DetailAssetWindow(); void create_objects(); + DetailAssetDialog *detail_dialog; }; -class DetailAssetThread : public Thread +class DetailAssetDialog : public BC_DialogThread { MWindow *mwindow; DetailAssetWindow *dwindow; public: - DetailAssetThread(MWindow *mwindow); - ~DetailAssetThread(); + DetailAssetDialog(MWindow *mwindow); + ~DetailAssetDialog(); + void start(Asset *asset, int x, int y); + BC_Window* new_gui(); - void start(Asset *asset); - void stop(); - void run(); + Asset *asset; + int x, y; }; diff --git a/cinelerra-5.1/cinelerra/assetedit.inc b/cinelerra-5.1/cinelerra/assetedit.inc index 2f0b5309..2c7675e7 100644 --- a/cinelerra-5.1/cinelerra/assetedit.inc +++ b/cinelerra-5.1/cinelerra/assetedit.inc @@ -40,7 +40,7 @@ class AssetEditByteOrderLOHI; class AssetEditByteOrderHILO; class AssetEditSigned; class DetailAssetWindow; -class DetailAssetThread; +class DetailAssetDialog; class DetailAssetButton; #endif diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 5738db41..bc556ae6 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -62,7 +62,7 @@ void AssetPopup::create_objects() BC_MenuItem *menu_item; BC_SubMenu *submenu; add_item(info = new AssetPopupInfo(mwindow, this)); - add_item(format = new AWindowListFormat(mwindow)); + add_item(format = new AWindowListFormat(mwindow, gui)); add_item(new AssetPopupSort(mwindow, this)); add_item(index = new AssetPopupBuildIndex(mwindow, this)); add_item(view = new AssetPopupView(mwindow, this)); @@ -144,16 +144,17 @@ AssetPopupInfo::~AssetPopupInfo() int AssetPopupInfo::handle_event() { - if(mwindow->session->drag_assets->total) - { + int cur_x, cur_y; + popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0); + + if( mwindow->session->drag_assets->total ) { mwindow->awindow->asset_edit->edit_asset( - mwindow->session->drag_assets->values[0]); + mwindow->session->drag_assets->values[0], cur_x, cur_y); } else - if(mwindow->session->drag_clips->total) - { + if( mwindow->session->drag_clips->total ) { popup->gui->awindow->clip_edit->edit_clip( - mwindow->session->drag_clips->values[0]); + mwindow->session->drag_clips->values[0], cur_x, cur_y); } return 1; } @@ -212,11 +213,11 @@ int AssetPopupView::handle_event() VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW); vwindow->gui->lock_window("AssetPopupView::handle_event"); - if(mwindow->session->drag_assets->total) + if( mwindow->session->drag_assets->total ) vwindow->change_source( mwindow->session->drag_assets->values[0]); else - if(mwindow->session->drag_clips->total) + if( mwindow->session->drag_clips->total ) vwindow->change_source( mwindow->session->drag_clips->values[0]); @@ -244,11 +245,11 @@ int AssetPopupViewWindow::handle_event() // TODO: create new vwindow or change current vwindow vwindow->gui->lock_window("AssetPopupView::handle_event"); - if(mwindow->session->drag_assets->total) + if( mwindow->session->drag_assets->total ) vwindow->change_source( mwindow->session->drag_assets->values[0]); else - if(mwindow->session->drag_clips->total) + if( mwindow->session->drag_clips->total ) vwindow->change_source( mwindow->session->drag_clips->values[0]); @@ -367,10 +368,10 @@ AssetListMenu::~AssetListMenu() void AssetListMenu::create_objects() { - add_item(format = new AWindowListFormat(mwindow)); - add_item(new AWindowListSort(mwindow)); - add_item(new AssetListCopy(mwindow)); - add_item(new AssetListPaste(mwindow)); + add_item(format = new AWindowListFormat(mwindow, gui)); + add_item(new AWindowListSort(mwindow, gui)); + add_item(new AssetListCopy(mwindow, gui)); + add_item(new AssetListPaste(mwindow, gui)); update_titles(); } @@ -379,10 +380,11 @@ void AssetListMenu::update_titles() format->update(); } -AssetListCopy::AssetListCopy(MWindow *mwindow) +AssetListCopy::AssetListCopy(MWindow *mwindow, AWindowGUI *gui) : BC_MenuItem(_("Copy file list")) { this->mwindow = mwindow; + this->gui = gui; copy_dialog = 0; } AssetListCopy::~AssetListCopy() @@ -411,12 +413,14 @@ int AssetListCopy::handle_event() cp += sprintf(cp, "%s\n", path); } *cp = 0; + int cur_x, cur_y; + gui->get_abs_cursor_xy(cur_x, cur_y, 0); gui->unlock_window(); if( n ) { if( !copy_dialog ) copy_dialog = new AssetCopyDialog(this); - copy_dialog->start(text); + copy_dialog->start(text, cur_x, cur_y); } else { eprintf(_("Nothing selected")); @@ -432,10 +436,11 @@ AssetCopyDialog::AssetCopyDialog(AssetListCopy *copy) copy_window = 0; } -void AssetCopyDialog::start(char *text) +void AssetCopyDialog::start(char *text, int x, int y) { close_window(); this->text = text; + this->x = x; this->y = y; BC_DialogThread::start(); } @@ -447,10 +452,8 @@ AssetCopyDialog::~AssetCopyDialog() BC_Window* AssetCopyDialog::new_gui() { BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x(); - int y = display_info.get_abs_cursor_y(); - copy_window = new AssetCopyWindow(this, x, y); + copy_window = new AssetCopyWindow(this); copy_window->create_objects(); return copy_window; } @@ -466,8 +469,10 @@ void AssetCopyDialog::handle_close_event(int result) } -AssetCopyWindow::AssetCopyWindow(AssetCopyDialog *copy_dialog, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Copy File List"), x, y, 500, 200, 500, 200, 0, 0, 1) +AssetCopyWindow::AssetCopyWindow(AssetCopyDialog *copy_dialog) + : BC_Window(_(PROGRAM_NAME ": Copy File List"), + copy_dialog->x - 500/2, copy_dialog->y - 200/2, + 500, 200, 500, 200, 0, 0, 1) { this->copy_dialog = copy_dialog; } @@ -495,10 +500,11 @@ void AssetCopyWindow::create_objects() } -AssetListPaste::AssetListPaste(MWindow *mwindow) +AssetListPaste::AssetListPaste(MWindow *mwindow, AWindowGUI *gui) : BC_MenuItem(_("Paste file list")) { this->mwindow = mwindow; + this->gui = gui; paste_dialog = 0; } AssetListPaste::~AssetListPaste() @@ -509,8 +515,12 @@ AssetListPaste::~AssetListPaste() int AssetListPaste::handle_event() { if( !paste_dialog ) + paste_dialog->close_window(); + else paste_dialog = new AssetPasteDialog(this); - paste_dialog->start(); + int cur_x, cur_y; + gui->get_abs_cursor_xy(cur_x, cur_y, 0); + paste_dialog->start(cur_x, cur_y); return 1; } @@ -528,11 +538,7 @@ AssetPasteDialog::~AssetPasteDialog() BC_Window* AssetPasteDialog::new_gui() { - BC_DisplayInfo display_info; - int x = display_info.get_abs_cursor_x(); - int y = display_info.get_abs_cursor_y(); - - paste_window = new AssetPasteWindow(this, x, y); + paste_window = new AssetPasteWindow(this); paste_window->create_objects(); return paste_window; } @@ -573,9 +579,16 @@ void AssetPasteDialog::handle_close_event(int result) paste_window = 0; } +void AssetPasteDialog::start(int x, int y) +{ + this->x = x; this->y = y; + BC_DialogThread::start(); +} -AssetPasteWindow::AssetPasteWindow(AssetPasteDialog *paste_dialog, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Paste File List"), x, y, 500, 200, 500, 200, 0, 0, 1) +AssetPasteWindow::AssetPasteWindow(AssetPasteDialog *paste_dialog) + : BC_Window(_(PROGRAM_NAME ": Paste File List"), + paste_dialog->x - 500/2, paste_dialog->y - 200/2, + 500, 200, 500, 200, 0, 0, 1) { this->paste_dialog = paste_dialog; } diff --git a/cinelerra-5.1/cinelerra/assetpopup.h b/cinelerra-5.1/cinelerra/assetpopup.h index e0611ecf..c070f124 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.h +++ b/cinelerra-5.1/cinelerra/assetpopup.h @@ -206,12 +206,13 @@ public: class AssetListCopy : public BC_MenuItem { public: - AssetListCopy(MWindow *mwindow); + AssetListCopy(MWindow *mwindow, AWindowGUI *gui); ~AssetListCopy(); int handle_event(); MWindow *mwindow; + AWindowGUI *gui; AssetCopyDialog *copy_dialog; }; @@ -221,12 +222,13 @@ public: AssetCopyDialog(AssetListCopy *copy); ~AssetCopyDialog(); - void start(char *text); + void start(char *text, int x, int y); BC_Window* new_gui(); void handle_done_event(int result); void handle_close_event(int result); char *text; + int x, y; AssetListCopy *copy; AssetCopyWindow *copy_window; }; @@ -234,7 +236,7 @@ public: class AssetCopyWindow : public BC_Window { public: - AssetCopyWindow(AssetCopyDialog *copy_dialog, int x, int y); + AssetCopyWindow(AssetCopyDialog *copy_dialog); ~AssetCopyWindow(); void create_objects(); @@ -246,12 +248,13 @@ public: class AssetListPaste : public BC_MenuItem { public: - AssetListPaste(MWindow *mwindow); + AssetListPaste(MWindow *mwindow, AWindowGUI *gui); ~AssetListPaste(); int handle_event(); MWindow *mwindow; + AWindowGUI *gui; AssetPasteDialog *paste_dialog; }; @@ -264,15 +267,17 @@ public: BC_Window* new_gui(); void handle_done_event(int result); void handle_close_event(int result); + void start(int x, int y); AssetListPaste *paste; AssetPasteWindow *paste_window; + int x, y; }; class AssetPasteWindow : public BC_Window { public: - AssetPasteWindow(AssetPasteDialog *paste_dialog, int x, int y); + AssetPasteWindow(AssetPasteDialog *paste_dialog); ~AssetPasteWindow(); void create_objects(); diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 9a39a6fb..039e8400 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1873,7 +1873,9 @@ AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y) int AWindowInfo::handle_event() { - gui->awindow->asset_edit->edit_asset(gui->selected_asset()); + int cur_x, cur_y; + gui->get_abs_cursor_xy(cur_x, cur_y, 0); + gui->awindow->asset_edit->edit_asset(gui->selected_asset(), cur_x, cur_y); return 1; } @@ -2027,15 +2029,15 @@ int AVIconDrawing::handle_event() } -AWindowListFormat::AWindowListFormat(MWindow *mwindow) +AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui) : BC_MenuItem("") { this->mwindow = mwindow; + this->gui = gui; } int AWindowListFormat::handle_event() { - AWindowGUI *gui = mwindow->awindow->gui; gui->stop_vicon_drawing(); EDLSession *session = mwindow->edl->session; @@ -2063,15 +2065,15 @@ void AWindowListFormat::update() (char*)_("Display icons") : (char*)_("Display text")); } -AWindowListSort::AWindowListSort(MWindow *mwindow) +AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui) : BC_MenuItem(_("Sort items")) { this->mwindow = mwindow; + this->gui = gui; } int AWindowListSort::handle_event() { - AWindowGUI *gui = mwindow->awindow->gui; gui->sort_assets(); return 1; } diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index d77efbbf..2b4a69a9 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -426,22 +426,24 @@ public: class AWindowListFormat : public BC_MenuItem { public: - AWindowListFormat(MWindow *mwindow); + AWindowListFormat(MWindow *mwindow, AWindowGUI *gui); void update(); int handle_event(); MWindow *mwindow; + AWindowGUI *gui; }; class AWindowListSort : public BC_MenuItem { public: - AWindowListSort(MWindow *mwindow); + AWindowListSort(MWindow *mwindow, AWindowGUI *gui); void update(); int handle_event(); MWindow *mwindow; + AWindowGUI *gui; }; #endif diff --git a/cinelerra-5.1/cinelerra/clipedit.C b/cinelerra-5.1/cinelerra/clipedit.C index e3065673..74d2ff8e 100644 --- a/cinelerra-5.1/cinelerra/clipedit.C +++ b/cinelerra-5.1/cinelerra/clipedit.C @@ -56,8 +56,7 @@ ClipEdit::~ClipEdit() // After the window is closed and deleted, this is called. void ClipEdit::handle_close_event(int result) { - if(!result) - { + if( !result ) { int name_ok = 1; for( int i = 0; name_ok && i < mwindow->edl->clips.total; ++i ) { if( !strcasecmp(clip->local_session->clip_title, @@ -72,10 +71,9 @@ void ClipEdit::handle_close_event(int result) } } - if(!result) - { + if( !result ) { // Add to EDL - if(create_it) + if( create_it ) mwindow->edl->add_clip(clip); else // Copy clip to existing clip in EDL original->copy_session(clip); @@ -84,13 +82,11 @@ void ClipEdit::handle_close_event(int result) // Change VWindow to it if vwindow was called // But this doesn't let you easily create a lot of clips. - if(vwindow && create_it) - { + if( vwindow && create_it ) { // vwindow->change_source(new_edl); } } - else - { + else { mwindow->session->clip_number--; } @@ -98,7 +94,7 @@ void ClipEdit::handle_close_event(int result) // For creating new clips, the original was copied in add_clip. // For editing old clips, the original was transferred to another variable. - if(!create_it) clip->remove_user(); + if( !create_it ) clip->remove_user(); original = 0; clip = 0; create_it = 0; @@ -110,14 +106,12 @@ BC_Window* ClipEdit::new_gui() { original = clip; - if(!create_it) - { + if( !create_it ) { this->clip = new EDL(mwindow->edl); clip->create_objects(); clip->copy_all(original); } - window = new ClipEditWindow(mwindow, this); window->create_objects(); return window; @@ -125,47 +119,31 @@ BC_Window* ClipEdit::new_gui() -void ClipEdit::edit_clip(EDL *clip) +void ClipEdit::edit_clip(EDL *clip, int x, int y) { close_window(); -// Allow more than one window so we don't have to delete the clip in handle_event - if(!this->clip) - { - this->clip = clip; - this->create_it = 0; - start(); - } -} -void ClipEdit::create_clip(EDL *clip) -{ -// Allow more than one window so we don't have to delete the clip in handle_event - if(!this->clip) - { - this->clip = clip; - this->create_it = 1; - start(); - } + this->clip = clip; + this->create_it = 0; + this->x = x; this->y = y; + start(); } +void ClipEdit::create_clip(EDL *clip, int x, int y) +{ + close_window(); - - - - + this->clip = clip; + this->create_it = 1; + this->x = x; this->y = y; + start(); +} ClipEditWindow::ClipEditWindow(MWindow *mwindow, ClipEdit *thread) : BC_Window(_(PROGRAM_NAME ": Clip Info"), - mwindow->gui->get_abs_cursor_x(1) - 400 / 2, - mwindow->gui->get_abs_cursor_y(1) - 350 / 2, - 400, - 350, - 400, - 430, - 0, - 0, - 1) + thread->x -400/2, thread->y - 350/2, + 400, 350, 400, 430, 0, 0, 1) { this->mwindow = mwindow; this->thread = thread; diff --git a/cinelerra-5.1/cinelerra/clipedit.h b/cinelerra-5.1/cinelerra/clipedit.h index 57a78f10..100ad6ea 100644 --- a/cinelerra-5.1/cinelerra/clipedit.h +++ b/cinelerra-5.1/cinelerra/clipedit.h @@ -37,8 +37,8 @@ public: ClipEdit(MWindow *mwindow, AWindow *awindow, VWindow *vwindow); ~ClipEdit(); - void edit_clip(EDL *clip); - void create_clip(EDL *clip); + void edit_clip(EDL *clip, int x, int y); + void create_clip(EDL *clip, int x, int y); // After the window is closed and deleted, this is called. void handle_close_event(int result); @@ -55,6 +55,7 @@ public: EDL *original; ClipEditWindow *window; int create_it; + int x, y; }; diff --git a/cinelerra-5.1/cinelerra/clippopup.C b/cinelerra-5.1/cinelerra/clippopup.C index b8a235a5..cbd7ca04 100644 --- a/cinelerra-5.1/cinelerra/clippopup.C +++ b/cinelerra-5.1/cinelerra/clippopup.C @@ -58,7 +58,7 @@ void ClipPopup::create_objects() BC_MenuItem *menu_item; BC_SubMenu *submenu; add_item(info = new ClipPopupInfo(mwindow, this)); - add_item(format = new AWindowListFormat(mwindow)); + add_item(format = new AWindowListFormat(mwindow, gui)); add_item(new ClipPopupSort(mwindow, this)); add_item(view = new ClipPopupView(mwindow, this)); add_item(view_window = new ClipPopupViewWindow(mwindow, this)); @@ -137,16 +137,17 @@ ClipPopupInfo::~ClipPopupInfo() int ClipPopupInfo::handle_event() { - if(mwindow->session->drag_assets->total) - { + int cur_x, cur_y; + popup->gui->get_abs_cursor_xy(cur_x, cur_y, 0); + + if( mwindow->session->drag_assets->total ) { mwindow->awindow->asset_edit->edit_asset( - mwindow->session->drag_assets->values[0]); + mwindow->session->drag_assets->values[0], cur_x, cur_y); } else - if(mwindow->session->drag_clips->total) - { + if( mwindow->session->drag_clips->total ) { popup->gui->awindow->clip_edit->edit_clip( - mwindow->session->drag_clips->values[0]); + mwindow->session->drag_clips->values[0], cur_x, cur_y); } return 1; } @@ -186,11 +187,11 @@ int ClipPopupView::handle_event() VWindow *vwindow = mwindow->get_viewer(1, DEFAULT_VWINDOW); vwindow->gui->lock_window("ClipPopupView::handle_event"); - if(mwindow->session->drag_assets->total) + if( mwindow->session->drag_assets->total ) vwindow->change_source( mwindow->session->drag_assets->values[0]); else - if(mwindow->session->drag_clips->total) + if( mwindow->session->drag_clips->total ) vwindow->change_source( mwindow->session->drag_clips->values[0]); @@ -218,11 +219,11 @@ int ClipPopupViewWindow::handle_event() // TODO: create new vwindow or change current vwindow vwindow->gui->lock_window("ClipPopupView::handle_event"); - if(mwindow->session->drag_assets->total) + if( mwindow->session->drag_assets->total ) vwindow->change_source( mwindow->session->drag_assets->values[0]); else - if(mwindow->session->drag_clips->total) + if( mwindow->session->drag_clips->total ) vwindow->change_source( mwindow->session->drag_clips->values[0]); @@ -397,8 +398,8 @@ ClipListMenu::~ClipListMenu() void ClipListMenu::create_objects() { - add_item(format = new AWindowListFormat(mwindow)); - add_item(new AWindowListSort(mwindow)); + add_item(format = new AWindowListFormat(mwindow, gui)); + add_item(new AWindowListSort(mwindow, gui)); add_item(new ClipPasteToFolder(mwindow)); update(); } diff --git a/cinelerra-5.1/cinelerra/ctimebar.C b/cinelerra-5.1/cinelerra/ctimebar.C index 8cdb4cbd..9d786441 100644 --- a/cinelerra-5.1/cinelerra/ctimebar.C +++ b/cinelerra-5.1/cinelerra/ctimebar.C @@ -32,18 +32,9 @@ #include "theme.h" -CTimeBar::CTimeBar(MWindow *mwindow, - CWindowGUI *gui, - int x, - int y, - int w, - int h) - : TimeBar(mwindow, - gui, - x, - y, - w, - h) +CTimeBar::CTimeBar(MWindow *mwindow, CWindowGUI *gui, + int x, int y, int w, int h) + : TimeBar(mwindow, gui, x, y, w, h) { this->mwindow = mwindow; this->gui = gui; @@ -75,13 +66,12 @@ double CTimeBar::pixel_to_position(int pixel) { double start = 0, length = 0; EDL *edl = get_edl(); - if(edl) - { + if( edl ) { start = edl->local_session->preview_start; - if(start >= 0) + if( start >= 0 ) length = edl->local_session->preview_end - start; } - if(length <= 0) + if( length <= 0 ) length = get_edl_length(); return start + (double)pixel * length / get_w(); } @@ -106,21 +96,17 @@ void CTimeBar::select_label(double position) position = mwindow->edl->align_to_frame(position, 1); - if(shift_down()) - { - if(position > edl->local_session->get_selectionend(1) / 2 + - edl->local_session->get_selectionstart(1) / 2) - { + if( shift_down() ) { + if( position > edl->local_session->get_selectionend(1) / 2 + + edl->local_session->get_selectionstart(1) / 2 ) { edl->local_session->set_selectionend(position); } - else - { + else { edl->local_session->set_selectionstart(position); } } - else - { + else { edl->local_session->set_selectionstart(position); edl->local_session->set_selectionend(position); } @@ -133,19 +119,10 @@ void CTimeBar::select_label(double position) mwindow->gui->lock_window(); mwindow->gui->hide_cursor(0); mwindow->gui->draw_cursor(1); - mwindow->gui->update(0, - 1, // 1 for incremental drawing. 2 for full refresh - 1, - 0, - 1, - 1, - 0); + mwindow->gui->update(0, 1, // 1 for incremental drawing. 2 for full refresh + 1, 0, 1, 1, 0); mwindow->gui->unlock_window(); mwindow->update_plugin_guis(); //printf("CTimeBar::select_label 2\n"); } - - - - diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C index f5ce25de..7e3493b1 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C @@ -221,6 +221,7 @@ int File::get_options(FormatTools *format, audio_options, video_options); break; +#ifdef HAVE_OPENEXR case FILE_EXR: case FILE_EXR_LIST: FileEXR::get_parameters(parent_window, @@ -229,6 +230,7 @@ int File::get_options(FormatTools *format, audio_options, video_options); break; +#endif case FILE_FLAC: FileFLAC::get_parameters(parent_window, asset, @@ -373,7 +375,9 @@ const char *File::default_probes[] = { "PNG", "JPEG", "GIF", +#ifdef HAVE_OPENEXR "EXR", +#endif "FLAC", "CR2", "TGA", @@ -443,11 +447,13 @@ int File::probe() file = new FileGIF(this->asset, this); return FILE_OK; } +#ifdef HAVE_EXR if( !strcmp(pref->name,"EXR") ) { // EXR file if( !FileEXR::check_sig(this->asset, data)) continue; file = new FileEXR(this->asset, this); return FILE_OK; } +#endif if( !strcmp(pref->name,"FLAC") ) { // FLAC file if( !FileFLAC::check_sig(this->asset, data)) continue; file = new FileFLAC(this->asset, this); @@ -515,97 +521,97 @@ int File::open_file(Preferences *preferences, // get the format now // If you add another format to case 0, you also need to add another case for the // file format #define. - case FILE_UNKNOWN: { - int ret = probe(); - if( ret != FILE_OK ) return ret; - break; } + case FILE_UNKNOWN: { + int ret = probe(); + if( ret != FILE_OK ) return ret; + break; } // format already determined - case FILE_AC3: - file = new FileAC3(this->asset, this); - break; - - case FILE_SCENE: - file = new FileScene(this->asset, this); - break; - - case FILE_FFMPEG: - file = new FileFFMPEG(this->asset, this); - break; - - case FILE_PCM: - case FILE_WAV: - case FILE_AU: - case FILE_AIFF: - case FILE_SND: + case FILE_AC3: + file = new FileAC3(this->asset, this); + break; + + case FILE_SCENE: + file = new FileScene(this->asset, this); + break; + + case FILE_FFMPEG: + file = new FileFFMPEG(this->asset, this); + break; + + case FILE_PCM: + case FILE_WAV: + case FILE_AU: + case FILE_AIFF: + case FILE_SND: //printf("File::open_file 1\n"); - file = new FileSndFile(this->asset, this); - break; - - case FILE_PNG: - case FILE_PNG_LIST: - file = new FilePNG(this->asset, this); - break; - - case FILE_JPEG: - case FILE_JPEG_LIST: - file = new FileJPEG(this->asset, this); - break; - - case FILE_GIF: - case FILE_GIF_LIST: - file = new FileGIF(this->asset, this); - break; - - case FILE_EXR: - case FILE_EXR_LIST: - file = new FileEXR(this->asset, this); - break; - - case FILE_FLAC: - file = new FileFLAC(this->asset, this); - break; - - case FILE_CR2: - case FILE_CR2_LIST: - file = new FileCR2(this->asset, this); - break; - - case FILE_TGA_LIST: - case FILE_TGA: - file = new FileTGA(this->asset, this); - break; - - case FILE_TIFF: - case FILE_TIFF_LIST: - file = new FileTIFF(this->asset, this); - break; - - case FILE_DB: - file = new FileDB(this->asset, this); - break; - - case FILE_MPEG: - case FILE_AMPEG: - case FILE_VMPEG: - file = new FileMPEG(this->asset, this); - break; - - case FILE_OGG: - file = new FileOGG(this->asset, this); - break; - - case FILE_VORBIS: - file = new FileVorbis(this->asset, this); - break; + file = new FileSndFile(this->asset, this); + break; + + case FILE_PNG: + case FILE_PNG_LIST: + file = new FilePNG(this->asset, this); + break; + + case FILE_JPEG: + case FILE_JPEG_LIST: + file = new FileJPEG(this->asset, this); + break; + + case FILE_GIF: + case FILE_GIF_LIST: + file = new FileGIF(this->asset, this); + break; +#ifdef HAVE_OPENEXR + case FILE_EXR: + case FILE_EXR_LIST: + file = new FileEXR(this->asset, this); + break; +#endif + case FILE_FLAC: + file = new FileFLAC(this->asset, this); + break; + + case FILE_CR2: + case FILE_CR2_LIST: + file = new FileCR2(this->asset, this); + break; + + case FILE_TGA_LIST: + case FILE_TGA: + file = new FileTGA(this->asset, this); + break; + + case FILE_TIFF: + case FILE_TIFF_LIST: + file = new FileTIFF(this->asset, this); + break; + + case FILE_DB: + file = new FileDB(this->asset, this); + break; + + case FILE_MPEG: + case FILE_AMPEG: + case FILE_VMPEG: + file = new FileMPEG(this->asset, this); + break; + + case FILE_OGG: + file = new FileOGG(this->asset, this); + break; + + case FILE_VORBIS: + file = new FileVorbis(this->asset, this); + break; #ifdef HAVE_DV - case FILE_RAWDV: - file = new FileDV(this->asset, this); - break; + case FILE_RAWDV: + file = new FileDV(this->asset, this); + break; #endif // try plugins - default: - return 1; - break; + default: + return 1; + break; } @@ -1254,16 +1260,12 @@ int File::can_copy_from(Asset *asset, int output_w, int output_h) { - if(!asset) return 0; - - if(file) - { + if( asset && file ) { return asset->width == output_w && asset->height == output_h && file->can_copy_from(asset, position); } - else - return 0; + return 0; } // Fill in queries about formats when adding formats here. @@ -1316,36 +1318,35 @@ const char* File::formattostr(int format) const char* File::formattostr(ArrayList *plugindb, int format) { - switch(format) - { - case FILE_SCENE: return _(SCENE_NAME); - case FILE_AC3: return _(AC3_NAME); - case FILE_WAV: return _(WAV_NAME); - case FILE_PCM: return _(PCM_NAME); - case FILE_AU: return _(AU_NAME); - case FILE_AIFF: return _(AIFF_NAME); - case FILE_SND: return _(SND_NAME); - case FILE_PNG: return _(PNG_NAME); - case FILE_PNG_LIST: return _(PNG_LIST_NAME); - case FILE_JPEG: return _(JPEG_NAME); - case FILE_JPEG_LIST: return _(JPEG_LIST_NAME); - case FILE_CR2: return _(CR2_NAME); - case FILE_CR2_LIST: return _(CR2_LIST_NAME); - case FILE_FLAC: return _(FLAC_NAME); - case FILE_EXR: return _(EXR_NAME); - case FILE_EXR_LIST: return _(EXR_LIST_NAME); - case FILE_MPEG: return _(MPEG_NAME); - case FILE_AMPEG: return _(AMPEG_NAME); - case FILE_VMPEG: return _(VMPEG_NAME); - case FILE_TGA: return _(TGA_NAME); - case FILE_TGA_LIST: return _(TGA_LIST_NAME); - case FILE_TIFF: return _(TIFF_NAME); - case FILE_TIFF_LIST: return _(TIFF_LIST_NAME); - case FILE_OGG: return _(OGG_NAME); - case FILE_VORBIS: return _(VORBIS_NAME); - case FILE_RAWDV: return _(RAWDV_NAME); - case FILE_FFMPEG: return _(FFMPEG_NAME); - case FILE_DB: return _(DBASE_NAME); + switch(format) { + case FILE_SCENE: return _(SCENE_NAME); + case FILE_AC3: return _(AC3_NAME); + case FILE_WAV: return _(WAV_NAME); + case FILE_PCM: return _(PCM_NAME); + case FILE_AU: return _(AU_NAME); + case FILE_AIFF: return _(AIFF_NAME); + case FILE_SND: return _(SND_NAME); + case FILE_PNG: return _(PNG_NAME); + case FILE_PNG_LIST: return _(PNG_LIST_NAME); + case FILE_JPEG: return _(JPEG_NAME); + case FILE_JPEG_LIST: return _(JPEG_LIST_NAME); + case FILE_CR2: return _(CR2_NAME); + case FILE_CR2_LIST: return _(CR2_LIST_NAME); + case FILE_FLAC: return _(FLAC_NAME); + case FILE_EXR: return _(EXR_NAME); + case FILE_EXR_LIST: return _(EXR_LIST_NAME); + case FILE_MPEG: return _(MPEG_NAME); + case FILE_AMPEG: return _(AMPEG_NAME); + case FILE_VMPEG: return _(VMPEG_NAME); + case FILE_TGA: return _(TGA_NAME); + case FILE_TGA_LIST: return _(TGA_LIST_NAME); + case FILE_TIFF: return _(TIFF_NAME); + case FILE_TIFF_LIST: return _(TIFF_LIST_NAME); + case FILE_OGG: return _(OGG_NAME); + case FILE_VORBIS: return _(VORBIS_NAME); + case FILE_RAWDV: return _(RAWDV_NAME); + case FILE_FFMPEG: return _(FFMPEG_NAME); + case FILE_DB: return _(DBASE_NAME); } return _("Unknown"); } @@ -1365,15 +1366,14 @@ int File::strtobits(const char *bits) const char* File::bitstostr(int bits) { //printf("File::bitstostr\n"); - switch(bits) - { - case BITSLINEAR8: return (NAME_8BIT); - case BITSLINEAR16: return (NAME_16BIT); - case BITSLINEAR24: return (NAME_24BIT); - case BITSLINEAR32: return (NAME_32BIT); - case BITSULAW: return (NAME_ULAW); - case BITS_ADPCM: return (NAME_ADPCM); - case BITSFLOAT: return (NAME_FLOAT); + switch(bits) { + case BITSLINEAR8: return (NAME_8BIT); + case BITSLINEAR16: return (NAME_16BIT); + case BITSLINEAR24: return (NAME_24BIT); + case BITSLINEAR32: return (NAME_32BIT); + case BITSULAW: return (NAME_ULAW); + case BITS_ADPCM: return (NAME_ADPCM); + case BITSFLOAT: return (NAME_FLOAT); } return _("Unknown"); } @@ -1418,14 +1418,16 @@ int File::get_best_colormodel(Asset *asset, int driver) { switch(asset->format) { -#ifdef HAVE_FIREWIRE +#ifdef HAVE_DV case FILE_RAWDV: return FileDV::get_best_colormodel(asset, driver); #endif case FILE_MPEG: return FileMPEG::get_best_colormodel(asset, driver); case FILE_JPEG: case FILE_JPEG_LIST: return FileJPEG::get_best_colormodel(asset, driver); +#ifdef HAVE_OPENEXR case FILE_EXR: case FILE_EXR_LIST: return FileEXR::get_best_colormodel(asset, driver); +#endif case FILE_PNG: case FILE_PNG_LIST: return FilePNG::get_best_colormodel(asset, driver); case FILE_TGA: diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index a62b1b3c..ca0c879f 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -19,6 +19,8 @@ * */ +#ifdef HAVE_OPENEXR + #include "asset.h" #include "bcsignals.h" #include "clip.h" @@ -662,3 +664,4 @@ int EXRCompressionItem::handle_event() return 0; } +#endif diff --git a/cinelerra-5.1/cinelerra/fileexr.h b/cinelerra-5.1/cinelerra/fileexr.h index f05c92aa..d4cea047 100644 --- a/cinelerra-5.1/cinelerra/fileexr.h +++ b/cinelerra-5.1/cinelerra/fileexr.h @@ -24,6 +24,7 @@ #include "file.inc" +#include "fileexr.inc" #include "filelist.h" #include "vframe.inc" diff --git a/cinelerra-5.1/cinelerra/fileexr.inc b/cinelerra-5.1/cinelerra/fileexr.inc index add3ec16..7937e4f9 100644 --- a/cinelerra-5.1/cinelerra/fileexr.inc +++ b/cinelerra-5.1/cinelerra/fileexr.inc @@ -23,5 +23,10 @@ #define FILEEXR_INC class FileEXR; +class EXRUnit; +class EXRConfigVideo; +class EXRUseAlpha; +class EXRCompression; +class EXRCompressionItem; #endif diff --git a/cinelerra-5.1/cinelerra/formatpopup.C b/cinelerra-5.1/cinelerra/formatpopup.C index fa520abc..683c7117 100644 --- a/cinelerra-5.1/cinelerra/formatpopup.C +++ b/cinelerra-5.1/cinelerra/formatpopup.C @@ -55,8 +55,10 @@ void FormatPopup::create_objects() if(!use_brender) { +#ifdef HAVE_OPENEXR format_items.append(new BC_ListBoxItem(_(EXR_NAME))); format_items.append(new BC_ListBoxItem(_(EXR_LIST_NAME))); +#endif format_items.append(new BC_ListBoxItem(_(WAV_NAME))); format_items.append(new BC_ListBoxItem(_(RAWDV_NAME))); format_items.append(new BC_ListBoxItem(_(AMPEG_NAME))); diff --git a/cinelerra-5.1/cinelerra/labeledit.C b/cinelerra-5.1/cinelerra/labeledit.C index 945d306a..a2bd71f4 100644 --- a/cinelerra-5.1/cinelerra/labeledit.C +++ b/cinelerra-5.1/cinelerra/labeledit.C @@ -45,9 +45,11 @@ LabelEdit::~LabelEdit() close_window(); } -void LabelEdit::start(Label *label) +void LabelEdit::start(Label *label, int x, int y) { this->label = label; + this->x = x; this->y = y; + BC_DialogThread::start(); } @@ -64,15 +66,14 @@ void LabelEdit::handle_done_event(int result) BC_Window *LabelEdit::new_gui() { - int x = mwindow->gui->get_abs_cursor_x(1) - 400 / 2; - int y = mwindow->gui->get_abs_cursor_y(1) - 350 / 2; - label_edit_window = new LabelEditWindow(mwindow, this, x, y); + label_edit_window = new LabelEditWindow(mwindow, this); label_edit_window->create_objects(); return label_edit_window; } -LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y) - : BC_Window(_(PROGRAM_NAME ": Label Info"), x, y, +LabelEditWindow::LabelEditWindow(MWindow *mwindow, LabelEdit *thread) + : BC_Window(_(PROGRAM_NAME ": Label Info"), + thread->x - 400/2, thread->y - 350/2, 400, 350, 400, 430, 0, 0, 1) { this->mwindow = mwindow; diff --git a/cinelerra-5.1/cinelerra/labeledit.h b/cinelerra-5.1/cinelerra/labeledit.h index 094c9f41..9c6a9ab6 100644 --- a/cinelerra-5.1/cinelerra/labeledit.h +++ b/cinelerra-5.1/cinelerra/labeledit.h @@ -39,7 +39,7 @@ public: ~LabelEdit(); BC_Window *new_gui(); - void start(Label *label); + void start(Label *label, int x, int y); void handle_close_event(int result); void handle_done_event(int result); @@ -49,13 +49,14 @@ public: VWindow *vwindow; Label *label; + int x, y; LabelEditWindow *label_edit_window; }; class LabelEditWindow : public BC_Window { public: - LabelEditWindow(MWindow *mwindow, LabelEdit *thread, int x, int y); + LabelEditWindow(MWindow *mwindow, LabelEdit *thread); ~LabelEditWindow(); void create_objects(); diff --git a/cinelerra-5.1/cinelerra/labelpopup.C b/cinelerra-5.1/cinelerra/labelpopup.C index ee25db46..cbac067b 100644 --- a/cinelerra-5.1/cinelerra/labelpopup.C +++ b/cinelerra-5.1/cinelerra/labelpopup.C @@ -75,8 +75,10 @@ LabelPopupEdit::~LabelPopupEdit() int LabelPopupEdit::handle_event() { AssetPicon *result = (AssetPicon*)gui->asset_list->get_selection(0,0); + int cur_x, cur_y; + gui->get_abs_cursor_xy(cur_x, cur_y, 0); if( result && result->label ) - gui->awindow->label_edit->start(result->label); + gui->awindow->label_edit->start(result->label, cur_x, cur_y); return 1; } @@ -144,8 +146,8 @@ LabelListMenu:: ~LabelListMenu() void LabelListMenu::create_objects() { - add_item(format = new AWindowListFormat(mwindow)); - add_item(new AWindowListSort(mwindow)); + add_item(format = new AWindowListFormat(mwindow, gui)); + add_item(new AWindowListSort(mwindow, gui)); } void LabelListMenu::update() diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index de0f2ea5..33cee066 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1980,6 +1980,9 @@ void MWindow::create_objects(int want_gui, Timer timer; + init_awindow(); + if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_compositor(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); @@ -1991,24 +1994,21 @@ void MWindow::create_objects(int want_gui, init_gui(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_awindow(); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_levelwindow(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_indexes(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); init_channeldb(); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_gwindow(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_render(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_brender(); init_exportedl(); init_commercials(); diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index b0930084..a1232154 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -2026,9 +2026,11 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) cp[n] = 0; edl->update_assets(new_edl); + int cur_x, cur_y; + gui->get_abs_cursor_xy(cur_x, cur_y, 0); gui->unlock_window(); - awindow->clip_edit->create_clip(new_edl); + awindow->clip_edit->create_clip(new_edl, cur_x, cur_y); gui->lock_window("MWindow::save_clip"); save_backup(); diff --git a/cinelerra-5.1/cinelerra/timebar.C b/cinelerra-5.1/cinelerra/timebar.C index b295c323..ed0011cd 100644 --- a/cinelerra-5.1/cinelerra/timebar.C +++ b/cinelerra-5.1/cinelerra/timebar.C @@ -54,16 +54,11 @@ #include "zoombar.h" -LabelGUI::LabelGUI(MWindow *mwindow, - TimeBar *timebar, - int64_t pixel, - int y, - double position, - VFrame **data) - : BC_Toggle(translate_pixel(mwindow, pixel), - y, - data ? data : mwindow->theme->label_toggle, - 0) +LabelGUI::LabelGUI(MWindow *mwindow, TimeBar *timebar, + int64_t pixel, int y, + double position, VFrame **data) + : BC_Toggle(translate_pixel(mwindow, pixel), y, + data ? data : mwindow->theme->label_toggle, 0) { this->mwindow = mwindow; this->timebar = timebar; @@ -99,14 +94,17 @@ int LabelGUI::button_press_event() { int result = 0; - if (this->is_event_win() && get_buttonpress() == 3) { - if (label) - timebar->label_edit->start(label); + if( this->is_event_win() && get_buttonpress() == 3 ) { + if( label ) { + int cur_x, cur_y; + get_abs_cursor_xy(cur_x, cur_y, 0); + timebar->label_edit->start(label, cur_x, cur_y); + } result = 1; } else { result = BC_Toggle::button_press_event(); } - if (label) + if( label ) set_tooltip(this->label->textstr); return result; } @@ -118,16 +116,11 @@ int LabelGUI::handle_event() } -InPointGUI::InPointGUI(MWindow *mwindow, - TimeBar *timebar, - int64_t pixel, - double position) - : LabelGUI(mwindow, - timebar, - pixel, - get_y(mwindow, timebar), - position, - mwindow->theme->in_point) +InPointGUI::InPointGUI(MWindow *mwindow, TimeBar *timebar, + int64_t pixel, double position) + : LabelGUI(mwindow, timebar, + pixel, get_y(mwindow, timebar), + position, mwindow->theme->in_point) { //printf("InPointGUI::InPointGUI %d %d\n", pixel, get_y(mwindow, timebar)); } @@ -143,16 +136,11 @@ int InPointGUI::get_y(MWindow *mwindow, TimeBar *timebar) } -OutPointGUI::OutPointGUI(MWindow *mwindow, - TimeBar *timebar, - int64_t pixel, - double position) - : LabelGUI(mwindow, - timebar, - pixel, - get_y(mwindow, timebar), - position, - mwindow->theme->out_point) +OutPointGUI::OutPointGUI(MWindow *mwindow, TimeBar *timebar, + int64_t pixel, double position) + : LabelGUI(mwindow, timebar, + pixel, get_y(mwindow, timebar), + position, mwindow->theme->out_point) { //printf("OutPointGUI::OutPointGUI %d %d\n", pixel, get_y(mwindow, timebar)); } @@ -166,10 +154,8 @@ int OutPointGUI::get_y(MWindow *mwindow, TimeBar *timebar) } -PresentationGUI::PresentationGUI(MWindow *mwindow, - TimeBar *timebar, - int64_t pixel, - double position) +PresentationGUI::PresentationGUI(MWindow *mwindow, TimeBar *timebar, + int64_t pixel, double position) : LabelGUI(mwindow, timebar, pixel, get_y(mwindow, timebar), position) { } @@ -177,12 +163,8 @@ PresentationGUI::~PresentationGUI() { } -TimeBar::TimeBar(MWindow *mwindow, - BC_WindowBase *gui, - int x, - int y, - int w, - int h) +TimeBar::TimeBar(MWindow *mwindow, BC_WindowBase *gui, + int x, int y, int w, int h) : BC_SubWindow(x, y, w, h) { //printf("TimeBar::TimeBar %d %d %d %d\n", x, y, w, h); @@ -195,9 +177,9 @@ TimeBar::TimeBar(MWindow *mwindow, TimeBar::~TimeBar() { - if(in_point) delete in_point; - if(out_point) delete out_point; - if(label_edit) delete label_edit; + delete in_point; + delete out_point; + delete label_edit; labels.remove_all_objects(); presentations.remove_all_objects(); } @@ -222,8 +204,7 @@ int64_t TimeBar::position_to_pixel(double position) double TimeBar::pixel_to_position(int pixel) { - if(pane) - { + if( pane ) { pixel += mwindow->edl->local_session->view_start[pane->number]; } @@ -237,19 +218,12 @@ void TimeBar::update_labels() int output = 0; EDL *edl = get_edl(); - if(edl) - { - for(Label *current = edl->labels->first; - current; - current = NEXT) - { + if( edl ) { + for( Label *current=edl->labels->first; current; current=NEXT ) { int64_t pixel = position_to_pixel(current->position); - - if(pixel >= 0 && pixel < get_w()) - { + if( pixel >= 0 && pixel < get_w() ) { // Create new label - if(output >= labels.total) - { + if( output >= labels.total ) { LabelGUI *new_label; add_subwindow(new_label = new LabelGUI(mwindow, @@ -266,13 +240,11 @@ void TimeBar::update_labels() // Reposition old label { LabelGUI *gui = labels.values[output]; - if(gui->pixel != pixel) - { + if( gui->pixel != pixel ) { gui->pixel = pixel; gui->reposition(0); } - else - { + else { gui->draw_face(1,0); } @@ -281,11 +253,11 @@ void TimeBar::update_labels() labels.values[output]->label = current; } - if(edl->local_session->get_selectionstart(1) <= current->position && - edl->local_session->get_selectionend(1) >= current->position) + if( edl->local_session->get_selectionstart(1) <= current->position && + edl->local_session->get_selectionend(1) >= current->position ) labels.values[output]->update(1); else - if(labels.values[output]->get_value()) + if( labels.values[output]->get_value() ) labels.values[output]->update(0); output++; @@ -305,39 +277,35 @@ void TimeBar::update_labels() void TimeBar::update_highlights() { - for(int i = 0; i < labels.total; i++) - { + for( int i = 0; i < labels.total; i++ ) { LabelGUI *label = labels.values[i]; - if(mwindow->edl->equivalent(label->position, + if( mwindow->edl->equivalent(label->position, mwindow->edl->local_session->get_selectionstart(1)) || - mwindow->edl->equivalent(label->position, - mwindow->edl->local_session->get_selectionend(1))) - { - if(!label->get_value()) label->update(1); + mwindow->edl->equivalent(label->position, + mwindow->edl->local_session->get_selectionend(1)) ) { + if( !label->get_value() ) label->update(1); } else - if(label->get_value()) label->update(0); + if( label->get_value() ) label->update(0); } - if(mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(), + if( mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(), mwindow->edl->local_session->get_selectionstart(1)) || mwindow->edl->equivalent(mwindow->edl->local_session->get_inpoint(), - mwindow->edl->local_session->get_selectionend(1))) - { - if(in_point) in_point->update(1); + mwindow->edl->local_session->get_selectionend(1)) ) { + if( in_point ) in_point->update(1); } else - if(in_point) in_point->update(0); + if( in_point ) in_point->update(0); - if(mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(), + if( mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(), mwindow->edl->local_session->get_selectionstart(1)) || mwindow->edl->equivalent(mwindow->edl->local_session->get_outpoint(), - mwindow->edl->local_session->get_selectionend(1))) - { - if(out_point) out_point->update(1); + mwindow->edl->local_session->get_selectionend(1)) ) { + if( out_point ) out_point->update(1); } else - if(out_point) out_point->update(0); + if( out_point ) out_point->update(0); } void TimeBar::update_points() @@ -346,34 +314,27 @@ void TimeBar::update_points() int64_t pixel = !edl ? 0 : position_to_pixel(edl->local_session->get_inpoint()); - if(in_point) - { - if(edl && - edl->local_session->inpoint_valid() && - pixel >= 0 && pixel < get_w()) - { - if(!EQUIV(edl->local_session->get_inpoint(), in_point->position) || - in_point->pixel != pixel) - { + if( in_point ) { + if( edl && edl->local_session->inpoint_valid() && + pixel >= 0 && pixel < get_w() ) { + if( !EQUIV(edl->local_session->get_inpoint(), in_point->position) || + in_point->pixel != pixel ) { in_point->pixel = pixel; in_point->position = edl->local_session->get_inpoint(); in_point->reposition(0); } - else - { + else { in_point->draw_face(1, 0); } } - else - { + else { delete in_point; in_point = 0; } } else - if(edl && edl->local_session->inpoint_valid() && - pixel >= 0 && pixel < get_w()) - { + if( edl && edl->local_session->inpoint_valid() && + pixel >= 0 && pixel < get_w() ) { add_subwindow(in_point = new InPointGUI(mwindow, this, pixel, edl->local_session->get_inpoint())); in_point->set_cursor(ARROW_CURSOR, 0, 0); @@ -382,34 +343,27 @@ void TimeBar::update_points() pixel = !edl ? 0 : position_to_pixel(edl->local_session->get_outpoint()); - if(out_point) - { + if( out_point ) { if( edl && edl->local_session->outpoint_valid() && - pixel >= 0 && pixel < get_w()) - { - if(!EQUIV(edl->local_session->get_outpoint(), out_point->position) || - out_point->pixel != pixel) - { + pixel >= 0 && pixel < get_w()) { + if( !EQUIV(edl->local_session->get_outpoint(), out_point->position) || + out_point->pixel != pixel ) { out_point->pixel = pixel; out_point->position = edl->local_session->get_outpoint(); out_point->reposition(0); } - else - { + else { out_point->draw_face(1, 0); } } - else - { + else { delete out_point; out_point = 0; } } else - if(edl && - edl->local_session->outpoint_valid() && - pixel >= 0 && pixel < get_w()) - { + if( edl && edl->local_session->outpoint_valid() && + pixel >= 0 && pixel < get_w() ) { add_subwindow(out_point = new OutPointGUI(mwindow, this, pixel, edl->local_session->get_outpoint())); out_point->set_cursor(ARROW_CURSOR, 0, 0); @@ -434,10 +388,8 @@ void TimeBar::update(int flush) int64_t pixel = -1; int x = get_relative_cursor_x(); // Draw highlight position - if(edl && - (highlighted || current_operation == TIMEBAR_DRAG) && - x >= 0 && x < get_w()) - { + if( edl && (highlighted || current_operation == TIMEBAR_DRAG) && + x >= 0 && x < get_w() ) { //printf("TimeBar::update %d %d\n", __LINE__, x); double position = pixel_to_position(x); @@ -446,15 +398,13 @@ void TimeBar::update(int flush) update_clock(position); } - if(pixel < 0) - { + if( pixel < 0 ) { double position = test_highlight(); - if(position >= 0) pixel = position_to_pixel(position); + if( position >= 0 ) pixel = position_to_pixel(position); } - if(pixel >= 0 && pixel < get_w()) - { + if( pixel >= 0 && pixel < get_w() ) { set_color(mwindow->theme->timebar_cursor_color); set_line_dashes(1); //printf("TimeBar::update %d pane=%d pixel=%jd\n", __LINE__, pane->number, pixel); @@ -463,8 +413,7 @@ void TimeBar::update(int flush) } - if(edl) - { + if( edl ) { double playback_start = edl->local_session->playback_start; if( playback_start >= 0 ) { int64_t pixel = position_to_pixel(playback_start); @@ -526,8 +475,7 @@ void TimeBar::draw_range() //printf("TimeBar::draw_range %d %p\n", __LINE__, get_edl()); - if(has_preview() && get_edl()) - { + if( has_preview() && get_edl() ) { int x1, x2; get_preview_pixels(x1, x2); @@ -542,8 +490,7 @@ void TimeBar::draw_range() EDL *edl = get_edl(); - if(edl) - { + if( edl ) { int64_t pixel = position_to_pixel( edl->local_session->get_selectionstart(1)); // Draw insertion point position if this timebar belongs to a window which @@ -571,21 +518,18 @@ double TimeBar::get_edl_length() { edl_length = 0; - if(get_edl()) - { + if( get_edl() ) { //printf("TimeBar::get_edl_length 1 %f\n", get_edl()->tracks->total_playable_length()); edl_length = get_edl()->tracks->total_playable_length(); } //printf("TimeBar::get_edl_length 2\n"); - if(!EQUIV(edl_length, 0)) - { + if( !EQUIV(edl_length, 0) ) { //printf("TimeBar::get_edl_length 3\n"); time_per_pixel = edl_length / get_w(); //printf("TimeBar::get_edl_length 4\n"); } - else - { + else { time_per_pixel = 0; } //printf("TimeBar::get_edl_length 5\n"); @@ -600,21 +544,18 @@ int TimeBar::get_preview_pixels(int &x1, int &x2) get_edl_length(); - if(get_edl()) - { - if(!EQUIV(edl_length, 0)) - { - if(get_edl()->local_session->preview_end <= 0 || - get_edl()->local_session->preview_end > edl_length) + if( get_edl() ) { + if( !EQUIV(edl_length, 0) ) { + if( get_edl()->local_session->preview_end <= 0 || + get_edl()->local_session->preview_end > edl_length ) get_edl()->local_session->preview_end = edl_length; - if(get_edl()->local_session->preview_start > - get_edl()->local_session->preview_end) + if( get_edl()->local_session->preview_start > + get_edl()->local_session->preview_end ) get_edl()->local_session->preview_start = 0; x1 = (int)(get_edl()->local_session->preview_start / time_per_pixel); x2 = (int)(get_edl()->local_session->preview_end / time_per_pixel); } - else - { + else { x1 = 0; x2 = get_w(); } @@ -633,59 +574,52 @@ int TimeBar::test_preview(int buttonpress) int result = 0; - if(get_edl() && cursor_inside() && buttonpress >= 0) - { + if( get_edl() && cursor_inside() && buttonpress >= 0 ) { int x1, x2, x = get_relative_cursor_x(); get_preview_pixels(x1, x2); //printf("TimeBar::test_preview %d %d %d\n", x1, x2, x); // Inside left handle - if(x >= x1 - HANDLE_W && x < x1 + HANDLE_W && + if( x >= x1 - HANDLE_W && x < x1 + HANDLE_W && // Ignore left handle if both handles are up against the left side - x2 > HANDLE_W) - { - if(buttonpress) - { + x2 > HANDLE_W ) { + if( buttonpress ) { current_operation = TIMEBAR_DRAG_LEFT; start_position = get_edl()->local_session->preview_start; start_cursor_x = x; } - else if(get_cursor() != LEFT_CURSOR) + else if( get_cursor() != LEFT_CURSOR ) set_cursor(LEFT_CURSOR, 0, 1); result = 1; } // Inside right handle - else if(x >= x2 - HANDLE_W && x < x2 + HANDLE_W && + else if( x >= x2 - HANDLE_W && x < x2 + HANDLE_W && // Ignore right handle if both handles are up against the right side - x1 < get_w() - HANDLE_W) - { - if(buttonpress) - { + x1 < get_w() - HANDLE_W ) { + if( buttonpress ) { current_operation = TIMEBAR_DRAG_RIGHT; start_position = get_edl()->local_session->preview_end; start_cursor_x = x; } - else if(get_cursor() != RIGHT_CURSOR) + else if( get_cursor() != RIGHT_CURSOR ) set_cursor(RIGHT_CURSOR, 0, 1); result = 1; } // Inside preview - else if(get_button_down() && get_buttonpress() == 3 && - x >= x1 && x < x2) - { - if(buttonpress) - { + else if( get_button_down() && get_buttonpress() == 3 && + x >= x1 && x < x2 ) { + if( buttonpress ) { current_operation = TIMEBAR_DRAG_CENTER; starting_start_position = get_edl()->local_session->preview_start; starting_end_position = get_edl()->local_session->preview_end; start_cursor_x = x; } - if(get_cursor() != HSEPARATE_CURSOR) + if( get_cursor() != HSEPARATE_CURSOR ) set_cursor(HSEPARATE_CURSOR, 0, 1); result = 1; } } - if(!result && get_cursor() != ARROW_CURSOR) + if( !result && get_cursor() != ARROW_CURSOR ) set_cursor(ARROW_CURSOR, 0, 1); @@ -696,8 +630,7 @@ int TimeBar::move_preview(int &redraw) { int result = 0, x = get_relative_cursor_x(); - if(current_operation == TIMEBAR_DRAG_LEFT) - { + if( current_operation == TIMEBAR_DRAG_LEFT ) { get_edl()->local_session->preview_start = start_position + time_per_pixel * (x - start_cursor_x); CLAMP(get_edl()->local_session->preview_start, @@ -706,8 +639,7 @@ int TimeBar::move_preview(int &redraw) result = 1; } else - if(current_operation == TIMEBAR_DRAG_RIGHT) - { + if( current_operation == TIMEBAR_DRAG_RIGHT ) { get_edl()->local_session->preview_end = start_position + time_per_pixel * (x - start_cursor_x); CLAMP(get_edl()->local_session->preview_end, @@ -716,19 +648,16 @@ int TimeBar::move_preview(int &redraw) result = 1; } else - if(current_operation == TIMEBAR_DRAG_CENTER) - { + if( current_operation == TIMEBAR_DRAG_CENTER ) { double dt = time_per_pixel * (x - start_cursor_x); get_edl()->local_session->preview_start = starting_start_position + dt; get_edl()->local_session->preview_end = starting_end_position + dt; - if(get_edl()->local_session->preview_start < 0) - { + if( get_edl()->local_session->preview_start < 0 ) { get_edl()->local_session->preview_end -= get_edl()->local_session->preview_start; get_edl()->local_session->preview_start = 0; } else - if(get_edl()->local_session->preview_end > edl_length) - { + if( get_edl()->local_session->preview_end > edl_length ) { get_edl()->local_session->preview_start -= get_edl()->local_session->preview_end - edl_length; get_edl()->local_session->preview_end = edl_length; } @@ -737,8 +666,7 @@ int TimeBar::move_preview(int &redraw) //printf("TimeBar::move_preview %d %d\n", __LINE__, current_operation); - if(result) - { + if( result ) { update_preview(); redraw = 1; } @@ -763,36 +691,30 @@ void TimeBar::stop_playback() int TimeBar::button_press_event() { int result = 0; - if(is_event_win() && cursor_above()) - { - if(has_preview() && get_buttonpress() == 3) - { + if( is_event_win() && cursor_above() ) { + if( has_preview() && get_buttonpress() == 3 ) { result = test_preview(1); } // Change time format - else if(ctrl_down()) - { - if(get_buttonpress() == 1) + else if( ctrl_down() ) { + if( get_buttonpress() == 1 ) mwindow->next_time_format(); else - if(get_buttonpress() == 2) + if( get_buttonpress() == 2 ) mwindow->prev_time_format(); result = 1; } - else if(get_buttonpress() == 1) - { + else if( get_buttonpress() == 1 ) { stop_playback(); // Select region between two labels - if(get_double_click()) - { + if( get_double_click() ) { int x = get_relative_cursor_x(); double position = pixel_to_position(x); // Test labels select_region(position); } - else - { + else { // Reposition highlight cursor update_cursor(); @@ -816,7 +738,7 @@ int TimeBar::cursor_motion_event() int redraw = 0; //printf("TimeBar::cursor_motion_event %d %p %d\n", __LINE__, this, current_operation); - switch(current_operation) + switch( current_operation ) { case TIMEBAR_DRAG: { @@ -831,19 +753,18 @@ int TimeBar::cursor_motion_event() case TIMEBAR_DRAG_LEFT: case TIMEBAR_DRAG_RIGHT: case TIMEBAR_DRAG_CENTER: - if(has_preview()) + if( has_preview() ) result = move_preview(redraw); break; default: - if(cursor_above()) - { + if( cursor_above() ) { highlighted = 1; redraw = 1; } //printf("TimeBar::cursor_motion_event 20\n"); - if(has_preview()) + if( has_preview() ) result = test_preview(0); //printf("TimeBar::cursor_motion_event 30\n"); break; @@ -851,8 +772,7 @@ int TimeBar::cursor_motion_event() //printf("TimeBar::cursor_motion_event %d %d\n", __LINE__, current_operation); - if(redraw) - { + if( redraw ) { update(1); } //printf("TimeBar::cursor_motion_event %d %p %d\n", __LINE__, this, current_operation); @@ -862,8 +782,7 @@ int TimeBar::cursor_motion_event() int TimeBar::cursor_leave_event() { - if(highlighted) - { + if( highlighted ) { highlighted = 0; update(1); } @@ -875,7 +794,7 @@ int TimeBar::button_release_event() //printf("TimeBar::button_release_event %d %d\n", __LINE__, current_operation); int result = 0; int need_redraw = 0; - switch(current_operation) + switch( current_operation ) { case TIMEBAR_DRAG: mwindow->gui->get_focused_pane()->canvas->stop_dragscroll(); @@ -885,16 +804,14 @@ int TimeBar::button_release_event() break; default: - if(current_operation != TIMEBAR_NONE) - { + if( current_operation != TIMEBAR_NONE ) { current_operation = TIMEBAR_NONE; result = 1; } break; } - if((!cursor_above() && highlighted) || need_redraw) - { + if( (!cursor_above() && highlighted) || need_redraw ) { highlighted = 0; update(1); } @@ -914,40 +831,34 @@ void TimeBar::handle_mwindow_drag() int TimeBar::select_region(double position) { Label *start = 0, *end = 0, *current; - for(current = mwindow->edl->labels->first; current; current = NEXT) - { - if(current->position > position) - { + for( current = mwindow->edl->labels->first; current; current = NEXT ) { + if( current->position > position ) { end = current; break; } } - for(current = mwindow->edl->labels->last ; current; current = PREVIOUS) - { - if(current->position <= position) - { + for( current = mwindow->edl->labels->last ; current; current = PREVIOUS ) { + if( current->position <= position ) { start = current; break; } } // Select region - if(end != start) - { - if(!start) + if( end != start ) { + if( !start ) mwindow->edl->local_session->set_selectionstart(0); else mwindow->edl->local_session->set_selectionstart(start->position); - if(!end) + if( !end ) mwindow->edl->local_session->set_selectionend(mwindow->edl->tracks->total_length()); else mwindow->edl->local_session->set_selectionend(end->position); } else - if(end || start) - { + if( end || start ) { mwindow->edl->local_session->set_selectionstart(start->position); mwindow->edl->local_session->set_selectionend(start->position); } diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 576b1eee..d6607933 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -15,7 +15,6 @@ CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS" CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1" CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFG_CFLAGS+=" -I/usr/include/freetype2" -CFG_CFLAGS+=" -I/usr/include/OpenEXR" AC_DEFUN([CHECK_WITH], [ AC_ARG_WITH([$1], @@ -520,18 +519,20 @@ CHECK_WANT([ESOUND], [no], [use esd], [ CHECK_WANT([DL], [auto], [system has libdl], [ CHECK_LIB([DL], [dl], [dlopen])]) +CHECK_WANT([EXR], [auto], [use exr], []) + CHECK_WANT([NUMA], [auto], [system has libnuma], [ CHECK_LIB([NUMA], [numa], [numa_alloc])]) - -AC_MSG_CHECKING([for openexr available]) -saved_LIBS="$LIBS" -saved_CXXFLAGS="$CXXFLAGS" -# ilmbase libs -LIBS=" -lIlmImf -lIlmThread -lIex" -CXXFLAGS="-I/usr/include/OpenEXR" -AC_LANG_PUSH(C++) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +CHECK_WANT([OPENEXR], [auto], [use openexr], [ + AC_MSG_CHECKING([for openexr available]) + saved_LIBS="$LIBS" + saved_CXXFLAGS="$CXXFLAGS" + # ilmbase libs + LIBS=" -lIlmImf -lIlmThread -lIex" + CXXFLAGS="-I/usr/include/OpenEXR" + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include "ImfChannelList.h" #include "ImfChromaticities.h" #include "ImfCompression.h" @@ -546,15 +547,18 @@ class EXRIStream : public Imf::IStream { public: EXRIStream() : Imf::IStream("mypath") {} }; class EXROStream : public Imf::OStream { public: EXROStream() : Imf::OStream("mypath") {} }; -]])], [HAVE_openexr=yes], [HAVE_openexr=no]) -if test "x$HAVE_openexr" = "xyes"; then - SHARED_openexr="$LIBS" -fi -LIBS="$saved_LIBS" -CXXFLAGS="$saved_CXXFLAGS" -AC_LANG_POP(C++) -AC_MSG_RESULT([$HAVE_openexr]) -AC_SUBST([HAVE_openexr]) +]])], [HAVE_OPENEXR=yes], [HAVE_OPENEXR=no]) + RESULT="$HAVE_OPENEXR" + if test "x$RESULT" = "xyes"; then + SHARED_openexr="$LIBS" + CFG_CFLAGS+=" -I/usr/include/OpenEXR" + fi + LIBS="$saved_LIBS" + CXXFLAGS="$saved_CXXFLAGS" + AC_LANG_POP(C++) + AC_MSG_RESULT([$HAVE_OPENEXR]) +]) +AC_SUBST([HAVE_OPENEXR]) # build global_config OBJDIR=`uname -m` @@ -564,9 +568,10 @@ echo "AC_HELP_STRING([Reason],[Package])" echo "AC_HELP_STRING([------],[-------])" AC_DEFUN([PKG_DISABLED],[ - BUILD_$1=0 - AC_SUBST(BUILD_$1) - echo "AC_HELP_STRING([disabled],[$1])" + PKG_$1="no" + BUILD_$1=0 + AC_SUBST(BUILD_$1) + echo "AC_HELP_STRING([disabled],[$1])" ]) AC_DEFUN([PKG_SHARED],[ BUILD_$1=0 @@ -575,6 +580,7 @@ AC_DEFUN([PKG_SHARED],[ echo "AC_HELP_STRING([shared],[$1])" ]) AC_DEFUN([PKG_STATIC],[ + PKG_$1="yes" BUILD_$1=1 AC_SUBST(BUILD_$1) STATIC_BLDS+=" [$1]" @@ -591,6 +597,7 @@ for dep in \ libtheora/libogg libtheora/libvorbis ; do lib=`dirname $dep`; needs=`basename $dep` eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs"; + echo "dep lib=$lib, needs=$needs, pkg_lib=$pkg_lib, needs_lib=$needs_lib" > /dev/tty if test "x$pkg_lib" != "xno"; then eval "PKG_$needs=yes" fi @@ -622,7 +629,7 @@ PKG_PROVIDE([ffmpeg]) PKG_PROVIDE([fftw]) PKG_PROVIDE([flac]) PKG_PROVIDE([giflib]) -PKG_PROVIDE([ilmbase]) +PKG_PROVIDE([ilmbase], [$WANT_OPENEXR]) PKG_PROVIDE([ladspa],[$WANT_LADSPA_BUILD]) PKG_PROVIDE([lame]) PKG_PROVIDE([libavc1394],[$WANT_FIREWIRE]) @@ -636,7 +643,9 @@ PKG_PROVIDE([libtheora]) PKG_PROVIDE([libuuid]) PKG_PROVIDE([libvorbis]) PKG_PROVIDE([mjpegtools]) -PKG_PROVIDE([openexr]) +echo "WANT_OPENEXR = $WANT_OPENEXR" > /dev/tty +PKG_PROVIDE([openexr], [$WANT_OPENEXR]) +echo "PKG_openexr = $PKG_openexr" > /dev/tty PKG_PROVIDE([openjpeg]) PKG_PROVIDE([tiff]) PKG_PROVIDE([twolame]) @@ -654,7 +663,7 @@ AC_SUBST(SYSTEM_LIBS) echo "" for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \ - VIDEO4LINUX2 ESOUND PACTL; do + VIDEO4LINUX2 ESOUND PACTL OPENEXR; do eval vv="\$WANT_$v" if test "x$vv" != "xno"; then CFG_CFLAGS+=" -DHAVE_$v" @@ -760,8 +769,13 @@ if test $WANT_X265_HIDEPTH = "yes" ; then echo "x265.cfg_params := -DENABLE_SHARED=no -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON" fi -for pkg in $STATIC_PKGS; do echo "static_pkgs += $pkg"; done +for pkg in $STATIC_PKGS; do + eval pkg_lib="\$PKG_$pkg" + if test "x$pkg_lib" = "xno"; then continue; fi; + echo "static_pkgs += $pkg" +done echo "" + for pkg in $STATIC_BLDS; do echo "static_blds += $pkg" ver_pkg=ver_$pkg diff --git a/cinelerra-5.1/doc/ShellCmds.html b/cinelerra-5.1/doc/ShellCmds.html index f3874fda..9630931c 100644 --- a/cinelerra-5.1/doc/ShellCmds.html +++ b/cinelerra-5.1/doc/ShellCmds.html @@ -33,11 +33,5 @@ This runs a dialog that lets you Add/Del/Edit the items in the main menu popup.  Possible options are:
 
1) Add a new menu item/script: 
    click Add
    in the Label box, change the word "new" to the desired menu label
    in the Commands box, type the command lines to be included in the script
    (for example: Label => gimp; Commands => gimp)
    check-OK in the Commands window
    check-OK in the Shell window
    click on OK or Apply in the Preferences window (WILL NOT TAKE EFFECT UNTIL CLICK)
2) Del to delete an existing menu item (for example manual):
     select to highlight an entry in the Cinelerra: Shell listbox
     click Del 
     check-OK in the Shell window
     click on OK or Apply in the Preferences window (the entry is destroyed)
3) Edit an existing menu item:
    click Edit
    select to highlight an entry in the Cinelerra: Shell listbox
    click edit (the edit dialog appears)
    set the label and/or commands to the new desired values
    check-OK in the Shell window
    click on OK or Apply in the Preferences window
-
-

Document Outline

- -
-- 2.26.2