示例#1
0
        /// <summary>
        /// このインスタンスのコピーを作成します。
        /// </summary>
        /// <returns></returns>
        public Object clone()
        {
            IconHandle ret = new IconHandle();

            ret.Caption  = Caption;
            ret.IconID   = IconID;
            ret.IDS      = IDS;
            ret.Index    = Index;
            ret.Language = Language;
            ret.setLength(Length);
            ret.Original = Original;
            ret.Program  = Program;
            return(ret);
        }
示例#2
0
        /// <summary>
        /// このインスタンスから、Handleのリストを作成すると同時に、Eventsに登録されているVsqEventのvalue値および各ハンドルのvalue値を更新します
        /// </summary>
        /// <returns></returns>
        private List <VsqHandle> buildHandleList()
        {
            List <VsqHandle> handle = new List <VsqHandle>();
            int  current_id         = -1;
            int  current_handle     = -1;
            bool add_quotation_mark = true;
            bool is_vocalo1         = Common.Version.StartsWith("DSB2");
            bool is_vocalo2         = Common.Version.StartsWith("DSB3");

            foreach (var item in Events.iterator())
            {
                current_id++;
                item.ID.value = current_id;
                // IconHandle
                if (item.ID.IconHandle != null)
                {
                    if (item.ID.IconHandle is IconHandle)
                    {
                        IconHandle ish = (IconHandle)item.ID.IconHandle;
                        current_handle++;
                        VsqHandle handle_item = VsqHandle.castFromIconHandle(ish);
                        handle_item.Index = current_handle;
                        handle.Add(handle_item);
                        item.ID.IconHandle_index = current_handle;
                        if (is_vocalo1)
                        {
                            VsqVoiceLanguage lang = VocaloSysUtil.getLanguageFromName(ish.IDS);
                            add_quotation_mark = lang == VsqVoiceLanguage.Japanese;
                        }
                        else if (is_vocalo2)
                        {
                            VsqVoiceLanguage lang = VocaloSysUtil.getLanguageFromName(ish.IDS);
                            add_quotation_mark = lang == VsqVoiceLanguage.Japanese;
                        }
                    }
                }
                // LyricHandle
                if (item.ID.LyricHandle != null)
                {
                    current_handle++;
                    VsqHandle handle_item = VsqHandle.castFromLyricHandle(item.ID.LyricHandle);
                    handle_item.Index            = current_handle;
                    handle_item.addQuotationMark = add_quotation_mark;
                    handle.Add(handle_item);
                    item.ID.LyricHandle_index = current_handle;
                }
                // VibratoHandle
                if (item.ID.VibratoHandle != null)
                {
                    current_handle++;
                    VsqHandle handle_item = item.ID.VibratoHandle.castToVsqHandle();
                    handle_item.Index = current_handle;
                    handle.Add(handle_item);
                    item.ID.VibratoHandle_index = current_handle;
                }
                // NoteHeadHandle
                if (item.ID.NoteHeadHandle != null)
                {
                    current_handle++;
                    VsqHandle handle_item = item.ID.NoteHeadHandle.castToVsqHandle();
                    handle_item.Index = current_handle;
                    handle.Add(handle_item);
                    item.ID.NoteHeadHandle_index = current_handle;
                }
                // IconDynamicsHandle
                if (item.ID.IconDynamicsHandle != null)
                {
                    current_handle++;
                    VsqHandle handle_item = item.ID.IconDynamicsHandle.castToVsqHandle();
                    handle_item.Index = current_handle;
                    handle_item.setLength(item.ID.getLength());
                    handle.Add(handle_item);
                    item.ID.IconHandle_index = current_handle;
                }
            }
            return(handle);
        }