public VibratoHandle castToVibratoHandle()
        {
            VibratoHandle ret = new VibratoHandle();

            ret.Index = Index;
            ret.setCaption(Caption);
            ret.setDepthBP((VibratoBPList)DepthBP.clone());
            ret.IconID = IconID;
            ret.IDS    = IDS;
            ret.Index  = Index;
            ret.setLength(Length);
            ret.Original = Original;
            ret.setRateBP((VibratoBPList)RateBP.clone());
            ret.setStartDepth(StartDepth);
            ret.setStartRate(StartRate);
            return(ret);
        }
Exemple #2
0
 /// <summary>
 /// このインスタンスと,指定したVibratoHandleのインスタンスが等しいかどうかを調べます
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool equals(VibratoHandle item)
 {
     if (item == null)
     {
         return(false);
     }
     if (startRate != item.startRate)
     {
         return(false);
     }
     if (startDepth != item.startDepth)
     {
         return(false);
     }
     if (IconID != item.IconID)
     {
         return(false);
     }
     if ((item.depthBP == null) != (this.depthBP == null))
     {
         // どちらかがnullで,どちらかがnullでない場合,一致するのは考えられない
         return(false);
     }
     if ((item.rateBP == null) != (this.rateBP == null))
     {
         return(false);
     }
     if (this.depthBP != null)
     {
         if (!this.depthBP.equals(item.depthBP))
         {
             return(false);
         }
     }
     if (this.rateBP != null)
     {
         if (!this.rateBP.equals(item.rateBP))
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #3
0
        public Object clone()
        {
            VibratoHandle result = new VibratoHandle();

            result.Index    = Index;
            result.IconID   = IconID;
            result.IDS      = this.IDS;
            result.Original = this.Original;
            result.setCaption(caption);
            result.setLength(getLength());
            result.setStartDepth(startDepth);
            if (depthBP != null)
            {
                result.setDepthBP((VibratoBPList)depthBP.clone());
            }
            result.setStartRate(startRate);
            if (rateBP != null)
            {
                result.setRateBP((VibratoBPList)rateBP.clone());
            }
            return(result);
        }
Exemple #4
0
        /// <summary>
        /// ビブラートのプリセットタイプから,VibratoHandleを作成します
        /// </summary>
        /// <param name="icon_id"></param>
        /// <param name="vibrato_length"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static VibratoHandle getDefaultVibratoHandle(string icon_id, int vibrato_length, SynthesizerType type)
        {
            if (!isInitialized)
            {
                serr.println("VocaloSysUtil#getDefaultVibratoHandle; not initialized yet");
                return(null);
            }
            if (s_exp_config_sys.ContainsKey(type))
            {
                foreach (var vconfig in s_exp_config_sys[type].vibratoConfigIterator())
                {
                    if (vconfig.IconID.Equals(icon_id))
                    {
                        VibratoHandle ret = (VibratoHandle)vconfig.clone();
                        ret.setLength(vibrato_length);
                        return(ret);
                    }
                }
            }
            VibratoHandle empty = new VibratoHandle();

            empty.IconID = "$04040000";
            return(empty);
        }
Exemple #5
0
        public bool equals(VsqEvent item)
        {
            if (this.Clock != item.Clock)
            {
                return(false);
            }
            if (this.ID.type != item.ID.type)
            {
                return(false);
            }
            if (this.ID.type == VsqIDType.Anote)
            {
                #region 音符の比較
                if (this.ID.Note != item.ID.Note)
                {
                    return(false);
                }
                if (this.ID.getLength() != item.ID.getLength())
                {
                    return(false);
                }
                if (this.ID.d4mean != item.ID.d4mean)
                {
                    return(false);
                }
                if (this.ID.DEMaccent != item.ID.DEMaccent)
                {
                    return(false);
                }
                if (this.ID.DEMdecGainRate != item.ID.DEMdecGainRate)
                {
                    return(false);
                }
                if (this.ID.Dynamics != item.ID.Dynamics)
                {
                    return(false);
                }
                if (this.ID.LyricHandle == null && item.ID.LyricHandle != null)
                {
                    return(false);
                }
                if (this.ID.LyricHandle != null && item.ID.LyricHandle == null)
                {
                    return(false);
                }
                if (this.ID.LyricHandle != null && item.ID.LyricHandle != null)
                {
                    if (!this.ID.LyricHandle.L0.equalsForSynth(item.ID.LyricHandle.L0))
                    {
                        return(false);
                    }
                    int count = this.ID.LyricHandle.Trailing.Count;
                    if (count != item.ID.LyricHandle.Trailing.Count)
                    {
                        return(false);
                    }
                    for (int k = 0; k < count; k++)
                    {
                        if (!this.ID.LyricHandle.Trailing[k].equalsForSynth(item.ID.LyricHandle.Trailing[k]))
                        {
                            return(false);
                        }
                    }
                }
                if (this.ID.NoteHeadHandle == null && item.ID.NoteHeadHandle != null)
                {
                    return(false);
                }
                if (this.ID.NoteHeadHandle != null && item.ID.NoteHeadHandle == null)
                {
                    return(false);
                }
                if (this.ID.NoteHeadHandle != null && item.ID.NoteHeadHandle != null)
                {
                    if (!this.ID.NoteHeadHandle.IconID.Equals(item.ID.NoteHeadHandle.IconID))
                    {
                        return(false);
                    }
                    if (this.ID.NoteHeadHandle.getDepth() != item.ID.NoteHeadHandle.getDepth())
                    {
                        return(false);
                    }
                    if (this.ID.NoteHeadHandle.getDuration() != item.ID.NoteHeadHandle.getDuration())
                    {
                        return(false);
                    }
                    if (this.ID.NoteHeadHandle.getLength() != item.ID.NoteHeadHandle.getLength())
                    {
                        return(false);
                    }
                }
                if (this.ID.PMBendDepth != item.ID.PMBendDepth)
                {
                    return(false);
                }
                if (this.ID.PMBendLength != item.ID.PMBendLength)
                {
                    return(false);
                }
                if (this.ID.PMbPortamentoUse != item.ID.PMbPortamentoUse)
                {
                    return(false);
                }
                if (this.ID.pMeanEndingNote != item.ID.pMeanEndingNote)
                {
                    return(false);
                }
                if (this.ID.pMeanOnsetFirstNote != item.ID.pMeanOnsetFirstNote)
                {
                    return(false);
                }
                VibratoHandle hVibratoThis = this.ID.VibratoHandle;
                VibratoHandle hVibratoItem = item.ID.VibratoHandle;
                if (hVibratoThis == null && hVibratoItem != null)
                {
                    return(false);
                }
                if (hVibratoThis != null && hVibratoItem == null)
                {
                    return(false);
                }
                if (hVibratoThis != null && hVibratoItem != null)
                {
                    if (this.ID.VibratoDelay != item.ID.VibratoDelay)
                    {
                        return(false);
                    }
                    if (!hVibratoThis.IconID.Equals(hVibratoItem.IconID))
                    {
                        return(false);
                    }
                    if (hVibratoThis.getStartDepth() != hVibratoItem.getStartDepth())
                    {
                        return(false);
                    }
                    if (hVibratoThis.getStartRate() != hVibratoItem.getStartRate())
                    {
                        return(false);
                    }
                    VibratoBPList vibRateThis = hVibratoThis.getRateBP();
                    VibratoBPList vibRateItem = hVibratoItem.getRateBP();
                    if (vibRateThis == null && vibRateItem != null)
                    {
                        return(false);
                    }
                    if (vibRateThis != null && vibRateItem == null)
                    {
                        return(false);
                    }
                    if (vibRateThis != null && vibRateItem != null)
                    {
                        int numRateCount = vibRateThis.getCount();
                        if (numRateCount != vibRateItem.getCount())
                        {
                            return(false);
                        }
                        for (int k = 0; k < numRateCount; k++)
                        {
                            VibratoBPPair pThis = vibRateThis.getElement(k);
                            VibratoBPPair pItem = vibRateItem.getElement(k);
                            if (pThis.X != pItem.X)
                            {
                                return(false);
                            }
                            if (pThis.Y != pItem.Y)
                            {
                                return(false);
                            }
                        }
                    }
                    VibratoBPList vibDepthThis = hVibratoThis.getDepthBP();
                    VibratoBPList vibDepthItem = hVibratoItem.getDepthBP();
                    if (vibDepthThis == null && vibDepthItem != null)
                    {
                        return(false);
                    }
                    if (vibDepthThis != null && vibDepthItem == null)
                    {
                        return(false);
                    }
                    if (vibDepthThis != null && vibDepthItem != null)
                    {
                        int numDepthCount = vibDepthThis.getCount();
                        if (numDepthCount != vibDepthItem.getCount())
                        {
                            return(false);
                        }
                        for (int k = 0; k < numDepthCount; k++)
                        {
                            VibratoBPPair pThis = vibDepthThis.getElement(k);
                            VibratoBPPair pItem = vibDepthItem.getElement(k);
                            if (pThis.X != pItem.X)
                            {
                                return(false);
                            }
                            if (pThis.Y != pItem.Y)
                            {
                                return(false);
                            }
                        }
                    }
                }
                if (this.ID.vMeanNoteTransition != item.ID.vMeanNoteTransition)
                {
                    return(false);
                }
                #endregion
            }
            else if (this.ID.type == VsqIDType.Singer)
            {
                #region シンガーイベントの比較
                if (this.ID.IconHandle.Program != item.ID.IconHandle.Program)
                {
                    return(false);
                }
                #endregion
            }
            else if (this.ID.type == VsqIDType.Aicon)
            {
                if (!this.ID.IconDynamicsHandle.IconID.Equals(item.ID.IconDynamicsHandle.IconID))
                {
                    return(false);
                }
                if (this.ID.IconDynamicsHandle.isDynaffType())
                {
                    // 強弱記号
                }
                else
                {
                    // クレッシェンド・デクレッシェンド
                    if (this.ID.getLength() != item.ID.getLength())
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }