X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmainindexes.C;h=05812bb7c02b47ca1414e455e071e5c16eabfe5b;hb=9f0e523f895dabf635f694efc854f2be479d712c;hp=a4ea540dc546e17c2742fe04a163a4ba28569bed;hpb=190b4810ec184c74ceab3fcd6faf09a91c92c53c;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mainindexes.C b/cinelerra-5.1/cinelerra/mainindexes.C index a4ea540d..05812bb7 100644 --- a/cinelerra-5.1/cinelerra/mainindexes.C +++ b/cinelerra-5.1/cinelerra/mainindexes.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "asset.h" @@ -74,8 +74,7 @@ void MainIndexes::add_next_asset(File *file, Indexable *indexable) SET_TRACE // Test current asset IndexFile indexfile(mwindow, indexable); - IndexState *index_state = 0; - index_state = indexable->index_state; + IndexState *index_state = indexable->index_state; SET_TRACE int ret = indexfile.open_index(); @@ -92,13 +91,6 @@ SET_TRACE next_lock->unlock(); } -void MainIndexes::delete_current_sources() -{ - for(int i = 0; i < current_indexables.size(); i++) - current_indexables.get(i)->Garbage::remove_user(); - current_indexables.remove_all(); -} - void MainIndexes::start_loop() { interrupt_flag = 0; @@ -119,7 +111,7 @@ void MainIndexes::start_build() { //printf("MainIndexes::start_build 1\n"); interrupt_flag = 0; -// Locked up when indexes were already being built and an indexable was +// Locked up when indexes were already being built and an indexable was // pasted. // interrupt_lock.lock(); input_lock->unlock(); @@ -141,8 +133,6 @@ void MainIndexes::interrupt_build() void MainIndexes::load_next_sources() { - delete_current_sources(); - // Transfer from new list next_lock->lock("MainIndexes::load_next_sources"); for(int i = 0; i < next_indexables.size(); i++) @@ -167,13 +157,14 @@ void MainIndexes::run() // test index of each indexable MainProgressBar *progress = 0; - int total_sources = current_indexables.size(); - for( int i = 0; i < total_sources && !interrupt_flag; ++i ) { + next_lock->lock("MainIndexes::run"); + for( int i=0; iindex_state; // if status is known, no probe if( index_state->index_status != INDEX_NOTTESTED ) continue; + next_lock->unlock(); IndexFile indexfile(mwindow, indexable); int ret = indexfile.open_index(); @@ -196,8 +187,14 @@ void MainIndexes::run() indexfile.create_index(progress); if( progress->is_cancelled() ) interrupt_flag = 1; + next_lock->lock("MainIndexes::run"); } + for( int i=0; iremove_user(); + current_indexables.remove_all(); + next_lock->unlock(); + if(progress) { // progress box is only created when an index is built if(mwindow->gui) mwindow->gui->lock_window("MainIndexes::run 3"); progress->stop_progress();