Ejemplo n.º 1
0
    void Update()
    {
        playheadScrubbing = playheadHandle.curState == manipObject.manipState.grabbed;

        if (!playheadScrubbing)
        {
            updatePlayhead();
        }
        else
        {
            playheadHandle.xBounds.y = _deviceInterface._gridParams.UnittoX(_deviceInterface._gridParams.head_tail.x);
            playheadHandle.xBounds.x = _deviceInterface._gridParams.UnittoX(_deviceInterface._gridParams.head_tail.y);
            curGridPosition          = _deviceInterface._gridParams.XtoUnit(playheadHandle.transform.localPosition.x);
            timelineEventUpdate();
        }

        lock (_recordLock) {
            if (toRecord.Keys.Count > 0)
            {
                foreach (KeyValuePair <int, float> entry in toRecord)
                {
                    activeEvents[entry.Key] = _deviceInterface.SpawnTimelineEvent(entry.Key, new Vector2(entry.Value, entry.Value + .01f));
                    activeEvents[entry.Key].setRecord(true);
                    activeEvents[entry.Key].setOut(entry.Value + .01f);
                    activeEvents[entry.Key].overlapCheck();
                }

                toRecord.Clear();
            }
        }
    }
Ejemplo n.º 2
0
    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");
            }
        }
    }
Ejemplo n.º 3
0
    public void spawnEvent(manipulator m, Vector2 gridpos)
    {
        int     track = (int)_interface._gridParams.YtoUnit(gridpos.y);
        Vector2 io    = Vector2.zero;

        io.x = _interface._gridParams.XtoUnit(gridpos.x + _interface._gridParams.unitSize / (2f * _interface._gridParams.snapFraction));
        io.y = _interface._gridParams.XtoUnit(gridpos.x - _interface._gridParams.unitSize / (2f * _interface._gridParams.snapFraction));
        timelineHandle tl = _interface.SpawnTimelineEvent(track, io).GetComponentInChildren <timelineHandle>();

        tl.stretchMode = true;
        m.ForceGrab(tl);
    }
Ejemplo n.º 4
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;
            }
        }
    }