Esempio n. 1
0
        public void OnRepeatedMeasureExited(eGeneratorState stateIN)
        {
            mStaffPlayer.ClearNotes();

            if (stateIN >= eGeneratorState.editing)
            {
                if (mMeasureEditor.mCurrentMeasure.value < mMeasureEditor.mNumberOfMeasures.value)
                {
                    mMeasureEditor.mCurrentMeasure.value += 1;
                }
                else
                {
                    mMeasureEditor.mCurrentMeasure.value = 0;
                }
                mMeasureEditor.UIToggleAllInstruments(true);
            }
        }
Esempio n. 2
0
        /// Updates the helper notes showing/not showing, whether mShowEditorHints.isOn.
        public void ToggleHelperNotes(Dropdown colorDropdownIN = null)
        {
            if (mMusicGenerator.mState >= eGeneratorState.editing)
            {
                if (mShowEditorHints.isOn)
                {
                    if (mLoadedClip.mInstrumentSet.mInstruments.Count == 0)
                    {
                        return;
                    }

                    int currentInstIndex = (int)mInstrumentPanel.mInstrument.InstrumentIndex;
                    if (colorDropdownIN != null)
                    {
                        mLoadedClip.mInstrumentSet.mInstruments[currentInstIndex].mData.mStaffPlayerColor = (eStaffPlayerColors)colorDropdownIN.value;
                    }

                    mStaffPlayer.ClearNotes(true, true);
                    Instrument instrument = mLoadedClip.mInstrumentSet.mInstruments[currentInstIndex];
                    mStaffPlayer.ShowHighlightedNotes(instrument);
                    if (mShowAllInstruments.isOn)
                    {
                        InstrumentSet set = mLoadedClip.mInstrumentSet;
                        for (int i = 0; i < set.mInstruments.Count; i++)
                        {
                            int[][] notes = set.mInstruments[i].mClipNotes[mCurrentMeasure.value];
                            mStaffPlayer.ShowSetEditorNotes(notes, i);
                        }
                    }
                    else
                    {
                        mStaffPlayer.ShowSetEditorNotes(instrument.mClipNotes[mCurrentMeasure.value], instrument.InstrumentIndex);
                    }
                }
                else
                {
                    mStaffPlayer.ClearNotes(false, true);
                }
            }
        }
Esempio n. 3
0
        /// Toggles all the instruments not currently being edited
        public void UIToggleAllInstruments(bool clear = false)
        {
            StaffPlayerUI     staffPlayer     = mStaffPlayer;
            InstrumentPanelUI instrumentPanel = mInstrumentPanel;

            if (clear)
            {
                staffPlayer.ClearNotes(true, false);
            }
            if (mInstrumentPanel.mInstrument != null)
            {
                InstrumentSet set = mLoadedClip.mInstrumentSet;
                if (set == null || set.mInstruments.Count == 0)
                {
                    return;
                }
                int currentInstrument = (int)set.mInstruments[(int)instrumentPanel.mInstrument.InstrumentIndex].InstrumentIndex;

                if (set.mInstruments.Count > currentInstrument)
                {
                    int[][] clipNotes = set.mInstruments[currentInstrument].mClipNotes[mCurrentMeasure.value];
                    if (mShowAllInstruments.isOn)
                    {
                        for (int i = 0; i < set.mInstruments.Count; i++)
                        {
                            int[][] notes = set.mInstruments[i].mClipNotes[mCurrentMeasure.value];
                            staffPlayer.ShowSetEditorNotes(notes, i);
                        }
                    }
                    else
                    {
                        staffPlayer.ShowSetEditorNotes(clipNotes, currentInstrument);
                    }
                }
            }
        }