Пример #1
0
 public VibratoHandle castToVibratoHandle() {
   VibratoHandle ret = new VibratoHandle();
   ret.index = index;
   ret.caption = caption;
   ret.depthBP = (VibratoBPList) depthBP.clone();
   ret.iconID = iconID;
   ret.IDS = IDS;
   ret.index = index;
   ret.length = length;
   ret.original = original;
   ret.rateBP = (VibratoBPList) rateBP.clone();
   ret.startDepth = startDepth;
   ret.startRate = startRate;
   return ret;
 }
Пример #2
0
 /// <summary>
 /// インスタンスを文字列に変換します
 /// </summary>
 /// <param name="encode">2バイト文字をエンコードするか否かを指定するフラグ</param>
 /// <returns>インスタンスを変換した文字列</returns>
 public String toString(boolean encode) {
   String result = "";
   result += "[h#" + (new DecimalFormat("0000")).format(index) + "]";
   switch (m_type) {
     case Lyric:
       result += "\nL0=" + L0.toString(encode);
       break;
     case Vibrato:
       int c_depth = depthBP.getCount();
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "StartDepth=" + startDepth + "\n";
       result += "DepthBPNum=" + c_depth + "\n";
       if (c_depth > 0) {
         result += "DepthBPX=" + (new DecimalFormat("0.000000")).format(depthBP.getElement(0).x);
         for (int i = 1; i < c_depth; i++) {
           result += "," + (new DecimalFormat("0.000000")).format(depthBP.getElement(i).x);
         }
         result += "\nDepthBPY=" + depthBP.getElement(0).y;
         for (int i = 1; i < c_depth; i++) {
           result += "," + depthBP.getElement(i).y;
         }
         result += "\n";
       }
       int c_rate = rateBP.getCount();
       result += "StartRate=" + startRate + "\n";
       result += "RateBPNum=" + c_rate;
       if (c_rate > 0) {
         result += "\nRateBPX=" + (new DecimalFormat("0.000000")).format(rateBP.getElement(0).x);
         for (int i = 1; i < c_rate; i++) {
           result += "," + (new DecimalFormat("0.000000")).format(rateBP.getElement(i).x);
         }
         result += "\nRateBPY=" + rateBP.getElement(0).y;
         for (int i = 1; i < c_rate; i++) {
           result += "," + rateBP.getElement(i).y;
         }
       }
       break;
     case Singer:
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "Language=" + language + "\n";
       result += "Program=" + program;
       break;
     case NoteHeadHandle:
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "Duration=" + duration + "\n";
       result += "Depth=" + depth;
       break;
     default:
       break;
   }
   return result;
 }