From 877bf33862808d3c3fbe11a31de0000feb915f21 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Thu, 8 Feb 2018 12:43:46 -0700 Subject: [PATCH] add size numeric format in bcfilebox --- cinelerra-5.1/guicast/bcfilebox.C | 125 ++++++++---------- cinelerra-5.1/guicast/bcfilebox.h | 26 +++- cinelerra-5.1/guicast/bcfilebox.inc | 5 + cinelerra-5.1/guicast/bcresources.C | 13 ++ cinelerra-5.1/guicast/bcresources.h | 5 +- cinelerra-5.1/guicast/bcwindowbase.C | 2 + .../guicast/images/file_size_fmt_dn.png | Bin 0 -> 334 bytes .../guicast/images/file_size_fmt_dn_png.h | 30 +++++ .../guicast/images/file_size_fmt_hi.png | Bin 0 -> 315 bytes .../guicast/images/file_size_fmt_hi_png.h | 29 ++++ .../guicast/images/file_size_fmt_up.png | Bin 0 -> 321 bytes .../guicast/images/file_size_fmt_up_png.h | 30 +++++ cinelerra-5.1/guicast/units.C | 15 +-- 13 files changed, 196 insertions(+), 84 deletions(-) create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_dn.png create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_dn_png.h create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_hi.png create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_hi_png.h create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_up.png create mode 100644 cinelerra-5.1/guicast/images/file_size_fmt_up_png.h diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 03a49e9a..e050bfe3 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -172,8 +172,6 @@ int BC_FileBoxListBox::evaluate_query(char *string) } - - BC_FileBoxTextBox::BC_FileBoxTextBox(int x, int y, BC_FileBox *filebox) : BC_TextBox(x, y, filebox->get_w() - 20, 1, filebox->want_directory ? filebox->directory : filebox->filename) @@ -185,9 +183,6 @@ BC_FileBoxTextBox::~BC_FileBoxTextBox() { } - - - int BC_FileBoxTextBox::handle_event() { int result = 0; @@ -199,8 +194,6 @@ int BC_FileBoxTextBox::handle_event() } - - BC_FileBoxDirectoryText::BC_FileBoxDirectoryText(int x, int y, BC_FileBox *filebox) : BC_TextBox(x, y, filebox->get_w() - 40, 1, filebox->fs->get_current_dir()) { @@ -229,9 +222,6 @@ int BC_FileBoxDirectoryText::handle_event() } - - - BC_FileBoxFilterText::BC_FileBoxFilterText(int x, int y, BC_FileBox *filebox) : BC_TextBox(x, y, filebox->get_w() - 50, 1, filebox->get_resources()->filebox_filter) { @@ -245,20 +235,9 @@ int BC_FileBoxFilterText::handle_event() } - - BC_FileBoxFilterMenu::BC_FileBoxFilterMenu(int x, int y, BC_FileBox *filebox) - : BC_ListBox(x, - y, - filebox->get_w() - 30, - 120, - LISTBOX_TEXT, - &filebox->filter_list, - 0, - 0, - 1, - 0, - 1) + : BC_ListBox(x, y, filebox->get_w() - 30, 120, + LISTBOX_TEXT, &filebox->filter_list, 0, 0, 1, 0, 1) { this->filebox = filebox; set_tooltip(_("Change the filter")); @@ -274,39 +253,26 @@ int BC_FileBoxFilterMenu::handle_event() } - - - - - - - - -BC_FileBoxCancel::BC_FileBoxCancel(BC_FileBox *filebox) - : BC_CancelButton(filebox) +BC_FileBoxSizeFormat::BC_FileBoxSizeFormat(int x, int y, BC_FileBox *file_box) + : BC_Button(x, y, BC_WindowBase::get_resources()->filebox_szfmt_images) { - this->filebox = filebox; - set_tooltip(_("Cancel the operation")); + this->file_box = file_box; + set_tooltip(_("Size numeric format")); } - -BC_FileBoxCancel::~BC_FileBoxCancel() +BC_FileBoxSizeFormat::~BC_FileBoxSizeFormat() { } -int BC_FileBoxCancel::handle_event() +int BC_FileBoxSizeFormat::handle_event() { -// filebox->submit_file(filebox->textbox->get_text()); - filebox->newfolder_thread->interrupt(); - filebox->set_done(1); + if( ++file_box->size_format > FILEBOX_SIZE_THOU ) + file_box->size_format = FILEBOX_SIZE_RAW; + BC_WindowBase::get_resources()->filebox_size_format = file_box->size_format; + file_box->refresh(0); return 1; } - - - - - BC_FileBoxUseThis::BC_FileBoxUseThis(BC_FileBox *filebox) : BC_Button(filebox->get_w() / 2 - BC_WindowBase::get_resources()->usethis_button_images[0]->get_w() / 2, @@ -331,9 +297,6 @@ int BC_FileBoxUseThis::handle_event() } - - - BC_FileBoxOK::BC_FileBoxOK(BC_FileBox *filebox) : BC_OKButton(filebox, !filebox->want_directory ? @@ -359,6 +322,26 @@ int BC_FileBoxOK::handle_event() return 1; } +BC_FileBoxCancel::BC_FileBoxCancel(BC_FileBox *filebox) + : BC_CancelButton(filebox) +{ + this->filebox = filebox; + set_tooltip(_("Cancel the operation")); +} + +BC_FileBoxCancel::~BC_FileBoxCancel() +{ +} + +int BC_FileBoxCancel::handle_event() +{ +// filebox->submit_file(filebox->textbox->get_text()); + filebox->newfolder_thread->interrupt(); + filebox->set_done(1); + return 1; +} + + BC_FileBoxText::BC_FileBoxText(int x, int y, BC_FileBox *filebox) : BC_Button(x, y, BC_WindowBase::get_resources()->filebox_text_images) @@ -455,13 +438,6 @@ int BC_FileBoxReload::handle_event() - - - - - - - BC_FileBox::BC_FileBox(int x, int y, const char *init_path, const char *title, const char *caption, int show_all_files, int want_directory, int multiple_files, int h_padding) @@ -489,6 +465,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path, filter_text = 0; filter_popup = 0; usethis_button = 0; + size_format = BC_WindowBase::get_resources()->filebox_size_format; strcpy(this->caption, caption); strcpy(this->current_path, init_path); @@ -619,6 +596,9 @@ void BC_FileBox::create_objects() x -= resources->filebox_updir_images[0]->get_w() + 5; add_subwindow(updir_button = new BC_FileBoxUpdir(x, y, this)); + x -= resources->filebox_szfmt_images[0]->get_w() + 5; + + add_subwindow(szfmt_button = new BC_FileBoxSizeFormat(x, y, this)); x = 10; y += directory_title_margin + 3; @@ -755,6 +735,7 @@ int BC_FileBox::resize_event(int w, int h) reload_button->reposition_window(reload_button->get_x()+dx, reload_button->get_y()); delete_button->reposition_window(delete_button->get_x()+dx, delete_button->get_y()); updir_button->reposition_window(updir_button->get_x()+dx, updir_button->get_y()); + szfmt_button->reposition_window(szfmt_button->get_x()+dx, szfmt_button->get_y()); set_w(w); set_h(h); get_resources()->filebox_w = get_w(); get_resources()->filebox_h = get_h(); @@ -829,26 +810,34 @@ int BC_FileBox::create_tables() if(!is_dir) { int64_t size = file_item->size; -#if 1 - int len = 1; - static const char *suffix[] = { "", "K", "M", "G", "T", "P" }; - for( int64_t s=size; len<15 && (s/=10)>0; ++len ); - int drop = len-3; - if( drop > 0 ) { + if( (size_format == FILEBOX_SIZE_1000 && size >= 1000) || + (size_format == FILEBOX_SIZE_1024 && size >= 1024) ) { + static const char *suffix[] = { "", "K", "M", "G", "T", "P" }; + if( size_format == FILEBOX_SIZE_1024 ) { + static const long double kk = logl(1000.)/logl(1024.); + size = expl(kk*logl((long double)size)) + 0.5; + } + int len = 1; + for( int64_t s=size; len<16 && (s/=10)>0; ++len ); + int drop = len-3; size /= ipow(10,drop); int sfx = (len-1)/3; int digits = (sfx+1)*3 - len; int64_t frac = ipow(10,digits); - int mantisa = size / frac; - int fraction = size - mantisa*frac; + int mant = size / frac; + int fraction = size - mant*frac; if( fraction ) - sprintf(string, "%d.%0*d%s", mantisa, digits, fraction, suffix[sfx]); + sprintf(string, "%d.%0*d%s", + mant, digits, fraction, suffix[sfx]); else - sprintf(string, "%d%s", mantisa, suffix[sfx]); + sprintf(string, "%d%s", + mant, suffix[sfx]); } - else -#endif + else { sprintf(string, "%jd", size); + if( size_format == FILEBOX_SIZE_THOU ) + Units::punctuate(string); + } new_item = new BC_ListBoxItem(string, get_resources()->file_color); } else diff --git a/cinelerra-5.1/guicast/bcfilebox.h b/cinelerra-5.1/guicast/bcfilebox.h index 682fa9c3..4192077f 100644 --- a/cinelerra-5.1/guicast/bcfilebox.h +++ b/cinelerra-5.1/guicast/bcfilebox.h @@ -78,22 +78,22 @@ public: BC_FileBox *filebox; }; -class BC_FileBoxOK : public BC_OKButton +class BC_FileBoxUseThis : public BC_Button { public: - BC_FileBoxOK(BC_FileBox *filebox); - ~BC_FileBoxOK(); - + BC_FileBoxUseThis(BC_FileBox *filebox); + ~BC_FileBoxUseThis(); int handle_event(); BC_FileBox *filebox; }; -class BC_FileBoxUseThis : public BC_Button +class BC_FileBoxOK : public BC_OKButton { public: - BC_FileBoxUseThis(BC_FileBox *filebox); - ~BC_FileBoxUseThis(); + BC_FileBoxOK(BC_FileBox *filebox); + ~BC_FileBoxOK(); + int handle_event(); BC_FileBox *filebox; @@ -191,6 +191,15 @@ public: BC_FileBox *filebox; }; +class BC_FileBoxSizeFormat : public BC_Button +{ +public: + BC_FileBoxSizeFormat(int x, int y, BC_FileBox *file_box); + ~BC_FileBoxSizeFormat(); + + int handle_event(); + BC_FileBox *file_box; +}; class BC_FileBoxRecent : public BC_ListBox @@ -239,6 +248,7 @@ public: friend class BC_FileBoxDelete; friend class BC_FileBoxReload; friend class BC_FileBoxRecent; + friend class BC_FileBoxSizeFormat; virtual void create_objects(); virtual int keypress_event(); @@ -307,6 +317,7 @@ private: BC_Button *updir_button; BC_Button *delete_button; BC_Button *reload_button; + BC_FileBoxSizeFormat *szfmt_button; BC_Button *ok_button, *cancel_button; BC_FileBoxUseThis *usethis_button; char caption[BCTEXTLEN]; @@ -320,6 +331,7 @@ private: int sort_column; int sort_order; + int size_format; const char *column_titles[FILEBOX_COLUMNS]; ArrayList filter_list; diff --git a/cinelerra-5.1/guicast/bcfilebox.inc b/cinelerra-5.1/guicast/bcfilebox.inc index 92e974c0..433acc92 100644 --- a/cinelerra-5.1/guicast/bcfilebox.inc +++ b/cinelerra-5.1/guicast/bcfilebox.inc @@ -39,6 +39,11 @@ class BC_FileBox; #define FILEBOX_DATE 2 #define FILEBOX_EXTENSION 3 +#define FILEBOX_SIZE_RAW 0 +#define FILEBOX_SIZE_1000 1 +#define FILEBOX_SIZE_1024 2 +#define FILEBOX_SIZE_THOU 3 + #define FILEBOX_NAME_TEXT _("File") #define FILEBOX_SIZE_TEXT _("Size") #define FILEBOX_DATE_TEXT _("Date") diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index 38053d09..bad4b6db 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -347,6 +347,7 @@ VFrame *BC_Resources::default_filebox_newfolder_images[3] = { 0, }; VFrame *BC_Resources::default_filebox_rename_images[3] = { 0, }; VFrame *BC_Resources::default_filebox_delete_images[3] = { 0, }; VFrame *BC_Resources::default_filebox_reload_images[3] = { 0, }; +VFrame *BC_Resources::default_filebox_szfmt_images[3] = { 0, }; VFrame *BC_Resources::default_listbox_button[4] = { 0, }; VFrame *BC_Resources::default_listbox_bg = 0; VFrame *BC_Resources::default_listbox_expand[5] = { 0, }; @@ -508,6 +509,10 @@ new_vframes(3,default_menubar_data, #include "images/file_reload_up_png.h" #include "images/file_reload_hi_png.h" #include "images/file_reload_dn_png.h" +#include "images/file_size_fmt_up_png.h" +#include "images/file_size_fmt_hi_png.h" +#include "images/file_size_fmt_dn_png.h" + new_vframes(3,default_filebox_text_images, new VFramePng(file_text_up_png), new VFramePng(file_text_hi_png), @@ -543,6 +548,11 @@ new_vframes(3,default_filebox_reload_images, new VFramePng(file_reload_hi_png), new VFramePng(file_reload_dn_png)); +new_vframes(3,default_filebox_szfmt_images, + new VFramePng(file_size_fmt_up_png), + new VFramePng(file_size_fmt_hi_png), + new VFramePng(file_size_fmt_dn_png)); + #include "images/listbox_button_dn_png.h" #include "images/listbox_button_hi_png.h" #include "images/listbox_button_up_png.h" @@ -783,6 +793,8 @@ new_vframes(20,default_medium_7segment, filebox_rename_images = default_filebox_rename_images; filebox_delete_images = default_filebox_delete_images; filebox_reload_images = default_filebox_reload_images; + filebox_szfmt_images = default_filebox_szfmt_images; + filebox_size_format = FILEBOX_SIZE_RAW; directory_color = BLUE; file_color = BLACK; @@ -859,6 +871,7 @@ BC_Resources::~BC_Resources() del_vframes(default_filebox_rename_images, 3); del_vframes(default_filebox_delete_images, 3); del_vframes(default_filebox_reload_images, 3); + del_vframes(default_filebox_szfmt_images, 3); del_vframes(default_listbox_button, 4); delete default_listbox_bg; del_vframes(default_listbox_expand, 5); diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index 1c73f713..dae01307 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -195,6 +195,7 @@ public: VFrame **filebox_descend_images; VFrame **filebox_delete_images; VFrame **filebox_reload_images; + VFrame **filebox_szfmt_images; // Generic button images VFrame **generic_button_images; @@ -388,6 +389,7 @@ public: static VFrame *default_filebox_rename_images[3]; static VFrame *default_filebox_delete_images[3]; static VFrame *default_filebox_reload_images[3]; + static VFrame *default_filebox_szfmt_images[3]; static VFrame *default_listbox_button[4]; static VFrame *default_listbox_bg; static VFrame *default_listbox_expand[5]; @@ -414,7 +416,8 @@ public: int use_xvideo; // Seems to help if only 1 window is created at a time. Mutex *create_window_lock; - +// size raw, 1000, 1024, thou + int filebox_size_format; private: // Test for availability of shared memory pixmaps void init_shm(BC_WindowBase *window); diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 58055f78..b429da4c 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -4256,6 +4256,7 @@ int BC_WindowBase::load_defaults(BC_Hash *defaults) resources->filebox_columnwidth[1] = defaults->get("FILEBOX_WIDTH1", resources->filebox_columnwidth[1]); resources->filebox_columnwidth[2] = defaults->get("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]); resources->filebox_columnwidth[3] = defaults->get("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]); + resources->filebox_size_format = defaults->get("FILEBOX_SIZE_FORMAT", get_resources()->filebox_size_format); defaults->get("FILEBOX_FILTER", resources->filebox_filter); return 0; } @@ -4283,6 +4284,7 @@ int BC_WindowBase::save_defaults(BC_Hash *defaults) defaults->update("FILEBOX_WIDTH2", resources->filebox_columnwidth[2]); defaults->update("FILEBOX_WIDTH3", resources->filebox_columnwidth[3]); defaults->update("FILEBOX_FILTER", resources->filebox_filter); + defaults->update("FILEBOX_SIZE_FORMAT", get_resources()->filebox_size_format); return 0; } diff --git a/cinelerra-5.1/guicast/images/file_size_fmt_dn.png b/cinelerra-5.1/guicast/images/file_size_fmt_dn.png new file mode 100644 index 0000000000000000000000000000000000000000..18a7f4c387456ed446f90cc998b0919eb5604e39 GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPd69>PMbv^gQb3h@*%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`?yBqLS9-P1Q9cf)j$+&WJe#}JR>XQv(HV^-vFVLx16{NVWV_GO*7!VF)$ zD>Ad0E7{~UX@!@|gthBbx3KT1mQqsUUGavEp<%aq*9-fGnXR+VI;bcz{CHi!BGfoD z^7Tot$-jis%vh%Oyt}9s+1&4}SLtaYlggf;Hajg}=A-IcPZy)JOI|Qrn5l1fsZhE7 z`T3Jii84PITPIm@J4CJXIMkw2zV2QePZ+OMhwUO*wm%#er@=ltB<)VvZPmw~~#C^fMp zHASI3vm`?yBqLS9-P1Q9cf)j$+-y%5#}JR>SHm2+4j6E(KKQ@>rmUOel3i=Pt)Hz8 z=sCtBYP|WGlgq8!9GbJ;8h#|ICCP1ItWuvRxPj5lp=h6O?r+Wii)9i%)Q9$*(^4yo z3glZBvYFwwu(!juk|OuU1jdjpnu{N;-Wia#>595s!c2d=i3M)A?Q1sO?YUVqMfI{5 zL&xe#D>vw6zs#Pvx2e`H<@Ef@wHc+U8(vs5xJ^$mR%bAK4RWWatDnm{r-UW|7ea4q literal 0 HcmV?d00001 diff --git a/cinelerra-5.1/guicast/images/file_size_fmt_hi_png.h b/cinelerra-5.1/guicast/images/file_size_fmt_hi_png.h new file mode 100644 index 00000000..b9b85c37 --- /dev/null +++ b/cinelerra-5.1/guicast/images/file_size_fmt_hi_png.h @@ -0,0 +1,29 @@ +#ifndef FILE_SIZE_FMT_HI_PNG_H +#define FILE_SIZE_FMT_HI_PNG_H + +static unsigned char file_size_fmt_hi_png[] = +{ + 0x00, 0x00, 0x01, 0x3b, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x19, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xe9, 0x85, + 0x63, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, + 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, + 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, + 0x07, 0xe2, 0x02, 0x08, 0x0f, 0x2e, 0x26, 0xfa, 0x7a, 0xa0, 0x4a, 0x00, 0x00, 0x00, 0x21, 0x69, + 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x54, 0x68, 0x65, 0x20, + 0x47, 0x49, 0x4d, 0x50, 0x6d, 0xb0, 0x97, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x49, 0x44, 0x41, 0x54, + 0x48, 0xc7, 0xd5, 0x56, 0x41, 0x0a, 0xc0, 0x30, 0x08, 0xab, 0xc1, 0xff, 0x7f, 0xd9, 0x1d, 0x46, + 0x41, 0xa4, 0xba, 0xad, 0x4b, 0x3b, 0xe6, 0xad, 0x50, 0x8c, 0xc6, 0x04, 0x15, 0x33, 0xb3, 0xe6, + 0x42, 0x44, 0xda, 0xdb, 0x08, 0x29, 0x9b, 0x46, 0x80, 0xf8, 0x61, 0x26, 0x62, 0x1e, 0xb0, 0x01, + 0x7a, 0x27, 0x9e, 0x11, 0xb0, 0x01, 0x46, 0x40, 0x72, 0xbe, 0x2d, 0x6d, 0xfb, 0x29, 0xff, 0xa3, + 0x1c, 0x60, 0xf0, 0x7f, 0x55, 0x8c, 0xce, 0x2a, 0x26, 0x76, 0x5a, 0x51, 0x0e, 0xa6, 0x54, 0xb3, + 0x00, 0xdb, 0x13, 0x4b, 0x40, 0xb6, 0x74, 0x72, 0x47, 0x81, 0x60, 0x01, 0x54, 0xb4, 0x29, 0xa3, + 0xe2, 0xab, 0xb9, 0x50, 0x66, 0xb2, 0xd4, 0x27, 0x1e, 0x60, 0x99, 0x4f, 0x3e, 0x91, 0x70, 0x46, + 0xdb, 0x3f, 0x7c, 0xb2, 0xdd, 0x8c, 0xd9, 0x7c, 0x94, 0x25, 0xd3, 0x4a, 0x00, 0x88, 0xab, 0x92, + 0xa9, 0xb0, 0x2e, 0x6b, 0xe9, 0x6b, 0x91, 0xbd, 0x82, 0x7d, 0x3e, 0x64, 0xcb, 0x9f, 0x79, 0xad, + 0x68, 0x75, 0x65, 0xb0, 0xe8, 0x3b, 0x00, 0x46, 0x97, 0x60, 0x33, 0x27, 0x00, 0x36, 0xeb, 0x00, + 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#endif diff --git a/cinelerra-5.1/guicast/images/file_size_fmt_up.png b/cinelerra-5.1/guicast/images/file_size_fmt_up.png new file mode 100644 index 0000000000000000000000000000000000000000..3871acd99fcd50987334dd1f9fd82bbaa169152b GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPd69>P(ZpmhkW}uK_W=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2d;l98(5?&%wlyJ0#=ZlR}(V~EG`vtf>W2NXDj5B=YNM^;SOT}Eha-rkuK zTuVEc7?w76ObOjF;iygHegkHC_nRzRCxr=CE1x(arW)GGAhPrPi)l8undOhCHE;3k zSrRs_SxMvas%VeCkV&TPMjURNZe|^uxliLUr{uw~m=MlwXHTk&^`-p&KSxIX*b4h& z8(yAZI9-$~qsDL`X7AqE^?T=@QK>j_ROQpDh%cuTzP@Cdx-?DaN6p*SAlG`j`njxg HN@xNAcsg_U literal 0 HcmV?d00001 diff --git a/cinelerra-5.1/guicast/images/file_size_fmt_up_png.h b/cinelerra-5.1/guicast/images/file_size_fmt_up_png.h new file mode 100644 index 00000000..5bd5c29d --- /dev/null +++ b/cinelerra-5.1/guicast/images/file_size_fmt_up_png.h @@ -0,0 +1,30 @@ +#ifndef FILE_SIZE_FMT_UP_PNG_H +#define FILE_SIZE_FMT_UP_PNG_H + +static unsigned char file_size_fmt_up_png[] = +{ + 0x00, 0x00, 0x01, 0x41, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x19, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xe9, 0x85, + 0x63, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, + 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, + 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, + 0x07, 0xe2, 0x02, 0x08, 0x0f, 0x2f, 0x2d, 0x74, 0xb3, 0x48, 0x83, 0x00, 0x00, 0x00, 0x21, 0x69, + 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x54, 0x68, 0x65, 0x20, + 0x47, 0x49, 0x4d, 0x50, 0x6d, 0xb0, 0x97, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x49, 0x44, 0x41, 0x54, + 0x48, 0xc7, 0xcd, 0x56, 0x41, 0x0e, 0xc0, 0x20, 0x08, 0x13, 0xc2, 0xff, 0xbf, 0xdc, 0x1d, 0x16, + 0x13, 0x47, 0x1c, 0x12, 0xad, 0x6e, 0xbd, 0x99, 0x18, 0x0a, 0xa5, 0x88, 0x02, 0x00, 0xa5, 0x81, + 0x88, 0x94, 0x55, 0xb8, 0x90, 0xc5, 0x3c, 0x81, 0xbf, 0x30, 0x03, 0x1f, 0x47, 0xd9, 0x04, 0xb5, + 0x92, 0x56, 0x11, 0x7b, 0x23, 0xc8, 0xc8, 0x16, 0x25, 0x55, 0x89, 0x00, 0x14, 0xb9, 0xcf, 0xe8, + 0x96, 0x3c, 0xdb, 0x03, 0x1f, 0xc7, 0x66, 0x83, 0xb4, 0x49, 0x8c, 0xa4, 0x56, 0x96, 0x83, 0x22, + 0x28, 0xd3, 0xaa, 0x5b, 0x48, 0x8e, 0x54, 0x92, 0x35, 0x87, 0x32, 0x08, 0x46, 0xb2, 0xd9, 0x6a, + 0xc6, 0x99, 0xbe, 0x28, 0xe3, 0x09, 0x19, 0xc1, 0x56, 0x5c, 0x54, 0x09, 0xb6, 0xcd, 0xc9, 0x27, + 0x16, 0x8e, 0x64, 0xfb, 0xff, 0x9c, 0x1c, 0x1f, 0xc6, 0xa8, 0x3f, 0xc6, 0xb0, 0xe9, 0xc8, 0x00, + 0xcb, 0x72, 0x65, 0x1c, 0x26, 0x00, 0xc0, 0x5c, 0xbd, 0xbd, 0x5d, 0xaf, 0xbd, 0x9d, 0xcc, 0x24, + 0x78, 0xc8, 0xc5, 0x24, 0xf2, 0xca, 0x58, 0xf4, 0xcb, 0x60, 0xf5, 0xe9, 0x02, 0x95, 0xa5, 0x66, + 0x2c, 0xf8, 0x7c, 0xed, 0xab, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, + 0x82 +}; + +#endif diff --git a/cinelerra-5.1/guicast/units.C b/cinelerra-5.1/guicast/units.C index 8e24d3ef..9c2f1d27 100644 --- a/cinelerra-5.1/guicast/units.C +++ b/cinelerra-5.1/guicast/units.C @@ -620,14 +620,13 @@ const char* Units::format_to_separators(int time_format) void Units::punctuate(char *string) { - int len = strlen(string); - int commas = (len - 1) / 3; - for(int i = len + commas, j = len, k; j >= 0 && i >= 0; i--, j--) { - k = (len - j - 1) / 3; - if(k * 3 == len - j - 1 && j != len - 1 && string[j] != 0) { - string[i--] = ','; - } - string[i] = string[j]; + int sep = ',', len = strlen(string), commas = (len - 1) / 3; + char *cp = string + len, *bp = cp + commas; + *bp = 0; + for( int k=3; cp < bp && bp > string; ) { + *--bp = *--cp; + if( --k > 0 ) continue; + *--bp = sep; k = 3; } } -- 2.26.2