Ejemplo n.º 1
0
        public void print(ITextWriter sw)
        {
            string pbw   = "";
            string pby   = "";
            string pbm   = "";
            int    count = Points.Count;

            for (int i = 0; i < count; i++)
            {
                string comma = (i == 0 ? "" : ",");
                pbw += comma + Points[i].Step;
                pby += Points[i].Value + ",";
                string            type = "";
                UstPortamentoType ut   = Points[i].Type;
                if (ut == UstPortamentoType.S)
                {
                    type = "";
                }
                else if (ut == UstPortamentoType.Linear)
                {
                    type = "s";
                }
                else if (ut == UstPortamentoType.R)
                {
                    type = "r";
                }
                else if (ut == UstPortamentoType.J)
                {
                    type = "j";
                }
                pbm += comma + type;
            }
            sw.write("PBW=" + pbw);
            sw.newLine();
            sw.write("PBS=" + Start + (mIsUnknownIntSpecified ? (";" + mUnknownInt) : ""));
            sw.newLine();
            if (Points.Count >= 2)
            {
                sw.write("PBY=" + pby);
                sw.newLine();
                sw.write("PBM=" + pbm);
                sw.newLine();
            }
        }
Ejemplo n.º 2
0
 public void print(ITextWriter sw)
 {
     if (this.Index == UstFile.PREV_INDEX)
     {
         sw.write("[#PREV]");
         sw.newLine();
     }
     else if (this.Index == UstFile.NEXT_INDEX)
     {
         sw.write("[#NEXT]");
         sw.newLine();
     }
     else
     {
         sw.write("[#" + PortUtil.formatDecimal("0000", Index) + "]");
         sw.newLine();
     }
     if (isLengthSpecified())
     {
         sw.write("Length=" + mLength);
         sw.newLine();
     }
     if (isLyricSpecified())
     {
         sw.write("Lyric=" + getLyric());
         sw.newLine();
     }
     if (isNoteSpecified())
     {
         sw.write("NoteNum=" + getNote());
         sw.newLine();
     }
     if (isIntensitySpecified())
     {
         sw.write("Intensity=" + getIntensity());
         sw.newLine();
     }
     if (isPitchesSpecified() && mPitches != null)
     {
         sw.write("PBType=" + getPBType());
         sw.newLine();
         sw.write("Piches=");
         for (int i = 0; i < mPitches.Length; i++)
         {
             if (i == 0)
             {
                 sw.write(mPitches[i] + "");
             }
             else
             {
                 sw.write("," + mPitches[i]);
             }
         }
         sw.newLine();
     }
     if (isTempoSpecified())
     {
         sw.write("Tempo=" + getTempo());
         sw.newLine();
     }
     if (isVibratoSpecified() && mVibrato != null)
     {
         sw.write(mVibrato.ToString());
         sw.newLine();
     }
     if (isPortamentoSpecified() && mPortamento != null)
     {
         mPortamento.print(sw);
     }
     if (isPreUtteranceSpecified())
     {
         sw.write("PreUtterance=" + getPreUtterance());
         sw.newLine();
     }
     if (isVoiceOverlapSpecified())
     {
         sw.write("VoiceOverlap=" + getVoiceOverlap());
         sw.newLine();
     }
     if (isEnvelopeSpecified() && mEnvelope != null)
     {
         sw.write(mEnvelope.ToString());
         sw.newLine();
     }
     if (Flags != "")
     {
         sw.write("Flags=" + Flags);
         sw.newLine();
     }
     if (isModurationSpecified())
     {
         sw.write("Moduration=" + getModuration());
         sw.newLine();
     }
     if (isStartPointSpecified())
     {
         sw.write("StartPoint=" + getStartPoint());
         sw.newLine();
     }
     if (Properties != null)
     {
         int size = Properties.Count;
         for (int i = 0; i < size; i++)
         {
             UstEventProperty itemi = Properties[i];
             sw.write(itemi.Name + "=" + itemi.Value);
             sw.newLine();
         }
     }
 }