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

        base.Load(data);
        speedDial.setPercent(data.speedDial);
        volumeDial.setPercent(data.ampDial);
        GetComponent <samplerLoad>().SetSample(data.label, data.file);

        volumeInput.ID  = data.jackInAmpID;
        speedInput.ID   = data.jackInSpeedID;
        controlInput.ID = data.jackInSeqID;
        output.ID       = data.jackOutID;

        playButton.startToggled = data.playToggle;
        dirSwitch.setSwitch(data.dirSwitch);
        loopSwitch.setSwitch(data.loopSwitch);
        headSlider.setPercent(data.headPos);
        tailSlider.setPercent(data.tailPos);

        turntableButton.startToggled = data.turntable;
        if (data.turntablePos != Vector3.zero)
        {
            turntableObject.transform.localPosition = data.turntablePos;
        }
        if (data.turntableRot != Quaternion.identity)
        {
            turntableObject.transform.localRotation = data.turntableRot;
        }
    }
    public override void Load(InstrumentData d)
    {
        ValveData data = d as ValveData;

        base.Load(data);

        input.ID        = data.jackInID;
        output.ID       = data.jackOutID;
        controlInput.ID = data.jackControlID;

        ampDial.setPercent(data.dialState);
        activeSwitch.setSwitch(data.switchState);
    }
    public override void Load(InstrumentData d)
    {
        OscillatorData data = d as OscillatorData;

        base.Load(data);

        freqDial.setPercent(data.freq);
        ampDial.setPercent(data.amp);
        waveSlider.setPercent(data.wave);
        lfoSwitch.setSwitch(!data.lfo);

        ID = data.ID;
        signalOutput.ID = data.jackOutID;
        ampInput.ID     = data.jackInAmpID;
        freqInput.ID    = data.jackInFreqID;
    }
    public override void Load(InstrumentData d)
    {
        SplitterData data = d as SplitterData;

        base.Load(data);

        input.ID = data.jackInID;

        setFlow(data.flowDir);
        flowSwitch.setSwitch(flow);

        if (data.jackCount < 2)
        {
            count = 1;
            Vector3 pos = stretchSlider.localPosition;
            pos.x = (count + 1) * -.04f;
            stretchSlider.localPosition = pos;
            updateSplitterCount();

            output.ID = data.jackOutAID;
            signal.nodes[0].jack.ID = data.jackOutBID;
        }
        else
        {
            count = data.jackCount - 1;
            Vector3 pos = stretchSlider.localPosition;
            pos.x = (count + 1) * -.04f;
            stretchSlider.localPosition = pos;
            updateSplitterCount();

            output.ID = data.jackOutID[0];

            for (int i = 1; i < data.jackCount; i++)
            {
                signal.nodes[i - 1].jack.ID = data.jackOutID[i];
            }
        }
    }
    public void SetTimelineData(TimelineComponentData data)
    {
        playButton.startToggled = data.playing;
        recButton.startToggled  = data.recording;
        playInput.ID            = data.playTrigID;
        recInput.ID             = data.recTrigID;

        overdub  = data.overdub;
        snapping = data.snap;
        notelock = data.notelock;
        _timelinePlayer.looping = data.loop;

        loopSwitch.setSwitch(data.loop);
        snapSwitch.setSwitch(data.snap);
        overdubSwitch.setSwitch(data.overdub);
        notelockSwitch.setSwitch(data.notelock);

        unitSlider.setVal(data.unitResolution);

        startunitres = data.unitResolution;
        startwidth   = data.gridWidth;
        startrange   = data.gridRange;
        startio      = data.head_tail;
    }
Beispiel #6
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;
            }
        }
    }