Commit f388b4bb authored by Abdu Mohamdy's avatar Abdu Mohamdy
Browse files

prompt on file save/load

parent 4627a4f8
......@@ -351,7 +351,7 @@ class ChannelMixerWindow extends UIWindow {
}
}
class ClipPlayingWindow extends UIWindow {
public class ClipPlayingWindow extends UIWindow {
private final String FILENAME = "flight-set.json";
private final String[] labels = new String[] { "-", "-", "-", "-" };
private final FlightEngine flightEngine;
......@@ -432,7 +432,7 @@ class ClipPlayingWindow extends UIWindow {
String filename = filenameBox.getValue();
// String fileName = labels[automationSlot.getValuei()].equals("-") ? "set.json" : labels[automationSlot.getValuei()];
flightEngine.savePlaylist(filename);
// selectOutput("Save Set", "saveSet", new File(dataPath(fileName)), UILoopRecorder.this);
selectOutput("Save Set", "saveSet", new File(dataPath("")), ClipPlayingWindow.this);
}
}
}
......@@ -443,8 +443,7 @@ class ClipPlayingWindow extends UIWindow {
new UIButton(this.width - (this.width-12)/2 - 4, yPos, (this.width-12)/2, 20) {
protected void onToggle(boolean active) {
if (active) {
String filename = filenameBox.getValue();
flightEngine.loadPlaylist(filename);
selectInput("Select a file", "loadPlaylist", new File(dataPath("")), ClipPlayingWindow.this);
}
}
}
......@@ -470,6 +469,7 @@ class ClipPlayingWindow extends UIWindow {
public void saveSet(File file) {
if (file != null) {
flightEngine.savePlaylist(file);
// saveBytes(file.getPath(), automation[automationSlot.getValuei()].toJson().toString().getBytes());
// slotLabel.setLabel(labels[automationSlot.getValuei()] = file.getName());
}
......@@ -483,6 +483,15 @@ class ClipPlayingWindow extends UIWindow {
// slotLabel.setLabel(labels[automationSlot.getValuei()] = file.getName());
}
}
public void loadPlaylist(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
flightEngine.loadPlaylist(selection);
filenameBox.setValue(selection.getName(), true);
}
}
}
/**
......@@ -680,4 +689,3 @@ class PatternControlWindow extends UIWindow {
}
}
}
This diff is collapsed.
[
{
"id": 295,
"class": "heronarts.lx.clip.LXMasterClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": []
},
{
"id": 91,
"class": "heronarts.lx.clip.LXChannelClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": [
{
"laneType": "pattern",
"events": [
{
"cursor": 0.0,
"patternIndex": 0,
"patternLabel": "ColorSweep"
}
]
},
{
"laneType": "midiNote",
"events": []
},
{
"laneType": "parameter",
"events": [
{
"cursor": 5602.0,
"normalized": 0.28535353557931054
},
{
"cursor": 5695.0,
"normalized": 0.2929292933808433
},
{
"cursor": 5759.0,
"normalized": 0.300505051182376
},
{
"cursor": 5759.0,
"normalized": 0.30808080898390877
},
{
"cursor": 5759.0,
"normalized": 0.3156565667854415
},
{
"cursor": 5792.0,
"normalized": 0.32323232458697426
},
{
"cursor": 5792.0,
"normalized": 0.3459595979915725
},
{
"cursor": 5825.0,
"normalized": 0.36868687139617073
},
{
"cursor": 5825.0,
"normalized": 0.3838383869992362
},
{
"cursor": 5856.0,
"normalized": 0.4141414182053672
},
{
"cursor": 5856.0,
"normalized": 0.4595959650145637
},
{
"cursor": 5856.0,
"normalized": 0.48989899622069466
},
{
"cursor": 5856.0,
"normalized": 0.5505050586329566
},
{
"cursor": 5887.0,
"normalized": 0.5808080898390876
},
{
"cursor": 5887.0,
"normalized": 0.5883838476406203
},
{
"cursor": 5921.0,
"normalized": 0.6338383944498168
},
{
"cursor": 5921.0,
"normalized": 0.6565656678544151
},
{
"cursor": 5954.0,
"normalized": 0.717171730266677
},
{
"cursor": 5954.0,
"normalized": 0.7626262770758735
},
{
"cursor": 5954.0,
"normalized": 0.8005050660835372
},
{
"cursor": 5984.0,
"normalized": 0.8459596128927337
},
{
"cursor": 5984.0,
"normalized": 0.8989899175034629
},
{
"cursor": 5984.0,
"normalized": 0.9444444643126594
},
{
"cursor": 6018.0,
"normalized": 0.9747474955187904
},
{
"cursor": 6047.0,
"normalized": 1.0
},
{
"cursor": 7394.0,
"normalized": 0.8257575780153275
},
{
"cursor": 7394.0,
"normalized": 0.7121212109923363
},
{
"cursor": 7425.0,
"normalized": 0.6666666641831398
},
{
"cursor": 7425.0,
"normalized": 0.5833333283662796
},
{
"cursor": 7425.0,
"normalized": 0.5151515081524849
},
{
"cursor": 7455.0,
"normalized": 0.4469696879386902
},
{
"cursor": 7455.0,
"normalized": 0.4166666567325592
},
{
"cursor": 7488.0,
"normalized": 0.40909089893102646
},
{
"cursor": 7713.0,
"normalized": 0.4015151411294937
},
{
"cursor": 7713.0,
"normalized": 0.39393938332796097
},
{
"cursor": 7744.0,
"normalized": 0.3787878677248955
},
{
"cursor": 7744.0,
"normalized": 0.36363635212183
},
{
"cursor": 7778.0,
"normalized": 0.35606059432029724
},
{
"cursor": 7811.0,
"normalized": 0.3484848365187645
},
{
"cursor": 7872.0,
"normalized": 0.34090907871723175
},
{
"cursor": 7903.0,
"normalized": 0.333333320915699
},
{
"cursor": 7935.0,
"normalized": 0.32575756311416626
},
{
"cursor": 7935.0,
"normalized": 0.3181818053126335
}
],
"path": "/pattern/ColorSweep/ColorSweep_HUE",
"componentId": 63,
"parameterPath": "ColorSweep_HUE"
},
{
"laneType": "parameter",
"events": [
{
"cursor": 10882.0,
"normalized": 0.05757575780153275
},
{
"cursor": 10913.0,
"normalized": 0.0651515156030655
},
{
"cursor": 10913.0,
"normalized": 0.07272727340459824
},
{
"cursor": 10946.0,
"normalized": 0.08030303120613098
},
{
"cursor": 10976.0,
"normalized": 0.08787878900766373
},
{
"cursor": 11039.0,
"normalized": 0.09545454680919647
},
{
"cursor": 11039.0,
"normalized": 0.10303030461072922
},
{
"cursor": 11039.0,
"normalized": 0.11060606241226197
},
{
"cursor": 11073.0,
"normalized": 0.11818182021379471
},
{
"cursor": 11073.0,
"normalized": 0.12575757801532744
},
{
"cursor": 11073.0,
"normalized": 0.14090909361839293
},
{
"cursor": 11105.0,
"normalized": 0.15606060922145842
},
{
"cursor": 11105.0,
"normalized": 0.17121212482452391
},
{
"cursor": 11137.0,
"normalized": 0.1863636404275894
},
{
"cursor": 11137.0,
"normalized": 0.19393939822912215
},
{
"cursor": 11167.0,
"normalized": 0.20909091383218764
},
{
"cursor": 11201.0,
"normalized": 0.26212121844291686
},
{
"cursor": 11201.0,
"normalized": 0.27727273404598235
},
{
"cursor": 11201.0,
"normalized": 0.2848484918475151
},
{
"cursor": 11232.0,
"normalized": 0.33030303865671157
},
{
"cursor": 11232.0,
"normalized": 0.3681818276643753
},
{
"cursor": 11266.0,
"normalized": 0.37575758546590804
},
{
"cursor": 11266.0,
"normalized": 0.41363637447357177
},
{
"cursor": 11266.0,
"normalized": 0.42878789007663726
},
{
"cursor": 11298.0,
"normalized": 0.44393940567970275
},
{
"cursor": 11328.0,
"normalized": 0.45909092128276824
},
{
"cursor": 11328.0,
"normalized": 0.466666679084301
},
{
"cursor": 11328.0,
"normalized": 0.47424243688583373
},
{
"cursor": 11362.0,
"normalized": 0.4818181946873665
},
{
"cursor": 11362.0,
"normalized": 0.4893939524888992
},
{
"cursor": 11425.0,
"normalized": 0.49696971029043197
},
{
"cursor": 11457.0,
"normalized": 0.5045454680919648
},
{
"cursor": 11457.0,
"normalized": 0.5121212258934975
},
{
"cursor": 11489.0,
"normalized": 0.5196969836950303
},
{
"cursor": 11519.0,
"normalized": 0.5348484992980957
},
{
"cursor": 11552.0,
"normalized": 0.5424242570996285
},
{
"cursor": 11585.0,
"normalized": 0.5500000149011612
},
{
"cursor": 11617.0,
"normalized": 0.5651515305042267
},
{
"cursor": 11617.0,
"normalized": 0.5727272883057595
},
{
"cursor": 11617.0,
"normalized": 0.5803030461072922
},
{
"cursor": 11617.0,
"normalized": 0.587878803908825
},
{
"cursor": 11650.0,
"normalized": 0.5954545617103577
},
{
"cursor": 11713.0,
"normalized": 0.6030303195118905
},
{
"cursor": 11745.0,
"normalized": 0.6106060773134232
},
{
"cursor": 11778.0,
"normalized": 0.618181835114956
},
{
"cursor": 11809.0,
"normalized": 0.6257575929164887
},
{
"cursor": 11841.0,
"normalized": 0.6333333507180214
},
{
"cursor": 11873.0,
"normalized": 0.6409091085195542
}
],
"path": "/pattern/ColorSweep/ColorSweep_RANGE",
"componentId": 63,
"parameterPath": "ColorSweep_RANGE"
}
]
},
{
"id": 120,
"class": "heronarts.lx.clip.LXChannelClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": [
{
"laneType": "pattern",
"events": [
{
"cursor": 0.0,
"patternIndex": 0,
"patternLabel": "ColorSweep"
}
]
},
{
"laneType": "midiNote",
"events": []
}
]
},
{
"id": 149,
"class": "heronarts.lx.clip.LXChannelClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": [
{
"laneType": "pattern",
"events": [
{
"cursor": 0.0,
"patternIndex": 0,
"patternLabel": "ColorSweep"
}
]
},
{
"laneType": "midiNote",
"events": []
}
]
},
{
"id": 178,
"class": "heronarts.lx.clip.LXChannelClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": [
{
"laneType": "pattern",
"events": [
{
"cursor": 0.0,
"patternIndex": 0,
"patternLabel": "ColorSweep"
}
]
},
{
"laneType": "midiNote",
"events": []
}
]
},
{
"id": 207,
"class": "heronarts.lx.clip.LXChannelClip",
"internal": {
"modulationColor": 0
},
"parameters": {
"label": "Clip-1",
"running": true,
"trigger": false,
"length": 13663.0,
"loop": false
},
"children": {},
"index": 0,
"parameterLanes": [
{
"laneType": "pattern",
"events": [
{
"cursor": 0.0,
"patternIndex": 0,
"patternLabel": "ColorSweep"
}
]
},
{
"laneType": "midiNote",
"events": []
}
]
},
{