import javax.swing.JOptionPane;

/* TODO list :
 *  - keyboard listener for animation player (play / pause = space, forward = semicolon, backward = comma, stop = backspace)
 *  - pattern timeline info to follow scroll horizontal ?
 *  - export / import
 *  - play on arduino button
 *  - slider update on edit / add / delete music
 *  - checkbox option to follow the tick mark when playing
 */
public class Main {
	public static void main(String[] args) throws InterruptedException {
		// FIXME interface testing in progress
		/*String serialPort = null;
		try {
			serialPort = SerialPortChooserDialog.showSerialPortChooserDialog();
		} catch (NoSerialPortException e) {
			JOptionPane.showMessageDialog(null, "No serial port available !", "Error", JOptionPane.ERROR_MESSAGE);
			System.exit(-1);
		}
		if(serialPort == null) System.exit(-1);
	
		final SerialCom serialCom = new SerialCom(serialPort);
		// arduino need time before accepting serial data
		Thread.sleep(1000);*/
		
		MusicList musicList = new MusicList(null);
		/*musicList.addMusic(
				new Music(
						new MusicPattern(new int[] {0, 10, 100, 10, 100}, 10, 1000),
						new MusicPath(MusicPath.CENTER_IN, 1000),
						1));
		musicList.addMusic(
				new Music(
						new MusicPattern(new int[] {0, 10, 100, 10, 100}, 1, 0),
						new MusicPath(MusicPath.CENTER_OUT, 1000),
						1));*/
		
		Interface i = new Interface(musicList, new Runnable() {
			@Override
			public void run() {
				//serialCom.close();
			}
		});
		i.setVisible(true);
	}
}
