Skip to content

Commit

Permalink
Save and restore the xyloroll selected keys including highlighted sta…
Browse files Browse the repository at this point in the history
…te, issue #30
  • Loading branch information
plaidpants committed Jan 11, 2020
1 parent cbca9e2 commit f28f276
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Assets/Scripts/XyloRoll/xylorollDeviceInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ public override InstrumentData GetData() {
}
data.timelineEvents = tempevents.ToArray();

return data;
data.selectedKeys = selectedKeys;

return data;
}

public override void Load(InstrumentData d) {
Expand Down Expand Up @@ -433,7 +435,13 @@ public override void Load(InstrumentData d) {
} else {
if (data.seqInID != 0) _timeline.playInput.ID = data.seqInID;
}
selectedKeys = data.selectedKeys;

// restore the selected keys highlight states
for (int i = 0; i < selectedKeys.Count; i++)
{
keys[selectedKeys[i]].phantomHit(true);
}
}

}
Expand Down Expand Up @@ -469,4 +477,5 @@ public class XyloRollData : InstrumentData {
public TimelineComponentData timelineData;
public timelineEvent.eventData[] timelineEvents;
public float timelineHeight;
public List<int> selectedKeys = new List<int>();
}

0 comments on commit f28f276

Please sign in to comment.