Exemplo n.º 1
0
    public override void Load(InstrumentData d)
    {
        MixerData data = d as MixerData;

        base.Load(data);
        output.GetComponent <omniJack>().ID = data.jackOutID;

        count = data.sliders.Length;
        Vector3 pos = stretchSlider.localPosition;

        pos.x = (count - 1) * -.04f - .076f;
        stretchSlider.localPosition = pos;
        updateMixerCount();

        pos   = lengthSlider.localPosition;
        pos.x = data.height;
        lengthSlider.localPosition = pos;

        for (int i = 0; i < count; i++)
        {
            signal.incoming[i].GetComponent <fader>().fadeSlider.setPercent(data.sliders[i]);
            signal.incoming[i].GetComponent <fader>().inputA.ID = data.jackInID[2 * i];
            signal.incoming[i].GetComponent <fader>().inputB.ID = data.jackInID[2 * i + 1];
        }
    }
Exemplo n.º 2
0
    void StartDraggingSceneObject()
    {
        RenderTexture  rt   = null;
        InstrumentData data = null;

        if (instrumentDragged == null)
        {
            return;
        }

        timeStartedDragging = Time.time;
        foreach (UIButton uiButton in uiButtons.buttons)
        {
            if (uiButton.data.id == instrumentDragged.data.id && uiButton.data.type == instrumentDragged.data.type)
            {
                rt   = (RenderTexture)uiButton.image.texture;
                data = uiButton.data;
            }
        }
        if (data != null)
        {
            OnStartDragging(data, rt);
            Events.OnRemoveInstrument(instrumentDragged);
        }
    }
Exemplo n.º 3
0
    public override void Load(InstrumentData d)
    {
        MaracaData data = d as MaracaData;

        base.Load(data);
        jackOut.ID = data.jackOutID;
    }
Exemplo n.º 4
0
    public override void Load(InstrumentData d)
    {
        TouchPadData data = d as TouchPadData;

        base.Load(data);
        output.ID = data.jackOutID;
    }
        private void OnListViewInstrumentsItemChecked(object sender, ItemCheckedEventArgs e)
        {
            if (m_ListViewInstruments.CheckedItems.Count > m_RequiredMaxInstruments)
            {
                e.Item.Checked = false;
                //                                                      The maximum number of shared instruments is {0}.
                string text = string.Format(CultureInfo.CurrentCulture, Resources.MaximumNumberOfSharedInstruments, m_RequiredMaxInstruments);
                MessageBox.Show(text, Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            long selectedInstrumentsMap = 0;

            foreach (ListViewItem item in m_ListViewInstruments.CheckedItems)
            {
                InstrumentData instrument = item.Tag as InstrumentData;
                if (instrument == null)
                {
                    throw new InvalidOperationException("ListViewItem item.Tag type " + (item.Tag == null ? "Null" : item.Tag.GetType().FullName) + " is not " + typeof(InstrumentData).FullName);
                }

                selectedInstrumentsMap |= instrument.BitMap;
            }
            m_InstrumentsMap = selectedInstrumentsMap;
        }
Exemplo n.º 6
0
    public override void Load(InstrumentData d)
    {
        MIDIoutData data = d as MIDIoutData;

        base.Load(data);

        if (data.connection != "")
        {
            _midiComponentInterface.ConnectByName(data.connection);
        }

        Vector3 pos;

        pos   = CChandle.transform.localPosition;
        pos.y = data.CChandle;
        CChandle.transform.localPosition = pos;

        pos   = notehandle.transform.localPosition;
        pos.y = data.notehandle;
        notehandle.transform.localPosition = pos;

        CCupdate();
        NoteUpdate();

        for (int i = 0; i < CClist.Count; i++)
        {
            CClist[i].input.ID = data.CCjacks[i];
        }
        for (int i = 0; i < Notelist.Count; i++)
        {
            Notelist[i].input.ID = data.NOTEjacks[i];
        }
    }
Exemplo n.º 7
0
        } /* PaintCurrentRow */

        private void  DrawTimeChart()
        {
            DrawAxisLabelsTime();

            int numHistRecs = 0;

            lock (history)
            {
                numHistRecs = history.Count;
            }

            int x;

            for (x = 0; x < numHistRecs; x++)
            {
                InstrumentData dataRow = (InstrumentData)(history[x]);
                DateTime       t       = dataRow.Time;
                if (t.CompareTo(timeTop) > 0)
                {
                    continue;
                }

                if (t.CompareTo(timeBot) < 0)
                {
                    continue;
                }

                int row = CalcRowForTime(t);
                PlotOneDataRow(dataRow, row);
            }
        } /* DrawTimeChart */
Exemplo n.º 8
0
    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;
        }
    }
Exemplo n.º 9
0
 public void GetTransformData(InstrumentData data)
 {
     data.position = transform.position;
     data.rotation = transform.rotation;
     data.scale    = transform.localScale;
     data.ID       = transform.GetInstanceID();
 }
        private void OkButton_OnClick(object sender, RoutedEventArgs e)
        {
            switch (SelectedItem.Text)
            {
            case "SineWave":
                _instrumentData.InstrumentFunction = new SineWave();
                break;

            case "SquareWave":
                _instrumentData.InstrumentFunction = new SquareWave();
                break;

            case "TriangleWave":
                _instrumentData.InstrumentFunction = new TriangleWave();
                break;

            case "SawtoothWave":
                _instrumentData.InstrumentFunction = new SawtoothWave();
                break;

            default:
                _instrumentData = null;
                break;
            }

            _instrumentData.InstrumentName = InstrumentName.Text;

            Close();
        }
Exemplo n.º 11
0
        private void OpenFileComplete(PlayerData playerData, string filename, bool success)
        {
            m_loadingForm.Close();
            if (false == success)
            {
                MessageBox.Show("Failed to load the file", "Load file error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.Text = String.Format("{0} - {1}", APP_NAME, filename);

            m_editorForm.Title = filename;

            m_playerData = playerData;

            this.m_audioPlayer.StopAllSounds();
            m_player.LoadPlayerData(playerData);

            m_audioList.List.DataSource = playerData.Instruments;

#if ENABLE_EVENT_FORM
            _eventsForm.SetPlayerData(playerData);
#endif

            for (int i = 0, l = playerData.Instruments.Count; i < l; i++)
            {
                InstrumentData instrument = playerData.Instruments[i];
            }

            m_editorForm.Editor.Initialize(m_playerData);
        }
Exemplo n.º 12
0
        private void  BuildDataFieldList()
        {
            int origWindowHeight        = this.Height;
            int origDataFieldListHeight = DataFieldList.Height;

            int origWindowWidth        = this.Width;
            int origDataFieldListWidth = DataFieldList.Width;

            int numFields = InstrumentData.NumOfFields();

            if (!includeNonDataFields)
            {
                numFields = InstrumentData.NumDataFields();
            }

            int fieldNum = 0;

            for (fieldNum = 0; fieldNum < numFields; fieldNum++)
            {
                DataFieldList.Items.Add(InstrumentData.FieldName(fieldNum));
            }
            DataFieldList.SelectedItem = selectedDataField;

            int totalHeightNeeded = InstrumentData.NumOfFields() * DataFieldList.ItemHeight + 30;

            DataFieldList.Height = totalHeightNeeded;

            int newWindowHeight = DataFieldList.Height + (origWindowHeight - origDataFieldListHeight);
            int newWindowWidth  = DataFieldList.Width + (origWindowWidth - origDataFieldListWidth);

            this.Height = newWindowHeight;
            this.Width  = newWindowWidth;
        }
Exemplo n.º 13
0
        } /* DrawTimeChart */

        private void  DrawDepthChart()
        {
            DrawAxisLabelsDepth();

            int historyNumOfRows = 0;

            lock (history)
            {
                historyNumOfRows = history.Count;
            }
            int y;

            for (y = 0; y < historyNumOfRows; y++)
            {
                InstrumentData dataRow = (InstrumentData)(history[y]);
                float          depth   = dataRow.Depth();
                if (depth < depthTop)
                {
                    continue;
                }

                if (depth > depthBot)
                {
                    continue;
                }

                int row = CalcRowForDepth(depth);
                PlotOneDataRow(dataRow, row);
            }
        }
Exemplo n.º 14
0
    void OnInstrumentActive(InstrumentData data, int laneID)
    {
        float delayDouble = 0.8f;
        float delaySingle = 0.5f;
        float delay       = 0;

        switch (laneID)
        {
        case 1:
            delay = delaySingle;
            break;

        case 2:
            delay = delaySingle;
            break;

        case 3:
            delay = delaySingle;
            break;

        case 4:
            delay = delayDouble;
            break;
        }
        StartCoroutine(OnInstrumentActiveDelayed(laneID, delay));
    }
Exemplo n.º 15
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");
            }
        }
    }
Exemplo n.º 16
0
        public Demo(IDriverEx driver, IDDK ddk, Config.Demo config, string id, InstrumentDataList instrumentDataList, string driverFolder)
            : base(driver, ddk, config, typeof(Demo).Name, id)
        {
            Log.TaskBegin(Id);
            try
            {
                if (string.IsNullOrEmpty(driverFolder))
                {
                    throw new ArgumentNullException("driverFolder");
                }
                if (instrumentDataList == null)
                {
                    throw new ArgumentNullException("instrumentDataList");
                }

                m_Properties = new DemoProperties(driver, m_DDK, config, m_Device);

                //-------------------------------------------------------------------------------------------------------------------
                if (m_DDK.InstrumentMap == null)
                {
                    throw new InvalidOperationException("DDK.InstrumentMap is Null");
                }
                long instrumentsMap = m_DDK.InstrumentMap.Value;
                if (instrumentsMap == (long)InstrumentID.None)
                {
                    throw new InvalidOperationException("DDK.InstrumentMap = " + instrumentsMap.ToString() + " must be != " + ((long)InstrumentID.None).ToString());
                }
                string instrumentsMapBinary = InstrumentData.GetBitMapBinary(instrumentsMap);
                string instrumentsNames     = instrumentDataList.GetNames();

                bool   logInFile      = LogInFile;
                string fileNamePrefix = instrumentDataList[0].Name;
                Log.Init(Id, logInFile, fileNamePrefix);

                // Logging in a file starts here, if logInFile is True
                const string indent = "\t";
                string       text   = Environment.NewLine + Environment.NewLine +
                                      indent + "Driver Folder \"" + driverFolder + "\"" + Environment.NewLine +
                                      indent + "Name        \"" + Name + "\", IsSimulated = " + IsSimulated.ToString() + Environment.NewLine +
                                      indent + "USB Address \"" + UsbAddress + "\"" + Environment.NewLine +
                                      indent + "DDK.InstrumentMap = " + instrumentsMap.ToString() + " = " + instrumentsMapBinary + " = " + instrumentsNames +
                                      Environment.NewLine;
                Log.WriteLine(Id, text);

                //-------------------------------------------------------------------------------------------------------------------
                m_Properties.LogInFile.OnSetProperty += OnPropertyLogInFileSet;

                //-------------------------------------------------------------------------------------------------------------------
                CommandTestInit();
                CommandStartStopInit();

                Log.TaskEnd(Id);
            }
            catch (Exception ex)
            {
                Log.TaskEnd(Id, ex);
                throw;
            }
        }
Exemplo n.º 17
0
    public override void Load(InstrumentData d)
    {
        MicrophoneData data = d as MicrophoneData;

        base.Load(data);
        output.ID = data.jackOutID;
        ampDial.setPercent(data.amp);
    }
Exemplo n.º 18
0
    public override void Load(InstrumentData d)
    {
        TapeGroupData data = d as TapeGroupData;

        base.Load(data);

        Setup(data.samplegroup);
    }
Exemplo n.º 19
0
    public override InstrumentData GetData()
    {
        InstrumentData data = new InstrumentData();

        data.deviceType = menuItem.deviceType.Tapes;
        GetTransformData(data);
        return(data);
    }
Exemplo n.º 20
0
 private void OnPriceReceived(object sender, InstrumentData instrumentData)
 {
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
     {
         _instrumentMap[instrumentData.Ticker].CurrentPrice = instrumentData.CurrentPrice;
         _instrumentMap[instrumentData.Ticker].Exchange     = instrumentData.SourceName;
         _instrumentMap[instrumentData.Ticker].TimeStamp    = instrumentData.TimeStamp;
     }));
 }
Exemplo n.º 21
0
    public void RemoveInstrument(InstrumentData data, int laneID, int slotID)
    {
        int sequence = 0;

        foreach (Lane lane in Board.Instance.lanesManager.GetLanes(laneID))
        {
            AddInstrumentToSlotReal(data, lane, slotID);
        }
    }
Exemplo n.º 22
0
    public override void Load(InstrumentData d)
    {
        PanoData data = d as PanoData;

        base.Load(data);
        imageLoad.instance.addPano(this);
        loadImage(data.filename);
        showButton.startToggled = data.active;
    }
Exemplo n.º 23
0
    public override void Load(InstrumentData d)
    {
        NoiseData data = d as NoiseData;

        base.Load(data);
        ID        = data.ID;
        output.ID = data.jackOutID;
        speedDial.setPercent(data.dialState);
    }
Exemplo n.º 24
0
        } /* DrawAxisLabelsTime */

        private void PlotOneDataRow(InstrumentData r,
                                    int row
                                    )
        {
            int seriesIdx;

            //g.FillRectangle (new SolidBrush (chartPanel.BackColor), 1, row, chartWidth - 2, this.chartRowWidth);

            float[] data = r.Data();

            for (seriesIdx = 0; seriesIdx < maxNumDataSets; seriesIdx++)
            {
                if (!seriesToPlot[seriesIdx])
                {
                    continue;
                }

                int dataIdx = fieldIdxs[plottingAxisIdx, seriesIdx];

                int   col = chartFirstCol;
                float d   = data[dataIdx];

                if (d == float.NaN)
                {
                    col = chartLastCol;
                }

                else if (d < minValues[dataIdx])
                {
                    col = chartFirstCol;
                }

                else if (d > maxValues[dataIdx])
                {
                    col = chartLastCol;
                }

                else
                {
                    col = chartFirstCol + (int)((d - minValues[dataIdx]) * colFactors[dataIdx] + 0.5f);
                }

                if (col < chartFirstCol)
                {
                    col = chartFirstCol;
                }

                else if (col > chartLastCol)
                {
                    col = chartLastCol;
                }

                plotDC.FillRectangle(seriesBrushes[seriesIdx], col, row, chartColWidth, chartRowWidth);
                plotBufferDC.FillRectangle(seriesBrushes[seriesIdx], col, row, chartColWidth, chartRowWidth);
            }
        } /* PlotOneDataRow */
        public RemoveInstrumentEventAction(PlayerData playerData, InstrumentData instrumentData)
        {
            if (playerData == null || instrumentData == null)
            {
                Cancel = true;
            }

            m_playerData     = playerData;
            m_instrumentData = instrumentData;
        }
Exemplo n.º 26
0
    // Update is called once per frame
    public void UpgradeInstrumento(int index)
    {
        InstrumentData data = instruments[index];

        if (currentMoney > data.cost[data.level + 1] && data.level < data.cost.Length)
        {
            data.level++;
            XMLManager.Serializar(instruments, "artistas");
        }
    }
Exemplo n.º 27
0
    public override void Load(InstrumentData d)
    {
        LooperData data = d as LooperData;

        base.Load(data);
        input.ID         = data.jackInID;
        output.ID        = data.jackOutID;
        recordTrigger.ID = data.recordTriggerID;
        playTrigger.ID   = data.playTriggerID;
        durSlider.setVal(data.dur);
    }
Exemplo n.º 28
0
        public RenameInstrumentEventAction(InstrumentData instrumentData, string newInstrumentName)
        {
            if (instrumentData == null)
            {
                Cancel = true;
            }

            m_instrumentData    = instrumentData;
            m_oldInstrumentName = instrumentData.Name;
            m_newInstrumentName = newInstrumentName;
        }
Exemplo n.º 29
0
    public override void Load(InstrumentData d)
    {
        DrumData data = d as DrumData;

        base.Load(data);

        ID         = data.ID;
        sampOut.ID = data.jackOutSampID;
        sigOut.ID  = data.jackOutSigID;
        samp.SetSample(data.tapeLabel, data.tapeFile);
    }
Exemplo n.º 30
0
        public SetSoundAction(EventData eventData, InstrumentData instrumentData)
        {
            if (null == eventData || null == instrumentData)
            {
                Cancel = true;
            }

            m_eventData              = eventData;
            m_nextInstrumentData     = instrumentData;
            m_previousInstrumentData = m_eventData.Instrument;
        }
        public DerivedInstrumentWindow(EditMode editMode, VmInstrument vmInstrument = null)
        {
            InitializeComponent();
            this._EditMode = editMode;
            this._vmInstrument = vmInstrument;
            this._InstrumentData = new InstrumentData();
            if (editMode == EditMode.AddNew)
            {
                this._InstrumentData.Instrument = new Instrument() { IsDerivative = true };
                this._InstrumentData.DerivativeRelation = new DerivativeRelation()
                {
                    AskOperand1Type = OperandType.Ask,
                    AskOperand2Type = OperandType.Ask,
                    AskOperator1Type = OperatorType.Multiply,
                    AskOperator2Type = OperatorType.Multiply,
                    AskOperand3 = 1,
                    BidOperand1Type = OperandType.Bid,
                    BidOperand2Type = OperandType.Bid,
                    BidOperator1Type = OperatorType.Multiply,
                    BidOperator2Type = OperatorType.Multiply,
                    BidOperand3 = 1,
                    LastOperand1Type = OperandType.Last,
                    LastOperand2Type = OperandType.Last,
                    LastOperator1Type = OperatorType.Multiply,
                    LastOperator2Type = OperatorType.Multiply,
                    LastOperand3 = 1,
                    UnderlyingInstrument1IdInverted = false,
                    UnderlyingInstrument2Id = null
                };
                if(VmQuotationManager.Instance.Instruments.Count>0)
                {
                    this._InstrumentData.DerivativeRelation.UnderlyingInstrument1Id = VmQuotationManager.Instance.Instruments[0].Id;
                }
            }
            else
            {
                this._InstrumentData.Instrument = vmInstrument.Instrument.Clone();
                this._InstrumentData.DerivativeRelation = vmInstrument.VmDerivativeRelation.DerivativeRelation.Clone();
            }

            this.DataContext = this._InstrumentData;
            this._HintMessage = new HintMessage(this.HintTextBlock);
        }
        public InstrumentWindow(EditMode editMode, VmInstrument vmInstrument =  null)
        {
            InitializeComponent();
            this._EditMode = editMode;
            this._vmInstrument = vmInstrument;
            this._InstrumentData = new InstrumentData();
            if (editMode == EditMode.AddNew)
            {
                this._InstrumentData.Instrument = new Instrument() { IsDerivative = false, IsSwitchUseAgio = false, UseWeightedPrice = false };
                this._InstrumentData.PriceRangeCheckRule = new PriceRangeCheckRule();
                this._InstrumentData.WeightedPriceRule = new WeightedPriceRule();
            }
            else
            {
                this._InstrumentData.Instrument = vmInstrument.Instrument.Clone();
                this._InstrumentData.PriceRangeCheckRule = vmInstrument.VmPriceRangeCheckRule.PriceRangeCheckRule.Clone();
                this._InstrumentData.WeightedPriceRule = vmInstrument.VmWeightedPriceRule.WeightedPriceRule.Clone();
            }

            this.DataContext = this._InstrumentData;
            this._HintMessage = new HintMessage(this.HintTextBlock);
        }
Exemplo n.º 33
0
        public static int AddInstrument(InstrumentData instrumentData)
        {
            int instrumentId;
            using (TransactionScope scope = new TransactionScope())
            {
                instrumentId = QuotationData.AddMetadataObject(instrumentData.Instrument);
                if (instrumentData.Instrument.IsDerivative)
                {
                    instrumentData.DerivativeRelation.Id = instrumentId;
                    QuotationData.AddMetadataObject(instrumentData.DerivativeRelation);
                }
                else
                {
                    instrumentData.PriceRangeCheckRule.Id = instrumentId;
                    QuotationData.AddMetadataObject(instrumentData.PriceRangeCheckRule);

                    instrumentData.WeightedPriceRule.Id = instrumentId;
                    QuotationData.AddMetadataObject(instrumentData.WeightedPriceRule);
                }
                scope.Complete();
            }
            return instrumentId;
        }
Exemplo n.º 34
0
 public void AddInstrument(InstrumentData instrumentData, Action<int> SetInstrumentId)
 {
     this._ServiceProxy.BeginAddInstrument(instrumentData, delegate(IAsyncResult ar)
     {
         int instrumentId = this._ServiceProxy.EndAddInstrument(ar);
         SetInstrumentId(instrumentId);
     }, null);
 }