@@ -22,6 +22,7 @@ public class Song implements Cloneable {
2222 private float delay ;
2323 private CustomInstrument [] customInstruments ;
2424 private int firstCustomInstrumentIndex ;
25+ private boolean isStereo = false ;
2526
2627 /**
2728 * Create Song instance by copying other Song parameters
@@ -30,11 +31,11 @@ public class Song implements Cloneable {
3031 public Song (Song other ) {
3132 this (other .getSpeed (), other .getLayerHashMap (), other .getSongHeight (),
3233 other .getLength (), other .getTitle (), other .getAuthor (),
33- other .getDescription (), other .getPath (), other .getFirstCustomInstrumentIndex (), other .getCustomInstruments ());
34+ other .getDescription (), other .getPath (), other .getFirstCustomInstrumentIndex (), other .getCustomInstruments (), other . isStereo );
3435 }
3536
3637 /**
37- * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int)}
38+ * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, boolean )}
3839 * @param speed
3940 * @param layerHashMap
4041 * @param songHeight
@@ -44,14 +45,15 @@ public Song(Song other) {
4445 * @param description
4546 * @param path
4647 */
48+ @ Deprecated
4749 public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
4850 short songHeight , final short length , String title , String author ,
4951 String description , File path ) {
50- this (speed , layerHashMap , songHeight , length , title , author , description , path , InstrumentUtils .getCustomInstrumentFirstIndex (), new CustomInstrument [0 ]);
52+ this (speed , layerHashMap , songHeight , length , title , author , description , path , InstrumentUtils .getCustomInstrumentFirstIndex (), new CustomInstrument [0 ], false );
5153 }
5254
5355 /**
54- * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, CustomInstrument[])}
56+ * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, CustomInstrument[], boolean )}
5557 * @param speed
5658 * @param layerHashMap
5759 * @param songHeight
@@ -62,21 +64,61 @@ public Song(float speed, HashMap<Integer, Layer> layerHashMap,
6264 * @param path
6365 * @param customInstruments
6466 */
67+ @ Deprecated
6568 public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
6669 short songHeight , final short length , String title , String author ,
6770 String description , File path , CustomInstrument [] customInstruments ) {
68- this (speed , layerHashMap , songHeight , length , title , author , description , path , InstrumentUtils .getCustomInstrumentFirstIndex (), customInstruments );
71+ this (speed , layerHashMap , songHeight , length , title , author , description , path , InstrumentUtils .getCustomInstrumentFirstIndex (), customInstruments , false );
6972 }
7073
74+ /**
75+ * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, boolean)}
76+ * @param speed
77+ * @param layerHashMap
78+ * @param songHeight
79+ * @param length
80+ * @param title
81+ * @param author
82+ * @param description
83+ * @param path
84+ * @param firstCustomInstrumentIndex
85+ */
86+ @ Deprecated
7187 public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
7288 short songHeight , final short length , String title , String author ,
7389 String description , File path , int firstCustomInstrumentIndex ) {
74- this (speed , layerHashMap , songHeight , length , title , author , description , path , firstCustomInstrumentIndex , new CustomInstrument [0 ]);
90+ this (speed , layerHashMap , songHeight , length , title , author , description , path , firstCustomInstrumentIndex , new CustomInstrument [0 ], false );
91+ }
92+
93+ /**
94+ * @deprecated Use {@link #Song(float, HashMap, short, short, String, String, String, File, int, CustomInstrument[], boolean)}
95+ * @param speed
96+ * @param layerHashMap
97+ * @param songHeight
98+ * @param length
99+ * @param title
100+ * @param author
101+ * @param description
102+ * @param path
103+ * @param firstCustomInstrumentIndex
104+ * @param customInstruments
105+ */
106+ @ Deprecated
107+ public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
108+ short songHeight , final short length , String title , String author ,
109+ String description , File path , int firstCustomInstrumentIndex , CustomInstrument [] customInstruments ) {
110+ this (speed , layerHashMap , songHeight , length , title , author , description , path , firstCustomInstrumentIndex , customInstruments , false );
111+ }
112+
113+ public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
114+ short songHeight , final short length , String title , String author ,
115+ String description , File path , int firstCustomInstrumentIndex , boolean isStereo ) {
116+ this (speed , layerHashMap , songHeight , length , title , author , description , path , firstCustomInstrumentIndex , new CustomInstrument [0 ], isStereo );
75117 }
76118
77119 public Song (float speed , HashMap <Integer , Layer > layerHashMap ,
78120 short songHeight , final short length , String title , String author ,
79- String description , File path , int firstCustomInstrumentIndex , CustomInstrument [] customInstruments ) {
121+ String description , File path , int firstCustomInstrumentIndex , CustomInstrument [] customInstruments , boolean isStereo ) {
80122 this .speed = speed ;
81123 delay = 20 / speed ;
82124 this .layerHashMap = layerHashMap ;
@@ -88,6 +130,7 @@ public Song(float speed, HashMap<Integer, Layer> layerHashMap,
88130 this .path = path ;
89131 this .firstCustomInstrumentIndex = firstCustomInstrumentIndex ;
90132 this .customInstruments = customInstruments ;
133+ this .isStereo = isStereo ;
91134 }
92135
93136 /**
@@ -179,4 +222,12 @@ public Song clone() {
179222 public int getFirstCustomInstrumentIndex () {
180223 return firstCustomInstrumentIndex ;
181224 }
225+
226+ /**
227+ * Returns true if song has at least one stereo {@link Note} or {@link Layer} in nbs file
228+ * @return
229+ */
230+ public boolean isStereo () {
231+ return isStereo ;
232+ }
182233}
0 commit comments