• R/O
  • SSH
  • HTTPS

cadencii: コミット


コミットメタ情報

リビジョン1963 (tree)
日時2012-01-15 02:29:50
作者kbinani

ログメッセージ

[vConnect/trunk/stand2.0] deleted: vsqPhonemeDB

変更サマリ

差分

--- vConnect/trunk/stand2.0/stand/vsqMetaText/vsqPhonemeDB.h (revision 1962)
+++ vConnect/trunk/stand2.0/stand/vsqMetaText/vsqPhonemeDB.h (nonexistent)
@@ -1,62 +0,0 @@
1-/*
2- * vsqPhonemeDB.h
3- * Copyright (C) 2010- HAL,
4- * Copyright (C) 2011 kbinani.
5- *
6- * This files is a part of v.Connect.
7- * vsqPhonemeDB inherits utauVoiceDataBase class.
8- * This class reads UTAU oto.ini in vsq meta-text extention.
9- *
10- * These files are distributed in the hope that it will be useful,
11- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13- *
14- */
15-#ifndef __vsqPhonemeDB_h__
16-#define __vsqPhonemeDB_h__
17-
18-#include "vsqBase.h"
19-#include "../RuntimeOption.h"
20-
21-using namespace vconnect;
22-
23-class vsqPhonemeDB// : public vsqBase
24-{
25-
26-public:
27-
28- vsqPhonemeDB()
29- {
30- isInitialized = false;
31- singerIndex = 0;
32- }
33-
34- ~vsqPhonemeDB(){
35- //UtauDB::dbClear();
36- /*for( unsigned int i = 0; i < voiceDBs.size(); i++ ){
37- SAFE_DELETE( voiceDBs[i] );
38- }
39- voiceDBs.clear();*/
40- }
41-
42- void setRuntimeOption( RuntimeOption &option )
43- {
44- _codepage_otoini = option.getEncodingOtoIni();
45- }
46-
47-
48-public:
49-
50- int singerIndex;
51-
52- string _codepage_otoini;
53-
54-
55-private:
56-
57- bool isInitialized;
58-
59-
60-};
61-
62-#endif
--- vConnect/trunk/stand2.0/stand/vsqMetaText/Sequence.cpp (revision 1962)
+++ vConnect/trunk/stand2.0/stand/vsqMetaText/Sequence.cpp (revision 1963)
@@ -8,16 +8,19 @@
88
99 namespace vconnect
1010 {
11- void Sequence::setParamOtoIni( vsqPhonemeDB *target, string singerName, string otoIniPath )
11+ void Sequence::setParamOtoIni( string singerName, string otoIniPath, string encoding )
1212 {
1313 // 名前登録して
14- singerMap.insert( make_pair( singerName, target->singerIndex ) );
15- // 中身読んで
16- UtauDB *p = new UtauDB;
17- p->read( otoIniPath, target->_codepage_otoini.c_str() );
18- // リストに追加
19- UtauDBManager::regist( p );
20- target->singerIndex++;
14+ int index = UtauDBManager::find( otoIniPath );
15+ if( index < 0 ){
16+ // 中身読んで
17+ UtauDB *p = new UtauDB;
18+ p->read( otoIniPath, encoding.c_str() );
19+ // リストに追加
20+ UtauDBManager::regist( p );
21+ index = UtauDBManager::find( otoIniPath );
22+ }
23+ singerMap.insert( std::make_pair( singerName, index ) );
2124 }
2225
2326 void Sequence::setParamEvent( Event *target, string left, string right )
@@ -88,14 +91,13 @@
8891 bool Sequence::read( string file_name, RuntimeOption option )
8992 {
9093 bool result = false;
91- this->voiceDataBase.setRuntimeOption( option );
9294 TextInputStream *stream = new TextInputStream( file_name, option.getEncodingVsqText() );
93- bool ret = this->readCore( stream, file_name );
95+ bool ret = this->readCore( stream, file_name, option.getEncodingOtoIni() );
9496 delete stream;
9597 return ret;
9698 }
9799
98- bool Sequence::readCore( InputStream *stream, string vsqFilePath )
100+ bool Sequence::readCore( InputStream *stream, string vsqFilePath, string encodingOtoIni )
99101 {
100102 if( !stream ) return false;
101103
@@ -148,7 +150,7 @@
148150 string directory = Path::getDirectoryName( vsqFilePath );
149151 otoIniPath = Path::combine( directory, otoIniPath );
150152 }
151- this->setParamOtoIni( &this->voiceDataBase, singerName, otoIniPath );
153+ this->setParamOtoIni( singerName, otoIniPath, encodingOtoIni );
152154 }else if( search.compare( OBJ_NAME_TEMPO ) == 0 ){
153155 // [Tempo]
154156 this->vsqTempoBp.setParameter( left, right );
--- vConnect/trunk/stand2.0/stand/vsqMetaText/Sequence.h (revision 1962)
+++ vConnect/trunk/stand2.0/stand/vsqMetaText/Sequence.h (revision 1963)
@@ -11,7 +11,6 @@
1111 #include "EventList.h"
1212 #include "BPList.h"
1313 #include "vsqTempo.h"
14-#include "vsqPhonemeDB.h"
1514 #include "../RuntimeOption.h"
1615 #include "../Socket.h"
1716 #include "../Path.h"
@@ -117,13 +116,14 @@
117116
118117 private:
119118
120- /// <summary>
121- /// VSQのメタテキストを読み込みます.
122- /// </summary>
123- /// <param name="stream">読み込むストリーム.</param>
124- /// <param name="vsqFilePath">読み込むファイルのパス</param>
125- /// <returns>読み込みに成功した場合true,それ以外はfalseを返します.</returns>
126- bool readCore( InputStream *stream, string vsqFilePath );
119+ /**
120+ * VSQのメタテキストを読み込みます.
121+ * @param stream 読み込むストリーム.
122+ * @param vsqFilePath 読み込むファイルのパス
123+ * @param encodingOtoIni oto.ini ファイルのテキストエンコーディング
124+ * @return 読み込みに成功した場合true,それ以外はfalseを返します.
125+ */
126+ bool readCore( InputStream *stream, string vsqFilePath, string encodingOtoIni );
127127
128128 /// <summary>
129129 /// 指定したイベントの内容を,メタテキストの行データを元に設定します.
@@ -133,7 +133,13 @@
133133 /// <param name="right">メタテキストの"="の右側部分</param>
134134 void setParamEvent( vconnect::Event *target, string left, string right );
135135
136- void setParamOtoIni( vsqPhonemeDB *target, string singerName, string otoIniPath );
136+ /**
137+ * 歌手名と oto.ini のパスの紐付けを登録する
138+ * @param singerName 歌手名
139+ * @param otoIniPath oto.ini のパス
140+ * @param encoding oto.ini のテキストエンコーディング
141+ */
142+ void setParamOtoIni( string singerName, string otoIniPath, string encoding );
137143
138144 private:
139145
@@ -178,10 +184,6 @@
178184 cout << i->first << ":" << i->second->toString() << endl;
179185 }
180186 }
181-
182- private:
183- vsqPhonemeDB voiceDataBase;
184-
185187 };
186188 }
187189 #endif
--- vConnect/trunk/stand2.0/stand/Transcriber.cpp (revision 1962)
+++ vConnect/trunk/stand2.0/stand/Transcriber.cpp (revision 1963)
@@ -58,16 +58,13 @@
5858 // 圧縮形式のマッチング.
5959 vConnectPhoneme src_phoneme, dst_phoneme;
6060
61- string tmp_path;
62- src.getDBPath(tmp_path);
63- tmp_path += src_param.fileName;
61+ string tmp_path = src.getOtoIniPath() + src_param.fileName;
6462 if( !src_phoneme.readPhoneme( tmp_path.c_str() ) ){
6563 cout << " error; can't read file : " << tmp_path << endl;
6664 continue;
6765 }
6866
69- dst.getDBPath(tmp_path);
70- tmp_path += dst_param.fileName;
67+ tmp_path = dst.getOtoIniPath() + dst_param.fileName;
7168 if( !dst_phoneme.readPhoneme( tmp_path.c_str() ) ){
7269 cout << " error; can't read file : " << tmp_path << endl;
7370 continue;
@@ -80,8 +77,7 @@
8077 mb_conv(tmp_path, s);
8178 src_phoneme.writePhoneme(s.c_str());
8279 */
83- dst.getDBPath(tmp_path);
84- tmp_path += dst_param.fileName;
80+ tmp_path = dst.getOtoIniPath() + dst_param.fileName;
8581 dst_phoneme.writePhoneme( tmp_path.c_str() );
8682 }else{
8783 vConnectPhoneme src_phoneme, dst_phoneme;
--- vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDBManager.cpp (revision 1962)
+++ vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDBManager.cpp (revision 1963)
@@ -42,4 +42,18 @@
4242 }
4343 UtauDBManager::mDBs.clear();
4444 }
45+
46+ int UtauDBManager::find( string otoIniPath )
47+ {
48+ if( otoIniPath.length() == 0 ){
49+ return -1;
50+ }
51+ int size = UtauDBManager::size();
52+ for( int i = 0; i < size; i++ ){
53+ if( UtauDBManager::get( i )->getOtoIniPath() == otoIniPath ){
54+ return i;
55+ }
56+ }
57+ return -1;
58+ }
4559 }
--- vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDB.cpp (revision 1962)
+++ vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDB.cpp (revision 1963)
@@ -92,10 +92,9 @@
9292 return result;
9393 }
9494
95- int UtauDB::getDBPath( string &dst )
95+ string UtauDB::getOtoIniPath()
9696 {
97- dst = mDBPath;
98- return 1;
97+ return this->mDBPath;
9998 }
10099
101100 bool UtauDB::empty()
--- vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDBManager.h (revision 1962)
+++ vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDBManager.h (revision 1963)
@@ -55,6 +55,13 @@
5555 */
5656 static UtauDB *get( int index );
5757
58+ /**
59+ * 指定した oto.ini の音源のインデックスを取得する
60+ * @param otoIniPath oto.ini のパス
61+ * @return 音源のインデックス
62+ */
63+ static int find( string otoIniPath );
64+
5865 private:
5966 UtauDBManager()
6067 {
--- vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDB.h (revision 1962)
+++ vConnect/trunk/stand2.0/stand/utauVoiceDB/UtauDB.h (revision 1963)
@@ -45,12 +45,11 @@
4545
4646 int getParams( UtauParameter &parameters, int index );
4747
48- /// <summary>
49- /// oto.iniファイルのパスを取得します.
50- /// </summary>
51- /// <param name="dst">ファイルパスの格納先.</param>
52- /// <returns>1を返します.</returns>
53- int getDBPath( string &dst );
48+ /**
49+ * oto.iniファイルのパスを取得します.
50+ * @return oto.ini のパス
51+ */
52+ string getOtoIniPath();
5453
5554 /// <summary>
5655 /// 音素の数が0かどうかを取得します.
--- vConnect/trunk/stand2.0/stand/corpusManager.cpp (revision 1962)
+++ vConnect/trunk/stand2.0/stand/corpusManager.cpp (revision 1963)
@@ -169,7 +169,7 @@
169169 string tmp;
170170 mUtauDB = p;
171171 if( p ){
172- p->getDBPath( mDBPath );
172+ this->mDBPath = p->getOtoIniPath();
173173 }
174174 tmp = "vConnect.ini";
175175 mEnableExtention = setting.readSetting( mDBPath, tmp, options.getEncodingOtoIni().c_str()); // 文字コード指定は暫定処置
旧リポジトリブラウザで表示