Surprise, surprise! :) With the latest fixes for gstreamer.py bug 1123410, it becomes possible to wait for all TagReader tasks to complete before starting conversion.
As I currently still use the forwarded ConverterQueueFoo exceptions, which work extremely well so far, what I do is similar to this in ui.py:
in read_tags(): self.tag_reader_tasks.append(tagreader) # maintain list of TagReader tasks
in tags_read() callback: self.tag_reader_tasks.remove(tagreader) # maintain list of TagReader tasks
# only add files where TagReader was successful
if sound_file.tags_read: # or if not True, alternatively store an error to be found by do_convert() before converter.start self.converter.add(sound_file)
in do_convert(): self.tag_reader_tasks = [] self.converter.abort() # to start with empty queues
and at the end of the enumerate(files) loop, when all TagReader tasks have been started (but may not have completed yet):
while len(self.tag_reader_tasks)>0 and len(self.converter.waiting_tasks) < total: gtk_sleep(1)
Of course, in that loop I check the forwarded exceptions, too. So far, this even seems to be a work-around for Fedora 19 development.
Surprise, surprise! :) With the latest fixes for gstreamer.py bug 1123410, it becomes possible to wait for all TagReader tasks to complete before starting conversion.
As I currently still use the forwarded ConverterQueueFoo exceptions, which work extremely well so far, what I do is similar to this in ui.py:
in read_tags():
self.tag_ reader_ tasks.append( tagreader) # maintain list of TagReader tasks
in tags_read() callback:
self.tag_ reader_ tasks.remove( tagreader) # maintain list of TagReader tasks tags_read: # or if not True, alternatively store an error to be found by do_convert() before converter.start
self. converter. add(sound_ file)
# only add files where TagReader was successful
if sound_file.
in do_convert():
self.tag_ reader_ tasks = []
self.converter .abort( ) # to start with empty queues
and at the end of the enumerate(files) loop, when all TagReader tasks have been started (but may not have completed yet):
while len(self. tag_reader_ tasks)> 0 and len(self. converter. waiting_ tasks) < total:
gtk_sleep( 1)
Of course, in that loop I check the forwarded exceptions, too. So far, this even seems to be a work-around for Fedora 19 development.