Blame view

VRGNYMusicLights/Sources/ApplicationJava/Main.java 1.48 KB
a89c030d   pfrison   VRGNYMusicLights ...
1
  import javax.swing.JOptionPane;
742429d1   pfrison   VRGNYMusicLight b...
2
3
4
  
  /* TODO list :
   *  - keyboard listener for animation player (play / pause = space, forward = semicolon, backward = comma, stop = backspace)
278cdee0   pfrison   VRGNYMusicLights ...
5
   *  - pattern timeline info to follow scroll horizontal ?
d175ba55   pfrison   VRGNYMusicLight a...
6
7
8
9
   *  - export / import
   *  - play on arduino button
   *  - slider update on edit / add / delete music
   *  - checkbox option to follow the tick mark when playing
742429d1   pfrison   VRGNYMusicLight b...
10
11
12
   */
  public class Main {
  	public static void main(String[] args) throws InterruptedException {
a89c030d   pfrison   VRGNYMusicLights ...
13
14
  		// FIXME interface testing in progress
  		/*String serialPort = null;
742429d1   pfrison   VRGNYMusicLight b...
15
16
17
18
19
20
21
22
23
24
25
26
  		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);*/
  		
a89c030d   pfrison   VRGNYMusicLights ...
27
  		MusicList musicList = new MusicList(null);
d175ba55   pfrison   VRGNYMusicLight a...
28
  		/*musicList.addMusic(
a89c030d   pfrison   VRGNYMusicLights ...
29
  				new Music(
d175ba55   pfrison   VRGNYMusicLight a...
30
31
  						new MusicPattern(new int[] {0, 10, 100, 10, 100}, 10, 1000),
  						new MusicPath(MusicPath.CENTER_IN, 1000),
278cdee0   pfrison   VRGNYMusicLights ...
32
33
34
35
36
  						1));
  		musicList.addMusic(
  				new Music(
  						new MusicPattern(new int[] {0, 10, 100, 10, 100}, 1, 0),
  						new MusicPath(MusicPath.CENTER_OUT, 1000),
d175ba55   pfrison   VRGNYMusicLight a...
37
  						1));*/
a89c030d   pfrison   VRGNYMusicLights ...
38
39
  		
  		Interface i = new Interface(musicList, new Runnable() {
742429d1   pfrison   VRGNYMusicLight b...
40
41
42
43
44
45
46
47
  			@Override
  			public void run() {
  				//serialCom.close();
  			}
  		});
  		i.setVisible(true);
  	}
  }