Exemple #1
0
        private void CreateEmptyOutputStaves(List<List<VoiceDef>> barDefsInOneSystem, int numberOfVisibleInputStaves)
        {
            int nVisibleOutputStaves = _pageFormat.VisibleOutputVoiceIndicesPerStaff.Count;
            List<byte> invisibleOutputVoiceIndices = new List<byte>();
            if(numberOfVisibleInputStaves > 0 )
                invisibleOutputVoiceIndices = InvisibleOutputVoiceIndices(_pageFormat.VisibleOutputVoiceIndicesPerStaff, barDefsInOneSystem[0]);

            for(int i = 0; i < Systems.Count; i++)
            {
                SvgSystem system = Systems[i];
                List<VoiceDef> barDef = barDefsInOneSystem[i];

                #region create invisible staves
                if(invisibleOutputVoiceIndices.Count > 0)
                {
                    foreach(byte invisibleOutputVoiceIndex in invisibleOutputVoiceIndices)
                    {
                        Trk invisibleTrkDef = barDef[invisibleOutputVoiceIndex] as Trk;
                        HiddenOutputStaff hiddenOutputStaff = new HiddenOutputStaff(system);
                        OutputVoice outputVoice = new OutputVoice(hiddenOutputStaff, invisibleTrkDef.MidiChannel, invisibleTrkDef.MasterVolume);
                        outputVoice.VoiceDef = invisibleTrkDef;
                        hiddenOutputStaff.Voices.Add(outputVoice);
                        system.Staves.Add(hiddenOutputStaff);
                    }
                }
                #endregion create invisible staves

                for(int printedStaffIndex = 0; printedStaffIndex < nVisibleOutputStaves; printedStaffIndex++)
                {
                    string staffname = StaffName(i, printedStaffIndex);
                    OutputStaff outputStaff = new OutputStaff(system, staffname, _pageFormat.StafflinesPerStaff[printedStaffIndex], _pageFormat.Gap, _pageFormat.StafflineStemStrokeWidth);

                    List<byte> outputVoiceIndices = _pageFormat.VisibleOutputVoiceIndicesPerStaff[printedStaffIndex];
                    for(int ovIndex = 0; ovIndex < outputVoiceIndices.Count; ++ovIndex)
                    {
                        Trk trkDef = barDef[outputVoiceIndices[ovIndex]] as Trk;
                        Debug.Assert(trkDef != null);
                        OutputVoice outputVoice = new OutputVoice(outputStaff, trkDef.MidiChannel, trkDef.MasterVolume);
                        outputVoice.VoiceDef = trkDef;
                        outputStaff.Voices.Add(outputVoice);
                    }
                    SetStemDirections(outputStaff);
                    system.Staves.Add(outputStaff);
                }
            }
        }
Exemple #2
0
 public OutputVoice(OutputStaff outputStaff, int midiChannel, byte? masterVolume)
     : base(outputStaff)
 {
     MidiChannel = midiChannel;
     _masterVolume = masterVolume;
 }
Exemple #3
0
 public OutputVoice(OutputStaff outputStaff, int midiChannel)
     : base(outputStaff)
 {
     MidiChannel = midiChannel;
 }
Exemple #4
0
 public OutputVoice(OutputStaff outputStaff, byte midiChannel, byte?masterVolume)
     : base(outputStaff)
 {
     _midiChannel  = midiChannel;
     _masterVolume = masterVolume;
 }