From: Good Guy Date: Mon, 27 Jun 2016 23:03:59 +0000 (-0600) Subject: info btn, zoom lockup, nesting, paste fixes X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=155cea9e8f0f6a59f3e713230575603da305d47e;p=goodguy%2Fhistory.git info btn, zoom lockup, nesting, paste fixes --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index a6a1c1ce..e052668b 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1508,8 +1508,6 @@ int AWindowFolders::selection_changed() int AWindowFolders::button_press_event() { - if( get_buttonpress() == 3 && is_event_win() && cursor_inside() ) - return 0; return BC_ListBox::button_press_event(); } @@ -1560,8 +1558,6 @@ AWindowAssets::~AWindowAssets() int AWindowAssets::button_press_event() { - if( get_buttonpress() == 3 && is_event_win() && cursor_inside() ) - return 0; return BC_ListBox::button_press_event(); } diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index 3892c54f..df287629 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -634,7 +634,9 @@ void ResourcePixmap::draw_audio_source(TrackCanvas *canvas, if(indexable->is_asset) { + mwindow->gui->unlock_window(); File *source = mwindow->audio_cache->check_out(edit->asset, mwindow->edl); + mwindow->gui->lock_window("draw_audio_source"); if(!source) { diff --git a/cinelerra-5.1/cinelerra/resourcethread.C b/cinelerra-5.1/cinelerra/resourcethread.C index 6aa27b99..c3d69412 100644 --- a/cinelerra-5.1/cinelerra/resourcethread.C +++ b/cinelerra-5.1/cinelerra/resourcethread.C @@ -374,6 +374,8 @@ void ResourceThread::open_render_engine(EDL *nested_edl, File *ResourceThread::get_audio_source(Asset *asset) { + if( interrupted ) asset = 0; + if( audio_asset && audio_asset != asset && (!asset || strcmp(audio_asset->path, asset->path)) ) { @@ -394,6 +396,8 @@ File *ResourceThread::get_audio_source(Asset *asset) File *ResourceThread::get_video_source(Asset *asset) { + if( interrupted ) asset = 0; + if( video_asset && video_asset != asset && (!asset || strcmp(video_asset->path, asset->path)) ) { diff --git a/cinelerra-5.1/cinelerra/vedit.C b/cinelerra-5.1/cinelerra/vedit.C index 7f0115b0..775822fe 100644 --- a/cinelerra-5.1/cinelerra/vedit.C +++ b/cinelerra-5.1/cinelerra/vedit.C @@ -129,6 +129,8 @@ int VEdit::read_frame(VFrame *video_out, int use_cache, int use_asynchronous) { + File *file = 0; + int result = 0; int64_t source_position = 0; const int debug = 0; @@ -139,20 +141,19 @@ if(debug) printf("VEdit::read_frame %d source_position=%jd input_position=%jd\n" Asset *asset = get_nested_asset(&source_position, input_position, direction); + if( !asset ) result = 1; if(debug) printf("VEdit::read_frame %d source_position=%jd input_position=%jd\n", __LINE__, source_position, input_position); - File *file = cache->check_out(asset, - edl); - int result = 0; - + if( !result ) { + file = cache->check_out(asset, edl); + if( !file ) result = 1; + } if(debug) printf("VEdit::read_frame %d path=%s source_position=%jd\n", __LINE__, asset->path, source_position); - if(file) - { - + if( !result ) { if(debug) printf("VEdit::read_frame %d\n", __LINE__); source_position = (direction == PLAY_FORWARD) ? source_position : @@ -179,8 +180,6 @@ if(debug) printf("VEdit::read_frame %d\n", __LINE__); cache->check_in(asset); if(debug) printf("VEdit::read_frame %d\n", __LINE__); } - else - result = 1; //for(int i = 0; i < video_out->get_w() * 3 * 20; i++) video_out->get_rows()[0][i] = 128; return result; diff --git a/cinelerra-5.1/guicast/bcclipboard.C b/cinelerra-5.1/guicast/bcclipboard.C index c91c51fe..ba33171a 100644 --- a/cinelerra-5.1/guicast/bcclipboard.C +++ b/cinelerra-5.1/guicast/bcclipboard.C @@ -240,7 +240,7 @@ int BC_Clipboard::to_clipboard(const char *data, long len, int clipboard_num) #endif // Store in local buffer - if(this->data[clipboard_num] && length[clipboard_num] != len + 1) + if(this->data[clipboard_num] && length[clipboard_num] != len) { delete [] this->data[clipboard_num]; this->data[clipboard_num] = 0; @@ -250,10 +250,11 @@ int BC_Clipboard::to_clipboard(const char *data, long len, int clipboard_num) { length[clipboard_num] = len; this->data[clipboard_num] = new char[len + 1]; - memcpy(this->data[clipboard_num], data, len); - this->data[clipboard_num][len] = 0; } + memcpy(this->data[clipboard_num], data, len); + this->data[clipboard_num][len] = 0; + if(clipboard_num == PRIMARY_SELECTION) { XSetSelectionOwner(out_display, @@ -370,7 +371,8 @@ int BC_Clipboard::from_clipboard(char *data, long maxlen, int clipboard_num) #else XUnlockDisplay(in_display); #endif - +//int len = strlen(data); +//printf("BC_Clipboard::from_clipboard %d: %d '%*.*s'\n",clipboard_num,len,len,len,data); return 0; } diff --git a/cinelerra-5.1/guicast/bctextbox.C b/cinelerra-5.1/guicast/bctextbox.C index 0bcf9f46..cecd2492 100644 --- a/cinelerra-5.1/guicast/bctextbox.C +++ b/cinelerra-5.1/guicast/bctextbox.C @@ -2079,27 +2079,21 @@ int BC_TextBox::get_cursor_letter2(int cursor_x, int cursor_y) void BC_TextBox::select_word(int &letter1, int &letter2, int ibeam_letter) { int wtext_len = wtext_update(); - if(!wtext_len) return; - letter1 = letter2 = ibeam_letter; - do { - if(iswalnum(wtext[letter1])) letter1--; - } while(letter1 > 0 && iswalnum(wtext[letter1])); - - if( !iswalnum(wtext[letter1]) ) letter1++; - - do { - if( iswalnum(wtext[letter2]) ) letter2++; - } while( letter2 < wtext_len && isalnum(wtext[letter2]) ); + if( letter1 < 0 ) letter1 = 0; + if( letter2 < 0 ) letter2 = 0; + if( letter1 > wtext_len ) letter1 = wtext_len; + if( letter2 > wtext_len ) letter2 = wtext_len; + if( !wtext_len ) return; - if( letter2 < wtext_len && wtext[letter2] == ' ') letter2++; + while( letter1 > 0 && iswalnum(wtext[letter1]) ) --letter1; + if( letter1 < wtext_len && iswspace(wtext[letter1]) ) ++letter1; - if(letter1 < 0) letter1 = 0; - if(letter2 < 0) letter2 = 0; - if(letter1 > wtext_len) letter1 = wtext_len; - if(letter2 > wtext_len) letter2 = wtext_len; + while( letter2 < wtext_len && iswalnum(wtext[letter2]) ) ++letter2; + if( letter2 < wtext_len && wtext[letter2] == ' ' ) ++letter2; } + void BC_TextBox::select_line(int &letter1, int &letter2, int ibeam_letter) { int wtext_len = wtext_update(); @@ -2134,9 +2128,9 @@ void BC_TextBox::copy_selection(int clipboard_num) highlight_letter1 < 0 || highlight_letter2 < 0 || highlight_letter2 - highlight_letter1 <= 0) return; int clip_len = highlight_letter2 - highlight_letter1; - char ctext[clip_len+1]; //printf(" BC_TextBox::copy_selection %d %d %d\n",highlight_letter1, highlight_letter2, clip_len); - text_update(&wtext[highlight_letter1],clip_len, ctext,clip_len+1); + char ctext[4*clip_len+4]; + clip_len = text_update(&wtext[highlight_letter1],clip_len, ctext,4*clip_len+4); get_clipboard()->to_clipboard(ctext, clip_len, clipboard_num); } @@ -2146,11 +2140,11 @@ void BC_TextBox::paste_selection(int clipboard_num) int len = get_clipboard()->clipboard_len(clipboard_num); if( len > 0 ) { - char cstring[len]; wchar_t wstring[len]; --len; - get_clipboard()->from_clipboard(cstring, len, clipboard_num); + char cstring[len]; wchar_t wstring[len]; + get_clipboard()->from_clipboard(cstring, len, clipboard_num); --len; //printf("BC_TextBox::paste_selection %d '%*.*s'\n",len,len,len,cstring); - BC_Resources::encode(BC_Resources::encoding, BC_Resources::wide_encoding, - cstring,(len+1), (char *)wstring,(len+1)*sizeof(wchar_t)); + len = BC_Resources::encode(BC_Resources::encoding, BC_Resources::wide_encoding, + cstring,len, (char *)wstring,(len+1)*sizeof(wchar_t)) / sizeof(wchar_t); insert_text(wstring, len); } }