<commit_before>package com.soniccandle.controller;

import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;

import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.SwingWorker;

import com.soniccandle.model.SimpleRenderer;
import com.soniccandle.model.VideoOutputter;
import com.soniccandle.model.XuggleVideoOutputter;

public class RenderSwingWorker extends SwingWorker<Boolean, Integer> {

	public int videoFrameRate;
	public int width;
	public int height;
	public File audioFile;
	public File outputTo;
	public VideoOutputter outputter;
	public BufferedImage backgroundImage;
	public JProgressBar progressBar;

	@Override
	public Boolean doInBackground() {
		SimpleRenderer renderer;
		try {
			renderer = new SimpleRenderer(audioFile, videoFrameRate, width, height, outputTo);
			renderer.backgroundImage = backgroundImage;
			renderer.outputter = outputter;
			renderer.start();
			while (!renderer.isDone) {
				renderer.renderNextFrame();
				this.publish(renderer.progress);
			}
			renderer.finish();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		return true;
	}
	
    @Override
    protected void process(List<Integer> progresses) {
    	Integer progress = progresses.get(progresses.size() - 1);
    	progressBar.setValue(progress);
    }
	
	@Override
    public void done() {
		if (outputter instanceof XuggleVideoOutputter && outputTo.length() < 100) {
			JOptionPane.showMessageDialog(null, "Ooof - looks like there was a problem, sorry.  Please check that your adio file is 16-bit wav, not 24 or 32, thanks!  Other bitrates coming soon, hopefully.");
		} else {
			JOptionPane.showMessageDialog(null, "Done!");
		}
	}
	
	
	
}
<commit_msg>fixed bug where done would not display for image sequence.<commit_after>package com.soniccandle.controller;

import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;

import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.SwingWorker;

import com.soniccandle.model.SimpleRenderer;
import com.soniccandle.model.VideoOutputter;
import com.soniccandle.model.XuggleVideoOutputter;

public class RenderSwingWorker extends SwingWorker<Boolean, Integer> {

	public int videoFrameRate;
	public int width;
	public int height;
	public File audioFile;
	public File outputTo;
	public VideoOutputter outputter;
	public BufferedImage backgroundImage;
	public JProgressBar progressBar;

	@Override
	public Boolean doInBackground() {
		SimpleRenderer renderer;
		try {
			renderer = new SimpleRenderer(audioFile, videoFrameRate, width, height, outputTo);
			renderer.backgroundImage = backgroundImage;
			renderer.outputter = outputter;
			renderer.start();
			while (!renderer.isDone) {
				renderer.renderNextFrame();
				this.publish(renderer.progress);
			}
			renderer.finish();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		return true;
	}
	
    @Override
    protected void process(List<Integer> progresses) {
    	Integer progress = progresses.get(progresses.size() - 1);
    	progressBar.setValue(progress);
    }
	
	@Override
    public void done() {
		if (outputter instanceof XuggleVideoOutputter && outputTo.length() < 100) {
			JOptionPane.showMessageDialog(null, "Ooof - looks like there was a problem, sorry.  Please check that your adio file is 16-bit wav, not 24 or 32, thanks!  Other bitrates coming soon, hopefully.");
			return;
		} 
		
		JOptionPane.showMessageDialog(null, "Done!");
	}
	
	
	
}

{'fraction_non_alphanumeric': 0.09371428571428571, 'fraction_numerical': 0.005714285714285714, 'mean_word_length': 4.47887323943662, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2560280', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1063, 'n_words': 275}