X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fedl.C;fp=cinelerra-5.1%2Fcinelerra%2Fedl.C;h=4411bf4bd0c652d0a065bb72f85e32ffbb7648f8;hp=a114f3c995ec3df962b516caf2fe19f216ac7408;hb=09ccfde5a1fd65069f69b37490462b7ccf38a336;hpb=09415d6aba2e181c49863393a047d0947c969d21 diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index a114f3c9..4411bf4b 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -24,7 +24,7 @@ #include "atrack.h" #include "autoconf.h" #include "automation.h" -#include "awindowgui.inc" +#include "awindowgui.h" #include "bccmodels.h" #include "bchash.h" #include "bcsignals.h" @@ -70,7 +70,6 @@ EDL::EDL(EDL *parent_edl) tracks = 0; labels = 0; local_session = 0; - folders.set_array_delete(); id = next_id(); path[0] = 0; } @@ -87,7 +86,6 @@ EDL::~EDL() delete assets; delete session; } - folders.remove_all_objects(); } @@ -146,9 +144,7 @@ int EDL::create_default_tracks() int EDL::load_xml(FileXML *file, uint32_t load_flags) { int result = 0; - -// Clear objects - folders.remove_all_objects(); + folders.clear(); if( (load_flags & LOAD_ALL) == LOAD_ALL ) { remove_vwindow_edls(); @@ -237,10 +233,8 @@ int EDL::read_xml(FileXML *file, uint32_t load_flags) result = file->skip_tag(); } else - if( file->tag.title_is("FOLDER") ) { - char folder[BCTEXTLEN]; - strcpy(folder, file->read_text()); - new_folder(folder); + if( file->tag.title_is("FOLDERS") ) { + result = folders.load_xml(file); } else if( file->tag.title_is("MIXERS") ) { @@ -408,11 +402,8 @@ void EDL::copy_session(EDL *edl, int session_only) if( !session_only ) { strcpy(this->path, edl->path); -//printf("EDL::copy_session %p %s\n", this, this->path); - - folders.remove_all_objects(); - for( int i=0; ifolders.size(); ++i ) - folders.append(cstrdup(edl->folders[i])); + awindow_folder = edl->awindow_folder; + folders.copy_from(&edl->folders); } if( !parent_edl ) { @@ -548,16 +539,7 @@ int EDL::copy(double start, double end, int all, session->save_xml(file); session->save_video_config(file); session->save_audio_config(file); - -// Folders - for( int i=0; itag.set_title("FOLDER"); - file->append_tag(); - file->append_text(folders[i]); - file->tag.set_title("/FOLDER"); - file->append_tag(); - file->append_newline(); - } + folders.save_xml(file); if( !parent_edl ) copy_assets(start, end, file, all, output_path); @@ -1214,18 +1196,58 @@ double EDL::align_to_frame(double position, int round) } -void EDL::new_folder(const char *folder) +BinFolder *EDL::get_folder(int no) +{ + for( int i=0; iawindow_folder ) return fp; + } + return 0; +} + +int EDL::get_folder_number(const char *title) { - for( int i=0; ititle) ) + return folders[i]->awindow_folder; + } + return AW_NO_FOLDER; +} + +const char *EDL::get_folder_name(int no) +{ + if( no >= 0 && notitle; +} + +int EDL::new_folder(const char *title) +{ + if( !title[0] ) return 1; + int ret = get_folder_number(title); + if( ret >= 0 ) return 1; + int idx = AWINDOW_FOLDERS; + for( int i=0; iawindow_folder; + if( no >= idx ) idx = no+1; + } + folders.append(new BinFolder(idx, title)); + return 0; } -void EDL::delete_folder(const char *folder) +int EDL::delete_folder(const char *title) { - int i = folders.size(); - while( --i >= 0 && strcasecmp(folders[i], folder) ); - if( i >= 0 ) folders.remove_number(i); + int k = folders.size(); + while( --k >= 0 && strcmp(title, folders[k]->title) ); + if( k >= 0 ) + folders.remove_object_number(k); + return k; } int EDL::get_use_vconsole(VEdit* *playable_edit,