예제 #1
0
            /// <summary>
            /// VOCALOID2システムが使用する辞書を読み込みます。
            /// </summary>
            public static void loadSystemDictionaries()
            {
                if (mInitialized)
                {
                    return;
                }
                // 辞書フォルダからの読込み
                string editor_path = VocaloSysUtil.getEditorPath(SynthesizerType.VOCALOID2);

                if (editor_path != "")
                {
                    string path = Path.Combine(PortUtil.getDirectoryName(editor_path), "UDIC");
                    if (!Directory.Exists(path))
                    {
                        return;
                    }
                    string[] files = PortUtil.listFiles(path, "*.udc");
                    for (int i = 0; i < files.Length; i++)
                    {
                        files[i] = PortUtil.getFileName(files[i]);
                        string dict = Path.Combine(path, files[i]);
                        mTable.Add(new SymbolTable(dict, true, false, "Shift_JIS"));
                    }
                }
                mInitialized = true;
            }
예제 #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);
        }