public override void Load(InstrumentData d)
    {
        TimelineData data = d as TimelineData;

        base.Load(data);

        _timeline.SetTimelineData(data.timelineData);

        Vector3 pos = trackHandle.localPosition;

        pos.y = data.handleHeight;
        trackHandle.localPosition = pos;


        for (int i = 0; i < data.timelineEvents.Length; i++)
        {
            _timeline.SpawnTimelineEvent(data.timelineEvents[i].track, data.timelineEvents[i].in_out);
        }

        Update();
        for (int i = 0; i < data.tracks.Length; i++)
        {
            if (i < _trackInterfaces.Count)
            {
                _trackInterfaces[i].Load(data.tracks[i]);
            }
            else
            {
                Debug.Log("ERROR");
            }
        }
    }
Exemplo n.º 2
0
    public override void Load(InstrumentData d)
    {
        XyloRollData data = d as XyloRollData;

        base.Load(data);

        for (int i = 0; i < 3; i++)
        {
            _adsrInterface.xyHandles[i].setPercent(data.ADSRdata[i]);
        }
        _adsrInterface.setDefaults = false;

        octaveSlider.setVal(data.octaveSetting);

        seqEnableButton.startToggled = data.seqon;
        arpEnableButton.startToggled = data.arpon;

        arpPatternSlider.switchVal = data.arpSetting;
        arpSpeedSlider.switchVal   = data.arpSpeed;

        inputSwitch.setSwitch(data.inputSetting == 1);

        sampleBank.GetComponent <samplerLoad>().QueueSample(data.inputSample[0], data.inputSample[1]);

        oscBank.GetComponent <oscillatorBankComponentInterface>().setValues(data.oscAamp, data.oscAfreq, data.oscAwave, data.oscBamp, data.oscBfreq, data.oscBwave);

        if (data.midiInConnection != null && data.midiInConnection != "")
        {
            midiInButton.startToggled = true;
            _midiIn.ConnectByName(data.midiInConnection);
        }
        if (data.midiOutConnection != null && data.midiOutConnection != "")
        {
            midiOutButton.startToggled = true;
            _midiOut.ConnectByName(data.midiOutConnection);
        }

        output.ID = data.jackOutID;

        if (data.timelinePresent)
        {
            _timeline.SetTimelineData(data.timelineData);

            Vector3 pos = _timeline.heightHandle.transform.localPosition;
            pos.y = data.timelineHeight;
            _timeline.heightHandle.transform.localPosition = pos;
            _timeline.setStartHeight(data.timelineHeight);

            for (int i = 0; i < data.timelineEvents.Length; i++)
            {
                _timeline.SpawnTimelineEvent(data.timelineEvents[i].track, data.timelineEvents[i].in_out);
            }
        }
        else
        {
            if (data.seqInID != 0)
            {
                _timeline.playInput.ID = data.seqInID;
            }
        }
    }