23 |
package org.jsampler.view.fantasia; |
package org.jsampler.view.fantasia; |
24 |
|
|
25 |
import javax.swing.Icon; |
import javax.swing.Icon; |
26 |
import javax.swing.JDialog; |
import javax.swing.ImageIcon; |
|
import javax.swing.JFrame; |
|
27 |
import javax.swing.UIManager; |
import javax.swing.UIManager; |
28 |
|
|
29 |
import org.jsampler.CC; |
import org.jsampler.CC; |
32 |
import org.jsampler.view.InstrumentsDbTableView; |
import org.jsampler.view.InstrumentsDbTableView; |
33 |
import org.jsampler.view.InstrumentsDbTreeView; |
import org.jsampler.view.InstrumentsDbTreeView; |
34 |
import org.jsampler.view.BasicIconSet; |
import org.jsampler.view.BasicIconSet; |
35 |
|
import org.jsampler.view.JSMainFrame; |
36 |
import org.jsampler.view.JSViewConfig; |
import org.jsampler.view.JSViewConfig; |
37 |
|
|
38 |
import org.jvnet.substance.api.SubstanceConstants; |
import org.jvnet.substance.api.SubstanceConstants; |
71 |
} |
} |
72 |
} |
} |
73 |
|
|
74 |
|
@Override |
75 |
public JSPrefs |
public JSPrefs |
76 |
preferences() { return FantasiaPrefs.preferences(); } |
preferences() { return FantasiaPrefs.preferences(); } |
77 |
|
|
78 |
|
/** Exports the view configuration of the current session. */ |
79 |
|
@Override |
80 |
|
public String |
81 |
|
exportSessionViewConfig() { |
82 |
|
StringBuffer sb = new StringBuffer(); |
83 |
|
MainFrame frame = (MainFrame)CC.getMainFrame(); |
84 |
|
|
85 |
|
for(int i = 0; i < frame.getChannelsPaneCount(); i++) { |
86 |
|
exportSamplerChannels(sb, i); |
87 |
|
} |
88 |
|
|
89 |
|
MidiDevicesPane midi = frame.getRightSidePane().getDevicesPane().getMidiDevicesPane(); |
90 |
|
|
91 |
|
for(int i = 0; i < midi.getDevicePaneCount(); i++) { |
92 |
|
sb.append("#jsampler.fantasia: [MIDI device]\r\n"); |
93 |
|
|
94 |
|
boolean b = midi.getDevicePaneAt(i).isOptionsPaneExpanded(); |
95 |
|
sb.append("#jsampler.fantasia: expanded = ").append(b).append("\r\n"); |
96 |
|
|
97 |
|
sb.append("#\r\n"); |
98 |
|
} |
99 |
|
|
100 |
|
AudioDevicesPane au = frame.getRightSidePane().getDevicesPane().getAudioDevicesPane(); |
101 |
|
|
102 |
|
for(int i = 0; i < au.getDevicePaneCount(); i++) { |
103 |
|
sb.append("#jsampler.fantasia: [audio device]\r\n"); |
104 |
|
|
105 |
|
boolean b = au.getDevicePaneAt(i).isOptionsPaneExpanded(); |
106 |
|
sb.append("#jsampler.fantasia: expanded = ").append(b).append("\r\n"); |
107 |
|
|
108 |
|
sb.append("#\r\n"); |
109 |
|
} |
110 |
|
|
111 |
|
return sb.toString(); |
112 |
|
} |
113 |
|
|
114 |
|
private void |
115 |
|
exportSamplerChannels(StringBuffer sb, int channelsPane) { |
116 |
|
JSMainFrame frame = CC.getMainFrame(); |
117 |
|
|
118 |
|
for(int i = 0; i < frame.getChannelsPane(channelsPane).getChannelCount(); i++) { |
119 |
|
Channel c = (Channel)frame.getChannelsPane(channelsPane).getChannel(i); |
120 |
|
|
121 |
|
sb.append("#jsampler.fantasia: [channel]\r\n"); |
122 |
|
|
123 |
|
sb.append("#jsampler.fantasia: channelsPanel = "); |
124 |
|
sb.append(channelsPane + 1).append("\r\n"); |
125 |
|
|
126 |
|
switch(c.getViewTracker().getOriginalView().getType()) { |
127 |
|
case SMALL: |
128 |
|
sb.append("#jsampler.fantasia: viewType = SMALL\r\n"); |
129 |
|
break; |
130 |
|
|
131 |
|
case NORMAL: |
132 |
|
sb.append("#jsampler.fantasia: viewType = NORMAL\r\n"); |
133 |
|
break; |
134 |
|
} |
135 |
|
|
136 |
|
boolean b = c.getViewTracker().getOriginalView().isOptionsButtonSelected(); |
137 |
|
sb.append("#jsampler.fantasia: expanded = ").append(b).append("\r\n"); |
138 |
|
|
139 |
|
sb.append("#\r\n"); |
140 |
|
} |
141 |
|
} |
142 |
|
|
143 |
|
@Override |
144 |
public InstrumentsDbTreeView |
public InstrumentsDbTreeView |
145 |
getInstrumentsDbTreeView() { return instrumentsDbTreeView; } |
getInstrumentsDbTreeView() { return instrumentsDbTreeView; } |
146 |
|
|
147 |
|
@Override |
148 |
public InstrumentsDbTableView |
public InstrumentsDbTableView |
149 |
getInstrumentsDbTableView() { return instrumentsDbTableView; } |
getInstrumentsDbTableView() { return instrumentsDbTableView; } |
150 |
|
|
151 |
|
@Override |
152 |
public BasicIconSet |
public BasicIconSet |
153 |
getBasicIconSet() { return basicIconSet; } |
getBasicIconSet() { return basicIconSet; } |
154 |
|
|
155 |
private class TreeView implements InstrumentsDbTreeView { |
private class TreeView implements InstrumentsDbTreeView { |
156 |
|
@Override |
157 |
public Icon |
public Icon |
158 |
getRootIcon() { return Res.iconDb16; } |
getRootIcon() { return Res.iconDb16; } |
159 |
|
|
160 |
|
@Override |
161 |
public Icon |
public Icon |
162 |
getClosedIcon() { return Res.iconFolder16; } |
getClosedIcon() { return Res.iconFolder16; } |
163 |
|
|
164 |
|
@Override |
165 |
public Icon |
public Icon |
166 |
getOpenIcon() { return Res.iconFolderOpen16; } |
getOpenIcon() { return Res.iconFolderOpen16; } |
167 |
|
|
168 |
|
@Override |
169 |
public Icon |
public Icon |
170 |
getInstrumentIcon() { return Res.iconInstrument16; } |
getInstrumentIcon() { return Res.iconInstrument16; } |
171 |
|
|
172 |
|
@Override |
173 |
public Icon |
public Icon |
174 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
175 |
} |
} |
176 |
|
|
177 |
private static class TableView implements InstrumentsDbTableView { |
private static class TableView implements InstrumentsDbTableView { |
178 |
|
@Override |
179 |
public Icon |
public Icon |
180 |
getFolderIcon() { return Res.iconFolder16; } |
getFolderIcon() { return Res.iconFolder16; } |
181 |
|
|
182 |
|
@Override |
183 |
public Icon |
public Icon |
184 |
getInstrumentIcon() { return Res.iconInstrument16; } |
getInstrumentIcon() { return Res.iconInstrument16; } |
185 |
|
|
186 |
|
@Override |
187 |
public Icon |
public Icon |
188 |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
getGigInstrumentIcon() { return Res.iconInstrument16; } |
189 |
} |
} |
190 |
|
|
191 |
private class IconSet implements BasicIconSet { |
private class IconSet implements BasicIconSet { |
192 |
|
@Override |
193 |
|
public ImageIcon |
194 |
|
getApplicationIcon() { return Res.iconAppIcon; } |
195 |
|
|
196 |
|
@Override |
197 |
public Icon |
public Icon |
198 |
getBack16Icon() { return Res.iconBack16; } |
getBack16Icon() { return Res.iconBack16; } |
199 |
|
|
200 |
|
@Override |
201 |
public Icon |
public Icon |
202 |
getUp16Icon() { return Res.iconUp16; } |
getUp16Icon() { return Res.iconUp16; } |
203 |
|
|
204 |
|
@Override |
205 |
public Icon |
public Icon |
206 |
getForward16Icon() { return Res.iconNext16; } |
getForward16Icon() { return Res.iconNext16; } |
207 |
|
|
208 |
|
@Override |
209 |
public Icon |
public Icon |
210 |
getReload16Icon() { return Res.iconReload16; } |
getReload16Icon() { return Res.iconReload16; } |
211 |
|
|
212 |
|
@Override |
213 |
public Icon |
public Icon |
214 |
getPreferences16Icon() { return Res.iconPreferences16; } |
getPreferences16Icon() { return Res.iconPreferences16; } |
215 |
|
|
216 |
|
@Override |
217 |
|
public Icon |
218 |
|
getWarning32Icon() { return Res.iconWarning32; } |
219 |
|
|
220 |
|
@Override |
221 |
|
public Icon |
222 |
|
getQuestion32Icon() { return Res.iconQuestion32; } |
223 |
} |
} |
224 |
|
|
225 |
|
@Override |
226 |
public boolean |
public boolean |
227 |
getInstrumentsDbSupport() { return true; } |
getInstrumentsDbSupport() { return true; } |
228 |
} |
} |