diff --git a/trunk/Background/Background.cs b/trunk/Background/Background.cs new file mode 100644 index 0000000..7b573ce --- /dev/null +++ b/trunk/Background/Background.cs @@ -0,0 +1,239 @@ +namespace Background { + + using System; + using System.Collections.Generic; + using System.Text; + using System.Windows.Forms; + using System.Drawing; + using System.Drawing.Imaging; + using System.IO; + using Plugin; + + public class Background : IPlugin { + + public void ApplyLanguage( string language_code ) { + + } + + /// + /// プラグインの名称 + /// + public string Name { + get { + return "Background"; + } + } + + /// + /// プラグインのタイプを表す。 + /// + public ulong Type { + get { + return Constants.LS_ENABLES_ENTRY_SETTING + Constants.LS_NO_EVENT_HANDLER; + } + } + + /// + /// プラグインの簡潔な説明文。 + /// + public string Abstract { + get { + return "画像を配置するプラグインです。様々な特効が使えます。"; + } + } + + /// + /// イベントハンドラ。このプラグインの設定メニューが押された時呼び出されます。 + /// + /// + /// + public DialogResult BaseSetting() { + return DialogResult.Cancel; + } + + public DialogResult EntrySetting( ref string config ) { + EntryConfig cfg = new EntryConfig( config ); + DialogResult result; + using ( entry_config dlg = new entry_config( cfg ) ) { + result = dlg.ShowDialog(); + if ( result == DialogResult.OK ) { + cfg = dlg.Config; + config = cfg.ToString(); + } + } + return result; + } + + /// + /// 設定値を格納した文字列を指定します。 + /// + /// + public string Config { + get { + return ""; + } + set { + } + } + + private Bitmap m_bmp; + private string m_last_file = ""; + + /// + /// フレームに加工を施す関数 + /// + /// + /// + public void Apply( ref Bitmap bmp, float time, float e_begin, float e_end, ref string e_body ) { + EntryConfig cfg = new EntryConfig( e_body ); + if ( m_last_file != "" ) { + if ( m_last_file != cfg.File ) { + Image img = ImageFromFile( cfg.File ); + if ( img != null ) { + m_bmp = new Bitmap( img.Width, img.Height, PixelFormat.Format32bppArgb ); + using ( Graphics gx = Graphics.FromImage( m_bmp ) ) { + gx.DrawImage( img, 0, 0, img.Width, img.Height ); + } + } + m_last_file = cfg.File; + } + } else { + Image img = ImageFromFile( cfg.File ); + if ( img != null ) { + m_bmp = new Bitmap( img.Width, img.Height, PixelFormat.Format32bppArgb ); + using ( Graphics gx = Graphics.FromImage( m_bmp ) ) { + gx.DrawImage( img, 0, 0, img.Width, img.Height ); + } + } + } + float alpha = 1f; + if ( cfg.FadeIn ) { + float diff = time - e_begin; + if ( 0f <= diff && diff <= cfg.FadeInRatio ) { + alpha = 1.0f / cfg.FadeInRatio * diff; + } + } + if ( cfg.FadeOut ) { + float diff = e_end - time; + if ( 0f <= diff && diff <= cfg.FadeOutRatio ) { + alpha = 1.0f / cfg.FadeOutRatio * diff; + } + } + if ( m_bmp != null ) { + using ( Graphics g = Graphics.FromImage( bmp ) ) { + //g.DrawImage( m_bmp, cfg.X, cfg.Y, m_bmp.Width * cfg.Scale, m_bmp.Height * cfg.Scale ); + ColorMatrix cm = new ColorMatrix(); + cm.Matrix00 = 1; + cm.Matrix11 = 1; + cm.Matrix22 = 1; + cm.Matrix33 = alpha; + cm.Matrix44 = 1; + ImageAttributes ia = new ImageAttributes(); + ia.SetColorMatrix( cm ); + + int width = (int)(m_bmp.Width * cfg.Scale); + int height = (int)(m_bmp.Height * cfg.Scale); + int iwidth = m_bmp.Width; + int iheight = m_bmp.Height; + g.DrawImage( m_bmp, new Rectangle( cfg.X, cfg.Y, width, height ), + 0, 0, iwidth, iheight, GraphicsUnit.Pixel, ia ); + } + } + } + + /// + /// 指定したパスのファイルからイメージを読み込みます + /// + /// + /// + public static Image ImageFromFile( string fpath ) { + Image result = null; + if ( File.Exists( fpath ) ) { + using ( FileStream fs = new FileStream( fpath, FileMode.Open, FileAccess.Read ) ) { + result = Image.FromStream( fs ); + } + } + return result; + } + + public void Render( Graphics g, Size size, float time, string mouth, string reserved ) { + } + } + + + public struct EntryConfig { + public string File; + public bool FadeIn; + public bool FadeOut; + public int X; + public int Y; + public float Scale; + public float FadeInRatio; + public float FadeOutRatio; + public EntryConfig( string config ) { + string[] spl = config.Split( new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries ); + File = ""; + FadeIn = false; + FadeOut = false; + X = 0; + Y = 0; + Scale = 1f; + FadeInRatio = 2f; + FadeOutRatio = 2f; + foreach ( string entry in spl ) { + string[] spl2 = entry.Split( new char[] { '=' } ); + switch ( spl2[0] ) { + case "File": + File = spl2[1]; + break; + case "FadeIn": + if ( spl2[1] == TRUE ) { + FadeIn = true; + } else { + FadeIn = false; + } + break; + case "FadeOut": + if ( spl2[1] == TRUE ) { + FadeOut = true; + } else { + FadeOut = false; + } + break; + case "X": + X = int.Parse( spl2[1] ); + break; + case "Y": + Y = int.Parse( spl2[1] ); + break; + case "Scale": + Scale = float.Parse( spl2[1] ); + break; + case "FadeInRatio": + FadeInRatio = float.Parse( spl2[1] ); + break; + case "FadeOutRatio": + FadeOutRatio = float.Parse( spl2[1] ); + break; + } + } + } + private const string TRUE = "true"; + private const string FALSE = "false"; + new public string ToString() { + string fadein, fadeout; + if ( FadeIn ) { + fadein = TRUE; + } else { + fadein = FALSE; + } + if ( FadeOut ) { + fadeout = TRUE; + } else { + fadeout = FALSE; + } + return "File=" + File + "\nFadeIn=" + fadein + "\nFadeOut=" + fadeout + "\nX=" + X + "\nY=" + Y + "\nScale=" + Scale + "\nFadeInRatio=" + FadeInRatio + "\nFadeOutRatio=" + FadeOutRatio; + } + + } +} diff --git a/trunk/Background/Background.csproj b/trunk/Background/Background.csproj new file mode 100644 index 0000000..66cb9ae --- /dev/null +++ b/trunk/Background/Background.csproj @@ -0,0 +1,77 @@ +サソ + + Debug + AnyCPU + 9.0.21022 + 2.0 + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9} + Library + Properties + Background + Background + + + 2.0 + v3.5 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + Form + + + entry_config.cs + + + + + + Designer + entry_config.cs + + + + + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00} + IPlugin + + + + + + + + + \ No newline at end of file diff --git a/trunk/Background/Properties/AssemblyInfo.cs b/trunk/Background/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fe1e6fd --- /dev/null +++ b/trunk/Background/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "Background" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Boare" )] +[assembly: AssemblyProduct( "Background" )] +[assembly: AssemblyCopyright( "Copyright (C) 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√%縺ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九ッ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医↓縺ッ +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "8c648f56-5cc7-432d-a8a5-73ed17b699b1" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝ェ繝薙ず繝ァ繝ウ縺翫h縺ウ繝薙Ν繝臥分蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/Background/entry_config.Designer.cs b/trunk/Background/entry_config.Designer.cs new file mode 100644 index 0000000..37f8610 --- /dev/null +++ b/trunk/Background/entry_config.Designer.cs @@ -0,0 +1,289 @@ +サソnamespace Background { + partial class entry_config { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.txtFile = new System.Windows.Forms.TextBox(); + this.btnFile = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.txtX = new System.Windows.Forms.TextBox(); + this.txtY = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.dialogImage = new System.Windows.Forms.OpenFileDialog(); + this.label4 = new System.Windows.Forms.Label(); + this.txtScale = new System.Windows.Forms.TextBox(); + this.chkFadeIn = new System.Windows.Forms.CheckBox(); + this.chkFadeOut = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtFadeOutRatio = new System.Windows.Forms.TextBox(); + this.txtFadeInRatio = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 280, 238 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 21; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 181, 238 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 20; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 12, 15 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 63, 12 ); + this.label1.TabIndex = 22; + this.label1.Text = "逕サ蜒上ヵ繧。繧、繝ォ"; + // + // txtFile + // + this.txtFile.Location = new System.Drawing.Point( 81, 12 ); + this.txtFile.Name = "txtFile"; + this.txtFile.Size = new System.Drawing.Size( 244, 19 ); + this.txtFile.TabIndex = 23; + // + // btnFile + // + this.btnFile.Location = new System.Drawing.Point( 331, 10 ); + this.btnFile.Name = "btnFile"; + this.btnFile.Size = new System.Drawing.Size( 24, 23 ); + this.btnFile.TabIndex = 24; + this.btnFile.Text = "..."; + this.btnFile.UseVisualStyleBackColor = true; + this.btnFile.Click += new System.EventHandler( this.btnFile_Click ); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 12, 24 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 12, 12 ); + this.label2.TabIndex = 25; + this.label2.Text = "X"; + // + // txtX + // + this.txtX.Location = new System.Drawing.Point( 30, 21 ); + this.txtX.Name = "txtX"; + this.txtX.Size = new System.Drawing.Size( 100, 19 ); + this.txtX.TabIndex = 26; + this.txtX.Text = "0"; + // + // txtY + // + this.txtY.Location = new System.Drawing.Point( 213, 21 ); + this.txtY.Name = "txtY"; + this.txtY.Size = new System.Drawing.Size( 100, 19 ); + this.txtY.TabIndex = 28; + this.txtY.Text = "0"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point( 195, 24 ); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size( 12, 12 ); + this.label3.TabIndex = 27; + this.label3.Text = "Y"; + // + // dialogImage + // + this.dialogImage.Filter = "Image Files|*.bmp;*.png;*.jpg|All Files|*.*"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point( 12, 60 ); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size( 53, 12 ); + this.label4.TabIndex = 29; + this.label4.Text = "陦ィ遉コ蛟咲紫"; + // + // txtScale + // + this.txtScale.Location = new System.Drawing.Point( 71, 57 ); + this.txtScale.Name = "txtScale"; + this.txtScale.Size = new System.Drawing.Size( 100, 19 ); + this.txtScale.TabIndex = 30; + this.txtScale.Text = "1.0"; + // + // chkFadeIn + // + this.chkFadeIn.AutoSize = true; + this.chkFadeIn.Location = new System.Drawing.Point( 18, 24 ); + this.chkFadeIn.Name = "chkFadeIn"; + this.chkFadeIn.Size = new System.Drawing.Size( 76, 16 ); + this.chkFadeIn.TabIndex = 31; + this.chkFadeIn.Text = "繝輔ぉ繝シ繝峨う繝ウ"; + this.chkFadeIn.UseVisualStyleBackColor = true; + this.chkFadeIn.CheckedChanged += new System.EventHandler( this.chkFadeIn_CheckedChanged ); + // + // chkFadeOut + // + this.chkFadeOut.AutoSize = true; + this.chkFadeOut.Location = new System.Drawing.Point( 18, 59 ); + this.chkFadeOut.Name = "chkFadeOut"; + this.chkFadeOut.Size = new System.Drawing.Size( 84, 16 ); + this.chkFadeOut.TabIndex = 32; + this.chkFadeOut.Text = "繝輔ぉ繝シ繝峨い繧ヲ繝"; + this.chkFadeOut.UseVisualStyleBackColor = true; + this.chkFadeOut.CheckedChanged += new System.EventHandler( this.chkFadeOut_CheckedChanged ); + // + // groupBox1 + // + this.groupBox1.Controls.Add( this.txtFadeOutRatio ); + this.groupBox1.Controls.Add( this.txtFadeInRatio ); + this.groupBox1.Controls.Add( this.label6 ); + this.groupBox1.Controls.Add( this.label5 ); + this.groupBox1.Controls.Add( this.chkFadeIn ); + this.groupBox1.Controls.Add( this.chkFadeOut ); + this.groupBox1.Location = new System.Drawing.Point( 12, 136 ); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size( 343, 90 ); + this.groupBox1.TabIndex = 33; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Fade IN/OUT"; + // + // txtFadeOutRatio + // + this.txtFadeOutRatio.Enabled = false; + this.txtFadeOutRatio.Location = new System.Drawing.Point( 227, 57 ); + this.txtFadeOutRatio.Name = "txtFadeOutRatio"; + this.txtFadeOutRatio.Size = new System.Drawing.Size( 103, 19 ); + this.txtFadeOutRatio.TabIndex = 36; + // + // txtFadeInRatio + // + this.txtFadeInRatio.Enabled = false; + this.txtFadeInRatio.Location = new System.Drawing.Point( 227, 22 ); + this.txtFadeInRatio.Name = "txtFadeInRatio"; + this.txtFadeInRatio.Size = new System.Drawing.Size( 103, 19 ); + this.txtFadeInRatio.TabIndex = 35; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point( 138, 60 ); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size( 83, 12 ); + this.label6.TabIndex = 34; + this.label6.Text = "蜉ケ譫懈凾髢難シ育ァ抵シ会シ"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point( 138, 25 ); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size( 83, 12 ); + this.label5.TabIndex = 33; + this.label5.Text = "蜉ケ譫懈凾髢難シ育ァ抵シ会シ"; + // + // groupBox2 + // + this.groupBox2.Controls.Add( this.txtScale ); + this.groupBox2.Controls.Add( this.label4 ); + this.groupBox2.Controls.Add( this.txtX ); + this.groupBox2.Controls.Add( this.label2 ); + this.groupBox2.Controls.Add( this.txtY ); + this.groupBox2.Controls.Add( this.label3 ); + this.groupBox2.Location = new System.Drawing.Point( 12, 37 ); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size( 343, 93 ); + this.groupBox2.TabIndex = 34; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Position and Scale"; + // + // entry_config + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 369, 273 ); + this.Controls.Add( this.groupBox2 ); + this.Controls.Add( this.groupBox1 ); + this.Controls.Add( this.btnFile ); + this.Controls.Add( this.txtFile ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "entry_config"; + this.ShowInTaskbar = false; + this.Text = "EntryConfig"; + this.groupBox1.ResumeLayout( false ); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout( false ); + this.groupBox2.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtFile; + private System.Windows.Forms.Button btnFile; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtX; + private System.Windows.Forms.TextBox txtY; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.OpenFileDialog dialogImage; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtScale; + private System.Windows.Forms.CheckBox chkFadeIn; + private System.Windows.Forms.CheckBox chkFadeOut; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox txtFadeOutRatio; + private System.Windows.Forms.TextBox txtFadeInRatio; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.GroupBox groupBox2; + } +} \ No newline at end of file diff --git a/trunk/Background/entry_config.cs b/trunk/Background/entry_config.cs new file mode 100644 index 0000000..15707eb --- /dev/null +++ b/trunk/Background/entry_config.cs @@ -0,0 +1,74 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Background { + public partial class entry_config : Form { + EntryConfig m_entry_config; + public entry_config( EntryConfig config ) { + InitializeComponent(); + m_entry_config = config; + txtFile.Text = m_entry_config.File; + txtX.Text = m_entry_config.X.ToString(); + txtY.Text = m_entry_config.Y.ToString(); + txtScale.Text = m_entry_config.Scale.ToString(); + chkFadeIn.Checked = m_entry_config.FadeIn; + chkFadeOut.Checked = m_entry_config.FadeOut; + txtFadeInRatio.Text = m_entry_config.FadeInRatio.ToString(); + txtFadeOutRatio.Text = m_entry_config.FadeOutRatio.ToString(); + } + + private void btnFile_Click( object sender, EventArgs e ) { + if ( dialogImage.ShowDialog() == DialogResult.OK ) { + txtFile.Text = dialogImage.FileName; + } + } + + + private void btnOK_Click( object sender, EventArgs e ) { + EntryConfig old = m_entry_config; + try { + m_entry_config.File = txtFile.Text; + m_entry_config.X = int.Parse( txtX.Text ); + m_entry_config.Y = int.Parse( txtY.Text ); + m_entry_config.Scale = float.Parse( txtScale.Text ); + m_entry_config.FadeIn = chkFadeIn.Checked; + m_entry_config.FadeOut = chkFadeOut.Checked; + m_entry_config.FadeInRatio = float.Parse( txtFadeInRatio.Text ); + m_entry_config.FadeOutRatio = float.Parse( txtFadeOutRatio.Text ); + if ( m_entry_config.FadeInRatio <= 0f ) { + m_entry_config.FadeIn = false; + m_entry_config.FadeInRatio = 2f; + } + if ( m_entry_config.FadeOutRatio <= 0f ) { + m_entry_config.FadeOut = false; + m_entry_config.FadeOutRatio = 2f; + } + this.DialogResult = DialogResult.OK; + } catch { + m_entry_config = old; + this.DialogResult = DialogResult.Cancel; + } + } + + + public EntryConfig Config { + get { + return m_entry_config; + } + } + + + private void chkFadeIn_CheckedChanged( object sender, EventArgs e ) { + txtFadeInRatio.Enabled = chkFadeIn.Checked; + } + + + private void chkFadeOut_CheckedChanged( object sender, EventArgs e ) { + txtFadeOutRatio.Enabled = chkFadeOut.Checked; + } + } +} \ No newline at end of file diff --git a/trunk/Background/entry_config.resx b/trunk/Background/entry_config.resx new file mode 100644 index 0000000..0101e26 --- /dev/null +++ b/trunk/Background/entry_config.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/trunk/Background/makefile b/trunk/Background/makefile new file mode 100644 index 0000000..f6db45a --- /dev/null +++ b/trunk/Background/makefile @@ -0,0 +1,10 @@ +RM=rm +CP=cp + +Background.dll: Background.cs entry_config.cs entry_config.Designer.cs IPlugin.dll + gmcs -target:library -out:Background.dll \ + -r:System.Windows.Forms,System.Drawing,IPlugin.dll \ + Background.cs entry_config.cs entry_config.Designer.cs + +clean: + $(RM) Background.dll IPlugin.dll diff --git a/trunk/DevUtl/DevUtl.csproj b/trunk/DevUtl/DevUtl.csproj new file mode 100644 index 0000000..246c80b --- /dev/null +++ b/trunk/DevUtl/DevUtl.csproj @@ -0,0 +1,65 @@ +サソ + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {A7798205-28BD-4DCD-A4EC-56FD23EE7AB9} + Exe + Properties + DevUtl + DevUtl + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {0C58B068-272F-4390-A14F-3D72AFCF3DFB} + Boare.Lib.AppUtil + + + + + \ No newline at end of file diff --git a/trunk/DevUtl/Program.cs b/trunk/DevUtl/Program.cs new file mode 100644 index 0000000..7c954c3 --- /dev/null +++ b/trunk/DevUtl/Program.cs @@ -0,0 +1,139 @@ +サソ//#define BINARYFILE_TO_BYTEARRAY +#define BINARYFILE_TO_BASE64 +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +using Boare.Lib.AppUtil; + +namespace DevUtl { + class Program { + static void Main( string[] args ) { +#if BINARYFILE_TO_BASE64 + Console.WriteLine( "BINARYFILE_TO_BASE64" ); + if ( args.Length < 1 ) { + Console.WriteLine( "error; too few arguments" ); + return; + } + if ( !File.Exists( args[0] ) ) { + Console.WriteLine( "error; file not found" ); + return; + } + string str = ""; + using ( FileStream fs = new FileStream( args[0], FileMode.Open ) ) { + byte[] b = new byte[fs.Length]; + fs.Read( b, 0, b.Length ); + str = Convert.ToBase64String( b ); + } + int length = str.Length; + int split_length = 100; + Console.Write( "string foo = " ); + uint count = 0; + while ( length > 0 ) { + count++; + string pref = " "; + if ( count == 1 ) { + pref = ""; + } + if ( length < split_length ) { + Console.WriteLine( pref + "\"" + str + "\";" ); + break; + } else { + string part = str.Substring( 0, split_length ); + str = str.Substring( split_length ); + length = str.Length; + Console.WriteLine( pref + "\"" + part + "\" +" ); + } + } +#endif +#if BINARYFILE_TO_BYTEARRAY + Console.WriteLine( "BINARYFILE_TO_BYTEARRAY" ); + if ( args.Length < 2 ) { + Console.WriteLine( "error; too few arguments" ); + return; + } + if ( !File.Exists( args[0] ) ) { + Console.WriteLine( "error; file not found" ); + return; + } + byte[] hoge = new byte[] { 0x00, 0x01, }; + using ( StreamWriter sw = new StreamWriter( args[1], false, Encoding.UTF8 ) ) { + sw.Write( "byte[] foo = new byte[] { " ); + bool first = true; + using ( FileStream fs = new FileStream( args[0], FileMode.Open ) ) { + const int BUF = 20; + byte[] buffer = new byte[BUF]; + while ( true ) { + int len = fs.Read( buffer, 0, BUF ); + if ( len <= 0 ) { + break; + } + if ( first ) { + first = false; + } else { + sw.WriteLine(); + sw.Write( " " ); + } + for ( int i = 0; i < len; i++ ) { + sw.Write( "0x" + Convert.ToString( buffer[i], 16 ) + ", " ); + } + } + } + sw.WriteLine( "};" ); + } +#else +#if LANGUAGE_FILE_CONVERSION + Console.WriteLine( "LANGUAGE_FILE_CONVERSION" ); + //Console.WriteLine( "input the name of message definition file" ); + string msg_dat = @"C:\cvs\lipsync\LipSync\en.lang";// Console.ReadLine(); + Dictionary dict = new Dictionary(); + using ( StreamReader sr = new StreamReader( msg_dat ) ) { + while ( sr.Peek() >= 0 ) { + string line = sr.ReadLine(); + if ( line.StartsWith( "#" ) ) { + continue; + } + string[] spl = line.Split( "\t".ToCharArray() ); + dict.Add( spl[0], spl[1] ); + } + } + + while ( true ) { + Console.WriteLine( "input edit target file" ); + string cs = Console.ReadLine(); + string new_file = Path.Combine( Path.GetDirectoryName( cs ), Path.GetFileNameWithoutExtension( cs ) + "_.tmp" ); + using ( StreamWriter sw = new StreamWriter( new_file ) ) + using ( StreamReader sr = new StreamReader( cs ) ) { + while ( sr.Peek() >= 0 ) { + sw.WriteLine( sr.ReadLine() ); + } + } + + using ( StreamWriter sw = new StreamWriter( cs ) ) + using ( StreamReader sr = new StreamReader( new_file ) ) { + while ( sr.Peek() >= 0 ) { + string line = sr.ReadLine(); + int index = line.IndexOf( "Messaging.GetMessage( MessageID." ); + if ( index >= 0 ) { + while ( index >= 0 ) { + int right = line.IndexOf( ")", index ); + string item = line.Substring( index + 32, right - (index + 32) ); + item = item.Trim(); + Console.WriteLine( "item=\"" + item + "\"" ); + string new_line = line.Substring( 0, index ) + "_( \"" + dict[item] + "\" )" + line.Substring( right + 1 ); + line = new_line; + index = line.IndexOf( "Messaging.GetMessage( MessageID." ); + } + sw.WriteLine( line ); + } else { + sw.WriteLine( line ); + } + } + } + } +#endif +#endif + } + } +} diff --git a/trunk/DevUtl/Properties/AssemblyInfo.cs b/trunk/DevUtl/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fa46fdf --- /dev/null +++ b/trunk/DevUtl/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "DevUtl" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "DevUtl" )] +[assembly: AssemblyCopyright( "Copyright ツゥ 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧 +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "568982bb-45a8-4ebc-bf4f-e3d4d4606b1d" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/IPlugin/AviReader.cs b/trunk/IPlugin/AviReader.cs new file mode 100644 index 0000000..1be5ee4 --- /dev/null +++ b/trunk/IPlugin/AviReader.cs @@ -0,0 +1,483 @@ +サソusing System; +using System.Drawing; +using System.Drawing.Imaging; +using System.Runtime.InteropServices; +using System.IO; + +namespace Plugin { + + public class Avi { + + public const int StreamtypeVIDEO = 1935960438; //mmioStringToFOURCC("vids", 0) + public const int OF_SHARE_DENY_WRITE = 32; + public const int BMP_MAGIC_COOKIE = 19778; //ascii string "BM" + + #region structure declarations + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct RECT { + public UInt32 left; + public UInt32 top; + public UInt32 right; + public UInt32 bottom; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct BITMAPINFOHEADER { + public UInt32 biSize; + public Int32 biWidth; + public Int32 biHeight; + public Int16 biPlanes; + public Int16 biBitCount; + public UInt32 biCompression; + public UInt32 biSizeImage; + public Int32 biXPelsPerMeter; + public Int32 biYPelsPerMeter; + public UInt32 biClrUsed; + public UInt32 biClrImportant; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct AVISTREAMINFO { + public UInt32 fccType; + public UInt32 fccHandler; + public UInt32 dwFlags; + public UInt32 dwCaps; + public UInt16 wPriority; + public UInt16 wLanguage; + public UInt32 dwScale; + public UInt32 dwRate; + public UInt32 dwStart; + public UInt32 dwLength; + public UInt32 dwInitialFrames; + public UInt32 dwSuggestedBufferSize; + public UInt32 dwQuality; + public UInt32 dwSampleSize; + public RECT rcFrame; + public UInt32 dwEditCount; + public UInt32 dwFormatChangeCount; + [MarshalAs( UnmanagedType.ByValArray, SizeConst = 64 )] + public UInt16[] szName; + } + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct BITMAPFILEHEADER { + public Int16 bfType; //"magic cookie" - must be "BM" + public Int32 bfSize; + public Int16 bfReserved1; + public Int16 bfReserved2; + public Int32 bfOffBits; + } + + #endregion structure declarations + + #region method declarations + + //Initialize the AVI library + [DllImport( "avifil32.dll" )] + public static extern void AVIFileInit(); + + //Open an AVI file + [DllImport( "avifil32.dll", PreserveSig = true )] + public static extern int AVIFileOpen( + ref int ppfile, + String szFile, + int uMode, + int pclsidHandler ); + + //Get a stream from an open AVI file + [DllImport( "avifil32.dll" )] + public static extern int AVIFileGetStream( + int pfile, + out IntPtr ppavi, + int fccType, + int lParam ); + + //Get the start position of a stream + [DllImport( "avifil32.dll", PreserveSig = true )] + public static extern int AVIStreamStart( int pavi ); + + //Get the length of a stream in frames + [DllImport( "avifil32.dll", PreserveSig = true )] + public static extern int AVIStreamLength( int pavi ); + + //Get information about an open stream + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamInfo( + int pAVIStream, + ref AVISTREAMINFO psi, + int lSize ); + + //Get a pointer to a GETFRAME object (returns 0 on error) + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamGetFrameOpen( + IntPtr pAVIStream, + ref BITMAPINFOHEADER bih ); + + /*[DllImport("avifil32.dll")] + public static extern int AVIStreamGetFrameOpen( + IntPtr pAVIStream, + int dummy);*/ + + //Get a pointer to a packed DIB (returns 0 on error) + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamGetFrame( + int pGetFrameObj, + int lPos ); + + //Create a new stream in an open AVI file + [DllImport( "avifil32.dll" )] + public static extern int AVIFileCreateStream( + int pfile, + out IntPtr ppavi, + ref AVISTREAMINFO ptr_streaminfo ); + + //Set the format for a new stream + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamSetFormat( + IntPtr aviStream, Int32 lPos, + ref BITMAPINFOHEADER lpFormat, Int32 cbFormat ); + + //Write a sample to a stream + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamWrite( + IntPtr aviStream, Int32 lStart, Int32 lSamples, + IntPtr lpBuffer, Int32 cbBuffer, Int32 dwFlags, + Int32 dummy1, Int32 dummy2 ); + + //Release the GETFRAME object + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamGetFrameClose( + int pGetFrameObj ); + + //Release an open AVI stream + [DllImport( "avifil32.dll" )] + public static extern int AVIStreamRelease( IntPtr aviStream ); + + //Release an open AVI file + [DllImport( "avifil32.dll" )] + public static extern int AVIFileRelease( int pfile ); + + //Close the AVI library + [DllImport( "avifil32.dll" )] + public static extern void AVIFileExit(); + + #endregion methos declarations + + #region other useful avi functions + + //public const int StreamtypeAUDIO = 1935963489; //mmioStringToFOURCC("auds", 0) + //public const int StreamtypeMIDI = 1935960429; //mmioStringToFOURCC("mids", 0) + //public const int StreamtypeTEXT = 1937012852; //mmioStringToFOURCC("txts", 0) + + /*[StructLayout(LayoutKind.Sequential, Pack=1)] + public struct AVIFILEINFO{ + public Int32 dwMaxBytesPerSecond; + public Int32 dwFlags; + public Int32 dwCaps; + public Int32 dwStreams; + public Int32 dwSuggestedBufferSize; + public Int32 dwWidth; + public Int32 dwHeight; + public Int32 dwScale; + public Int32 dwRate; + public Int32 dwLength; + public Int32 dwEditCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=64)] + public char[] szFileType; + }*/ + + /*[StructLayout(LayoutKind.Sequential, Pack=1)] + public struct AVICOMPRESSOPTIONS { + public UInt32 fccType; + public UInt32 fccHandler; + public UInt32 dwKeyFrameEvery; // only used with AVICOMRPESSF_KEYFRAMES + public UInt32 dwQuality; + public UInt32 dwBytesPerSecond; // only used with AVICOMPRESSF_DATARATE + public UInt32 dwFlags; + public IntPtr lpFormat; + public UInt32 cbFormat; + public IntPtr lpParms; + public UInt32 cbParms; + public UInt32 dwInterleaveEvery; + }*/ + + /*[DllImport("avifil32.dll")] + public static extern int AVIMakeCompressedStream( + out IntPtr ppsCompressed, IntPtr aviStream, + ref AVICOMPRESSOPTIONS ao, int dummy);*/ + + /*[DllImport("avifil32.dll")] + public static extern int AVISaveOptions( + IntPtr hWnd, + int uiFlags, + int nStreams, + ref IntPtr ppavi, + ref IntPtr ppOptions);*/ + + /*[DllImport("avifil32.dll")] + public static extern int AVIFileInfo( + int pfile, + ref AVIFILEINFO pfi, + int lSize);*/ + + /*[DllImport("winmm.dll", EntryPoint="mmioStringToFOURCCA")] + public static extern int mmioStringToFOURCC(String sz, int uFlags);*/ + + /*[DllImport("avifil32.dll")] + public static extern int AVIStreamRead( + IntPtr pavi, + Int32 lStart, + Int32 lSamples, + IntPtr lpBuffer, + Int32 cbBuffer, + Int32 plBytes, + Int32 plSamples + );*/ + + #endregion other useful avi functions + + } + + /// Extract bitmaps from AVI files + public class AviReader { + + //position of the first frame, count of frames in the stream + private int firstFrame = 0, countFrames = 0; + //pointers + private int aviFile = 0; + private int getFrameObject; + private IntPtr aviStream; + //stream and header info + private Avi.AVISTREAMINFO streamInfo; + + public int CountFrames { + get { + return countFrames; + } + } + + public UInt32 FrameRate { + get { + return streamInfo.dwRate / streamInfo.dwScale; + } + } + + public Size BitmapSize { + get { + return new Size( (int)streamInfo.rcFrame.right, (int)streamInfo.rcFrame.bottom ); + } + } + + /// Opens an AVI file and creates a GetFrame object + /// Name of the AVI file + public void Open( string fileName ) { + //Intitialize AVI library + Avi.AVIFileInit(); + + //Open the file + int result = Avi.AVIFileOpen( + ref aviFile, fileName, + Avi.OF_SHARE_DENY_WRITE, 0 ); + + if ( result != 0 ) { + throw new Exception( "Exception in AVIFileOpen: " + result.ToString() ); + } + + //Get the video stream + result = Avi.AVIFileGetStream( + aviFile, + out aviStream, + Avi.StreamtypeVIDEO, 0 ); + + if ( result != 0 ) { + throw new Exception( "Exception in AVIFileGetStream: " + result.ToString() ); + } + + firstFrame = Avi.AVIStreamStart( aviStream.ToInt32() ); + countFrames = Avi.AVIStreamLength( aviStream.ToInt32() ); + + streamInfo = new Avi.AVISTREAMINFO(); + result = Avi.AVIStreamInfo( aviStream.ToInt32(), ref streamInfo, Marshal.SizeOf( streamInfo ) ); + + if ( result != 0 ) { + throw new Exception( "Exception in AVIStreamInfo: " + result.ToString() ); + } + + //Open frames + + Avi.BITMAPINFOHEADER bih = new Avi.BITMAPINFOHEADER(); + bih.biBitCount = 24; + bih.biClrImportant = 0; + bih.biClrUsed = 0; + bih.biCompression = 0; //BI_RGB; + bih.biHeight = (Int32)streamInfo.rcFrame.bottom; + bih.biWidth = (Int32)streamInfo.rcFrame.right; + bih.biPlanes = 1; + bih.biSize = (UInt32)Marshal.SizeOf( bih ); + bih.biXPelsPerMeter = 0; + bih.biYPelsPerMeter = 0; + + getFrameObject = Avi.AVIStreamGetFrameOpen( aviStream, ref bih ); //force function to return 24bit DIBS + //getFrameObject = Avi.AVIStreamGetFrameOpen(aviStream, 0); //return any bitmaps + if ( getFrameObject == 0 ) { + throw new Exception( "Exception in AVIStreamGetFrameOpen!" ); + } + } + + /// Closes all streams, files and libraries + public void Close() { + if ( getFrameObject != 0 ) { + Avi.AVIStreamGetFrameClose( getFrameObject ); + getFrameObject = 0; + } + if ( aviStream != IntPtr.Zero ) { + Avi.AVIStreamRelease( aviStream ); + aviStream = IntPtr.Zero; + } + if ( aviFile != 0 ) { + Avi.AVIFileRelease( aviFile ); + aviFile = 0; + } + Avi.AVIFileExit(); + } + + + public Bitmap Export( int position ) { + if ( position > countFrames ) { + throw new Exception( "Invalid frame position" ); + } + + //Decompress the frame and return a pointer to the DIB + int pDib = Avi.AVIStreamGetFrame( getFrameObject, firstFrame + position ); + //Copy the bitmap header into a managed struct + Avi.BITMAPINFOHEADER bih = new Avi.BITMAPINFOHEADER(); + bih = (Avi.BITMAPINFOHEADER)Marshal.PtrToStructure( new IntPtr( pDib ), bih.GetType() ); + + /*if(bih.biBitCount < 24){ + throw new Exception("Not enough colors! DIB color depth is less than 24 bit."); + }else */ + if ( bih.biSizeImage < 1 ) { + throw new Exception( "Exception in AVIStreamGetFrame: Not bitmap decompressed." ); + } + + //Copy the image + byte[] bitmapData = new byte[bih.biSizeImage]; + int address = pDib + Marshal.SizeOf( bih ); + for ( int offset = 0; offset < bitmapData.Length; offset++ ) { + bitmapData[offset] = Marshal.ReadByte( new IntPtr( address ) ); + address++; + } + + //Copy bitmap info + byte[] bitmapInfo = new byte[Marshal.SizeOf( bih )]; + IntPtr ptr; + ptr = Marshal.AllocHGlobal( bitmapInfo.Length ); + Marshal.StructureToPtr( bih, ptr, false ); + address = ptr.ToInt32(); + for ( int offset = 0; offset < bitmapInfo.Length; offset++ ) { + bitmapInfo[offset] = Marshal.ReadByte( new IntPtr( address ) ); + address++; + } + + //Create file header + Avi.BITMAPFILEHEADER bfh = new Avi.BITMAPFILEHEADER(); + bfh.bfType = Avi.BMP_MAGIC_COOKIE; + bfh.bfSize = (Int32)(55 + bih.biSizeImage); //size of file as written to disk + bfh.bfReserved1 = 0; + bfh.bfReserved2 = 0; + bfh.bfOffBits = Marshal.SizeOf( bih ) + Marshal.SizeOf( bfh ); + + //Create or overwrite the destination file + MemoryStream fs = new MemoryStream(); + //FileStream fs = new FileStream( dstFileName, System.IO.FileMode.Create ); + BinaryWriter bw = new BinaryWriter( fs ); + + //Write header + bw.Write( bfh.bfType ); + bw.Write( bfh.bfSize ); + bw.Write( bfh.bfReserved1 ); + bw.Write( bfh.bfReserved2 ); + bw.Write( bfh.bfOffBits ); + //Write bitmap info + bw.Write( bitmapInfo ); + //Write bitmap data + bw.Write( bitmapData ); + bw.Close(); +// fs.Close(); + fs.Flush(); + + fs.Seek( 0, SeekOrigin.Begin ); + Bitmap bmp = new Bitmap( fs ); + fs.Close(); + return bmp; + } + + + /// Exports a frame into a bitmap file + /// Position of the frame + /// Name ofthe file to store the bitmap + public void ExportBitmap( int position, String dstFileName ) { + if ( position > countFrames ) { + throw new Exception( "Invalid frame position" ); + } + + //Decompress the frame and return a pointer to the DIB + int pDib = Avi.AVIStreamGetFrame( getFrameObject, firstFrame + position ); + //Copy the bitmap header into a managed struct + Avi.BITMAPINFOHEADER bih = new Avi.BITMAPINFOHEADER(); + bih = (Avi.BITMAPINFOHEADER)Marshal.PtrToStructure( new IntPtr( pDib ), bih.GetType() ); + + /*if(bih.biBitCount < 24){ + throw new Exception("Not enough colors! DIB color depth is less than 24 bit."); + }else */ + if ( bih.biSizeImage < 1 ) { + throw new Exception( "Exception in AVIStreamGetFrame: Not bitmap decompressed." ); + } + + //Copy the image + byte[] bitmapData = new byte[bih.biSizeImage]; + int address = pDib + Marshal.SizeOf( bih ); + for ( int offset = 0; offset < bitmapData.Length; offset++ ) { + bitmapData[offset] = Marshal.ReadByte( new IntPtr( address ) ); + address++; + } + + //Copy bitmap info + byte[] bitmapInfo = new byte[Marshal.SizeOf( bih )]; + IntPtr ptr; + ptr = Marshal.AllocHGlobal( bitmapInfo.Length ); + Marshal.StructureToPtr( bih, ptr, false ); + address = ptr.ToInt32(); + for ( int offset = 0; offset < bitmapInfo.Length; offset++ ) { + bitmapInfo[offset] = Marshal.ReadByte( new IntPtr( address ) ); + address++; + } + + //Create file header + Avi.BITMAPFILEHEADER bfh = new Avi.BITMAPFILEHEADER(); + bfh.bfType = Avi.BMP_MAGIC_COOKIE; + bfh.bfSize = (Int32)(55 + bih.biSizeImage); //size of file as written to disk + bfh.bfReserved1 = 0; + bfh.bfReserved2 = 0; + bfh.bfOffBits = Marshal.SizeOf( bih ) + Marshal.SizeOf( bfh ); + + //Create or overwrite the destination file + FileStream fs = new FileStream( dstFileName, System.IO.FileMode.Create ); + BinaryWriter bw = new BinaryWriter( fs ); + + //Write header + bw.Write( bfh.bfType ); + bw.Write( bfh.bfSize ); + bw.Write( bfh.bfReserved1 ); + bw.Write( bfh.bfReserved2 ); + bw.Write( bfh.bfOffBits ); + //Write bitmap info + bw.Write( bitmapInfo ); + //Write bitmap data + bw.Write( bitmapData ); + bw.Close(); + fs.Close(); + } + } + +} diff --git a/trunk/IPlugin/IPlugin.cs b/trunk/IPlugin/IPlugin.cs new file mode 100644 index 0000000..b0a2764 --- /dev/null +++ b/trunk/IPlugin/IPlugin.cs @@ -0,0 +1,129 @@ +サソ/* + * IPlugin.cs + * Copyright (c) 2007, 2008 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace Plugin { + + + public class Constants { + /// + /// 繧ィ繝ウ繝医Μ繝シ縺斐→縺ョ險ュ螳壹′蜿ッ閭ス縺ェ繝励Λ繧ー繧、繝ウ縺ァ縺ゅk縺薙→繧定。ィ縺励∪縺吶 + /// + public const ulong LS_ENABLES_ENTRY_SETTING = 1; + /// + /// 縺薙ョ繝励Λ繧ー繧、繝ウ縺後∬ィュ螳夂畑繧ヲ繧」繝ウ繝峨え繧呈戟縺溘↑縺縺薙→繧定。ィ縺励∪縺吶 + /// + public const ulong LS_NO_EVENT_HANDLER = 2; + /// + /// 縺薙ョ繝励Λ繧ー繧、繝ウ縺後√く繝」繝ゥ繧ッ繧ソ謠冗判逕ィ縺ョ繝励Λ繧ー繧、繝ウ縺ァ縺ゅk縺薙→繧定。ィ縺励∪縺吶 + /// + public const ulong LS_TYPE_CHARACTER = 4; + } + + + /// + /// 繝。繧、繝ウ逕サ髱「縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧句、画焚縺ク縺ョ繝励Ο繧ュ繧キ繧呈署萓 + /// + public class Proxy { + + } + + + /// + /// 繝励Λ繧ー繧、繝ウ逕ィ縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞ョ夂セゥ縺励∪縺 + /// + public interface IPlugin { + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ蜷咲ァー + /// + string Name { + get; + } + + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ邁。貎斐↑隱ャ譏取枚縲 + /// + string Abstract { + get; + } + + + /// + /// 繝輔Ξ繝シ繝縺ォ蜉蟾・繧呈命縺咎未謨ー + /// + /// 蜉蟾・縺ョ蟇セ雎。 + /// 繝薙ョ繧ェ縺ョ蜈磯ュ縺九i縺ョ譎ょ綾(遘) + /// 繧ィ繝ウ繝医Μ縺ョ髢句ァ区凾蛻サ + /// 繧ィ繝ウ繝医Μ縺ョ邨ゆコ譎ょ綾 + /// 繧ィ繝ウ繝医Μ縺ョ險ュ螳壼、 + void Apply( ref Bitmap frame, float time, float e_begin, float e_end, ref string e_body ); + + + /// + /// 繝励Λ繧ー繧、繝ウ逕ィ縺ョ險ュ螳壼、繧呈シ邏阪@縺滓枚蟄怜励r謖螳壹@縺セ縺吶 + /// + /// + string Config { + get; + set; + } + + + /// + /// 繝。繧、繝ウ逕サ髱「縺ョ險隱櫁ィュ螳壹′螟画峩縺輔l縺溘→縺榊他縺ウ蜃コ縺輔l縺セ縺吶 + /// + /// + void ApplyLanguage( string language_code ); + + + /// + /// 縺薙ョ繝励Λ繧ー繧、繝ウ縺ョ險ュ螳壹Γ繝九Η繝シ縺梧款縺輔l縺滓凾蜻シ縺ウ蜃コ縺輔l縺セ縺吶 + /// + DialogResult BaseSetting(); + + + /// + /// 繧ィ繝ウ繝医Μ繝シ縺斐→縺ョ險ュ螳壹Γ繝九Η繝シ縺梧款縺輔l縺滓凾蜻シ縺ウ蜃コ縺輔l縺セ縺吶 + /// 繧ィ繝ウ繝医Μ繝シ縺斐→縺ョ險ュ螳壹ッ縲√キ繧峨$縺繧灘エ縺ァ莉サ諢上↓險ュ螳壹〒縺阪∪縺吶 + /// + /// 邱ィ髮縺吶k繧ィ繝ウ繝医Μ縺ョ險ュ螳 + DialogResult EntrySetting( ref string entry_config ); + + + /// + /// 縺薙ョ繝励Λ繧ー繧、繝ウ縺ョ繧ソ繧、繝励r謖螳壹@縺セ縺吶 + /// + ulong Type { + get; + } + + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ謠冗判髢「謨ー縲 + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ縺ョ謠冗判蜈 + /// g縺ョ繧オ繧、繧コ + /// 繝薙ョ繧ェ縺ョ蜈磯ュ縺九i縺ョ譎ょ綾 + /// 譎ょ綾time縺ォ縺翫¢繧句哨縺ョ蠖「縺後さ繝ウ繝槫玄蛻繧翫〒蛻玲嫌縺輔l縺ヲ縺繧 + /// シ井コ育エシ + void Render( Graphics g, Size size, float time, string mouth, string Reserved ); + + } +} diff --git a/trunk/IPlugin/IPlugin.csproj b/trunk/IPlugin/IPlugin.csproj new file mode 100644 index 0000000..5194710 --- /dev/null +++ b/trunk/IPlugin/IPlugin.csproj @@ -0,0 +1,74 @@ +サソ + + Debug + AnyCPU + 9.0.21022 + 2.0 + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00} + Library + Properties + IPlugin + IPlugin + + + 2.0 + v3.5 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\IPlugin.XML + + + pdbonly + true + bin\Release\ + DEBUG;TRACE + prompt + 4 + bin\Release\IPlugin.XML + + + + + + + + + + + Form + + + InputBox.cs + + + + + + + + InputBox.cs + Designer + + + + + + + + + \ No newline at end of file diff --git a/trunk/IPlugin/ISO639.cs b/trunk/IPlugin/ISO639.cs new file mode 100644 index 0000000..cc144a3 --- /dev/null +++ b/trunk/IPlugin/ISO639.cs @@ -0,0 +1,29 @@ +サソ/* + * ISO639.cs + * Copyright (c) 2007, 2008 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System.Globalization; + +namespace Plugin { + + public class ISO639 { + public static bool CheckValidity( string code_string ) { + try { + CultureInfo c = CultureInfo.CreateSpecificCulture( code_string ); + } catch { + return false; + } + return true; + } + } + +} diff --git a/trunk/IPlugin/InputBox.cs b/trunk/IPlugin/InputBox.cs new file mode 100644 index 0000000..60cb02e --- /dev/null +++ b/trunk/IPlugin/InputBox.cs @@ -0,0 +1,44 @@ +サソ/* + * InputBox.cs + * Copyright (c) 2007, 2008 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Plugin { + public partial class InputBox : Form { + + public string rText{ + get{ + return input.Text; + } + set { + input.Text = value; + } + } + + public InputBox( string title, string message ) { + InitializeComponent(); + this.message.Text = message; + this.Text = title; + } + + private void btnOK_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + this.Close(); + } + } +} \ No newline at end of file diff --git a/trunk/IPlugin/InputBox.designer.cs b/trunk/IPlugin/InputBox.designer.cs new file mode 100644 index 0000000..bf31744 --- /dev/null +++ b/trunk/IPlugin/InputBox.designer.cs @@ -0,0 +1,111 @@ +サソ/* + * InputBox.designer.cs + * Copyright (c) 2007, 2008 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Plugin { + partial class InputBox { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.message = new System.Windows.Forms.Label(); + this.input = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 114, 73 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 1; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 208, 73 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // message + // + this.message.AutoEllipsis = true; + this.message.AutoSize = true; + this.message.Location = new System.Drawing.Point( 12, 9 ); + this.message.Name = "message"; + this.message.Size = new System.Drawing.Size( 50, 12 ); + this.message.TabIndex = 2; + this.message.Text = "message"; + // + // input + // + this.input.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.input.Location = new System.Drawing.Point( 29, 35 ); + this.input.Name = "input"; + this.input.Size = new System.Drawing.Size( 254, 19 ); + this.input.TabIndex = 0; + // + // InputBox + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 298, 113 ); + this.Controls.Add( this.input ); + this.Controls.Add( this.message ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "InputBox"; + this.Text = "InputBox"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label message; + private System.Windows.Forms.TextBox input; + } +} \ No newline at end of file diff --git a/trunk/IPlugin/InputBox.resx b/trunk/IPlugin/InputBox.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/trunk/IPlugin/InputBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/trunk/IPlugin/Properties/AssemblyInfo.cs b/trunk/IPlugin/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6a9e8a0 --- /dev/null +++ b/trunk/IPlugin/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "IPlugin" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Boare" )] +[assembly: AssemblyProduct( "IPlugin" )] +[assembly: AssemblyCopyright( "Copyright (C) 2007" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√%縺ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九ッ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医↓縺ッ +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "eb60d449-2a04-4bc0-b45c-d4ebf429cf13" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝ェ繝薙ず繝ァ繝ウ縺翫h縺ウ繝薙Ν繝臥分蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/IPlugin/makefile b/trunk/IPlugin/makefile new file mode 100644 index 0000000..9cfce04 --- /dev/null +++ b/trunk/IPlugin/makefile @@ -0,0 +1,10 @@ +CP=cp +RM=rm +OPT=-r:System,System.Drawing,System.Windows.Forms +IPLUGIN_SRC=IPlugin.cs ISO639.cs InputBox.cs InputBox.designer.cs + +IPlugin.dll: $(IPLUGIN_SRC) + gmcs -target:library -out:IPlugin.dll $(IPLUGIN_SRC) $(OPT) + +clean: + $(RM) IPlugin.dll diff --git a/trunk/JVsq/build.xml b/trunk/JVsq/build.xml new file mode 100644 index 0000000..41cd686 --- /dev/null +++ b/trunk/JVsq/build.xml @@ -0,0 +1,69 @@ + + + + + + Builds, tests, and runs the project JVsq. + + + diff --git a/trunk/JVsq/nbproject/build-impl.xml b/trunk/JVsq/nbproject/build-impl.xml new file mode 100644 index 0000000..27c520d --- /dev/null +++ b/trunk/JVsq/nbproject/build-impl.xml @@ -0,0 +1,629 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + diff --git a/trunk/JVsq/nbproject/genfiles.properties b/trunk/JVsq/nbproject/genfiles.properties new file mode 100644 index 0000000..fb72ef9 --- /dev/null +++ b/trunk/JVsq/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=56626a14 +build.xml.script.CRC32=9b5d8d76 +build.xml.stylesheet.CRC32=be360661 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=56626a14 +nbproject/build-impl.xml.script.CRC32=c54cb890 +nbproject/build-impl.xml.stylesheet.CRC32=487672f9 diff --git a/trunk/JVsq/nbproject/project.properties b/trunk/JVsq/nbproject/project.properties new file mode 100644 index 0000000..e901ce6 --- /dev/null +++ b/trunk/JVsq/nbproject/project.properties @@ -0,0 +1,57 @@ +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/JVsq.jar +dist.javadoc.dir=${dist.dir}/javadoc +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath}:\ + ${libs.junit_4.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/trunk/JVsq/nbproject/project.xml b/trunk/JVsq/nbproject/project.xml new file mode 100644 index 0000000..3b64cc4 --- /dev/null +++ b/trunk/JVsq/nbproject/project.xml @@ -0,0 +1,16 @@ + + + org.netbeans.modules.java.j2seproject + + + JVsq + 1.6.5 + + + + + + + + + diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932.java b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932.java new file mode 100644 index 0000000..a5c2f3b --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932.java @@ -0,0 +1,130 @@ +/* + * cp932.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.bocoree + * + * jp.sourceforge.lipsync.bocoree is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.bocoree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.bocoree; + +import java.util.*; +import java.nio.charset.*; + +public class cp932 { + //private static HashMap _DICT = new HashMap(); + private static boolean m_initialized = false; + private static boolean m_cp932_available = false; + //private static Charset m_cp932 = null; + private static String s_sjis = "Shift_JIS"; + + private static int attatchKey( int key ) { + if ( cp932_a.getMinKey() <= key && key <= cp932_a.getMaxKey() ) { + return cp932_a.get( key ); + } else if ( cp932_b.getMinKey() <= key && key <= cp932_b.getMaxKey() ) { + return cp932_b.get( key ); + } else if ( cp932_c.getMinKey() <= key && key <= cp932_c.getMaxKey() ) { + return cp932_c.get( key ); + } else { + return -1; + } + } + + private static void init() { + m_cp932_available = Charset.isSupported( "Shift_JIS" ); + m_initialized = true; + } + + public static byte[] convert( String str ) { + if ( !m_initialized ) { + init(); + } + if ( m_cp932_available ) { + byte[] ret; + try{ + ret = str.getBytes( s_sjis ); + }catch( Exception e ){ + ret = new byte[0]; + } + return ret; + } else { + char[] arr = str.toCharArray(); + ArrayList list = new ArrayList(); + for ( int i = 0; i < arr.length; i++ ) { + int att = attatchKey( arr[i] ); + if ( att >= 0 ) { + if ( att > 0xff ) { + byte b1 = (byte) (att >> 8); + byte b2 = (byte) (att - (b1 << 8)); + list.add( b1 ); + list.add( b2 ); + } else { + list.add( (byte) att ); + } + } else { + list.add( 0x63 ); + } + } + byte[] ret = new byte[list.size()]; + for ( int i = 0; i < list.size(); i++ ) { + Integer value = (Integer) list.get( i ); + ret[i] = (byte) value.intValue(); + } + return ret; + } + } + + public static String convert( byte[] dat ) { + if ( !m_initialized ) { + init(); + } + if ( m_cp932_available ) { + String ret; + try{ + ret = new String( dat, s_sjis ); + }catch( Exception e ){ + ret = ""; + } + return ret; + } else { + StringBuilder sb = new StringBuilder(); + /*int i = 0; + while ( i < dat.length ) { + int b1 = dat[i]; + boolean found = false; + for ( Iterator keys = _DICT.keySet().iterator(); keys.hasNext();) { + int key = ((Integer) keys.next()).intValue(); + int test = (Integer) _DICT.get( key ); + if ( b1 == test ) { + found = true; + char ch = (char) key; + sb.append( ch + "" ); + break; + } + } + i++; + if ( !found && i < dat.length ) { + int b2 = (dat[i - 1] << 8) + dat[i]; + for ( Iterator keys = _DICT.keySet().iterator(); keys.hasNext();) { + Integer key = (Integer) keys.next(); + int test = ((Integer) _DICT.get( key )).intValue(); + if ( test == b2 ) { + int ik = key.intValue(); + char ch = (char) ik; + sb.append( ch + "" ); + break; + } + } + i++; + } + }*/ + return sb.toString(); + } + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_a.java b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_a.java new file mode 100644 index 0000000..3680c35 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_a.java @@ -0,0 +1,3093 @@ +/* + * cp932_a.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.bocoree + * + * jp.sourceforge.lipsync.bocoree is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.bocoree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.bocoree; + +import java.util.*; + +public class cp932_a { + private static HashMap _DICT = new HashMap(); + private static boolean m_initialized = false; + + public static int getMinKey() { + return 0; + } + + public static int getMaxKey() { + return 26333; + } + + public static int get( int key ) { + if( !m_initialized ){ + init(); + } + if ( _DICT.containsKey( key ) ) { + return ((Integer) _DICT.get( key )).intValue(); + } else { + return -1; + } + } + + private static void init() { + _DICT.put( 0, 0 ); + _DICT.put( 1, 1 ); + _DICT.put( 2, 2 ); + _DICT.put( 3, 3 ); + _DICT.put( 4, 4 ); + _DICT.put( 5, 5 ); + _DICT.put( 6, 6 ); + _DICT.put( 7, 7 ); + _DICT.put( 8, 8 ); + _DICT.put( 9, 9 ); + _DICT.put( 10, 10 ); + _DICT.put( 11, 11 ); + _DICT.put( 12, 12 ); + _DICT.put( 13, 13 ); + _DICT.put( 14, 14 ); + _DICT.put( 15, 15 ); + _DICT.put( 16, 16 ); + _DICT.put( 17, 17 ); + _DICT.put( 18, 18 ); + _DICT.put( 19, 19 ); + _DICT.put( 20, 20 ); + _DICT.put( 21, 21 ); + _DICT.put( 22, 22 ); + _DICT.put( 23, 23 ); + _DICT.put( 24, 24 ); + _DICT.put( 25, 25 ); + _DICT.put( 26, 26 ); + _DICT.put( 27, 27 ); + _DICT.put( 28, 28 ); + _DICT.put( 29, 29 ); + _DICT.put( 30, 30 ); + _DICT.put( 31, 31 ); + _DICT.put( 32, 32 ); + _DICT.put( 33, 33 ); + _DICT.put( 34, 34 ); + _DICT.put( 35, 35 ); + _DICT.put( 36, 36 ); + _DICT.put( 37, 37 ); + _DICT.put( 38, 38 ); + _DICT.put( 39, 39 ); + _DICT.put( 40, 40 ); + _DICT.put( 41, 41 ); + _DICT.put( 42, 42 ); + _DICT.put( 43, 43 ); + _DICT.put( 44, 44 ); + _DICT.put( 45, 45 ); + _DICT.put( 46, 46 ); + _DICT.put( 47, 47 ); + _DICT.put( 48, 48 ); + _DICT.put( 49, 49 ); + _DICT.put( 50, 50 ); + _DICT.put( 51, 51 ); + _DICT.put( 52, 52 ); + _DICT.put( 53, 53 ); + _DICT.put( 54, 54 ); + _DICT.put( 55, 55 ); + _DICT.put( 56, 56 ); + _DICT.put( 57, 57 ); + _DICT.put( 58, 58 ); + _DICT.put( 59, 59 ); + _DICT.put( 60, 60 ); + _DICT.put( 61, 61 ); + _DICT.put( 62, 62 ); + _DICT.put( 64, 64 ); + _DICT.put( 65, 65 ); + _DICT.put( 66, 66 ); + _DICT.put( 67, 67 ); + _DICT.put( 68, 68 ); + _DICT.put( 69, 69 ); + _DICT.put( 70, 70 ); + _DICT.put( 71, 71 ); + _DICT.put( 72, 72 ); + _DICT.put( 73, 73 ); + _DICT.put( 74, 74 ); + _DICT.put( 75, 75 ); + _DICT.put( 76, 76 ); + _DICT.put( 77, 77 ); + _DICT.put( 78, 78 ); + _DICT.put( 79, 79 ); + _DICT.put( 80, 80 ); + _DICT.put( 81, 81 ); + _DICT.put( 82, 82 ); + _DICT.put( 83, 83 ); + _DICT.put( 84, 84 ); + _DICT.put( 85, 85 ); + _DICT.put( 86, 86 ); + _DICT.put( 87, 87 ); + _DICT.put( 88, 88 ); + _DICT.put( 89, 89 ); + _DICT.put( 90, 90 ); + _DICT.put( 91, 91 ); + _DICT.put( 92, 92 ); + _DICT.put( 93, 93 ); + _DICT.put( 94, 94 ); + _DICT.put( 95, 95 ); + _DICT.put( 96, 96 ); + _DICT.put( 97, 97 ); + _DICT.put( 98, 98 ); + _DICT.put( 99, 99 ); + _DICT.put( 100, 100 ); + _DICT.put( 101, 101 ); + _DICT.put( 102, 102 ); + _DICT.put( 103, 103 ); + _DICT.put( 104, 104 ); + _DICT.put( 105, 105 ); + _DICT.put( 106, 106 ); + _DICT.put( 107, 107 ); + _DICT.put( 108, 108 ); + _DICT.put( 109, 109 ); + _DICT.put( 110, 110 ); + _DICT.put( 111, 111 ); + _DICT.put( 112, 112 ); + _DICT.put( 113, 113 ); + _DICT.put( 114, 114 ); + _DICT.put( 115, 115 ); + _DICT.put( 116, 116 ); + _DICT.put( 117, 117 ); + _DICT.put( 118, 118 ); + _DICT.put( 119, 119 ); + _DICT.put( 120, 120 ); + _DICT.put( 121, 121 ); + _DICT.put( 122, 122 ); + _DICT.put( 123, 123 ); + _DICT.put( 124, 124 ); + _DICT.put( 125, 125 ); + _DICT.put( 126, 126 ); + _DICT.put( 127, 127 ); + _DICT.put( 128, 128 ); + _DICT.put( 161, 33 ); + _DICT.put( 162, 33169 ); + _DICT.put( 163, 33170 ); + _DICT.put( 165, 92 ); + _DICT.put( 166, 124 ); + _DICT.put( 167, 33176 ); + _DICT.put( 168, 33102 ); + _DICT.put( 169, 99 ); + _DICT.put( 170, 97 ); + _DICT.put( 171, 33249 ); + _DICT.put( 172, 33226 ); + _DICT.put( 173, 45 ); + _DICT.put( 174, 82 ); + _DICT.put( 175, 33104 ); + _DICT.put( 176, 33163 ); + _DICT.put( 177, 33149 ); + _DICT.put( 178, 50 ); + _DICT.put( 179, 51 ); + _DICT.put( 180, 33100 ); + _DICT.put( 181, 33738 ); + _DICT.put( 182, 33271 ); + _DICT.put( 183, 33093 ); + _DICT.put( 184, 33091 ); + _DICT.put( 185, 49 ); + _DICT.put( 186, 111 ); + _DICT.put( 187, 33250 ); + _DICT.put( 192, 65 ); + _DICT.put( 193, 65 ); + _DICT.put( 194, 65 ); + _DICT.put( 195, 65 ); + _DICT.put( 196, 65 ); + _DICT.put( 197, 65 ); + _DICT.put( 198, 65 ); + _DICT.put( 199, 67 ); + _DICT.put( 200, 69 ); + _DICT.put( 201, 69 ); + _DICT.put( 202, 69 ); + _DICT.put( 203, 69 ); + _DICT.put( 204, 73 ); + _DICT.put( 205, 73 ); + _DICT.put( 206, 73 ); + _DICT.put( 207, 73 ); + _DICT.put( 208, 68 ); + _DICT.put( 209, 78 ); + _DICT.put( 210, 79 ); + _DICT.put( 211, 79 ); + _DICT.put( 212, 79 ); + _DICT.put( 213, 79 ); + _DICT.put( 214, 79 ); + _DICT.put( 215, 33150 ); + _DICT.put( 216, 79 ); + _DICT.put( 217, 85 ); + _DICT.put( 218, 85 ); + _DICT.put( 219, 85 ); + _DICT.put( 220, 85 ); + _DICT.put( 221, 89 ); + _DICT.put( 222, 84 ); + _DICT.put( 223, 115 ); + _DICT.put( 224, 97 ); + _DICT.put( 225, 97 ); + _DICT.put( 226, 97 ); + _DICT.put( 227, 97 ); + _DICT.put( 228, 97 ); + _DICT.put( 229, 97 ); + _DICT.put( 230, 97 ); + _DICT.put( 231, 99 ); + _DICT.put( 232, 101 ); + _DICT.put( 233, 101 ); + _DICT.put( 234, 101 ); + _DICT.put( 235, 101 ); + _DICT.put( 236, 105 ); + _DICT.put( 237, 105 ); + _DICT.put( 238, 105 ); + _DICT.put( 239, 105 ); + _DICT.put( 240, 100 ); + _DICT.put( 241, 110 ); + _DICT.put( 242, 111 ); + _DICT.put( 243, 111 ); + _DICT.put( 244, 111 ); + _DICT.put( 245, 111 ); + _DICT.put( 246, 111 ); + _DICT.put( 247, 33152 ); + _DICT.put( 248, 111 ); + _DICT.put( 249, 117 ); + _DICT.put( 250, 117 ); + _DICT.put( 251, 117 ); + _DICT.put( 252, 117 ); + _DICT.put( 253, 121 ); + _DICT.put( 254, 116 ); + _DICT.put( 255, 121 ); + _DICT.put( 913, 33695 ); + _DICT.put( 914, 33696 ); + _DICT.put( 915, 33697 ); + _DICT.put( 916, 33698 ); + _DICT.put( 917, 33699 ); + _DICT.put( 918, 33700 ); + _DICT.put( 919, 33701 ); + _DICT.put( 920, 33702 ); + _DICT.put( 921, 33703 ); + _DICT.put( 922, 33704 ); + _DICT.put( 923, 33705 ); + _DICT.put( 924, 33706 ); + _DICT.put( 925, 33707 ); + _DICT.put( 926, 33708 ); + _DICT.put( 927, 33709 ); + _DICT.put( 928, 33710 ); + _DICT.put( 929, 33711 ); + _DICT.put( 931, 33712 ); + _DICT.put( 932, 33713 ); + _DICT.put( 933, 33714 ); + _DICT.put( 934, 33715 ); + _DICT.put( 935, 33716 ); + _DICT.put( 936, 33717 ); + _DICT.put( 937, 33718 ); + _DICT.put( 945, 33727 ); + _DICT.put( 946, 33728 ); + _DICT.put( 947, 33729 ); + _DICT.put( 948, 33730 ); + _DICT.put( 949, 33731 ); + _DICT.put( 950, 33732 ); + _DICT.put( 951, 33733 ); + _DICT.put( 952, 33734 ); + _DICT.put( 953, 33735 ); + _DICT.put( 954, 33736 ); + _DICT.put( 955, 33737 ); + _DICT.put( 956, 33738 ); + _DICT.put( 957, 33739 ); + _DICT.put( 958, 33740 ); + _DICT.put( 959, 33741 ); + _DICT.put( 960, 33742 ); + _DICT.put( 961, 33743 ); + _DICT.put( 963, 33744 ); + _DICT.put( 964, 33745 ); + _DICT.put( 965, 33746 ); + _DICT.put( 966, 33747 ); + _DICT.put( 967, 33748 ); + _DICT.put( 968, 33749 ); + _DICT.put( 969, 33750 ); + _DICT.put( 1025, 33862 ); + _DICT.put( 1040, 33856 ); + _DICT.put( 1041, 33857 ); + _DICT.put( 1042, 33858 ); + _DICT.put( 1043, 33859 ); + _DICT.put( 1044, 33860 ); + _DICT.put( 1045, 33861 ); + _DICT.put( 1046, 33863 ); + _DICT.put( 1047, 33864 ); + _DICT.put( 1048, 33865 ); + _DICT.put( 1049, 33866 ); + _DICT.put( 1050, 33867 ); + _DICT.put( 1051, 33868 ); + _DICT.put( 1052, 33869 ); + _DICT.put( 1053, 33870 ); + _DICT.put( 1054, 33871 ); + _DICT.put( 1055, 33872 ); + _DICT.put( 1056, 33873 ); + _DICT.put( 1057, 33874 ); + _DICT.put( 1058, 33875 ); + _DICT.put( 1059, 33876 ); + _DICT.put( 1060, 33877 ); + _DICT.put( 1061, 33878 ); + _DICT.put( 1062, 33879 ); + _DICT.put( 1063, 33880 ); + _DICT.put( 1064, 33881 ); + _DICT.put( 1065, 33882 ); + _DICT.put( 1066, 33883 ); + _DICT.put( 1067, 33884 ); + _DICT.put( 1068, 33885 ); + _DICT.put( 1069, 33886 ); + _DICT.put( 1070, 33887 ); + _DICT.put( 1071, 33888 ); + _DICT.put( 1072, 33904 ); + _DICT.put( 1073, 33905 ); + _DICT.put( 1074, 33906 ); + _DICT.put( 1075, 33907 ); + _DICT.put( 1076, 33908 ); + _DICT.put( 1077, 33909 ); + _DICT.put( 1078, 33911 ); + _DICT.put( 1079, 33912 ); + _DICT.put( 1080, 33913 ); + _DICT.put( 1081, 33914 ); + _DICT.put( 1082, 33915 ); + _DICT.put( 1083, 33916 ); + _DICT.put( 1084, 33917 ); + _DICT.put( 1085, 33918 ); + _DICT.put( 1086, 33920 ); + _DICT.put( 1087, 33921 ); + _DICT.put( 1088, 33922 ); + _DICT.put( 1089, 33923 ); + _DICT.put( 1090, 33924 ); + _DICT.put( 1091, 33925 ); + _DICT.put( 1092, 33926 ); + _DICT.put( 1093, 33927 ); + _DICT.put( 1094, 33928 ); + _DICT.put( 1095, 33929 ); + _DICT.put( 1096, 33930 ); + _DICT.put( 1097, 33931 ); + _DICT.put( 1098, 33932 ); + _DICT.put( 1099, 33933 ); + _DICT.put( 1100, 33934 ); + _DICT.put( 1101, 33935 ); + _DICT.put( 1102, 33936 ); + _DICT.put( 1103, 33937 ); + _DICT.put( 1105, 33910 ); + _DICT.put( 8208, 33117 ); + _DICT.put( 8213, 33116 ); + _DICT.put( 8216, 33125 ); + _DICT.put( 8217, 33126 ); + _DICT.put( 8220, 33127 ); + _DICT.put( 8221, 33128 ); + _DICT.put( 8224, 33269 ); + _DICT.put( 8225, 33270 ); + _DICT.put( 8229, 33124 ); + _DICT.put( 8230, 33123 ); + _DICT.put( 8240, 33265 ); + _DICT.put( 8242, 33164 ); + _DICT.put( 8243, 33165 ); + _DICT.put( 8251, 33190 ); + _DICT.put( 8451, 33166 ); + _DICT.put( 8470, 34690 ); + _DICT.put( 8481, 34692 ); + _DICT.put( 8491, 33264 ); + _DICT.put( 8544, 34644 ); + _DICT.put( 8545, 34645 ); + _DICT.put( 8546, 34646 ); + _DICT.put( 8547, 34647 ); + _DICT.put( 8548, 34648 ); + _DICT.put( 8549, 34649 ); + _DICT.put( 8550, 34650 ); + _DICT.put( 8551, 34651 ); + _DICT.put( 8552, 34652 ); + _DICT.put( 8553, 34653 ); + _DICT.put( 8560, 64064 ); + _DICT.put( 8561, 64065 ); + _DICT.put( 8562, 64066 ); + _DICT.put( 8563, 64067 ); + _DICT.put( 8564, 64068 ); + _DICT.put( 8565, 64069 ); + _DICT.put( 8566, 64070 ); + _DICT.put( 8567, 64071 ); + _DICT.put( 8568, 64072 ); + _DICT.put( 8569, 64073 ); + _DICT.put( 8592, 33193 ); + _DICT.put( 8593, 33194 ); + _DICT.put( 8594, 33192 ); + _DICT.put( 8595, 33195 ); + _DICT.put( 8658, 33227 ); + _DICT.put( 8660, 33228 ); + _DICT.put( 8704, 33229 ); + _DICT.put( 8706, 33245 ); + _DICT.put( 8707, 33230 ); + _DICT.put( 8711, 33246 ); + _DICT.put( 8712, 33208 ); + _DICT.put( 8715, 33209 ); + _DICT.put( 8721, 34708 ); + _DICT.put( 8730, 33251 ); + _DICT.put( 8733, 33253 ); + _DICT.put( 8734, 33159 ); + _DICT.put( 8735, 34712 ); + _DICT.put( 8736, 33242 ); + _DICT.put( 8741, 33121 ); + _DICT.put( 8743, 33224 ); + _DICT.put( 8744, 33225 ); + _DICT.put( 8745, 33215 ); + _DICT.put( 8746, 33214 ); + _DICT.put( 8747, 33255 ); + _DICT.put( 8748, 33256 ); + _DICT.put( 8750, 34707 ); + _DICT.put( 8756, 33160 ); + _DICT.put( 8757, 33254 ); + _DICT.put( 8765, 33252 ); + _DICT.put( 8786, 33248 ); + _DICT.put( 8800, 33154 ); + _DICT.put( 8801, 33247 ); + _DICT.put( 8806, 33157 ); + _DICT.put( 8807, 33158 ); + _DICT.put( 8810, 33249 ); + _DICT.put( 8811, 33250 ); + _DICT.put( 8834, 33212 ); + _DICT.put( 8835, 33213 ); + _DICT.put( 8838, 33210 ); + _DICT.put( 8839, 33211 ); + _DICT.put( 8869, 33243 ); + _DICT.put( 8895, 34713 ); + _DICT.put( 8978, 33244 ); + _DICT.put( 9312, 34624 ); + _DICT.put( 9313, 34625 ); + _DICT.put( 9314, 34626 ); + _DICT.put( 9315, 34627 ); + _DICT.put( 9316, 34628 ); + _DICT.put( 9317, 34629 ); + _DICT.put( 9318, 34630 ); + _DICT.put( 9319, 34631 ); + _DICT.put( 9320, 34632 ); + _DICT.put( 9321, 34633 ); + _DICT.put( 9322, 34634 ); + _DICT.put( 9323, 34635 ); + _DICT.put( 9324, 34636 ); + _DICT.put( 9325, 34637 ); + _DICT.put( 9326, 34638 ); + _DICT.put( 9327, 34639 ); + _DICT.put( 9328, 34640 ); + _DICT.put( 9329, 34641 ); + _DICT.put( 9330, 34642 ); + _DICT.put( 9331, 34643 ); + _DICT.put( 9472, 33951 ); + _DICT.put( 9473, 33962 ); + _DICT.put( 9474, 33952 ); + _DICT.put( 9475, 33963 ); + _DICT.put( 9484, 33953 ); + _DICT.put( 9487, 33964 ); + _DICT.put( 9488, 33954 ); + _DICT.put( 9491, 33965 ); + _DICT.put( 9492, 33956 ); + _DICT.put( 9495, 33967 ); + _DICT.put( 9496, 33955 ); + _DICT.put( 9499, 33966 ); + _DICT.put( 9500, 33957 ); + _DICT.put( 9501, 33978 ); + _DICT.put( 9504, 33973 ); + _DICT.put( 9507, 33968 ); + _DICT.put( 9508, 33959 ); + _DICT.put( 9509, 33980 ); + _DICT.put( 9512, 33975 ); + _DICT.put( 9515, 33970 ); + _DICT.put( 9516, 33958 ); + _DICT.put( 9519, 33974 ); + _DICT.put( 9520, 33979 ); + _DICT.put( 9523, 33969 ); + _DICT.put( 9524, 33960 ); + _DICT.put( 9527, 33976 ); + _DICT.put( 9528, 33981 ); + _DICT.put( 9531, 33971 ); + _DICT.put( 9532, 33961 ); + _DICT.put( 9535, 33977 ); + _DICT.put( 9538, 33982 ); + _DICT.put( 9547, 33972 ); + _DICT.put( 9632, 33185 ); + _DICT.put( 9633, 33184 ); + _DICT.put( 9650, 33187 ); + _DICT.put( 9651, 33186 ); + _DICT.put( 9660, 33189 ); + _DICT.put( 9661, 33188 ); + _DICT.put( 9670, 33183 ); + _DICT.put( 9671, 33182 ); + _DICT.put( 9675, 33179 ); + _DICT.put( 9678, 33181 ); + _DICT.put( 9679, 33180 ); + _DICT.put( 9711, 33276 ); + _DICT.put( 9733, 33178 ); + _DICT.put( 9734, 33177 ); + _DICT.put( 9792, 33162 ); + _DICT.put( 9794, 33161 ); + _DICT.put( 9834, 33268 ); + _DICT.put( 9837, 33267 ); + _DICT.put( 9839, 33266 ); + _DICT.put( 12288, 33088 ); + _DICT.put( 12289, 33089 ); + _DICT.put( 12290, 33090 ); + _DICT.put( 12291, 33110 ); + _DICT.put( 12293, 33112 ); + _DICT.put( 12294, 33113 ); + _DICT.put( 12295, 33114 ); + _DICT.put( 12296, 33137 ); + _DICT.put( 12297, 33138 ); + _DICT.put( 12298, 33139 ); + _DICT.put( 12299, 33140 ); + _DICT.put( 12300, 33141 ); + _DICT.put( 12301, 33142 ); + _DICT.put( 12302, 33143 ); + _DICT.put( 12303, 33144 ); + _DICT.put( 12304, 33145 ); + _DICT.put( 12305, 33146 ); + _DICT.put( 12306, 33191 ); + _DICT.put( 12307, 33196 ); + _DICT.put( 12308, 33131 ); + _DICT.put( 12309, 33132 ); + _DICT.put( 12317, 34688 ); + _DICT.put( 12319, 34689 ); + _DICT.put( 12353, 33439 ); + _DICT.put( 12354, 33440 ); + _DICT.put( 12355, 33441 ); + _DICT.put( 12356, 33442 ); + _DICT.put( 12357, 33443 ); + _DICT.put( 12358, 33444 ); + _DICT.put( 12359, 33445 ); + _DICT.put( 12360, 33446 ); + _DICT.put( 12361, 33447 ); + _DICT.put( 12362, 33448 ); + _DICT.put( 12363, 33449 ); + _DICT.put( 12364, 33450 ); + _DICT.put( 12365, 33451 ); + _DICT.put( 12366, 33452 ); + _DICT.put( 12367, 33453 ); + _DICT.put( 12368, 33454 ); + _DICT.put( 12369, 33455 ); + _DICT.put( 12370, 33456 ); + _DICT.put( 12371, 33457 ); + _DICT.put( 12372, 33458 ); + _DICT.put( 12373, 33459 ); + _DICT.put( 12374, 33460 ); + _DICT.put( 12375, 33461 ); + _DICT.put( 12376, 33462 ); + _DICT.put( 12377, 33463 ); + _DICT.put( 12378, 33464 ); + _DICT.put( 12379, 33465 ); + _DICT.put( 12380, 33466 ); + _DICT.put( 12381, 33467 ); + _DICT.put( 12382, 33468 ); + _DICT.put( 12383, 33469 ); + _DICT.put( 12384, 33470 ); + _DICT.put( 12385, 33471 ); + _DICT.put( 12386, 33472 ); + _DICT.put( 12387, 33473 ); + _DICT.put( 12388, 33474 ); + _DICT.put( 12389, 33475 ); + _DICT.put( 12390, 33476 ); + _DICT.put( 12391, 33477 ); + _DICT.put( 12392, 33478 ); + _DICT.put( 12393, 33479 ); + _DICT.put( 12394, 33480 ); + _DICT.put( 12395, 33481 ); + _DICT.put( 12396, 33482 ); + _DICT.put( 12397, 33483 ); + _DICT.put( 12398, 33484 ); + _DICT.put( 12399, 33485 ); + _DICT.put( 12400, 33486 ); + _DICT.put( 12401, 33487 ); + _DICT.put( 12402, 33488 ); + _DICT.put( 12403, 33489 ); + _DICT.put( 12404, 33490 ); + _DICT.put( 12405, 33491 ); + _DICT.put( 12406, 33492 ); + _DICT.put( 12407, 33493 ); + _DICT.put( 12408, 33494 ); + _DICT.put( 12409, 33495 ); + _DICT.put( 12410, 33496 ); + _DICT.put( 12411, 33497 ); + _DICT.put( 12412, 33498 ); + _DICT.put( 12413, 33499 ); + _DICT.put( 12414, 33500 ); + _DICT.put( 12415, 33501 ); + _DICT.put( 12416, 33502 ); + _DICT.put( 12417, 33503 ); + _DICT.put( 12418, 33504 ); + _DICT.put( 12419, 33505 ); + _DICT.put( 12420, 33506 ); + _DICT.put( 12421, 33507 ); + _DICT.put( 12422, 33508 ); + _DICT.put( 12423, 33509 ); + _DICT.put( 12424, 33510 ); + _DICT.put( 12425, 33511 ); + _DICT.put( 12426, 33512 ); + _DICT.put( 12427, 33513 ); + _DICT.put( 12428, 33514 ); + _DICT.put( 12429, 33515 ); + _DICT.put( 12430, 33516 ); + _DICT.put( 12431, 33517 ); + _DICT.put( 12432, 33518 ); + _DICT.put( 12433, 33519 ); + _DICT.put( 12434, 33520 ); + _DICT.put( 12435, 33521 ); + _DICT.put( 12436, 33684 ); + _DICT.put( 12443, 33098 ); + _DICT.put( 12444, 33099 ); + _DICT.put( 12445, 33108 ); + _DICT.put( 12446, 33109 ); + _DICT.put( 12449, 33600 ); + _DICT.put( 12450, 33601 ); + _DICT.put( 12451, 33602 ); + _DICT.put( 12452, 33603 ); + _DICT.put( 12453, 33604 ); + _DICT.put( 12454, 33605 ); + _DICT.put( 12455, 33606 ); + _DICT.put( 12456, 33607 ); + _DICT.put( 12457, 33608 ); + _DICT.put( 12458, 33609 ); + _DICT.put( 12459, 33610 ); + _DICT.put( 12460, 33611 ); + _DICT.put( 12461, 33612 ); + _DICT.put( 12462, 33613 ); + _DICT.put( 12463, 33614 ); + _DICT.put( 12464, 33615 ); + _DICT.put( 12465, 33616 ); + _DICT.put( 12466, 33617 ); + _DICT.put( 12467, 33618 ); + _DICT.put( 12468, 33619 ); + _DICT.put( 12469, 33620 ); + _DICT.put( 12470, 33621 ); + _DICT.put( 12471, 33622 ); + _DICT.put( 12472, 33623 ); + _DICT.put( 12473, 33624 ); + _DICT.put( 12474, 33625 ); + _DICT.put( 12475, 33626 ); + _DICT.put( 12476, 33627 ); + _DICT.put( 12477, 33628 ); + _DICT.put( 12478, 33629 ); + _DICT.put( 12479, 33630 ); + _DICT.put( 12480, 33631 ); + _DICT.put( 12481, 33632 ); + _DICT.put( 12482, 33633 ); + _DICT.put( 12483, 33634 ); + _DICT.put( 12484, 33635 ); + _DICT.put( 12485, 33636 ); + _DICT.put( 12486, 33637 ); + _DICT.put( 12487, 33638 ); + _DICT.put( 12488, 33639 ); + _DICT.put( 12489, 33640 ); + _DICT.put( 12490, 33641 ); + _DICT.put( 12491, 33642 ); + _DICT.put( 12492, 33643 ); + _DICT.put( 12493, 33644 ); + _DICT.put( 12494, 33645 ); + _DICT.put( 12495, 33646 ); + _DICT.put( 12496, 33647 ); + _DICT.put( 12497, 33648 ); + _DICT.put( 12498, 33649 ); + _DICT.put( 12499, 33650 ); + _DICT.put( 12500, 33651 ); + _DICT.put( 12501, 33652 ); + _DICT.put( 12502, 33653 ); + _DICT.put( 12503, 33654 ); + _DICT.put( 12504, 33655 ); + _DICT.put( 12505, 33656 ); + _DICT.put( 12506, 33657 ); + _DICT.put( 12507, 33658 ); + _DICT.put( 12508, 33659 ); + _DICT.put( 12509, 33660 ); + _DICT.put( 12510, 33661 ); + _DICT.put( 12511, 33662 ); + _DICT.put( 12512, 33664 ); + _DICT.put( 12513, 33665 ); + _DICT.put( 12514, 33666 ); + _DICT.put( 12515, 33667 ); + _DICT.put( 12516, 33668 ); + _DICT.put( 12517, 33669 ); + _DICT.put( 12518, 33670 ); + _DICT.put( 12519, 33671 ); + _DICT.put( 12520, 33672 ); + _DICT.put( 12521, 33673 ); + _DICT.put( 12522, 33674 ); + _DICT.put( 12523, 33675 ); + _DICT.put( 12524, 33676 ); + _DICT.put( 12525, 33677 ); + _DICT.put( 12526, 33678 ); + _DICT.put( 12527, 33679 ); + _DICT.put( 12528, 33680 ); + _DICT.put( 12529, 33681 ); + _DICT.put( 12530, 33682 ); + _DICT.put( 12531, 33683 ); + _DICT.put( 12532, 33684 ); + _DICT.put( 12533, 33685 ); + _DICT.put( 12534, 33686 ); + _DICT.put( 12539, 33093 ); + _DICT.put( 12540, 33115 ); + _DICT.put( 12541, 33106 ); + _DICT.put( 12542, 33107 ); + _DICT.put( 12849, 34698 ); + _DICT.put( 12850, 34699 ); + _DICT.put( 12857, 34700 ); + _DICT.put( 12964, 34693 ); + _DICT.put( 12965, 34694 ); + _DICT.put( 12966, 34695 ); + _DICT.put( 12967, 34696 ); + _DICT.put( 12968, 34697 ); + _DICT.put( 13059, 34661 ); + _DICT.put( 13069, 34665 ); + _DICT.put( 13076, 34656 ); + _DICT.put( 13080, 34659 ); + _DICT.put( 13090, 34657 ); + _DICT.put( 13091, 34667 ); + _DICT.put( 13094, 34666 ); + _DICT.put( 13095, 34660 ); + _DICT.put( 13099, 34668 ); + _DICT.put( 13110, 34662 ); + _DICT.put( 13115, 34670 ); + _DICT.put( 13129, 34655 ); + _DICT.put( 13130, 34669 ); + _DICT.put( 13133, 34658 ); + _DICT.put( 13137, 34663 ); + _DICT.put( 13143, 34664 ); + _DICT.put( 13179, 34686 ); + _DICT.put( 13180, 34703 ); + _DICT.put( 13181, 34702 ); + _DICT.put( 13182, 34701 ); + _DICT.put( 13198, 34674 ); + _DICT.put( 13199, 34675 ); + _DICT.put( 13212, 34671 ); + _DICT.put( 13213, 34672 ); + _DICT.put( 13214, 34673 ); + _DICT.put( 13217, 34677 ); + _DICT.put( 13252, 34676 ); + _DICT.put( 13261, 34691 ); + _DICT.put( 19968, 35050 ); + _DICT.put( 19969, 37530 ); + _DICT.put( 19971, 36533 ); + _DICT.put( 19975, 38556 ); + _DICT.put( 19976, 36836 ); + _DICT.put( 19977, 36431 ); + _DICT.put( 19978, 36835 ); + _DICT.put( 19979, 35258 ); + _DICT.put( 19981, 38259 ); + _DICT.put( 19982, 38750 ); + _DICT.put( 19984, 39072 ); + _DICT.put( 19985, 35150 ); + _DICT.put( 19988, 35470 ); + _DICT.put( 19989, 39073 ); + _DICT.put( 19990, 37026 ); + _DICT.put( 19991, 39360 ); + _DICT.put( 19992, 35701 ); + _DICT.put( 19993, 38328 ); + _DICT.put( 19998, 36837 ); + _DICT.put( 20001, 38844 ); + _DICT.put( 20006, 38336 ); + _DICT.put( 20008, 64104 ); + _DICT.put( 20010, 39074 ); + _DICT.put( 20013, 37510 ); + _DICT.put( 20017, 39075 ); + _DICT.put( 20018, 35832 ); + _DICT.put( 20022, 39076 ); + _DICT.put( 20024, 35547 ); + _DICT.put( 20025, 37455 ); + _DICT.put( 20027, 36581 ); + _DICT.put( 20028, 39077 ); + _DICT.put( 20031, 39078 ); + _DICT.put( 20034, 39079 ); + _DICT.put( 20035, 37972 ); + _DICT.put( 20037, 35702 ); + _DICT.put( 20043, 37974 ); + _DICT.put( 20045, 37857 ); + _DICT.put( 20046, 36033 ); + _DICT.put( 20047, 38482 ); + _DICT.put( 20053, 58728 ); + _DICT.put( 20054, 39080 ); + _DICT.put( 20055, 36838 ); + _DICT.put( 20056, 39081 ); + _DICT.put( 20057, 35251 ); + _DICT.put( 20061, 35811 ); + _DICT.put( 20062, 36078 ); + _DICT.put( 20063, 38631 ); + _DICT.put( 20066, 39844 ); + _DICT.put( 20081, 38800 ); + _DICT.put( 20083, 37883 ); + _DICT.put( 20094, 35491 ); + _DICT.put( 20096, 35668 ); + _DICT.put( 20098, 39082 ); + _DICT.put( 20101, 39083 ); + _DICT.put( 20102, 38841 ); + _DICT.put( 20104, 38748 ); + _DICT.put( 20105, 37256 ); + _DICT.put( 20106, 39085 ); + _DICT.put( 20107, 36502 ); + _DICT.put( 20108, 37873 ); + _DICT.put( 20110, 39088 ); + _DICT.put( 20113, 35165 ); + _DICT.put( 20114, 36061 ); + _DICT.put( 20116, 36060 ); + _DICT.put( 20117, 35044 ); + _DICT.put( 20120, 39018 ); + _DICT.put( 20121, 39017 ); + _DICT.put( 20123, 36273 ); + _DICT.put( 20124, 34975 ); + _DICT.put( 20126, 39089 ); + _DICT.put( 20127, 39090 ); + _DICT.put( 20128, 39091 ); + _DICT.put( 20129, 38483 ); + _DICT.put( 20130, 39092 ); + _DICT.put( 20132, 36080 ); + _DICT.put( 20133, 35045 ); + _DICT.put( 20134, 38546 ); + _DICT.put( 20136, 35740 ); + _DICT.put( 20139, 35741 ); + _DICT.put( 20140, 35742 ); + _DICT.put( 20141, 37600 ); + _DICT.put( 20142, 38842 ); + _DICT.put( 20144, 39093 ); + _DICT.put( 20147, 39094 ); + _DICT.put( 20150, 39095 ); + _DICT.put( 20154, 36972 ); + _DICT.put( 20160, 36697 ); + _DICT.put( 20161, 36973 ); + _DICT.put( 20162, 39100 ); + _DICT.put( 20164, 39098 ); + _DICT.put( 20166, 39099 ); + _DICT.put( 20167, 35703 ); + _DICT.put( 20170, 36257 ); + _DICT.put( 20171, 35310 ); + _DICT.put( 20173, 39097 ); + _DICT.put( 20174, 39096 ); + _DICT.put( 20175, 38311 ); + _DICT.put( 20180, 36453 ); + _DICT.put( 20181, 36452 ); + _DICT.put( 20182, 37308 ); + _DICT.put( 20183, 39101 ); + _DICT.put( 20184, 38260 ); + _DICT.put( 20185, 37093 ); + _DICT.put( 20189, 33111 ); + _DICT.put( 20190, 39102 ); + _DICT.put( 20191, 39104 ); + _DICT.put( 20193, 64105 ); + _DICT.put( 20195, 37347 ); + _DICT.put( 20196, 38879 ); + _DICT.put( 20197, 35016 ); + _DICT.put( 20205, 39103 ); + _DICT.put( 20206, 35260 ); + _DICT.put( 20208, 35778 ); + _DICT.put( 20210, 37511 ); + _DICT.put( 20214, 35983 ); + _DICT.put( 20215, 39105 ); + _DICT.put( 20219, 37955 ); + _DICT.put( 20220, 64106 ); + _DICT.put( 20224, 64107 ); + _DICT.put( 20225, 35561 ); + _DICT.put( 20227, 64108 ); + _DICT.put( 20233, 39106 ); + _DICT.put( 20234, 35017 ); + _DICT.put( 20237, 36062 ); + _DICT.put( 20238, 35562 ); + _DICT.put( 20239, 38298 ); + _DICT.put( 20240, 38064 ); + _DICT.put( 20241, 35704 ); + _DICT.put( 20250, 35311 ); + _DICT.put( 20252, 39141 ); + _DICT.put( 20253, 37728 ); + _DICT.put( 20271, 38028 ); + _DICT.put( 20272, 39108 ); + _DICT.put( 20276, 38074 ); + _DICT.put( 20278, 38880 ); + _DICT.put( 20280, 36940 ); + _DICT.put( 20281, 64109 ); + _DICT.put( 20282, 36454 ); + _DICT.put( 20284, 36503 ); + _DICT.put( 20285, 35262 ); + _DICT.put( 20291, 37583 ); + _DICT.put( 20294, 37441 ); + _DICT.put( 20295, 39112 ); + _DICT.put( 20301, 35018 ); + _DICT.put( 20302, 37601 ); + _DICT.put( 20303, 36698 ); + _DICT.put( 20304, 36274 ); + _DICT.put( 20305, 38723 ); + _DICT.put( 20307, 37324 ); + _DICT.put( 20309, 35261 ); + _DICT.put( 20310, 64110 ); + _DICT.put( 20311, 39111 ); + _DICT.put( 20313, 38749 ); + _DICT.put( 20314, 39107 ); + _DICT.put( 20315, 39109 ); + _DICT.put( 20316, 36332 ); + _DICT.put( 20317, 39110 ); + _DICT.put( 20318, 39747 ); + _DICT.put( 20329, 39118 ); + _DICT.put( 20335, 39121 ); + _DICT.put( 20336, 39119 ); + _DICT.put( 20339, 35264 ); + _DICT.put( 20341, 38329 ); + _DICT.put( 20342, 39113 ); + _DICT.put( 20347, 39117 ); + _DICT.put( 20348, 36081 ); + _DICT.put( 20351, 36455 ); + _DICT.put( 20355, 35492 ); + _DICT.put( 20358, 39122 ); + _DICT.put( 20360, 39114 ); + _DICT.put( 20362, 64112 ); + _DICT.put( 20363, 38881 ); + _DICT.put( 20365, 36504 ); + _DICT.put( 20367, 39115 ); + _DICT.put( 20369, 39120 ); + _DICT.put( 20370, 64111 ); + _DICT.put( 20372, 64114 ); + _DICT.put( 20374, 39123 ); + _DICT.put( 20376, 39116 ); + _DICT.put( 20378, 64113 ); + _DICT.put( 20379, 35743 ); + _DICT.put( 20381, 35019 ); + _DICT.put( 20384, 35744 ); + _DICT.put( 20385, 35263 ); + _DICT.put( 20395, 39748 ); + _DICT.put( 20397, 38553 ); + _DICT.put( 20398, 38286 ); + _DICT.put( 20399, 36082 ); + _DICT.put( 20405, 36942 ); + _DICT.put( 20406, 38837 ); + _DICT.put( 20415, 38358 ); + _DICT.put( 20418, 35927 ); + _DICT.put( 20419, 37283 ); + _DICT.put( 20420, 35298 ); + _DICT.put( 20425, 64097 ); + _DICT.put( 20426, 36722 ); + _DICT.put( 20429, 64115 ); + _DICT.put( 20430, 39127 ); + _DICT.put( 20432, 39132 ); + _DICT.put( 20433, 39130 ); + _DICT.put( 20436, 39125 ); + _DICT.put( 20439, 37293 ); + _DICT.put( 20440, 39128 ); + _DICT.put( 20442, 39131 ); + _DICT.put( 20443, 39129 ); + _DICT.put( 20445, 38363 ); + _DICT.put( 20447, 39126 ); + _DICT.put( 20449, 36941 ); + _DICT.put( 20451, 38547 ); + _DICT.put( 20452, 39133 ); + _DICT.put( 20453, 39134 ); + _DICT.put( 20462, 36675 ); + _DICT.put( 20463, 39147 ); + _DICT.put( 20467, 37999 ); + _DICT.put( 20469, 38229 ); + _DICT.put( 20470, 39142 ); + _DICT.put( 20472, 38382 ); + _DICT.put( 20474, 35252 ); + _DICT.put( 20478, 39146 ); + _DICT.put( 20479, 64118 ); + _DICT.put( 20485, 39140 ); + _DICT.put( 20486, 39149 ); + _DICT.put( 20489, 37233 ); + _DICT.put( 20491, 36034 ); + _DICT.put( 20493, 38011 ); + _DICT.put( 20495, 57541 ); + _DICT.put( 20497, 39148 ); + _DICT.put( 20498, 37756 ); + _DICT.put( 20500, 39137 ); + _DICT.put( 20502, 36084 ); + _DICT.put( 20505, 36083 ); + _DICT.put( 20506, 39135 ); + _DICT.put( 20510, 64119 ); + _DICT.put( 20511, 36568 ); + _DICT.put( 20513, 39143 ); + _DICT.put( 20514, 64117 ); + _DICT.put( 20515, 38381 ); + _DICT.put( 20516, 37484 ); + _DICT.put( 20517, 39139 ); + _DICT.put( 20518, 35985 ); + _DICT.put( 20520, 39136 ); + _DICT.put( 20521, 39144 ); + _DICT.put( 20522, 39138 ); + _DICT.put( 20523, 38863 ); + _DICT.put( 20524, 39145 ); + _DICT.put( 20525, 39008 ); + _DICT.put( 20534, 35812 ); + _DICT.put( 20537, 35984 ); + _DICT.put( 20544, 64116 ); + _DICT.put( 20546, 64122 ); + _DICT.put( 20547, 39150 ); + _DICT.put( 20550, 64120 ); + _DICT.put( 20551, 39151 ); + _DICT.put( 20552, 39155 ); + _DICT.put( 20553, 35020 ); + _DICT.put( 20559, 38350 ); + _DICT.put( 20560, 39154 ); + _DICT.put( 20565, 39153 ); + _DICT.put( 20566, 39157 ); + _DICT.put( 20570, 39156 ); + _DICT.put( 20572, 37602 ); + _DICT.put( 20581, 35986 ); + _DICT.put( 20588, 39158 ); + _DICT.put( 20592, 64121 ); + _DICT.put( 20594, 36547 ); + _DICT.put( 20596, 37284 ); + _DICT.put( 20597, 37603 ); + _DICT.put( 20598, 35828 ); + _DICT.put( 20600, 39159 ); + _DICT.put( 20605, 35669 ); + _DICT.put( 20608, 39160 ); + _DICT.put( 20613, 39162 ); + _DICT.put( 20621, 38484 ); + _DICT.put( 20625, 35974 ); + _DICT.put( 20628, 64123 ); + _DICT.put( 20632, 36432 ); + _DICT.put( 20633, 38133 ); + _DICT.put( 20634, 39161 ); + _DICT.put( 20652, 36291 ); + _DICT.put( 20653, 38754 ); + _DICT.put( 20658, 39164 ); + _DICT.put( 20659, 39234 ); + _DICT.put( 20660, 39163 ); + _DICT.put( 20661, 36290 ); + _DICT.put( 20663, 36765 ); + _DICT.put( 20670, 35928 ); + _DICT.put( 20674, 39235 ); + _DICT.put( 20677, 35789 ); + _DICT.put( 20681, 39232 ); + _DICT.put( 20682, 39233 ); + _DICT.put( 20685, 37805 ); + _DICT.put( 20687, 37276 ); + _DICT.put( 20689, 35745 ); + _DICT.put( 20693, 38508 ); + _DICT.put( 20694, 39236 ); + _DICT.put( 20696, 64125 ); + _DICT.put( 20698, 38843 ); + _DICT.put( 20702, 39237 ); + _DICT.put( 20707, 39240 ); + _DICT.put( 20709, 39238 ); + _DICT.put( 20711, 37229 ); + _DICT.put( 20717, 39239 ); + _DICT.put( 20718, 39241 ); + _DICT.put( 20724, 64124 ); + _DICT.put( 20725, 39243 ); + _DICT.put( 20729, 39242 ); + _DICT.put( 20731, 38342 ); + _DICT.put( 20736, 35670 ); + _DICT.put( 20737, 39245 ); + _DICT.put( 20738, 39246 ); + _DICT.put( 20740, 35245 ); + _DICT.put( 20745, 39244 ); + _DICT.put( 20754, 36594 ); + _DICT.put( 20756, 39249 ); + _DICT.put( 20757, 39248 ); + _DICT.put( 20758, 39247 ); + _DICT.put( 20760, 39124 ); + _DICT.put( 20762, 39250 ); + _DICT.put( 20767, 36766 ); + _DICT.put( 20769, 39251 ); + _DICT.put( 20778, 38724 ); + _DICT.put( 20786, 38615 ); + _DICT.put( 20791, 39253 ); + _DICT.put( 20794, 39252 ); + _DICT.put( 20795, 39255 ); + _DICT.put( 20796, 39254 ); + _DICT.put( 20799, 39256 ); + _DICT.put( 20800, 39257 ); + _DICT.put( 20801, 35058 ); + _DICT.put( 20803, 36019 ); + _DICT.put( 20804, 35930 ); + _DICT.put( 20805, 36699 ); + _DICT.put( 20806, 37531 ); + _DICT.put( 20807, 35746 ); + _DICT.put( 20808, 37094 ); + _DICT.put( 20809, 36085 ); + _DICT.put( 20810, 64126 ); + _DICT.put( 20811, 36238 ); + _DICT.put( 20812, 39259 ); + _DICT.put( 20813, 38598 ); + _DICT.put( 20814, 37733 ); + _DICT.put( 20816, 36505 ); + _DICT.put( 20818, 39258 ); + _DICT.put( 20820, 39260 ); + _DICT.put( 20826, 37757 ); + _DICT.put( 20828, 35477 ); + _DICT.put( 20834, 39261 ); + _DICT.put( 20836, 64128 ); + _DICT.put( 20837, 37884 ); + _DICT.put( 20840, 37203 ); + _DICT.put( 20841, 39263 ); + _DICT.put( 20842, 39264 ); + _DICT.put( 20843, 38058 ); + _DICT.put( 20844, 36086 ); + _DICT.put( 20845, 39002 ); + _DICT.put( 20846, 39265 ); + _DICT.put( 20849, 35748 ); + _DICT.put( 20853, 38330 ); + _DICT.put( 20854, 37300 ); + _DICT.put( 20855, 35823 ); + _DICT.put( 20856, 37716 ); + _DICT.put( 20860, 35987 ); + _DICT.put( 20864, 39266 ); + _DICT.put( 20866, 39267 ); + _DICT.put( 20869, 37856 ); + _DICT.put( 20870, 35198 ); + _DICT.put( 20873, 39270 ); + _DICT.put( 20874, 36347 ); + _DICT.put( 20876, 39269 ); + _DICT.put( 20877, 36292 ); + _DICT.put( 20879, 39271 ); + _DICT.put( 20880, 58348 ); + _DICT.put( 20881, 39272 ); + _DICT.put( 20882, 38496 ); + _DICT.put( 20883, 39273 ); + _DICT.put( 20885, 39274 ); + _DICT.put( 20886, 39275 ); + _DICT.put( 20887, 36839 ); + _DICT.put( 20889, 36554 ); + _DICT.put( 20893, 64129 ); + _DICT.put( 20896, 35493 ); + _DICT.put( 20898, 39278 ); + _DICT.put( 20900, 39276 ); + _DICT.put( 20901, 38587 ); + _DICT.put( 20902, 39277 ); + _DICT.put( 20904, 38265 ); + _DICT.put( 20905, 39279 ); + _DICT.put( 20906, 39280 ); + _DICT.put( 20907, 39281 ); + _DICT.put( 20908, 37758 ); + _DICT.put( 20912, 39285 ); + _DICT.put( 20913, 39283 ); + _DICT.put( 20914, 39284 ); + _DICT.put( 20915, 39282 ); + _DICT.put( 20916, 36321 ); + _DICT.put( 20917, 39286 ); + _DICT.put( 20918, 38632 ); + _DICT.put( 20919, 38882 ); + _DICT.put( 20925, 39287 ); + _DICT.put( 20926, 64130 ); + _DICT.put( 20932, 37030 ); + _DICT.put( 20933, 39288 ); + _DICT.put( 20934, 36729 ); + _DICT.put( 20937, 39289 ); + _DICT.put( 20939, 37532 ); + _DICT.put( 20940, 38845 ); + _DICT.put( 20941, 37760 ); + _DICT.put( 20950, 39363 ); + _DICT.put( 20955, 39290 ); + _DICT.put( 20956, 60067 ); + _DICT.put( 20957, 35779 ); + _DICT.put( 20960, 39291 ); + _DICT.put( 20961, 38525 ); + _DICT.put( 20966, 36744 ); + _DICT.put( 20967, 37370 ); + _DICT.put( 20969, 39293 ); + _DICT.put( 20970, 37858 ); + _DICT.put( 20972, 64131 ); + _DICT.put( 20973, 39294 ); + _DICT.put( 20976, 39296 ); + _DICT.put( 20977, 35405 ); + _DICT.put( 20981, 39297 ); + _DICT.put( 20982, 35749 ); + _DICT.put( 20984, 37834 ); + _DICT.put( 20985, 35226 ); + _DICT.put( 20986, 36719 ); + _DICT.put( 20989, 38047 ); + _DICT.put( 20990, 39298 ); + _DICT.put( 20992, 37761 ); + _DICT.put( 20995, 36974 ); + _DICT.put( 20996, 39299 ); + _DICT.put( 20998, 38314 ); + _DICT.put( 20999, 37080 ); + _DICT.put( 21000, 35488 ); + _DICT.put( 21002, 35495 ); + _DICT.put( 21003, 39300 ); + _DICT.put( 21006, 39302 ); + _DICT.put( 21009, 35929 ); + _DICT.put( 21012, 39301 ); + _DICT.put( 21013, 64132 ); + _DICT.put( 21015, 38897 ); + _DICT.put( 21021, 36745 ); + _DICT.put( 21028, 38075 ); + _DICT.put( 21029, 38346 ); + _DICT.put( 21031, 39303 ); + _DICT.put( 21033, 38808 ); + _DICT.put( 21034, 39304 ); + _DICT.put( 21038, 39305 ); + _DICT.put( 21040, 37790 ); + _DICT.put( 21043, 39306 ); + _DICT.put( 21046, 37031 ); + _DICT.put( 21047, 36348 ); + _DICT.put( 21048, 35988 ); + _DICT.put( 21049, 39307 ); + _DICT.put( 21050, 36456 ); + _DICT.put( 21051, 36239 ); + _DICT.put( 21059, 37604 ); + _DICT.put( 21060, 39309 ); + _DICT.put( 21063, 37285 ); + _DICT.put( 21066, 36333 ); + _DICT.put( 21067, 39310 ); + _DICT.put( 21068, 39311 ); + _DICT.put( 21069, 37199 ); + _DICT.put( 21071, 39308 ); + _DICT.put( 21076, 39313 ); + _DICT.put( 21078, 38485 ); + _DICT.put( 21083, 36228 ); + _DICT.put( 21086, 39312 ); + _DICT.put( 21091, 35989 ); + _DICT.put( 21092, 36316 ); + _DICT.put( 21093, 38029 ); + _DICT.put( 21097, 39316 ); + _DICT.put( 21098, 39314 ); + _DICT.put( 21103, 38299 ); + _DICT.put( 21104, 36840 ); + _DICT.put( 21105, 39323 ); + _DICT.put( 21106, 35460 ); + _DICT.put( 21107, 39317 ); + _DICT.put( 21108, 39315 ); + _DICT.put( 21109, 37230 ); + _DICT.put( 21117, 39319 ); + _DICT.put( 21119, 39318 ); + _DICT.put( 21123, 35427 ); + _DICT.put( 21127, 35968 ); + _DICT.put( 21128, 39324 ); + _DICT.put( 21129, 38827 ); + _DICT.put( 21133, 39320 ); + _DICT.put( 21137, 39325 ); + _DICT.put( 21138, 39322 ); + _DICT.put( 21140, 39321 ); + _DICT.put( 21147, 38861 ); + _DICT.put( 21148, 64133 ); + _DICT.put( 21151, 36087 ); + _DICT.put( 21152, 35265 ); + _DICT.put( 21155, 38898 ); + _DICT.put( 21158, 64134 ); + _DICT.put( 21161, 36757 ); + _DICT.put( 21162, 37751 ); + _DICT.put( 21163, 36229 ); + _DICT.put( 21164, 39328 ); + _DICT.put( 21165, 39329 ); + _DICT.put( 21167, 64375 ); + _DICT.put( 21169, 38883 ); + _DICT.put( 21172, 38986 ); + _DICT.put( 21173, 39331 ); + _DICT.put( 21177, 36088 ); + _DICT.put( 21180, 39330 ); + _DICT.put( 21182, 35406 ); + _DICT.put( 21184, 64135 ); + _DICT.put( 21185, 39332 ); + _DICT.put( 21187, 38517 ); + _DICT.put( 21189, 37562 ); + _DICT.put( 21191, 38725 ); + _DICT.put( 21193, 38359 ); + _DICT.put( 21197, 39333 ); + _DICT.put( 21202, 59603 ); + _DICT.put( 21205, 37806 ); + _DICT.put( 21207, 39334 ); + _DICT.put( 21208, 35496 ); + _DICT.put( 21209, 38577 ); + _DICT.put( 21211, 64136 ); + _DICT.put( 21213, 36767 ); + _DICT.put( 21214, 39335 ); + _DICT.put( 21215, 38373 ); + _DICT.put( 21216, 39339 ); + _DICT.put( 21218, 37032 ); + _DICT.put( 21219, 39336 ); + _DICT.put( 21220, 35790 ); + _DICT.put( 21222, 39337 ); + _DICT.put( 21223, 35497 ); + _DICT.put( 21234, 35917 ); + _DICT.put( 21235, 39340 ); + _DICT.put( 21237, 39341 ); + _DICT.put( 21240, 39342 ); + _DICT.put( 21241, 39343 ); + _DICT.put( 21242, 36569 ); + _DICT.put( 21246, 36089 ); + _DICT.put( 21247, 38620 ); + _DICT.put( 21248, 64137 ); + _DICT.put( 21249, 38630 ); + _DICT.put( 21250, 37877 ); + _DICT.put( 21253, 38383 ); + _DICT.put( 21254, 39344 ); + _DICT.put( 21255, 64138 ); + _DICT.put( 21256, 39345 ); + _DICT.put( 21261, 39347 ); + _DICT.put( 21263, 39349 ); + _DICT.put( 21264, 39348 ); + _DICT.put( 21269, 39350 ); + _DICT.put( 21270, 35259 ); + _DICT.put( 21271, 38507 ); + _DICT.put( 21273, 36346 ); + _DICT.put( 21274, 39351 ); + _DICT.put( 21277, 37240 ); + _DICT.put( 21280, 36768 ); + _DICT.put( 21281, 35751 ); + _DICT.put( 21283, 39352 ); + _DICT.put( 21284, 64139 ); + _DICT.put( 21290, 38105 ); + _DICT.put( 21295, 39353 ); + _DICT.put( 21297, 39354 ); + _DICT.put( 21299, 39355 ); + _DICT.put( 21304, 39356 ); + _DICT.put( 21305, 38211 ); + _DICT.put( 21306, 35814 ); + _DICT.put( 21307, 35043 ); + _DICT.put( 21311, 37821 ); + _DICT.put( 21312, 39357 ); + _DICT.put( 21313, 36700 ); + _DICT.put( 21315, 37095 ); + _DICT.put( 21317, 39359 ); + _DICT.put( 21318, 39358 ); + _DICT.put( 21319, 36769 ); + _DICT.put( 21320, 36063 ); + _DICT.put( 21321, 39361 ); + _DICT.put( 21322, 38076 ); + _DICT.put( 21325, 39362 ); + _DICT.put( 21329, 38106 ); + _DICT.put( 21330, 37298 ); + _DICT.put( 21331, 37356 ); + _DICT.put( 21332, 35750 ); + _DICT.put( 21335, 37868 ); + _DICT.put( 21336, 37456 ); + _DICT.put( 21338, 38030 ); + _DICT.put( 21340, 38509 ); + _DICT.put( 21342, 39364 ); + _DICT.put( 21344, 37096 ); + _DICT.put( 21350, 35924 ); + _DICT.put( 21353, 39365 ); + _DICT.put( 21358, 39366 ); + _DICT.put( 21359, 35147 ); + _DICT.put( 21360, 35059 ); + _DICT.put( 21361, 35563 ); + _DICT.put( 21362, 64140 ); + _DICT.put( 21363, 37286 ); + _DICT.put( 21364, 35696 ); + _DICT.put( 21365, 38801 ); + _DICT.put( 21367, 39369 ); + _DICT.put( 21368, 35253 ); + _DICT.put( 21371, 39368 ); + _DICT.put( 21375, 35752 ); + _DICT.put( 21378, 39370 ); + _DICT.put( 21380, 38639 ); + _DICT.put( 21395, 64141 ); + _DICT.put( 21398, 39371 ); + _DICT.put( 21400, 38864 ); + _DICT.put( 21402, 36090 ); + _DICT.put( 21407, 36020 ); + _DICT.put( 21408, 39372 ); + _DICT.put( 21413, 39374 ); + _DICT.put( 21414, 39373 ); + _DICT.put( 21416, 36990 ); + _DICT.put( 21417, 35160 ); + _DICT.put( 21421, 35197 ); + _DICT.put( 21422, 39375 ); + _DICT.put( 21424, 39376 ); + _DICT.put( 21426, 64142 ); + _DICT.put( 21427, 36021 ); + _DICT.put( 21430, 39377 ); + _DICT.put( 21435, 35726 ); + _DICT.put( 21442, 36433 ); + _DICT.put( 21443, 39378 ); + _DICT.put( 21448, 38548 ); + _DICT.put( 21449, 36275 ); + _DICT.put( 21450, 35705 ); + _DICT.put( 21451, 38726 ); + _DICT.put( 21452, 37231 ); + _DICT.put( 21453, 38077 ); + _DICT.put( 21454, 36603 ); + _DICT.put( 21460, 36710 ); + _DICT.put( 21462, 36582 ); + _DICT.put( 21463, 36595 ); + _DICT.put( 21465, 36758 ); + _DICT.put( 21467, 38078 ); + _DICT.put( 21469, 64143 ); + _DICT.put( 21471, 39381 ); + _DICT.put( 21473, 35170 ); + _DICT.put( 21474, 37232 ); + _DICT.put( 21475, 36091 ); + _DICT.put( 21476, 36035 ); + _DICT.put( 21477, 35813 ); + _DICT.put( 21480, 39385 ); + _DICT.put( 21481, 37440 ); + _DICT.put( 21482, 37372 ); + _DICT.put( 21483, 35753 ); + _DICT.put( 21484, 36770 ); + _DICT.put( 21485, 39386 ); + _DICT.put( 21486, 39384 ); + _DICT.put( 21487, 35266 ); + _DICT.put( 21488, 37348 ); + _DICT.put( 21489, 36534 ); + _DICT.put( 21490, 36458 ); + _DICT.put( 21491, 35141 ); + _DICT.put( 21494, 35472 ); + _DICT.put( 21495, 36230 ); + _DICT.put( 21496, 36457 ); + _DICT.put( 21498, 39387 ); + _DICT.put( 21505, 39388 ); + _DICT.put( 21507, 35688 ); + _DICT.put( 21508, 35429 ); + _DICT.put( 21512, 36231 ); + _DICT.put( 21513, 35687 ); + _DICT.put( 21514, 37597 ); + _DICT.put( 21515, 35140 ); + _DICT.put( 21516, 37807 ); + _DICT.put( 21517, 38588 ); + _DICT.put( 21518, 36160 ); + _DICT.put( 21519, 38809 ); + _DICT.put( 21520, 37734 ); + _DICT.put( 21521, 36092 ); + _DICT.put( 21531, 35918 ); + _DICT.put( 21533, 39397 ); + _DICT.put( 21535, 35809 ); + _DICT.put( 21536, 38505 ); + _DICT.put( 21542, 38107 ); + _DICT.put( 21545, 39396 ); + _DICT.put( 21547, 35548 ); + _DICT.put( 21548, 39391 ); + _DICT.put( 21549, 39392 ); + _DICT.put( 21550, 39394 ); + _DICT.put( 21558, 39395 ); + _DICT.put( 21560, 35706 ); + _DICT.put( 21561, 36993 ); + _DICT.put( 21563, 38315 ); + _DICT.put( 21564, 39393 ); + _DICT.put( 21565, 39389 ); + _DICT.put( 21566, 36065 ); + _DICT.put( 21568, 39390 ); + _DICT.put( 21570, 38979 ); + _DICT.put( 21574, 38384 ); + _DICT.put( 21576, 37606 ); + _DICT.put( 21577, 36064 ); + _DICT.put( 21578, 36240 ); + _DICT.put( 21582, 39398 ); + _DICT.put( 21585, 37851 ); + _DICT.put( 21599, 39402 ); + _DICT.put( 21608, 36604 ); + _DICT.put( 21610, 36596 ); + _DICT.put( 21616, 39405 ); + _DICT.put( 21617, 39403 ); + _DICT.put( 21619, 38561 ); + _DICT.put( 21621, 39400 ); + _DICT.put( 21622, 39409 ); + _DICT.put( 21623, 39404 ); + _DICT.put( 21627, 39407 ); + _DICT.put( 21628, 36036 ); + _DICT.put( 21629, 38589 ); + _DICT.put( 21632, 39408 ); + _DICT.put( 21636, 39410 ); + _DICT.put( 21638, 39412 ); + _DICT.put( 21642, 64146 ); + _DICT.put( 21643, 36334 ); + _DICT.put( 21644, 39009 ); + _DICT.put( 21646, 39401 ); + _DICT.put( 21647, 39399 ); + _DICT.put( 21648, 39411 ); + _DICT.put( 21650, 39406 ); + _DICT.put( 21660, 64145 ); + _DICT.put( 21666, 39414 ); + _DICT.put( 21668, 39490 ); + _DICT.put( 21669, 39416 ); + _DICT.put( 21672, 39420 ); + _DICT.put( 21673, 64147 ); + _DICT.put( 21675, 39488 ); + _DICT.put( 21676, 39417 ); + _DICT.put( 21679, 39517 ); + _DICT.put( 21682, 36327 ); + _DICT.put( 21683, 35408 ); + _DICT.put( 21688, 39415 ); + _DICT.put( 21692, 39492 ); + _DICT.put( 21693, 35060 ); + _DICT.put( 21694, 39491 ); + _DICT.put( 21696, 34979 ); + _DICT.put( 21697, 38249 ); + _DICT.put( 21698, 39489 ); + _DICT.put( 21700, 39418 ); + _DICT.put( 21703, 39413 ); + _DICT.put( 21704, 39419 ); + _DICT.put( 21705, 36294 ); + _DICT.put( 21720, 39493 ); + _DICT.put( 21729, 35061 ); + _DICT.put( 21730, 39502 ); + _DICT.put( 21733, 39494 ); + _DICT.put( 21734, 39495 ); + _DICT.put( 21736, 36771 ); + _DICT.put( 21737, 38537 ); + _DICT.put( 21741, 39500 ); + _DICT.put( 21742, 39499 ); + _DICT.put( 21746, 37710 ); + _DICT.put( 21754, 39501 ); + _DICT.put( 21757, 39498 ); + _DICT.put( 21759, 64148 ); + _DICT.put( 21764, 35155 ); + _DICT.put( 21766, 36276 ); + _DICT.put( 21767, 36943 ); + _DICT.put( 21775, 39496 ); + _DICT.put( 21776, 37762 ); + _DICT.put( 21780, 39497 ); + _DICT.put( 21782, 34976 ); + _DICT.put( 21806, 39507 ); + _DICT.put( 21807, 38722 ); + _DICT.put( 21809, 36773 ); + _DICT.put( 21811, 39513 ); + _DICT.put( 21816, 39512 ); + _DICT.put( 21817, 39503 ); + _DICT.put( 21822, 37313 ); + _DICT.put( 21824, 39504 ); + _DICT.put( 21828, 37357 ); + _DICT.put( 21829, 39509 ); + _DICT.put( 21830, 36772 ); + _DICT.put( 21836, 39506 ); + _DICT.put( 21839, 38626 ); + _DICT.put( 21843, 35931 ); + _DICT.put( 21846, 39510 ); + _DICT.put( 21847, 39511 ); + _DICT.put( 21852, 39508 ); + _DICT.put( 21853, 39514 ); + _DICT.put( 21859, 39505 ); + _DICT.put( 21883, 39520 ); + _DICT.put( 21884, 39525 ); + _DICT.put( 21886, 39521 ); + _DICT.put( 21888, 39516 ); + _DICT.put( 21891, 39526 ); + _DICT.put( 21892, 37200 ); + _DICT.put( 21894, 64149 ); + _DICT.put( 21895, 39528 ); + _DICT.put( 21897, 36161 ); + _DICT.put( 21898, 39518 ); + _DICT.put( 21899, 37533 ); + _DICT.put( 21912, 39522 ); + _DICT.put( 21913, 39515 ); + _DICT.put( 21914, 35499 ); + _DICT.put( 21916, 35564 ); + _DICT.put( 21917, 35461 ); + _DICT.put( 21918, 39523 ); + _DICT.put( 21919, 39519 ); + _DICT.put( 21927, 35990 ); + _DICT.put( 21928, 39529 ); + _DICT.put( 21929, 39527 ); + _DICT.put( 21930, 37234 ); + _DICT.put( 21931, 35689 ); + _DICT.put( 21932, 35754 ); + _DICT.put( 21934, 39524 ); + _DICT.put( 21936, 35826 ); + _DICT.put( 21942, 35171 ); + _DICT.put( 21956, 39533 ); + _DICT.put( 21957, 39531 ); + _DICT.put( 21959, 39589 ); + _DICT.put( 21972, 39536 ); + _DICT.put( 21978, 39530 ); + _DICT.put( 21980, 39534 ); + _DICT.put( 21983, 39532 ); + _DICT.put( 21987, 36459 ); + _DICT.put( 21988, 39535 ); + _DICT.put( 22007, 39538 ); + _DICT.put( 22009, 39543 ); + _DICT.put( 22013, 39541 ); + _DICT.put( 22014, 39540 ); + _DICT.put( 22022, 37457 ); + _DICT.put( 22025, 35267 ); + _DICT.put( 22036, 39537 ); + _DICT.put( 22038, 39539 ); + _DICT.put( 22039, 36774 ); + _DICT.put( 22040, 35154 ); + _DICT.put( 22043, 39542 ); + _DICT.put( 22057, 35292 ); + _DICT.put( 22063, 39554 ); + _DICT.put( 22065, 36858 ); + _DICT.put( 22066, 39549 ); + _DICT.put( 22068, 39547 ); + _DICT.put( 22070, 39548 ); + _DICT.put( 22072, 39550 ); + _DICT.put( 22082, 35164 ); + _DICT.put( 22092, 37208 ); + _DICT.put( 22094, 39544 ); + _DICT.put( 22096, 39545 ); + _DICT.put( 22107, 35482 ); + _DICT.put( 22116, 39553 ); + _DICT.put( 22120, 35565 ); + _DICT.put( 22122, 39556 ); + _DICT.put( 22123, 39552 ); + _DICT.put( 22124, 39555 ); + _DICT.put( 22132, 38316 ); + _DICT.put( 22136, 37843 ); + _DICT.put( 22138, 38070 ); + _DICT.put( 22144, 39558 ); + _DICT.put( 22150, 39557 ); + _DICT.put( 22151, 35428 ); + _DICT.put( 22154, 39559 ); + _DICT.put( 22159, 39562 ); + _DICT.put( 22164, 39561 ); + _DICT.put( 22176, 39560 ); + _DICT.put( 22178, 37976 ); + _DICT.put( 22181, 39563 ); + _DICT.put( 22190, 39564 ); + _DICT.put( 22196, 39566 ); + _DICT.put( 22198, 39565 ); + _DICT.put( 22204, 39568 ); + _DICT.put( 22208, 39571 ); + _DICT.put( 22209, 39569 ); + _DICT.put( 22210, 39567 ); + _DICT.put( 22211, 39570 ); + _DICT.put( 22216, 39572 ); + _DICT.put( 22222, 39573 ); + _DICT.put( 22225, 39574 ); + _DICT.put( 22227, 39575 ); + _DICT.put( 22231, 39576 ); + _DICT.put( 22232, 39268 ); + _DICT.put( 22234, 36602 ); + _DICT.put( 22235, 36460 ); + _DICT.put( 22238, 35313 ); + _DICT.put( 22240, 35062 ); + _DICT.put( 22243, 37475 ); + _DICT.put( 22254, 39577 ); + _DICT.put( 22256, 36258 ); + _DICT.put( 22258, 35021 ); + _DICT.put( 22259, 36989 ); + _DICT.put( 22265, 39578 ); + _DICT.put( 22266, 36037 ); + _DICT.put( 22269, 36241 ); + _DICT.put( 22271, 39580 ); + _DICT.put( 22272, 39579 ); + _DICT.put( 22275, 38366 ); + _DICT.put( 22276, 39581 ); + _DICT.put( 22280, 39583 ); + _DICT.put( 22281, 39582 ); + _DICT.put( 22283, 39584 ); + _DICT.put( 22285, 39585 ); + _DICT.put( 22287, 35991 ); + _DICT.put( 22290, 35200 ); + _DICT.put( 22291, 39586 ); + _DICT.put( 22294, 39588 ); + _DICT.put( 22296, 39587 ); + _DICT.put( 22300, 39590 ); + _DICT.put( 22303, 37753 ); + _DICT.put( 22310, 39591 ); + _DICT.put( 22311, 34995 ); + _DICT.put( 22312, 36317 ); + _DICT.put( 22317, 35932 ); + _DICT.put( 22320, 37486 ); + _DICT.put( 22327, 39592 ); + _DICT.put( 22328, 39593 ); + _DICT.put( 22331, 39595 ); + _DICT.put( 22336, 39596 ); + _DICT.put( 22338, 36322 ); + _DICT.put( 22343, 35791 ); + _DICT.put( 22346, 38486 ); + _DICT.put( 22350, 39594 ); + _DICT.put( 22351, 39597 ); + _DICT.put( 22352, 36287 ); + _DICT.put( 22353, 36162 ); + _DICT.put( 22361, 64150 ); + _DICT.put( 22369, 39601 ); + _DICT.put( 22372, 36259 ); + _DICT.put( 22373, 64151 ); + _DICT.put( 22374, 37458 ); + _DICT.put( 22377, 39598 ); + _DICT.put( 22378, 37592 ); + _DICT.put( 22399, 39602 ); + _DICT.put( 22402, 36994 ); + _DICT.put( 22408, 39600 ); + _DICT.put( 22409, 39603 ); + _DICT.put( 22411, 35934 ); + _DICT.put( 22419, 39604 ); + _DICT.put( 22432, 39605 ); + _DICT.put( 22434, 36163 ); + _DICT.put( 22435, 35423 ); + _DICT.put( 22436, 39607 ); + _DICT.put( 22442, 39608 ); + _DICT.put( 22444, 64152 ); + _DICT.put( 22448, 39609 ); + _DICT.put( 22451, 39606 ); + _DICT.put( 22464, 39599 ); + _DICT.put( 22467, 39610 ); + _DICT.put( 22470, 39611 ); + _DICT.put( 22471, 64154 ); + _DICT.put( 22472, 64153 ); + _DICT.put( 22475, 38532 ); + _DICT.put( 22478, 36841 ); + _DICT.put( 22482, 39613 ); + _DICT.put( 22483, 39614 ); + _DICT.put( 22484, 39612 ); + _DICT.put( 22486, 39616 ); + _DICT.put( 22492, 37975 ); + _DICT.put( 22495, 35046 ); + _DICT.put( 22496, 38261 ); + _DICT.put( 22499, 39617 ); + _DICT.put( 22516, 36859 ); + _DICT.put( 22519, 36535 ); + _DICT.put( 22521, 38012 ); + _DICT.put( 22522, 35566 ); + _DICT.put( 22524, 36329 ); + _DICT.put( 22528, 38520 ); + _DICT.put( 22530, 37808 ); + _DICT.put( 22533, 35992 ); + _DICT.put( 22534, 37325 ); + _DICT.put( 22538, 39615 ); + _DICT.put( 22539, 39618 ); + _DICT.put( 22549, 37314 ); + _DICT.put( 22553, 39619 ); + _DICT.put( 22557, 39620 ); + _DICT.put( 22561, 39622 ); + _DICT.put( 22564, 37607 ); + _DICT.put( 22570, 35500 ); + _DICT.put( 22575, 60063 ); + _DICT.put( 22576, 35201 ); + _DICT.put( 22577, 38385 ); + _DICT.put( 22580, 36842 ); + _DICT.put( 22581, 37735 ); + _DICT.put( 22586, 36324 ); + _DICT.put( 22589, 39628 ); + _DICT.put( 22592, 38331 ); + _DICT.put( 22593, 38875 ); + _DICT.put( 22602, 35314 ); + _DICT.put( 22603, 39624 ); + _DICT.put( 22609, 37209 ); + _DICT.put( 22610, 39627 ); + _DICT.put( 22612, 37763 ); + _DICT.put( 22615, 37736 ); + _DICT.put( 22616, 37764 ); + _DICT.put( 22617, 38071 ); + _DICT.put( 22618, 37579 ); + _DICT.put( 22622, 36295 ); + _DICT.put( 22626, 39623 ); + _DICT.put( 22633, 35222 ); + _DICT.put( 22635, 37717 ); + _DICT.put( 22640, 39625 ); + _DICT.put( 22642, 39621 ); + _DICT.put( 22645, 36975 ); + _DICT.put( 22649, 39629 ); + _DICT.put( 22654, 36717 ); + _DICT.put( 22659, 35755 ); + _DICT.put( 22661, 39630 ); + _DICT.put( 22675, 38374 ); + _DICT.put( 22679, 37277 ); + _DICT.put( 22684, 37572 ); + _DICT.put( 22686, 64157 ); + _DICT.put( 22687, 39632 ); + _DICT.put( 22696, 38510 ); + _DICT.put( 22699, 39633 ); + _DICT.put( 22702, 39638 ); + _DICT.put( 22706, 64158 ); + _DICT.put( 22707, 38317 ); + _DICT.put( 22712, 39637 ); + _DICT.put( 22713, 39631 ); + _DICT.put( 22714, 39634 ); + _DICT.put( 22715, 39636 ); + _DICT.put( 22718, 36260 ); + _DICT.put( 22721, 38343 ); + _DICT.put( 22725, 39639 ); + _DICT.put( 22727, 37476 ); + _DICT.put( 22730, 35315 ); + _DICT.put( 22732, 36843 ); + _DICT.put( 22737, 39641 ); + _DICT.put( 22739, 39640 ); + _DICT.put( 22741, 36232 ); + _DICT.put( 22743, 39642 ); + _DICT.put( 22744, 39644 ); + _DICT.put( 22745, 39643 ); + _DICT.put( 22748, 39646 ); + _DICT.put( 22750, 39635 ); + _DICT.put( 22751, 39648 ); + _DICT.put( 22756, 39647 ); + _DICT.put( 22757, 39645 ); + _DICT.put( 22763, 36461 ); + _DICT.put( 22764, 36976 ); + _DICT.put( 22766, 37235 ); + _DICT.put( 22767, 39649 ); + _DICT.put( 22768, 37050 ); + _DICT.put( 22769, 35051 ); + _DICT.put( 22770, 38020 ); + _DICT.put( 22775, 37593 ); + _DICT.put( 22777, 39651 ); + _DICT.put( 22778, 39650 ); + _DICT.put( 22779, 39652 ); + _DICT.put( 22780, 39653 ); + _DICT.put( 22781, 39654 ); + _DICT.put( 22786, 39655 ); + _DICT.put( 22793, 38351 ); + _DICT.put( 22794, 39656 ); + _DICT.put( 22795, 64159 ); + _DICT.put( 22799, 35268 ); + _DICT.put( 22800, 39657 ); + _DICT.put( 22805, 38747 ); + _DICT.put( 22806, 35407 ); + _DICT.put( 22808, 39367 ); + _DICT.put( 22809, 36711 ); + _DICT.put( 22810, 37309 ); + _DICT.put( 22811, 39658 ); + _DICT.put( 22812, 38633 ); + _DICT.put( 22818, 38578 ); + _DICT.put( 22821, 39660 ); + _DICT.put( 22823, 37349 ); + _DICT.put( 22825, 37718 ); + _DICT.put( 22826, 37310 ); + _DICT.put( 22827, 38262 ); + _DICT.put( 22828, 39661 ); + _DICT.put( 22829, 39662 ); + _DICT.put( 22830, 35227 ); + _DICT.put( 22833, 36536 ); + _DICT.put( 22834, 39663 ); + _DICT.put( 22839, 35022 ); + _DICT.put( 22840, 39664 ); + _DICT.put( 22846, 39665 ); + _DICT.put( 22852, 35202 ); + _DICT.put( 22855, 35567 ); + _DICT.put( 22856, 37854 ); + _DICT.put( 22857, 38386 ); + _DICT.put( 22862, 39669 ); + _DICT.put( 22863, 37236 ); + _DICT.put( 22864, 39668 ); + _DICT.put( 22865, 35935 ); + _DICT.put( 22867, 64160 ); + _DICT.put( 22868, 38522 ); + _DICT.put( 22869, 39667 ); + _DICT.put( 22871, 37765 ); + _DICT.put( 22872, 39671 ); + _DICT.put( 22874, 39670 ); + _DICT.put( 22875, 64161 ); + _DICT.put( 22877, 64162 ); + _DICT.put( 22880, 39673 ); + _DICT.put( 22882, 39672 ); + _DICT.put( 22883, 64163 ); + _DICT.put( 22885, 35228 ); + _DICT.put( 22887, 39674 ); + _DICT.put( 22888, 36775 ); + _DICT.put( 22889, 39676 ); + _DICT.put( 22890, 37444 ); + _DICT.put( 22892, 39675 ); + _DICT.put( 22894, 38321 ); + _DICT.put( 22899, 36759 ); + _DICT.put( 22900, 37754 ); + _DICT.put( 22904, 39744 ); + _DICT.put( 22909, 36164 ); + _DICT.put( 22913, 39745 ); + _DICT.put( 22914, 37952 ); + _DICT.put( 22915, 38108 ); + _DICT.put( 22916, 38607 ); + _DICT.put( 22922, 37956 ); + _DICT.put( 22925, 39754 ); + _DICT.put( 22931, 35671 ); + _DICT.put( 22934, 38756 ); + _DICT.put( 22937, 38573 ); + _DICT.put( 22939, 39850 ); + _DICT.put( 22941, 39746 ); + _DICT.put( 22947, 39749 ); + _DICT.put( 22948, 64164 ); + _DICT.put( 22949, 37315 ); + _DICT.put( 22952, 38487 ); + _DICT.put( 22956, 37737 ); + _DICT.put( 22962, 39750 ); + _DICT.put( 22969, 38533 ); + _DICT.put( 22970, 64165 ); + _DICT.put( 22971, 36296 ); + _DICT.put( 22974, 36776 ); + _DICT.put( 22982, 39751 ); + _DICT.put( 22985, 36463 ); + _DICT.put( 22987, 36462 ); + _DICT.put( 22992, 34999 ); + _DICT.put( 22993, 36038 ); + _DICT.put( 22995, 37033 ); + _DICT.put( 22996, 35023 ); + _DICT.put( 23001, 39755 ); + _DICT.put( 23002, 39756 ); + _DICT.put( 23004, 39753 ); + _DICT.put( 23013, 35159 ); + _DICT.put( 23014, 35501 ); + _DICT.put( 23016, 39752 ); + _DICT.put( 23018, 38595 ); + _DICT.put( 23019, 38224 ); + _DICT.put( 23030, 34982 ); + _DICT.put( 23035, 35063 ); + _DICT.put( 23039, 36464 ); + _DICT.put( 23041, 35024 ); + _DICT.put( 23043, 34977 ); + _DICT.put( 23049, 39761 ); + _DICT.put( 23057, 39759 ); + _DICT.put( 23064, 38586 ); + _DICT.put( 23066, 39762 ); + _DICT.put( 23068, 39760 ); + _DICT.put( 23071, 39758 ); + _DICT.put( 23072, 36944 ); + _DICT.put( 23077, 39757 ); + _DICT.put( 23081, 38360 ); + _DICT.put( 23087, 36066 ); + _DICT.put( 23093, 39766 ); + _DICT.put( 23094, 39767 ); + _DICT.put( 23100, 36777 ); + _DICT.put( 23104, 39763 ); + _DICT.put( 23105, 38987 ); + _DICT.put( 23110, 37995 ); + _DICT.put( 23113, 39765 ); + _DICT.put( 23130, 36261 ); + _DICT.put( 23138, 39768 ); + _DICT.put( 23142, 38263 ); + _DICT.put( 23146, 39769 ); + _DICT.put( 23148, 39764 ); + _DICT.put( 23167, 38585 ); + _DICT.put( 23186, 38013 ); + _DICT.put( 23194, 39770 ); + _DICT.put( 23195, 38225 ); + _DICT.put( 23228, 39771 ); + _DICT.put( 23229, 39775 ); + _DICT.put( 23230, 39772 ); + _DICT.put( 23233, 35269 ); + _DICT.put( 23234, 39774 ); + _DICT.put( 23241, 36537 ); + _DICT.put( 23243, 39773 ); + _DICT.put( 23244, 35993 ); + _DICT.put( 23248, 39787 ); + _DICT.put( 23254, 39780 ); + _DICT.put( 23255, 39777 ); + _DICT.put( 23265, 37508 ); + _DICT.put( 23267, 39776 ); + _DICT.put( 23270, 39778 ); + _DICT.put( 23273, 39779 ); + _DICT.put( 23290, 39781 ); + _DICT.put( 23291, 39782 ); + _DICT.put( 23305, 35568 ); + _DICT.put( 23307, 39784 ); + _DICT.put( 23308, 39783 ); + _DICT.put( 23318, 39785 ); + _DICT.put( 23330, 36844 ); + _DICT.put( 23338, 39788 ); + _DICT.put( 23340, 37594 ); + _DICT.put( 23344, 35172 ); + _DICT.put( 23346, 39786 ); + _DICT.put( 23350, 39789 ); + _DICT.put( 23358, 39790 ); + _DICT.put( 23360, 39793 ); + _DICT.put( 23363, 39791 ); + _DICT.put( 23365, 39792 ); + _DICT.put( 23376, 36465 ); + _DICT.put( 23377, 39794 ); + _DICT.put( 23380, 36165 ); + _DICT.put( 23381, 39795 ); + _DICT.put( 23382, 64166 ); + _DICT.put( 23383, 36506 ); + _DICT.put( 23384, 37302 ); + _DICT.put( 23386, 39796 ); + _DICT.put( 23387, 39797 ); + _DICT.put( 23388, 36473 ); + _DICT.put( 23389, 36166 ); + _DICT.put( 23391, 38608 ); + _DICT.put( 23395, 35655 ); + _DICT.put( 23396, 36039 ); + _DICT.put( 23397, 39798 ); + _DICT.put( 23398, 35447 ); + _DICT.put( 23401, 39799 ); + _DICT.put( 23403, 37303 ); + _DICT.put( 23408, 39800 ); + _DICT.put( 23409, 39841 ); + _DICT.put( 23411, 39801 ); + _DICT.put( 23413, 39802 ); + _DICT.put( 23416, 39803 ); + _DICT.put( 23418, 39805 ); + _DICT.put( 23424, 39806 ); + _DICT.put( 23427, 39808 ); + _DICT.put( 23429, 37358 ); + _DICT.put( 23431, 35142 ); + _DICT.put( 23432, 36583 ); + _DICT.put( 23433, 35008 ); + _DICT.put( 23435, 37238 ); + _DICT.put( 23436, 35502 ); + _DICT.put( 23437, 36531 ); + _DICT.put( 23439, 36167 ); + _DICT.put( 23445, 37766 ); + _DICT.put( 23447, 36672 ); + _DICT.put( 23448, 35503 ); + _DICT.put( 23449, 37512 ); + _DICT.put( 23450, 37608 ); + _DICT.put( 23451, 34998 ); + _DICT.put( 23452, 35672 ); + _DICT.put( 23453, 38387 ); + _DICT.put( 23455, 36544 ); + _DICT.put( 23458, 35697 ); + _DICT.put( 23459, 37097 ); + _DICT.put( 23460, 36538 ); + _DICT.put( 23461, 38727 ); + _DICT.put( 23462, 39809 ); + _DICT.put( 23470, 35707 ); + _DICT.put( 23472, 36297 ); + _DICT.put( 23475, 35409 ); + _DICT.put( 23476, 35203 ); + _DICT.put( 23477, 36778 ); + _DICT.put( 23478, 35270 ); + _DICT.put( 23480, 39810 ); + _DICT.put( 23481, 38757 ); + _DICT.put( 23487, 36712 ); + _DICT.put( 23488, 64167 ); + _DICT.put( 23490, 36578 ); + _DICT.put( 23491, 39811 ); + _DICT.put( 23492, 35569 ); + _DICT.put( 23493, 37840 ); + _DICT.put( 23494, 38567 ); + _DICT.put( 23495, 39812 ); + _DICT.put( 23497, 39813 ); + _DICT.put( 23500, 38264 ); + _DICT.put( 23504, 39815 ); + _DICT.put( 23506, 35494 ); + _DICT.put( 23507, 35829 ); + _DICT.put( 23508, 39814 ); + _DICT.put( 23512, 64169 ); + _DICT.put( 23515, 35504 ); + _DICT.put( 23517, 36945 ); + _DICT.put( 23518, 39819 ); + _DICT.put( 23519, 36416 ); + _DICT.put( 23521, 35271 ); + _DICT.put( 23522, 39818 ); + _DICT.put( 23524, 39816 ); + _DICT.put( 23525, 39820 ); + _DICT.put( 23526, 39817 ); + _DICT.put( 23527, 37962 ); + _DICT.put( 23528, 40651 ); + _DICT.put( 23529, 36946 ); + _DICT.put( 23531, 39821 ); + _DICT.put( 23532, 64170 ); + _DICT.put( 23534, 38846 ); + _DICT.put( 23536, 39822 ); + _DICT.put( 23539, 39824 ); + _DICT.put( 23541, 37534 ); + _DICT.put( 23542, 39823 ); + _DICT.put( 23544, 37025 ); + _DICT.put( 23546, 36507 ); + _DICT.put( 23550, 37326 ); + _DICT.put( 23551, 36597 ); + _DICT.put( 23553, 38293 ); + _DICT.put( 23554, 37098 ); + _DICT.put( 23556, 36555 ); + _DICT.put( 23557, 39825 ); + _DICT.put( 23558, 36779 ); + _DICT.put( 23559, 39826 ); + _DICT.put( 23560, 39827 ); + _DICT.put( 23561, 35025 ); + _DICT.put( 23562, 37304 ); + _DICT.put( 23563, 36977 ); + _DICT.put( 23565, 39828 ); + _DICT.put( 23566, 37809 ); + _DICT.put( 23567, 36780 ); + _DICT.put( 23569, 36781 ); + _DICT.put( 23571, 39829 ); + _DICT.put( 23574, 37099 ); + _DICT.put( 23578, 36782 ); + _DICT.put( 23582, 64171 ); + _DICT.put( 23584, 39830 ); + _DICT.put( 23586, 39831 ); + _DICT.put( 23588, 38622 ); + _DICT.put( 23592, 39832 ); + _DICT.put( 23597, 35780 ); + _DICT.put( 23601, 36673 ); + _DICT.put( 23608, 39833 ); + _DICT.put( 23609, 39834 ); + _DICT.put( 23610, 36570 ); + _DICT.put( 23611, 36939 ); + _DICT.put( 23612, 37874 ); + _DICT.put( 23613, 36979 ); + _DICT.put( 23614, 38134 ); + _DICT.put( 23615, 37953 ); + _DICT.put( 23616, 35783 ); + _DICT.put( 23617, 39835 ); + _DICT.put( 23621, 35727 ); + _DICT.put( 23622, 39836 ); + _DICT.put( 23624, 35836 ); + _DICT.put( 23626, 37837 ); + _DICT.put( 23627, 35246 ); + _DICT.put( 23629, 36466 ); + _DICT.put( 23630, 39837 ); + _DICT.put( 23631, 39840 ); + _DICT.put( 23632, 39839 ); + _DICT.put( 23633, 35835 ); + _DICT.put( 23635, 39838 ); + _DICT.put( 23637, 37719 ); + _DICT.put( 23646, 37294 ); + _DICT.put( 23648, 37738 ); + _DICT.put( 23649, 36550 ); + _DICT.put( 23652, 37239 ); + _DICT.put( 23653, 38810 ); + _DICT.put( 23660, 39842 ); + _DICT.put( 23662, 39843 ); + _DICT.put( 23663, 37844 ); + _DICT.put( 23665, 36434 ); + _DICT.put( 23670, 39845 ); + _DICT.put( 23673, 39846 ); + _DICT.put( 23692, 39847 ); + _DICT.put( 23696, 35570 ); + _DICT.put( 23697, 39848 ); + _DICT.put( 23700, 39849 ); + _DICT.put( 23713, 35242 ); + _DICT.put( 23718, 64172 ); + _DICT.put( 23720, 37210 ); + _DICT.put( 23721, 35554 ); + _DICT.put( 23723, 39851 ); + _DICT.put( 23724, 38566 ); + _DICT.put( 23729, 37328 ); + _DICT.put( 23731, 35448 ); + _DICT.put( 23734, 39853 ); + _DICT.put( 23735, 39855 ); + _DICT.put( 23736, 35549 ); + _DICT.put( 23738, 64173 ); + _DICT.put( 23739, 39852 ); + _DICT.put( 23740, 39854 ); + _DICT.put( 23742, 39857 ); + _DICT.put( 23749, 39856 ); + _DICT.put( 23751, 39858 ); + _DICT.put( 23769, 39859 ); + _DICT.put( 23776, 37819 ); + _DICT.put( 23777, 35756 ); + _DICT.put( 23784, 35299 ); + _DICT.put( 23785, 39860 ); + _DICT.put( 23786, 39865 ); + _DICT.put( 23789, 39863 ); + _DICT.put( 23791, 38389 ); + _DICT.put( 23792, 38388 ); + _DICT.put( 23797, 64174 ); + _DICT.put( 23798, 37767 ); + _DICT.put( 23802, 39862 ); + _DICT.put( 23803, 36723 ); + _DICT.put( 23805, 39861 ); + _DICT.put( 23815, 37010 ); + _DICT.put( 23819, 39866 ); + _DICT.put( 23822, 36328 ); + _DICT.put( 23825, 39872 ); + _DICT.put( 23828, 39873 ); + _DICT.put( 23829, 39867 ); + _DICT.put( 23830, 35410 ); + _DICT.put( 23831, 39868 ); + _DICT.put( 23832, 39877 ); + _DICT.put( 23833, 39876 ); + _DICT.put( 23834, 39875 ); + _DICT.put( 23835, 39871 ); + _DICT.put( 23839, 39870 ); + _DICT.put( 23842, 39874 ); + _DICT.put( 23847, 64175 ); + _DICT.put( 23849, 38390 ); + _DICT.put( 23874, 64178 ); + _DICT.put( 23883, 39881 ); + _DICT.put( 23884, 39878 ); + _DICT.put( 23886, 39880 ); + _DICT.put( 23888, 38802 ); + _DICT.put( 23890, 39879 ); + _DICT.put( 23891, 64176 ); + _DICT.put( 23900, 39869 ); + _DICT.put( 23913, 37011 ); + _DICT.put( 23916, 39882 ); + _DICT.put( 23917, 64179 ); + _DICT.put( 23919, 36277 ); + _DICT.put( 23923, 39883 ); + _DICT.put( 23926, 39884 ); + _DICT.put( 23938, 39887 ); + _DICT.put( 23940, 39886 ); + _DICT.put( 23943, 39885 ); + _DICT.put( 23947, 37768 ); + _DICT.put( 23948, 39864 ); + _DICT.put( 23952, 39893 ); + _DICT.put( 23965, 39889 ); + _DICT.put( 23970, 39888 ); + _DICT.put( 23980, 39890 ); + _DICT.put( 23982, 39891 ); + _DICT.put( 23991, 39894 ); + _DICT.put( 23992, 64180 ); + _DICT.put( 23993, 64181 ); + _DICT.put( 23994, 38884 ); + _DICT.put( 23996, 39895 ); + _DICT.put( 23997, 39892 ); + _DICT.put( 24009, 39896 ); + _DICT.put( 24012, 35550 ); + _DICT.put( 24013, 39897 ); + _DICT.put( 24016, 64182 ); + _DICT.put( 24018, 39899 ); + _DICT.put( 24019, 39898 ); + _DICT.put( 24022, 39900 ); + _DICT.put( 24027, 39901 ); + _DICT.put( 24029, 37100 ); + _DICT.put( 24030, 36674 ); + _DICT.put( 24033, 36740 ); + _DICT.put( 24035, 37251 ); + _DICT.put( 24037, 36168 ); + _DICT.put( 24038, 36278 ); + _DICT.put( 24039, 36169 ); + _DICT.put( 24040, 35728 ); + _DICT.put( 24043, 39902 ); + _DICT.put( 24046, 36279 ); + _DICT.put( 24049, 36040 ); + _DICT.put( 24050, 39903 ); + _DICT.put( 24051, 38564 ); + _DICT.put( 24052, 37986 ); + _DICT.put( 24053, 39904 ); + _DICT.put( 24055, 36170 ); + _DICT.put( 24059, 35498 ); + _DICT.put( 24061, 37446 ); + _DICT.put( 24062, 35792 ); + _DICT.put( 24066, 36467 ); + _DICT.put( 24067, 38266 ); + _DICT.put( 24070, 38079 ); + _DICT.put( 24075, 39905 ); + _DICT.put( 24076, 35571 ); + _DICT.put( 24081, 39908 ); + _DICT.put( 24086, 37535 ); + _DICT.put( 24089, 39907 ); + _DICT.put( 24090, 39906 ); + _DICT.put( 24091, 39909 ); + _DICT.put( 24093, 37609 ); + _DICT.put( 24101, 36995 ); + _DICT.put( 24107, 36468 ); + _DICT.put( 24109, 37064 ); + _DICT.put( 24111, 37329 ); + _DICT.put( 24112, 35649 ); + _DICT.put( 24115, 37536 ); + _DICT.put( 24118, 39910 ); + _DICT.put( 24119, 39911 ); + _DICT.put( 24120, 36845 ); + _DICT.put( 24125, 38488 ); + _DICT.put( 24128, 39914 ); + _DICT.put( 24131, 39913 ); + _DICT.put( 24132, 39912 ); + _DICT.put( 24133, 38301 ); + _DICT.put( 24135, 39921 ); + _DICT.put( 24140, 38521 ); + _DICT.put( 24142, 39915 ); + _DICT.put( 24148, 39917 ); + _DICT.put( 24149, 38539 ); + _DICT.put( 24151, 39916 ); + _DICT.put( 24159, 39918 ); + _DICT.put( 24161, 38054 ); + _DICT.put( 24162, 39919 ); + _DICT.put( 24163, 38332 ); + _DICT.put( 24164, 39920 ); + _DICT.put( 24178, 35505 ); + _DICT.put( 24179, 38333 ); + _DICT.put( 24180, 37966 ); + _DICT.put( 24181, 39922 ); + _DICT.put( 24182, 39923 ); + _DICT.put( 24184, 36171 ); + _DICT.put( 24185, 35506 ); + _DICT.put( 24186, 39924 ); + _DICT.put( 24187, 36022 ); + _DICT.put( 24188, 38755 ); + _DICT.put( 24189, 38728 ); + _DICT.put( 24190, 35572 ); + _DICT.put( 24191, 39926 ); + _DICT.put( 24193, 37537 ); + _DICT.put( 24195, 36172 ); + _DICT.put( 24196, 36783 ); + _DICT.put( 24199, 38109 ); + _DICT.put( 24202, 36784 ); + _DICT.put( 24207, 36760 ); + _DICT.put( 24213, 37610 ); + _DICT.put( 24214, 38391 ); + _DICT.put( 24215, 37720 ); + _DICT.put( 24218, 36173 ); + _DICT.put( 24220, 38267 ); + _DICT.put( 24224, 39927 ); + _DICT.put( 24230, 37752 ); + _DICT.put( 24231, 36288 ); + _DICT.put( 24235, 36041 ); + _DICT.put( 24237, 37611 ); + _DICT.put( 24245, 35009 ); + _DICT.put( 24246, 36750 ); + _DICT.put( 24247, 36174 ); + _DICT.put( 24248, 38758 ); + _DICT.put( 24257, 39928 ); + _DICT.put( 24258, 39929 ); + _DICT.put( 24259, 38000 ); + _DICT.put( 24264, 39930 ); + _DICT.put( 24265, 38901 ); + _DICT.put( 24266, 38988 ); + _DICT.put( 24271, 39932 ); + _DICT.put( 24272, 39931 ); + _DICT.put( 24275, 35430 ); + _DICT.put( 24278, 40000 ); + _DICT.put( 24282, 40003 ); + _DICT.put( 24283, 40004 ); + _DICT.put( 24285, 40002 ); + _DICT.put( 24287, 38239 ); + _DICT.put( 24288, 36785 ); + _DICT.put( 24289, 40006 ); + _DICT.put( 24290, 40005 ); + _DICT.put( 24291, 40001 ); + _DICT.put( 24296, 40007 ); + _DICT.put( 24297, 40008 ); + _DICT.put( 24300, 40009 ); + _DICT.put( 24304, 40012 ); + _DICT.put( 24305, 40010 ); + _DICT.put( 24307, 40011 ); + _DICT.put( 24308, 40013 ); + _DICT.put( 24310, 35204 ); + _DICT.put( 24311, 37612 ); + _DICT.put( 24312, 40014 ); + _DICT.put( 24314, 35994 ); + _DICT.put( 24315, 35316 ); + _DICT.put( 24316, 37973 ); + _DICT.put( 24318, 40015 ); + _DICT.put( 24319, 37881 ); + _DICT.put( 24321, 38361 ); + _DICT.put( 24323, 40016 ); + _DICT.put( 24324, 38989 ); + _DICT.put( 24329, 40017 ); + _DICT.put( 24330, 38334 ); + _DICT.put( 24331, 40020 ); + _DICT.put( 24332, 39071 ); + _DICT.put( 24333, 39087 ); + _DICT.put( 24335, 36526 ); + _DICT.put( 24336, 37875 ); + _DICT.put( 24337, 40021 ); + _DICT.put( 24339, 35708 ); + _DICT.put( 24340, 37538 ); + _DICT.put( 24341, 35064 ); + _DICT.put( 24342, 40022 ); + _DICT.put( 24343, 38308 ); + _DICT.put( 24344, 36175 ); + _DICT.put( 24347, 37487 ); + _DICT.put( 24351, 37613 ); + _DICT.put( 24353, 64183 ); + _DICT.put( 24357, 38637 ); + _DICT.put( 24358, 36023 ); + _DICT.put( 24359, 36042 ); + _DICT.put( 24361, 40023 ); + _DICT.put( 24365, 40024 ); + _DICT.put( 24367, 40030 ); + _DICT.put( 24369, 36579 ); + _DICT.put( 24372, 64184 ); + _DICT.put( 24373, 37539 ); + _DICT.put( 24375, 35757 ); + _DICT.put( 24376, 40025 ); + _DICT.put( 24380, 38218 ); + _DICT.put( 24382, 37477 ); + _DICT.put( 24385, 40026 ); + _DICT.put( 24389, 64103 ); + _DICT.put( 24392, 40027 ); + _DICT.put( 24394, 35758 ); + _DICT.put( 24396, 40028 ); + _DICT.put( 24398, 40029 ); + _DICT.put( 24401, 40031 ); + _DICT.put( 24403, 37782 ); + _DICT.put( 24406, 40032 ); + _DICT.put( 24407, 40033 ); + _DICT.put( 24409, 40034 ); + _DICT.put( 24412, 40019 ); + _DICT.put( 24413, 40018 ); + _DICT.put( 24417, 40035 ); + _DICT.put( 24418, 35936 ); + _DICT.put( 24422, 38214 ); + _DICT.put( 24423, 64185 ); + _DICT.put( 24425, 36298 ); + _DICT.put( 24426, 38230 ); + _DICT.put( 24427, 37540 ); + _DICT.put( 24428, 38250 ); + _DICT.put( 24429, 40036 ); + _DICT.put( 24432, 36786 ); + _DICT.put( 24433, 35173 ); + _DICT.put( 24435, 40037 ); + _DICT.put( 24439, 40038 ); + _DICT.put( 24441, 38640 ); + _DICT.put( 24444, 38110 ); + _DICT.put( 24447, 40041 ); + _DICT.put( 24448, 35229 ); + _DICT.put( 24449, 37034 ); + _DICT.put( 24450, 40040 ); + _DICT.put( 24451, 40039 ); + _DICT.put( 24452, 35937 ); + _DICT.put( 24453, 37330 ); + _DICT.put( 24455, 40045 ); + _DICT.put( 24456, 40043 ); + _DICT.put( 24458, 40042 ); + _DICT.put( 24459, 38821 ); + _DICT.put( 24460, 36067 ); + _DICT.put( 24464, 36761 ); + _DICT.put( 24465, 40044 ); + _DICT.put( 24466, 37739 ); + _DICT.put( 24467, 36701 ); + _DICT.put( 24471, 37822 ); + _DICT.put( 24472, 40048 ); + _DICT.put( 24473, 40047 ); + _DICT.put( 24478, 40046 ); + _DICT.put( 24480, 40049 ); + _DICT.put( 24481, 36068 ); + _DICT.put( 24488, 40050 ); + _DICT.put( 24489, 38300 ); + _DICT.put( 24490, 36730 ); + _DICT.put( 24493, 40051 ); + _DICT.put( 24494, 38135 ); + _DICT.put( 24499, 37823 ); + _DICT.put( 24500, 37541 ); + _DICT.put( 24503, 64186 ); + _DICT.put( 24505, 37711 ); + _DICT.put( 24508, 40052 ); + _DICT.put( 24509, 35658 ); + _DICT.put( 24515, 36947 ); + _DICT.put( 24517, 38219 ); + _DICT.put( 24524, 35573 ); + _DICT.put( 24525, 37957 ); + _DICT.put( 24534, 40053 ); + _DICT.put( 24535, 36469 ); + _DICT.put( 24536, 38489 ); + _DICT.put( 24537, 38490 ); + _DICT.put( 24540, 35230 ); + _DICT.put( 24541, 40058 ); + _DICT.put( 24542, 64187 ); + _DICT.put( 24544, 37513 ); + _DICT.put( 24548, 40055 ); + _DICT.put( 24555, 35317 ); + _DICT.put( 24560, 40107 ); + _DICT.put( 24561, 40057 ); + _DICT.put( 24565, 37967 ); + _DICT.put( 24568, 40056 ); + _DICT.put( 24571, 40054 ); + _DICT.put( 24573, 36250 ); + _DICT.put( 24575, 40060 ); + _DICT.put( 24590, 40067 ); + _DICT.put( 24591, 40073 ); + _DICT.put( 24592, 40065 ); + _DICT.put( 24594, 37755 ); + _DICT.put( 24597, 40070 ); + _DICT.put( 24598, 38268 ); + _DICT.put( 24601, 40064 ); + _DICT.put( 24603, 40069 ); + _DICT.put( 24604, 38885 ); + _DICT.put( 24605, 36470 ); + _DICT.put( 24608, 37331 ); + _DICT.put( 24609, 40061 ); + _DICT.put( 24613, 35709 ); + _DICT.put( 24614, 40072 ); + _DICT.put( 24615, 37035 ); + _DICT.put( 24616, 35205 ); + _DICT.put( 24617, 40066 ); + _DICT.put( 24618, 35318 ); + _DICT.put( 24619, 40071 ); + _DICT.put( 24623, 35759 ); + _DICT.put( 24625, 40068 ); + _DICT.put( 24634, 40074 ); + _DICT.put( 24641, 40076 ); + _DICT.put( 24642, 40086 ); + _DICT.put( 24643, 40084 ); + _DICT.put( 24646, 40081 ); + _DICT.put( 24650, 40080 ); + _DICT.put( 24651, 38902 ); + _DICT.put( 24653, 40082 ); + _DICT.put( 24656, 35760 ); + _DICT.put( 24658, 36176 ); + _DICT.put( 24661, 36762 ); + _DICT.put( 24665, 40089 ); + _DICT.put( 24666, 40075 ); + _DICT.put( 24669, 64188 ); + _DICT.put( 24671, 40079 ); + _DICT.put( 24672, 40062 ); + _DICT.put( 24674, 35320 ); + _DICT.put( 24675, 40083 ); + _DICT.put( 24676, 40085 ); + _DICT.put( 24677, 37488 ); + _DICT.put( 24680, 36262 ); + _DICT.put( 24681, 35254 ); + _DICT.put( 24682, 40077 ); + _DICT.put( 24683, 40088 ); + _DICT.put( 24684, 40087 ); + _DICT.put( 24685, 35761 ); + _DICT.put( 24687, 37287 ); + _DICT.put( 24688, 35462 ); + _DICT.put( 24693, 35938 ); + _DICT.put( 24695, 40078 ); + _DICT.put( 24705, 40090 ); + _DICT.put( 24707, 40093 ); + _DICT.put( 24708, 40095 ); + _DICT.put( 24709, 64189 ); + _DICT.put( 24713, 36539 ); + _DICT.put( 24714, 64190 ); + _DICT.put( 24715, 40101 ); + _DICT.put( 24716, 37614 ); + _DICT.put( 24717, 40091 ); + _DICT.put( 24722, 40099 ); + _DICT.put( 24724, 35319 ); + _DICT.put( 24726, 40097 ); + _DICT.put( 24727, 40098 ); + _DICT.put( 24730, 40094 ); + _DICT.put( 24731, 40096 ); + _DICT.put( 24735, 36069 ); + _DICT.put( 24736, 38729 ); + _DICT.put( 24739, 35507 ); + _DICT.put( 24742, 35192 ); + _DICT.put( 24743, 40100 ); + _DICT.put( 24745, 37977 ); + _DICT.put( 24746, 34987 ); + _DICT.put( 24754, 38111 ); + _DICT.put( 24755, 40059 ); + _DICT.put( 24756, 40106 ); + _DICT.put( 24757, 40110 ); + _DICT.put( 24758, 38627 ); + _DICT.put( 24760, 40103 ); + _DICT.put( 24764, 37769 ); + _DICT.put( 24765, 40108 ); + _DICT.put( 24773, 36846 ); + _DICT.put( 24774, 40109 ); + _DICT.put( 24775, 37845 ); + _DICT.put( 24785, 39014 ); + _DICT.put( 24787, 40105 ); + _DICT.put( 24789, 64192 ); + _DICT.put( 24792, 40111 ); + _DICT.put( 24794, 36251 ); + _DICT.put( 24796, 37065 ); + _DICT.put( 24798, 64191 ); + _DICT.put( 24799, 35026 ); + _DICT.put( 24800, 40104 ); + _DICT.put( 24801, 40102 ); + _DICT.put( 24803, 37241 ); + _DICT.put( 24807, 40092 ); + _DICT.put( 24808, 36435 ); + _DICT.put( 24816, 37316 ); + _DICT.put( 24817, 40123 ); + _DICT.put( 24818, 64194 ); + _DICT.put( 24819, 37242 ); + _DICT.put( 24820, 40118 ); + _DICT.put( 24822, 40115 ); + _DICT.put( 24823, 40116 ); + _DICT.put( 24825, 36580 ); + _DICT.put( 24826, 40119 ); + _DICT.put( 24827, 40122 ); + _DICT.put( 24832, 40117 ); + _DICT.put( 24833, 36676 ); + _DICT.put( 24835, 40120 ); + _DICT.put( 24838, 40114 ); + _DICT.put( 24840, 38650 ); + _DICT.put( 24841, 38649 ); + _DICT.put( 24845, 40124 ); + _DICT.put( 24846, 40125 ); + _DICT.put( 24847, 35027 ); + _DICT.put( 24849, 64195 ); + _DICT.put( 24853, 40113 ); + _DICT.put( 24858, 35824 ); + _DICT.put( 24859, 34980 ); + _DICT.put( 24863, 35508 ); + _DICT.put( 24864, 64193 ); + _DICT.put( 24865, 40121 ); + _DICT.put( 24871, 40129 ); + _DICT.put( 24872, 40128 ); + _DICT.put( 24876, 40133 ); + _DICT.put( 24880, 64197 ); + _DICT.put( 24884, 40134 ); + _DICT.put( 24887, 64196 ); + _DICT.put( 24892, 40132 ); + _DICT.put( 24893, 40135 ); + _DICT.put( 24894, 40127 ); + _DICT.put( 24895, 40131 ); + _DICT.put( 24898, 40136 ); + _DICT.put( 24900, 40137 ); + _DICT.put( 24903, 40126 ); + _DICT.put( 24904, 36508 ); + _DICT.put( 24906, 40130 ); + _DICT.put( 24907, 37332 ); + _DICT.put( 24908, 36177 ); + _DICT.put( 24909, 40112 ); + _DICT.put( 24910, 36948 ); + _DICT.put( 24915, 40150 ); + _DICT.put( 24917, 38375 ); + _DICT.put( 24920, 40140 ); + _DICT.put( 24921, 40141 ); + _DICT.put( 24922, 40142 ); + _DICT.put( 24925, 40149 ); + _DICT.put( 24927, 40148 ); + _DICT.put( 24930, 38557 ); + _DICT.put( 24931, 35509 ); + _DICT.put( 24933, 40146 ); + _DICT.put( 24935, 35940 ); + _DICT.put( 24936, 35411 ); + _DICT.put( 24939, 40143 ); + _DICT.put( 24942, 38838 ); + _DICT.put( 24943, 40145 ); + _DICT.put( 24944, 35028 ); + _DICT.put( 24945, 40147 ); + _DICT.put( 24947, 40138 ); + _DICT.put( 24948, 40144 ); + _DICT.put( 24949, 40151 ); + _DICT.put( 24950, 35939 ); + _DICT.put( 24951, 40139 ); + _DICT.put( 24958, 38780 ); + _DICT.put( 24962, 38730 ); + _DICT.put( 24967, 40154 ); + _DICT.put( 24970, 40158 ); + _DICT.put( 24974, 37278 ); + _DICT.put( 24976, 38903 ); + _DICT.put( 24977, 40159 ); + _DICT.put( 24980, 40156 ); + _DICT.put( 24982, 40153 ); + _DICT.put( 24984, 64198 ); + _DICT.put( 24985, 40152 ); + _DICT.put( 24986, 40157 ); + _DICT.put( 24996, 38318 ); + _DICT.put( 24999, 37810 ); + _DICT.put( 25001, 35941 ); + _DICT.put( 25003, 40160 ); + _DICT.put( 25004, 40155 ); + _DICT.put( 25006, 40161 ); + _DICT.put( 25010, 35995 ); + _DICT.put( 25014, 35247 ); + _DICT.put( 25018, 40169 ); + _DICT.put( 25022, 35510 ); + _DICT.put( 25027, 40167 ); + _DICT.put( 25030, 40168 ); + _DICT.put( 25031, 36263 ); + _DICT.put( 25032, 40166 ); + _DICT.put( 25033, 40164 ); + _DICT.put( 25034, 40163 ); + _DICT.put( 25035, 40170 ); + _DICT.put( 25036, 40162 ); + _DICT.put( 25037, 40172 ); + _DICT.put( 25040, 35321 ); + _DICT.put( 25059, 40174 ); + _DICT.put( 25062, 40173 ); + _DICT.put( 25074, 37542 ); + _DICT.put( 25076, 40177 ); + _DICT.put( 25078, 40175 ); + _DICT.put( 25079, 40165 ); + _DICT.put( 25080, 35996 ); + _DICT.put( 25082, 40176 ); + _DICT.put( 25084, 40180 ); + _DICT.put( 25085, 40179 ); + _DICT.put( 25086, 40181 ); + _DICT.put( 25087, 40178 ); + _DICT.put( 25088, 40182 ); + _DICT.put( 25096, 40183 ); + _DICT.put( 25097, 40184 ); + _DICT.put( 25098, 38376 ); + _DICT.put( 25100, 40186 ); + _DICT.put( 25101, 40185 ); + _DICT.put( 25102, 36702 ); + _DICT.put( 25104, 37036 ); + _DICT.put( 25105, 35300 ); + _DICT.put( 25106, 35322 ); + _DICT.put( 25107, 64199 ); + _DICT.put( 25108, 40187 ); + _DICT.put( 25110, 35005 ); + _DICT.put( 25114, 37066 ); + _DICT.put( 25115, 40188 ); + _DICT.put( 25117, 59073 ); + _DICT.put( 25118, 40256 ); + _DICT.put( 25119, 35969 ); + _DICT.put( 25121, 40257 ); + _DICT.put( 25126, 37101 ); + _DICT.put( 25130, 40258 ); + _DICT.put( 25134, 40259 ); + _DICT.put( 25135, 35673 ); + _DICT.put( 25136, 40260 ); + _DICT.put( 25138, 40261 ); + _DICT.put( 25139, 40262 ); + _DICT.put( 25140, 37333 ); + _DICT.put( 25144, 36043 ); + _DICT.put( 25147, 38623 ); + _DICT.put( 25151, 38491 ); + _DICT.put( 25152, 36746 ); + _DICT.put( 25153, 40263 ); + _DICT.put( 25159, 37102 ); + _DICT.put( 25160, 59323 ); + _DICT.put( 25161, 38112 ); + _DICT.put( 25163, 36584 ); + _DICT.put( 25165, 36299 ); + _DICT.put( 25166, 40264 ); + _DICT.put( 25171, 37317 ); + _DICT.put( 25173, 38309 ); + _DICT.put( 25176, 37359 ); + _DICT.put( 25179, 40267 ); + _DICT.put( 25182, 40265 ); + _DICT.put( 25184, 40268 ); + _DICT.put( 25187, 40266 ); + _DICT.put( 25192, 40269 ); + _DICT.put( 25198, 38319 ); + _DICT.put( 25201, 34997 ); + _DICT.put( 25206, 38269 ); + _DICT.put( 25209, 38113 ); + _DICT.put( 25212, 40270 ); + _DICT.put( 25214, 40273 ); + _DICT.put( 25215, 36787 ); + _DICT.put( 25216, 35674 ); + _DICT.put( 25218, 40271 ); + _DICT.put( 25219, 40278 ); + _DICT.put( 25220, 36788 ); + _DICT.put( 25225, 40272 ); + _DICT.put( 25226, 37987 ); + _DICT.put( 25233, 38781 ); + _DICT.put( 25234, 40274 ); + _DICT.put( 25235, 40275 ); + _DICT.put( 25236, 40279 ); + _DICT.put( 25237, 37770 ); + _DICT.put( 25238, 40276 ); + _DICT.put( 25239, 36178 ); + _DICT.put( 25240, 37084 ); + _DICT.put( 25243, 40293 ); + _DICT.put( 25244, 38066 ); + _DICT.put( 25246, 37360 ); + _DICT.put( 25254, 64200 ); + _DICT.put( 25259, 38114 ); + _DICT.put( 25260, 40363 ); + _DICT.put( 25265, 38392 ); + _DICT.put( 25269, 37615 ); + _DICT.put( 25273, 38549 ); + _DICT.put( 25275, 40282 ); + _DICT.put( 25276, 35231 ); + _DICT.put( 25277, 37514 ); + _DICT.put( 25282, 40291 ); + _DICT.put( 25285, 37459 ); + _DICT.put( 25286, 40285 ); + _DICT.put( 25287, 40292 ); + _DICT.put( 25288, 40287 ); + _DICT.put( 25289, 40294 ); + _DICT.put( 25290, 40290 ); + _DICT.put( 25292, 40289 ); + _DICT.put( 25293, 38031 ); + _DICT.put( 25295, 40283 ); + _DICT.put( 25296, 35323 ); + _DICT.put( 25297, 40281 ); + _DICT.put( 25298, 35729 ); + _DICT.put( 25299, 37361 ); + _DICT.put( 25300, 40277 ); + _DICT.put( 25303, 40280 ); + _DICT.put( 25304, 36179 ); + _DICT.put( 25305, 37081 ); + _DICT.put( 25307, 36789 ); + _DICT.put( 25308, 40288 ); + _DICT.put( 25309, 38001 ); + _DICT.put( 25312, 35730 ); + _DICT.put( 25313, 35431 ); + _DICT.put( 25324, 35463 ); + _DICT.put( 25325, 36928 ); + _DICT.put( 25326, 40296 ); + _DICT.put( 25327, 40301 ); + _DICT.put( 25329, 40297 ); + _DICT.put( 25331, 35997 ); + _DICT.put( 25333, 40302 ); + _DICT.put( 25334, 36417 ); + _DICT.put( 25335, 36233 ); + _DICT.put( 25342, 36677 ); + _DICT.put( 25343, 40284 ); + _DICT.put( 25345, 36509 ); + _DICT.put( 25346, 40299 ); + _DICT.put( 25351, 36471 ); + _DICT.put( 25352, 40300 ); + _DICT.put( 25353, 35010 ); + _DICT.put( 25356, 40295 ); + _DICT.put( 25361, 37543 ); + _DICT.put( 25369, 35731 ); + _DICT.put( 25375, 35762 ); + _DICT.put( 25383, 40298 ); + _DICT.put( 25384, 34981 ); + _DICT.put( 25387, 36289 ); + _DICT.put( 25391, 36949 ); + _DICT.put( 25402, 37616 ); + _DICT.put( 25405, 38098 ); + _DICT.put( 25406, 40304 ); + _DICT.put( 25407, 37245 ); + _DICT.put( 25417, 37288 ); + _DICT.put( 25420, 36426 ); + _DICT.put( 25421, 40305 ); + _DICT.put( 25423, 40307 ); + _DICT.put( 25424, 40303 ); + _DICT.put( 25429, 38367 ); + _DICT.put( 25431, 37563 ); + _DICT.put( 25436, 37243 ); + _DICT.put( 25447, 38393 ); + _DICT.put( 25448, 36556 ); + _DICT.put( 25449, 40320 ); + _DICT.put( 25451, 40318 ); + _DICT.put( 25454, 37016 ); + _DICT.put( 25458, 35998 ); + _DICT.put( 25462, 40312 ); + _DICT.put( 25463, 36791 ); + _DICT.put( 25466, 37862 ); + _DICT.put( 25467, 37968 ); + _DICT.put( 25472, 40310 ); + _DICT.put( 25475, 37244 ); + _DICT.put( 25480, 36598 ); + _DICT.put( 25481, 40315 ); + _DICT.put( 25484, 36790 ); + _DICT.put( 25486, 40309 ); + _DICT.put( 25487, 40314 ); + _DICT.put( 25490, 38002 ); + _DICT.put( 25494, 40308 ); + _DICT.put( 25496, 35904 ); + _DICT.put( 25499, 35452 ); + _DICT.put( 25503, 40316 ); + _DICT.put( 25504, 38825 ); + _DICT.put( 25505, 36300 ); + _DICT.put( 25506, 37460 ); + _DICT.put( 25507, 40313 ); + _DICT.put( 25509, 37082 ); + _DICT.put( 25511, 36180 ); + _DICT.put( 25512, 36996 ); + _DICT.put( 25513, 35206 ); + _DICT.put( 25514, 37211 ); + _DICT.put( 25515, 40311 ); + _DICT.put( 25516, 35684 ); + _DICT.put( 25522, 35942 ); + _DICT.put( 25524, 37581 ); + _DICT.put( 25525, 40317 ); + _DICT.put( 25531, 37246 ); + _DICT.put( 25534, 40321 ); + _DICT.put( 25536, 40323 ); + _DICT.put( 25539, 37301 ); + _DICT.put( 25540, 40329 ); + _DICT.put( 25542, 40324 ); + _DICT.put( 25545, 40326 ); + _DICT.put( 25551, 38240 ); + _DICT.put( 25552, 37617 ); + _DICT.put( 25554, 40327 ); + _DICT.put( 25558, 38731 ); + _DICT.put( 25562, 38759 ); + _DICT.put( 25563, 35511 ); + _DICT.put( 25569, 34988 ); + _DICT.put( 25571, 40325 ); + _DICT.put( 25577, 40322 ); + _DICT.put( 25582, 35574 ); + _DICT.put( 25588, 35207 ); + _DICT.put( 25589, 64201 ); + _DICT.put( 25590, 40328 ); + _DICT.put( 25594, 38760 ); + _DICT.put( 25606, 40332 ); + _DICT.put( 25613, 37305 ); + _DICT.put( 25615, 40339 ); + _DICT.put( 25619, 40333 ); + _DICT.put( 25622, 40330 ); + _DICT.put( 25623, 40337 ); + _DICT.put( 25628, 40306 ); + _DICT.put( 25638, 40334 ); + _DICT.put( 25640, 40338 ); + _DICT.put( 25644, 38080 ); + _DICT.put( 25645, 37771 ); + _DICT.put( 25652, 40331 ); + _DICT.put( 25654, 40335 ); + _DICT.put( 25658, 35943 ); + _DICT.put( 25662, 36335 ); + _DICT.put( 25666, 37083 ); + _DICT.put( 25678, 40343 ); + _DICT.put( 25688, 37701 ); + _DICT.put( 25696, 64202 ); + _DICT.put( 25703, 40340 ); + _DICT.put( 25705, 38528 ); + _DICT.put( 25711, 40341 ); + _DICT.put( 25718, 40342 ); + _DICT.put( 25720, 38604 ); + _DICT.put( 25722, 37024 ); + _DICT.put( 25731, 35970 ); + _DICT.put( 25736, 40349 ); + _DICT.put( 25746, 36436 ); + _DICT.put( 25747, 40346 ); + _DICT.put( 25749, 40345 ); + _DICT.put( 25754, 37969 ); + _DICT.put( 25757, 64203 ); + _DICT.put( 25758, 37811 ); + _DICT.put( 25764, 37712 ); + _DICT.put( 25765, 40347 ); + _DICT.put( 25769, 40348 ); + _DICT.put( 25771, 38287 ); + _DICT.put( 25773, 37988 ); + _DICT.put( 25774, 36418 ); + _DICT.put( 25776, 37103 ); + _DICT.put( 25778, 38511 ); + _DICT.put( 25785, 35432 ); + _DICT.put( 25787, 40355 ); + _DICT.put( 25788, 40350 ); + _DICT.put( 25793, 38761 ); + _DICT.put( 25794, 40357 ); + _DICT.put( 25797, 40353 ); + _DICT.put( 25799, 40354 ); + _DICT.put( 25805, 37248 ); + _DICT.put( 25806, 64204 ); + _DICT.put( 25810, 40352 ); + _DICT.put( 25812, 40286 ); + _DICT.put( 25816, 40356 ); + _DICT.put( 25818, 40351 ); + _DICT.put( 25824, 40361 ); + _DICT.put( 25825, 40362 ); + _DICT.put( 25826, 37702 ); + _DICT.put( 25827, 40364 ); + _DICT.put( 25830, 36419 ); + _DICT.put( 25831, 40359 ); + _DICT.put( 25836, 35675 ); + _DICT.put( 25839, 40365 ); + _DICT.put( 25841, 40358 ); + _DICT.put( 25842, 40369 ); + _DICT.put( 25844, 40368 ); + _DICT.put( 25846, 40367 ); + _DICT.put( 25850, 40370 ); + _DICT.put( 25853, 40372 ); + _DICT.put( 25854, 36847 ); + _DICT.put( 25856, 40371 ); + _DICT.put( 25861, 40375 ); + _DICT.put( 25880, 40373 ); + _DICT.put( 25884, 40374 ); + _DICT.put( 25885, 40336 ); + _DICT.put( 25891, 40377 ); + _DICT.put( 25892, 40376 ); + _DICT.put( 25898, 40344 ); + _DICT.put( 25899, 40378 ); + _DICT.put( 25900, 40366 ); + _DICT.put( 25903, 36472 ); + _DICT.put( 25908, 40379 ); + _DICT.put( 25909, 40380 ); + _DICT.put( 25910, 40382 ); + _DICT.put( 25911, 40381 ); + _DICT.put( 25912, 40383 ); + _DICT.put( 25913, 35324 ); + _DICT.put( 25915, 36181 ); + _DICT.put( 25918, 38394 ); + _DICT.put( 25919, 37037 ); + _DICT.put( 25925, 36044 ); + _DICT.put( 25928, 40385 ); + _DICT.put( 25933, 40388 ); + _DICT.put( 25934, 64205 ); + _DICT.put( 25935, 38257 ); + _DICT.put( 25937, 35710 ); + _DICT.put( 25941, 40387 ); + _DICT.put( 25942, 40386 ); + _DICT.put( 25943, 38003 ); + _DICT.put( 25944, 40389 ); + _DICT.put( 25945, 35763 ); + _DICT.put( 25949, 40391 ); + _DICT.put( 25950, 40390 ); + _DICT.put( 25954, 35512 ); + _DICT.put( 25955, 36437 ); + _DICT.put( 25958, 37846 ); + _DICT.put( 25964, 35944 ); + _DICT.put( 25968, 37012 ); + _DICT.put( 25970, 40392 ); + _DICT.put( 25972, 37038 ); + _DICT.put( 25973, 37703 ); + _DICT.put( 25975, 38270 ); + _DICT.put( 25976, 40393 ); + _DICT.put( 25986, 40394 ); + _DICT.put( 25987, 40395 ); + _DICT.put( 25991, 38326 ); + _DICT.put( 25992, 39804 ); + _DICT.put( 25993, 37060 ); + _DICT.put( 25996, 38251 ); + _DICT.put( 25998, 36310 ); + _DICT.put( 26000, 38115 ); + _DICT.put( 26001, 38081 ); + _DICT.put( 26007, 37740 ); + _DICT.put( 26009, 38847 ); + _DICT.put( 26011, 40397 ); + _DICT.put( 26012, 36558 ); + _DICT.put( 26015, 40398 ); + _DICT.put( 26017, 34996 ); + _DICT.put( 26020, 35794 ); + _DICT.put( 26021, 37067 ); + _DICT.put( 26023, 38272 ); + _DICT.put( 26027, 40399 ); + _DICT.put( 26028, 36449 ); + _DICT.put( 26029, 37478 ); + _DICT.put( 26031, 36474 ); + _DICT.put( 26032, 36950 ); + _DICT.put( 26039, 40400 ); + _DICT.put( 26041, 38395 ); + _DICT.put( 26044, 35223 ); + _DICT.put( 26045, 36475 ); + _DICT.put( 26049, 40403 ); + _DICT.put( 26051, 40401 ); + _DICT.put( 26052, 40404 ); + _DICT.put( 26053, 38839 ); + _DICT.put( 26054, 40402 ); + _DICT.put( 26059, 37113 ); + _DICT.put( 26060, 40405 ); + _DICT.put( 26063, 37296 ); + _DICT.put( 26066, 40406 ); + _DICT.put( 26071, 35576 ); + _DICT.put( 26073, 40408 ); + _DICT.put( 26075, 40407 ); + _DICT.put( 26080, 40409 ); + _DICT.put( 26081, 40410 ); + _DICT.put( 26082, 35577 ); + _DICT.put( 26085, 37882 ); + _DICT.put( 26086, 37461 ); + _DICT.put( 26087, 35724 ); + _DICT.put( 26088, 36476 ); + _DICT.put( 26089, 37249 ); + _DICT.put( 26092, 36731 ); + _DICT.put( 26093, 34990 ); + _DICT.put( 26097, 40411 ); + _DICT.put( 26106, 35232 ); + _DICT.put( 26107, 40415 ); + _DICT.put( 26112, 64206 ); + _DICT.put( 26114, 36182 ); + _DICT.put( 26115, 40414 ); + _DICT.put( 26118, 36265 ); + _DICT.put( 26119, 36792 ); + _DICT.put( 26121, 64209 ); + _DICT.put( 26122, 40413 ); + _DICT.put( 26124, 36793 ); + _DICT.put( 26126, 38590 ); + _DICT.put( 26127, 36264 ); + _DICT.put( 26131, 35029 ); + _DICT.put( 26132, 37068 ); + _DICT.put( 26133, 64207 ); + _DICT.put( 26140, 40420 ); + _DICT.put( 26142, 64211 ); + _DICT.put( 26143, 37039 ); + _DICT.put( 26144, 35174 ); + _DICT.put( 26148, 64212 ); + _DICT.put( 26149, 36724 ); + _DICT.put( 26151, 38534 ); + _DICT.put( 26152, 36336 ); + _DICT.put( 26157, 36794 ); + _DICT.put( 26158, 64210 ); + _DICT.put( 26159, 37029 ); + _DICT.put( 26161, 64099 ); + _DICT.put( 26164, 40419 ); + _DICT.put( 26165, 40417 ); + _DICT.put( 26166, 40418 ); + _DICT.put( 26171, 64208 ); + _DICT.put( 26172, 37515 ); + _DICT.put( 26175, 40517 ); + _DICT.put( 26177, 40424 ); + _DICT.put( 26178, 36510 ); + _DICT.put( 26179, 36183 ); + _DICT.put( 26180, 40422 ); + _DICT.put( 26185, 40423 ); + _DICT.put( 26187, 36951 ); + _DICT.put( 26191, 40421 ); + _DICT.put( 26194, 36430 ); + _DICT.put( 26199, 64214 ); + _DICT.put( 26201, 64215 ); + _DICT.put( 26205, 40426 ); + _DICT.put( 26206, 40425 ); + _DICT.put( 26207, 40430 ); + _DICT.put( 26210, 40431 ); + _DICT.put( 26212, 40427 ); + _DICT.put( 26213, 64213 ); + _DICT.put( 26214, 35393 ); + _DICT.put( 26215, 40428 ); + _DICT.put( 26216, 40429 ); + _DICT.put( 26217, 38099 ); + _DICT.put( 26222, 38273 ); + _DICT.put( 26223, 35945 ); + _DICT.put( 26224, 40432 ); + _DICT.put( 26227, 64217 ); + _DICT.put( 26228, 37040 ); + _DICT.put( 26230, 36795 ); + _DICT.put( 26234, 37489 ); + _DICT.put( 26241, 35781 ); + _DICT.put( 26243, 40433 ); + _DICT.put( 26244, 40437 ); + _DICT.put( 26247, 35273 ); + _DICT.put( 26248, 40434 ); + _DICT.put( 26249, 40436 ); + _DICT.put( 26254, 40435 ); + _DICT.put( 26257, 36747 ); + _DICT.put( 26262, 37479 ); + _DICT.put( 26263, 35011 ); + _DICT.put( 26264, 40438 ); + _DICT.put( 26265, 64218 ); + _DICT.put( 26269, 40439 ); + _DICT.put( 26272, 64219 ); + _DICT.put( 26274, 37544 ); + _DICT.put( 26278, 38895 ); + _DICT.put( 26283, 36450 ); + _DICT.put( 26286, 38377 ); + _DICT.put( 26290, 64220 ); + _DICT.put( 26292, 38492 ); + _DICT.put( 26296, 40513 ); + _DICT.put( 26297, 40441 ); + _DICT.put( 26300, 40444 ); + _DICT.put( 26302, 40443 ); + _DICT.put( 26303, 64221 ); + _DICT.put( 26305, 40440 ); + _DICT.put( 26308, 40512 ); + _DICT.put( 26311, 37852 ); + _DICT.put( 26313, 40442 ); + _DICT.put( 26326, 40514 ); + _DICT.put( 26329, 36748 ); + _DICT.put( 26330, 40515 ); + _DICT.put( 26332, 38762 ); + _DICT.put( 26333, 38040 ); + m_initialized = true; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_b.java b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_b.java new file mode 100644 index 0000000..db3e4fc --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_b.java @@ -0,0 +1,3093 @@ +/* + * cp932_b.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.bocoree + * + * jp.sourceforge.lipsync.bocoree is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.bocoree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.bocoree; + +import java.util.*; + +public class cp932_b { + private static HashMap _DICT = new HashMap(); + private static boolean m_initialized = false; + + public static int getMinKey() { + return 26336; + } + + public static int getMaxKey() { + return 35997; + } + + public static int get( int key ) { + if( !m_initialized ){ + init(); + } + if ( _DICT.containsKey( key ) ) { + return ((Integer) _DICT.get( key )).intValue(); + } else { + return -1; + } + } + + private static void init() { + _DICT.put( 26336, 40516 ); + _DICT.put( 26342, 40518 ); + _DICT.put( 26345, 40519 ); + _DICT.put( 26352, 40520 ); + _DICT.put( 26354, 35784 ); + _DICT.put( 26355, 35175 ); + _DICT.put( 26356, 36184 ); + _DICT.put( 26357, 40521 ); + _DICT.put( 26359, 40522 ); + _DICT.put( 26360, 36753 ); + _DICT.put( 26361, 37250 ); + _DICT.put( 26362, 64222 ); + _DICT.put( 26363, 64102 ); + _DICT.put( 26364, 39382 ); + _DICT.put( 26365, 37213 ); + _DICT.put( 26366, 37212 ); + _DICT.put( 26367, 37334 ); + _DICT.put( 26368, 36293 ); + _DICT.put( 26371, 39152 ); + _DICT.put( 26376, 35982 ); + _DICT.put( 26377, 38732 ); + _DICT.put( 26379, 38396 ); + _DICT.put( 26381, 38302 ); + _DICT.put( 26382, 64223 ); + _DICT.put( 26383, 40523 ); + _DICT.put( 26388, 36337 ); + _DICT.put( 26389, 37565 ); + _DICT.put( 26390, 40524 ); + _DICT.put( 26391, 38990 ); + _DICT.put( 26395, 38493 ); + _DICT.put( 26397, 37545 ); + _DICT.put( 26398, 40525 ); + _DICT.put( 26399, 35578 ); + _DICT.put( 26406, 40526 ); + _DICT.put( 26407, 40527 ); + _DICT.put( 26408, 38616 ); + _DICT.put( 26410, 38562 ); + _DICT.put( 26411, 38550 ); + _DICT.put( 26412, 38523 ); + _DICT.put( 26413, 36420 ); + _DICT.put( 26414, 40529 ); + _DICT.put( 26417, 36585 ); + _DICT.put( 26420, 38512 ); + _DICT.put( 26422, 40531 ); + _DICT.put( 26423, 40534 ); + _DICT.put( 26424, 40533 ); + _DICT.put( 26426, 35575 ); + _DICT.put( 26429, 35712 ); + _DICT.put( 26431, 40530 ); + _DICT.put( 26433, 40532 ); + _DICT.put( 26438, 40535 ); + _DICT.put( 26441, 37017 ); + _DICT.put( 26446, 38811 ); + _DICT.put( 26447, 35015 ); + _DICT.put( 26448, 36318 ); + _DICT.put( 26449, 37306 ); + _DICT.put( 26451, 36571 ); + _DICT.put( 26454, 36849 ); + _DICT.put( 26457, 40538 ); + _DICT.put( 26460, 37741 ); + _DICT.put( 26462, 40536 ); + _DICT.put( 26463, 37289 ); + _DICT.put( 26464, 40537 ); + _DICT.put( 26465, 36848 ); + _DICT.put( 26466, 38619 ); + _DICT.put( 26467, 40539 ); + _DICT.put( 26468, 40540 ); + _DICT.put( 26469, 38792 ); + _DICT.put( 26470, 64225 ); + _DICT.put( 26474, 40545 ); + _DICT.put( 26477, 36185 ); + _DICT.put( 26479, 38004 ); + _DICT.put( 26480, 40542 ); + _DICT.put( 26481, 37772 ); + _DICT.put( 26482, 40412 ); + _DICT.put( 26483, 40416 ); + _DICT.put( 26485, 35694 ); + _DICT.put( 26487, 37990 ); + _DICT.put( 26492, 40544 ); + _DICT.put( 26494, 36796 ); + _DICT.put( 26495, 38082 ); + _DICT.put( 26501, 40550 ); + _DICT.put( 26503, 38136 ); + _DICT.put( 26505, 40541 ); + _DICT.put( 26507, 40547 ); + _DICT.put( 26508, 40546 ); + _DICT.put( 26512, 37069 ); + _DICT.put( 26517, 38541 ); + _DICT.put( 26519, 38865 ); + _DICT.put( 26522, 38535 ); + _DICT.put( 26524, 35274 ); + _DICT.put( 26525, 36477 ); + _DICT.put( 26528, 39015 ); + _DICT.put( 26529, 40549 ); + _DICT.put( 26530, 37013 ); + _DICT.put( 26534, 40548 ); + _DICT.put( 26537, 40543 ); + _DICT.put( 26543, 36045 ); + _DICT.put( 26547, 40555 ); + _DICT.put( 26548, 40553 ); + _DICT.put( 26550, 35275 ); + _DICT.put( 26551, 40551 ); + _DICT.put( 26552, 40557 ); + _DICT.put( 26553, 40563 ); + _DICT.put( 26555, 64226 ); + _DICT.put( 26560, 64228 ); + _DICT.put( 26561, 37318 ); + _DICT.put( 26564, 38335 ); + _DICT.put( 26566, 40565 ); + _DICT.put( 26570, 38209 ); + _DICT.put( 26574, 40564 ); + _DICT.put( 26575, 38032 ); + _DICT.put( 26576, 38494 ); + _DICT.put( 26577, 35513 ); + _DICT.put( 26579, 37109 ); + _DICT.put( 26580, 36703 ); + _DICT.put( 26584, 37585 ); + _DICT.put( 26586, 38733 ); + _DICT.put( 26589, 40560 ); + _DICT.put( 26590, 40559 ); + _DICT.put( 26594, 40561 ); + _DICT.put( 26596, 40558 ); + _DICT.put( 26599, 40566 ); + _DICT.put( 26601, 40556 ); + _DICT.put( 26604, 40554 ); + _DICT.put( 26606, 40562 ); + _DICT.put( 26607, 40552 ); + _DICT.put( 26609, 37516 ); + _DICT.put( 26611, 38646 ); + _DICT.put( 26612, 36548 ); + _DICT.put( 26613, 36338 ); + _DICT.put( 26619, 36280 ); + _DICT.put( 26622, 38543 ); + _DICT.put( 26623, 35424 ); + _DICT.put( 26625, 64229 ); + _DICT.put( 26626, 37580 ); + _DICT.put( 26627, 37832 ); + _DICT.put( 26628, 35176 ); + _DICT.put( 26643, 37104 ); + _DICT.put( 26646, 37042 ); + _DICT.put( 26647, 35913 ); + _DICT.put( 26654, 40568 ); + _DICT.put( 26657, 36186 ); + _DICT.put( 26658, 35484 ); + _DICT.put( 26665, 40570 ); + _DICT.put( 26666, 35476 ); + _DICT.put( 26667, 40577 ); + _DICT.put( 26674, 40573 ); + _DICT.put( 26676, 37105 ); + _DICT.put( 26680, 35434 ); + _DICT.put( 26681, 36266 ); + _DICT.put( 26684, 35433 ); + _DICT.put( 26685, 36301 ); + _DICT.put( 26688, 40571 ); + _DICT.put( 26689, 35973 ); + _DICT.put( 26690, 35946 ); + _DICT.put( 26691, 37773 ); + _DICT.put( 26692, 64230 ); + _DICT.put( 26694, 40569 ); + _DICT.put( 26696, 35012 ); + _DICT.put( 26701, 40572 ); + _DICT.put( 26702, 40574 ); + _DICT.put( 26704, 35787 ); + _DICT.put( 26705, 35915 ); + _DICT.put( 26706, 64227 ); + _DICT.put( 26707, 35514 ); + _DICT.put( 26708, 35690 ); + _DICT.put( 26713, 40578 ); + _DICT.put( 26716, 36343 ); + _DICT.put( 26717, 38545 ); + _DICT.put( 26719, 36438 ); + _DICT.put( 26723, 40579 ); + _DICT.put( 26727, 38223 ); + _DICT.put( 26740, 40591 ); + _DICT.put( 26742, 35249 ); + _DICT.put( 26743, 40580 ); + _DICT.put( 26750, 40597 ); + _DICT.put( 26751, 40581 ); + _DICT.put( 26753, 38848 ); + _DICT.put( 26755, 40588 ); + _DICT.put( 26757, 38014 ); + _DICT.put( 26765, 40596 ); + _DICT.put( 26767, 40583 ); + _DICT.put( 26771, 34994 ); + _DICT.put( 26772, 40585 ); + _DICT.put( 26775, 36187 ); + _DICT.put( 26779, 40587 ); + _DICT.put( 26781, 40586 ); + _DICT.put( 26783, 40582 ); + _DICT.put( 26784, 40593 ); + _DICT.put( 26786, 36797 ); + _DICT.put( 26790, 39659 ); + _DICT.put( 26791, 36070 ); + _DICT.put( 26792, 38812 ); + _DICT.put( 26797, 40584 ); + _DICT.put( 26799, 37618 ); + _DICT.put( 26800, 35394 ); + _DICT.put( 26801, 36267 ); + _DICT.put( 26803, 40576 ); + _DICT.put( 26805, 40592 ); + _DICT.put( 26806, 35457 ); + _DICT.put( 26809, 40590 ); + _DICT.put( 26810, 40594 ); + _DICT.put( 26812, 37774 ); + _DICT.put( 26820, 35580 ); + _DICT.put( 26822, 40624 ); + _DICT.put( 26824, 64100 ); + _DICT.put( 26825, 38599 ); + _DICT.put( 26826, 40599 ); + _DICT.put( 26827, 35579 ); + _DICT.put( 26829, 40606 ); + _DICT.put( 26831, 64231 ); + _DICT.put( 26834, 38495 ); + _DICT.put( 26836, 40607 ); + _DICT.put( 26837, 40609 ); + _DICT.put( 26839, 40613 ); + _DICT.put( 26840, 40601 ); + _DICT.put( 26842, 37449 ); + _DICT.put( 26847, 37775 ); + _DICT.put( 26848, 40617 ); + _DICT.put( 26849, 40604 ); + _DICT.put( 26851, 40614 ); + _DICT.put( 26855, 40608 ); + _DICT.put( 26862, 36952 ); + _DICT.put( 26863, 40618 ); + _DICT.put( 26866, 37041 ); + _DICT.put( 26873, 40616 ); + _DICT.put( 26874, 35515 ); + _DICT.put( 26880, 39023 ); + _DICT.put( 26881, 40598 ); + _DICT.put( 26884, 40612 ); + _DICT.put( 26885, 35030 ); + _DICT.put( 26888, 40600 ); + _DICT.put( 26891, 38584 ); + _DICT.put( 26892, 40605 ); + _DICT.put( 26893, 36929 ); + _DICT.put( 26894, 37573 ); + _DICT.put( 26895, 40595 ); + _DICT.put( 26898, 40611 ); + _DICT.put( 26905, 37018 ); + _DICT.put( 26906, 40621 ); + _DICT.put( 26907, 35473 ); + _DICT.put( 26908, 35999 ); + _DICT.put( 26913, 40623 ); + _DICT.put( 26914, 40602 ); + _DICT.put( 26915, 40622 ); + _DICT.put( 26917, 40615 ); + _DICT.put( 26918, 40603 ); + _DICT.put( 26920, 40619 ); + _DICT.put( 26922, 40620 ); + _DICT.put( 26928, 40637 ); + _DICT.put( 26932, 37836 ); + _DICT.put( 26934, 40610 ); + _DICT.put( 26937, 40633 ); + _DICT.put( 26941, 40635 ); + _DICT.put( 26943, 37590 ); + _DICT.put( 26954, 38763 ); + _DICT.put( 26963, 38294 ); + _DICT.put( 26964, 40630 ); + _DICT.put( 26965, 37320 ); + _DICT.put( 26969, 40636 ); + _DICT.put( 26970, 37214 ); + _DICT.put( 26972, 40627 ); + _DICT.put( 26973, 40640 ); + _DICT.put( 26974, 40639 ); + _DICT.put( 26976, 37869 ); + _DICT.put( 26977, 40638 ); + _DICT.put( 26978, 37864 ); + _DICT.put( 26984, 64233 ); + _DICT.put( 26986, 40642 ); + _DICT.put( 26987, 40629 ); + _DICT.put( 26989, 35782 ); + _DICT.put( 26990, 40632 ); + _DICT.put( 26991, 36732 ); + _DICT.put( 26995, 38016 ); + _DICT.put( 26996, 40634 ); + _DICT.put( 26997, 35785 ); + _DICT.put( 26999, 40626 ); + _DICT.put( 27000, 40628 ); + _DICT.put( 27001, 40625 ); + _DICT.put( 27004, 38991 ); + _DICT.put( 27005, 35449 ); + _DICT.put( 27006, 40631 ); + _DICT.put( 27009, 40641 ); + _DICT.put( 27010, 35412 ); + _DICT.put( 27018, 36325 ); + _DICT.put( 27022, 35196 ); + _DICT.put( 27025, 40658 ); + _DICT.put( 27028, 38992 ); + _DICT.put( 27029, 40661 ); + _DICT.put( 27032, 64235 ); + _DICT.put( 27035, 36953 ); + _DICT.put( 27036, 40660 ); + _DICT.put( 27040, 40659 ); + _DICT.put( 27047, 40656 ); + _DICT.put( 27054, 40644 ); + _DICT.put( 27057, 40673 ); + _DICT.put( 27058, 40643 ); + _DICT.put( 27060, 40662 ); + _DICT.put( 27067, 40654 ); + _DICT.put( 27070, 40649 ); + _DICT.put( 27071, 40646 ); + _DICT.put( 27073, 40647 ); + _DICT.put( 27075, 40655 ); + _DICT.put( 27079, 60064 ); + _DICT.put( 27082, 40652 ); + _DICT.put( 27083, 36188 ); + _DICT.put( 27084, 37574 ); + _DICT.put( 27085, 37252 ); + _DICT.put( 27086, 40650 ); + _DICT.put( 27088, 40645 ); + _DICT.put( 27091, 40648 ); + _DICT.put( 27096, 38764 ); + _DICT.put( 27097, 38538 ); + _DICT.put( 27101, 40653 ); + _DICT.put( 27102, 40663 ); + _DICT.put( 27106, 64236 ); + _DICT.put( 27111, 40671 ); + _DICT.put( 27112, 40664 ); + _DICT.put( 27115, 40677 ); + _DICT.put( 27117, 40675 ); + _DICT.put( 27122, 40670 ); + _DICT.put( 27129, 40669 ); + _DICT.put( 27131, 37582 ); + _DICT.put( 27133, 37253 ); + _DICT.put( 27135, 40667 ); + _DICT.put( 27138, 40665 ); + _DICT.put( 27141, 40672 ); + _DICT.put( 27146, 40678 ); + _DICT.put( 27147, 38131 ); + _DICT.put( 27148, 40684 ); + _DICT.put( 27154, 40679 ); + _DICT.put( 27155, 40682 ); + _DICT.put( 27156, 40676 ); + _DICT.put( 27159, 37524 ); + _DICT.put( 27161, 38231 ); + _DICT.put( 27163, 40666 ); + _DICT.put( 27166, 40674 ); + _DICT.put( 27167, 36798 ); + _DICT.put( 27169, 38605 ); + _DICT.put( 27170, 40694 ); + _DICT.put( 27171, 40681 ); + _DICT.put( 27177, 36000 ); + _DICT.put( 27178, 35233 ); + _DICT.put( 27179, 35454 ); + _DICT.put( 27182, 40657 ); + _DICT.put( 27184, 64237 ); + _DICT.put( 27189, 36799 ); + _DICT.put( 27190, 40686 ); + _DICT.put( 27192, 40693 ); + _DICT.put( 27193, 36599 ); + _DICT.put( 27194, 35474 ); + _DICT.put( 27197, 37453 ); + _DICT.put( 27204, 40683 ); + _DICT.put( 27206, 64239 ); + _DICT.put( 27207, 40688 ); + _DICT.put( 27208, 40692 ); + _DICT.put( 27211, 35764 ); + _DICT.put( 27224, 35691 ); + _DICT.put( 27225, 40690 ); + _DICT.put( 27231, 35648 ); + _DICT.put( 27233, 37833 ); + _DICT.put( 27234, 40689 ); + _DICT.put( 27238, 40691 ); + _DICT.put( 27243, 64238 ); + _DICT.put( 27250, 40685 ); + _DICT.put( 27251, 64240 ); + _DICT.put( 27256, 40687 ); + _DICT.put( 27262, 64241 ); + _DICT.put( 27263, 35456 ); + _DICT.put( 27264, 37480 ); + _DICT.put( 27268, 40698 ); + _DICT.put( 27277, 40696 ); + _DICT.put( 27278, 36071 ); + _DICT.put( 27280, 40695 ); + _DICT.put( 27287, 40768 ); + _DICT.put( 27292, 40567 ); + _DICT.put( 27296, 40697 ); + _DICT.put( 27298, 40699 ); + _DICT.put( 27299, 40700 ); + _DICT.put( 27306, 40779 ); + _DICT.put( 27308, 40775 ); + _DICT.put( 27310, 40589 ); + _DICT.put( 27315, 40774 ); + _DICT.put( 27320, 40773 ); + _DICT.put( 27323, 40770 ); + _DICT.put( 27329, 40680 ); + _DICT.put( 27330, 40772 ); + _DICT.put( 27331, 40771 ); + _DICT.put( 27345, 40777 ); + _DICT.put( 27347, 38981 ); + _DICT.put( 27354, 40780 ); + _DICT.put( 27355, 35833 ); + _DICT.put( 27358, 40776 ); + _DICT.put( 27359, 40778 ); + _DICT.put( 27362, 64242 ); + _DICT.put( 27364, 64243 ); + _DICT.put( 27368, 38053 ); + _DICT.put( 27370, 40781 ); + _DICT.put( 27386, 40785 ); + _DICT.put( 27387, 40782 ); + _DICT.put( 27396, 38803 ); + _DICT.put( 27397, 40783 ); + _DICT.put( 27402, 40668 ); + _DICT.put( 27410, 40786 ); + _DICT.put( 27414, 40787 ); + _DICT.put( 27421, 35156 ); + _DICT.put( 27423, 40789 ); + _DICT.put( 27424, 35975 ); + _DICT.put( 27425, 36511 ); + _DICT.put( 27427, 35795 ); + _DICT.put( 27431, 35234 ); + _DICT.put( 27442, 38782 ); + _DICT.put( 27447, 40791 ); + _DICT.put( 27448, 40790 ); + _DICT.put( 27449, 40793 ); + _DICT.put( 27450, 35676 ); + _DICT.put( 27453, 35796 ); + _DICT.put( 27454, 35516 ); + _DICT.put( 27459, 40796 ); + _DICT.put( 27463, 40795 ); + _DICT.put( 27465, 40797 ); + _DICT.put( 27468, 35276 ); + _DICT.put( 27470, 37462 ); + _DICT.put( 27472, 40798 ); + _DICT.put( 27475, 35517 ); + _DICT.put( 27476, 40800 ); + _DICT.put( 27481, 40799 ); + _DICT.put( 27483, 40801 ); + _DICT.put( 27487, 40802 ); + _DICT.put( 27489, 40803 ); + _DICT.put( 27490, 36478 ); + _DICT.put( 27491, 37043 ); + _DICT.put( 27492, 36255 ); + _DICT.put( 27494, 38288 ); + _DICT.put( 27497, 38368 ); + _DICT.put( 27498, 39011 ); + _DICT.put( 27503, 36501 ); + _DICT.put( 27507, 36302 ); + _DICT.put( 27508, 38896 ); + _DICT.put( 27512, 40804 ); + _DICT.put( 27513, 40805 ); + _DICT.put( 27515, 36480 ); + _DICT.put( 27519, 40806 ); + _DICT.put( 27520, 40807 ); + _DICT.put( 27523, 40809 ); + _DICT.put( 27524, 40808 ); + _DICT.put( 27526, 38519 ); + _DICT.put( 27529, 36733 ); + _DICT.put( 27530, 36586 ); + _DICT.put( 27531, 36451 ); + _DICT.put( 27533, 40810 ); + _DICT.put( 27541, 40812 ); + _DICT.put( 27542, 36930 ); + _DICT.put( 27544, 40811 ); + _DICT.put( 27550, 40813 ); + _DICT.put( 27556, 40814 ); + _DICT.put( 27562, 40815 ); + _DICT.put( 27563, 40816 ); + _DICT.put( 27567, 40817 ); + _DICT.put( 27569, 40819 ); + _DICT.put( 27570, 40818 ); + _DICT.put( 27571, 40820 ); + _DICT.put( 27572, 35235 ); + _DICT.put( 27573, 37481 ); + _DICT.put( 27575, 40821 ); + _DICT.put( 27578, 36421 ); + _DICT.put( 27579, 35435 ); + _DICT.put( 27580, 40822 ); + _DICT.put( 27583, 37729 ); + _DICT.put( 27584, 39626 ); + _DICT.put( 27589, 35650 ); + _DICT.put( 27590, 40823 ); + _DICT.put( 27595, 40824 ); + _DICT.put( 27597, 38378 ); + _DICT.put( 27598, 38536 ); + _DICT.put( 27602, 37829 ); + _DICT.put( 27603, 40825 ); + _DICT.put( 27604, 38116 ); + _DICT.put( 27606, 64244 ); + _DICT.put( 27608, 38137 ); + _DICT.put( 27611, 38609 ); + _DICT.put( 27615, 40826 ); + _DICT.put( 27627, 40828 ); + _DICT.put( 27628, 40827 ); + _DICT.put( 27631, 40830 ); + _DICT.put( 27635, 40829 ); + _DICT.put( 27656, 40833 ); + _DICT.put( 27663, 36481 ); + _DICT.put( 27665, 38575 ); + _DICT.put( 27667, 40834 ); + _DICT.put( 27668, 40835 ); + _DICT.put( 27671, 35651 ); + _DICT.put( 27675, 40836 ); + _DICT.put( 27683, 40838 ); + _DICT.put( 27684, 40837 ); + _DICT.put( 27700, 36997 ); + _DICT.put( 27703, 38232 ); + _DICT.put( 27704, 35177 ); + _DICT.put( 27710, 38083 ); + _DICT.put( 27711, 64245 ); + _DICT.put( 27712, 37619 ); + _DICT.put( 27713, 36704 ); + _DICT.put( 27714, 35713 ); + _DICT.put( 27726, 38084 ); + _DICT.put( 27728, 36524 ); + _DICT.put( 27733, 40840 ); + _DICT.put( 27735, 35518 ); + _DICT.put( 27738, 35224 ); + _DICT.put( 27740, 64246 ); + _DICT.put( 27741, 37872 ); + _DICT.put( 27742, 40839 ); + _DICT.put( 27743, 36189 ); + _DICT.put( 27744, 37490 ); + _DICT.put( 27746, 40841 ); + _DICT.put( 27752, 40849 ); + _DICT.put( 27754, 40842 ); + _DICT.put( 27759, 64248 ); + _DICT.put( 27760, 37311 ); + _DICT.put( 27762, 35714 ); + _DICT.put( 27763, 40850 ); + _DICT.put( 27770, 35976 ); + _DICT.put( 27773, 35652 ); + _DICT.put( 27774, 40848 ); + _DICT.put( 27777, 40846 ); + _DICT.put( 27778, 40843 ); + _DICT.put( 27779, 38784 ); + _DICT.put( 27782, 64247 ); + _DICT.put( 27784, 37566 ); + _DICT.put( 27788, 37847 ); + _DICT.put( 27789, 40844 ); + _DICT.put( 27792, 40852 ); + _DICT.put( 27794, 40851 ); + _DICT.put( 27795, 35906 ); + _DICT.put( 27798, 35243 ); + _DICT.put( 27801, 36281 ); + _DICT.put( 27802, 40845 ); + _DICT.put( 27803, 40847 ); + _DICT.put( 27809, 38518 ); + _DICT.put( 27810, 37362 ); + _DICT.put( 27819, 38551 ); + _DICT.put( 27822, 40860 ); + _DICT.put( 27825, 40861 ); + _DICT.put( 27827, 35277 ); + _DICT.put( 27832, 38310 ); + _DICT.put( 27833, 38651 ); + _DICT.put( 27834, 40863 ); + _DICT.put( 27835, 36513 ); + _DICT.put( 27836, 36800 ); + _DICT.put( 27837, 40856 ); + _DICT.put( 27838, 40862 ); + _DICT.put( 27839, 35208 ); + _DICT.put( 27841, 35765 ); + _DICT.put( 27844, 40853 ); + _DICT.put( 27845, 40858 ); + _DICT.put( 27849, 37106 ); + _DICT.put( 27850, 38033 ); + _DICT.put( 27852, 38117 ); + _DICT.put( 27859, 40855 ); + _DICT.put( 27861, 38464 ); + _DICT.put( 27863, 40857 ); + _DICT.put( 27865, 40866 ); + _DICT.put( 27866, 64249 ); + _DICT.put( 27867, 40864 ); + _DICT.put( 27869, 40859 ); + _DICT.put( 27873, 38465 ); + _DICT.put( 27874, 37991 ); + _DICT.put( 27875, 35715 ); + _DICT.put( 27877, 37700 ); + _DICT.put( 27880, 37517 ); + _DICT.put( 27882, 40867 ); + _DICT.put( 27887, 40865 ); + _DICT.put( 27888, 37335 ); + _DICT.put( 27889, 40854 ); + _DICT.put( 27891, 35178 ); + _DICT.put( 27908, 64250 ); + _DICT.put( 27915, 38765 ); + _DICT.put( 27916, 40878 ); + _DICT.put( 27922, 40877 ); + _DICT.put( 27927, 37108 ); + _DICT.put( 27929, 40874 ); + _DICT.put( 27931, 38796 ); + _DICT.put( 27934, 37812 ); + _DICT.put( 27935, 40868 ); + _DICT.put( 27941, 37571 ); + _DICT.put( 27945, 35179 ); + _DICT.put( 27946, 36190 ); + _DICT.put( 27947, 40871 ); + _DICT.put( 27954, 36678 ); + _DICT.put( 27955, 40876 ); + _DICT.put( 27957, 40875 ); + _DICT.put( 27958, 40870 ); + _DICT.put( 27960, 40873 ); + _DICT.put( 27963, 35464 ); + _DICT.put( 27965, 40872 ); + _DICT.put( 27966, 37992 ); + _DICT.put( 27969, 38828 ); + _DICT.put( 27972, 36850 ); + _DICT.put( 27973, 37107 ); + _DICT.put( 27993, 40884 ); + _DICT.put( 27994, 40882 ); + _DICT.put( 27996, 38252 ); + _DICT.put( 28003, 40879 ); + _DICT.put( 28004, 40881 ); + _DICT.put( 28006, 35161 ); + _DICT.put( 28009, 36191 ); + _DICT.put( 28010, 38993 ); + _DICT.put( 28012, 35420 ); + _DICT.put( 28014, 38274 ); + _DICT.put( 28015, 64252 ); + _DICT.put( 28020, 38785 ); + _DICT.put( 28023, 35395 ); + _DICT.put( 28024, 36954 ); + _DICT.put( 28025, 40883 ); + _DICT.put( 28037, 40888 ); + _DICT.put( 28039, 64251 ); + _DICT.put( 28040, 36801 ); + _DICT.put( 28044, 38735 ); + _DICT.put( 28046, 40885 ); + _DICT.put( 28051, 40880 ); + _DICT.put( 28053, 40886 ); + _DICT.put( 28054, 64320 ); + _DICT.put( 28057, 38876 ); + _DICT.put( 28059, 37779 ); + _DICT.put( 28060, 37824 ); + _DICT.put( 28076, 64321 ); + _DICT.put( 28079, 35413 ); + _DICT.put( 28082, 35188 ); + _DICT.put( 28085, 40892 ); + _DICT.put( 28088, 40895 ); + _DICT.put( 28092, 38849 ); + _DICT.put( 28096, 38788 ); + _DICT.put( 28101, 40902 ); + _DICT.put( 28102, 40896 ); + _DICT.put( 28103, 40893 ); + _DICT.put( 28107, 38866 ); + _DICT.put( 28108, 40899 ); + _DICT.put( 28111, 64322 ); + _DICT.put( 28113, 36713 ); + _DICT.put( 28114, 40901 ); + _DICT.put( 28117, 40906 ); + _DICT.put( 28120, 37777 ); + _DICT.put( 28121, 40904 ); + _DICT.put( 28126, 40898 ); + _DICT.put( 28129, 37463 ); + _DICT.put( 28132, 40905 ); + _DICT.put( 28134, 40894 ); + _DICT.put( 28136, 40900 ); + _DICT.put( 28138, 40907 ); + _DICT.put( 28139, 35066 ); + _DICT.put( 28140, 40897 ); + _DICT.put( 28142, 40908 ); + _DICT.put( 28145, 36955 ); + _DICT.put( 28146, 64324 ); + _DICT.put( 28147, 36734 ); + _DICT.put( 28149, 38307 ); + _DICT.put( 28151, 36268 ); + _DICT.put( 28152, 64323 ); + _DICT.put( 28153, 40889 ); + _DICT.put( 28154, 40903 ); + _DICT.put( 28155, 37721 ); + _DICT.put( 28156, 64325 ); + _DICT.put( 28165, 37044 ); + _DICT.put( 28167, 35465 ); + _DICT.put( 28168, 36303 ); + _DICT.put( 28169, 36802 ); + _DICT.put( 28170, 40891 ); + _DICT.put( 28171, 36705 ); + _DICT.put( 28179, 35947 ); + _DICT.put( 28181, 40890 ); + _DICT.put( 28185, 40912 ); + _DICT.put( 28186, 36749 ); + _DICT.put( 28187, 36024 ); + _DICT.put( 28189, 40927 ); + _DICT.put( 28191, 40921 ); + _DICT.put( 28192, 35732 ); + _DICT.put( 28193, 37742 ); + _DICT.put( 28195, 40916 ); + _DICT.put( 28196, 40925 ); + _DICT.put( 28197, 34989 ); + _DICT.put( 28198, 35153 ); + _DICT.put( 28199, 64328 ); + _DICT.put( 28201, 35255 ); + _DICT.put( 28203, 40918 ); + _DICT.put( 28204, 37290 ); + _DICT.put( 28205, 40909 ); + _DICT.put( 28206, 40911 ); + _DICT.put( 28207, 36192 ); + _DICT.put( 28216, 40928 ); + _DICT.put( 28217, 64326 ); + _DICT.put( 28218, 40923 ); + _DICT.put( 28220, 64329 ); + _DICT.put( 28222, 40915 ); + _DICT.put( 28227, 40922 ); + _DICT.put( 28234, 38569 ); + _DICT.put( 28237, 40920 ); + _DICT.put( 28238, 40924 ); + _DICT.put( 28246, 36046 ); + _DICT.put( 28248, 36803 ); + _DICT.put( 28251, 37464 ); + _DICT.put( 28252, 64327 ); + _DICT.put( 28255, 40914 ); + _DICT.put( 28263, 38734 ); + _DICT.put( 28267, 40917 ); + _DICT.put( 28270, 40910 ); + _DICT.put( 28271, 37778 ); + _DICT.put( 28274, 40913 ); + _DICT.put( 28278, 40919 ); + _DICT.put( 28286, 39024 ); + _DICT.put( 28287, 36540 ); + _DICT.put( 28288, 38558 ); + _DICT.put( 28290, 40929 ); + _DICT.put( 28300, 38060 ); + _DICT.put( 28303, 40941 ); + _DICT.put( 28304, 36025 ); + _DICT.put( 28310, 36736 ); + _DICT.put( 28312, 40931 ); + _DICT.put( 28316, 38829 ); + _DICT.put( 28317, 36193 ); + _DICT.put( 28319, 40944 ); + _DICT.put( 28322, 35052 ); + _DICT.put( 28325, 40942 ); + _DICT.put( 28330, 40930 ); + _DICT.put( 28335, 40936 ); + _DICT.put( 28338, 40938 ); + _DICT.put( 28342, 38766 ); + _DICT.put( 28343, 40933 ); + _DICT.put( 28346, 37709 ); + _DICT.put( 28349, 40935 ); + _DICT.put( 28351, 64330 ); + _DICT.put( 28354, 40943 ); + _DICT.put( 28356, 40937 ); + _DICT.put( 28357, 38597 ); + _DICT.put( 28361, 40932 ); + _DICT.put( 28363, 36512 ); + _DICT.put( 28364, 40956 ); + _DICT.put( 28369, 35466 ); + _DICT.put( 28371, 40934 ); + _DICT.put( 28372, 40939 ); + _DICT.put( 28373, 40940 ); + _DICT.put( 28381, 37354 ); + _DICT.put( 28382, 37336 ); + _DICT.put( 28396, 40948 ); + _DICT.put( 28399, 40954 ); + _DICT.put( 28402, 40952 ); + _DICT.put( 28404, 37704 ); + _DICT.put( 28407, 57410 ); + _DICT.put( 28408, 40949 ); + _DICT.put( 28414, 40950 ); + _DICT.put( 28415, 40926 ); + _DICT.put( 28417, 35737 ); + _DICT.put( 28418, 38233 ); + _DICT.put( 28422, 36541 ); + _DICT.put( 28425, 36247 ); + _DICT.put( 28431, 38994 ); + _DICT.put( 28433, 40946 ); + _DICT.put( 28435, 57409 ); + _DICT.put( 28436, 35209 ); + _DICT.put( 28437, 37254 ); + _DICT.put( 28448, 38041 ); + _DICT.put( 28450, 35519 ); + _DICT.put( 28451, 38904 ); + _DICT.put( 28459, 38559 ); + _DICT.put( 28460, 37584 ); + _DICT.put( 28465, 40953 ); + _DICT.put( 28466, 40955 ); + _DICT.put( 28472, 37201 ); + _DICT.put( 28478, 57408 ); + _DICT.put( 28479, 40951 ); + _DICT.put( 28481, 40945 ); + _DICT.put( 28485, 35521 ); + _DICT.put( 28500, 35977 ); + _DICT.put( 28504, 57422 ); + _DICT.put( 28507, 57417 ); + _DICT.put( 28508, 37110 ); + _DICT.put( 28511, 35459 ); + _DICT.put( 28516, 36737 ); + _DICT.put( 28518, 57426 ); + _DICT.put( 28525, 57419 ); + _DICT.put( 28526, 37546 ); + _DICT.put( 28527, 57416 ); + _DICT.put( 28528, 37591 ); + _DICT.put( 28532, 57451 ); + _DICT.put( 28536, 57413 ); + _DICT.put( 28538, 57412 ); + _DICT.put( 28540, 57421 ); + _DICT.put( 28544, 57415 ); + _DICT.put( 28545, 57414 ); + _DICT.put( 28546, 57420 ); + _DICT.put( 28548, 37023 ); + _DICT.put( 28550, 57411 ); + _DICT.put( 28552, 64331 ); + _DICT.put( 28558, 57423 ); + _DICT.put( 28561, 57424 ); + _DICT.put( 28567, 35520 ); + _DICT.put( 28577, 57429 ); + _DICT.put( 28579, 57428 ); + _DICT.put( 28580, 57430 ); + _DICT.put( 28586, 57433 ); + _DICT.put( 28593, 37730 ); + _DICT.put( 28595, 57427 ); + _DICT.put( 28597, 64332 ); + _DICT.put( 28601, 57431 ); + _DICT.put( 28608, 35971 ); + _DICT.put( 28609, 37367 ); + _DICT.put( 28610, 57425 ); + _DICT.put( 28611, 37978 ); + _DICT.put( 28614, 57432 ); + _DICT.put( 28628, 57437 ); + _DICT.put( 28629, 57435 ); + _DICT.put( 28632, 57438 ); + _DICT.put( 28635, 57441 ); + _DICT.put( 28639, 57434 ); + _DICT.put( 28640, 36234 ); + _DICT.put( 28641, 37959 ); + _DICT.put( 28644, 40887 ); + _DICT.put( 28651, 38804 ); + _DICT.put( 28652, 57436 ); + _DICT.put( 28654, 57440 ); + _DICT.put( 28655, 37363 ); + _DICT.put( 28657, 57439 ); + _DICT.put( 28659, 57418 ); + _DICT.put( 28661, 64333 ); + _DICT.put( 28662, 59529 ); + _DICT.put( 28666, 57444 ); + _DICT.put( 28670, 57448 ); + _DICT.put( 28673, 57446 ); + _DICT.put( 28677, 64334 ); + _DICT.put( 28679, 64335 ); + _DICT.put( 28681, 57442 ); + _DICT.put( 28683, 57443 ); + _DICT.put( 28687, 57447 ); + _DICT.put( 28689, 57445 ); + _DICT.put( 28693, 38253 ); + _DICT.put( 28696, 57453 ); + _DICT.put( 28698, 57450 ); + _DICT.put( 28699, 57449 ); + _DICT.put( 28701, 57452 ); + _DICT.put( 28702, 37842 ); + _DICT.put( 28703, 57454 ); + _DICT.put( 28710, 37525 ); + _DICT.put( 28711, 37355 ); + _DICT.put( 28712, 64336 ); + _DICT.put( 28716, 37027 ); + _DICT.put( 28720, 57455 ); + _DICT.put( 28722, 57457 ); + _DICT.put( 28734, 57456 ); + _DICT.put( 28748, 40947 ); + _DICT.put( 28753, 57458 ); + _DICT.put( 28760, 37861 ); + _DICT.put( 28771, 57459 ); + _DICT.put( 28779, 35278 ); + _DICT.put( 28783, 37780 ); + _DICT.put( 28784, 35396 ); + _DICT.put( 28792, 35716 ); + _DICT.put( 28796, 36572 ); + _DICT.put( 28797, 36304 ); + _DICT.put( 28805, 64337 ); + _DICT.put( 28809, 38982 ); + _DICT.put( 28810, 36998 ); + _DICT.put( 28814, 35210 ); + _DICT.put( 28818, 57461 ); + _DICT.put( 28825, 57460 ); + _DICT.put( 28843, 64338 ); + _DICT.put( 28844, 57464 ); + _DICT.put( 28845, 37465 ); + _DICT.put( 28846, 57467 ); + _DICT.put( 28847, 57462 ); + _DICT.put( 28851, 57466 ); + _DICT.put( 28856, 57465 ); + _DICT.put( 28857, 37727 ); + _DICT.put( 28858, 35031 ); + _DICT.put( 28859, 64098 ); + _DICT.put( 28872, 38899 ); + _DICT.put( 28875, 57469 ); + _DICT.put( 28879, 35143 ); + _DICT.put( 28889, 57472 ); + _DICT.put( 28893, 57470 ); + _DICT.put( 28895, 57468 ); + _DICT.put( 28913, 57463 ); + _DICT.put( 28921, 38466 ); + _DICT.put( 28925, 57474 ); + _DICT.put( 28932, 64340 ); + _DICT.put( 28937, 57473 ); + _DICT.put( 28943, 64339 ); + _DICT.put( 28948, 35211 ); + _DICT.put( 28953, 57476 ); + _DICT.put( 28954, 38320 ); + _DICT.put( 28956, 57475 ); + _DICT.put( 28961, 38579 ); + _DICT.put( 28966, 36805 ); + _DICT.put( 28982, 37202 ); + _DICT.put( 28988, 36804 ); + _DICT.put( 28998, 64342 ); + _DICT.put( 28999, 64343 ); + _DICT.put( 29001, 38905 ); + _DICT.put( 29004, 57482 ); + _DICT.put( 29006, 37111 ); + _DICT.put( 29013, 57478 ); + _DICT.put( 29014, 57483 ); + _DICT.put( 29017, 35212 ); + _DICT.put( 29020, 64341 ); + _DICT.put( 29026, 57481 ); + _DICT.put( 29028, 38017 ); + _DICT.put( 29029, 57477 ); + _DICT.put( 29030, 57480 ); + _DICT.put( 29031, 36806 ); + _DICT.put( 29033, 38095 ); + _DICT.put( 29036, 57484 ); + _DICT.put( 29038, 36559 ); + _DICT.put( 29053, 37112 ); + _DICT.put( 29060, 57487 ); + _DICT.put( 29064, 57479 ); + _DICT.put( 29066, 35910 ); + _DICT.put( 29071, 57485 ); + _DICT.put( 29076, 38767 ); + _DICT.put( 29077, 57488 ); + _DICT.put( 29081, 60068 ); + _DICT.put( 29087, 36718 ); + _DICT.put( 29096, 57489 ); + _DICT.put( 29100, 57490 ); + _DICT.put( 29105, 37965 ); + _DICT.put( 29113, 57492 ); + _DICT.put( 29118, 57493 ); + _DICT.put( 29121, 64345 ); + _DICT.put( 29123, 37970 ); + _DICT.put( 29128, 37781 ); + _DICT.put( 29129, 57495 ); + _DICT.put( 29134, 57497 ); + _DICT.put( 29136, 38867 ); + _DICT.put( 29138, 57494 ); + _DICT.put( 29140, 57496 ); + _DICT.put( 29141, 35213 ); + _DICT.put( 29143, 57491 ); + _DICT.put( 29151, 39546 ); + _DICT.put( 29152, 57498 ); + _DICT.put( 29157, 37255 ); + _DICT.put( 29158, 36439 ); + _DICT.put( 29159, 57500 ); + _DICT.put( 29164, 57499 ); + _DICT.put( 29165, 36931 ); + _DICT.put( 29166, 39383 ); + _DICT.put( 29173, 57501 ); + _DICT.put( 29177, 57503 ); + _DICT.put( 29179, 57486 ); + _DICT.put( 29180, 57502 ); + _DICT.put( 29182, 64346 ); + _DICT.put( 29183, 57504 ); + _DICT.put( 29190, 38042 ); + _DICT.put( 29197, 57505 ); + _DICT.put( 29200, 57506 ); + _DICT.put( 29211, 57507 ); + _DICT.put( 29224, 57508 ); + _DICT.put( 29226, 37596 ); + _DICT.put( 29228, 57510 ); + _DICT.put( 29229, 57509 ); + _DICT.put( 29232, 57511 ); + _DICT.put( 29234, 57512 ); + _DICT.put( 29237, 36573 ); + _DICT.put( 29238, 38275 ); + _DICT.put( 29242, 38634 ); + _DICT.put( 29243, 57513 ); + _DICT.put( 29244, 57514 ); + _DICT.put( 29245, 37237 ); + _DICT.put( 29246, 36514 ); + _DICT.put( 29247, 57515 ); + _DICT.put( 29248, 57516 ); + _DICT.put( 29254, 57517 ); + _DICT.put( 29255, 38352 ); + _DICT.put( 29256, 38085 ); + _DICT.put( 29259, 57518 ); + _DICT.put( 29260, 38006 ); + _DICT.put( 29266, 37547 ); + _DICT.put( 29272, 57519 ); + _DICT.put( 29273, 35301 ); + _DICT.put( 29275, 35725 ); + _DICT.put( 29277, 38596 ); + _DICT.put( 29279, 38580 ); + _DICT.put( 29281, 35250 ); + _DICT.put( 29282, 38995 ); + _DICT.put( 29287, 38513 ); + _DICT.put( 29289, 38312 ); + _DICT.put( 29298, 37045 ); + _DICT.put( 29300, 57520 ); + _DICT.put( 29305, 37825 ); + _DICT.put( 29309, 36001 ); + _DICT.put( 29310, 57521 ); + _DICT.put( 29312, 36306 ); + _DICT.put( 29313, 57523 ); + _DICT.put( 29314, 57522 ); + _DICT.put( 29319, 57524 ); + _DICT.put( 29330, 57525 ); + _DICT.put( 29334, 57526 ); + _DICT.put( 29344, 35677 ); + _DICT.put( 29346, 57527 ); + _DICT.put( 29351, 57528 ); + _DICT.put( 29356, 36002 ); + _DICT.put( 29359, 38086 ); + _DICT.put( 29361, 64347 ); + _DICT.put( 29362, 57530 ); + _DICT.put( 29366, 36851 ); + _DICT.put( 29369, 57529 ); + _DICT.put( 29374, 64348 ); + _DICT.put( 29378, 35766 ); + _DICT.put( 29379, 57531 ); + _DICT.put( 29380, 57533 ); + _DICT.put( 29382, 57532 ); + _DICT.put( 29390, 57534 ); + _DICT.put( 29392, 36047 ); + _DICT.put( 29394, 57535 ); + _DICT.put( 29399, 35815 ); + _DICT.put( 29401, 37215 ); + _DICT.put( 29403, 36253 ); + _DICT.put( 29408, 57537 ); + _DICT.put( 29409, 57538 ); + _DICT.put( 29410, 57536 ); + _DICT.put( 29417, 36587 ); + _DICT.put( 29420, 37830 ); + _DICT.put( 29421, 35767 ); + _DICT.put( 29431, 57540 ); + _DICT.put( 29432, 37451 ); + _DICT.put( 29433, 57539 ); + _DICT.put( 29436, 38996 ); + _DICT.put( 29437, 38018 ); + _DICT.put( 29450, 57543 ); + _DICT.put( 29462, 57545 ); + _DICT.put( 29463, 57542 ); + _DICT.put( 29467, 38610 ); + _DICT.put( 29468, 57544 ); + _DICT.put( 29469, 57546 ); + _DICT.put( 29471, 38850 ); + _DICT.put( 29476, 64349 ); + _DICT.put( 29477, 57550 ); + _DICT.put( 29481, 57549 ); + _DICT.put( 29482, 37526 ); + _DICT.put( 29483, 37964 ); + _DICT.put( 29486, 36003 ); + _DICT.put( 29487, 57548 ); + _DICT.put( 29492, 57547 ); + _DICT.put( 29494, 38736 ); + _DICT.put( 29495, 38737 ); + _DICT.put( 29502, 57551 ); + _DICT.put( 29503, 35214 ); + _DICT.put( 29508, 36246 ); + _DICT.put( 29509, 36482 ); + _DICT.put( 29518, 57552 ); + _DICT.put( 29519, 57553 ); + _DICT.put( 29527, 57555 ); + _DICT.put( 29539, 36706 ); + _DICT.put( 29544, 57557 ); + _DICT.put( 29546, 57556 ); + _DICT.put( 29552, 57558 ); + _DICT.put( 29554, 35436 ); + _DICT.put( 29557, 57560 ); + _DICT.put( 29559, 64351 ); + _DICT.put( 29560, 57559 ); + _DICT.put( 29562, 57562 ); + _DICT.put( 29563, 57561 ); + _DICT.put( 29572, 36026 ); + _DICT.put( 29575, 38822 ); + _DICT.put( 29577, 35786 ); + _DICT.put( 29579, 35236 ); + _DICT.put( 29590, 35816 ); + _DICT.put( 29609, 35551 ); + _DICT.put( 29618, 38886 ); + _DICT.put( 29619, 57564 ); + _DICT.put( 29627, 57566 ); + _DICT.put( 29629, 64352 ); + _DICT.put( 29632, 57567 ); + _DICT.put( 29634, 35279 ); + _DICT.put( 29640, 57563 ); + _DICT.put( 29641, 64353 ); + _DICT.put( 29642, 36440 ); + _DICT.put( 29645, 37567 ); + _DICT.put( 29646, 57565 ); + _DICT.put( 29650, 64356 ); + _DICT.put( 29654, 64354 ); + _DICT.put( 29662, 57570 ); + _DICT.put( 29664, 36588 ); + _DICT.put( 29667, 64355 ); + _DICT.put( 29669, 57568 ); + _DICT.put( 29674, 35933 ); + _DICT.put( 29677, 38087 ); + _DICT.put( 29678, 57569 ); + _DICT.put( 29681, 57596 ); + _DICT.put( 29685, 64358 ); + _DICT.put( 29688, 57575 ); + _DICT.put( 29694, 36027 ); + _DICT.put( 29699, 35717 ); + _DICT.put( 29701, 57572 ); + _DICT.put( 29702, 38813 ); + _DICT.put( 29703, 64357 ); + _DICT.put( 29705, 38830 ); + _DICT.put( 29730, 37364 ); + _DICT.put( 29733, 57574 ); + _DICT.put( 29734, 64359 ); + _DICT.put( 29737, 64361 ); + _DICT.put( 29738, 64360 ); + _DICT.put( 29742, 64362 ); + _DICT.put( 29746, 57576 ); + _DICT.put( 29747, 38868 ); + _DICT.put( 29748, 35797 ); + _DICT.put( 29749, 38138 ); + _DICT.put( 29750, 37993 ); + _DICT.put( 29754, 57577 ); + _DICT.put( 29759, 57579 ); + _DICT.put( 29761, 57582 ); + _DICT.put( 29781, 57578 ); + _DICT.put( 29785, 57581 ); + _DICT.put( 29786, 36072 ); + _DICT.put( 29787, 35180 ); + _DICT.put( 29788, 57583 ); + _DICT.put( 29790, 37008 ); + _DICT.put( 29791, 57580 ); + _DICT.put( 29792, 38874 ); + _DICT.put( 29794, 64363 ); + _DICT.put( 29795, 57586 ); + _DICT.put( 29796, 60066 ); + _DICT.put( 29801, 57584 ); + _DICT.put( 29802, 57587 ); + _DICT.put( 29807, 57573 ); + _DICT.put( 29808, 57585 ); + _DICT.put( 29811, 36282 ); + _DICT.put( 29814, 57588 ); + _DICT.put( 29822, 57589 ); + _DICT.put( 29827, 38814 ); + _DICT.put( 29833, 64364 ); + _DICT.put( 29835, 57590 ); + _DICT.put( 29854, 57591 ); + _DICT.put( 29855, 64365 ); + _DICT.put( 29858, 57571 ); + _DICT.put( 29863, 57592 ); + _DICT.put( 29872, 35522 ); + _DICT.put( 29885, 36515 ); + _DICT.put( 29898, 57593 ); + _DICT.put( 29903, 57594 ); + _DICT.put( 29908, 57595 ); + _DICT.put( 29916, 35162 ); + _DICT.put( 29920, 57664 ); + _DICT.put( 29922, 38234 ); + _DICT.put( 29923, 57665 ); + _DICT.put( 29926, 35490 ); + _DICT.put( 29927, 57666 ); + _DICT.put( 29929, 57667 ); + _DICT.put( 29934, 57668 ); + _DICT.put( 29936, 57670 ); + _DICT.put( 29937, 57671 ); + _DICT.put( 29938, 57669 ); + _DICT.put( 29942, 38258 ); + _DICT.put( 29943, 57673 ); + _DICT.put( 29944, 57672 ); + _DICT.put( 29953, 64366 ); + _DICT.put( 29955, 57675 ); + _DICT.put( 29956, 57674 ); + _DICT.put( 29957, 57676 ); + _DICT.put( 29964, 57677 ); + _DICT.put( 29965, 57679 ); + _DICT.put( 29966, 57678 ); + _DICT.put( 29969, 36249 ); + _DICT.put( 29971, 57681 ); + _DICT.put( 29973, 57680 ); + _DICT.put( 29976, 35523 ); + _DICT.put( 29978, 36978 ); + _DICT.put( 29980, 37723 ); + _DICT.put( 29982, 57682 ); + _DICT.put( 29983, 37046 ); + _DICT.put( 29987, 36441 ); + _DICT.put( 29989, 35225 ); + _DICT.put( 29990, 57683 ); + _DICT.put( 29992, 38768 ); + _DICT.put( 29995, 38369 ); + _DICT.put( 29996, 57684 ); + _DICT.put( 29999, 64168 ); + _DICT.put( 30000, 37731 ); + _DICT.put( 30001, 38738 ); + _DICT.put( 30002, 36194 ); + _DICT.put( 30003, 36956 ); + _DICT.put( 30007, 37482 ); + _DICT.put( 30008, 39346 ); + _DICT.put( 30010, 37548 ); + _DICT.put( 30011, 35302 ); + _DICT.put( 30012, 57685 ); + _DICT.put( 30020, 57686 ); + _DICT.put( 30022, 57691 ); + _DICT.put( 30025, 57689 ); + _DICT.put( 30026, 57688 ); + _DICT.put( 30027, 40384 ); + _DICT.put( 30028, 35397 ); + _DICT.put( 30029, 57687 ); + _DICT.put( 30031, 35032 ); + _DICT.put( 30033, 38056 ); + _DICT.put( 30036, 38088 ); + _DICT.put( 30041, 38831 ); + _DICT.put( 30042, 57692 ); + _DICT.put( 30043, 57690 ); + _DICT.put( 30044, 37499 ); + _DICT.put( 30045, 37028 ); + _DICT.put( 30048, 38057 ); + _DICT.put( 30050, 38220 ); + _DICT.put( 30052, 57694 ); + _DICT.put( 30053, 38826 ); + _DICT.put( 30054, 35948 ); + _DICT.put( 30055, 57695 ); + _DICT.put( 30057, 57693 ); + _DICT.put( 30058, 38100 ); + _DICT.put( 30059, 57696 ); + _DICT.put( 30061, 57697 ); + _DICT.put( 30063, 64367 ); + _DICT.put( 30064, 35033 ); + _DICT.put( 30067, 36852 ); + _DICT.put( 30068, 57702 ); + _DICT.put( 30070, 57699 ); + _DICT.put( 30071, 37867 ); + _DICT.put( 30072, 57698 ); + _DICT.put( 30079, 35653 ); + _DICT.put( 30082, 57705 ); + _DICT.put( 30086, 57700 ); + _DICT.put( 30087, 57701 ); + _DICT.put( 30089, 57704 ); + _DICT.put( 30090, 57703 ); + _DICT.put( 30091, 38212 ); + _DICT.put( 30094, 37217 ); + _DICT.put( 30095, 37216 ); + _DICT.put( 30097, 35678 ); + _DICT.put( 30100, 57706 ); + _DICT.put( 30106, 57707 ); + _DICT.put( 30109, 57708 ); + _DICT.put( 30115, 57710 ); + _DICT.put( 30117, 57709 ); + _DICT.put( 30123, 35189 ); + _DICT.put( 30129, 57718 ); + _DICT.put( 30130, 38118 ); + _DICT.put( 30131, 57712 ); + _DICT.put( 30133, 57714 ); + _DICT.put( 30136, 57716 ); + _DICT.put( 30137, 36957 ); + _DICT.put( 30140, 57717 ); + _DICT.put( 30141, 57715 ); + _DICT.put( 30142, 36542 ); + _DICT.put( 30146, 57711 ); + _DICT.put( 30147, 57713 ); + _DICT.put( 30149, 38241 ); + _DICT.put( 30151, 36807 ); + _DICT.put( 30154, 57720 ); + _DICT.put( 30157, 57719 ); + _DICT.put( 30162, 57721 ); + _DICT.put( 30164, 36516 ); + _DICT.put( 30165, 36269 ); + _DICT.put( 30168, 37783 ); + _DICT.put( 30169, 57722 ); + _DICT.put( 30171, 37577 ); + _DICT.put( 30174, 57724 ); + _DICT.put( 30178, 38815 ); + _DICT.put( 30179, 57723 ); + _DICT.put( 30185, 37257 ); + _DICT.put( 30192, 57730 ); + _DICT.put( 30194, 57732 ); + _DICT.put( 30195, 57733 ); + _DICT.put( 30196, 37491 ); + _DICT.put( 30202, 57731 ); + _DICT.put( 30204, 57728 ); + _DICT.put( 30206, 57725 ); + _DICT.put( 30207, 57726 ); + _DICT.put( 30209, 57729 ); + _DICT.put( 30217, 57736 ); + _DICT.put( 30219, 57734 ); + _DICT.put( 30221, 57735 ); + _DICT.put( 30239, 57737 ); + _DICT.put( 30240, 57739 ); + _DICT.put( 30241, 57740 ); + _DICT.put( 30242, 57741 ); + _DICT.put( 30244, 57742 ); + _DICT.put( 30247, 57738 ); + _DICT.put( 30256, 57744 ); + _DICT.put( 30260, 57743 ); + _DICT.put( 30267, 57745 ); + _DICT.put( 30274, 38851 ); + _DICT.put( 30278, 57748 ); + _DICT.put( 30279, 57746 ); + _DICT.put( 30280, 57747 ); + _DICT.put( 30284, 35552 ); + _DICT.put( 30290, 38652 ); + _DICT.put( 30294, 38344 ); + _DICT.put( 30296, 57750 ); + _DICT.put( 30300, 57749 ); + _DICT.put( 30305, 57751 ); + _DICT.put( 30306, 57752 ); + _DICT.put( 30311, 57756 ); + _DICT.put( 30312, 57753 ); + _DICT.put( 30313, 57754 ); + _DICT.put( 30314, 57755 ); + _DICT.put( 30316, 57757 ); + _DICT.put( 30320, 57758 ); + _DICT.put( 30322, 57759 ); + _DICT.put( 30326, 57760 ); + _DICT.put( 30328, 57761 ); + _DICT.put( 30330, 38061 ); + _DICT.put( 30331, 37743 ); + _DICT.put( 30332, 57762 ); + _DICT.put( 30333, 38034 ); + _DICT.put( 30334, 38227 ); + _DICT.put( 30336, 57763 ); + _DICT.put( 30338, 64368 ); + _DICT.put( 30339, 57764 ); + _DICT.put( 30340, 37705 ); + _DICT.put( 30342, 35398 ); + _DICT.put( 30343, 36195 ); + _DICT.put( 30344, 57765 ); + _DICT.put( 30347, 57766 ); + _DICT.put( 30350, 57767 ); + _DICT.put( 30352, 36424 ); + _DICT.put( 30355, 57769 ); + _DICT.put( 30358, 57768 ); + _DICT.put( 30361, 57770 ); + _DICT.put( 30362, 57771 ); + _DICT.put( 30363, 64371 ); + _DICT.put( 30364, 64369 ); + _DICT.put( 30366, 64370 ); + _DICT.put( 30374, 64372 ); + _DICT.put( 30382, 38119 ); + _DICT.put( 30384, 57772 ); + _DICT.put( 30388, 57773 ); + _DICT.put( 30391, 60041 ); + _DICT.put( 30392, 57774 ); + _DICT.put( 30393, 57775 ); + _DICT.put( 30394, 57776 ); + _DICT.put( 30399, 36429 ); + _DICT.put( 30402, 57777 ); + _DICT.put( 30403, 38005 ); + _DICT.put( 30406, 38526 ); + _DICT.put( 30408, 35181 ); + _DICT.put( 30410, 35190 ); + _DICT.put( 30413, 57778 ); + _DICT.put( 30418, 57780 ); + _DICT.put( 30422, 57779 ); + _DICT.put( 30423, 37776 ); + _DICT.put( 30427, 37047 ); + _DICT.put( 30428, 40792 ); + _DICT.put( 30430, 57781 ); + _DICT.put( 30431, 38591 ); + _DICT.put( 30433, 57782 ); + _DICT.put( 30435, 35524 ); + _DICT.put( 30436, 38101 ); + _DICT.put( 30437, 57783 ); + _DICT.put( 30439, 57784 ); + _DICT.put( 30442, 57785 ); + _DICT.put( 30446, 38618 ); + _DICT.put( 30450, 38611 ); + _DICT.put( 30452, 37564 ); + _DICT.put( 30456, 37258 ); + _DICT.put( 30459, 57787 ); + _DICT.put( 30462, 36738 ); + _DICT.put( 30465, 36808 ); + _DICT.put( 30468, 57790 ); + _DICT.put( 30471, 57789 ); + _DICT.put( 30472, 57788 ); + _DICT.put( 30473, 38139 ); + _DICT.put( 30475, 35525 ); + _DICT.put( 30476, 36007 ); + _DICT.put( 30491, 57796 ); + _DICT.put( 30494, 57793 ); + _DICT.put( 30495, 36958 ); + _DICT.put( 30496, 38576 ); + _DICT.put( 30500, 57792 ); + _DICT.put( 30501, 57794 ); + _DICT.put( 30502, 57795 ); + _DICT.put( 30505, 57791 ); + _DICT.put( 30519, 57797 ); + _DICT.put( 30520, 57798 ); + _DICT.put( 30522, 37549 ); + _DICT.put( 30524, 35553 ); + _DICT.put( 30528, 37509 ); + _DICT.put( 30534, 64374 ); + _DICT.put( 30535, 57799 ); + _DICT.put( 30554, 57800 ); + _DICT.put( 30555, 57803 ); + _DICT.put( 30561, 36999 ); + _DICT.put( 30563, 37826 ); + _DICT.put( 30565, 57804 ); + _DICT.put( 30566, 38514 ); + _DICT.put( 30568, 57801 ); + _DICT.put( 30571, 57802 ); + _DICT.put( 30585, 57807 ); + _DICT.put( 30590, 57806 ); + _DICT.put( 30591, 57805 ); + _DICT.put( 30603, 57809 ); + _DICT.put( 30606, 57808 ); + _DICT.put( 30609, 57810 ); + _DICT.put( 30622, 57812 ); + _DICT.put( 30624, 57811 ); + _DICT.put( 30629, 38347 ); + _DICT.put( 30636, 36725 ); + _DICT.put( 30637, 38852 ); + _DICT.put( 30640, 57813 ); + _DICT.put( 30643, 37813 ); + _DICT.put( 30646, 57814 ); + _DICT.put( 30649, 57815 ); + _DICT.put( 30651, 57819 ); + _DICT.put( 30652, 57817 ); + _DICT.put( 30653, 57818 ); + _DICT.put( 30655, 57816 ); + _DICT.put( 30663, 57820 ); + _DICT.put( 30669, 57821 ); + _DICT.put( 30679, 57822 ); + _DICT.put( 30682, 57823 ); + _DICT.put( 30683, 38581 ); + _DICT.put( 30684, 57824 ); + _DICT.put( 30690, 38638 ); + _DICT.put( 30691, 57825 ); + _DICT.put( 30693, 37485 ); + _DICT.put( 30695, 38026 ); + _DICT.put( 30697, 35817 ); + _DICT.put( 30701, 37466 ); + _DICT.put( 30702, 57826 ); + _DICT.put( 30703, 35768 ); + _DICT.put( 30707, 37070 ); + _DICT.put( 30716, 57827 ); + _DICT.put( 30722, 36283 ); + _DICT.put( 30732, 57828 ); + _DICT.put( 30738, 57829 ); + _DICT.put( 30740, 36004 ); + _DICT.put( 30741, 36307 ); + _DICT.put( 30752, 57831 ); + _DICT.put( 30753, 64376 ); + _DICT.put( 30757, 37749 ); + _DICT.put( 30758, 36308 ); + _DICT.put( 30759, 35693 ); + _DICT.put( 30770, 38467 ); + _DICT.put( 30772, 37994 ); + _DICT.put( 30778, 37750 ); + _DICT.put( 30783, 36219 ); + _DICT.put( 30789, 57833 ); + _DICT.put( 30798, 64377 ); + _DICT.put( 30813, 36809 ); + _DICT.put( 30820, 64378 ); + _DICT.put( 30827, 38832 ); + _DICT.put( 30828, 36196 ); + _DICT.put( 30831, 36005 ); + _DICT.put( 30834, 38049 ); + _DICT.put( 30836, 57835 ); + _DICT.put( 30842, 64379 ); + _DICT.put( 30844, 57837 ); + _DICT.put( 30849, 36073 ); + _DICT.put( 30854, 57836 ); + _DICT.put( 30855, 37620 ); + _DICT.put( 30860, 57839 ); + _DICT.put( 30861, 35414 ); + _DICT.put( 30862, 57834 ); + _DICT.put( 30865, 38120 ); + _DICT.put( 30867, 35151 ); + _DICT.put( 30869, 36330 ); + _DICT.put( 30871, 39025 ); + _DICT.put( 30874, 57838 ); + _DICT.put( 30883, 57840 ); + _DICT.put( 30887, 38345 ); + _DICT.put( 30889, 37079 ); + _DICT.put( 30890, 57842 ); + _DICT.put( 30895, 57843 ); + _DICT.put( 30901, 57841 ); + _DICT.put( 30906, 35437 ); + _DICT.put( 30908, 57849 ); + _DICT.put( 30910, 57848 ); + _DICT.put( 30913, 36517 ); + _DICT.put( 30917, 57850 ); + _DICT.put( 30918, 57845 ); + _DICT.put( 30922, 57851 ); + _DICT.put( 30923, 57846 ); + _DICT.put( 30928, 38102 ); + _DICT.put( 30929, 57844 ); + _DICT.put( 30932, 57847 ); + _DICT.put( 30938, 57921 ); + _DICT.put( 30951, 57920 ); + _DICT.put( 30952, 38529 ); + _DICT.put( 30956, 57852 ); + _DICT.put( 30959, 35049 ); + _DICT.put( 30964, 57923 ); + _DICT.put( 30973, 57922 ); + _DICT.put( 30977, 36810 ); + _DICT.put( 30983, 57924 ); + _DICT.put( 30990, 37218 ); + _DICT.put( 30993, 57926 ); + _DICT.put( 30994, 57925 ); + _DICT.put( 31001, 57927 ); + _DICT.put( 31014, 57830 ); + _DICT.put( 31018, 57832 ); + _DICT.put( 31019, 57929 ); + _DICT.put( 31020, 57928 ); + _DICT.put( 31024, 64380 ); + _DICT.put( 31034, 36518 ); + _DICT.put( 31036, 38887 ); + _DICT.put( 31038, 36560 ); + _DICT.put( 31040, 57930 ); + _DICT.put( 31041, 35926 ); + _DICT.put( 31047, 35679 ); + _DICT.put( 31048, 35654 ); + _DICT.put( 31049, 36483 ); + _DICT.put( 31056, 38739 ); + _DICT.put( 31059, 57936 ); + _DICT.put( 31061, 57935 ); + _DICT.put( 31062, 37219 ); + _DICT.put( 31063, 57932 ); + _DICT.put( 31066, 57934 ); + _DICT.put( 31069, 36714 ); + _DICT.put( 31070, 36959 ); + _DICT.put( 31071, 57933 ); + _DICT.put( 31072, 57931 ); + _DICT.put( 31074, 37961 ); + _DICT.put( 31077, 36811 ); + _DICT.put( 31080, 38235 ); + _DICT.put( 31085, 36309 ); + _DICT.put( 31095, 37784 ); + _DICT.put( 31098, 57937 ); + _DICT.put( 31103, 57938 ); + _DICT.put( 31104, 57960 ); + _DICT.put( 31105, 35798 ); + _DICT.put( 31108, 39004 ); + _DICT.put( 31109, 37204 ); + _DICT.put( 31114, 57939 ); + _DICT.put( 31117, 35280 ); + _DICT.put( 31118, 37621 ); + _DICT.put( 31119, 38303 ); + _DICT.put( 31124, 64385 ); + _DICT.put( 31131, 64387 ); + _DICT.put( 31133, 57940 ); + _DICT.put( 31142, 35738 ); + _DICT.put( 31143, 57941 ); + _DICT.put( 31146, 57943 ); + _DICT.put( 31150, 57944 ); + _DICT.put( 31152, 37960 ); + _DICT.put( 31155, 57945 ); + _DICT.put( 31161, 57946 ); + _DICT.put( 31162, 57947 ); + _DICT.put( 31165, 35799 ); + _DICT.put( 31166, 35281 ); + _DICT.put( 31167, 37827 ); + _DICT.put( 31168, 36679 ); + _DICT.put( 31169, 36484 ); + _DICT.put( 31177, 57948 ); + _DICT.put( 31179, 36680 ); + _DICT.put( 31185, 35272 ); + _DICT.put( 31186, 38242 ); + _DICT.put( 31189, 57949 ); + _DICT.put( 31192, 38121 ); + _DICT.put( 31199, 37220 ); + _DICT.put( 31201, 57952 ); + _DICT.put( 31203, 57953 ); + _DICT.put( 31204, 38025 ); + _DICT.put( 31206, 36960 ); + _DICT.put( 31207, 57950 ); + _DICT.put( 31209, 37505 ); + _DICT.put( 31212, 57951 ); + _DICT.put( 31216, 36812 ); + _DICT.put( 31227, 35034 ); + _DICT.put( 31232, 35656 ); + _DICT.put( 31240, 57954 ); + _DICT.put( 31243, 37622 ); + _DICT.put( 31245, 57955 ); + _DICT.put( 31246, 37061 ); + _DICT.put( 31252, 38571 ); + _DICT.put( 31255, 38210 ); + _DICT.put( 31256, 57956 ); + _DICT.put( 31257, 57957 ); + _DICT.put( 31258, 37492 ); + _DICT.put( 31260, 38853 ); + _DICT.put( 31263, 57959 ); + _DICT.put( 31264, 57958 ); + _DICT.put( 31278, 36589 ); + _DICT.put( 31281, 57961 ); + _DICT.put( 31282, 35054 ); + _DICT.put( 31287, 57964 ); + _DICT.put( 31291, 57962 ); + _DICT.put( 31292, 35282 ); + _DICT.put( 31293, 35949 ); + _DICT.put( 31294, 57963 ); + _DICT.put( 31295, 36197 ); + _DICT.put( 31296, 36242 ); + _DICT.put( 31298, 38372 ); + _DICT.put( 31299, 57965 ); + _DICT.put( 31302, 38515 ); + _DICT.put( 31305, 57967 ); + _DICT.put( 31309, 37071 ); + _DICT.put( 31310, 35182 ); + _DICT.put( 31311, 35256 ); + _DICT.put( 31312, 34986 ); + _DICT.put( 31319, 57966 ); + _DICT.put( 31329, 57968 ); + _DICT.put( 31330, 57969 ); + _DICT.put( 31331, 36853 ); + _DICT.put( 31337, 57970 ); + _DICT.put( 31339, 35438 ); + _DICT.put( 31344, 57972 ); + _DICT.put( 31348, 35978 ); + _DICT.put( 31350, 35718 ); + _DICT.put( 31353, 57973 ); + _DICT.put( 31354, 35827 ); + _DICT.put( 31357, 57974 ); + _DICT.put( 31359, 37114 ); + _DICT.put( 31361, 37835 ); + _DICT.put( 31363, 37086 ); + _DICT.put( 31364, 36339 ); + _DICT.put( 31368, 57975 ); + _DICT.put( 31378, 37506 ); + _DICT.put( 31379, 37259 ); + _DICT.put( 31381, 57977 ); + _DICT.put( 31382, 57979 ); + _DICT.put( 31383, 57976 ); + _DICT.put( 31384, 57978 ); + _DICT.put( 31391, 35905 ); + _DICT.put( 31401, 57980 ); + _DICT.put( 31402, 35909 ); + _DICT.put( 31406, 35719 ); + _DICT.put( 31407, 38769 ); + _DICT.put( 31408, 57982 ); + _DICT.put( 31414, 57984 ); + _DICT.put( 31418, 35149 ); + _DICT.put( 31423, 57987 ); + _DICT.put( 31427, 35478 ); + _DICT.put( 31428, 57986 ); + _DICT.put( 31429, 57985 ); + _DICT.put( 31431, 57989 ); + _DICT.put( 31432, 57981 ); + _DICT.put( 31434, 57990 ); + _DICT.put( 31435, 38823 ); + _DICT.put( 31437, 57991 ); + _DICT.put( 31439, 57992 ); + _DICT.put( 31441, 64388 ); + _DICT.put( 31442, 39666 ); + _DICT.put( 31443, 57994 ); + _DICT.put( 31445, 57993 ); + _DICT.put( 31449, 57995 ); + _DICT.put( 31450, 57996 ); + _DICT.put( 31452, 38835 ); + _DICT.put( 31453, 57997 ); + _DICT.put( 31455, 59629 ); + _DICT.put( 31456, 36813 ); + _DICT.put( 31457, 57998 ); + _DICT.put( 31458, 57999 ); + _DICT.put( 31459, 36726 ); + _DICT.put( 31461, 37814 ); + _DICT.put( 31462, 58000 ); + _DICT.put( 31463, 64389 ); + _DICT.put( 31466, 37447 ); + _DICT.put( 31467, 64391 ); + _DICT.put( 31469, 58001 ); + _DICT.put( 31471, 37467 ); + _DICT.put( 31472, 58002 ); + _DICT.put( 31478, 35747 ); + _DICT.put( 31480, 39262 ); + _DICT.put( 31481, 37500 ); + _DICT.put( 31482, 36529 ); + _DICT.put( 31487, 35526 ); + _DICT.put( 31490, 58003 ); + _DICT.put( 31492, 58016 ); + _DICT.put( 31494, 58006 ); + _DICT.put( 31496, 35720 ); + _DICT.put( 31498, 58005 ); + _DICT.put( 31499, 58018 ); + _DICT.put( 31503, 58004 ); + _DICT.put( 31505, 36814 ); + _DICT.put( 31512, 58008 ); + _DICT.put( 31513, 58009 ); + _DICT.put( 31515, 37706 ); + _DICT.put( 31518, 58010 ); + _DICT.put( 31520, 35453 ); + _DICT.put( 31525, 36985 ); + _DICT.put( 31526, 38276 ); + _DICT.put( 31528, 58012 ); + _DICT.put( 31532, 37350 ); + _DICT.put( 31539, 58007 ); + _DICT.put( 31541, 58011 ); + _DICT.put( 31542, 58013 ); + _DICT.put( 31545, 36345 ); + _DICT.put( 31557, 58020 ); + _DICT.put( 31558, 38221 ); + _DICT.put( 31560, 38052 ); + _DICT.put( 31561, 37785 ); + _DICT.put( 31563, 35800 ); + _DICT.put( 31564, 58019 ); + _DICT.put( 31565, 58017 ); + _DICT.put( 31567, 38067 ); + _DICT.put( 31568, 58014 ); + _DICT.put( 31569, 37501 ); + _DICT.put( 31570, 37787 ); + _DICT.put( 31572, 37786 ); + _DICT.put( 31574, 36340 ); + _DICT.put( 31581, 58038 ); + _DICT.put( 31589, 58022 ); + _DICT.put( 31591, 58024 ); + _DICT.put( 31596, 58027 ); + _DICT.put( 31598, 58028 ); + _DICT.put( 31600, 58025 ); + _DICT.put( 31601, 58026 ); + _DICT.put( 31604, 58023 ); + _DICT.put( 31605, 58021 ); + _DICT.put( 31610, 58015 ); + _DICT.put( 31622, 38349 ); + _DICT.put( 31623, 35283 ); + _DICT.put( 31627, 58035 ); + _DICT.put( 31629, 58032 ); + _DICT.put( 31631, 58037 ); + _DICT.put( 31634, 58036 ); + _DICT.put( 31636, 38035 ); + _DICT.put( 31637, 38565 ); + _DICT.put( 31639, 36442 ); + _DICT.put( 31640, 58030 ); + _DICT.put( 31641, 58039 ); + _DICT.put( 31642, 58034 ); + _DICT.put( 31644, 58033 ); + _DICT.put( 31645, 58029 ); + _DICT.put( 31646, 64392 ); + _DICT.put( 31647, 58031 ); + _DICT.put( 31649, 35527 ); + _DICT.put( 31658, 37468 ); + _DICT.put( 31661, 37115 ); + _DICT.put( 31665, 38048 ); + _DICT.put( 31668, 58044 ); + _DICT.put( 31672, 38050 ); + _DICT.put( 31680, 37087 ); + _DICT.put( 31681, 58041 ); + _DICT.put( 31684, 38093 ); + _DICT.put( 31686, 58045 ); + _DICT.put( 31687, 38353 ); + _DICT.put( 31689, 37498 ); + _DICT.put( 31691, 58040 ); + _DICT.put( 31692, 58042 ); + _DICT.put( 31695, 58043 ); + _DICT.put( 31709, 58046 ); + _DICT.put( 31712, 36546 ); + _DICT.put( 31716, 37828 ); + _DICT.put( 31717, 58051 ); + _DICT.put( 31718, 58050 ); + _DICT.put( 31721, 58047 ); + _DICT.put( 31725, 38997 ); + _DICT.put( 31731, 58056 ); + _DICT.put( 31734, 58060 ); + _DICT.put( 31735, 58057 ); + _DICT.put( 31744, 58053 ); + _DICT.put( 31751, 58054 ); + _DICT.put( 31757, 58059 ); + _DICT.put( 31761, 58048 ); + _DICT.put( 31762, 39379 ); + _DICT.put( 31763, 58055 ); + _DICT.put( 31764, 58049 ); + _DICT.put( 31767, 58058 ); + _DICT.put( 31775, 58064 ); + _DICT.put( 31777, 35528 ); + _DICT.put( 31779, 58061 ); + _DICT.put( 31783, 58062 ); + _DICT.put( 31786, 58063 ); + _DICT.put( 31787, 58066 ); + _DICT.put( 31799, 58065 ); + _DICT.put( 31800, 38132 ); + _DICT.put( 31805, 58067 ); + _DICT.put( 31806, 38906 ); + _DICT.put( 31807, 38379 ); + _DICT.put( 31808, 58072 ); + _DICT.put( 31811, 58069 ); + _DICT.put( 31820, 58068 ); + _DICT.put( 31821, 37072 ); + _DICT.put( 31823, 58071 ); + _DICT.put( 31824, 58073 ); + _DICT.put( 31828, 58070 ); + _DICT.put( 31830, 58077 ); + _DICT.put( 31832, 58074 ); + _DICT.put( 31839, 58075 ); + _DICT.put( 31840, 58052 ); + _DICT.put( 31844, 58076 ); + _DICT.put( 31845, 58078 ); + _DICT.put( 31852, 58079 ); + _DICT.put( 31859, 38340 ); + _DICT.put( 31861, 58080 ); + _DICT.put( 31870, 38624 ); + _DICT.put( 31873, 35788 ); + _DICT.put( 31874, 35912 ); + _DICT.put( 31875, 58081 ); + _DICT.put( 31881, 38322 ); + _DICT.put( 31883, 37000 ); + _DICT.put( 31885, 38574 ); + _DICT.put( 31888, 58082 ); + _DICT.put( 31890, 38833 ); + _DICT.put( 31893, 38036 ); + _DICT.put( 31895, 37221 ); + _DICT.put( 31896, 37971 ); + _DICT.put( 31899, 36716 ); + _DICT.put( 31903, 35006 ); + _DICT.put( 31905, 58087 ); + _DICT.put( 31906, 58085 ); + _DICT.put( 31908, 58083 ); + _DICT.put( 31909, 35487 ); + _DICT.put( 31911, 36815 ); + _DICT.put( 31912, 58088 ); + _DICT.put( 31915, 58086 ); + _DICT.put( 31917, 58084 ); + _DICT.put( 31918, 58092 ); + _DICT.put( 31921, 58091 ); + _DICT.put( 31922, 58090 ); + _DICT.put( 31923, 58089 ); + _DICT.put( 31929, 58093 ); + _DICT.put( 31933, 58094 ); + _DICT.put( 31934, 37048 ); + _DICT.put( 31936, 58095 ); + _DICT.put( 31938, 58097 ); + _DICT.put( 31941, 58096 ); + _DICT.put( 31946, 36048 ); + _DICT.put( 31950, 37207 ); + _DICT.put( 31954, 58099 ); + _DICT.put( 31958, 37788 ); + _DICT.put( 31960, 58098 ); + _DICT.put( 31964, 58100 ); + _DICT.put( 31966, 38323 ); + _DICT.put( 31967, 37260 ); + _DICT.put( 31968, 36198 ); + _DICT.put( 31970, 58101 ); + _DICT.put( 31975, 38854 ); + _DICT.put( 31983, 58103 ); + _DICT.put( 31986, 58104 ); + _DICT.put( 31988, 58105 ); + _DICT.put( 31990, 58106 ); + _DICT.put( 31992, 36485 ); + _DICT.put( 31994, 58107 ); + _DICT.put( 31995, 35950 ); + _DICT.put( 31998, 35722 ); + _DICT.put( 32000, 35657 ); + _DICT.put( 32002, 58176 ); + _DICT.put( 32004, 38641 ); + _DICT.put( 32005, 36199 ); + _DICT.put( 32006, 58108 ); + _DICT.put( 32010, 58179 ); + _DICT.put( 32011, 38628 ); + _DICT.put( 32013, 37979 ); + _DICT.put( 32016, 38226 ); + _DICT.put( 32020, 36739 ); + _DICT.put( 32021, 58178 ); + _DICT.put( 32023, 36561 ); + _DICT.put( 32024, 36200 ); + _DICT.put( 32025, 36486 ); + _DICT.put( 32026, 35721 ); + _DICT.put( 32027, 38324 ); + _DICT.put( 32028, 58177 ); + _DICT.put( 32032, 37222 ); + _DICT.put( 32033, 38497 ); + _DICT.put( 32034, 36341 ); + _DICT.put( 32043, 36487 ); + _DICT.put( 32044, 37595 ); + _DICT.put( 32046, 58182 ); + _DICT.put( 32047, 38877 ); + _DICT.put( 32048, 36311 ); + _DICT.put( 32050, 58183 ); + _DICT.put( 32051, 36961 ); + _DICT.put( 32053, 58185 ); + _DICT.put( 32057, 36816 ); + _DICT.put( 32058, 36270 ); + _DICT.put( 32063, 58184 ); + _DICT.put( 32066, 36681 ); + _DICT.put( 32067, 36028 ); + _DICT.put( 32068, 37223 ); + _DICT.put( 32069, 58180 ); + _DICT.put( 32070, 58186 ); + _DICT.put( 32072, 64394 ); + _DICT.put( 32075, 58181 ); + _DICT.put( 32076, 35951 ); + _DICT.put( 32078, 58189 ); + _DICT.put( 32079, 58193 ); + _DICT.put( 32080, 35979 ); + _DICT.put( 32086, 58188 ); + _DICT.put( 32091, 58197 ); + _DICT.put( 32092, 64395 ); + _DICT.put( 32094, 36201 ); + _DICT.put( 32097, 38797 ); + _DICT.put( 32098, 35002 ); + _DICT.put( 32099, 58194 ); + _DICT.put( 32102, 35723 ); + _DICT.put( 32104, 58191 ); + _DICT.put( 32110, 58192 ); + _DICT.put( 32113, 37789 ); + _DICT.put( 32114, 58190 ); + _DICT.put( 32115, 58187 ); + _DICT.put( 32117, 35399 ); + _DICT.put( 32118, 37090 ); + _DICT.put( 32121, 36006 ); + _DICT.put( 32125, 58199 ); + _DICT.put( 32137, 58196 ); + _DICT.put( 32143, 58198 ); + _DICT.put( 32147, 58195 ); + _DICT.put( 32153, 35952 ); + _DICT.put( 32154, 37297 ); + _DICT.put( 32155, 58200 ); + _DICT.put( 32156, 37262 ); + _DICT.put( 32159, 58213 ); + _DICT.put( 32160, 64397 ); + _DICT.put( 32162, 58209 ); + _DICT.put( 32163, 58203 ); + _DICT.put( 32171, 58207 ); + _DICT.put( 32172, 36600 ); + _DICT.put( 32173, 35035 ); + _DICT.put( 32174, 58202 ); + _DICT.put( 32175, 58210 ); + _DICT.put( 32176, 58214 ); + _DICT.put( 32177, 36202 ); + _DICT.put( 32178, 38612 ); + _DICT.put( 32180, 37588 ); + _DICT.put( 32181, 58204 ); + _DICT.put( 32183, 64396 ); + _DICT.put( 32184, 58212 ); + _DICT.put( 32186, 58201 ); + _DICT.put( 32187, 37469 ); + _DICT.put( 32189, 58206 ); + _DICT.put( 32190, 35003 ); + _DICT.put( 32191, 38600 ); + _DICT.put( 32199, 58205 ); + _DICT.put( 32202, 35801 ); + _DICT.put( 32203, 38122 ); + _DICT.put( 32207, 37261 ); + _DICT.put( 32209, 38862 ); + _DICT.put( 32210, 36751 ); + _DICT.put( 32213, 58254 ); + _DICT.put( 32214, 64398 ); + _DICT.put( 32216, 58215 ); + _DICT.put( 32218, 37116 ); + _DICT.put( 32220, 58211 ); + _DICT.put( 32221, 58216 ); + _DICT.put( 32222, 58218 ); + _DICT.put( 32224, 37623 ); + _DICT.put( 32225, 58221 ); + _DICT.put( 32228, 58217 ); + _DICT.put( 32232, 38354 ); + _DICT.put( 32233, 35529 ); + _DICT.put( 32236, 38601 ); + _DICT.put( 32239, 35036 ); + _DICT.put( 32242, 58220 ); + _DICT.put( 32244, 38907 ); + _DICT.put( 32251, 58219 ); + _DICT.put( 32257, 35215 ); + _DICT.put( 32260, 37866 ); + _DICT.put( 32261, 58222 ); + _DICT.put( 32265, 58229 ); + _DICT.put( 32266, 58223 ); + _DICT.put( 32267, 58230 ); + _DICT.put( 32274, 58226 ); + _DICT.put( 32283, 38043 ); + _DICT.put( 32286, 36552 ); + _DICT.put( 32287, 58228 ); + _DICT.put( 32289, 58225 ); + _DICT.put( 32290, 58231 ); + _DICT.put( 32291, 58224 ); + _DICT.put( 32294, 36707 ); + _DICT.put( 32299, 38468 ); + _DICT.put( 32302, 36715 ); + _DICT.put( 32305, 58227 ); + _DICT.put( 32306, 58240 ); + _DICT.put( 32309, 58235 ); + _DICT.put( 32311, 58238 ); + _DICT.put( 32313, 58236 ); + _DICT.put( 32314, 58241 ); + _DICT.put( 32315, 58234 ); + _DICT.put( 32317, 58208 ); + _DICT.put( 32318, 37073 ); + _DICT.put( 32321, 38089 ); + _DICT.put( 32323, 58237 ); + _DICT.put( 32326, 58232 ); + _DICT.put( 32330, 37184 ); + _DICT.put( 32331, 35953 ); + _DICT.put( 32333, 36682 ); + _DICT.put( 32338, 64399 ); + _DICT.put( 32340, 36932 ); + _DICT.put( 32341, 37205 ); + _DICT.put( 32342, 58244 ); + _DICT.put( 32345, 58246 ); + _DICT.put( 32346, 58247 ); + _DICT.put( 32349, 58243 ); + _DICT.put( 32350, 58245 ); + _DICT.put( 32358, 58233 ); + _DICT.put( 32359, 58242 ); + _DICT.put( 32361, 58250 ); + _DICT.put( 32362, 58249 ); + _DICT.put( 32365, 38554 ); + _DICT.put( 32368, 35914 ); + _DICT.put( 32377, 58248 ); + _DICT.put( 32379, 58252 ); + _DICT.put( 32380, 58251 ); + _DICT.put( 32381, 58255 ); + _DICT.put( 32383, 58257 ); + _DICT.put( 32386, 36443 ); + _DICT.put( 32387, 58253 ); + _DICT.put( 32392, 58258 ); + _DICT.put( 32393, 58259 ); + _DICT.put( 32394, 64092 ); + _DICT.put( 32396, 58260 ); + _DICT.put( 32398, 58266 ); + _DICT.put( 32399, 37722 ); + _DICT.put( 32400, 58262 ); + _DICT.put( 32402, 58261 ); + _DICT.put( 32403, 58263 ); + _DICT.put( 32404, 58264 ); + _DICT.put( 32406, 58265 ); + _DICT.put( 32411, 58267 ); + _DICT.put( 32412, 58268 ); + _DICT.put( 32566, 35530 ); + _DICT.put( 32568, 58269 ); + _DICT.put( 32570, 58270 ); + _DICT.put( 32581, 58271 ); + _DICT.put( 32583, 64400 ); + _DICT.put( 32588, 58272 ); + _DICT.put( 32589, 58273 ); + _DICT.put( 32590, 58274 ); + _DICT.put( 32592, 58275 ); + _DICT.put( 32593, 58276 ); + _DICT.put( 32596, 58278 ); + _DICT.put( 32597, 58277 ); + _DICT.put( 32600, 58279 ); + _DICT.put( 32607, 58280 ); + _DICT.put( 32608, 58281 ); + _DICT.put( 32615, 58284 ); + _DICT.put( 32616, 58282 ); + _DICT.put( 32617, 58283 ); + _DICT.put( 32618, 36319 ); + _DICT.put( 32619, 35954 ); + _DICT.put( 32622, 37493 ); + _DICT.put( 32624, 38065 ); + _DICT.put( 32626, 36752 ); + _DICT.put( 32629, 37996 ); + _DICT.put( 32631, 38123 ); + _DICT.put( 32632, 58285 ); + _DICT.put( 32633, 40171 ); + _DICT.put( 32642, 58286 ); + _DICT.put( 32643, 58288 ); + _DICT.put( 32645, 38789 ); + _DICT.put( 32646, 58287 ); + _DICT.put( 32647, 58290 ); + _DICT.put( 32648, 58289 ); + _DICT.put( 32650, 38770 ); + _DICT.put( 32652, 58291 ); + _DICT.put( 32654, 38140 ); + _DICT.put( 32660, 58292 ); + _DICT.put( 32666, 58295 ); + _DICT.put( 32669, 58294 ); + _DICT.put( 32670, 58293 ); + _DICT.put( 32673, 64401 ); + _DICT.put( 32675, 58296 ); + _DICT.put( 32676, 35921 ); + _DICT.put( 32680, 37185 ); + _DICT.put( 32681, 35680 ); + _DICT.put( 32686, 58300 ); + _DICT.put( 32687, 58297 ); + _DICT.put( 32690, 58298 ); + _DICT.put( 32694, 58301 ); + _DICT.put( 32696, 58302 ); + _DICT.put( 32697, 58299 ); + _DICT.put( 32701, 35144 ); + _DICT.put( 32705, 35237 ); + _DICT.put( 32709, 58304 ); + _DICT.put( 32710, 58305 ); + _DICT.put( 32714, 58306 ); + _DICT.put( 32716, 38786 ); + _DICT.put( 32722, 36683 ); + _DICT.put( 32724, 58308 ); + _DICT.put( 32725, 58307 ); + _DICT.put( 32736, 37001 ); + _DICT.put( 32737, 58309 ); + _DICT.put( 32742, 58310 ); + _DICT.put( 32745, 58311 ); + _DICT.put( 32747, 35555 ); + _DICT.put( 32752, 35531 ); + _DICT.put( 32755, 58312 ); + _DICT.put( 32761, 58313 ); + _DICT.put( 32763, 38524 ); + _DICT.put( 32764, 38787 ); + _DICT.put( 32768, 38771 ); + _DICT.put( 32769, 38998 ); + _DICT.put( 32771, 36204 ); + _DICT.put( 32772, 58316 ); + _DICT.put( 32773, 36562 ); + _DICT.put( 32774, 58315 ); + _DICT.put( 32779, 58317 ); + _DICT.put( 32780, 36519 ); + _DICT.put( 32784, 37327 ); + _DICT.put( 32786, 58318 ); + _DICT.put( 32789, 36203 ); + _DICT.put( 32791, 38613 ); + _DICT.put( 32792, 58319 ); + _DICT.put( 32793, 58320 ); + _DICT.put( 32796, 58321 ); + _DICT.put( 32801, 58322 ); + _DICT.put( 32808, 58323 ); + _DICT.put( 32819, 36520 ); + _DICT.put( 32822, 38635 ); + _DICT.put( 32827, 58325 ); + _DICT.put( 32829, 37470 ); + _DICT.put( 32831, 58324 ); + _DICT.put( 32838, 58327 ); + _DICT.put( 32842, 58326 ); + _DICT.put( 32850, 58328 ); + _DICT.put( 32854, 37049 ); + _DICT.put( 32856, 58329 ); + _DICT.put( 32858, 58330 ); + _DICT.put( 32862, 38327 ); + _DICT.put( 32863, 58331 ); + _DICT.put( 32865, 37263 ); + _DICT.put( 32866, 58332 ); + _DICT.put( 32872, 58333 ); + _DICT.put( 32879, 38908 ); + _DICT.put( 32880, 58336 ); + _DICT.put( 32882, 58335 ); + _DICT.put( 32883, 58334 ); + _DICT.put( 32884, 37550 ); + _DICT.put( 32886, 58337 ); + _DICT.put( 32887, 36933 ); + _DICT.put( 32889, 58338 ); + _DICT.put( 32893, 58339 ); + _DICT.put( 32894, 38999 ); + _DICT.put( 32895, 58340 ); + _DICT.put( 32900, 58341 ); + _DICT.put( 32901, 58343 ); + _DICT.put( 32902, 58342 ); + _DICT.put( 32903, 38051 ); + _DICT.put( 32905, 37879 ); + _DICT.put( 32907, 39005 ); + _DICT.put( 32908, 38055 ); + _DICT.put( 32915, 58345 ); + _DICT.put( 32918, 36817 ); + _DICT.put( 32920, 38217 ); + _DICT.put( 32922, 58346 ); + _DICT.put( 32923, 58344 ); + _DICT.put( 32925, 35532 ); + _DICT.put( 32929, 36050 ); + _DICT.put( 32930, 36488 ); + _DICT.put( 32933, 38124 ); + _DICT.put( 32937, 36008 ); + _DICT.put( 32938, 38498 ); + _DICT.put( 32940, 58349 ); + _DICT.put( 32941, 58347 ); + _DICT.put( 32943, 36205 ); + _DICT.put( 32945, 36206 ); + _DICT.put( 32946, 35047 ); + _DICT.put( 32948, 36326 ); + _DICT.put( 32954, 38008 ); + _DICT.put( 32963, 35037 ); + _DICT.put( 32964, 58354 ); + _DICT.put( 32966, 37471 ); + _DICT.put( 32972, 38007 ); + _DICT.put( 32974, 37337 ); + _DICT.put( 32982, 58356 ); + _DICT.put( 32985, 58352 ); + _DICT.put( 32986, 58355 ); + _DICT.put( 32987, 58350 ); + _DICT.put( 32989, 58353 ); + _DICT.put( 32990, 38469 ); + _DICT.put( 32993, 36051 ); + _DICT.put( 32996, 35067 ); + _DICT.put( 32997, 58351 ); + _DICT.put( 33007, 58358 ); + _DICT.put( 33009, 58359 ); + _DICT.put( 33012, 37815 ); + _DICT.put( 33016, 35769 ); + _DICT.put( 33020, 58437 ); + _DICT.put( 33021, 37980 ); + _DICT.put( 33026, 36489 ); + _DICT.put( 33029, 35770 ); + _DICT.put( 33030, 37062 ); + _DICT.put( 33031, 39013 ); + _DICT.put( 33032, 38572 ); + _DICT.put( 33033, 58357 ); + _DICT.put( 33034, 37074 ); + _DICT.put( 33050, 35698 ); + _DICT.put( 33051, 58360 ); + _DICT.put( 33059, 58362 ); + _DICT.put( 33065, 58361 ); + _DICT.put( 33071, 58363 ); + _DICT.put( 33073, 37445 ); + _DICT.put( 33075, 37981 ); + _DICT.put( 33081, 37551 ); + _DICT.put( 33086, 58434 ); + _DICT.put( 33094, 58433 ); + _DICT.put( 33099, 58364 ); + _DICT.put( 33102, 36980 ); + _DICT.put( 33104, 38277 ); + _DICT.put( 33105, 58436 ); + _DICT.put( 33107, 58435 ); + _DICT.put( 33108, 36207 ); + _DICT.put( 33109, 39026 ); + _DICT.put( 33119, 58452 ); + _DICT.put( 33125, 58440 ); + _DICT.put( 33126, 58441 ); + _DICT.put( 33131, 36590 ); + _DICT.put( 33134, 58439 ); + _DICT.put( 33136, 36248 ); + _DICT.put( 33137, 58438 ); + _DICT.put( 33140, 58442 ); + _DICT.put( 33144, 37552 ); + _DICT.put( 33145, 38304 ); + _DICT.put( 33146, 37186 ); + _DICT.put( 33151, 37338 ); + _DICT.put( 33152, 58446 ); + _DICT.put( 33154, 58447 ); + _DICT.put( 33155, 58443 ); + _DICT.put( 33160, 58444 ); + _DICT.put( 33162, 58445 ); + _DICT.put( 33167, 36208 ); + _DICT.put( 33171, 58453 ); + _DICT.put( 33173, 58449 ); + _DICT.put( 33178, 38278 ); + _DICT.put( 33180, 38540 ); + _DICT.put( 33181, 38215 ); + _DICT.put( 33184, 58448 ); + _DICT.put( 33187, 58451 ); + _DICT.put( 33188, 58450 ); + _DICT.put( 33192, 38499 ); + _DICT.put( 33193, 58454 ); + _DICT.put( 33200, 58455 ); + _DICT.put( 33203, 37206 ); + _DICT.put( 33205, 58456 ); + _DICT.put( 33208, 58458 ); + _DICT.put( 33210, 58462 ); + _DICT.put( 33213, 58459 ); + _DICT.put( 33214, 58457 ); + _DICT.put( 33215, 37982 ); + _DICT.put( 33216, 58460 ); + _DICT.put( 33218, 58461 ); + _DICT.put( 33222, 35248 ); + _DICT.put( 33224, 58468 ); + _DICT.put( 33225, 58463 ); + _DICT.put( 33229, 58464 ); + _DICT.put( 33233, 58465 ); + _DICT.put( 33235, 37279 ); + _DICT.put( 33240, 58467 ); + _DICT.put( 33241, 58466 ); + _DICT.put( 33242, 58469 ); + _DICT.put( 33247, 58470 ); + _DICT.put( 33248, 58471 ); + _DICT.put( 33251, 36962 ); + _DICT.put( 33253, 35303 ); + _DICT.put( 33255, 58472 ); + _DICT.put( 33256, 38869 ); + _DICT.put( 33258, 36521 ); + _DICT.put( 33261, 36684 ); + _DICT.put( 33267, 36490 ); + _DICT.put( 33268, 37494 ); + _DICT.put( 33274, 58473 ); + _DICT.put( 33275, 58474 ); + _DICT.put( 33276, 35152 ); + _DICT.put( 33278, 58475 ); + _DICT.put( 33281, 58476 ); + _DICT.put( 33282, 58477 ); + _DICT.put( 33285, 58478 ); + _DICT.put( 33287, 58479 ); + _DICT.put( 33288, 35771 ); + _DICT.put( 33289, 40360 ); + _DICT.put( 33290, 58480 ); + _DICT.put( 33292, 37091 ); + _DICT.put( 33293, 58481 ); + _DICT.put( 33294, 36553 ); + _DICT.put( 33296, 58482 ); + _DICT.put( 33298, 39086 ); + _DICT.put( 33302, 58483 ); + _DICT.put( 33303, 38364 ); + _DICT.put( 33304, 35546 ); + _DICT.put( 33307, 37187 ); + _DICT.put( 33308, 36727 ); + _DICT.put( 33310, 38289 ); + _DICT.put( 33311, 36685 ); + _DICT.put( 33321, 58484 ); + _DICT.put( 33322, 36209 ); + _DICT.put( 33323, 58485 ); + _DICT.put( 33324, 38090 ); + _DICT.put( 33326, 58500 ); + _DICT.put( 33331, 58487 ); + _DICT.put( 33333, 37319 ); + _DICT.put( 33334, 38037 ); + _DICT.put( 33335, 36029 ); + _DICT.put( 33336, 58486 ); + _DICT.put( 33337, 37188 ); + _DICT.put( 33344, 58488 ); + _DICT.put( 33351, 37624 ); + _DICT.put( 33368, 58490 ); + _DICT.put( 33369, 58489 ); + _DICT.put( 33370, 58492 ); + _DICT.put( 33373, 58491 ); + _DICT.put( 33375, 58493 ); + _DICT.put( 33378, 58496 ); + _DICT.put( 33380, 58494 ); + _DICT.put( 33382, 35533 ); + _DICT.put( 33384, 58497 ); + _DICT.put( 33386, 58498 ); + _DICT.put( 33387, 58499 ); + _DICT.put( 33390, 36271 ); + _DICT.put( 33391, 38855 ); + _DICT.put( 33393, 58501 ); + _DICT.put( 33394, 36934 ); + _DICT.put( 33398, 35216 ); + _DICT.put( 33399, 58502 ); + _DICT.put( 33400, 58503 ); + _DICT.put( 33406, 58504 ); + _DICT.put( 33419, 35056 ); + _DICT.put( 33421, 58505 ); + _DICT.put( 33426, 58506 ); + _DICT.put( 33433, 38279 ); + _DICT.put( 33437, 36549 ); + _DICT.put( 33439, 58508 ); + _DICT.put( 33445, 35400 ); + _DICT.put( 33446, 34992 ); + _DICT.put( 33451, 58507 ); + _DICT.put( 33452, 58510 ); + _DICT.put( 33453, 37997 ); + _DICT.put( 33455, 36963 ); + _DICT.put( 33457, 35284 ); + _DICT.put( 33459, 38470 ); + _DICT.put( 33464, 35964 ); + _DICT.put( 33465, 35802 ); + _DICT.put( 33467, 58509 ); + _DICT.put( 33469, 35304 ); + _DICT.put( 33477, 35489 ); + _DICT.put( 33489, 35217 ); + _DICT.put( 33490, 58514 ); + _DICT.put( 33491, 38888 ); + _DICT.put( 33492, 37339 ); + _DICT.put( 33495, 38243 ); + _DICT.put( 33497, 58526 ); + _DICT.put( 33499, 35285 ); + _DICT.put( 33500, 58524 ); + _DICT.put( 33502, 58522 ); + _DICT.put( 33503, 58513 ); + _DICT.put( 33505, 58511 ); + _DICT.put( 33507, 58512 ); + _DICT.put( 33509, 36577 ); + _DICT.put( 33510, 35818 ); + _DICT.put( 33511, 37527 ); + _DICT.put( 33515, 37839 ); + _DICT.put( 33521, 35184 ); + _DICT.put( 33523, 58516 ); + _DICT.put( 33524, 58515 ); + _DICT.put( 33529, 58521 ); + _DICT.put( 33530, 58517 ); + _DICT.put( 33531, 58520 ); + _DICT.put( 33537, 64403 ); + _DICT.put( 33538, 38606 ); + _DICT.put( 33539, 58519 ); + _DICT.put( 33540, 35286 ); + _DICT.put( 33541, 35485 ); + _DICT.put( 33542, 58523 ); + _DICT.put( 33545, 58525 ); + _DICT.put( 33550, 35955 ); + _DICT.put( 33558, 58529 ); + _DICT.put( 33559, 58538 ); + _DICT.put( 33560, 58539 ); + _DICT.put( 33564, 34985 ); + _DICT.put( 33571, 58546 ); + _DICT.put( 33576, 35055 ); + _DICT.put( 33579, 58537 ); + _DICT.put( 33583, 58536 ); + _DICT.put( 33585, 58531 ); + _DICT.put( 33586, 58530 ); + _DICT.put( 33588, 58528 ); + _DICT.put( 33589, 58527 ); + _DICT.put( 33590, 37507 ); + _DICT.put( 33592, 37369 ); + _DICT.put( 33593, 58533 ); + _DICT.put( 33600, 58532 ); + _DICT.put( 33605, 58535 ); + _DICT.put( 33609, 37264 ); + _DICT.put( 33610, 35956 ); + _DICT.put( 33615, 35168 ); + _DICT.put( 33616, 58534 ); + _DICT.put( 33618, 36210 ); + _DICT.put( 33624, 37265 ); + _DICT.put( 33634, 64404 ); + _DICT.put( 33651, 58552 ); + _DICT.put( 33653, 58553 ); + _DICT.put( 33655, 35287 ); + _DICT.put( 33659, 35244 ); + _DICT.put( 33660, 58550 ); + _DICT.put( 33663, 64405 ); + _DICT.put( 33669, 58540 ); + _DICT.put( 33671, 58548 ); + _DICT.put( 33673, 58555 ); + _DICT.put( 33674, 58549 ); + _DICT.put( 33678, 58547 ); + _DICT.put( 33683, 58518 ); + _DICT.put( 33686, 58545 ); + _DICT.put( 33690, 58541 ); + _DICT.put( 33694, 35534 ); + _DICT.put( 33695, 58543 ); + _DICT.put( 33696, 58554 ); + _DICT.put( 33698, 58544 ); + _DICT.put( 33704, 58556 ); + _DICT.put( 33706, 58542 ); + _DICT.put( 33707, 38044 ); + _DICT.put( 33713, 38793 ); + _DICT.put( 33717, 58551 ); + _DICT.put( 33725, 58573 ); + _DICT.put( 33729, 58565 ); + _DICT.put( 33733, 37019 ); + _DICT.put( 33735, 64406 ); + _DICT.put( 33738, 35685 ); + _DICT.put( 33740, 35803 ); + _DICT.put( 33742, 58560 ); + _DICT.put( 33747, 35289 ); + _DICT.put( 33750, 36818 ); + _DICT.put( 33752, 58563 ); + _DICT.put( 33756, 36312 ); + _DICT.put( 33759, 37744 ); + _DICT.put( 33760, 58568 ); + _DICT.put( 33769, 38380 ); + _DICT.put( 33771, 58559 ); + _DICT.put( 33775, 35288 ); + _DICT.put( 33776, 36052 ); + _DICT.put( 33777, 38216 ); + _DICT.put( 33778, 58569 ); + _DICT.put( 33780, 58557 ); + _DICT.put( 33782, 64407 ); + _DICT.put( 33783, 58566 ); + _DICT.put( 33787, 58576 ); + _DICT.put( 33789, 58561 ); + _DICT.put( 33795, 58562 ); + _DICT.put( 33796, 37816 ); + _DICT.put( 33799, 58567 ); + _DICT.put( 33803, 58564 ); + _DICT.put( 33804, 38471 ); + _DICT.put( 33805, 58570 ); + _DICT.put( 33806, 35038 ); + _DICT.put( 33811, 58558 ); + _DICT.put( 33824, 58572 ); + _DICT.put( 33826, 58571 ); + _DICT.put( 33833, 38027 ); + _DICT.put( 33834, 58578 ); + _DICT.put( 33836, 58589 ); + _DICT.put( 33841, 35486 ); + _DICT.put( 33845, 58592 ); + _DICT.put( 33848, 58574 ); + _DICT.put( 33852, 58579 ); + _DICT.put( 33853, 38798 ); + _DICT.put( 33862, 58588 ); + _DICT.put( 33864, 64408 ); + _DICT.put( 33865, 38772 ); + _DICT.put( 33870, 38824 ); + _DICT.put( 33879, 37528 ); + _DICT.put( 33883, 35467 ); + _DICT.put( 33889, 38290 ); + _DICT.put( 33890, 58594 ); + _DICT.put( 33891, 37791 ); + _DICT.put( 33894, 34991 ); + _DICT.put( 33897, 58587 ); + _DICT.put( 33899, 58583 ); + _DICT.put( 33900, 37266 ); + _DICT.put( 33901, 58577 ); + _DICT.put( 33902, 58585 ); + _DICT.put( 33903, 58590 ); + _DICT.put( 33905, 37963 ); + _DICT.put( 33909, 34984 ); + _DICT.put( 33911, 58582 ); + _DICT.put( 33913, 58591 ); + _DICT.put( 33914, 38296 ); + _DICT.put( 33922, 58586 ); + _DICT.put( 33924, 58581 ); + _DICT.put( 33931, 36819 ); + _DICT.put( 33936, 36686 ); + _DICT.put( 33940, 36522 ); + _DICT.put( 33945, 38614 ); + _DICT.put( 33948, 38246 ); + _DICT.put( 33951, 58597 ); + _DICT.put( 33953, 58606 ); + _DICT.put( 33965, 58584 ); + _DICT.put( 33970, 35479 ); + _DICT.put( 33972, 64409 ); + _DICT.put( 33976, 36854 ); + _DICT.put( 33977, 58595 ); + _DICT.put( 33979, 58600 ); + _DICT.put( 33980, 37267 ); + _DICT.put( 33983, 58596 ); + _DICT.put( 33985, 58603 ); + _DICT.put( 33988, 37502 ); + _DICT.put( 33990, 58604 ); + _DICT.put( 33993, 38773 ); + _DICT.put( 33994, 58593 ); + _DICT.put( 33995, 35415 ); + _DICT.put( 33997, 58599 ); + _DICT.put( 34000, 58602 ); + _DICT.put( 34001, 38570 ); + _DICT.put( 34006, 58605 ); + _DICT.put( 34009, 58598 ); + _DICT.put( 34010, 58601 ); + _DICT.put( 34012, 64096 ); + _DICT.put( 34028, 38472 ); + _DICT.put( 34030, 38976 ); + _DICT.put( 34036, 58609 ); + _DICT.put( 34044, 58616 ); + _DICT.put( 34047, 58608 ); + _DICT.put( 34048, 36545 ); + _DICT.put( 34054, 58575 ); + _DICT.put( 34065, 38348 ); + _DICT.put( 34067, 38560 ); + _DICT.put( 34068, 58615 ); + _DICT.put( 34069, 58614 ); + _DICT.put( 34071, 58610 ); + _DICT.put( 34072, 58611 ); + _DICT.put( 34074, 35157 ); + _DICT.put( 34079, 58613 ); + _DICT.put( 34081, 58607 ); + _DICT.put( 34086, 37587 ); + _DICT.put( 34092, 58612 ); + _DICT.put( 34093, 35068 ); + _DICT.put( 34101, 37280 ); + _DICT.put( 34109, 38337 ); + _DICT.put( 34112, 58617 ); + _DICT.put( 34113, 58688 ); + _DICT.put( 34115, 38103 ); + _DICT.put( 34120, 58620 ); + _DICT.put( 34121, 36820 ); + _DICT.put( 34122, 36551 ); + _DICT.put( 34123, 58690 ); + _DICT.put( 34126, 35772 ); + _DICT.put( 34131, 64410 ); + _DICT.put( 34133, 58691 ); + _DICT.put( 34135, 38297 ); + _DICT.put( 34136, 58619 ); + _DICT.put( 34137, 64411 ); + _DICT.put( 34138, 58580 ); + _DICT.put( 34147, 58618 ); + _DICT.put( 34152, 39022 ); + _DICT.put( 34153, 37792 ); + _DICT.put( 34154, 38291 ); + _DICT.put( 34155, 64412 ); + _DICT.put( 34157, 58698 ); + _DICT.put( 34167, 58704 ); + _DICT.put( 34174, 58705 ); + _DICT.put( 34176, 58692 ); + _DICT.put( 34180, 38038 ); + _DICT.put( 34183, 58702 ); + _DICT.put( 34184, 58694 ); + _DICT.put( 34186, 58696 ); + _DICT.put( 34192, 58706 ); + _DICT.put( 34193, 58695 ); + _DICT.put( 34196, 58699 ); + _DICT.put( 34199, 35218 ); + _DICT.put( 34201, 37859 ); + _DICT.put( 34203, 58700 ); + _DICT.put( 34204, 58703 ); + _DICT.put( 34212, 58693 ); + _DICT.put( 34214, 37189 ); + _DICT.put( 34216, 58697 ); + _DICT.put( 34217, 36422 ); + _DICT.put( 34218, 36964 ); + _DICT.put( 34219, 35919 ); + _DICT.put( 34220, 38642 ); + _DICT.put( 34222, 38647 ); + _DICT.put( 34223, 36754 ); + _DICT.put( 34224, 64414 ); + _DICT.put( 34233, 58710 ); + _DICT.put( 34234, 58708 ); + _DICT.put( 34241, 39021 ); + _DICT.put( 34249, 58707 ); + _DICT.put( 34253, 38805 ); + _DICT.put( 34255, 58709 ); + _DICT.put( 34256, 58711 ); + _DICT.put( 34261, 58712 ); + _DICT.put( 34268, 58715 ); + _DICT.put( 34269, 58713 ); + _DICT.put( 34276, 37793 ); + _DICT.put( 34277, 58714 ); + _DICT.put( 34281, 38091 ); + _DICT.put( 34282, 58701 ); + _DICT.put( 34295, 36755 ); + _DICT.put( 34297, 58716 ); + _DICT.put( 34298, 58721 ); + _DICT.put( 34299, 37268 ); + _DICT.put( 34302, 58720 ); + _DICT.put( 34306, 58689 ); + _DICT.put( 34310, 58722 ); + _DICT.put( 34311, 37224 ); + _DICT.put( 34314, 58717 ); + _DICT.put( 34315, 58719 ); + _DICT.put( 34323, 58718 ); + _DICT.put( 34326, 40784 ); + _DICT.put( 34327, 40769 ); + _DICT.put( 34330, 58724 ); + _DICT.put( 34338, 58723 ); + _DICT.put( 34349, 38806 ); + _DICT.put( 34351, 57786 ); + _DICT.put( 34352, 58725 ); + _DICT.put( 34367, 58726 ); + _DICT.put( 34381, 58727 ); + _DICT.put( 34382, 36053 ); + _DICT.put( 34384, 35699 ); + _DICT.put( 34388, 58729 ); + _DICT.put( 34389, 39292 ); + _DICT.put( 34394, 35733 ); + _DICT.put( 34396, 38840 ); + _DICT.put( 34398, 35825 ); + _DICT.put( 34399, 58730 ); + _DICT.put( 34407, 58731 ); + _DICT.put( 34411, 37518 ); + _DICT.put( 34417, 58732 ); + _DICT.put( 34425, 37880 ); + _DICT.put( 34427, 35000 ); + _DICT.put( 34442, 35297 ); + _DICT.put( 34443, 58737 ); + _DICT.put( 34444, 58738 ); + _DICT.put( 34451, 58733 ); + _DICT.put( 34453, 36444 ); + _DICT.put( 34467, 58734 ); + _DICT.put( 34468, 37985 ); + _DICT.put( 34473, 58735 ); + _DICT.put( 34474, 58736 ); + _DICT.put( 34475, 58746 ); + _DICT.put( 34479, 58740 ); + _DICT.put( 34480, 58743 ); + _DICT.put( 34486, 58739 ); + _DICT.put( 34500, 58741 ); + _DICT.put( 34502, 58742 ); + _DICT.put( 34503, 36566 ); + _DICT.put( 34505, 58744 ); + _DICT.put( 34507, 37472 ); + _DICT.put( 34509, 35957 ); + _DICT.put( 34510, 35425 ); + _DICT.put( 34516, 58747 ); + _DICT.put( 34521, 35422 ); + _DICT.put( 34523, 58753 ); + _DICT.put( 34526, 58748 ); + _DICT.put( 34527, 58752 ); + _DICT.put( 34532, 38072 ); + _DICT.put( 34537, 58749 ); + _DICT.put( 34540, 58750 ); + _DICT.put( 34541, 38247 ); + _DICT.put( 34542, 38104 ); + _DICT.put( 34543, 58754 ); + _DICT.put( 34552, 37371 ); + _DICT.put( 34553, 58764 ); + _DICT.put( 34555, 58760 ); + _DICT.put( 34558, 35305 ); + _DICT.put( 34560, 58758 ); + _DICT.put( 34562, 38473 ); + _DICT.put( 34563, 58759 ); + _DICT.put( 34566, 58756 ); + _DICT.put( 34568, 58757 ); + _DICT.put( 34569, 58762 ); + _DICT.put( 34570, 58765 ); + _DICT.put( 34573, 58763 ); + _DICT.put( 34577, 58761 ); + _DICT.put( 34578, 58755 ); + _DICT.put( 34584, 37495 ); + _DICT.put( 34586, 58772 ); + _DICT.put( 34588, 38568 ); + _DICT.put( 34597, 58770 ); + _DICT.put( 34601, 58771 ); + _DICT.put( 34612, 58766 ); + _DICT.put( 34615, 58768 ); + _DICT.put( 34619, 58769 ); + _DICT.put( 34623, 58767 ); + _DICT.put( 34633, 37092 ); + _DICT.put( 34635, 39000 ); + _DICT.put( 34636, 58776 ); + _DICT.put( 34638, 58777 ); + _DICT.put( 34643, 58783 ); + _DICT.put( 34645, 36937 ); + _DICT.put( 34647, 58779 ); + _DICT.put( 34649, 58782 ); + _DICT.put( 34655, 58774 ); + _DICT.put( 34656, 58773 ); + _DICT.put( 34659, 58784 ); + _DICT.put( 34662, 35290 ); + _DICT.put( 34664, 58780 ); + _DICT.put( 34666, 58785 ); + _DICT.put( 34670, 58781 ); + _DICT.put( 34676, 58778 ); + _DICT.put( 34678, 37553 ); + _DICT.put( 34680, 58775 ); + _DICT.put( 34687, 38024 ); + _DICT.put( 34690, 58789 ); + _DICT.put( 34701, 38746 ); + _DICT.put( 34719, 58788 ); + _DICT.put( 34722, 58787 ); + _DICT.put( 34731, 58796 ); + _DICT.put( 34735, 58790 ); + _DICT.put( 34739, 58798 ); + _DICT.put( 34746, 38790 ); + _DICT.put( 34747, 58801 ); + _DICT.put( 34749, 58792 ); + _DICT.put( 34752, 58793 ); + _DICT.put( 34756, 58797 ); + _DICT.put( 34758, 58800 ); + _DICT.put( 34759, 58799 ); + _DICT.put( 34763, 58791 ); + _DICT.put( 34768, 58794 ); + _DICT.put( 34770, 58811 ); + _DICT.put( 34784, 58804 ); + _DICT.put( 34799, 58802 ); + _DICT.put( 34802, 58803 ); + _DICT.put( 34806, 58808 ); + _DICT.put( 34807, 58809 ); + _DICT.put( 34809, 35401 ); + _DICT.put( 34811, 35681 ); + _DICT.put( 34814, 58807 ); + _DICT.put( 34821, 58786 ); + _DICT.put( 34823, 64417 ); + _DICT.put( 34829, 58806 ); + _DICT.put( 34830, 58810 ); + _DICT.put( 34831, 58805 ); + _DICT.put( 34833, 58812 ); + _DICT.put( 34837, 58814 ); + _DICT.put( 34838, 58813 ); + _DICT.put( 34849, 58816 ); + _DICT.put( 34850, 58815 ); + _DICT.put( 34851, 58745 ); + _DICT.put( 34855, 58820 ); + _DICT.put( 34865, 58817 ); + _DICT.put( 34870, 58818 ); + _DICT.put( 34873, 58819 ); + _DICT.put( 34875, 58821 ); + _DICT.put( 34880, 35980 ); + _DICT.put( 34882, 58823 ); + _DICT.put( 34884, 58822 ); + _DICT.put( 34886, 36687 ); + _DICT.put( 34892, 36211 ); + _DICT.put( 34893, 40869 ); + _DICT.put( 34898, 58824 ); + _DICT.put( 34899, 36720 ); + _DICT.put( 34903, 35416 ); + _DICT.put( 34905, 58825 ); + _DICT.put( 34907, 35185 ); + _DICT.put( 34909, 36821 ); + _DICT.put( 34910, 58826 ); + _DICT.put( 34913, 36212 ); + _DICT.put( 34914, 58827 ); + _DICT.put( 34915, 35039 ); + _DICT.put( 34920, 38236 ); + _DICT.put( 34923, 58828 ); + _DICT.put( 34928, 37002 ); + _DICT.put( 34930, 58835 ); + _DICT.put( 34933, 58832 ); + _DICT.put( 34935, 37519 ); + _DICT.put( 34941, 58833 ); + _DICT.put( 34942, 58830 ); + _DICT.put( 34943, 35804 ); + _DICT.put( 34945, 58829 ); + _DICT.put( 34946, 58836 ); + _DICT.put( 34952, 35925 ); + _DICT.put( 34955, 37340 ); + _DICT.put( 34957, 58842 ); + _DICT.put( 34962, 58838 ); + _DICT.put( 34966, 37299 ); + _DICT.put( 34967, 58837 ); + _DICT.put( 34969, 58840 ); + _DICT.put( 34974, 58831 ); + _DICT.put( 34978, 58841 ); + _DICT.put( 34980, 58843 ); + _DICT.put( 34987, 38125 ); + _DICT.put( 34990, 58839 ); + _DICT.put( 34992, 58844 ); + _DICT.put( 34993, 58846 ); + _DICT.put( 34996, 36049 ); + _DICT.put( 34997, 58834 ); + _DICT.put( 34999, 35007 ); + _DICT.put( 35007, 58845 ); + _DICT.put( 35009, 36313 ); + _DICT.put( 35010, 38900 ); + _DICT.put( 35011, 58847 ); + _DICT.put( 35012, 58848 ); + _DICT.put( 35013, 37269 ); + _DICT.put( 35023, 38816 ); + _DICT.put( 35028, 58849 ); + _DICT.put( 35029, 38740 ); + _DICT.put( 35032, 58850 ); + _DICT.put( 35033, 58851 ); + _DICT.put( 35036, 38370 ); + _DICT.put( 35037, 58852 ); + _DICT.put( 35039, 36286 ); + _DICT.put( 35041, 38817 ); + _DICT.put( 35048, 58857 ); + _DICT.put( 35058, 58858 ); + _DICT.put( 35059, 36822 ); + _DICT.put( 35060, 58856 ); + _DICT.put( 35061, 64418 ); + _DICT.put( 35064, 38791 ); + _DICT.put( 35065, 58853 ); + _DICT.put( 35068, 58855 ); + _DICT.put( 35069, 37051 ); + _DICT.put( 35070, 37022 ); + _DICT.put( 35074, 58854 ); + _DICT.put( 35076, 58859 ); + _DICT.put( 35079, 38305 ); + _DICT.put( 35082, 58861 ); + _DICT.put( 35084, 58860 ); + _DICT.put( 35088, 35468 ); + _DICT.put( 35090, 38474 ); + _DICT.put( 35091, 58862 ); + _DICT.put( 35100, 64093 ); + _DICT.put( 35101, 58874 ); + _DICT.put( 35102, 58864 ); + _DICT.put( 35109, 58865 ); + _DICT.put( 35114, 58866 ); + _DICT.put( 35115, 58867 ); + _DICT.put( 35126, 58871 ); + _DICT.put( 35128, 58872 ); + _DICT.put( 35131, 58870 ); + _DICT.put( 35137, 58868 ); + _DICT.put( 35139, 58863 ); + _DICT.put( 35140, 58869 ); + _DICT.put( 35148, 58873 ); + _DICT.put( 35149, 59573 ); + _DICT.put( 35158, 35238 ); + _DICT.put( 35166, 58876 ); + _DICT.put( 35167, 35805 ); + _DICT.put( 35168, 58875 ); + _DICT.put( 35172, 58945 ); + _DICT.put( 35174, 58944 ); + _DICT.put( 35178, 58947 ); + _DICT.put( 35181, 58946 ); + _DICT.put( 35183, 58948 ); + _DICT.put( 35186, 36688 ); + _DICT.put( 35188, 58949 ); + _DICT.put( 35191, 58950 ); + _DICT.put( 35198, 58951 ); + _DICT.put( 35199, 37052 ); + _DICT.put( 35201, 38774 ); + _DICT.put( 35203, 58952 ); + _DICT.put( 35206, 38306 ); + _DICT.put( 35207, 37989 ); + _DICT.put( 35208, 58953 ); + _DICT.put( 35210, 58954 ); + _DICT.put( 35211, 36009 ); + _DICT.put( 35215, 35659 ); + _DICT.put( 35219, 58955 ); + _DICT.put( 35222, 36491 ); + _DICT.put( 35223, 37984 ); + _DICT.put( 35224, 58956 ); + _DICT.put( 35226, 35439 ); + _DICT.put( 35233, 58957 ); + _DICT.put( 35238, 58959 ); + _DICT.put( 35239, 38807 ); + _DICT.put( 35241, 58958 ); + _DICT.put( 35242, 36965 ); + _DICT.put( 35244, 58960 ); + _DICT.put( 35247, 58961 ); + _DICT.put( 35250, 58962 ); + _DICT.put( 35251, 35535 ); + _DICT.put( 35258, 58963 ); + _DICT.put( 35261, 58964 ); + _DICT.put( 35263, 58965 ); + _DICT.put( 35264, 58966 ); + _DICT.put( 35282, 35440 ); + _DICT.put( 35290, 58967 ); + _DICT.put( 35292, 58968 ); + _DICT.put( 35293, 58969 ); + _DICT.put( 35299, 35312 ); + _DICT.put( 35302, 36935 ); + _DICT.put( 35303, 58970 ); + _DICT.put( 35316, 58971 ); + _DICT.put( 35320, 58972 ); + _DICT.put( 35328, 36030 ); + _DICT.put( 35330, 37625 ); + _DICT.put( 35331, 58973 ); + _DICT.put( 35336, 35958 ); + _DICT.put( 35338, 36981 ); + _DICT.put( 35340, 58976 ); + _DICT.put( 35342, 37794 ); + _DICT.put( 35344, 58975 ); + _DICT.put( 35346, 64419 ); + _DICT.put( 35347, 35920 ); + _DICT.put( 35350, 58974 ); + _DICT.put( 35351, 37365 ); + _DICT.put( 35352, 35660 ); + _DICT.put( 35355, 58977 ); + _DICT.put( 35357, 58978 ); + _DICT.put( 35359, 36823 ); + _DICT.put( 35363, 35981 ); + _DICT.put( 35365, 58979 ); + _DICT.put( 35370, 38475 ); + _DICT.put( 35373, 37085 ); + _DICT.put( 35377, 35734 ); + _DICT.put( 35379, 38643 ); + _DICT.put( 35380, 37225 ); + _DICT.put( 35382, 58980 ); + _DICT.put( 35383, 64420 ); + _DICT.put( 35386, 36966 ); + _DICT.put( 35387, 37520 ); + _DICT.put( 35388, 36824 ); + _DICT.put( 35393, 58981 ); + _DICT.put( 35398, 58984 ); + _DICT.put( 35400, 58985 ); + _DICT.put( 35408, 36284 ); + _DICT.put( 35409, 37312 ); + _DICT.put( 35410, 58983 ); + _DICT.put( 35412, 36825 ); + _DICT.put( 35413, 38237 ); + _DICT.put( 35419, 58982 ); + _DICT.put( 35422, 36492 ); + _DICT.put( 35424, 35186 ); + _DICT.put( 35426, 58989 ); + _DICT.put( 35427, 35959 ); + _DICT.put( 35430, 36494 ); + _DICT.put( 35433, 36493 ); + _DICT.put( 35435, 39020 ); + _DICT.put( 35436, 58988 ); + _DICT.put( 35437, 58987 ); + _DICT.put( 35438, 37190 ); + _DICT.put( 35440, 35692 ); + _DICT.put( 35441, 39010 ); + _DICT.put( 35442, 35417 ); + _DICT.put( 35443, 36826 ); + _DICT.put( 35449, 64421 ); + _DICT.put( 35452, 58986 ); + _DICT.put( 35458, 58991 ); + _DICT.put( 35460, 58992 ); + _DICT.put( 35461, 58990 ); + _DICT.put( 35463, 36054 ); + _DICT.put( 35465, 38751 ); + _DICT.put( 35468, 36495 ); + _DICT.put( 35469, 37958 ); + _DICT.put( 35473, 58995 ); + _DICT.put( 35475, 37054 ); + _DICT.put( 35477, 37473 ); + _DICT.put( 35480, 38741 ); + _DICT.put( 35482, 58998 ); + _DICT.put( 35486, 36074 ); + _DICT.put( 35488, 37053 ); + _DICT.put( 35489, 58994 ); + _DICT.put( 35491, 58999 ); + _DICT.put( 35492, 36075 ); + _DICT.put( 35493, 58996 ); + _DICT.put( 35494, 58997 ); + _DICT.put( 35495, 64422 ); + _DICT.put( 35496, 58993 ); + _DICT.put( 35500, 37088 ); + _DICT.put( 35501, 37831 ); + _DICT.put( 35504, 37454 ); + _DICT.put( 35506, 35291 ); + _DICT.put( 35513, 38126 ); + _DICT.put( 35516, 35682 ); + _DICT.put( 35518, 64423 ); + _DICT.put( 35519, 37554 ); + _DICT.put( 35522, 59002 ); + _DICT.put( 35524, 59000 ); + _DICT.put( 35527, 37483 ); + _DICT.put( 35531, 37055 ); + _DICT.put( 35532, 35536 ); + _DICT.put( 35533, 59001 ); + _DICT.put( 35535, 36986 ); + _DICT.put( 35538, 38856 ); + _DICT.put( 35542, 39007 ); + _DICT.put( 35546, 59003 ); + _DICT.put( 35547, 59015 ); + _DICT.put( 35548, 37555 ); + _DICT.put( 35550, 59014 ); + _DICT.put( 35551, 64424 ); + _DICT.put( 35552, 59011 ); + _DICT.put( 35553, 59019 ); + _DICT.put( 35554, 59012 ); + _DICT.put( 35556, 59008 ); + _DICT.put( 35558, 37626 ); + _DICT.put( 35559, 59006 ); + _DICT.put( 35563, 59004 ); + _DICT.put( 35565, 38720 ); + _DICT.put( 35566, 36496 ); + _DICT.put( 35569, 59009 ); + _DICT.put( 35571, 59005 ); + _DICT.put( 35574, 64426 ); + _DICT.put( 35575, 59013 ); + _DICT.put( 35576, 36756 ); + _DICT.put( 35578, 36031 ); + _DICT.put( 35582, 37368 ); + _DICT.put( 35584, 38500 ); + _DICT.put( 35585, 35193 ); + _DICT.put( 35586, 35040 ); + _DICT.put( 35588, 37795 ); + _DICT.put( 35591, 59017 ); + _DICT.put( 35596, 59016 ); + _DICT.put( 35598, 37860 ); + _DICT.put( 35600, 59021 ); + _DICT.put( 35604, 59010 ); + _DICT.put( 35606, 59020 ); + _DICT.put( 35607, 59022 ); + _DICT.put( 35609, 36010 ); + _DICT.put( 35610, 59018 ); + _DICT.put( 35611, 36213 ); + _DICT.put( 35613, 36563 ); + _DICT.put( 35616, 59023 ); + _DICT.put( 35617, 38775 ); + _DICT.put( 35622, 59026 ); + _DICT.put( 35624, 59029 ); + _DICT.put( 35627, 59027 ); + _DICT.put( 35628, 38228 ); + _DICT.put( 35635, 59024 ); + _DICT.put( 35641, 35806 ); + _DICT.put( 35646, 59028 ); + _DICT.put( 35649, 59030 ); + _DICT.put( 35657, 59034 ); + _DICT.put( 35660, 59031 ); + _DICT.put( 35662, 59033 ); + _DICT.put( 35663, 59032 ); + _DICT.put( 35667, 64427 ); + _DICT.put( 35670, 59035 ); + _DICT.put( 35672, 36527 ); + _DICT.put( 35674, 59037 ); + _DICT.put( 35675, 59036 ); + _DICT.put( 35676, 38280 ); + _DICT.put( 35679, 59039 ); + _DICT.put( 35686, 35960 ); + _DICT.put( 35691, 59038 ); + _DICT.put( 35692, 59040 ); + _DICT.put( 35695, 59041 ); + _DICT.put( 35696, 35683 ); + _DICT.put( 35697, 58303 ); + _DICT.put( 35698, 36855 ); + _DICT.put( 35700, 59042 ); + _DICT.put( 35703, 36076 ); + _DICT.put( 35709, 59043 ); + _DICT.put( 35711, 64428 ); + _DICT.put( 35712, 59044 ); + _DICT.put( 35715, 36445 ); + _DICT.put( 35722, 40396 ); + _DICT.put( 35724, 59045 ); + _DICT.put( 35726, 59046 ); + _DICT.put( 35728, 36689 ); + _DICT.put( 35730, 59047 ); + _DICT.put( 35731, 59048 ); + _DICT.put( 35734, 59049 ); + _DICT.put( 35737, 59050 ); + _DICT.put( 35738, 59051 ); + _DICT.put( 35895, 37450 ); + _DICT.put( 35898, 59052 ); + _DICT.put( 35903, 59054 ); + _DICT.put( 35905, 59053 ); + _DICT.put( 35910, 37796 ); + _DICT.put( 35912, 59055 ); + _DICT.put( 35914, 38476 ); + _DICT.put( 35916, 59056 ); + _DICT.put( 35918, 59057 ); + _DICT.put( 35920, 59058 ); + _DICT.put( 35925, 59059 ); + _DICT.put( 35930, 37848 ); + _DICT.put( 35937, 36827 ); + _DICT.put( 35938, 59060 ); + _DICT.put( 35946, 36235 ); + _DICT.put( 35947, 39084 ); + _DICT.put( 35948, 59061 ); + _DICT.put( 35960, 59062 ); + _DICT.put( 35961, 38238 ); + _DICT.put( 35962, 59063 ); + _DICT.put( 35964, 59071 ); + _DICT.put( 35970, 59064 ); + _DICT.put( 35973, 59066 ); + _DICT.put( 35977, 59065 ); + _DICT.put( 35978, 59067 ); + _DICT.put( 35980, 38501 ); + _DICT.put( 35981, 59068 ); + _DICT.put( 35982, 59069 ); + _DICT.put( 35988, 59070 ); + _DICT.put( 35992, 59072 ); + _DICT.put( 35997, 35404 ); + m_initialized = true; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_c.java b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_c.java new file mode 100644 index 0000000..b51facf --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/cp932_c.java @@ -0,0 +1,3433 @@ +/* + * cp932_c.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.bocoree + * + * jp.sourceforge.lipsync.bocoree is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.bocoree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.bocoree; + +import java.util.*; + +public class cp932_c { + private static HashMap _DICT = new HashMap(); + private static boolean m_initialized = false; + + public static int getMinKey() { + return 35998; + } + + public static int getMaxKey() { + return 65509; + } + + public static int get( int key ) { + if( !m_initialized ){ + init(); + } + if ( _DICT.containsKey( key ) ) { + return ((Integer) _DICT.get( key )).intValue(); + } else { + return -1; + } + } + + private static void init() { + _DICT.put( 35998, 37605 ); + _DICT.put( 36000, 38281 ); + _DICT.put( 36001, 36320 ); + _DICT.put( 36002, 36214 ); + _DICT.put( 36007, 38254 ); + _DICT.put( 36008, 35293 ); + _DICT.put( 36009, 38092 ); + _DICT.put( 36010, 59075 ); + _DICT.put( 36011, 35537 ); + _DICT.put( 36012, 37075 ); + _DICT.put( 36013, 59074 ); + _DICT.put( 36014, 59079 ); + _DICT.put( 36015, 37529 ); + _DICT.put( 36016, 38625 ); + _DICT.put( 36018, 59077 ); + _DICT.put( 36019, 59078 ); + _DICT.put( 36020, 35661 ); + _DICT.put( 36022, 59080 ); + _DICT.put( 36023, 38019 ); + _DICT.put( 36024, 37341 ); + _DICT.put( 36027, 38127 ); + _DICT.put( 36028, 37724 ); + _DICT.put( 36029, 59076 ); + _DICT.put( 36031, 38502 ); + _DICT.put( 36032, 35306 ); + _DICT.put( 36033, 59082 ); + _DICT.put( 36034, 38983 ); + _DICT.put( 36035, 37568 ); + _DICT.put( 36036, 39012 ); + _DICT.put( 36039, 36497 ); + _DICT.put( 36040, 59081 ); + _DICT.put( 36042, 37295 ); + _DICT.put( 36045, 59098 ); + _DICT.put( 36046, 37191 ); + _DICT.put( 36049, 37878 ); + _DICT.put( 36051, 38255 ); + _DICT.put( 36058, 59085 ); + _DICT.put( 36059, 36446 ); + _DICT.put( 36060, 36498 ); + _DICT.put( 36062, 36828 ); + _DICT.put( 36064, 38021 ); + _DICT.put( 36066, 36011 ); + _DICT.put( 36067, 59084 ); + _DICT.put( 36068, 59083 ); + _DICT.put( 36070, 38282 ); + _DICT.put( 36074, 36543 ); + _DICT.put( 36077, 37745 ); + _DICT.put( 36080, 64429 ); + _DICT.put( 36084, 64430 ); + _DICT.put( 36090, 59087 ); + _DICT.put( 36091, 59088 ); + _DICT.put( 36092, 36215 ); + _DICT.put( 36093, 59086 ); + _DICT.put( 36100, 59089 ); + _DICT.put( 36101, 59090 ); + _DICT.put( 36103, 59092 ); + _DICT.put( 36104, 37281 ); + _DICT.put( 36106, 59091 ); + _DICT.put( 36107, 35556 ); + _DICT.put( 36109, 59094 ); + _DICT.put( 36111, 59093 ); + _DICT.put( 36112, 59095 ); + _DICT.put( 36114, 64431 ); + _DICT.put( 36115, 59097 ); + _DICT.put( 36116, 59099 ); + _DICT.put( 36118, 59100 ); + _DICT.put( 36196, 37076 ); + _DICT.put( 36198, 36557 ); + _DICT.put( 36199, 59101 ); + _DICT.put( 36203, 35441 ); + _DICT.put( 36205, 59102 ); + _DICT.put( 36208, 37270 ); + _DICT.put( 36209, 59103 ); + _DICT.put( 36211, 59104 ); + _DICT.put( 36212, 38283 ); + _DICT.put( 36214, 64432 ); + _DICT.put( 36215, 35662 ); + _DICT.put( 36225, 59105 ); + _DICT.put( 36229, 37556 ); + _DICT.put( 36234, 35194 ); + _DICT.put( 36249, 59106 ); + _DICT.put( 36259, 36591 ); + _DICT.put( 36264, 37014 ); + _DICT.put( 36275, 37291 ); + _DICT.put( 36282, 59109 ); + _DICT.put( 36286, 59108 ); + _DICT.put( 36290, 59107 ); + _DICT.put( 36299, 59115 ); + _DICT.put( 36300, 59113 ); + _DICT.put( 36303, 59110 ); + _DICT.put( 36310, 59112 ); + _DICT.put( 36314, 59111 ); + _DICT.put( 36315, 59114 ); + _DICT.put( 36317, 35735 ); + _DICT.put( 36319, 59118 ); + _DICT.put( 36321, 37077 ); + _DICT.put( 36323, 59119 ); + _DICT.put( 36328, 36055 ); + _DICT.put( 36330, 59116 ); + _DICT.put( 36331, 59117 ); + _DICT.put( 36335, 38984 ); + _DICT.put( 36339, 37557 ); + _DICT.put( 36341, 37192 ); + _DICT.put( 36348, 59120 ); + _DICT.put( 36351, 59123 ); + _DICT.put( 36360, 59121 ); + _DICT.put( 36361, 59122 ); + _DICT.put( 36362, 38776 ); + _DICT.put( 36367, 37797 ); + _DICT.put( 36368, 59126 ); + _DICT.put( 36381, 59124 ); + _DICT.put( 36382, 59125 ); + _DICT.put( 36383, 59127 ); + _DICT.put( 36394, 59208 ); + _DICT.put( 36400, 59130 ); + _DICT.put( 36404, 59131 ); + _DICT.put( 36405, 59129 ); + _DICT.put( 36418, 59128 ); + _DICT.put( 36420, 37627 ); + _DICT.put( 36423, 59200 ); + _DICT.put( 36424, 59204 ); + _DICT.put( 36425, 59201 ); + _DICT.put( 36426, 59132 ); + _DICT.put( 36428, 59202 ); + _DICT.put( 36432, 59203 ); + _DICT.put( 36437, 59210 ); + _DICT.put( 36441, 59205 ); + _DICT.put( 36447, 37078 ); + _DICT.put( 36448, 59207 ); + _DICT.put( 36451, 59209 ); + _DICT.put( 36452, 59206 ); + _DICT.put( 36466, 59212 ); + _DICT.put( 36468, 36690 ); + _DICT.put( 36470, 59211 ); + _DICT.put( 36476, 59213 ); + _DICT.put( 36481, 59214 ); + _DICT.put( 36484, 59217 ); + _DICT.put( 36485, 59216 ); + _DICT.put( 36487, 59215 ); + _DICT.put( 36490, 59219 ); + _DICT.put( 36491, 59218 ); + _DICT.put( 36493, 38644 ); + _DICT.put( 36497, 59221 ); + _DICT.put( 36499, 59220 ); + _DICT.put( 36500, 59222 ); + _DICT.put( 36505, 59223 ); + _DICT.put( 36513, 59225 ); + _DICT.put( 36522, 59224 ); + _DICT.put( 36523, 36967 ); + _DICT.put( 36524, 59226 ); + _DICT.put( 36527, 35819 ); + _DICT.put( 36528, 59227 ); + _DICT.put( 36529, 59229 ); + _DICT.put( 36542, 59230 ); + _DICT.put( 36549, 59231 ); + _DICT.put( 36550, 59228 ); + _DICT.put( 36552, 59232 ); + _DICT.put( 36554, 36564 ); + _DICT.put( 36555, 59233 ); + _DICT.put( 36556, 35663 ); + _DICT.put( 36557, 35922 ); + _DICT.put( 36559, 64434 ); + _DICT.put( 36562, 36012 ); + _DICT.put( 36571, 59234 ); + _DICT.put( 36575, 37870 ); + _DICT.put( 36578, 37725 ); + _DICT.put( 36579, 59235 ); + _DICT.put( 36587, 59238 ); + _DICT.put( 36600, 36530 ); + _DICT.put( 36603, 59237 ); + _DICT.put( 36604, 59236 ); + _DICT.put( 36605, 35961 ); + _DICT.put( 36606, 59239 ); + _DICT.put( 36611, 35442 ); + _DICT.put( 36613, 59241 ); + _DICT.put( 36617, 36314 ); + _DICT.put( 36618, 59240 ); + _DICT.put( 36620, 59249 ); + _DICT.put( 36626, 59243 ); + _DICT.put( 36627, 59245 ); + _DICT.put( 36628, 38371 ); + _DICT.put( 36629, 59242 ); + _DICT.put( 36633, 59244 ); + _DICT.put( 36635, 59248 ); + _DICT.put( 36636, 59246 ); + _DICT.put( 36637, 35664 ); + _DICT.put( 36639, 59247 ); + _DICT.put( 36646, 59250 ); + _DICT.put( 36649, 38009 ); + _DICT.put( 36650, 38870 ); + _DICT.put( 36655, 36691 ); + _DICT.put( 36659, 59251 ); + _DICT.put( 36664, 38721 ); + _DICT.put( 36665, 59253 ); + _DICT.put( 36667, 59252 ); + _DICT.put( 36670, 59256 ); + _DICT.put( 36671, 38752 ); + _DICT.put( 36674, 59255 ); + _DICT.put( 36676, 35469 ); + _DICT.put( 36677, 59254 ); + _DICT.put( 36678, 59259 ); + _DICT.put( 36681, 59258 ); + _DICT.put( 36684, 59257 ); + _DICT.put( 36685, 37713 ); + _DICT.put( 36686, 59260 ); + _DICT.put( 36695, 59261 ); + _DICT.put( 36700, 59262 ); + _DICT.put( 36703, 36236 ); + _DICT.put( 36705, 35908 ); + _DICT.put( 36706, 59264 ); + _DICT.put( 36707, 59265 ); + _DICT.put( 36708, 59266 ); + _DICT.put( 36763, 36968 ); + _DICT.put( 36764, 59267 ); + _DICT.put( 36766, 36523 ); + _DICT.put( 36767, 59268 ); + _DICT.put( 36771, 59269 ); + _DICT.put( 36775, 39327 ); + _DICT.put( 36776, 39326 ); + _DICT.put( 36781, 59270 ); + _DICT.put( 36782, 58256 ); + _DICT.put( 36783, 59271 ); + _DICT.put( 36784, 37443 ); + _DICT.put( 36785, 36938 ); + _DICT.put( 36786, 37983 ); + _DICT.put( 36791, 59272 ); + _DICT.put( 36794, 38355 ); + _DICT.put( 36795, 37586 ); + _DICT.put( 36796, 36254 ); + _DICT.put( 36799, 37448 ); + _DICT.put( 36802, 35145 ); + _DICT.put( 36804, 38552 ); + _DICT.put( 36805, 36982 ); + _DICT.put( 36814, 35965 ); + _DICT.put( 36817, 35807 ); + _DICT.put( 36820, 38356 ); + _DICT.put( 36826, 59273 ); + _DICT.put( 36834, 59275 ); + _DICT.put( 36837, 59274 ); + _DICT.put( 36838, 35294 ); + _DICT.put( 36841, 37876 ); + _DICT.put( 36842, 59276 ); + _DICT.put( 36843, 38039 ); + _DICT.put( 36845, 37714 ); + _DICT.put( 36847, 59277 ); + _DICT.put( 36848, 36721 ); + _DICT.put( 36852, 59279 ); + _DICT.put( 36855, 38592 ); + _DICT.put( 36856, 59294 ); + _DICT.put( 36857, 59281 ); + _DICT.put( 36858, 59282 ); + _DICT.put( 36861, 37575 ); + _DICT.put( 36864, 37342 ); + _DICT.put( 36865, 37271 ); + _DICT.put( 36867, 37798 ); + _DICT.put( 36869, 59280 ); + _DICT.put( 36870, 35700 ); + _DICT.put( 36875, 59289 ); + _DICT.put( 36877, 59286 ); + _DICT.put( 36878, 59299 ); + _DICT.put( 36879, 37799 ); + _DICT.put( 36880, 37504 ); + _DICT.put( 36881, 59283 ); + _DICT.put( 36883, 37628 ); + _DICT.put( 36884, 37746 ); + _DICT.put( 36885, 59284 ); + _DICT.put( 36886, 59288 ); + _DICT.put( 36887, 36992 ); + _DICT.put( 36889, 38023 ); + _DICT.put( 36890, 37578 ); + _DICT.put( 36893, 37056 ); + _DICT.put( 36894, 59287 ); + _DICT.put( 36895, 37292 ); + _DICT.put( 36896, 37282 ); + _DICT.put( 36897, 59285 ); + _DICT.put( 36898, 34983 ); + _DICT.put( 36899, 38977 ); + _DICT.put( 36903, 59290 ); + _DICT.put( 36910, 37343 ); + _DICT.put( 36913, 36692 ); + _DICT.put( 36914, 36969 ); + _DICT.put( 36917, 59292 ); + _DICT.put( 36918, 59291 ); + _DICT.put( 36920, 35053 ); + _DICT.put( 36921, 59293 ); + _DICT.put( 36924, 38222 ); + _DICT.put( 36926, 59301 ); + _DICT.put( 36929, 37849 ); + _DICT.put( 36930, 37003 ); + _DICT.put( 36933, 37496 ); + _DICT.put( 36935, 35830 ); + _DICT.put( 36937, 59300 ); + _DICT.put( 36938, 38742 ); + _DICT.put( 36939, 35166 ); + _DICT.put( 36941, 38357 ); + _DICT.put( 36942, 35295 ); + _DICT.put( 36943, 59295 ); + _DICT.put( 36944, 59296 ); + _DICT.put( 36945, 59297 ); + _DICT.put( 36946, 59298 ); + _DICT.put( 36947, 37817 ); + _DICT.put( 36948, 37442 ); + _DICT.put( 36949, 35041 ); + _DICT.put( 36950, 59302 ); + _DICT.put( 36952, 59303 ); + _DICT.put( 36953, 60065 ); + _DICT.put( 36956, 37307 ); + _DICT.put( 36958, 59304 ); + _DICT.put( 36960, 35219 ); + _DICT.put( 36961, 37227 ); + _DICT.put( 36963, 36013 ); + _DICT.put( 36965, 38777 ); + _DICT.put( 36967, 64437 ); + _DICT.put( 36968, 59305 ); + _DICT.put( 36969, 37707 ); + _DICT.put( 36973, 37272 ); + _DICT.put( 36974, 36565 ); + _DICT.put( 36975, 59306 ); + _DICT.put( 36978, 59309 ); + _DICT.put( 36981, 36741 ); + _DICT.put( 36982, 59307 ); + _DICT.put( 36983, 37194 ); + _DICT.put( 36984, 37193 ); + _DICT.put( 36986, 35042 ); + _DICT.put( 36988, 38857 ); + _DICT.put( 36989, 59311 ); + _DICT.put( 36991, 38128 ); + _DICT.put( 36992, 59313 ); + _DICT.put( 36993, 59312 ); + _DICT.put( 36994, 59310 ); + _DICT.put( 36995, 57988 ); + _DICT.put( 36996, 35538 ); + _DICT.put( 36999, 59278 ); + _DICT.put( 37001, 59315 ); + _DICT.put( 37002, 59314 ); + _DICT.put( 37007, 59316 ); + _DICT.put( 37009, 38743 ); + _DICT.put( 37027, 37855 ); + _DICT.put( 37030, 38477 ); + _DICT.put( 37032, 59317 ); + _DICT.put( 37034, 36567 ); + _DICT.put( 37039, 59318 ); + _DICT.put( 37041, 59319 ); + _DICT.put( 37045, 59320 ); + _DICT.put( 37048, 37696 ); + _DICT.put( 37057, 35048 ); + _DICT.put( 37066, 36216 ); + _DICT.put( 37070, 39001 ); + _DICT.put( 37083, 59324 ); + _DICT.put( 37086, 64438 ); + _DICT.put( 37089, 35923 ); + _DICT.put( 37090, 59321 ); + _DICT.put( 37092, 59322 ); + _DICT.put( 37096, 38292 ); + _DICT.put( 37101, 35443 ); + _DICT.put( 37109, 38744 ); + _DICT.put( 37111, 35773 ); + _DICT.put( 37117, 37747 ); + _DICT.put( 37122, 59325 ); + _DICT.put( 37138, 59326 ); + _DICT.put( 37141, 64440 ); + _DICT.put( 37145, 59327 ); + _DICT.put( 37159, 64441 ); + _DICT.put( 37165, 37697 ); + _DICT.put( 37168, 59329 ); + _DICT.put( 37170, 59328 ); + _DICT.put( 37193, 37841 ); + _DICT.put( 37194, 59330 ); + _DICT.put( 37195, 36693 ); + _DICT.put( 37196, 36574 ); + _DICT.put( 37197, 38010 ); + _DICT.put( 37198, 37521 ); + _DICT.put( 37202, 36592 ); + _DICT.put( 37204, 37004 ); + _DICT.put( 37206, 59331 ); + _DICT.put( 37208, 59332 ); + _DICT.put( 37218, 36988 ); + _DICT.put( 37219, 59333 ); + _DICT.put( 37221, 59334 ); + _DICT.put( 37225, 59335 ); + _DICT.put( 37226, 38799 ); + _DICT.put( 37228, 36694 ); + _DICT.put( 37234, 59337 ); + _DICT.put( 37235, 59336 ); + _DICT.put( 37237, 36217 ); + _DICT.put( 37239, 36243 ); + _DICT.put( 37240, 36447 ); + _DICT.put( 37250, 59340 ); + _DICT.put( 37255, 36742 ); + _DICT.put( 37257, 59339 ); + _DICT.put( 37259, 59338 ); + _DICT.put( 37261, 37351 ); + _DICT.put( 37264, 36077 ); + _DICT.put( 37266, 37057 ); + _DICT.put( 37271, 38062 ); + _DICT.put( 37276, 36696 ); + _DICT.put( 37282, 59341 ); + _DICT.put( 37284, 36829 ); + _DICT.put( 37290, 59344 ); + _DICT.put( 37291, 59342 ); + _DICT.put( 37295, 59343 ); + _DICT.put( 37300, 59346 ); + _DICT.put( 37301, 59345 ); + _DICT.put( 37304, 36856 ); + _DICT.put( 37306, 59347 ); + _DICT.put( 37312, 59348 ); + _DICT.put( 37313, 59349 ); + _DICT.put( 37318, 38094 ); + _DICT.put( 37319, 36305 ); + _DICT.put( 37320, 36575 ); + _DICT.put( 37321, 59350 ); + _DICT.put( 37323, 59351 ); + _DICT.put( 37324, 38818 ); + _DICT.put( 37325, 36708 ); + _DICT.put( 37326, 38636 ); + _DICT.put( 37327, 38858 ); + _DICT.put( 37328, 59352 ); + _DICT.put( 37329, 35808 ); + _DICT.put( 37334, 59353 ); + _DICT.put( 37335, 64443 ); + _DICT.put( 37336, 37698 ); + _DICT.put( 37338, 64442 ); + _DICT.put( 37339, 59356 ); + _DICT.put( 37340, 35480 ); + _DICT.put( 37341, 36970 ); + _DICT.put( 37342, 64444 ); + _DICT.put( 37343, 59354 ); + _DICT.put( 37345, 59355 ); + _DICT.put( 37347, 37598 ); + _DICT.put( 37348, 64447 ); + _DICT.put( 37349, 64448 ); + _DICT.put( 37350, 38516 ); + _DICT.put( 37351, 35834 ); + _DICT.put( 37357, 64445 ); + _DICT.put( 37358, 64446 ); + _DICT.put( 37365, 59358 ); + _DICT.put( 37366, 59359 ); + _DICT.put( 37372, 59357 ); + _DICT.put( 37375, 59361 ); + _DICT.put( 37382, 64449 ); + _DICT.put( 37386, 64451 ); + _DICT.put( 37389, 37853 ); + _DICT.put( 37390, 35426 ); + _DICT.put( 37392, 64450 ); + _DICT.put( 37393, 59365 ); + _DICT.put( 37396, 59362 ); + _DICT.put( 37397, 59364 ); + _DICT.put( 37406, 59360 ); + _DICT.put( 37417, 59502 ); + _DICT.put( 37420, 59363 ); + _DICT.put( 37428, 38889 ); + _DICT.put( 37431, 36056 ); + _DICT.put( 37433, 64458 ); + _DICT.put( 37434, 64452 ); + _DICT.put( 37436, 64454 ); + _DICT.put( 37439, 59373 ); + _DICT.put( 37440, 64453 ); + _DICT.put( 37444, 37715 ); + _DICT.put( 37445, 59368 ); + _DICT.put( 37448, 59371 ); + _DICT.put( 37449, 59369 ); + _DICT.put( 37451, 59374 ); + _DICT.put( 37454, 64455 ); + _DICT.put( 37456, 59375 ); + _DICT.put( 37457, 64457 ); + _DICT.put( 37463, 59367 ); + _DICT.put( 37465, 64456 ); + _DICT.put( 37466, 59380 ); + _DICT.put( 37467, 35220 ); + _DICT.put( 37470, 59366 ); + _DICT.put( 37474, 38059 ); + _DICT.put( 37476, 59370 ); + _DICT.put( 37478, 36830 ); + _DICT.put( 37479, 64459 ); + _DICT.put( 37489, 36218 ); + _DICT.put( 37495, 64461 ); + _DICT.put( 37496, 64462 ); + _DICT.put( 37502, 38503 ); + _DICT.put( 37504, 35810 ); + _DICT.put( 37507, 36709 ); + _DICT.put( 37509, 37818 ); + _DICT.put( 37512, 64095 ); + _DICT.put( 37521, 37196 ); + _DICT.put( 37523, 59378 ); + _DICT.put( 37525, 59372 ); + _DICT.put( 37526, 59377 ); + _DICT.put( 37528, 38593 ); + _DICT.put( 37530, 37558 ); + _DICT.put( 37531, 59379 ); + _DICT.put( 37532, 59376 ); + _DICT.put( 37543, 64460 ); + _DICT.put( 37549, 37195 ); + _DICT.put( 37559, 59383 ); + _DICT.put( 37561, 59382 ); + _DICT.put( 37583, 59381 ); + _DICT.put( 37584, 64466 ); + _DICT.put( 37586, 38478 ); + _DICT.put( 37587, 64470 ); + _DICT.put( 37589, 64468 ); + _DICT.put( 37591, 64464 ); + _DICT.put( 37593, 64465 ); + _DICT.put( 37600, 64469 ); + _DICT.put( 37604, 36763 ); + _DICT.put( 37607, 64463 ); + _DICT.put( 37609, 59384 ); + _DICT.put( 37610, 38365 ); + _DICT.put( 37613, 35187 ); + _DICT.put( 37618, 38245 ); + _DICT.put( 37619, 37522 ); + _DICT.put( 37624, 35736 ); + _DICT.put( 37625, 64101 ); + _DICT.put( 37626, 59386 ); + _DICT.put( 37627, 64473 ); + _DICT.put( 37628, 36220 ); + _DICT.put( 37631, 64476 ); + _DICT.put( 37634, 64478 ); + _DICT.put( 37638, 36427 ); + _DICT.put( 37647, 59385 ); + _DICT.put( 37648, 37005 ); + _DICT.put( 37656, 37006 ); + _DICT.put( 37657, 59456 ); + _DICT.put( 37658, 59458 ); + _DICT.put( 37661, 64477 ); + _DICT.put( 37662, 64475 ); + _DICT.put( 37664, 36857 ); + _DICT.put( 37665, 64472 ); + _DICT.put( 37666, 59457 ); + _DICT.put( 37667, 59459 ); + _DICT.put( 37669, 64471 ); + _DICT.put( 37670, 35793 ); + _DICT.put( 37672, 38244 ); + _DICT.put( 37675, 36576 ); + _DICT.put( 37676, 38978 ); + _DICT.put( 37678, 59388 ); + _DICT.put( 37679, 36342 ); + _DICT.put( 37682, 39006 ); + _DICT.put( 37685, 59461 ); + _DICT.put( 37690, 59460 ); + _DICT.put( 37691, 59462 ); + _DICT.put( 37700, 59387 ); + _DICT.put( 37704, 64094 ); + _DICT.put( 37707, 37863 ); + _DICT.put( 37709, 37748 ); + _DICT.put( 37716, 37589 ); + _DICT.put( 37718, 59467 ); + _DICT.put( 37719, 64480 ); + _DICT.put( 37723, 37474 ); + _DICT.put( 37724, 59463 ); + _DICT.put( 37728, 59464 ); + _DICT.put( 37740, 35916 ); + _DICT.put( 37742, 59466 ); + _DICT.put( 37744, 64479 ); + _DICT.put( 37749, 36014 ); + _DICT.put( 37756, 59465 ); + _DICT.put( 37758, 36831 ); + _DICT.put( 37772, 35481 ); + _DICT.put( 37780, 59471 ); + _DICT.put( 37782, 36285 ); + _DICT.put( 37783, 37273 ); + _DICT.put( 37786, 37576 ); + _DICT.put( 37796, 64481 ); + _DICT.put( 37799, 35418 ); + _DICT.put( 37804, 59469 ); + _DICT.put( 37805, 59470 ); + _DICT.put( 37806, 37569 ); + _DICT.put( 37808, 59468 ); + _DICT.put( 37817, 59472 ); + _DICT.put( 37827, 59478 ); + _DICT.put( 37830, 64482 ); + _DICT.put( 37832, 59481 ); + _DICT.put( 37840, 59480 ); + _DICT.put( 37841, 37708 ); + _DICT.put( 37846, 59473 ); + _DICT.put( 37847, 59474 ); + _DICT.put( 37848, 59477 ); + _DICT.put( 37853, 59479 ); + _DICT.put( 37854, 64483 ); + _DICT.put( 37857, 35774 ); + _DICT.put( 37860, 59482 ); + _DICT.put( 37861, 59476 ); + _DICT.put( 37864, 59475 ); + _DICT.put( 37880, 64484 ); + _DICT.put( 37891, 59486 ); + _DICT.put( 37895, 59487 ); + _DICT.put( 37904, 59488 ); + _DICT.put( 37907, 59485 ); + _DICT.put( 37908, 59484 ); + _DICT.put( 37912, 36832 ); + _DICT.put( 37913, 37800 ); + _DICT.put( 37914, 59483 ); + _DICT.put( 37921, 59492 ); + _DICT.put( 37931, 59490 ); + _DICT.put( 37937, 64485 ); + _DICT.put( 37941, 59491 ); + _DICT.put( 37942, 59489 ); + _DICT.put( 37944, 37366 ); + _DICT.put( 37946, 59493 ); + _DICT.put( 37953, 59494 ); + _DICT.put( 37956, 59496 ); + _DICT.put( 37957, 64486 ); + _DICT.put( 37960, 64487 ); + _DICT.put( 37969, 35539 ); + _DICT.put( 37970, 59495 ); + _DICT.put( 37971, 38648 ); + _DICT.put( 37978, 59507 ); + _DICT.put( 37979, 59497 ); + _DICT.put( 37982, 59500 ); + _DICT.put( 37984, 59498 ); + _DICT.put( 37986, 59499 ); + _DICT.put( 37994, 59501 ); + _DICT.put( 38000, 59503 ); + _DICT.put( 38005, 59504 ); + _DICT.put( 38007, 59505 ); + _DICT.put( 38012, 59508 ); + _DICT.put( 38013, 59506 ); + _DICT.put( 38014, 59509 ); + _DICT.put( 38015, 59511 ); + _DICT.put( 38017, 59510 ); + _DICT.put( 38263, 37559 ); + _DICT.put( 38272, 38629 ); + _DICT.put( 38274, 59512 ); + _DICT.put( 38275, 37197 ); + _DICT.put( 38279, 59513 ); + _DICT.put( 38281, 38338 ); + _DICT.put( 38282, 59514 ); + _DICT.put( 38283, 35402 ); + _DICT.put( 38287, 35163 ); + _DICT.put( 38289, 35541 ); + _DICT.put( 38290, 64488 ); + _DICT.put( 38291, 35540 ); + _DICT.put( 38292, 59515 ); + _DICT.put( 38294, 59516 ); + _DICT.put( 38296, 59517 ); + _DICT.put( 38297, 59518 ); + _DICT.put( 38304, 59520 ); + _DICT.put( 38306, 35542 ); + _DICT.put( 38307, 35444 ); + _DICT.put( 38308, 36221 ); + _DICT.put( 38309, 38068 ); + _DICT.put( 38311, 59522 ); + _DICT.put( 38312, 59521 ); + _DICT.put( 38317, 59523 ); + _DICT.put( 38322, 35195 ); + _DICT.put( 38329, 59526 ); + _DICT.put( 38331, 59525 ); + _DICT.put( 38332, 59524 ); + _DICT.put( 38334, 59527 ); + _DICT.put( 38339, 59530 ); + _DICT.put( 38343, 35013 ); + _DICT.put( 38346, 59528 ); + _DICT.put( 38348, 59532 ); + _DICT.put( 38349, 59531 ); + _DICT.put( 38356, 59534 ); + _DICT.put( 38357, 59533 ); + _DICT.put( 38358, 59535 ); + _DICT.put( 38360, 37804 ); + _DICT.put( 38364, 59536 ); + _DICT.put( 38369, 59537 ); + _DICT.put( 38370, 59539 ); + _DICT.put( 38373, 59538 ); + _DICT.put( 38428, 38284 ); + _DICT.put( 38433, 59540 ); + _DICT.put( 38440, 59541 ); + _DICT.put( 38442, 36323 ); + _DICT.put( 38446, 59542 ); + _DICT.put( 38447, 59543 ); + _DICT.put( 38450, 38504 ); + _DICT.put( 38459, 37226 ); + _DICT.put( 38463, 34978 ); + _DICT.put( 38464, 37321 ); + _DICT.put( 38466, 59544 ); + _DICT.put( 38468, 38285 ); + _DICT.put( 38475, 59547 ); + _DICT.put( 38476, 59545 ); + _DICT.put( 38477, 36222 ); + _DICT.put( 38479, 59546 ); + _DICT.put( 38480, 36032 ); + _DICT.put( 38491, 38339 ); + _DICT.put( 38492, 59549 ); + _DICT.put( 38493, 59551 ); + _DICT.put( 38494, 59550 ); + _DICT.put( 38495, 59552 ); + _DICT.put( 38498, 35136 ); + _DICT.put( 38499, 36983 ); + _DICT.put( 38500, 36764 ); + _DICT.put( 38501, 35543 ); + _DICT.put( 38502, 59553 ); + _DICT.put( 38506, 38022 ); + _DICT.put( 38508, 59555 ); + _DICT.put( 38512, 35137 ); + _DICT.put( 38514, 59554 ); + _DICT.put( 38515, 37570 ); + _DICT.put( 38517, 38859 ); + _DICT.put( 38518, 37801 ); + _DICT.put( 38519, 59548 ); + _DICT.put( 38520, 38820 ); + _DICT.put( 38522, 36015 ); + _DICT.put( 38525, 38778 ); + _DICT.put( 38533, 35831 ); + _DICT.put( 38534, 38834 ); + _DICT.put( 38536, 35911 ); + _DICT.put( 38538, 37344 ); + _DICT.put( 38539, 58432 ); + _DICT.put( 38541, 59556 ); + _DICT.put( 38542, 35403 ); + _DICT.put( 38543, 37007 ); + _DICT.put( 38548, 35445 ); + _DICT.put( 38549, 59558 ); + _DICT.put( 38551, 59559 ); + _DICT.put( 38552, 59557 ); + _DICT.put( 38553, 35972 ); + _DICT.put( 38555, 36315 ); + _DICT.put( 38556, 36833 ); + _DICT.put( 38557, 64491 ); + _DICT.put( 38560, 35138 ); + _DICT.put( 38563, 38871 ); + _DICT.put( 38567, 59561 ); + _DICT.put( 38568, 59308 ); + _DICT.put( 38570, 59560 ); + _DICT.put( 38575, 64492 ); + _DICT.put( 38576, 59564 ); + _DICT.put( 38577, 59562 ); + _DICT.put( 38578, 59563 ); + _DICT.put( 38580, 59565 ); + _DICT.put( 38582, 59566 ); + _DICT.put( 38583, 38890 ); + _DICT.put( 38584, 59567 ); + _DICT.put( 38585, 59568 ); + _DICT.put( 38587, 37063 ); + _DICT.put( 38588, 38073 ); + _DICT.put( 38592, 37021 ); + _DICT.put( 38593, 35557 ); + _DICT.put( 38596, 38745 ); + _DICT.put( 38597, 35307 ); + _DICT.put( 38598, 36695 ); + _DICT.put( 38599, 36057 ); + _DICT.put( 38601, 59571 ); + _DICT.put( 38603, 59570 ); + _DICT.put( 38604, 36499 ); + _DICT.put( 38605, 59572 ); + _DICT.put( 38606, 59569 ); + _DICT.put( 38609, 36423 ); + _DICT.put( 38613, 59576 ); + _DICT.put( 38614, 58795 ); + _DICT.put( 38617, 39380 ); + _DICT.put( 38619, 37015 ); + _DICT.put( 38620, 59574 ); + _DICT.put( 38626, 38819 ); + _DICT.put( 38627, 37871 ); + _DICT.put( 38632, 35146 ); + _DICT.put( 38634, 37089 ); + _DICT.put( 38635, 36532 ); + _DICT.put( 38640, 38325 ); + _DICT.put( 38642, 35167 ); + _DICT.put( 38646, 38891 ); + _DICT.put( 38647, 38795 ); + _DICT.put( 38649, 59577 ); + _DICT.put( 38651, 37732 ); + _DICT.put( 38656, 36601 ); + _DICT.put( 38660, 59578 ); + _DICT.put( 38662, 59579 ); + _DICT.put( 38663, 36971 ); + _DICT.put( 38664, 59580 ); + _DICT.put( 38666, 38892 ); + _DICT.put( 38669, 59575 ); + _DICT.put( 38670, 59582 ); + _DICT.put( 38671, 59584 ); + _DICT.put( 38673, 59583 ); + _DICT.put( 38675, 59581 ); + _DICT.put( 38678, 59585 ); + _DICT.put( 38681, 59586 ); + _DICT.put( 38684, 37274 ); + _DICT.put( 38686, 35296 ); + _DICT.put( 38692, 59587 ); + _DICT.put( 38695, 38582 ); + _DICT.put( 38698, 59588 ); + _DICT.put( 38704, 59589 ); + _DICT.put( 38706, 38985 ); + _DICT.put( 38707, 64493 ); + _DICT.put( 38712, 40528 ); + _DICT.put( 38713, 59590 ); + _DICT.put( 38715, 64494 ); + _DICT.put( 38717, 59591 ); + _DICT.put( 38718, 59592 ); + _DICT.put( 38722, 59596 ); + _DICT.put( 38723, 64495 ); + _DICT.put( 38724, 59593 ); + _DICT.put( 38726, 59594 ); + _DICT.put( 38728, 59595 ); + _DICT.put( 38729, 59597 ); + _DICT.put( 38733, 64496 ); + _DICT.put( 38735, 64497 ); + _DICT.put( 38737, 64498 ); + _DICT.put( 38738, 37058 ); + _DICT.put( 38741, 64499 ); + _DICT.put( 38742, 38645 ); + _DICT.put( 38745, 37059 ); + _DICT.put( 38748, 59598 ); + _DICT.put( 38750, 38129 ); + _DICT.put( 38752, 59599 ); + _DICT.put( 38753, 60018 ); + _DICT.put( 38754, 38602 ); + _DICT.put( 38756, 59600 ); + _DICT.put( 38758, 59601 ); + _DICT.put( 38760, 59602 ); + _DICT.put( 38761, 35446 ); + _DICT.put( 38763, 59604 ); + _DICT.put( 38765, 36984 ); + _DICT.put( 38769, 59605 ); + _DICT.put( 38772, 35907 ); + _DICT.put( 38777, 59606 ); + _DICT.put( 38778, 59610 ); + _DICT.put( 38780, 59608 ); + _DICT.put( 38785, 59609 ); + _DICT.put( 38788, 35475 ); + _DICT.put( 38789, 59607 ); + _DICT.put( 38790, 59611 ); + _DICT.put( 38795, 59612 ); + _DICT.put( 38797, 35014 ); + _DICT.put( 38799, 59613 ); + _DICT.put( 38800, 59614 ); + _DICT.put( 38808, 36834 ); + _DICT.put( 38812, 59615 ); + _DICT.put( 38816, 35686 ); + _DICT.put( 38819, 59618 ); + _DICT.put( 38822, 59617 ); + _DICT.put( 38824, 59616 ); + _DICT.put( 38827, 59025 ); + _DICT.put( 38829, 38362 ); + _DICT.put( 38835, 59619 ); + _DICT.put( 38836, 59620 ); + _DICT.put( 38851, 59621 ); + _DICT.put( 38854, 59622 ); + _DICT.put( 38856, 59623 ); + _DICT.put( 38859, 59624 ); + _DICT.put( 38867, 35544 ); + _DICT.put( 38876, 59625 ); + _DICT.put( 38893, 59626 ); + _DICT.put( 38894, 37954 ); + _DICT.put( 38898, 59628 ); + _DICT.put( 38899, 35257 ); + _DICT.put( 38901, 59631 ); + _DICT.put( 38902, 59630 ); + _DICT.put( 38907, 35139 ); + _DICT.put( 38911, 35775 ); + _DICT.put( 38913, 38341 ); + _DICT.put( 38914, 37560 ); + _DICT.put( 38915, 36256 ); + _DICT.put( 38917, 36224 ); + _DICT.put( 38918, 36743 ); + _DICT.put( 38920, 36987 ); + _DICT.put( 38924, 59633 ); + _DICT.put( 38927, 59632 ); + _DICT.put( 38928, 38753 ); + _DICT.put( 38929, 35558 ); + _DICT.put( 38930, 38096 ); + _DICT.put( 38931, 37850 ); + _DICT.put( 38935, 37020 ); + _DICT.put( 38936, 38860 ); + _DICT.put( 38938, 35962 ); + _DICT.put( 38945, 59636 ); + _DICT.put( 38948, 59635 ); + _DICT.put( 38956, 38506 ); + _DICT.put( 38957, 37802 ); + _DICT.put( 38964, 35183 ); + _DICT.put( 38967, 59637 ); + _DICT.put( 38968, 59634 ); + _DICT.put( 38971, 38256 ); + _DICT.put( 38972, 38794 ); + _DICT.put( 38973, 59638 ); + _DICT.put( 38982, 59639 ); + _DICT.put( 38987, 59641 ); + _DICT.put( 38988, 37352 ); + _DICT.put( 38989, 35450 ); + _DICT.put( 38990, 35451 ); + _DICT.put( 38991, 59640 ); + _DICT.put( 38996, 35559 ); + _DICT.put( 38997, 36016 ); + _DICT.put( 38999, 64500 ); + _DICT.put( 39000, 35560 ); + _DICT.put( 39003, 37726 ); + _DICT.put( 39006, 38878 ); + _DICT.put( 39013, 64501 ); + _DICT.put( 39015, 36058 ); + _DICT.put( 39019, 59642 ); + _DICT.put( 39023, 59643 ); + _DICT.put( 39024, 59644 ); + _DICT.put( 39025, 59712 ); + _DICT.put( 39027, 59714 ); + _DICT.put( 39028, 59713 ); + _DICT.put( 39080, 38295 ); + _DICT.put( 39082, 59715 ); + _DICT.put( 39087, 59716 ); + _DICT.put( 39089, 59717 ); + _DICT.put( 39094, 59718 ); + _DICT.put( 39107, 59720 ); + _DICT.put( 39108, 59719 ); + _DICT.put( 39110, 59721 ); + _DICT.put( 39131, 38130 ); + _DICT.put( 39132, 58314 ); + _DICT.put( 39135, 36936 ); + _DICT.put( 39138, 35665 ); + _DICT.put( 39145, 59722 ); + _DICT.put( 39147, 59723 ); + _DICT.put( 39149, 39338 ); + _DICT.put( 39150, 40794 ); + _DICT.put( 39151, 38097 ); + _DICT.put( 39154, 35065 ); + _DICT.put( 39156, 35001 ); + _DICT.put( 39164, 36500 ); + _DICT.put( 39165, 38479 ); + _DICT.put( 39166, 36860 ); + _DICT.put( 39171, 59724 ); + _DICT.put( 39173, 38621 ); + _DICT.put( 39177, 59725 ); + _DICT.put( 39178, 38779 ); + _DICT.put( 39180, 35169 ); + _DICT.put( 39184, 36448 ); + _DICT.put( 39186, 59726 ); + _DICT.put( 39187, 35308 ); + _DICT.put( 39188, 59727 ); + _DICT.put( 39192, 59728 ); + _DICT.put( 39197, 59730 ); + _DICT.put( 39198, 59731 ); + _DICT.put( 39200, 59733 ); + _DICT.put( 39201, 59729 ); + _DICT.put( 39204, 59732 ); + _DICT.put( 39207, 64504 ); + _DICT.put( 39208, 35545 ); + _DICT.put( 39212, 59734 ); + _DICT.put( 39214, 59735 ); + _DICT.put( 39229, 59736 ); + _DICT.put( 39230, 59737 ); + _DICT.put( 39234, 59738 ); + _DICT.put( 39237, 59740 ); + _DICT.put( 39241, 59739 ); + _DICT.put( 39243, 59742 ); + _DICT.put( 39244, 59745 ); + _DICT.put( 39248, 59741 ); + _DICT.put( 39249, 59743 ); + _DICT.put( 39250, 59744 ); + _DICT.put( 39253, 59746 ); + _DICT.put( 39255, 35776 ); + _DICT.put( 39318, 36593 ); + _DICT.put( 39319, 59747 ); + _DICT.put( 39320, 59748 ); + _DICT.put( 39321, 36225 ); + _DICT.put( 39326, 64506 ); + _DICT.put( 39333, 59749 ); + _DICT.put( 39336, 35421 ); + _DICT.put( 39340, 37998 ); + _DICT.put( 39341, 59750 ); + _DICT.put( 39342, 59751 ); + _DICT.put( 39347, 37497 ); + _DICT.put( 39348, 37865 ); + _DICT.put( 39356, 59752 ); + _DICT.put( 39361, 38045 ); + _DICT.put( 39364, 37322 ); + _DICT.put( 39365, 35191 ); + _DICT.put( 39366, 35820 ); + _DICT.put( 39368, 35821 ); + _DICT.put( 39376, 37523 ); + _DICT.put( 39377, 59757 ); + _DICT.put( 39378, 35822 ); + _DICT.put( 39381, 35309 ); + _DICT.put( 39384, 59756 ); + _DICT.put( 39387, 59754 ); + _DICT.put( 39389, 59755 ); + _DICT.put( 39391, 59753 ); + _DICT.put( 39394, 59767 ); + _DICT.put( 39405, 59758 ); + _DICT.put( 39406, 59759 ); + _DICT.put( 39409, 59760 ); + _DICT.put( 39410, 59761 ); + _DICT.put( 39416, 59763 ); + _DICT.put( 39419, 59762 ); + _DICT.put( 39423, 36728 ); + _DICT.put( 39425, 59764 ); + _DICT.put( 39429, 59766 ); + _DICT.put( 39438, 35666 ); + _DICT.put( 39439, 59765 ); + _DICT.put( 39442, 37275 ); + _DICT.put( 39443, 36017 ); + _DICT.put( 39449, 59768 ); + _DICT.put( 39464, 37323 ); + _DICT.put( 39467, 59769 ); + _DICT.put( 39472, 37803 ); + _DICT.put( 39479, 59770 ); + _DICT.put( 39486, 59776 ); + _DICT.put( 39488, 59773 ); + _DICT.put( 39490, 59772 ); + _DICT.put( 39491, 59774 ); + _DICT.put( 39493, 59771 ); + _DICT.put( 39501, 59778 ); + _DICT.put( 39502, 64507 ); + _DICT.put( 39509, 59777 ); + _DICT.put( 39511, 59780 ); + _DICT.put( 39514, 35777 ); + _DICT.put( 39515, 59779 ); + _DICT.put( 39519, 59781 ); + _DICT.put( 39522, 59782 ); + _DICT.put( 39524, 59784 ); + _DICT.put( 39525, 59783 ); + _DICT.put( 39529, 59785 ); + _DICT.put( 39530, 59787 ); + _DICT.put( 39531, 59786 ); + _DICT.put( 39592, 36252 ); + _DICT.put( 39597, 59788 ); + _DICT.put( 39600, 59789 ); + _DICT.put( 39608, 35419 ); + _DICT.put( 39612, 59790 ); + _DICT.put( 39616, 59791 ); + _DICT.put( 39620, 37009 ); + _DICT.put( 39631, 59792 ); + _DICT.put( 39633, 59793 ); + _DICT.put( 39635, 59794 ); + _DICT.put( 39636, 59795 ); + _DICT.put( 39640, 36226 ); + _DICT.put( 39641, 64508 ); + _DICT.put( 39644, 64576 ); + _DICT.put( 39646, 59796 ); + _DICT.put( 39647, 59797 ); + _DICT.put( 39650, 59798 ); + _DICT.put( 39651, 59799 ); + _DICT.put( 39654, 59800 ); + _DICT.put( 39658, 38063 ); + _DICT.put( 39659, 59802 ); + _DICT.put( 39661, 38213 ); + _DICT.put( 39662, 59803 ); + _DICT.put( 39663, 59801 ); + _DICT.put( 39665, 59805 ); + _DICT.put( 39668, 59804 ); + _DICT.put( 39671, 59806 ); + _DICT.put( 39675, 59807 ); + _DICT.put( 39686, 59808 ); + _DICT.put( 39704, 59809 ); + _DICT.put( 39706, 59810 ); + _DICT.put( 39711, 59811 ); + _DICT.put( 39714, 59812 ); + _DICT.put( 39715, 59813 ); + _DICT.put( 39717, 59814 ); + _DICT.put( 39719, 59815 ); + _DICT.put( 39720, 59816 ); + _DICT.put( 39721, 59817 ); + _DICT.put( 39722, 59818 ); + _DICT.put( 39726, 59819 ); + _DICT.put( 39727, 59820 ); + _DICT.put( 39729, 40788 ); + _DICT.put( 39730, 59821 ); + _DICT.put( 39739, 58102 ); + _DICT.put( 39740, 35667 ); + _DICT.put( 39745, 35392 ); + _DICT.put( 39746, 36272 ); + _DICT.put( 39747, 59823 ); + _DICT.put( 39748, 59822 ); + _DICT.put( 39749, 38563 ); + _DICT.put( 39757, 59825 ); + _DICT.put( 39758, 59826 ); + _DICT.put( 39759, 59824 ); + _DICT.put( 39761, 59827 ); + _DICT.put( 39764, 38530 ); + _DICT.put( 39768, 59828 ); + _DICT.put( 39770, 35739 ); + _DICT.put( 39791, 38980 ); + _DICT.put( 39794, 64578 ); + _DICT.put( 39796, 59829 ); + _DICT.put( 39797, 64577 ); + _DICT.put( 39811, 59831 ); + _DICT.put( 39822, 35004 ); + _DICT.put( 39823, 64579 ); + _DICT.put( 39825, 59832 ); + _DICT.put( 39826, 38313 ); + _DICT.put( 39827, 59830 ); + _DICT.put( 39830, 59833 ); + _DICT.put( 39831, 59834 ); + _DICT.put( 39839, 59835 ); + _DICT.put( 39840, 59836 ); + _DICT.put( 39848, 59837 ); + _DICT.put( 39850, 38542 ); + _DICT.put( 39851, 36428 ); + _DICT.put( 39853, 36344 ); + _DICT.put( 39854, 37198 ); + _DICT.put( 39857, 64580 ); + _DICT.put( 39860, 59838 ); + _DICT.put( 39865, 59841 ); + _DICT.put( 39867, 64581 ); + _DICT.put( 39872, 59839 ); + _DICT.put( 39878, 59842 ); + _DICT.put( 39881, 36079 ); + _DICT.put( 39882, 59840 ); + _DICT.put( 39887, 59843 ); + _DICT.put( 39889, 59844 ); + _DICT.put( 39890, 59845 ); + _DICT.put( 39892, 59849 ); + _DICT.put( 39894, 36425 ); + _DICT.put( 39899, 37346 ); + _DICT.put( 39905, 59850 ); + _DICT.put( 39906, 59847 ); + _DICT.put( 39907, 59846 ); + _DICT.put( 39908, 59848 ); + _DICT.put( 39912, 35966 ); + _DICT.put( 39920, 59854 ); + _DICT.put( 39921, 59853 ); + _DICT.put( 39922, 59852 ); + _DICT.put( 39925, 34993 ); + _DICT.put( 39936, 64582 ); + _DICT.put( 39940, 59864 ); + _DICT.put( 39942, 59860 ); + _DICT.put( 39944, 59861 ); + _DICT.put( 39945, 59857 ); + _DICT.put( 39946, 59863 ); + _DICT.put( 39948, 59859 ); + _DICT.put( 39949, 35458 ); + _DICT.put( 39952, 39019 ); + _DICT.put( 39954, 59862 ); + _DICT.put( 39955, 59858 ); + _DICT.put( 39956, 59856 ); + _DICT.put( 39957, 59855 ); + _DICT.put( 39963, 59866 ); + _DICT.put( 39969, 59869 ); + _DICT.put( 39972, 59868 ); + _DICT.put( 39973, 59867 ); + _DICT.put( 39981, 38248 ); + _DICT.put( 39982, 59865 ); + _DICT.put( 39983, 35057 ); + _DICT.put( 39984, 59870 ); + _DICT.put( 39986, 59872 ); + _DICT.put( 39993, 35471 ); + _DICT.put( 39994, 59851 ); + _DICT.put( 39995, 35158 ); + _DICT.put( 39998, 59874 ); + _DICT.put( 40006, 59873 ); + _DICT.put( 40007, 59871 ); + _DICT.put( 40008, 37452 ); + _DICT.put( 40018, 38544 ); + _DICT.put( 40023, 38872 ); + _DICT.put( 40026, 59875 ); + _DICT.put( 40032, 59876 ); + _DICT.put( 40039, 59877 ); + _DICT.put( 40054, 59878 ); + _DICT.put( 40056, 59879 ); + _DICT.put( 40165, 37561 ); + _DICT.put( 40167, 59880 ); + _DICT.put( 40169, 38069 ); + _DICT.put( 40171, 59885 ); + _DICT.put( 40172, 59881 ); + _DICT.put( 40176, 59882 ); + _DICT.put( 40179, 38480 ); + _DICT.put( 40180, 38594 ); + _DICT.put( 40182, 37838 ); + _DICT.put( 40195, 59886 ); + _DICT.put( 40198, 59887 ); + _DICT.put( 40199, 37820 ); + _DICT.put( 40200, 59884 ); + _DICT.put( 40201, 59883 ); + _DICT.put( 40206, 35240 ); + _DICT.put( 40210, 59895 ); + _DICT.put( 40213, 59894 ); + _DICT.put( 40219, 35221 ); + _DICT.put( 40223, 59892 ); + _DICT.put( 40227, 59891 ); + _DICT.put( 40230, 59889 ); + _DICT.put( 40232, 35483 ); + _DICT.put( 40234, 59888 ); + _DICT.put( 40235, 36528 ); + _DICT.put( 40236, 35239 ); + _DICT.put( 40251, 36227 ); + _DICT.put( 40254, 59898 ); + _DICT.put( 40255, 59897 ); + _DICT.put( 40257, 59896 ); + _DICT.put( 40260, 59893 ); + _DICT.put( 40262, 59899 ); + _DICT.put( 40264, 59900 ); + _DICT.put( 40272, 59972 ); + _DICT.put( 40273, 59971 ); + _DICT.put( 40281, 59973 ); + _DICT.put( 40284, 35148 ); + _DICT.put( 40285, 59968 ); + _DICT.put( 40286, 59969 ); + _DICT.put( 40288, 36244 ); + _DICT.put( 40289, 38583 ); + _DICT.put( 40292, 59970 ); + _DICT.put( 40299, 64584 ); + _DICT.put( 40300, 38481 ); + _DICT.put( 40303, 59978 ); + _DICT.put( 40304, 64583 ); + _DICT.put( 40306, 59974 ); + _DICT.put( 40314, 59979 ); + _DICT.put( 40327, 59976 ); + _DICT.put( 40329, 59975 ); + _DICT.put( 40335, 35963 ); + _DICT.put( 40346, 59980 ); + _DICT.put( 40356, 59981 ); + _DICT.put( 40361, 59982 ); + _DICT.put( 40363, 59977 ); + _DICT.put( 40367, 59890 ); + _DICT.put( 40370, 59983 ); + _DICT.put( 40372, 37599 ); + _DICT.put( 40376, 59987 ); + _DICT.put( 40378, 59988 ); + _DICT.put( 40379, 59986 ); + _DICT.put( 40385, 59985 ); + _DICT.put( 40386, 59991 ); + _DICT.put( 40388, 59984 ); + _DICT.put( 40390, 59989 ); + _DICT.put( 40399, 59990 ); + _DICT.put( 40403, 59993 ); + _DICT.put( 40409, 59992 ); + _DICT.put( 40422, 59995 ); + _DICT.put( 40429, 59996 ); + _DICT.put( 40431, 59997 ); + _DICT.put( 40434, 39016 ); + _DICT.put( 40440, 59994 ); + _DICT.put( 40441, 37353 ); + _DICT.put( 40442, 36331 ); + _DICT.put( 40445, 59998 ); + _DICT.put( 40473, 64586 ); + _DICT.put( 40474, 59999 ); + _DICT.put( 40475, 60000 ); + _DICT.put( 40478, 60001 ); + _DICT.put( 40565, 60002 ); + _DICT.put( 40568, 36018 ); + _DICT.put( 40569, 60003 ); + _DICT.put( 40573, 60004 ); + _DICT.put( 40575, 36525 ); + _DICT.put( 40577, 60005 ); + _DICT.put( 40584, 60006 ); + _DICT.put( 40587, 60007 ); + _DICT.put( 40588, 60008 ); + _DICT.put( 40593, 60011 ); + _DICT.put( 40594, 60009 ); + _DICT.put( 40595, 39003 ); + _DICT.put( 40597, 60010 ); + _DICT.put( 40599, 38893 ); + _DICT.put( 40605, 60012 ); + _DICT.put( 40607, 38873 ); + _DICT.put( 40613, 60013 ); + _DICT.put( 40614, 38046 ); + _DICT.put( 40617, 60014 ); + _DICT.put( 40618, 60016 ); + _DICT.put( 40621, 60017 ); + _DICT.put( 40632, 60015 ); + _DICT.put( 40633, 36237 ); + _DICT.put( 40634, 38603 ); + _DICT.put( 40635, 38531 ); + _DICT.put( 40636, 39925 ); + _DICT.put( 40638, 40832 ); + _DICT.put( 40639, 38555 ); + _DICT.put( 40644, 35241 ); + _DICT.put( 40652, 60019 ); + _DICT.put( 40653, 35695 ); + _DICT.put( 40654, 60020 ); + _DICT.put( 40655, 60021 ); + _DICT.put( 40656, 60022 ); + _DICT.put( 40657, 64587 ); + _DICT.put( 40658, 36245 ); + _DICT.put( 40660, 60023 ); + _DICT.put( 40664, 57554 ); + _DICT.put( 40665, 38617 ); + _DICT.put( 40667, 37345 ); + _DICT.put( 40668, 60024 ); + _DICT.put( 40669, 60026 ); + _DICT.put( 40670, 60025 ); + _DICT.put( 40672, 60027 ); + _DICT.put( 40677, 60028 ); + _DICT.put( 40680, 60029 ); + _DICT.put( 40687, 60030 ); + _DICT.put( 40692, 60032 ); + _DICT.put( 40694, 60033 ); + _DICT.put( 40695, 60034 ); + _DICT.put( 40697, 60035 ); + _DICT.put( 40699, 60036 ); + _DICT.put( 40700, 60037 ); + _DICT.put( 40701, 60038 ); + _DICT.put( 40711, 60039 ); + _DICT.put( 40712, 60040 ); + _DICT.put( 40718, 37699 ); + _DICT.put( 40723, 36059 ); + _DICT.put( 40725, 60042 ); + _DICT.put( 40736, 37228 ); + _DICT.put( 40737, 60043 ); + _DICT.put( 40748, 60044 ); + _DICT.put( 40763, 38208 ); + _DICT.put( 40766, 60045 ); + _DICT.put( 40778, 60046 ); + _DICT.put( 40779, 57942 ); + _DICT.put( 40782, 59096 ); + _DICT.put( 40783, 59627 ); + _DICT.put( 40786, 60047 ); + _DICT.put( 40788, 60048 ); + _DICT.put( 40799, 60050 ); + _DICT.put( 40800, 60051 ); + _DICT.put( 40801, 60052 ); + _DICT.put( 40802, 38894 ); + _DICT.put( 40803, 60049 ); + _DICT.put( 40806, 60053 ); + _DICT.put( 40807, 60054 ); + _DICT.put( 40810, 60056 ); + _DICT.put( 40812, 60055 ); + _DICT.put( 40818, 60058 ); + _DICT.put( 40822, 60059 ); + _DICT.put( 40823, 60057 ); + _DICT.put( 40845, 38836 ); + _DICT.put( 40853, 60060 ); + _DICT.put( 40860, 60061 ); + _DICT.put( 40861, 57971 ); + _DICT.put( 40864, 60062 ); + _DICT.put( 57344, 61504 ); + _DICT.put( 57345, 61505 ); + _DICT.put( 57346, 61506 ); + _DICT.put( 57347, 61507 ); + _DICT.put( 57348, 61508 ); + _DICT.put( 57349, 61509 ); + _DICT.put( 57350, 61510 ); + _DICT.put( 57351, 61511 ); + _DICT.put( 57352, 61512 ); + _DICT.put( 57353, 61513 ); + _DICT.put( 57354, 61514 ); + _DICT.put( 57355, 61515 ); + _DICT.put( 57356, 61516 ); + _DICT.put( 57357, 61517 ); + _DICT.put( 57358, 61518 ); + _DICT.put( 57359, 61519 ); + _DICT.put( 57360, 61520 ); + _DICT.put( 57361, 61521 ); + _DICT.put( 57362, 61522 ); + _DICT.put( 57363, 61523 ); + _DICT.put( 57364, 61524 ); + _DICT.put( 57365, 61525 ); + _DICT.put( 57366, 61526 ); + _DICT.put( 57367, 61527 ); + _DICT.put( 57368, 61528 ); + _DICT.put( 57369, 61529 ); + _DICT.put( 57370, 61530 ); + _DICT.put( 57371, 61531 ); + _DICT.put( 57372, 61532 ); + _DICT.put( 57373, 61533 ); + _DICT.put( 57374, 61534 ); + _DICT.put( 57375, 61535 ); + _DICT.put( 57376, 61536 ); + _DICT.put( 57377, 61537 ); + _DICT.put( 57378, 61538 ); + _DICT.put( 57379, 61539 ); + _DICT.put( 57380, 61540 ); + _DICT.put( 57381, 61541 ); + _DICT.put( 57382, 61542 ); + _DICT.put( 57383, 61543 ); + _DICT.put( 57384, 61544 ); + _DICT.put( 57385, 61545 ); + _DICT.put( 57386, 61546 ); + _DICT.put( 57387, 61547 ); + _DICT.put( 57388, 61548 ); + _DICT.put( 57389, 61549 ); + _DICT.put( 57390, 61550 ); + _DICT.put( 57391, 61551 ); + _DICT.put( 57392, 61552 ); + _DICT.put( 57393, 61553 ); + _DICT.put( 57394, 61554 ); + _DICT.put( 57395, 61555 ); + _DICT.put( 57396, 61556 ); + _DICT.put( 57397, 61557 ); + _DICT.put( 57398, 61558 ); + _DICT.put( 57399, 61559 ); + _DICT.put( 57400, 61560 ); + _DICT.put( 57401, 61561 ); + _DICT.put( 57402, 61562 ); + _DICT.put( 57403, 61563 ); + _DICT.put( 57404, 61564 ); + _DICT.put( 57405, 61565 ); + _DICT.put( 57406, 61566 ); + _DICT.put( 57407, 61568 ); + _DICT.put( 57408, 61569 ); + _DICT.put( 57409, 61570 ); + _DICT.put( 57410, 61571 ); + _DICT.put( 57411, 61572 ); + _DICT.put( 57412, 61573 ); + _DICT.put( 57413, 61574 ); + _DICT.put( 57414, 61575 ); + _DICT.put( 57415, 61576 ); + _DICT.put( 57416, 61577 ); + _DICT.put( 57417, 61578 ); + _DICT.put( 57418, 61579 ); + _DICT.put( 57419, 61580 ); + _DICT.put( 57420, 61581 ); + _DICT.put( 57421, 61582 ); + _DICT.put( 57422, 61583 ); + _DICT.put( 57423, 61584 ); + _DICT.put( 57424, 61585 ); + _DICT.put( 57425, 61586 ); + _DICT.put( 57426, 61587 ); + _DICT.put( 57427, 61588 ); + _DICT.put( 57428, 61589 ); + _DICT.put( 57429, 61590 ); + _DICT.put( 57430, 61591 ); + _DICT.put( 57431, 61592 ); + _DICT.put( 57432, 61593 ); + _DICT.put( 57433, 61594 ); + _DICT.put( 57434, 61595 ); + _DICT.put( 57435, 61596 ); + _DICT.put( 57436, 61597 ); + _DICT.put( 57437, 61598 ); + _DICT.put( 57438, 61599 ); + _DICT.put( 57439, 61600 ); + _DICT.put( 57440, 61601 ); + _DICT.put( 57441, 61602 ); + _DICT.put( 57442, 61603 ); + _DICT.put( 57443, 61604 ); + _DICT.put( 57444, 61605 ); + _DICT.put( 57445, 61606 ); + _DICT.put( 57446, 61607 ); + _DICT.put( 57447, 61608 ); + _DICT.put( 57448, 61609 ); + _DICT.put( 57449, 61610 ); + _DICT.put( 57450, 61611 ); + _DICT.put( 57451, 61612 ); + _DICT.put( 57452, 61613 ); + _DICT.put( 57453, 61614 ); + _DICT.put( 57454, 61615 ); + _DICT.put( 57455, 61616 ); + _DICT.put( 57456, 61617 ); + _DICT.put( 57457, 61618 ); + _DICT.put( 57458, 61619 ); + _DICT.put( 57459, 61620 ); + _DICT.put( 57460, 61621 ); + _DICT.put( 57461, 61622 ); + _DICT.put( 57462, 61623 ); + _DICT.put( 57463, 61624 ); + _DICT.put( 57464, 61625 ); + _DICT.put( 57465, 61626 ); + _DICT.put( 57466, 61627 ); + _DICT.put( 57467, 61628 ); + _DICT.put( 57468, 61629 ); + _DICT.put( 57469, 61630 ); + _DICT.put( 57470, 61631 ); + _DICT.put( 57471, 61632 ); + _DICT.put( 57472, 61633 ); + _DICT.put( 57473, 61634 ); + _DICT.put( 57474, 61635 ); + _DICT.put( 57475, 61636 ); + _DICT.put( 57476, 61637 ); + _DICT.put( 57477, 61638 ); + _DICT.put( 57478, 61639 ); + _DICT.put( 57479, 61640 ); + _DICT.put( 57480, 61641 ); + _DICT.put( 57481, 61642 ); + _DICT.put( 57482, 61643 ); + _DICT.put( 57483, 61644 ); + _DICT.put( 57484, 61645 ); + _DICT.put( 57485, 61646 ); + _DICT.put( 57486, 61647 ); + _DICT.put( 57487, 61648 ); + _DICT.put( 57488, 61649 ); + _DICT.put( 57489, 61650 ); + _DICT.put( 57490, 61651 ); + _DICT.put( 57491, 61652 ); + _DICT.put( 57492, 61653 ); + _DICT.put( 57493, 61654 ); + _DICT.put( 57494, 61655 ); + _DICT.put( 57495, 61656 ); + _DICT.put( 57496, 61657 ); + _DICT.put( 57497, 61658 ); + _DICT.put( 57498, 61659 ); + _DICT.put( 57499, 61660 ); + _DICT.put( 57500, 61661 ); + _DICT.put( 57501, 61662 ); + _DICT.put( 57502, 61663 ); + _DICT.put( 57503, 61664 ); + _DICT.put( 57504, 61665 ); + _DICT.put( 57505, 61666 ); + _DICT.put( 57506, 61667 ); + _DICT.put( 57507, 61668 ); + _DICT.put( 57508, 61669 ); + _DICT.put( 57509, 61670 ); + _DICT.put( 57510, 61671 ); + _DICT.put( 57511, 61672 ); + _DICT.put( 57512, 61673 ); + _DICT.put( 57513, 61674 ); + _DICT.put( 57514, 61675 ); + _DICT.put( 57515, 61676 ); + _DICT.put( 57516, 61677 ); + _DICT.put( 57517, 61678 ); + _DICT.put( 57518, 61679 ); + _DICT.put( 57519, 61680 ); + _DICT.put( 57520, 61681 ); + _DICT.put( 57521, 61682 ); + _DICT.put( 57522, 61683 ); + _DICT.put( 57523, 61684 ); + _DICT.put( 57524, 61685 ); + _DICT.put( 57525, 61686 ); + _DICT.put( 57526, 61687 ); + _DICT.put( 57527, 61688 ); + _DICT.put( 57528, 61689 ); + _DICT.put( 57529, 61690 ); + _DICT.put( 57530, 61691 ); + _DICT.put( 57531, 61692 ); + _DICT.put( 57532, 61760 ); + _DICT.put( 57533, 61761 ); + _DICT.put( 57534, 61762 ); + _DICT.put( 57535, 61763 ); + _DICT.put( 57536, 61764 ); + _DICT.put( 57537, 61765 ); + _DICT.put( 57538, 61766 ); + _DICT.put( 57539, 61767 ); + _DICT.put( 57540, 61768 ); + _DICT.put( 57541, 61769 ); + _DICT.put( 57542, 61770 ); + _DICT.put( 57543, 61771 ); + _DICT.put( 57544, 61772 ); + _DICT.put( 57545, 61773 ); + _DICT.put( 57546, 61774 ); + _DICT.put( 57547, 61775 ); + _DICT.put( 57548, 61776 ); + _DICT.put( 57549, 61777 ); + _DICT.put( 57550, 61778 ); + _DICT.put( 57551, 61779 ); + _DICT.put( 57552, 61780 ); + _DICT.put( 57553, 61781 ); + _DICT.put( 57554, 61782 ); + _DICT.put( 57555, 61783 ); + _DICT.put( 57556, 61784 ); + _DICT.put( 57557, 61785 ); + _DICT.put( 57558, 61786 ); + _DICT.put( 57559, 61787 ); + _DICT.put( 57560, 61788 ); + _DICT.put( 57561, 61789 ); + _DICT.put( 57562, 61790 ); + _DICT.put( 57563, 61791 ); + _DICT.put( 57564, 61792 ); + _DICT.put( 57565, 61793 ); + _DICT.put( 57566, 61794 ); + _DICT.put( 57567, 61795 ); + _DICT.put( 57568, 61796 ); + _DICT.put( 57569, 61797 ); + _DICT.put( 57570, 61798 ); + _DICT.put( 57571, 61799 ); + _DICT.put( 57572, 61800 ); + _DICT.put( 57573, 61801 ); + _DICT.put( 57574, 61802 ); + _DICT.put( 57575, 61803 ); + _DICT.put( 57576, 61804 ); + _DICT.put( 57577, 61805 ); + _DICT.put( 57578, 61806 ); + _DICT.put( 57579, 61807 ); + _DICT.put( 57580, 61808 ); + _DICT.put( 57581, 61809 ); + _DICT.put( 57582, 61810 ); + _DICT.put( 57583, 61811 ); + _DICT.put( 57584, 61812 ); + _DICT.put( 57585, 61813 ); + _DICT.put( 57586, 61814 ); + _DICT.put( 57587, 61815 ); + _DICT.put( 57588, 61816 ); + _DICT.put( 57589, 61817 ); + _DICT.put( 57590, 61818 ); + _DICT.put( 57591, 61819 ); + _DICT.put( 57592, 61820 ); + _DICT.put( 57593, 61821 ); + _DICT.put( 57594, 61822 ); + _DICT.put( 57595, 61824 ); + _DICT.put( 57596, 61825 ); + _DICT.put( 57597, 61826 ); + _DICT.put( 57598, 61827 ); + _DICT.put( 57599, 61828 ); + _DICT.put( 57600, 61829 ); + _DICT.put( 57601, 61830 ); + _DICT.put( 57602, 61831 ); + _DICT.put( 57603, 61832 ); + _DICT.put( 57604, 61833 ); + _DICT.put( 57605, 61834 ); + _DICT.put( 57606, 61835 ); + _DICT.put( 57607, 61836 ); + _DICT.put( 57608, 61837 ); + _DICT.put( 57609, 61838 ); + _DICT.put( 57610, 61839 ); + _DICT.put( 57611, 61840 ); + _DICT.put( 57612, 61841 ); + _DICT.put( 57613, 61842 ); + _DICT.put( 57614, 61843 ); + _DICT.put( 57615, 61844 ); + _DICT.put( 57616, 61845 ); + _DICT.put( 57617, 61846 ); + _DICT.put( 57618, 61847 ); + _DICT.put( 57619, 61848 ); + _DICT.put( 57620, 61849 ); + _DICT.put( 57621, 61850 ); + _DICT.put( 57622, 61851 ); + _DICT.put( 57623, 61852 ); + _DICT.put( 57624, 61853 ); + _DICT.put( 57625, 61854 ); + _DICT.put( 57626, 61855 ); + _DICT.put( 57627, 61856 ); + _DICT.put( 57628, 61857 ); + _DICT.put( 57629, 61858 ); + _DICT.put( 57630, 61859 ); + _DICT.put( 57631, 61860 ); + _DICT.put( 57632, 61861 ); + _DICT.put( 57633, 61862 ); + _DICT.put( 57634, 61863 ); + _DICT.put( 57635, 61864 ); + _DICT.put( 57636, 61865 ); + _DICT.put( 57637, 61866 ); + _DICT.put( 57638, 61867 ); + _DICT.put( 57639, 61868 ); + _DICT.put( 57640, 61869 ); + _DICT.put( 57641, 61870 ); + _DICT.put( 57642, 61871 ); + _DICT.put( 57643, 61872 ); + _DICT.put( 57644, 61873 ); + _DICT.put( 57645, 61874 ); + _DICT.put( 57646, 61875 ); + _DICT.put( 57647, 61876 ); + _DICT.put( 57648, 61877 ); + _DICT.put( 57649, 61878 ); + _DICT.put( 57650, 61879 ); + _DICT.put( 57651, 61880 ); + _DICT.put( 57652, 61881 ); + _DICT.put( 57653, 61882 ); + _DICT.put( 57654, 61883 ); + _DICT.put( 57655, 61884 ); + _DICT.put( 57656, 61885 ); + _DICT.put( 57657, 61886 ); + _DICT.put( 57658, 61887 ); + _DICT.put( 57659, 61888 ); + _DICT.put( 57660, 61889 ); + _DICT.put( 57661, 61890 ); + _DICT.put( 57662, 61891 ); + _DICT.put( 57663, 61892 ); + _DICT.put( 57664, 61893 ); + _DICT.put( 57665, 61894 ); + _DICT.put( 57666, 61895 ); + _DICT.put( 57667, 61896 ); + _DICT.put( 57668, 61897 ); + _DICT.put( 57669, 61898 ); + _DICT.put( 57670, 61899 ); + _DICT.put( 57671, 61900 ); + _DICT.put( 57672, 61901 ); + _DICT.put( 57673, 61902 ); + _DICT.put( 57674, 61903 ); + _DICT.put( 57675, 61904 ); + _DICT.put( 57676, 61905 ); + _DICT.put( 57677, 61906 ); + _DICT.put( 57678, 61907 ); + _DICT.put( 57679, 61908 ); + _DICT.put( 57680, 61909 ); + _DICT.put( 57681, 61910 ); + _DICT.put( 57682, 61911 ); + _DICT.put( 57683, 61912 ); + _DICT.put( 57684, 61913 ); + _DICT.put( 57685, 61914 ); + _DICT.put( 57686, 61915 ); + _DICT.put( 57687, 61916 ); + _DICT.put( 57688, 61917 ); + _DICT.put( 57689, 61918 ); + _DICT.put( 57690, 61919 ); + _DICT.put( 57691, 61920 ); + _DICT.put( 57692, 61921 ); + _DICT.put( 57693, 61922 ); + _DICT.put( 57694, 61923 ); + _DICT.put( 57695, 61924 ); + _DICT.put( 57696, 61925 ); + _DICT.put( 57697, 61926 ); + _DICT.put( 57698, 61927 ); + _DICT.put( 57699, 61928 ); + _DICT.put( 57700, 61929 ); + _DICT.put( 57701, 61930 ); + _DICT.put( 57702, 61931 ); + _DICT.put( 57703, 61932 ); + _DICT.put( 57704, 61933 ); + _DICT.put( 57705, 61934 ); + _DICT.put( 57706, 61935 ); + _DICT.put( 57707, 61936 ); + _DICT.put( 57708, 61937 ); + _DICT.put( 57709, 61938 ); + _DICT.put( 57710, 61939 ); + _DICT.put( 57711, 61940 ); + _DICT.put( 57712, 61941 ); + _DICT.put( 57713, 61942 ); + _DICT.put( 57714, 61943 ); + _DICT.put( 57715, 61944 ); + _DICT.put( 57716, 61945 ); + _DICT.put( 57717, 61946 ); + _DICT.put( 57718, 61947 ); + _DICT.put( 57719, 61948 ); + _DICT.put( 57720, 62016 ); + _DICT.put( 57721, 62017 ); + _DICT.put( 57722, 62018 ); + _DICT.put( 57723, 62019 ); + _DICT.put( 57724, 62020 ); + _DICT.put( 57725, 62021 ); + _DICT.put( 57726, 62022 ); + _DICT.put( 57727, 62023 ); + _DICT.put( 57728, 62024 ); + _DICT.put( 57729, 62025 ); + _DICT.put( 57730, 62026 ); + _DICT.put( 57731, 62027 ); + _DICT.put( 57732, 62028 ); + _DICT.put( 57733, 62029 ); + _DICT.put( 57734, 62030 ); + _DICT.put( 57735, 62031 ); + _DICT.put( 57736, 62032 ); + _DICT.put( 57737, 62033 ); + _DICT.put( 57738, 62034 ); + _DICT.put( 57739, 62035 ); + _DICT.put( 57740, 62036 ); + _DICT.put( 57741, 62037 ); + _DICT.put( 57742, 62038 ); + _DICT.put( 57743, 62039 ); + _DICT.put( 57744, 62040 ); + _DICT.put( 57745, 62041 ); + _DICT.put( 57746, 62042 ); + _DICT.put( 57747, 62043 ); + _DICT.put( 57748, 62044 ); + _DICT.put( 57749, 62045 ); + _DICT.put( 57750, 62046 ); + _DICT.put( 57751, 62047 ); + _DICT.put( 57752, 62048 ); + _DICT.put( 57753, 62049 ); + _DICT.put( 57754, 62050 ); + _DICT.put( 57755, 62051 ); + _DICT.put( 57756, 62052 ); + _DICT.put( 57757, 62053 ); + _DICT.put( 57758, 62054 ); + _DICT.put( 57759, 62055 ); + _DICT.put( 57760, 62056 ); + _DICT.put( 57761, 62057 ); + _DICT.put( 57762, 62058 ); + _DICT.put( 57763, 62059 ); + _DICT.put( 57764, 62060 ); + _DICT.put( 57765, 62061 ); + _DICT.put( 57766, 62062 ); + _DICT.put( 57767, 62063 ); + _DICT.put( 57768, 62064 ); + _DICT.put( 57769, 62065 ); + _DICT.put( 57770, 62066 ); + _DICT.put( 57771, 62067 ); + _DICT.put( 57772, 62068 ); + _DICT.put( 57773, 62069 ); + _DICT.put( 57774, 62070 ); + _DICT.put( 57775, 62071 ); + _DICT.put( 57776, 62072 ); + _DICT.put( 57777, 62073 ); + _DICT.put( 57778, 62074 ); + _DICT.put( 57779, 62075 ); + _DICT.put( 57780, 62076 ); + _DICT.put( 57781, 62077 ); + _DICT.put( 57782, 62078 ); + _DICT.put( 57783, 62080 ); + _DICT.put( 57784, 62081 ); + _DICT.put( 57785, 62082 ); + _DICT.put( 57786, 62083 ); + _DICT.put( 57787, 62084 ); + _DICT.put( 57788, 62085 ); + _DICT.put( 57789, 62086 ); + _DICT.put( 57790, 62087 ); + _DICT.put( 57791, 62088 ); + _DICT.put( 57792, 62089 ); + _DICT.put( 57793, 62090 ); + _DICT.put( 57794, 62091 ); + _DICT.put( 57795, 62092 ); + _DICT.put( 57796, 62093 ); + _DICT.put( 57797, 62094 ); + _DICT.put( 57798, 62095 ); + _DICT.put( 57799, 62096 ); + _DICT.put( 57800, 62097 ); + _DICT.put( 57801, 62098 ); + _DICT.put( 57802, 62099 ); + _DICT.put( 57803, 62100 ); + _DICT.put( 57804, 62101 ); + _DICT.put( 57805, 62102 ); + _DICT.put( 57806, 62103 ); + _DICT.put( 57807, 62104 ); + _DICT.put( 57808, 62105 ); + _DICT.put( 57809, 62106 ); + _DICT.put( 57810, 62107 ); + _DICT.put( 57811, 62108 ); + _DICT.put( 57812, 62109 ); + _DICT.put( 57813, 62110 ); + _DICT.put( 57814, 62111 ); + _DICT.put( 57815, 62112 ); + _DICT.put( 57816, 62113 ); + _DICT.put( 57817, 62114 ); + _DICT.put( 57818, 62115 ); + _DICT.put( 57819, 62116 ); + _DICT.put( 57820, 62117 ); + _DICT.put( 57821, 62118 ); + _DICT.put( 57822, 62119 ); + _DICT.put( 57823, 62120 ); + _DICT.put( 57824, 62121 ); + _DICT.put( 57825, 62122 ); + _DICT.put( 57826, 62123 ); + _DICT.put( 57827, 62124 ); + _DICT.put( 57828, 62125 ); + _DICT.put( 57829, 62126 ); + _DICT.put( 57830, 62127 ); + _DICT.put( 57831, 62128 ); + _DICT.put( 57832, 62129 ); + _DICT.put( 57833, 62130 ); + _DICT.put( 57834, 62131 ); + _DICT.put( 57835, 62132 ); + _DICT.put( 57836, 62133 ); + _DICT.put( 57837, 62134 ); + _DICT.put( 57838, 62135 ); + _DICT.put( 57839, 62136 ); + _DICT.put( 57840, 62137 ); + _DICT.put( 57841, 62138 ); + _DICT.put( 57842, 62139 ); + _DICT.put( 57843, 62140 ); + _DICT.put( 57844, 62141 ); + _DICT.put( 57845, 62142 ); + _DICT.put( 57846, 62143 ); + _DICT.put( 57847, 62144 ); + _DICT.put( 57848, 62145 ); + _DICT.put( 57849, 62146 ); + _DICT.put( 57850, 62147 ); + _DICT.put( 57851, 62148 ); + _DICT.put( 57852, 62149 ); + _DICT.put( 57853, 62150 ); + _DICT.put( 57854, 62151 ); + _DICT.put( 57855, 62152 ); + _DICT.put( 57856, 62153 ); + _DICT.put( 57857, 62154 ); + _DICT.put( 57858, 62155 ); + _DICT.put( 57859, 62156 ); + _DICT.put( 57860, 62157 ); + _DICT.put( 57861, 62158 ); + _DICT.put( 57862, 62159 ); + _DICT.put( 57863, 62160 ); + _DICT.put( 57864, 62161 ); + _DICT.put( 57865, 62162 ); + _DICT.put( 57866, 62163 ); + _DICT.put( 57867, 62164 ); + _DICT.put( 57868, 62165 ); + _DICT.put( 57869, 62166 ); + _DICT.put( 57870, 62167 ); + _DICT.put( 57871, 62168 ); + _DICT.put( 57872, 62169 ); + _DICT.put( 57873, 62170 ); + _DICT.put( 57874, 62171 ); + _DICT.put( 57875, 62172 ); + _DICT.put( 57876, 62173 ); + _DICT.put( 57877, 62174 ); + _DICT.put( 57878, 62175 ); + _DICT.put( 57879, 62176 ); + _DICT.put( 57880, 62177 ); + _DICT.put( 57881, 62178 ); + _DICT.put( 57882, 62179 ); + _DICT.put( 57883, 62180 ); + _DICT.put( 57884, 62181 ); + _DICT.put( 57885, 62182 ); + _DICT.put( 57886, 62183 ); + _DICT.put( 57887, 62184 ); + _DICT.put( 57888, 62185 ); + _DICT.put( 57889, 62186 ); + _DICT.put( 57890, 62187 ); + _DICT.put( 57891, 62188 ); + _DICT.put( 57892, 62189 ); + _DICT.put( 57893, 62190 ); + _DICT.put( 57894, 62191 ); + _DICT.put( 57895, 62192 ); + _DICT.put( 57896, 62193 ); + _DICT.put( 57897, 62194 ); + _DICT.put( 57898, 62195 ); + _DICT.put( 57899, 62196 ); + _DICT.put( 57900, 62197 ); + _DICT.put( 57901, 62198 ); + _DICT.put( 57902, 62199 ); + _DICT.put( 57903, 62200 ); + _DICT.put( 57904, 62201 ); + _DICT.put( 57905, 62202 ); + _DICT.put( 57906, 62203 ); + _DICT.put( 57907, 62204 ); + _DICT.put( 57908, 62272 ); + _DICT.put( 57909, 62273 ); + _DICT.put( 57910, 62274 ); + _DICT.put( 57911, 62275 ); + _DICT.put( 57912, 62276 ); + _DICT.put( 57913, 62277 ); + _DICT.put( 57914, 62278 ); + _DICT.put( 57915, 62279 ); + _DICT.put( 57916, 62280 ); + _DICT.put( 57917, 62281 ); + _DICT.put( 57918, 62282 ); + _DICT.put( 57919, 62283 ); + _DICT.put( 57920, 62284 ); + _DICT.put( 57921, 62285 ); + _DICT.put( 57922, 62286 ); + _DICT.put( 57923, 62287 ); + _DICT.put( 57924, 62288 ); + _DICT.put( 57925, 62289 ); + _DICT.put( 57926, 62290 ); + _DICT.put( 57927, 62291 ); + _DICT.put( 57928, 62292 ); + _DICT.put( 57929, 62293 ); + _DICT.put( 57930, 62294 ); + _DICT.put( 57931, 62295 ); + _DICT.put( 57932, 62296 ); + _DICT.put( 57933, 62297 ); + _DICT.put( 57934, 62298 ); + _DICT.put( 57935, 62299 ); + _DICT.put( 57936, 62300 ); + _DICT.put( 57937, 62301 ); + _DICT.put( 57938, 62302 ); + _DICT.put( 57939, 62303 ); + _DICT.put( 57940, 62304 ); + _DICT.put( 57941, 62305 ); + _DICT.put( 57942, 62306 ); + _DICT.put( 57943, 62307 ); + _DICT.put( 57944, 62308 ); + _DICT.put( 57945, 62309 ); + _DICT.put( 57946, 62310 ); + _DICT.put( 57947, 62311 ); + _DICT.put( 57948, 62312 ); + _DICT.put( 57949, 62313 ); + _DICT.put( 57950, 62314 ); + _DICT.put( 57951, 62315 ); + _DICT.put( 57952, 62316 ); + _DICT.put( 57953, 62317 ); + _DICT.put( 57954, 62318 ); + _DICT.put( 57955, 62319 ); + _DICT.put( 57956, 62320 ); + _DICT.put( 57957, 62321 ); + _DICT.put( 57958, 62322 ); + _DICT.put( 57959, 62323 ); + _DICT.put( 57960, 62324 ); + _DICT.put( 57961, 62325 ); + _DICT.put( 57962, 62326 ); + _DICT.put( 57963, 62327 ); + _DICT.put( 57964, 62328 ); + _DICT.put( 57965, 62329 ); + _DICT.put( 57966, 62330 ); + _DICT.put( 57967, 62331 ); + _DICT.put( 57968, 62332 ); + _DICT.put( 57969, 62333 ); + _DICT.put( 57970, 62334 ); + _DICT.put( 57971, 62336 ); + _DICT.put( 57972, 62337 ); + _DICT.put( 57973, 62338 ); + _DICT.put( 57974, 62339 ); + _DICT.put( 57975, 62340 ); + _DICT.put( 57976, 62341 ); + _DICT.put( 57977, 62342 ); + _DICT.put( 57978, 62343 ); + _DICT.put( 57979, 62344 ); + _DICT.put( 57980, 62345 ); + _DICT.put( 57981, 62346 ); + _DICT.put( 57982, 62347 ); + _DICT.put( 57983, 62348 ); + _DICT.put( 57984, 62349 ); + _DICT.put( 57985, 62350 ); + _DICT.put( 57986, 62351 ); + _DICT.put( 57987, 62352 ); + _DICT.put( 57988, 62353 ); + _DICT.put( 57989, 62354 ); + _DICT.put( 57990, 62355 ); + _DICT.put( 57991, 62356 ); + _DICT.put( 57992, 62357 ); + _DICT.put( 57993, 62358 ); + _DICT.put( 57994, 62359 ); + _DICT.put( 57995, 62360 ); + _DICT.put( 57996, 62361 ); + _DICT.put( 57997, 62362 ); + _DICT.put( 57998, 62363 ); + _DICT.put( 57999, 62364 ); + _DICT.put( 58000, 62365 ); + _DICT.put( 58001, 62366 ); + _DICT.put( 58002, 62367 ); + _DICT.put( 58003, 62368 ); + _DICT.put( 58004, 62369 ); + _DICT.put( 58005, 62370 ); + _DICT.put( 58006, 62371 ); + _DICT.put( 58007, 62372 ); + _DICT.put( 58008, 62373 ); + _DICT.put( 58009, 62374 ); + _DICT.put( 58010, 62375 ); + _DICT.put( 58011, 62376 ); + _DICT.put( 58012, 62377 ); + _DICT.put( 58013, 62378 ); + _DICT.put( 58014, 62379 ); + _DICT.put( 58015, 62380 ); + _DICT.put( 58016, 62381 ); + _DICT.put( 58017, 62382 ); + _DICT.put( 58018, 62383 ); + _DICT.put( 58019, 62384 ); + _DICT.put( 58020, 62385 ); + _DICT.put( 58021, 62386 ); + _DICT.put( 58022, 62387 ); + _DICT.put( 58023, 62388 ); + _DICT.put( 58024, 62389 ); + _DICT.put( 58025, 62390 ); + _DICT.put( 58026, 62391 ); + _DICT.put( 58027, 62392 ); + _DICT.put( 58028, 62393 ); + _DICT.put( 58029, 62394 ); + _DICT.put( 58030, 62395 ); + _DICT.put( 58031, 62396 ); + _DICT.put( 58032, 62397 ); + _DICT.put( 58033, 62398 ); + _DICT.put( 58034, 62399 ); + _DICT.put( 58035, 62400 ); + _DICT.put( 58036, 62401 ); + _DICT.put( 58037, 62402 ); + _DICT.put( 58038, 62403 ); + _DICT.put( 58039, 62404 ); + _DICT.put( 58040, 62405 ); + _DICT.put( 58041, 62406 ); + _DICT.put( 58042, 62407 ); + _DICT.put( 58043, 62408 ); + _DICT.put( 58044, 62409 ); + _DICT.put( 58045, 62410 ); + _DICT.put( 58046, 62411 ); + _DICT.put( 58047, 62412 ); + _DICT.put( 58048, 62413 ); + _DICT.put( 58049, 62414 ); + _DICT.put( 58050, 62415 ); + _DICT.put( 58051, 62416 ); + _DICT.put( 58052, 62417 ); + _DICT.put( 58053, 62418 ); + _DICT.put( 58054, 62419 ); + _DICT.put( 58055, 62420 ); + _DICT.put( 58056, 62421 ); + _DICT.put( 58057, 62422 ); + _DICT.put( 58058, 62423 ); + _DICT.put( 58059, 62424 ); + _DICT.put( 58060, 62425 ); + _DICT.put( 58061, 62426 ); + _DICT.put( 58062, 62427 ); + _DICT.put( 58063, 62428 ); + _DICT.put( 58064, 62429 ); + _DICT.put( 58065, 62430 ); + _DICT.put( 58066, 62431 ); + _DICT.put( 58067, 62432 ); + _DICT.put( 58068, 62433 ); + _DICT.put( 58069, 62434 ); + _DICT.put( 58070, 62435 ); + _DICT.put( 58071, 62436 ); + _DICT.put( 58072, 62437 ); + _DICT.put( 58073, 62438 ); + _DICT.put( 58074, 62439 ); + _DICT.put( 58075, 62440 ); + _DICT.put( 58076, 62441 ); + _DICT.put( 58077, 62442 ); + _DICT.put( 58078, 62443 ); + _DICT.put( 58079, 62444 ); + _DICT.put( 58080, 62445 ); + _DICT.put( 58081, 62446 ); + _DICT.put( 58082, 62447 ); + _DICT.put( 58083, 62448 ); + _DICT.put( 58084, 62449 ); + _DICT.put( 58085, 62450 ); + _DICT.put( 58086, 62451 ); + _DICT.put( 58087, 62452 ); + _DICT.put( 58088, 62453 ); + _DICT.put( 58089, 62454 ); + _DICT.put( 58090, 62455 ); + _DICT.put( 58091, 62456 ); + _DICT.put( 58092, 62457 ); + _DICT.put( 58093, 62458 ); + _DICT.put( 58094, 62459 ); + _DICT.put( 58095, 62460 ); + _DICT.put( 58096, 62528 ); + _DICT.put( 58097, 62529 ); + _DICT.put( 58098, 62530 ); + _DICT.put( 58099, 62531 ); + _DICT.put( 58100, 62532 ); + _DICT.put( 58101, 62533 ); + _DICT.put( 58102, 62534 ); + _DICT.put( 58103, 62535 ); + _DICT.put( 58104, 62536 ); + _DICT.put( 58105, 62537 ); + _DICT.put( 58106, 62538 ); + _DICT.put( 58107, 62539 ); + _DICT.put( 58108, 62540 ); + _DICT.put( 58109, 62541 ); + _DICT.put( 58110, 62542 ); + _DICT.put( 58111, 62543 ); + _DICT.put( 58112, 62544 ); + _DICT.put( 58113, 62545 ); + _DICT.put( 58114, 62546 ); + _DICT.put( 58115, 62547 ); + _DICT.put( 58116, 62548 ); + _DICT.put( 58117, 62549 ); + _DICT.put( 58118, 62550 ); + _DICT.put( 58119, 62551 ); + _DICT.put( 58120, 62552 ); + _DICT.put( 58121, 62553 ); + _DICT.put( 58122, 62554 ); + _DICT.put( 58123, 62555 ); + _DICT.put( 58124, 62556 ); + _DICT.put( 58125, 62557 ); + _DICT.put( 58126, 62558 ); + _DICT.put( 58127, 62559 ); + _DICT.put( 58128, 62560 ); + _DICT.put( 58129, 62561 ); + _DICT.put( 58130, 62562 ); + _DICT.put( 58131, 62563 ); + _DICT.put( 58132, 62564 ); + _DICT.put( 58133, 62565 ); + _DICT.put( 58134, 62566 ); + _DICT.put( 58135, 62567 ); + _DICT.put( 58136, 62568 ); + _DICT.put( 58137, 62569 ); + _DICT.put( 58138, 62570 ); + _DICT.put( 58139, 62571 ); + _DICT.put( 58140, 62572 ); + _DICT.put( 58141, 62573 ); + _DICT.put( 58142, 62574 ); + _DICT.put( 58143, 62575 ); + _DICT.put( 58144, 62576 ); + _DICT.put( 58145, 62577 ); + _DICT.put( 58146, 62578 ); + _DICT.put( 58147, 62579 ); + _DICT.put( 58148, 62580 ); + _DICT.put( 58149, 62581 ); + _DICT.put( 58150, 62582 ); + _DICT.put( 58151, 62583 ); + _DICT.put( 58152, 62584 ); + _DICT.put( 58153, 62585 ); + _DICT.put( 58154, 62586 ); + _DICT.put( 58155, 62587 ); + _DICT.put( 58156, 62588 ); + _DICT.put( 58157, 62589 ); + _DICT.put( 58158, 62590 ); + _DICT.put( 58159, 62592 ); + _DICT.put( 58160, 62593 ); + _DICT.put( 58161, 62594 ); + _DICT.put( 58162, 62595 ); + _DICT.put( 58163, 62596 ); + _DICT.put( 58164, 62597 ); + _DICT.put( 58165, 62598 ); + _DICT.put( 58166, 62599 ); + _DICT.put( 58167, 62600 ); + _DICT.put( 58168, 62601 ); + _DICT.put( 58169, 62602 ); + _DICT.put( 58170, 62603 ); + _DICT.put( 58171, 62604 ); + _DICT.put( 58172, 62605 ); + _DICT.put( 58173, 62606 ); + _DICT.put( 58174, 62607 ); + _DICT.put( 58175, 62608 ); + _DICT.put( 58176, 62609 ); + _DICT.put( 58177, 62610 ); + _DICT.put( 58178, 62611 ); + _DICT.put( 58179, 62612 ); + _DICT.put( 58180, 62613 ); + _DICT.put( 58181, 62614 ); + _DICT.put( 58182, 62615 ); + _DICT.put( 58183, 62616 ); + _DICT.put( 58184, 62617 ); + _DICT.put( 58185, 62618 ); + _DICT.put( 58186, 62619 ); + _DICT.put( 58187, 62620 ); + _DICT.put( 58188, 62621 ); + _DICT.put( 58189, 62622 ); + _DICT.put( 58190, 62623 ); + _DICT.put( 58191, 62624 ); + _DICT.put( 58192, 62625 ); + _DICT.put( 58193, 62626 ); + _DICT.put( 58194, 62627 ); + _DICT.put( 58195, 62628 ); + _DICT.put( 58196, 62629 ); + _DICT.put( 58197, 62630 ); + _DICT.put( 58198, 62631 ); + _DICT.put( 58199, 62632 ); + _DICT.put( 58200, 62633 ); + _DICT.put( 58201, 62634 ); + _DICT.put( 58202, 62635 ); + _DICT.put( 58203, 62636 ); + _DICT.put( 58204, 62637 ); + _DICT.put( 58205, 62638 ); + _DICT.put( 58206, 62639 ); + _DICT.put( 58207, 62640 ); + _DICT.put( 58208, 62641 ); + _DICT.put( 58209, 62642 ); + _DICT.put( 58210, 62643 ); + _DICT.put( 58211, 62644 ); + _DICT.put( 58212, 62645 ); + _DICT.put( 58213, 62646 ); + _DICT.put( 58214, 62647 ); + _DICT.put( 58215, 62648 ); + _DICT.put( 58216, 62649 ); + _DICT.put( 58217, 62650 ); + _DICT.put( 58218, 62651 ); + _DICT.put( 58219, 62652 ); + _DICT.put( 58220, 62653 ); + _DICT.put( 58221, 62654 ); + _DICT.put( 58222, 62655 ); + _DICT.put( 58223, 62656 ); + _DICT.put( 58224, 62657 ); + _DICT.put( 58225, 62658 ); + _DICT.put( 58226, 62659 ); + _DICT.put( 58227, 62660 ); + _DICT.put( 58228, 62661 ); + _DICT.put( 58229, 62662 ); + _DICT.put( 58230, 62663 ); + _DICT.put( 58231, 62664 ); + _DICT.put( 58232, 62665 ); + _DICT.put( 58233, 62666 ); + _DICT.put( 58234, 62667 ); + _DICT.put( 58235, 62668 ); + _DICT.put( 58236, 62669 ); + _DICT.put( 58237, 62670 ); + _DICT.put( 58238, 62671 ); + _DICT.put( 58239, 62672 ); + _DICT.put( 58240, 62673 ); + _DICT.put( 58241, 62674 ); + _DICT.put( 58242, 62675 ); + _DICT.put( 58243, 62676 ); + _DICT.put( 58244, 62677 ); + _DICT.put( 58245, 62678 ); + _DICT.put( 58246, 62679 ); + _DICT.put( 58247, 62680 ); + _DICT.put( 58248, 62681 ); + _DICT.put( 58249, 62682 ); + _DICT.put( 58250, 62683 ); + _DICT.put( 58251, 62684 ); + _DICT.put( 58252, 62685 ); + _DICT.put( 58253, 62686 ); + _DICT.put( 58254, 62687 ); + _DICT.put( 58255, 62688 ); + _DICT.put( 58256, 62689 ); + _DICT.put( 58257, 62690 ); + _DICT.put( 58258, 62691 ); + _DICT.put( 58259, 62692 ); + _DICT.put( 58260, 62693 ); + _DICT.put( 58261, 62694 ); + _DICT.put( 58262, 62695 ); + _DICT.put( 58263, 62696 ); + _DICT.put( 58264, 62697 ); + _DICT.put( 58265, 62698 ); + _DICT.put( 58266, 62699 ); + _DICT.put( 58267, 62700 ); + _DICT.put( 58268, 62701 ); + _DICT.put( 58269, 62702 ); + _DICT.put( 58270, 62703 ); + _DICT.put( 58271, 62704 ); + _DICT.put( 58272, 62705 ); + _DICT.put( 58273, 62706 ); + _DICT.put( 58274, 62707 ); + _DICT.put( 58275, 62708 ); + _DICT.put( 58276, 62709 ); + _DICT.put( 58277, 62710 ); + _DICT.put( 58278, 62711 ); + _DICT.put( 58279, 62712 ); + _DICT.put( 58280, 62713 ); + _DICT.put( 58281, 62714 ); + _DICT.put( 58282, 62715 ); + _DICT.put( 58283, 62716 ); + _DICT.put( 58284, 62784 ); + _DICT.put( 58285, 62785 ); + _DICT.put( 58286, 62786 ); + _DICT.put( 58287, 62787 ); + _DICT.put( 58288, 62788 ); + _DICT.put( 58289, 62789 ); + _DICT.put( 58290, 62790 ); + _DICT.put( 58291, 62791 ); + _DICT.put( 58292, 62792 ); + _DICT.put( 58293, 62793 ); + _DICT.put( 58294, 62794 ); + _DICT.put( 58295, 62795 ); + _DICT.put( 58296, 62796 ); + _DICT.put( 58297, 62797 ); + _DICT.put( 58298, 62798 ); + _DICT.put( 58299, 62799 ); + _DICT.put( 58300, 62800 ); + _DICT.put( 58301, 62801 ); + _DICT.put( 58302, 62802 ); + _DICT.put( 58303, 62803 ); + _DICT.put( 58304, 62804 ); + _DICT.put( 58305, 62805 ); + _DICT.put( 58306, 62806 ); + _DICT.put( 58307, 62807 ); + _DICT.put( 58308, 62808 ); + _DICT.put( 58309, 62809 ); + _DICT.put( 58310, 62810 ); + _DICT.put( 58311, 62811 ); + _DICT.put( 58312, 62812 ); + _DICT.put( 58313, 62813 ); + _DICT.put( 58314, 62814 ); + _DICT.put( 58315, 62815 ); + _DICT.put( 58316, 62816 ); + _DICT.put( 58317, 62817 ); + _DICT.put( 58318, 62818 ); + _DICT.put( 58319, 62819 ); + _DICT.put( 58320, 62820 ); + _DICT.put( 58321, 62821 ); + _DICT.put( 58322, 62822 ); + _DICT.put( 58323, 62823 ); + _DICT.put( 58324, 62824 ); + _DICT.put( 58325, 62825 ); + _DICT.put( 58326, 62826 ); + _DICT.put( 58327, 62827 ); + _DICT.put( 58328, 62828 ); + _DICT.put( 58329, 62829 ); + _DICT.put( 58330, 62830 ); + _DICT.put( 58331, 62831 ); + _DICT.put( 58332, 62832 ); + _DICT.put( 58333, 62833 ); + _DICT.put( 58334, 62834 ); + _DICT.put( 58335, 62835 ); + _DICT.put( 58336, 62836 ); + _DICT.put( 58337, 62837 ); + _DICT.put( 58338, 62838 ); + _DICT.put( 58339, 62839 ); + _DICT.put( 58340, 62840 ); + _DICT.put( 58341, 62841 ); + _DICT.put( 58342, 62842 ); + _DICT.put( 58343, 62843 ); + _DICT.put( 58344, 62844 ); + _DICT.put( 58345, 62845 ); + _DICT.put( 58346, 62846 ); + _DICT.put( 58347, 62848 ); + _DICT.put( 58348, 62849 ); + _DICT.put( 58349, 62850 ); + _DICT.put( 58350, 62851 ); + _DICT.put( 58351, 62852 ); + _DICT.put( 58352, 62853 ); + _DICT.put( 58353, 62854 ); + _DICT.put( 58354, 62855 ); + _DICT.put( 58355, 62856 ); + _DICT.put( 58356, 62857 ); + _DICT.put( 58357, 62858 ); + _DICT.put( 58358, 62859 ); + _DICT.put( 58359, 62860 ); + _DICT.put( 58360, 62861 ); + _DICT.put( 58361, 62862 ); + _DICT.put( 58362, 62863 ); + _DICT.put( 58363, 62864 ); + _DICT.put( 58364, 62865 ); + _DICT.put( 58365, 62866 ); + _DICT.put( 58366, 62867 ); + _DICT.put( 58367, 62868 ); + _DICT.put( 58368, 62869 ); + _DICT.put( 58369, 62870 ); + _DICT.put( 58370, 62871 ); + _DICT.put( 58371, 62872 ); + _DICT.put( 58372, 62873 ); + _DICT.put( 58373, 62874 ); + _DICT.put( 58374, 62875 ); + _DICT.put( 58375, 62876 ); + _DICT.put( 58376, 62877 ); + _DICT.put( 58377, 62878 ); + _DICT.put( 58378, 62879 ); + _DICT.put( 58379, 62880 ); + _DICT.put( 58380, 62881 ); + _DICT.put( 58381, 62882 ); + _DICT.put( 58382, 62883 ); + _DICT.put( 58383, 62884 ); + _DICT.put( 58384, 62885 ); + _DICT.put( 58385, 62886 ); + _DICT.put( 58386, 62887 ); + _DICT.put( 58387, 62888 ); + _DICT.put( 58388, 62889 ); + _DICT.put( 58389, 62890 ); + _DICT.put( 58390, 62891 ); + _DICT.put( 58391, 62892 ); + _DICT.put( 58392, 62893 ); + _DICT.put( 58393, 62894 ); + _DICT.put( 58394, 62895 ); + _DICT.put( 58395, 62896 ); + _DICT.put( 58396, 62897 ); + _DICT.put( 58397, 62898 ); + _DICT.put( 58398, 62899 ); + _DICT.put( 58399, 62900 ); + _DICT.put( 58400, 62901 ); + _DICT.put( 58401, 62902 ); + _DICT.put( 58402, 62903 ); + _DICT.put( 58403, 62904 ); + _DICT.put( 58404, 62905 ); + _DICT.put( 58405, 62906 ); + _DICT.put( 58406, 62907 ); + _DICT.put( 58407, 62908 ); + _DICT.put( 58408, 62909 ); + _DICT.put( 58409, 62910 ); + _DICT.put( 58410, 62911 ); + _DICT.put( 58411, 62912 ); + _DICT.put( 58412, 62913 ); + _DICT.put( 58413, 62914 ); + _DICT.put( 58414, 62915 ); + _DICT.put( 58415, 62916 ); + _DICT.put( 58416, 62917 ); + _DICT.put( 58417, 62918 ); + _DICT.put( 58418, 62919 ); + _DICT.put( 58419, 62920 ); + _DICT.put( 58420, 62921 ); + _DICT.put( 58421, 62922 ); + _DICT.put( 58422, 62923 ); + _DICT.put( 58423, 62924 ); + _DICT.put( 58424, 62925 ); + _DICT.put( 58425, 62926 ); + _DICT.put( 58426, 62927 ); + _DICT.put( 58427, 62928 ); + _DICT.put( 58428, 62929 ); + _DICT.put( 58429, 62930 ); + _DICT.put( 58430, 62931 ); + _DICT.put( 58431, 62932 ); + _DICT.put( 58432, 62933 ); + _DICT.put( 58433, 62934 ); + _DICT.put( 58434, 62935 ); + _DICT.put( 58435, 62936 ); + _DICT.put( 58436, 62937 ); + _DICT.put( 58437, 62938 ); + _DICT.put( 58438, 62939 ); + _DICT.put( 58439, 62940 ); + _DICT.put( 58440, 62941 ); + _DICT.put( 58441, 62942 ); + _DICT.put( 58442, 62943 ); + _DICT.put( 58443, 62944 ); + _DICT.put( 58444, 62945 ); + _DICT.put( 58445, 62946 ); + _DICT.put( 58446, 62947 ); + _DICT.put( 58447, 62948 ); + _DICT.put( 58448, 62949 ); + _DICT.put( 58449, 62950 ); + _DICT.put( 58450, 62951 ); + _DICT.put( 58451, 62952 ); + _DICT.put( 58452, 62953 ); + _DICT.put( 58453, 62954 ); + _DICT.put( 58454, 62955 ); + _DICT.put( 58455, 62956 ); + _DICT.put( 58456, 62957 ); + _DICT.put( 58457, 62958 ); + _DICT.put( 58458, 62959 ); + _DICT.put( 58459, 62960 ); + _DICT.put( 58460, 62961 ); + _DICT.put( 58461, 62962 ); + _DICT.put( 58462, 62963 ); + _DICT.put( 58463, 62964 ); + _DICT.put( 58464, 62965 ); + _DICT.put( 58465, 62966 ); + _DICT.put( 58466, 62967 ); + _DICT.put( 58467, 62968 ); + _DICT.put( 58468, 62969 ); + _DICT.put( 58469, 62970 ); + _DICT.put( 58470, 62971 ); + _DICT.put( 58471, 62972 ); + _DICT.put( 58472, 63040 ); + _DICT.put( 58473, 63041 ); + _DICT.put( 58474, 63042 ); + _DICT.put( 58475, 63043 ); + _DICT.put( 58476, 63044 ); + _DICT.put( 58477, 63045 ); + _DICT.put( 58478, 63046 ); + _DICT.put( 58479, 63047 ); + _DICT.put( 58480, 63048 ); + _DICT.put( 58481, 63049 ); + _DICT.put( 58482, 63050 ); + _DICT.put( 58483, 63051 ); + _DICT.put( 58484, 63052 ); + _DICT.put( 58485, 63053 ); + _DICT.put( 58486, 63054 ); + _DICT.put( 58487, 63055 ); + _DICT.put( 58488, 63056 ); + _DICT.put( 58489, 63057 ); + _DICT.put( 58490, 63058 ); + _DICT.put( 58491, 63059 ); + _DICT.put( 58492, 63060 ); + _DICT.put( 58493, 63061 ); + _DICT.put( 58494, 63062 ); + _DICT.put( 58495, 63063 ); + _DICT.put( 58496, 63064 ); + _DICT.put( 58497, 63065 ); + _DICT.put( 58498, 63066 ); + _DICT.put( 58499, 63067 ); + _DICT.put( 58500, 63068 ); + _DICT.put( 58501, 63069 ); + _DICT.put( 58502, 63070 ); + _DICT.put( 58503, 63071 ); + _DICT.put( 58504, 63072 ); + _DICT.put( 58505, 63073 ); + _DICT.put( 58506, 63074 ); + _DICT.put( 58507, 63075 ); + _DICT.put( 58508, 63076 ); + _DICT.put( 58509, 63077 ); + _DICT.put( 58510, 63078 ); + _DICT.put( 58511, 63079 ); + _DICT.put( 58512, 63080 ); + _DICT.put( 58513, 63081 ); + _DICT.put( 58514, 63082 ); + _DICT.put( 58515, 63083 ); + _DICT.put( 58516, 63084 ); + _DICT.put( 58517, 63085 ); + _DICT.put( 58518, 63086 ); + _DICT.put( 58519, 63087 ); + _DICT.put( 58520, 63088 ); + _DICT.put( 58521, 63089 ); + _DICT.put( 58522, 63090 ); + _DICT.put( 58523, 63091 ); + _DICT.put( 58524, 63092 ); + _DICT.put( 58525, 63093 ); + _DICT.put( 58526, 63094 ); + _DICT.put( 58527, 63095 ); + _DICT.put( 58528, 63096 ); + _DICT.put( 58529, 63097 ); + _DICT.put( 58530, 63098 ); + _DICT.put( 58531, 63099 ); + _DICT.put( 58532, 63100 ); + _DICT.put( 58533, 63101 ); + _DICT.put( 58534, 63102 ); + _DICT.put( 58535, 63104 ); + _DICT.put( 58536, 63105 ); + _DICT.put( 58537, 63106 ); + _DICT.put( 58538, 63107 ); + _DICT.put( 58539, 63108 ); + _DICT.put( 58540, 63109 ); + _DICT.put( 58541, 63110 ); + _DICT.put( 58542, 63111 ); + _DICT.put( 58543, 63112 ); + _DICT.put( 58544, 63113 ); + _DICT.put( 58545, 63114 ); + _DICT.put( 58546, 63115 ); + _DICT.put( 58547, 63116 ); + _DICT.put( 58548, 63117 ); + _DICT.put( 58549, 63118 ); + _DICT.put( 58550, 63119 ); + _DICT.put( 58551, 63120 ); + _DICT.put( 58552, 63121 ); + _DICT.put( 58553, 63122 ); + _DICT.put( 58554, 63123 ); + _DICT.put( 58555, 63124 ); + _DICT.put( 58556, 63125 ); + _DICT.put( 58557, 63126 ); + _DICT.put( 58558, 63127 ); + _DICT.put( 58559, 63128 ); + _DICT.put( 58560, 63129 ); + _DICT.put( 58561, 63130 ); + _DICT.put( 58562, 63131 ); + _DICT.put( 58563, 63132 ); + _DICT.put( 58564, 63133 ); + _DICT.put( 58565, 63134 ); + _DICT.put( 58566, 63135 ); + _DICT.put( 58567, 63136 ); + _DICT.put( 58568, 63137 ); + _DICT.put( 58569, 63138 ); + _DICT.put( 58570, 63139 ); + _DICT.put( 58571, 63140 ); + _DICT.put( 58572, 63141 ); + _DICT.put( 58573, 63142 ); + _DICT.put( 58574, 63143 ); + _DICT.put( 58575, 63144 ); + _DICT.put( 58576, 63145 ); + _DICT.put( 58577, 63146 ); + _DICT.put( 58578, 63147 ); + _DICT.put( 58579, 63148 ); + _DICT.put( 58580, 63149 ); + _DICT.put( 58581, 63150 ); + _DICT.put( 58582, 63151 ); + _DICT.put( 58583, 63152 ); + _DICT.put( 58584, 63153 ); + _DICT.put( 58585, 63154 ); + _DICT.put( 58586, 63155 ); + _DICT.put( 58587, 63156 ); + _DICT.put( 58588, 63157 ); + _DICT.put( 58589, 63158 ); + _DICT.put( 58590, 63159 ); + _DICT.put( 58591, 63160 ); + _DICT.put( 58592, 63161 ); + _DICT.put( 58593, 63162 ); + _DICT.put( 58594, 63163 ); + _DICT.put( 58595, 63164 ); + _DICT.put( 58596, 63165 ); + _DICT.put( 58597, 63166 ); + _DICT.put( 58598, 63167 ); + _DICT.put( 58599, 63168 ); + _DICT.put( 58600, 63169 ); + _DICT.put( 58601, 63170 ); + _DICT.put( 58602, 63171 ); + _DICT.put( 58603, 63172 ); + _DICT.put( 58604, 63173 ); + _DICT.put( 58605, 63174 ); + _DICT.put( 58606, 63175 ); + _DICT.put( 58607, 63176 ); + _DICT.put( 58608, 63177 ); + _DICT.put( 58609, 63178 ); + _DICT.put( 58610, 63179 ); + _DICT.put( 58611, 63180 ); + _DICT.put( 58612, 63181 ); + _DICT.put( 58613, 63182 ); + _DICT.put( 58614, 63183 ); + _DICT.put( 58615, 63184 ); + _DICT.put( 58616, 63185 ); + _DICT.put( 58617, 63186 ); + _DICT.put( 58618, 63187 ); + _DICT.put( 58619, 63188 ); + _DICT.put( 58620, 63189 ); + _DICT.put( 58621, 63190 ); + _DICT.put( 58622, 63191 ); + _DICT.put( 58623, 63192 ); + _DICT.put( 58624, 63193 ); + _DICT.put( 58625, 63194 ); + _DICT.put( 58626, 63195 ); + _DICT.put( 58627, 63196 ); + _DICT.put( 58628, 63197 ); + _DICT.put( 58629, 63198 ); + _DICT.put( 58630, 63199 ); + _DICT.put( 58631, 63200 ); + _DICT.put( 58632, 63201 ); + _DICT.put( 58633, 63202 ); + _DICT.put( 58634, 63203 ); + _DICT.put( 58635, 63204 ); + _DICT.put( 58636, 63205 ); + _DICT.put( 58637, 63206 ); + _DICT.put( 58638, 63207 ); + _DICT.put( 58639, 63208 ); + _DICT.put( 58640, 63209 ); + _DICT.put( 58641, 63210 ); + _DICT.put( 58642, 63211 ); + _DICT.put( 58643, 63212 ); + _DICT.put( 58644, 63213 ); + _DICT.put( 58645, 63214 ); + _DICT.put( 58646, 63215 ); + _DICT.put( 58647, 63216 ); + _DICT.put( 58648, 63217 ); + _DICT.put( 58649, 63218 ); + _DICT.put( 58650, 63219 ); + _DICT.put( 58651, 63220 ); + _DICT.put( 58652, 63221 ); + _DICT.put( 58653, 63222 ); + _DICT.put( 58654, 63223 ); + _DICT.put( 58655, 63224 ); + _DICT.put( 58656, 63225 ); + _DICT.put( 58657, 63226 ); + _DICT.put( 58658, 63227 ); + _DICT.put( 58659, 63228 ); + _DICT.put( 58660, 63296 ); + _DICT.put( 58661, 63297 ); + _DICT.put( 58662, 63298 ); + _DICT.put( 58663, 63299 ); + _DICT.put( 58664, 63300 ); + _DICT.put( 58665, 63301 ); + _DICT.put( 58666, 63302 ); + _DICT.put( 58667, 63303 ); + _DICT.put( 58668, 63304 ); + _DICT.put( 58669, 63305 ); + _DICT.put( 58670, 63306 ); + _DICT.put( 58671, 63307 ); + _DICT.put( 58672, 63308 ); + _DICT.put( 58673, 63309 ); + _DICT.put( 58674, 63310 ); + _DICT.put( 58675, 63311 ); + _DICT.put( 58676, 63312 ); + _DICT.put( 58677, 63313 ); + _DICT.put( 58678, 63314 ); + _DICT.put( 58679, 63315 ); + _DICT.put( 58680, 63316 ); + _DICT.put( 58681, 63317 ); + _DICT.put( 58682, 63318 ); + _DICT.put( 58683, 63319 ); + _DICT.put( 58684, 63320 ); + _DICT.put( 58685, 63321 ); + _DICT.put( 58686, 63322 ); + _DICT.put( 58687, 63323 ); + _DICT.put( 58688, 63324 ); + _DICT.put( 58689, 63325 ); + _DICT.put( 58690, 63326 ); + _DICT.put( 58691, 63327 ); + _DICT.put( 58692, 63328 ); + _DICT.put( 58693, 63329 ); + _DICT.put( 58694, 63330 ); + _DICT.put( 58695, 63331 ); + _DICT.put( 58696, 63332 ); + _DICT.put( 58697, 63333 ); + _DICT.put( 58698, 63334 ); + _DICT.put( 58699, 63335 ); + _DICT.put( 58700, 63336 ); + _DICT.put( 58701, 63337 ); + _DICT.put( 58702, 63338 ); + _DICT.put( 58703, 63339 ); + _DICT.put( 58704, 63340 ); + _DICT.put( 58705, 63341 ); + _DICT.put( 58706, 63342 ); + _DICT.put( 58707, 63343 ); + _DICT.put( 58708, 63344 ); + _DICT.put( 58709, 63345 ); + _DICT.put( 58710, 63346 ); + _DICT.put( 58711, 63347 ); + _DICT.put( 58712, 63348 ); + _DICT.put( 58713, 63349 ); + _DICT.put( 58714, 63350 ); + _DICT.put( 58715, 63351 ); + _DICT.put( 58716, 63352 ); + _DICT.put( 58717, 63353 ); + _DICT.put( 58718, 63354 ); + _DICT.put( 58719, 63355 ); + _DICT.put( 58720, 63356 ); + _DICT.put( 58721, 63357 ); + _DICT.put( 58722, 63358 ); + _DICT.put( 58723, 63360 ); + _DICT.put( 58724, 63361 ); + _DICT.put( 58725, 63362 ); + _DICT.put( 58726, 63363 ); + _DICT.put( 58727, 63364 ); + _DICT.put( 58728, 63365 ); + _DICT.put( 58729, 63366 ); + _DICT.put( 58730, 63367 ); + _DICT.put( 58731, 63368 ); + _DICT.put( 58732, 63369 ); + _DICT.put( 58733, 63370 ); + _DICT.put( 58734, 63371 ); + _DICT.put( 58735, 63372 ); + _DICT.put( 58736, 63373 ); + _DICT.put( 58737, 63374 ); + _DICT.put( 58738, 63375 ); + _DICT.put( 58739, 63376 ); + _DICT.put( 58740, 63377 ); + _DICT.put( 58741, 63378 ); + _DICT.put( 58742, 63379 ); + _DICT.put( 58743, 63380 ); + _DICT.put( 58744, 63381 ); + _DICT.put( 58745, 63382 ); + _DICT.put( 58746, 63383 ); + _DICT.put( 58747, 63384 ); + _DICT.put( 58748, 63385 ); + _DICT.put( 58749, 63386 ); + _DICT.put( 58750, 63387 ); + _DICT.put( 58751, 63388 ); + _DICT.put( 58752, 63389 ); + _DICT.put( 58753, 63390 ); + _DICT.put( 58754, 63391 ); + _DICT.put( 58755, 63392 ); + _DICT.put( 58756, 63393 ); + _DICT.put( 58757, 63394 ); + _DICT.put( 58758, 63395 ); + _DICT.put( 58759, 63396 ); + _DICT.put( 58760, 63397 ); + _DICT.put( 58761, 63398 ); + _DICT.put( 58762, 63399 ); + _DICT.put( 58763, 63400 ); + _DICT.put( 58764, 63401 ); + _DICT.put( 58765, 63402 ); + _DICT.put( 58766, 63403 ); + _DICT.put( 58767, 63404 ); + _DICT.put( 58768, 63405 ); + _DICT.put( 58769, 63406 ); + _DICT.put( 58770, 63407 ); + _DICT.put( 58771, 63408 ); + _DICT.put( 58772, 63409 ); + _DICT.put( 58773, 63410 ); + _DICT.put( 58774, 63411 ); + _DICT.put( 58775, 63412 ); + _DICT.put( 58776, 63413 ); + _DICT.put( 58777, 63414 ); + _DICT.put( 58778, 63415 ); + _DICT.put( 58779, 63416 ); + _DICT.put( 58780, 63417 ); + _DICT.put( 58781, 63418 ); + _DICT.put( 58782, 63419 ); + _DICT.put( 58783, 63420 ); + _DICT.put( 58784, 63421 ); + _DICT.put( 58785, 63422 ); + _DICT.put( 58786, 63423 ); + _DICT.put( 58787, 63424 ); + _DICT.put( 58788, 63425 ); + _DICT.put( 58789, 63426 ); + _DICT.put( 58790, 63427 ); + _DICT.put( 58791, 63428 ); + _DICT.put( 58792, 63429 ); + _DICT.put( 58793, 63430 ); + _DICT.put( 58794, 63431 ); + _DICT.put( 58795, 63432 ); + _DICT.put( 58796, 63433 ); + _DICT.put( 58797, 63434 ); + _DICT.put( 58798, 63435 ); + _DICT.put( 58799, 63436 ); + _DICT.put( 58800, 63437 ); + _DICT.put( 58801, 63438 ); + _DICT.put( 58802, 63439 ); + _DICT.put( 58803, 63440 ); + _DICT.put( 58804, 63441 ); + _DICT.put( 58805, 63442 ); + _DICT.put( 58806, 63443 ); + _DICT.put( 58807, 63444 ); + _DICT.put( 58808, 63445 ); + _DICT.put( 58809, 63446 ); + _DICT.put( 58810, 63447 ); + _DICT.put( 58811, 63448 ); + _DICT.put( 58812, 63449 ); + _DICT.put( 58813, 63450 ); + _DICT.put( 58814, 63451 ); + _DICT.put( 58815, 63452 ); + _DICT.put( 58816, 63453 ); + _DICT.put( 58817, 63454 ); + _DICT.put( 58818, 63455 ); + _DICT.put( 58819, 63456 ); + _DICT.put( 58820, 63457 ); + _DICT.put( 58821, 63458 ); + _DICT.put( 58822, 63459 ); + _DICT.put( 58823, 63460 ); + _DICT.put( 58824, 63461 ); + _DICT.put( 58825, 63462 ); + _DICT.put( 58826, 63463 ); + _DICT.put( 58827, 63464 ); + _DICT.put( 58828, 63465 ); + _DICT.put( 58829, 63466 ); + _DICT.put( 58830, 63467 ); + _DICT.put( 58831, 63468 ); + _DICT.put( 58832, 63469 ); + _DICT.put( 58833, 63470 ); + _DICT.put( 58834, 63471 ); + _DICT.put( 58835, 63472 ); + _DICT.put( 58836, 63473 ); + _DICT.put( 58837, 63474 ); + _DICT.put( 58838, 63475 ); + _DICT.put( 58839, 63476 ); + _DICT.put( 58840, 63477 ); + _DICT.put( 58841, 63478 ); + _DICT.put( 58842, 63479 ); + _DICT.put( 58843, 63480 ); + _DICT.put( 58844, 63481 ); + _DICT.put( 58845, 63482 ); + _DICT.put( 58846, 63483 ); + _DICT.put( 58847, 63484 ); + _DICT.put( 58848, 63552 ); + _DICT.put( 58849, 63553 ); + _DICT.put( 58850, 63554 ); + _DICT.put( 58851, 63555 ); + _DICT.put( 58852, 63556 ); + _DICT.put( 58853, 63557 ); + _DICT.put( 58854, 63558 ); + _DICT.put( 58855, 63559 ); + _DICT.put( 58856, 63560 ); + _DICT.put( 58857, 63561 ); + _DICT.put( 58858, 63562 ); + _DICT.put( 58859, 63563 ); + _DICT.put( 58860, 63564 ); + _DICT.put( 58861, 63565 ); + _DICT.put( 58862, 63566 ); + _DICT.put( 58863, 63567 ); + _DICT.put( 58864, 63568 ); + _DICT.put( 58865, 63569 ); + _DICT.put( 58866, 63570 ); + _DICT.put( 58867, 63571 ); + _DICT.put( 58868, 63572 ); + _DICT.put( 58869, 63573 ); + _DICT.put( 58870, 63574 ); + _DICT.put( 58871, 63575 ); + _DICT.put( 58872, 63576 ); + _DICT.put( 58873, 63577 ); + _DICT.put( 58874, 63578 ); + _DICT.put( 58875, 63579 ); + _DICT.put( 58876, 63580 ); + _DICT.put( 58877, 63581 ); + _DICT.put( 58878, 63582 ); + _DICT.put( 58879, 63583 ); + _DICT.put( 58880, 63584 ); + _DICT.put( 58881, 63585 ); + _DICT.put( 58882, 63586 ); + _DICT.put( 58883, 63587 ); + _DICT.put( 58884, 63588 ); + _DICT.put( 58885, 63589 ); + _DICT.put( 58886, 63590 ); + _DICT.put( 58887, 63591 ); + _DICT.put( 58888, 63592 ); + _DICT.put( 58889, 63593 ); + _DICT.put( 58890, 63594 ); + _DICT.put( 58891, 63595 ); + _DICT.put( 58892, 63596 ); + _DICT.put( 58893, 63597 ); + _DICT.put( 58894, 63598 ); + _DICT.put( 58895, 63599 ); + _DICT.put( 58896, 63600 ); + _DICT.put( 58897, 63601 ); + _DICT.put( 58898, 63602 ); + _DICT.put( 58899, 63603 ); + _DICT.put( 58900, 63604 ); + _DICT.put( 58901, 63605 ); + _DICT.put( 58902, 63606 ); + _DICT.put( 58903, 63607 ); + _DICT.put( 58904, 63608 ); + _DICT.put( 58905, 63609 ); + _DICT.put( 58906, 63610 ); + _DICT.put( 58907, 63611 ); + _DICT.put( 58908, 63612 ); + _DICT.put( 58909, 63613 ); + _DICT.put( 58910, 63614 ); + _DICT.put( 58911, 63616 ); + _DICT.put( 58912, 63617 ); + _DICT.put( 58913, 63618 ); + _DICT.put( 58914, 63619 ); + _DICT.put( 58915, 63620 ); + _DICT.put( 58916, 63621 ); + _DICT.put( 58917, 63622 ); + _DICT.put( 58918, 63623 ); + _DICT.put( 58919, 63624 ); + _DICT.put( 58920, 63625 ); + _DICT.put( 58921, 63626 ); + _DICT.put( 58922, 63627 ); + _DICT.put( 58923, 63628 ); + _DICT.put( 58924, 63629 ); + _DICT.put( 58925, 63630 ); + _DICT.put( 58926, 63631 ); + _DICT.put( 58927, 63632 ); + _DICT.put( 58928, 63633 ); + _DICT.put( 58929, 63634 ); + _DICT.put( 58930, 63635 ); + _DICT.put( 58931, 63636 ); + _DICT.put( 58932, 63637 ); + _DICT.put( 58933, 63638 ); + _DICT.put( 58934, 63639 ); + _DICT.put( 58935, 63640 ); + _DICT.put( 58936, 63641 ); + _DICT.put( 58937, 63642 ); + _DICT.put( 58938, 63643 ); + _DICT.put( 58939, 63644 ); + _DICT.put( 58940, 63645 ); + _DICT.put( 58941, 63646 ); + _DICT.put( 58942, 63647 ); + _DICT.put( 58943, 63648 ); + _DICT.put( 58944, 63649 ); + _DICT.put( 58945, 63650 ); + _DICT.put( 58946, 63651 ); + _DICT.put( 58947, 63652 ); + _DICT.put( 58948, 63653 ); + _DICT.put( 58949, 63654 ); + _DICT.put( 58950, 63655 ); + _DICT.put( 58951, 63656 ); + _DICT.put( 58952, 63657 ); + _DICT.put( 58953, 63658 ); + _DICT.put( 58954, 63659 ); + _DICT.put( 58955, 63660 ); + _DICT.put( 58956, 63661 ); + _DICT.put( 58957, 63662 ); + _DICT.put( 58958, 63663 ); + _DICT.put( 58959, 63664 ); + _DICT.put( 58960, 63665 ); + _DICT.put( 58961, 63666 ); + _DICT.put( 58962, 63667 ); + _DICT.put( 58963, 63668 ); + _DICT.put( 58964, 63669 ); + _DICT.put( 58965, 63670 ); + _DICT.put( 58966, 63671 ); + _DICT.put( 58967, 63672 ); + _DICT.put( 58968, 63673 ); + _DICT.put( 58969, 63674 ); + _DICT.put( 58970, 63675 ); + _DICT.put( 58971, 63676 ); + _DICT.put( 58972, 63677 ); + _DICT.put( 58973, 63678 ); + _DICT.put( 58974, 63679 ); + _DICT.put( 58975, 63680 ); + _DICT.put( 58976, 63681 ); + _DICT.put( 58977, 63682 ); + _DICT.put( 58978, 63683 ); + _DICT.put( 58979, 63684 ); + _DICT.put( 58980, 63685 ); + _DICT.put( 58981, 63686 ); + _DICT.put( 58982, 63687 ); + _DICT.put( 58983, 63688 ); + _DICT.put( 58984, 63689 ); + _DICT.put( 58985, 63690 ); + _DICT.put( 58986, 63691 ); + _DICT.put( 58987, 63692 ); + _DICT.put( 58988, 63693 ); + _DICT.put( 58989, 63694 ); + _DICT.put( 58990, 63695 ); + _DICT.put( 58991, 63696 ); + _DICT.put( 58992, 63697 ); + _DICT.put( 58993, 63698 ); + _DICT.put( 58994, 63699 ); + _DICT.put( 58995, 63700 ); + _DICT.put( 58996, 63701 ); + _DICT.put( 58997, 63702 ); + _DICT.put( 58998, 63703 ); + _DICT.put( 58999, 63704 ); + _DICT.put( 59000, 63705 ); + _DICT.put( 59001, 63706 ); + _DICT.put( 59002, 63707 ); + _DICT.put( 59003, 63708 ); + _DICT.put( 59004, 63709 ); + _DICT.put( 59005, 63710 ); + _DICT.put( 59006, 63711 ); + _DICT.put( 59007, 63712 ); + _DICT.put( 59008, 63713 ); + _DICT.put( 59009, 63714 ); + _DICT.put( 59010, 63715 ); + _DICT.put( 59011, 63716 ); + _DICT.put( 59012, 63717 ); + _DICT.put( 59013, 63718 ); + _DICT.put( 59014, 63719 ); + _DICT.put( 59015, 63720 ); + _DICT.put( 59016, 63721 ); + _DICT.put( 59017, 63722 ); + _DICT.put( 59018, 63723 ); + _DICT.put( 59019, 63724 ); + _DICT.put( 59020, 63725 ); + _DICT.put( 59021, 63726 ); + _DICT.put( 59022, 63727 ); + _DICT.put( 59023, 63728 ); + _DICT.put( 59024, 63729 ); + _DICT.put( 59025, 63730 ); + _DICT.put( 59026, 63731 ); + _DICT.put( 59027, 63732 ); + _DICT.put( 59028, 63733 ); + _DICT.put( 59029, 63734 ); + _DICT.put( 59030, 63735 ); + _DICT.put( 59031, 63736 ); + _DICT.put( 59032, 63737 ); + _DICT.put( 59033, 63738 ); + _DICT.put( 59034, 63739 ); + _DICT.put( 59035, 63740 ); + _DICT.put( 59036, 63808 ); + _DICT.put( 59037, 63809 ); + _DICT.put( 59038, 63810 ); + _DICT.put( 59039, 63811 ); + _DICT.put( 59040, 63812 ); + _DICT.put( 59041, 63813 ); + _DICT.put( 59042, 63814 ); + _DICT.put( 59043, 63815 ); + _DICT.put( 59044, 63816 ); + _DICT.put( 59045, 63817 ); + _DICT.put( 59046, 63818 ); + _DICT.put( 59047, 63819 ); + _DICT.put( 59048, 63820 ); + _DICT.put( 59049, 63821 ); + _DICT.put( 59050, 63822 ); + _DICT.put( 59051, 63823 ); + _DICT.put( 59052, 63824 ); + _DICT.put( 59053, 63825 ); + _DICT.put( 59054, 63826 ); + _DICT.put( 59055, 63827 ); + _DICT.put( 59056, 63828 ); + _DICT.put( 59057, 63829 ); + _DICT.put( 59058, 63830 ); + _DICT.put( 59059, 63831 ); + _DICT.put( 59060, 63832 ); + _DICT.put( 59061, 63833 ); + _DICT.put( 59062, 63834 ); + _DICT.put( 59063, 63835 ); + _DICT.put( 59064, 63836 ); + _DICT.put( 59065, 63837 ); + _DICT.put( 59066, 63838 ); + _DICT.put( 59067, 63839 ); + _DICT.put( 59068, 63840 ); + _DICT.put( 59069, 63841 ); + _DICT.put( 59070, 63842 ); + _DICT.put( 59071, 63843 ); + _DICT.put( 59072, 63844 ); + _DICT.put( 59073, 63845 ); + _DICT.put( 59074, 63846 ); + _DICT.put( 59075, 63847 ); + _DICT.put( 59076, 63848 ); + _DICT.put( 59077, 63849 ); + _DICT.put( 59078, 63850 ); + _DICT.put( 59079, 63851 ); + _DICT.put( 59080, 63852 ); + _DICT.put( 59081, 63853 ); + _DICT.put( 59082, 63854 ); + _DICT.put( 59083, 63855 ); + _DICT.put( 59084, 63856 ); + _DICT.put( 59085, 63857 ); + _DICT.put( 59086, 63858 ); + _DICT.put( 59087, 63859 ); + _DICT.put( 59088, 63860 ); + _DICT.put( 59089, 63861 ); + _DICT.put( 59090, 63862 ); + _DICT.put( 59091, 63863 ); + _DICT.put( 59092, 63864 ); + _DICT.put( 59093, 63865 ); + _DICT.put( 59094, 63866 ); + _DICT.put( 59095, 63867 ); + _DICT.put( 59096, 63868 ); + _DICT.put( 59097, 63869 ); + _DICT.put( 59098, 63870 ); + _DICT.put( 59099, 63872 ); + _DICT.put( 59100, 63873 ); + _DICT.put( 59101, 63874 ); + _DICT.put( 59102, 63875 ); + _DICT.put( 59103, 63876 ); + _DICT.put( 59104, 63877 ); + _DICT.put( 59105, 63878 ); + _DICT.put( 59106, 63879 ); + _DICT.put( 59107, 63880 ); + _DICT.put( 59108, 63881 ); + _DICT.put( 59109, 63882 ); + _DICT.put( 59110, 63883 ); + _DICT.put( 59111, 63884 ); + _DICT.put( 59112, 63885 ); + _DICT.put( 59113, 63886 ); + _DICT.put( 59114, 63887 ); + _DICT.put( 59115, 63888 ); + _DICT.put( 59116, 63889 ); + _DICT.put( 59117, 63890 ); + _DICT.put( 59118, 63891 ); + _DICT.put( 59119, 63892 ); + _DICT.put( 59120, 63893 ); + _DICT.put( 59121, 63894 ); + _DICT.put( 59122, 63895 ); + _DICT.put( 59123, 63896 ); + _DICT.put( 59124, 63897 ); + _DICT.put( 59125, 63898 ); + _DICT.put( 59126, 63899 ); + _DICT.put( 59127, 63900 ); + _DICT.put( 59128, 63901 ); + _DICT.put( 59129, 63902 ); + _DICT.put( 59130, 63903 ); + _DICT.put( 59131, 63904 ); + _DICT.put( 59132, 63905 ); + _DICT.put( 59133, 63906 ); + _DICT.put( 59134, 63907 ); + _DICT.put( 59135, 63908 ); + _DICT.put( 59136, 63909 ); + _DICT.put( 59137, 63910 ); + _DICT.put( 59138, 63911 ); + _DICT.put( 59139, 63912 ); + _DICT.put( 59140, 63913 ); + _DICT.put( 59141, 63914 ); + _DICT.put( 59142, 63915 ); + _DICT.put( 59143, 63916 ); + _DICT.put( 59144, 63917 ); + _DICT.put( 59145, 63918 ); + _DICT.put( 59146, 63919 ); + _DICT.put( 59147, 63920 ); + _DICT.put( 59148, 63921 ); + _DICT.put( 59149, 63922 ); + _DICT.put( 59150, 63923 ); + _DICT.put( 59151, 63924 ); + _DICT.put( 59152, 63925 ); + _DICT.put( 59153, 63926 ); + _DICT.put( 59154, 63927 ); + _DICT.put( 59155, 63928 ); + _DICT.put( 59156, 63929 ); + _DICT.put( 59157, 63930 ); + _DICT.put( 59158, 63931 ); + _DICT.put( 59159, 63932 ); + _DICT.put( 59160, 63933 ); + _DICT.put( 59161, 63934 ); + _DICT.put( 59162, 63935 ); + _DICT.put( 59163, 63936 ); + _DICT.put( 59164, 63937 ); + _DICT.put( 59165, 63938 ); + _DICT.put( 59166, 63939 ); + _DICT.put( 59167, 63940 ); + _DICT.put( 59168, 63941 ); + _DICT.put( 59169, 63942 ); + _DICT.put( 59170, 63943 ); + _DICT.put( 59171, 63944 ); + _DICT.put( 59172, 63945 ); + _DICT.put( 59173, 63946 ); + _DICT.put( 59174, 63947 ); + _DICT.put( 59175, 63948 ); + _DICT.put( 59176, 63949 ); + _DICT.put( 59177, 63950 ); + _DICT.put( 59178, 63951 ); + _DICT.put( 59179, 63952 ); + _DICT.put( 59180, 63953 ); + _DICT.put( 59181, 63954 ); + _DICT.put( 59182, 63955 ); + _DICT.put( 59183, 63956 ); + _DICT.put( 59184, 63957 ); + _DICT.put( 59185, 63958 ); + _DICT.put( 59186, 63959 ); + _DICT.put( 59187, 63960 ); + _DICT.put( 59188, 63961 ); + _DICT.put( 59189, 63962 ); + _DICT.put( 59190, 63963 ); + _DICT.put( 59191, 63964 ); + _DICT.put( 59192, 63965 ); + _DICT.put( 59193, 63966 ); + _DICT.put( 59194, 63967 ); + _DICT.put( 59195, 63968 ); + _DICT.put( 59196, 63969 ); + _DICT.put( 59197, 63970 ); + _DICT.put( 59198, 63971 ); + _DICT.put( 59199, 63972 ); + _DICT.put( 59200, 63973 ); + _DICT.put( 59201, 63974 ); + _DICT.put( 59202, 63975 ); + _DICT.put( 59203, 63976 ); + _DICT.put( 59204, 63977 ); + _DICT.put( 59205, 63978 ); + _DICT.put( 59206, 63979 ); + _DICT.put( 59207, 63980 ); + _DICT.put( 59208, 63981 ); + _DICT.put( 59209, 63982 ); + _DICT.put( 59210, 63983 ); + _DICT.put( 59211, 63984 ); + _DICT.put( 59212, 63985 ); + _DICT.put( 59213, 63986 ); + _DICT.put( 59214, 63987 ); + _DICT.put( 59215, 63988 ); + _DICT.put( 59216, 63989 ); + _DICT.put( 59217, 63990 ); + _DICT.put( 59218, 63991 ); + _DICT.put( 59219, 63992 ); + _DICT.put( 59220, 63993 ); + _DICT.put( 59221, 63994 ); + _DICT.put( 59222, 63995 ); + _DICT.put( 59223, 63996 ); + _DICT.put( 63728, 160 ); + _DICT.put( 63729, 253 ); + _DICT.put( 63730, 254 ); + _DICT.put( 63731, 255 ); + _DICT.put( 63785, 64224 ); + _DICT.put( 63964, 64489 ); + _DICT.put( 64014, 64144 ); + _DICT.put( 64015, 64155 ); + _DICT.put( 64016, 64156 ); + _DICT.put( 64017, 64177 ); + _DICT.put( 64018, 64216 ); + _DICT.put( 64019, 64232 ); + _DICT.put( 64020, 64234 ); + _DICT.put( 64021, 64344 ); + _DICT.put( 64022, 64350 ); + _DICT.put( 64023, 64373 ); + _DICT.put( 64024, 64381 ); + _DICT.put( 64025, 64382 ); + _DICT.put( 64026, 64384 ); + _DICT.put( 64027, 64386 ); + _DICT.put( 64028, 64390 ); + _DICT.put( 64029, 64393 ); + _DICT.put( 64030, 64402 ); + _DICT.put( 64031, 64413 ); + _DICT.put( 64032, 64415 ); + _DICT.put( 64033, 64416 ); + _DICT.put( 64034, 64425 ); + _DICT.put( 64035, 64433 ); + _DICT.put( 64036, 64435 ); + _DICT.put( 64037, 64436 ); + _DICT.put( 64038, 64439 ); + _DICT.put( 64039, 64467 ); + _DICT.put( 64040, 64474 ); + _DICT.put( 64041, 64490 ); + _DICT.put( 64042, 64502 ); + _DICT.put( 64043, 64503 ); + _DICT.put( 64044, 64505 ); + _DICT.put( 64045, 64585 ); + _DICT.put( 65281, 33097 ); + _DICT.put( 65282, 64087 ); + _DICT.put( 65283, 33172 ); + _DICT.put( 65284, 33168 ); + _DICT.put( 65285, 33171 ); + _DICT.put( 65286, 33173 ); + _DICT.put( 65287, 64086 ); + _DICT.put( 65288, 33129 ); + _DICT.put( 65289, 33130 ); + _DICT.put( 65290, 33174 ); + _DICT.put( 65291, 33147 ); + _DICT.put( 65292, 33091 ); + _DICT.put( 65293, 33148 ); + _DICT.put( 65294, 33092 ); + _DICT.put( 65295, 33118 ); + _DICT.put( 65296, 33359 ); + _DICT.put( 65297, 33360 ); + _DICT.put( 65298, 33361 ); + _DICT.put( 65299, 33362 ); + _DICT.put( 65300, 33363 ); + _DICT.put( 65301, 33364 ); + _DICT.put( 65302, 33365 ); + _DICT.put( 65303, 33366 ); + _DICT.put( 65304, 33367 ); + _DICT.put( 65305, 33368 ); + _DICT.put( 65306, 33094 ); + _DICT.put( 65307, 33095 ); + _DICT.put( 65308, 33155 ); + _DICT.put( 65309, 33153 ); + _DICT.put( 65310, 33156 ); + _DICT.put( 65311, 33096 ); + _DICT.put( 65312, 33175 ); + _DICT.put( 65313, 33376 ); + _DICT.put( 65314, 33377 ); + _DICT.put( 65315, 33378 ); + _DICT.put( 65316, 33379 ); + _DICT.put( 65317, 33380 ); + _DICT.put( 65318, 33381 ); + _DICT.put( 65319, 33382 ); + _DICT.put( 65320, 33383 ); + _DICT.put( 65321, 33384 ); + _DICT.put( 65322, 33385 ); + _DICT.put( 65323, 33386 ); + _DICT.put( 65324, 33387 ); + _DICT.put( 65325, 33388 ); + _DICT.put( 65326, 33389 ); + _DICT.put( 65327, 33390 ); + _DICT.put( 65328, 33391 ); + _DICT.put( 65329, 33392 ); + _DICT.put( 65330, 33393 ); + _DICT.put( 65331, 33394 ); + _DICT.put( 65332, 33395 ); + _DICT.put( 65333, 33396 ); + _DICT.put( 65334, 33397 ); + _DICT.put( 65335, 33398 ); + _DICT.put( 65336, 33399 ); + _DICT.put( 65337, 33400 ); + _DICT.put( 65338, 33401 ); + _DICT.put( 65339, 33133 ); + _DICT.put( 65340, 33119 ); + _DICT.put( 65341, 33134 ); + _DICT.put( 65342, 33103 ); + _DICT.put( 65343, 33105 ); + _DICT.put( 65344, 33101 ); + _DICT.put( 65345, 33409 ); + _DICT.put( 65346, 33410 ); + _DICT.put( 65347, 33411 ); + _DICT.put( 65348, 33412 ); + _DICT.put( 65349, 33413 ); + _DICT.put( 65350, 33414 ); + _DICT.put( 65351, 33415 ); + _DICT.put( 65352, 33416 ); + _DICT.put( 65353, 33417 ); + _DICT.put( 65354, 33418 ); + _DICT.put( 65355, 33419 ); + _DICT.put( 65356, 33420 ); + _DICT.put( 65357, 33421 ); + _DICT.put( 65358, 33422 ); + _DICT.put( 65359, 33423 ); + _DICT.put( 65360, 33424 ); + _DICT.put( 65361, 33425 ); + _DICT.put( 65362, 33426 ); + _DICT.put( 65363, 33427 ); + _DICT.put( 65364, 33428 ); + _DICT.put( 65365, 33429 ); + _DICT.put( 65366, 33430 ); + _DICT.put( 65367, 33431 ); + _DICT.put( 65368, 33432 ); + _DICT.put( 65369, 33433 ); + _DICT.put( 65370, 33434 ); + _DICT.put( 65371, 33135 ); + _DICT.put( 65372, 33122 ); + _DICT.put( 65373, 33136 ); + _DICT.put( 65374, 33120 ); + _DICT.put( 65377, 161 ); + _DICT.put( 65378, 162 ); + _DICT.put( 65379, 163 ); + _DICT.put( 65380, 164 ); + _DICT.put( 65381, 165 ); + _DICT.put( 65382, 166 ); + _DICT.put( 65383, 167 ); + _DICT.put( 65384, 168 ); + _DICT.put( 65385, 169 ); + _DICT.put( 65386, 170 ); + _DICT.put( 65387, 171 ); + _DICT.put( 65388, 172 ); + _DICT.put( 65389, 173 ); + _DICT.put( 65390, 174 ); + _DICT.put( 65391, 175 ); + _DICT.put( 65392, 176 ); + _DICT.put( 65393, 177 ); + _DICT.put( 65394, 178 ); + _DICT.put( 65395, 179 ); + _DICT.put( 65396, 180 ); + _DICT.put( 65397, 181 ); + _DICT.put( 65398, 182 ); + _DICT.put( 65399, 183 ); + _DICT.put( 65400, 184 ); + _DICT.put( 65401, 185 ); + _DICT.put( 65402, 186 ); + _DICT.put( 65403, 187 ); + _DICT.put( 65404, 188 ); + _DICT.put( 65405, 189 ); + _DICT.put( 65406, 190 ); + _DICT.put( 65407, 191 ); + _DICT.put( 65408, 192 ); + _DICT.put( 65409, 193 ); + _DICT.put( 65410, 194 ); + _DICT.put( 65411, 195 ); + _DICT.put( 65412, 196 ); + _DICT.put( 65413, 197 ); + _DICT.put( 65414, 198 ); + _DICT.put( 65415, 199 ); + _DICT.put( 65416, 200 ); + _DICT.put( 65417, 201 ); + _DICT.put( 65418, 202 ); + _DICT.put( 65419, 203 ); + _DICT.put( 65420, 204 ); + _DICT.put( 65421, 205 ); + _DICT.put( 65422, 206 ); + _DICT.put( 65423, 207 ); + _DICT.put( 65424, 208 ); + _DICT.put( 65425, 209 ); + _DICT.put( 65426, 210 ); + _DICT.put( 65427, 211 ); + _DICT.put( 65428, 212 ); + _DICT.put( 65429, 213 ); + _DICT.put( 65430, 214 ); + _DICT.put( 65431, 215 ); + _DICT.put( 65432, 216 ); + _DICT.put( 65433, 217 ); + _DICT.put( 65434, 218 ); + _DICT.put( 65435, 219 ); + _DICT.put( 65436, 220 ); + _DICT.put( 65437, 221 ); + _DICT.put( 65438, 222 ); + _DICT.put( 65439, 223 ); + _DICT.put( 65504, 33169 ); + _DICT.put( 65505, 33170 ); + _DICT.put( 65506, 33226 ); + _DICT.put( 65507, 33104 ); + _DICT.put( 65508, 64085 ); + _DICT.put( 65509, 33167 ); + m_initialized = true; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/math.java b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/math.java new file mode 100644 index 0000000..b2dcdd9 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/bocoree/math.java @@ -0,0 +1,340 @@ +/* + * math.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.bocoree. + * + * jp.sourceforge.lipsync.bocoree is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.bocoree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.bocoree; + +public class math { + private static final double _PI2 = 2.0 * Math.PI; + private static final double _PI4 = 4.0 * Math.PI; + private static final double _PI6 = 6.0 * Math.PI; + private static final double _PI8 = 8.0 * Math.PI; + + public enum WindowFunctionType { + Hamming, + rectangular, + Gauss, + Hann, + Blackman, + Bartlett, + Nuttall, + Blackman_Harris, + Blackman_Nattall, + flap_top, + Parzen, + Akaike, + Welch, + Kaiser, + } + + public static double window_func(WindowFunctionType type, double x) throws Exception { + switch ( type ) { + case Akaike: + return wnd_akaike(x); + case Bartlett: + return wnd_bartlett(x); + case Blackman: + return wnd_blackman(x); + case Blackman_Harris: + return wnd_blackman_harris(x); + case Blackman_Nattall: + return wnd_blackman_nattall(x); + case flap_top: + return wnd_flap_top(x); + case Gauss: + throw new Exception("too few argument for Gauss window function"); + case Hamming: + return wnd_hamming(x); + case Hann: + return wnd_hann(x); + case Kaiser: + throw new Exception("too few argument for Kaiser window function"); + case Nuttall: + return wnd_nuttall(x); + case Parzen: + return wnd_parzen(x); + case rectangular: + return wnd_rectangular(x); + case Welch: + return wnd_welch(x); + } + return 0.0; + } + + public static double window_func(WindowFunctionType type, double x, double[] param) { + switch ( type ) { + case Akaike: + return wnd_akaike(x); + case Bartlett: + return wnd_bartlett(x); + case Blackman: + return wnd_blackman(x); + case Blackman_Harris: + return wnd_blackman_harris(x); + case Blackman_Nattall: + return wnd_blackman_nattall(x); + case flap_top: + return wnd_flap_top(x); + case Gauss: + return wnd_gauss(x, param[0]); + case Hamming: + return wnd_hamming(x); + case Hann: + return wnd_hann(x); + case Kaiser: + return wnd_kaiser(x, param[0]); + case Nuttall: + return wnd_nuttall(x); + case Parzen: + return wnd_parzen(x); + case rectangular: + return wnd_rectangular(x); + case Welch: + return wnd_welch(x); + } + return 0.0; + } + + /** + * 繧ォ繧、繧カ繝シ遯 + * @param x + * @param alpha + * @return + */ + public static double wnd_kaiser(double x, double alpha) { + if ( 0.0 <= x && x <= 1.0 ) { + double t = 2.0 * x - 1.0; + return besi0(Math.PI * alpha * Math.sqrt(1.0 - t * t)) / besi0(Math.PI * alpha); + } else { + return 0.0; + } + } + + /** + * 繧ヲ繧ァ繝ォ繝∫ェ + * @param x + * @return + */ + public static double wnd_welch(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 4.0 * x * (1.0 - x); + } else { + return 0.0; + } + } + + /** + * 襍、豎遯 + * @param x + * @return + */ + public static double wnd_akaike(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.625 - 0.5 * Math.cos(_PI2 * x) - 0.125 * Math.cos(_PI4 * x); + } else { + return 0.0; + } + } + + /** + * 繝代Ν繧カ繝ウ遯 + * @param x + * @return + */ + public static double wnd_parzen(double x) { + double x0 = Math.abs(x); + if ( x0 <= 1.0 ) { + return (0.75 * x0 - 1.5) * x0 * x0 + 1.0; + } else { + x0 = 2.0 - x0; + return 0.25 * x0 * x0 * x0; + } + } + + /** + * 繝輔Λ繝繝医サ繝医ャ繝礼ェ + * @param x + * @return + */ + public static double wnd_flap_top(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 1.0 - 1.93 * Math.cos(_PI2 * x) + 1.29 * Math.cos(_PI4 * x) - 0.388 * Math.cos(_PI6 * x) + 0.032 * Math.cos(_PI8 * x); + } else { + return 0.0; + } + } + + /** + * 繝悶Λ繝繧ッ繝槭Φ窶舌リ繝繝医シ繝ォ遯 + * @param x + * @return + */ + public static double wnd_blackman_nattall(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.3635819 - 0.4891775 * Math.cos(_PI2 * x) + 0.1365995 * Math.cos(_PI4 * x) - 0.0106411 * Math.cos(_PI6 * x); + } else { + return 0.0; + } + } + + /** + * 繝悶Λ繝繧ッ繝槭Φ窶舌ワ繝ェ繧ケ遯 + * @param x + * @return + */ + public static double wnd_blackman_harris(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.35875 - 0.48829 * Math.cos(_PI2 * x) + 0.14128 * Math.cos(_PI4 * x) - 0.01168 * Math.cos(_PI6 * x); + } else { + return 0.0; + } + } + + /** + * 繝翫ャ繝医シ繝ォ遯 + * @param x + * @return + */ + public static double wnd_nuttall(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.355768 - 0.487396 * Math.cos(_PI2 * x) + 0.144232 * Math.cos(_PI4 * x) - 0.012604 * Math.cos(_PI6 * x); + } else { + return 0.0; + } + } + + /** + * 繝舌シ繝医Ξ繝繝育ェ + * @param x + * @return + */ + public static double wnd_bartlett(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 1.0 - 2.0 * Math.abs(x - 0.5); + } else { + return 0.0; + } + } + + /** + * 繝悶Λ繝繧ッ繝槭Φ遯 + * @param x + * @return + */ + public static double wnd_blackman(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.42 - 0.5 * Math.cos(_PI2 * x) + 0.08 * Math.cos(_PI4 * x); + } else { + return 0.0; + } + } + + /** + * 繝上Φ遯 + * @param x + * @return + */ + public static double wnd_hann(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.5 - 0.5 * Math.cos(_PI2 * x); + } else { + return 0.0; + } + } + + /** + * 繧ャ繧ヲ繧ケ遯 + * @param x + * @param sigma + * @return + */ + public static double wnd_gauss(double x, double sigma) { + return Math.exp(-x * x / (sigma * sigma)); + } + + /** + * 遏ゥ蠖「遯 + * @param x + * @return + */ + public static double wnd_rectangular(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 1.0; + } else { + return 0.0; + } + } + + /** + * 繝上Α繝ウ繧ー遯 + * @param x + * @return + */ + public static double wnd_hamming(double x) { + if ( 0.0 <= x && x <= 1.0 ) { + return 0.54 - 0.46 * Math.cos(_PI2 * x); + } else { + return 0.0; + } + } + + /** + * 隨ャ1遞ョ繝吶ャ繧サ繝ォ髢「謨ー + * @param x + * @return + */ + public static double besi0(double x) { + int i; + double w, wx375; + double[] a = {1.0, 3.5156229, 3.0899424, + 1.2067492, 0.2659732, 0.0360768 + }; + double[] b = {0.39894228, 0.013285917, 0.002253187, + -0.001575649, 0.009162808, -0.020577063, + 0.026355372, -0.016476329 + }; + if ( x < 0.0 ) { + return 0.0; + } + if ( x <= 3.75 ) { + wx375 = x * x / 14.0625; + w = 0.0045813; + for ( i = 5; i >= 0; i-- ) { + w = w * wx375 + a[i]; + } + return w; + } + wx375 = 3.75 / x; + w = 0.003923767; + for ( i = 7; i >= 0; i-- ) { + w = w * wx375 + b[i]; + } + return w / Math.sqrt(x) * Math.exp(x); + } + + /** + * 陬懆ェ、蟾ョ髢「謨ー + * @param x + * @return + */ + public static double erfcc(double x) { + double t, z, res; + z = Math.abs(x); + t = 1.0 / (1.0 + 0.5 * z); + res = t * Math.exp(-z * z - 1.26551223 + t * (1.00002368 + t * (0.37409196 + t * (0.09678418 + t * (-0.18628806 + t * (0.27886807 + t * (-1.13520398 + t * (1.48851587 + t * (-0.82215223 + t * 0.17087277))))))))); + if ( x < 0.0 ) { + res = 2.0 - res; + } + return res; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/BPPair.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/BPPair.java new file mode 100644 index 0000000..67a13af --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/BPPair.java @@ -0,0 +1,58 @@ +/* + * BPPair.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class BPPair implements Comparable { + //private int m_clock; + public int Clock; + //private int m_value; + public int Value; + + public int compareTo( Object arg_item ) { + if ( !arg_item.getClass().equals( BPPair.class.getClass() ) ) { + return 0; + } + BPPair item = (BPPair)arg_item; + if ( Clock > item.Clock ) { + return 1; + } else if ( Clock < item.Clock ) { + return -1; + } else { + return 0; + } + } + + + /*public property int Clock { + get { + return m_clock; + } + set { + m_clock = value; + } + };*/ + /*public property int Value { + get { + return m_value; + } + set { + m_value = value; + } + };*/ + public BPPair( int clock, int value ) { + Clock = clock; + Value = value; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/IconHandle.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/IconHandle.java new file mode 100644 index 0000000..b210aed --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/IconHandle.java @@ -0,0 +1,88 @@ +/* + * IconHandle.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class IconHandle extends VsqHandle implements Cloneable { + public Object clone() { + IconHandle ret = new IconHandle(); + ret.Caption = Caption; + ret.IconID = IconID; + ret.IDS = IDS; + ret.Index = Index; + ret.Language = Language; + ret.Length = Length; + ret.Original = Original; + ret.Program = Program; + ret.Type = Type; + return ret; + } + + + /*public property int Program { + get { + return m_program; + } + set { + m_program = value; + } + };*/ + /*public property int Language { + get { + return m_language; + } + set { + m_language = value; + } + };*/ + /*public property int Length { + get { + return m_length; + } + set { + m_length = value; + } + };*/ + /*public property String Caption { + get { + return m_caption; + } + set { + m_caption = value; + } + };*/ + /*public property String IconID { + get { + return m_icon_id; + } + set { + m_icon_id = value; + } + };*/ + /*public property String IDS { + get { + return m_ids; + } + set { + m_ids = value; + } + };*/ + /*public property int Original { + get { + return m_original; + } + set { + m_original = value; + } + };*/ +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/KeyValuePair.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/KeyValuePair.java new file mode 100644 index 0000000..2b61681 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/KeyValuePair.java @@ -0,0 +1,28 @@ +/* + * KeyValuePair.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public class KeyValuePair { + public K Key; + public V Value; + + public KeyValuePair( K key, V value ) { + Key = key; + Value = value; + } +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/Lyric.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/Lyric.java new file mode 100644 index 0000000..c39b1f3 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/Lyric.java @@ -0,0 +1,365 @@ +/* + * Lyric.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import jp.sourceforge.lipsync.bocoree.*; + +/** + * VsqHandle縺ォ譬シ邏阪&繧後k豁瑚ゥ槭ョ諠蝣ア繧呈桶縺繧ッ繝ゥ繧ケ縲 + */ +public class Lyric { + //private String m_phrase; + public String Phrase; + private String[] m_phonetic_symbol; + //private float UnknownFloat; + public float UnknownFloat; + private int[] m_consonant_adjustment; + private boolean m_protected; + public boolean PhoneticSymbolProtected; + + /*public proprety boolean PhoneticSymbolProtected { + get { + return m_protected; + } + set { + m_protected = value; + } + };*/ + /*public property float UnknownFloat { + get { + return UnknownFloat; + } + set { + UnknownFloat = value; + } + };*/ + public int[] getConsonantAdjustment() { + return m_consonant_adjustment; + } + + /** + * 縺薙ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ邁。譏薙さ繝斐シ繧貞叙蠕励@縺セ縺吶 + * @returns 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ邁。譏薙さ繝斐シ + */ + public Lyric clone() { + Lyric result = new Lyric(); + result.Phrase = this.Phrase; + result.m_phonetic_symbol = (String[]) this.m_phonetic_symbol.clone(); + result.UnknownFloat = this.UnknownFloat; + result.m_consonant_adjustment = (int[]) this.m_consonant_adjustment.clone(); + result.m_protected = m_protected; + return result; + } + + /** + * 豁瑚ゥ槭∫匱髻ウ險伜捷繧呈欠螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ + * @param phrase 豁瑚ゥ + * @param phonetic_symbol 逋コ髻ウ險伜捷 + */ + public Lyric( String phrase, String phonetic_symbol ) { + Phrase = phrase; + setPhoneticSymbol( phonetic_symbol ); + UnknownFloat = 0.000000f; + } + + private Lyric() { + } + + + /*// + /// 縺薙ョ豁瑚ゥ槭ョ繝輔Ξ繝シ繧コ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺吶 + /// + public proprety String Phrase { + get { + return m_phrase; + } + set { + m_phrase = value; + } + };*/ + /// + /// 縺薙ョ豁瑚ゥ槭ョ逋コ髻ウ險伜捷繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺吶 + /// + public String getPhoneticSymbol() { + String ret = m_phonetic_symbol[0]; + for ( int i = 1; i < m_phonetic_symbol.length; i++ ) { + ret += " " + m_phonetic_symbol[i]; + } + return ret; + } + + public void setPhoneticSymbol( String value ) { + String s = value.replace( " ", " " ); + m_phonetic_symbol = s.split( " ", 16 ); + for ( int i = 0; i < m_phonetic_symbol.length; i++ ) { + m_phonetic_symbol[i] = m_phonetic_symbol[i].replace( "\\\\", "\\" ); + } + m_consonant_adjustment = new int[m_phonetic_symbol.length]; + for ( int i = 0; i < m_phonetic_symbol.length; i++ ) { + if ( VsqPhoneticSymbol.IsConsonant( m_phonetic_symbol[i] ) ) { + m_consonant_adjustment[i] = 64; + } else { + m_consonant_adjustment[i] = 0; + } + } + } + + public String[] getPhoneticSymbolList() { + String[] ret = new String[m_phonetic_symbol.length]; + for ( int i = 0; i < m_phonetic_symbol.length; i++ ) { + ret[i] = m_phonetic_symbol[i]; + } + return ret; + } + + +/// +/// 譁蟄怜励°繧峨ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ +/// +/// 逕滓仙縺ョ譁蟄怜 + public Lyric( String _line ) { + if ( _line.length() <= 0 ) { + Phrase = "a"; + setPhoneticSymbol( "a" ); + UnknownFloat = 1.0f; + m_protected = false; + } else { + String[] spl = _line.split( "," ); + int c_length = spl.length - 3; + if ( spl.length < 4 ) { + Phrase = "a"; + setPhoneticSymbol( "a" ); + UnknownFloat = 0.0f; + m_protected = false; + } else { + Phrase = decode( spl[0] ); + setPhoneticSymbol( decode( spl[1] ) ); + UnknownFloat = Float.valueOf( spl[2] ); + m_protected = (spl[spl.length - 1] == "0") ? false : true; + } + + } + } + + + /// + /// mIndexOf縺ョ繝繧ケ繝医Γ繧ス繝繝峨Tearch, value繧偵>繧阪>繧榊、峨∴縺ヲ繝繧ケ繝医☆繧倶コ九 + /// + /// + public static boolean test_mIndexOf() { + byte[] search = { 0, 12, 3, 5, 16, 34 }; + byte[] value = { 16, 34 }; + if ( mIndexOf( search, value ) == 4 ) { + return true; + } else { + return false; + } + + } + + + /// + /// 繝舌う繝井クヲ縺ウsearch縺ョ荳ュ縺ォ蜷ォ縺セ繧後k繝舌う繝井クヲ縺ウvalue縺ョ菴咲スョ繧呈爾縺励∪縺吶 + /// + /// 讀懃エ「蟇セ雎。縺ョ繝舌う繝井クヲ縺ウ + /// 讀懃エ「縺吶k繝舌う繝井クヲ縺ウ + /// value縺瑚ヲ九▽縺九l縺ー縺昴ョ繧、繝ウ繝繝繧ッ繧ケ繧偵∬ヲ九▽縺九i縺ェ縺代l縺ー-1繧定ソ斐@縺セ縺 + private static int mIndexOf( byte[] search, byte[] value ) { + int i, j; + int search_length = search.length; + int value_length = value.length; + + // 讀懃エ「縺吶k繝舌う繝井クヲ縺ウ縺後∵、懃エ「蟇セ雎。縺ョ繝舌う繝井クヲ縺ウ繧医j髟キ縺縺ィ縺阪 + // 隕九▽縺九k繧上¢縺ェ縺 + if ( value_length > search_length ) { + return -1; + } + + // i : 讀懃エ「縺ョ蝓コ轤ケ + for ( i = 0; i <= search_length - value_length; i++ ) { + boolean failed = false; + for ( j = 0; j < value_length; j++ ) { + if ( search[i + j] != value[j] ) { + failed = true; + break; + } + } + if ( !failed ) { + return i; + } + } + return -1; + } + + /** + * 繧ィ繧ケ繧ア繝シ繝励&繧後◆\"繧縲―x**繧貞セゥ蟶ー縺輔○縺セ縺 + * @param _String 繝繧ウ繝シ繝牙ッセ雎。縺ョ譁蟄怜 + * @returns 繝繧ウ繝シ繝牙セ後ョ譁蟄怜 + */ + public static String decode( String _String ) { + String result = _String; + result = result.replace( "\\\"", "" ); + //Encoding sjis = Encoding.GetEncoding( 932 ); + //Encoding sjis = Encoding.GetEncoding( "Shift_JIS" ); + byte[] str = result.getBytes(); + + //Console.WriteLine( "Lyric.decode; sjis.GetString( str )=" + sjis.GetString( str ) ); + byte[] x16 = "\\x".getBytes(); + int index = mIndexOf( str, x16 ); + while ( index >= 0 ) { + //Console.WriteLine( "Lyric.decode; index=" + index ); + byte[] chr_byte = new byte[2]; + chr_byte[0] = str[index + 2]; + chr_byte[1] = str[index + 3]; + String chr; + try { + chr = new String( chr_byte, "UTF-8" ); + } catch ( Exception e ) { + chr = ""; + } + //Console.WriteLine( "Lyric.decode; chr=" + chr ); + int chrcode = Integer.parseInt( chr, 16 ); + str[index] = (byte) chrcode; + for ( int i = index + 4; i < str.length; i++ ) { + str[i - 3] = str[i]; + } + + int length = str.length - 3; + byte[] new_str = new byte[length]; + for ( int i = 0; i < length; i++ ) { + new_str[i] = str[i]; + } + str = new_str; + index = mIndexOf( str, x16 ); + } + //return sjis.GetString( str ); + return cp932.convert( str ); + } + + +/// +/// 荳弱∴繧峨l縺滓枚蟄怜励ョ荳ュ縺ョ2繝舌う繝域枚蟄励r\x**縺ョ蠖「蠑上↓繧ィ繝ウ繧ウ繝シ繝峨@縺セ縺吶 +/// +/// 繧ィ繝ウ繧ウ繝シ繝牙ッセ雎。 +/// 繧ィ繝ウ繧ウ繝シ繝峨@縺滓枚蟄怜 + public static char[] encode( String item ) { + //Encoding sjis = Encoding.GetEncoding( 932 ); + byte[] bytea = cp932.convert( item );// sjis.GetBytes( item ); + + String result = ""; + for ( int i = 0; i < + bytea.length; i++ ) { + if ( isprint( (char) bytea[i] ) ) { + result += (char) bytea[i]; + } else { + int a = bytea[i]; + result += "\\x" + Integer.toHexString( (int) bytea[i] ); + } + + } + char[] res = result.toCharArray(); + return res; + } + + +/// +/// 荳弱∴繧峨l縺滓枚蟄怜励rShift_JIS縺ィ縺ソ縺ェ縺励|yte[]縺ォ螟画鋤縺励&繧峨↓char[]縺ォ螟画鋤縺励◆繧ゅョ霑斐@縺セ縺 +/// +/// 螟画鋤蜈縺ョ譁蟄怜 +/// 螟画鋤蠕後ョchar[] + public static char[] encodeEx( String item ) { + //Encoding sjis = Encoding.GetEncoding( 932 ); + byte[] dat = cp932.convert( item );// sjis.GetBytes( item ); + + char[] result = new char[dat.length]; + for ( int i = 0; i < dat.length; i++ ) { + result[i] = (char) dat[i]; + } + + return result; + } + + +/// +/// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧呈枚蟄怜励↓螟画鋤縺励∪縺 +/// +/// 2繝舌う繝域枚蟄励r繧ィ繝ウ繧ウ繝シ繝峨☆繧九°蜷ヲ縺九r謖螳壹☆繧九ヵ繝ゥ繧ー +/// 螟画鋤蠕後ョ譁蟄怜 + public String toString( boolean a_encode ) { + String result; + if ( a_encode ) { + String njp = new String( encode( this.Phrase ) ); + result = "\"" + njp + "\",\"" + getPhoneticSymbol() + "\"," + String.format( "0.000000", UnknownFloat ); + } else { + result = "\""; + //Encoding sjis = Encoding.GetEncoding( 932 ); + byte[] dat = cp932.convert( this.Phrase );// sjis.GetBytes( this.Phrase ); + + for ( int i = 0; i < dat.length; i++ ) { + result += (char) dat[i]; + } + result += "\",\"" + getPhoneticSymbol() + "\"," + String.format( "0.000000", UnknownFloat ); + result = result.replace( "\\\\", "\\" ); + } + for ( int i = 0; i < m_consonant_adjustment.length; i++ ) { + result += "," + m_consonant_adjustment[i]; + } + + if ( m_protected ) { + result += ",1"; + } else { + result += ",0"; + } + + return result; + } + + +/// +/// 譁蟄励′繝励Μ繝ウ繝亥コ蜉帛庄閭ス縺九←縺縺九r蛻、螳壹@縺セ縺 +/// +/// +/// + private static boolean isprint( char ch ) { + if ( 32 <= (int) ch && (int) ch <= 126 ) { + return true; + } else { + return false; + } + + } + + + /// + /// Lyric繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧呈ァ狗ッ峨☆繧九ユ繧ケ繝医r陦後>縺セ縺 + /// + /// 繝繧ケ繝医↓謌仙粥縺吶l縺ーtrue縲√◎縺縺ァ縺ェ縺代l縺ーfalse繧定ソ斐@縺セ縺 + public static boolean test() { + + String line = "\\\"\\x82\\xe7\\\",\\\"4 a\\\",1.000000,64,1,1"; + //Console.WriteLine( "Lyric.test; line=" + line ); + Lyric lyric = new Lyric( line ); + if ( lyric.Phrase == "繧" && + lyric.getPhoneticSymbol() == "4 a" && + lyric.UnknownFloat == 1.0 && + lyric.m_consonant_adjustment[0] == 64 && + lyric.m_consonant_adjustment[1] == 1 && + lyric.m_consonant_adjustment[2] == 1 ) { + return true; + } else { + return false; + } + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/LyricHandle.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/LyricHandle.java new file mode 100644 index 0000000..857e1ad --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/LyricHandle.java @@ -0,0 +1,47 @@ +/* + * LyricHandle.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class LyricHandle extends VsqHandle implements Cloneable { + public LyricHandle() { + } + + + /// + /// type = Lyric逕ィ縺ョhandle縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 豁瑚ゥ + /// 逋コ髻ウ險伜捷 + public LyricHandle( String phrase, String phonetic_symbol ) { + Type = VsqHandleType.Lyric; + L0 = new Lyric( phrase, phonetic_symbol ); + } + + /*public property Lyric L0 { + get { + return m_lyric; + } + set { + m_lyric = value; + } + }*/ + public Object clone() { + LyricHandle ret = new LyricHandle(); + ret.Type = Type; + ret.Index = Index; + ret.L0 = (Lyric)L0.clone(); + return ret; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEvent.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEvent.java new file mode 100644 index 0000000..f059d23 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEvent.java @@ -0,0 +1,122 @@ +/* + * MidiEvent.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class MidiEvent implements Comparable, Cloneable { + public int index; + public MidiEventType type; + public int[] intValue; + public String stringValue; + public byte[] byteValue; + + public static MidiEvent TempoChange( int clock, int tempo ) { + MidiEvent res = new MidiEvent(); + res.index = clock; + res.type = MidiEventType.tempo; + res.intValue = new int[1]; + res.intValue[0] = tempo; + return res; + } + + public static MidiEvent TimeSig( int clock, int numerator, int denominator ) { + MidiEvent res = new MidiEvent(); + res.index = clock; + res.type = MidiEventType.time_signal; + res.intValue = new int[2]; + res.intValue[0] = numerator; + res.intValue[1] = denominator; + return res; + } + + public Object clone() { + MidiEvent res = new MidiEvent(); + res.index = index; + res.type = type; + if ( intValue != null ) { + res.intValue = new int[intValue.length]; + for ( int i = 0; i < intValue.length; i++ ) { + res.intValue[i] = intValue[i]; + } + } + res.stringValue = stringValue; + if ( byteValue != null ) { + res.byteValue = new byte[byteValue.length]; + for ( int i = 0; i < byteValue.length; i++ ) { + res.byteValue[i] = byteValue[i]; + } + } + return res; + } + + public int compareTo( MidiEvent obj ) { + return this.index - obj.index; + } + + public boolean Equals( MidiEvent obj ) { + if ( this.index == obj.index ) { + return true; + } else { + return false; + } + } + + private MidiEvent() { + } + + /** + * 縺九″縺九¢縲ゅΓ繧ソ繝繧ュ繧ケ繝井サ・螟悶ョmidi繧、繝吶Φ繝医r蜿悶j謇ア縺縲 + * @param line + */ + public MidiEvent( String line ) { + index = -1; + type = MidiEventType.unknown; + //intValue = new int[1]; + //intValue[0] = -9000; + stringValue = ""; + byteValue = null; + + String[] spl = line.split( " " ); + index = Integer.parseInt( spl[0] ); + if ( spl[1].equals( "Tempo" ) ) { + type = MidiEventType.tempo; + intValue = new int[1]; + intValue[0] = Integer.parseInt( spl[2] ); + } else if ( spl[1].equals( "TimeSig" ) ) { + type = MidiEventType.time_signal; + intValue = new int[4]; + String[] spl2 = spl[2].split( "/" ); + intValue[0] = Integer.parseInt( spl2[0] ); + intValue[1] = Integer.parseInt( spl2[1] ); + intValue[2] = Integer.parseInt( spl[3] ); + intValue[3] = Integer.parseInt( spl[4] ); + } else if ( spl[1].equals( "Par" ) ) { + type = MidiEventType.parameter; + intValue = new int[3]; + String[] spl3 = spl[2].split( "=" ); + intValue[0] = Integer.parseInt( spl3[1] ); + spl3 = spl[3].split( "=" ); + intValue[1] = Integer.parseInt( spl3[1] ); + spl3 = spl[4].split( "=" ); + intValue[2] = Integer.parseInt( spl3[1] ); + } else { + type = MidiEventType.unknown; + stringValue = spl[2]; + for ( int i = 1; i < spl.length; i++ ) { + stringValue += " " + spl[i]; + } + } + + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEventType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEventType.java new file mode 100644 index 0000000..af27baa --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiEventType.java @@ -0,0 +1,71 @@ +/* + * MidiEvent.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public enum MidiEventType { + /// + /// channel = 0ス15縺ョ蛟、 + /// + channel, + /// + /// note = 0ス127縺ョ蛟、 + /// + note, + /// + /// dtime = 0ス268,435,455 (0x0FFFFFFF)縺ョ蛟、 + /// + dtime, + /// + /// velocity = 0ス127縺ョ蛟、 + /// + velocity, + /// + /// patch = 0ス127縺ョ蛟、 + /// + patch, + /// + /// sequence = 0-65,535 (0xFFFF)縺ョ蛟、 + /// + sequence, + /// + /// text = 0byte莉・荳翫ョASCII譁蟄怜 + /// + text, + /// + /// raw = 0byte莉・荳翫ョ繝舌う繝翫Μ繝繝シ繧ソ縺ョ譁蟄怜 + /// + raw, + /// + /// pitch_wheel = -8192ス8191 (0x1FFF)縺ョ蛟、 + /// + pitch_wheel, + /// + /// song_pos = 0ス16,383 (0x3FFF)縺ョ蛟、 + /// + song_pos, + /// + /// song_number = 0ス127縺ョ蛟、 + /// + song_number, + /// + /// tempo = 繝槭う繧ッ繝ュ遘, 0ス16,777,215 (0x00FFFFFF)縺ョ蛟、 + /// + tempo, + time_signal, + unknown, + /// + /// 蜍晄焔縺ォ霑ス蜉縲ゅせ繧、繝槭そ繝ウ + /// + parameter, +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiFile.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiFile.java new file mode 100644 index 0000000..c9f7bae --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/MidiFile.java @@ -0,0 +1,1636 @@ +/* + * NrpnData.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.io.*; + class MidiFile { + /* MIDI status commands most significant bit is 1 */ + final int note_off = 0x80; + final int note_on = 0x90; + final int poly_aftertouch = 0xa0; + final int control_change = 0xb0; + final int program_chng = 0xc0; + final int channel_aftertouch = 0xd0; + final int pitch_wheel = 0xe0; + final int system_exclusive = 0xf0; + final int delay_packet = 1111; + + /* 7 bit controllers */ + final int damper_pedal = 0x40; + final int portamento = 0x41; + final int sostenuto = 0x42; + final int soft_pedal = 0x43; + final int general_4 = 0x44; + final int hold_2 = 0x45; + final int general_5 = 0x50; + final int general_6 = 0x51; + final int general_7 = 0x52; + final int general_8 = 0x53; + final int tremolo_depth = 0x5c; + final int chorus_depth = 0x5d; + final int detune = 0x5e; + final int phaser_depth = 0x5f; + + /* parameter values */ + final int data_inc = 0x60; + final int data_dec = 0x61; + + /* parameter selection */ + final int non_reg_lsb = 0x62; + final int non_reg_msb = 0x63; + final int reg_lsb = 0x64; + final int reg_msb = 0x65; + + /* Standard MIDI Files meta event definitions */ + final int meta_event = 0xFF; + final int sequence_number = 0x00; + final int text_event = 0x01; + final int copyright_notice = 0x02; + final int sequence_name = 0x03; + final int instrument_name = 0x04; + final int lyric = 0x05; + final int marker = 0x06; + final int cue_point = 0x07; + final int channel_prefix = 0x20; + final int end_of_track = 0x2f; + final int set_tempo = 0x51; + final int smpte_offset = 0x54; + final int time_signature = 0x58; + final int key_signature = 0x59; + final int sequencer_specific = 0x7f; + + /* Manufacturer's ID number */ + final int Seq_Circuits = 0x01; /* Sequential Circuits Inc. */ + final int Big_Briar = 0x02; /* Big Briar Inc. */ + final int Octave = 0x03; /* Octave/Plateau */ + final int Moog = 0x04; /* Moog Music */ + final int Passport = 0x05; /* Passport Designs */ + final int Lexicon = 0x06; /* Lexicon */ + final int Tempi = 0x20; /* Bon Tempi */ + final int Siel = 0x21; /* S.I.E.L. */ + final int Kawai = 0x41; + final int Roland = 0x42; + final int Korg = 0x42; + final int Yamaha = 0x43; + + /* miscellaneous definitions */ + final long MThd = 0x4d546864L; + final long MTrk = 0x4d54726bL; + + final int MTHD = 256; + final int MTRK = 257; + final int TRKEND = 258; + + final int ON = note_on;//#define ON note_on + final int OFF = note_off; + final int POPR = poly_aftertouch; + final int PAR = control_change; + final int PB = pitch_wheel; + final int PRCH = program_chng; + final int CHPR = channel_aftertouch; + final int SYSEX = system_exclusive; + + final int ARB = 259; + final int MINOR = 260; + final int MAJOR = 261; + + final int CH = 262; + final int NOTE = 263; + final int VAL = 264; + final int CON = 265; + final int PROG = 266; + + static final int INT = 267; + static final int STRING = 268; + final int STRESC = 269; + final int ERR = 270; + final int NOTEVAL = 271; + final int EOL = 272; + + final int META = 273; + final int SEQSPEC = (META + 1 + sequencer_specific); + final int TEXT = (META + 1 + text_event); + final int COPYRIGHT = (META + 1 + copyright_notice); + final int SEQNAME = (META + 1 + sequence_name); + final int INSTRNAME = (META + 1 + instrument_name); + final int LYRIC = (META + 1 + lyric); + final int MARKER = (META + 1 + marker); + final int CUE = (META + 1 + cue_point); + final int SEQNR = (META + 1 + sequence_number); + final int KEYSIG = (META + 1 + key_signature); + final int TEMPO = (META + 1 + set_tempo); + final int TIMESIG = (META + 1 + time_signature); + final int SMPTE = (META + 1 + smpte_offset); + + private final int EOF = -1; + private RandomAccessFile F = null; + //private StreamWriter sw = null; + private StringBuilder sb = null; + //private StreamReader yyin = null; + + private final int FALSE = 0; + private final int TRUE = 1; + + static int err_cont = 0; + + private int fold = 0; /* fold long lines */ + private int notes = 0; /* print notes as a-g */ + private int times = 0; /* print times as Measure/beat/click */ + private static int Measure, M0, Beat, Clicks; + private int TrksToDo = 1; + private int TrkNr; + private static long T0; + static char[] buffer = new char[] { }; + static int bufsiz = 0, buflen; + + private static String note = "n"; + private static String vol = "v"; + private static String con = "c"; + private static String val = "v"; + private static String prog = "p"; + + private static String PolyPr = "PoPr"; + private static String Param = "Par"; + private static String ProgCh = "PrCh"; + private static String ChanPr = "ChPr"; + + static int Format, Ntrks; + + private long Mf_currtime; + private int Mf_nomerge; + private long Mf_toberead; + private String Msgbuff; + private int Msgindex; + + //wtrackDelegate Mf_wtrack = null; + //wtrackDelegate Mf_wtempotrack = null; + //putcDelegate Mf_putc = null; + static long Mf_numbyteswritten = 0L; + + /*extern */ + static long yyval; + /*extern */ + static int eol_seen; + /*extern */ + static int lineno; + /*extern */ + static int yyleng; + /*extern */ + static String yytext; + /*extern */ + static int do_hex; + /*extern */ + static int Mf_RunStat; + + static int laststat; /* last status code */ + static int lastmeta; /* last meta event type */ + + static char[] data = new char[5];//changed to static + static int chan;//static縺ォ螟画峩 + + private int m_nrpn_msb, m_nrpn_lsb; + + public String ReadToEnd() { + return sb.toString(); + } + + + public MidiFile( String smf_path/*, String text_path, Mode mode*/ ) { + //if ( mode == Mode.Read ) { + F = new RandomAccessFile( smf_path, "r" ); + //sw = new StreamWriter( text_path ); + sb = new StringBuilder(); + Mf_toberead = 0L; + Mf_currtime = 0L; + Mf_nomerge = 0; + Mf_nomerge = 1; + TrkNr = 0; + Measure = 4; + Beat = 0x60; + Clicks = 0x60; + T0 = 0L; + M0 = 0; + readheader(); + while ( readtrack() != 0 ) { + } + //sw.Close(); + /*} else if ( mode == Mode.Write ) { + yyin = new StreamReader( text_path ); + F = new FileStream( smf_path, FileMode.Create, FileAccess.Write ); + Mf_putc = fileputc; + Mf_wtrack = mywritetrack; + TrkNr = 0; + Measure = 4; + Beat = 96; + Clicks = 96; + M0 = 0; + T0 = 0; + translate(); + F.Close(); + yyin.Close(); + }*/ + } + + public void close() { + if ( F != null ) { + F.close(); + } + } + + // region t2mf + + int getbyte( String mess ) { + //char ermesg[100]; + getint( mess ); + if ( yyval < 0 || yyval > 127 ) { + String ermesg = "Wrong value (" + yyval + ") for " + mess;// sprintf (ermesg, "Wrong value (%ld) for %s", yyval, mess); + error( ermesg ); + yyval = 0; + } + return (int)yyval; + } + + + static void gethex() { + int c; + buflen = 0; + do_hex = 1; + c = yylex(); + if ( c == STRING ) { + /* Note: yytext includes the trailing, but not the starting quote */ + int i = 0; + if ( yyleng - 1 > bufsiz ) { + bufsiz = yyleng - 1; + if ( buffer != null ) { + buffer = realloc( buffer, bufsiz ); + } else { + buffer = malloc( bufsiz ); + } + /*if ( !buffer ){//buffer == TRUE => buffer != FALSE -> buffer != 0 + error( "Out of memory" ); + }縺輔¥縺倥g縺励∪縺励◆縲ゅ*/ + } + while ( i < yyleng - 1 ) { + c = yytext[i++]; + rescan: + if ( c == '\\' ) { + switch ( c = yytext[i++] ) { + case '0': + c = '\0'; + break; + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + case 'x': + //yytext[i]縺ョ菴咲スョ縺ョ譁蟄励′16騾イ謨ー縺ァ菴ソ繧上l繧区枚蟄励§繧縺ェ縺縺ィ縺 + try { + Int32.Parse( "" + yytext[i] ); + c = yytext[i]; + } catch(Exception ex ) { + prs_error( "Illegal \\x in String" ); + } + /*if ( sscanf( yytext + i, "%2x", &c ) != 1 ) + prs_error( "Illegal \\x in String" );*/ + i += 2; + break; + case '\r': + case '\n': + c = yytext.charAt( i++ ); + while ( c == ' ' || c == '\t' || c == '\r' || c == '\n' ){ + /* skip whitespace */ + c = yytext.charAt( i++ ); + } + goto rescan; /* sorry EWD :=) */ + } + } + buffer[buflen++] = (char)c; + } + } else if ( c == INT ) { + do { + if ( buflen >= bufsiz ) { + bufsiz += 128; + if ( buffer != null ) {// buffer == TRUE -> buffer != FALSE => buffer != 0 + buffer = realloc( buffer, bufsiz ); + } else { + buffer = malloc( bufsiz ); + } + /*if ( !buffer ) { + error( "Out of memory" ); + }蜑企勁縺励∪縺励◆縲ゅ*/ + } + /* This test not applicable for sysex + if (yyval < 0 || yyval > 127) + error ("Illegal hex value"); */ + buffer[buflen++] = (char)yyval; + c = yylex(); + } while ( c == INT ); + if ( c != EOL ) + prs_error( "Unknown hex input" ); + } else + prs_error( "String or hex input expected" ); + } + + + static int yylex() { + // TODO: THIS IS DUMY!! + return 0; + } + + static void prs_error( String s ) {//static莠悟、画峩j + int c = 0; + int count; + int ln = (eol_seen != FALSE ? lineno - 1 : lineno); + Console.WriteLine( ln + ": " + s );// fprintf( stderr, "%d: %s\n", ln, s ); + if ( yyleng > 0 && yytext != "\n" ) { + Console.WriteLine( "*** " + yyleng + " " + yytext + " ***" );//fprintf( stderr, "*** %*s ***\n", yyleng, yytext ); + } + count = 0; + while ( count < 100 && (c = yylex()) != EOL && c != EOF ) { + count++/* skip rest of line */; + } + if ( c == EOF ) { + Environment.Exit( 1 );// exit( 1 ); + } + if ( err_cont != FALSE ) { + //longjmp( erjump, 1 ); + throw new Exception( s ); + } + } + + + static char[] realloc( char[] source, int size ) { + char[] result = new char[size]; + for ( int i = 0; i < size; i++ ) { + if ( i < source.Length ) { + result[i] = source[i]; + } else { + break; + } + } + return result; + } + + + static char[] malloc( int size ) { + return new char[size]; + } + + + static void checkeol() { + if ( eol_seen != FALSE ) { + return; + } + if ( yylex() != EOL ) { + prs_error( "Garbage deleted" ); + while ( eol_seen == FALSE/*!eol_seen*/ ) { + yylex(); /* skip rest of line */ + } + } + } + + private void translate() { + if ( yylex() == MTHD ) { + Format = getint( "MFile format" ); + Ntrks = getint( "MFile #tracks" ); + Clicks = getint( "MFile Clicks" ); + if ( Clicks < 0 ) { + Clicks = (Clicks & 0xff) << 8 | getint( "MFile SMPTE division" ); + } + checkeol(); + mfwrite( Format, Ntrks, Clicks, F ); + } else { + Console.WriteLine( "Missing MFile - can't continue\n" ); + Environment.Exit( 1 ); + } + } + + + private void mfwrite( int format, int ntracks, int division, RandomAccessFile fp ) { + int i; + //void mf_w_track_chunk(), mf_w_header_chunk(); + + if ( Mf_putc == null/*NULLFUNC*/ ) { + mferror( "mfmf_write() called without setting Mf_putc" ); + } + + if ( Mf_wtrack == null/*NULLFUNC*/ ) { + mferror( "mfmf_write() called without setting Mf_mf_writetrack" ); + } + + /* every MIDI file starts with a header */ + mf_w_header_chunk( format, ntracks, division ); + + /* In format 1 files, the first track is a tempo map */ + if ( format == 1 && (Mf_wtempotrack != null) ) { + mf_w_track_chunk( -1, fp, Mf_wtempotrack ); + ntracks--; + } + + /* The rest of the file is a series of tracks */ + for ( i = 0; i < ntracks; i++ ) { + mf_w_track_chunk( i, fp, Mf_wtrack ); + } + } + + + void mf_w_header_chunk( int format, int ntracks, int division ) { + ulong ident, length; + //void write16bit(),write32bit(); + + ident = MThd; /* Head chunk identifier */ + length = 6; /* Chunk length */ + + /* individual bytes of the header must be written separately + to preserve byte order across cpu types :-( */ + write32bit( ident ); + write32bit( length ); + write16bit( format ); + write16bit( ntracks ); + write16bit( division ); + } /* end gen_header_chunk() */ + + + //Delegate int wtrackDelegate(); + //delegate int putcDelegate( int c ); + + private void mf_w_track_chunk( int which_track, RandomAccessFile fp, wtrackDelegate wtrack /* int (*wtrack) wtrack*/) { + ulong trkhdr, trklength; + long offset, place_marker; + //void write16bit(),write32bit(); + + trkhdr = MTrk; + trklength = 0; + + /* Remember where the length was written, because we don't + know how long it will be until we've finished writing */ + offset = fp.Position;//ftell( fp ); + /* Write the track chunk header */ + write32bit( trkhdr ); + write32bit( trklength ); + + Mf_numbyteswritten = 0L; /* the header's length doesn't count */ + laststat = 0; + + /* Note: this calls Mf_writetempotrack with an unused parameter (-1) + But this is innocent */ + + wtrack();//蠑墓焚辟。縺上※縺縺繧薙°縺ェ縲ゅゅ (*wtrack)( which_track ); + + if ( laststat != meta_event || lastmeta != end_of_track ) { + /* mf_write End of track meta event */ + eputc( 0 ); + eputc( meta_event ); + eputc( end_of_track ); + eputc( 0 ); + } + + laststat = 0; + + /* It's impossible to know how long the track chunk will be beforehand, + so the position of the track length data is kept so that it can + be written after the chunk has been generated */ + place_marker = fp.Position;// ftell( fp ); + + /* This method turned out not to be portable because the + parameter returned from ftell is not guaranteed to be + in bytes on every machine */ + /* track.length = place_marker - offset - (long) sizeof(track); */ + + + fp.seek( offset ); + + trklength = Mf_numbyteswritten; + + /* Re-mf_write the track chunk header with right length */ + write32bit( trkhdr ); + write32bit( trklength ); + + fp.seek( place_marker );// fseek( fp, place_marker, 0 ); + } + + private void write32bit( long data ) { + eputc( (int)((data >> 24) & 0xff) ); + eputc( (int)((data >> 16) & 0xff) ); + eputc( (int)((data >> 8) & 0xff) ); + eputc( (int)(data & 0xff) ); + } + + + void write16bit( int data ) { + eputc( (int)((data & 0xff00) >> 8) ); + eputc( (int)(data & 0xff) ); + } + + + private int eputc( int c )/*unsigned char c*/{ + if ( Mf_putc == null )/* == NULLFUNC*/ { + mferror( "Mf_putc undefined" ); + return (-1); + } + + //return_val = (*Mf_putc)( c ); + int return_val = Mf_putc( c ); + + if ( return_val == EOF ) { + mferror( "error writing" ); + } + + Mf_numbyteswritten++; + return (return_val); + } + + + static void checkchan() { + if ( yylex() != CH || yylex() != INT ) { + syntax(); + } + if ( yyval < 1 || yyval > 16 ) { + error( "Chan must be between 1 and 16" ); + } + chan = (int)yyval - 1; + } + + + static void checknote() { + int c = 0; + if ( yylex() != NOTE || ((c = yylex()) != INT && c != NOTEVAL) ) { + syntax(); + } + if ( c == NOTEVAL ) { + /*static */ + int[] notes = new int[]{ + 9, /* a */ + 11, /* b */ + 0, /* c */ + 2, /* d */ + 4, /* e */ + 5, /* f */ + 7 /* g */ + }; + + //char* p = yytext; + String p = yytext; + int index = 0; + c = p[index];//*p++; + if ( Char.IsUpper( (char)c )/* isupper( c )*/ ) { + String temp = c + ""; + temp = temp.ToLower(); + c = (int)temp[0];//tolower( c ); + } + yyval = notes[c - 'a']; + switch ( p[index]/**p*/ ) { + case '#': + case '+': + yyval++; + //p++; + index++; + break; + case 'b': + case 'B': + case '-': + yyval--; + //p++; + index++; + break; + } + yyval += 12 * Intger.parseInt( p );//atoi( p ); + } + if ( yyval < 0 || yyval > 127 ) + error( "Note must be between 0 and 127" ); + data[0] = (char)yyval; + } + + + static void syntax() {//static縺ォ螟画峩縺励◆ + prs_error( "Syntax error" ); + } + + + static void checkval() { + if ( yylex() != VAL || yylex() != INT ) + syntax(); + if ( yyval < 0 || yyval > 127 ) + error( "Value must be between 0 and 127" ); + data[1] = (char)yyval; + } + + + static void splitval() { + if ( yylex() != VAL || yylex() != INT ) + syntax(); + if ( yyval < 0 || yyval > 16383 ) + error( "Value must be between 0 and 16383" ); + data[0] = (char)(yyval % 128); + data[1] = (char)(yyval / 128); + } + + + static void get16val() { + if ( yylex() != VAL || yylex() != INT ) + syntax(); + if ( yyval < 0 || yyval > 65535 ) + error( "Value must be between 0 and 65535" ); + data[0] = (char)((yyval >> 8) & 0xff); + data[1] = (char)(yyval & 0xff); + } + + + static void checkcon() { + if ( yylex() != CON || yylex() != INT ) + syntax(); + if ( yyval < 0 || yyval > 127 ) + error( "Controller must be between 0 and 127" ); + data[0] = (char)yyval; + } + + + void WriteVarLen( long value ) { + long buffer; + + buffer = value & 0x7f; + while ( (value >>= 7) > 0 ) { + buffer <<= 8; + buffer |= 0x80; + buffer += (value & 0x7f); + } + while ( true/*1*/ ) { + eputc( (int)(buffer & 0xff) ); + + if ( (buffer & 0x80) != FALSE ) + buffer >>= 8; + else + return; + } + }/* end of WriteVarLen */ + + + int mf_w_midi_event( long delta_time, int type, int chan, char[] data, long size ) { + //int i; + /*unsigned */ + char c; + + WriteVarLen( delta_time ); + + /* all MIDI events start with the type in the first four bits, + and the channel in the lower four bits */ + c = (char)(type | chan); + + if ( chan > 15 ) { + //perror( "error: MIDI channel greater than 16\n" ); + Console.Error.WriteLine( "error: MIDI channel greater than 16" ); + } + + if ( Mf_RunStat == FALSE || laststat != c ) + eputc( c ); + + laststat = c; + + /* write out the data bytes */ + for ( ulong i = 0; i < size; i++ ) { + eputc( (int)(data[i]) ); + } + + return (int)size; + } /* end mf_write MIDI event */ + + + int mf_w_meta_event( long delta_time, int type, char[] data, long size ) { + //int i; + + WriteVarLen( delta_time ); + + /* This marks the fact we're writing a meta-event */ + eputc( meta_event ); + laststat = meta_event; + + /* The type of meta event */ + eputc( (int)type ); + lastmeta = (int)type; + + /* The length of the data bytes to follow */ + WriteVarLen( size ); + + for ( ulong i = 0; i < size; i++ ) { + if ( eputc( data[i] ) != data[i] ) { + return (-1); + } + } + return (int)size; + } /* end mf_w_meta_event */ + + + static void checkprog() { + if ( yylex() != PROG || yylex() != INT ) + syntax(); + if ( yyval < 0 || yyval > 127 ) + error( "Program number must be between 0 and 127" ); + data[0] = (char)yyval; + } + + + int mf_w_sysex_event(long delta_time, char[] data, long size ) { + //int i; + + WriteVarLen( delta_time ); + + /* The type of sysex event */ + eputc( data[0] );//eputc( *data ); + laststat = 0; + + /* The length of the data bytes to follow */ + WriteVarLen( size - 1 ); + + for ( ulong i = 1; i < size; i++ ) { + if ( eputc( data[i] ) != data[i] ) + return (-1); + } + return (int)size; + } /* end mf_w_sysex_event */ + + + void mf_w_tempo( long delta_time, long tempo ) { + /* Write tempo */ + /* all tempos are written as 120 beats/minute, */ + /* expressed in microseconds/quarter note */ + + WriteVarLen( delta_time ); + + eputc( meta_event ); + laststat = meta_event; + eputc( set_tempo ); + + eputc( 3 ); + eputc( (int)(0xff & (tempo >> 16)) ); + eputc( (int)(0xff & (tempo >> 8)) ); + eputc( (int)(0xff & tempo) ); + } + + + int mywritetrack() { + int opcode, c; + long currtime = 0; + long newtime, delta; + int i, k; + + while ( (opcode = yylex()) == EOL ) + ; + if ( opcode != MTRK ) + prs_error( "Missing MTrk" ); + checkeol(); + while ( true/*1*/ ) { + err_cont = 1; + //setjmp( erjump ); + try { + switch ( yylex() ) { + case MTRK: + prs_error( "Unexpected MTrk" ); + continue; + case EOF: + err_cont = 0; + error( "Unexpected EOF" ); + return -1; + case TRKEND: + err_cont = 0; + checkeol(); + return 1; + case INT: + newtime = yyval; + if ( (opcode = yylex()) == '/' ) { + if ( yylex() != INT ) + prs_error( "Illegal time value" ); + newtime = (newtime - M0) * Measure + yyval; + if ( yylex() != '/' || yylex() != INT ) + prs_error( "Illegal time value" ); + newtime = T0 + newtime * Beat + yyval; + opcode = yylex(); + } + delta = newtime - currtime; + switch ( opcode ) { + case ON: + case OFF: + case POPR: + checkchan(); + checknote(); + checkval(); + mf_w_midi_event( (ulong)delta, (uint)opcode, (uint)chan, data, (char)2L ); + break; + + case PAR: + checkchan(); + checkcon(); + checkval(); + mf_w_midi_event( (ulong)delta, (uint)opcode, (uint)chan, data, (char)2L ); + break; + + case PB: + checkchan(); + splitval(); + mf_w_midi_event( (ulong)delta, (uint)opcode, (uint)chan, data, (char)2L ); + break; + + case PRCH: + checkchan(); + checkprog(); + mf_w_midi_event( (ulong)delta, (uint)opcode, (uint)chan, data, (char)1L ); + break; + + case CHPR: + checkchan(); + checkval(); + data[0] = data[1]; + mf_w_midi_event( (ulong)delta, (uint)opcode, (uint)chan, data, (char)1L ); + break; + + case SYSEX: + case ARB: + gethex(); + mf_w_sysex_event( (ulong)delta, buffer, (ulong)buflen ); + break; + + case TEMPO: + if ( yylex() != INT ) + syntax(); + mf_w_tempo( (ulong)delta, (ulong)yyval ); + break; + + case TIMESIG: { + int nn, denom, cc, bb; + if ( yylex() != INT || yylex() != '/' ) + syntax(); + nn = (int)yyval; + denom = getbyte( "Denom" ); + cc = getbyte( "clocks per click" ); + bb = getbyte( "32nd notes per 24 clocks" ); + for ( i = 0, k = 1; k < denom; i++, k <<= 1 ) + ; + if ( k != denom ) + error( "Illegal TimeSig" ); + data[0] = (char)nn; + data[1] = (char)i; + data[2] = (char)cc; + data[3] = (char)bb; + M0 += (int)((newtime - T0) / (Beat * Measure)); + T0 = newtime; + Measure = nn; + Beat = 4 * Clicks / denom; + mf_w_meta_event( (ulong)delta, time_signature, data, 4L ); + } + break; + + case SMPTE: + for ( i = 0; i < 5; i++ ) { + data[i] = (char)getbyte( "SMPTE" ); + } + mf_w_meta_event( (ulong)delta, smpte_offset, data, 5L ); + break; + + case KEYSIG: + data[0] = (char)getint( "Keysig" ); + if ( data[0] < -7 || data[0] > 7 ) + error( "Key Sig must be between -7 and 7" ); + if ( (c = yylex()) != MINOR && c != MAJOR ) { + syntax(); + } + if ( c == MINOR ) { + data[1] = (char)TRUE;//(c == MINOR); + } else { + data[1] = (char)FALSE; + } + mf_w_meta_event( (ulong)delta, key_signature, data, 2L ); + break; + + case SEQNR: + //get16val( "SeqNr" ); + get16val();// + mf_w_meta_event( (ulong)delta, sequence_number, data, 2L ); + break; + + case META: { + int type = yylex(); + switch ( type ) { + case TRKEND: + type = end_of_track; + break; + case TEXT: + case COPYRIGHT: + case SEQNAME: + case INSTRNAME: + case LYRIC: + case MARKER: + case CUE: + type -= (META + 1); + break; + case INT: + type = (int)yyval; + break; + default: + prs_error( "Illegal Meta type" ); + break; + } + if ( type == end_of_track ) + buflen = 0; + else + gethex(); + mf_w_meta_event( (ulong)delta, (uint)type, buffer, (ulong)buflen ); + break; + } + case SEQSPEC: + gethex(); + mf_w_meta_event( (ulong)delta, sequencer_specific, buffer, (ulong)buflen ); + break; + default: + prs_error( "Unknown input" ); + break; + } + currtime = newtime; + break; + case EOL: + break; + default: + prs_error( "Unknown input" ); + break; + } + } catch (Exception ex ) { + continue; + } + checkeol(); + } + } + + + static int getint( String mess ) {//changed to static + //char[] ermesg = new char[100]; + if ( yylex() != INT ) { + String ermesg = "Integer expected for " + mess;//sprintf( ermesg, "Integer expected for %s", mess ); + error( ermesg ); + yyval = 0; + } + return (int)yyval; + } + + + int fileputc( int c ) { + //return putc(c, F); + F.WriteByte( (byte)c ); + return 0; + } + + + // Functions to be called while processing the MIDI file. + + private int getc() { + try { + int res; + res = F.ReadByte(); + return res; + } catch ( Exception e ) { + Console.Error.WriteLine( e.StackTrace ); + return EOF; + } + } + + private static void error( String s ) {//static莠悟、画峩 + /*if ( TrksToDo <= 0 ) { + Console.Error.WriteLine( "Error: Garbage at end" ); + } else { + Console.Error.WriteLine( "Error: " + s ); + }*/ + } + + + private void header( int format, int ntrks, int division ) { + if ( (division & 0x8000) != FALSE ) { + // SMPTE + times = 0; /* Can't do beats */ + sb.append( "MFile " + format + " " + ntrks + " " + (-((-(division >> 8)) & 0xff)) + " " + (division & 0xff) + "\n" ); + } else { + sb.append( "MFile " + format + " " + ntrks + " " + division + "\n" ); + } + //Console.Writef("MFile %d %d %d\n",format,ntrks,division); + if ( format > 2 ) { + //fprintf(stderr, "Can't deal with format %d files\n", format); + Console.Error.WriteLine( "Can't deal with format " + format + " files" ); + //Console.Writef("Can't deal with format %d files\n", format); + //System.Environment.Exit( 1 ); + return; + } + Beat = Clicks = division; + TrksToDo = ntrks; + } + + private void starttrack() { + //sw.WriteLine( "MTrk" ); + sb.append( "MTrk\n" ); + TrkNr++; + } + + private void endtrack() { + //sw.WriteLine( "TrkEnd" ); + sb.append( "TrkEnd\n" ); + --TrksToDo; + } + + private void on( int chan, int pitch, int v ) { + prtime(); + //sw.WriteLine( "On ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + vol + "=" + v ); + sb.append( "On ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + vol + "=" + v + "\n" ); + } + + private void off( int chan, int pitch, int v ) { + prtime(); + //sw.WriteLine( "Off ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + vol + "=" + v ); + sb.append( "Off ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + vol + "=" + v + "\n" ); + } + + private void pressure( int chan, int pitch, int press ) { + prtime(); + //sw.WriteLine( PolyPr + " ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + val + "=" + press ); + sb.append( PolyPr + " ch=" + (chan + 1) + " " + note + "=" + mknote( pitch ) + " " + val + "=" + press + "\n" ); + } + + class Comment { + public int Index; + public String Msb; + public String Lsb; + public Comment( int index, String msb, String lsb ) { + Index = index; + Msb = msb; + Lsb = lsb; + } + } + + private void parameter( int chan, int control, int value ) { + prtime(); + //sw.WriteLine( Param + " ch=" + (chan + 1) + " " + con + "=" + control + " " + val + "=" + value ); + sb.append( Param + " ch=" + (chan + 1) + " " + con + "=" + control + " " + val + "=" + value + "\n" ); + } + + private void pitchbend( int chan, int lsb, int msb ) { + prtime(); + //sw.WriteLine( "Pb ch=" + (chan + 1) + " " + val + "=" + (128 * msb + lsb) ); + sb.append( "Pb ch=" + (chan + 1) + " " + val + "=" + (128 * msb + lsb) + "\n" ); + } + + private void program( int chan, int program ) { + prtime(); + //sw.WriteLine( ProgCh + " ch=" + (chan + 1) + " " + prog + "=" + program ); + sb.append( ProgCh + " ch=" + (chan + 1) + " " + prog + "=" + program + "\n" ); + } + + private void chanpressure( int chan, int press ) { + prtime(); + //sw.WriteLine( ChanPr + " ch=" + (chan + 1) + " " + val + "=" + press ); + sb.append( ChanPr + " ch=" + (chan + 1) + " " + val + "=" + press + "\n" ); + } + + private void sysex() { + sysex( msgleng(), msg() ); + } + private void sysex( int leng, String mess ) { + prtime(); + //sw.Write( "SysEx" ); + sb.append( "SysEx" ); + prhex( mess, leng ); + } + + private void arbitrary( int leng, String mess ) { + prtime(); + //sw.Write( "Arb" ); + sb.append( "Arb" ); + prhex( mess, leng ); + } + + private void metamisc( int type, int leng, String mess ) { + prtime(); + //sw.Write( "Meta 0x" + Convert.ToString( type, 16 ) ); + sb.append( "Meta 0x" + Convert.ToString( type, 16 ) ); + prhex( mess, leng ); + } + + private void seqnum( int num ) { + prtime(); + //sw.WriteLine( "SeqNr " + num ); + sb.append( "SeqNr " + num + "\n" ); + } + + private void eot() { + prtime(); + //sw.WriteLine( "Meta TrkEnd" ); + sb.append( "Meta TrkEnd\n" ); + } + + private void smpte( int hr, int mn, int se, int fr, int ff ) { + prtime(); + //sw.WriteLine( "SMPTE " + hr + " " + mn + " " + se + " " + fr + " " + ff ); + sb.append( "SMPTE " + hr + " " + mn + " " + se + " " + fr + " " + ff + "\n" ); + } + + private void tempo( long tempo ) { + prtime(); + //sw.WriteLine( "Tempo " + tempo ); + sb.append( "Tempo " + tempo +"\n" ); + } + + private void timesig( int nn, int dd, int cc, int bb ) { + int denom = 1; + while ( dd-- > 0 ) { + denom *= 2; + } + prtime(); + //sw.WriteLine( "TimeSig " + nn + "/" + denom + " " + cc + " " + bb ); + sb.append( "TimeSig " + nn + "/" + denom + " " + cc + " " + bb + "\n" ); + M0 += (int)(Mf_currtime - T0) / (Beat * Measure); + T0 = Mf_currtime; + Measure = nn; + Beat = 4 * Clicks / denom; + } + + private void keysig( int sf, int mi ) { + prtime(); + if ( mi != FALSE ) { + //sw.WriteLine( "KeySig " + sf + " " + "minor" ); + sb.append( "KeySig " + sf + " " + "minor\n" ); + } else { + //sw.WriteLine( "KeySig " + sf + " " + "major" ); + sb.append( "KeySig " + sf + " " + "major\n" ); + } + } + + private void sqspecific( int leng, String mess ) { + prtime(); + //sw.Write( "SeqSpec" ); + sb.append( "SeqSpec" ); + prhex( mess, leng ); + } + + private void text( int type, int leng, String mess ) { + String[] ttype = { + "", + "Text", /* type=0x01 */ + "Copyright", /* type=0x02 */ + "TrkName", + "InstrName", /* ... */ + "Lyric", + "Marker", + "Cue", /* type=0x07 */ + "Unrec" + }; + + int unrecognized = ttype.Length - 1; + + prtime(); + if ( type < 1 || type > unrecognized ) { + //sw.Write( "Meta 0x" + Convert.ToString( type, 16 ) ); + sb.append( "Meta 0x" + Convert.ToString( type, 16 ) ); + prtext( mess, leng ); + } else if ( type == 3 && TrkNr == 1 ) { + //sw.Write( "Meta SeqName " ); + sb.append( "Meta SeqName " ); + prtext( mess, leng ); + } else { + //sw.Write( "Meta " + ttype[type] + " " ); + sb.append( "Meta " + ttype[type] + " " ); + prtext( mess, leng ); + } + } + + + // support functions for mf2t + + private void prtime() { + if ( times != FALSE ) { + long m = (Mf_currtime - T0) / Beat; + //sw.Write( "" + (m / Measure + M0) + ":" + (m % Measure) + ":" + ((Mf_currtime - T0) % Beat) + " " ); + sb.append( "" + (m / Measure + M0) + ":" + (m % Measure) + ":" + ((Mf_currtime - T0) % Beat) + " " ); + } else { + //sw.Write( "" + Mf_currtime + " " ); + sb.append( "" + Mf_currtime + " " ); + } + } + + private void prtext( String p, int leng ) { + //Console.Error.WriteLine( "prtext" ); + int n; + char c; + int pos = 25; + //int index = -1; + //sw.Write( "\"" ); + sb.append( "\"" ); + for ( n = 0; n < leng; n++ ) { + //index++; + char[] t = p.substring( n, n + 1 ).toCharArray(); + c = t[0]; + if ( fold != FALSE && (pos >= fold) ) { + //sw.Write( "\\" + Environment.NewLine + "\t" );//"\\\n\t"); + sb.append( "\\" + "\n" + "\t" ); + pos = 13; /* tab + \xab + \ */ + if ( c == ' ' || c == '\t' ) { + //sw.Write( "\\" ); + sb.append( "\\" ); + ++pos; + } + } + switch ( c ) { + case '\\': + case '"': + //sw.Write( "\\" + c ); + sb.append( "\\" + c ); + pos += 2; + break; + case '\r': + //sw.Write( "\\r" ); + sb.append( "\\r" ); + pos += 2; + break; + case '\n': + //sw.Write( "\\n" ); + sb.append( "\\n" ); + pos += 2; + break; + case '\0': + //sw.Write( "\\-" ); + sb.append( "\\-" ); + pos += 2; + break; + default: + if ( isprint( c ) ) { + //sw.Write( c.ToString() ); + sb.append( c.ToString() ); + ++pos; + } else { + //sw.Write( "\\x" + Convert.ToString( (int)c, 16 ) ); + sb.append( "\\x" + Convert.ToString( (int)c, 16 ) ); + pos += 4; + } + break; + } + //Console.Error.WriteLine( "in for loop" ); + } + //Console.Error.WriteLine( "buffer=" + buffer ); + //sw.WriteLine( "\"" ); + sb.append( "\"\n" ); + } + + private String mknote( int pitch ) { + String[] Notes = { "c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "a#", "b" }; + if ( notes != FALSE ) { + return Notes[pitch % 12] + pitch / 12; + } else { + return "" + pitch; + } + } + + private int msgleng() { + return Msgindex; + } + + + private String msg() { + return Msgbuff; + } + + private void prhex( String p, int leng ) { + int n; + int pos = 25; + + int index = -1; + for ( n = 0; n < leng; n++, index++ ) { + if ( fold != FALSE && (pos) >= fold ) { + //sw.Write( "\\" + Environment.NewLine + "\t" + Convert.ToString( (int)char.Parse( p.SubString( index, 1 ) ), 16 ) ); + sb.append( "\\" + "\n" + "\t" + Convert.ToString( (int)char.Parse( p.SubString( index, 1 ) ), 16 ) ); + pos = 14; /* tab + ab + " ab" + \ */ + } else { + //sw.Write( " " + Convert.ToString( (int)char.Parse( p.SubString( index, 1 ) ), 16 ) ); + sb.append( " " + Convert.ToString( (int)char.Parse( p.SubString( index, 1 ) ), 16 ) ); + pos += 3; + } + } + //sw.WriteLine( "" ); + sb.append( "\n" ); + } + + private static boolean isprint( char ch ) { + if ( 32 <= (int)ch && (int)ch <= 126 ) { + return true; + } else { + return false; + } + } + + private void readheader() { + if ( readmt( "MThd" ) != -1 ) { + Mf_toberead = read32bit(); + int format = read16bit(); + int ntrks = read16bit(); + int division = read16bit(); + header( format, ntrks, division ); + while ( Mf_toberead > 0L ) { + egetc(); + } + } + } + + private int readtrack() { + int[] ttype = { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 2, 0 }; + int num2 = 0; + int num4 = 0; + int num5 = 0; + int status = 0; + if ( readmt( "MTrk" ) == -1 ) { + return 0; + } + Mf_toberead = read32bit(); + Mf_currtime = 0L; + starttrack(); + while ( Mf_toberead > 0L ) { + long unrecognized; + Mf_currtime += readvarinum(); + int c = egetc(); + if ( (num4 != 0) && (c != 0xf7) ) { + mferror( "didn't find expected continuation of a sysex" ); + } + if ( (c & 0x80) == 0 ) { + if ( status == 0 ) { + mferror( "unexpected running status" ); + } + num5 = 1; + num2 = c; + c = status; + } else if ( c < 240 ) { + status = c; + num5 = 0; + } + int num7 = ttype[(c >> 4) & 15]; + if ( num7 != 0 ) { + if ( num5 == 0 ) { + num2 = egetc(); + } + chanmessage( status, num2, (num7 <= 1) ? 0 : egetc() ); + continue; + } + switch ( c ) { + case 0xff: { + int type = egetc(); + unrecognized = (Mf_toberead - readvarinum()) - 1L; + msginit(); + while ( Mf_toberead > unrecognized ) { + msgadd( egetc() ); + } + metaevent( type ); + continue; + } + case 240: { + unrecognized = Mf_toberead - readvarinum(); + msginit(); + msgadd( 240 ); + while ( Mf_toberead > unrecognized ) { + msgadd( c = egetc() ); + } + if ( (c != 0xf7) && (Mf_nomerge != 0) ) { + break; + } + sysex(); + continue; + } + case 0xf7: { + unrecognized = Mf_toberead - readvarinum(); + if ( num4 == 0 ) { + msginit(); + } + while ( Mf_toberead > unrecognized ) { + msgadd( c = egetc() ); + } + if ( num4 == 0 ) { + arbitrary( msgleng(), msg() ); + } else if ( c == 0xf7 ) { + sysex(); + num4 = 0; + } + continue; + } + default: + goto Label_0260; + } + num4 = 1; + continue; + Label_0260: + badbyte( c ); + } + endtrack(); + //Console.Write( buffer ); + return 1; + } + + private int readmt( String s ) { + String res = s; + int num2 = 4; + int[] e = new int[num2]; + e[0] = getc(); + e[1] = getc(); + e[2] = getc(); + e[3] = getc(); + for ( int i = 0; i < 4; i++ ) { + if ( e[i] != char.Parse( res.SubString( i, 1 ) ) ) { + mferror( "expecting " + s ); + } + } + return e[3]; + } + + private void mferror( String s ) { + error( s ); + //System.Environment.Exit( 1 ); + } + + private int read16bit() { + int num = egetc(); + int num2 = egetc(); + return to16bit( num, num2 ); + } + + + private long read32bit() { + int num = egetc(); + int num2 = egetc(); + int num3 = egetc(); + int num4 = egetc(); + return to32bit( num, num2, num3, num4 ); + } + + + private int egetc() { + int num = getc(); + if ( num == EOF ) { + mferror( "premature EOF" ); + } + Mf_toberead -= 1L; + return num; + } + + private long readvarinum() { + int num2 = egetc(); + long num = num2; + if ( (num2 & 0x80) != 0 ) { + num &= 0x7fL; + do { + num2 = egetc(); + num = (num << 7) + (num2 & 0x7f); + } while ( (num2 & 0x80) != 0 ); + } + return num; + } + + private void chanmessage( int status, int c1, int c2 ) { + int chan = status & 15; + switch ( (status & 240) ) { + case 0x80: + off( chan, c1, c2 ); + break; + + case 0x90: + on( chan, c1, c2 ); + break; + + case 160: + pressure( chan, c1, c2 ); + break; + + case 0xb0: + parameter( chan, c1, c2 ); + break; + + case 0xe0: + pitchbend( chan, c1, c2 ); + break; + + case 0xc0: + program( chan, c1 ); + break; + + case 0xd0: + chanpressure( chan, c1 ); + break; + } + } + + private void msginit() { + Msgindex = 0; + Msgbuff = ""; + } + + private void msgadd( int c ) { + Msgbuff = Msgbuff + (char)c; + Msgindex++; + } + + private void metaevent( int type ) { + int leng = msgleng(); + String m = msg(); + switch ( type ) { + case 0: + seqnum( to16bit( + (int)char.Parse( m.SubString( 0, 1 ) ), + (int)char.Parse( m.SubString( 1, 1 ) ) ) + ); + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + text( type, leng, m ); + break; + + case 0x2f: + eot(); + break; + + case 0x51: + tempo( to32bit( + 0, + (int)char.Parse( m.SubString( 0, 1 ) ), + (int)char.Parse( m.SubString( 1, 1 ) ), + (int)char.Parse( m.SubString( 2, 1 ) ) ) + ); + break; + + case 0x54: + smpte( + (int)char.Parse( m.SubString( 0, 1 ) ), + (int)char.Parse( m.SubString( 1, 1 ) ), + (int)char.Parse( m.SubString( 2, 1 ) ), + (int)char.Parse( m.SubString( 3, 1 ) ), + (int)char.Parse( m.SubString( 4, 1 ) ) + ); + break; + + case 0x58: + timesig( + (int)char.Parse( m.SubString( 0, 1 ) ), + (int)char.Parse( m.SubString( 1, 1 ) ), + (int)char.Parse( m.SubString( 2, 1 ) ), + (int)char.Parse( m.SubString( 3, 1 ) ) + ); + break; + + case 0x59: + keysig( + (int)char.Parse( m.SubString( 0, 1 ) ), + (int)char.Parse( m.SubString( 1, 1 ) ) + ); + break; + + case 0x7f: + sqspecific( leng, m ); + break; + + default: + metamisc( type, leng, m ); + break; + } + } + + private void badbyte( int c ) { + mferror( "unexpected byte: " + c ); + } + + private static int to16bit( int c1, int c2 ) { + return (((c1 & 0xff) << 8) + (c2 & 0xff)); + } + + + private static long to32bit( int c1, int c2, int c3, int c4 ) { + long num = 0L; + num = c1 & 0xff; + num = (num << 8) + (c2 & 0xff); + num = (num << 8) + (c3 & 0xff); + return ((num << 8) + (c4 & 0xff)); + } + } diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/NrpnData.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/NrpnData.java new file mode 100644 index 0000000..72a4b20 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/NrpnData.java @@ -0,0 +1,49 @@ +/* + * NrpnData.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class NrpnData { + //private int m_clock; + public int Clock; + //private byte m_parameter; + public byte Parameter; + //private byte m_value; + public byte Value; + + public NrpnData( int clock, byte parameter, byte value ) { + Clock = clock; + Parameter = parameter; + Value = value; + } + + + /*public property int Clock { + get { + return m_clock; + } + };*/ + /*public property byte Parameter { + get { + return m_parameter; + } + };*/ + /*public property byte Value { + get { + return m_value; + } + set { + m_value = value; + } + };*/ +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SMFReader.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SMFReader.java new file mode 100644 index 0000000..58bf4d7 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SMFReader.java @@ -0,0 +1,50 @@ +/* + * SMFReader.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; +import java.util.*; +/// + /// SMF繝輔ぃ繧、繝ォ繧定ァ」譫舌@縲√ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ蠖「蠑上ョ繝繝シ繧ソ縺ォ螟画鋤縺励∪縺 + /// + public class SMFReader { + //private StreamReader sr = null; + + private MidiFile m_midi = null; + //private String _result = ""; + private Vector m_lines; + + /// + /// 繝繝輔か繝ォ繝医さ繝ウ繧ケ繝医Λ繧ッ繧ソ縲ゅさ繝ウ繧ケ繝医Λ繧ッ繝医→蜷梧凾縺ォ隗」譫舌r陦後>縲∵欠螳壹&繧後◆繝輔ぃ繧、繝ォ縺ォ邨先棡繧呈シ邏阪@縺セ縺吶 + /// + /// 隗」譫仙ッセ雎。縺ョ繝輔ぃ繧、繝ォ縺ク縺ョ繝代せ + public SMFReader( String _path ) { + //_result = Path.GetTempFileName(); + m_midi = new MidiFile( _path );//, _result, Mode.Read ); + //sr = new StreamReader( _result ); + m_lines = new Vector(); + String[] splitted = m_midi.ReadToEnd().split( "\n" ); + for( int i = 0; i < splitted.length; i++ ){ + String spl = splitted[i]; + m_lines.add( spl ); + } + } + + public void dispose() { + m_midi.close(); + } + + public Vector getLines() { + return m_lines; + } + +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SingerConfig.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SingerConfig.java new file mode 100644 index 0000000..0121f2c --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/SingerConfig.java @@ -0,0 +1,327 @@ +/* + * SingerConfig.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +import java.io.*; +import jp.sourceforge.lipsync.bocoree.*; + +public class SingerConfig { + public String ID = "VOCALOID:VIRTUAL:VOICE"; + public String FORMAT = "2.0.0.0"; + public String VOICEIDSTR = ""; + public String VOICENAME = "Miku"; + public int Breathiness = 0; + public int Brightness = 0; + public int Clearness = 0; + public int Opening = 0; + public int GenderFactor = 0; + public int Original = 0; + + public static void decode_vvd_bytes( Vector dat ) { + for ( int i = 0; i < dat.size(); i++ ) { + byte b = (Byte)dat.get( i ); + byte M = (byte)(b >> 4); + byte L = (byte)(b - (M << 4)); + byte newM = endecode_vvd_m( M ); + byte newL = endecode_vvd_l( L ); + dat.set( i, (byte)((newM << 4) | newL) ); + } + } + + private static byte endecode_vvd_l( byte value ) { + switch ( value ) { + case 0x0: + return 0xa; + case 0x1: + return 0xb; + case 0x2: + return 0x8; + case 0x3: + return 0x9; + case 0x4: + return 0xe; + case 0x5: + return 0xf; + case 0x6: + return 0xc; + case 0x7: + return 0xd; + case 0x8: + return 0x2; + case 0x9: + return 0x3; + case 0xa: + return 0x0; + case 0xb: + return 0x1; + case 0xc: + return 0x6; + case 0xd: + return 0x7; + case 0xe: + return 0x4; + case 0xf: + return 0x5; + } + return 0x0; + } + + private static byte endecode_vvd_m( byte value ) { + switch ( value ) { + case 0x0: + return 0x1; + case 0x1: + return 0x0; + case 0x2: + return 0x3; + case 0x3: + return 0x2; + case 0x4: + return 0x5; + case 0x5: + return 0x4; + case 0x6: + return 0x7; + case 0x7: + return 0x6; + case 0x8: + return 0x9; + case 0x9: + return 0x8; + case 0xa: + return 0xb; + case 0xb: + return 0xa; + case 0xc: + return 0xd; + case 0xd: + return 0xc; + case 0xe: + return 0xf; + case 0xf: + return 0xe; + } + return 0x0; + } + + public SingerConfig( String file, int original ) throws FileNotFoundException, IOException { + Original = original; + FileInputStream fs = new FileInputStream( file ); + File f = new File( file ); + int length = (int)f.length(); + byte[] tdat = new byte[length]; + fs.read( tdat, 0, length ); + Vector dat = new Vector(); + decode_vvd_bytes( dat ); + for ( int i = 0; i < dat.size() - 1; i++ ) { + tdat[i] = (Byte)dat.get( i ); + } + for ( int i = 0; i < tdat.length - 1; i++ ) { + byte b = tdat[i]; + if ( b == 0x17 && b == 0x10 ) { + tdat[i] = 0x0d; + tdat[i + 1] = 0x0a; + } + } + String str = cp932.convert( tdat ); + String crlf = Character.toString( (char)0x0d ) + Character.toString( (char)0x0a ); + String[] spl = str.split( crlf ); + + for ( int i = 0; i < spl.length; i++ ) { + String s = spl[i]; + int first = s.indexOf( '"' ); + int first_end = get_quated_String( s, first ); + int second = s.indexOf( '"', first_end + 1 ); + int second_end = get_quated_String( s, second ); + char[] chs = s.toCharArray(); + String id = new String( chs, first, first_end - first + 1 ); + String value = new String( chs, second, second_end - second + 1 ); + id = id.substring( 1, id.length() - 2 ); + value = value.substring( 1, value.length() - 2 ); + value = value.replace( "\\\"", "\"" ); + if ( id.equals( "ID" ) ) { + ID = value; + } else if ( id.equals( "FORMAT" ) ) { + FORMAT = value; + } else if ( id.equals( "VOICEIDSTR" ) ) { + VOICEIDSTR = value; + } else if ( id.equals( "VOICENAME" ) ) { + VOICENAME = value; + } else if ( id.equals( "Breathiness" ) ) { + try { + Breathiness = Integer.parseInt( value ); + } catch ( Exception e ) { + } + } else if ( id.equals( "Brightness" ) ) { + try { + Brightness = Integer.parseInt( value ); + } catch ( Exception e ) { + } + } else if ( id.equals( "Clearness" ) ) { + try { + Clearness = Integer.parseInt( value ); + } catch ( Exception e ) { + } + } else if ( id.equals( "Opening" ) ) { + try { + Opening = Integer.parseInt( value ); + } catch ( Exception e ) { + } + } else if ( id.equals( "Gender:Factor" ) ) { + try { + GenderFactor = Integer.parseInt( value ); + } catch ( Exception e ) { + } + } + } + } + + +/// +/// 菴咲スョposition縺ォ縺ゅk'"'縺九iシ梧ャ。縺ォ迴セ繧後k'"'縺ョ菴咲スョ繧定ェソ縺ケ繧具シ弱お繧ケ繧ア繝シ繝励&繧後◆\"縺ッ繧ケ繧ュ繝繝励&繧後kシ'"'縺瑚ヲ九▽縺九i縺ェ縺九▲縺溷エ蜷-1繧定ソ斐☆ +/// +/// +/// +/// + private static int get_quated_String( String s, int position ) { + if ( position < 0 ) { + return -1; + } + + char[] chs = s.toCharArray(); + if ( position >= chs.length ) { + return -1; + } + + if ( chs[position] != '"' ) { + return -1; + } + + int end = -1; + for ( int i = position + 1; i < + chs.length; i++ ) { + if ( chs[i] == '"' && chs[i - 1] != '\\' ) { + end = i; + break; + } + } + return end; + } + + // 縺薙%豕ィ諢擾シシ + public String[] toStringEx() { + Vector ret = new Vector(); + ret.add( "\"ID\":=:\"" + ID + "\"" ); + ret.add( "\"FORMAT\":=:\"" + FORMAT + "\"" ); + ret.add( "\"VOICEIDSTR\":=:\"" + VOICEIDSTR + "\"" ); + ret.add( "\"VOICENAME\":=:\"" + VOICENAME.replace( "\"", "\\\"" ) + "\"" ); + ret.add( "\"Breathiness\":=:\"" + Breathiness + "\"" ); + ret.add( "\"Brightness\":=:\"" + Brightness + "\"" ); + ret.add( "\"Clearness\":=:\"" + Clearness + "\"" ); + ret.add( "\"Opening\":=:\"" + Opening + "\"" ); + ret.add( "\"Gender:Factor\":=:\"" + GenderFactor + "\"" ); + return ret.toArray( new String[]{} ); + } + + /*public property int Original { + get { + return m_original; + } + set { + m_original = value; + } + };*/ + + /*public property String ID { + get { + return m_id; + } + set { + m_id = value; + } + };*/ + + /*public property String FORMAT { + get { + return m_format; + } + set { + m_format = value; + } + };*/ + + /*public property String VOICEIDSTR { + get { + return m_voiceidstr; + } + set { + m_voiceidstr = value; + } + };*/ + + /*public proprety String VOICENAME { + get { + return m_voicename; + } + set { + m_voicename = value; + } + };*/ + + /*public property int Breathiness { + get { + return m_breathiness; + } + set { + m_breathiness = value; + } + };*/ + + /*public property int Brightness { + get { + return m_brightness; + } + set { + m_brightness = value; + } + };*/ + + /*public property int Clearness { + get { + return m_clearness; + } + set { + m_clearness = value; + } + };*/ + + /*public proprety int Opening { + get { + return m_opening; + } + set { + m_opening = value; + } + };*/ + + /*public property int GenderFactor { + get { + return m_gender_factor; + } + set { + m_gender_factor = value; + } + };*/ +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TempoTableEntry.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TempoTableEntry.java new file mode 100644 index 0000000..0ae83a5 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TempoTableEntry.java @@ -0,0 +1,70 @@ +/* + * BPPair.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class TempoTableEntry implements Comparable, Cloneable { + //private int m_clock; + public int Clock; + //private int m_tempo; + public int Tempo; + //private double m_time; + public double Time; + + /*public property int Tempo { + get { + return m_tempo; + } + set { + m_tempo = value; + } + };*/ + /*public property double Time { + get { + return m_time; + } + set { + m_time = value; + } + };*/ + /*public property int Clock { + get { + return m_clock; + } + set { + m_clock = value; + } + };*/ + public Object clone() { + return new TempoTableEntry( Clock, Tempo, Time ); + } + + public TempoTableEntry( int _index, int _tempo, double _time ) { + this.Clock = _index; + this.Tempo = _tempo; + this.Time = _time; + } + + public int compareTo( TempoTableEntry entry ) { + return this.Clock - entry.Clock; + } + + public boolean equals( TempoTableEntry entry ) { + if ( this.Clock == entry.Clock ) { + return true; + } else { + return false; + } + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextMemoryStream.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextMemoryStream.java new file mode 100644 index 0000000..bcec866 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextMemoryStream.java @@ -0,0 +1,112 @@ +/* + * TextMemoryStream.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.io.*; +import java.util.*; + +/** + * + * @author kbinani + */ +public class TextMemoryStream { + StringBuilder m_ms = null; + int m_position; + + /// + /// + /// + /// + public void write( String value ) { + m_ms.append( value ); + m_position = m_ms.length(); + } + + public void rewind() { + m_position = 0; + } + + public void writeLine( String s ) { + m_ms.append( s + "\n" ); + } + + public void close() { + if ( m_ms != null ) { + m_ms = null; + } + } + + public int peek() { + if ( m_position >= m_ms.length() ) { + return -1; + } else { + return (int)m_ms.charAt( m_position ); + } + } + + private int readByte() { + if ( m_position >= m_ms.length() ) { + return -1; + } else { + m_position++; + return (int)m_ms.charAt( m_position ); + } + } + + public String readLine() { + int ret; + ret = readByte(); + ArrayList buffer = new ArrayList(); + while ( ret >= 0 ) { + char ch = (char)ret; + if ( ch == '\n' ) { + int next; + long current = m_position; //0x0D繧呈、懷コ縺励◆逶エ蠕後ョ繧ケ繝医Μ繝シ繝縺ョ菴咲スョ + + break; + } + buffer.add( ch ); + ret = readByte(); + } + String ans = ""; + for ( int i = 0; i < buffer.size(); i++ ) { + ans += buffer.get( i ); + } + return ans; + } + + public void dispose() { + close(); + } + + public TextMemoryStream( String path, String encoding ) throws Exception { + m_ms = new StringBuilder(); + File f = new File( path ); + if ( f.exists() ) { + FileReader fis = new FileReader( f ); + BufferedReader br = new BufferedReader( fis ); + while ( br.ready() ) { + String line = br.readLine(); + m_ms.append( line + "\n" ); + } + } + m_position = 0; + } + + public TextMemoryStream() { + m_ms = new StringBuilder(); + m_position = 0; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextResult.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextResult.java new file mode 100644 index 0000000..bba9c89 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TextResult.java @@ -0,0 +1,43 @@ +/* + * TextResult.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public class TextResult { + private String m_value; + + /** + * + * @param value + */ + public TextResult( String value ) { + m_value = value; + } + + /** + * + * @return + */ + public String get() { + return m_value; + } + + public void set( String value ) { + m_value = value; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TimeSigTableEntry.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TimeSigTableEntry.java new file mode 100644 index 0000000..eaabcb2 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/TimeSigTableEntry.java @@ -0,0 +1,90 @@ +/* + * BPPair.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class TimeSigTableEntry implements Comparable, Cloneable { + //int m_clock; + public int Clock; + //int m_numerator; + public int Numerator; + //int m_denominator; + public int Denominator; + //int m_bar_count; + public int BarCount; + + public Object clone() { + return new TimeSigTableEntry( Clock, Numerator, Denominator, BarCount ); + } + + public int compareTo( TimeSigTableEntry item ) { + return this.BarCount - item.BarCount; + } + + + /*// + /// 繧ッ繝ュ繝繧ッ謨ー + /// + public property int Clock { + get { + return m_clock; + } + set { + m_clock = value; + } + };*/ + /*// + /// 諡榊ュ舌ョ蛻豈 + /// + public property int Numerator { + get { + return m_numerator; + } + set { + m_numerator = value; + } + };*/ + /*// + /// 諡榊ュ舌ョ蛻豈 + /// + public property int Denominator { + get { + return m_denominator; + } + set { + m_denominator = value; + } + };*/ + /*// + /// Clock縺ョ譎らせ縺ァ菴募ー冗ッ逶ョ縺九r蜿門セ励@縺セ縺吶 + /// + public property int BarCount { + get { + return m_bar_count; + } + set { + m_bar_count = value; + } + };*/ + public TimeSigTableEntry( + int clock, + int numerator, + int denominator, + int bar_count ) { + Clock = clock; + Numerator = numerator; + Denominator = denominator; + BarCount = bar_count; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoHandle.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoHandle.java new file mode 100644 index 0000000..7f94723 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoHandle.java @@ -0,0 +1,156 @@ +/* + * VibratoHandle.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public class VibratoHandle extends VsqHandle implements Cloneable { + public Object clone() { + VibratoHandle result = new VibratoHandle(); + result.Type = Type; + result.Index = Index; + result.IconID = IconID; + result.IDS = this.IDS; + result.Original = this.Original; + result.Caption = this.Caption; + result.Length = this.Length; + result.StartDepth = this.StartDepth; + result.DepthBPNum = this.DepthBPNum; + if ( DepthBPX != null ) { + result.DepthBPX = (float[])this.DepthBPX.clone(); + } + if ( DepthBPY != null ) { + result.DepthBPY = (int[])this.DepthBPY.clone(); + } + result.StartRate = this.StartRate; + result.RateBPNum = this.RateBPNum; + if ( this.RateBPX != null ) { + result.RateBPX = (float[])this.RateBPX.clone(); + } + if ( this.RateBPY != null ) { + result.RateBPY = (int[])this.RateBPY.clone(); + } + return result; + } + + + /*public int Original { + get { + return m_original; + } + set { + m_original = value; + } + }*/ + /*public int Length { + get { + return m_length; + } + set { + m_length = value; + } + }*/ + /*public string Caption { + get { + return m_caption; + } + set { + m_caption = value; + } + }*/ + /*public property String IDS { + get { + return m_ids; + } + set { + m_ids = value; + } + };*/ + /*public string IconID { + get { + return m_icon_id; + } + set { + m_icon_id = value; + } + }*/ + + /*public int StartDepth { + get { + return m_start_depth; + } + set { + m_start_depth = value; + } + }*/ + /*public int StartRate { + get { + return m_start_rate; + } + set { + m_start_rate = value; + } + }*/ + /*public int DepthBPNum { + get { + return m_depth_bp_num; + } + set { + m_depth_bp_num = value; + } + }*/ + /*public property int RateBPNum { + get { + return m_rate_bp_num; + } + set { + m_rate_bp_num = value; + } + };*/ + /*public property float[] DepthBPX { + get { + return m_depth_bp_x; + } + set { + m_depth_bp_x = value; + } + };*/ + /*public property int[] DepthBPY { + get { + return m_depth_bp_y; + } + set { + m_depth_bp_y = value; + } + };*/ + /*public property float[] RateBPX { + get { + return m_rate_bp_x; + } + set { + m_rate_bp_x = value; + } + };*/ + + /*public property int[] RateBPY { + get { + return m_rate_bp_y; + } + set { + m_rate_bp_y = value; + } + };*/ +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoType.java new file mode 100644 index 0000000..255c113 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoType.java @@ -0,0 +1,33 @@ +/* + * VibratoType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + + public enum VibratoType{ + NormalType1, + NormalType2, + NormalType3, + NormalType4, + ExtremeType1, + ExtremeType2, + ExtremeType3, + ExtremeType4, + FastType1, + FastType2, + FastType3, + FastType4, + SlightType1, + SlightType2, + SlightType3, + SlightType4, + } \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoTypeUtil.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoTypeUtil.java new file mode 100644 index 0000000..ff1e341 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VibratoTypeUtil.java @@ -0,0 +1,253 @@ +/* + * VibratoType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public class VibratoTypeUtil { + public static VibratoType FromIconID( String icon_id ) { + if ( icon_id.equals( "$04040001" ) ) { + return VibratoType.NormalType1; + } else if ( icon_id.equals( "$04040002" ) ) { + return VibratoType.NormalType2; + } else if ( icon_id.equals( "$04040003" ) ) { + return VibratoType.NormalType3; + } else if ( icon_id.equals( "$0400004" ) ) { + return VibratoType.NormalType4; + } else if ( icon_id.equals( "$04040005" ) ) { + return VibratoType.ExtremeType1; + } else if ( icon_id.equals( "$04040006" ) ) { + return VibratoType.ExtremeType2; + } else if ( icon_id.equals( "$04040007" ) ) { + return VibratoType.ExtremeType3; + } else if ( icon_id.equals( "$04040008" ) ) { + return VibratoType.ExtremeType4; + } else if ( icon_id.equals( "$04040009" ) ) { + return VibratoType.FastType1; + } else if ( icon_id.equals( "$0404000a" ) ) { + return VibratoType.FastType2; + } else if ( icon_id.equals( "$0404000b" ) ) { + return VibratoType.FastType3; + } else if ( icon_id.equals( "$0404000c" ) ) { + return VibratoType.FastType4; + } else if ( icon_id.equals( "$0404000d" ) ) { + return VibratoType.SlightType1; + } else if ( icon_id.equals( "$0404000e" ) ) { + return VibratoType.SlightType2; + } else if ( icon_id.equals( "$0404000f" ) ) { + return VibratoType.SlightType3; + } else if ( icon_id.equals( "$04040010" ) ) { + return VibratoType.SlightType4; + } + + return VibratoType.NormalType1; + } + + public static String GetIconID( VibratoType type ) { + switch ( type ) { + case NormalType1: + return "$04040001"; + case NormalType2: + return "$04040002"; + case NormalType3: + return "$04040003"; + case NormalType4: + return "$0400004"; + case ExtremeType1: + return "$04040005"; + case ExtremeType2: + return "$04040006"; + case ExtremeType3: + return "$04040007"; + case ExtremeType4: + return "$04040008"; + case FastType1: + return "$04040009"; + case FastType2: + return "$0404000a"; + case FastType3: + return "$0404000b"; + case FastType4: + return "$0404000c"; + case SlightType1: + return "$0404000d"; + case SlightType2: + return "$0404000e"; + case SlightType3: + return "$0404000f"; + case SlightType4: + return "$04040010"; + } + return ""; + } + + public static VibratoHandle GetDefaultVibratoHandle( VibratoType type, int vibrato_clocks ) { + VibratoHandle res = new VibratoHandle(); + res.Type = VsqHandleType.Vibrato; + res.Length = vibrato_clocks; + res.Original = 1; + res.DepthBPNum = 0; + res.RateBPNum = 0; + res.Caption = toString( type ); + res.IconID = GetIconID( type ); + switch ( type ) { + case NormalType1: + res.IDS = "normal"; + res.StartDepth = 64; + res.StartRate = 50; + break; + case NormalType2: + res.IDS = "normal"; + res.StartDepth = 40; + res.StartRate = 40; + break; + case NormalType3: + res.IDS = "normal"; + res.StartDepth = 127; + res.StartRate = 50; + break; + case NormalType4: + res.IDS = "normal"; + res.StartDepth = 64; + res.DepthBPNum = 57; + res.DepthBPX = new float[]{ 0.603900f, 0.612500f, 0.616400f, 0.621100f, 0.625000f, 0.633600f, 0.637500f, 0.641400f, 0.646100f, 0.653900f, 0.658600f, 0.666400f, 0.670300f, 0.675000f, 0.678900f, 0.683600f, 0.691400f, 0.696100f, 0.703900f, 0.708600f, 0.712500f, 0.716400f, 0.721100f, 0.725000f, 0.728900f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.766400f, 0.771100f, 0.775000f, 0.783600f, 0.791400f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.812500f, 0.821100f, 0.828900f, 0.837500f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.862500f, 0.866400f, 0.875000f, 0.878900f, 0.883600f, 0.887500f, 0.891400f, 0.896100f, 0.900000f, 1.000000f }; + res.DepthBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + res.StartRate = 50; + res.RateBPNum = 52; + res.RateBPX = new float[]{ 0.600000f, 0.612500f, 0.616400f, 0.621100f, 0.628900f, 0.633600f, 0.637500f, 0.641400f, 0.653900f, 0.658600f, 0.662500f, 0.666400f, 0.675000f, 0.683600f, 0.687500f, 0.691400f, 0.700000f, 0.703900f, 0.708600f, 0.712500f, 0.725000f, 0.728900f, 0.732800f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.771100f, 0.775000f, 0.778900f, 0.783600f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.816400f, 0.821100f, 0.828900f, 0.833600f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.866400f, 0.871100f, 0.875000f, 0.878900f, 0.887500f, 0.891400f, 0.900000f, 1.000000f }; + res.RateBPY = new int[]{ 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + break; + case ExtremeType1: + res.IDS = "extreme"; + res.StartDepth = 64; + res.StartRate = 64; + break; + case ExtremeType2: + res.IDS = "extreme"; + res.StartDepth = 32; + res.StartRate = 32; + break; + case ExtremeType3: + res.IDS = "extreme"; + res.StartDepth = 100; + res.StartRate = 50; + break; + case ExtremeType4: + res.IDS = "extreme"; + res.StartDepth = 64; + res.DepthBPNum = 57; + res.DepthBPX = new float[]{ 0.603900f, 0.612500f, 0.616400f, 0.621100f, 0.625000f, 0.633600f, 0.637500f, 0.641400f, 0.646100f, 0.653900f, 0.658600f, 0.666400f, 0.670300f, 0.675000f, 0.678900f, 0.683600f, 0.691400f, 0.696100f, 0.703900f, 0.708600f, 0.712500f, 0.716400f, 0.721100f, 0.725000f, 0.728900f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.766400f, 0.771100f, 0.775000f, 0.783600f, 0.791400f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.812500f, 0.821100f, 0.828900f, 0.837500f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.862500f, 0.866400f, 0.875000f, 0.878900f, 0.883600f, 0.887500f, 0.891400f, 0.896100f, 0.900000f, 1.000000f }; + res.DepthBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + res.StartRate = 64; + res.RateBPNum = 57; + res.RateBPX = new float[]{ 0.603900f, 0.612500f, 0.616400f, 0.621100f, 0.625000f, 0.633600f, 0.637500f, 0.641400f, 0.646100f, 0.653900f, 0.658600f, 0.666400f, 0.670300f, 0.675000f, 0.678900f, 0.683600f, 0.691400f, 0.696100f, 0.703900f, 0.708600f, 0.712500f, 0.716400f, 0.721100f, 0.725000f, 0.728900f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.766400f, 0.771100f, 0.775000f, 0.783600f, 0.791400f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.812500f, 0.821100f, 0.828900f, 0.837500f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.862500f, 0.866400f, 0.875000f, 0.878900f, 0.883600f, 0.887500f, 0.891400f, 0.896100f, 0.900000f, 1.000000f }; + res.RateBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + break; + case FastType1: + res.IDS = "fast"; + res.StartDepth = 64; + res.StartRate = 64; + break; + case FastType2: + res.IDS = "fast"; + res.StartDepth = 40; + res.StartRate = 50; + break; + case FastType3: + res.IDS = "fast"; + res.StartDepth = 80; + res.StartRate = 70; + break; + case FastType4: + res.IDS = "fast"; + res.StartDepth = 64; + res.DepthBPNum = 57; + res.DepthBPX = new float[]{ 0.603900f, 0.612500f, 0.616400f, 0.621100f, 0.625000f, 0.633600f, 0.637500f, 0.641400f, 0.646100f, 0.653900f, 0.658600f, 0.666400f, 0.670300f, 0.675000f, 0.678900f, 0.683600f, 0.691400f, 0.696100f, 0.703900f, 0.708600f, 0.712500f, 0.716400f, 0.721100f, 0.725000f, 0.728900f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.766400f, 0.771100f, 0.775000f, 0.783600f, 0.791400f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.812500f, 0.821100f, 0.828900f, 0.837500f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.862500f, 0.866400f, 0.875000f, 0.878900f, 0.883600f, 0.887500f, 0.891400f, 0.896100f, 0.900000f, 1.000000f }; + res.DepthBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + res.StartRate = 64; + res.RateBPNum = 57; + res.RateBPX = new float[]{ 0.603900f, 0.612500f, 0.616400f, 0.621100f, 0.625000f, 0.633600f, 0.637500f, 0.641400f, 0.646100f, 0.653900f, 0.658600f, 0.666400f, 0.670300f, 0.675000f, 0.678900f, 0.683600f, 0.691400f, 0.696100f, 0.703900f, 0.708600f, 0.712500f, 0.716400f, 0.721100f, 0.725000f, 0.728900f, 0.737500f, 0.746100f, 0.750000f, 0.758600f, 0.762500f, 0.766400f, 0.771100f, 0.775000f, 0.783600f, 0.791400f, 0.795300f, 0.800000f, 0.803900f, 0.808600f, 0.812500f, 0.821100f, 0.828900f, 0.837500f, 0.841400f, 0.846100f, 0.850000f, 0.853900f, 0.862500f, 0.866400f, 0.875000f, 0.878900f, 0.883600f, 0.887500f, 0.891400f, 0.896100f, 0.900000f, 1.000000f }; + res.RateBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + break; + case SlightType1: + res.IDS = "slight"; + res.StartDepth = 64; + res.StartRate = 64; + break; + case SlightType2: + res.IDS = "slight"; + res.StartDepth = 40; + res.StartRate = 64; + break; + case SlightType3: + res.IDS = "slight"; + res.StartDepth = 72; + res.StartRate = 64; + break; + case SlightType4: + res.IDS = "slight"; + res.StartDepth = 64; + res.DepthBPNum = 57; + res.DepthBPX = new float[]{ 0.604300f, 0.612500f, 0.616800f, 0.620700f, 0.625000f, 0.633200f, 0.637500f, 0.641800f, 0.645700f, 0.654300f, 0.658200f, 0.666800f, 0.670700f, 0.675000f, 0.679300f, 0.683200f, 0.691800f, 0.695700f, 0.704300f, 0.708200f, 0.712500f, 0.716800f, 0.720700f, 0.725000f, 0.729300f, 0.737500f, 0.745700f, 0.750000f, 0.758200f, 0.762500f, 0.766800f, 0.770700f, 0.775000f, 0.783200f, 0.791800f, 0.795700f, 0.800000f, 0.804300f, 0.808200f, 0.812500f, 0.820700f, 0.829300f, 0.837500f, 0.841800f, 0.845700f, 0.850000f, 0.854300f, 0.862500f, 0.866800f, 0.875000f, 0.879300f, 0.883200f, 0.887500f, 0.891800f, 0.895700f, 0.900000f, 1.000000f }; + res.DepthBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + res.StartRate = 64; + res.RateBPNum = 57; + res.RateBPX = new float[]{ 0.604300f, 0.612500f, 0.616800f, 0.620700f, 0.625000f, 0.633200f, 0.637500f, 0.641800f, 0.645700f, 0.654300f, 0.658200f, 0.666800f, 0.670700f, 0.675000f, 0.679300f, 0.683200f, 0.691800f, 0.695700f, 0.704300f, 0.708200f, 0.712500f, 0.716800f, 0.720700f, 0.725000f, 0.729300f, 0.737500f, 0.745700f, 0.750000f, 0.758200f, 0.762500f, 0.766800f, 0.770700f, 0.775000f, 0.783200f, 0.791800f, 0.795700f, 0.800000f, 0.804300f, 0.808200f, 0.812500f, 0.820700f, 0.829300f, 0.837500f, 0.841800f, 0.845700f, 0.850000f, 0.854300f, 0.862500f, 0.866800f, 0.875000f, 0.879300f, 0.883200f, 0.887500f, 0.891800f, 0.895700f, 0.900000f, 1.000000f }; + res.RateBPY = new int[]{ 64, 63, 62, 61, 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 35, 34, 32, 31, 30, 29, 28, 27, 25, 24, 23, 22, 21, 20, 19, 17, 15, 14, 13, 12, 11, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0 }; + break; + } + return res; + } + + public static String toString( VibratoType value ) { + switch ( value ) { + case NormalType1: + return "[Normal] Type 1"; + case NormalType2: + return "[Normal] Type 2"; + case NormalType3: + return "[Normal] Type 3"; + case NormalType4: + return "[Normal] Type 4"; + case ExtremeType1: + return "[Extreme] Type 1"; + case ExtremeType2: + return "[Extreme] Type 2"; + case ExtremeType3: + return "[Extreme] Type 3"; + case ExtremeType4: + return "[Extreme] Type 4"; + case FastType1: + return "[Fast] Type 1"; + case FastType2: + return "[Fast] Type 2"; + case FastType3: + return "[Fast] Type 3"; + case FastType4: + return "[Fast] Type 4"; + case SlightType1: + return "[Slight] Type 1"; + case SlightType2: + return "[Slight] Type 2"; + case SlightType3: + return "[Slight] Type 3"; + case SlightType4: + return "[Slight] Type 4"; + } + return ""; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBPList.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBPList.java new file mode 100644 index 0000000..3f49b36 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBPList.java @@ -0,0 +1,203 @@ +/* + * VsqBPList.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +import java.io.*; + +/** + * ス曖PList縺ョ繝繝シ繧ソ驛ィ蛻繧貞叙繧頑桶縺縺溘a縺ョ繧ッ繝ゥ繧ケ縲 + *@author kbinani + */ +public class VsqBPList implements Cloneable { + TreeMap _list = new TreeMap(); + int _default = 0; + int _maximum = 127; + int _minimum = 0; + + public Object clone() { + VsqBPList res = new VsqBPList( _default, _minimum, _maximum ); + Set enumerator = _list.keySet(); + for ( Iterator itr = enumerator.iterator(); itr.hasNext();) { + Integer key = (Integer)itr.next(); + res._list.put( key, _list.get( key ) ); + } + return res; + } + + /** + * 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縲ゅョ繝輔か繝ォ繝亥、縺ッ繧ウ繧ウ縺ァ謖螳壹☆繧九 + * @param default_value + */ + public VsqBPList( int default_value, int minimum, int maximum ) { + _default = default_value; + _maximum = maximum; + _minimum = minimum; + } + + /** + * 縺薙ョ繝ェ繧ケ繝医↓險ュ螳壹&繧後◆譛螟ァ蛟、繧貞叙蠕励@縺セ縺吶 + */ + public int getMaximum() { + return _maximum; + } + + /** + * 縺薙ョ繝ェ繧ケ繝医↓險ュ螳壹&繧後◆譛蟆丞、繧貞叙蠕励@縺セ縺 + /* + public int getMinimum() { + return _minimum; + } + + + /* // + /// _list縺ク縺ョ繧「繧ッ繧サ繝繧オ + /// + public SortedList List { + get { + return _list; + } + }*/ + public Set keyClockSet() { + return _list.keySet(); + } + + + public Iterator keyClockIterator(){ + return _list.keySet().iterator(); + } + + public void remove( int clock ) { + if ( _list.containsKey( clock ) ) { + _list.remove( clock ); + } + } + + public boolean containsKey( int clock ) { + return _list.containsKey( clock ); + } + + public int size() { + return _list.size(); + } + + public void clear() { + _list.clear(); + } + + /** + * 譁ー縺励>繝繝シ繧ソ轤ケ繧定ソス蜉縺励∪縺吶 + * + * @param clock + * @param value + */ + public void add( int clock, int value ) { + _list.put( clock, value ); + } + + public int get( int clock ) { + if ( _list.size() == 0 ) { + return _default; + } else { + if ( _list.containsKey( clock ) ) { + return _list.get( clock ); + } else { + int index = 0; + int prev = 0; + for ( Iterator itr = _list.keySet().iterator(); itr.hasNext();) { + Integer key = (Integer)itr.next(); + if ( clock < key ) { + index = prev; + break; + } + prev = key; + } + if ( _list.containsKey( index ) ) { + return _list.get( index ); + } else { + return _default; + } + } + } + } + + /** + * 縺薙ョBPList縺ョ繝繝輔か繝ォ繝亥、繧貞叙蠕励@縺セ縺 + */ + public int getDefault() { + return _default; + } + + /** + * 縺薙ョBPList縺ョ蜀螳ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ譖ク縺榊コ縺励∪縺 + * + * @param writer + */ + public void print( BufferedWriter writer ) throws IOException { + boolean first = true; + for ( Iterator itr = _list.keySet().iterator(); itr.hasNext();) { + Integer key = (Integer)itr.next(); + int val = _list.get( key ); + if ( first ) { + writer.write( key + "=" + val + "\n" ); + first = false; + } else { + writer.write( key + "=" + val + "\n" ); + } + } + } + + /** + * 縺薙ョBPList縺ョ蜀螳ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ譖ク縺榊コ縺励∪縺 + * + * @param writer + */ + public void print( TextMemoryStream writer, int start, String header ) { + boolean first = true; + for ( Iterator itr = _list.keySet().iterator(); itr.hasNext();) { + Integer key = (Integer)itr.next(); + if ( start <= key ) { + if ( first ) { + writer.writeLine( header ); + first = false; + } + int val = _list.get( key ); + writer.writeLine( key + "=" + val ); + } + } + } + + /** + * 繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i繝繝シ繧ソ轤ケ繧定ェュ霎シ縺ソ縲∫樟蝨ィ縺ョ繝ェ繧ケ繝医↓霑ス蜉縺励∪縺 + * + * @param reader + * @returns + */ + public String readFrom( TextMemoryStream reader ) { + String last_line = reader.readLine(); + while ( !last_line.startsWith( "[" ) ) { + String[] spl = last_line.split( "=" ); + int i1 = Integer.parseInt( spl[0] ); + int i2 = Integer.parseInt( spl[1] ); + _list.put( i1, i2 ); + if ( reader.peek() < 0 ) { + break; + } else { + last_line = reader.readLine(); + } + } + return last_line; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineEnumeration.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineEnumeration.java new file mode 100644 index 0000000..f3a692b --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineEnumeration.java @@ -0,0 +1,126 @@ +/* + * VsqBarLineEnumeration.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + +/** + * + * @author kbinani + */ +public class VsqBarLineEnumeration implements Enumeration { + Vector TimeSigTable; + int end_clock; + int m_index = 0; + int m_last_clock = -1; + + public VsqBarLineEnumeration( Vector time_sig_table, int t_end_clock ) { + TimeSigTable = time_sig_table; + end_clock = t_end_clock; + m_index = 0; + m_last_clock = -1; + } + + public boolean hasMoreElements() { + if ( m_last_clock < 0 ) { + return true; + } + for ( int i = m_index; i < TimeSigTable.size(); i++ ) { + int denominator = TimeSigTable.get( i ).Denominator; + int numerator = TimeSigTable.get( i ).Numerator; + int local_clock = TimeSigTable.get( i ).Clock; + int bar_count = TimeSigTable.get( i ).BarCount; + int clock_step = 480 * 4 / denominator; + int mod = clock_step * numerator; + int bar_counter = bar_count - 1; + int t_end = end_clock; + if ( i + 1 < TimeSigTable.size() ) { + t_end = TimeSigTable.get( i + 1 ).Clock; + } + int t_start = m_last_clock + clock_step; + for ( int clock = t_start; clock < t_end; clock += clock_step ) { + if ( (clock - local_clock) % mod == 0 ) { + bar_counter++; + return true; + } else { + return true; + } + } + } + return false; + } + + public Object nextElement() { + if ( m_last_clock < 0 ) { + m_last_clock = 0; + return new VsqBarLineType( 0, true, TimeSigTable.get( 0 ).Denominator, TimeSigTable.get( 0 ).Numerator, 0 ); + } + int last = m_index; + for ( m_index = last; m_index < TimeSigTable.size(); m_index++ ) { + int denominator = TimeSigTable.get( m_index ).Denominator; + int numerator = TimeSigTable.get( m_index ).Numerator; + int local_clock = TimeSigTable.get( m_index ).Clock; + int bar_count = TimeSigTable.get( m_index ).BarCount; + int clock_step = 480 * 4 / denominator; + int mod = clock_step * numerator; + int bar_counter = bar_count - 1; + int t_end = end_clock; + if ( m_index + 1 < TimeSigTable.size() ) { + t_end = TimeSigTable.get( m_index + 1 ).Clock; + } + int t_start = m_last_clock + clock_step; + for ( int clock = t_start; clock < t_end; clock += clock_step ) { + if ( (clock - local_clock) % mod == 0 ) { + bar_counter++; + m_last_clock = clock; + return new VsqBarLineType( clock, true, denominator, numerator, bar_counter ); + } else { + m_last_clock = clock; + return new VsqBarLineType( clock, false, denominator, numerator, bar_counter ); + } + } + } + return null; + } + + + /*private Object imp_nextElement() { + int local_denominator; + int local_numerator; + int local_clock; + int local_bar_count; + int clock_step; + for ( int i = 0; i < TimeSigTable.size(); i++ ) { + local_denominator = TimeSigTable.get( i ).Denominator; + local_numerator = TimeSigTable.get( i ).Numerator; + local_clock = TimeSigTable.get( i ).Clock; + local_bar_count = TimeSigTable.get( i ).BarCount; + clock_step = 480 * 4 / local_denominator; + int mod = clock_step * local_numerator; + int bar_counter = local_bar_count - 1; + int t_end = end_clock; + if ( i + 1 < TimeSigTable.size() ) { + t_end = TimeSigTable.get( i + 1 ).Clock; + } + for ( int clock = local_clock; clock < t_end; clock += clock_step ) { + if ( (clock - local_clock) % mod == 0 ) { + bar_counter++; + return new VsqBarLineType( clock, true, local_denominator, local_numerator, bar_counter ); + } else { + return new VsqBarLineType( clock, false, local_denominator, local_numerator, bar_counter ); + } + } + } + }*/ +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineType.java new file mode 100644 index 0000000..2c63f63 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqBarLineType.java @@ -0,0 +1,56 @@ +/* + * VibratoType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class VsqBarLineType { + public int Clock = 0; + public boolean IsSeparator = true; + public int Denominator; + public int Numerator; + public int BarCount; + + /*public property int BarCount { + get { + return m_bar_count; + } + };*/ + /*public property int LocalDenominator { + get { + return m_denominator; + } + };*/ + /*public property int LocalNumerator { + get { + return m_numerator; + } + };*/ + /*public property int Clock { + get { + return m_clock; + } + };*/ + /*public boolean property IsSeparator { + get { + return m_is_separator; + } + };*/ + public VsqBarLineType( int clock, boolean is_separator, int denominator, int numerator, int bar_count ) { + Clock = clock; + IsSeparator = is_separator; + Denominator = denominator; + Numerator = numerator; + BarCount = bar_count; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommand.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommand.java new file mode 100644 index 0000000..fe3073e --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommand.java @@ -0,0 +1,44 @@ +/* + * VsqCommand.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +/// +/// +/// + +public class VsqCommand { + public VsqCommandType Type; + /** + * 繧ウ繝槭Φ繝峨ョ蜃ヲ逅蜀螳ケ繧剃ソ晄戟縺励∪縺吶Args蜈キ菴鍋噪縺ェ蜀螳ケ縺ッ縲∝ヲ逅縺吶k繧ッ繝ゥ繧ケ縺斐→縺ォ逡ー縺ェ繧翫∪縺 + */ + public Object[] Args; + /** + * 蠕檎カ壹☆繧九さ繝槭Φ繝 + */ + public Vector Children = new Vector(); + /** + * 縺薙ョ繧ウ繝槭Φ繝峨ョ隕ェ + */ + public VsqCommand Parent = null; + + /** + * VsqCommand縺ッ蜷繧ッ繝ゥ繧ケ縺ョGenerateCommand縺九i繧ウ繝ウ繧ケ繝医Λ繧ッ繝医@縺ェ縺代l縺ー縺ェ繧峨↑縺縲 + * 縺ェ縺ョ縺ァ縲∫┌蠑墓焚縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ繧帝國阡ス縺吶k縺溘a縺ョ繧ゅョ縲 + */ + protected VsqCommand() { + //throw new Exception( "縺薙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繝医ッ蜻シ縺ウ蜃コ縺励■繧縺縺代∪縺帙s繧" ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommandType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommandType.java new file mode 100644 index 0000000..bd1d0e3 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommandType.java @@ -0,0 +1,45 @@ +/* + * VsqCommandType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public enum VsqCommandType { + Root, + ChangePreMeasure, + EventAdd, + EventDelete, + EventChangeClock, + EventChangeLyric, + EventChangeNote, + EventChangeClockAndNote, + TrackEditCurve, + TrackEditCurveRange, + EventChangeVelocity, + EventChangeLength, + EventChangeClockAndLength, + EventChangeIDContaints, + EventChangeClockAndIDContaints, + TrackChangeName, + AddTrack, + DeleteTrack, + EventChangeClockAndIDContaintsRange, + EventDeleteRange, + EventAddRange, + UpdateTempo, + UpdateTempoRange, + UpdateTimesig, + UpdateTimesigRange, + EventChangeIDContaintsRange, + TrackReplace, + Replace, +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommon.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommon.java new file mode 100644 index 0000000..55fdb4b --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCommon.java @@ -0,0 +1,103 @@ +/* + * VsqCommon.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.awt.*; + +/** + * vsq繝輔ぃ繧、繝ォ縺ョ繝。繧ソ繝繧ュ繧ケ繝医ョ[Common]繧サ繧ッ繧キ繝ァ繝ウ縺ォ險倬鹸縺輔l繧句螳ケ繧貞叙繧頑桶縺 + * @author kbinani + */ +public class VsqCommon implements Cloneable { + public String m_version; + public String m_name; + public String m_color; + public int m_dynamics_mode; + public int m_play_mode; + + public Object clone() { + String[] spl = m_color.split( ",", 3 ); + int r = Integer.parseInt( spl[0] ); + int g = Integer.parseInt( spl[1] ); + int b = Integer.parseInt( spl[2] ); + Color color = new Color( r, g, b ); + VsqCommon res = new VsqCommon( m_name, color, m_dynamics_mode, m_play_mode ); + res.m_version = m_version; + return res; + } + + /** + * 蜷繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ + * @param name 繝医Λ繝繧ッ蜷 + * @param color Color蛟、シ域э蜻ウ縺ッ荳肴趣シ + * @param dynamics_mode DynamicsModeシ医ョ繝輔か繝ォ繝医ッ1シ + * @param play_mode PlayModeシ医ョ繝輔か繝ォ繝医ッ1シ + */ + public VsqCommon( String name, Color color, int dynamics_mode, int play_mode ) { + m_version = "DSB301"; + m_name = name; + m_color = color.getRed() + "," + color.getGreen() + "," + color.getBlue(); + m_dynamics_mode = dynamics_mode; + m_play_mode = play_mode; + } + + /** + * MetaText縺ョ繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + * @param sr 隱ュ縺ソ霎シ繧繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ + * @param last_line 隱ュ縺ソ霎シ繧薙□譛蠕後ョ陦後′霑斐&繧後k + */ + public VsqCommon( TextMemoryStream sr, TextResult last_line ) { + m_version = ""; + m_name = ""; + m_color = "0,0,0"; + m_dynamics_mode = 0; + m_play_mode = 0; + last_line.set( sr.readLine() ); + String[] spl; + while ( !last_line.get().startsWith( "[" ) ) { + spl = last_line.get().split( "=" ); + if ( spl[0].equals( "Version" ) ) { + this.m_version = spl[1]; + } else if ( spl[0].equals( "Name" ) ) { + this.m_name = spl[1]; + break; + } else if ( spl[0].equals( "Color" ) ) { + this.m_color = spl[1]; + } else if ( spl[0].equals( "DynamicsMode" ) ) { + this.m_dynamics_mode = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "PlayMode" ) ) { + this.m_play_mode = Integer.parseInt( spl[1] ); + } + if ( sr.peek() < 0 ) { + break; + } + last_line.set( sr.readLine() ); + } + } + + /** + * 繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ蜀螳ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + * + * @param sw 蜃コ蜉帛 + */ + public void write( TextMemoryStream sw ) { + sw.writeLine( "[Common]" ); + sw.writeLine( "Version=" + m_version ); + sw.writeLine( "Name=" + m_name ); + sw.writeLine( "Color=" + m_color ); + sw.writeLine( "DynamicsMode=" + m_dynamics_mode ); + sw.writeLine( "PlayMode=" + this.m_play_mode ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCurveType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCurveType.java new file mode 100644 index 0000000..4df360a --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqCurveType.java @@ -0,0 +1,60 @@ +/* + * VsqCurveType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; +/// +/// vsq繝輔ぃ繧、繝ォ縺ァ邱ィ髮蜿ッ閭ス縺ェ繧ォ繝シ繝悶サ繝励Ο繝代ユ繧」縺ョ遞ョ鬘 +/// + +public enum VsqCurveType { + /// + /// 繝吶Ο繧キ繝繧」 + /// + VEL, + /// + /// 繝繧、繝翫Α繧ッ繧ケ縲64 + /// + DYN, + /// + /// 繝悶Ξ繧キ繝阪せ縲0 + /// + BRE, + /// + /// 繝悶Λ繧、繝医ロ繧ケ縲64 + /// + BRI, + /// + /// 繧ッ繝ェ繧「繝阪せ縲0 + /// + CLE, + /// + /// 繧ェ繝シ繝励ル繝ウ繧ー縲127 + /// + OPE, + /// + /// 繧ク繧ァ繝ウ繝繝シ繝輔ぃ繧ッ繧ソ繝シ縲64 + /// + GEN, + /// + /// 繝昴Ν繧ソ繝。繝ウ繝医ち繧、繝溘Φ繧ー縲64 + /// + POR, + /// + /// 繝斐ャ繝√吶Φ繝峨0 + /// + PIT, + /// + /// 繝斐ャ繝√吶Φ繝峨そ繝ウ繧キ繝繧」繝薙ユ繧」縲2 + /// + PBS, +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEvent.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEvent.java new file mode 100644 index 0000000..b2bfe83 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEvent.java @@ -0,0 +1,110 @@ +/* + * VsqEvent.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * vsq繝輔ぃ繧、繝ォ縺ョ繝。繧ソ繝繧ュ繧ケ繝亥縺ォ險倩ソー縺輔l繧九う繝吶Φ繝医 + */ +public class VsqEvent implements Comparable, Cloneable { + //int m_internal_id; + /** + * 蜀驛ィ縺ァ菴ソ逕ィ縺吶k繧、繝ウ繧ケ繧ソ繝ウ繧ケ蝗コ譛峨ョID
+ * for furutre implement:
+     *    public property int InternalID {
+     *       get {
+     *            return m_internal_id;
+     *       }
+     *       set {
+     *           m_internal_id = value;
+     *       }
+     *   };
+ */ + public int InternalID; + //int m_clock; + public int Clock; + //VsqID m_id; + public VsqID ID; + + /** + * 縺薙ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ウ繝斐シ繧剃ス懈舌@縺セ縺 + * @returns> + */ + public Object clone() { + VsqEvent ret = new VsqEvent( Clock, ID ); + ret.InternalID = InternalID; + return ret; + } + + + /* // + /// 縺薙ョ繧、繝吶Φ繝医′逋コ逕溘☆繧九け繝ュ繝繧ッ縲 + /// + public property int Clock { + get { + return m_clock; + } + set { + m_clock = value; + } + };*/ + + /* // + /// 逋コ逕溘☆繧九う繝吶Φ繝医ョ蜀螳ケ繧定。ィ縺励◆ID + /// + public property VsqID ID { + get { + return m_id; + } + set { + m_id = value; + } + };*/ + public int compareTo( VsqEvent item ) { + int ret = this.Clock - item.Clock; + if ( ret == 0 ) { + if ( this.ID != null && item.ID != null ) { + if ( this.ID == item.ID ) { + return 0; + } else { + if ( this.ID.type == VsqIDType.Singer ) { + return -1; + } else if ( item.ID.type == VsqIDType.Anote ) { + return 1; + } + } + } else { + return ret; + } + } else { + return ret; + } + return 0; + } + + public VsqEvent( String line ) { + String[] spl = line.split( "=" ); + Clock = Integer.parseInt( spl[0] ); + if ( spl[1].equals( "EOS" ) ) { + ID = VsqID.EOS; + } + } + + public VsqEvent( int clock, VsqID id /*, int internal_id*/ ) { + Clock = clock; + ID = (VsqID)id.clone(); + //InternalID = internal_id; + InternalID = 0; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIterator.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIterator.java new file mode 100644 index 0000000..0fe49af --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIterator.java @@ -0,0 +1,84 @@ +/* + * VsqEventIterator.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + +/** + * + * @author kbinani + */ +public class VsqEventIterator implements Iterator { + private Vector m_list; + private int m_index = 0; + private VsqEventIteratorMode m_mode; + + public VsqEventIterator( Vector list, VsqEventIteratorMode mode ) { + m_list = list; + m_index = 0; + m_mode = mode; + } + + public void remove() { + m_list.remove( m_index ); + } + + public Object next() { + int last = m_index; + for ( m_index = last; m_index < m_list.size(); m_index++ ) { + VsqEvent ret = m_list.get( m_index ); + if ( m_mode == VsqEventIteratorMode.All ) { + return ret; + } else if ( m_mode == VsqEventIteratorMode.Anote ) { + if ( ret.ID.type == VsqIDType.Anote ) { + return ret; + } else { + continue; + } + } else if ( m_mode == VsqEventIteratorMode.Singer ) { + if ( ret.ID.type == VsqIDType.Singer ) { + return ret; + } else { + continue; + } + } + } + return null; + } + + public boolean hasNext() { + if ( m_mode == VsqEventIteratorMode.All ) { + return (m_index + 1 < m_list.size()); + } else { + for ( int i = m_index; i < m_list.size(); i++ ) { + VsqEvent ret = m_list.get( i ); + if ( m_mode == VsqEventIteratorMode.Anote ) { + if ( ret.ID.type == VsqIDType.Anote ) { + return true; + } else { + continue; + } + } else if ( m_mode == VsqEventIteratorMode.Singer ) { + if ( ret.ID.type == VsqIDType.Singer ) { + return true; + } else { + continue; + } + } + } + return false; + } + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIteratorMode.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIteratorMode.java new file mode 100644 index 0000000..38e488f --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventIteratorMode.java @@ -0,0 +1,24 @@ +/* + * VsqEventIterator.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public enum VsqEventIteratorMode { + Anote, + Singer, + All, +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventList.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventList.java new file mode 100644 index 0000000..e72adf8 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqEventList.java @@ -0,0 +1,97 @@ +/* + * VsqEventList.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + +/// +/// 蝗コ譛迂D莉倥″縺ョVsqEvent縺ョ繝ェ繧ケ繝医r蜿悶j謇ア縺 +/// +public class VsqEventList { + private Vector m_list; + private Vector m_ids; + + /// + /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + public VsqEventList() { + m_list = new Vector(); + m_ids = new Vector(); + } + + public VsqEventIterator iterator( VsqEventIteratorMode mode ) { + return new VsqEventIterator( m_list, mode ); + } + + public VsqEventIterator iterator(){ + return iterator( VsqEventIteratorMode.All ); + } + + public void add( VsqEvent item ) { + int new_id = GetNextId( 0 ); + item.InternalID = new_id; + m_list.add( item ); + m_ids.add( new_id ); + boolean changed = true; + while ( changed ) { + changed = false; + for ( int i = 0; i < m_list.size() - 1; i++ ) { + if ( m_list.get( i ).compareTo( m_list.get( i + 1 ) ) > 0 ) { + VsqEvent t = (VsqEvent)m_list.get( i ).clone(); + m_list.set( i, m_list.get( i + 1 ) ); + m_list.set( i + 1, t ); + changed = true; + } + } + } + for ( int i = 0; i < m_list.size(); i++ ) { + m_ids.set( i, m_list.get( i ).InternalID ); + } + } + + public void removeAt( int index ) { + m_list.remove( index ); + m_ids.remove( index ); + } + + private int GetNextId( int next ) { + int index = -1; + Vector current = new Vector( m_ids ); + int nfound = 0; + while ( true ) { + index++; + if ( !current.contains( index ) ) { + nfound++; + if ( nfound == next + 1 ) { + return index; + } else { + current.add( index ); + } + } + } + } + + public int size() { + return m_list.size(); + } + + public VsqEvent get( int index ) { + return m_list.get( index ); + } + + public void set( int index, VsqEvent value ) { + m_list.add( index, value ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqFile.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqFile.java new file mode 100644 index 0000000..0797ead --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqFile.java @@ -0,0 +1,2584 @@ +/* + * VsqEventList.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +import java.io.*; +import java.text.*; +import java.nio.*; + +public class VsqFile implements Cloneable { + Vector m_tracks; + Vector m_tempo_table; + Vector m_timesig_table; + int m_tpq; + /** + * 譖イ縺ョ髟キ縺輔r蜿門セ励@縺セ縺吶(繧ッ繝ュ繝繧ッ(4蛻髻ウ隨ヲ縺ッ480繧ッ繝ュ繝繧ッ))
+     * public property long TotalClocks {
+     *     get {
+     *         return TotalClocks;
+     *     }
+     *     set {
+     *         TotalClocks = value;
+     *     }
+     * };
+ */ + public long TotalClocks = 0; + int m_base_tempo; + /** + *
public VsqMaster Master {
+     *     get {
+     *         return m_master;
+     *     }
+     *     set {
+     *         m_master = value;
+     *     }
+     * };
+ */ + public VsqMaster Master; // VsqMaster, VsqMixer縺ッ騾壼ククシ梧怙蛻昴ョ髱朞aster Track縺ォ險倩ソー縺輔l繧九′シ悟庄謳ャ諤ァ縺ョ縺溘aシ + + /** + * + *
public VsqMixer Mixer {
+     *   get {
+     *       return m_mixer;
+     *   }
+     *   set {
+     *       m_mixer = value;
+     *   }
+     *};
+ */ + public VsqMixer Mixer; // 縺薙%縺ァ縺ッVsqFile縺ォ逶エ螻槭☆繧九b縺ョ縺ィ縺励※蜿悶j謇ア縺シ + + int m_premeasure_clocks; + static byte[] _MTRK = new byte[] {0x4d, 0x54, 0x72, 0x6b}; + static byte[] _MTHD = new byte[] {0x4d, 0x54, 0x68, 0x64}; + static byte[] _MASTER_TRACK = new byte[] {0x4D, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x54, 0x72, 0x61, 0x63, 0x6B,}; + + public VsqCommand Execute( VsqCommand command ) { + VsqCommandType type = command.Type; + if ( type == VsqCommandType.ChangePreMeasure ) { + VsqCommand ret = GCommandChangePreMeasure( Master.PreMeasure ); + int value = (Integer)command.Args[0]; + Master.PreMeasure = value; + updateTimesigInfo(); + return ret; + } else if ( type == VsqCommandType.AddTrack ) { + VsqTrack track = (VsqTrack)command.Args[0]; + VsqMixerEntry mixer = (VsqMixerEntry)command.Args[1]; + int position = (Integer)command.Args[2]; + VsqCommand ret = GCommandDeleteTrack( position ); + if ( m_tracks.size() <= 17 ) { + m_tracks.insertElementAt( (VsqTrack)track.clone(),position ); + Mixer.Slave.add( (VsqMixerEntry)mixer.clone() ); + //Mixer.m_tracks = Mixer.Slave.Count; + return ret; + } else { + return null; + } + } else if ( type == VsqCommandType.DeleteTrack ) { + int track = (Integer)command.Args[0]; + VsqCommand ret = GCommandAddTrack( m_tracks.get( track), Mixer.Slave.get(track - 1), track ); + m_tracks.removeElementAt( track ); + Mixer.Slave.removeElementAt( track - 1 ); + updateTotalClocks(); + return ret; + } else if ( type == VsqCommandType.UpdateTempo ) { + int clock = (Integer)command.Args[0]; + int tempo = (Integer)command.Args[1]; + int new_clock = (Integer)command.Args[2]; + + int index = -1; + for ( int i = 0; i < m_tempo_table.size(); i++ ) { + if ( m_tempo_table.get( i ).Clock == clock ) { + index = i; + break; + } + } + VsqCommand ret = null; + if ( index >= 0 ) { + if ( tempo <= 0 ) { + ret = GCommandUpdateTempo( clock, clock, m_tempo_table.get( index ).Tempo ); + m_tempo_table.removeElementAt( index ); + } else { + ret = GCommandUpdateTempo( new_clock, clock, m_tempo_table.get( index ).Tempo ); + m_tempo_table.get( index ).Tempo = tempo; + m_tempo_table.get( index ).Clock = new_clock; + } + } else { + ret = GCommandUpdateTempo( clock, clock, -1 ); + m_tempo_table.add( new TempoTableEntry( new_clock, tempo, 0.0 ) ); + } + updateTempoInfo(); + updateTotalClocks(); + + // 邱ィ髮鬆伜沺繧呈峩譁ー + int affected_clock = Math.min( clock, new_clock ); + for ( int i = 1; i < m_tracks.size(); i++ ) { + if ( affected_clock < m_tracks.get( i ).getEditedStart() ) { + m_tracks.get( i ).setEditedStart( affected_clock ); + } + m_tracks.get( i ).setEditedEnd((int)TotalClocks ); + } + return ret; + } else if ( type == VsqCommandType.UpdateTempoRange ) { + int[] clocks = (int[])command.Args[0]; + int[] tempos = (int[])command.Args[1]; + int[] new_clocks = (int[])command.Args[2]; + int[] new_tempos = new int[tempos.length]; + int affected_clock = Integer.MAX_VALUE; + for ( int i = 0; i < clocks.length; i++ ) { + int index = -1; + affected_clock = Math.min( affected_clock, clocks[i] ); + affected_clock = Math.min( affected_clock, new_clocks[i] ); + for ( int j = 0; j < m_tempo_table.size(); j++ ) { + if ( m_tempo_table.get( j ).Clock == clocks[i] ) { + index = j; + break; + } + } + if ( index >= 0 ) { + new_tempos[i] = m_tempo_table.get( index ).Tempo; + if ( tempos[i] <= 0 ) { + m_tempo_table.removeElementAt( index ); + } else { + m_tempo_table.get( index ).Tempo = tempos[i]; + m_tempo_table.get( index ).Clock = new_clocks[i]; + } + } else { + new_tempos[i] = -1; + m_tempo_table.add( new TempoTableEntry( new_clocks[i], tempos[i], 0.0 ) ); + } + } + updateTempoInfo(); + updateTotalClocks(); + for ( int i = 1; i < m_tracks.size(); i++ ) { + if ( affected_clock < m_tracks.get( i ).getEditedStart() ) { + m_tracks.get( i ).setEditedStart( affected_clock ); + } + m_tracks.get( i ).setEditedEnd( (int)TotalClocks ); + } + return GCommandUpdateTempoRange( new_clocks, clocks, new_tempos ); + } else if ( type == VsqCommandType.UpdateTimesig ) { + int barcount = (Integer)command.Args[0]; + int numerator = (Integer)command.Args[1]; + int denominator = (Integer)command.Args[2]; + int new_barcount = (Integer)command.Args[3]; + int index = -1; + for ( int i = 0; i < m_timesig_table.size(); i++ ) { + if ( barcount == m_timesig_table.get( i ).BarCount ) { + index = i; + break; + } + } + VsqCommand ret = null; + if ( index >= 0 ) { + if ( numerator <= 0 ) { + ret = GCommandUpdateTimesig( barcount, barcount, m_timesig_table.get( index ).Numerator, m_timesig_table.get( index ).Denominator ); + m_timesig_table.removeElementAt( index ); + } else { + ret = GCommandUpdateTimesig( new_barcount, barcount, m_timesig_table.get( index ).Numerator, m_timesig_table.get( index ).Denominator ); + m_timesig_table.get( index ).BarCount = new_barcount; + m_timesig_table.get( index ).Numerator = numerator; + m_timesig_table.get( index ).Denominator = denominator; + } + } else { + ret = GCommandUpdateTimesig( new_barcount, new_barcount, -1, -1 ); + m_timesig_table.add( new TimeSigTableEntry( 0, numerator, denominator, new_barcount ) ); + } + updateTimesigInfo(); + updateTotalClocks(); + return ret; + } else if ( type == VsqCommandType.UpdateTimesigRange ) { + int[] barcounts = (int[])command.Args[0]; + int[] numerators = (int[])command.Args[1]; + int[] denominators = (int[])command.Args[2]; + int[] new_barcounts = (int[])command.Args[3]; + int[] new_numerators = new int[numerators.length]; + int[] new_denominators = new int[denominators.length]; + for ( int i = 0; i < barcounts.length; i++ ) { + int index = -1; + for ( int j = 0; j < m_timesig_table.size(); j++ ) { + if ( m_timesig_table.get(j).BarCount == barcounts[i] ) { + index = j; + break; + } + } + if ( index >= 0 ) { + new_numerators[i] = m_timesig_table.get( index ).Numerator; + new_denominators[i] = m_timesig_table.get( index ).Denominator; + if ( numerators[i] <= 0 ) { + m_timesig_table.removeElementAt( index ); + } else { + m_timesig_table.get( index ).BarCount = new_barcounts[i]; + m_timesig_table.get( index ).Numerator = numerators[i]; + m_timesig_table.get( index ).Denominator = denominators[i]; + } + } else { + new_numerators[i] = -1; + new_denominators[i] = -1; + m_timesig_table.add( new TimeSigTableEntry( 0, numerators[i], denominators[i], new_barcounts[i] ) ); + } + } + updateTimesigInfo(); + updateTotalClocks(); + return GCommandUpdateTimesigRange( new_barcounts, barcounts, new_numerators, new_denominators ); + } else if ( type == VsqCommandType.Replace ) { + VsqFile vsq = (VsqFile)command.Args[0]; + VsqFile inv = (VsqFile)this.clone(); + m_tracks.clear(); + for ( int i = 0; i < vsq.m_tracks.size(); i++ ) { + m_tracks.add( (VsqTrack)vsq.m_tracks.get( i ).clone() ); + } + m_tempo_table.clear(); + for ( int i = 0; i < vsq.m_tempo_table.size(); i++ ) { + m_tempo_table.add( (TempoTableEntry)vsq.m_tempo_table.get( i ).clone() ); + } + m_timesig_table.clear(); + for ( int i = 0; i < vsq.m_timesig_table.size(); i++ ) { + m_timesig_table.add( (TimeSigTableEntry)vsq.m_timesig_table.get( i ).clone() ); + } + m_tpq = vsq.m_tpq; + TotalClocks = vsq.TotalClocks; + m_base_tempo = vsq.m_base_tempo; + Master = (VsqMaster)vsq.Master.clone(); + Mixer = (VsqMixer)vsq.Mixer.clone(); + m_premeasure_clocks = vsq.m_premeasure_clocks; + updateTotalClocks(); + return GCommandReplace( inv ); + } else if ( type == VsqCommandType.EventAdd ) { + int track = (Integer)command.Args[0]; + VsqEvent item = (VsqEvent)command.Args[1]; + //int key = this.m_tracks.get( track ).GetNextId( 0 ); + //item.InternalID = key; + m_tracks.get( track ).getEvents().add( item ); + VsqCommand ret = GCommandEventDelete( track, item.InternalID ); + //this.m_tracks.get( track ).Events.Sort(); + updateTotalClocks(); + if ( item.Clock < m_tracks.get(track).getEditedStart() ) { + m_tracks.get( track).setEditedStart( item.Clock); + } + if ( m_tracks.get(track).getEditedEnd() < item.Clock + item.ID.Length ) { + m_tracks.get( track ).setEditedEnd( item.Clock + item.ID.Length ); + } + return ret; + } else if ( type == VsqCommandType.EventAddRange ) { + int track = (Integer)command.Args[0]; + VsqEvent[] items = (VsqEvent[])command.Args[1]; + Vector inv_ids = new Vector(); + int min_clock = (int)TotalClocks; + int max_clock = 0; + for ( int i = 0; i < items.length; i++ ) { + VsqEvent item = (VsqEvent)items[i].clone(); + min_clock = Math.min( min_clock, item.Clock ); + max_clock = Math.max( max_clock, item.Clock + item.ID.Length ); + //int key = m_tracks.get( track ).GetNextId( i ); + //item.InternalID = key; + m_tracks.get( track ).getEvents().add( item ); + inv_ids.add( item.InternalID ); + } + //m_tracks.get( track ).Events.Sort(); + updateTotalClocks(); + if ( min_clock < m_tracks.get( track ).getEditedStart() ) { + m_tracks.get( track ).setEditedStart( min_clock ); + } + if ( m_tracks.get( track ).getEditedEnd() < max_clock ) { + m_tracks.get( track ).setEditedEnd( max_clock ); + } + int count = inv_ids.size(); + int[] inv_ids_arr = new int[count]; + for( int i = 0; i < count; i++ ){ + inv_ids_arr[i] = inv_ids.get( i ); + } + return GCommandEventDeleteRange( track, inv_ids_arr ); + } else if ( type == VsqCommandType.EventDelete ) { + int internal_id = (Integer)command.Args[0]; + int track = (Integer)command.Args[1]; + VsqEvent[] original = new VsqEvent[1]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + original[0] = (VsqEvent)item.clone(); + break; + } + } + if ( original[0].Clock < m_tracks.get( track ).getEditedStart() ) { + m_tracks.get( track ).setEditedStart( original[0].Clock ); + } + if ( m_tracks.get( track ).getEditedEnd() < original[0].Clock + original[0].ID.Length ) { + m_tracks.get( track ).setEditedEnd(original[0].Clock + original[0].ID.Length); + } + VsqCommand ret = GCommandEventAddRange( track, original ); + for ( int i = 0; i < this.m_tracks.get( track ).getEvents().size(); i++ ) { + if ( this.m_tracks.get( track ).getEvents().get( i ).InternalID == internal_id ) { + m_tracks.get( track ).getEvents().removeAt( i ); + break; + } + } + updateTotalClocks(); + return ret; + } else if ( type == VsqCommandType.EventDeleteRange ) { + int[] internal_ids = (int[])command.Args[0]; + int track = (Integer)command.Args[1]; + Vector inv = new Vector(); + int min_clock = Integer.MAX_VALUE; + int max_clock = Integer.MIN_VALUE; + for ( int j = 0; j < internal_ids.length; j++ ) { + for ( int i = 0; i < m_tracks.get( track ).getEvents().size(); i++ ) { + if ( internal_ids[j] == m_tracks.get( track ).getEvents().get( i ).InternalID ) { + inv.add( (VsqEvent)m_tracks.get( track ).getEvents().get( i ).clone() ); + min_clock = Math.min( min_clock, m_tracks.get( track ).getEvents().get( i ).Clock ); + max_clock = Math.max( max_clock, m_tracks.get( track ).getEvents().get( i ).Clock + m_tracks.get( track ).getEvents().get( i ).ID.Length ); + m_tracks.get( track ).getEvents().removeAt( i ); + break; + } + } + } + updateTotalClocks(); + m_tracks.get( track ).setEditedStart(min_clock); + m_tracks.get( track ).setEditedEnd(max_clock ); + VsqEvent[] inv_arr = new VsqEvent[inv.size()]; + for( int i = 0; i < inv.size(); i++ ){ + inv_arr[i] = inv.get(i ); + } + return GCommandEventAddRange( track, inv_arr ); + } else if ( type == VsqCommandType.EventChangeClock ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int value = (Integer)command.Args[2]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeClock( track, internal_id, item.Clock ); + int min = Math.min( item.Clock, value ); + int max = Math.max( item.Clock + item.ID.Length, value + item.ID.Length ); + m_tracks.get( track ).setEditedStart(min); + m_tracks.get( track ).setEditedEnd(max); + item.Clock = value; + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeLyric ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + String phrase = (String)command.Args[2]; + String phonetic_symbol = (String)command.Args[3]; + boolean protect_symbol = (Boolean)command.Args[4]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + if ( item.ID.type == VsqIDType.Anote ) { + VsqCommand ret = GCommandEventChangeLyric( track, internal_id, item.ID.LyricHandle.L0.Phrase, item.ID.LyricHandle.L0.getPhoneticSymbol(), item.ID.LyricHandle.L0.PhoneticSymbolProtected ); + item.ID.LyricHandle.L0.Phrase = phrase; + item.ID.LyricHandle.L0.setPhoneticSymbol( phonetic_symbol ); + item.ID.LyricHandle.L0.PhoneticSymbolProtected = protect_symbol; + m_tracks.get( track ).setEditedStart(item.Clock); + m_tracks.get( track ).setEditedEnd(item.Clock + item.ID.Length); + updateTotalClocks(); + return ret; + } + } + } + return null; + } else if ( type == VsqCommandType.EventChangeNote ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int note = (Integer)command.Args[2]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeNote( track, internal_id, item.ID.Note ); + item.ID.Note = note; + updateTotalClocks(); + m_tracks.get( track ).setEditedStart(item.Clock); + m_tracks.get( track ).setEditedEnd(item.Clock + item.ID.Length); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeClockAndNote ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int clock = (Integer)command.Args[2]; + int note = (Integer)command.Args[3]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeClockAndNote( track, internal_id, item.Clock, item.ID.Note ); + int min = Math.min( item.Clock, clock ); + int max = Math.max( item.Clock + item.ID.Length, clock + item.ID.Length ); + m_tracks.get( track ).setEditedStart( min ); + m_tracks.get( track ).setEditedEnd( max ); + item.Clock = clock; + item.ID.Note = note; + //this.m_tracks.get( track ).Events.Sort(); + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.TrackEditCurve ) { + int track = (Integer)command.Args[0]; + VsqCurveType curve = (VsqCurveType)command.Args[1]; + Vector com = (Vector)command.Args[2]; + //SortedList list = m_tracks.get( track )[curve].Vector; + + VsqCommand inv = null; + Vector edit = new Vector(); + if ( com != null ) { + if ( com.size() > 0 ) { + int start_clock = com.get(0).Clock; + int end_clock = com.get(0).Clock; + for ( Iterator itr = com.iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + start_clock = Math.min( start_clock, item.Clock ); + end_clock = Math.max( end_clock, item.Clock ); + } + m_tracks.get( track ).setEditedStart( start_clock ); + m_tracks.get( track ).setEditedEnd( end_clock ); + int start_value = m_tracks.get( track ).getVsqBPList(curve).get( start_clock); + int end_value = m_tracks.get( track ).getVsqBPList(curve).get(end_clock); + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( start_clock <= clock && clock <= end_clock ) { + edit.add( new BPPair( clock, m_tracks.get( track ).getVsqBPList(curve).get(clock) ) ); + } + } + boolean start_found = false; + boolean end_found = false; + for ( int i = 0; i < edit.size(); i++ ) { + if ( edit.get( i ).Clock == start_clock ) { + start_found = true; + edit.get( i ).Value = start_value; + if ( start_found && end_found ) { + break; + } + } + if ( edit.get( i ).Clock == end_clock ) { + end_found = true; + edit.get( i ).Value = end_value; + if ( start_found && end_found ) { + break; + } + } + } + if ( !start_found ) { + edit.add( new BPPair( start_clock, start_value ) ); + } + if ( !end_found ) { + edit.add( new BPPair( end_clock, end_value ) ); + } + + // 荳ヲ縺ケ譖ソ縺 + Collections.sort( edit ); + inv = GCommandTrackEditCurve( track, curve, edit ); + } else if ( com.size() == 0 ) { + inv = GCommandTrackEditCurve( track, curve, new Vector() ); + } + } + + updateTotalClocks(); + if ( com.size() == 0 ) { + return inv; + } else if ( com.size() == 1 ) { + boolean found = false; + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( clock == com.get(0).Clock ) { + found = true; + m_tracks.get( track ).getVsqBPList(curve).add( clock, com.get(0).Value ); + break; + } + } + if ( !found ) { + m_tracks.get( track ).getVsqBPList(curve).add( com.get(0).Clock, com.get(0).Value ); + } + } else { + int start_clock = com.get(0).Clock; + int end_clock = com.get(com.size() - 1).Clock; + boolean removed = true; + while ( removed ) { + removed = false; + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( start_clock <= clock && clock <= end_clock ) { + m_tracks.get( track ).getVsqBPList(curve).remove( clock ); + removed = true; + break; + } + } + } + for ( Iterator itr = com.iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + m_tracks.get( track ).getVsqBPList(curve).add( item.Clock, item.Value ); + } + } + return inv; + } else if ( type == VsqCommandType.TrackEditCurveRange ) { + int track = (Integer)command.Args[0]; + VsqCurveType[] curves = (VsqCurveType[])command.Args[1]; + Vector[] coms = (Vector[])command.Args[2]; + Vector> inv_coms = new Vector>( curves.length ); + VsqCommand inv = null; + + for ( int k = 0; k < curves.length; k++ ) { + VsqCurveType curve = curves[k]; + Vector com = coms[k]; + //SortedList list = m_tracks.get( track )[curve].Vector; + Vector edit = new Vector(); + if ( com != null ) { + if ( com.size() > 0 ) { + int start_clock = com.get(0).Clock; + int end_clock = com.get(0).Clock; + for ( Iterator itr = com.iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + start_clock = Math.min( start_clock, item.Clock ); + end_clock = Math.max( end_clock, item.Clock ); + } + m_tracks.get( track ).setEditedStart( start_clock); + m_tracks.get( track ).setEditedEnd( end_clock); + int start_value = m_tracks.get( track ).getVsqBPList(curve).get(start_clock); + int end_value = m_tracks.get( track ).getVsqBPList(curve).get(end_clock); + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( start_clock <= clock && clock <= end_clock ) { + edit.add( new BPPair( clock, m_tracks.get( track ).getVsqBPList(curve).get(clock) ) ); + } + } + boolean start_found = false; + boolean end_found = false; + for ( int i = 0; i < edit.size(); i++ ) { + if ( edit.get( i ).Clock == start_clock ) { + start_found = true; + edit.get( i ).Value = start_value; + if ( start_found && end_found ) { + break; + } + } + if ( edit.get( i ).Clock == end_clock ) { + end_found = true; + edit.get( i ).Value = end_value; + if ( start_found && end_found ) { + break; + } + } + } + if ( !start_found ) { + edit.add( new BPPair( start_clock, start_value ) ); + } + if ( !end_found ) { + edit.add( new BPPair( end_clock, end_value ) ); + } + + // 荳ヲ縺ケ譖ソ縺 + Collections.sort( edit); + inv_coms.set( k, edit ); + //inv = GCommandTrackEditCurve( track, curve, edit ); + } else if ( com.size() == 0 ) { + //inv = GCommandTrackEditCurve( track, curve, new Vector() ); + inv_coms.set( k, new Vector() ); + } + } + + updateTotalClocks(); + if ( com.size() == 0 ) { + return inv; + } else if ( com.size() == 1 ) { + boolean found = false; + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( clock == com.get(0).Clock ) { + found = true; + m_tracks.get( track ).getVsqBPList(curve).add( clock, com.get(0).Value ); + break; + } + } + if ( !found ) { + m_tracks.get( track ).getVsqBPList(curve).add( com.get(0).Clock, com.get(0).Value ); + } + } else { + int start_clock = com.get(0).Clock; + int end_clock = com.get(com.size() - 1).Clock; + boolean removed = true; + while ( removed ) { + removed = false; + for ( Iterator itr = m_tracks.get( track ).getVsqBPList( curve ).keyClockIterator(); itr.hasNext();) { + int clock = (Integer)itr.next(); + if ( start_clock <= clock && clock <= end_clock ) { + m_tracks.get( track ).getVsqBPList(curve).remove( clock ); + removed = true; + break; + } + } + } + for ( Iterator itr = com.iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + m_tracks.get( track ).getVsqBPList(curve).add( item.Clock, item.Value ); + } + } + } + return GCommandTrackEditCurveRange( track, curves, inv_coms ); + } else if ( type == VsqCommandType.EventChangeVelocity ) { + int track = (Integer)command.Args[0]; + Vector> veloc = (Vector>)command.Args[1]; + Vector> inv = new Vector>(); + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent ev = (VsqEvent)itr.next(); + for ( Iterator itr2 = veloc.iterator(); itr2.hasNext();) { + KeyValuePair add = (KeyValuePair)itr2.next(); + if ( ev.InternalID == add.Key ) { + inv.add( new KeyValuePair( ev.InternalID, ev.ID.Dynamics ) ); + ev.ID.Dynamics = add.Value; + m_tracks.get( track ).setEditedStart( ev.Clock ); + m_tracks.get( track ).setEditedEnd( ev.Clock + ev.ID.Length ); + break; + } + } + } + return GCommandEventChangeVelocity( track, inv ); + } else if ( type == VsqCommandType.EventChangeLength ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int new_length = (Integer)command.Args[2]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeLength( track, internal_id, item.ID.Length ); + m_tracks.get( track ).setEditedStart( item.Clock ); + int max = Math.max( item.Clock + item.ID.Length, item.Clock + new_length ); + m_tracks.get( track ).setEditedEnd( max ); + item.ID.Length = new_length; + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeClockAndLength ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int new_clock = (Integer)command.Args[2]; + int new_length = (Integer)command.Args[3]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeClockAndLength( track, internal_id, item.Clock, item.ID.Length ); + int min = Math.min( item.Clock, new_clock ); + int max_length = Math.max( item.ID.Length, new_length ); + int max = Math.max( item.Clock + max_length, new_clock + max_length ); + m_tracks.get( track ).setEditedStart( min ); + m_tracks.get( track ).setEditedEnd( max ); + item.ID.Length = new_length; + item.Clock = new_clock; + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeIDContaints ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + VsqID value = (VsqID)command.Args[2]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeIDContaints( track, internal_id, item.ID ); + int max_length = Math.max( item.ID.Length, value.Length ); + m_tracks.get( track ).setEditedStart( item.Clock ); + m_tracks.get( track ).setEditedEnd( item.Clock + max_length ); + item.ID = (VsqID)value.clone(); + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeIDContaintsRange ) { + int track = (Integer)command.Args[0]; + int[] internal_ids = (int[])command.Args[1]; + VsqID[] values = (VsqID[])command.Args[2]; + VsqID[] inv_values = new VsqID[values.length]; + for ( int i = 0; i < internal_ids.length; i++ ) { + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_ids[i] ) { + inv_values[i] = (VsqID)item.ID.clone(); + int max_length = Math.max( item.ID.Length, values[i].Length ); + m_tracks.get( track ).setEditedStart( item.Clock ); + m_tracks.get( track ).setEditedEnd( item.Clock + max_length ); + item.ID = (VsqID)values[i].clone(); + break; + } + } + } + updateTotalClocks(); + return GCommandEventChangeIDContaintsRange( track, internal_ids, inv_values ); + } else if ( type == VsqCommandType.EventChangeClockAndIDContaints ) { + int track = (Integer)command.Args[0]; + int internal_id = (Integer)command.Args[1]; + int new_clock = (Integer)command.Args[2]; + VsqID value = (VsqID)command.Args[3]; + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_id ) { + VsqCommand ret = GCommandEventChangeClockAndIDContaints( track, internal_id, item.Clock, item.ID ); + int max_length = Math.max( item.ID.Length, value.Length ); + int min = Math.min( item.Clock, new_clock ); + int max = Math.max( item.Clock + max_length, new_clock + max_length ); + item.ID = (VsqID)value.clone(); + item.Clock = new_clock; + m_tracks.get( track ).setEditedStart( min ); + m_tracks.get( track ).setEditedEnd( max ); + updateTotalClocks(); + return ret; + } + } + return null; + } else if ( type == VsqCommandType.EventChangeClockAndIDContaintsRange ) { + int track = (Integer)command.Args[0]; + int[] internal_ids = (int[])command.Args[1]; + int[] clocks = (int[])command.Args[2]; + VsqID[] values = (VsqID[])command.Args[3]; + Vector inv_id = new Vector(); + Vector inv_clock = new Vector(); + for ( int i = 0; i < internal_ids.length; i++ ) { + for ( Iterator itr = m_tracks.get( track ).getEvents().iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.InternalID == internal_ids[i] ) { + inv_id.add( (VsqID)item.ID.clone() ); + inv_clock.add( item.Clock ); + int max_length = Math.max( item.ID.Length, values[i].Length ); + int min = Math.min( item.Clock, clocks[i] ); + int max = Math.max( item.Clock + max_length, clocks[i] + max_length ); + m_tracks.get( track ).setEditedStart( min ); + m_tracks.get( track ).setEditedEnd( max ); + item.ID = (VsqID)values[i].clone(); + item.Clock = clocks[i]; + break; + } + } + } + updateTotalClocks(); + int[] inv_clock_arr = new int[inv_clock.size()]; + for( int i = 0; i < inv_clock.size(); i++ ){ + inv_clock_arr[i] = inv_clock.get( i); + } + VsqID[] inv_id_arr = new VsqID[inv_id.size()]; + for( int i = 0; i < inv_id.size(); i++ ){ + inv_id_arr[i] = inv_id.get(i); + } + return GCommandEventChangeClockAndIDContaintsRange( + track, + internal_ids, + inv_clock_arr, + inv_id_arr ); + } else if ( type == VsqCommandType.TrackChangeName ) { + int track = (Integer)command.Args[0]; + String new_name = (String)command.Args[1]; + VsqCommand ret = GCommandTrackChangeName( track, m_tracks.get( track ).getName() ); + m_tracks.get( track ).setName( new_name ); + return ret; + } else if ( type == VsqCommandType.TrackReplace ) { + int track = (Integer)command.Args[0]; + VsqTrack item = (VsqTrack)command.Args[1]; + VsqCommand ret = GCommandTrackReplace( track, (VsqTrack)m_tracks.get( track ).clone() ); + m_tracks.set( track, item ); + updateTotalClocks(); + return ret; + } + + return null; + } + + public static VsqCommand GCommandRoot() { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.Root; + command.Args = null; + return command; + } + + public static VsqCommand GCommandReplace( VsqFile vsq ) { + VsqCommand command = new VsqCommand(); + command.Args = new Object[1]; + command.Type = VsqCommandType.Replace; + command.Args[0] = (VsqFile)vsq.clone(); + return command; + } + + public static VsqCommand GCommandTrackReplace( int track, VsqTrack item ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.TrackReplace; + command.Args = new Object[2]; + command.Args[0] = track; + command.Args[1] = (VsqTrack)item.clone(); + return command; + } + + public static VsqCommand GCommandUpdateTimesig( int bar_count, int new_barcount, int numerator, int denominator ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.UpdateTimesig; + command.Args = new Object[4]; + command.Args[0] = bar_count; + command.Args[1] = numerator; + command.Args[2] = denominator; + command.Args[3] = new_barcount; + return command; + } + + public static VsqCommand GCommandUpdateTimesigRange( int[] bar_counts, int[] new_barcounts, int[] numerators, int[] denominators ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.UpdateTimesigRange; + command.Args = new Object[4]; + command.Args[0] = (int[])bar_counts.clone(); + command.Args[1] = (int[])numerators.clone(); + command.Args[2] = (int[])denominators.clone(); + command.Args[3] = (int[])new_barcounts.clone(); + return command; + } + + public static VsqCommand GCommandUpdateTempoRange( int[] clocks, int[] new_clocks, int[] tempos ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.UpdateTempoRange; + command.Args = new Object[3]; + command.Args[0] = (int[])clocks.clone(); + command.Args[1] = (int[])tempos.clone(); + command.Args[2] = (int[])new_clocks.clone(); + return command; + } + + public static VsqCommand GCommandUpdateTempo( int clock, int new_clock, int tempo ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.UpdateTempo; + command.Args = new Object[3]; + command.Args[0] = clock; + command.Args[1] = tempo; + command.Args[2] = new_clock; + return command; + } + + public static VsqCommand GCommandChangePreMeasure( int pre_measure ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.ChangePreMeasure; + command.Args = new Object[1]; + command.Args[0] = pre_measure; + return command; + } + + public static VsqCommand GCommandDeleteTrack( int track ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.DeleteTrack; + command.Args = new Object[1]; + command.Args[0] = track; + return command; + } + + + /// + /// 繝医Λ繝繧ッ繧定ソス蜉縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺呻シ師rack縺ッClone()縺励※貂。縺輔↑縺上※繧ゅh縺 + /// + /// + /// + public static VsqCommand GCommandAddTrack( VsqTrack track, VsqMixerEntry mixer, int position ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.AddTrack; + command.Args = new Object[5]; + command.Args[0] = track; + command.Args[1] = mixer; + command.Args[2] = position; + return command; + } + + + /// + /// 繝医Λ繝繧ッ蜷阪r螟画峩縺吶k繧ウ繝槭Φ繝峨r菴懈舌@縺セ縺 + /// + /// + /// + /// + public static VsqCommand GCommandTrackChangeName( int track, String new_name ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.TrackChangeName; + command.Args = new Object[2]; + command.Args[0] = track; + command.Args[1] = new_name; + return command; + } + + + /// + /// VsqID縺ィClock繧貞酔譎ゅ↓螟画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeClockAndIDContaintsRange( int track, int[] internal_ids, int[] clocks, VsqID[] values ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeClockAndIDContaintsRange; + int count = internal_ids.length; + command.Args = new Object[4]; + command.Args[0] = track; + command.Args[1] = (int[])internal_ids.clone(); + command.Args[2] = (int[])clocks.clone(); + command.Args[3] = (VsqID[])values.clone(); + return command; + } + + + /// + /// VsqID縺ィClock繧貞酔譎ゅ↓螟画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeClockAndIDContaints( int track, int internal_id, int clock, VsqID value ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeClockAndIDContaints; + command.Args = new Object[4]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = clock; + command.Args[3] = (VsqID)value.clone(); + return command; + } + + + /// + /// VsqID縺ョ蜀螳ケ繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺吶 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeIDContaintsRange( int track, int[] internal_ids, VsqID[] values ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeIDContaintsRange; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = (int[])internal_ids.clone(); + VsqID[] list = new VsqID[values.length]; + for ( int i = 0; i < values.length; i++ ) { + list[i] = (VsqID)values[i].clone(); + } + command.Args[2] = list; + return command; + } + + + /// + /// VsqID縺ョ蜀螳ケ繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺吶 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeIDContaints( int track, int internal_id, VsqID value ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeIDContaints; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = (VsqID)value.clone(); + return command; + } + + + /// + /// 繝弱シ繝医ョ髟キ縺輔r螟画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeClockAndLength( int track, int internal_id, int new_clock, int new_length ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeClockAndLength; + command.Args = new Object[4]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = new_clock; + command.Args[3] = new_length; + return command; + } + + + /// + /// 繝弱シ繝医ョ髟キ縺輔r螟画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeLength( int track, int internal_id, int new_length ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeLength; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = new_length; + return command; + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺ョシ碁浹隨ヲ縺ョ繝吶Ο繧キ繝繧」(VEL)繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺呻シ + /// 繝ェ繧ケ繝velocity縺ォ縺ッシ碁浹隨ヲ繧呈欠螳壹☆繧紀nteralID縺ィシ悟、画峩縺励◆縺繝吶Ο繧キ繝繧」縺ョ蛟、縺ョ繝壹い繧堤匳骭イ縺励∪縺 + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeVelocity( int track, Vector> velocity ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeVelocity; + command.Args = new Object[2]; + command.Args[0] = track; + Vector> list = new Vector>(); + for ( Iterator itr = velocity.iterator(); itr.hasNext();) { + KeyValuePair item = (KeyValuePair)itr.next(); + list.add( new KeyValuePair( item.Key, item.Value ) ); + } + command.Args[1] = list; + return command; + } + + + /// + /// vsq繝輔ぃ繧、繝ォ縺ョ繧ォ繝シ繝悶r邱ィ髮縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺呻シ + /// + /// + /// + /// + /// + public static VsqCommand GCommandTrackEditCurve( int track, VsqCurveType target, Vector edit ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.TrackEditCurve; + command.Args = new Object[5]; + command.Args[0] = track; + command.Args[1] = target; + Vector copied = new Vector(); + for ( Iterator itr = edit.iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + copied.add( item ); + } + command.Args[2] = copied; + return command; + } + + public static VsqCommand GCommandTrackEditCurveRange( int track, VsqCurveType[] targets, Vector> edits ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.TrackEditCurveRange; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = (VsqCurveType[])targets.clone(); + Vector> cpy = new Vector>(targets.length); + for ( int i = 0; i < edits.size(); i++ ) { + Vector copied = new Vector(); + for ( Iterator itr = edits.get(i).iterator(); itr.hasNext();) { + BPPair item = (BPPair)itr.next(); + copied.add( new BPPair( item.Clock, item.Value ) ); + } + cpy.set( i, copied ); + } + command.Args[2] = cpy; + return command; + } + + /// + /// 迚ケ螳壻ス咲スョ縺ョ繧、繝吶Φ繝医ョ豁瑚ゥ槭→逋コ髻ウ險伜捷繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺吶 + /// + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeLyric( int track, int internal_id, String phrase, String phonetic_symbol, boolean protect_symbol ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeLyric; + command.Args = new Object[5]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = phrase; + command.Args[3] = phonetic_symbol; + command.Args[4] = protect_symbol; + return command; + } + + + /// + /// 繝弱シ繝医ョ繧ッ繝ュ繝繧ッ菴咲スョ繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeClock( int track, int internal_id, int value ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeClock; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = value; + return command; + } + + public static VsqCommand GCommandEventDeleteRange( int track, int[] internal_ids ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventDeleteRange; + command.Args = new Object[2]; + command.Args[0] = (int[])internal_ids.clone(); + command.Args[1] = track; + return command; + } + + + /// + /// 繝弱シ繝医r蜑企勁縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + public static VsqCommand GCommandEventDelete( int track, int internal_id ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventDelete; + command.Args = new Object[2]; + command.Args[1] = track; + command.Args[0] = internal_id; + return command; + } + + public static VsqCommand GCommandEventAddRange( int track, VsqEvent[] items ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventAddRange; + command.Args = new Object[2]; + command.Args[0] = track; + command.Args[1] = (VsqEvent[])items.clone(); + return command; + } + + + /// + /// 繝弱シ繝医r霑ス蜉縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺吶 + /// + /// + /// + /// + public static VsqCommand GCommandEventAdd( int track, VsqEvent item ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventAdd; + command.Args = new Object[2]; + command.Args[0] = track; + command.Args[1] = (VsqEvent)item.clone(); + return command; + } + + + /// + /// 繝弱シ繝医ョ髻ウ遞九r螟画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeNote( int track, int internal_id, int note ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeNote; + command.Args = new Object[3]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = note; + return command; + } + + + /// + /// 繝弱シ繝医ョ髻ウ遞九→繧ッ繝ュ繝繧ッ繧貞、画峩縺吶k繧ウ繝槭Φ繝峨r逋コ陦後@縺セ縺 + /// + /// + /// + /// + /// + public static VsqCommand GCommandEventChangeClockAndNote( int track, int internal_id, int clock, int note ) { + VsqCommand command = new VsqCommand(); + command.Type = VsqCommandType.EventChangeClockAndNote; + command.Args = new Object[4]; + command.Args[0] = track; + command.Args[1] = internal_id; + command.Args[2] = clock; + command.Args[3] = note; + return command; + } + + public Object clone() { + VsqFile ret = new VsqFile(); + ret.m_tracks = new Vector(); + for ( int i = 0; i < m_tracks.size(); i++ ) { + ret.m_tracks.add( (VsqTrack)m_tracks.get( i ).clone() ); + } + ret.m_tempo_table = new Vector(); + for ( int i = 0; i < m_tempo_table.size(); i++ ) { + ret.m_tempo_table.add( (TempoTableEntry)m_tempo_table.get( i ).clone() ); + } + ret.m_timesig_table = new Vector(); + for ( int i = 0; i < m_timesig_table.size(); i++ ) { + ret.m_timesig_table.add( (TimeSigTableEntry)m_timesig_table.get( i ).clone() ); + } + ret.m_tpq = m_tpq; + ret.TotalClocks = TotalClocks; + ret.m_base_tempo = m_base_tempo; + ret.Master = (VsqMaster)Master.clone(); + ret.Mixer = (VsqMixer)Mixer.clone(); + ret.m_premeasure_clocks = m_premeasure_clocks; + return ret; + } + + private VsqFile() { + VsqUtil.LoadSingerConfigs(); + } + + + /// + /// 蟆冗ッ縺ョ蛹コ蛻繧翫r鬆谺。霑斐☆Enumerator縲 + /// + /// + public Iterator getVsqBarLineIterator( int end_clock ) { + } + + + /// + /// 蝓コ譛ャ繝繝ウ繝晏、繧貞叙蠕励@縺セ縺 + /// + public int getBaseTempo() { + return m_base_tempo; + } + + + /// + /// 繝励Μ繝。繧ク繝」繝シ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺吶 + /// + public int getPreMeasure() { + //return m_tracks[1].MetaText.master.PreMeasure; + return Master.PreMeasure; + } + + public int getPreMeasureClocks() { + return m_premeasure_clocks; + } + + + /// + /// 繝励Μ繝。繧ク繝」繝シ縺ョ髟キ縺(繧ッ繝ュ繝繧ッ)繧定ィ育ョ励@縺セ縺吶 + /// + private int GetPreMeasureInClock() { + int pre_measure = Master.PreMeasure; + int last_bar_count = m_timesig_table.get(0).BarCount; + int last_clock = m_timesig_table.get( 0).Clock; + int last_denominator = m_timesig_table.get(0).Denominator; + int last_numerator = m_timesig_table.get(0).Numerator; + for ( int i = 1; i < m_timesig_table.size(); i++ ) { + if ( m_timesig_table.get( i ).BarCount >= pre_measure ) { + break; + } else { + last_bar_count = m_timesig_table.get( i ).BarCount; + last_clock = m_timesig_table.get( i ).Clock; + last_denominator = m_timesig_table.get( i ).Denominator; + last_numerator = m_timesig_table.get( i ).Numerator; + } + } + + int remained = pre_measure - last_bar_count;//繝励Μ繝。繧ク繝」繝シ縺ョ邨ゅo繧翫∪縺ァ縺ョ谿九j蟆冗ッ謨ー + + return last_clock + remained * last_numerator * 480 * 4 / last_denominator; + } + + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺ォ縺翫¢繧九…lock=0縺九i縺ョ貍泌・冗オ碁℃譎る俣(sec) + /// + /// + /// + public double SecFromClock( int clock ) { + for ( int i = m_tempo_table.size() - 1; i >= 0; i-- ) { + if ( m_tempo_table.get( i ).Clock < clock ) { + double init = m_tempo_table.get( i ).Time; + int dclock = clock - m_tempo_table.get( i ).Clock; + double sec_per_clock1 = m_tempo_table.get( i ).Tempo * 1e-6 / 480.0; + return init + dclock * sec_per_clock1; + } + } + + double sec_per_clock = m_base_tempo * 1e-6 / 480.0; + return clock * sec_per_clock; + } + + + /// + /// 謖螳壹@縺滓凾蛻サ縺ォ縺翫¢繧九√け繝ュ繝繧ッ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public float ClockFromSec( float time ) { + // time縺ォ縺翫¢繧九ユ繝ウ繝昴r蜿門セ + int tempo = m_base_tempo; + float base_clock = 0; + float base_time = 0f; + if ( m_tempo_table.size() == 0 ) { + tempo = m_base_tempo; + base_clock = 0; + base_time = 0f; + } else if ( m_tempo_table.size() == 1 ) { + tempo = m_tempo_table.get(0).Tempo; + base_clock = m_tempo_table.get(0).Clock; + base_time = (float)m_tempo_table.get(0).Time; + } else { + for ( int i = m_tempo_table.size() - 1; i >= 0; i-- ) { + if ( m_tempo_table.get( i ).Time < time ) { + return m_tempo_table.get( i ).Clock + (time - (float)m_tempo_table.get( i ).Time) * m_tpq * 1000000.0f / (float)m_tempo_table.get( i ).Tempo; + } + } + } + float dt = time - base_time; + return base_clock + dt * m_tpq * 1000000.0f / (float)tempo; + } + + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺ォ縺翫¢繧区牛蟄舌r蜿門セ励@縺セ縺 + /// + /// + /// + /// + public void getTimesigAt( int clock, Integer numerator, Integer denominator ) { + int index = 0; + for ( int i = m_timesig_table.size() - 1; i >= 0; i-- ) { + index = i; + if ( m_timesig_table.get( i ).Clock <= clock ) { + break; + } + } + numerator = m_timesig_table.get( index ).Numerator; + denominator = m_timesig_table.get( index ).Denominator; + } + + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺ォ縺翫¢繧九ユ繝ウ繝昴r蜿門セ励@縺セ縺吶 + /// + /// + /// + public int getTempoAt( int clock ) { + int index = 0; + for ( int i = m_tempo_table.size() - 1; i >= 0; i-- ) { + index = i; + if ( m_tempo_table.get( i ).Clock <= clock ) { + break; + } + } + return m_tempo_table.get( index ).Tempo; + } + + + /// + /// 謖螳壹@縺溷ー冗ッ縺ョ髢句ァ九け繝ュ繝繧ッ繧定ェソ縺ケ縺セ縺吶ゅ%縺薙〒菴ソ逕ィ縺吶k蟆冗ッ謨ー縺ッ縲√励Μ繝。繧ク繝」繝シ繧定諷ョ縺励↑縺縲ょ叉縺。縲∵峇鬆ュ縺ョ蟆冗ッ縺0縺ァ縺ゅk縲 + /// + /// + /// + public int getClockFromBarCount( int bar_count ) { + int index = 0; + for ( int i = m_timesig_table.size() - 1; i >= 0; i-- ) { + index = i; + if ( m_timesig_table.get( i ).BarCount <= bar_count ) { + break; + } + } + int numerator = m_timesig_table.get( index ).Numerator; + int denominator = m_timesig_table.get( index ).Denominator; + int init_clock = m_timesig_table.get( index ).Clock; + int init_bar_count = m_timesig_table.get( index ).BarCount; + int clock_per_bar = numerator * 480 * 4 / denominator; + return init_clock + (bar_count - init_bar_count) * clock_per_bar; + } + + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺後∵峇鬆ュ縺九i菴募ー冗ッ逶ョ縺ォ螻槭@縺ヲ縺繧九°繧定ェソ縺ケ縺セ縺吶ゅ%縺薙〒菴ソ逕ィ縺吶k蟆冗ッ謨ー縺ッ縲√励Μ繝。繧ク繝」繝シ繧定諷ョ縺励↑縺縲ょ叉縺。縲∵峇鬆ュ縺ョ蟆冗ッ縺0縺ァ縺ゅk縲 + /// + /// + /// + public int getBarCountFromClock( int clock ) { + int index = 0; + for ( int i = m_timesig_table.size() - 1; i >= 0; i-- ) { + index = i; + if ( m_timesig_table.get( i ).Clock <= clock ) { + break; + } + } + int bar_count = 0; + if ( index >= 0 ) { + int last_clock = m_timesig_table.get( index ).Clock; + int t_bar_count = m_timesig_table.get( index ).BarCount; + int numerator = m_timesig_table.get( index ).Numerator; + int denominator = m_timesig_table.get( index ).Denominator; + int clock_per_bar = numerator * 480 * 4 / denominator; + bar_count = t_bar_count + (clock - last_clock) / clock_per_bar; + } + return bar_count; + } + + public int getTickPerQuarter() { + return m_tpq; + } + + public Vector getTempoTable() { + return m_tempo_table; + } + + public Vector getm_timesig_table() { + return m_timesig_table; + } + + public VsqTrack getTracks( int track ) { + return m_tracks.get( track ); + } + + public void dispose() { + if ( m_tracks != null ) { + m_tracks.clear(); + } + if ( m_tempo_table != null ) { + m_tempo_table.clear(); + } + m_tracks = null; + m_tempo_table = null; + } + + + /// + /// 遨コ縺ョvsq繝輔ぃ繧、繝ォ繧呈ァ狗ッ峨@縺セ縺 + /// + /// + /// + /// + /// + public VsqFile( int default_singer_program_change, int pre_measure, int numerator, int denominator, int tempo ) { + VsqUtil.LoadSingerConfigs(); + TotalClocks = (long)(pre_measure * 480 * 4 / denominator * numerator); + m_tpq = 480; + + m_tracks = new Vector(); + m_tracks.add( new VsqTrack( tempo, numerator, denominator ) ); + String singer = "Miku"; + SingerConfig sc = VsqUtil.GetSingerInfo( default_singer_program_change ); + if ( sc != null ) { + singer = sc.VOICENAME; + } + m_tracks.add( new VsqTrack( "Voice1", singer ) ); + Master = new VsqMaster( pre_measure ); + + Mixer = new VsqMixer( 0, 0, 0, 0 ); + Mixer.Slave.add( new VsqMixerEntry( 0, 0, 0, 0 ) ); +// m_mixer.Slave.Add( new VsqMixerEntry( 0, 0, 0, 0 ) ); + //m_mixer.m_tracks = 1; + m_timesig_table = new Vector(); + m_timesig_table.add( new TimeSigTableEntry( 0, numerator, denominator, 0 ) ); + m_tempo_table = new Vector(); + m_tempo_table.add( new TempoTableEntry( 0, tempo, 0.0 ) ); + m_base_tempo = tempo; + m_premeasure_clocks = GetPreMeasureInClock(); + } + + + /// + /// vsq繝輔ぃ繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// + public VsqFile( String _fpath ) { + VsqUtil.LoadSingerConfigs(); + m_tempo_table = new Vector(); + m_timesig_table = new Vector(); + m_tpq = 480; + //tpq_sec = 480.0 * 1000000.0; + + // SMF繧偵さ繝ウ繝舌シ繝医@縺溘ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ繧剃ス懈 + TextMemoryStream tms = new TextMemoryStream(); + SMFReader reader = new SMFReader( _fpath ); + String[] lines0 = reader.Lines; + for ( int i = 0; i < lines0.length; i++ ) { + String line = lines0[i]; + tms.writeLine( line ); + } + + // 繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i縲√ヨ繝ゥ繝繧ッ縺斐→縺ォ蛻繧雁縺 + tms.rewind(); + m_tracks = new Vector(); + + // 繝倥ャ繝縺九i繝医Λ繝繧ッ謨ー縲ゝPQ繧貞叙蠕 + String[] spl = tms.readLine().split( " " ); + int trackNum = Integer.parseInt( spl[2] ); + m_tpq = Integer.parseInt( spl[3] ); + //tpq_sec = TickPerQuarter * 1000000.0; + for ( int i = 0; i < trackNum; i++ ) { + Vector lines = new Vector(); + String line; + while ( (line = tms.readLine()) != null ) { + if ( line.startsWith( "TrkEnd" ) ) { + break; + } + if ( line != "MTrk" ) { + lines.add( line ); + } + } + m_tracks.add( new VsqTrack( lines ) ); + } + + Master = (VsqMaster)m_tracks.get(1).getMaster().clone(); + Mixer = (VsqMixer)m_tracks.get(1).getMixer().clone(); + m_tracks.get(1).setMaster(null); + m_tracks.get(1).setMixer(null); + + int master_track = -1; + for ( int i = 0; i < m_tracks.size(); i++ ) { + if ( m_tracks.get( i ).getName().equals("Master Track") ) { + master_track = i; + break; + } + } + + int prev_tempo; + int prev_index; + double prev_time; + if ( master_track >= 0 ) { + //TempoList縺ョ菴懈 + Vector midi_event = m_tracks.get( master_track ).getTempoList(); + // 縺ィ繧翫≠縺医★tempo_table縺ォ譬シ邏 + prev_tempo = midi_event.get(0).intValue[0]; + m_base_tempo = prev_tempo; + prev_index = 0; + m_tempo_table.add( new TempoTableEntry( midi_event.get(0).index, midi_event.get(0).intValue[0], 0.0 ) ); + double thistime; + prev_time = 0.0; + for ( int j = 1; j < midi_event.size(); j++ ) { + int current_tempo = midi_event.get(j).intValue[0]; + int current_index = midi_event.get(j).index; + thistime = prev_time + (double)(prev_tempo) * (double)(current_index - prev_index) / (m_tpq * 1000000.0); + m_tempo_table.add( new TempoTableEntry( current_index, current_tempo, thistime ) ); + prev_tempo = current_tempo; + prev_index = current_index; + prev_time = thistime; + } + Collections.sort( m_tempo_table ); + + // m_timesig_table縺ョ菴懈 + Vector time_sigs = m_tracks.get(master_track).getTimeSigList(); + m_timesig_table.add( new TimeSigTableEntry( 0, time_sigs.get(0).intValue[0], time_sigs.get(0).intValue[1], 0 ) ); + for ( int j = 1; j < time_sigs.size(); j++ ) { + int numerator = m_timesig_table.get(j - 1).Numerator; + int denominator = m_timesig_table.get(j - 1).Denominator; + int clock = m_timesig_table.get(j - 1).Clock; + int bar_count = m_timesig_table.get(j - 1).BarCount; + + int dif = 480 * 4 / denominator * numerator;//1蟆冗ッ縺御ス輔け繝ュ繝繧ッ縺具シ + + bar_count += (time_sigs.get(j).index - clock) / dif; + m_timesig_table.add( new TimeSigTableEntry( time_sigs.get(j).index, time_sigs.get(j).intValue[0], time_sigs.get(j).intValue[1], bar_count ) ); + } + + + + // 譖イ縺ョ髟キ縺輔r險育ョ + updateTempoInfo(); + updateTimesigInfo(); + m_premeasure_clocks = GetPreMeasureInClock(); + updateTotalClocks(); + } + } + + + /// + /// m_timesig_table縺ョ[*].Clock縺ョ驛ィ蛻繧呈峩譁ー縺励∪縺 + /// + public void updateTimesigInfo() { + if ( m_timesig_table.get(0).Clock != 0 ) { + throw new Exception( "initial timesig does not found" ); + } + m_timesig_table.get(0).Clock = 0; + Collections.sort(m_timesig_table); + for ( int j = 1; j < m_timesig_table.size(); j++ ) { + int numerator = m_timesig_table.get(j - 1).Numerator; + int denominator = m_timesig_table.get(j - 1).Denominator; + int clock = m_timesig_table.get(j - 1).Clock; + int bar_count = m_timesig_table.get(j - 1).BarCount; + int dif = 480 * 4 / denominator * numerator;//1蟆冗ッ縺御ス輔け繝ュ繝繧ッ縺具シ + + clock += (m_timesig_table.get(j).BarCount - bar_count) * dif; + m_timesig_table.get(j).Clock = clock; + } + m_premeasure_clocks = GetPreMeasureInClock(); + + } + + + /// + /// TempoTable縺ョ[*].Time縺ョ驛ィ蛻繧呈峩譁ー縺励∪縺 + /// + public void updateTempoInfo() { + if ( m_tempo_table.size() == 0 ) { + m_tempo_table.add( new TempoTableEntry( 0, getBaseTempo(), 0.0 ) ); + } + Collections.sort( m_tempo_table); + if ( m_tempo_table.get(0).Clock != 0 ) { + m_tempo_table.get(0).Time = (double)getBaseTempo() * (double)m_tempo_table.get(0).Clock / (getTickPerQuarter() * 1000000.0); + } else { + m_tempo_table.get(0).Time = 0.0; + } + double prev_time = m_tempo_table.get(0).Time; + int prev_clock = m_tempo_table.get(0).Clock; + int prev_tempo = m_tempo_table.get(0).Tempo; + double inv_tpq_sec = 1.0 / (getTickPerQuarter() * 1000000.0); + for ( int i = 1; i < m_tempo_table.size(); i++ ) { + m_tempo_table.get( i ).Time = prev_time + (double)prev_tempo * (double)(m_tempo_table.get( i ).Clock - prev_clock) * inv_tpq_sec; + prev_time = m_tempo_table.get( i ).Time; + prev_tempo = m_tempo_table.get( i ).Tempo; + prev_clock = m_tempo_table.get( i ).Clock; + } + } + + + /// + /// VsqFile.Execute縺ョ螳溯。檎峩蠕後↑縺ゥ縺ォ縲[_total_clocks縺ョ蛟、繧呈峩譁ー縺吶k + /// + public void updateTotalClocks() { + long max = m_premeasure_clocks; + for ( int i = 1; i < m_tracks.size(); i++ ) { + VsqTrack track = m_tracks.get( i ); + for ( Iterator itr = track.getEvents().iterator(); itr.hasNext();) { + VsqEvent ve = (VsqEvent)itr.next(); + max = Math.max( max, (long)(ve.Clock + ve.ID.Length) ); + } + VsqCurveType[] values = VsqCurveType.values(); + for ( int j = 0; j < values.length; j++ ) { + VsqCurveType vct = values[j]; + if ( vct == VsqCurveType.VEL ) { + continue; + } + if ( track.getVsqBPList( vct).size() > 0 ) { + Set keys_list = track.getVsqBPList( vct ).keyClockSet(); + long last_key = 0; + for( Iterator itr = keys_list.iterator(); itr.hasNext(); ){ + last_key = Math.max( last_key, (Integer)itr.next() ); + } + max = Math.max( max, last_key ); + } + } + } + TotalClocks = max; + } + + + /// + /// 譖イ縺ョ髟キ縺輔r蜿門セ励☆繧九(sec) + /// + public double getTotalSec() { + return SecFromClock( (int)TotalClocks ); + } + + + /// + /// 謖螳壹&繧後◆逡ェ蜿キ縺ョ繝医Λ繝繧ッ縺ォ蜷ォ縺セ繧後k豁瑚ゥ槭r謖螳壹&繧後◆繝輔ぃ繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + /// + /// + /// + public void printLyricTable( int track, String fpath ) { + BufferedWriter sw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( fpath) ) ); + for ( int i = 0; i < m_tracks.get( track ).getEvents().size(); i++ ) { + int Length; + // timesignal + int time_signal = m_tracks.get( track ).getEvents().get( i ).Clock; + // 繧、繝吶Φ繝医〒謖螳壹&繧後◆ID縺鍬yric縺ァ縺ゅ▲縺溷エ蜷 + if ( m_tracks.get( track ).getEvents().get( i ).ID.type == VsqIDType.Anote ) { + // 逋コ髻ウ髟キ繧貞叙蠕 + Length = m_tracks.get( track ).getEvents().get( i ).ID.Length; + + // tempo_table縺九i縲∫匱髻ウ髢句ァ区凾縺ョtempo繧貞叙蠕 + int last = m_tempo_table.size() - 1; + int tempo = m_tempo_table.get(last).Tempo; + int prev_index = m_tempo_table.get(last).Clock; + double prev_time = m_tempo_table.get(last).Time; + for ( int j = 1; j < m_tempo_table.size(); j++ ) { + if ( m_tempo_table.get(j).Clock > time_signal ) { + tempo = m_tempo_table.get(j - 1).Tempo; + prev_index = m_tempo_table.get(j - 1).Clock; + prev_time = m_tempo_table.get(j - 1).Time; + break; + } + } + int current_index = m_tracks.get( track ).getEvents().get( i ).Clock; + double start_time = prev_time + (double)(current_index - prev_index) * (double)tempo / (m_tpq * 1000000.0); + // TODO: 蜊倡エ斐↓ + Length縺励◆縺縺代〒縺ッ縺セ縺壹>縺ッ縺壹りヲ∵、懆ィ + double end_time = start_time + ((double)Length) * ((double)tempo) / (m_tpq * 1000000.0); + DecimalFormat df = new DecimalFormat("0.000000" ); + sw.write( m_tracks.get( track ).getEvents().get( i ).Clock + "," + + df.format( start_time) + "," + + df.format( end_time) + "," + + m_tracks.get( track ).getEvents().get( i ).ID.LyricHandle.L0.Phrase + "," + + m_tracks.get( track ).getEvents().get( i ).ID.LyricHandle.L0.getPhoneticSymbol() + "\n" ); + } + + } + + } + + private void printTrack( VsqTrack item, RandomAccessFile fs, int msPreSend ) { + //VsqTrack item = m_tracks.get( track ); + String _NL = "" + (char)0x0a; + //繝倥ャ繝 + fs.write( _MTRK, 0, 4 ); + //繝繝シ繧ソ髟キ縲ゅ→繧翫≠縺医★0 + fs.write( new byte[] {0x00, 0x00, 0x00, 0x00}, 0, 4 ); + long first_position = fs.getFilePointer(); + //繝医Λ繝繧ッ蜷 + writeFlexibleLengthUnsignedLong( fs, 0x00 );//繝繝ォ繧ソ繧ソ繧、繝 + + fs.write( 0xff );//繧ケ繝繝シ繧ソ繧ケ繧ソ繧、繝 + + fs.write( 0x03 );//繧、繝吶Φ繝医ち繧、繝祐equence/Track Name + + char[] seq_name = Lyric.encode( item.getName() ); + writeFlexibleLengthUnsignedLong( fs, (long)seq_name.length );//seq_name縺ョ譁蟄玲焚 + + writeCharArray( fs, seq_name ); + //Meta Text繧呈コ門y + TextMemoryStream sr = new TextMemoryStream(); + item.printMetaText( sr, false, TotalClocks + 120, GetPreMeasureInClock() ); + sr.rewind(); + int line_count = -1; + String tmp = ""; + if ( sr.peek() >= 0 ) { + tmp = sr.readLine(); + char[] line_char; + String line = ""; + while ( sr.peek() >= 0 ) { + line = sr.readLine(); + tmp += _NL + line; + while ( (tmp + getLinePrefix( line_count )).length() >= 127 ) { + line_count++; + tmp = getLinePrefix( line_count ) + tmp; + String work = tmp.substring( 0, 127 ); + tmp = tmp.substring( 127 ); + line_char = work.toCharArray(); + writeFlexibleLengthUnsignedLong( fs, 0x00 ); + fs.write( 0xff );//繧ケ繝繝シ繧ソ繧ケ繧ソ繧、繝 + + fs.write( 0x01 );//繧、繝吶Φ繝医ち繧、繝柚eta Text + + writeFlexibleLengthUnsignedLong( fs, (long)line_char.length );//繝繝シ繧ソ髟キ + + writeCharArray( fs, line_char );//繝。繧ソ繝繧ュ繧ケ繝域悽菴 + + } + } + // 谿九j繧貞コ蜉 + line_count++; + tmp = getLinePrefix( line_count ) + tmp + _NL; + while ( tmp.length() > 127 ) { + String work = tmp.substring( 0, 127 ); + tmp = tmp.substring( 127 ); + line_char = work.toCharArray(); + writeFlexibleLengthUnsignedLong( fs, 0x00 ); + fs.write( 0xff ); + fs.write( 0x01 ); + writeFlexibleLengthUnsignedLong( fs, line_char.length ); + writeCharArray( fs, line_char ); + line_count++; + tmp = getLinePrefix( line_count ); + } + line_char = tmp.toCharArray(); + writeFlexibleLengthUnsignedLong( fs, 0x00 ); + fs.write( 0xff ); + fs.write( 0x01 ); + writeFlexibleLengthUnsignedLong( fs, (long)line_char.length ); + writeCharArray( fs, line_char ); + } + + + int last = 0; + VsqNrpn[] data = generateNRPN( item, msPreSend ); + + NrpnData[] nrpns = VsqNrpn.convert( data ); + for ( int i = 0; i < nrpns.length; i++ ) { + writeFlexibleLengthUnsignedLong( fs, (long)(nrpns[i].Clock - last) ); + fs.write( 0xb0 ); + fs.write( nrpns[i].Parameter ); + fs.write( nrpns[i].Value ); + last = nrpns[i].Clock; + } + + //繝医Λ繝繧ッ繧ィ繝ウ繝 + VsqEvent last_event = item.getEvents().get(item.getEvents().size() - 1); + int last_clock = last_event.Clock + last_event.ID.Length; + writeFlexibleLengthUnsignedLong( fs, (long)last_clock ); + fs.write( 0xff ); + fs.write( 0xf2 ); + fs.write( 0x00 ); + long pos = fs.getFilePointer(); + fs.seek( first_position - 4 ); + writeUnsignedInt( fs, pos - first_position ); + fs.seek( pos ); + } + + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺ォ縺翫¢繧九励Μ繧サ繝ウ繝峨サ繧ッ繝ュ繝繧ッ繧貞叙蠕励@縺セ縺 + /// + /// + /// + /// + public int getPresendClockAt( int clock, int msPreSend ) { + double clock_msec = SecFromClock( clock ) * 1000.0; + float draft_clock_sec = (float)(clock_msec - msPreSend) / 1000.0f; + int draft_clock = (int)Math.floor( ClockFromSec( draft_clock_sec ) ); + return clock - draft_clock; + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺九i縲・xpression(DYN)縺ョNRPN繝ェ繧ケ繝医r菴懈舌@縺セ縺 + /// + /// + /// + /// + public VsqNrpn[] generateExpressionNRPN( VsqTrack track, int msPreSend ) { + return generateExpressionNRPN( track, msPreSend, 0, (int)TotalClocks, 0 ); + } + + public VsqNrpn[] generateExpressionNRPN( VsqTrack track, int msPreSend, int clStart, int clEnd, int t_temp_premeasure ) { + Vector ret = new Vector(); + //SortedList list = track[VsqCurveType.DYN].Vector; + int count = track.getVsqBPList( VsqCurveType.DYN ).size(); + Byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ); + int start_clock = clStart < m_premeasure_clocks ? m_premeasure_clocks : clStart; + int start_value = track.getVsqBPList(VsqCurveType.DYN).get(start_clock); + VsqNrpn add0 = new VsqNrpn( start_clock - getPresendClockAt( start_clock, msPreSend ) - clStart + t_temp_premeasure, 0x6300, (byte)0x00, (byte)0x00 ); + add0.append( 0x6301, delay0, delay1 ); + add0.append( 0x6302, (byte)start_value ); + ret.add( add0 ); + Integer[] keys = track.getVsqBPList(VsqCurveType.DYN).keyClockSet().toArray( new Integer[0] ); + for ( int i = 1; i < keys.length; i++ ) { + if ( keys[i] > clEnd ) { + break; + } + if ( keys[i] > start_clock ) { + VsqNrpn add = new VsqNrpn( keys[i] - getPresendClockAt( keys[i], msPreSend ) - clStart + t_temp_premeasure, 0x6302, (byte)track.getVsqBPList(VsqCurveType.DYN).get(keys[i]) ); + ret.add( add ); + } + } + return ret.toArray( new VsqNrpn[0] ); + } + + + /// + /// 蜈磯ュ縺ォ險倬鹸縺輔l繧起RPN繧剃ス懈舌@縺セ縺 + /// + /// + public static VsqNrpn generateHeaderNRPN() { + VsqNrpn ret = new VsqNrpn( 0, 0x6000, (byte)0x00, (byte)0x00 ); // 0x00 (NRPN 0x6000 BNK device number = 0x00) + + ret.append( 0x6001, (byte)0x00, (byte)0x00 ); // 0x00 (NRPN 0x6001 BNK DELAY delay = 0x0000) + //ret.append( 0x6002, 0x00 ); // 0x00 (NRPN 0x6002 LANGUAGE TYPE language type = 0x00) + //ret.append( 0x5302, 0x00 ); // 0x00 (NRPN 0x5302 VOICE TYPE voice type = 0x00) + + return ret; + } + + public VsqNrpn[] generateSingerNRPN( VsqEvent ve, int msPreSend, int clShift ) { + int clock = ve.Clock; + + double clock_msec = SecFromClock( clock ) * 1000.0; + + int ttempo = getTempoAt( clock ); + double tempo = 6e7 / ttempo; + //double sStart = SecFromClock( ve.Clock ); + double msEnd = SecFromClock( ve.Clock + ve.ID.Length ) * 1000.0; + int duration = (int)Math.ceil( msEnd - clock_msec ); + Byte duration0, duration1; + getMsbAndLsb( duration, duration0, duration1 ); + Byte delay0, delay1; + getMsbAndLsb( (int)msPreSend, delay0, delay1 ); + Vector ret = new Vector(); + + VsqNrpn add = new VsqNrpn( clock - getPresendClockAt( clock, msPreSend ) - clShift, 0x6002, (byte)ve.ID.IconHandle.Language ); + add.append( 0x5302, (byte)ve.ID.IconHandle.Program ); + return new VsqNrpn[] {add}; + } + + + /// + /// 謖螳壹@縺欸sqEvent繧定。ィ迴セ縺吶kNRPN繧剃ス懈舌@縺セ縺 + /// + /// + /// + /// + /// + public VsqNrpn[] generateNoteNRPN( VsqEvent ve, int msPreSend, byte note_loc ) { + return generateNoteNRPN( ve, msPreSend, note_loc, 0 ); + } + + public VsqNrpn[] generateNoteNRPN( VsqEvent ve, int msPreSend, byte note_loc, int clShift ) { + int clock = ve.Clock; + + double clock_msec = SecFromClock( clock ) * 1000.0; + + int ttempo = getTempoAt( clock ); + double tempo = 6e7 / ttempo; + //double sStart = SecFromClock( ve.Clock ); + double msEnd = SecFromClock( ve.Clock + ve.ID.Length ) * 1000.0; + int duration = (int)Math.ceil( msEnd - clock_msec ); + + Byte duration0, duration1; + getMsbAndLsb( duration, duration0, duration1 ); + Byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ); + Vector ret = new Vector(); + + VsqNrpn add = new VsqNrpn( clock - getPresendClockAt( clock, msPreSend ) - clShift, 0x5001, delay0, delay1 ); + add.append( 0x5002, (byte)ve.ID.Note ); // Note number + + add.append( 0x5003, (byte)ve.ID.Dynamics ); // Velocity + + add.append( 0x5004, duration0, duration1 ); // Note duration(LSB) + + add.append( 0x5005, note_loc ); // Note Location + + if ( ve.ID.VibratoHandle != null ) { + add.append( 0x500c, (byte)0x00, (byte)0x00 ); + int vibrato_type = VibratoTypeUtil.FromIconID( ve.ID.VibratoHandle.IconID ).ordinal(); + int note_length = ve.ID.Length; + int vibrato_delay = ve.ID.VibratoDelay; + byte bVibratoDuration = (byte)((float)(note_length - vibrato_delay) / (float)note_length * 127); + byte bVibratoDelay = (byte)(0x7f - bVibratoDuration); + add.append( 0x500d, (byte)vibrato_type, bVibratoDuration ); + add.append( 0x500e, bVibratoDelay ); + } + + String[] spl = ve.ID.LyricHandle.L0.getPhoneticSymbolList(); + String s = ""; + for ( int j = 0; j < spl.length; j++ ) { + s += spl[j]; + } + char[] symbols = s.toCharArray(); + add.append( 0x5012, (byte)symbols.length );// 0x12(Number of phonetic symbols in bytes) + + int count = -1; + for ( int j = 0; j < spl.length; j++ ) { + char[] chars = spl[j].toCharArray(); + for ( int k = 0; k < chars.length; k++ ) { + count++; + if ( k == 0 ) { + add.append( ((0x50 << 8) | (byte)(0x13 + count)), (byte)chars[k], (byte)ve.ID.LyricHandle.L0.getConsonantAdjustment()[j] ); // Phonetic symbol j + + } else { + add.append( (0x50 << 8) | (byte)(0x13 + count), (byte)chars[k] ); // Phonetic symbol j + + } + } + } + add.append( 0x504f, (byte)0x7f ); // End of phonetic symbols + + add.append( 0x5050, (byte)0x04 );// 0x50(v1mean) + + add.append( 0x5051, (byte)0x08 );// 0x51(d1mean) + + add.append( 0x5052, (byte)0x14 );// 0x52(d1meanFirstNote) + + add.append( 0x5053, (byte)0x1c );// 0x53(d2mean) + + add.append( 0x5054, (byte)0x18 );// 0x54(d4mean) + + add.append( 0x5055, (byte)0x0a ); // 055(pMeanOnsetFirstNote) + + add.append( 0x5056, (byte)0x0c ); // 0x56(vMeanNoteTransition) + + add.append( 0x5057, (byte)0x0c );// 0x57(pMeanEndingNote) + + add.append( 0x5058, (byte)ve.ID.PMbPortamentoUse );// 0x58(AddScoopToUpInternals&AddPortamentoToDownIntervals) + + add.append( 0x5059, (byte)0x32 );// 0x59(changeAfterPeak) + + add.append( 0x505a, (byte)0x32 );// 0x5a(Accent) + + add.append( 0x507f, (byte)0x7f );// 0x7f(Note message continuation) + + ret.add( add ); + return ret.toArray(new VsqNrpn[0]); + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺ョ繝繝シ繧ソ縺九i縲¨RPN縺ョ繝ェ繧ケ繝医r菴懈舌@縺セ縺 + /// + /// + /// + /// + public VsqNrpn[] generateNRPN( VsqTrack track, int msPreSend ) { + return generateNRPN( track, msPreSend, 0, (int)TotalClocks, 0 ); + } + + public VsqNrpn[] generateNRPN( VsqTrack track, int msPreSend, int clStart, int clEnd, int t_temp_premeasure ) { + Vector list = new Vector(); + list.add( generateHeaderNRPN() ); + + int count = track.getEvents().size(); + int note_start = 0; + int note_end = track.getEvents().size() - 1; + for ( int i = 0; i < track.getEvents().size(); i++ ) { + if ( clStart <= track.getEvents().get( i ).Clock ) { + note_start = i; + break; + } + note_start = i; + } + for ( int i = track.getEvents().size() - 1; i >= 0; i-- ) { + if ( track.getEvents().get( i ).Clock <= clEnd ) { + note_end = i; + break; + } + } + + // 譛蛻昴ョ豁梧焔繧呈アコ繧√k + int singer_event = -1; + for ( int i = note_start; i >= 0; i-- ) { + if ( track.getEvents().get( i ).ID.type == VsqIDType.Singer ) { + singer_event = i; + break; + } + } + if ( singer_event >= 0 ) { //隕九▽縺九▲縺溷エ蜷 + Collections.addAll( list, generateSingerNRPN( track.getEvents().get(singer_event), 0, 0 ) ); + } else { //螟壼縺ゅj縺医↑縺縺ィ諤昴≧縺後∵ュ梧焔縺御ク肴弱ョ蝣エ蜷医 + + list.add( new VsqNrpn( 0, 0x6002, (byte)0 ) ); + list.add( new VsqNrpn( 0, 0x5302, (byte)0 ) ); + } + + for ( int i = note_start; i <= note_end; i++ ) { + byte note_loc = 0x00; + if ( i == note_start ) { + if ( i == note_end ) { + note_loc = 0x03; + } else { + note_loc = 0x01; + } + } else if ( i == note_end ) { + note_loc = 0x02; + } + + if ( track.getEvents().get( i ).ID.type == VsqIDType.Anote ) { + Collections.addAll( list, generateNoteNRPN( + track.getEvents().get( i ), + msPreSend, + note_loc, + clStart - t_temp_premeasure ) ); + Collections.addAll( list, generateVibratoNRPN( + track.getEvents().get( i ), + msPreSend, + clStart - t_temp_premeasure ) ); + } else if ( track.getEvents().get( i ).ID.type == VsqIDType.Singer ) { + if ( i > note_start ) { + Collections.addAll( list, generateSingerNRPN( track.getEvents().get( i ), msPreSend, clStart - t_temp_premeasure ) ); + } + } + } + Collections.addAll( list, generateVoiceChangeParameterNRPN( track, msPreSend, clStart, clEnd, t_temp_premeasure ) ); + Collections.addAll( list, generateExpressionNRPN( track, msPreSend, clStart, clEnd, t_temp_premeasure ) ); + Collections.addAll( list, generatePitchBendNRPN( track, msPreSend, clStart, clEnd, t_temp_premeasure ) ); + Collections.addAll( list, generatePitchBendSensitivityNRPN( track, msPreSend, clStart, clEnd, t_temp_premeasure ) ); + + Collections.sort( list ); + Vector merged = new Vector(); + for ( int i = 0; i < list.size(); i++ ) { + Collections.addAll( merged, list.get( i ).expand() ); + } + return merged.toArray( new VsqNrpn[0]); + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺九i縲 ̄itchBend縺ョNRPN繧剃ス懈舌@縺セ縺 + /// + /// + /// + /// + public VsqNrpn[] generatePitchBendNRPN( VsqTrack track, int msPreSend ) { + return generatePitchBendNRPN( track, msPreSend, 0, (int)TotalClocks, 0 ); + } + + public VsqNrpn[] generatePitchBendNRPN( VsqTrack track, int msPreSend, int clStart, int clEnd, int t_pre_measure ) { + Vector ret = new Vector(); + //SortedList list = track[VsqCurveType.PIT].Vector; + Integer[] keys = track.getVsqBPList(VsqCurveType.PIT).keyClockSet().toArray( new Integer[0]); + int count = keys.length; + byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ); + int start_clock = clStart < m_premeasure_clocks ? m_premeasure_clocks : clStart; + VsqNrpn add0 = new VsqNrpn( start_clock - getPresendClockAt( start_clock, msPreSend ) - clStart + t_pre_measure, 0x5400, (byte)0x00, (byte)0x00 ); + add0.append( 0x5401, delay0, delay1 ); + + int start_value = track.getVsqBPList(VsqCurveType.PIT).get(start_clock) + 0x2000; + byte start_value0, start_value1; + getMsbAndLsb( start_value, start_value0, start_value1 ); + add0.append( 0x5402, start_value0, start_value1 ); + ret.add( add0 ); + + for ( int i = 1; i < keys.length; i++ ) { + if ( keys[i] > clEnd ) { + break; + } + if ( keys[i] > start_clock ) { + int value = track.getVsqBPList(VsqCurveType.PIT).get(keys[i])+ 0x2000; + byte value0, value1; + getMsbAndLsb( value, value0, value1 ); + VsqNrpn add = new VsqNrpn( keys[i] - getPresendClockAt( keys[i], msPreSend ) - clStart + t_pre_measure, 0x5402, value0, value1 ); + ret.add( add ); + } + } + return ret.toArray(new VsqNrpn[0]); + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺九iPitchBendSensitivity縺ョNRPN繧剃ス懈舌@縺セ縺 + /// + /// + /// + /// + public VsqNrpn[] generatePitchBendSensitivityNRPN( VsqTrack track, int msPreSend ) { + return generatePitchBendSensitivityNRPN( track, msPreSend, 0, (int)TotalClocks, 0 ); + } + + public VsqNrpn[] generatePitchBendSensitivityNRPN( VsqTrack track, int msPreSend, int clStart, int clEnd, int t_pre_measure ) { + Vector ret = new Vector(); + //SortedList list = track[VsqCurveType.PBS].Vector; + Integer[] keys = track.getVsqBPList(VsqCurveType.PBS).keyClockSet().toArray(new Integer[0]); + int count = keys.length; + Byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ) ; + int start_clock = clStart < m_premeasure_clocks ? m_premeasure_clocks : clStart; + int start_value = track.getVsqBPList(VsqCurveType.PBS).get( start_clock); + VsqNrpn add0 = new VsqNrpn( start_clock - getPresendClockAt( start_clock, msPreSend ) - clStart + t_pre_measure, 0x6700, (byte)0x00, (byte)0x00 ); + add0.append( 0x6701, delay0, delay1 ); + add0.append( 0x6702, (byte)start_value, (byte)0x00 ); + ret.add( add0 ); + for ( int i = 1; i < keys.length; i++ ) { + if ( keys[i] > clEnd ) { + break; + } + if ( keys[i] > start_clock ) { + VsqNrpn add = new VsqNrpn( keys[i]- getPresendClockAt( keys[i], msPreSend ) - clStart + t_pre_measure, 0x6702, (byte)track.getVsqBPList(VsqCurveType.PBS).get(keys[i]), (byte)0x00 ); + ret.add( add ); + } + } + return ret.toArray( new VsqNrpn[0]); + } + + public VsqNrpn[] generateVibratoNRPN( VsqEvent ve, int msPreSend ) { + return generateVibratoNRPN( ve, msPreSend, 0 ); + } + + public VsqNrpn[] generateVibratoNRPN( VsqEvent ve, int msPreSend, int clShift ) { + Vector ret = new Vector(); + if ( ve.ID.VibratoHandle != null ) { + int vclock = ve.Clock + ve.ID.VibratoDelay; + Byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ) ; + VsqNrpn add2 = new VsqNrpn( vclock - getPresendClockAt( vclock, msPreSend ) - clShift, 0x6500, (byte)0x00, (byte)0x00 ); + add2.append( 0x6501, delay0, delay1 ); + add2.append( 0x6502, (byte)ve.ID.VibratoHandle.StartDepth ); + add2.append( 0x6402, (byte)ve.ID.VibratoHandle.StartRate ); + ret.add( add2 ); + int vlength = ve.Clock + ve.ID.Length - ve.ID.VibratoDelay; + if ( ve.ID.VibratoHandle.RateBPNum > 0 ) { + for ( int i = 0; i < ve.ID.VibratoHandle.RateBPX.length; i++ ) { + float percent = ve.ID.VibratoHandle.RateBPX[i]; + int cl = vclock + (int)(percent * vlength); + ret.add( new VsqNrpn( cl, 0x6402, (byte)ve.ID.VibratoHandle.RateBPY[i] ) ); + } + } + if ( ve.ID.VibratoHandle.DepthBPNum > 0 ) { + for ( int i = 0; i < ve.ID.VibratoHandle.DepthBPX.length; i++ ) { + float percent = ve.ID.VibratoHandle.DepthBPX[i]; + int cl = vclock + (int)(percent * vlength); + ret.add( new VsqNrpn( cl, 0x6502, (byte)ve.ID.VibratoHandle.DepthBPY[i] ) ); + } + } + } + Collections.sort( ret ); + return ret.toArray(new VsqNrpn[0]); + } + + + /// + /// 謖螳壹@縺溘ヨ繝ゥ繝繧ッ縺九i縲〃oiceChangeParameter縺ョNRPN縺ョ繝ェ繧ケ繝医r菴懈舌@縺セ縺 + /// + /// + /// + /// + public VsqNrpn[] generateVoiceChangeParameterNRPN( VsqTrack track, int msPreSend ) { + return generateVoiceChangeParameterNRPN( track, msPreSend, 0, (int)TotalClocks, 0 ); + } + + public VsqNrpn[] generateVoiceChangeParameterNRPN( VsqTrack track, int msPreSend, int clStart, int clEnd, int t_pre_measure ) { + int premeasure_clock = m_premeasure_clocks; + byte delay0, delay1; + getMsbAndLsb( msPreSend, delay0, delay1 ); + Vector < VsqNrpn + > res = new Vector(); + int start_clock = (clStart < premeasure_clock) ? premeasure_clock : clStart; + VsqNrpn ret = new VsqNrpn( start_clock - getPresendClockAt( start_clock, msPreSend ) - clStart + t_pre_measure, 0x5500, (byte)0x00, (byte)0x00 ); + + ret.append( 0x5501, delay0, delay1 ); // Voice Change Parameter delay + + ret.append( 0x5502, (byte)0x31 ); // BRE + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.BRE).get(start_clock) ); + + ret.append( 0x5502, (byte)0x32 ); // BRI + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.BRI).get(start_clock) ); + + ret.append( 0x5502, (byte)0x33 ); // CLE + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.CLE).get(start_clock) ); + + ret.append( 0x5502, (byte)0x34 ); // POR + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.POR).get(start_clock) ); + + ret.append( 0x5502, (byte)0x35 ); // OPE + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.OPE).get(start_clock) ); + + ret.append( 0x5502, (byte)0x70 ); // GEN + + ret.append( 0x5503, (byte)track.getVsqBPList(VsqCurveType.GEN).get(start_clock) ); + res.add( ret ); + + VsqCurveType[] values = VsqCurveType.values(); + for( int j = 0; j < values.length; j++ ){ + VsqCurveType vct = values[j]; + byte lsb = 0x31; + switch ( vct ) { + case DYN: + case PBS: + case PIT: + case VEL: + continue; + case BRE: + lsb = 0x31; + break; + case BRI: + lsb = 0x32; + break; + case CLE: + lsb = 0x33; + break; + case POR: + lsb = 0x34; + break; + case OPE: + lsb = 0x35; + break; + case GEN: + lsb = 0x70; + break; + } + //SortedList list = track[vct].Vector; + Integer[] keys = track.getVsqBPList(vct).keyClockSet().toArray( new Integer[0]); + for ( int i = 0; i < keys.length; i++ ) { + if ( keys[i] > clEnd ) { + break; + } + if ( keys[i] > start_clock ) { + VsqNrpn add = new VsqNrpn( keys[i] - getPresendClockAt( keys[i], msPreSend ) - clStart + t_pre_measure, 0x5502, lsb ); + add.append( 0x5503, (byte)track.getVsqBPList(vct).get(keys[i]) ); + res.add( add ); + } + } + } + + return res.toArray( new VsqNrpn[0]); + } + + private static void getMsbAndLsb( int value, Byte msb,Byte lsb ) { + msb = (byte)(value >> 7); + lsb = (byte)(value - (msb << 7)); + } + + + /// + /// 繝輔ぃ繧、繝ォ縺ォ縺薙ョVsqFile繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ荳ュ霄ォ繧貞コ蜉帙@縺セ縺吶 + /// + /// + /// 繝励Μ繧サ繝ウ繝峨ち繧、繝(msec) + public void write( String file, int msPreSend ) { + int last_clock = 0; + for ( int track = 1; track < m_tracks.size(); track++ ) { + if ( m_tracks.get( track ).getEvents().size() > 0 ) { + int index = m_tracks.get( track ).getEvents().size() - 1; + VsqEvent last = m_tracks.get( track ).getEvents().get( index ); + last_clock = Math.max( last_clock, last.Clock + last.ID.Length ); + } + } + + //int delay = DelayFromPreSend( pre_send ); + RandomAccessFile fs = new RandomAccessFile( file, "rw" ); + long first_position;//繝√Ε繝ウ繧ッ縺ョ蜈磯ュ縺ョ繝輔ぃ繧、繝ォ菴咲スョ + + // 繝倥ャ繝 + //繝√Ε繝ウ繧ッ繧ソ繧、繝 + fs.write( _MTHD, 0, 4 ); + //繝繝シ繧ソ髟キ + fs.writeByte( 0x00 ); + fs.writeByte( 0x00 ); + fs.writeByte( 0x00 ); + fs.writeByte( 0x06 ); + //繝輔か繝シ繝槭ャ繝 + fs.writeByte( 0x00 ); + fs.writeByte( 0x01 ); + //繝医Λ繝繧ッ謨ー + writeUnsignedShort( fs, this.m_tracks.size() ); + //譎る俣蜊倅ス + fs.writeByte( 0x01 ); + fs.writeByte( 0xe0 ); + + // Master Track + //繝√Ε繝ウ繧ッ繧ソ繧、繝 + fs.write( _MTRK, 0, 4 ); + //繝繝シ繧ソ髟キ縲ゅ→繧翫≠縺医★0繧貞・繧後※縺翫¥ + fs.write( new byte[] { 0x00, 0x00, 0x00, 0x00 }, 0, 4 ); + first_position = fs.getFilePointer(); + //繝医Λ繝繧ッ蜷 + writeFlexibleLengthUnsignedLong( fs, 0 );//繝繝ォ繧ソ繧ソ繧、繝 + fs.writeByte( 0xff );//繧ケ繝繝シ繧ソ繧ケ繧ソ繧、繝 + fs.writeByte( 0x03 );//繧、繝吶Φ繝医ち繧、繝祐equence/Track Name + fs.writeByte( (byte)_MASTER_TRACK.length );//繝医Λ繝繧ッ蜷阪ョ譁蟄玲焚縲ゅ%繧後ッ蝗コ螳 + fs.write( _MASTER_TRACK, 0, _MASTER_TRACK.length ); + + Vector events = new Vector(); + for (int i = 0; i < this.m_timesig_table.size(); i++ ){ + TimeSigTableEntry entry = m_timesig_table.get( i ); + events.add( MidiEvent.TimeSig( entry.Clock, entry.Numerator, entry.Denominator ) ); + last_clock = Math.max( last_clock, entry.Clock ); + } + for( int i = 0; i < m_tempo_table.size(); i++ ){ + TempoTableEntry entry = m_tempo_table.get( i ); + events.add( MidiEvent.TempoChange( entry.Clock, entry.Tempo ) ); + last_clock = Math.max( last_clock, entry.Clock ); + } + Collections.sort( events); + int last = 0; + for( int i = 0; i < events.size(); i++ ){ + MidiEvent item = events.get( i ); + switch ( item.type ) { + case tempo: + writeFlexibleLengthUnsignedLong( fs, item.index - last) ; + last = item.index; + fs.writeByte( 0xff ); + fs.writeByte( 0x51 ); + fs.writeByte( 0x03 ); + writeTempo( fs, item.intValue[0] ); + break; + case time_signal: + int num = item.intValue[0]; + int den = item.intValue[1]; + writeFlexibleLengthUnsignedLong( fs, item.index - last ); + last = item.index; + fs.writeByte( 0xff ); + fs.writeByte( 0x58 );//繧、繝吶Φ繝医ち繧、繝裕ime Signature + fs.writeByte( 0x04 );//繝繝シ繧ソ髟キ + fs.writeByte( (byte)num );//蛻蟄 + fs.writeByte( (byte)(Math.log( den ) / Math.log( 2.0 ) ) );//蛻豈阪ョ2縺ョ雋縺ョ縺ケ縺堺ケ玲焚 + fs.writeByte( 0x18 ); + fs.writeByte( 0x08 ); + break; + } + } + + //WriteFlexibleLengthUnsignedLong( fs, (ulong)(last_clock + 120 - last) ); + writeFlexibleLengthUnsignedLong( fs, 0 ); + fs.writeByte( 0xff ); + fs.writeByte( 0x2f );//繧、繝吶Φ繝医ち繧、繝勇nd of Track + fs.writeByte( 0x00 ); + long pos = fs.getFilePointer(); + fs.seek( first_position - 4); + writeUnsignedInt( fs, pos - first_position); + fs.seek( pos); + + // 繝医Λ繝繧ッ + VsqTrack t_track = (VsqTrack)m_tracks.get( 1).clone(); + t_track.setMaster( (VsqMaster)Master.clone() ); + t_track.setMixer( (VsqMixer)Mixer.clone() ); + printTrack( t_track, fs, msPreSend ); + for ( int track = 2; track < m_tracks.size(); track++ ) { + printTrack( m_tracks.get( track ), fs, msPreSend ); + } + } + + public void write( String file ) { + write( file, 500 ); + } + + + /// + /// 繝。繧ソ繝繧ュ繧ケ繝医ョ陦檎分蜿キ縺九i縲∝推陦悟磯ュ縺ョ繝励Ξ繝輔ぅ繧ッ繧ケ譁蟄怜("DM:0123:"遲)繧剃ス懈舌@縺セ縺 + /// + /// + /// + public static String getLinePrefix( int count ) { + int digits = howManyDigits( count ); + int c = (digits - 1) / 4 + 1; + String format = ""; + for ( int i = 0; i < c; i++ ) { + format += "0000"; + } + DecimalFormat df = new DecimalFormat( format ); + return "DM:" + df.format( count ) + ":"; + } + + + /// + /// 謨ーnumber縺ョ譯∵焚繧定ェソ縺ケ縺セ縺吶ゑシ10騾イ謨ー縺ョ縺ソシ + /// + /// + /// + private static int howManyDigits( int number ) { + int val; + if ( number > 0 ) { + val = number; + } else { + val = -number; + } + int i = 1; + int digits = 1; + while ( true ) { + i++; + digits *= 10; + if ( val < digits ) { + return i - 1; + } + } + } + + + /// + /// char[]繧呈嶌縺崎セシ繧縲 + /// + /// + /// + public void writeCharArray( RandomAccessFile fs, char[] item ) { + for ( int i = 0; i < item.length; i++ ) { + fs.writeByte( (byte)item[i] ); + } + } + + + /// + /// 繝繝ウ繝晏、繧偵ン繝繧ー繧ィ繝ウ繝繧」繧「繝ウ縺ァ譖ク縺崎セシ縺ソ縺セ縺吶 + /// 繝繝ウ繝昴ッ3繝舌う繝医〒險伜・縺輔l繧九ョ縺ァ縲∝挨髢「謨ー繧堤畑諢上@縺溘 + /// + /// + /// + public void writeTempo( RandomAccessFile fs, long tempo ) { + byte[] dat = new byte[3]; + ByteBuffer.wrap( dat ).order( ByteOrder.nativeOrder() ).putLong( tempo ); + fs.write( dat ); + } + + + /// + /// ushort蛟、繧偵ン繝繧ー繧ィ繝ウ繝繧」繧「繝ウ縺ァfs縺ォ譖ク縺崎セシ縺ソ縺セ縺 + /// + /// + public void writeUnsignedShort( RandomAccessFile fs, int data ) { + byte[] dat = new byte[2]; + ByteBuffer.wrap( dat ).order( ByteOrder.nativeOrder() ).putInt( data ); + fs.write( dat ); + } + + + /// + /// uint蛟、繧偵ン繝繧ー繧ィ繝ウ繝繧」繧「繝ウ縺ァfs縺ォ譖ク縺崎セシ縺ソ縺セ縺 + /// + /// + public void writeUnsignedInt( RandomAccessFile fs, long data ) { + byte[] dat = new byte[4]; + ByteBuffer.wrap( dat ).order( ByteOrder.nativeOrder() ).putLong( data ); + fs.write( dat ); + } + + + /// + /// SMF縺ョ蜿ッ螟蛾聞謨ー蛟、陦ィ迴セ繧剃スソ縺」縺ヲ縲「long繧鍛yte[]縺ォ螟画鋤縺励∪縺 + /// + /// + /// + public static byte[] getBytesFlexibleLengthUnsignedLong( long number ) { + boolean[] bits = new boolean[64]; + long val = 0x1; + bits[0] = (number & val) == val; + for ( int i = 1; i < 64; i++ ) { + val = val << 1; + bits[i] = (number & val) == val; + } + int first = 0; + for ( int i = 63; i >= 0; i-- ) { + if ( bits[i] ) { + first = i; + break; + } + } + // 菴輔ヰ繧、繝亥ソ隕√°シ + int bytes = first / 7 + 1; + byte[] ret = new byte[bytes]; + for ( int i = 1; i <= bytes; i++ ) { + int num = 0; + int count = 0x80; + for ( int j = (bytes - i + 1) * 7 - 1; j >= (bytes - i + 1) * 7 - 6 - 1; j-- ) { + count = count >> 1; + if ( bits[j] ) { + num += count; + } + } + if ( i != bytes ) { + num += 0x80; + } + ret[i - 1] = (byte)num; + } + return ret; + } + + + /// + /// 謨エ謨ー繧呈嶌縺崎セシ繧縲ゅヵ繧ゥ繝シ繝槭ャ繝医ッSMF縺ョ蜿ッ螟蛾聞謨ー蛟、陦ィ迴セ縲 + /// + /// + /// + public static void writeFlexibleLengthUnsignedLong( RandomAccessFile fs, long number ) { + byte[] bytes = getBytesFlexibleLengthUnsignedLong( number ); + fs.write( bytes, 0, bytes.length ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandle.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandle.java new file mode 100644 index 0000000..f0a2b54 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandle.java @@ -0,0 +1,391 @@ +/* + * VsqHandle.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.io.*; +import java.text.*; + +/// +/// 繝上Φ繝峨Ν繧貞叙繧頑桶縺縺セ縺吶ゅワ繝ウ繝峨Ν縺ォ縺ッLyricHandle縲〃ibratoHandle縺翫h縺ウIconHandle縺後≠繧 +/// +public class VsqHandle { + public VsqHandleType Type; + public int Index; + /*protected String m_icon_id; + protected String m_ids; + protected Lyric m_lyric; + protected int m_original; + protected String m_caption; + protected int m_length; + protected int m_start_depth; + protected int DepthBPNum; + protected float[] DepthBPX; + protected int[] DepthBPY; + protected int m_start_rate; + protected int RateBPNum; + protected float[] RateBPX; + protected int[] RateBPY; + protected int m_language; + protected int m_program;*/ + public String IconID; + public String IDS; + public Lyric L0; + public int Original; + public String Caption; + public int Length; + public int StartDepth; + public int DepthBPNum; + public float[] DepthBPX; + public int[] DepthBPY; + public int StartRate; + public int RateBPNum; + public float[] RateBPX; + public int[] RateBPY; + public int Language; + public int Program; + + public LyricHandle ConvertToLyricHandle() { + LyricHandle ret = new LyricHandle(); + ret.L0 = (Lyric)L0.clone(); + ret.Type = Type;//m_type; + + ret.Index = Index;// m_index; + + return ret; + } + + public VibratoHandle ConvertToVibratoHandle() { + VibratoHandle ret = new VibratoHandle(); + ret.Type = Type; + ret.Index = Index; + ret.Caption = Caption; + ret.DepthBPNum = DepthBPNum; + ret.DepthBPX = DepthBPX; + ret.DepthBPY = DepthBPY; + ; + ret.IconID = IconID; + ret.IDS = IDS; + ret.Length = Length; + ret.Original = Original; + ret.RateBPNum = RateBPNum; + ret.RateBPX = RateBPX; + ret.RateBPY = RateBPY; + ret.StartDepth = StartDepth; + ret.StartRate = StartRate; + return ret; + } + + public IconHandle ConvertToIconHandle() { + IconHandle ret = new IconHandle(); + ret.Type = Type; + ret.Index = Index; + ret.Caption = Caption; + ret.IconID = IconID; + ret.IDS = IDS; + ret.Language = Language; + ret.Length = Length; + ret.Original = Original; + ret.Program = Program; + return ret; + } + + + /*public VsqHandleType Type { + get { + return m_type; + } + set { + m_type = value; + } + } + + + public int Index { + get { + return m_index; + } + set { + m_index = value; + } + }*/ + /*// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ邁。譏薙さ繝斐シ繧貞叙蠕励@縺セ縺吶 + /// + /// + public object Clone() { + VsqHandle result = new VsqHandle(); + result.m_type = m_type; + result.m_index = m_index; + result.m_icon_id = m_icon_id; + result.IDS = this.IDS; + if ( this.L0 != null ) { + result.L0 = this.L0.Clone(); + } + result.Original = this.Original; + result.Caption = this.Caption; + result.Length = this.Length; + result.StartDepth = this.StartDepth; + result.DepthBPNum = this.DepthBPNum; + if ( this.DepthBPX != null ) { + result.DepthBPX = (float[])this.DepthBPX.Clone(); + } + if ( this.DepthBPY != null ) { + result.DepthBPY = (int[])this.DepthBPY.Clone(); + } + result.StartRate = this.StartRate; + result.RateBPNum = this.RateBPNum; + if ( this.RateBPX != null ) { + result.RateBPX = (float[])this.RateBPX.Clone(); + } + if ( this.RateBPY != null ) { + result.RateBPY = (int[])this.RateBPY.Clone(); + } + result.Language = this.Language; + result.Program = this.Program; + return result; + }*/ + public VsqHandle() { + } + + /// + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧偵せ繝医Μ繝シ繝縺ォ譖ク縺崎セシ縺ソ縺セ縺吶 + /// encode=true縺ョ蝣エ蜷医2繝舌う繝域枚蟄励r繧ィ繝ウ繧ウ繝シ繝峨@縺ヲ蜃コ蜉帙@縺セ縺吶 + /// + /// 譖ク縺崎セシ縺ソ蟇セ雎。 + /// 2繝舌う繝域枚蟄励r繧ィ繝ウ繧ウ繝シ繝峨☆繧九°蜷ヲ縺九r謖螳壹☆繧九ヵ繝ゥ繧ー + public void write( TextMemoryStream sw, boolean encode ) { + sw.writeLine( this.toString( encode ) ); + } + + + /// + /// FileStream縺九i隱ュ縺ソ霎シ縺ソ縺ェ縺後i繧ウ繝ウ繧ケ繝医Λ繧ッ繝 + /// + /// 隱ュ縺ソ霎シ縺ソ蟇セ雎。 + public VsqHandle( TextMemoryStream sr, int value, TextResult last_line ) { + this.Index = value; + String[] spl; + String[] spl2; + + // default蛟、縺ァ譴 + this.Type = VsqHandleType.Vibrato; + IconID = ""; + IDS = "normal"; + L0 = new Lyric( "" ); + Original = 0; + Caption = ""; + Length = 0; + StartDepth = 0; + DepthBPNum = 0; + DepthBPX = null; + DepthBPY = null; + StartRate = 0; + RateBPNum = 0; + RateBPX = null; + RateBPY = null; + Language = 0; + Program = 0; + + String tmpDepthBPX = ""; + String tmpDepthBPY = ""; + String tmpRateBPX = ""; + String tmpRateBPY = ""; + + // "["縺ォ縺カ縺。蠖薙◆繧九∪縺ァ隱ュ霎シ繧 + last_line.set( sr.readLine() ); + while ( !last_line.get().startsWith( "[" ) ) { + spl = last_line.get().split( "=" ); + if ( spl[0].equals( "Language" ) ) { + Language = Integer.parseInt( spl[1] ); + } else if ( spl[0].endsWith( "Program" ) ) { + Program = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "IconID" ) ) { + IconID = spl[1]; + } else if ( spl[0].equals( "IDS" ) ) { + IDS = spl[1]; + } else if ( spl[0].equals( "Original" ) ) { + Original = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "Caption" ) ) { + Caption = spl[1]; + for ( int i = 2; i < spl.length; i++ ) { + Caption += "=" + spl[i]; + } + } else if ( spl[0].equals( "Length" ) ) { + Length = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "StartDepth" ) ) { + StartDepth = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "DepthBPNum" ) ) { + DepthBPNum = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "DepthBPX" ) ) { + tmpDepthBPX = spl[1]; + } else if ( spl[0].equals( "DepthBPY" ) ) { + tmpDepthBPY = spl[1]; + } else if ( spl[0].equals( "StartRate" ) ) { + StartRate = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "RateBPNum" ) ) { + RateBPNum = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "RateBPX" ) ) { + tmpRateBPX = spl[1]; + } else if ( spl[0].equals( "RateBPY" ) ) { + tmpRateBPY = spl[1]; + } else if ( spl[0].equals( "L0" ) ) { + Type = VsqHandleType.Lyric; + L0 = new Lyric( spl[1] ); + } + if ( sr.peek() < 0 ) { + break; + } + last_line.set( sr.readLine() ); + } + if ( IDS != "normal" ) { + Type = VsqHandleType.Singer; + } else if ( IconID != "" ) { + Type = VsqHandleType.Vibrato; + } else { + Type = VsqHandleType.Lyric; + } + + // RateBPX, RateBPY縺ョ險ュ螳 + if ( this.Type == VsqHandleType.Vibrato ) { + if ( RateBPNum > 0 ) { + RateBPX = new float[RateBPNum]; + spl2 = tmpRateBPX.split( "," ); + for ( int i = 0; i < RateBPNum; i++ ) { + RateBPX[i] = Float.parseFloat( spl2[i] ); + } + + RateBPY = new int[RateBPNum]; + spl2 = tmpRateBPY.split( "," ); + for ( int i = 0; i < RateBPNum; i++ ) { + RateBPY[i] = Integer.parseInt( spl2[i] ); + } + } else { + RateBPX = null; + RateBPY = null; + } + + // DepthBPX, DepthBPY縺ョ險ュ螳 + if ( DepthBPNum > 0 ) { + DepthBPX = new float[DepthBPNum]; + spl2 = tmpDepthBPX.split( "," ); + for ( int i = 0; i < DepthBPNum; i++ ) { + DepthBPX[i] = Float.parseFloat( spl2[i] ); + } + + DepthBPY = new int[DepthBPNum]; + spl2 = tmpDepthBPY.split( "," ); + for ( int i = 0; i < DepthBPNum; i++ ) { + DepthBPY[i] = Integer.parseInt( spl2[i] ); + } + } else { + DepthBPX = null; + DepthBPY = null; + } + } + + } + + /// + /// 繝上Φ繝峨Ν謖螳壼ュ撰シ井セ九∴縺ー"h#0123"縺ィ縺縺譁蟄怜暦シ峨°繧峨ワ繝ウ繝峨Ν逡ェ蜿キ繧貞叙蠕励@縺セ縺 + /// + /// 繝上Φ繝峨Ν謖螳壼ュ + /// 繝上Φ繝峨Ν逡ェ蜿キ + public static int HandleIndexFromString( String _String ) { + String[] spl = _String.split( "#" ); + return Integer.parseInt( spl[1] ); + } + + + /// + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + /// + /// 蜃コ蜉帛 + public void Print( java.io.BufferedWriter sw ) throws IOException { + String result = this.toString(); + sw.write( result + "\n" ); + } + + + /// + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧偵さ繝ウ繧ス繝シ繝ォ逕サ髱「縺ォ蜃コ蜉帙@縺セ縺 + /// + private void Print() { + String result = this.toString(); + System.out.println( result ); + } + + + /// + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧呈枚蟄怜励↓螟画鋤縺励∪縺 + /// + /// 2繝舌う繝域枚蟄励r繧ィ繝ウ繧ウ繝シ繝峨☆繧九°蜷ヲ縺九r謖螳壹☆繧九ヵ繝ゥ繧ー + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧貞、画鋤縺励◆譁蟄怜 + public String toString( boolean encode ) { + String result = ""; + result += "[h#" + (new DecimalFormat( "0000" )).format( Index ) + "]"; + switch ( Type ) { + case Lyric: + result += "\nL0=" + L0.toString( encode ); + break; + case Vibrato: + DecimalFormat df = new DecimalFormat( "0.000000" ); + 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=" + DepthBPNum + "\n"; + if ( DepthBPNum > 0 ) { + result += "DepthBPX=" + df.format( DepthBPX[0] ); + for ( int i = 1; i < DepthBPNum; i++ ) { + result += "," + df.format( DepthBPX[i] ); + } + result += "\n" + "DepthBPY=" + DepthBPY[0]; + for ( int i = 1; i < DepthBPNum; i++ ) { + result += "," + DepthBPY[i]; + } + result += "\n"; + } + result += "StartRate=" + StartRate + "\n"; + result += "RateBPNum=" + RateBPNum; + if ( RateBPNum > 0 ) { + result += "\n" + "RateBPX=" + df.format( RateBPX[0] ); + for ( int i = 1; i < RateBPNum; i++ ) { + result += "," + df.format( RateBPX[i] ); + } + result += "\n" + "RateBPY=" + RateBPY[0]; + for ( int i = 1; i < RateBPNum; i++ ) { + result += "," + RateBPY[i]; + } + } + break; + case Singer: + result += "\n" + "IconID=" + 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; + default: + break; + } + return result; + + } + +} + diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandleType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandleType.java new file mode 100644 index 0000000..fcee3f0 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqHandleType.java @@ -0,0 +1,24 @@ +/* + * VibratoHandleType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public enum VsqHandleType { + Lyric, + Vibrato, + Singer +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqID.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqID.java new file mode 100644 index 0000000..11b5c5b --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqID.java @@ -0,0 +1,209 @@ +/* + * VsqID.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.text.*; +/// +/// 繝。繧ソ繝繧ュ繧ケ繝医↓蝓九a霎シ縺セ繧後kID繧定。ィ縺吶け繝ゥ繧ケ縲 +/// + +public class VsqID implements Cloneable { + public int value; + public VsqIDType type; + public int IconHandle_index; + public IconHandle IconHandle; + public int Length; + public int Note; + public int Dynamics; + public int PMBendDepth; + public int PMBendLength; + public int PMbPortamentoUse; + public int DEMdecGainRate; + public int DEMaccent; + public int LyricHandle_index; + public LyricHandle LyricHandle; + public int VibratoHandle_index; + public VibratoHandle VibratoHandle; + public int VibratoDelay; + public static VsqID EOS = new VsqID( -1 ); + + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ邁。譏薙さ繝斐シ繧貞叙蠕励@縺セ縺吶 + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ邁。譏薙さ繝斐シ + public Object clone() { + VsqID result = new VsqID( this.value ); + result.type = this.type; + if ( this.IconHandle != null ) { + result.IconHandle = (IconHandle)this.IconHandle.clone(); + } + result.Length = this.Length; + result.Note = this.Note; + result.Dynamics = this.Dynamics; + result.PMBendDepth = this.PMBendDepth; + result.PMBendLength = this.PMBendLength; + result.PMbPortamentoUse = this.PMbPortamentoUse; + result.DEMdecGainRate = this.DEMdecGainRate; + result.DEMaccent = this.DEMaccent; + if ( this.LyricHandle != null ) { + result.LyricHandle = (LyricHandle)this.LyricHandle.clone(); + } + if ( this.VibratoHandle != null ) { + result.VibratoHandle = (VibratoHandle)this.VibratoHandle.clone(); + } + result.VibratoDelay = this.VibratoDelay; + return result; + } + + + /// + /// ID縺ョ逡ェ蜿キシID#****縺ョ****シ峨r謖螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ縲 + /// + /// ID縺ョ逡ェ蜿キ + public VsqID( int a_value ) { + value = a_value; + } + + + /// + /// 繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 隱ュ縺ソ霎シ縺ソ蟇セ雎。 + /// + /// 隱ュ縺ソ霎シ繧薙□譛蠕後ョ陦後′霑斐&繧後∪縺 + public VsqID( TextMemoryStream sr, int value, TextResult last_line ) { + String[] spl; + this.value = value; + this.type = VsqIDType.Unknown; + this.IconHandle_index = -2; + this.LyricHandle_index = -1; + this.VibratoHandle_index = -1; + this.Length = 0; + this.Note = 0; + this.Dynamics = 0; + this.PMBendDepth = 0; + this.PMBendLength = 0; + this.PMbPortamentoUse = 0; + this.DEMdecGainRate = 0; + this.DEMaccent = 0; + //this.LyricHandle_index = -2; + //this.VibratoHandle_index = -2; + this.VibratoDelay = 0; + last_line.set( sr.readLine() ); + while ( !last_line.get().startsWith( "[" ) ) { + spl = last_line.get().split( "=" ); + if ( spl[0].equals( "Type" ) ) { + if ( spl[1].equals( "Anote" ) ) { + type = VsqIDType.Anote; + } else if ( spl[1].equals( "Singer" ) ) { + type = VsqIDType.Singer; + } else { + type = VsqIDType.Unknown; + } + } else if ( spl[0].equals( "Length" ) ) { + this.Length = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "Note#" ) ) { + this.Note = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "Dynamics" ) ) { + this.Dynamics = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "PMBendDepth" ) ) { + this.PMBendDepth = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "PMBendLength" ) ) { + this.PMBendLength = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "DEMdecGainRate" ) ) { + this.DEMdecGainRate = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "DEMaccent" ) ) { + this.DEMaccent = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "LyricHandle" ) ) { + this.LyricHandle_index = VsqHandle.HandleIndexFromString( spl[1] ); + + } else if ( spl[0].equals( "IconHandle" ) ) { + this.IconHandle_index = VsqHandle.HandleIndexFromString( spl[1] ); + } else if ( spl[0].equals( "VibratoHandle" ) ) { + this.VibratoHandle_index = VsqHandle.HandleIndexFromString( spl[1] ); + } else if ( spl[0].equals( "VibratoDelay" ) ) { + this.VibratoDelay = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "PMbPortamentoUse" ) ) { + PMbPortamentoUse = Integer.parseInt( spl[1] ); + } + if ( sr.peek() < 0 ) { + break; + } + last_line.set( sr.readLine() ); + } + } + + public String toString() { + String ret = "{Type=" + type; + DecimalFormat df = new DecimalFormat( "0000" ); + switch ( type ) { + case Anote: + ret += ", Length=" + Length; + ret += ", Note#=" + Note; + ret += ", Dynamics=" + Dynamics; + ret += ", PMBendDepth=" + PMBendDepth; + ret += ", PMBendLength=" + PMBendLength; + ret += ", PMbPortamentoUse=" + PMbPortamentoUse; + ret += ", DEMdecGainRate=" + DEMdecGainRate; + ret += ", DEMaccent=" + DEMaccent; + if ( LyricHandle != null ) { + ret += ", LyricHandle=h#" + df.format( LyricHandle_index ); + } + if ( VibratoHandle != null ) { + ret += ", VibratoHandle=h#" + df.format( VibratoHandle_index ); + ret += ", VibratoDelay=" + VibratoDelay; + } + break; + case Singer: + ret += ", IconHandle=h#" + df.format( IconHandle_index ); + break; + } + ret += "}"; + return ret; + } + + + /// + /// 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + /// + /// 蜃コ蜉帛 + public void write( TextMemoryStream sw ) { + DecimalFormat df = new DecimalFormat( "0000" ); + sw.writeLine( "[ID#" + df.format( value ) + "]" ); + sw.writeLine( "Type=" + type ); + switch ( type ) { + case Anote: + sw.writeLine( "Length=" + Length ); + sw.writeLine( "Note#=" + Note ); + sw.writeLine( "Dynamics=" + Dynamics ); + sw.writeLine( "PMBendDepth=" + PMBendDepth ); + sw.writeLine( "PMBendLength=" + PMBendLength ); + sw.writeLine( "PMbPortamentoUse=" + PMbPortamentoUse ); + sw.writeLine( "DEMdecGainRate=" + DEMdecGainRate ); + sw.writeLine( "DEMaccent=" + DEMaccent ); + if ( LyricHandle != null ) { + sw.writeLine( "LyricHandle=h#" + df.format( LyricHandle_index ) ); + } + if ( VibratoHandle != null ) { + sw.writeLine( "VibratoHandle=h#" + df.format( VibratoHandle_index ) ); + sw.writeLine( "VibratoDelay=" + VibratoDelay ); + } + break; + case Singer: + sw.writeLine( "IconHandle=h#" + df.format( IconHandle_index ) ); + break; + } + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqIDType.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqIDType.java new file mode 100644 index 0000000..5cfaa0d --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqIDType.java @@ -0,0 +1,24 @@ +/* + * VsqIDType.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +public enum VsqIDType { + Singer, + Anote, + Unknown +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMaster.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMaster.java new file mode 100644 index 0000000..3a0b51e --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMaster.java @@ -0,0 +1,69 @@ +/* + * VsqMaster.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.io.*; + +/** + * + * @author kbinani + */ +public class VsqMaster implements Cloneable { + public int PreMeasure; + + public Object clone() { + VsqMaster res = new VsqMaster( PreMeasure ); + return res; + } + + /** + * 繝励Μ繝。繧ク繝」繝シ蛟、繧呈欠螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ + */ + public VsqMaster( int pre_measure ) { + this.PreMeasure = pre_measure; + } + + /** + * 繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + * @param sr 隱ュ縺ソ霎シ縺ソ蜈 + * @param last_line 譛蠕後↓隱ュ縺ソ霎シ繧薙□陦後′霑斐&繧後∪縺 + * @throws java.lang.Exception + */ + public VsqMaster( TextMemoryStream sr, TextResult last_line ) { + PreMeasure = 0; + String[] spl; + last_line.set( sr.readLine() ); + while ( !last_line.get().startsWith( "[" ) ) { + spl = last_line.get().split( "=" ); + if ( spl[0].equals( "PreMeasure" ) ) { + this.PreMeasure = Integer.valueOf( spl[1] ); + break; + } + if ( sr.peek() < 0 ) { + break; + } + last_line.set( sr.readLine() ); + } + } + + /** + * 繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ蜀螳ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + * @param sw蜃コ蜉帛 + */ + public void write( TextMemoryStream sw ){ + sw.writeLine( "[Master]" ); + sw.writeLine( "PreMeasure=" + PreMeasure ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMetaText.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMetaText.java new file mode 100644 index 0000000..9b56917 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMetaText.java @@ -0,0 +1,911 @@ +/* + * VsqMetaText.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +import java.text.*; +import java.awt.*; + +/** + * vsq縺ョ繝。繧ソ繝繧ュ繧ケ繝医ョ荳ュ霄ォ繧貞ヲ逅縺吶k縺溘a縺ョ繧ッ繝ゥ繧ケ + * @author kbinani + */ +public class VsqMetaText implements Cloneable { + protected VsqCommon common; + protected VsqMaster master; + protected VsqMixer mixer; + //private List m_events; + private VsqEventList m_events; + //private List m_another_events; + /// + /// PIT縲ゅヴ繝繝√吶Φ繝峨Eefault=0 + /// + private VsqBPList pitchBendBPList; + /// + /// PBS縲ゅヴ繝繝√吶Φ繝峨そ繝ウ繧キ繝繧」繝薙ユ繧」縲Efault=2 + /// + private VsqBPList pitchBendSensBPList; + /// + /// DYN縲ゅム繧、繝翫Α繧ッ繧ケ縲Eefault=64 + /// + private VsqBPList dynamicsBPList; + /// + /// BRE縲ゅヶ繝ャ繧キ繝阪せ縲Eefault=0 + /// + private VsqBPList epRResidualBPList; + /// + /// BRI縲ゅヶ繝ゥ繧、繝医ロ繧ケ縲Eefault=64 + /// + private VsqBPList epRESlopeBPList; + /// + /// CLE縲ゅけ繝ェ繧「繝阪せ縲Eefault=0 + /// + private VsqBPList epRESlopeDepthBPList; + private VsqBPList reso1FreqBPList; + private VsqBPList reso2FreqBPList; + private VsqBPList reso3FreqBPList; + private VsqBPList reso4FreqBPList; + private VsqBPList reso1BWBPList; + private VsqBPList reso2BWBPList; + private VsqBPList reso3BWBPList; + private VsqBPList reso4BWBPList; + private VsqBPList reso1AmpBPList; + private VsqBPList reso2AmpBPList; + private VsqBPList reso3AmpBPList; + private VsqBPList reso4AmpBPList; + /// + /// GEN縲ゅず繧ァ繝ウ繝繝シ繝輔ぃ繧ッ繧ソ繝シ縲Eefault=64 + /// + private VsqBPList genderFactorBPList; + /// + /// POR縲ゅ昴Ν繧ソ繝。繝ウ繝医ち繧、繝溘Φ繧ー縲Eefault=64 + /// + private VsqBPList portamentoTimingBPList; + /// + /// OPE縲ゅが繝シ繝励ル繝ウ繧ー縲Eefault=127 + /// + private VsqBPList openingBPList; + + public Object clone() { + VsqMetaText res = new VsqMetaText(); + if ( common != null ) { + res.common = (VsqCommon)common.clone(); + } + if ( master != null ) { + res.master = (VsqMaster)master.clone(); + } + if ( mixer != null ) { + res.mixer = (VsqMixer)mixer.clone(); + } + if ( m_events != null ) { + res.m_events = new VsqEventList();// List(); + + for ( Iterator itr = m_events.iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + res.m_events.add( (VsqEvent)item.clone() ); + } + } + /*if ( m_another_events != null ) { + res.m_another_events = new List(); + foreach ( VsqEvent item in m_another_events ) { + res.m_another_events.Add( (VsqEvent)item.clone() ); + } + }*/ + if ( pitchBendBPList != null ) { + res.pitchBendBPList = (VsqBPList)pitchBendBPList.clone(); + } + if ( pitchBendSensBPList != null ) { + res.pitchBendSensBPList = (VsqBPList)pitchBendSensBPList.clone(); + } + if ( dynamicsBPList != null ) { + res.dynamicsBPList = (VsqBPList)dynamicsBPList.clone(); + } + if ( epRResidualBPList != null ) { + res.epRResidualBPList = (VsqBPList)epRResidualBPList.clone(); + } + if ( epRESlopeBPList != null ) { + res.epRESlopeBPList = (VsqBPList)epRESlopeBPList.clone(); + } + if ( epRESlopeDepthBPList != null ) { + res.epRESlopeDepthBPList = (VsqBPList)epRESlopeDepthBPList.clone(); + } + if ( reso1FreqBPList != null ) { + res.reso1FreqBPList = (VsqBPList)reso1FreqBPList.clone(); + } + if ( reso2FreqBPList != null ) { + res.reso2FreqBPList = (VsqBPList)reso2FreqBPList.clone(); + } + if ( reso3FreqBPList != null ) { + res.reso3FreqBPList = (VsqBPList)reso3FreqBPList.clone(); + } + if ( reso4FreqBPList != null ) { + res.reso4FreqBPList = (VsqBPList)reso4FreqBPList.clone(); + } + if ( reso1BWBPList != null ) { + res.reso1BWBPList = (VsqBPList)reso1BWBPList.clone(); + } + if ( reso2BWBPList != null ) { + res.reso2BWBPList = (VsqBPList)reso2BWBPList.clone(); + } + if ( reso3BWBPList != null ) { + res.reso3BWBPList = (VsqBPList)reso3BWBPList.clone(); + } + if ( reso4BWBPList != null ) { + res.reso4BWBPList = (VsqBPList)reso4BWBPList.clone(); + } + if ( reso1AmpBPList != null ) { + res.reso1AmpBPList = (VsqBPList)reso1AmpBPList.clone(); + } + if ( reso2AmpBPList != null ) { + res.reso2AmpBPList = (VsqBPList)reso2AmpBPList.clone(); + } + if ( reso3AmpBPList != null ) { + res.reso3AmpBPList = (VsqBPList)reso3AmpBPList.clone(); + } + if ( reso4AmpBPList != null ) { + res.reso4AmpBPList = (VsqBPList)reso4AmpBPList.clone(); + } + if ( genderFactorBPList != null ) { + res.genderFactorBPList = (VsqBPList)genderFactorBPList.clone(); + } + if ( portamentoTimingBPList != null ) { + res.portamentoTimingBPList = (VsqBPList)portamentoTimingBPList.clone(); + } + if ( openingBPList != null ) { + res.openingBPList = (VsqBPList)openingBPList.clone(); + } + return res; + } + + +// public List Events { + public VsqEventList getEventList() { + return m_events; + } + + + /*public List AnotherEvents { + get { + return m_another_events; + } + }*/ + public VsqBPList getVsqBPList( VsqCurveType type ) { + switch ( type ) { + case BRE: + return this.epRResidualBPList; + case BRI: + return this.epRESlopeBPList; + case CLE: + return this.epRESlopeDepthBPList; + case DYN: + return this.dynamicsBPList; + case GEN: + return this.genderFactorBPList; + case OPE: + return this.openingBPList; + case PBS: + return this.pitchBendSensBPList; + case PIT: + return this.pitchBendBPList; + case POR: + return this.portamentoTimingBPList; + default: + return null; + } + } + + public void setVsqBPList( VsqCurveType type, VsqBPList value ) { + switch ( type ) { + case BRE: + this.epRResidualBPList = value; + break; + case BRI: + this.epRESlopeBPList = value; + break; + case CLE: + this.epRESlopeDepthBPList = value; + break; + case DYN: + this.dynamicsBPList = value; + break; + case GEN: + this.genderFactorBPList = value; + break; + case OPE: + this.openingBPList = value; + break; + case PBS: + this.pitchBendSensBPList = value; + break; + case PIT: + this.pitchBendBPList = value; + break; + case POR: + this.portamentoTimingBPList = value; + break; + } + } + + /*// + /// LyricEvents逕ィ縺ォ菴ソ逕ィ縺ァ縺阪k遨コ縺巧D逡ェ蜿キ繧貞叙蠕励@縺セ縺呻シ始ext=0縺ョ譎ゅッ谺。縺ォ蛻ゥ逕ィ蜿ッ閭ス縺ェIDシ系ext=1縺ッシ系ext=0縺ィ縺励※蠕励i繧後kID繧剃スソ逕ィ縺励◆蠕悟茜逕ィ蜿ッ閭ス縺ェIDシ憩tc.. + /// + /// + private int GetNextId_( int next ) { + int index = -1; + int count = m_events.Count; + boolean[] list = new boolean[count]; + for ( int i = 0; i < count; i++ ) { + list[i] = false; + } + for ( int i = 0; i < count; i++ ) { + if ( 0 <= m_events[i].InternalID && m_events[i].InternalID < count ) { + list[i] = true; + } + } + int j = -1; + for ( int i = 0; i < count; i++ ) { + if ( !list[i] ) { + j++; + if ( j == next ) { + return i; + } + } + } + return count + next + 1; + } + private int GetNextId( int next ) { + int index = -1; + List current = new List(); + for ( int i = 0; i < m_events.Count; i++ ) { + current.Add( m_events[i].InternalID ); + } + int nfound = 0; + while ( true ) { + index++; + boolean found = false; + for ( int i = 0; i < current.Count; i++ ) { + if ( index == current[i] ) { + found = true; + break; + } + } + if ( !found ) { + nfound++; + if ( nfound == next + 1 ) { + return index; + } else { + current.Add( index ); + } + } + } + }*/ + /*// + /// AnotherEvents逕ィ縺ォ菴ソ逕ィ縺ァ縺阪k谺。縺ョ遨コ縺巧D逡ェ蜿キ繧貞叙蠕励@縺セ縺 + /// + /// + public int GetNextIdForAnotherEvent( int next ) { + int index = -1; + List current = new List(); + for ( int i = 0; i < m_another_events.Count; i++ ) { + current.Add( m_another_events[i].InternalID ); + } + int nfound = 0; + while ( true ) { + index++; + boolean found = false; + for ( int i = 0; i < current.Count; i++ ) { + if ( index == current[i] ) { + found = true; + break; + } + } + if ( !found ) { + nfound++; + if ( nfound == next + 1 ) { + return index; + } else { + current.Add( index ); + } + } + } + }*/ +/// +/// Editor逕サ髱「荳翫〒荳翫°繧永ndex逡ェ逶ョ縺ョ繧ォ繝シ繝悶r陦ィ縺傳PList繧呈アゅa縺セ縺 +/// +/// +/// + /*public VsqBPList GetCurve( + int index ) { + switch ( index ) { + case 1: + return DYN; + case 2: + return BRE; + case 3: + return BRI; + case 4: + return CLE; + case 5: + return OPE; + case 6: + return GEN; + case 7: + return POR; + case 8: + return PIT; + case 9: + return PBS; + default: + return null; + } + + }*/ + /// + /// Editor逕サ髱「荳翫〒荳翫°繧永ndex逡ェ逶ョ縺ョ繧ォ繝シ繝悶ョ蜷榊燕繧定ェソ縺ケ縺セ縺 + /// + /// + /// + public static String getCurveName( int index ) { + switch ( index ) { + case 0: + return "VEL"; + case 1: + return "DYN"; + case 2: + return "BRE"; + case 3: + return "BRI"; + case 4: + return "CLE"; + case 5: + return "OPE"; + case 6: + return "GEN"; + case 7: + return "POR"; + case 8: + return "PIT"; + case 9: + return "PBS"; + default: + return ""; + } + + } + + /// + /// Singer繝励Ο繝代ユ繧」縺ォ謖螳壹&繧後※縺繧 + /// + public String getSinger() { + for ( Iterator itr = m_events.iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.ID.type == VsqIDType.Singer ) { + return item.ID.IconHandle.IDS; + } + } + return ""; + } + + public void setSinger( String value ) { + for ( Iterator itr = m_events.iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + if ( item.ID.type == VsqIDType.Singer ) { + item.ID.IconHandle.IDS = value; + break; + } + } + } + + /// + /// EOS繧、繝吶Φ繝医′險倬鹸縺輔l縺ヲ縺繧九け繝ュ繝繧ッ繧貞叙蠕励@縺セ縺吶 + /// + /// + public int getIndexOfEos() { + int result; + if ( m_events.size() > 0 ) { + int ilast = m_events.size() - 1; + result = m_events.get( ilast ).Clock; + } else { + result = -1; + } + + return result; + } + + /** + * 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺九i縲!D縺ィHandle縺ョ繝ェ繧ケ繝医r讒狗ッ峨@縺セ縺 + * + *@param id + *@param handle + **/ + private void buildIdHandleList( Vector id, Vector handle ) { + id = new Vector(); + handle = new Vector(); + int current_id = -1; + int current_handle = -1; + Vector events = new Vector(); + for ( Iterator itr = m_events.iterator(); itr.hasNext();) { + VsqEvent item = (VsqEvent)itr.next(); + events.add( item ); + } + Collections.sort( events ); + for ( int i = 0; i < events.size(); i++ ) { + VsqEvent item = events.get( i ); + VsqID id_item = (VsqID)item.ID.clone(); + current_id++; + item.ID.value = current_id; + id_item.value = current_id; + // IconHandle + if ( item.ID.IconHandle != null ) { + current_handle++; + VsqHandle handle_item = (VsqHandle)item.ID.IconHandle.clone(); + handle_item.Index = current_handle; + handle.add( handle_item ); + id_item.IconHandle_index = current_handle; + } + + // LyricHandle + if ( item.ID.LyricHandle != null ) { + current_handle++; + VsqHandle handle_item = (VsqHandle)item.ID.LyricHandle.clone(); + handle_item.Index = current_handle; + handle.add( handle_item ); + id_item.LyricHandle_index = current_handle; + } + + // VibratoHandle + if ( item.ID.VibratoHandle != null ) { + current_handle++; + VsqHandle handle_item = (VsqHandle)item.ID.VibratoHandle.clone(); + handle_item.Index = current_handle; + handle.add( handle_item ); + id_item.VibratoHandle_index = current_handle; + } + + id.add( id_item ); + } + + } + + + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョ蜀螳ケ繧呈欠螳壹&繧後◆繝輔ぃ繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺吶 + /// + /// + /// + public void print( TextMemoryStream sw, boolean encode, long eos, int start ) { + //using ( StreamWriter sw = new StreamWriter( fpath ) ) { + if ( common != null ) { + common.write( sw ); + } + + if ( master != null ) { + master.write( sw ); + } + + if ( mixer != null ) { + mixer.write( sw ); + } + + Vector id = null; + Vector handle = null; + buildIdHandleList( id, handle ); + writeEventList( sw, eos ); + int i; + for ( i = 0; i < id.size(); i++ ) { + id.get( i ).write( sw ); + } + + for ( i = 0; i < handle.size(); i++ ) { + handle.get( i ).write( sw, encode ); + } + + if ( pitchBendBPList.size() > 0 ) { + pitchBendBPList.print( sw, start, "[PitchBendBPList]" ); + } + + if ( pitchBendSensBPList.size() > 0 ) { + pitchBendSensBPList.print( sw, start, "[PitchBendSensBPList]" ); + } + + if ( dynamicsBPList.size() > 0 ) { + dynamicsBPList.print( sw, start, "[DynamicsBPList]" ); + } + + if ( epRResidualBPList.size() > 0 ) { + epRResidualBPList.print( sw, start, "[EpRResidualBPList]" ); + } + + if ( epRESlopeBPList.size() > 0 ) { + epRESlopeBPList.print( sw, start, "[EpRESlopeBPList]" ); + } + + if ( epRESlopeDepthBPList.size() > 0 ) { + epRESlopeDepthBPList.print( sw, start, "[EpRESlopeDepthBPList]" ); + } + + if ( reso1FreqBPList.size() > 0 ) { + reso1FreqBPList.print( sw, start, "[Reso1FreqBPList]" ); + } + + if ( reso2FreqBPList.size() > 0 ) { + reso2FreqBPList.print( sw, start, "[Reso2FreqBPList]" ); + } + + if ( reso3FreqBPList.size() > 0 ) { + reso3FreqBPList.print( sw, start, "[Reso3FreqBPList]" ); + } + + if ( reso4FreqBPList.size() > 0 ) { + reso4FreqBPList.print( sw, start, "[Reso4FreqBPList]" ); + } + + if ( reso1BWBPList.size() > 0 ) { + reso1BWBPList.print( sw, start, "[Reso1BWBPList]" ); + } + + if ( reso2BWBPList.size() > 0 ) { + reso2BWBPList.print( sw, start, "[Reso2BWBPList]" ); + } + + if ( reso3BWBPList.size() > 0 ) { + reso3BWBPList.print( sw, start, "[Reso3BWBPList]" ); + } + + if ( reso4BWBPList.size() > 0 ) { + reso4BWBPList.print( sw, start, "[Reso4BWBPList]" ); + } + + if ( reso1AmpBPList.size() > 0 ) { + reso1AmpBPList.print( sw, start, "[Reso1AmpBPList]" ); + } + + if ( reso2AmpBPList.size() > 0 ) { + reso2AmpBPList.print( sw, start, "[Reso2AmpBPList]" ); + } + + if ( reso3AmpBPList.size() > 0 ) { + reso3AmpBPList.print( sw, start, "[Reso3AmpBPList]" ); + } + + if ( reso4AmpBPList.size() > 0 ) { + reso4AmpBPList.print( sw, start, "[Reso4AmpBPList]" ); + } + + if ( genderFactorBPList.size() > 0 ) { + genderFactorBPList.print( sw, start, "[GenderFactorBPList]" ); + } + + if ( portamentoTimingBPList.size() > 0 ) { + portamentoTimingBPList.print( sw, start, "[PortamentoTimingBPList]" ); + } + + if ( openingBPList.size() > 0 ) { + openingBPList.print( sw, start, "[OpeningBPList]" ); + } +//} + + } + + private void writeEventList( TextMemoryStream sw, long eos ) { + sw.writeLine( "[EventList]" ); + Vector temp = new Vector(); + /*foreach ( VsqEvent item in m_another_events ) { + temp.Add( item ); + }*/ + for ( Iterator itr = m_events.iterator(); itr.hasNext();) { + temp.add( (VsqEvent)itr.next() ); + } + + Collections.sort( temp ); + int i = 0; + DecimalFormat df = new DecimalFormat( "0000" ); + while ( i < temp.size() ) { + VsqEvent item = temp.get( i ); + if ( !item.ID.equals( VsqID.EOS ) ) { + String ids = "ID#" + df.format( i ); + int clock = temp.get( i ).Clock; + while ( i + 1 < temp.size() && clock == temp.get( i + 1 ).Clock ) { + i++; + ids += ",ID#" + df.format( i ); + } + + sw.writeLine( clock + "=" + ids ); + } + + i++; + } + + sw.writeLine( eos + "=EOS" ); + } + + +/// +/// 菴輔b辟。縺ХsqMetaText繧呈ァ狗ッ峨☆繧九ゅ%繧後ッ縲`aster Track逕ィ縺ョMetaText縺ィ縺励※縺ョ縺ソ菴ソ逕ィ縺輔l繧九∋縺 +/// + public VsqMetaText() { + } + + + /// + /// 譛蛻昴ョ繝医Λ繝繧ッ莉・螟悶ョ荳闊ャ縺ョ繝。繧ソ繝繧ュ繧ケ繝医r讒狗ッ峨(Master縺御ス懊i繧後↑縺) + /// + public VsqMetaText( String name, String singer ) { + this( name, 0, singer, false ); + } + + + /// + /// 譛蛻昴ョ繝医Λ繝繧ッ縺ョ繝。繧ソ繝繧ュ繧ケ繝医r讒狗ッ峨(Master縺御ス懊i繧後k) + /// + /// + public VsqMetaText( String name, String singer, int pre_measure ) { + this( name, pre_measure, singer, true ); + } + + private VsqMetaText( String name, int pre_measure, String singer, boolean is_first_track ) { + common = new VsqCommon( name, new Color( 179, 181, 123 ), 1, 1 ); + pitchBendBPList = new VsqBPList( 0, -8192, 8192 ); + pitchBendBPList.add( 0, pitchBendBPList.getDefault() ); + + pitchBendSensBPList = new VsqBPList( 2, 0, 24 ); + pitchBendSensBPList.add( 0, pitchBendSensBPList.getDefault() ); + + dynamicsBPList = new VsqBPList( 64, 0, 127 ); + dynamicsBPList.add( 0, dynamicsBPList.getDefault() ); + + epRResidualBPList = new VsqBPList( 0, 0, 127 ); + epRResidualBPList.add( 0, epRResidualBPList.getDefault() ); + + epRESlopeBPList = new VsqBPList( 64, 0, 127 ); + epRESlopeBPList.add( 0, epRESlopeBPList.getDefault() ); + + epRESlopeDepthBPList = new VsqBPList( 0, 0, 127 ); + epRESlopeDepthBPList.add( 0, epRESlopeDepthBPList.getDefault() ); + + reso1FreqBPList = new VsqBPList( 255, 0, 255 ); + reso1FreqBPList.add( 0, reso1FreqBPList.getDefault() ); + + reso2FreqBPList = new VsqBPList( 255, 0, 255 ); + reso2FreqBPList.add( 0, reso2FreqBPList.getDefault() ); + + reso3FreqBPList = new VsqBPList( 255, 0, 255 ); + reso3FreqBPList.add( 0, reso3FreqBPList.getDefault() ); + + reso4FreqBPList = new VsqBPList( 255, 0, 255 ); + reso4FreqBPList.add( 0, reso4FreqBPList.getDefault() ); + + reso1BWBPList = new VsqBPList( 255, 0, 255 ); + reso1BWBPList.add( 0, reso1BWBPList.getDefault() ); + + reso2BWBPList = new VsqBPList( 255, 0, 255 ); + reso2BWBPList.add( 0, reso2BWBPList.getDefault() ); + + reso3BWBPList = new VsqBPList( 255, 0, 255 ); + reso3BWBPList.add( 0, reso3BWBPList.getDefault() ); + + reso4BWBPList = new VsqBPList( 255, 0, 255 ); + reso4BWBPList.add( 0, reso4BWBPList.getDefault() ); + + reso1AmpBPList = new VsqBPList( 255, 0, 255 ); + reso1AmpBPList.add( 0, reso1AmpBPList.getDefault() ); + + reso2AmpBPList = new VsqBPList( 255, 0, 255 ); + reso2AmpBPList.add( 0, reso2AmpBPList.getDefault() ); + + reso3AmpBPList = new VsqBPList( 255, 0, 255 ); + reso3AmpBPList.add( 0, reso3AmpBPList.getDefault() ); + + reso4AmpBPList = new VsqBPList( 255, 0, 255 ); + reso4AmpBPList.add( 0, reso4AmpBPList.getDefault() ); + + genderFactorBPList = new VsqBPList( 64, 0, 127 ); + genderFactorBPList.add( 0, genderFactorBPList.getDefault() ); + + portamentoTimingBPList = new VsqBPList( 64, 0, 127 ); + portamentoTimingBPList.add( 0, portamentoTimingBPList.getDefault() ); + + openingBPList = new VsqBPList( 127, 0, 127 ); + openingBPList.add( 0, openingBPList.getDefault() ); + + if ( is_first_track ) { + master = new VsqMaster( pre_measure ); + } else { + master = null; + } + + m_events = new VsqEventList(); + //m_another_events = new List(); + VsqID id = new VsqID( 0 ); + id.type = VsqIDType.Singer; + id.IconHandle = new IconHandle(); + id.IconHandle.Type = VsqHandleType.Singer; + id.IconHandle.IconID = "$07010000"; + id.IconHandle.IDS = singer; + id.IconHandle.Original = 0; + id.IconHandle.Caption = ""; + id.IconHandle.Length = 1; + id.IconHandle.Language = 0; + id.IconHandle.Program = 0; + m_events.add( new VsqEvent( 0, id ) ); + } + + public VsqMetaText( TextMemoryStream sr ) { + Vector> t_event_list = new Vector>(); + //SortedDictionary t_event_list = new SortedDictionary(); + TreeMap __id = new TreeMap(); + TreeMap __handle = new TreeMap(); + pitchBendBPList = new VsqBPList( 0, -8192, 8192 ); + pitchBendSensBPList = new VsqBPList( 2, 0, 24 ); + dynamicsBPList = new VsqBPList( 64, 0, 127 ); + epRResidualBPList = new VsqBPList( 0, 0, 127 ); + epRESlopeBPList = new VsqBPList( 64, 0, 127 ); + epRESlopeDepthBPList = new VsqBPList( 0, 0, 127 ); + reso1FreqBPList = new VsqBPList( 255, 0, 255 ); + reso2FreqBPList = new VsqBPList( 255, 0, 255 ); + reso3FreqBPList = new VsqBPList( 255, 0, 255 ); + reso4FreqBPList = new VsqBPList( 255, 0, 255 ); + reso1BWBPList = new VsqBPList( 255, 0, 255 ); + reso2BWBPList = new VsqBPList( 255, 0, 255 ); + reso3BWBPList = new VsqBPList( 255, 0, 255 ); + reso4BWBPList = new VsqBPList( 255, 0, 255 ); + reso1AmpBPList = new VsqBPList( 255, 0, 255 ); + reso2AmpBPList = new VsqBPList( 255, 0, 255 ); + reso3AmpBPList = new VsqBPList( 255, 0, 255 ); + reso4AmpBPList = new VsqBPList( 255, 0, 255 ); + genderFactorBPList = new VsqBPList( 64, 0, 127 ); + portamentoTimingBPList = new VsqBPList( 64, 0, 127 ); + openingBPList = new VsqBPList( 127, 0, 127 ); + + TextResult last_line = new TextResult( "" ); + last_line.set( sr.readLine() ); + while ( true ) { + if ( last_line.get().length() == 0 ) { + break; + } + + if ( last_line.get().equals( "[Common]" ) ) { + common = new VsqCommon( sr, last_line ); + } else if ( last_line.get().equals( "[Master]" ) ) { + master = new VsqMaster( sr, last_line ); + } else if ( last_line.get().equals( "[Mixer]" ) ) { + mixer = new VsqMixer( sr, last_line ); + } else if ( last_line.get().equals( "[EventList]" ) ) { + last_line.set( sr.readLine() ); + while ( !last_line.get().startsWith( "[" ) ) { + String[] spl2 = last_line.get().split( "=" ); + int clock = Integer.parseInt( spl2[0] ); + int id_number = -1; + if ( spl2[1] != "EOS" ) { + String[] ids = spl2[1].split( "," ); + for ( int i = 0; i < ids.length; i++ ) { + String[] spl3 = ids[i].split( "#" ); + id_number = Integer.parseInt( spl3[1] ); + t_event_list.add( new KeyValuePair( clock, id_number ) ); + } + } else { + t_event_list.add( new KeyValuePair( clock, -1 ) ); + } + + if ( sr.peek() < 0 ) { + break; + } else { + last_line.set( sr.readLine() ); + } + + } + } else if ( last_line.get().equals( "[PitchBendBPList]" ) ) { + last_line.set( pitchBendBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[PitchBendSensBPList]" ) ) { + last_line.set( pitchBendSensBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[DynamicsBPList]" ) ) { + last_line.set( dynamicsBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[EpRResidualBPList]" ) ) { + last_line.set( epRResidualBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[EpRESlopeBPList]" ) ) { + last_line.set( epRESlopeBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[EpRESlopeDepthBPList]" ) ) { + last_line.set( epRESlopeDepthBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso1FreqBPList]" ) ) { + last_line.set( reso1FreqBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso2FreqBPList]" ) ) { + last_line.set( reso2FreqBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso3FreqBPList]" ) ) { + last_line.set( reso3FreqBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso4FreqBPList]" ) ) { + last_line.set( reso4FreqBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso1BWBPList]" ) ) { + last_line.set( reso1BWBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso2BWBPList]" ) ) { + last_line.set( reso2BWBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso3BWBPList]" ) ) { + last_line.set( reso3BWBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso4BWBPList]" ) ) { + last_line.set( reso4BWBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso1AmpBPList]" ) ) { + last_line.set( reso1AmpBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso2AmpBPList]" ) ) { + last_line.set( reso2AmpBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso3AmpBPList]" ) ) { + last_line.set( reso3AmpBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[Reso4AmpBPList]" ) ) { + last_line.set( reso4AmpBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[GenderFactorBPList]" ) ) { + last_line.set( genderFactorBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[PortamentoTimingBPList]" ) ) { + last_line.set( portamentoTimingBPList.readFrom( sr ) ); + } else if ( last_line.get().equals( "[OpeningBPList]" ) ) { + last_line.set( openingBPList.readFrom( sr ) ); + } else { + String buffer = last_line.get(); + buffer = + buffer.replace( "[", "" ); + buffer = + buffer.replace( "]", "" ); + String[] spl = buffer.split( "#" ); + int index = Integer.parseInt( spl[1] ); + if ( last_line.get().startsWith( "[ID#" ) ) { + __id.put( index, new VsqID( sr, index, last_line ) ); + } else if ( last_line.get().startsWith( "[h#" ) ) { + __handle.put( index, new VsqHandle( sr, index, last_line ) ); + } + + + + } + + if ( sr.peek() < 0 ) { + break; + } + + } + + // 縺セ縺喇andle繧段d縺ォ蝓九a霎シ縺ソ + for ( int i = 0; i < + __id.size(); i++ ) { + if ( __handle.containsKey( __id.get( i ).IconHandle_index ) ) { + __id.get( i ).IconHandle = __handle.get( __id.get( i ).IconHandle_index ).ConvertToIconHandle(); + } + + if ( __handle.containsKey( __id.get( i ).LyricHandle_index ) ) { + __id.get( i ).LyricHandle = __handle.get( __id.get( i ).LyricHandle_index ).ConvertToLyricHandle(); + } + + if ( __handle.containsKey( __id.get( i ).VibratoHandle_index ) ) { + __id.get( i ).VibratoHandle = __handle.get( __id.get( i ).VibratoHandle_index ).ConvertToVibratoHandle(); + } + + } + + // id繧弾ventList縺ォ蝓九a霎シ縺ソ + m_events = new VsqEventList();// List(); + //m_another_events = new List(); + + for ( int i = 0; i < t_event_list.size(); i++ ) { + KeyValuePair item = t_event_list.get( i ); + int clock = item.Key; + int id_number = item.Value; + if ( __id.containsKey( id_number ) ) { + //if ( __id[id_number].type == VsqIDType.Anote ) { + m_events.add( new VsqEvent( clock, (VsqID)__id.get( id_number ).clone() ) ); + //} else { + // m_another_events.Add( new VsqEvent( clock, (VsqID)__id[id_number].clone(), GetNextIdForAnotherEvent( 0 ) ) ); + //} + } + + } + } + +} + diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixer.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixer.java new file mode 100644 index 0000000..105b943 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixer.java @@ -0,0 +1,219 @@ +/* + * VsqMixer.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + +/// +/// vsq繝輔ぃ繧、繝ォ縺ョ繝。繧ソ繝繧ュ繧ケ繝医ョ[Mixer]繧サ繧ッ繧キ繝ァ繝ウ縺ォ險倬鹸縺輔l繧句螳ケ繧貞叙繧頑桶縺 +/// +public class VsqMixer implements Cloneable { + //private int MasterFeder; + public int MasterFeder; + //private int MasterPanpot; + public int MasterPanpot; + //private int MasterMute; + public int MasterMute; +//private int OutputMode; + public int OutputMode; +//public int Tracks; + /// + /// vsq繝輔ぃ繧、繝ォ縺ョ蜷繝医Λ繝繧ッ縺ョfader, panpot, mute縺翫h縺ウoutputmode蛟、繧剃ソ晄戟縺励∪縺 + /// + public Vector Slave = new Vector(); + + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ョSlave隕∫エ縺ォ菫晄戟縺輔l繧九い繧、繝繝縺ョ蛟区焚縲Wsq繝輔ぃ繧、繝ォ縺ョ"繝医Λ繝繧ッ謨ー - 1"縺ォ遲峨@縺 + /// + public int getTracks() { + return Slave.size(); + } + + + /*public property Vector Slave { + get { + return m_slave; + } + set { + m_slave = value; + } + };*/ + /*public property int MasterFeder { + get { + return MasterFeder; + } + set { + MasterFeder = value; + } + };*/ + /*public property int MasterPanpot { + get { + return MasterPanpot; + } + set { + MasterPanpot = value; + } + };*/ + /*public property int MasterMute { + get { + return MasterMute; + } + set { + MasterMute = value; + } + };*/ + /*public property int OutputMode { + get { + return MasterMute; + } + set { + MasterMute = value; + } + };*/ + public Object clone() { + VsqMixer res = new VsqMixer( MasterFeder, MasterPanpot, MasterMute, OutputMode ); + res.Slave = new Vector(); + //res.Tracks = Tracks; + for ( int i = 0; i < Slave.size(); i++ ) { + VsqMixerEntry item = Slave.get( i ); + res.Slave.add( (VsqMixerEntry) item.clone() ); + } + return res; + } + + + /// + /// 蜷繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// MasterFader蛟、 + /// MasterPanpot蛟、 + /// MasterMute蛟、 + /// OutputMode蛟、 + public VsqMixer( int master_fader, int master_panpot, int master_mute, int output_mode ) { + this.MasterFeder = master_fader; + this.MasterMute = master_mute; + this.MasterPanpot = master_panpot; + this.OutputMode = output_mode; + Slave = new Vector(); + } + + + /// + /// 繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 隱ュ縺ソ霎シ縺ソ蟇セ雎。 + /// 譛蠕後↓隱ュ縺ソ霎シ繧薙□陦後′霑斐&繧後∪縺 + public VsqMixer( TextMemoryStream sr, TextResult last_line ) { + MasterFeder = 0; + MasterPanpot = 0; + MasterMute = 0; + OutputMode = 0; + //Tracks = 1; + int tracks = 0; + String[] spl; + String buffer = ""; + last_line.set( sr.readLine() ); + while ( !last_line.get().startsWith( "[" ) ) { + spl = last_line.get().split( "=" ); + if ( spl[0].equals( "MasterFeder" ) ) { + MasterFeder = Integer.parseInt( spl[1] ); + } else if ( spl[0].equals( "MasterPanpot" ) ) { + MasterPanpot = Integer.parseInt( + spl[1] ); + } else if ( spl[0].equals( "MasterMute" ) ) { + MasterMute = Integer.parseInt( + spl[1] ); + } else if ( spl[0].equals( "OutputMode" ) ) { + OutputMode = Integer.parseInt( + spl[1] ); + } else if ( spl[0].equals( "Tracks" ) ) { + tracks = Integer.parseInt( + spl[1] ); + } else { + if ( spl[0].startsWith( "Feder" ) || + spl[0].startsWith( "Panpot" ) || + spl[0].startsWith( "Mute" ) || + spl[0].startsWith( "Solo" ) ) { + buffer += spl[0] + "=" + spl[1] + "\n"; + } + } + if ( sr.peek() < 0 ) { + break; + } + last_line.set( sr.readLine() ); + } + + Slave = new Vector(); + for ( int i = 0; i < tracks; i++ ) { + Slave.add( new VsqMixerEntry( 0, 0, 0, 0 ) ); + } + spl = buffer.split( "\n" ); + String[] spl2; + for ( int i = 0; i < spl.length; i++ ) { + String ind = ""; + int index; + spl2 = spl[i].split( "=" ); + if ( spl2[0].startsWith( "Feder" ) ) { + ind = spl2[0].replace( "Feder", "" ); + index = Integer.parseInt( + ind ); + Slave.get( index ).Feder = Integer.parseInt( + spl2[1] ); + } else if ( spl2[0].startsWith( "Panpot" ) ) { + ind = spl2[0].replace( "Panpot", "" ); + index = Integer.parseInt( + ind ); + Slave.get( index ).Panpot = Integer.parseInt( + spl2[1] ); + } else if ( spl2[0].startsWith( "Mute" ) ) { + ind = spl2[0].replace( "Mute", "" ); + index = Integer.parseInt( + ind ); + Slave.get( index ).Mute = Integer.parseInt( + spl2[1] ); + } else if ( spl2[0].startsWith( "Solo" ) ) { + ind = spl2[0].replace( "Solo", "" ); + index = Integer.parseInt( + ind ); + Slave.get( index ).Solo = Integer.parseInt( + spl2[1] ); + } + + } + } + + + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧偵ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ォ蜃コ蜉帙@縺セ縺 + /// + /// 蜃コ蜉帛ッセ雎。 + public void write( TextMemoryStream sw ) { + sw.writeLine( "[Mixer]" ); + sw.writeLine( "MasterFeder=" + MasterFeder ); + sw.writeLine( "MasterPanpot=" + MasterPanpot ); + sw.writeLine( "MasterMute=" + MasterMute ); + sw.writeLine( "OutputMode=" + OutputMode ); + sw.writeLine( "Tracks=" + getTracks() ); + for ( int i = 0; i < Slave.size(); i++ ) { + sw.writeLine( "Feder" + i + "=" + Slave.get( i ).Feder ); + sw.writeLine( "Panpot" + i + "=" + Slave.get( i ).Panpot ); + sw.writeLine( "Mute" + i + "=" + Slave.get( i ).Mute ); + sw.writeLine( "Solo" + i + "=" + Slave.get( i ).Solo ); + } + } + +} + + + diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixerEntry.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixerEntry.java new file mode 100644 index 0000000..f908f62 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqMixerEntry.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package jp.sourceforge.lipsync.vsq; + +/** + * + * @author kbinani + */ +/// +/// VsqMixer縺ョSlave隕∫エ縺ォ譬シ邏阪&繧後k蜷繧ィ繝ウ繝医Μ +/// +public class VsqMixerEntry implements Cloneable { + public int Feder; + public int Panpot; + public int Mute; + public int Solo; + + public Object clone() { + VsqMixerEntry res = new VsqMixerEntry( Feder, Panpot, Mute, Solo ); + return res; + } + + + /// + /// 蜷繝代Λ繝。繝シ繧ソ繧呈欠螳壹@縺溘さ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// Feder蛟、 + /// Panpot蛟、 + /// Mute蛟、 + /// Solo蛟、 + public VsqMixerEntry( int feder, int panpot, int mute, int solo ) { + this.Feder = feder; + this.Panpot = panpot; + this.Mute = mute; + this.Solo = solo; + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNote.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNote.java new file mode 100644 index 0000000..7cc8d55 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNote.java @@ -0,0 +1,239 @@ +/* + * VsqMixer.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/// +/// 髻ウ髫弱r陦ィ迴セ縺吶k縺溘a縺ョ繧ッ繝ゥ繧ケ +/// +public class VsqNote { + int _note; + private static final boolean[] _KEY_TYPE = new boolean[]{ + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + false, + true, + true, + false, + true, + false, + true, + true, + false, + true, + }; + + /// + /// 髻ウ髫弱ョ繝弱シ繝亥、縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縲 + /// + /// 縺薙ョ髻ウ髫弱r蛻晄悄蛹悶☆繧九◆繧√ョ繝弱シ繝亥、 + public VsqNote( int note ) { + _note = note; + } + + /*// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺瑚。ィ縺咎浹髫弱ョ繝弱シ繝亥、 + /// + public property int Value { + get { + return _note; + } + set { + _note = value; + } + }*/ + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺瑚。ィ縺咎浹髫弱′縲√ヴ繧「繝弱ョ逋ス骰オ縺九←縺縺九r霑斐@縺セ縺 + /// + public boolean getIsWhiteKey() { + return NoteIsWhiteKey( _note ); + } + + + /// + /// 謖螳壹@縺滄浹髫弱′縲√ヴ繧「繝弱ョ逋ス骰オ縺九←縺縺九r霑斐@縺セ縺 + /// + /// + /// + public static boolean NoteIsWhiteKey( int note ) { + if ( 0 <= note && note <= 127 ) { + return _KEY_TYPE[note]; + } else { + int odd = note % 12; + switch ( odd ) { + case 1: + case 3: + case 6: + case 8: + case 10: + return false; + default: + return true; + } + } + } + + public static String NoteToString( int note ) { + int odd = note % 12; + int order = (note - odd) / 12 - 2; + switch ( odd ) { + case 0: + return "C" + order; + case 1: + return "C#" + order; + case 2: + return "D" + order; + case 3: + return "Eb" + order; + case 4: + return "E" + order; + case 5: + return "F" + order; + case 6: + return "F#" + order; + case 7: + return "G" + order; + case 8: + return "G#" + order; + case 9: + return "A" + order; + case 10: + return "Bb" + order; + case 11: + return "B" + order; + default: + return ""; + } + } + + public String toString() { + return NoteToString( _note ); + } + +} diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNrpn.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNrpn.java new file mode 100644 index 0000000..3c4f998 --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqNrpn.java @@ -0,0 +1,143 @@ +/* + * VsqMixer.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + +public class VsqNrpn implements Comparable { + /** + *
+     * public property int Clock {
+     *   get {
+     *        return m_clock;
+     *    }
+     *    set {
+     *        m_clock = value;
+     *    }
+     *};
+ */ + public int Clock; + private int m_nrpn; + private byte m_datamsb; + private byte m_datalsb; + private boolean m_datalsb_specified = false; + private Vector m_list; + + public VsqNrpn( int clock, int nrpn, byte data_msb ) { + Clock = clock; + m_nrpn = nrpn; + m_datamsb = data_msb; + m_datalsb_specified = false; + m_list = new Vector(); + } + + public VsqNrpn( int clock, int nrpn, byte data_msb, byte data_lsb ) { + Clock = clock; + m_nrpn = nrpn; + m_datamsb = data_msb; + m_datalsb = data_lsb; + m_datalsb_specified = true; + m_list = new Vector(); + } + + private VsqNrpn() { + } + + public VsqNrpn[] expand() { + Vector ret = new Vector(); + if ( m_datalsb_specified ) { + ret.add( new VsqNrpn( Clock, m_nrpn, m_datamsb, m_datalsb ) ); + } else { + ret.add( new VsqNrpn( Clock, m_nrpn, m_datamsb ) ); + } + for ( int i = 0; i < m_list.size(); i++ ) { + VsqNrpn item = m_list.get( i ); + if ( item.m_datalsb_specified ) { + ret.add( new VsqNrpn( item.Clock, item.m_nrpn, item.m_datamsb, item.m_datalsb ) ); + } else { + ret.add( new VsqNrpn( item.Clock, item.m_nrpn, item.m_datamsb ) ); + } + } + return ret.toArray( new VsqNrpn[0] ); + } + + public static VsqNrpn[] merge( VsqNrpn[] src1, VsqNrpn[] src2 ) { + Vector ret = new Vector(); + for ( int i = 0; i < src1.length; i++ ) { + ret.add( src1[i] ); + } + for ( int i = 0; i < src2.length; i++ ) { + ret.add( src2[i] ); + } + Collections.sort( ret ); + return ret.toArray( new VsqNrpn[0] ); + } + + public static NrpnData[] convert( VsqNrpn[] source ) { + int nrpn = source[0].getNrpn(); + byte msb = (byte)(nrpn >> 8); + byte lsb = (byte)(nrpn - (nrpn << 8)); + Vector ret = new Vector(); + ret.add( new NrpnData( source[0].Clock, (byte)0x63, msb ) ); + ret.add( new NrpnData( source[0].Clock, (byte)0x62, lsb ) ); + ret.add( new NrpnData( source[0].Clock, (byte)0x06, source[0].getDataMsb() ) ); + if ( source[0].getDataLsbSpecified() ) { + ret.add( new NrpnData( source[0].Clock, (byte)0x26, source[0].getDataLsb() ) ); + } + for ( int i = 1; i < source.length; i++ ) { + int tnrpn = source[i].getNrpn(); + byte tmsb = (byte)(tnrpn >> 8); + byte tlsb = (byte)(tnrpn - (tnrpn << 8)); + if ( tmsb != msb ) { + ret.add( new NrpnData( source[i].Clock, (byte)0x63, tmsb ) ); + msb = tmsb; + } + ret.add( new NrpnData( source[i].Clock, (byte)0x62, tlsb ) ); + ret.add( new NrpnData( source[i].Clock, (byte)0x06, source[i].getDataMsb() ) ); + if ( source[i].getDataLsbSpecified() ) { + ret.add( new NrpnData( source[i].Clock, (byte)0x26, source[i].getDataLsb() ) ); + } + } + return ret.toArray( new NrpnData[0] ); + } + + public int compareTo( VsqNrpn item ) { + return Clock - item.Clock; + } + + public void append( int nrpn, byte data_msb ) { + m_list.add( new VsqNrpn( Clock, nrpn, data_msb ) ); + } + + public void append( int nrpn, byte data_msb, byte data_lsb ) { + m_list.add( new VsqNrpn( Clock, nrpn, data_msb, data_lsb ) ); + } + + public int getNrpn() { + return m_nrpn; + } + + public byte getDataMsb() { + return m_datamsb; + } + + public byte getDataLsb() { + return m_datalsb; + } + + private boolean getDataLsbSpecified() { + return m_datalsb_specified; + } + +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqPhoneticSymbol.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqPhoneticSymbol.java new file mode 100644 index 0000000..de553ec --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqPhoneticSymbol.java @@ -0,0 +1,146 @@ +/* + * VsqPhoneticSymbol.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +public class VsqPhoneticSymbol { + private static final String[] _SYMBOL_VOWEL_JP = new String[] { + "a", + "i", + "M", + "e", + "o", + }; + private static String[] _SYMBOL_CONSONANT_JP = new String[] { + "k", + "k'", + "g", + "g'", + "N", + "N'", + "s", + "S", + "z", + "Z", + "dz", + "dZ", + "t", + "t'", + "ts", + "tS", + "d", + "d'", + "n", + "J", + "h", + "h\\", + "C", + "p\\", + "p\\'", + "b", + "b'", + "p", + "p'", + "m", + "m'", + "j", + "4", + "4'", + "w", + "N\\", + }; + private static String[] _SYMBOL_EN = new String[] { + "@", + "V", + "e", + "e", + "I", + "i:", + "{", + "O:", + "Q", + "U", + "u:", + "@r", + "eI", + "aI", + "OI", + "@U", + "aU", + "I@", + "e@", + "U@", + "O@", + "Q@", + "w", + "j", + "b", + "d", + "g", + "bh", + "dh", + "gh", + "dZ", + "v", + "D", + "z", + "Z", + "m", + "n", + "N", + "r", + "l", + "l0", + "p", + "t", + "k", + "ph", + "th", + "kh", + "tS", + "f", + "T", + "s", + "S", + "h", + }; + + public static boolean IsConsonant( String symbol ) { + for ( int i = 0; i < _SYMBOL_CONSONANT_JP.length; i++ ) { + if ( _SYMBOL_CONSONANT_JP[i].equals( symbol ) ) { + return true; + } + } + return false; + } + + public static boolean IsValidSymbol( String symbol ) { + for ( int i = 0; i < _SYMBOL_VOWEL_JP.length; i++ ) { + if ( _SYMBOL_VOWEL_JP[i].equals( symbol ) ) { + return true; + } + } + for ( int i = 0; i < _SYMBOL_CONSONANT_JP.length; i++ ) { + if ( _SYMBOL_CONSONANT_JP[i].equals( symbol ) ) { + return true; + } + } + for ( int i = 0; i < _SYMBOL_EN.length; i++ ) { + if ( _SYMBOL_EN[i].equals( symbol ) ) { + return true; + } + } + return false; + } + +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqTrack.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqTrack.java new file mode 100644 index 0000000..821e91e --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqTrack.java @@ -0,0 +1,307 @@ +/* + * VsqTrack.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; +import java.io.*; + +public class VsqTrack implements Cloneable { + private String m_name; + private VsqMetaText m_meta_text; + private Vector m_midi_event; + private int m_edited_start = Integer.MAX_VALUE; + private int m_edited_end = Integer.MIN_VALUE; + + public VsqEventIterator singerEventEnumerator() { + return m_meta_text.getEventList().iterator( VsqEventIteratorMode.Singer ); + } + + public VsqEventIterator noteEventEnumerator() { + return m_meta_text.getEventList().iterator( VsqEventIteratorMode.Anote ); + } + + public void printMetaText( TextMemoryStream sw, boolean encode, long eos, int start ) { + m_meta_text.print( sw, encode, eos, start ); + } + + public void printMetaText( String file ) throws IOException { + TextMemoryStream tms = new TextMemoryStream(); + int count = m_meta_text.getEventList().size(); + int clLast = m_meta_text.getEventList().get( count - 1 ).Clock + 480; + m_meta_text.print( tms, true, (long)clLast, 0 ); + BufferedWriter sw = new BufferedWriter( new FileWriter( file ) ); + tms.rewind(); + while ( tms.peek() >= 0 ) { + String line = tms.readLine(); + sw.write( line + "\n" ); + } + } + + /** + * for future implement:
+     *property VsqMaster Master {
+     *    public get {
+     *        return m_meta_text.master;
+     *    }
+     *    protected set {
+     *        m_meta_text.master = value;
+     *    }
+     *};
+ * @return + */ + public VsqMaster getMaster() { + return m_meta_text.master; + } + + protected void setMaster( VsqMaster value ) { + m_meta_text.master = value; + } + + /** + * for future implement:
+     *property VsqMixer Mixer {
+     *    public get {
+     *        return m_meta_text.mixer;
+     *    }
+     *    protected set {
+     *        m_meta_text.mixer = value;
+     *    }
+     *};
+ * @return + */ + public VsqMixer getMixer() { + return m_meta_text.mixer; + } + + protected void setMixer( VsqMixer value ) { + m_meta_text.mixer = value; + } + + public VsqBPList getVsqBPList( VsqCurveType curveType ) { + return m_meta_text.getVsqBPList( curveType ); + } + + public void setVsqBPList( VsqCurveType curveType, VsqBPList value ) { + m_meta_text.setVsqBPList( curveType, value ); + } + + public VsqEventList getEvents() { + return m_meta_text.getEventList(); + } + + /** + * for future implement:
+     * property int EditedStart {
+     *     public get {
+     *         return m_edited_start;
+     *     }
+     *     protected set {
+     *         if ( value < m_edited_start ) {
+     *              m_edited_start = value;
+     *          }
+     *      }
+     * };
+ */ + public int getEditedStart(){ + return m_edited_start; + } + protected void setEditedStart( int value ){ + m_edited_start = value; + } + public int getEditedEnd() { + return m_edited_end; + } + + protected void setEditedEnd( int value ) { + if ( m_edited_end < value ) { + m_edited_end = value; + } + } + + public void resetEditedArea() { + m_edited_start = Integer.MAX_VALUE; + m_edited_end = Integer.MIN_VALUE; + } + + public Object clone() { + VsqTrack res = new VsqTrack(); + res.m_name = m_name; + if ( m_meta_text != null ) { + res.m_meta_text = (VsqMetaText)m_meta_text.clone(); + } + if ( m_midi_event != null ) { + res.m_midi_event = new Vector(); + for ( int i = 0; i < m_midi_event.size(); i++ ) { + MidiEvent item = m_midi_event.get( i ); + res.m_midi_event.add( (MidiEvent)item.clone() ); + } + } + res.m_edited_start = m_edited_start; + res.m_edited_end = m_edited_end; + return res; + } + + private VsqTrack() { + } + + /** + * Master Track繧呈ァ狗ッ + * @param tempo + * @param numerator + * @param denominator + */ + public VsqTrack( int tempo, int numerator, int denominator ) { + this.m_name = "Master Track"; + this.m_meta_text = null; + this.m_midi_event = new Vector(); + this.m_midi_event.add( new MidiEvent( "0 Tempo " + tempo ) ); + this.m_midi_event.add( new MidiEvent( "0 TimeSig " + numerator + "/" + denominator + " 24 8" ) ); + } + + /** + * Master Track縺ァ縺ェ縺繝医Λ繝繧ッ繧呈ァ狗ッ峨 + * @param name + * @param singer + */ + public VsqTrack( String name, String singer ) { + m_name = name; + m_meta_text = new VsqMetaText( name, singer ); + m_midi_event = new Vector(); + } + + /** + * + * 繝。繧ソ繝繧ュ繧ケ繝医 + * private property VsqMetaText MetaText { + * get { + * return m_meta_text; + * } + * }; + */ + protected VsqMetaText getVsqMetaText() { + return m_meta_text; + } + + /** + * 繝医Λ繝繧ッ縺ョ蜷榊燕縲 + * public property String Name { + * get { + * return m_name; + * } + * set { + * m_name = value; + * } + * }; + */ + public String getName() { + return m_name; + } + + public void setName( String value ) { + m_name = value; + } + + /** + * 豁瑚ゥ槭ョ譁蟄玲焚繧定ェソ縺ケ縺セ縺 + * @returns + */ + public int getLyricLength() { + int counter = 0; + VsqEventList list = m_meta_text.getEventList(); + for ( int i = 0; i < list.size(); i++ ) { + if ( list.get( i ).ID.type == VsqIDType.Anote ) { + counter++; + } + } + return counter; + } + + /** + * vsq繝輔ぃ繧、繝ォ繧知f2t蠖「蠑上↓繝繧ュ繧ケ繝亥喧縺輔l縺溘ヵ繧。繧、繝ォ縺九i繧ウ繝ウ繧ケ繝医Λ繧ッ繝医 + * @param lines + */ + public VsqTrack( Vector lines ) throws IOException { + m_midi_event = new Vector(); + m_name = ""; + String meta_text_path; + File temp_file = File.createTempFile( "temp", ".bin" ); + meta_text_path = temp_file.getPath(); + + TextMemoryStream sw = new TextMemoryStream(); + int signal; + for ( int j = 0; j < lines.size(); j++ ) { + String s = lines.get( j ); + String line = s; + // signal繧貞叙蠕 + int index = line.indexOf( ' ' ); + String str_signal = line.substring( 0, index ); + signal = Integer.parseInt( str_signal ); + String remain = line.substring( index + 1 ); + + // 繧、繝吶Φ繝医ョ遞ョ鬘槭〒蜃ヲ逅繧貞蟯 + String[] spl = remain.split( " " ); + if ( spl[0] == "Meta" && spl[1] == "Text" ) { + line = line.replace( signal + " Meta Text \"", "" ); + int second_colon = line.indexOf( ":", 3 ); + line = line.substring( second_colon + 1 ); + line = line.substring( 0, line.length() - 1 ); + line = line.replace( "\\n", "\n" ); + sw.write( line ); + } else if ( spl[0] == "Meta" && (spl[1] == "TrkName" || spl[1] == "SeqName") ) { + m_name = spl[2]; + for ( int i = 3; i < spl.length; i++ ) { + m_name += " " + spl[i]; + } + m_name = m_name.replace( "\"", "" ); + m_name = Lyric.decode( m_name ); + } else { + m_midi_event.add( new MidiEvent( line ) ); + } + } + sw.rewind(); + m_meta_text = new VsqMetaText( sw ); + temp_file.delete(); + } + + /** + * MidiEvent縺ョ荳ュ縺九i繝繝ウ繝晄ュ蝣ア繧呈歓蜃コ縺励∪縺 + * @returns + */ + public Vector getTempoList() { + Vector list = new Vector(); + for ( int i = 0; i < m_midi_event.size(); i++ ) { + if ( m_midi_event.get( i ).type == MidiEventType.tempo ) { + list.add( m_midi_event.get( i ) ); + } + } + Collections.sort( list ); + return list; + } + + /** + * MidiEvent縺ョ荳ュ縺九i諡榊ュ先ュ蝣ア繧呈歓蜃コ縺励∪縺 + * @returns + */ + public Vector getTimeSigList() { + Vector list = new Vector(); + for ( int i = 0; i < m_midi_event.size(); i++ ) { + if ( m_midi_event.get( i ).type == MidiEventType.time_signal ) { + list.add( m_midi_event.get( i ) ); + } + } + Collections.sort( list ); + return list; + } + +} \ No newline at end of file diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqUtil.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqUtil.java new file mode 100644 index 0000000..d25209b --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqUtil.java @@ -0,0 +1,326 @@ +/* + * VsqUtil.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +import java.util.*; + /// + /// 繧ウ繝ウ繝斐Η繝シ繧ソ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺欸OCALOID2繧キ繧ケ繝繝縺ォ縺、縺縺ヲ縺ョ諠蝣ア繧貞叙蠕励☆繧九◆繧√ョ繧ケ繧ソ繝繧」繝繧ッ繝サ繝ゥ繧、繝悶Λ繝ェ縲 + /// + public class VsqUtil { + /// + /// VOCALOID繧キ繧ケ繝繝縺ョ莉墓ァ倅ク願ィュ螳壼庄閭ス縺ェ豁梧焔縺ョ譛螟ァ謨ー + /// + public final int MAX_SINGERS = 0x4000; + + private static String s_dll_path = ""; + private static boolean s_dll_path_done = false; + private static String s_exp_db_dir = ""; + private static boolean s_exp_db_dir_done = false; + private static Dictionary s_singer_configs = null; + private static Vector s_installed_singers = new Vector(); + + /// + /// 謖螳壹@縺溘励Ο繧ー繝ゥ繝繝√ぉ繝ウ繧ク縺梧球蠖薙☆繧区ュ梧焔縺ョ豁悟罰險隱槭r陦ィ縺吶う繝ウ繝繧ッ繧ケ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public static VsqVoiceLanguage GetLanguage( int program_change ) { + String name = GetOriginalSinger( program_change ); + switch ( name ) { + case "Miku": + case "Rin": + case "Len": + case "Rin_ACT2": + case "Len_ACT2": + case "Gackpoid": + return VsqVoiceLanguage.Japanese; + } + return VsqVoiceLanguage.Default; + } + + + /// + /// 謖螳壹@縺溘励Ο繧ー繝ゥ繝繝√ぉ繝ウ繧ク縺梧球蠖薙☆繧区ュ梧焔縺ョ縲√が繝ェ繧ク繝翫Ν縺ョ豁梧焔蜷阪r蜿門セ励@縺セ縺吶 + /// + /// + /// + public static String GetOriginalSinger( int program_change ) { + if ( s_singer_configs == null ) { + LoadSingerConfigs(); + } + if ( s_singer_configs.ContainsKey( program_change ) ) { + SingerConfig sc = GetSingerInfo( program_change ); + String voiceidstr = sc.VOICEIDSTR; + foreach ( SingerConfig installed in s_installed_singers ) { + if ( installed.VOICEIDSTR == voiceidstr ) { + return installed.VOICENAME; + } + } + } + return ""; + } + + + /// + /// 謖螳壹@縺溘励Ο繧ー繝ゥ繝繝√ぉ繝ウ繧ク縺梧球蠖薙☆繧区ュ梧焔縺ョ諠蝣ア繧偵〃sqID縺ォ螟画鋤縺励◆迚ゥ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public static VsqID GetSingerID( int program_change ) { + VsqID ret = new VsqID( 0 ); + ret.type = VsqIDType.Singer; + SingerConfig sc = GetSingerInfo( program_change ); + int language = 0; + foreach ( SingerConfig sc2 in s_installed_singers ) { + if ( sc.VOICEIDSTR == sc2.VOICEIDSTR ) { + switch ( sc2.VOICENAME ) { + case "Miku": + language = 0; + break; + } + } + } + ret.IconHandle = new IconHandle(); + ret.IconHandle.IconID = "$0701" + program_change.ToString( "0000" ); + ret.IconHandle.IDS = sc.VOICENAME; + ret.IconHandle.Index = 0; + ret.IconHandle.Language = language; + ret.IconHandle.Length = 1; + ret.IconHandle.Original = sc.Original; + ret.IconHandle.Program = program_change; + ret.IconHandle.Type = VsqHandleType.Singer; + ret.IconHandle.Caption = ""; + return ret; + } + + + /// + /// 謖螳壹@縺溘励Ο繧ー繝ゥ繝繝√ぉ繝ウ繧ク縺ョ豁梧焔諠蝣ア繧貞叙蠕励@縺セ縺吶 + /// + /// + /// + public static SingerConfig GetSingerInfo( int program_change ) { + if ( s_singer_configs == null ) { + LoadSingerConfigs(); + } + if ( s_singer_configs.ContainsKey( program_change ) ) { + return s_singer_configs[program_change]; + } else { + return null; + } + } + + + /// + /// 豁梧焔險ュ螳壹r隱ュ縺ソ霎シ繧縲GetSingerInfo, GetSingerID縺梧怙蛻昴↓蜻シ縺ー繧後◆譎ゅ↓閾ェ蜍慕噪縺ォ蜻シ縺ウ蜃コ縺輔l繧九′縲∵守、コ逧縺ォ蜻シ縺ウ蜃コ縺励※繧り憶縺縲 + /// + public static void LoadSingerConfigs() { + if ( s_singer_configs == null ) { + LoadSingerConfigs( GetExpDbPath() ); + } + } + + + /// + /// SingerEditor縺ォ繧医▲縺ヲ險ュ螳壹&繧後◆豁梧焔縺ョ繝ェ繧ケ繝医r蜿門セ励☆繧具シ弱Μ繧ケ繝医ョ繧ュ繝シ縺ッ縲後励Ο繧ー繝ゥ繝繝√ぉ繝ウ繧ク縲阪ョ蛟、縺ォ蟇セ蠢懊☆繧 + /// + /// + /// + private static void LoadSingerConfigs( String path ) { + s_singer_configs = new Dictionary(); + String map_file = Path.Combine( path, "voice.map" ); + if ( !File.Exists( map_file ) ) { + return; + } + using ( FileStream fs = new FileStream( map_file, FileMode.Open, FileAccess.Read ) ) { + byte[] dat = new byte[8]; + fs.Seek( 0x20, SeekOrigin.Begin ); + for ( int i = 0; i < MAX_SINGERS; i++ ) { + fs.Read( dat, 0, 8 ); + ulong value = makelong_le( dat ); + if ( value >= 1 ) { +#if DEBUG + Console.WriteLine( " value=" + value ); +#endif + String file = Path.Combine( path, "vvoice" + value + ".vvd" ); + if ( File.Exists( file ) ) { + s_singer_configs.Add( i, new SingerConfig( file, (int)(value - 1) ) ); + } + } + } + } + Vector voiceidstrs = new Vector(); + foreach ( SingerConfig sc in s_singer_configs.Values ) { + if ( !voiceidstrs.Contains( sc.VOICEIDSTR ) ) { + voiceidstrs.Add( sc.VOICEIDSTR ); + } + } + foreach ( String s in voiceidstrs ) { + String dir = Path.Combine( path, s ); + String[] files = Directory.GetFiles( dir, "*.vvd" ); + foreach ( String s2 in files ) { + String file = Path.Combine( dir, s2 ); + if ( File.Exists( file ) ) { + s_installed_singers.Add( new SingerConfig( file, -1 ) ); + } + } + } + } + + + /// + /// 髟キ縺8縺ョ繝舌う繝亥励r繝ェ繝医Ν繧ィ繝ウ繝繧」繧「繝ウ縺ィ縺ソ縺ェ縺励「nsigned long縺ォ螟画鋤縺励∪縺 + /// + /// + /// + private static long makelong_le( byte[] oct ) { + return (ulong)oct[7] << 56 | (ulong)oct[6] << 48 | (ulong)oct[5] << 40 | (ulong)oct[4] << 32 | (ulong)oct[3] << 24 | (ulong)oct[2] << 16 | (ulong)oct[1] << 8 | (ulong)oct[0]; + } + + + /// + /// VOCALOID2 VSTi縺ョdll縺ク縺ョ繝輔Ν繝代せ繧貞叙蠕励@縺セ縺 + /// + /// + public static unsafe String GetVstiDllPath() { + if ( s_dll_path_done ) { + return s_dll_path; + } + try { + uint hKey; + int ret = windows.RegOpenKeyExW( windows.HKEY_LOCAL_MACHINE, "SOFTWARE\\VOCALOID2\\APPLICATION", 0, windows.KEY_READ, &hKey ); + if ( ret != windows.ERROR_SUCCESS ) { + ret = windows.RegOpenKeyExW( windows.HKEY_LOCAL_MACHINE, "SOFTWARE\\VOCALOID2_DEMO\\APPLICATION", 0, windows.KEY_READ, &hKey ); + if ( ret != windows.ERROR_SUCCESS ) { + return s_dll_path; + } + } + + FILETIME ft; + for ( uint i = 0; ; i++ ) { + String lpszName = new String( new char[64] ); + String pClass = new String( new char[64] ); + uint dwNameSize = (uint)lpszName.Length; + uint pcbClass = 64; + int lRes = windows.RegEnumKeyExW( hKey, i, lpszName, &dwNameSize, (uint*)0, pClass, &pcbClass, &ft ); + if ( lRes != windows.ERROR_SUCCESS ) { + break; + } + + uint hChildKey; + ret = windows.RegOpenKeyExW( hKey, lpszName, 0, windows.KEY_READ, &hChildKey ); + if ( ret != windows.ERROR_SUCCESS ) { + continue; + } + + uint dwType = windows.REG_SZ; + uint dwSize = windows.MAX_PATH; + byte[] tszVSTPlugin = new byte[windows.MAX_PATH]; + tszVSTPlugin[0] = (byte)'\0'; + fixed ( byte* pData = &tszVSTPlugin[0] ) { + ret = windows.RegQueryValueExW( hChildKey, "PATH", (uint*)0, &dwType, pData, &dwSize ); + } + windows.RegCloseKey( hChildKey ); + if ( ret != windows.ERROR_SUCCESS ) { + continue; + } + + String name = Encoding.Unicode.GetString( tszVSTPlugin, 0, (int)dwSize ); + if ( name.EndsWith( "\0" ) ) { + name = name.SubString( 0, name.Length - 1 ); + } + // 陬ス蜩∫沿 + if ( name.EndsWith( "\\vocaloid2.dll" ) ) { + s_dll_path = name; + break; + } + // 繝繝「迚 + if ( name.EndsWith( "\\vocaloid2_demo.dll" ) ) { + s_dll_path = name; + break; + } + } + windows.RegCloseKey( hKey ); + } catch { + } finally { + s_dll_path_done = true; + } + return s_dll_path; + } + + + /// + /// 豁悟罰繝繝シ繧ソ繝吶シ繧ケ縺御ソ晏ュ倥&繧後※縺繧九ョ繧」繝ャ繧ッ繝医Μ縺ョ繝輔Ν繝代せ繧貞叙蠕励@縺セ縺 + /// + /// + public static unsafe String GetExpDbPath() { + if ( s_exp_db_dir_done ) { + return s_exp_db_dir; + } + try { + uint hKey; + int ret = windows.RegOpenKeyExW( windows.HKEY_LOCAL_MACHINE, "SOFTWARE\\VOCALOID2\\DATABASE\\VOICE", 0, windows.KEY_READ, &hKey ); + if ( ret != windows.ERROR_SUCCESS ) { + ret = windows.RegOpenKeyExW( windows.HKEY_LOCAL_MACHINE, "SOFTWARE\\VOCALOID2_DEMO\\DATABASE\\VOICE", 0, windows.KEY_READ, &hKey ); + if ( ret != windows.ERROR_SUCCESS ) { + return s_exp_db_dir; + } + } + + FILETIME ft; + for ( uint i = 0; ; i++ ) { + String lpszName = new String( new char[64] ); + String pClass = new String( new char[64] ); + uint dwNameSize = (uint)lpszName.Length; + uint pcbClass = 64; + int lRes = windows.RegEnumKeyExW( hKey, i, lpszName, &dwNameSize, (uint*)0, pClass, &pcbClass, &ft ); + if ( lRes != windows.ERROR_SUCCESS ) { + break; + } + + uint hChildKey; + ret = windows.RegOpenKeyExW( hKey, lpszName, 0, windows.KEY_READ, &hChildKey ); + if ( ret != windows.ERROR_SUCCESS ) { + continue; + } + + uint dwType = windows.REG_SZ; + uint dwSize = windows.MAX_PATH; + byte[] tszVSTPlugin = new byte[windows.MAX_PATH]; + tszVSTPlugin[0] = (byte)'\0'; + fixed ( byte* pData = &tszVSTPlugin[0] ) { + ret = windows.RegQueryValueExW( hChildKey, "INSTALLDIR", (uint*)0, &dwType, pData, &dwSize ); + } + windows.RegCloseKey( hChildKey ); + if ( ret != windows.ERROR_SUCCESS ) { + continue; + } + + String name = Encoding.Unicode.GetString( tszVSTPlugin, 0, (int)dwSize ); + if ( name.EndsWith( "\0" ) ) { + name = name.SubString( 0, name.Length - 1 ); + } + if ( name.EndsWith( "\\voicedbdir" ) ) { + s_exp_db_dir = name; + break; + } + } + windows.RegCloseKey( hKey ); + } catch { + } finally { + s_exp_db_dir_done = true; + } + return s_exp_db_dir; + } + } diff --git a/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqVoiceLanguage.java b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqVoiceLanguage.java new file mode 100644 index 0000000..4dc2c5d --- /dev/null +++ b/trunk/JVsq/src/jp/sourceforge/lipsync/vsq/VsqVoiceLanguage.java @@ -0,0 +1,29 @@ +/* + * VsqVoiceLanguage.java + * Copyright (c) 2008 kbinani + * + * This file is part of jp.sourceforge.lipsync.vsq. + * + * jp.sourceforge.lipsync.vsq is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * jp.sourceforge.lipsync.vsq is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +package jp.sourceforge.lipsync.vsq; + +/** + *VOCALOID2縺ョ豁悟罰險隱 + * @author kbinani + */ +public enum VsqVoiceLanguage { + /** + * 繝繝輔か繝ォ繝医Japanese縺ィ蜷悟、 + */ + Default, + /** + * 譌・譛ャ隱 + */ + Japanese, +} diff --git a/trunk/LipSync.sln b/trunk/LipSync.sln new file mode 100644 index 0000000..136543e --- /dev/null +++ b/trunk/LipSync.sln @@ -0,0 +1,86 @@ +サソ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LipSync", "LipSync\LipSync.csproj", "{15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IPlugin", "IPlugin\IPlugin.csproj", "{FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NicoComment", "NicoComment\NicoComment.csproj", "{6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VFlip", "VFlip\VFlip.csproj", "{E5F9AD85-0C02-4286-AC4C-F5B34EA10650}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Background", "Background\Background.csproj", "{F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevUtl", "DevUtl\DevUtl.csproj", "{A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lang2po", "lang2po\lang2po.csproj", "{D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boare.Lib.AppUtil", "..\Boare.Lib.AppUtil\Boare.Lib.AppUtil.csproj", "{0C58B068-272F-4390-A14F-3D72AFCF3DFB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boare.Lib.Media", "..\Boare.Lib.Media\Boare.Lib.Media.csproj", "{F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boare.Lib.Vsq", "..\Boare.Lib.Vsq\Boare.Lib.Vsq.csproj", "{673347F3-6FC2-4F82-9273-BF158E0F8CB1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bocoree", "..\bocoree\bocoree.csproj", "{C8AAE632-9C6C-4372-8175-811528A66742}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boare.Lib.Swf", "..\Boare.Lib.Swf\Boare.Lib.Swf.csproj", "{D861973B-3BC6-4F52-83BE-49A8C269C09F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56}.Release|Any CPU.Build.0 = Release|Any CPU + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00}.Release|Any CPU.Build.0 = Release|Any CPU + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1}.Release|Any CPU.Build.0 = Release|Any CPU + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650}.Release|Any CPU.Build.0 = Release|Any CPU + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9}.Release|Any CPU.Build.0 = Release|Any CPU + {A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7798205-28BD-4DCD-A4EC-56FD23EE7AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9}.Release|Any CPU.Build.0 = Release|Any CPU + {0C58B068-272F-4390-A14F-3D72AFCF3DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C58B068-272F-4390-A14F-3D72AFCF3DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C58B068-272F-4390-A14F-3D72AFCF3DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C58B068-272F-4390-A14F-3D72AFCF3DFB}.Release|Any CPU.Build.0 = Release|Any CPU + {F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452}.Release|Any CPU.Build.0 = Release|Any CPU + {673347F3-6FC2-4F82-9273-BF158E0F8CB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {673347F3-6FC2-4F82-9273-BF158E0F8CB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {673347F3-6FC2-4F82-9273-BF158E0F8CB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {673347F3-6FC2-4F82-9273-BF158E0F8CB1}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AAE632-9C6C-4372-8175-811528A66742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8AAE632-9C6C-4372-8175-811528A66742}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AAE632-9C6C-4372-8175-811528A66742}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8AAE632-9C6C-4372-8175-811528A66742}.Release|Any CPU.Build.0 = Release|Any CPU + {D861973B-3BC6-4F52-83BE-49A8C269C09F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D861973B-3BC6-4F52-83BE-49A8C269C09F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D861973B-3BC6-4F52-83BE-49A8C269C09F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D861973B-3BC6-4F52-83BE-49A8C269C09F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/trunk/LipSync/Common/AviutlPlugin.cs b/trunk/LipSync/Common/AviutlPlugin.cs new file mode 100644 index 0000000..6f2d0f4 --- /dev/null +++ b/trunk/LipSync/Common/AviutlPlugin.cs @@ -0,0 +1,45 @@ +サソusing System.Runtime.InteropServices; + +namespace Boare.Lib.AviutlPlugin{ + + /*class aviutl { + + [DllImport( "Invoke", EntryPoint="GetFilterTable")] + public extern static FILTER_DLL GetFilterTable(); + + } + + + struct FILTER_DLL { + int flag; + int x,y; + TCHAR *name; + int track_n; + TCHAR **track_name; + int* track_default; + int* track_s; + int* track_e; + int check_n; + TCHAR **check_name; + int* check_default; + BOOL (*func_proc)( FILTER *fp,FILTER_PROC_INFO *fpip ); + BOOL (*func_init)( FILTER *fp ); + BOOL (*func_exit)( FILTER *fp ); + BOOL (*func_update)( FILTER *fp,int status ); + BOOL (*func_WndProc)( HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam,void *editp,FILTER *fp ); + int* track; + int* check; + void* ex_data_ptr; + int ex_data_size; + TCHAR *information; + BOOL (*func_save_start)( FILTER *fp,int s,int e,void *editp ); + BOOL (*func_save_end)( FILTER *fp,void *editp ); + EXFUNC *exfunc; + HWND hwnd; + HINSTANCE dll_hinst; + void* ex_data_def; + BOOL (*func_is_saveframe)( FILTER *fp,void *editp,int saveno,int frame,int fps,int edit_flag,int inter ); + int[] reserve = new int[6]; + }*/ + +} diff --git a/trunk/LipSync/Common/Common.cs b/trunk/LipSync/Common/Common.cs new file mode 100644 index 0000000..d5cd2c5 --- /dev/null +++ b/trunk/LipSync/Common/Common.cs @@ -0,0 +1,264 @@ +サソ/* + * Common.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace LipSync { + + /// + /// LipSync蜈ア逕ィ縺ョ髢「謨ー + /// + public class Common { + private static string m_log_file = ""; + private static StreamWriter m_sw = null; + private static SaveFileDialog s_dialog = null; + public static Color CURVE_X = Color.Black; + public static Color CURVE_Y = Color.White; + public static Color CURVE_SCALE = Color.Orange; + public static Color CURVE_ALPHA = Color.Red; + public static Color CURVE_ROTATE = Color.Navy; + + /// + /// 繝輔ぃ繧、繝ォ繝繧、繧「繝ュ繧ー縺ョFilter縺ォ謖螳壹@繧医≧縺ィ縺励※縺繧区枚蟄怜励′繧ィ繝ゥ繝シ繧定オキ縺薙&縺ェ縺縺九←縺縺九r遒コ縺九a縺セ縺 + /// + /// + /// + public static bool CheckFilterValidity( string filter ) { + if ( s_dialog == null ) { + s_dialog = new SaveFileDialog(); + } + try { + s_dialog.Filter = filter; + return true; + } catch { + return false; + } + } + + public static void DebugWriteLine( string s ) { +#if DEBUG +#if MONO + Console.WriteLine( s ); + System.Diagnostics.Trace.WriteLine( s ); + System.Diagnostics.Debug.WriteLine( s ); +#else + //System.Diagnostics.Debug.WriteLine( s ); + Console.WriteLine( s ); +#endif +#endif + } + + public static Image GetThumbnailImage( Image image, int width, int height ) { + Bitmap res = new Bitmap( width, height, PixelFormat.Format32bppArgb ); + if ( image == null ) { + return res; + } + int w = image.Width; + int h = image.Height; + float ASPECTO = (float)width / (float)height; + float aspecto = (float)w / (float)h; + float order = 1f; //諡。螟ァ邇 + int top = 0; //謠冗判菴咲スョy蠎ァ讓 + int left = 0; //謠冗判菴咲スョx蠎ァ讓 + if ( ASPECTO > aspecto ) { + // 繧オ繝繝阪う繝ォ縺ョ縺サ縺縺梧ィェ髟キ + order = (float)height / (float)h; + left = (int)(width - order * w) / 2; + } else { + // 繧オ繝繝阪う繝ォ縺ョ縺サ縺縺檎クヲ髟キ + order = (float)width / (float)w; + top = (int)(height - order * h) / 2; + } + using ( Graphics g = Graphics.FromImage( res ) ) { + g.Clear( Color.Transparent ); + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + g.DrawImage( image, left, top, w * order, h * order ); + } + return res; + } + + /// + /// 2縺、縺ョ謨エ謨ー縺ョ譛螟ァ蜈ャ邏謨ー繧定ソ斐@縺セ縺吶 + /// + /// + /// + /// + public static long GetGCD( long m, long n ) { + if ( n > m ) { + long a = n; + n = m; + m = a; + } + while ( true ) { + if ( n == 0 ) { + return m; + } + long quotient = m / n; + long odd = m - n * quotient; + if ( odd == 0 ) { + return n; + } + m = n; + n = odd; + } + } + + + public static Point PointFromPointF( PointF point_f ) { + return new Point( (int)point_f.X, (int)point_f.Y ); + } + + + public static Size SizeFromSizeF( SizeF size_f ) { + return new Size( (int)size_f.Width, (int)size_f.Height ); + } + + + /// + /// 逕サ蜒上°繧我ク埼乗朱伜沺繧呈、懷コ縺吶k縲 + /// + /// + /// + public static Rectangle GetNonTransparentRegion( Bitmap bmp ) { + if ( bmp.PixelFormat != PixelFormat.Format32bppArgb ) { + return new Rectangle(); + } + BitmapData bmpdat = bmp.LockBits( + new Rectangle( 0, 0, bmp.Width, bmp.Height ), + ImageLockMode.ReadOnly, + PixelFormat.Format32bppArgb + ); + + int stride = bmpdat.Stride; + + int ymax = 0; + int ymin = (bmp.Height - 1) * stride; + int xmax = 0; + int xmin = (bmp.Width - 1) * 4; + const byte ZERO = 0; + unsafe { + byte* dat = (byte*)(void*)bmpdat.Scan0; + int xend = bmp.Width * 4; + int yend; + for ( int x = 0; x < xend; x += 4 ) { + // ymin繧呈アコ繧√k + yend = ymin;//ymin* stride; + for ( int y = 0; y <= yend; y += stride ) { + if ( dat[x + y + 3] != ZERO ) { + //ymin = Math.Min( ymin, y / stride ); + ymin = Math.Min( ymin, y ); + break; + } + } + + // ymax繧呈アコ繧√k + yend = ymax;// ymax * stride; + for ( int y = (bmp.Height - 1) * stride; y >= yend; y -= stride ) { + if ( dat[x + y + 3] != ZERO ) { + //ymax = Math.Max( ymax, y / stride ); + ymax = Math.Max( ymax, y ); + break; + } + } + } + + yend = ymax;// ymax * stride; + for ( int y = ymin; y <= yend; y += stride ) { + // xmin繧呈アコ繧√k + for ( int x = 0; x < xmin; x += 4 ) { + if ( dat[x + y + 3] != ZERO ) { + //xmin = Math.Min( xmin, x / 4 ); + xmin = Math.Min( xmin, x ); + break; + } + } + + // xmax繧呈アコ繧√k + for ( int x = (bmp.Width - 1) * 4; x >= xmax; x -= 4 ) { + if ( dat[x + y + 3] != ZERO ) { + //xmax = Math.Max( xmax, x / 4 ); + xmax = Math.Max( xmax, x ); + break; + } + } + } + if ( xmax <= xmin || ymax <= ymin ) { + xmin = 0; + xmax = bmp.Width - 1; + ymin = 0; + ymax = bmp.Height - 1; + } else { + xmin = xmin / 4; + xmax = xmax / 4; + ymin = ymin / stride; + ymax = ymax / stride; + } + } + bmp.UnlockBits( bmpdat ); + return new Rectangle( xmin, ymin, xmax - xmin + 1, ymax - ymin + 1 ); + } + + public static void LogPush( Exception ex ) { + LogPush( ex.Source + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace ); + } + public static void LogPush( string procedure, string message_type, string message ) { + LogPush( procedure + ";" + message_type + ";" + message ); + } + static void LogPush( string message ) { + if ( m_sw == null ) { + m_log_file = Path.Combine( Application.StartupPath, "error.log" ); + m_sw = new StreamWriter( m_log_file, true, Encoding.Unicode ); + m_sw.WriteLine( "************************************************************************" ); + m_sw.WriteLine( "Logger started : " + DateTime.Now.ToString() ); + m_sw.WriteLine( "------------------------------------------------------------------------" ); + } + m_sw.WriteLine( DateTime.Now.ToString() + ";" + message ); + m_sw.Flush(); + } + + public static void LogClose() { + if ( m_sw != null ) { + m_sw.Close(); + m_sw = null; + } + } + + /// + /// 謖螳壹@縺溘ヱ繧ケ縺ョ繝輔ぃ繧、繝ォ縺九i繧、繝。繝シ繧ク繧定ェュ縺ソ霎シ縺ソ縺セ縺 + /// + /// 繧、繝。繝シ繧ク繝輔ぃ繧、繝ォ縺ク縺ョ繝代せ + /// + public static Image ImageFromFile( string fpath ) { + Bitmap result = null; + if ( File.Exists( fpath ) ) { + using ( FileStream fs = new FileStream( fpath, FileMode.Open, FileAccess.Read ) ) { + Image temp = Image.FromStream( fs ); + result = new Bitmap( temp.Width, temp.Height, PixelFormat.Format32bppArgb ); + using ( Graphics g = Graphics.FromImage( result ) ) { + g.DrawImage( temp, 0, 0, temp.Width, temp.Height ); + } + temp.Dispose(); + } + } + return result; + } + } + +} diff --git a/trunk/LipSync/Common/CurveEditor.cs b/trunk/LipSync/Common/CurveEditor.cs new file mode 100644 index 0000000..8ebfbd8 --- /dev/null +++ b/trunk/LipSync/Common/CurveEditor.cs @@ -0,0 +1,2653 @@ +/* + * CurveEditor.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Runtime.Serialization; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; +using LipSync; + +namespace CurveEditor { + + public partial class CurveEditor : UserControl { + public delegate void CurveEditedEventHandler(); + + public enum MouseDownMode { + Nothing, + MovePoint, + } + + private class ScaleAndOffset { + public float Scale; + public float Offset; + + public ScaleAndOffset( float scale, float offset ) { + Scale = scale; + Offset = offset; + } + } + + Dictionary m_list = new Dictionary(); + Dictionary m_list_minmax = new Dictionary(); + bool m_drag_ = false; + bool m_drag_with_space_key = false; + Point m_drag_start; + float m_old_xoffset; + float m_old_yoffset; + const int LABEL_WIDTH = 15; + const int LIST_WIDTH = 60; + string m_selected = ""; + int m_picked_point_id = -1; + PickedSide m_picked_side; + bool m_scale_locked = false; + ControlType m_last_added_type = ControlType.None; + List m_commands = new List(); + int m_command_position = -1; + PointF m_before_edit; + //bool m_moved = false; + //bool m_mouse_upped = true; + bool m_change_xscale = false; + bool m_change_yscale = false; + int m_change_origin; + float m_old_scale; + float CHANGE_SCALE_ORDER = 70f; + bool m_spacekey_down = false; + Cursor HAND; + bool _number_visible = false; + PointF _number; + Font _font; + Point _mouse_position; + ContextMenuStrip _cmenu; + ToolStripMenuItem _cmenuNumericInput; + bool m_rescaley_enabled = true; + XLabel m_xlabel = XLabel.None; + YLabel m_ylabel = YLabel.None; + bool m_change_xscale_with_wheel = true; + bool m_change_yscale_with_wheel = true; + bool m_show_list = true; + float m_max_xscale = 100f; + float m_min_xscale = 1e-4f; + float m_max_yscale = 100f; + float m_min_yscale = 1e-4f; + Color m_origin_scale_line = Color.FromArgb( 44, 44, 44 ); + Color m_scale_line = Color.FromArgb( 94, 94, 94 ); + Color m_sub_scale_line = Color.FromArgb( 110, 110, 110 ); + Color m_cHandle_master = Color.FromArgb( 240, 144, 160 ); + Color m_cControl_master = Color.FromArgb( 255, 130, 0 ); + Color m_cHandle_normal = Color.FromArgb( 255, 130, 0 ); + Color m_cControl_normal = Color.FromArgb( 51, 192, 64 ); + Color m_data_point = Color.Black; + Color m_data_point_hilight = Color.Red; + int m_data_point_size = 2; + int m_control_point_size = 2; + PointType m_data_point_type; + PointType m_control_point_type; + Color m_label_back = Color.FromArgb( 172, 172, 172 ); + Color m_list_back = Color.FromArgb( 143, 143, 143 ); + float m_xscale = 1f; + float m_yscale = 1f; + float m_xoffset = 0f; + float m_yoffset = 0f; + int m_place_count_x = 1; + int m_place_count_y = 1; + bool m_scroll_enabled = true; + bool m_mouse_moved = false; + MouseDownMode m_mouse_down_mode = MouseDownMode.Nothing; + + /// + /// 繧ォ繝シ繝悶ョ繝繝シ繧ソ轤ケ繝サ蛻カ蠕。轤ケ縺ェ縺ゥ縺檎キィ髮縺輔l縺滓凾縺ォ逋コ逕溘@縺セ縺 + /// + public event CurveEditedEventHandler CurveEdited; + + /// + /// 繝代ヶ繝ェ繝繧ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + public CurveEditor() { + InitializeComponent(); + this.MouseWheel += new MouseEventHandler( CurveEditor_MouseWheel ); + this.SetStyle( ControlStyles.DoubleBuffer, true ); + this.SetStyle( ControlStyles.UserPaint, true ); + this.SetStyle( ControlStyles.AllPaintingInWmPaint, true ); + byte[] foo = new byte[] { 0x0, 0x0, 0x2, 0x0, 0x1, 0x0, 0x20, 0x20, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0xe8, 0x2, 0x0, 0x0, 0x16, 0x0, + 0x0, 0x0, 0x28, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x1, 0x0, 0x4, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x80, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x80, 0x80, 0x0, 0x0, 0x0, 0x0, + 0x80, 0x0, 0x80, 0x0, 0x80, 0x0, 0x0, 0x80, 0x80, 0x0, 0xc0, 0xc0, 0xc0, 0x0, 0x80, 0x80, 0x80, 0x0, 0xff, 0x0, + 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0x0, 0xff, + 0xff, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, + 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xf8, + 0x1f, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xcf, 0xf3, 0xff, 0xff, 0x87, 0xe1, 0xff, 0xff, 0x7, + 0xe0, 0xff, 0xff, 0x7, 0xe0, 0xff, 0xff, 0x87, 0xe1, 0xff, 0xff, 0xcf, 0xf3, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xf8, + 0x1f, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; + using ( MemoryStream ms = new MemoryStream( foo ) ) { + HAND = new Cursor( ms ); + } + _font = new Font( "MS UI Gothic", 10 ); + } + + public bool GetYScaleAndYOffset( string ID, out float y_scale, out float y_offset ) { + if ( m_list_minmax.ContainsKey( ID ) ) { + y_scale = m_list_minmax[ID].Scale; + y_offset = m_list_minmax[ID].Offset; + return true; + } else { + y_scale = 1f; + y_offset = 0f; + return false; + } + } + + public void SetYScaleAndYOffset( string ID, float y_scale, float y_offset ) { + if ( m_list_minmax.ContainsKey( ID ) ) { + m_list_minmax[ID].Scale = y_scale; + m_list_minmax[ID].Offset = y_offset; + this.Invalidate(); + } + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public Size GraphSize { + get { + int width, height; + if ( XLabel != XLabel.None ) { + height = this.Height - LABEL_WIDTH; + } else { + height = this.Height; + } + if ( YLabel != YLabel.None ) { + width = this.Width - LABEL_WIDTH; + } else { + width = this.Width; + } + if ( ShowList ) { + width -= LIST_WIDTH; + } + return new Size( width, height ); + } + } + + /// + /// 邵ヲ霆ク繧ケ繧ア繝シ繝ォ縺ョ螟画峩繧定ィア蜿ッ縺吶k縺九←縺縺九r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool RescaleYEnabled { + get { + return m_rescaley_enabled; + } + set { + m_rescaley_enabled = value; + } + } + + bool Drag { + get { + return m_drag_; + } + set { + m_drag_ = value; + if ( m_drag_ ) { + this.Cursor = HAND; + } else { + this.Cursor = Cursors.Default; + } + } + } + + /// + /// 迴セ蝨ィ繧ォ繝シ繝悶お繝繧」繧ソ縺ォ險ュ螳壹&繧後※縺繧九ョ繝シ繧ソ繧貞ィ縺ヲ遐エ譽縺暦シ悟晄悄蛹悶@縺セ縺 + /// + public void Clear() { + m_list.Clear(); + m_list_minmax.Clear(); + m_commands.Clear(); + m_command_position = -1; + m_selected = ""; + m_picked_point_id = -1; + } + + /// + /// Undo, Redo逕ィ縺ョ繝舌ャ繝輔ぃ繧貞ィ縺ヲ遐エ譽縺暦シ悟晄悄蛹悶@縺セ縺 + /// + public void ClearBuffer() { + m_commands.Clear(); + m_command_position = -1; + } + + /// + /// 讓ェ霆ク縺ョ逶ョ逶帙ョ遞ョ鬘槭r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public XLabel XLabel { + get { + return m_xlabel; + } + set { + m_xlabel = value; + } + } + + /// + /// 邵ヲ霆ク縺ョ逶ョ逶帙ョ遞ョ鬘槭r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public YLabel YLabel { + get { + return m_ylabel; + } + set { + m_ylabel = value; + } + } + + /// + /// 繝槭え繧ケ繝帙う繝シ繝ォ縺ァ讓ェ霆ク縺ョ繧ケ繧ア繝シ繝ォ繧貞、画峩縺吶k縺九←縺縺九r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool ChangeXScaleWithWheel { + get { + return m_change_xscale_with_wheel; + } + set { + m_change_xscale_with_wheel = value; + } + } + + /// + /// 繝槭え繧ケ繝帙う繝シ繝ォ縺ァ邵ヲ霆ク縺ョ繧ケ繧ア繝シ繝ォ繧貞、画峩縺吶k縺九←縺縺九r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool ChangeYScaleWithWheel { + get { + return m_change_yscale_with_wheel; + } + set { + m_change_yscale_with_wheel = value; + } + } + + /// + /// 邱ィ髮蟇セ雎。縺ィ縺ェ繧九き繝シ繝悶ョ繝ェ繧ケ繝医rシ檎判髱「蜿ウ蛛エ縺ォ陦ィ遉コ縺吶k縺九←縺縺九r蜿門セ励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool ShowList { + get { + return m_show_list; + } + set { + m_show_list = value; + } + } + + /// + /// 讓ェ霆ク縺ョ繧ケ繧ア繝シ繝ォ縺ィ縺励※險ュ螳壹〒縺阪k譛螟ァ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float MaxXScale { + get { + return m_max_xscale; + } + set { + if ( value > 0 && value > m_min_xscale ) { + m_max_xscale = value; + } + } + } + + /// + /// 讓ェ霆ク縺ョ繧ケ繧ア繝シ繝ォ縺ィ縺励※險ュ螳壹〒縺阪k譛蟆丞、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float MinXScale { + get { + return m_min_xscale; + } + set { + if ( value > 0 && value < m_max_xscale ) { + m_min_xscale = value; + } + } + } + + /// + /// 邵ヲ霆ク縺ョ繧ケ繧ア繝シ繝ォ縺ィ縺励※險ュ螳壹〒縺阪k譛螟ァ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float MaxYScale { + get { + return m_max_yscale; + } + set { + if ( value > 0 && value > m_min_yscale ) { + m_max_yscale = value; + } + } + } + + /// + /// 邵ヲ霆ク縺ョ繧ケ繧ア繝シ繝ォ縺ィ縺励※險ュ螳壹〒縺阪k譛蟆丞、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float MinYScale { + get { + return m_min_yscale; + } + set { + if ( value > 0 && value < m_max_yscale ) { + m_min_yscale = value; + } + } + } + + void CurveEditor_MouseWheel( object sender, MouseEventArgs e ) { + Keys modifier = Control.ModifierKeys; + if ( modifier == Keys.Control ) { + float dx = e.Delta / XScale; + XOffset -= dx; + this.Invalidate(); + } else if ( modifier == Keys.Shift ) { + float dy = e.Delta / YScale; + YOffset -= dy; + if ( m_selected != "" ) { + m_list_minmax[m_selected].Offset = YOffset; + } + this.Invalidate(); + } else if ( modifier == Keys.None ) { + float count = e.Delta / 120f; + float n_xscale; + float n_yscale; + float order; + if ( count < 0 ) { + order = (float)Math.Pow( 0.83, Math.Abs( count ) ); + } else { + order = (float)(1f / Math.Pow( 0.83, Math.Abs( count ) )); + } + if ( m_change_xscale_with_wheel ) { + n_xscale = m_xscale * order; + } else { + n_xscale = m_xscale; + } + if ( m_change_yscale_with_wheel ) { + n_yscale = m_yscale * order; + } else { + n_yscale = m_yscale; + } + if ( m_xscale != n_xscale || m_yscale != n_yscale ) { + bool changed = false; + if ( MinXScale <= n_xscale && n_xscale <= MaxXScale ) { + XOffset = e.X * (1f / n_xscale - 1f / XScale) + XOffset; + XScale = n_xscale; + changed = true; + } + if ( MinYScale <= n_yscale && n_yscale <= MaxYScale ) { + YOffset = (this.Height - e.Y) * (1f / n_yscale - 1f / YScale) + YOffset; + YScale = n_yscale; + changed = true; + } + if ( changed ) { + this.Invalidate(); + } + } + } + } + + /// + /// 邱ィ髮蟇セ雎。縺ィ縺ェ繧九き繝シ繝悶rシ後%縺ョ繧ウ繝ウ繝医Ο繝シ繝ォ縺ォ霑ス蜉縺励∪縺 + /// + /// + /// + /*public void Add( string ID, Color curve ) { + m_list.Add( ID, new BezierChain( curve ) ); + }*/ + + public void Add( string ID, BezierChain chain ) { + m_list.Add( ID, chain ); + m_list_minmax.Add( ID, new ScaleAndOffset( 1f, 0f ) ); + } + + //todo:蜍輔°縺励≧繧休縺ョ遽蝗イ繧呈爾遏・縺ァ縺阪k繧医≧縺ォ縺吶kシ殫t1-4縺昴l縺槭l縺悟虚縺丞エ蜷医 + /// + /// 4縺、縺ョ蛻カ蠕。轤ケ縺九i縺ェ繧九吶ず繧ィ譖イ邱壹′縲』霆ク縺ォ縺、縺縺ヲ髯ー縺九←縺縺九r蛻、螳壹☆繧 + /// + /// 蟋狗せ + /// 蛻カ蠕。轤ケ1 + /// 蛻カ蠕。轤ケ2 + /// 邨らせ + /// + public static bool IsBezierImplicit( float pt1, float pt2, float pt3, float pt4 ) { + double a = pt4 - 3 * pt3 + 3 * pt2 - pt1; + double b = 2 * pt3 - 4 * pt2 + 2 * pt1; + double c = pt2 - pt1; + if ( a == 0 ) { + if ( c >= 0 && b + c >= 0 ) { + return true; + } else { + return false; + } + } else if ( a > 0 ) { + if ( -b / (2 * a) <= 0 ) { + if ( c >= 0 ) { + return true; + } else { + return false; + } + } else if ( 1 <= -b / (2 * a) ) { + if ( a + b + c >= 0 ) { + return true; + } else { + return false; + } + } else { + if ( c - b * b / (4 * a) >= 0 ) { + return true; + } else { + return false; + } + } + } else { + if ( -b / (2 * a) <= 0.5 ) { + if ( a + b + c >= 0 ) { + return true; + } else { + return false; + } + } else { + if ( c >= 0 ) { + return true; + } else { + return false; + } + } + } + } + + #region 謠冗判險ュ螳 + public Color MainScaleLine { + get { + return m_origin_scale_line; + } + set { + m_origin_scale_line = value; + } + } + + + public Color ScaleLine { + get { + return m_scale_line; + } + set { + m_scale_line = value; + } + } + + + public Color SubScaleLine { + get { + return m_sub_scale_line; + } + set { + m_sub_scale_line = value; + } + } + + + public Color HandleMaster { + get { + return m_cHandle_master; + } + set { + m_cHandle_master = value; + } + } + + + public Color ControlMaster { + get { + return m_cControl_master; + } + set { + m_cControl_master = value; + } + } + + + public Color HandleNormal { + get { + return m_cHandle_normal; + } + set { + m_cHandle_normal = value; + } + } + + + public Color ControlNormal { + get { + return m_cControl_normal; + } + set { + m_cControl_normal = value; + } + } + + /// + /// 繝繝シ繧ソ繝昴う繝ウ繝医ョ謠冗判濶イ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public Color DataPoint { + get { + return m_data_point; + } + set { + m_data_point = value; + } + } + + /// + /// 驕ク謚槭&繧後◆繝繝シ繧ソ繝昴う繝ウ繝医ョ謠冗判濶イ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public Color DataPointHilight { + get { + return m_data_point_hilight; + } + set { + m_data_point_hilight = value; + } + } + + public int DataPointSize { + get { + return m_data_point_size; + } + set { + m_data_point_size = value; + } + } + + + public int ControlPointSize { + get { + return m_control_point_size; + } + set { + m_control_point_size = value; + } + } + + + public PointType DataPointType { + get { + return m_data_point_type; + } + set { + m_data_point_type = value; + } + } + + + public PointType ControlPointType { + get { + return m_control_point_type; + } + set { + m_control_point_type = value; + } + } + + + public Color LabelBackground { + get { + return m_label_back; + } + set { + m_label_back = value; + } + } + + + public Color ListBackground { + get { + return m_list_back; + } + set { + m_list_back = value; + } + } + #endregion + + /// + /// 讓ェ霆ク縺ョ繧ケ繧ア繝シ繝ォ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺兌pixel/(莉サ諢上ョ蜊倅ス)] + /// + public float XScale { + get { + return m_xscale; + } + set { + if ( !m_scale_locked && MinXScale <= value && value <= MaxXScale ) { + m_xscale = value; + } + } + } + + /// + /// 邵ヲ霆ク縺ョ繧ケ繧ア繝シ繝ォ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺兌pixel/(莉サ諢上ョ蜊倅ス)] + /// + public float YScale { + get { + return m_yscale; + } + set { + if ( !m_scale_locked && MinYScale <= value && value <= MaxYScale ) { + m_yscale = value; + } + } + } + + /// + /// 逕サ髱「蟾ヲ遶ッ縺ォ縺翫¢繧休霆ク縺ョ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float XOffset { + get { + return m_xoffset; + } + set { + m_xoffset = value; + } + } + + /// + /// + /// + public float YOffset { + get { + return m_yoffset; + } + set { + m_yoffset = value; + } + } + + /// + /// 繧ー繝ゥ繝穂ク翫ョX蠎ァ讓吶rシ後さ繝ウ繝医Ο繝シ繝ォ荳翫ョ蠎ァ讓(pixel)縺ォ謠帷ョ励@縺セ縺 + /// + /// + /// + private int cX( float sX ) { + return (int)((sX + XOffset) * XScale); + } + + /// + /// 繧ー繝ゥ繝穂ク翫ョY蠎ァ讓吶rシ後さ繝ウ繝医Ο繝シ繝ォ荳翫ョ蠎ァ讓(pixel)縺ォ謠帷ョ励@縺セ縺 + /// + /// + /// + private int cY( float sY ) { + return this.Height - (int)((sY + YOffset) * YScale); + } + + private Point cPoint( PointF sPoint ) { + return new Point( cX( sPoint.X ), cY( sPoint.Y ) ); + } + + private float sX( int cX ) { + return cX / XScale - XOffset; + } + + private float sY( int cY ) { + return (this.Height - cY) / YScale - YOffset; + } + + private PointF sPoint( Point cPoint ) { + return new PointF( sX( cPoint.X ), sY( cPoint.Y ) ); + } + + private float m_place_x { + get { + int n1 = (int)Math.Log10( 400 / XScale ); + int n2 = (int)Math.Log10( 200 / XScale ); + int n5 = (int)Math.Log10( 80 / XScale ); + float d1 = (float)Math.Pow( 10, n1 ); + float d2 = (float)Math.Pow( 10, n2 ); + float d5 = (float)Math.Pow( 10, n5 ); + if ( d1 <= 2 * d2 && d1 <= 5 * d5 ) { + m_place_count_x = 1; + return d1; + } else if ( 2 * d2 <= d1 && 2 * d2 <= 5 * d5 ) { + m_place_count_x = 2; + return d2; + } else { + m_place_count_x = 5; + return d5; + } + } + } + + private float m_place_y { + get { + int n1 = (int)Math.Log10( 400 / YScale ); + int n2 = (int)Math.Log10( 200 / YScale ); + int n5 = (int)Math.Log10( 80 / YScale ); + float d1 = (float)Math.Pow( 10, n1 ); + float d2 = (float)Math.Pow( 10, n2 ); + float d5 = (float)Math.Pow( 10, n5 ); + if ( d1 <= 2 * d2 && d1 <= 5 * d5 ) { + m_place_count_y = 1; + return d1; + } else if ( 2 * d2 <= d1 && 2 * d2 <= 5 * d5 ) { + m_place_count_y = 2; + return d2; + } else { + m_place_count_y = 5; + return d5; + } + } + } + + public BezierChain this[string ID] { + get { + return m_list[ID]; + } + set { + m_list[ID] = value; + } + } + + public float this[string ID, float x] { + get { + return m_list[ID].GetValue( x ); + } + } + + public bool ScrollEnabled { + get { + return m_scroll_enabled; + } + set { + m_scroll_enabled = value; + } + } + + /// + /// + /// + /// + /// + /// 髢「謨ー繧呈栢縺代k縺ィ縺咲「コ螳溘↓m_scale_locked = false縺ィ縺吶k縺薙→シシ + private void CurveEditor_Paint( object sender, PaintEventArgs e ) { + m_scale_locked = true; + + //繧ー繝ゥ繝募縺ョ繝。繝「繝ェ繧呈緒逕サ + int o_x = cX( 0f ); + int o_y = cY( 0f ); + e.Graphics.DrawLine( new Pen( MainScaleLine ), new Point( 0, o_y ), new Point( this.Width, o_y ) ); + e.Graphics.DrawLine( new Pen( MainScaleLine ), new Point( o_x, 0 ), new Point( o_x, this.Height ) ); +#if DEBUG + //MessageBox.Show( "place_x=" + place_x ); +#endif + float place_x = m_place_count_x * m_place_x; + int start_x = (int)(sX( 0 ) / place_x) - 1; + int end_x = (int)(sX( this.Width ) / place_x) + 1; + for ( int i = start_x; i <= end_x; i++ ) { + float sx; + int px; + if ( i != 0 ) { + sx = i * place_x; + px = cX( sx ); + e.Graphics.DrawLine( new Pen( ScaleLine ), new Point( px, 0 ), new Point( px, this.Height ) ); + } + sx = (i + 0.5f) * place_x; + px = cX( sx ); + e.Graphics.DrawLine( new Pen( SubScaleLine ), new Point( px, 0 ), new Point( px, this.Height ) ); + } + + float place_y = m_place_count_y * m_place_y; + int start_y = (int)(sY( this.Height ) / place_y) - 1; + int end_y = (int)(sY( 0 ) / place_y) + 1; + for ( int i = start_y; i <= end_y; i++ ) { + float sy; + int py; + if ( i != 0 ) { + sy = i * place_y; + py = cY( sy ); + e.Graphics.DrawLine( new Pen( ScaleLine ), new Point( 0, py ), new Point( this.Width, py ) ); + } + sy = (i + 0.5f) * place_y; + py = cY( sy ); + e.Graphics.DrawLine( new Pen( SubScaleLine ), new Point( 0, py ), new Point( this.Width, py ) ); + } + + //foreach ( BezierChain chain in m_list.Values ) { + foreach ( string ID in m_list.Keys ) { + BezierChain chain = m_list[ID]; + BezierPoint last; + if ( chain.Count >= 2 ) { + last = chain.List[0]; + } else { + int default_y = cY( chain.Default ); + e.Graphics.DrawLine( new Pen( chain.Color ), new Point( 0, default_y ), new Point( this.Width, default_y ) ); + if ( ID == m_selected && chain.Count >= 1 ) { + int width2 = m_data_point_size; + switch ( DataPointType ) { + case PointType.Circle: + if ( chain.List[0].ID == m_picked_point_id ) { + e.Graphics.FillEllipse( new SolidBrush( DataPointHilight ), + new Rectangle( cX( chain.List[0].Base.X ) - width2, cY( chain.List[0].Base.Y ) - width2, 2 * width2, 2 * width2 ) ); + } else { + e.Graphics.FillEllipse( new SolidBrush( DataPoint ), + new Rectangle( cX( chain.List[0].Base.X ) - width2, cY( chain.List[0].Base.Y ) - width2, 2 * width2, 2 * width2 ) ); + } + break; + case PointType.Rectangle: + if ( chain.List[0].ID == m_picked_point_id ) { + e.Graphics.FillRectangle( new SolidBrush( DataPointHilight ), + new Rectangle( cX( chain.List[0].Base.X ) - width2, cY( chain.List[0].Base.Y ) - width2, 2 * width2, 2 * width2 ) ); + } else { + e.Graphics.FillRectangle( new SolidBrush( DataPoint ), + new Rectangle( cX( chain.List[0].Base.X ) - width2, cY( chain.List[0].Base.Y ) - width2, 2 * width2, 2 * width2 ) ); + } + break; + } + } + continue; + } + int width = m_data_point_size; + if ( ID == m_selected ) { + switch ( DataPointType ) { + case PointType.Circle: + if ( chain.List[0].ID == m_picked_point_id ) { + e.Graphics.FillEllipse( new SolidBrush( DataPointHilight ), + new Rectangle( cX( chain.List[0].Base.X ) - width, cY( chain.List[0].Base.Y ) - width, 2 * width, 2 * width ) ); + } else { + e.Graphics.FillEllipse( new SolidBrush( DataPoint ), + new Rectangle( cX( chain.List[0].Base.X ) - width, cY( chain.List[0].Base.Y ) - width, 2 * width, 2 * width ) ); + } + break; + case PointType.Rectangle: + if ( chain.List[0].ID == m_picked_point_id ) { + e.Graphics.FillRectangle( new SolidBrush( DataPointHilight ), + new Rectangle( cX( chain.List[0].Base.X ) - width, cY( chain.List[0].Base.Y ) - width, 2 * width, 2 * width ) ); + } else { + e.Graphics.FillRectangle( new SolidBrush( DataPoint ), + new Rectangle( cX( chain.List[0].Base.X ) - width, cY( chain.List[0].Base.Y ) - width, 2 * width, 2 * width ) ); + } + break; + } + } + + //繝繝輔か繝ォ繝亥、シ亥キヲ蛛エシ峨ョ謠冗判 + if ( chain.Count >= 1 ) { + int default_y = cY( chain.Default ); + int x = cX( chain.List[0].Base.X ); + int y = cY( chain.List[0].Base.Y ); + e.Graphics.DrawLine( new Pen( chain.Color ), new Point( x, default_y ), new Point( -1, default_y ) ); + e.Graphics.DrawLine( new Pen( chain.Color ), new Point( x, default_y ), new Point( x, y ) ); + } + //for ( int i = 1; i < chain.Count; i++ ) { + bool first = true; + Size sz = new Size( 2 * width, 2 * width ); + for( int i = 0; i < chain.List.Count; i++ ){ + BezierPoint bp = chain.List[i]; + if ( first ) { + last = bp; + first = false; + continue; + } + //if ( last.ControlRightType != ControlType.None && chain[i].ControlLeftType != ControlType.None ) { + e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + e.Graphics.DrawBezier( new Pen( chain.Color ), + cPoint( last.Base ), + cPoint( last.ControlRight ), + cPoint( bp.ControlLeft ), + cPoint( bp.Base ) ); + e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; + + //蛻カ蠕。繝上Φ繝峨Ν逕ィ縺ョ邱 + if ( ID == m_selected ) { + if ( bp.ControlLeftType == ControlType.Master ) { + e.Graphics.DrawLine( new Pen( HandleMaster ), cPoint( bp.Base ), cPoint( bp.ControlLeft ) ); + } else if ( bp.ControlLeftType == ControlType.Normal ) { + e.Graphics.DrawLine( new Pen( HandleNormal ), cPoint( bp.Base ), cPoint( bp.ControlLeft ) ); + } + if ( last.ControlRightType == ControlType.Master ) { + e.Graphics.DrawLine( new Pen( HandleMaster ), cPoint( last.Base ), cPoint( last.ControlRight ) ); + } else if ( last.ControlRightType == ControlType.Normal ) { + e.Graphics.DrawLine( new Pen( HandleNormal ), cPoint( last.Base ), cPoint( last.ControlRight ) ); + } + + //繝繝シ繧ソ轤ケ + width = m_data_point_size; + Point data_point = new Point( cX( bp.Base.X ) - width, cY( bp.Base.Y ) - width ); + switch ( DataPointType ) { + case PointType.Circle: + if ( bp.ID == m_picked_point_id ) { + e.Graphics.FillEllipse( new SolidBrush( DataPointHilight ), + new Rectangle( data_point, sz ) ); + } else { + e.Graphics.FillEllipse( new SolidBrush( DataPoint ), + new Rectangle( data_point, sz ) ); + } + break; + case PointType.Rectangle: + if ( bp.ID == m_picked_point_id ) { + e.Graphics.FillRectangle( new SolidBrush( DataPointHilight ), + new Rectangle( data_point, sz ) ); + } else { + e.Graphics.FillRectangle( new SolidBrush( DataPoint ), + new Rectangle( data_point, sz ) ); + } + break; + } + + //蛻カ蠕。繝上Φ繝峨Ν轤ケ + width = m_control_point_size; + Color cLeft = Color.Black; + Color cRight = Color.Black; + if ( bp.ControlLeftType == ControlType.Master ) { + cLeft = ControlMaster; + } else if ( bp.ControlLeftType == ControlType.Normal ) { + cLeft = ControlNormal; + } + if ( last.ControlRightType == ControlType.Master ) { + cRight = ControlMaster; + } else if ( last.ControlRightType == ControlType.Normal ) { + cRight = ControlNormal; + } + if ( bp.ControlLeftType != ControlType.None && (bp.ControlLeft.X != bp.Base.X || bp.ControlLeft.Y != bp.Base.Y) ) { + Point ctrl_left = new Point( cX( bp.ControlLeft.X ) - width, cY( bp.ControlLeft.Y ) - width ); + switch ( ControlPointType ) { + case PointType.Circle: + e.Graphics.FillEllipse( new SolidBrush( cLeft ), new Rectangle( ctrl_left, sz ) ); + break; + case PointType.Rectangle: + e.Graphics.FillRectangle( new SolidBrush( cLeft ), new Rectangle( ctrl_left, sz ) ); + break; + } + } + if ( last.ControlRightType != ControlType.None && (last.ControlRight.X != last.Base.X || last.ControlRight.Y != last.Base.Y) ) { + Point ctrl_right = new Point( cX( last.ControlRight.X ) - width, cY( last.ControlRight.Y ) - width ); + switch ( ControlPointType ) { + case PointType.Circle: + e.Graphics.FillEllipse( new SolidBrush( cRight ), new Rectangle( ctrl_right, sz ) ); + break; + case PointType.Rectangle: + e.Graphics.FillRectangle( new SolidBrush( cRight ), new Rectangle( ctrl_right, sz ) ); + break; + } + } + } + last = bp; + } + + //繝繝輔か繝ォ繝亥、シ亥承蛛エシ峨ョ謠冗判 + if ( chain.Count >= 1 ) { + int default_y = cY( chain.Default ); + int x = cX( last.Base.X ); + int y = cY( last.Base.Y ); + e.Graphics.DrawLine( new Pen( chain.Color ), new Point( x, default_y ), new Point( this.Width + 1, default_y ) ); + e.Graphics.DrawLine( new Pen( chain.Color ), new Point( x, default_y ), new Point( x, y ) ); + } + } + + // 繝槭え繧ケ菴咲スョ縺ョ謨ー蛟、繧呈緒逕サ + if ( _number_visible ) { + int x = cX( _number.X ); + int y = cY( _number.Y ); + e.Graphics.DrawString( "x : " + _number.X, + _font, + Brushes.Black, + new PointF( x, y - 24 ) ); + e.Graphics.DrawString( "y : " + _number.Y, + _font, + Brushes.Black, + new PointF( x, y - 12 ) ); + } else { + float x = sX( _mouse_position.X ); + float y = sY( _mouse_position.Y ); + e.Graphics.DrawString( "x : " + x, + _font, + Brushes.Black, + new PointF( _mouse_position.X, _mouse_position.Y - 24 ) ); + e.Graphics.DrawString( "y : " + y, + _font, + Brushes.Black, + new PointF( _mouse_position.X, _mouse_position.Y - 12 ) ); + } + + int label_y = 0; + using ( Font font = new Font( "MS UI Gothic", 9 ) ) { + //繝ゥ繝吶Ν繧呈緒逕サ縲ゑシ亥ソ隕√↑繧会シ + switch ( XLabel ) { + case XLabel.Top: + e.Graphics.FillRectangle( new SolidBrush( LabelBackground ), + new Rectangle( 0, 0, this.Width, LABEL_WIDTH ) ); + break; + case XLabel.Bottom: + e.Graphics.FillRectangle( new SolidBrush( LabelBackground ), + new Rectangle( 0, this.Height - LABEL_WIDTH, this.Width, LABEL_WIDTH ) ); + label_y = this.Height - LABEL_WIDTH; + break; + } + if ( XLabel != XLabel.None ) { + for ( int i = start_x; i <= end_x; i++ ) { + float sx = i * place_x; + int px = cX( sx ); + e.Graphics.DrawString( sx.ToString(), font, Brushes.Black, new PointF( px, label_y ) ); + } + } + + int label_x = 0; + switch ( YLabel ) { + case YLabel.Left: + e.Graphics.FillRectangle( + new SolidBrush( LabelBackground ), + new Rectangle( 0, 0, LABEL_WIDTH, this.Height ) ); + break; + case YLabel.Right: + if ( ShowList ) { + label_x = this.Width - LABEL_WIDTH - LIST_WIDTH; + } else { + label_x = this.Width - LABEL_WIDTH; + } + e.Graphics.FillRectangle( + new SolidBrush( LabelBackground ), + new Rectangle( label_x, 0, LABEL_WIDTH, this.Height ) ); + break; + } + if ( YLabel != YLabel.None ) { + for ( int i = start_y; i <= end_y; i++ ) { + float sy = i * place_y; + int py = cY( sy ); + e.Graphics.DrawString( sy.ToString(), font, Brushes.Black, new PointF( label_x, py ) ); + } + } + + //繝ェ繧ケ繝医r謠上¥ + if ( ShowList ) { + e.Graphics.FillRectangle( + new SolidBrush( ListBackground ), + new Rectangle( this.Width - LIST_WIDTH, 0, LIST_WIDTH, this.Height ) ); + e.Graphics.DrawLine( + Pens.Black, + new Point( this.Width - LIST_WIDTH, 0 ), + new Point( this.Width - LIST_WIDTH, this.Height ) ); + int count = 0; + using ( Font labelfont = new Font( "Arial", 12, FontStyle.Bold, GraphicsUnit.Pixel ) ) { + foreach ( string name in m_list.Keys ) { + e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + if ( name == m_selected ) { + e.Graphics.DrawString( + name, + labelfont, + Brushes.White, + new PointF( this.Width - 40, count * 17 + 2 ) ); + } else { + e.Graphics.DrawString( + name, + labelfont, + Brushes.Black, + new PointF( this.Width - 40, count * 17 + 2 ) ); + } + e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; + e.Graphics.FillRectangle( + new SolidBrush( m_list[name].Color ), + new Rectangle( this.Width - 55, count * 17 + 2, 10, 15 ) ); + count++; + } + } + } + } + m_scale_locked = false; + } + + private void CurveEditor_MouseDown( object sender, MouseEventArgs e ) { + m_mouse_moved = false; + if ( e.Button == MouseButtons.Middle || (m_spacekey_down && e.Button == MouseButtons.Left ) ) { + if ( m_spacekey_down && ((e.Button & MouseButtons.Left) == MouseButtons.Left) ) { + m_drag_with_space_key = true; + } + #region MouseButtons.Middle + if ( ScrollEnabled ) { + switch ( XLabel ) { + case XLabel.Top: + if ( e.Y <= LABEL_WIDTH ) { + return; + } + break; + case XLabel.Bottom: + if ( this.Height - LABEL_WIDTH <= e.Y ) { + return; + } + break; + } + switch ( YLabel ) { + case YLabel.Left: + if ( e.X <= LABEL_WIDTH ) { + return; + } + if ( ShowList && this.Width - LIST_WIDTH <= e.X ) { + return; + } + break; + case YLabel.Right: + if ( ShowList ) { + if ( this.Width - LIST_WIDTH - LABEL_WIDTH <= e.X && e.X <= this.Width - LIST_WIDTH ) { + // 霆ク繝ゥ繝吶Ν縺ョ驛ィ蛻縺ァ繝槭え繧ケ繝繧ヲ繝ウ + return; + } else if ( this.Width - LIST_WIDTH <= e.X ) { + // 繝ェ繧ケ繝医ョ驛ィ蛻縺ァ繝槭え繧ケ繝繧ヲ繝ウ + return; + } + } else { + if ( this.Width - LABEL_WIDTH <= e.X ) { + return; + } + } + break; + } + m_drag_start = e.Location; + m_old_xoffset = m_xoffset; + m_old_yoffset = m_yoffset; + Drag = true; + } + #endregion + } else if ( e.Button == MouseButtons.Left ) { + #region MouseButtons.Left + + #region 繝ェ繧ケ繝 + // 蜿ウ縺ョ繝ェ繧ケ繝医ョ驛ィ蛻縺後け繝ェ繝繧ッ縺輔l縺溘°縺ゥ縺縺九r讀懈渊 + if ( ShowList && this.Width - LIST_WIDTH <= e.X ) { + int count = 0; + + foreach ( string name in m_list.Keys ) { + Rectangle active = new Rectangle( this.Width - 55, count * 17, 50, 16 ); + if ( active.X <= e.X && e.X <= active.X + active.Width && + active.Y <= e.Y && e.Y <= active.Y + active.Height ) { + m_selected = name; + if ( RescaleYEnabled ) { + /*float min, max; + m_list[m_selected].GetMinMax( out min, out max ); +#if DEBUG + LipSync.Common.DebugWriteLine( "min,max=" + min + "," + max ); +#endif + if ( min != max ) { + float dif = max - min; + YScale = this.GraphSize.Height / (dif * 1.1f); + float new_offset; + if ( XLabel == XLabel.Bottom ) { + new_offset = -(min - dif * 0.05f - LABEL_WIDTH / YScale); + } else { + new_offset = -min + dif * 0.05f; + } + YOffset = new_offset; + }*/ + YScale = m_list_minmax[m_selected].Scale; + YOffset = m_list_minmax[m_selected].Offset; + } + this.Invalidate(); + return; + } + count++; + } + m_selected = ""; + this.Invalidate(); + return; + } + + #endregion + + #region 繧ケ繧ア繝シ繝ォ驛ィ蛻 + if ( XLabel == XLabel.Top ) { + if ( 0 <= e.Y && e.Y <= LABEL_WIDTH ) { + m_change_xscale = true; + m_change_origin = e.X; + m_old_scale = XScale; + return; + } + } else if ( XLabel == XLabel.Bottom ) { + if ( this.Height - LABEL_WIDTH <= e.Y && e.Y <= this.Height ) { + m_change_xscale = true; + m_change_origin = e.X; + m_old_scale = XScale; + return; + } + } + + if ( YLabel == YLabel.Left ) { + if ( 0 <= e.X && e.X <= LABEL_WIDTH ) { + m_change_yscale = true; + m_change_origin = e.Y; + m_old_scale = YScale; + return; + } + } else if ( YLabel == YLabel.Right ) { + if ( ShowList ) { + if ( this.Width - LIST_WIDTH - LABEL_WIDTH <= e.X && e.X <= this.Width - LIST_WIDTH ) { + m_change_yscale = true; + m_change_origin = e.Y; + m_old_scale = YScale; + return; + } + } else { + if ( this.Width - LABEL_WIDTH <= e.X && e.X <= this.Width ) { + m_change_yscale = true; + m_change_origin = e.Y; + m_old_scale = YScale; + return; + } + } + } + + #endregion + + #region 繝槭え繧ケ菴咲スョ縺ョ繝繝シ繧ソ轤ケ繧呈、懃エ「 + + DetectSelectedPoint( e.Location, out m_picked_point_id, out m_picked_side ); +#if DEBUG + Common.DebugWriteLine( "CureveEditor_MouseDown" ); + Common.DebugWriteLine( " m_picked_point_id=" + m_picked_point_id ); + Common.DebugWriteLine( " m_picked_side=" + m_picked_side ); +#endif + if ( m_picked_point_id >= 0 ) { + if ( m_picked_side == PickedSide.Base ) { + m_before_edit = m_list[m_selected][m_picked_point_id].Base; + } else if ( m_picked_side == PickedSide.Left ) { + m_before_edit = m_list[m_selected][m_picked_point_id].ControlLeft; + } else { + m_before_edit = m_list[m_selected][m_picked_point_id].ControlRight; + } + _number_visible = true; + m_mouse_down_mode = MouseDownMode.MovePoint; + Invalidate(); + } else { + m_mouse_down_mode = MouseDownMode.Nothing; + } + + #endregion + #endregion + } + } + + /// + /// 繧ォ繝シ繝悶お繝繧」繧ソ逕サ髱「荳翫ョ謖螳壹&繧後◆轤ケ縺ォ縺ゅk繝繝シ繧ソ轤ケ繧定ェソ縺ケ縺セ縺吶 + /// + /// + /// + /// + private void DetectSelectedPoint( Point e, out int picked_point_id, out PickedSide picked_side ) { + picked_point_id = -1; + picked_side = PickedSide.Base; + if ( m_selected != "" ) { + Rectangle active; + Point pt; + for ( int i = 0; i < m_list[m_selected].List.Count; i++ ) { + pt = cPoint( m_list[m_selected].List[i].Base ); + int width = m_data_point_size; + pt = new Point( pt.X - width - 1, pt.Y - width - 1 ); + active = new Rectangle( pt, new Size( width * 2 + 2, width * 2 + 2 ) ); + if ( active.X <= e.X && e.X <= active.X + active.Width && + active.Y <= e.Y && e.Y <= active.Y + active.Height ) { + picked_point_id = m_list[m_selected].List[i].ID; + picked_side = PickedSide.Base; + //m_before_edit = m_list[m_selected][i].Base; + //m_mouse_upped = false; + //_number_visible = true; + return; + } + + pt = cPoint( m_list[m_selected].List[i].ControlLeft ); + width = m_control_point_size; + pt = new Point( pt.X - width - 1, pt.Y - width - 1 ); + active = new Rectangle( pt, new Size( width * 2 + 2, width * 2 + 2 ) ); + if ( active.X <= e.X && e.X <= active.X + active.Width && + active.Y <= e.Y && e.Y <= active.Y + active.Height ) { + picked_point_id = m_list[m_selected].List[i].ID; + picked_side = PickedSide.Left; + //m_before_edit = m_list[m_selected][i].ControlLeft; + //m_mouse_upped = false; + //_number_visible = true; + return; + } + pt = cPoint( m_list[m_selected].List[i].ControlRight ); + width = m_control_point_size; + pt = new Point( pt.X - width - 1, pt.Y - width - 1 ); + active = new Rectangle( pt, new Size( width * 2 + 2, width * 2 + 2 ) ); + if ( active.X <= e.X && e.X <= active.X + active.Width && + active.Y <= e.Y && e.Y <= active.Y + active.Height ) { + picked_point_id = m_list[m_selected].List[i].ID; + picked_side = PickedSide.Right; + //m_before_edit = m_list[m_selected][i].ControlRight; + //m_mouse_upped = false; + //_number_visible = true; + return; + } + } + //m_picked_point = -1; + //m_mouse_upped = true; + } + } + + private void CurveEditor_MouseUp( object sender, MouseEventArgs e ) { + Drag = false; + m_drag_with_space_key = false; + if ( m_selected != "" && m_mouse_down_mode == MouseDownMode.MovePoint && m_picked_point_id >= 0 && m_mouse_moved ) { + PointF new_pt = m_list[m_selected][m_picked_point_id].GetPosition( m_picked_side ); + Command run = Command.GCommandEditPosition( m_selected, m_picked_point_id, m_picked_side, new_pt ); + m_list[m_selected][m_picked_point_id].SetPosition( m_picked_side, m_before_edit ); + Register( Execute( run ) ); + this.Invalidate(); + } + m_mouse_down_mode = MouseDownMode.Nothing; + + m_change_xscale = false; + m_change_yscale = false; + + _number_visible = false; + } + + private void CurveEditor_MouseMove( object sender, MouseEventArgs e ) { + m_mouse_moved = true; + _mouse_position = e.Location; + if ( Drag ) { + bool drag_ok = false; + if ( m_drag_with_space_key ) { + if ( m_spacekey_down ) { + drag_ok = true; + } + } else { + drag_ok = true; + } + if ( drag_ok && m_selected != "" ) { + int dx = e.X - m_drag_start.X; + int dy = m_drag_start.Y - e.Y; + XOffset = m_old_xoffset + dx / m_xscale; + YOffset = m_old_yoffset + dy / m_yscale; + m_list_minmax[m_selected].Offset = YOffset; + this.Invalidate(); + } + } else if ( m_picked_point_id >= 0 && m_mouse_down_mode == MouseDownMode.MovePoint ) { + PointF new_pt = sPoint( e.Location ); + BezierPoint bp = m_list[m_selected][m_picked_point_id]; + int centre = m_list[m_selected].GetIndexFromId( m_picked_point_id ); + int left_id = m_list[m_selected].GetIdFromIndex( centre - 1 ); + int right_id = m_list[m_selected].GetIdFromIndex( centre + 1 ); + switch ( m_picked_side ) { + case PickedSide.Base: + #region PickedSide.Base + if ( 1 <= centre ) { + if ( new_pt.X < m_list[m_selected][left_id].Base.X ) { + new_pt.X = m_list[m_selected][left_id].Base.X; + } + if ( bp.ControlLeftType != ControlType.None ) { + float x1 = m_list[m_selected][left_id].Base.X; + float x2 = m_list[m_selected][left_id].ControlRight.X; + float x3 = new_pt.X + (bp.ControlLeft.X - bp.Base.X); + float x4 = new_pt.X; + if ( !IsBezierImplicit( x1, x2, x3, x4 ) ) { + bp.Base = new PointF( bp.Base.X, new_pt.Y ); + _number = bp.Base; + this.Invalidate(); + return; + } + } + } + if ( centre < m_list[m_selected].Count - 1 ) { + if ( m_list[m_selected][right_id].Base.X < new_pt.X ) { + new_pt.X = m_list[m_selected][right_id].Base.X; + } + if ( bp.ControlRightType != ControlType.None ) { + float x1 = new_pt.X; + float x2 = new_pt.X + (bp.ControlRight.X - bp.Base.X); + float x3 = m_list[m_selected][right_id].ControlLeft.X; + float x4 = m_list[m_selected][right_id].Base.X; + if ( !IsBezierImplicit( x1, x2, x3, x4 ) ) { + bp.Base = new PointF( bp.Base.X, new_pt.Y ); + _number = bp.Base; + this.Invalidate(); + return; + } + } + } + bp.Base = new_pt; + _number = bp.Base; + #endregion + break; + case PickedSide.Right: + #region PickedSide.Right + if ( centre < m_list[m_selected].Count - 1 ) { + float x1 = bp.Base.X; + float x2 = new_pt.X; + float x3 = m_list[m_selected][right_id].ControlLeft.X; + float x4 = m_list[m_selected][right_id].Base.X; + bool is_right = IsBezierImplicit( x1, x2, x3, x4 ); + + bool is_left = true; + float dx = new_pt.X - bp.Base.X; + float dy = new_pt.Y - bp.Base.Y; + float k = 1f; + //if ( bp.ControlRightType == ControlType.Master && m_picked_point >= 1 ) { + if ( bp.ControlRightType != ControlType.None && centre >= 1 ) { + x1 = m_list[m_selected][left_id].Base.X; + x2 = m_list[m_selected][left_id].ControlRight.X; + float dx1 = (bp.ControlLeft.X - bp.Base.X) * XScale; + float dy1 = (bp.ControlLeft.Y - bp.Base.Y) * YScale; + float length = (float)Math.Sqrt( dx1 * dx1 + dy1 * dy1 ); + float tdx = dx * XScale; + float tdy = dy * YScale; + k = length / (float)Math.Sqrt( tdx * tdx + tdy * tdy ); + x3 = bp.Base.X - dx * k; + x4 = bp.Base.X; + is_left = IsBezierImplicit( x1, x2, x3, x4 ); + } + if ( is_right && is_left ) { + bp.ControlRight = new_pt; + _number = bp.ControlRight; + if ( bp.ControlRightType == ControlType.Master && centre >= 1 && bp.ControlLeftType != ControlType.None ) { + bp.ControlLeft = new PointF( bp.Base.X - dx * k, bp.Base.Y - dy * k ); + } + this.Invalidate(); + return; + } else { + if ( centre == 0 ) { + bp.ControlRight = new PointF( bp.ControlRight.X, new_pt.Y ); + _number = bp.ControlRight; + this.Invalidate(); + return; + } else { + //縺ィ繧翫≠縺医★new_pt縺ョy縺縺第崛縺医※縺ソ縺ヲ蜀崎ゥ穂セ。縺励※縺ソ繧 + new_pt = new PointF( bp.ControlRight.X, new_pt.Y ); + dx = new_pt.X - bp.Base.X; + dy = new_pt.Y - bp.Base.Y; + x1 = bp.Base.X; + x2 = new_pt.X; + x3 = m_list[m_selected][right_id].ControlLeft.X; + x4 = m_list[m_selected][right_id].Base.X; + is_right = IsBezierImplicit( x1, x2, x3, x4 ); + is_left = true; + if ( bp.ControlRightType == ControlType.Master ) { + x1 = m_list[m_selected][left_id].Base.X; + x2 = m_list[m_selected][left_id].ControlRight.X; + float dx2 = (bp.ControlLeft.X - bp.Base.X) * XScale; + float dy2 = (bp.ControlLeft.Y - bp.Base.Y) * YScale; + float length = (float)Math.Sqrt( dx2 * dx2 + dy2 * dy2 ); + float tdx = dx * XScale; + float tdy = dy * YScale; + k = length / (float)Math.Sqrt( tdx * tdx + tdy * tdy ); + x3 = bp.Base.X - dx * k; + x4 = bp.Base.X; + is_left = IsBezierImplicit( x1, x2, x3, x4 ); + } + if ( is_right && is_left ) { + bp.ControlRight = new PointF( bp.ControlRight.X, new_pt.Y ); + _number = bp.ControlRight; + if ( bp.ControlRightType == ControlType.Master ) { + bp.ControlLeft = new PointF( bp.Base.X - dx * k, bp.Base.Y - dy * k ); + } + this.Invalidate(); + return; + } + } + } + } else { + bp.ControlRight = new_pt; + _number = bp.ControlRight; + } + #endregion + break; + case PickedSide.Left: + #region PickedSide.Left + if ( centre >= 1 ) { + float x1 = m_list[m_selected][left_id].Base.X; + float x2 = m_list[m_selected][left_id].ControlRight.X; + float x3 = new_pt.X; + float x4 = bp.Base.X; + bool is_left = IsBezierImplicit( x1, x2, x3, x4 ); + + bool is_right = true; + float dx = new_pt.X - bp.Base.X; + float dy = new_pt.Y - bp.Base.Y; + float k = 1f; + if ( bp.ControlLeftType != ControlType.None && centre < m_list[m_selected].Count - 1 ) { + //if ( bp.ControlLeftType == ControlType.Master && m_picked_point < m_list[m_selected].Count - 1 ) { + float dx1 = (bp.ControlRight.X - bp.Base.X) * XScale; + float dy1 = (bp.ControlRight.Y - bp.Base.Y) * YScale; + float length = (float)Math.Sqrt( dx1 * dx1 + dy1 * dy1 ); + float tdx = dx * XScale; + float tdy = dy * YScale; + k = length / (float)Math.Sqrt( tdx * tdx + tdy * tdy ); + x1 = bp.Base.X; + x2 = bp.Base.X - dx * k; + x3 = m_list[m_selected][right_id].ControlLeft.X; + x4 = m_list[m_selected][right_id].Base.X; + is_right = IsBezierImplicit( x1, x2, x3, x4 ); + } + if ( is_right && is_left ) { + bp.ControlLeft = new_pt; + _number = bp.ControlLeft; + if ( bp.ControlLeftType == ControlType.Master && centre >= 1 && bp.ControlRightType != ControlType.None ) { + bp.ControlRight = new PointF( bp.Base.X - dx * k, bp.Base.Y - dy * k ); + } + this.Invalidate(); + return; + } else { + if ( centre == m_list[m_selected].Count - 1 ) { + bp.ControlLeft = new PointF( bp.ControlLeft.X, new_pt.Y ); + _number = bp.ControlLeft; + this.Invalidate(); + return; + } else { + //縺ィ繧翫≠縺医★new_pt縺ョy縺縺第崛縺医※縺ソ縺ヲ蜀崎ゥ穂セ。縺励※縺ソ繧 + new_pt = new PointF( bp.ControlLeft.X, new_pt.Y ); + dx = new_pt.X - bp.Base.X; + dy = new_pt.Y - bp.Base.Y; + x1 = m_list[m_selected][left_id].Base.X; + x2 = m_list[m_selected][left_id].ControlRight.X; + x3 = new_pt.X; + x4 = bp.Base.X; + is_left = IsBezierImplicit( x1, x2, x3, x4 ); + is_right = true; + if ( bp.ControlLeftType == ControlType.Master ) { + float dx2 = (bp.ControlRight.X - bp.Base.X) * XScale; + float dy2 = (bp.ControlRight.Y - bp.Base.Y) * YScale; + float length = (float)Math.Sqrt( dx2 * dx2 + dy2 * dy2 ); + float tdx = dx * XScale; + float tdy = dy * YScale; + k = length / (float)Math.Sqrt( tdx * tdx + tdy * tdy ); + x1 = bp.Base.X; + x2 = bp.Base.X - dx * k; + x3 = m_list[m_selected][right_id].ControlLeft.X; + x4 = m_list[m_selected][right_id].Base.X; + is_right = IsBezierImplicit( x1, x2, x3, x4 ); + } + if ( is_right && is_left ) { + bp.ControlLeft = new PointF( bp.ControlLeft.X, new_pt.Y ); + _number = bp.ControlLeft; + if ( bp.ControlLeftType == ControlType.Master ) { + bp.ControlRight = new PointF( bp.Base.X - dx * k, bp.Base.Y - dy * k ); + } + this.Invalidate(); + return; + } + } + } + } else { + bp.ControlLeft = new_pt; + _number = bp.ControlLeft; + } + //譏斐ョ=> + /*if ( m_picked_point >= 1 ) { + float x1 = m_list[m_selected][m_picked_point - 1].Base.X; + float x2 = m_list[m_selected][m_picked_point - 1].ControlRight.X; + float x3 = new_pt.X; + float x4 = bp.Base.X; + if ( !IsBezierImplicit( x1, x2, x3, x4 ) ) { + bp.ControlLeft = new PointF( bp.ControlLeft.X, new_pt.Y ); + this.Invalidate(); + return; + } + } + bp.ControlLeft = new_pt;*/ + //<=縺薙%縺セ縺ァ + #endregion + break; + } + this.Invalidate(); + } else if ( m_change_xscale ) { + float new_scale = m_old_scale * (float)Math.Pow( 10, (e.X - m_change_origin) / CHANGE_SCALE_ORDER ); + if ( new_scale < MinXScale ) { + new_scale = MinXScale; + } else if ( MaxXScale < new_scale ) { + new_scale = MaxXScale; + } + if ( new_scale != XScale ) { + XOffset = (m_change_origin) * (1f / new_scale - 1f / XScale) + XOffset; + XScale = new_scale; + this.Invalidate(); + } + } else if ( m_change_yscale ) { + float new_scale = m_old_scale * (float)Math.Pow( 10, (e.Y - m_change_origin) / CHANGE_SCALE_ORDER ); + if ( new_scale < MinYScale ) { + new_scale = MinYScale; + } else if ( MaxYScale < new_scale ) { + new_scale = MaxYScale; + } + if ( new_scale != YScale ) { + YOffset = m_change_origin * (1f / new_scale - 1f / YScale) + YOffset; + YScale = new_scale; + m_list_minmax[m_selected].Offset = YOffset; + m_list_minmax[m_selected].Scale = YScale; + this.Invalidate(); + } + } + this.Invalidate(); + } + + private void CurveEditor_Resize( object sender, EventArgs e ) { + this.Invalidate(); + } + + private void CurveEditor_MouseDoubleClick( object sender, MouseEventArgs e ) { + if ( m_selected == "" ) { + return; + } + float x = sX( e.X ); + float y = sY( e.Y ); + + int picked_id; + PickedSide picked_side; + DetectSelectedPoint( e.Location, out picked_id, out picked_side ); + if ( picked_id >= 0 ) { + m_picked_point_id = picked_id; + m_picked_side = picked_side; + m_before_edit = m_list[m_selected][m_picked_point_id].GetPosition( m_picked_side ); + using ( LipSync.SetSize dlg = new LipSync.SetSize( + _( "Numeric entry" ), + "x", + "y", + m_before_edit.X, + m_before_edit.Y ) ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + SizeF res = new SizeF( dlg.ResultWidth, dlg.ResultHeight ); + PointF new_pt = new PointF( res.Width, res.Height ); + Command run = Command.GCommandEditPosition( m_selected, m_picked_point_id, m_picked_side, new_pt ); + m_list[m_selected][m_picked_point_id].SetPosition( m_picked_side, m_before_edit ); + Register( Execute( run ) ); + this.Invalidate(); + } + } + } else { + float handle_length; + float slope = 0f; + if ( m_list[m_selected].Count == 0 ) { + handle_length = x * 0.5f; + } else { + int right_point = -1; + //蜿ウ蛛エ縺ョ轤ケ繧呈、懃エ「 + for ( int i = 0; i < m_list[m_selected].List.Count; i++ ) { + if ( x == m_list[m_selected].List[i].Base.X ) { + //x縺檎ュ峨@縺上↑繧倶ス咲スョ縺ォ縺ッ繝繝シ繧ソ轤ケ繧定ソス蜉縺ァ縺阪↑縺莉墓ァ倥 + return; + } + if ( x < m_list[m_selected].List[i].Base.X ) { + right_point = i; + break; + } + } + if ( right_point == -1 ) { + // 譛繧ょ承 + float dx = Math.Abs( x - m_list[m_selected].List[m_list[m_selected].List.Count - 1].Base.X ); + handle_length = dx / 2; + } else if ( right_point == 0 ) { + float dx = Math.Abs( m_list[m_selected].List[0].Base.X - x ); + handle_length = dx / 2; + } else { + float dx_r = Math.Abs( m_list[m_selected].List[right_point].Base.X - x ); + float dx_l = Math.Abs( x - m_list[m_selected].List[right_point - 1].Base.X ); + handle_length = Math.Min( dx_r, dx_l ) / 2; + slope = (m_list[m_selected].List[right_point].Base.Y - m_list[m_selected].List[right_point - 1].Base.Y) / + (m_list[m_selected].List[right_point].Base.X - m_list[m_selected].List[right_point - 1].Base.X); + } + } + + PointF p_left, p_right; + p_right = new PointF( x + handle_length, y + handle_length * slope ); + p_left = new PointF( x - handle_length, y - handle_length * slope ); + BezierPoint bp = new BezierPoint( new PointF( x, y ), + p_left, + p_right ); + bp.ControlLeftType = m_last_added_type; + bp.ControlRightType = m_last_added_type; + Command run = Command.GCommandAdd( m_selected, bp ); + Register( Execute( run ) ); + m_picked_side = PickedSide.Base; + for ( int i = 0; i < m_list[m_selected].List.Count; i++ ) { + BezierPoint bpoint = m_list[m_selected].List[i]; + if ( x == bpoint.Base.X ) { + m_picked_point_id = bpoint.ID; + break; + } + } + } + this.Invalidate(); + } + + private void CurveEditor_PreviewKeyDown( object sender, PreviewKeyDownEventArgs e ) { + if ( m_selected != "" && m_picked_point_id >= 0 ) { + if ( m_picked_side != PickedSide.Base ) { + switch ( e.KeyCode ) { + case Keys.H: + if ( m_list[m_selected][m_picked_point_id].GetControlType( m_picked_side ) != ControlType.Master ) { + Command run = Command.GCommandChangeType( m_selected, m_picked_point_id, m_picked_side, ControlType.Master ); + Register( Execute( run ) ); + } + break; + case Keys.V: + if ( m_list[m_selected][m_picked_point_id].GetControlType( m_picked_side ) != ControlType.Normal ) { + Command run = Command.GCommandChangeType( m_selected, m_picked_point_id, m_picked_side, ControlType.Normal ); + Register( Execute( run ) ); + } + break; + case Keys.Delete: + if ( m_list[m_selected][m_picked_point_id].GetControlType( m_picked_side ) != ControlType.None ) { + Command run = Command.GCommandChangeType( m_selected, m_picked_point_id, m_picked_side, ControlType.None ); + Register( Execute( run ) ); + } + break; + } + this.Invalidate(); + } else { + ControlType target; + switch ( e.KeyCode ) { + case Keys.H: + target = ControlType.Master; + break; + case Keys.V: + target = ControlType.Normal; + break; + case Keys.Delete: + Command run = Command.GCommandDelete( m_selected, m_picked_point_id ); + Register( Execute( run ) ); + m_picked_point_id = -1; + this.Invalidate(); + return; + default: + return; + } + BezierPoint bpoint = m_list[m_selected][m_picked_point_id]; + if ( bpoint != null ) { + if ( m_list[m_selected][m_picked_point_id].ControlLeftType != target || + m_list[m_selected][m_picked_point_id].ControlRightType != target ) { + BezierPoint bp = m_list[m_selected][m_picked_point_id].Clone(); + bp.ControlLeftType = target; + bp.ControlRightType = target; + Command run = Command.GCommandEdit( m_selected, m_picked_point_id, bp ); + Register( Execute( run ) ); + this.Invalidate(); + } + } + } + } + } + + private Command Execute( Command run ) { +#if DEBUG + Common.DebugWriteLine( "CurveEditor.Execute" ); + /*Common.DebugWriteLine( " before" ); + for ( int i = 0; i < m_list[m_selected].List.Count; i++ ) { + BezierPoint bp = m_list[m_selected].List[i]; + Common.DebugWriteLine( " Base.X=" + bp.Base.X + ", ID=" + bp.ID ); + }*/ +#endif + Command ret = null; + switch ( run.Type ) { + case CommandType.Position: + switch ( run.Side ) { + case PickedSide.Base: + ret = Command.GCommandEditPosition( run.ID, run.PointID, run.Side, m_list[run.ID][run.PointID].Base ); + break; + case PickedSide.Left: + ret = Command.GCommandEditPosition( run.ID, run.PointID, run.Side, m_list[run.ID][run.PointID].ControlLeft ); + break; + case PickedSide.Right: + ret = Command.GCommandEditPosition( run.ID, run.PointID, run.Side, m_list[run.ID][run.PointID].ControlRight ); + break; + } +#if DEBUG + LipSync.Common.DebugWriteLine( " before;Position=" + m_list[run.ID][run.PointID].GetPosition( PickedSide.Base ) ); +#endif + m_list[run.ID][run.PointID].SetPosition( run.Side, run.Position ); +#if DEBUG + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + if ( AppManager.SaveData.m_telop_ex2[i].Text == run.ID ) { + + } + } +#endif + break; + case CommandType.Type: + switch ( run.Side ) { + case PickedSide.Left: + ret = Command.GCommandChangeType( run.ID, run.PointID, run.Side, m_list[run.ID][run.PointID].ControlLeftType ); + m_list[run.ID][run.PointID].ControlLeftType = run.ControlType; + break; + case PickedSide.Right: + ret = Command.GCommandChangeType( run.ID, run.PointID, run.Side, m_list[run.ID][run.PointID].ControlRightType ); + m_list[run.ID][run.PointID].ControlRightType = run.ControlType; + break; + } + break; + case CommandType.Add: + BezierPoint bp = run.BezierPoint.Clone(); + bp.ID = m_list[run.ID].GetNextID(); + ret = Command.GCommandDelete( run.ID, bp.ID ); + m_list[run.ID].Add( bp ); + break; + case CommandType.Delete: + ret = Command.GCommandAdd( run.ID, m_list[run.ID][run.PointID] ); + m_list[run.ID].RemoveAt( run.PointID ); + break; + case CommandType.Edit: + ret = Command.GCommandEdit( run.ID, run.PointID, m_list[run.ID][run.PointID] ); + m_list[run.ID][run.PointID] = run.BezierPoint.Clone(); + break; + default: + return null; + } + if ( this.CurveEdited != null ) { + CurveEdited(); + } +#if DEBUG + /*Common.DebugWriteLine( " after" ); + for ( int i = 0; i < m_list[m_selected].List.Count; i++ ) { + BezierPoint bp = m_list[m_selected].List[i]; + Common.DebugWriteLine( " Base.X=" + bp.Base.X + ", ID=" + bp.ID ); + }*/ +#endif + return ret; + } + + /// + /// 繧「繝ウ繝峨ぇ蜃ヲ逅陦後>縺セ縺 + /// + public void Undo() { + if ( IsUndoAvailable ) { + Command run = m_commands[m_command_position].Clone(); + m_commands[m_command_position] = Execute( run ); + m_command_position--; + this.Invalidate(); + } + } + + /// + /// 繝ェ繝峨ぇ蜃ヲ逅陦後>縺セ縺 + /// + public void Redo() { + if ( IsRedoAvailable ) { + Command run = m_commands[m_command_position + 1].Clone(); + m_commands[m_command_position + 1] = Execute( run ); + m_command_position++; + this.Invalidate(); + } + } + + /// + /// 繝ェ繝峨ぇ謫堺ス懊′蜿ッ閭ス縺九←縺縺九r陦ィ縺吝、繧貞叙蠕励@縺セ縺 + /// + public bool IsRedoAvailable { + get { + if ( m_command_position + 1 < m_commands.Count ) { + return true; + } else { + return false; + } + } + } + + /// + /// 繧「繝ウ繝峨ぇ謫堺ス懊′蜿ッ閭ス縺九←縺縺九r陦ィ縺吝、繧貞叙蠕励@縺セ縺 + /// + public bool IsUndoAvailable { + get { + if ( 0 > m_command_position ) { + return false; + } else { + return true; + } + } + } + + /// + /// 繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ縺ォ謖螳壹&繧後◆繧ウ繝槭Φ繝峨r逋サ骭イ縺励∪縺 + /// + /// + void Register( Command command ) { + if ( m_command_position == m_commands.Count - 1 ) { + // 譁ー縺励>繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ繧定ソス蜉縺吶k蝣エ蜷 + m_commands.Add( command.Clone() ); + m_command_position = m_commands.Count - 1; + } else { + // 譌「縺ォ縺ゅk繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ繧剃ク頑嶌縺阪☆繧句エ蜷 + m_commands[m_command_position + 1].Dispose(); + m_commands[m_command_position + 1] = command.Clone(); + for ( int i = m_commands.Count - 1; i >= m_command_position + 2; i-- ) { + m_commands.RemoveAt( i ); + } + m_command_position++; + } + } + + private void CurveEditor_KeyDown( object sender, KeyEventArgs e ) { + if ( e.KeyCode == Keys.Space ) { + m_spacekey_down = true; + this.Cursor = HAND; + } else { + m_spacekey_down = false; + this.Cursor = Cursors.Default; + } + } + + private void CurveEditor_KeyUp( object sender, KeyEventArgs e ) { + m_spacekey_down = false; + this.Cursor = Cursors.Default; + } + + void _num_input_FormClosing( object sender, FormClosingEventArgs e ) { + e.Cancel = true; + } + + /// + /// 繝繝シ繧ソ轤ケ縺ョ謨ー蛟、蜈・蜉帷畑縺ョ繧ウ繝ウ繝繧ュ繧ケ繝医Γ繝九Η繝シ繧貞晄悄蛹悶@縺セ縺 + /// + private void InitializeContextMenu() { + if( _cmenu != null ) { + _cmenu.Dispose(); + } + if( _cmenuNumericInput != null ) { + _cmenuNumericInput.Dispose(); + } + _cmenu = new ContextMenuStrip(); + _cmenu.ShowCheckMargin = false; + _cmenu.ShowImageMargin = false; + _cmenuNumericInput = new ToolStripMenuItem(); + _cmenu.Items.AddRange( new ToolStripItem[] { + _cmenuNumericInput} ); + _cmenu.Name = "cmenu"; + _cmenu.Size = new System.Drawing.Size( 135, 26 ); + _cmenu.Font = this.Font; + _cmenuNumericInput.Name = "cmenuNumericInput"; + _cmenuNumericInput.Size = new System.Drawing.Size( 134, 22 ); + _cmenuNumericInput.Text = _( "Numeric entry" ) + "(&N)"; + _cmenuNumericInput.Click += new EventHandler( _cmenuNumericInput_Click ); + } + + void _cmenuNumericInput_Click( object sender, EventArgs e ) { + m_before_edit = m_list[m_selected][m_picked_point_id].GetPosition( m_picked_side ); + using ( LipSync.SetSize dlg = new LipSync.SetSize( + _( "Numeric entry" ), + "x", + "y", + m_before_edit.X, + m_before_edit.Y ) ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + SizeF res = new SizeF( dlg.ResultWidth, dlg.ResultHeight ); + PointF new_pt = new PointF( res.Width, res.Height ); + Command run = Command.GCommandEditPosition( m_selected, m_picked_point_id, m_picked_side, new_pt ); + m_list[m_selected][m_picked_point_id].SetPosition( m_picked_side, m_before_edit ); + Register( Execute( run ) ); + this.Invalidate(); + } + } + } + + private void CurveEditor_MouseClick( object sender, MouseEventArgs e ) { + if ( (e.Button & MouseButtons.Right) == MouseButtons.Right ) { + DetectSelectedPoint( e.Location, out m_picked_point_id, out m_picked_side ); +#if DEBUG + Common.DebugWriteLine( "CureveEditor_MouseClick" ); + Common.DebugWriteLine( " m_picked_point_id=" + m_picked_point_id ); + Common.DebugWriteLine( " m_picked_side=" + m_picked_side ); +#endif + if ( m_picked_point_id >= 0 ) { + InitializeContextMenu(); + _cmenu.Show( this, e.Location ); + _number_visible = false; +#if DEBUG + LipSync.Common.DebugWriteLine( "MouseClick, m_picked_point_id=" + m_picked_point_id ); +#endif + } + } + } + + private void CurveEditor_FontChanged( object sender, EventArgs e ) { + if ( _cmenu != null ) { + _cmenu.Font = this.Font; + } + } + } + + + internal class Command /*: ICloneable*/ { + string m_id; + //int m_picked_index; + PickedSide m_picked_side; + PointF m_new_position; + CommandType m_command_type; + ControlType m_control_type; + BezierPoint m_bp; + //float m_x; + int m_pid; + + public override string ToString() { + return "{ID=" + ID + ", PointID=" + PointID + ", Side=" + Side + ", CommandType=" + Type + ", Position=" + Position + "}"; + } + + public Command Clone() { + Command result = new Command(); + result.m_id = this.m_id; + //result.m_picked_index = this.m_picked_index; + result.m_new_position = this.m_new_position; + result.m_command_type = this.m_command_type; + result.m_control_type = this.m_control_type; + if ( this.m_bp != null ) { + result.m_bp = this.m_bp.Clone(); + } + result.m_pid = this.m_pid; + result.m_picked_side = this.m_picked_side; + return result; + } + + public void Dispose(){ + m_bp = null; + } + + public static Command GCommandEditPosition( string ID, int picked_id, PickedSide picked_side, PointF new_position ) { + Command ret = new Command(); + ret.m_id = ID; + ret.m_pid = picked_id; + ret.m_picked_side = picked_side; + ret.m_new_position = new_position; + ret.m_command_type = CommandType.Position; + ret.m_control_type = ControlType.None; + return ret; + } + + public static Command GCommandChangeType( string ID, int picked_id, PickedSide picked_side, ControlType control_type ){ + Command ret = new Command(); + ret.m_id = ID; + ret.m_pid = picked_id; + ret.m_picked_side = picked_side; + ret.m_command_type = CommandType.Type; + ret.m_control_type = control_type; + return ret; + } + + public static Command GCommandAdd( string ID, BezierPoint point ) { + Command ret = new Command(); + ret.m_id = ID; + if ( point != null ) { + ret.m_bp = (BezierPoint)point.Clone(); + } + ret.m_command_type = CommandType.Add; + return ret; + } + + public static Command GCommandDelete( string ID, /*float*/int pid ) { + Command ret = new Command(); + ret.m_id = ID; + //this.m_x = x; + ret.m_pid = pid; + ret.m_command_type = CommandType.Delete; + return ret; + } + + public static Command GCommandNothing() { + return new Command(); + } + + private Command() { + this.m_command_type = CommandType.None; + } + + public static Command GCommandEdit( string ID, int picked_id, BezierPoint point ) { + Command ret = new Command(); + ret.m_id = ID; + ret.m_pid = picked_id; + if ( point != null ) { + ret.m_bp = (BezierPoint)point.Clone(); + } + ret.m_command_type = CommandType.Edit; + return ret; + } + + public int PointID { + get { + return m_pid; + } + } + + /*public float X { + get { + return m_x; + } + }*/ + + public BezierPoint BezierPoint { + get { + return m_bp; + } + } + + public CommandType Type{ + get{ + return m_command_type; + } + } + + public ControlType ControlType { + get { + return m_control_type; + } + } + + public string ID{ + get{ + return m_id; + } + } + + public PickedSide Side{ + get{ + return m_picked_side; + } + } + + public PointF Position{ + get{ + return m_new_position; + } + } + } + + internal enum CommandType { + Position,//蜊倥↓菴咲スョ繧貞、画峩縺吶k + Type,//蛻カ蠕。轤ケ縺ョ繧ソ繧、繝励r螟画峩縺吶k + Add, + Delete, + None, + Edit, + } + + + public enum PickedSide { + Right, + Base, + Left, + } + + + public enum PointType { + Circle, + Rectangle, + } + + public enum XLabel { + None, + Top, + Bottom, + } + + public enum YLabel { + None, + Left, + Right, + } + + [Serializable] + public class BezierChain : IDisposable, ICloneable { + private List list; + private float m_default = 0f; + private Color m_color; + + public bool GetKeyMinMax( out float min, out float max ) { + if ( list.Count == 0 ) { + min = 0f; + max = 0f; + return false; + } + min = float.MaxValue; + max = float.MinValue; + for ( int i = 0; i < list.Count; i++ ) { + min = Math.Min( min, list[i].Base.X ); + max = Math.Max( max, list[i].Base.X ); + } + return true; + } + + public int GetIndexFromId( int id ) { + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].ID == id ) { + return i; + } + } + return -1; + } + + public int GetIdFromIndex( int index ) { + if ( 0 <= index && index < list.Count ) { + return list[index].ID; + } + return -1; + } + + public List List { + get { + return list; + } + set { + list = value; + } + } + + [OnDeserialized] + void onDeserialized( StreamingContext sc ) { + for ( int i = 0; i < list.Count; i++ ) { + list[i].ID = i; + list[i].Order = i; + } + } + + public void Sort() { + //list.Sort( new BezierChainOrderIgnoaringComparator() ); + list.Sort(); + for ( int i = 0; i < list.Count; i++ ) { + list[i].Order = i; + } + } + + public void Dispose() { + if ( list != null ) { + list.Clear(); + } + } + + public int GetNextID() { + int max = -1; + for ( int i = 0; i < list.Count; i++ ) { + max = Math.Max( max, list[i].ID ); + } + return max + 1; + } + + public void GetValueMinMax( out float min, out float max ){ + //todo: 繝吶ず繧ィ縺梧怏蜉ケ縺ェ縺ィ縺阪↓縲∵峇邱壹ョ謠上¥譛螟ァ蛟、縲∵怙蟆丞、繧り諷ョ + min = Default; + max = Default; + foreach ( BezierPoint bp in list ) { + min = Math.Min( min, bp.Base.Y ); + max = Math.Max( max, bp.Base.Y ); + } + } + + public object Clone() { + BezierChain result = new BezierChain( this.m_color ); + foreach ( BezierPoint bp in list ) { + result.list.Add( bp.Clone() ); + } + result.m_default = this.m_default; + return result; + } + + public float Default { + get { + return m_default; + } + set { + m_default = value; + } + } + + public BezierChain( Color curve ) { + list = new List(); + m_color = curve; + } + + public BezierPoint this[int id] { + get { + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].ID == id ) { + return list[i]; + } + } + return null; + } + set { + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].ID == id ) { + list[i] = value; + return; + } + } + throw new Exception( "invalid point id" ); + } + } + + public Color Color { + get { + return m_color; + } + set { + m_color = value; + } + } + + public void Add( BezierPoint bp ) { + if ( list == null ) { + list = new List(); + m_color = Color.Black; + } +#if DEBUG + Common.DebugWriteLine( "BezierChain.Add" ); + Common.DebugWriteLine( " before" ); + for ( int i = 0; i < list.Count; i++ ) { + Common.DebugWriteLine( " Base.X=" + list[i].Base.X + ", Order=" + list[i].Order ); + } +#endif + bool found = false; + for ( int i = 0; i < list.Count - 1; i++ ) { + if ( list[i].Base.X <= bp.Base.X && bp.Base.X < list[i + 1].Base.X ) { + bp.Order = list[i].Order + 1; + for ( int j = i + 1; j < list.Count; j++ ) { + list[j].Order = list[j].Order + 1; + } + found = true; + break; + } + } + if ( !found ) { + if ( list.Count == 0 ){ + bp.Order = 0; + }else{ + bp.Order = list[list.Count - 1].Order + 1; + } + } + list.Add( bp ); + Sort(); +#if DEBUG + Common.DebugWriteLine( "BezierChain.Add" ); + Common.DebugWriteLine( " after" ); + for ( int i = 0; i < list.Count; i++ ) { + Common.DebugWriteLine( " Base.X=" + list[i].Base.X + ", Order=" + list[i].Order ); + } +#endif + } + + public void RemoveAt( int id ) { + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].ID == id ) { + list.RemoveAt( i ); + Sort(); + return; + } + } + } + + /*public void RemoveAt( float x ) { + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].Base.X == x ) { + list.RemoveAt( i ); + break; + } + } + }*/ + + public int Count { + get { + if ( list == null ) { + return 0; + } + return list.Count; + } + } + + public float GetValue( float x ) { + for ( int i = 0; i < list.Count - 1; i++ ) { + if ( list[i].Base.X <= x && x <= list[i + 1].Base.X ) { + if ( list[i].ControlRightType == ControlType.None && list[i + 1].ControlLeftType == ControlType.None ) { + PointF p1 = list[i].Base; + PointF p2 = list[i + 1].Base; + float slope = (p2.Y - p1.Y) / (p2.X - p1.X); + return p1.Y + slope * (x - p1.X); + } else { + float x1 = list[i].Base.X; + float x2 = list[i].ControlRight.X; + float x3 = list[i + 1].ControlLeft.X; + float x4 = list[i + 1].Base.X; + float a3 = x4 - 3 * x3 + 3 * x2 - x1; + float a2 = 3 * x3 - 6 * x2 + 3 * x1; + float a1 = 3 * (x2 - x1); + float a0 = x1; + if ( x1 == x ) { + return list[i].Base.Y; + } else if ( x4 == x ) { + return list[i + 1].Base.Y; + } else { + float t = SolveCubicEquation( a3, a2, a1, a0, x ); + x1 = list[i].Base.Y; + x2 = list[i].ControlRight.Y; + x3 = list[i + 1].ControlLeft.Y; + x4 = list[i + 1].Base.Y; + a3 = x4 - 3 * x3 + 3 * x2 - x1; + a2 = 3 * x3 - 6 * x2 + 3 * x1; + a1 = 3 * (x2 - x1); + a0 = x1; + return ((a3 * t + a2) * t + a1) * t + a0; + } + } + } + } + return m_default; + } + + /// + /// 3谺。譁ケ遞句シ渋3*x^3 + a2*x^2 + a1*x + a0 = ans縺ョ隗」繧偵ル繝・繝シ繝医Φ豕輔r菴ソ縺」縺ヲ險育ョ励@縺セ縺吶ゅ◆縺縺励∝腰隱ソ蠅怜刈縺ァ縺ゅk蠢隕√′縺ゅk縲 + /// + /// + /// + /// + /// + /// + /// + /// + private static float SolveCubicEquation( float a3, float a2, float a1, float a0, float ans ) { + double EPSILON = 1e-9; + double suggested_t = 0.4; + double a3_3 = a3 * 3.0; + double a2_2 = a2 * 2.0; + while ( (a3_3 * suggested_t + a2_2) * suggested_t + a1 == 0.0 ) { + suggested_t += 0.1; + } + double x = suggested_t; + double new_x = suggested_t; + for( int i = 0; i < 5000; i++ ){ + new_x = x - (((a3 * x + a2) * x + a1) * x + a0 - ans) / ((a3_3 * x + a2_2) * x + a1); + if ( Math.Abs( new_x - x ) < EPSILON * new_x ) { + break; + } + x = new_x; + } + return (float)new_x; + } + } + + public enum ControlType { + None, + Normal, + Master, + } + + /// + /// 繝吶ず繧ィ譖イ邱壹r讒区舌☆繧九ョ繝シ繧ソ轤ケ縲 + /// + [Serializable] + public class BezierPoint : IComparable { + PointF m_base; + internal PointF m_control_left; + internal PointF m_control_right; + ControlType m_type_left; + ControlType m_type_right; + [NonSerialized] + int m_id; + [OptionalField] + public int Order; + + public int ID { + get { + return m_id; + } + internal set { + m_id = value; + } + } + + public override string ToString() { + return "m_base=" + m_base.X + "," + m_base.Y + "\n" + + "m_control_left=" + m_control_left.X + "," + m_control_left.Y + "\n" + + "m_control_right=" + m_control_right.X + "," + m_control_right.Y + "\n" + + "m_type_left=" + m_type_left + "\n" + + "m_type_right=" + m_type_right + "\n"; + } + + public BezierPoint( PointF p1, PointF left, PointF right ) { + m_base = p1; + m_control_left = new PointF( left.X - m_base.X, left.Y - m_base.Y ); + m_control_right = new PointF( right.X - m_base.X, right.Y - m_base.Y ); + m_type_left = ControlType.None; + m_type_right = ControlType.None; + } + + public BezierPoint Clone() { + BezierPoint result = new BezierPoint( this.Base, this.ControlLeft, this.ControlRight ); + result.m_control_left = this.m_control_left; + result.m_control_right = this.m_control_right; + result.m_type_left = this.m_type_left; + result.m_type_right = this.m_type_right; + result.Order = this.Order; + result.m_id = this.m_id; + return result; + } + + public int CompareTo( BezierPoint item ) { + if ( this.Base.X > item.Base.X ) { + return 1; + } else if ( this.Base.X < item.Base.X ) { + return -1; + } else { + return this.Order - item.Order; + /*if ( this.ID > item.ID ) { + return 1; + } else if ( this.ID < item.ID ) { + return -1; + } else { + return 0; + }*/ + } + } + + public PointF Base { + get { + return m_base; + } + set { + m_base = value; + } + } + + public void SetPosition( PickedSide picked_side, PointF new_position ) { + if ( picked_side == PickedSide.Base ) { + this.Base = new_position; + } else if ( picked_side == PickedSide.Left ) { + this.m_control_left = new PointF( new_position.X - this.Base.X, new_position.Y - this.Base.Y); + } else { + this.m_control_right = new PointF( new_position.X - this.Base.X, new_position.Y - this.Base.Y ); + } + } + + public PointF GetPosition( PickedSide picked_side ) { + if ( picked_side == PickedSide.Base ) { + return this.Base; + } else if ( picked_side == PickedSide.Left ) { + return this.ControlLeft; + } else { + return this.ControlRight; + } + } + + public ControlType GetControlType( PickedSide picked_side ) { + if ( picked_side == PickedSide.Left ) { + return this.ControlLeftType; + } else if ( picked_side == PickedSide.Right ) { + return this.ControlRightType; + } else { + return ControlType.None; + } + } + + public PointF ControlLeft { + get { + if ( m_type_left != ControlType.None ) { + return new PointF( m_base.X + m_control_left.X, m_base.Y + m_control_left.Y ); + } else { + return m_base; + } + } + set { + m_control_left = new PointF( value.X - m_base.X, value.Y - m_base.Y ); + } + } + + public PointF ControlRight { + get { + if ( m_type_right != ControlType.None ) { + return new PointF( m_base.X + m_control_right.X, m_base.Y + m_control_right.Y ); + } else { + return m_base; + } + } + set { + m_control_right = new PointF( value.X - m_base.X, value.Y - m_base.Y ); + } + } + + public ControlType ControlLeftType { + get { + return m_type_left; + } + set { + m_type_left = value; + } + } + + public ControlType ControlRightType { + get { + return m_type_right; + } + set { + m_type_right = value; + } + } + } + +} diff --git a/trunk/LipSync/Common/CurveEditor.designer.cs b/trunk/LipSync/Common/CurveEditor.designer.cs new file mode 100644 index 0000000..322262a --- /dev/null +++ b/trunk/LipSync/Common/CurveEditor.designer.cs @@ -0,0 +1,68 @@ +サソ/* + * CurveEditor.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace CurveEditor { + partial class CurveEditor { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region 繧ウ繝ウ繝昴シ繝阪Φ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.SuspendLayout(); + // + // CurveEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.Name = "CurveEditor"; + this.Size = new System.Drawing.Size( 333, 120 ); + this.Paint += new System.Windows.Forms.PaintEventHandler( this.CurveEditor_Paint ); + this.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler( this.CurveEditor_PreviewKeyDown ); + this.MouseMove += new System.Windows.Forms.MouseEventHandler( this.CurveEditor_MouseMove ); + this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler( this.CurveEditor_MouseDoubleClick ); + this.FontChanged += new System.EventHandler( this.CurveEditor_FontChanged ); + this.KeyUp += new System.Windows.Forms.KeyEventHandler( this.CurveEditor_KeyUp ); + this.MouseClick += new System.Windows.Forms.MouseEventHandler( this.CurveEditor_MouseClick ); + this.MouseDown += new System.Windows.Forms.MouseEventHandler( this.CurveEditor_MouseDown ); + this.Resize += new System.EventHandler( this.CurveEditor_Resize ); + this.MouseUp += new System.Windows.Forms.MouseEventHandler( this.CurveEditor_MouseUp ); + this.KeyDown += new System.Windows.Forms.KeyEventHandler( this.CurveEditor_KeyDown ); + this.ResumeLayout( false ); + + } + + #endregion + + + + } +} diff --git a/trunk/LipSync/Common/NativeMethods.cs b/trunk/LipSync/Common/NativeMethods.cs new file mode 100644 index 0000000..85267d8 --- /dev/null +++ b/trunk/LipSync/Common/NativeMethods.cs @@ -0,0 +1,290 @@ +サソ/*================================================================================ + File: NativeMethods.cs + + Summary: This is part of a sample showing how to place Windows Forms controls + inside one of the common file dialogs. +---------------------------------------------------------------------------------- +Copyright (C) Microsoft Corporation. All rights reserved. + +This source code is intended only as a supplement to Microsoft Development Tools +and/or on-line documentation. See these other materials for detailed information +regarding Microsoft code samples. + +This sample is not intended for production use. Code and policy for a production +application must be developed to meet the specific data and security requirements +of the application. + +THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +================================================================================*/ + +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace ExtensibleDialogs +{ + /// + /// Defines the shape of hook procedures that can be called by the OpenFileDialog + /// + internal delegate IntPtr OfnHookProc( IntPtr hWnd, UInt16 msg, Int32 wParam, Int32 lParam ); + + /// + /// Values that can be placed in the OPENFILENAME structure, we don't use all of them + /// + internal class OpenFileNameFlags + { + public const Int32 ReadOnly = 0x00000001; + public const Int32 OverWritePrompt = 0x00000002; + public const Int32 HideReadOnly = 0x00000004; + public const Int32 NoChangeDir = 0x00000008; + public const Int32 ShowHelp = 0x00000010; + public const Int32 EnableHook = 0x00000020; + public const Int32 EnableTemplate = 0x00000040; + public const Int32 EnableTemplateHandle = 0x00000080; + public const Int32 NoValidate = 0x00000100; + public const Int32 AllowMultiSelect = 0x00000200; + public const Int32 ExtensionDifferent = 0x00000400; + public const Int32 PathMustExist = 0x00000800; + public const Int32 FileMustExist = 0x00001000; + public const Int32 CreatePrompt = 0x00002000; + public const Int32 ShareAware = 0x00004000; + public const Int32 NoReadOnlyReturn = 0x00008000; + public const Int32 NoTestFileCreate = 0x00010000; + public const Int32 NoNetworkButton = 0x00020000; + public const Int32 NoLongNames = 0x00040000; + public const Int32 Explorer = 0x00080000; + public const Int32 NoDereferenceLinks = 0x00100000; + public const Int32 LongNames = 0x00200000; + public const Int32 EnableIncludeNotify = 0x00400000; + public const Int32 EnableSizing = 0x00800000; + public const Int32 DontAddToRecent = 0x02000000; + public const Int32 ForceShowHidden = 0x10000000; + }; + + /// + /// Values that can be placed in the FlagsEx field of the OPENFILENAME structure + /// + internal class OpenFileNameFlagsEx + { + public const Int32 NoPlacesBar = 0x00000001; + }; + + /// + /// A small subset of the window messages that can be sent to the OpenFileDialog + /// These are just the ones that this implementation is interested in + /// + internal class WindowMessage + { + public const UInt16 InitDialog = 0x0110; + public const UInt16 Size = 0x0005; + public const UInt16 Notify = 0x004E; + }; + + /// + /// The possible notification messages that can be generated by the OpenFileDialog + /// We only look for CDN_SELCHANGE + /// + internal class CommonDlgNotification + { + private const UInt16 First = unchecked((UInt16)((UInt16)0 - (UInt16)601)); + + public const UInt16 InitDone = (First - 0x0000); + public const UInt16 SelChange = (First - 0x0001); + public const UInt16 FolderChange = (First - 0x0002); + public const UInt16 ShareViolation = (First - 0x0003); + public const UInt16 Help = (First - 0x0004); + public const UInt16 FileOk = (First - 0x0005); + public const UInt16 TypeChange = (First - 0x0006); + public const UInt16 IncludeItem = (First - 0x0007); + } + + /// + /// Messages that can be send to the common dialogs + /// We only use CDM_GETFILEPATH + /// + internal class CommonDlgMessage { + private const UInt16 User = 0x0400; + private const UInt16 First = User + 100; + private const UInt16 Last = User + 200; + public const UInt16 GetSpec = First; + public const UInt16 GetFilePath = First + 0x0001; + public const UInt16 GetFolderPath = First + 0x0002; + public const UInt16 GetFolderIDList = First + 0x0003; + public const UInt16 SetControlText = First + 0x0004; + public const UInt16 HideControl = First + 0x0005; + public const UInt16 SetDefExt = First + 0x0006; + }; + + /// + /// See the documentation for OPENFILENAME + /// + internal struct OpenFileName + { + public Int32 lStructSize; + public IntPtr hwndOwner; + public IntPtr hInstance; + public IntPtr lpstrFilter; + public IntPtr lpstrCustomFilter; + public Int32 nMaxCustFilter; + public Int32 nFilterIndex; + public IntPtr lpstrFile; + public Int32 nMaxFile; + public IntPtr lpstrFileTitle; + public Int32 nMaxFileTitle; + public IntPtr lpstrInitialDir; + public IntPtr lpstrTitle; + public Int32 Flags; + public Int16 nFileOffset; + public Int16 nFileExtension; + public IntPtr lpstrDefExt; + public Int32 lCustData; + public OfnHookProc lpfnHook; + public IntPtr lpTemplateName; + public IntPtr pvReserved; + public Int32 dwReserved; + public Int32 FlagsEx; + }; + + /// + /// Part of the notification messages sent by the common dialogs + /// + [StructLayout(LayoutKind.Explicit)] + internal struct NMHDR + { + [FieldOffset(0)] public IntPtr hWndFrom; + [FieldOffset(4)] public UInt16 idFrom; + [FieldOffset(8)] public UInt16 code; + }; + + /// + /// Part of the notification messages sent by the common dialogs + /// + [StructLayout(LayoutKind.Explicit)] + internal struct OfNotify + { + [FieldOffset(0)] public NMHDR hdr; + [FieldOffset(12)] public IntPtr ipOfn; + [FieldOffset(16)] public IntPtr ipFile; + }; + + /// + /// Win32 window style constants + /// We use them to set up our child window + /// + internal class DlgStyle + { + public const Int32 DsSetFont = 0x00000040; + public const Int32 Ds3dLook = 0x00000004; + public const Int32 DsControl = 0x00000400; + public const Int32 WsChild = 0x40000000; + public const Int32 WsClipSiblings = 0x04000000; + public const Int32 WsVisible = 0x10000000; + public const Int32 WsGroup = 0x00020000; + public const Int32 SsNotify = 0x00000100; + }; + + /// + /// Win32 "extended" window style constants + /// + internal class ExStyle + { + public const Int32 WsExNoParentNotify = 0x00000004; + public const Int32 WsExControlParent = 0x00010000; + }; + + /// + /// An in-memory Win32 dialog template + /// Note: this has a very specific structure with a single static "label" control + /// See documentation for DLGTEMPLATE and DLGITEMTEMPLATE + /// + [StructLayout(LayoutKind.Sequential)] + internal class DlgTemplate + { + // The dialog template - see documentation for DLGTEMPLATE + public Int32 style = DlgStyle.Ds3dLook | DlgStyle.DsControl | DlgStyle.WsChild | DlgStyle.WsClipSiblings | DlgStyle.SsNotify; + public Int32 extendedStyle = ExStyle.WsExControlParent; + public Int16 numItems = 1; + public Int16 x = 0; + public Int16 y = 0; + public Int16 cx = 0; + public Int16 cy = 0; + public Int16 reservedMenu = 0; + public Int16 reservedClass = 0; + public Int16 reservedTitle = 0; + + // Single dlg item, must be dword-aligned - see documentation for DLGITEMTEMPLATE + public Int32 itemStyle = DlgStyle.WsChild; + public Int32 itemExtendedStyle = ExStyle.WsExNoParentNotify; + public Int16 itemX = 0; + public Int16 itemY = 0; + public Int16 itemCx = 0; + public Int16 itemCy = 0; + public Int16 itemId = 0; + public UInt16 itemClassHdr = 0xffff; // we supply a constant to indicate the class of this control + public Int16 itemClass = 0x0082; // static label control + public Int16 itemText = 0x0000; // no text for this control + public Int16 itemData = 0x0000; // no creation data for this control + }; + + /// + /// The rectangle structure used in Win32 API calls + /// + [StructLayout(LayoutKind.Sequential)] + internal struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + }; + + /// + /// The point structure used in Win32 API calls + /// + [StructLayout(LayoutKind.Sequential)] + internal struct POINT + { + public int X; + public int Y; + }; + + /// + /// Contains all of the p/invoke declarations for the Win32 APIs used in this sample + /// + public class NativeMethods + { + + [DllImport("User32.dll", CharSet = CharSet.Unicode)] + internal static extern IntPtr GetDlgItem( IntPtr hWndDlg, Int16 Id ); + + [DllImport("User32.dll", CharSet = CharSet.Unicode)] + internal static extern IntPtr GetParent( IntPtr hWnd ); + + [DllImport("User32.dll", CharSet = CharSet.Unicode)] + internal static extern IntPtr SetParent( IntPtr hWndChild, IntPtr hWndNewParent ); + + [DllImport("User32.dll", CharSet = CharSet.Unicode)] + internal static extern UInt32 SendMessage( IntPtr hWnd, UInt32 msg, UInt32 wParam, StringBuilder buffer ); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + internal static extern int GetWindowRect( IntPtr hWnd, ref RECT rc ); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + internal static extern int GetClientRect( IntPtr hWnd, ref RECT rc ); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + internal static extern bool ScreenToClient( IntPtr hWnd, ref POINT pt ); + + [DllImport("user32.dll", CharSet = CharSet.Unicode)] + internal static extern bool MoveWindow( IntPtr hWnd, int X, int Y, int Width, int Height, bool repaint ); + + [DllImport("ComDlg32.dll", CharSet = CharSet.Unicode)] + internal static extern bool GetOpenFileName( ref OpenFileName ofn ); + + [DllImport("ComDlg32.dll", CharSet = CharSet.Unicode)] + internal static extern Int32 CommDlgExtendedError(); + + } +} diff --git a/trunk/LipSync/Common/NumericUpDownEx.Designer.cs b/trunk/LipSync/Common/NumericUpDownEx.Designer.cs new file mode 100644 index 0000000..158b79a --- /dev/null +++ b/trunk/LipSync/Common/NumericUpDownEx.Designer.cs @@ -0,0 +1,45 @@ +サソ/* + * NumericUpDownEx.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class NumericUpDownEx { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region 繧ウ繝ウ繝昴シ繝阪Φ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/trunk/LipSync/Common/NumericUpDownEx.cs b/trunk/LipSync/Common/NumericUpDownEx.cs new file mode 100644 index 0000000..95a6718 --- /dev/null +++ b/trunk/LipSync/Common/NumericUpDownEx.cs @@ -0,0 +1,44 @@ +サソ/* + * NumericUpDownEx.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +//using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace LipSync { + /// + /// MouseWheel縺ァIncrement縺壹▽蛟、繧貞「玲ク帙&縺帙k縺薙→縺ョ縺ァ縺阪kNumericUpDown + /// + public partial class NumericUpDownEx : NumericUpDown { + public NumericUpDownEx() { + InitializeComponent(); + } + protected override void OnMouseWheel( MouseEventArgs e ) { + decimal new_val; + if ( e.Delta > 0 ) { + new_val = this.Value + this.Increment; + } else if ( e.Delta < 0 ) { + new_val = this.Value - this.Increment; + } else { + return; + } + if ( this.Minimum <= new_val && new_val <= this.Maximum ) { + this.Value = new_val; + } + } + } +} diff --git a/trunk/LipSync/Common/OpenFileDialog.cs b/trunk/LipSync/Common/OpenFileDialog.cs new file mode 100644 index 0000000..4c180fc --- /dev/null +++ b/trunk/LipSync/Common/OpenFileDialog.cs @@ -0,0 +1,506 @@ +/*================================================================================ + File: OpenFileDialog.cs + + Summary: This is part of a sample showing how to place Windows Forms controls + inside one of the common file dialogs. +---------------------------------------------------------------------------------- +Copyright (C) Microsoft Corporation. All rights reserved. + +This source code is intended only as a supplement to Microsoft Development Tools +and/or on-line documentation. See these other materials for detailed information +regarding Microsoft code samples. + +This sample is not intended for production use. Code and policy for a production +application must be developed to meet the specific data and security requirements +of the application. + +THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +================================================================================*/ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; + +namespace ExtensibleDialogs { + /// + /// The extensible OpenFileDialog + /// + public class OpenFileDialog : IDisposable { + // The maximum number of characters permitted in a path + private const int _MAX_PATH = 260; + + // The "control ID" of the content window inside the OpenFileDialog + // See the accompanying article to learn how I discovered it + private const int _CONTENT_PANEL_ID = 0x0461; + + // A constant that determines the spacing between panels inside the OpenFileDialog + private const int _PANEL_GAP_FACTOR = 3; + + /// + /// Clients can implement handlers of this type to catch "selection changed" events + /// + public delegate void SelectionChangedHandler( string path ); + + /// + /// This event is fired whenever the user selects an item in the dialog + /// + public event SelectionChangedHandler SelectionChanged; + + public delegate void FolderChangedHandler( string path ); + public event FolderChangedHandler FolderChanged; + + // unmanaged memory buffers to hold the file name (with and without full path) + private IntPtr _fileNameBuffer; + private IntPtr _fileTitleBuffer; + private IntPtr _initialDirBuffer; + + // user-supplied control that gets placed inside the OpenFileDialog + private System.Windows.Forms.Control _userControl; + + // unmanaged memory buffer that holds the Win32 dialog template + private IntPtr _ipTemplate; + + private string _filter; + private string _fileName; + private string _defaultExtension; + private int _filterIndex; + private short _fileOffset; + private short _fileExtension; + private string _initialDir; + + public string InitialDirectory { + get { + return _initialDir; + } + set { + _initialDir = value; + if ( !Path.IsPathRooted( _initialDir ) ) { + if ( !Directory.Exists( _initialDir ) ) { + _initialDir = Path.GetDirectoryName( _initialDir ); + } + } + _fileName = ""; + UnicodeEncoding ue = new UnicodeEncoding(); + byte[] zero = new byte[2 * _MAX_PATH]; + for ( int i = 0; i < 2 * _MAX_PATH; i++ ) { + zero[i] = 0; + } + Marshal.Copy( zero, 0, _initialDirBuffer, 2 * _MAX_PATH ); + Marshal.Copy( zero, 0, _fileNameBuffer, 2 * _MAX_PATH ); + if ( _initialDir.Length > 0 ) { + byte[] initial_dir_buffer = ue.GetBytes( _initialDir ); + Marshal.Copy( initial_dir_buffer, 0, _initialDirBuffer, initial_dir_buffer.Length ); + } + } + } + + + public int FilterIndex { + get { + return _filterIndex; + } + set { + _filterIndex = value; + } + } + + + public OpenFileDialog( System.Windows.Forms.Control userControl ) + : this( "", "", "", userControl ) { + } + + + /// + /// Sets up the data structures necessary to display the OpenFileDialog + /// + /// The file extension to use if the user doesn't specify one (no "." required) + /// You can specify a filename to appear in the dialog, although the user can change it + /// See the documentation for the OPENFILENAME structure for a description of filter strings + /// Any Windows Forms control, it will be placed inside the OpenFileDialog + private OpenFileDialog( string defaultExtension, string fileName, string filter, System.Windows.Forms.Control userControl ) { + _filter = filter; + _fileName = fileName; + _defaultExtension = defaultExtension; + + // LipSync Character Config(*.lsc,content.xml)|*.lsc;content.xml|All Files(*.*)|*.* + // 竊・ + // LipSync Character Config(*.lsc,content.xml)\0*.lsc;content.xml\0All Files(*.*)\0*.*\0\0 + filter = filter.Replace( "|", "\0" ) + "\0\0"; + + // Need two buffers in unmanaged memory to hold the filename + // Note: the multiplication by 2 is to allow for Unicode (16-bit) characters + _fileNameBuffer = Marshal.AllocCoTaskMem( 2 * _MAX_PATH ); + _fileTitleBuffer = Marshal.AllocCoTaskMem( 2 * _MAX_PATH ); + _initialDirBuffer = Marshal.AllocCoTaskMem( 2 * _MAX_PATH ); + + // Zero these two buffers + byte[] zeroBuffer = new byte[2 * (_MAX_PATH + 1)]; + for ( int i = 0; i < 2 * (_MAX_PATH + 1); i++ ) { + zeroBuffer[i] = 0; + } + Marshal.Copy( zeroBuffer, 0, _fileNameBuffer, 2 * _MAX_PATH ); + Marshal.Copy( zeroBuffer, 0, _fileTitleBuffer, 2 * _MAX_PATH ); + Marshal.Copy( zeroBuffer, 0, _initialDirBuffer, 2 * _MAX_PATH ); + + _filterIndex = 0; + _fileOffset = 0; + _fileExtension = 0; + + // keep a reference to the user-supplied control + _userControl = userControl; + } + + + public string FileName { + get { + return _fileName; + } + set { + if ( value == null ) { + return; + } + _fileName = value; + string folder; + if ( Path.IsPathRooted( _fileName ) ) { + folder = _fileName; + _fileName = ""; + } else { + if ( Directory.Exists( _fileName ) ) { + folder = _fileName; + _fileName = ""; + } else { + if ( _fileName != "" ) { + folder = Path.GetDirectoryName( _fileName ); + } else { + folder = ""; + } + } + } +#if DEBUG + LipSync.Common.DebugWriteLine( "FileName.set(); folder=" + folder ); + LipSync.Common.DebugWriteLine( "FileName.set(); _fileName=" + _fileName ); +#endif + byte[] zero = new byte[2 * _MAX_PATH]; + for ( int i = 0; i < 2 * _MAX_PATH; i++ ) { + zero[i] = 0; + } + Marshal.Copy( zero, 0, _fileNameBuffer, 2 * _MAX_PATH ); + Marshal.Copy( zero, 0, _initialDirBuffer, 2 * _MAX_PATH ); + + UnicodeEncoding ue = new UnicodeEncoding(); + if ( _fileName.Length > 0 ) { + byte[] file_name_bytes = ue.GetBytes( _fileName ); + Marshal.Copy( file_name_bytes, 0, _fileNameBuffer, file_name_bytes.Length ); + } + + if ( folder.Length > 0 ) { + byte[] initial_dir_bytes = ue.GetBytes( folder ); + Marshal.Copy( initial_dir_bytes, 0, _initialDirBuffer, initial_dir_bytes.Length ); + } +#if DEBUG + LipSync.Common.DebugWriteLine( "FileName.set(); _fileNameBuffer=" + Marshal.PtrToStringUni( _fileNameBuffer ) ); + LipSync.Common.DebugWriteLine( "FileName.set(); _initialDir=" + Marshal.PtrToStringUni( _initialDirBuffer ) ); +#endif + } + } + + + public string Filter { + get { + return _filter; + } + set { + _filter = value; + } + } + + + public string DefaultExt { + get { + return _defaultExtension; + } + set { + _defaultExtension = value; + } + } + + + /// + /// The finalizer will release the unmanaged memory, if I should forget to call Dispose + /// + ~OpenFileDialog() { + Dispose( false ); + } + + + /// + /// Display the OpenFileDialog and allow user interaction + /// + /// true if the user clicked OK, false if they clicked cancel (or close) + public System.Windows.Forms.DialogResult ShowDialog() { + // Create an in-memory Win32 dialog template; this will be a "child" window inside the FileOpenDialog + // We have no use for this child window, except that its presence allows us to capture events when + // the user interacts with the FileOpenDialog + _ipTemplate = BuildDialogTemplate(); + + // Populate the OPENFILENAME structure + // The flags specified are the minimal set to get the appearance and behaviour we need + OpenFileName ofn = new OpenFileName(); + ofn.lStructSize = Marshal.SizeOf( ofn ); + ofn.lpstrFile = _fileNameBuffer; + ofn.nMaxFile = _MAX_PATH; + ofn.lpstrDefExt = Marshal.StringToCoTaskMemUni( _defaultExtension ); + ofn.lpstrFileTitle = _fileTitleBuffer; + ofn.nMaxFileTitle = _MAX_PATH; + string filter = _filter.Replace( "|", "\0" ) + "\0\0"; + ofn.lpstrFilter = Marshal.StringToCoTaskMemUni( filter ); + ofn.Flags = OpenFileNameFlags.EnableHook | OpenFileNameFlags.EnableTemplateHandle | OpenFileNameFlags.EnableSizing | OpenFileNameFlags.Explorer; + ofn.hInstance = _ipTemplate; + ofn.lpfnHook = new OfnHookProc( MyHookProc ); + ofn.lpstrInitialDir = _initialDirBuffer; + ofn.nFilterIndex = _filterIndex; + ofn.nFileOffset = _fileOffset; + ofn.nFileExtension = _fileExtension; + + // copy initial file name into unmanaged memory buffer + UnicodeEncoding ue = new UnicodeEncoding(); + byte[] fileNameBytes = ue.GetBytes( _fileName ); + Marshal.Copy( fileNameBytes, 0, _fileNameBuffer, fileNameBytes.Length ); + Marshal.Copy( fileNameBytes, 0, _initialDirBuffer, fileNameBytes.Length ); + + if ( NativeMethods.GetOpenFileName( ref ofn ) ) { + _fileName = Marshal.PtrToStringUni( _fileNameBuffer ); + _filterIndex = ofn.nFilterIndex; + byte[] file_name_buffer = ue.GetBytes( _fileName ); + Marshal.Copy( file_name_buffer, 0, _initialDirBuffer, file_name_buffer.Length ); + _fileOffset = ofn.nFileOffset; + _fileExtension = ofn.nFileExtension; + return System.Windows.Forms.DialogResult.OK; + } else { + return System.Windows.Forms.DialogResult.Cancel; + } + } + + + /// + /// Builds an in-memory Win32 dialog template. See documentation for DLGTEMPLATE. + /// + /// a pointer to an unmanaged memory buffer containing the dialog template + private IntPtr BuildDialogTemplate() { + // We must place this child window inside the standard FileOpenDialog in order to get any + // notifications sent to our hook procedure. Also, this child window must contain at least + // one control. We make no direct use of the child window, or its control. + + // Set up the contents of the DLGTEMPLATE + DlgTemplate template = new DlgTemplate(); + + // Allocate some unmanaged memory for the template structure, and copy it in + IntPtr ipTemplate = Marshal.AllocCoTaskMem( Marshal.SizeOf( template ) ); + Marshal.StructureToPtr( template, ipTemplate, true ); + return ipTemplate; + } + + + /// + /// The hook procedure for window messages generated by the FileOpenDialog + /// + /// the handle of the window at which this message is targeted + /// the message identifier + /// message-specific parameter data + /// mess-specific parameter data + /// + public IntPtr MyHookProc( IntPtr hWnd, UInt16 msg, Int32 wParam, Int32 lParam ) { + if ( hWnd == IntPtr.Zero ) + return IntPtr.Zero; + + // Behaviour is dependant on the message received + switch ( msg ) { + // We're not interested in every possible message; just return a NULL for those we don't care about + default: { + return IntPtr.Zero; + } + + // WM_INITDIALOG - at this point the OpenFileDialog exists, so we pull the user-supplied control + // into the FileOpenDialog now, using the SetParent API. + case WindowMessage.InitDialog: { + if( _userControl != null ){ + IntPtr hWndParent = NativeMethods.GetParent( hWnd ); + NativeMethods.SetParent( _userControl.Handle, hWndParent ); + } + return IntPtr.Zero; + } + + // WM_SIZE - the OpenFileDialog has been resized, so we'll resize the content and user-supplied + // panel to fit nicely + case WindowMessage.Size: { + FindAndResizePanels( hWnd ); + return IntPtr.Zero; + } + + // WM_NOTIFY - we're only interested in the CDN_SELCHANGE notification message: + // we grab the currently-selected filename and fire our event + case WindowMessage.Notify: { + IntPtr ipNotify = new IntPtr( lParam ); + OfNotify ofNot = (OfNotify)Marshal.PtrToStructure( ipNotify, typeof( OfNotify ) ); + UInt16 code = ofNot.hdr.code; + if ( code == CommonDlgNotification.SelChange ) { + // This is the first time we can rely on the presence of the content panel + // Resize the content and user-supplied panels to fit nicely + FindAndResizePanels( hWnd ); + + // get the newly-selected path + IntPtr hWndParent = NativeMethods.GetParent( hWnd ); + StringBuilder pathBuffer = new StringBuilder( _MAX_PATH ); + UInt32 ret = NativeMethods.SendMessage( hWndParent, CommonDlgMessage.GetFilePath, _MAX_PATH, pathBuffer ); + string path = pathBuffer.ToString(); + + // copy the string into the path buffer + byte[] zero = new byte[2 * _MAX_PATH]; + for ( int i = 0; i < 2 * _MAX_PATH; i++ ) { + zero[i] = 0; + } + Marshal.Copy( zero, 0, _fileNameBuffer, 2 * _MAX_PATH ); + UnicodeEncoding ue = new UnicodeEncoding(); + byte[] pathBytes = ue.GetBytes( path ); + Marshal.Copy( pathBytes, 0, _fileNameBuffer, pathBytes.Length ); + + _fileName = path; +#if DEBUG + LipSync.Common.DebugWriteLine( "ExtensibleDialog.OpenFiledialog.MyHookProc; SelChange; _fileName=" + path ); +#endif + // fire selection-changed event + if ( SelectionChanged != null ) { + SelectionChanged( path ); + } + } else if ( code == CommonDlgNotification.FolderChange ) { + // This is the first time we can rely on the presence of the content panel + // Resize the content and user-supplied panels to fit nicely + FindAndResizePanels( hWnd ); + + // get the newly-selected path + IntPtr hWndParent = NativeMethods.GetParent( hWnd ); + StringBuilder pathBuffer = new StringBuilder( _MAX_PATH ); + UInt32 ret = NativeMethods.SendMessage( hWndParent, CommonDlgMessage.GetFolderPath, _MAX_PATH, pathBuffer ); + string path = pathBuffer.ToString(); + + // copy the string into the path buffer + byte[] zero = new byte[2 * _MAX_PATH]; + for ( int i = 0; i < 2 * _MAX_PATH; i++ ) { + zero[i] = 0; + } + Marshal.Copy( zero, 0, _initialDirBuffer, 2 * _MAX_PATH ); + Marshal.Copy( zero, 0, _fileNameBuffer, 2 * _MAX_PATH ); + UnicodeEncoding ue = new UnicodeEncoding(); + byte[] pathBytes = ue.GetBytes( path ); + Marshal.Copy( pathBytes, 0, _initialDirBuffer, pathBytes.Length ); + + // fire selection-changed event + if ( FolderChanged != null ) { + FolderChanged( path ); + } + } + return IntPtr.Zero; + } + } + } + + + /// + /// Layout the content of the OpenFileDialog, according to the overall size of the dialog + /// + /// handle of window that received the WM_SIZE message + private void FindAndResizePanels( IntPtr hWnd ) { + // The FileOpenDialog is actually of the parent of the specified window + IntPtr hWndParent = NativeMethods.GetParent( hWnd ); + + // The "content" window is the one that displays the filenames, tiles, etc. + // The _CONTENT_PANEL_ID is a magic number - see the accompanying text to learn + // how I discovered it. + IntPtr hWndContent = NativeMethods.GetDlgItem( hWndParent, _CONTENT_PANEL_ID ); + + Rectangle rcClient = new Rectangle( 0, 0, 0, 0 ); + Rectangle rcContent = new Rectangle( 0, 0, 0, 0 ); + + // Get client rectangle of dialog + RECT rcTemp = new RECT(); + NativeMethods.GetClientRect( hWndParent, ref rcTemp ); + rcClient.X = rcTemp.left; + rcClient.Y = rcTemp.top; + rcClient.Width = rcTemp.right - rcTemp.left; + rcClient.Height = rcTemp.bottom - rcTemp.top; + + // The content window may not be present when the dialog first appears + if ( hWndContent != IntPtr.Zero ) { + // Find the dimensions of the content panel + RECT rc = new RECT(); + NativeMethods.GetWindowRect( hWndContent, ref rc ); + + // Translate these dimensions into the dialog's coordinate system + POINT topLeft; + topLeft.X = rc.left; + topLeft.Y = rc.top; + NativeMethods.ScreenToClient( hWndParent, ref topLeft ); + POINT bottomRight; + bottomRight.X = rc.right; + bottomRight.Y = rc.bottom; + NativeMethods.ScreenToClient( hWndParent, ref bottomRight ); + rcContent.X = topLeft.X; + rcContent.Width = bottomRight.X - topLeft.X; + rcContent.Y = topLeft.Y; + rcContent.Height = bottomRight.Y - topLeft.Y; + + // Shrink content panel's width + int width = rcClient.Right - rcContent.Left; + if ( _userControl != null ) { + rcContent.Width = (width / 2) + _PANEL_GAP_FACTOR; + } else { + rcContent.Width = width + _PANEL_GAP_FACTOR; + } + NativeMethods.MoveWindow( hWndContent, rcContent.Left, rcContent.Top, rcContent.Width, rcContent.Height, true ); + } + + if( _userControl != null ){ + // Position the user-supplied control alongside the content panel + Rectangle rcUser = new Rectangle( rcContent.Right + (2 * _PANEL_GAP_FACTOR), rcContent.Top, rcClient.Right - rcContent.Right - (3 * _PANEL_GAP_FACTOR), rcContent.Bottom - rcContent.Top ); + NativeMethods.MoveWindow( _userControl.Handle, rcUser.X, rcUser.Y, rcUser.Width, rcUser.Height, true ); + } + } + + /// + /// returns the path currently selected by the user inside the OpenFileDialog + /// + public string SelectedPath { + get { + return Marshal.PtrToStringUni( _fileNameBuffer ); + } + } + + #region IDisposable Members + + public void Dispose() { + Dispose( true ); + } + + /// + /// Free any unamanged memory used by this instance of OpenFileDialog + /// + /// true if called by Dispose, false otherwise + public void Dispose( bool disposing ) { + if ( disposing ) { + GC.SuppressFinalize( this ); + } + + Marshal.FreeCoTaskMem( _fileNameBuffer ); + Marshal.FreeCoTaskMem( _fileTitleBuffer ); + Marshal.FreeCoTaskMem( _initialDirBuffer ); + Marshal.FreeCoTaskMem( _ipTemplate ); + } + + #endregion + } + +} diff --git a/trunk/LipSync/EditResx.pl b/trunk/LipSync/EditResx.pl new file mode 100644 index 0000000..2d68c6c --- /dev/null +++ b/trunk/LipSync/EditResx.pl @@ -0,0 +1,14 @@ +$file = $ARGV[0]; + +$index = rindex( $file, "." ); +$newfile = substr( $file, 0, $index ) . "_.resx"; + +open( FILE, $file ); +open( EDIT, ">" . $newfile ); +while( $line = ){ +# chomp $line; + $line =~ s/[\\]/\//g; + print EDIT $line; +} +close( FILE ); +close( EDIT ); diff --git a/trunk/LipSync/Editor/AppManager.cs b/trunk/LipSync/Editor/AppManager.cs new file mode 100644 index 0000000..fb4a32d --- /dev/null +++ b/trunk/LipSync/Editor/AppManager.cs @@ -0,0 +1,468 @@ +サソ/* + * AppManager.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace LipSync { + + public static class AppManager { + public static bool Playing = false; + public static SettingsEx SaveData; + public static EnvSettings Config; + internal static List m_commands = new List(); + internal static int m_command_position = -1; + private static readonly Bitmap m_author_list = null; + /// + /// telop縺ョ謠冗判縺ォ蠢隕√↑譛螟ァ縺ョ繝医Λ繝繧ッ謨ー + /// + public static int MaxTelopLanes = 0; + private static bool m_edited; + + /// + /// Edited繝励Ο繝代ユ繧」縺悟、画峩縺輔l縺滓凾逋コ逕溘@縺セ縺 + /// + public static event EventHandler EditedChanged; + + #region _AUTHOR_LIST + private const string _AUTHOR_LSIT = "iVBORw0KGgoAAAANSUhEUgAAATIAAAKQCAYAAAAc+va9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYA" + + "AICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAOCZJREFUeF7tnc/LRW1X1yUiREQQQRQHgkS8BOLAiRDJE1SDEKFZieRM" + + "IifhIEiCl5pa2CwKtSQImhQ1iKShgqX+BeaP9z95O+vtrMf1fJ+1rh9773PO3vv63HC4zzn7+rHW59r7e6917Wtf93d9Fz8QgAAE" + + "IAABCEAAAhCAAAQgAAEIQGATgT961LJX62ekTFb/Zx9f/s6zfWvD3v/KJiupBAEIQKBBYESkRspoFz//+OLbz5fX98+/yohAAAIQ" + + "OJKAi8yPPRq1V+tnpIzX93a/eHzxvY/Xjz5e33y8/uzx+tPH6weOdIK2IACBtQmMCJmW8c+/9EDn7y0Ciz/2vUVg//zx+sbz5ULo" + + "n//3s/4PPyvab09B7avYtqeo9vsnpS/r28v++trDifcQWJPAjJA5IRcpE6r43ubE/MfSR08lLQr714+XC9b3P96bqP3nZxkXQU9H" + + "XYyqfkzM/Mf6dDu8PPNwa57LeL0wgRkh84jKBcOEyL77j08x+YPH7+8LLE1QTMTiXFmMmFy4/ueznf/6LPsLz8+Wglpd7+fvPT9b" + + "m5aqfvfjZaJmZb54vH762Z/Z8UMLjymuQ2A5AluFzOr91ONlaeJffwrIt56fbU7Mf37w8ebXHi875oL2m8+Dnkr+ybPeHz9+W7sm" + + "htaufW+fTSw9HTUR835MzNx+69PKxPSVebjlTmccXpXAEUL2E09BcUEygYk/JigmMCZoJmYmRh4xeUT1T57H7POPiLC5kFkds9cE" + + "z0XL7bc+7bvvebwsUrM6aseqY4zfELg9ga1CFlO+f/UUod8NEVG8IeAQbT4rRlQmTD6XZumgtWmfYwrrEZnfUVV7XQh/8VHP2vfj" + + "tx84HIQABP6cgM93mcDYy4XAfvuPikechI9zYH83iJDNj8W5sVjnHz6jJxOnL0I5K/93nsdi2hiXfagtPtnv9lsb3LnkDIfAYgRc" + + "GGaFzOp98/H61uNlKaVN3Nt8mKV3ntKZmFmkZW1bOmjRkwmPpX8qTiZA1paniNZWFi1m31nfdmPA6v/W4+WpZW9d3GJDjbsQuD8B" + + "n4dygYm/3fss5YtrxPx9nOy3+bFqHZnf4fT08A9DWRM77TeOgi7OzSb7uXN5//MWDyHwFQKZgKlYVHNXvi7MjsflF96BiZlFWl7f" + + "3kexcyH75aeQaSSVPVGQfWd9+/eIGCc4BCAwRGDmkaWRBj2t5G7jCC3KQAAChxB4lZBlUd0hBtMIBCAAAQhAAAIQgAAEIAABCEAA" + + "AhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEI" + + "QAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABDYT" + + "+Pbmml+teFQ7mTmvbHvW/ZYtZ7Jz1i/KQwACDwKvvIhf2fbs4CFks8QoD4E3EvjGjr7ixb2nncoEb/8Vbc+43fLz1Qxm7KQsBJYi" + + "oNGFffZXD0Qspxdx1k4WycTvqr5H2jZbvVxmf+uY1638bvkZGWkf6pvyjOV7rDkOAQg0CLQuttEUKl7oFjFl4hiFxs0Z7XumXFVW" + + "RWqmzWhvKzL0PmLUWIlViy0nLAQgMEkgXpgqSHZBZqmcXoRRvKpjsYy3GS/y2I+XzcpF96pysZ62ocdG7PU+Mx+yiMz7iPapAGqU" + + "ae18Om2ePHUoDoHzEMgiDE3x9ALLLkL7zi/cWD+L1jRqy8qrwGpE1xI5F+AsGsqOVfa2/GwJfPwDoDao74jXea4FLLkogSq90ou9" + + "mttRMYlik12gWYQyWqcqV4lVLF8JUq/vkSgqS5NbqSVCdtGLBbPPS6A1T+QXeZZeVumoCkMUriiOHr15OhXb0zqZjZWAxna1XuuY" + + "21H1HSPNmGZqWtkSvpbgnvcMwTIIXIBAduFpWlnN3cSUsdVOL5qLohTbrCKdzD6NvqKI9Y5pOpzZm6WHlV+VfZUYqq0XOG0wEQLn" + + "JBBToSolzCzXeq12tN0s0svKZBGQltPUMUvtYtQ10mblS2Z3ZNPySyPRc54NWAWBixKoRKZ30ao4tNpRNNUkt/fZErXYbzXnFFNZ" + + "Fa7Kr6rvnp8qZGqfRpcjIn7RUwmzIQCBrQQ0tY3ttI5t7W+2nqbMlYjPtkt5CEDghgRaAnEm8TiTLTc8DXAJAtcmcHYhG0nVrz0C" + + "WA8BCEAAAhCAAAQgAAEIQAACEIAABCAwSqC1CHTrsdG+W+VYnHoERdqAwCIEPilWiyDGTQhA4NUE9q77evXyhVe3/2q+tA8BCLyB" + + "wOjD1dUzk2ZifP4xi/D2PJP5BgR0AQEIXJ1AFLJMrHo7VbiQ6Q4XzqUngKP1rs4Z+yEAgRcSyLa0se7ic5Oe3mWi1isXTfeysT3v" + + "ywWxOvZCBDQNAQhcnUBrq6AYralgZZGcPhweRUn70fZa7V+dMfZDAAIvJqCCFCfXq/mznuj00tVWxFcdezEGmocABK5M4J1C5lFZ" + + "K3JDyK58NmE7BD5EIIu6WilhJjStyM3nvnQurppbQ8g+dCLQLQTuQCCmlCMbKbrPo/W03JZ6d+CMDxCAwAsJtMQr7tbaKxdNzMr6" + + "dwjZCweTpiEAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCDwcQKf2GPsFRshvqLNjw8OBkAAAmMEXi1k1VY9Y9aNlzpK" + + "yI5qZ9xySkIAArsIxIs225RQV+Fv6awlZEdthNjzY8ZuhGyGFmUhsJNAthOFNRkf76lEJNuOR0VltJ1eRBefmZyxT9tt2aNC1vJ7" + + "1l632f2Iw4bo7TyJqb42geoijxedE4pl9X0r4ooXbnzWMYpR1oeOjPaxtV0VkswvtbOyrydmVk/3Ohvxde2zEu8hsIPA6AaEevFm" + + "D2Jn0Ua8oDOh0P4zIYuPLWXClqWYo35plBf71wfaXaDcngy72ac7bni5ytejUuQdpwFVIXA9AjGtrCIcvRizeaR40bYiqShgWd9V" + + "ZFf1GQUl1t3il9vmvoxEmaP29uy/3pmDxRA4CYFeWhmjhyxayVKman7MBadK4xTJTDsz6WpLUPSYC1qWClaRVlU2E7yWUJ7kFMEM" + + "CJyfQHXhqjBUQhEjGBW93gUdhTGKQkwde+mppmmtPjPhaQmg2hTtVbuy9DJLe13MtS3SyfNfK1h4cgKagmnkVEVdMQ3tpWDZBaxz" + + "Tq1Jc7/wY4Q0IhTRtxG/qqgpCk3GK/oXxTSL6CK3THhPfrpgHgTOS0Ajgvh59Fhr0ju70Ef76KWco/apDTP1enUz/6oItdXvec8Q" + + "LIPARQjElG5GZKKAtVKk3gVcpZSZkG2xT4V2j5C5cI3YnAl8VY8U8yIXC2ZCAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAA" + + "AQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAE" + + "IAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAROQKD337lfYWL2n7Jf1c9R7bY4bWX47npHsaAdCHyU" + + "QHbhbL2Ytjryzv6O7Ash+/8jfiTTrecQ9RYn0BKyd/2H6mhD9h+0jxoi7WdPu622tvaztV4Uk3eNWWSHkO05k6j7NQKenumJVX2O" + + "5f0C8LJVqtfroxelaLuZDdnQjvQb+87sV98qEe/5rlGIsYt1VJAq272daJf7ngnSLANva6Rer2y0NeNs30WbZ/rkUobAlwRa4jVy" + + "LAqZl/cLNJ7k1V/i6uIfrWvlqmiiZ39LwLJjesHN2KjikzGq+KkAVnZXIjbCfs+Y9Ti3+o/j12un9ceOSxoCXxLwk1mjrOyz/yX1" + + "lC5ehH7h6cXhJ238K6z1KrGo6nr/ehHrST/im/ZdcYhttfqpjqkwRd9ax1o8M0HP+o8peDVmekn02EVuPTbav54/MbIcPU+4hCHw" + + "ZWqjIX28aLL0MZ5w8eLTE1PTJS0bL6aWGFViWkVk0Z+eb+qrfs5s9O9a/VS+qyBF3/xY1q6KnNYb4adC4fwyn9UGFdw41lnZzP8s" + + "iu35nI0Ply4EviTQC+Wzkz67mPSE1dRHxSaKgApiloZkUVrrIlGx1CFv2asiU/WjPqiIZDa0uPSYqQCosLcispZtKk5ZRJjZltXT" + + "uhrxZWObiWNvvLiEIfAVAtkFnYX6/td29GKavWBbUVU81rqgqpM/+pP5lkVH2k+WgmUsYlpVRThZvRbfmTariCwTvZE/PlFkZthp" + + "2Vb/WaRd+VydJ1zWEPhaaqnCkUUefuFlJ2EViejF2oua4gX/6rqVUEUxiqlTPG00LcoEtYreol+ZDZnfzm0kIoxlq+i7NYbqs4pz" + + "Nkajfug5NGMrly0EUgL6lzx+1vfVseyv5WjZLPVRsag+H1m3x6F3fMRGj1a87Fa+rXo6yEfYrePbanOm7J52uJwh8DUCfoHpheYn" + + "pZ9wWy+82E7v5M2GJ9rXErk9dUcu+MqOln8thqPHMsGOYzUi6NXY9v5oZD637GmdQxnj6rst5wmXNgQgAAEIQAACEIAABCAAAQhA" + + "AAIQgAAEIAABCEDgKwR0yUKFZ7QceCEAAQi8ncCoQI2WcweqBbdvd5AOIQCBNQiY6PgygGwFflw0qgtcK4HTxaxGclYM16CPlxCA" + + "wCEEqhX9sXFdza7HslX1USCtvIklYnbIkNEIBCDg0ZFGV62FwC5K2aLibHGoPp4TI77ewlZGCAIQgMBmAlGstJEqIosRVhS0WD4K" + + "Vyuy22w4FSEAgbUJ6KM5WeqnYpWlnC3hQ8jWPsfwHgIvJ5BN5Fe7SPg818jcWS+CI718+dDSAQTWINCaeNflE3GyXsXvCIFbgzhe" + + "QgAChxJQEdNJfP+cCZpGZHp3Mh7XyIs5skOHkcYgsDaB1rxXNQeWTey7iFXRHUK29nmG9xB4OYFWJKWdxzVg1eR9b95rVDxf7jgd" + + "QAAC9yKQTfZnHurK/7gGLc6RZRGYls3m1O5FFW8gAIG3E+hFUll0NvJd5chsf28HQocQgMA1CWST/S1PshX+o+WvSQirIQABCEAA" + + "AhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEI" + + "QAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEI7CIQ/1t4fL+r" + + "USpDAAIQOIrArDDNlnc7t9Y7yk/agQAEbkxgRmBi2dn/HD7Tz41x4xoEIGAETBD8pUSqYy4iWi+Wd2GKZb0/jap6/bTKRwHstaMp" + + "beU3ZwYEIHAhAhrVtOauMhHI0jwvF4WsateFRMWoSh+zdlQwK5tGfbvQ8GEqBCCgImaC4K/smH2nohE/63ttK6uromdlev3YyMVy" + + "/j6O6Eg7sW+3lbMCAhC4GIHW/FR2LF74KgKaPrrYxFQyEzZtR8tn0Z2mpypkPcFspaKz83QXG3LMhcD9CKhIRA+zYyNipQLY+lwJ" + + "adVPlRpGIctS1J5NWUR3v9HGIwjclEAV7WhUpBHQiDhl81YqGD4/lkVvWZ8j82NZvy1743wa6eVNT3Tcuj8BFxOdE3MhiWITL/qW" + + "+MzMcbX6ceHTCC1+P3PHsirbSrHvfwbgIQRuQkDnheLnVxyLIujvR/vRqKlVL+snDlk2H8Yc2U1OatxYk4ALRHVxZ2lXT3xmBXHE" + + "hlERHLE3iihp5ZrnPV5DAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACELg3" + + "gew5Tn2mU5+j1Gc7s2c9700N7yAAgdMQ6AmWGxqFTHe3qLbtOY2TGAIBCNybQLZ1TtxiJ9vSx4homSh4PNB973MG7yBwOgIxrdR9" + + "x3ybn2p/Md0osdo48XROYxAEIHAvArppo3sXRSmWqTZ51I0SicrudZ7gDQROTSAKk4tX3Conbr6YRVw9YTu18xgHAQjch0Bv91mP" + + "rhCy+4w5nkDglgRmdnCNk/0xFY1gSC1veZrgFATOT6C382tLqHpCeH7vsRACEIAABCAAAQhAAAIQgAAEIAABCEDgjgSy/4Fpfo48" + + "F1nVdU6t4/o4U7bottf+HccDnyAAgUkC+pB3JkAjYlR1O1sX4ZocQIpDYHUCow+C63OUMVrTtWVVVFX1ZW15+1nd1h3S1ccP/yEA" + + "gZA6xhRSBScul8iiperRJY3sdNlF9hB6HJRMPBk0CEAAAiWBTLw0OvLKmSDFqCmu7tdHmbycCmcrihuZp2NoIQABCHxnUl9TuNaK" + + "+/jgtwtNVb6K2Kq5uSqNZZggAAEIpASySEgLZtFWTBtVkKq5sFYk50IaBTX7jseZOJEhAIFuaplFWjqZr3NfWTQXxWw0Issm/Nny" + + "h5MWAhDoEojRVLU1jwpXS8jsWGzHPveELLuZEL+Lc25dhygAAQisR2AkLYwT9P4+kmrdtYzzXdVdy14UmInaeiOFxxCAQDelVDHK" + + "UrqZyMo7HBUyFVTtnyGEAAQg0CWg82AqJHEJRC+y0s5mBTDaondSu45QAAIQWI9AJWA6D9ZK71qp5agAtoSUdWTrnZd4DIFdBKoI" + + "KE64V0sgeksjZusRje0aSipDYD0CPdHoiZQRa5XJbhLEebT4Pivbs2+9EcNjCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQWJJA" + + "a6ucDEhVfqasPkBudWfaXXKgcBoCEJgjkAlNq4WZ8keURfTmxpPSEFiGQPbsZG95hD5Q3loTlpXNyld2xIGoxHBGJJcZWByFwGoE" + + "VAh668Rmyh9ZNj41ENeS2fc9m1cbU/yFwFIEZoQmm9NqCchM25o2Zu3OPqe51EDiLARWI9Ca6G89y5gJk363pe2Rdl1E7ffsg+qr" + + "jS/+QmBJAiMPYmdiE+e1KnC9tmfa7U32k14uefri9OoEqol4fZaxlyJmc1Qjbc+2W6WWPo4I2epnNP4vSaCKhlowRueuZtseabea" + + "7G/dZV1yYHEaAisRiGIzEs1UZbJIaabt0XZ7EdlKY4evEIDAk8BeYdD5ryhIe9qu2t3TJoMOAQjcmEA2gd6buK8m8LO7idp+1nav" + + "jLY7Ej3eeMhwDQIQyAjsFYbekwBbqVft7rV3qz3UgwAETk4g3qnsTZ5r2Z5ro23Pttvrl+MQgAAEIAABCEAAAhCAAAQgAAEIQAAC" + + "ENhCQBeyWhv+XfZc5ZY+qAMBCEBgE4FMoLKGELJNeKkEAQi8gsDW6EkXnWYr9H35Qywb14LN+LNHYLWf3nq0GbsoCwEInIBATAdn" + + "LvBMkDJxi4tiZ0Vz1J7RcjH9jehHRfIEw4UJEIBAlSLahVxFT3rBq4D57hUuEtVD3bEPKzuytU8mNr1Frq3Hk1Sw4no0xIzrAwIX" + + "JpBFUb0LXNNIFcLsEaS4eFafteyJk4vlyAJct6W1S4YLqQplz44LDzOmQ+DeBKKQxegqRmgtYdI6GnnFdC4TolYE9aqIrCVyiNm9" + + "z3e8uyGBOD8WBSlGLCOT+jqZr/VH0r2egBwheEfYccPTAJcgcG0CCNmfj9+oUF57xLEeAjckoJGUR0U6h9WK0DR1dEzZTYCYrmY3" + + "DVqIR4Vma9Q12v4NTwNcgsC1CaiQZRdzljbqZHlWrxIyvTvogvaO1NJFN5vziwJ87VHFeggsRiCmltlFnt2ddETxWC+aaYlh6y7j" + + "0ZP90XaNCBGyxU5+3L0XAb3L6JGURk4xitEUsScC2Q0DF5JYtxeVaSTYGoleW9nxXp17jTzeQOBmBHRuTC/o1udM4Co8rbKjInJk" + + "OV8Oki0LudkQ4w4E1iBQRSgjwjEqBJkgjtZdYxTwEgIQgAAEIAABCEAAAhCAAAQaBPTmQQtWVja7SwpwCEAAAm8lMCpkVTmE7K3D" + + "RWcQgEBGoLfWzOqoWMVlHt5m/G7kRgSjAQEIQOAwAiNCFsVMF+v6sezxqcOMpCEIQAACI/NeI1GUPlHg7WZp50h7jAwEIACBQwjE" + + "R4Kqx4NiROZPGGTpZeupg0OMpREIQAACe+bIVPBc3OL38YF0aEMAAhB4G4E4R6aPBmW7UVSPM808EvU25+gIAhBYg8DoZH+c1I+C" + + "5w+3624ZzJGtcf7gJQROQWBEyPROZbZ2LLubeQoHMQICELg/gS1CFufCtD7zZPc/Z/AQAqcjsEfIomjFu5m6l9rpnMYgCEDgmgSq" + + "ZRat79XTajFstWyDebJrnitYDYHLEhgRHS+T3aHsfXdZMBgOAQicj0C2xKL3nXpRCVps53yeYxEEIAABCEAAAhCAAAQgAAEIQAAC" + + "EIAABCAAAQhAAAIQgAAEIPA+AiPbUrs12a4W0dLRrazjGrPRrYHeR4SeIACByxFwIVHDVeAywWuVGRHIqszlIGIwBCDwWQLVA9zx" + + "caRsE0RfB5ZFYfo4UozosgiutTbts3ToHQIQuASBKGTZXvr6YHdr37FM/LLdYQ1MJXaXgIaREIDAuQio+Kjw9ASnEq9eRGcUZp7d" + + "PBc1rIEABE5F4NVCpnNwVdR3KigYAwEIXIuAbs3j2+q00sRqnkvrxC164nudM2OO7FrnDNZC4HQEXilkPhemc2KZkJ0ODAZBAALX" + + "IaBCFueuohC1IioVKp1Xy9JJ7yf2cR1qWAoBCJyKQCZklci0FsRmO8BWIsWC2FOdAhgDgfsQyDZL9Lmr6GVVripTbcKYba54H5p4" + + "AgEIfITAiOC4YTo5rwaPilTcdLGa8P8IDDqFAAQgAAEIQAACEIAABCAAAQhAAAIQWIZAb4eK2d0pZss76K31lhkoHIUABNoEWtvz" + + "zArMbPmekG1tjzGHAAQWJKAPiuvWProDRoWoWpOWle89MI6ILXgi4jIE9hKIYqZCpqLSEqHqWMu+7DGpWL5aGrLXZ+pDAAI3JpBF" + + "ZO5u9bjRVuHxaC9u1BgX4iJiNz7RcA0CewnEyCm25d+7wPhnK1NtqtjavUKPHR3N7eVAfQhA4AYE9LlHc2l0jmxmTmwmtcxE8wao" + + "cQECEHgVAd/VorczbPbc5R4hi6lkFaX1HoV6FRPahQAELkYgm2jviZq7uEfIYso6M/92MbyYCwEIvINAFKN4d1LnyFrrzWYm5KOA" + + "9ebLsijwHUzoAwIQuBiBKqqqdrDI7lrOCFnEo2mtHmOu7GInE+ZC4BME4qR+a+udaq5qT2oZF9lmdz1bIvcJVvQJAQickMCWRa6Z" + + "G730sLVCv1eXiOyEJw4mQeCsBOIGh1ts3JpaZpP82v/etrf4Qx0IQOBiBFQoRha3Zi5uredRV6v+xZBiLgQgAAEIQAACEIAABCAA" + + "AQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAE" + + "IAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgMCDQOs/jQMIAhCA" + + "wBSBTwnKSL8jZaacpTAEIHBPAp8SC+9X/6N5pPwp2+450ngFgZsSMKHwlwuKi0cUkVguExo/rph69ay89ZuVy2yz8r02Eb+bnqy4" + + "BYEWAY2MVJRUGDKB8/b1WBVdzZZTka36Q8Q41yGwKAG7+E0o/KXCFlM/j55UWOLn+D625e17VOXRWMSeta92efmeLa2UddGhxm0I" + + "3JNAjGAycdK0L0ZrfswFST/HqKlVL6aKsZza1rNVRfOeI4ZXEIDA1wj0xKKXVsboKEZa2m4Uuapc/F7ft0QyK8tQQwACCxHI5sc0" + + "dctSORWmSqgiSk9hq/mxmCpmwtWyNYvWFhpGXIXA2gQ8lavmvDza0TuFLaHxVFNTxphqqjhW7bv4VWmqtsm82NrnM94vTkAFYOZz" + + "q2wmLP6d3kSIQzB6zEVTU9zFhxP3IbAmgXhHUcUhioSXmxWa0XpVuUws1ebK7jVHFK8hAAEIQAACEIAABCAAAQhAAAIQgAAEIAAB" + + "CEAAAhCAAAQgcDYC2WNA+nB4y+ajHsY+qp2z8cUeCEDgDQT2CIjX3dOGu3hEG2/ARRcQgMAZCWS7UMQ1W60V8VHI9q6c18eMzsgK" + + "myAAgZMS2CMgGpHp40xZtKWPHGmZ2EaW4sY+syiuat/6aR076fBgFgQgMEJg6xyZPowdn31UgalS0OwhcX3I3AUoCl5WT8tl9SIP" + + "UtmRs4MyELgIga0RWUvIXESynTAcS9zRIopO9shRJpIxcssiQX2kqWfvRYYLMyEAgYxAb44sS8daUZwKTCYg2ma1Y0avnNarRNnL" + + "qd3GY+/cHmcVBCBwAgJbIjIVp5j2aXQU269SzkqQsvkztTdrPxOnlsidYBgwAQIQ2ENgVMg8VVMR0zucmgbGrXl0bsvLtoTMoyjt" + + "XwWziuoyMYxpLRHZnrOHuhA4CYFWmthKRau0rCVkPhemk/+t1FLnz1oRWWw/m8zP0uSTDANmQAACRxCYjUx65ePxbALfbfZIK36u" + + "3s+0GZmM1juCI21AAAIfJKApot71U9P2CJlHczHtzMRrtpyKl4qkimfPhw8OB11DAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAA" + + "BCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQ" + + "gAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgcAIC2X+sPoFZm0y4ky8O4I4+bRpcKkGgReBO" + + "F8rVfbm6/VuutBV93sKJOg0C8SS6+n+lvoMvrYv66uNTnYYIGRK1m4CfRPbbX7FRPcmyz7ENrZu1mRnd679qJ37fE7JeH1UqV/Vh" + + "5UeOZRdqZkv8zkWr4l2NS49TTzSysexxm+0zO+fsuyjUI33G8Ro9z3ZfMDRwTgJ+AuhJ1Lqos2N6IvUEcFQsW+3GPmK5LHJp2TN6" + + "rGeL2lP5ONJfJmS9elX/s2Mx48eWPiuOLfFW0Ro5P895xWHVSwj4iegnkf2Ofx31ePYX2wzzevF9rGvHR1Kjkf5jXw5F+1dYKnTR" + + "ni0+qjjE/qtj8UKt2Dh7t6/HWy/++Hmkv4xTHMM4ZnvHpmdra1xbdbecZy+5mGj0cwT0JPB0KROneCxerHrxtFKEKlpyoVHBUfuy" + + "C7vVfyVosd0RIdM+Wv6rL+pTlRJVbUbuPi6tcapEPdoV28kiR28j8yWzpxLyTIAy9voHcPR8qFiO/NH83FVHz4cSyC6cllhlaUQv" + + "BdLIoooA4gmZvdd+KvHJLlD1s3XRzfrY8r8S7RhFbrVl5I9KT3BaYzES4UY/Mnv0D1pmj46NjmsmsvpH1j9nEd2hFwyNnZNAFilk" + + "F7KfgLMXuZ6EMZ2rxCqmVtVJnkUjlSjrxRP71RM/8tA+tJ2WkGZRZEvQ3efRNitbsgs8clHfVWhbohLTyhitjQh5dU5lYjnKrhKt" + + "eP6c86rDqsMJ+EmjKUf8Sxsv7uxCq9KVLDXIoqUokiqsvairZVsWbWR+xouyEq8ZH+OFrcIYhSSzxb/rzQepOI1yUnsqIWtNDegf" + + "oMxHTUuzqEo5zfRZlW39MTv84qHB8xHIIqV4suj77JheTJVoZelWVrbqX8u2bFPSWd/+3V4fR/xv+RT9Uju3sGhxin+osrOx1b9G" + + "g3ruHGHrnvOh59v5rj4sOoxAvJgzUfMTK0sj/MT2etlFUB3LhCYr27uwos2VUMYTvGerXqzqYxYR9dqsRLTytycIvT8+lRiMjEXP" + + "1izy6Z03M2OYjVU8V3r29c6Bwy4cGro+gZnU8aretnxcwf9q3LLo86pjjN0Q+Nq6sDv+Jdya5q1wetxxvFcYN3xMCMRU5a4ndsvH" + + "FfyvTvy7jjcXOgQgAAEIQAAC7yJQLWHQ7/fYc2Rbe+ygLgQgcFMCW4RsVphmy4+gfkWbI/1SBgIQOBEBvduoC1Nbd+RmReQVd/dm" + + "bTgRekyBAASOJlCJTFxTF/scXTXeEspMhPy7EYEateFoVrQHAQiclICJgt5xbC2snRWR0fKxXE/MRts8KXLMggAEjiSg4lEtbs0i" + + "stElBy2h1Da8bM+OV6SqR3KlLQhA4I0EZiObmP71oiZ3Q+u06rmAWV0XNX9ftfdGXHQFAQickUAW2WRpZhSRWEdFqZr7iqKkwuSf" + + "o4iZDTGSU1GbteGM7LEJAhA4iMBsiqblRwTKTY03D1yoMjeigNnxWFbfa+SWieRBqGgGAhA4IwFNK3upopavRMXFR0VFd4VQEYyi" + + "5W3HKK1qLxPXaMMZ2WMTBCBwEAGd6O81m82njYpIdmOgigZbUeIeG3r+cRwCELgggWqeqbobmQnMaBvZ3UlNOSPCGK3FObs9Nlxw" + + "iDAZAhAYJeAi42lc/K3ikqVsmv5VaV3VbhWtzUZxmhqPLg8Z5UQ5CEDgxATiBT9y8WdlZttoRWMRVWXPkTaceGgwDQIQ2Eqgtfyi" + + "irb8+1Eh1In/ytYZIZuxYSsb6kEAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEliGQLeVofbcMGByFAASuQ6D3uNN1PMFSCEBg" + + "WQJxBb6uzK82cRxZurEsUByHAATeT6B6dEkjNSK3948NPUIAAoMEekIWH4sabJJiEIAABN5LwIWs2ipI9yMjrXzv+NAbBCAwQCDb" + + "pSLbv8ybQsgGoFIEAhB4LwEVsihiuqEiIvbesaE3CEBgkEBr3zAVssEmKQYBCEDgvQSqnWPNCo/OiMTeOyb0BgEITBCoJvh1Poyl" + + "FxNQKQoBCLyXQLxj2du1Ndtd9r3W0hsEIACBBgFNHWc3SQQuBCAAgY8TcOEa2Q12pMzHHcIACEAAAhCAAAQgAAEIQAACEIAABCAA" + + "AQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACCxOI/zhEMVTHWiv8db+y3s6xrf4XHhZchwAERgm0RKZ3LB7X99Uxs2v02KgPlIMA" + + "BBYnoA+BV6vwdVeLbAcM3eI6rv737X1aD52zc8biJyPuQ2APgSy1i6Kkx3U3WP0cRS62k22BXW0JxDZAe0aUuhBYlED2D0Oq1DLb" + + "1joKUm/jRUNcRW9Z3UWHBLchAIFRAlmqV4map4dbhMznxmK6GefLKmEb9YNyEIDA4gRGUksVnVZKWEVVLoQxIvN2de8yUsvFT0rc" + + "h8AWAq39xeIxvRkwWi+LvqKdo/ubbfGNOhCAwEIEXKSyaCgKmApbJUjaTm/+q9X/QsOAqxCAwBkJkDaecVSwCQIQ2EWA+a9d+KgM" + + "AQh8kgBbXn+SPn1DAAIQgAAEIHBOArrgddTKaqFs1V72vX/Xep5z1B7KQQACNyHQehC7cvGMQma2xnVtmdDpzYObDCFuQAACM5GN" + + "CkUUhlGRyMSmtRDWRih7YkBX+vtIjtwQyBbyciZAAAIXJxBXzreiGnezta4rEzRts1rEmq0f0/a079batewmAWvOLn6yYj4EWqmi" + + "RldZFBSFLAqCLnptRUVRiFRU/FlMjZjiM5pRdNWfXmqp5RE1rgkI3IBAJhg+1xQv8ir9rFbgezqYRV6VWGWiFNNFjRpj21Vau2X+" + + "7wbDigsQWJeAC0X2SJGKSDUfld0EqObVenNZak+M5FpRWRTRzG7mx9Y9x/H85gQ8SqrmrlREekLWE6ks6tMIS/vIbKgiPp3L87oq" + + "gJnw3nyocQ8C9yYQL/boabzY41xVliKO3ASIEVEleNqnC59HW61+Mttj6hnvdkZ/7j26eAeBRQhoxJPNO/XmnLxOa+5MhSYTs0yo" + + "su96kZ+KcxSxGLX12lnkFMBNCNyDQEy9srStEjKfV/P6mrJphKV3PFsRoKaJ0a6Ru6MexcW5s6w/xOwe5zBeQOA7K+NVKOLkf5y3" + + "6kVN2ZxXJRbV/FgmnCOCo0JaRWJZCstpAAEIXJzA6NyTC0Oc78pEIVsiEeu0cGkfUUSrelk6XNmgbYwI5MWHF/MhsBaBmYs6KzsS" + + "efWIVinkXtsyAZtps2c3xyEAgZMQmL2wW3NelXDEOiNuZyluVa9XdrbvEfsoAwEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhBY" + + "gkDr2Uaee1ziFMBJCFyfQOsRJ4Ts+uOLBxBYgoA+zxmdHl2MuwQonIQABD5PoFq9Hx/i1gfM9Vgmcv4d0dvnxxgLIHBrAq0HxrOI" + + "TB9Fip8r4ULIbn0K4RwEPk9An7mMD6KrkMUV9ppa6gPs2c4as08gfJ4OFkAAApcgoA+SV1FYJlzmoItbJWzsWHGJ0wAjIXBtAtWk" + + "vQlUL7V0IbPfldBxU+Da5wfWQ+ASBKLQuHhlUVYrIsuEzL/L9ha7BBiMhAAErkWgd9fSBa6aP0PIrjXeWAuB2xLQifjR/cVa9Ugr" + + "b3u64BgEzkug2vdLRa0SuThnVkVp5/UeyyAAAQgEAp6q+lcsu+D0gAAELk8AIbv8EOIABNYl0NvCel0yeA4BCEAAAhCAAAQgAAEI" + + "QAACEIAABCBwdgJ617Gyd7Tc2f3FPghA4GYERrfcGS13Mzy4AwEIXIGA7lZRLZ0YLXcFn7ERAhC4EYH4zGXc/cJddPEaLXcjNLgC" + + "AQhciUC2dY8KmX0eLXcl37EVAhC4CQHf4SJu5aPRmW73Ez+zkeJNTgTcgMCVCYzu9Dpa7sossB0CELgogdGdXkfLXRQDZkMAAlcm" + + "kO0hFjdU1P+aFO9qZuWuzALbIQCBixJAyC46cJgNAQh8nYBGWlYiW1M2Wg7GEIAABN5OYFSgRsu93QE6hAAEIGAERnd6HS0HVQhA" + + "AAIfJzC60+touY87hAEQgMA6BEZ3eh0ttw45PIUABCAAAQhAAAIQgAAEIAABCEAAAhA4O4FXbY74qnbPzhP7IACBDxB4leC8qt0P" + + "IKJLCEDg7ASyx5GOsPlV7R5hG21AAAI3I1DtYJG5GXeH9eNxp9hYR3eSvRk23IEABM5EoLXLq9qpq/c1fYyfvazulHEm37EFAhC4" + + "CYEsyjLXspX5regt7hBr9atNF2+CDTcgAIEzEchSQxelKgKLW2BH0cuiu6rsmRhgCwQgcHECKj6tZySriCzbaLFX9uLYMB8CEDgT" + + "gZ6QeUQV//lItUNsFZFlqeaZGGALBCBwcQIzc1nVzrHZFj5EZBc/MTAfAlckEFPK3hY8erz1uVf2iqywGQIQOCmBGcGptrvOtvCZ" + + "afekaDALAhCAAAQgAAEIQAACEIAABCAAAQhAYEECoztXjJZbECEuQwACnyYwI1DxyYCZep/2kf4hAIEFCJgoxYWvLZHqLddYABcu" + + "QgACZyRQbc9T2RqfAEDYzjii2ASBRQioeMWozBDEdWKaUs4K3yJIcRMCEDgDARezkSiLObIzjBg2QAAC3yEQ00T73Jsfi3uRaV2Q" + + "QgACEPgIgSptrIxRoRuJ3j7iGJ1CAAJrEGhFX9kxnRtDxNY4T/ASAqclkEVWejdShSrWYY7stEOLYRBYh0AUolZkpRsr+rya3uVc" + + "hxyeQgACpyIwI0YqfNnGi6dyDmMgAIF1CGST/ep9Fb2xnmyd8wRPIXB6AjOT9myeePrhxEAIrEugN9Hvc2MZIdaTrXve4DkEIAAB" + + "CEAAAhCAAAQgAAEIQAACELgLgZnFrdWKf2cx09Zd+OEHBCBwAgKj4lOVY8X/CQYREyCwOoGRxa0qVtWKf2M5s9B2dfb4DwEIHERg" + + "RMhcoLLfmXiNRnkHuUAzEIDA6gRGhSyKmL2Pi2Mz4ZpZaLv6GOA/BCCwk8DonmRR8GL62JojQ8x2Dg7VIQCBMQIjEVn1TKZ+7zvI" + + "jvVMKQhAAAIHEYhC1ntUSSfyY8RVvT/ITJqBAAQgUBMYici8tgtZFDz/Lh7TOTT4QwACEHgpgREh8zL6O94AyI691HAahwAEIBCj" + + "rF4EpSIV58JUCJkn49yCAATeTmBLRBb/LVx2N5NFsW8fRjqEwBoEqmUWre+VTJVaxjZiHZZfrHFu4SUETkNgRHS8THaHsvfdaRzF" + + "EAhA4PoEsiUWve/U60rQ2C32+ucHHkAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgMCFCfT2EGvtcnFhtzEdAhC4EwFfC5b5pMd6" + + "oncnLvgCAQhciICLVbaeLApZfARpZO3ZhRBgKgQgcHUCcdV+tvtr3N1i5LGmq/PAfghA4IIEELILDhomQwACXyVQPfztpfS4fU9q" + + "yVkEAQicigBCdqrhwBgIQGALgSziqqIw5si2EKYOBCDwcgIqTnFPMb1TiZC9fDjoAAIQ2EIAIdtCjToQgMApCegEfuszk/2nHEKM" + + "ggAEEDLOAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAYB+B+PB39T8rYw+je4u9qt193lIbAhC4JYFKmGa/Vziz" + + "9UcF8paDgFMQgMB2AlE84v+e9EeM9P9XWk8jjxu9qt3tnlITAhC4LYFMcNzZlmDF5yp1W+sodvZeF8zuafe2A4FjEIDAdgK6W0U1" + + "R6ZpXyyX9f6qdrd7Sk0IQOC2BHrRURZRVemlp6G99HO2z9jubQcCxyAAge0EMlFx4fD0UefJNB3NhOZV7W73lJoQgMBtCWRb8Wja" + + "mP1jEQdS7WbxqnZvOxA4BgEIbCegc1mxJRe0SshaW/K8qt3tnlITAhC4LYFKcOLyi5hKjiy90DkyTUU9Zd3S7m0HAscgAIF9BFRY" + + "PNKqRC4uvWj1/Kp293lLbQhA4JYEsjVhGkWZ45pi6lINhfOqdm85CDgFAQgcQyCu7I8tRgGr3rcseFW7x3hNKxCAwK0IqEiNrN/S" + + "pRnZDYBXtXsr+DgDAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAgWUJ6PY8BqK3PizCyur7cW1Hy+7te9lBw3EIQOCr" + + "BEbFJePmdStBatVxweyJYksoGUsIQAAC3yHQerg7rhFriVX2yJI+GaBbA+3tm+GDAAQg8CWB1kPjiqnasjp7kLz3cLk/lG59xPf+" + + "WSO11k4bDCcEILA4gUzIWqKhD5RHIcqEzufJMlEc7bsniosPIe5DAAItMWlN+mvqWO2IEYWvmo/T6ExHBSHjPIUABJoEZqMin9vK" + + "7ki2xCzOkblBs32TXnIyQwACKYERMYmbLLbms6KQVXcbszJEZJycEIDALgKatvXuQFZ3I/WuZEvIdII/pp/VDYXsJsAux6kMAQjc" + + "h0B1xzGmjtFbFbJsPkvnxbK2qiisNS9Hanmf8w5PIPASAioSI/uKtQypNlP0Oq0NGnt9vwQAjUIAAtcnUIlHXBQbvexFR9Vmit5e" + + "r63Yb6+v69PHAwhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAoE+geiQp1qzK+Nqz3iLZvhWUgAAEILCDwIgIVWVU" + + "7Fqfd5hIVQhAAAJtAvEJgLjGq3p2UteB6SNM3lvvSQHGBQIQgMBhBKqtdEYeOlcjXPwQscOGh4YgAIERAqNCNjKXZv1pGsrq/ZFR" + + "oAwEILCLQE+gelvxVFGZfY+I7RoaKkMAAqMEqojM66uQVXNkMRrLtgwatYdyEIAABKYJVJP98SHwnthlKeXInc5pY6kAAQhAICMw" + + "I1KtVFEn+InKON8gAIG3ERgVstZcWnWXEjF72zDSEQQgMDoxPzJ5P7KRI8QhAAEIvITAqEi1JvurNkbafolTNAoBCEAAAhCAAAQg" + + "AAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAA" + + "BCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAwReAnH6X/" + + "6PH6L1O1KAwBCEDgRAR+6WHLtx+vXz2RTZgCAQhAYIrArz+F7B8/fv/Y4/UjU7UpDAEIQGADgR9+poGWDtrrdx6vnw3tWIpo31uk" + + "Zcfs/c+H4/be63kZi8j+xuP1jcfrB0NZ78O/+uJZ19NQ69f7sLImivHHbbF69uOfLZ3lBwIQWJiAiYWJhomBz2/ZZ/+x954qmuhF" + + "MTJBsWMuOB6NWZkferxMyL4/tGUiZeVdeLy8taNtmUDGtq0ZFUL9vPAw4joEIGAE/uLjZWngnz1fP/r4/ZeDeNixn3q8/vjx+v3H" + + "y9LG//4Um7/y+P19j9fff362MlbfhOy7A16LoEycLPKytvymwPc83v/B85iJ3Pc+67stJorWh9U1MXRb/u+zDfts9sS+Qre8hQAE" + + "7k7AJuVNHP7P42XCYWLx75/C4MJkAmRC8S+ex//Z87OVNzEyITLR8on+//H8bHXiz6886//M4/evPd9/8fhtQvWtx8uEyduy76xt" + + "E0Vr+58+y5u91q7apn1J13yEAATuSsBTPRMYi3hiqmfC8C+f4uHC9e+en3/hKSZ/+hQbi4hMbH7zefybz88qLp4u/qencP23x2+L" + + "BK2ct+WR3I8/23IR/e3n57/5bPvfim0I2V3PUvyCQIeAzzFZKve3nmJigmKiYMJkUZpFaH9NPvtE/u89j//y47eLnJX/6Wd5vWNp" + + "aaMd99fffrz/gWfZ/xBE0Pr3uTsTWPvs0eLPPd7/xuP1J2KbCyGDDgEILEbA7ziaCLg4WHr3E09x8Tmov/r8bOJh4md3Ik3oTLAs" + + "qjORsXkvF0avbyKlP37z4H89Dlj6GJdomHj5vJi1+8Xj9Zeeff2bZ/sWzf2jx8ttc1vctsWGEHchAAEnYGJir7/weNmEuX/24zpx" + + "X322CX8XFp3o97ZcyP7BU6CsnM2L+Y/e7XSxM0GzH48WLYq0vvyzT/Sr7YwyBCCwCAETIBcAFwf7bPNXLh7ZZ8djImLi5ncOvS2v" + + "7+X8ZoBFXi5A2YJZFy8rY+1GoXP7rIyJmQoXQrbISYubEPgEAU87ffGrC1kUqU/YRZ8QgAAENhGwRbKWUlpUxQ8EIACByxHw1I9n" + + "MC83dOc2+P8BipnMHXM09SIAAAAASUVORK5CYII="; + #endregion + + /// + /// rect縺ョ荳ュ縺ォpoint縺悟・縺」縺ヲ縺繧九°縺ゥ縺縺九r蛻、螳 + /// + /// + /// + /// + public static bool IsInRectangle( Point point, Rectangle rect ) { + if ( rect.X <= point.X && point.X <= rect.X + rect.Width ) { + if ( rect.Y <= point.Y && point.Y <= rect.Y + rect.Height ) { + return true; + } + } + return false; + } + + public static bool Edited { + get { + return m_edited; + } + set { + bool old = m_edited; + m_edited = value; + if ( EditedChanged != null ) { + EditedChanged( typeof( AppManager ), new EventArgs() ); + } + } + } + + public static string VERSION { + get { +#if DEBUG + return GetAssemblyVersion( typeof( Form1 ) ) + " (build:debug)"; +#else + return GetAssemblyVersion( typeof( Form1 ) ) + " (build:release)"; +#endif + } + } + + private static string GetAssemblyVersion( Type t ) { + Assembly a = Assembly.GetAssembly( t ); + AssemblyFileVersionAttribute afva = (AssemblyFileVersionAttribute)Attribute.GetCustomAttribute( a, typeof( AssemblyFileVersionAttribute ) ); + return afva.Version; + } + + /// + /// pictureBox1縺ョ陦後ョ陦ィ遉コ迥カ諷九r陦ィ縺咎榊励r蜿門セ励@縺セ縺吶 + /// + /// + public static int[] GetTimeLineLanes() { + List ret = new List(); + // vsq + if ( SaveData.m_group_vsq.Folded ) { + ret.Add( 1 ); + } else { + ret.Add( SaveData.m_group_vsq.Count + 1 ); + } + // character + for ( int i = 0; i < SaveData.m_groups_character.Count; i++ ) { + if ( SaveData.m_groups_character[i].Folded ) { + ret.Add( 1 ); + } else { + ret.Add( SaveData.m_groups_character[i].Count + 1 ); + } + } + // telop + if ( SaveData.TelopListFolded ) { + ret.Add( 1 ); + } else { + ret.Add( MaxTelopLanes + 1 ); + } + // another image + if ( SaveData.m_group_another.Folded ) { + ret.Add( 1 ); + } else { + ret.Add( SaveData.m_group_another.Count + 1 ); + } + // plugin + if ( SaveData.m_group_plugin.Folded ) { + ret.Add( 1 ); + } else { + ret.Add( SaveData.m_group_plugin.Count + 1 ); + } + return ret.ToArray(); + } + + /// + /// 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繝。繧、繝ウ 繧ィ繝ウ繝医Μ 繝昴う繝ウ繝医〒縺吶 + /// + [STAThread] + static void Main( string[] argv ) { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault( false ); +#if !DEBUG + try { +#endif + string file = ""; + if ( argv.Length > 0 ) { + file = argv[0]; + } + Form1 form1 = null; + if ( File.Exists( file ) ) { + form1 = new Form1( file ); + } else { + form1 = new Form1( "" ); + } + Application.Run( form1 ); + Common.LogClose(); +#if !DEBUG + } catch ( Exception e ) { + Common.LogPush( e ); + Common.LogClose(); + } +#endif + } + + static AppManager() { + using ( MemoryStream ms = new MemoryStream( Convert.FromBase64String( _AUTHOR_LSIT ) ) ) { + m_author_list = new Bitmap( ms ); + } + } + + /// + /// 迴セ蝨ィ菫晄戟縺励※縺繧九さ繝槭Φ繝峨ヰ繝繝輔ぃ繧偵け繝ェ繧「縺励∪縺吶 + /// + public static void ClearCommandBuffer() { + m_commands.Clear(); + m_command_position = -1; + } + + /// + /// 谺。蝗槭い繝ウ繝峨ぇ蜃ヲ逅縺輔l繧九さ繝槭Φ繝峨ョ遞ョ鬘槭r隱ソ縺ケ縺セ縺 + /// + /// + public static CommandType GetNextUndoCommandType() { + if ( IsUndoAvailable ) { + return m_commands[m_command_position].type; + } else { + return CommandType.nothing; + } + } + + /// + /// 繧「繝ウ繝峨ぇ蜃ヲ逅繧定。後>縺セ縺 + /// + public static void Undo() { + if ( IsUndoAvailable ) { + Command run = m_commands[m_command_position]; + Command inv = SaveData.Execute( run ); + m_commands[m_command_position] = inv; + m_command_position--; + } + } + + /// + /// 谺。蝗槭Μ繝峨ぇ蜃ヲ逅縺輔l繧九さ繝槭Φ繝峨ョ遞ョ鬘槭r隱ソ縺ケ縺セ縺 + /// + /// + public static CommandType GetNextRedoCommandType() { + if ( IsRedoAvailable ) { + return m_commands[m_command_position + 1].type; + } else { + return CommandType.nothing; + } + } + + /// + /// 繝ェ繝峨ぇ蜃ヲ逅繧定。後>縺セ縺 + /// + public static void Redo() { + if ( IsRedoAvailable ) { + Command run = m_commands[m_command_position + 1]; + Command inv = SaveData.Execute( run ); + m_commands[m_command_position + 1] = inv; + m_command_position++; + } + } + + /// + /// 繝ェ繝峨ぇ謫堺ス懊′蜿ッ閭ス縺九←縺縺九r陦ィ縺吶励Ο繝代ユ繧」 + /// + public static bool IsRedoAvailable { + get { + if ( m_commands.Count > 0 && 0 <= m_command_position + 1 && m_command_position + 1 < m_commands.Count ) { + return true; + } else { + return false; + } + } + } + + /// + /// 繧「繝ウ繝峨ぇ謫堺ス懊′蜿ッ閭ス縺九←縺縺九r陦ィ縺吶励Ο繝代ユ繧」 + /// + public static bool IsUndoAvailable { + get { + if ( m_commands.Count > 0 && 0 <= m_command_position && m_command_position < m_commands.Count ) { + return true; + } else { + return false; + } + } + } + + /// + /// 繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ縺ォ謖螳壹&繧後◆繧ウ繝槭Φ繝峨r逋サ骭イ縺励∪縺 + /// + /// + public static void Register( Command command ) { + if ( m_command_position == m_commands.Count - 1 ) { + // 譁ー縺励>繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ繧定ソス蜉縺吶k蝣エ蜷 + m_commands.Add( command ); + m_command_position = m_commands.Count - 1; + } else { + // 譌「縺ォ縺ゅk繧ウ繝槭Φ繝峨ヰ繝繝輔ぃ繧剃ク頑嶌縺阪☆繧句エ蜷 + //m_commands[m_command_position + 1].Dispose(); + m_commands[m_command_position + 1] = command; + for ( int i = m_commands.Count - 1; i >= m_command_position + 2; i-- ) { + m_commands.RemoveAt( i ); + } + m_command_position++; + } + } + + public static Bitmap author_list { + get { + return (Bitmap)m_author_list.Clone(); + } + } + } + +} diff --git a/trunk/LipSync/Editor/AviOutput.cs b/trunk/LipSync/Editor/AviOutput.cs new file mode 100644 index 0000000..9b86e8a --- /dev/null +++ b/trunk/LipSync/Editor/AviOutput.cs @@ -0,0 +1,220 @@ +/* + * AviOutput.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.IO; +using System.Windows.Forms; +using System.Drawing; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class AviOutput : Form, IMultiLanguageControl { + private bool m_raw_mode = false; + private float m_start = 0f; + private float m_end = 0f; + + public AviOutput( bool raw_mode ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + m_raw_mode = raw_mode; + if ( groupAudio.Enabled ) { + if ( File.Exists( AppManager.SaveData.m_audioFile ) ) { + this.chkMergeAudio.Enabled = true; + } else { + this.chkMergeAudio.Enabled = false; + } + } + if ( m_raw_mode ) { + btnVideoCompression.Enabled = false; + txtDescription.Enabled = false; + } else { + btnVideoCompression.Enabled = true; + txtDescription.Enabled = true; + } + txtFile.Text = AppManager.Config.LastAviPath; + JudgeWritable(); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + btnCancel.Text = _( "Cancel" ); + btnOK.Text = _( "Save" ); + lblFileName.Text = _( "File Name" ); + if ( AppManager.Config.PathFFmpeg != "" && File.Exists( AppManager.Config.PathFFmpeg ) ) { + groupAudio.Text = _( "Audio" ); + groupAudio.Enabled = true; + } else { + groupAudio.Text = _( "Audio" ) + " (" + _( "Set the path of ffmpeg to enable this option" ) + ")"; + groupAudio.Enabled = false; + } + if ( AppManager.Config.PathMEncoder != "" && File.Exists( AppManager.Config.PathMEncoder ) ) { + groupFlv.Text = _( "FLV and MP4" ); + groupFlv.Enabled = true; + } else { + groupFlv.Text = _( "FLV and MP4" ) + " (" + _( "Set the path of mencoder and ffmpeg to enable this option" ) + ")"; + groupFlv.Enabled = false; + } + chkFLV.Text = _( "Convert to FLV" ); + chkMP4.Text = _( "Convert to MP4" ); + chkMergeAudio.Text = _( "Merge WAVE to AVI" ); + chkDeleteIntermediate.Text = _( "Delete Intermediate File" ); + btnVideoCompression.Text = _( "Video Compression" ); + groupStartEnd.Text = _( "Specify Output Range" ); + chkStart.Text = _( "Start" ); + chkEnd.Text = _( "End" ); + checkContainsAlpha.Text = _( "Add Alpha" ); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public AviOutputArguments Arguments { + get { + AviOutputArguments aoa = new AviOutputArguments(); + aoa.AviFile = this.FileName; + aoa.End = m_end; + aoa.EndSpecified = chkEnd.Checked; + aoa.FileNameParser = ""; + aoa.ImageFormat = null; + aoa.IsDeleteIntermediateRequired = chkDeleteIntermediate.Checked; + aoa.IsFlvEncodeRequired = chkFLV.Checked; + aoa.IsMp4EncodeRequired = chkMP4.Checked; + if ( aoa.IsMp4EncodeRequired && aoa.IsFlvEncodeRequired ) { + aoa.IsFlvEncodeRequired = false; + } + aoa.IsTransparent = checkContainsAlpha.Checked; + aoa.IsWaveMergeRequired = chkMergeAudio.Checked; + aoa.Start = m_start; + aoa.StartSpecified = chkStart.Checked; + aoa.UseVfwEncoder = radioVfw.Checked; + return aoa; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + //繝繧」繝ャ繧ッ繝医Μ縺悟ュ伜惠縺吶k縺九←縺縺九r遒コ隱 + string name = FileName; + if ( !Directory.Exists( Path.GetDirectoryName( name ) ) ) { + MessageBox.Show( string.Format( _( "Directory {0} does not exist." ), Path.GetDirectoryName( name ) ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + + //譌「縺ォ繝輔ぃ繧、繝ォ縺悟ュ伜惠縺吶k縺薙→繧定ュヲ蜻 + if ( File.Exists( name ) ) { + if ( MessageBox.Show( string.Format( _( "{0} already exists.\nDo you want to replace it?" ), name ), + "LipSync", + MessageBoxButtons.YesNo, + MessageBoxIcon.Exclamation ) == DialogResult.No ) { + return; + } + } + try { + m_start = float.Parse( txtStart.Text ); + m_end = float.Parse( txtEnd.Text ); + this.DialogResult = DialogResult.OK; + } catch ( Exception ex ) { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + Common.LogPush( ex ); + } + } + + private string FileName { + get { + if ( Path.GetExtension( txtFile.Text ).ToLower() != ".avi" ) { + string name = txtFile.Text; + txtFile.Text = Path.Combine( Path.GetDirectoryName( name ), Path.GetFileNameWithoutExtension( name ) + ".avi" ); + } + return txtFile.Text; + } + } + + private void btnFile_Click( object sender, EventArgs e ) { + using ( SaveFileDialog dlg = new SaveFileDialog() ) { + if ( AppManager.Config.LastAviPath != "" ) { + try { + dlg.InitialDirectory = Path.GetDirectoryName( AppManager.Config.LastAviPath ); + } catch { + } + } + try { + dlg.Filter = _( "Avi file(*.avi)|*.avi" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Avi file(*.avi)|*.avi|All Files(*.*)|*.*"; + } + dlg.OverwritePrompt = false; + if ( dlg.ShowDialog() == DialogResult.OK ) { + AppManager.Config.LastAviPath = dlg.FileName; + txtFile.Text = dlg.FileName; + JudgeWritable(); + } + } + } + + private void JudgeWritable() { + if ( txtFile.Text != "" ) { + btnOK.Enabled = true; + } else { + btnOK.Enabled = false; + } + } + + private void chkStart_CheckedChanged( object sender, EventArgs e ) { + txtStart.Enabled = chkStart.Checked; + if ( txtStart.Enabled ) { + txtStart.Focus(); + } + } + + private void checkBox1_CheckedChanged( object sender, EventArgs e ) { + txtEnd.Enabled = chkEnd.Checked; + if ( txtEnd.Enabled ) { + txtEnd.Focus(); + } + } + + private void chkFLV_CheckedChanged( object sender, EventArgs e ) { + if ( chkFLV.Checked && chkMP4.Checked ) { + chkMP4.Checked = false; + } + this.chkDeleteIntermediate.Enabled = chkFLV.Checked | chkMP4.Checked | chkMergeAudio.Checked; + } + + private void chkMP4_CheckedChanged( object sender, EventArgs e ) { + if ( chkMP4.Checked && chkFLV.Checked ) { + chkFLV.Checked = false; + } + this.chkDeleteIntermediate.Enabled = chkFLV.Checked | chkMP4.Checked | chkMergeAudio.Checked; + } + + private void chkMergeAudio_CheckedChanged( object sender, EventArgs e ) { + this.chkDeleteIntermediate.Enabled = chkFLV.Checked | chkMP4.Checked | chkMergeAudio.Checked; + } + } + +} diff --git a/trunk/LipSync/Editor/AviOutput.designer.cs b/trunk/LipSync/Editor/AviOutput.designer.cs new file mode 100644 index 0000000..dae5946 --- /dev/null +++ b/trunk/LipSync/Editor/AviOutput.designer.cs @@ -0,0 +1,378 @@ +/* + * AviOutput.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class AviOutput { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.txtFile = new System.Windows.Forms.TextBox(); + this.lblFileName = new System.Windows.Forms.Label(); + this.btnFile = new System.Windows.Forms.Button(); + this.btnVideoCompression = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.chkStart = new System.Windows.Forms.CheckBox(); + this.groupStartEnd = new System.Windows.Forms.GroupBox(); + this.txtEnd = new System.Windows.Forms.TextBox(); + this.txtStart = new System.Windows.Forms.TextBox(); + this.chkEnd = new System.Windows.Forms.CheckBox(); + this.groupFlv = new System.Windows.Forms.GroupBox(); + this.chkMP4 = new System.Windows.Forms.CheckBox(); + this.chkDeleteIntermediate = new System.Windows.Forms.CheckBox(); + this.chkFLV = new System.Windows.Forms.CheckBox(); + this.checkContainsAlpha = new System.Windows.Forms.CheckBox(); + this.txtDescription = new System.Windows.Forms.Label(); + this.groupAudio = new System.Windows.Forms.GroupBox(); + this.chkMergeAudio = new System.Windows.Forms.CheckBox(); + this.groupAviEncoder = new System.Windows.Forms.GroupBox(); + this.radioVcm = new System.Windows.Forms.RadioButton(); + this.radioVfw = new System.Windows.Forms.RadioButton(); + this.groupStartEnd.SuspendLayout(); + this.groupFlv.SuspendLayout(); + this.groupAudio.SuspendLayout(); + this.groupAviEncoder.SuspendLayout(); + this.SuspendLayout(); + // + // txtFile + // + this.txtFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtFile.BackColor = System.Drawing.SystemColors.Window; + this.txtFile.Location = new System.Drawing.Point( 73, 14 ); + this.txtFile.Name = "txtFile"; + this.txtFile.Size = new System.Drawing.Size( 221, 19 ); + this.txtFile.TabIndex = 0; + // + // lblFileName + // + this.lblFileName.AutoSize = true; + this.lblFileName.Location = new System.Drawing.Point( 15, 17 ); + this.lblFileName.Name = "lblFileName"; + this.lblFileName.Size = new System.Drawing.Size( 51, 12 ); + this.lblFileName.TabIndex = 4; + this.lblFileName.Text = "繝輔ぃ繧、繝ォ蜷"; + // + // btnFile + // + this.btnFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnFile.Location = new System.Drawing.Point( 300, 12 ); + this.btnFile.Name = "btnFile"; + this.btnFile.Size = new System.Drawing.Size( 24, 23 ); + this.btnFile.TabIndex = 1; + this.btnFile.Text = "..."; + this.btnFile.UseVisualStyleBackColor = true; + this.btnFile.Click += new System.EventHandler( this.btnFile_Click ); + // + // btnVideoCompression + // + this.btnVideoCompression.Enabled = false; + this.btnVideoCompression.Location = new System.Drawing.Point( 142, 423 ); + this.btnVideoCompression.Name = "btnVideoCompression"; + this.btnVideoCompression.Size = new System.Drawing.Size( 113, 24 ); + this.btnVideoCompression.TabIndex = 14; + this.btnVideoCompression.Text = "繝薙ョ繧ェ蝨ァ邵ョ"; + this.btnVideoCompression.UseVisualStyleBackColor = true; + this.btnVideoCompression.Visible = false; + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 246, 381 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 13; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Enabled = false; + this.btnOK.Location = new System.Drawing.Point( 147, 381 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 12; + this.btnOK.Text = "菫晏ュ"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // chkStart + // + this.chkStart.AutoSize = true; + this.chkStart.Location = new System.Drawing.Point( 35, 18 ); + this.chkStart.Name = "chkStart"; + this.chkStart.Size = new System.Drawing.Size( 48, 16 ); + this.chkStart.TabIndex = 8; + this.chkStart.Text = "髢句ァ"; + this.chkStart.UseVisualStyleBackColor = true; + this.chkStart.CheckedChanged += new System.EventHandler( this.chkStart_CheckedChanged ); + // + // groupStartEnd + // + this.groupStartEnd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupStartEnd.Controls.Add( this.txtEnd ); + this.groupStartEnd.Controls.Add( this.txtStart ); + this.groupStartEnd.Controls.Add( this.chkEnd ); + this.groupStartEnd.Controls.Add( this.chkStart ); + this.groupStartEnd.Location = new System.Drawing.Point( 12, 293 ); + this.groupStartEnd.Name = "groupStartEnd"; + this.groupStartEnd.Size = new System.Drawing.Size( 308, 72 ); + this.groupStartEnd.TabIndex = 7; + this.groupStartEnd.TabStop = false; + this.groupStartEnd.Text = "蜃コ蜉帷ッ蝗イ繧呈欠螳"; + // + // txtEnd + // + this.txtEnd.Enabled = false; + this.txtEnd.Location = new System.Drawing.Point( 103, 40 ); + this.txtEnd.Name = "txtEnd"; + this.txtEnd.Size = new System.Drawing.Size( 144, 19 ); + this.txtEnd.TabIndex = 11; + this.txtEnd.Text = "0"; + // + // txtStart + // + this.txtStart.Enabled = false; + this.txtStart.Location = new System.Drawing.Point( 103, 16 ); + this.txtStart.Name = "txtStart"; + this.txtStart.Size = new System.Drawing.Size( 144, 19 ); + this.txtStart.TabIndex = 9; + this.txtStart.Text = "0"; + // + // chkEnd + // + this.chkEnd.AutoSize = true; + this.chkEnd.Location = new System.Drawing.Point( 35, 42 ); + this.chkEnd.Name = "chkEnd"; + this.chkEnd.Size = new System.Drawing.Size( 48, 16 ); + this.chkEnd.TabIndex = 10; + this.chkEnd.Text = "邨ゆコ"; + this.chkEnd.UseVisualStyleBackColor = true; + this.chkEnd.CheckedChanged += new System.EventHandler( this.checkBox1_CheckedChanged ); + // + // groupFlv + // + this.groupFlv.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupFlv.Controls.Add( this.chkMP4 ); + this.groupFlv.Controls.Add( this.chkFLV ); + this.groupFlv.Location = new System.Drawing.Point( 13, 148 ); + this.groupFlv.Name = "groupFlv"; + this.groupFlv.Size = new System.Drawing.Size( 311, 72 ); + this.groupFlv.TabIndex = 2; + this.groupFlv.TabStop = false; + this.groupFlv.Text = "FLV"; + // + // chkMP4 + // + this.chkMP4.AutoSize = true; + this.chkMP4.Location = new System.Drawing.Point( 23, 44 ); + this.chkMP4.Name = "chkMP4"; + this.chkMP4.Size = new System.Drawing.Size( 104, 16 ); + this.chkMP4.TabIndex = 4; + this.chkMP4.Text = "Convert to MP4"; + this.chkMP4.UseVisualStyleBackColor = true; + this.chkMP4.CheckedChanged += new System.EventHandler( this.chkMP4_CheckedChanged ); + // + // chkDeleteIntermediate + // + this.chkDeleteIntermediate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkDeleteIntermediate.AutoSize = true; + this.chkDeleteIntermediate.Enabled = false; + this.chkDeleteIntermediate.Location = new System.Drawing.Point( 173, 48 ); + this.chkDeleteIntermediate.Name = "chkDeleteIntermediate"; + this.chkDeleteIntermediate.Size = new System.Drawing.Size( 134, 16 ); + this.chkDeleteIntermediate.TabIndex = 3; + this.chkDeleteIntermediate.Text = "荳ュ髢薙ヵ繧。繧、繝ォ繧貞炎髯、縺吶k"; + this.chkDeleteIntermediate.UseVisualStyleBackColor = true; + // + // chkFLV + // + this.chkFLV.AutoSize = true; + this.chkFLV.Location = new System.Drawing.Point( 23, 22 ); + this.chkFLV.Name = "chkFLV"; + this.chkFLV.Size = new System.Drawing.Size( 103, 16 ); + this.chkFLV.TabIndex = 2; + this.chkFLV.Text = "Convert to FLV"; + this.chkFLV.UseVisualStyleBackColor = true; + this.chkFLV.CheckedChanged += new System.EventHandler( this.chkFLV_CheckedChanged ); + // + // checkContainsAlpha + // + this.checkContainsAlpha.AutoSize = true; + this.checkContainsAlpha.Location = new System.Drawing.Point( 36, 48 ); + this.checkContainsAlpha.Name = "checkContainsAlpha"; + this.checkContainsAlpha.Size = new System.Drawing.Size( 110, 16 ); + this.checkContainsAlpha.TabIndex = 4; + this.checkContainsAlpha.Text = "繧「繝ォ繝輔ぃ蛟、繧貞性繧√k"; + this.checkContainsAlpha.UseVisualStyleBackColor = true; + // + // txtDescription + // + this.txtDescription.AutoSize = true; + this.txtDescription.Enabled = false; + this.txtDescription.Location = new System.Drawing.Point( 294, 429 ); + this.txtDescription.Name = "txtDescription"; + this.txtDescription.Size = new System.Drawing.Size( 9, 12 ); + this.txtDescription.TabIndex = 19; + this.txtDescription.Text = " "; + this.txtDescription.Visible = false; + // + // groupAudio + // + this.groupAudio.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupAudio.Controls.Add( this.chkMergeAudio ); + this.groupAudio.Location = new System.Drawing.Point( 12, 226 ); + this.groupAudio.Name = "groupAudio"; + this.groupAudio.Size = new System.Drawing.Size( 311, 61 ); + this.groupAudio.TabIndex = 5; + this.groupAudio.TabStop = false; + this.groupAudio.Text = "繧ェ繝シ繝繧」繧ェ"; + // + // chkMergeAudio + // + this.chkMergeAudio.AutoSize = true; + this.chkMergeAudio.Enabled = false; + this.chkMergeAudio.Location = new System.Drawing.Point( 35, 26 ); + this.chkMergeAudio.Name = "chkMergeAudio"; + this.chkMergeAudio.Size = new System.Drawing.Size( 96, 16 ); + this.chkMergeAudio.TabIndex = 6; + this.chkMergeAudio.Text = "AVI縺ォ蝓九a霎シ繧"; + this.chkMergeAudio.UseVisualStyleBackColor = true; + this.chkMergeAudio.CheckedChanged += new System.EventHandler( this.chkMergeAudio_CheckedChanged ); + // + // groupAviEncoder + // + this.groupAviEncoder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupAviEncoder.Controls.Add( this.radioVcm ); + this.groupAviEncoder.Controls.Add( this.radioVfw ); + this.groupAviEncoder.Location = new System.Drawing.Point( 13, 70 ); + this.groupAviEncoder.Name = "groupAviEncoder"; + this.groupAviEncoder.Size = new System.Drawing.Size( 311, 72 ); + this.groupAviEncoder.TabIndex = 20; + this.groupAviEncoder.TabStop = false; + this.groupAviEncoder.Text = "Avi Encoder"; + // + // radioVcm + // + this.radioVcm.AutoSize = true; + this.radioVcm.Location = new System.Drawing.Point( 23, 45 ); + this.radioVcm.Name = "radioVcm"; + this.radioVcm.Size = new System.Drawing.Size( 169, 16 ); + this.radioVcm.TabIndex = 1; + this.radioVcm.TabStop = true; + this.radioVcm.Text = "Video Compression Manager"; + this.radioVcm.UseVisualStyleBackColor = true; + // + // radioVfw + // + this.radioVfw.AutoSize = true; + this.radioVfw.Checked = true; + this.radioVfw.Location = new System.Drawing.Point( 23, 23 ); + this.radioVfw.Name = "radioVfw"; + this.radioVfw.Size = new System.Drawing.Size( 118, 16 ); + this.radioVfw.TabIndex = 0; + this.radioVfw.TabStop = true; + this.radioVfw.Text = "Video for Windows"; + this.radioVfw.UseVisualStyleBackColor = true; + // + // AviOutput + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 335, 421 ); + this.Controls.Add( this.groupAviEncoder ); + this.Controls.Add( this.chkDeleteIntermediate ); + this.Controls.Add( this.checkContainsAlpha ); + this.Controls.Add( this.txtDescription ); + this.Controls.Add( this.groupAudio ); + this.Controls.Add( this.groupFlv ); + this.Controls.Add( this.groupStartEnd ); + this.Controls.Add( this.btnVideoCompression ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnFile ); + this.Controls.Add( this.lblFileName ); + this.Controls.Add( this.txtFile ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AviOutput"; + this.ShowInTaskbar = false; + this.Text = "AviOutput"; + this.groupStartEnd.ResumeLayout( false ); + this.groupStartEnd.PerformLayout(); + this.groupFlv.ResumeLayout( false ); + this.groupFlv.PerformLayout(); + this.groupAudio.ResumeLayout( false ); + this.groupAudio.PerformLayout(); + this.groupAviEncoder.ResumeLayout( false ); + this.groupAviEncoder.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox txtFile; + private System.Windows.Forms.Label lblFileName; + private System.Windows.Forms.Button btnFile; + private System.Windows.Forms.Button btnVideoCompression; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.CheckBox chkStart; + private System.Windows.Forms.GroupBox groupStartEnd; + private System.Windows.Forms.TextBox txtEnd; + private System.Windows.Forms.TextBox txtStart; + private System.Windows.Forms.CheckBox chkEnd; + private System.Windows.Forms.GroupBox groupFlv; + private System.Windows.Forms.CheckBox chkDeleteIntermediate; + private System.Windows.Forms.CheckBox chkFLV; + private System.Windows.Forms.GroupBox groupAudio; + private System.Windows.Forms.CheckBox chkMergeAudio; + private System.Windows.Forms.Label txtDescription; + private System.Windows.Forms.CheckBox checkContainsAlpha; + private System.Windows.Forms.CheckBox chkMP4; + private System.Windows.Forms.GroupBox groupAviEncoder; + private System.Windows.Forms.RadioButton radioVfw; + private System.Windows.Forms.RadioButton radioVcm; + } +} diff --git a/trunk/LipSync/Editor/AviOutputArguments.cs b/trunk/LipSync/Editor/AviOutputArguments.cs new file mode 100644 index 0000000..a650413 --- /dev/null +++ b/trunk/LipSync/Editor/AviOutputArguments.cs @@ -0,0 +1,32 @@ +サソ/* + * AviOutputArguments.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + public class AviOutputArguments { + public string AviFile = ""; + public float Start = 0f; + public float End = 0f; + public bool StartSpecified = false; + public bool EndSpecified = false; + public bool IsWaveMergeRequired = false; + public bool IsFlvEncodeRequired = false; + public bool IsMp4EncodeRequired = false; + public bool IsDeleteIntermediateRequired = false; + public bool IsTransparent = false; + public string FileNameParser; + public System.Drawing.Imaging.ImageFormat ImageFormat; + public bool UseVfwEncoder = true; + } + +} diff --git a/trunk/LipSync/Editor/AviReaderEx.cs b/trunk/LipSync/Editor/AviReaderEx.cs new file mode 100644 index 0000000..24e9801 --- /dev/null +++ b/trunk/LipSync/Editor/AviReaderEx.cs @@ -0,0 +1,47 @@ +サソ/* + * AviReaderEx.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +using Boare.Lib.Media; + +namespace LipSync { + + public class AviReaderEx : AviReader { + private int m_num_openfailed = 0; + + /// + /// avi繝輔ぃ繧、繝ォ縺ョOpen縺ォ螟ア謨励@縺溽エッ遨榊屓謨ー繧貞叙蠕励@縺セ縺 + /// + public int NumFailed { + get { + return m_num_openfailed; + } + } + + + public AviReaderEx() : base() { + m_num_openfailed = 0; + } + + + public new void Open( string file ){ + try { + base.Open( file ); + } catch { + m_num_openfailed++; + } + } + } + +} diff --git a/trunk/LipSync/Editor/BarLineType.cs b/trunk/LipSync/Editor/BarLineType.cs new file mode 100644 index 0000000..7af7074 --- /dev/null +++ b/trunk/LipSync/Editor/BarLineType.cs @@ -0,0 +1,28 @@ +サソ/* + * BarLineType.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + public struct BarLineType { + public double Time; + public bool IsSeparator; + public bool NeverUseForSnapPoint; + + public BarLineType( double time, bool is_separator, bool never_use_for_snap_point ) { + Time = time; + IsSeparator = is_separator; + NeverUseForSnapPoint = never_use_for_snap_point; + } + } + +} diff --git a/trunk/LipSync/Editor/BugReport.Designer.cs b/trunk/LipSync/Editor/BugReport.Designer.cs new file mode 100644 index 0000000..d099432 --- /dev/null +++ b/trunk/LipSync/Editor/BugReport.Designer.cs @@ -0,0 +1,75 @@ +サソ/* + * BugReport.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class BugReport { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Font = new System.Drawing.Font( "シュシウ 繧エ繧キ繝繧ッ", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)) ); + this.textBox1.Location = new System.Drawing.Point( 12, 49 ); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 357, 223 ); + this.textBox1.TabIndex = 0; + // + // BugReport + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 381, 284 ); + this.Controls.Add( this.textBox1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.Name = "BugReport"; + this.ShowIcon = false; + this.Text = "BugReport"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/BugReport.cs b/trunk/LipSync/Editor/BugReport.cs new file mode 100644 index 0000000..bce1710 --- /dev/null +++ b/trunk/LipSync/Editor/BugReport.cs @@ -0,0 +1,84 @@ +サソ/* + * BugReport.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Windows.Forms; + +namespace LipSync { + + public partial class BugReport : Form { + public BugReport() { + InitializeComponent(); + string runtime_version = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion(); + textBox1.Text = "[ OS ]:" + OsVersion() + Environment.NewLine + + "[.NET runtime]:" + runtime_version + Environment.NewLine + + "[ LipSync ]:v" + AppManager.VERSION; + } + + private static string OsVersion() { + OperatingSystem os = System.Environment.OSVersion; + string version = "(" + os.Version.ToString() + ")"; + switch ( os.Platform ) { + case PlatformID.Win32Windows: + if ( os.Version.Major >= 4 ) { + switch ( os.Version.Minor ) { + case 0: + return "Windows 95" + version; + case 10: + return "Windows 98" + version; + case 90: + return "Windows Me" + version; + } + } + break; + case PlatformID.Win32NT: + switch ( os.Version.Major ) { + case 3: + switch ( os.Version.Minor ) { + case 0: + return "Windows NT 3" + version; + case 1: + return "Windows NT 3.1" + version; + case 5: + return "Windows NT 3.5" + version; + case 51: + return "Windows NT 3.51" + version; + } + break; + case 4: + if ( os.Version.Minor == 0 ) { + return "Windows NT 4.0" + version; + } + break; + case 5: + if ( os.Version.Minor == 0 ) { + return "Windows 2000" + version; + } else if ( os.Version.Minor == 1 ) { + return "Windows XP" + version; + } + break; + case 6: + if ( os.Version.Minor == 0 ) { + return "Windows Vista" + version; + } + break; + } + break; + case PlatformID.Win32S: + return "Win32s" + version; + } + return os.Platform.ToString() + version; + } + } + +} diff --git a/trunk/LipSync/Editor/Character.cs b/trunk/LipSync/Editor/Character.cs new file mode 100644 index 0000000..dfe2fda --- /dev/null +++ b/trunk/LipSync/Editor/Character.cs @@ -0,0 +1,300 @@ +サソ/* + * Character.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; + +namespace LipSync { + + public enum CharacterType { + def, + plugin + } + + [Serializable] + public class Character : IDisposable { + public CharacterType type; + string m_Name; + public PluginConfig m_pluginConfig; + public Size m_plugin_drawarea; + + [Obsolete] + public Image Base; + [Obsolete] + public Image a; + [Obsolete] + public Image aa; + [Obsolete] + public Image i; + [Obsolete] + public Image u; + [Obsolete] + public Image e; + [Obsolete] + public Image o; + [Obsolete] + public Image xo; + [Obsolete] + public Image nn; + + public List Images; + [NonSerialized] + private Bitmap m_cache = null; + [NonSerialized] + private string m_cache_draw = ""; + [OptionalField] + public string version;//setDefault縺ァ螟画峩縺吶k縺ョ縺ァ縲〉eadonly縺ォ縺励◆縺縺代←縺ァ縺阪s + [OptionalField] + public Size m_size; + [OptionalField] + public Bitmap m_preview = null; + + [NonSerialized] + bool internal_operation = false; + + [OnDeserializing] + private void onDeserializing( StreamingContext sc ) { + version = "0"; + m_size = new Size( 0, 0 ); + } + + [OnSerialized] + private void onSerialized( StreamingContext sc ) { + if ( m_size.Equals( new Size( 0, 0 ) ) ) { + foreach ( ImageEntry img in Images ) { + if ( img.title == "base" ) { + if ( img.Image != null ) { + m_size = new Size( img.Image.Width, img.Image.Height ); + break; + } + } + } + } + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ){ + // 蜿、縺繝舌シ繧ク繝ァ繝ウ縺ョ*.lse縺ィ縺ョ莠呈鋤諤ァ繧剃ソ昴▽縺溘a縲 + // base, a, ..., nn縺ョ繝繝シ繧ソ繧棚mages縺ォ遘サ蜍輔&縺帙k + if ( nn != null ) { + Images.Insert( 0, new ImageEntry( "nn", nn, "蜿」", false ) ); + nn.Dispose(); + } + if ( xo != null ) { + Images.Insert( 0, new ImageEntry( "xo", xo, "蜿」", false ) ); + xo.Dispose(); + } + if ( o != null ) { + Images.Insert( 0, new ImageEntry( "o", o, "蜿」", false ) ); + o.Dispose(); + } + if ( e != null ) { + Images.Insert( 0, new ImageEntry( "e", e, "蜿」", false ) ); + e.Dispose(); + } + if ( u != null ) { + Images.Insert( 0, new ImageEntry( "u", u, "蜿」", false ) ); + u.Dispose(); + } + if ( i != null ) { + Images.Insert( 0, new ImageEntry( "i", i, "蜿」", false ) ); + i.Dispose(); + } + if ( aa != null ) { + Images.Insert( 0, new ImageEntry( "aa", aa, "蜿」", false ) ); + aa.Dispose(); + } + if ( a != null ) { + Images.Insert( 0, new ImageEntry( "a", a, "蜿」", false ) ); + a.Dispose(); + } + if ( Base != null ) { + Images.Insert( 0, new ImageEntry( "base", Base, "譛ャ菴", true ) ); + Base.Dispose(); + } + if ( version == "0" ) { + for ( int k = 0; k < Images.Count; k++ ) { + if ( Images[k].title == "base" ) { + Images[k].IsDefault = true; + m_size = Images[k].Image.Size; + version = "2"; + } + } + } + + if ( m_size.Width <= 0 || m_size.Height <= 0 ) { + int max_x = 0; + int max_y = 0; + foreach ( ImageEntry img in Images ) { + if ( img.Image != null ) { + max_x = Math.Max( max_x, img.Image.Width + img.XOffset ); + max_y = Math.Max( max_y, img.Image.Height + img.YOffset ); + } + } + m_size = new Size( max_x, max_y ); + } + + } + + public void Dispose() { + m_Name = null; + m_pluginConfig = null; + if ( Base != null ) { + Base.Dispose(); + } + if ( a != null ) { + a.Dispose(); + } + if ( aa != null ) { + aa.Dispose(); + } + if ( i != null ) { + i.Dispose(); + } + if ( u != null ) { + u.Dispose(); + } + if ( e != null ) { + e.Dispose(); + } + if ( o != null ) { + o.Dispose(); + } + if ( xo != null ) { + xo.Dispose(); + } + if ( nn != null ) { + nn.Dispose(); + } + Images.Clear(); + } + + public void Write( Stream stream ) { + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize( stream, this ); + } + + public string GetMD5() { + System.Security.Cryptography.MD5CryptoServiceProvider mcsp = new System.Security.Cryptography.MD5CryptoServiceProvider(); + using ( MemoryStream ms = new MemoryStream() ) { + this.Write( ms ); + byte[] dat = mcsp.ComputeHash( ms ); + string res = ""; + foreach ( byte b in dat ) { + res += b.ToString( "x2" ); + } + return res; + } + return ""; + } + + public static Character FromFile( Stream stream ) { + Character result = null; + BinaryFormatter bf = new BinaryFormatter(); + result = (Character)bf.Deserialize( stream ); + bf = null; + return result; + } + + public static Character FromFile( string filepath ) { + Character result = null; + if ( File.Exists( filepath ) ) { + using ( FileStream fs = new FileStream( filepath, FileMode.Open ) ) { + result = FromFile( fs ); + } + } + return result; + } + + public int Width { + get { + return m_size.Width; + } + } + + public int Height { + get { + return m_size.Height; + } + } + + public string Name { + get { + return m_Name; + } + set { + m_Name = value; + } + } + + public Bitmap DefaultFace { + get { + string type = ""; + foreach ( ImageEntry img in this.Images ) { + if ( img.IsDefault ) { + type += img.title + "\n"; + } + } + Bitmap res = Face( type ); +#if DEBUG + if ( res == null ) { + Common.DebugWriteLine( "Character.DefaultFace.get(); res==null" ); + Common.DebugWriteLine( " Width=" + Width ); + Common.DebugWriteLine( " Height=" + Height ); + Common.DebugWriteLine( " type=" + type ); + } +#endif + return res; + } + } + + public Bitmap Face( string type ) { + if ( Width <= 0 || Height <= 0 ) { + return null; + } + + if ( m_cache != null ) { + if ( m_cache_draw == type ) { + return (Bitmap)m_cache.Clone(); + } + } + + Bitmap bmp = new Bitmap( Width, Height ); + string[] spl = type.Split( "\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries ); + using ( Graphics g = Graphics.FromImage( bmp ) ) { + //Image drawing; + for ( int i = 0; i < spl.Length; i++ ) { + for ( int index = 0; index < Images.Count; index++ ) { + if ( Images[index].title == spl[i] ) { + //drawing = Images[index].image; + Images[index].DrawTo( g ); + break; + } + } + } + } + + m_cache_draw = type; + if ( m_cache != null ) { + m_cache.Dispose(); + } + m_cache = (Bitmap)bmp.Clone(); + return bmp; + } + } + +} diff --git a/trunk/LipSync/Editor/Character3.cs b/trunk/LipSync/Editor/Character3.cs new file mode 100644 index 0000000..11362af --- /dev/null +++ b/trunk/LipSync/Editor/Character3.cs @@ -0,0 +1,739 @@ +サソ/* + * Character3.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using System.Xml.Serialization; + +using LipSync.Properties; + +namespace LipSync { + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ繧貞叙繧頑桶縺繧ッ繝ゥ繧ケ縲 + /// 隨ャ3荳紋サ」 + /// + [Serializable] + public class Character3 : ICloneable, IDisposable { + string m_name; + CharacterType m_type; + ImageEntry[] m_basic = new ImageEntry[9]; + List m_another; + Size m_size; + [NonSerialized] + Bitmap m_cache = null; + [NonSerialized] + int[] m_cache_draw; + string m_author; + string m_version; + PluginConfig m_plugin_config; + bool m_updated = false; // 隨ャ2荳紋サ」縺ョCharacter縺九i繧「繝繝励ョ繝シ繝医&繧後◆繧ゅョ縺ァ縺ゅk縺薙→繧定。ィ縺吶ヵ繝ゥ繧ー + bool m_is_build_in = false; + /// + /// 菴ソ逕ィ荳翫ョ豕ィ諢上↑縺ゥ + /// + [OptionalField] + string m_lisence; + + #region public static field + /// + /// 繝薙Ν繝医う繝ウ繝サ繧ュ繝」繝ゥ繧ッ繧ソ縲 + /// + public static readonly Character3 Miku = new Character3( + "Miku", + "縺輔↑繧", + "", + new ImageEntry[] { + new ImageEntry( "base", Resources.b_miku175_base, "base", true ), + new ImageEntry( "a", Resources.b_miku175_a, "mouth", false ), + new ImageEntry( "aa", Resources.b_miku175_aa, "mouth", false ), + new ImageEntry( "i", Resources.b_miku175_i, "mouth", false ), + new ImageEntry( "u", Resources.b_miku175_u, "mouth", false ), + new ImageEntry( "e", Resources.b_miku175_e, "mouth", false ), + new ImageEntry( "o", Resources.b_miku175_o, "mouth", false ), + new ImageEntry( "xo", Resources.b_miku175_xo, "mouth", false ), + new ImageEntry( "nn", Resources.b_miku175_nn, "mouth", false ) + }, + new ImageEntry[] { + new ImageEntry( "逶ョ髢峨§", Resources.b_miku175_eyeclose, "eye", false ), + new ImageEntry( "菴守岼縺ォ縺」縺薙j", Resources.b_miku175_smile, "eye", false ), + new ImageEntry( "逶ョ蜊顔岼", Resources.b_miku175_eyethin, "eye", false ), + new ImageEntry( "縺薙↑縺", Resources.b_miku175_konata, "eye", false ), + new ImageEntry( "シ橸シ", Resources.b_miku175_kudo, "eye", false ), + new ImageEntry( "蜩蟾ヲ繧ヲ繧」繝ウ繧ッ", Resources.b_miku175_winkleft, "eye", false ), + new ImageEntry( "蜿ウ繧ヲ繧」繝ウ繧ッ", Resources.b_miku175_winkright, "eye", false ), + new ImageEntry( "bee", Resources.b_miku175_bee, "mouth", false), + new ImageEntry( "neko", Resources.b_miku175_neko, "mouth", false ) + }, + true + ); + + public static readonly Character3 Rin = new Character3( + "Rin", + "縺輔↑繧", + "", + new ImageEntry[] { + new ImageEntry( "base", Resources.b_rin100_base, "base",true ), + new ImageEntry( "a", Resources.b_rin100_a, "mouth", false ), + new ImageEntry( "aa", Resources.b_rin100_aa, "mouth", false ), + new ImageEntry( "i", Resources.b_rin100_i, "mouth", false ), + new ImageEntry( "u", Resources.b_rin100_u, "mouth", false ), + new ImageEntry( "e", Resources.b_rin100_e, "mouth", false ), + new ImageEntry( "o", Resources.b_rin100_o, "mouth", false ), + new ImageEntry( "xo", Resources.b_rin100_xo, "mouth", false ), + new ImageEntry( "nn", Resources.b_rin100_nn, "mouth", false ) + }, + new ImageEntry[] { + new ImageEntry( "逶ョ髢峨§", Resources.b_rin100_eyeclose, "eye", false ), + new ImageEntry( "菴守岼縺ォ縺」縺薙j", Resources.b_rin100_smile, "eye", false ), + new ImageEntry( "逶ョ蜊顔岼", Resources.b_rin100_eyethin, "eye", false ), + new ImageEntry( "シ橸シ", Resources.b_rin100_kudo, "eye", false ), + new ImageEntry( "蜩蟾ヲ繧ヲ繧」繝ウ繧ッ", Resources.b_rin100_winkleft, "eye", false ), + new ImageEntry( "菴主承繧ヲ繧」繝ウ繧ッ", Resources.b_rin100_winkright, "eye" , false), + new ImageEntry( "bee", Resources.b_rin100_bee, "mouth", false ), + new ImageEntry( "neko", Resources.b_rin100_neko, "mouth", false ), + new ImageEntry( "縺阪@縺", Resources.b_rin100_kisisi, "mouth", false ) + }, + true + ); + + public static readonly Character3 Len = new Character3( + "Len", + "縺輔↑繧", + "", + new ImageEntry[] { + new ImageEntry( "base", Resources.b_len100_base, "譛ャ菴", true ), + new ImageEntry( "a", Resources.b_len100_a, "mouth", false ), + new ImageEntry( "aa", Resources.b_len100_aa, "mouth", false ), + new ImageEntry( "i", Resources.b_len100_i, "mouth", false ), + new ImageEntry( "u", Resources.b_len100_u, "mouth", false ), + new ImageEntry( "e", Resources.b_len100_e, "mouth", false ), + new ImageEntry( "o", Resources.b_len100_o, "mouth", false ), + new ImageEntry( "xo", Resources.b_len100_xo, "mouth", false ), + new ImageEntry( "nn", Resources.b_len100_nn, "mouth", false ) + }, + new ImageEntry[] { + new ImageEntry( "逶ョ髢峨§", Resources.b_len100_eyeclose, "eye", false ), + new ImageEntry( "菴守岼縺ォ縺」縺薙j", Resources.b_len100_smile, "eye", false ), + new ImageEntry( "逶ョ蜊顔岼", Resources.b_len100_eyethin, "eye", false ), + new ImageEntry( "シ茨ス繝サマ峨サツエシ", Resources.b_len100_shakin, "eye", false ), + new ImageEntry( "蜩蟾ヲ繧ヲ繧」繝ウ繧ッ", Resources.b_len100_winkleft, "eye", false ), + new ImageEntry( "荳ュ蜿ウ繧ヲ繧」繝ウ繧ッ", Resources.b_len100_winkright, "eye", false ), + new ImageEntry( "縺阪@縺", Resources.b_len100_kisisi, "mouth", false ) + }, + true + ); + #endregion + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { + SortedList slist = new SortedList(); + foreach ( ImageEntry ie in m_basic ) { + slist.Add( ie.Z, ie.title ); + } + foreach ( ImageEntry ie in m_another ) { + slist.Add( ie.Z, ie.title ); + } + for ( int i = 0; i < slist.Keys.Count; i++ ) { + string title = slist[slist.Keys[i]]; + bool found = false; + for ( int j = 0; j < m_basic.Length; j++ ) { + if ( m_basic[j].title == title ) { + m_basic[j].Z = i; + found = true; + break; + } + } + if ( !found ) { + for ( int j = 0; j < m_another.Count; j++ ) { + if ( m_another[j].title == title ) { + m_another[j].Z = i; + break; + } + } + } + } + } + + public bool IsBuildIn { + get { + return m_is_build_in; + } + } + + public void Remove( string title ) { + for ( int i = 0; i < m_another.Count; i++ ) { + if ( m_another[i].title == title ) { + m_another.RemoveAt( i ); + break; + } + } + } + + public void SetImage( Image img, int index ) { + this[index].SetImage( img ); + } + + public void SetImage( Image img, string title ) { + this[title].SetImage( img ); + } + + public PluginConfig PluginConfig { + get { + return m_plugin_config; + } + set { + m_plugin_config = value; + } + } + + public int Count { + get { + return 9 + m_another.Count; + } + } + + public void Dispose() { + m_basic = null; + m_another.Clear(); + if ( m_cache != null ) { + m_cache.Dispose(); + } + } + + public void Add( ImageEntry item ) { + ImageEntry adding = (ImageEntry)item.Clone(); + adding.Z = this.Count; + m_another.Add( adding ); + } + + public string Version { + get { + return m_version; + } + set { + m_version = value; + } + } + + public string Author { + get { + return m_author; + } + set { + m_author = value; + } + } + + public Character3() { + m_name = ""; + m_type = CharacterType.def; + m_basic = new ImageEntry[9]; + m_basic[0] = new ImageEntry( "base", null, "base", true ); + m_basic[1] = new ImageEntry( "a", null, "mouth", false ); + m_basic[2] = new ImageEntry( "aa", null, "mouth", false ); + m_basic[3] = new ImageEntry( "i", null, "mouth", false ); + m_basic[4] = new ImageEntry( "u", null, "mouth", false ); + m_basic[5] = new ImageEntry( "e", null, "mouth", false ); + m_basic[6] = new ImageEntry( "o", null, "mouth", false ); + m_basic[7] = new ImageEntry( "xo", null, "mouth", false ); + m_basic[8] = new ImageEntry( "nn", null, "mouth", false ); + for ( int i = 0; i < 9; i++ ) { + m_basic[i].Z = i; + } + m_another = new List(); + m_size = new Size(); + m_author = ""; + m_version = ""; + } + + public void Write( Stream s ) { + BinaryFormatter bf = new BinaryFormatter(); + bf.Serialize( s, this ); + } + + public string GetMD5() { + System.Security.Cryptography.MD5CryptoServiceProvider mcsp = new System.Security.Cryptography.MD5CryptoServiceProvider(); + using ( MemoryStream ms = new MemoryStream() ) { + this.Write( ms ); + byte[] dat = mcsp.ComputeHash( ms ); + string res = ""; + foreach ( byte b in dat ) { + res += b.ToString( "x2" ); + } + return res; + } + return ""; + } + + /// + /// 繝輔ぃ繧、繝ォ縺ォ菫晏ュ倥☆繧 + /// + /// + /// + public void WriteXml( string path ) { + string f = Path.GetFileName( path ); + if ( f != "content.xml" ) { + return; + } + int width = this.Width; + int height = this.Height; + string base_path = Path.GetDirectoryName( path ); + string image_path = Path.Combine( base_path, "images" ); + if ( !Directory.Exists( image_path ) ) { + Directory.CreateDirectory( Path.Combine( base_path, "images" ) ); + } + using ( FileStream fs = new FileStream( Path.Combine( base_path, "content.xml" ), FileMode.Create ) ) { + XmlSerializer xs = new XmlSerializer( typeof( Character3 ) ); + xs.Serialize( fs, this ); + } + using ( FileStream fs = new FileStream( Path.Combine( base_path, "basic.xml" ), FileMode.Create ) ) { + XmlSerializer xs = new XmlSerializer( typeof( ImageEntry[] ) ); + xs.Serialize( fs, m_basic ); + } + using ( FileStream fs = new FileStream( Path.Combine( base_path, "another.xml" ), FileMode.Create ) ) { + XmlSerializer xs = new XmlSerializer( typeof( List ) ); + xs.Serialize( fs, m_another ); + } + int count = -1; + foreach ( ImageEntry img in this ) { + count++; + if ( img.Image != null ) { + string file = Path.Combine( Path.Combine( base_path, "images" ), img.Z + ".png" ); + Bitmap temp = img.GetImage( width, height ); + temp.Save( file ); + } + } + } + + public Character3( PluginConfig plugin_config ) { + m_name = plugin_config.ID; + m_type = CharacterType.plugin; + m_plugin_config = plugin_config.Clone(); + m_updated = false; + } + + public static Character3 Read( Stream s ) { + BinaryFormatter bf = new BinaryFormatter(); + Character3 res = null; + try { + res = (Character3)bf.Deserialize( s ); + return res; + } catch { + return null; + } + } + + /// + /// xml繝輔ぃ繧、繝ォ縺九i縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + public static Character3 FromXml( string path ) { +#if DEBUG + Common.DebugWriteLine( "Character3.ctor(string);" ); +#endif + Character3 res; + string dir = Path.GetDirectoryName( path ); + using ( FileStream fs = new FileStream( path, FileMode.Open ) ) { + XmlSerializer xs = new XmlSerializer( typeof( Character3 ) ); + res = (Character3)xs.Deserialize( fs ); + } + + using ( FileStream fs = new FileStream( Path.Combine( dir, "basic.xml" ), FileMode.Open ) ) { + XmlSerializer xs = new XmlSerializer( typeof( ImageEntry[] ) ); + res.m_basic = (ImageEntry[])xs.Deserialize( fs ); + } + using ( FileStream fs = new FileStream( Path.Combine( dir, "another.xml" ), FileMode.Open ) ) { + XmlSerializer xs = new XmlSerializer( typeof( List ) ); + res.m_another = (List)xs.Deserialize( fs ); + } + //res.ZReorder(); + for ( int i = 0; i < res.Count; i++ ) { + int z = res[i].Z; + string file = Path.Combine( Path.Combine( dir, "images" ), z + ".png" ); +#if DEBUG + Common.DebugWriteLine( "Character3.ctor(String); file=" + file ); +#endif + if ( File.Exists( file ) ) { + res[i].SetImage( Common.ImageFromFile( file ) ); + } + } +#if DEBUG + Common.DebugWriteLine( "Character3.FromXml()" ); + for ( int i = 0; i < res.Count; i++ ) { + Common.DebugWriteLine( "i=" + i + "; title=" + res[i].title + "; (image==null)=" + (res[i].Image == null) ); + } + Common.DebugWriteLine( "m_size=" + res.m_size ); +#endif + return res; + } + + public static Character3 FromFile( string path ) { + Character3 res; + using ( FileStream fs = new FileStream( path, FileMode.Open ) ) { + BinaryFormatter bf = new BinaryFormatter(); + res = (Character3)bf.Deserialize( fs ); + } + return res; + } + + /// + /// 隨ャ2荳紋サ」逶ョ縺ョCharacter縺九i縺ョ繧ウ繝ウ繝舌シ繝 + /// + /// + /// + public Character3( Character character ) { + List basic = new List(); + List another = new List(); + string[] titles = new string[] { "base", "a", "aa", "i", "u", "e", "o", "xo", "nn" }; + + // z繧ェ繝シ繝繝シ繧呈峩譁ー縺励※縺翫¥ + for ( int i = 0; i < character.Images.Count; i++ ) { + character.Images[i].Z = i; + } +#if DEBUG + string t1 = ""; + for ( int i = 0; i < character.Images.Count; i++ ) { + t1 += character.Images[i].ToString() + "\n"; + } + System.Windows.Forms.MessageBox.Show( t1 ); +#endif + foreach ( string title in titles ) { + bool found = false; + foreach ( ImageEntry img in character.Images ) { + if ( img.title == title ) { + ImageEntry cp = new ImageEntry( img.title, null, img.tag, img.IsDefault, img.Z ); + cp.SetImage( img.GetImage() ); + basic.Add( cp ); + found = true; + break; + } + } + if ( !found ) { + if ( title == "base" ) { + basic.Add( new ImageEntry( title, null, "base", true ) ); + } else { + basic.Add( new ImageEntry( title, null, "mouth", false ) ); + } + } + } + + // another + foreach ( ImageEntry img in character.Images ) { + bool is_basic = false; + foreach ( string title in titles ) { + if ( img.title == title ) { + is_basic = true; + break; + } + } + if ( !is_basic ) { + ImageEntry cp = new ImageEntry( img.title, null, img.tag, img.IsDefault, img.Z ); + cp.SetImage( img.GetImage() ); + another.Add( cp ); + } + } + + m_name = character.Name; + m_basic = basic.ToArray(); + m_another = new List( another.ToArray() ); + m_size = character.m_size; + m_type = CharacterType.def; + m_author = ""; + m_version = ""; + m_updated = true; + //ZReorder(); +#if DEBUG + string t = ""; + for ( int i = 0; i < m_basic.Length; i++ ) { + t += m_basic[i].ToString() + "\n"; + } + for ( int i = 0; i < m_another.Count; i++ ) { + t += m_another[i].ToString() + "\n"; + } + System.Windows.Forms.MessageBox.Show( t ); +#endif + } + + [XmlIgnore] + public Bitmap DefaultFace { + get { + List type = new List(); + int count = -1; + foreach ( ImageEntry img in this ) { + count++; + if ( img.IsDefault ) { + type.Add( count ); + } + } + return Face( type.ToArray() ); + } + } + + public IEnumerator GetEnumerator() { + for ( int i = 0; i < m_basic.Length; i++ ) { + yield return m_basic[i]; + } + for ( int i = 0; i < m_another.Count; i++ ) { + yield return m_another[i]; + } + } + + public Bitmap Face( int[] targets ) { + if ( Width <= 0 || Height <= 0 ) { + return null; + } + + // z繧ェ繝シ繝繝シ鬆縺ォ謠冗判縺吶k逕サ蜒上r荳ヲ縺ケ譖ソ縺医k + int[] zorder = new int[targets.Length]; + for ( int i = 0; i < targets.Length; i++ ) { + zorder[i] = this[targets[i]].Z; + } + bool c = true; + while ( c ) { + c = false; + for ( int i = 0; i < targets.Length - 1; i++ ) { + if ( zorder[i] > zorder[i + 1] ) { + int b = targets[i]; + targets[i] = targets[i + 1]; + targets[i + 1] = b; + b = zorder[i]; + zorder[i] = zorder[i + 1]; + zorder[i + 1] = b; + c = true; + } + } + if ( !c ) { + break; + } + } + + // 蜑榊屓謠冗判縺励◆縺ョ縺ィ蜷後§謠冗判隕∵アゅ〒縺ゅl縺ー縲√く繝」繝繧キ繝・繧偵◎縺ョ縺セ縺セ霑斐☆ + if ( m_cache != null && m_cache_draw != null ) { + if ( m_cache_draw.Length == targets.Length ) { + bool match = true; + for ( int i = 0; i < targets.Length; i++ ) { + if ( m_cache_draw[i] != targets[i] ) { + match = false; + break; + } + } + if ( match ) { + return (Bitmap)m_cache.Clone(); + } + } + } + m_cache_draw = targets; + + Bitmap bmp = new Bitmap( Width, Height ); + using ( Graphics g = Graphics.FromImage( bmp ) ) { + for ( int i = 0; i < targets.Length; i++ ) { + ImageEntry img = this[targets[i]]; + if ( img != null ) { + img.DrawTo( g ); + } + } + } + + if ( m_cache != null ) { + m_cache = null; + } + m_cache = (Bitmap)bmp.Clone(); + return bmp; + } + + public ImageEntry this[string title] { + get { + for ( int i = 0; i < m_basic.Length; i++ ) { + if ( m_basic[i].title == title ) { + return m_basic[i]; + } + } + for ( int i = 0; i < m_another.Count; i++ ) { + if ( m_another[i].title == title ) { + return m_another[i]; + } + } + return null; + } + /*set { + for ( int i = 0; i < m_basic.Length; i++ ) { + if ( m_basic[i].title == title ) { + m_basic[i] = value; + } + } + for ( int i = 0; i < m_another.Count; i++ ) { + if ( m_another[i].title == title ) { + m_another[i] = value; + } + } + }*/ + } + + public ImageEntry this[int zorder] { + get { + for ( int i = 0; i < m_basic.Length; i++ ) { + if ( m_basic[i].Z == zorder ) { + return m_basic[i]; + } + } + for ( int i = 0; i < m_another.Count; i++ ) { + if ( m_another[i].Z == zorder ) { + return m_another[i]; + } + } + return null; + } + set { + for ( int i = 0; i < m_basic.Length; i++ ) { + if ( m_basic[i].Z == zorder ) { + m_basic[i] = value; + m_basic[i].Z = zorder; + return; + } + } + for ( int i = 0; i < m_another.Count; i++ ) { + if ( m_another[i].Z == zorder ) { + m_another[i] = value; + m_another[i].Z = zorder; + return; + } + } + } + } + + public Size Size { + get { + if ( m_type == CharacterType.def ) { + return m_size; + } else { + throw new NotImplementedException(); + } + } + set { + m_size = value; + } + } + + [XmlIgnore] + public int Width { + get { + return m_size.Width; + } + } + + [XmlIgnore] + public int Height { + get { + return m_size.Height; + } + } + + public object Clone() { + Character3 res = new Character3(); + res.m_name = m_name; + res.m_author = m_author; + res.m_version = m_version; + res.m_type = m_type; + if ( m_plugin_config != null ) { + res.m_plugin_config = m_plugin_config.Clone(); + } + for ( int i = 0; i < 9; i++ ) { + res.m_basic[i] = (ImageEntry)m_basic[i].Clone(); + } + res.m_another.Clear(); + for ( int i = 0; i < m_another.Count; i++ ) { + res.m_another.Add( (ImageEntry)m_another[i].Clone() ); + } + res.m_updated = m_updated; + res.m_size = m_size; + return res; + } + + private Character3( string name, string author, string version, ImageEntry[] basic, ImageEntry[] another, bool is_build_in ) + : this( name, author, version, basic, another ) { + m_is_build_in = is_build_in; + } + + public Character3( string name, string author, string version, ImageEntry[] basic, ImageEntry[] another ) { + m_type = CharacterType.def; + m_name = name; + m_author = author; + m_version = version; + if ( basic.Length < 9 ) { + throw new ArgumentException( "basic.Length < 9" ); + } + int z = -1; + for ( int i = 0; i < 9; i++ ) { + z++; + m_basic[i] = (ImageEntry)basic[i].Clone(); + m_basic[i].Z = z; + } + if ( another != null ) { + m_another = new List( another ); + } else { + m_another = new List(); + } + for ( int i = 0; i < m_another.Count; i++ ) { + z++; + m_another[i].Z = z; + } + int width = 0; + int height = 0; + if ( basic != null ) { + foreach ( ImageEntry img in basic ) { + if ( img.Image != null ) { + width = Math.Max( width, img.Image.Width ); + height = Math.Max( height, img.Image.Height ); + } + } + } + if ( another != null ) { + foreach ( ImageEntry img in another ) { + if ( img.Image != null ) { + width = Math.Max( width, img.Image.Width ); + height = Math.Max( height, img.Image.Height ); + } + } + } + //ZReorder(); + m_size = new Size( width, height ); + m_updated = false; + } + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ縺ョ繧ソ繧、繝励r蜿門セ励@縺セ縺 + /// + public CharacterType Type { + get { + return m_type; + } + } + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ縺ョ蜷咲ァー繧貞叙蠕励@縺セ縺 + /// + public string Name { + get { + return m_name; + } + set { + m_name = value; + } + } + } + +} diff --git a/trunk/LipSync/Editor/CharacterConfigCollection.cs b/trunk/LipSync/Editor/CharacterConfigCollection.cs new file mode 100644 index 0000000..89b4d73 --- /dev/null +++ b/trunk/LipSync/Editor/CharacterConfigCollection.cs @@ -0,0 +1,136 @@ +サソ/* + * CharacterConfigCollection.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; + +namespace LipSync { + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺ョ繝ェ繧ケ繝医r邂。逅縺吶k繧ッ繝ゥ繧ケ + /// + public static class CharacterConfigCollection { + + /// + /// 繝ェ繧ケ繝医ョ譛螟ァ髟キ + /// + const int MAX_DICT_LEN = 128; + static List m_list = new List(); + + /// + /// ID縺景d縺ァ縺ゅk繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺後Μ繧ケ繝医↓逋サ骭イ縺輔l縺ヲ縺繧九°縺ゥ縺縺九r霑斐@縺セ縺 + /// + /// + /// + public static bool IsRegistered( string id ) { + foreach ( CharacterConfigSpecifier item in m_list ) { + if ( item.ID == id ) { + return true; + } + } + return false; + } + + + /// + /// 迴セ蝨ィ縺ョ繝ェ繧ケ繝医ョ蜀螳ケ繧帝先ャ。霑斐☆iterator + /// + /// + public static IEnumerator GetEnumerator() { + foreach ( CharacterConfigSpecifier item in m_list ) { + yield return item; + } + yield break; + } + + + /// + /// 繝輔ぃ繧、繝ォ蜷阪′id縺ァ縺ゅk繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺ョ繝励Ξ繝薙Η繝シ繧定ソ斐@縺セ縺呻シ取悴逋サ骭イ縺ョ蝣エ蜷医ッnull繧定ソ斐@縺セ縺 + /// + /// + /// + public static Image GetPreviewImage( string id ) { + foreach ( CharacterConfigSpecifier item in m_list ) { + if ( item.ID == id ) { + return item.Image; + } + } + return null; + } + + + /// + /// 繝輔ぃ繧、繝ォ蜷阪′file縺ァ縺ゅk繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ繧定ェュ縺ソ霎シ縺ソシ後Μ繧ケ繝医↓逋サ骭イ縺励∪縺呻シ + /// 譌「縺ォ逋サ骭イ貂医∩縺ァ縺ゅ▲縺ヲ繧ゑシ檎匳骭イ縺輔l縺滓凾轤ケ繧医j繝輔ぃ繧、繝ォ縺梧眠縺励¢繧後ーシ檎匳骭イ蜀螳ケ繧呈峩譁ー縺励∪縺 + /// + /// + public static void Register( string file ) { +#if DEBUG + Common.DebugWriteLine( "CharacterConfigCollection.Register(String); m_list.Count=" + m_list.Count ); +#endif + if ( !File.Exists( file ) ) { + return; + } + DateTime date = File.GetLastWriteTimeUtc( file ); + DateTime date_registered = new DateTime(); + int index = -1; + for( int i = 0; i < m_list.Count; i++ ){ + if ( m_list[i].ID == file ) { + index = i; + date_registered = m_list[i].LastModefied; + break; + } + } + + // Character, Character3繧ッ繝ゥ繧ケ繧定ェュ縺ソ霎シ繧薙〒シ檎匳骭イ + CharacterConfigSpecifier item = null; + if ( Path.GetFileName( file ).ToLower() == "content.xml" ) { + Character3 ch = Character3.FromXml( file ); + item = new CharacterConfigSpecifier( ch, file, File.GetLastWriteTimeUtc( file ) ); + } else { + try { + Character3 ch = Character3.FromFile( file ); + item = new CharacterConfigSpecifier( ch, file, File.GetLastWriteTimeUtc( file ) ); + } catch { + try { + Character t = LipSync.Character.FromFile( file ); + item = new CharacterConfigSpecifier( t, file, File.GetLastWriteTimeUtc( file ) ); + } catch { + item = new CharacterConfigSpecifier( file, File.GetLastWriteTimeUtc( file ) ); + } + } + } + if ( item != null ) { +#if DEBUG + string dir = Path.GetDirectoryName( file ); + Common.GetThumbnailImage( item.Image, 128, 128 ).Save( Path.Combine( dir, Path.GetFileNameWithoutExtension( file ) ) + ".png" ); +#endif + if ( index >= 0 ) { + if ( date > date_registered ) { + m_list.RemoveAt( index ); + if ( m_list.Count > MAX_DICT_LEN ) { + m_list.RemoveAt( 0 ); + } + m_list.Add( item ); + } + } else { + m_list.Add( item ); + } + } + } + + } + +} diff --git a/trunk/LipSync/Editor/CharacterConfigSpecifier.cs b/trunk/LipSync/Editor/CharacterConfigSpecifier.cs new file mode 100644 index 0000000..bd52768 --- /dev/null +++ b/trunk/LipSync/Editor/CharacterConfigSpecifier.cs @@ -0,0 +1,95 @@ +サソ/* + * CharacterConfigSpecifier.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ繧定ュ伜挨縺吶k縺溘a縺ョ繧ッ繝ゥ繧ケ + /// + public class CharacterConfigSpecifier { + Image m_preview; + string m_id; + DateTime m_last_modefied; + + const int w = 256; + const int h = 256; + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ繧堤音螳壹☆繧紀Dシ朱壼クク縺ッ繝輔ぃ繧、繝ォ縺ク縺ョ繝輔Ν繝代せ + /// + public string ID { + get { + return m_id; + } + } + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺ョ譛邨よ峩譁ー譎ょ綾 + /// + public DateTime LastModefied { + get { + return m_last_modefied; + } + } + + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺ョ繝励Ξ繝薙Η繝シ + /// + public Image Image { + get { + return m_preview; + } + } + + public CharacterConfigSpecifier( string id, DateTime date ) { + m_id = id; + m_last_modefied = date; + } + + public CharacterConfigSpecifier( Character3 character, string id, DateTime date ) { + if ( character != null ) { + Bitmap bmp = character.DefaultFace; + Rectangle rc = Common.GetNonTransparentRegion( bmp ); + using ( Bitmap t = new Bitmap( rc.Width, rc.Height ) ) + using ( Graphics g = Graphics.FromImage( t ) ) { + g.DrawImage( + bmp, + 0, 0, rc, GraphicsUnit.Pixel ); + m_preview = Common.GetThumbnailImage( t, w, h ); + } + } + m_id = id; + m_last_modefied = date; + } + + public CharacterConfigSpecifier( Character character, string id, DateTime date ) { + if ( character != null ) { + Bitmap bmp = character.DefaultFace; + Rectangle rc = Common.GetNonTransparentRegion( bmp ); + using ( Bitmap t = new Bitmap( rc.Width, rc.Height ) ) + using ( Graphics g = Graphics.FromImage( t ) ) { + g.DrawImage( + bmp, + 0, 0, rc, GraphicsUnit.Pixel ); + m_preview = Common.GetThumbnailImage( t, w, h ); + } + } + m_id = id; + m_last_modefied = date; + } + } + +} diff --git a/trunk/LipSync/Editor/ColorSet.cs b/trunk/LipSync/Editor/ColorSet.cs new file mode 100644 index 0000000..3a24365 --- /dev/null +++ b/trunk/LipSync/Editor/ColorSet.cs @@ -0,0 +1,95 @@ +サソ/* + * ColorSet.cs + * Copyright (c) 2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + public class ColorSet { + public int A = 255; + public int R; + public int G; + public int B; + + public ColorSet( int alpha, int red, int green, int blue ) { + if ( red < 0 || 255 < red ) { + throw new ArgumentOutOfRangeException( "red" ); + } + if ( green < 0 || 255 < green ) { + throw new ArgumentOutOfRangeException( "green" ); + } + if ( blue < 0 || 255 < blue ) { + throw new ArgumentOutOfRangeException( "blue" ); + } + if ( alpha < 0 || 255 < alpha ) { + throw new ArgumentOutOfRangeException( "alpha" ); + } + R = red; + G = green; + B = blue; + A = alpha; + } + + public ColorSet() + : this( 255, 255, 255, 255 ) { + } + + public ColorSet( int red, int green, int blue ) + : this( 255, red, green, blue ) { + } + + public ColorSet( Color color ) + : this( color.A, color.R, color.G, color.B ) { + } + + public ColorSet( int alpha, ColorSet color ) + : this( alpha, color.R, color.G, color.B ) { + } + + public ColorSet( int alpha, Color color ) : + this( alpha, color.R, color.G, color.B ) { + } + + public Color Color { + get { + return Color.FromArgb( A, R, G, B ); + } + } + + public override bool Equals( object obj ) { + return Equals( obj, false ); + } + + public bool Equals( object obj, bool ignore_alpha ) { + if ( obj is ColorSet ) { + ColorSet item = (ColorSet)obj; + if ( ignore_alpha ) { + return (item.R == R && item.G == G && item.B == B); + } else { + return (item.A == A && item.R == R && item.G == G && item.B == B); + } + } else if ( obj is Color ) { + Color item = (Color)obj; + if ( ignore_alpha ) { + return (item.R == R && item.G == G && item.B == B); + } else { + return (item.A == A && item.R == R && item.G == G && item.B == B); + } + } else { + return base.Equals( obj ); + } + } + } + +} diff --git a/trunk/LipSync/Editor/Command.cs b/trunk/LipSync/Editor/Command.cs new file mode 100644 index 0000000..2d48d7e --- /dev/null +++ b/trunk/LipSync/Editor/Command.cs @@ -0,0 +1,316 @@ +サソ/* + * Command.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + public class Command { + public TimeTableType target; + public CommandType type; + public TimeTableEntry item; + public TimeTable table; + public TimeTableGroup tablegroup; + public Image image; + public Point position; + public int group; + public int track; + public int entry; + public string str; + public float floatValue; + public Size size; + public Telop telop; + public uint dwRate; + public uint dwScale; + public Color color; + public Command child; + public object[] args; + + public static Command GCommandChangeBackgroundColor( Color color ){ + Command ret = new Command(); + ret.target = TimeTableType.whole; + ret.type = CommandType.changeBackgroundColor; + ret.color = color; + return ret; + } + + public static Command GCommandAddTelop( Telop telop ) { + Command ret = new Command(); + ret.target = TimeTableType.telop; + ret.type = CommandType.addTelop; + if ( telop != null ) { + ret.telop = (Telop)telop.Clone(); + } + return ret; + } + + public static Command GCommandAddTelopRange( Telop[] telops ) { + Command ret = new Command(); + ret.target = TimeTableType.telop; + ret.type = CommandType.addTelopRange; + ret.args = new object[1]; + Telop[] add = new Telop[telops.Length]; + for ( int i = 0; i < add.Length; i++ ) { + add[i] = (Telop)telops[i].Clone(); + } + ret.args[0] = add; + return ret; + } + + public static Command GCommandEditTelop( int id, Telop telop ) { + Command ret = new Command(); + ret.target = TimeTableType.telop; + ret.type = CommandType.editTelop; + ret.entry = id; + if ( telop != null ) { + ret.telop = (Telop)telop.Clone(); + } + return ret; + } + + public static Command GCommandDeleteTelop( Telop item ) { + Command ret = new Command(); + ret.target = TimeTableType.telop; + ret.type = CommandType.deleteTelop; + ret.telop = (Telop)item.Clone(); + return ret; + } + + public static Command GCommandDeleteTelopRange( Telop[] items ) { + Command ret = new Command(); + ret.target = TimeTableType.telop; + ret.type = CommandType.deleteTelopRange; + ret.args = new object[1]; + Telop[] items2 = new Telop[items.Length]; + for ( int i = 0; i < items2.Length; i++ ) { + items2[i] = (Telop)items[i].Clone(); + } + ret.args[0] = items2; + return ret; + } + + public static Command GCommandDeleteTimeTableGroup( TimeTableType target, int group ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.deleteGroup; + ret.group = group; + return ret; + } + + public static Command GCommandDeleteTimeTable( TimeTableType target, int group, int track ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.deleteTimeTable; + ret.group = group; + ret.track = track; + return ret; + } + + public static Command GCommandSetMp3( string file_name ){ + Command ret = new Command(); + ret.target = TimeTableType.whole; + ret.type = CommandType.setMP3; + ret.str = file_name; + return ret; + } + + public static Command GCommandChangeVideoSize( Size size ){ + Command ret = new Command(); + ret.target = TimeTableType.whole; + ret.type = CommandType.changeVideoSize; + ret.size = size; + return ret; + } + + public static Command GCommandShiftTimeTable( TimeTableType target, int track, float floatValue ){ + Command ret = new Command(); + ret.target = target; + if ( target == TimeTableType.character ) { + ret.group = track; + } else { + ret.track = track; + } + ret.type = CommandType.shiftTimeTable; + ret.floatValue = floatValue; + return ret; + } + + public static Command GCommandChangeFps( uint rate, uint scale ){ + Command ret = new Command(); + ret.target = TimeTableType.whole; + ret.type = CommandType.changeFps; + ret.dwRate = rate; + ret.dwScale = scale; + return ret; + } + + public static Command GCommandChangeScale( TimeTableType target, int group, int track, float scale ){ + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.changeScale; + ret.group = group; + ret.track = track; + ret.floatValue = scale; + return ret; + } + + public static Command GCommandChangePluginConfig( int track, string config ) { + Command ret = new Command(); + ret.target = TimeTableType.whole; + ret.type = CommandType.changePluginConfig; + ret.track = track; + ret.str = config; + return ret; + } + + public static Command GCommandSetAvi( int track, string file_name ){ + Command ret = new Command(); + ret.target = TimeTableType.another; + ret.type = CommandType.setAvi; + ret.track = track; + ret.str = file_name; + return ret; + } + + public static Command GCommandEditTimeTableEntry( TimeTableType target, int group, int track, int entry, TimeTableEntry item ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.editEntry; + ret.group = group; + ret.track = track; + ret.entry = entry; + if ( item != null ) { + ret.item = (TimeTableEntry)item.Clone(); + } + return ret; + } + + public static Command GCommandAddTimeTableEntry( TimeTableType target, int group, int track, TimeTableEntry item ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.addEntry; + ret.group = group; + ret.track = track; + if ( item != null ) { + ret.item = (TimeTableEntry)item.Clone(); + } + return ret; + } + + public static Command GCommandDeleteTimeTableEntry( TimeTableType target, int group, int track, TimeTableEntry item ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.deleteEntry; + ret.group = group; + ret.track = track; + if ( item != null ) { + ret.item = (TimeTableEntry)item.Clone(); + } + return ret; + } + + public static Command GCommandEditTimeTable( TimeTableType target, int group, int track, TimeTable table ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.editTimeTable; + ret.group = group; + ret.track = track; + if ( table != null ) { + ret.table = (TimeTable)table.Clone(); + } + return ret; + } + + public static Command GCommandAddTimeTable( TimeTableType target, int group, int track, TimeTable table ){ + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.addTimeTable; + ret.group = group; + ret.track = track; + if ( table != null ) { + ret.table = (TimeTable)table.Clone(); + } + return ret; + } + + public static Command GCommandEditGroup( TimeTableType target, int group, TimeTableGroup table_group ) { + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.editGroup; + ret.group = group; + ret.tablegroup = (TimeTableGroup)table_group.Clone(); + return ret; + } + + public static Command GCommandAddGroup( TimeTableType target, int group, TimeTableGroup tablegroup ){ + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.addGroup; + ret.group = group; + if ( tablegroup != null ) { + ret.tablegroup = (TimeTableGroup)tablegroup.Clone(); + } else { + ret.tablegroup = null; + } + return ret; + } + + public static Command GCommandSetImage( int track, Image img ){ + Command ret = new Command(); + ret.target = TimeTableType.another; + ret.type = CommandType.setImage; + ret.track = track; + if ( img != null ) { + ret.image = (Image)img.Clone(); + } else { + ret.image = null; + } + return ret; + } + + public static Command GCommandSetPosition( TimeTableType target, int group, int track, Point position ){ + Command ret = new Command(); + ret.target = target; + ret.type = CommandType.setPosition; + ret.group = group; + ret.track = track; + ret.position = position; + return ret; + } + + public static Command GCommandNothing() { + Command ret = new Command(); + ret.target = TimeTableType.none; + return ret; + } + + private Command() { + } + + public override string ToString() { + string res = ""; + res += target.ToString(); + res += "," + type.ToString(); + res += ",group=" + group + ",track=" + track + ";entry=" + entry; + + if ( item == null ) { + res += ";item=null"; + } else { + res += ";item={begin=" + item.begin + ",end=" + item.end + ",body=" + item.body; + } + return res; + } + } + +} diff --git a/trunk/LipSync/Editor/CommandType.cs b/trunk/LipSync/Editor/CommandType.cs new file mode 100644 index 0000000..d921dba --- /dev/null +++ b/trunk/LipSync/Editor/CommandType.cs @@ -0,0 +1,44 @@ +サソ/* + * CommandType.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + public enum CommandType { + nothing, + addEntry, + deleteEntry, + editEntry, + addTimeTable, + deleteTimeTable, + editTimeTable, + addGroup, // CommandTarget == character縺ョ譎ゅョ縺ソ + editGroup, // CommandTarget == character縺ョ譎ゅョ縺ソ + deleteGroup, // CommandTarget == character縺ョ譎ゅョ縺ソ + setPosition, + setImage, + changePluginConfig, + changeFps, + changeVideoSize, + shiftTimeTable, + changeScale, + setMP3, + addTelop, + addTelopRange, + editTelop, + deleteTelop, + deleteTelopRange, + setAvi, + changeBackgroundColor, + } + +} diff --git a/trunk/LipSync/Editor/DisplacementControl.cs b/trunk/LipSync/Editor/DisplacementControl.cs new file mode 100644 index 0000000..73113ea --- /dev/null +++ b/trunk/LipSync/Editor/DisplacementControl.cs @@ -0,0 +1,235 @@ +サソ/* + * DisplacementControl.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class DisplacementControl : Form, IMultiLanguageControl { + private PointF m_scaleandoffset_x = new PointF( 1f, 0f ); + private PointF m_scaleandoffset_y = new PointF( 1f, 0f ); + private PointF m_scaleandoffset_alpha = new PointF( 400f, 0.3f ); + private PointF m_scaleandoffset_scale = new PointF( 40f, 0.5f ); + private PointF m_scaleandoffset_rotate = new PointF( 1f, 0f ); + private bool m_first_scaleandoffset = true; + + public DisplacementControl() { + InitializeComponent(); + ApplyFont( AppManager.Config.Font.GetFont() ); + ApplyLanguage(); + Rectangle r = AppManager.Config.CurveWindowPos; + Point pt_lt = new Point( r.Left, r.Top ); + Point pt_lb = new Point( r.Left, r.Bottom ); + Point pt_rt = new Point( r.Right, r.Top ); + Point pt_rb = new Point( r.Right, r.Bottom ); + bool visible = false; + foreach ( Screen s in Screen.AllScreens ) { + visible = visible | (IsInRectangle( pt_lt, s.Bounds ) | IsInRectangle( pt_lb, s.Bounds ) | IsInRectangle( pt_rt, s.Bounds ) | IsInRectangle( pt_rb, s.Bounds )); + } + if ( visible ) { + this.Left = r.Left; + this.Top = r.Top; + this.Width = r.Width; + this.Height = r.Height; + } else { + this.Width = Screen.PrimaryScreen.Bounds.Width / 2; + this.Height = Screen.PrimaryScreen.Bounds.Height / 2; + this.Left = this.Width / 2; + this.Top = this.Height / 2; + } + if ( AppManager.Config.CurveMaximized ) { + this.WindowState = FormWindowState.Maximized; + } else { + this.WindowState = FormWindowState.Normal; + } + this.SizeChanged += new EventHandler( DisplacementControl_LocationOrSizeChanged ); + this.LocationChanged += new EventHandler( DisplacementControl_LocationOrSizeChanged ); + } + + /// + /// 縺ゥ縺ョ繧ォ繝シ繝悶b驕ク謚槭&繧後※縺縺ェ縺迥カ諷九↓縺励∪縺 + /// + public void SetSelectedNone() { + curveEditor.Clear(); + curveEditor.ClearBuffer(); + comboObjects.SelectedIndex = -1; + } + + /// + /// rect縺ョ荳ュ縺ォpoint縺悟・縺」縺ヲ縺繧九°縺ゥ縺縺九r蛻、螳 + /// + /// + /// + /// + private static bool IsInRectangle( Point point, Rectangle rect ) { + if ( rect.X <= point.X && point.X <= rect.X + rect.Width ) { + if ( rect.Y <= point.Y && point.Y <= rect.Y + rect.Height ) { + return true; + } + } + return false; + } + + public void ApplyLanguage() { + this.Text = _( "Edit Motion Curve" ); + menuClose.Text = _( "Close" ) + "(&C)"; + menuFile.Text = _( "File" ) + "(&F)"; + menuRedo.Text = _( "Redo" ); + menuUndo.Text = _( "Undo" ); + menuEdit.Text = _( "Edit" ) + "(&E)"; + + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + /// + /// 迴セ蝨ィ縺ョ邱ィ髮諠蝣ア繧堤エ譽縺励∪縺 + /// + public void Clear() { + curveEditor.Clear(); + comboObjects.Items.Clear(); + comboObjects.Text = ""; + } + + private void DisplacementControl_FormClosing( object sender, FormClosingEventArgs e ) { + e.Cancel = true; + } + + private void menuUndo_Click( object sender, EventArgs e ) { + curveEditor.Undo(); + } + + private void menuRedo_Click( object sender, EventArgs e ) { + curveEditor.Redo(); + } + + private void menuEdit_DropDownOpening( object sender, EventArgs e ) { + menuUndo.Enabled = curveEditor.IsUndoAvailable; + menuRedo.Enabled = curveEditor.IsRedoAvailable; + } + + private void comboObjects_SelectedIndexChanged( object sender, EventArgs e ) { + int index = comboObjects.SelectedIndex; +#if DEBUG + Console.WriteLine( "DisplacementControl+comboObjects_SelectedIndexChanged" ); + Console.WriteLine( " index=" + index ); +#endif + if ( m_first_scaleandoffset ) { + float scale, offset; + if ( curveEditor.GetYScaleAndYOffset( "X", out scale, out offset ) ) { + m_scaleandoffset_x = new PointF( scale, offset ); + } + if ( curveEditor.GetYScaleAndYOffset( "Y", out scale, out offset ) ) { + m_scaleandoffset_y = new PointF( scale, offset ); + } + if ( curveEditor.GetYScaleAndYOffset( "Alpha", out scale, out offset ) ) { + m_scaleandoffset_alpha = new PointF( scale, offset ); + +#if DEBUG + Console.WriteLine( "Alpha, scale=" + scale + "; offset=" + offset ); +#endif + } + if ( curveEditor.GetYScaleAndYOffset( "Scale", out scale, out offset ) ) { + m_scaleandoffset_scale = new PointF( scale, offset ); + } + if ( curveEditor.GetYScaleAndYOffset( "Rotate", out scale, out offset ) ) { + m_scaleandoffset_rotate = new PointF( scale, offset ); + } + } + curveEditor.Clear(); + curveEditor.ClearBuffer(); + if ( index >= 0 ) { + TagForTreeNode node = (TagForTreeNode)comboObjects.Items[index]; + int id = node.id_or_index; + switch ( node.type ) { + case ZorderItemType.another: + curveEditor.Add( "X", AppManager.SaveData.m_group_another[id].mc_x ); + curveEditor.Add( "Y", AppManager.SaveData.m_group_another[id].mc_y ); + curveEditor.Add( "Alpha", AppManager.SaveData.m_group_another[id].mc_alpha ); + curveEditor.Add( "Scale", AppManager.SaveData.m_group_another[id].mc_scale ); + curveEditor.Add( "Roate", AppManager.SaveData.m_group_another[id].mc_rotate ); + break; + case ZorderItemType.character: + curveEditor.Add( "X", AppManager.SaveData.m_groups_character[id].mc_x ); + curveEditor.Add( "Y", AppManager.SaveData.m_groups_character[id].mc_y ); + curveEditor.Add( "Alpha", AppManager.SaveData.m_groups_character[id].mc_alpha ); + curveEditor.Add( "Scale", AppManager.SaveData.m_groups_character[id].mc_scale ); + curveEditor.Add( "Roate", AppManager.SaveData.m_groups_character[id].mc_rotate ); + break; + case ZorderItemType.plugin: + curveEditor.Add( "X", AppManager.SaveData.m_group_plugin[id].mc_x ); + curveEditor.Add( "Y", AppManager.SaveData.m_group_plugin[id].mc_y ); + curveEditor.Add( "Alpha", AppManager.SaveData.m_group_plugin[id].mc_alpha ); + curveEditor.Add( "Scale", AppManager.SaveData.m_group_plugin[id].mc_scale ); + curveEditor.Add( "Roate", AppManager.SaveData.m_group_plugin[id].mc_rotate ); + break; + case ZorderItemType.telop: + curveEditor.Add( "X", AppManager.SaveData[id].mc_x ); + curveEditor.Add( "Y", AppManager.SaveData[id].mc_y ); + curveEditor.Add( "Alpha", AppManager.SaveData[id].mc_alpha ); + curveEditor.Add( "Scale", AppManager.SaveData[id].mc_scale ); + curveEditor.Add( "Roate", AppManager.SaveData[id].mc_rotate ); + break; + } + curveEditor.SetYScaleAndYOffset( "X", m_scaleandoffset_x.X, m_scaleandoffset_x.Y ); + curveEditor.SetYScaleAndYOffset( "Y", m_scaleandoffset_y.X, m_scaleandoffset_y.Y ); + curveEditor.SetYScaleAndYOffset( "Alpha", m_scaleandoffset_alpha.X, m_scaleandoffset_alpha.Y ); + curveEditor.SetYScaleAndYOffset( "Scale", m_scaleandoffset_scale.X, m_scaleandoffset_scale.Y ); + curveEditor.SetYScaleAndYOffset( "Rotate", m_scaleandoffset_rotate.X, m_scaleandoffset_rotate.Y ); + if ( m_first_scaleandoffset ) { + m_first_scaleandoffset = false; + } + curveEditor.Invalidate(); + } + } + + private void DisplacementControl_VisibleChanged( object sender, EventArgs e ) { + ApplyLanguage(); + } + + private void menuVisualNumericInput_CheckedChanged( object sender, EventArgs e ) { + this.Invalidate(); + } + + private void curveEditor_CurveEdited() { + AppManager.Edited = true; + } + + private void DisplacementControl_LocationOrSizeChanged( object sender, EventArgs e ) { + if ( AppManager.Config != null ) { + if ( this.WindowState == FormWindowState.Normal ) { + AppManager.Config.CurveWindowPos = this.Bounds; + } + AppManager.Config.CurveMaximized = (this.WindowState == FormWindowState.Maximized); + } + } + + private void menuClose_Click( object sender, EventArgs e ) { + this.Close(); + } + } + +} diff --git a/trunk/LipSync/Editor/DisplacementControl.designer.cs b/trunk/LipSync/Editor/DisplacementControl.designer.cs new file mode 100644 index 0000000..2bfc5d7 --- /dev/null +++ b/trunk/LipSync/Editor/DisplacementControl.designer.cs @@ -0,0 +1,194 @@ +/* + * DisplacementControl.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class DisplacementControl { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.menuClose = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuUndo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuRedo = new System.Windows.Forms.ToolStripMenuItem(); + this.comboObjects = new System.Windows.Forms.ComboBox(); + this.curveEditor = new CurveEditor.CurveEditor(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuFile, + this.menuEdit} ); + this.menuStrip1.Location = new System.Drawing.Point( 0, 0 ); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size( 557, 24 ); + this.menuStrip1.TabIndex = 7; + this.menuStrip1.Text = "menuStrip1"; + // + // menuFile + // + this.menuFile.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuClose} ); + this.menuFile.Name = "menuFile"; + this.menuFile.Size = new System.Drawing.Size( 66, 20 ); + this.menuFile.Text = "繝輔ぃ繧、繝ォ(&F)"; + // + // menuClose + // + this.menuClose.Name = "menuClose"; + this.menuClose.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.menuClose.Size = new System.Drawing.Size( 152, 22 ); + this.menuClose.Text = "髢峨§繧(&C)"; + this.menuClose.Click += new System.EventHandler( this.menuClose_Click ); + // + // menuEdit + // + this.menuEdit.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuUndo, + this.menuRedo} ); + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size( 56, 20 ); + this.menuEdit.Text = "邱ィ髮(&E)"; + this.menuEdit.DropDownOpening += new System.EventHandler( this.menuEdit_DropDownOpening ); + // + // menuUndo + // + this.menuUndo.Name = "menuUndo"; + this.menuUndo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.menuUndo.Size = new System.Drawing.Size( 192, 22 ); + this.menuUndo.Text = "蜈縺ォ謌サ縺(&U)"; + this.menuUndo.Click += new System.EventHandler( this.menuUndo_Click ); + // + // menuRedo + // + this.menuRedo.Name = "menuRedo"; + this.menuRedo.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.Z))); + this.menuRedo.Size = new System.Drawing.Size( 192, 22 ); + this.menuRedo.Text = "繧繧顔峩縺(&R)"; + this.menuRedo.Click += new System.EventHandler( this.menuRedo_Click ); + // + // comboObjects + // + this.comboObjects.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboObjects.FormattingEnabled = true; + this.comboObjects.Location = new System.Drawing.Point( 0, 24 ); + this.comboObjects.Margin = new System.Windows.Forms.Padding( 0, 0, 0, 1 ); + this.comboObjects.Name = "comboObjects"; + this.comboObjects.Size = new System.Drawing.Size( 557, 20 ); + this.comboObjects.TabIndex = 8; + this.comboObjects.SelectedIndexChanged += new System.EventHandler( this.comboObjects_SelectedIndexChanged ); + // + // curveEditor1 + // + this.curveEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.curveEditor.BackColor = System.Drawing.SystemColors.AppWorkspace; + this.curveEditor.ChangeXScaleWithWheel = true; + this.curveEditor.ChangeYScaleWithWheel = true; + this.curveEditor.ControlMaster = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(130)))), ((int)(((byte)(0)))) ); + this.curveEditor.ControlNormal = System.Drawing.Color.FromArgb( ((int)(((byte)(51)))), ((int)(((byte)(192)))), ((int)(((byte)(64)))) ); + this.curveEditor.ControlPointSize = 2; + this.curveEditor.ControlPointType = CurveEditor.PointType.Circle; + this.curveEditor.DataPoint = System.Drawing.Color.Black; + this.curveEditor.DataPointHilight = System.Drawing.Color.Red; + this.curveEditor.DataPointSize = 2; + this.curveEditor.DataPointType = CurveEditor.PointType.Circle; + this.curveEditor.HandleMaster = System.Drawing.Color.FromArgb( ((int)(((byte)(240)))), ((int)(((byte)(144)))), ((int)(((byte)(160)))) ); + this.curveEditor.HandleNormal = System.Drawing.Color.FromArgb( ((int)(((byte)(255)))), ((int)(((byte)(130)))), ((int)(((byte)(0)))) ); + this.curveEditor.LabelBackground = System.Drawing.Color.FromArgb( ((int)(((byte)(172)))), ((int)(((byte)(172)))), ((int)(((byte)(172)))) ); + this.curveEditor.ListBackground = System.Drawing.Color.FromArgb( ((int)(((byte)(143)))), ((int)(((byte)(143)))), ((int)(((byte)(143)))) ); + this.curveEditor.Location = new System.Drawing.Point( 0, 45 ); + this.curveEditor.MainScaleLine = System.Drawing.Color.FromArgb( ((int)(((byte)(44)))), ((int)(((byte)(44)))), ((int)(((byte)(44)))) ); + this.curveEditor.Margin = new System.Windows.Forms.Padding( 0 ); + this.curveEditor.MaxXScale = 100F; + this.curveEditor.MaxYScale = 1000F; + this.curveEditor.MinimumSize = new System.Drawing.Size( 100, 100 ); + this.curveEditor.MinXScale = 1F; + this.curveEditor.MinYScale = 0.2F; + this.curveEditor.Name = "curveEditor1"; + this.curveEditor.RescaleYEnabled = true; + this.curveEditor.ScaleLine = System.Drawing.Color.FromArgb( ((int)(((byte)(94)))), ((int)(((byte)(94)))), ((int)(((byte)(94)))) ); + this.curveEditor.ScrollEnabled = true; + this.curveEditor.ShowList = true; + this.curveEditor.Size = new System.Drawing.Size( 557, 340 ); + this.curveEditor.SubScaleLine = System.Drawing.Color.FromArgb( ((int)(((byte)(110)))), ((int)(((byte)(110)))), ((int)(((byte)(110)))) ); + this.curveEditor.TabIndex = 6; + this.curveEditor.XLabel = CurveEditor.XLabel.Bottom; + this.curveEditor.XOffset = 0F; + this.curveEditor.XScale = 1F; + this.curveEditor.YLabel = CurveEditor.YLabel.Left; + this.curveEditor.YOffset = 0F; + this.curveEditor.YScale = 0.2F; + this.curveEditor.CurveEdited += new CurveEditor.CurveEditor.CurveEditedEventHandler( this.curveEditor_CurveEdited ); + // + // DisplacementControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size( 557, 385 ); + this.Controls.Add( this.comboObjects ); + this.Controls.Add( this.curveEditor ); + this.Controls.Add( this.menuStrip1 ); + this.MainMenuStrip = this.menuStrip1; + this.Name = "DisplacementControl"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "螟我ス阪ョ蛻カ蠕。"; + this.VisibleChanged += new System.EventHandler( this.DisplacementControl_VisibleChanged ); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.DisplacementControl_FormClosing ); + this.menuStrip1.ResumeLayout( false ); + this.menuStrip1.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private CurveEditor.CurveEditor curveEditor; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem menuFile; + private System.Windows.Forms.ToolStripMenuItem menuEdit; + public System.Windows.Forms.ToolStripMenuItem menuUndo; + public System.Windows.Forms.ToolStripMenuItem menuRedo; + public System.Windows.Forms.ComboBox comboObjects; + private System.Windows.Forms.ToolStripMenuItem menuClose; + } +} diff --git a/trunk/LipSync/Editor/EditEntry.Designer.cs b/trunk/LipSync/Editor/EditEntry.Designer.cs new file mode 100644 index 0000000..adb2a34 --- /dev/null +++ b/trunk/LipSync/Editor/EditEntry.Designer.cs @@ -0,0 +1,207 @@ +/* + * EditEntry.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class EditEntry { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.lblOnTime = new System.Windows.Forms.Label(); + this.lblOffTime = new System.Windows.Forms.Label(); + this.txtStart = new System.Windows.Forms.TextBox(); + this.txtEnd = new System.Windows.Forms.TextBox(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.txtMinStart = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtMaxEnd = new System.Windows.Forms.TextBox(); + this.btnUseThisValue = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // lblOnTime + // + this.lblOnTime.AutoSize = true; + this.lblOnTime.Location = new System.Drawing.Point( 12, 20 ); + this.lblOnTime.Name = "lblOnTime"; + this.lblOnTime.Size = new System.Drawing.Size( 69, 12 ); + this.lblOnTime.TabIndex = 0; + this.lblOnTime.Text = "ON譎ょ綾 (遘)"; + // + // lblOffTime + // + this.lblOffTime.AutoSize = true; + this.lblOffTime.Location = new System.Drawing.Point( 12, 53 ); + this.lblOffTime.Name = "lblOffTime"; + this.lblOffTime.Size = new System.Drawing.Size( 75, 12 ); + this.lblOffTime.TabIndex = 1; + this.lblOffTime.Text = "OFF譎ょ綾 (遘)"; + // + // txtStart + // + this.txtStart.Location = new System.Drawing.Point( 109, 17 ); + this.txtStart.Name = "txtStart"; + this.txtStart.Size = new System.Drawing.Size( 100, 19 ); + this.txtStart.TabIndex = 0; + this.txtStart.Text = "0"; + this.txtStart.TextChanged += new System.EventHandler( this.txtStart_TextChanged ); + this.txtStart.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler( this.txtStart_PreviewKeyDown ); + this.txtStart.KeyPress += new System.Windows.Forms.KeyPressEventHandler( this.txtStart_KeyPress ); + // + // txtEnd + // + this.txtEnd.Location = new System.Drawing.Point( 109, 50 ); + this.txtEnd.Name = "txtEnd"; + this.txtEnd.Size = new System.Drawing.Size( 100, 19 ); + this.txtEnd.TabIndex = 1; + this.txtEnd.Text = "0"; + this.txtEnd.TextChanged += new System.EventHandler( this.txtEnd_TextChanged ); + this.txtEnd.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler( this.txtEnd_PreviewKeyDown ); + this.txtEnd.KeyPress += new System.Windows.Forms.KeyPressEventHandler( this.txtEnd_KeyPress ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 229, 171 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 7; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 131, 171 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 6; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // txtMinStart + // + this.txtMinStart.Location = new System.Drawing.Point( 18, 26 ); + this.txtMinStart.Name = "txtMinStart"; + this.txtMinStart.ReadOnly = true; + this.txtMinStart.Size = new System.Drawing.Size( 63, 19 ); + this.txtMinStart.TabIndex = 3; + this.txtMinStart.Text = "0"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point( 87, 29 ); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size( 17, 12 ); + this.label3.TabIndex = 9; + this.label3.Text = "ス"; + // + // txtMaxEnd + // + this.txtMaxEnd.Location = new System.Drawing.Point( 110, 26 ); + this.txtMaxEnd.Name = "txtMaxEnd"; + this.txtMaxEnd.ReadOnly = true; + this.txtMaxEnd.Size = new System.Drawing.Size( 63, 19 ); + this.txtMaxEnd.TabIndex = 4; + this.txtMaxEnd.Text = "0"; + // + // btnUseThisValue + // + this.btnUseThisValue.Location = new System.Drawing.Point( 188, 24 ); + this.btnUseThisValue.Name = "btnUseThisValue"; + this.btnUseThisValue.Size = new System.Drawing.Size( 89, 23 ); + this.btnUseThisValue.TabIndex = 5; + this.btnUseThisValue.Text = "縺薙ョ蛟、繧剃スソ縺"; + this.btnUseThisValue.UseVisualStyleBackColor = true; + this.btnUseThisValue.Click += new System.EventHandler( this.btnUseThisValue_Click ); + // + // groupBox1 + // + this.groupBox1.Controls.Add( this.btnUseThisValue ); + this.groupBox1.Controls.Add( this.txtMinStart ); + this.groupBox1.Controls.Add( this.txtMaxEnd ); + this.groupBox1.Controls.Add( this.label3 ); + this.groupBox1.Location = new System.Drawing.Point( 12, 84 ); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size( 293, 69 ); + this.groupBox1.TabIndex = 2; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "螟画峩蜿ッ閭ス縺ェ蛟、縺ョ遽蝗イ"; + // + // EditEntry + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 319, 211 ); + this.Controls.Add( this.groupBox1 ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.txtEnd ); + this.Controls.Add( this.txtStart ); + this.Controls.Add( this.lblOffTime ); + this.Controls.Add( this.lblOnTime ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EditEntry"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "謨ー蛟、蜈・蜉"; + this.groupBox1.ResumeLayout( false ); + this.groupBox1.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblOnTime; + private System.Windows.Forms.Label lblOffTime; + private System.Windows.Forms.TextBox txtStart; + private System.Windows.Forms.TextBox txtEnd; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.TextBox txtMinStart; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtMaxEnd; + private System.Windows.Forms.Button btnUseThisValue; + private System.Windows.Forms.GroupBox groupBox1; + } +} diff --git a/trunk/LipSync/Editor/EditEntry.cs b/trunk/LipSync/Editor/EditEntry.cs new file mode 100644 index 0000000..76f4f46 --- /dev/null +++ b/trunk/LipSync/Editor/EditEntry.cs @@ -0,0 +1,178 @@ +サソ/* + * EditEntry.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class EditEntry : Form, IMultiLanguageControl { + private float m_start; + private float m_end; + private float m_min_start; + private float m_max_end; + /// + /// On time縺後ユ繧ュ繧ケ繝医懊ャ繧ッ繧ケ縺ォ繧医▲縺ヲ邱ィ髮縺輔l縺溘°縺ゥ縺縺 + /// + private bool m_start_edited = false; + /// + /// Off time縺後ユ繧ュ繧ケ繝医懊ャ繧ッ繧ケ縺ォ繧医▲縺ヲ邱ィ髮縺輔l縺溘°縺ゥ縺縺 + /// + private bool m_end_edited = false; + + public EditEntry( float start, float end, float min_start, float max_end ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + txtStart.Text = start.ToString(); + txtEnd.Text = end.ToString(); + txtMinStart.Text = min_start.ToString(); + txtMaxEnd.Text = max_end.ToString(); + m_min_start = min_start; + m_max_end = max_end; + m_start_edited = false; + m_end_edited = false; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.lblOnTime.Text = _( "ON time (sec)" ); + this.lblOffTime.Text = _( "OFF time (sec)" ); + this.btnCancel.Text = _( "Cancel" ); + this.btnOK.Text = _( "OK" ); + this.btnUseThisValue.Text = _( "Use this value" ); + this.groupBox1.Text = _( "Expandable range of this entry" ); + this.Text = _( "Numeric entry" ); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public float Start { + get { + return m_start; + } + } + + public float End { + get { + return m_end; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + /*if ( !m_start_edited ) { + m_start = m_start; + } + if ( !m_end_edited ) { + m_end = m_end; + }*/ + if ( m_start >= m_end || m_start < m_min_start || m_max_end < m_end ) { + MessageBox.Show( _( "Invalid value has been entered" ), _( "Error" ), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + this.DialogResult = DialogResult.Cancel; + } else { + this.DialogResult = (!m_end_edited && !m_start_edited) ? DialogResult.Cancel : DialogResult.OK; + } + this.Close(); + } + + private void btnUseThisValue_Click( object sender, EventArgs e ) { + if ( m_start != m_min_start || m_end != m_max_end ) { + txtStart.Text = m_min_start.ToString(); + txtEnd.Text = m_max_end.ToString(); + m_start = m_min_start; + m_end = m_max_end; + m_end_edited = true; + m_start_edited = true; + } + } + + private void txtStart_TextChanged( object sender, EventArgs e ) { + float old_begin = m_start; + m_start_edited = true; + try { + m_start = float.Parse( txtStart.Text ); + } catch ( Exception ex ) { + m_start = old_begin; + txtStart.Text = m_start.ToString(); + txtStart.SelectAll(); + Common.LogPush( ex ); + } + } + + private void txtEnd_TextChanged( object sender, EventArgs e ) { + float old_end = m_end; + m_end_edited = true; + try { + m_end = float.Parse( txtEnd.Text ); + } catch ( Exception ex ) { + m_end = old_end; + txtEnd.Text = m_end.ToString(); + txtEnd.SelectAll(); + } + } + + private void txtStart_KeyPress( object sender, KeyPressEventArgs e ) { + if ( (e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b' && e.KeyChar != '.' ) { + e.Handled = true; + } + } + + private void txtEnd_KeyPress( object sender, KeyPressEventArgs e ) { + if ( (e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b' && e.KeyChar != '.' ) { + e.Handled = true; + } + } + + private void txtStart_PreviewKeyDown( object sender, PreviewKeyDownEventArgs e ) { + if ( (e.Modifiers & Keys.Control) == Keys.Control ) { + if ( (e.KeyCode & Keys.X) == Keys.X ) { + Clipboard.SetText( txtStart.Text ); + txtStart.Text = ""; + } else if ( (e.KeyCode & Keys.C) == Keys.C ) { + Clipboard.SetText( txtStart.Text ); + } else if ( (e.KeyCode & Keys.V) == Keys.V ) { + if ( Clipboard.ContainsText() ) { + txtStart.Text = Clipboard.GetText(); + } + } + } + } + + private void txtEnd_PreviewKeyDown( object sender, PreviewKeyDownEventArgs e ) { + if ( (e.Modifiers & Keys.Control) == Keys.Control ) { + if ( (e.KeyCode & Keys.X) == Keys.X ) { + Clipboard.SetText( txtEnd.Text ); + txtEnd.Text = ""; + } else if ( (e.KeyCode & Keys.C) == Keys.C ) { + Clipboard.SetText( txtEnd.Text ); + } else if ( (e.KeyCode & Keys.V) == Keys.V ) { + if ( Clipboard.ContainsText() ) { + txtEnd.Text = Clipboard.GetText(); + } + } + } + } + } + +} diff --git a/trunk/LipSync/Editor/EditMode.cs b/trunk/LipSync/Editor/EditMode.cs new file mode 100644 index 0000000..6d6f036 --- /dev/null +++ b/trunk/LipSync/Editor/EditMode.cs @@ -0,0 +1,43 @@ +サソ/* + * EditMode.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + enum EditMode { + /// + /// 繝繝輔か繝ォ繝医ゆス輔b邱ィ髮縺励※辟。縺 + /// + None, + /// + /// 繧ィ繝ウ繝医Μ縺碁∈謚槭&繧後※繧九□縺代ョ迥カ諷 + /// + Selected, + /// + /// 繧ィ繝ウ繝医Μ縺ョ蜿ウ遶ッ繧偵ラ繝ゥ繝繧ー縺励※邨ゆコ譎ょ綾繧堤キィ髮縺吶k繝「繝シ繝 + /// + EditingRight, + /// + /// 繧ィ繝ウ繝医Μ縺ョ蟾ヲ遶ッ繧偵ラ繝ゥ繝繧ー縺励※髢句ァ区凾蛻サ繧堤キィ髮縺吶k繝「繝シ繝 + /// + EditingLeft, + /// + /// 繧ソ繧、繝繝ゥ繧、繝ウ荳翫ョ蟾ヲ繝懊ち繝ウ繝峨Λ繝繧ー縺ォ繧医j繧ィ繝ウ繝医Μ繧定ソス蜉縺吶k繝「繝シ繝 + /// + Dragging, + /// + /// 繧ィ繝ウ繝医Μ繧偵ラ繝ゥ繝繧ー縺励※繧ケ繝ゥ繧、繝峨&縺帙k繝「繝シ繝 + /// + Sliding, + } + +} diff --git a/trunk/LipSync/Editor/EditingBounds.cs b/trunk/LipSync/Editor/EditingBounds.cs new file mode 100644 index 0000000..5a6e95c --- /dev/null +++ b/trunk/LipSync/Editor/EditingBounds.cs @@ -0,0 +1,76 @@ +サソ/* + * EditingBounds.cs + * Copyright (c) 2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + public class EditingBounds { + private Rectangle m_rect; + private bool m_fixed; + public bool XFixed; + public bool YFixed; + + public EditingBounds() { + m_rect = new Rectangle(); + m_fixed = false; + XFixed = false; + YFixed = false; + } + + public EditingBounds( Rectangle bounds, bool item_fixed, bool x_fixed, bool y_fixed ) { + m_rect = bounds; + m_fixed = item_fixed; + XFixed = x_fixed; + YFixed = y_fixed; + } + + public int X { + get { + return m_rect.X; + } + } + + public int Y { + get { + return m_rect.Y; + } + } + + public int Width { + get { + return m_rect.Width; + } + } + + public int Height { + get { + return m_rect.Height; + } + } + + public bool Fixed { + get { + return m_fixed; + } + } + + public Rectangle Bounds { + get { + return m_rect; + } + } + } + +} diff --git a/trunk/LipSync/Editor/EnvConfiguration.Designer.cs b/trunk/LipSync/Editor/EnvConfiguration.Designer.cs new file mode 100644 index 0000000..5e63cb2 --- /dev/null +++ b/trunk/LipSync/Editor/EnvConfiguration.Designer.cs @@ -0,0 +1,871 @@ +サソ/* + * EnvConfiguration.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class EnvConfiguration { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.comboLanguage = new System.Windows.Forms.ComboBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabUserConfig = new System.Windows.Forms.TabPage(); + this.groupControl = new System.Windows.Forms.GroupBox(); + this.chkSyncAtCenter = new System.Windows.Forms.CheckBox(); + this.lblWheelRatio = new System.Windows.Forms.Label(); + this.btnWheelRatioDefault = new System.Windows.Forms.Button(); + this.groupLanguage = new System.Windows.Forms.GroupBox(); + this.btnReloadLanguageConfig = new System.Windows.Forms.Button(); + this.tabAppearance = new System.Windows.Forms.TabPage(); + this.groupDesign = new System.Windows.Forms.GroupBox(); + this.btnFontDefault = new System.Windows.Forms.Button(); + this.lblFontName = new System.Windows.Forms.Label(); + this.lblFont = new System.Windows.Forms.Label(); + this.btnChangeFont = new System.Windows.Forms.Button(); + this.lblEntryHeight = new System.Windows.Forms.Label(); + this.btnEntryHeightDefault = new System.Windows.Forms.Button(); + this.groupColor = new System.Windows.Forms.GroupBox(); + this.lblTimeLineTitle = new System.Windows.Forms.Label(); + this.lblTimelineTitleColor = new System.Windows.Forms.Label(); + this.btnChangeTimeLineTitle = new System.Windows.Forms.Button(); + this.btnTimeLineTitleDefault = new System.Windows.Forms.Button(); + this.lblTimeLineVSQ = new System.Windows.Forms.Label(); + this.btnTimeLineDefaultDefault = new System.Windows.Forms.Button(); + this.lblTimeLineVSQColor = new System.Windows.Forms.Label(); + this.btnChangeTimeLineDefault = new System.Windows.Forms.Button(); + this.btnChangeTimeLineVSQ = new System.Windows.Forms.Button(); + this.lblTimeLineDefaultColor = new System.Windows.Forms.Label(); + this.btnTimeLineVSQDefault = new System.Windows.Forms.Button(); + this.lblTimeLineDefault = new System.Windows.Forms.Label(); + this.lblTimeLinePlugin = new System.Windows.Forms.Label(); + this.btnTimeLinePluginDefault = new System.Windows.Forms.Button(); + this.lblTimeLinePluginColor = new System.Windows.Forms.Label(); + this.btnChangeTimeLinePlugin = new System.Windows.Forms.Button(); + this.tabLipSync = new System.Windows.Forms.TabPage(); + this.groupSerialVowel = new System.Windows.Forms.GroupBox(); + this.txtCombineThreshold = new System.Windows.Forms.TextBox(); + this.lblCombineThreshold = new System.Windows.Forms.Label(); + this.chkSerialVowel = new System.Windows.Forms.CheckBox(); + this.groupPhoneticSymbol = new System.Windows.Forms.GroupBox(); + this.tabSystem = new System.Windows.Forms.TabPage(); + this.groupAnotherBehavior = new System.Windows.Forms.GroupBox(); + this.chkHeavyOpenCharacterDialog = new System.Windows.Forms.CheckBox(); + this.chkGenCharacterAutomaticaly = new System.Windows.Forms.CheckBox(); + this.groupEncoder = new System.Windows.Forms.GroupBox(); + this.txtFFmpeg = new System.Windows.Forms.TextBox(); + this.lblFFmpeg = new System.Windows.Forms.Label(); + this.btnMEncoder = new System.Windows.Forms.Button(); + this.txtMEncoder = new System.Windows.Forms.TextBox(); + this.btnFFmpeg = new System.Windows.Forms.Button(); + this.lblMEncoder = new System.Windows.Forms.Label(); + this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.fontDialog = new System.Windows.Forms.FontDialog(); + this.numWheelRatio = new LipSync.NumericUpDownEx(); + this.numEntryHeight = new LipSync.NumericUpDownEx(); + this.mListClose = new LipSync.MListView(); + this.mListU = new LipSync.MListView(); + this.mListI = new LipSync.MListView(); + this.tabControl1.SuspendLayout(); + this.tabUserConfig.SuspendLayout(); + this.groupControl.SuspendLayout(); + this.groupLanguage.SuspendLayout(); + this.tabAppearance.SuspendLayout(); + this.groupDesign.SuspendLayout(); + this.groupColor.SuspendLayout(); + this.tabLipSync.SuspendLayout(); + this.groupSerialVowel.SuspendLayout(); + this.groupPhoneticSymbol.SuspendLayout(); + this.tabSystem.SuspendLayout(); + this.groupAnotherBehavior.SuspendLayout(); + this.groupEncoder.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numWheelRatio)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numEntryHeight)).BeginInit(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 182, 421 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 71, 24 ); + this.btnOK.TabIndex = 13; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 285, 421 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 71, 24 ); + this.btnCancel.TabIndex = 14; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // comboLanguage + // + this.comboLanguage.FormattingEnabled = true; + this.comboLanguage.Location = new System.Drawing.Point( 15, 28 ); + this.comboLanguage.Name = "comboLanguage"; + this.comboLanguage.Size = new System.Drawing.Size( 121, 20 ); + this.comboLanguage.TabIndex = 1; + this.comboLanguage.SelectedIndexChanged += new System.EventHandler( this.comboLanguage_SelectedIndexChanged ); + // + // tabControl1 + // + this.tabControl1.Controls.Add( this.tabUserConfig ); + this.tabControl1.Controls.Add( this.tabAppearance ); + this.tabControl1.Controls.Add( this.tabLipSync ); + this.tabControl1.Controls.Add( this.tabSystem ); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top; + this.tabControl1.Location = new System.Drawing.Point( 0, 0 ); + this.tabControl1.Margin = new System.Windows.Forms.Padding( 0 ); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size( 409, 402 ); + this.tabControl1.TabIndex = 0; + // + // tabUserConfig + // + this.tabUserConfig.BackColor = System.Drawing.SystemColors.Control; + this.tabUserConfig.Controls.Add( this.groupControl ); + this.tabUserConfig.Controls.Add( this.groupLanguage ); + this.tabUserConfig.Location = new System.Drawing.Point( 4, 21 ); + this.tabUserConfig.Name = "tabUserConfig"; + this.tabUserConfig.Padding = new System.Windows.Forms.Padding( 3 ); + this.tabUserConfig.Size = new System.Drawing.Size( 401, 377 ); + this.tabUserConfig.TabIndex = 0; + this.tabUserConfig.Text = "繝ヲ繝シ繧カ繝シ險ュ螳"; + this.tabUserConfig.UseVisualStyleBackColor = true; + // + // groupControl + // + this.groupControl.Controls.Add( this.chkSyncAtCenter ); + this.groupControl.Controls.Add( this.lblWheelRatio ); + this.groupControl.Controls.Add( this.btnWheelRatioDefault ); + this.groupControl.Controls.Add( this.numWheelRatio ); + this.groupControl.Location = new System.Drawing.Point( 10, 79 ); + this.groupControl.Name = "groupControl"; + this.groupControl.Size = new System.Drawing.Size( 381, 100 ); + this.groupControl.TabIndex = 30; + this.groupControl.TabStop = false; + this.groupControl.Text = "謫堺ス"; + // + // chkSyncAtCenter + // + this.chkSyncAtCenter.AutoSize = true; + this.chkSyncAtCenter.Location = new System.Drawing.Point( 24, 56 ); + this.chkSyncAtCenter.Name = "chkSyncAtCenter"; + this.chkSyncAtCenter.Size = new System.Drawing.Size( 199, 16 ); + this.chkSyncAtCenter.TabIndex = 16; + this.chkSyncAtCenter.Text = "Fix cursor to center in Sync mode"; + this.chkSyncAtCenter.UseVisualStyleBackColor = true; + this.chkSyncAtCenter.CheckedChanged += new System.EventHandler( this.chkSyncAtCenter_CheckedChanged ); + // + // lblWheelRatio + // + this.lblWheelRatio.AutoSize = true; + this.lblWheelRatio.Location = new System.Drawing.Point( 22, 24 ); + this.lblWheelRatio.Name = "lblWheelRatio"; + this.lblWheelRatio.Size = new System.Drawing.Size( 95, 12 ); + this.lblWheelRatio.TabIndex = 15; + this.lblWheelRatio.Text = "繝槭え繧ケ繝帙う繝シ繝ォ騾溷コヲ"; + // + // btnWheelRatioDefault + // + this.btnWheelRatioDefault.Location = new System.Drawing.Point( 313, 19 ); + this.btnWheelRatioDefault.Name = "btnWheelRatioDefault"; + this.btnWheelRatioDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnWheelRatioDefault.TabIndex = 4; + this.btnWheelRatioDefault.Text = "Default"; + this.btnWheelRatioDefault.UseVisualStyleBackColor = true; + this.btnWheelRatioDefault.Click += new System.EventHandler( this.btnWheelRatioDefault_Click ); + // + // groupLanguage + // + this.groupLanguage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupLanguage.AutoSize = true; + this.groupLanguage.Controls.Add( this.btnReloadLanguageConfig ); + this.groupLanguage.Controls.Add( this.comboLanguage ); + this.groupLanguage.Location = new System.Drawing.Point( 10, 6 ); + this.groupLanguage.Name = "groupLanguage"; + this.groupLanguage.Size = new System.Drawing.Size( 381, 67 ); + this.groupLanguage.TabIndex = 29; + this.groupLanguage.TabStop = false; + this.groupLanguage.Text = "險隱"; + // + // btnReloadLanguageConfig + // + this.btnReloadLanguageConfig.Location = new System.Drawing.Point( 207, 26 ); + this.btnReloadLanguageConfig.Name = "btnReloadLanguageConfig"; + this.btnReloadLanguageConfig.Size = new System.Drawing.Size( 163, 23 ); + this.btnReloadLanguageConfig.TabIndex = 2; + this.btnReloadLanguageConfig.Text = "險隱櫁ィュ螳壹ヵ繧。繧、繝ォ繧偵Μ繝ュ繝シ繝"; + this.btnReloadLanguageConfig.UseVisualStyleBackColor = true; + this.btnReloadLanguageConfig.Click += new System.EventHandler( this.btnReloadLanguageConfig_Click ); + // + // tabAppearance + // + this.tabAppearance.Controls.Add( this.groupDesign ); + this.tabAppearance.Controls.Add( this.groupColor ); + this.tabAppearance.Location = new System.Drawing.Point( 4, 21 ); + this.tabAppearance.Name = "tabAppearance"; + this.tabAppearance.Padding = new System.Windows.Forms.Padding( 3 ); + this.tabAppearance.Size = new System.Drawing.Size( 401, 377 ); + this.tabAppearance.TabIndex = 3; + this.tabAppearance.Text = "螟冶ヲウ"; + this.tabAppearance.UseVisualStyleBackColor = true; + // + // groupDesign + // + this.groupDesign.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupDesign.AutoSize = true; + this.groupDesign.Controls.Add( this.numEntryHeight ); + this.groupDesign.Controls.Add( this.btnFontDefault ); + this.groupDesign.Controls.Add( this.lblFontName ); + this.groupDesign.Controls.Add( this.lblFont ); + this.groupDesign.Controls.Add( this.btnChangeFont ); + this.groupDesign.Controls.Add( this.lblEntryHeight ); + this.groupDesign.Controls.Add( this.btnEntryHeightDefault ); + this.groupDesign.Location = new System.Drawing.Point( 8, 171 ); + this.groupDesign.Name = "groupDesign"; + this.groupDesign.Size = new System.Drawing.Size( 381, 100 ); + this.groupDesign.TabIndex = 32; + this.groupDesign.TabStop = false; + this.groupDesign.Text = "陦ィ遉コ"; + // + // btnFontDefault + // + this.btnFontDefault.Location = new System.Drawing.Point( 312, 59 ); + this.btnFontDefault.Name = "btnFontDefault"; + this.btnFontDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnFontDefault.TabIndex = 12; + this.btnFontDefault.Text = "Default"; + this.btnFontDefault.UseVisualStyleBackColor = true; + this.btnFontDefault.Click += new System.EventHandler( this.btnFontDefault_Click ); + // + // lblFontName + // + this.lblFontName.AutoSize = true; + this.lblFontName.Location = new System.Drawing.Point( 61, 64 ); + this.lblFontName.Name = "lblFontName"; + this.lblFontName.Size = new System.Drawing.Size( 0, 12 ); + this.lblFontName.TabIndex = 31; + // + // lblFont + // + this.lblFont.AutoSize = true; + this.lblFont.Location = new System.Drawing.Point( 16, 64 ); + this.lblFont.Name = "lblFont"; + this.lblFont.Size = new System.Drawing.Size( 38, 12 ); + this.lblFont.TabIndex = 30; + this.lblFont.Text = "繝輔か繝ウ繝"; + // + // btnChangeFont + // + this.btnChangeFont.Location = new System.Drawing.Point( 232, 59 ); + this.btnChangeFont.Name = "btnChangeFont"; + this.btnChangeFont.Size = new System.Drawing.Size( 75, 23 ); + this.btnChangeFont.TabIndex = 11; + this.btnChangeFont.Text = "螟画峩"; + this.btnChangeFont.UseVisualStyleBackColor = true; + this.btnChangeFont.Click += new System.EventHandler( this.btnChangeFont_Click ); + // + // lblEntryHeight + // + this.lblEntryHeight.AutoSize = true; + this.lblEntryHeight.Location = new System.Drawing.Point( 16, 27 ); + this.lblEntryHeight.Name = "lblEntryHeight"; + this.lblEntryHeight.Size = new System.Drawing.Size( 117, 12 ); + this.lblEntryHeight.TabIndex = 26; + this.lblEntryHeight.Text = "繧ィ繝ウ繝医Μ縺ョ鬮倥& (繝斐け繧サ繝ォ)"; + // + // btnEntryHeightDefault + // + this.btnEntryHeightDefault.Location = new System.Drawing.Point( 312, 22 ); + this.btnEntryHeightDefault.Name = "btnEntryHeightDefault"; + this.btnEntryHeightDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnEntryHeightDefault.TabIndex = 10; + this.btnEntryHeightDefault.Text = "Default"; + this.btnEntryHeightDefault.UseVisualStyleBackColor = true; + this.btnEntryHeightDefault.Click += new System.EventHandler( this.btnEntryHeightDefault_Click ); + // + // groupColor + // + this.groupColor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupColor.AutoSize = true; + this.groupColor.Controls.Add( this.lblTimeLineTitle ); + this.groupColor.Controls.Add( this.lblTimelineTitleColor ); + this.groupColor.Controls.Add( this.btnChangeTimeLineTitle ); + this.groupColor.Controls.Add( this.btnTimeLineTitleDefault ); + this.groupColor.Controls.Add( this.lblTimeLineVSQ ); + this.groupColor.Controls.Add( this.btnTimeLineDefaultDefault ); + this.groupColor.Controls.Add( this.lblTimeLineVSQColor ); + this.groupColor.Controls.Add( this.btnChangeTimeLineDefault ); + this.groupColor.Controls.Add( this.btnChangeTimeLineVSQ ); + this.groupColor.Controls.Add( this.lblTimeLineDefaultColor ); + this.groupColor.Controls.Add( this.btnTimeLineVSQDefault ); + this.groupColor.Controls.Add( this.lblTimeLineDefault ); + this.groupColor.Controls.Add( this.lblTimeLinePlugin ); + this.groupColor.Controls.Add( this.btnTimeLinePluginDefault ); + this.groupColor.Controls.Add( this.lblTimeLinePluginColor ); + this.groupColor.Controls.Add( this.btnChangeTimeLinePlugin ); + this.groupColor.Location = new System.Drawing.Point( 8, 6 ); + this.groupColor.Name = "groupColor"; + this.groupColor.Size = new System.Drawing.Size( 381, 159 ); + this.groupColor.TabIndex = 31; + this.groupColor.TabStop = false; + this.groupColor.Text = "驟崎牡"; + // + // lblTimeLineTitle + // + this.lblTimeLineTitle.AutoSize = true; + this.lblTimeLineTitle.Location = new System.Drawing.Point( 6, 24 ); + this.lblTimeLineTitle.Name = "lblTimeLineTitle"; + this.lblTimeLineTitle.Size = new System.Drawing.Size( 103, 12 ); + this.lblTimeLineTitle.TabIndex = 10; + this.lblTimeLineTitle.Text = "繧ソ繧、繝繝ゥ繧、繝ウ縺ョ繧ソ繧、繝医Ν"; + // + // lblTimelineTitleColor + // + this.lblTimelineTitleColor.BackColor = System.Drawing.Color.White; + this.lblTimelineTitleColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lblTimelineTitleColor.Location = new System.Drawing.Point( 116, 18 ); + this.lblTimelineTitleColor.Name = "lblTimelineTitleColor"; + this.lblTimelineTitleColor.Size = new System.Drawing.Size( 100, 23 ); + this.lblTimelineTitleColor.TabIndex = 11; + // + // btnChangeTimeLineTitle + // + this.btnChangeTimeLineTitle.Location = new System.Drawing.Point( 232, 19 ); + this.btnChangeTimeLineTitle.Name = "btnChangeTimeLineTitle"; + this.btnChangeTimeLineTitle.Size = new System.Drawing.Size( 75, 23 ); + this.btnChangeTimeLineTitle.TabIndex = 1; + this.btnChangeTimeLineTitle.Text = "螟画峩"; + this.btnChangeTimeLineTitle.UseVisualStyleBackColor = true; + this.btnChangeTimeLineTitle.Click += new System.EventHandler( this.btnChangeTimeLineTitle_Click ); + // + // btnTimeLineTitleDefault + // + this.btnTimeLineTitleDefault.Location = new System.Drawing.Point( 313, 19 ); + this.btnTimeLineTitleDefault.Name = "btnTimeLineTitleDefault"; + this.btnTimeLineTitleDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnTimeLineTitleDefault.TabIndex = 2; + this.btnTimeLineTitleDefault.Text = "Default"; + this.btnTimeLineTitleDefault.UseVisualStyleBackColor = true; + this.btnTimeLineTitleDefault.Click += new System.EventHandler( this.btnTimeLineTitleDefault_Click ); + // + // lblTimeLineVSQ + // + this.lblTimeLineVSQ.AutoSize = true; + this.lblTimeLineVSQ.Location = new System.Drawing.Point( 6, 57 ); + this.lblTimeLineVSQ.Name = "lblTimeLineVSQ"; + this.lblTimeLineVSQ.Size = new System.Drawing.Size( 61, 12 ); + this.lblTimeLineVSQ.TabIndex = 14; + this.lblTimeLineVSQ.Text = "VSQ繧ィ繝ウ繝医Μ"; + // + // btnTimeLineDefaultDefault + // + this.btnTimeLineDefaultDefault.Location = new System.Drawing.Point( 313, 118 ); + this.btnTimeLineDefaultDefault.Name = "btnTimeLineDefaultDefault"; + this.btnTimeLineDefaultDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnTimeLineDefaultDefault.TabIndex = 8; + this.btnTimeLineDefaultDefault.Text = "Default"; + this.btnTimeLineDefaultDefault.UseVisualStyleBackColor = true; + this.btnTimeLineDefaultDefault.Click += new System.EventHandler( this.btnTimeLineDefaultDefault_Click ); + // + // lblTimeLineVSQColor + // + this.lblTimeLineVSQColor.BackColor = System.Drawing.Color.White; + this.lblTimeLineVSQColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lblTimeLineVSQColor.Location = new System.Drawing.Point( 116, 51 ); + this.lblTimeLineVSQColor.Name = "lblTimeLineVSQColor"; + this.lblTimeLineVSQColor.Size = new System.Drawing.Size( 100, 23 ); + this.lblTimeLineVSQColor.TabIndex = 15; + // + // btnChangeTimeLineDefault + // + this.btnChangeTimeLineDefault.Location = new System.Drawing.Point( 232, 118 ); + this.btnChangeTimeLineDefault.Name = "btnChangeTimeLineDefault"; + this.btnChangeTimeLineDefault.Size = new System.Drawing.Size( 75, 23 ); + this.btnChangeTimeLineDefault.TabIndex = 7; + this.btnChangeTimeLineDefault.Text = "螟画峩"; + this.btnChangeTimeLineDefault.UseVisualStyleBackColor = true; + this.btnChangeTimeLineDefault.Click += new System.EventHandler( this.btnChangeTimeLineDefault_Click ); + // + // btnChangeTimeLineVSQ + // + this.btnChangeTimeLineVSQ.Location = new System.Drawing.Point( 232, 52 ); + this.btnChangeTimeLineVSQ.Name = "btnChangeTimeLineVSQ"; + this.btnChangeTimeLineVSQ.Size = new System.Drawing.Size( 75, 23 ); + this.btnChangeTimeLineVSQ.TabIndex = 3; + this.btnChangeTimeLineVSQ.Text = "螟画峩"; + this.btnChangeTimeLineVSQ.UseVisualStyleBackColor = true; + this.btnChangeTimeLineVSQ.Click += new System.EventHandler( this.btnChangeTimeLineVSQ_Click ); + // + // lblTimeLineDefaultColor + // + this.lblTimeLineDefaultColor.BackColor = System.Drawing.Color.White; + this.lblTimeLineDefaultColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lblTimeLineDefaultColor.Location = new System.Drawing.Point( 116, 117 ); + this.lblTimeLineDefaultColor.Name = "lblTimeLineDefaultColor"; + this.lblTimeLineDefaultColor.Size = new System.Drawing.Size( 100, 23 ); + this.lblTimeLineDefaultColor.TabIndex = 23; + // + // btnTimeLineVSQDefault + // + this.btnTimeLineVSQDefault.Location = new System.Drawing.Point( 313, 52 ); + this.btnTimeLineVSQDefault.Name = "btnTimeLineVSQDefault"; + this.btnTimeLineVSQDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnTimeLineVSQDefault.TabIndex = 4; + this.btnTimeLineVSQDefault.Text = "Default"; + this.btnTimeLineVSQDefault.UseVisualStyleBackColor = true; + this.btnTimeLineVSQDefault.Click += new System.EventHandler( this.btnTimeLineVSQDefault_Click ); + // + // lblTimeLineDefault + // + this.lblTimeLineDefault.AutoSize = true; + this.lblTimeLineDefault.Location = new System.Drawing.Point( 6, 123 ); + this.lblTimeLineDefault.Name = "lblTimeLineDefault"; + this.lblTimeLineDefault.Size = new System.Drawing.Size( 79, 12 ); + this.lblTimeLineDefault.TabIndex = 22; + this.lblTimeLineDefault.Text = "縺昴ョ莉悶ョ繧ィ繝ウ繝医Μ"; + // + // lblTimeLinePlugin + // + this.lblTimeLinePlugin.AutoSize = true; + this.lblTimeLinePlugin.Location = new System.Drawing.Point( 6, 90 ); + this.lblTimeLinePlugin.Name = "lblTimeLinePlugin"; + this.lblTimeLinePlugin.Size = new System.Drawing.Size( 82, 12 ); + this.lblTimeLinePlugin.TabIndex = 18; + this.lblTimeLinePlugin.Text = "繝励Λ繧ー繧、繝ウ繧ィ繝ウ繝医Μ"; + // + // btnTimeLinePluginDefault + // + this.btnTimeLinePluginDefault.Location = new System.Drawing.Point( 313, 85 ); + this.btnTimeLinePluginDefault.Name = "btnTimeLinePluginDefault"; + this.btnTimeLinePluginDefault.Size = new System.Drawing.Size( 57, 23 ); + this.btnTimeLinePluginDefault.TabIndex = 6; + this.btnTimeLinePluginDefault.Text = "Default"; + this.btnTimeLinePluginDefault.UseVisualStyleBackColor = true; + this.btnTimeLinePluginDefault.Click += new System.EventHandler( this.btnTimeLinePluginDefault_Click ); + // + // lblTimeLinePluginColor + // + this.lblTimeLinePluginColor.BackColor = System.Drawing.Color.White; + this.lblTimeLinePluginColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.lblTimeLinePluginColor.Location = new System.Drawing.Point( 116, 84 ); + this.lblTimeLinePluginColor.Name = "lblTimeLinePluginColor"; + this.lblTimeLinePluginColor.Size = new System.Drawing.Size( 100, 23 ); + this.lblTimeLinePluginColor.TabIndex = 19; + // + // btnChangeTimeLinePlugin + // + this.btnChangeTimeLinePlugin.Location = new System.Drawing.Point( 232, 85 ); + this.btnChangeTimeLinePlugin.Name = "btnChangeTimeLinePlugin"; + this.btnChangeTimeLinePlugin.Size = new System.Drawing.Size( 75, 23 ); + this.btnChangeTimeLinePlugin.TabIndex = 5; + this.btnChangeTimeLinePlugin.Text = "螟画峩"; + this.btnChangeTimeLinePlugin.UseVisualStyleBackColor = true; + this.btnChangeTimeLinePlugin.Click += new System.EventHandler( this.btnChangeTimeLinePlugin_Click ); + // + // tabLipSync + // + this.tabLipSync.BackColor = System.Drawing.SystemColors.Control; + this.tabLipSync.Controls.Add( this.groupSerialVowel ); + this.tabLipSync.Controls.Add( this.groupPhoneticSymbol ); + this.tabLipSync.Location = new System.Drawing.Point( 4, 21 ); + this.tabLipSync.Name = "tabLipSync"; + this.tabLipSync.Padding = new System.Windows.Forms.Padding( 3 ); + this.tabLipSync.Size = new System.Drawing.Size( 401, 377 ); + this.tabLipSync.TabIndex = 1; + this.tabLipSync.Text = "蜿」繝代け逕滓"; + this.tabLipSync.UseVisualStyleBackColor = true; + // + // groupSerialVowel + // + this.groupSerialVowel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupSerialVowel.Controls.Add( this.txtCombineThreshold ); + this.groupSerialVowel.Controls.Add( this.lblCombineThreshold ); + this.groupSerialVowel.Controls.Add( this.chkSerialVowel ); + this.groupSerialVowel.Location = new System.Drawing.Point( 8, 277 ); + this.groupSerialVowel.Name = "groupSerialVowel"; + this.groupSerialVowel.Size = new System.Drawing.Size( 385, 89 ); + this.groupSerialVowel.TabIndex = 5; + this.groupSerialVowel.TabStop = false; + this.groupSerialVowel.Text = "縺昴ョ莉悶ョ險ュ螳"; + // + // txtCombineThreshold + // + this.txtCombineThreshold.Location = new System.Drawing.Point( 222, 54 ); + this.txtCombineThreshold.Name = "txtCombineThreshold"; + this.txtCombineThreshold.Size = new System.Drawing.Size( 132, 19 ); + this.txtCombineThreshold.TabIndex = 5; + this.txtCombineThreshold.Text = "0"; + // + // lblCombineThreshold + // + this.lblCombineThreshold.AutoSize = true; + this.lblCombineThreshold.Location = new System.Drawing.Point( 17, 57 ); + this.lblCombineThreshold.Name = "lblCombineThreshold"; + this.lblCombineThreshold.Size = new System.Drawing.Size( 128, 12 ); + this.lblCombineThreshold.TabIndex = 1; + this.lblCombineThreshold.Text = "騾」邯夐浹縺ィ縺ソ縺ェ縺咏┌髻ウ譎る俣"; + // + // chkSerialVowel + // + this.chkSerialVowel.Location = new System.Drawing.Point( 19, 25 ); + this.chkSerialVowel.Name = "chkSerialVowel"; + this.chkSerialVowel.Size = new System.Drawing.Size( 360, 16 ); + this.chkSerialVowel.TabIndex = 4; + this.chkSerialVowel.Text = "蜷御ク豈埼浹縺碁」邯壹☆繧九→縺阪∝哨繧帝哩縺倥k"; + this.chkSerialVowel.UseVisualStyleBackColor = true; + // + // groupPhoneticSymbol + // + this.groupPhoneticSymbol.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupPhoneticSymbol.Controls.Add( this.mListClose ); + this.groupPhoneticSymbol.Controls.Add( this.mListU ); + this.groupPhoneticSymbol.Controls.Add( this.mListI ); + this.groupPhoneticSymbol.Location = new System.Drawing.Point( 8, 6 ); + this.groupPhoneticSymbol.Name = "groupPhoneticSymbol"; + this.groupPhoneticSymbol.Size = new System.Drawing.Size( 385, 265 ); + this.groupPhoneticSymbol.TabIndex = 4; + this.groupPhoneticSymbol.TabStop = false; + this.groupPhoneticSymbol.Text = "逋コ髻ウ縺ョ逶エ蜑阪↓蜿」縺ョ蠖「繧貞、牙喧縺輔○繧狗匱髻ウ險伜捷繧呈欠螳壹@縺セ縺"; + // + // tabSystem + // + this.tabSystem.BackColor = System.Drawing.SystemColors.Control; + this.tabSystem.Controls.Add( this.groupAnotherBehavior ); + this.tabSystem.Controls.Add( this.groupEncoder ); + this.tabSystem.Location = new System.Drawing.Point( 4, 21 ); + this.tabSystem.Name = "tabSystem"; + this.tabSystem.Padding = new System.Windows.Forms.Padding( 3 ); + this.tabSystem.Size = new System.Drawing.Size( 401, 377 ); + this.tabSystem.TabIndex = 2; + this.tabSystem.Text = "繧キ繧ケ繝繝"; + this.tabSystem.UseVisualStyleBackColor = true; + // + // groupAnotherBehavior + // + this.groupAnotherBehavior.Controls.Add( this.chkHeavyOpenCharacterDialog ); + this.groupAnotherBehavior.Controls.Add( this.chkGenCharacterAutomaticaly ); + this.groupAnotherBehavior.Location = new System.Drawing.Point( 6, 118 ); + this.groupAnotherBehavior.Name = "groupAnotherBehavior"; + this.groupAnotherBehavior.Size = new System.Drawing.Size( 389, 94 ); + this.groupAnotherBehavior.TabIndex = 19; + this.groupAnotherBehavior.TabStop = false; + this.groupAnotherBehavior.Text = "縺昴ョ莉悶ョ蜍穂ス懆ィュ螳"; + // + // chkHeavyOpenCharacterDialog + // + this.chkHeavyOpenCharacterDialog.Location = new System.Drawing.Point( 14, 56 ); + this.chkHeavyOpenCharacterDialog.Name = "chkHeavyOpenCharacterDialog"; + this.chkHeavyOpenCharacterDialog.Size = new System.Drawing.Size( 364, 16 ); + this.chkHeavyOpenCharacterDialog.TabIndex = 6; + this.chkHeavyOpenCharacterDialog.Text = "繝励Ξ繝薙Η繝シ蜿ッ閭ス縺ェ繧ュ繝」繝ゥ繧ッ繧ソ繝輔ぃ繧、繝ォ驕ク謚槭ム繧、繧「繝ュ繧ー繧剃スソ逕ィ"; + this.chkHeavyOpenCharacterDialog.UseVisualStyleBackColor = true; + this.chkHeavyOpenCharacterDialog.CheckedChanged += new System.EventHandler( this.chkHeavyOpenCharacterDialog_CheckedChanged ); + // + // chkGenCharacterAutomaticaly + // + this.chkGenCharacterAutomaticaly.Location = new System.Drawing.Point( 14, 27 ); + this.chkGenCharacterAutomaticaly.Name = "chkGenCharacterAutomaticaly"; + this.chkGenCharacterAutomaticaly.Size = new System.Drawing.Size( 364, 16 ); + this.chkGenCharacterAutomaticaly.TabIndex = 5; + this.chkGenCharacterAutomaticaly.Text = "VSQ隱ュ霎シ縺ソ譎ゅ↓繧ュ繝」繝ゥ繧ッ繧ソ繧定ェ蜍慕函謌舌☆繧"; + this.chkGenCharacterAutomaticaly.UseVisualStyleBackColor = true; + this.chkGenCharacterAutomaticaly.CheckedChanged += new System.EventHandler( this.chkGenCharacterAutomaticaly_CheckedChanged ); + // + // groupEncoder + // + this.groupEncoder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupEncoder.Controls.Add( this.txtFFmpeg ); + this.groupEncoder.Controls.Add( this.lblFFmpeg ); + this.groupEncoder.Controls.Add( this.btnMEncoder ); + this.groupEncoder.Controls.Add( this.txtMEncoder ); + this.groupEncoder.Controls.Add( this.btnFFmpeg ); + this.groupEncoder.Controls.Add( this.lblMEncoder ); + this.groupEncoder.Location = new System.Drawing.Point( 6, 6 ); + this.groupEncoder.Name = "groupEncoder"; + this.groupEncoder.Size = new System.Drawing.Size( 389, 106 ); + this.groupEncoder.TabIndex = 18; + this.groupEncoder.TabStop = false; + this.groupEncoder.Text = "繧ィ繝ウ繧ウ繝シ繝/繝繧ウ繝シ繝"; + // + // txtFFmpeg + // + this.txtFFmpeg.Location = new System.Drawing.Point( 100, 32 ); + this.txtFFmpeg.Name = "txtFFmpeg"; + this.txtFFmpeg.Size = new System.Drawing.Size( 248, 19 ); + this.txtFFmpeg.TabIndex = 1; + this.txtFFmpeg.TextChanged += new System.EventHandler( this.txtFFmpeg_TextChanged ); + // + // lblFFmpeg + // + this.lblFFmpeg.AutoSize = true; + this.lblFFmpeg.Location = new System.Drawing.Point( 6, 35 ); + this.lblFFmpeg.Name = "lblFFmpeg"; + this.lblFFmpeg.Size = new System.Drawing.Size( 74, 12 ); + this.lblFFmpeg.TabIndex = 0; + this.lblFFmpeg.Text = "ffmpeg縺ョ蝣エ謇"; + // + // btnMEncoder + // + this.btnMEncoder.Location = new System.Drawing.Point( 354, 68 ); + this.btnMEncoder.Name = "btnMEncoder"; + this.btnMEncoder.Size = new System.Drawing.Size( 24, 23 ); + this.btnMEncoder.TabIndex = 4; + this.btnMEncoder.Text = "..."; + this.btnMEncoder.UseVisualStyleBackColor = true; + this.btnMEncoder.Click += new System.EventHandler( this.btnMEncoder_Click ); + // + // txtMEncoder + // + this.txtMEncoder.Location = new System.Drawing.Point( 100, 70 ); + this.txtMEncoder.Name = "txtMEncoder"; + this.txtMEncoder.Size = new System.Drawing.Size( 248, 19 ); + this.txtMEncoder.TabIndex = 3; + this.txtMEncoder.TextChanged += new System.EventHandler( this.txtMEncoder_TextChanged ); + // + // btnFFmpeg + // + this.btnFFmpeg.Location = new System.Drawing.Point( 354, 30 ); + this.btnFFmpeg.Name = "btnFFmpeg"; + this.btnFFmpeg.Size = new System.Drawing.Size( 24, 23 ); + this.btnFFmpeg.TabIndex = 2; + this.btnFFmpeg.Text = "..."; + this.btnFFmpeg.UseVisualStyleBackColor = true; + this.btnFFmpeg.Click += new System.EventHandler( this.btnFFmpeg_Click ); + // + // lblMEncoder + // + this.lblMEncoder.AutoSize = true; + this.lblMEncoder.Location = new System.Drawing.Point( 6, 73 ); + this.lblMEncoder.Name = "lblMEncoder"; + this.lblMEncoder.Size = new System.Drawing.Size( 88, 12 ); + this.lblMEncoder.TabIndex = 15; + this.lblMEncoder.Text = "mencoder縺ョ蝣エ謇"; + // + // numWheelRatio + // + this.numWheelRatio.Location = new System.Drawing.Point( 168, 22 ); + this.numWheelRatio.Minimum = new decimal( new int[] { + 1, + 0, + 0, + 0} ); + this.numWheelRatio.Name = "numWheelRatio"; + this.numWheelRatio.Size = new System.Drawing.Size( 120, 19 ); + this.numWheelRatio.TabIndex = 3; + this.numWheelRatio.Value = new decimal( new int[] { + 50, + 0, + 0, + 0} ); + this.numWheelRatio.ValueChanged += new System.EventHandler( this.numWheelRatio_ValueChanged ); + // + // numEntryHeight + // + this.numEntryHeight.Location = new System.Drawing.Point( 149, 25 ); + this.numEntryHeight.Minimum = new decimal( new int[] { + 10, + 0, + 0, + 0} ); + this.numEntryHeight.Name = "numEntryHeight"; + this.numEntryHeight.Size = new System.Drawing.Size( 120, 19 ); + this.numEntryHeight.TabIndex = 9; + this.numEntryHeight.Value = new decimal( new int[] { + 10, + 0, + 0, + 0} ); + this.numEntryHeight.ValueChanged += new System.EventHandler( this.numEntryHeight_ValueChanged ); + // + // mListClose + // + this.mListClose.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mListClose.CheckBoxes = true; + this.mListClose.Header = "蜿」繧帝哩縺倥k"; + this.mListClose.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Left; + this.mListClose.Location = new System.Drawing.Point( 6, 18 ); + this.mListClose.Name = "mListClose"; + this.mListClose.Size = new System.Drawing.Size( 373, 68 ); + this.mListClose.TabIndex = 1; + // + // mListU + // + this.mListU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mListU.CheckBoxes = true; + this.mListU.Header = "\"縺\"縺ョ蜿」"; + this.mListU.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Left; + this.mListU.Location = new System.Drawing.Point( 6, 167 ); + this.mListU.Name = "mListU"; + this.mListU.Size = new System.Drawing.Size( 373, 87 ); + this.mListU.TabIndex = 3; + // + // mListI + // + this.mListI.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mListI.CheckBoxes = true; + this.mListI.Header = "\"縺Ы"縺ョ蜿」"; + this.mListI.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Left; + this.mListI.Location = new System.Drawing.Point( 6, 92 ); + this.mListI.Name = "mListI"; + this.mListI.Size = new System.Drawing.Size( 373, 69 ); + this.mListI.TabIndex = 2; + // + // EnvConfiguration + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 409, 461 ); + this.Controls.Add( this.tabControl1 ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnCancel ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EnvConfiguration"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "繧ェ繝励す繝ァ繝ウ"; + this.Load += new System.EventHandler( this.EnvConfiguration_Load ); + this.tabControl1.ResumeLayout( false ); + this.tabUserConfig.ResumeLayout( false ); + this.tabUserConfig.PerformLayout(); + this.groupControl.ResumeLayout( false ); + this.groupControl.PerformLayout(); + this.groupLanguage.ResumeLayout( false ); + this.tabAppearance.ResumeLayout( false ); + this.tabAppearance.PerformLayout(); + this.groupDesign.ResumeLayout( false ); + this.groupDesign.PerformLayout(); + this.groupColor.ResumeLayout( false ); + this.groupColor.PerformLayout(); + this.tabLipSync.ResumeLayout( false ); + this.groupSerialVowel.ResumeLayout( false ); + this.groupSerialVowel.PerformLayout(); + this.groupPhoneticSymbol.ResumeLayout( false ); + this.tabSystem.ResumeLayout( false ); + this.groupAnotherBehavior.ResumeLayout( false ); + this.groupEncoder.ResumeLayout( false ); + this.groupEncoder.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numWheelRatio)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numEntryHeight)).EndInit(); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ComboBox comboLanguage; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabUserConfig; + private System.Windows.Forms.TabPage tabLipSync; + private System.Windows.Forms.ColorDialog colorDialog1; + private MListView mListClose; + private MListView mListU; + private MListView mListI; + private System.Windows.Forms.GroupBox groupLanguage; + private System.Windows.Forms.TabPage tabSystem; + private System.Windows.Forms.TextBox txtFFmpeg; + private System.Windows.Forms.Label lblFFmpeg; + private System.Windows.Forms.Button btnFFmpeg; + private System.Windows.Forms.Button btnMEncoder; + private System.Windows.Forms.TextBox txtMEncoder; + private System.Windows.Forms.Label lblMEncoder; + private System.Windows.Forms.FontDialog fontDialog; + private System.Windows.Forms.GroupBox groupPhoneticSymbol; + private System.Windows.Forms.GroupBox groupSerialVowel; + private System.Windows.Forms.CheckBox chkSerialVowel; + private System.Windows.Forms.GroupBox groupEncoder; + private System.Windows.Forms.GroupBox groupAnotherBehavior; + private System.Windows.Forms.CheckBox chkGenCharacterAutomaticaly; + private System.Windows.Forms.TextBox txtCombineThreshold; + private System.Windows.Forms.Label lblCombineThreshold; + private System.Windows.Forms.CheckBox chkHeavyOpenCharacterDialog; + private System.Windows.Forms.Button btnReloadLanguageConfig; + private System.Windows.Forms.TabPage tabAppearance; + private System.Windows.Forms.GroupBox groupColor; + private System.Windows.Forms.Label lblTimeLineTitle; + private System.Windows.Forms.Label lblTimelineTitleColor; + private System.Windows.Forms.Button btnChangeTimeLineTitle; + private System.Windows.Forms.Button btnTimeLineTitleDefault; + private System.Windows.Forms.Label lblTimeLineVSQ; + private System.Windows.Forms.Button btnTimeLineDefaultDefault; + private System.Windows.Forms.Label lblTimeLineVSQColor; + private System.Windows.Forms.Button btnChangeTimeLineDefault; + private System.Windows.Forms.Button btnChangeTimeLineVSQ; + private System.Windows.Forms.Label lblTimeLineDefaultColor; + private System.Windows.Forms.Button btnTimeLineVSQDefault; + private System.Windows.Forms.Label lblTimeLineDefault; + private System.Windows.Forms.Label lblTimeLinePlugin; + private System.Windows.Forms.Button btnTimeLinePluginDefault; + private System.Windows.Forms.Label lblTimeLinePluginColor; + private System.Windows.Forms.Button btnChangeTimeLinePlugin; + private System.Windows.Forms.GroupBox groupDesign; + private NumericUpDownEx numEntryHeight; + private System.Windows.Forms.Button btnFontDefault; + private System.Windows.Forms.Label lblFontName; + private System.Windows.Forms.Label lblFont; + private System.Windows.Forms.Button btnChangeFont; + private System.Windows.Forms.Label lblEntryHeight; + private System.Windows.Forms.Button btnEntryHeightDefault; + private System.Windows.Forms.GroupBox groupControl; + private System.Windows.Forms.Button btnWheelRatioDefault; + private NumericUpDownEx numWheelRatio; + private System.Windows.Forms.Label lblWheelRatio; + private System.Windows.Forms.CheckBox chkSyncAtCenter; + } +} diff --git a/trunk/LipSync/Editor/EnvConfiguration.cs b/trunk/LipSync/Editor/EnvConfiguration.cs new file mode 100644 index 0000000..338bd5a --- /dev/null +++ b/trunk/LipSync/Editor/EnvConfiguration.cs @@ -0,0 +1,412 @@ +/* + * EnvConfiguration.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class EnvConfiguration : Form, IMultiLanguageControl { + const string _DEFAULT_LANGUAGE_STRING = "Default"; + EnvSettings m_config; + + public EnvConfiguration( EnvSettings config ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + + m_config = (EnvSettings)config.Clone(); + int selected = -1; + + string[] t_list = Messaging.GetRegisteredLanguage(); + comboLanguage.Items.Clear(); + comboLanguage.Items.Add( _DEFAULT_LANGUAGE_STRING ); + foreach ( string lang in t_list ) { + comboLanguage.Items.Add( lang ); + if ( lang == Messaging.Language ) { + selected = comboLanguage.Items.Count - 1; + } + } + if ( selected >= 0 ) { + comboLanguage.SelectedIndex = selected; + } else { + comboLanguage.SelectedIndex = 0; + } + + // nn + string[] list_nn = new string[] { "b", "p", "m", "b'", "p'", "m'" }; + mListClose.Items.Clear(); + for ( int i = 0; i < list_nn.Length; i++ ) { + string s = list_nn[i]; + mListClose.Items.Add( new ListViewItem( s ) ); + mListClose.Items[i].Checked = VowelType.IsRegisteredToNN( s ); + } + + // i + string[] list_i = new string[] { "k'", "g'", "S", "dZ", "tS", "J", "C" }; + mListI.Items.Clear(); + for ( int i = 0; i < list_i.Length; i++ ) { + string s = list_i[i]; + mListI.Items.Add( new ListViewItem( s ) ); + mListI.Items[i].Checked = VowelType.IsRegisteredToI( s ); + } + + // u + string[] list_u = new string[] { @"p\", @"p\'", "w", "ts", "dz" }; + for ( int i = 0; i < list_u.Length; i++ ) { + string s = list_u[i]; + mListU.Items.Add( new ListViewItem( s ) ); + mListU.Items[i].Checked = VowelType.IsRegisteredToU( s ); + } + //mListClose.BackColor = tabLipSync.BackColor; + //mListI.BackColor = tabLipSync.BackColor; + //mListU.BackColor = tabLipSync.BackColor; + + ScreenFont = m_config.Font.GetFont(); + numWheelRatio.Value = (decimal)(1.0 / m_config.WheelRatio); + + chkGenCharacterAutomaticaly.Checked = m_config.GenerateCharacterAutomatically; + chkHeavyOpenCharacterDialog.Checked = m_config.UseHeavyDialogInOpeningCharacterSettings; + chkSerialVowel.Checked = m_config.CloseMouthWhenSameVowelsRepeated; + + txtFFmpeg.Text = m_config.PathFFmpeg; + txtMEncoder.Text = m_config.PathMEncoder; + + chkSyncAtCenter.Checked = m_config.SyncAtCentre; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.btnOK.Text = _( "OK" ); + this.btnCancel.Text = _( "Cancel" ); + this.groupLanguage.Text = _( "Language" ); + this.Text = _( "Option" ); + + this.tabUserConfig.Text = _( "User Config" ); + this.tabAppearance.Text = _( "Appearance" ); + this.tabLipSync.Text = _( "lip-sync Option" ); + this.tabSystem.Text = _( "System" ); + + this.lblTimeLineTitle.Text = _( "Title of timeline" ); + this.lblTimeLineVSQ.Text = _( "VSQ Entry" ); + this.lblTimeLinePlugin.Text = _( "Plugin Entry" ); + this.lblTimeLineDefault.Text = _( "Another Entry" ); + this.lblEntryHeight.Text = _( "Entry height (pixel)" ); + this.btnChangeTimeLineTitle.Text = _( "Change" ); + this.btnChangeTimeLineVSQ.Text = _( "Change" ); + this.btnChangeTimeLinePlugin.Text = _( "Change" ); + this.btnChangeTimeLineDefault.Text = _( "Change" ); + this.groupPhoneticSymbol.Text = _( "Check phonetic symbol to configure detailed mouth shape control" ); + this.mListClose.Header = _( "Close mouth before pronunciation" ); + this.mListI.Header = _( "\"i\" shaped mouth before pronunciation" ); + this.mListU.Header = _( "\"u\" shaped mouth before pronunciation" ); + this.groupColor.Text = _( "Color" ); + this.groupDesign.Text = _( "Design" ); + this.lblFFmpeg.Text = _( "Path of ffmpeg" ); + this.lblMEncoder.Text = _( "Path of mencoder" ); + this.lblFont.Text = _( "Font" ); + this.btnChangeFont.Text = _( "Change" ); + this.groupSerialVowel.Text = _( "Another settings" ); + this.chkSerialVowel.Text = _( "Close mouth when same vowels repeated" ); + this.groupEncoder.Text = _( "Encoder/Decoder" ); + this.chkGenCharacterAutomaticaly.Text = _( "Generate character automaticaly when importing vsq" ); + this.lblCombineThreshold.Text = _( "Threshold silence length(sec)" ); + this.groupAnotherBehavior.Text = _( "Another settings" ); + this.chkHeavyOpenCharacterDialog.Text = _( "Use preview-enabled dialog in character selection" ); + this.btnReloadLanguageConfig.Text = _( "Reload language configurations" ); + this.groupControl.Text = _( "Operation" ); + this.lblWheelRatio.Text = _( "mouse wheel rate" ); + this.chkSyncAtCenter.Text = _( "Fix cursor to center in Sync mode" ); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + private Font ScreenFont { + get { + return m_config.Font.GetFont(); + } + set { + m_config.Font = new FontConfig( value ); + lblFontName.Text = m_config.Font.GetFont().FontFamily.Name + ", " + m_config.Font.GetFont().SizeInPoints + "pt, " + m_config.Font.GetFont().Style.ToString(); + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + m_config.CloseMouthPhoneticSymbols.Clear(); + foreach ( ListViewItem item in mListClose.Items ) { + if ( item.Checked ) { + m_config.CloseMouthPhoneticSymbols.Add( item.Text ); + } + } + + m_config.IMouthPhoneticSymbols.Clear(); + foreach ( ListViewItem item in mListI.Items ) { + if ( item.Checked ) { + m_config.IMouthPhoneticSymbols.Add( item.Text ); + } + } + + m_config.UMouthPhoneticSymbols.Clear(); + foreach ( ListViewItem item in mListU.Items ) { + if ( item.Checked ) { + m_config.UMouthPhoneticSymbols.Add( item.Text ); + } + } + + try { + m_config.EntryCombineThreshold = float.Parse( txtCombineThreshold.Text ); + } catch { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + this.DialogResult = DialogResult.Cancel; + } + this.DialogResult = DialogResult.OK; + } + + private void EnvConfiguration_Load( object sender, EventArgs e ) { + ApplyColorConfig(); + numEntryHeight.Value = m_config.TrackHeight; + txtCombineThreshold.Text = m_config.EntryCombineThreshold + ""; + } + + private void ApplyColorConfig() { + lblTimelineTitleColor.BackColor = m_config.TimeLineTitleColor.Color; + lblTimeLineVSQColor.BackColor = m_config.TimeLineVsqColor.Color; + lblTimeLinePluginColor.BackColor = m_config.TimeLinePluginColor.Color; + lblTimeLineDefaultColor.BackColor = m_config.TimeLineDefaultColor.Color; + this.Invalidate(); + } + + private void btnChangeTimeLineTitle_Click( object sender, EventArgs e ) { + colorDialog1.Reset(); + colorDialog1.Color = m_config.TimeLineTitleColor.Color; + if ( colorDialog1.ShowDialog() == DialogResult.OK ) { + m_config.TimeLineTitleColor = new ColorSet( colorDialog1.Color ); + ApplyColorConfig(); + } + } + + private void btnChangeTimeLineVSQ_Click( object sender, EventArgs e ) { + colorDialog1.Reset(); + colorDialog1.Color = m_config.TimeLineVsqColor.Color; + if ( colorDialog1.ShowDialog() == DialogResult.OK ) { + m_config.TimeLineVsqColor = new ColorSet( colorDialog1.Color ); + ApplyColorConfig(); + } + } + + private void btnChangeTimeLinePlugin_Click( object sender, EventArgs e ) { + colorDialog1.Reset(); + colorDialog1.Color = m_config.TimeLinePluginColor.Color; + if ( colorDialog1.ShowDialog() == DialogResult.OK ) { + m_config.TimeLinePluginColor = new ColorSet( colorDialog1.Color ); + ApplyColorConfig(); + } + } + + private void btnChangeTimeLineDefault_Click( object sender, EventArgs e ) { + colorDialog1.Reset(); + colorDialog1.Color = m_config.TimeLineDefaultColor.Color; + if ( colorDialog1.ShowDialog() == DialogResult.OK ) { + m_config.TimeLineDefaultColor = new ColorSet( colorDialog1.Color ); + ApplyColorConfig(); + } + } + + private void btnTimeLineTitleDefault_Click( object sender, EventArgs e ) { + m_config.TimeLineTitleColor = new ColorSet( Color.LightPink ); + ApplyColorConfig(); + } + + private void btnTimeLineVSQDefault_Click( object sender, EventArgs e ) { + m_config.TimeLineVsqColor = new ColorSet( Color.FromArgb( 175, 222, 82 ) ); + ApplyColorConfig(); + } + + private void btnTimeLinePluginDefault_Click( object sender, EventArgs e ) { + m_config.TimeLinePluginColor = new ColorSet( Color.FromArgb( 255, 184, 51 ) ); + ApplyColorConfig(); + } + + private void btnTimeLineDefaultDefault_Click( object sender, EventArgs e ) { + m_config.TimeLineDefaultColor = new ColorSet( Color.LightBlue ); + ApplyColorConfig(); + } + + private void btnEntryHeightDefault_Click( object sender, EventArgs e ) { + m_config.TrackHeight = 18; + numEntryHeight.Value = m_config.TrackHeight; + } + + private void numEntryHeight_ValueChanged( object sender, EventArgs e ) { + m_config.TrackHeight = (int)numEntryHeight.Value; + } + + private void btnFFmpeg_Click( object sender, EventArgs e ) { + using ( OpenFileDialog dlg = new OpenFileDialog() ) { + if ( m_config.PathFFmpeg != "" ) { + try { + dlg.InitialDirectory = Path.GetDirectoryName( m_config.PathFFmpeg ); + dlg.FileName = m_config.PathFFmpeg; + } catch { + } + } + try { + dlg.Filter = _( "Executable file(*.exe)|*.exe" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Executable file(*.exe)|*.exe|All Files(*.*)|*.*"; + } + if ( dlg.ShowDialog() == DialogResult.OK ) { + string file = dlg.FileName; + if ( File.Exists( file ) ) { + txtFFmpeg.Text = file; + m_config.PathFFmpeg = file; + } + } + } + } + + private void btnMEncoder_Click( object sender, EventArgs e ) { + using ( OpenFileDialog dlg = new OpenFileDialog() ) { + if ( m_config.PathMEncoder != "" ) { + try { + dlg.InitialDirectory = Path.GetDirectoryName( m_config.PathMEncoder ); + dlg.FileName = m_config.PathMEncoder; + } catch { + } + } + try { + dlg.Filter = _( "Executable file(*.exe)|*.exe" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Executable file(*.exe)|*.exe|All Files(*.*)|*.*"; + } + if ( dlg.ShowDialog() == DialogResult.OK ) { + string file = dlg.FileName; + if ( File.Exists( file ) ) { + txtMEncoder.Text = file; + m_config.PathMEncoder = file; + } + } + } + } + + public string PathFFmpeg { + get { + return txtFFmpeg.Text; + } + set { + txtFFmpeg.Text = value; + } + } + + public string PathMEncoder { + get { + return txtMEncoder.Text; + } + set { + txtMEncoder.Text = value; + } + } + + private void btnChangeFont_Click( object sender, EventArgs e ) { + fontDialog.Font = ScreenFont; + if ( fontDialog.ShowDialog() == DialogResult.OK ) { + ScreenFont = fontDialog.Font; + } + } + + private void btnFontDefault_Click( object sender, EventArgs e ) { + ScreenFont = new Font( "MS UI Gothic", 9 ); + } + + private void btnReloadLanguageConfig_Click( object sender, EventArgs e ) { + Messaging.LoadMessages(); + string current_lang = m_config.Language; + comboLanguage.Items.Clear(); + List list = new List( Messaging.GetRegisteredLanguage() ); + if ( !list.Contains( current_lang ) ) { + current_lang = _DEFAULT_LANGUAGE_STRING; + } + list.Insert( 0, _DEFAULT_LANGUAGE_STRING ); + comboLanguage.Items.AddRange( list.ToArray() ); + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i] == current_lang ) { + comboLanguage.SelectedIndex = i; + break; + } + } + } + + private void comboLanguage_SelectedIndexChanged( object sender, EventArgs e ) { + string res = ""; + if( comboLanguage.SelectedIndex >= 0 ) { + res = (string)comboLanguage.Items[comboLanguage.SelectedIndex]; + } + if ( res == _DEFAULT_LANGUAGE_STRING ) { + res = ""; + } + m_config.Language = res; + } + + private void numWheelRatio_ValueChanged( object sender, EventArgs e ) { + m_config.WheelRatio = (float)(1.0 / (double)numWheelRatio.Value); + } + + private void btnWheelRatioDefault_Click( object sender, EventArgs e ) { + numWheelRatio.Value = 5; + } + + public EnvSettings EnvSettings { + get { + return m_config; + } + } + + private void chkHeavyOpenCharacterDialog_CheckedChanged( object sender, EventArgs e ) { + m_config.UseHeavyDialogInOpeningCharacterSettings = chkHeavyOpenCharacterDialog.Checked; + } + + private void chkGenCharacterAutomaticaly_CheckedChanged( object sender, EventArgs e ) { + m_config.GenerateCharacterAutomatically = chkGenCharacterAutomaticaly.Checked; + } + + private void txtFFmpeg_TextChanged( object sender, EventArgs e ) { + m_config.PathFFmpeg = txtFFmpeg.Text; + } + + private void txtMEncoder_TextChanged( object sender, EventArgs e ) { + m_config.PathMEncoder = txtMEncoder.Text; + } + + private void chkSyncAtCenter_CheckedChanged( object sender, EventArgs e ) { + m_config.SyncAtCentre = chkSyncAtCenter.Checked; + } + } + +} diff --git a/trunk/LipSync/Editor/EnvSettings.cs b/trunk/LipSync/Editor/EnvSettings.cs new file mode 100644 index 0000000..efaac18 --- /dev/null +++ b/trunk/LipSync/Editor/EnvSettings.cs @@ -0,0 +1,351 @@ +サソ/* + * EnvSettings.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Windows.Forms; +using System.Xml.Serialization; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + /// + /// 謫堺ス懃腸蠅縺ョ險ュ螳壼、繧呈シ邏阪@縺セ縺 + /// + public class EnvSettings : ICloneable{ + private static XmlSerializer m_xml_serializer = null; + + public float PixelPerSec = 150.0f; + public float WheelRatio = 0.2f; + public int TimeLineInterval = 5; + public Rectangle WindowPosition = new Rectangle( 0, 0, 473, 435 ); + public bool WindowIsMaximized = false; + public Rectangle PreviewWindowPos = new Rectangle( 0, 0, 349, 340 ); + public Rectangle CurveWindowPos = new Rectangle( 0, 0, 349, 340 ); + public bool PreviewMaximized = false; + public bool CurveMaximized = false; + public PictureBoxSizeMode PreviewZoomMode = PictureBoxSizeMode.Zoom; + public string Language = ""; + public ColorSet TimeLineTitleColor = new ColorSet( Color.LightPink ); + public ColorSet TimeLineVsqColor = new ColorSet( Color.FromArgb( 175, 222, 82 ) ); + public ColorSet TimeLinePluginColor = new ColorSet( Color.FromArgb( 255, 184, 51 ) ); + public ColorSet TimeLineDefaultColor = new ColorSet( Color.LightBlue ); + public string PathFFmpeg = ""; + public string PathMEncoder = ""; + public bool PreviewHidden = false; + public float LastPreviewAspecto = 0.5f; + public FontConfig TelopDefaultFont = new FontConfig( "MS UI Gothic", 18 ); + public ColorSet TelopDefaultColor = new ColorSet( Color.Black ); + public bool PropertyHidden = false; + public int LastPropertyWidth = 175; + public int VerticalStringOffset = 3; + public bool CloseMouthWhenSameVowelsRepeated = true; + public bool GenerateCharacterAutomatically = true; + public float EntryCombineThreshold = 0f; + public string LastCharacterPath = ""; + public string LastMusicPath = ""; + public string LastVsqPath = ""; + public bool UseHeavyDialogInOpeningCharacterSettings = false; + public bool DrawBars = true; + /// + /// Vsq繝医Λ繝繧ッ繧貞クク縺ォ陦ィ遉コ縺吶k縺九←縺縺九r陦ィ縺 + /// + public bool FixVsqTrackPosition = false; + /// + /// 譛蠕後↓菴ソ逕ィ縺輔l縺蘗vi繝輔ぃ繧、繝ォ縺ク縺ョ繝代せ + /// + public string LastAviPath = ""; + public FontConfig Font = new FontConfig( "MS UI Gothic", 9 ); + /// + /// 繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ縺ョ邱ィ髮譎ゅ↓縲髱呎ュ「逕サ繝輔ぃ繧、繝ォ縺ョ蜷榊燕繧偵◎縺ョ縺セ縺セ逕サ蜒上ョ繧ソ繧、繝医Ν縺ィ縺吶k縺九←縺縺 + /// + public bool FileNameAsImageTitle = true; + + private QuantizeMode m_quantize_mode = QuantizeMode.off; // 髻ウ隨ヲ邱ィ髮譎ゅョ驥丞ュ仙喧繝「繝シ繝 + private bool m_quantize_triplet = false; // 3騾」隨ヲ繝「繝シ繝峨′譛牙柑縺九←縺縺 + private bool m_sync_at_centre = true; + private int m_track_height = 15; + private bool m_save_character_config_outside = false; + private List m_close_mouth_phonetic_symbols = new List( new string[] { "b", "p", "m", "b'", "p'", "m'" } ); + private List m_i_mouth_phonetic_symbols = new List( new string[] { "k'", "g'", "S", "dZ", "tS", "J", "C" } ); + private List m_u_mouth_phonetic_symbols = new List( new string[] { @"p\", @"p\'", "w", "ts", "dz" } ); + + public int TrackHeight { + get { + return m_track_height; + } + set { + m_track_height = value; + Size font_size = Misc.MeasureString( "abQBHqj", Font.GetFont() ); + VerticalStringOffset = (m_track_height - font_size.Height) / 2; + } + } + + public static EnvSettings FromFile( string config_file ) { + EnvSettings env; + if ( File.Exists( config_file ) ) { + if ( m_xml_serializer == null ) { + m_xml_serializer = new XmlSerializer( typeof( EnvSettings ) ); + } + FileStream fs = null; + try { + fs = new FileStream( config_file, FileMode.Open ); + env = (EnvSettings)m_xml_serializer.Deserialize( fs ); + } catch { +#if DEBUG + Common.DebugWriteLine( "EnvSettings2+FromFile" ); + Common.DebugWriteLine( " ctor from xml has been failed. trying ctor from EnvSettings." ); +#endif + /*if ( fs != null ) { + fs.Close(); + } + try { + fs = new FileStream( config_file, FileMode.Open ); + BinaryFormatter bf = new BinaryFormatter(); + EnvSettings env1 = (EnvSettings)bf.Deserialize( fs ); + env = new EnvSettings2( env1 ); + } catch ( Exception ex ){ +#if DEBUG + Common.DebugWriteLine( " ex=" + ex.ToString() ); +#endif + env = new EnvSettings2(); + } finally { + if ( fs != null ) { + fs.Close(); + } + }*/ + env = new EnvSettings(); + } finally { + if ( fs != null ) { + fs.Close(); + } + } + } else { + env = new EnvSettings(); + env.Save( config_file ); + } + return env; + } + + public EnvSettings() { + } + + /*internal EnvSettings2( EnvSettings old ) { + PixelPerSec = old.PIXEL_PER_SEC; + WheelRatio = old.WHEEL_RATIO; + TimeLineInterval = old.TIMELINE_INTERVAL; + WindowPosition = old.WINDOW_POS; + WindowIsMaximized = old.MAXIMIZED; + PreviewWindowPos = old.PREVIEW_WINDOW_POS; + CurveWindowPos = new Rectangle( 0, 0, 349, 340 ); + PreviewMaximized = false; + CurveMaximized = false; + PreviewZoomMode = old.PREVIEW_PICTUREMODE; + if ( old.LANGUAGE == LipSync.Language.ja ) { + Language = "ja"; + } else { + Language = ""; + } + TimeLineTitleColor = new ColorSet( old.TIMELINE_TITLE ); + TimeLineVsqColor = new ColorSet( old.TIMELINE_VSQ_ENTRY ); + TimeLinePluginColor = new ColorSet( old.TIMELINE_PLUGIN_ENTRY ); + TimeLineDefaultColor = new ColorSet( old.TIMELINE_DEFAULT_ENTRY ); + PathFFmpeg = old.PATH_FFMPEG; + PathMEncoder = old.PATH_MENCODER; + PreviewHidden = old.PREVIEW_HIDDEN; + LastPreviewAspecto = old.LAST_ASPECTO; + TelopDefaultFont = new FontConfig( old.TELOP_DEFAULT_FONT ); + TelopDefaultColor = new ColorSet( old.TELOP_DEFAULT_COLOR ); + PropertyHidden = old.PROPERTY_HIDDEN; + LastPropertyWidth = old.LAST_PROPERTY_WIDTH; + VerticalStringOffset = old.STRING_OFFSET; + CloseMouthWhenSameVowelsRepeated = old.CLOSE_MOUTH_WHEN_SAME_VOWEL_REPEATED; + GenerateCharacterAutomatically = old.GEN_CHARACTER_AUTOMATICELY; + EntryCombineThreshold = old.COMBINE_THRESHOLD; + LastCharacterPath = old.LAST_CHARACTER_PATH; + LastMusicPath = old.LAST_MUSIC_PATH; + LastVsqPath = old.LAST_VSQ_PATH; + UseHeavyDialogInOpeningCharacterSettings = old.USE_HEAVY_DIALOG; + DrawBars = true; + FixVsqTrackPosition = false; + LastAviPath = ""; + Font = new FontConfig( "MS UI Gothic", 9 ); + m_quantize_mode = QuantizeMode.off; + m_quantize_triplet = false; + m_sync_at_centre = true; + m_track_height = old.TRACK_HEIGHT; + m_save_character_config_outside = false; + m_close_mouth_phonetic_symbols = old.LIST_NN; + m_i_mouth_phonetic_symbols = old.LIST_I; + m_u_mouth_phonetic_symbols = old.LIST_U; + }*/ + + public void Save( string file ) { + if ( m_xml_serializer == null ) { + m_xml_serializer = new XmlSerializer( typeof( EnvSettings ) ); + } + using ( FileStream fs = new FileStream( file, FileMode.Create ) ) { + m_xml_serializer.Serialize( fs, this ); + } + } + + public bool SaveCharacterConfigOutside { + get { + return m_save_character_config_outside; + } + } + + [XmlArrayItem(typeof(string), ElementName="PhoneticSymbol")] + public List CloseMouthPhoneticSymbols { + get { + return m_close_mouth_phonetic_symbols; + } + set { + m_close_mouth_phonetic_symbols = new List( value.ToArray() ); + } + } + + [XmlArrayItem( typeof( string ), ElementName = "PhoneticSymbol" )] + public List IMouthPhoneticSymbols { + get { + return m_i_mouth_phonetic_symbols; + } + set { + m_i_mouth_phonetic_symbols = new List( value.ToArray() ); + } + } + + [XmlArrayItem( typeof( string ), ElementName = "PhoneticSymbol" )] + public List UMouthPhoneticSymbols { + get { + return m_u_mouth_phonetic_symbols; + } + set { + m_u_mouth_phonetic_symbols = new List( value.ToArray() ); + } + } + + public QuantizeMode QuantizeMode { + get { + return m_quantize_mode; + } + set { + m_quantize_mode = value; + } + } + + public bool QuantizeTripletEnabled { + get { + return m_quantize_triplet; + } + set { + m_quantize_triplet = value; + } + } + + public void CleanUpMouthList() { + for ( int i = 0; i < IMouthPhoneticSymbols.Count - 1; i++ ) { + bool changed = true; + while ( changed ) { + changed = false; + for ( int j = i + 1; j < IMouthPhoneticSymbols.Count; j++ ) { + if ( IMouthPhoneticSymbols[i] == IMouthPhoneticSymbols[j] ) { + IMouthPhoneticSymbols.RemoveAt( j ); + changed = true; + break; + } + } + } + } + for ( int i = 0; i < UMouthPhoneticSymbols.Count - 1; i++ ) { + bool changed = true; + while ( changed ) { + changed = false; + for ( int j = i + 1; j < UMouthPhoneticSymbols.Count; j++ ) { + if ( UMouthPhoneticSymbols[i] == UMouthPhoneticSymbols[j] ) { + UMouthPhoneticSymbols.RemoveAt( j ); + changed = true; + break; + } + } + } + } + for ( int i = 0; i < CloseMouthPhoneticSymbols.Count - 1; i++ ) { + bool changed = true; + while ( changed ) { + changed = false; + for ( int j = i + 1; j < CloseMouthPhoneticSymbols.Count; j++ ) { + if ( CloseMouthPhoneticSymbols[i] == CloseMouthPhoneticSymbols[j] ) { + CloseMouthPhoneticSymbols.RemoveAt( j ); + changed = true; + break; + } + } + } + } + } + + public bool SyncAtCentre { + get { + return m_sync_at_centre; + } + set { + m_sync_at_centre = value; + } + } + + public object Clone() { + EnvSettings res = new EnvSettings(); + res.CloseMouthWhenSameVowelsRepeated = this.CloseMouthWhenSameVowelsRepeated; + res.EntryCombineThreshold = this.EntryCombineThreshold; + res.GenerateCharacterAutomatically = this.GenerateCharacterAutomatically; + res.Language = this.Language; + res.LastPreviewAspecto = this.LastPreviewAspecto; + res.LastCharacterPath = this.LastCharacterPath; + res.LastMusicPath = this.LastMusicPath; + res.LastPropertyWidth = this.LastPropertyWidth; + res.LastVsqPath = this.LastVsqPath; + res.IMouthPhoneticSymbols = new List( this.IMouthPhoneticSymbols.ToArray() ); + res.CloseMouthPhoneticSymbols = new List( this.CloseMouthPhoneticSymbols.ToArray() ); + res.UMouthPhoneticSymbols = new List( this.UMouthPhoneticSymbols.ToArray() ); + res.WindowIsMaximized = this.WindowIsMaximized; + res.PathFFmpeg = this.PathFFmpeg; + res.PathMEncoder = this.PathMEncoder; + res.PixelPerSec = this.PixelPerSec; + res.PreviewZoomMode = this.PreviewZoomMode; + res.PropertyHidden = this.PropertyHidden; + res.Font = (FontConfig)this.Font.Clone(); + res.VerticalStringOffset = this.VerticalStringOffset; + res.TelopDefaultColor = this.TelopDefaultColor; + res.TelopDefaultFont = this.TelopDefaultFont; + res.TimeLineDefaultColor = this.TimeLineDefaultColor; + res.TimeLineInterval = this.TimeLineInterval; + res.TimeLinePluginColor = this.TimeLinePluginColor; + res.TimeLineTitleColor = this.TimeLineTitleColor; + res.TimeLineVsqColor = this.TimeLineVsqColor; + res.TrackHeight = this.TrackHeight; + res.UseHeavyDialogInOpeningCharacterSettings = this.UseHeavyDialogInOpeningCharacterSettings; + res.WheelRatio = this.WheelRatio; + res.WindowPosition = this.WindowPosition; + res.DrawBars = this.DrawBars; + res.m_quantize_mode = this.m_quantize_mode; + res.m_quantize_triplet = this.m_quantize_triplet; + res.m_sync_at_centre = this.m_sync_at_centre; + return res; + } + } + +} diff --git a/trunk/LipSync/Editor/FontConfig.cs b/trunk/LipSync/Editor/FontConfig.cs new file mode 100644 index 0000000..ed9af3c --- /dev/null +++ b/trunk/LipSync/Editor/FontConfig.cs @@ -0,0 +1,89 @@ +サソ/* + * FontConfig.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + /// + /// 繝輔か繝ウ繝医ョ險ュ螳壼、繧湛mlSerializer縺ァ"鄒弱@縺"譬シ邏阪☆繧九◆繧√ョ繧ッ繝ゥ繧ケ + /// + public class FontConfig : ICloneable{ + string m_font_family; + FontStyle m_font_style; + float m_font_size; + Font m_font = null; + + public string Family { + get { + return m_font_family; + } + set { + m_font_family = value; + } + } + + public string Style { + get { + return m_font_style + ""; + } + set { + m_font_style = (FontStyle)System.Enum.Parse( typeof( FontStyle ), value ); + } + } + + public float Size { + get { + return m_font_size; + } + set { + m_font_size = value; + } + } + + public FontConfig() { + m_font_family = "MS UI Gothic"; + m_font_style = FontStyle.Regular; + m_font_size = 18; + } + + public FontConfig( Font value ) { + m_font_family = value.FontFamily.Name; + m_font_style = value.Style; + m_font_size = value.Size; + } + + public FontConfig( string family, float size ) { + m_font_family = family; + m_font_size = size; + m_font_style = FontStyle.Regular; + } + + public Font GetFont() { + if ( m_font == null ) { + m_font = new Font( m_font_family, m_font_size, m_font_style ); + } + return m_font; + } + + public object Clone() { + FontConfig ret = new FontConfig(); + ret.m_font_family = m_font_family; + ret.m_font_size = m_font_size; + ret.m_font_style = m_font_style; + return ret; + } + } + +} diff --git a/trunk/LipSync/Editor/Form1.cs b/trunk/LipSync/Editor/Form1.cs new file mode 100644 index 0000000..be51d96 --- /dev/null +++ b/trunk/LipSync/Editor/Form1.cs @@ -0,0 +1,3727 @@ +サソ/* + * Form1.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.IO; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; +using Boare.Lib.Media; +using Boare.Lib.Vsq; +using Plugin; +#if DEBUG +using Boare.Lib.Swf; +#endif + +namespace LipSync { + + public partial class Form1 : Form, IMultiLanguageControl { + #region Constants + private const byte FILEFORMAT = 1; + /// + /// 繝励Ξ繝薙Η繝シ縺ィ繧ソ繧、繝繝ゥ繧、繝ウ縺ョ繧キ繝ウ繧ッ繝ュ繧定。後≧縺ィ縺阪∵ャ。縺ョ逕サ髱「縺ク遘サ蜍輔☆繧区凾縺ョ荳。蛛エ縺ョ驥崎、驛ィ蛻縺ョ蟷 + /// + private const float SIDE_WIDTH = 0.15f; + /// + /// m_editHandleLeft, Right縺ョ蟷 + /// + private const int HANDLE_WIDTH = 8; + /// + /// 閾ェ蜍輔せ繧ッ繝ュ繝シ繝ォ驕ゥ逕ィ逶エ蠕後∫判髱「縺ョ荳ュ螟ョ縺後∫樟蝨ィ縺ョ蜀咲函譎ょ綾菴咲スョ縺セ縺ァ貊代i縺九↓遘サ蜍輔☆繧九ヶ繝ャ繝ウ繝画凾髢 + /// + private const float FIT_CENTER_BREND_TIME = 2f; + const int BUF_LEN = 10; + #endregion + + #region Static Readonly Field + private static readonly AuthorListEntry[] m_credit = new AuthorListEntry[]{ + new AuthorListEntry( "is developped by:", FontStyle.Italic ), + new AuthorListEntry( "kbinani" ), + new AuthorListEntry( "and he thanks to:", FontStyle.Italic ), + new AuthorListEntry(), + new AuthorListEntry( "author of embedded character", FontStyle.Italic ), + new AuthorListEntry( "縺輔↑繧" ), + new AuthorListEntry(), + new AuthorListEntry( "contributors", FontStyle.Italic ), + new AuthorListEntry( "evm" ), + new AuthorListEntry( "驤エ譚大━" ), + new AuthorListEntry( "縺昴m縺昴mP" ), + new AuthorListEntry( "繧√′縺ュシ托シ托シ" ), + new AuthorListEntry( "荳顔キ" ), + new AuthorListEntry( "NOIKE" ), + new AuthorListEntry( "騾莠。閠" ), + new AuthorListEntry(), + new AuthorListEntry( "translator", FontStyle.Italic ), + new AuthorListEntry( "E-Avalance" ), + new AuthorListEntry(), + new AuthorListEntry( "bugs and suggestions reporters", FontStyle.Italic ), + new AuthorListEntry( "縺繧薙■繧繧" ), + new AuthorListEntry( "轣ー" ), + new AuthorListEntry( "sanryo" ), + new AuthorListEntry( "繧縺ェ縺弱′縺繧" ), + new AuthorListEntry( "elthy" ), + new AuthorListEntry( "fyfy" ), + new AuthorListEntry( "k-roh" ), + new AuthorListEntry( "縺輔∴" ), + new AuthorListEntry( "荳顔キ" ), + new AuthorListEntry( "MI" ), + new AuthorListEntry( "縺サ縺ィ縺サ縺ィ" ), + new AuthorListEntry( "IGASIO" ), + new AuthorListEntry( "PEX" ), + new AuthorListEntry(), + new AuthorListEntry( "and you.", FontStyle.Bold | FontStyle.Italic ), + }; + private static readonly Pen HILIGHT = new Pen( Color.Gray, 2 ); + private static readonly Pen HILIGHT_EDIT = new Pen( Color.Red, 2 ); + private static readonly Color REPEAT_AREA = Color.FromArgb( 105, 139, 105 ); + private static readonly Pen _PEN_123_123_123 = new Pen( Color.FromArgb( 123, 123, 123 ) ); + private static readonly SolidBrush _BRS_TRACKBG_ODD = new SolidBrush( Color.FromArgb( 240, 240, 240 ) ); + private static readonly SolidBrush _BRS_TRACKBG_EVEN = new SolidBrush( Color.FromArgb( 212, 212, 212 ) ); + private static readonly SolidBrush _BRS_TRACK_NAME = new SolidBrush( Color.FromArgb( 80, 80, 80 ) ); + private static readonly Pen _PEN_BOUNDS = new Pen( new HatchBrush( HatchStyle.Percent50, Color.Black, Color.White ), 4 ); + private static readonly Pen _PEN_FIXED_BOUNDS = new Pen( new HatchBrush( HatchStyle.Percent50, Color.Red, Color.White ), 4 ); + #endregion + + #region Static Field + //private static Color CANVAS_BACKGROUND_HILIGHT = Color.Black; + #endregion + + #region Field + /// + /// 繝輔ぃ繧、繝ォ縺ォ縺ッ菫晏ュ倥&繧後※縺縺溘′縲∫樟蝨ィ縺ョ迺ー蠅縺ァ縺ッ菴ソ縺医↑縺繝励Λ繧ー繧、繝ウ縺ョ繝医Λ繝繧ッ諠蝣ア縲 + /// 隱ュ霎シ譎ゅ↓蛻、螳壹@縺ヲ菴懈舌@縲∽ソ晏ュ俶凾縺ォ縺ッ荳蠢應ソ晏ュ倥☆繧九 + /// + private List m_not_used_plugin = new List(); + private List m_not_used_plugin_config = new List(); + /// + /// 螟画峩蜿ッ閭ス縺ェ險ュ螳壼、 + /// + //private EnvSettings AppManager.Config = new EnvSettings(); + private Color TRIANGLE_COLOR = Color.SteelBlue; + /// + /// pictureBox1荳翫ョ繝槭え繧ケ縺ョ菴咲スョ + /// + private Point m_mousePosition; + /// + /// pictureBox1荳翫ョ繧ッ繝ェ繝繧ッ縺輔l縺溘い繧、繝繝縺ョ蝣エ謇 + /// + private Item m_clicked; + private Rectangle m_rcHilight; + /// + /// 繧ィ繝ウ繝医Μ縺ョ邱ィ髮繝「繝シ繝峨〒縲√槭え繧ケ繧ォ繝シ繧ス繝ォ繧貞、画峩縺吶k縺ケ縺阪お繝ェ繧「 + /// + private Rectangle m_editHandleLeft = new Rectangle(); + private Rectangle m_editHandleRight = new Rectangle(); + private Item m_edit_handle_ed_item; + private string m_filePath = ""; + private int m_startToDrawX = 0; + private int m_startToDrawY = 0; + private PointF m_expandRange; + private bool m_initialized = false; + //private bool m_edited = false; + /// + /// 繧ウ繝斐シ縺輔l縺溘ち繧、繝繝繝シ繝悶Ν + /// + private TimeTable m_copied_timetable = null; + private Color TOOL_COLOR = Color.DarkGray; + /// + /// 繝医Λ繝繧ッ荳翫ョ繝峨Λ繝繧ー縺ォ繧医j繧ィ繝ウ繝医Μ繧定ソス蜉縺吶k繧ゅシ縺ゥ荳ュ縺ォ菫晄戟縺輔l繧九√b縺ィ繧ゅ→縺ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ繧ュ繝」繝繧キ繝・ + /// + private TimeTableGroup m_editing_group; + /// + /// 繝峨Λ繝繧ー荳ュ縺ョ繧「繧、繝繝 + /// + private Item m_dragging; + private float m_editing_t1, m_editing_t2; + private TimeTableEntry m_copied_entry = null; + private Telop m_copied_telop = null; + private Item m_copied; + private EditMode m_edit_mode = EditMode.None; + /// + /// 繝峨Λ繝繧ー縺ォ繧医j繧ィ繝ウ繝医Μ繧偵せ繝ゥ繧、繝峨☆繧九Δ繝シ繝峨〒縲√せ繝ゥ繧、繝蛾幕蟋句燕縺ョ縲√お繝ウ繝医Μ縺ョ繧ゅ→繧ゅ→縺ョbegin譎ょ綾 + /// + private TimeTableEntry m_slide_original = null; + private bool m_slide_moved = false; + //private float m_total_memory = 0f; +#if DEBUG + private long m_counter = 0L; +#endif + private DateTime m_preview_time; + private VersionInfo m_version_form = null; + + private bool m_avi_writing = false; + private Keys m_last_key = Keys.None; + private int m_realtime_group = 0; + private int m_realtime_track; + private int m_realtime_entry; + private DisplacementControl m_curve; + private bool m_is_repeat_mode = false; + /// + /// Paint繧、繝吶Φ繝医r繧ケ繧ュ繝繝励☆繧句ソ隕√ョ縺ゅk譎Urue + /// + private bool m_skip_paint = false; + /// + /// 繧ッ繧ェ繝ウ繧ソ繧、繧コ縺吶k髫帙ョ繧ー繝ェ繝繝画凾蛻サ縺ョ繝ェ繧ケ繝医ゅせ繧ッ繝ュ繝シ繝ォ繝舌シ縺檎ァサ蜍輔@縺滓凾縲∵峩譁ー + /// + private float[] m_grids; + /// + /// VSQ繝医Λ繝繧ッ繧貞崋螳夊。ィ遉コ縺吶k蝣エ蜷医ョ縲〃SQ繝医Λ繝繧ッ陦ィ遉コ驛ィ蛻縺ョ鬮倥& + /// + private int m_vsq_height = 0; + private FormPreview m_form_preview; + bool m_avi_cancel = false; + Thread m_stdout; + Process m_ffmpeg; + Process m_mencoder; + bool m_is_rawmode = false; + private int m_current_frame = 0; + private MediaPlayer m_player; + private ZorderItem m_editing_item = null; + private EditingBounds m_editing = new EditingBounds(); + /// + /// 譛蛻晉判蜒上′繧ッ繝ェ繝繧ッ縺輔l縺滉ス咲スョ縺ョ縲∫判蜒丞コァ讓咏ウサ縺ァ縺ョ菴咲スョ + /// + private Point m_base_point; + /// + /// 逕サ蜒上′繧ッ繝ェ繝繧ッ縺輔l縺滓凾轤ケ縺ァ縺ョ縲√◎縺ョ逕サ蜒上ョ菴咲スョ險ュ螳壽ュ蝣ア + /// + private Point m_init_position; + /// + /// 繝繧ュ繧ケ繝医お繝繧」繝繝医Δ繝シ繝 + /// + bool m_text_edit = false; + /// + /// 邱ィ髮荳ュ縺ョ繝繧ュ繧ケ繝 + /// + TextBox m_text = null; + /// + /// 繧ェ繝ェ繧ク繝翫Ν縺ョ繝繧ュ繧ケ繝 + /// + string m_text_original; + /// + /// 邱ィ髮縺励※縺繧九ユ繧ュ繧ケ繝医ョID + /// + int m_text_id; + double[] m_buf = new double[BUF_LEN]; + double m_fps; + DateTime m_last_ignitted = new DateTime(); + private DateTime m_started_date; + private Thread m_preview_thread = null; + private BSplitContainer m_panels; + private Telop m_editing_telop_original = null; + #endregion + + private delegate void ChangeTitleTextDelegate( string encoder_type, int percent, int current_frame, int max_frames ); + private delegate void ForceScreenUpdateDelegate(); + private delegate void Form1_AviWritingChange( bool value ); + + public Form1( string file ) { + AppManager.SaveData = new SettingsEx(); + m_filePath = file; + InitializeComponent(); + + m_panels = new BSplitContainer(); + + // m_panels + m_panels.Name = "m_panels"; + m_panels.Orientation = Orientation.Vertical; + m_panels.Panel1.BorderColor = SystemColors.ControlDark; + m_panels.Panel1.BorderStyle = BorderStyle.FixedSingle; + m_panels.Panel2.BorderColor = SystemColors.ControlDark; + m_panels.Panel2.BorderStyle = BorderStyle.FixedSingle; + m_panels.FixedPanel = FixedPanel.Panel1; + m_panels.Panel1.Controls.Add( previewer ); + m_panels.Panel2.Controls.AddRange( new Control[]{ side, + pictureBox1, + hScrollBar1, + vScrollBar1, + pictureBox2, + preview_image } ); + m_panels.Panel1MinSize = 0; + m_panels.Panel2.SizeChanged += new EventHandler( Panel2_SizeChanged ); + m_container.FixedPanel = FixedPanel.Panel1; + m_container.Panel1.Controls.Add( property ); + m_container.Panel2.Controls.Add( m_panels ); + m_panels.Dock = DockStyle.Fill; + property.Dock = DockStyle.Fill; + previewer.Dock = DockStyle.Fill; + + this.pictureBox1.MouseWheel += new MouseEventHandler( pictureBox1_MouseWheel ); + m_player = new MediaPlayer(); + previewer.TrackVolumeValue = m_player.Volume; + Messaging.LoadMessages(); + LoadConfig(); + this.SizeChanged += new EventHandler( Form1_LocationOrSizeChanged ); + this.LocationChanged += new EventHandler( Form1_LocationOrSizeChanged ); + AppManager.EditedChanged += new EventHandler( AppManager_EditedChanged ); + m_form_preview = new FormPreview(); + m_form_preview.FormClosing += new FormClosingEventHandler( m_form_preview_FormClosing ); + m_curve = new DisplacementControl(); + m_curve.FormClosing += new FormClosingEventHandler( m_curve_FormClosing ); + menuVisualVsqTrack.Checked = AppManager.Config.FixVsqTrackPosition; + ApplyLanguage(); + } + + private void m_curve_FormClosing( object sender, FormClosingEventArgs e ) { + e.Cancel = true; + menuVisualTransform.Checked = false; + } + + private void AppManager_EditedChanged( object sender, EventArgs e ) { + UpdateFormTitle(); + UpdateObjectList(); + menuEditRedo.Enabled = AppManager.IsRedoAvailable; //Execute縺ィResiter縺碁屬繧後※縺繧九ョ縺ァシ後%縺薙〒譖エ譁ー縺吶k蠢隕√′縺ゅk + menuEditUndo.Enabled = AppManager.IsUndoAvailable; + if ( AppManager.Edited ) { + this.Invalidate(); + } + } + + private void Panel2_SizeChanged( object sender, EventArgs e ) { + ResizePanel2(); + } + + private void m_form_preview_FormClosing( object sender, FormClosingEventArgs e ) { + e.Cancel = true; + m_form_preview.Hide(); + previewer.Parent = m_panels.Panel1; + int total_height = m_panels.Panel1.Height + m_panels.Panel2.Height; + int new_distance = (int)(total_height * AppManager.Config.LastPreviewAspecto); + m_panels.SplitterDistance = new_distance; + m_panels.IsSplitterFixed = false; + menuVisualPreviewSeparate.Checked = false; + } + + #region property + private void property_TelopDeleting( ZorderItem e ) { +#if DEBUG + Common.DebugWriteLine( "property1_TelopDeleting" ); + Common.DebugWriteLine( " e.Type=" + e.Type ); +#endif + if ( e.Type == ZorderItemType.telop ) { + Command run = Command.GCommandDeleteTelop( AppManager.SaveData[e.Index] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + Telop.DecideLane( AppManager.SaveData.m_telop_ex2 ); + property.Editing = null; + if ( m_curve.comboObjects.SelectedItem != null ){ + TagForTreeNode t = (TagForTreeNode)m_curve.comboObjects.SelectedItem; + if ( t.type == ZorderItemType.telop && t.id_or_index == e.Index ) { + m_curve.SetSelectedNone(); + } + } + SetVScrollRange(); + } + } + + private void property_EditingItemChanged( ZorderItem item ) { +#if DEBUG + Common.DebugWriteLine( "property1_EditingItemChanged" ); +#endif + if ( item != null ) { + switch ( item.Type ) { + case ZorderItemType.another: + property.SelectedObject = AppManager.SaveData.m_group_another[item.Index].Clone(); + break; + case ZorderItemType.character: + property.SelectedObject = AppManager.SaveData.m_groups_character[item.Index].Clone(); + break; + case ZorderItemType.telop: + //Telop.DecideLane( AppManager.SaveData.m_telop_ex2 ); + property.SelectedObject = AppManager.SaveData[item.Index].Clone(); + break; + } + } else { + property.SelectedObject = null; + } + } + + private void property_TelopAdding() { + h_addTelop( this, new EventArgs() ); + } + + private void property_PropertyValueChanged( object sender, PropertyValueChangedEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "property1_PropertyValueChanged(object,PropertyValueChangedEventArgs)" ); +#endif + int target = property.Editing.Index; + string start = ""; + string type = ""; + string name = ""; + +#if DEBUG + Common.DebugWriteLine( " (property1.SelectedObject is TimeTable) =" + (property.SelectedObject is TimeTable) ); + Common.DebugWriteLine( " (property1.SelectedObject is TimeTableGroup)=" + (property.SelectedObject is TimeTableGroup) ); + Common.DebugWriteLine( " (property1.SelectedObject is Telop) =" + (property.SelectedObject is Telop) ); +#endif + // property1.SelectedObject縺ッシ後◎繧後◇繧後ョ邱ィ髮蟇セ雎。縺ョ蜊倥↑繧九け繝ュ繝シ繝ウ縺ェ縺ョ縺ァシ + // 螟画峩縺輔l縺溘iCommand繧剃スソ縺」縺ヲ譛ャ菴薙r譖エ譁ー縺吶k蠢隕√′縺ゅk + if ( property.SelectedObject is TimeTable ) { + Command run = Command.GCommandEditTimeTable( TimeTableType.another, -1, target, (TimeTable)property.SelectedObject ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + start = AppManager.SaveData[TimeTableType.another, -1].GetFirstOn( target ) + ""; + type = "another"; + name = AppManager.SaveData[TimeTableType.another, -1][target].Text; + } else if ( property.SelectedObject is TimeTableGroup ) { + Command run = Command.GCommandEditGroup( TimeTableType.character, target, (TimeTableGroup)property.SelectedObject ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + start = "" + AppManager.SaveData[TimeTableType.character, target].GetFirstOn(); + type = "character"; + name = AppManager.SaveData[TimeTableType.character, target].Text; + } else if ( property.SelectedObject is Telop ) { + Command run = Command.GCommandEditTelop( target, (Telop)property.SelectedObject ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + start = "" + AppManager.SaveData[target].Start; + type = "telop"; + name = AppManager.SaveData[target].Text; + } + + // property1.ListView縺ョ陦ィ遉コ蜀螳ケ繧呈峩譁ー + ZorderItem editing = property.Editing; +#if DEBUG + Common.DebugWriteLine( " editing.Type=" + editing.Type ); + Common.DebugWriteLine( " editing.Index=" + editing.Index ); + Common.DebugWriteLine( " editing.Name=" + editing.Name ); + bool found = false; +#endif + foreach ( ListViewItem item in property.ListView.Items ) { + if ( item.Tag is ZorderItem ) { + ZorderItem zitem = (ZorderItem)item.Tag; + if ( zitem.Type == editing.Type && zitem.Index == editing.Index ) { + item.SubItems[0].Text = start; + item.SubItems[1].Text = type; + item.SubItems[2].Text = name; +#if DEBUG + found = true; +#endif + break; + } + } + } + +#if DEBUG + Common.DebugWriteLine( "found=" + found ); +#endif + UpdateEditHandle(); + AppManager.Edited = true; + } + #endregion + + #region hScrollBar1 + private void hScrollBar1_Scroll( object sender, ScrollEventArgs e ) { + m_startToDrawX = StartToDrawX(); + UpdateGridList(); + pictureBox1.Invalidate(); + } + #endregion + + private void vScrollBar1_Scroll( object sender, ScrollEventArgs e ) { + m_startToDrawY = StartToDrawY(); + side.Refresh(); + pictureBox1.Refresh(); + } + + #region pictureBox1 + private void pictureBox1_MouseWheel( object sender, MouseEventArgs e ) { + if ( (Control.ModifierKeys & Keys.Shift) == Keys.Shift ) { + if ( vScrollBar1.Enabled ) { + int prev = vScrollBar1.Value; + float add = -(float)e.Delta / AppManager.Config.WheelRatio; + int set = (int)((float)prev + add); + if ( set > vScrollBar1.Maximum + 1 - vScrollBar1.LargeChange ) { + set = vScrollBar1.Maximum + 1 - vScrollBar1.LargeChange; + } else if ( set < vScrollBar1.Minimum ) { + set = vScrollBar1.Minimum; + } + if ( prev != set ) { + vScrollBar1.Value = set; + m_startToDrawY = StartToDrawY(); + pictureBox1.Invalidate(); + side.Invalidate(); + } + } + } else { + if ( hScrollBar1.Enabled ) { + int prev = hScrollBar1.Value; + float add = -(float)e.Delta / AppManager.Config.WheelRatio; + int set = (int)((float)prev + add); + if ( set > hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange ) { + set = hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange; + } else if ( set < hScrollBar1.Minimum ) { + set = hScrollBar1.Minimum; + } + if ( prev != set ) { + hScrollBar1.Value = set; + m_startToDrawX = StartToDrawX(); + pictureBox1.Invalidate(); + } + UpdateGridList(); + } + } + } + + private void pictureBox1_PreviewKeyDown( object sender, PreviewKeyDownEventArgs e ) { + if ( e.KeyCode == Keys.Delete ) { + DeleteEntry(); + } + if ( AppManager.Playing && menuEditRealTime.Checked ) { + if ( m_last_key == e.KeyCode ) { + return; + } + string target = ""; + float m_end = Now; + switch ( e.KeyCode ) { + case Keys.A: + target = "a"; + break; + case Keys.I: + target = "i"; + break; + case Keys.U: + target = "u"; + break; + case Keys.E: + target = "e"; + break; + case Keys.O: + target = "o"; + break; + case Keys.Space: + if ( m_last_key != Keys.None ) { + TimeTableEntry tte = (TimeTableEntry)AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track][m_realtime_entry].Clone(); + tte.end = m_end; + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track][m_realtime_entry].end = m_end; + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track].RemoveAt( m_realtime_entry ); + Command run = Command.GCommandAddTimeTableEntry( TimeTableType.character, + m_realtime_group, + m_realtime_track, + tte ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + m_last_key = Keys.None; + return; + default: + return; + } + //縺セ縺壹∫峩蜑阪↓蜈・蜉帙&繧後◆繧ィ繝ウ繝医Μ繧堤オゆコ縺輔○繧句ヲ逅 + if ( m_last_key != Keys.None ) { + TimeTableEntry tte = (TimeTableEntry)AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track][m_realtime_entry].Clone(); + tte.end = m_end; + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track].RemoveAt( m_realtime_entry ); + Command run = Command.GCommandAddTimeTableEntry( TimeTableType.character, + m_realtime_group, + m_realtime_track, + tte ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + //莉翫@縺後◆謚シ縺輔l縺溘く繝シ縺ォ蟇セ蠢懊☆繧九お繝ウ繝医Μ繧定ソス蜉縲 + for ( int i = 0; i < AppManager.SaveData.m_groups_character[m_realtime_group].Count; i++ ) { + if ( AppManager.SaveData.m_groups_character[m_realtime_group][i].Text == target ) { + m_realtime_track = i; + break; + } + } + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track].Add( new TimeTableEntry( m_end, m_end, target ) ); + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track].Sort(); + //sort縺励◆縺ョ縺ァm_realtime_entry繧呈、懃エ「縺ァ謗「縺 + for ( int entry = 0; entry < AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track].Count; entry++ ) { + if ( AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track][entry].begin == m_end ) { + m_realtime_entry = entry; + break; + } + } + m_last_key = e.KeyCode; + } + } + + private void pictureBox1_MouseClick( object sender, MouseEventArgs e ) { + m_mousePosition.X = e.X; + m_mousePosition.Y = e.Y; + + if ( e.Button == MouseButtons.Right ) { + if ( 0 <= e.Y && e.Y <= AppManager.Config.TrackHeight ) { + cmenuRepeat.Show( pictureBox1, e.X, e.Y ); + return; + } + } + + if ( m_edit_mode == EditMode.Dragging ) { + return; + } + + if ( m_edit_mode == EditMode.Sliding ) { + if ( m_slide_moved ) { + return; + } + m_edit_mode = EditMode.None; + } + + if ( m_edit_mode == EditMode.Selected ) { + if ( e.Button == MouseButtons.Right ) { + m_edit_mode = EditMode.None; + } + } + + if ( m_edit_mode == EditMode.None/*!m_editMode*/ ) { + m_clicked = GetGroupItem( m_mousePosition.X + m_startToDrawX, m_mousePosition.Y + m_startToDrawY ); + if ( e.Button == MouseButtons.Right ) { + #region 蜿ウ繧ッ繝ェ繝繧ッ + m_edit_mode = EditMode.None; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + + if ( !cmenu.IsDisposed || cmenu != null ) { + cmenu.Dispose(); + } + cmenu = new ContextMenuStrip(); + cmenu.RenderMode = ToolStripRenderMode.ManagerRenderMode; + cmenu.ShowCheckMargin = false; + cmenu.ShowImageMargin = false; + cmenu.Font = AppManager.Config.Font.GetFont(); + + if ( m_clicked.type == TimeTableType.top ) { + return; + } + if ( group < 0 ) { + cmenu.Items.Add( _( "Video size configuration" ), + null, + new EventHandler( h_setVideoSize ) ); + } else { + if ( track < 0 ) { + #region 繧ソ繧、繝医Ν縺後け繝ェ繝繧ッ縺輔l縺溘→縺 + switch ( m_clicked.type ) { + case TimeTableType.vsq: + cmenu.Items.Add( _( "Read from VSQ file" ), null, new EventHandler( h_readVsq ) ); + break; + case TimeTableType.character: + if ( AppManager.SaveData.m_groups_character[group].Character != null ) { + cmenu.Items.Add( _( "Edit character" ), null, new EventHandler( h_editCharacter ) ); + if ( AppManager.SaveData.m_groups_character[group].Character.Type == CharacterType.def ) { + cmenu.Items.Add( "-" ); + cmenu.Items.Add( _( "Preview image" ), null, new EventHandler( h_previewImage ) ); + cmenu.Items.Add( _( "Image placement" ), null, new EventHandler( h_setImagePosition ) ); + cmenu.Items.Add( _( "Scale setting" ), null, new EventHandler( h_setScale ) ); + cmenu.Items.Add( "-" ); + cmenu.Items.Add( _( "Generate wink" ), null, new EventHandler( h_addWink ) ); + } + } + cmenu.Items.Add( "-" ); + cmenu.Items.Add( _( "Delete" ), null, new EventHandler( h_deleteTrack ) ); + break; + case TimeTableType.telop: + cmenu.Items.Add( _( "Add Telop" ), null, new EventHandler( h_addTelop ) ); + break; + case TimeTableType.another: + cmenu.Items.Add( _( "Add track" ), null, new EventHandler( h_addTrack ) ); + break; + } + #endregion + } else { + bool copy_enabled = true; + if ( entry < 0 ) { + #region 繝医Λ繝繧ッ縺後け繝ェ繝繧ッ縺輔l縺溘→縺 + switch ( m_clicked.type ) { + case TimeTableType.vsq: + cmenu.Items.Add( _( "Generate Lipsync from this track" ), null, new EventHandler( h_genMouthFromVsq ) ); + if ( AppManager.SaveData.m_group_vsq[track].Count == 0 ) { + copy_enabled = false; + } + break; + case TimeTableType.character: + cmenu.Items.Add( _( "Note ON from here" ) + "(&O)", + null, + new EventHandler( h_noteON ) ); + cmenu.Items.Add( _( "Preview image" ), + null, + new EventHandler( h_previewImage ) ); + if ( AppManager.SaveData.m_groups_character[group][track].Count == 0 ) { + copy_enabled = false; + } + break; + case TimeTableType.another: + cmenu.Items.Add( _( "Note ON from here" ) + "(&O)", + null, + new EventHandler( h_noteON ) ); + if ( AppManager.SaveData.m_group_another[track].Image == null ) { + cmenu.Items.Add( _( "Set image" ), + null, + new EventHandler( h_setImage ) ); + } else { + cmenu.Items.Add( _( "Preview image" ), + null, + new EventHandler( h_previewImage ) ); + cmenu.Items.Add( _( "Change image" ), + null, + new EventHandler( h_setImage ) ); + } + ToolStripMenuItem mItemImage = new ToolStripMenuItem( _( "Image" ) ); + mItemImage.DropDown = new ContextMenuStrip(); + ((ContextMenuStrip)mItemImage.DropDown).Items.Add( _( "Image placement" ), + null, + new EventHandler( h_setImagePosition ) ); + ((ContextMenuStrip)mItemImage.DropDown).Items.Add( _( "Scale setting" ), + null, + new EventHandler( h_setScale ) ); + ((ContextMenuStrip)mItemImage.DropDown).ShowCheckMargin = false; + ((ContextMenuStrip)mItemImage.DropDown).ShowImageMargin = false; + cmenu.Items.Add( mItemImage ); + if ( AppManager.SaveData.m_group_another[track].Count == 0 ) { + copy_enabled = false; + } + break; + case TimeTableType.plugin: + cmenu.Items.Add( _( "Note ON from here" ) + "(&O)", + null, + new EventHandler( h_noteON ) ); + if ( AppManager.SaveData.m_group_plugin[track].Count == 0 ) { + copy_enabled = false; + } + break; + } + + //繧ィ繝ウ繝医Μ縺ョ雋シ莉倥¢ + if ( m_clicked.type != TimeTableType.vsq ) { + cmenu.Items.Add( _( "Paste" ) + "(&V)", + null, + new EventHandler( h_pasteEntry ) ); + if ( m_copied_entry == null && m_copied_telop == null ) { + cmenu.Items[cmenu.Items.Count - 1].Enabled = false; + } + } + + + #endregion + } else { + #region 繧ィ繝ウ繝医Μ縺後け繝ェ繝繧ッ縺輔l縺溘→縺 + copy_enabled = true;//繧ィ繝ウ繝医Μ縺後け繝ェ繝繧ッ縺輔l縺溘ョ縺ァ縲√お繝ウ繝医Μ縺ョ蛟区焚縺ッ1蛟倶サ・荳奇シ + if ( m_clicked.type != TimeTableType.vsq ) { + cmenu.Items.Add( _( "Note OFF" ) + "(&O)", null, new EventHandler( h_noteOFF ) ); + if ( m_clicked.type == TimeTableType.character ) { + cmenu.Items.Add( _( "Image Preview" ), null, new EventHandler( h_previewImage ) ); + } + cmenu.Items.Add( _( "Numeric Entry" ) + "(&N)", null, new EventHandler( h_editEntry ) ); + if ( m_clicked.type != TimeTableType.telop ) { + cmenu.Items.Add( _( "Expand" ) + "(&E)", null, new EventHandler( h_expandEntry ) ); + } + cmenu.Items.Add( "-" ); + + // 繧ー繝ォ繝シ繝怜崋譛峨ョ讖溯ス + if ( m_clicked.type == TimeTableType.another ) { + if ( AppManager.SaveData.m_group_another[track].Image == null ) { + //if ( s.m_group_another[track].GetImage( 0f ) == null ) { + cmenu.Items.Add( _( "Set Image" ), null, new EventHandler( h_setImage ) ); + } else { + cmenu.Items.Add( _( "Preview Image" ), null, new EventHandler( h_previewImage ) ); + cmenu.Items.Add( _( "Change Image" ), null, new EventHandler( h_setImage ) ); + } + ToolStripMenuItem mItemImage = new ToolStripMenuItem( _( "Image" ) ); + mItemImage.DropDown = new ContextMenuStrip(); + ((ContextMenuStrip)mItemImage.DropDown).Items.Add( _( "Image placement" ), + null, + new EventHandler( h_setImagePosition ) ); + ((ContextMenuStrip)mItemImage.DropDown).Items.Add( _( "Scale setting" ), + null, + new EventHandler( h_setScale ) ); + ((ContextMenuStrip)mItemImage.DropDown).ShowCheckMargin = false; + ((ContextMenuStrip)mItemImage.DropDown).ShowImageMargin = false; + cmenu.Items.Add( mItemImage ); + cmenu.Items.Add( "-" ); + } else if ( m_clicked.type == TimeTableType.plugin ) { + if ( (AppManager.SaveData.m_plugins[m_clicked.track].Instance.Type & Constants.LS_ENABLES_ENTRY_SETTING) == Constants.LS_ENABLES_ENTRY_SETTING ) { + cmenu.Items.Add( _( "Plugin config. of this entry" ), null, new EventHandler( h_entrySetting ) ); + cmenu.Items.Add( "-" ); + } + } + + //邱ィ髮邉サ縺ョ蜈ア騾壹さ繝槭Φ繝 + cmenu.Items.Add( _( "Copy" ) + "(&C)", null, new EventHandler( h_copyEntry ) ); + cmenu.Items.Add( _( "Cut" ) + "(&X)", null, new EventHandler( h_cutEntry ) ); + cmenu.Items.Add( _( "Split Entry" ) + "(&S)", null, new EventHandler( h_splitEntry ) ); + } + #endregion + } + + #region 繧ソ繧、繝繝ゥ繧、繝ウ逕ィ縺ョ蜈ア騾壹さ繝槭Φ繝 + //繧ソ繧、繝繝ゥ繧、繝ウ + if ( m_clicked.type != TimeTableType.telop ) { + ToolStripMenuItem mItemTimeline = new ToolStripMenuItem( _( "Timeline" ) ); + ContextMenuStrip cItemTimeline = new ContextMenuStrip(); + cItemTimeline.Items.Add( _( "Copy" ), null, new EventHandler( h_copyTimeTable ) ); + if ( !copy_enabled ) { + cItemTimeline.Items[cItemTimeline.Items.Count - 1].Enabled = false; + } + cItemTimeline.Items.Add( _( "Copy On/Off inverted" ), null, new EventHandler( h_copyTimeTableInvert ) ); + if ( !copy_enabled ) { + cItemTimeline.Items[cItemTimeline.Items.Count - 1].Enabled = false; + } + cItemTimeline.Items.Add( _( "Paste" ), null, new EventHandler( h_pasteTimeTable ) ); + if ( m_copied_timetable == null ) { + cItemTimeline.Items[cItemTimeline.Items.Count - 1].Enabled = false; + } + cItemTimeline.Items.Add( _( "Import from TEXT" ), null, new EventHandler( h_importFromText ) ); + cItemTimeline.Items.Add( _( "Export to TEXT" ), null, new EventHandler( h_exportToText ) ); + cItemTimeline.ShowCheckMargin = false; + cItemTimeline.ShowImageMargin = false; + mItemTimeline.DropDown = cItemTimeline; + cmenu.Items.Add( mItemTimeline ); + } + + //邱ィ髮 + ToolStripMenuItem mItemEdit = new ToolStripMenuItem( _( "Edit" ) ); + ContextMenuStrip cItemEdit = new ContextMenuStrip(); + if ( m_clicked.type != TimeTableType.plugin && m_clicked.type != TimeTableType.character && m_clicked.type != TimeTableType.telop ) { + cItemEdit.Items.Add( _( "Delete" ), null, new EventHandler( h_deleteTrack ) ); + } + cItemEdit.Items.Add( _( "Delete entries" ), null, new EventHandler( h_clearEntry ) ); + if ( !copy_enabled ) { + cItemEdit.Items[cItemEdit.Items.Count - 1].Enabled = false; + } + cItemEdit.Items.Add( _( "Shift this time-line" ), null, new EventHandler( h_shiftEntries ) ); + if ( !copy_enabled ) { + cItemEdit.Items[cItemEdit.Items.Count - 1].Enabled = false; + } + cItemEdit.ShowCheckMargin = false; + cItemEdit.ShowImageMargin = false; + mItemEdit.DropDown = cItemEdit; + cmenu.Items.Add( mItemEdit ); + + #endregion + + } + } + if ( cmenu.Items.Count >= 1 ) { + cmenu.Show( pictureBox1, new Point( e.X, e.Y ) ); + } + #endregion + } else if ( e.Button == MouseButtons.Left ) { + #region 蟾ヲ繧ッ繝ェ繝繧ッ + if ( m_clicked.entry >= 0 ) { + m_edit_handle_ed_item = GetGroupItem( e.X + m_startToDrawX, e.Y + m_startToDrawY ); +#if DEBUG + Common.DebugWriteLine( "pictureBox1_MouseClick; m_edit_handle_ed_item.entry=" + m_edit_handle_ed_item.entry ); +#endif + UpdateEditHandle( e.X, e.Y ); + m_edit_mode = EditMode.Selected; + float time = SecFromXCoord( e.X ); + UpdateExpandRange( time ); + if ( m_clicked.type == TimeTableType.telop ) { + Telop selected = AppManager.SaveData[m_clicked.entry]; + property.Editing = new ZorderItem( selected.Text, ZorderItemType.telop, selected.ID ); + } + pictureBox1.Invalidate(); + } + #endregion + } + } else if ( m_edit_mode != EditMode.EditingLeft && m_edit_mode != EditMode.EditingRight/* !m_editEntry*/ ) { + m_clicked = GetGroupItem( e.X + m_startToDrawX, e.Y + m_startToDrawY ); + if ( m_clicked.entry >= 0 ) { + UpdateEditHandle( e.X, e.Y ); + float time = SecFromXCoord( e.X ); + UpdateExpandRange( time ); + if ( m_clicked.type == TimeTableType.telop ) { + Telop selected = AppManager.SaveData[m_clicked.entry]; + property.Editing = new ZorderItem( selected.Text, ZorderItemType.telop, selected.ID ); + } + pictureBox1.Invalidate(); + } else { + m_edit_mode = EditMode.None; + } + } + } + + private void pictureBox1_MouseMove( object sender, MouseEventArgs e ) { + if ( AppManager.Playing ) { + m_mousePosition = e.Location; + return; + } + + Rectangle last = m_rcHilight; + m_rcHilight = GetHilightRect( m_mousePosition.X, m_mousePosition.Y ); + + if ( preview_image.Visible ) { + TimeSpan ts = DateTime.Now.Subtract( m_preview_time ); + if ( ts.TotalMilliseconds > 1000 ) { + preview_image.Visible = false; + } + } + + statusTime.Text = SecFromXCoord( e.X ).ToString( "0.00" ) + " sec"; + if ( m_edit_mode != EditMode.Selected ) { + m_mousePosition.X = e.X; + m_mousePosition.Y = e.Y; + if ( m_edit_mode == EditMode.Dragging ) { + // 繧ィ繝ウ繝医Μ繧定ソス蜉縺吶k繝「繝シ繝 + m_editing_t2 = SecFromXCoord( e.X ); + m_slide_moved = true; + if ( AppManager.Config.QuantizeMode != QuantizeMode.off && m_grids != null ) { + m_editing_t2 = GetSnapPoint( m_editing_t2 ); + } + float begin = m_editing_t1; + float end = m_editing_t2; + if ( begin > end ) { + float b = begin; + begin = end; + end = b; + } + if ( begin < 0f ) { + begin = 0f; + } + if ( AppManager.SaveData.m_totalSec < end ) { + end = AppManager.SaveData.m_totalSec; + } + if ( m_dragging.type == TimeTableType.telop ) { + AppManager.SaveData[m_editing_telop_original.ID].Start = begin; + AppManager.SaveData[m_editing_telop_original.ID].End = end; + } else if ( m_dragging.type != TimeTableType.vsq ) { + AppManager.SaveData[m_dragging.type, m_dragging.group] = null; + AppManager.SaveData[m_dragging.type, m_dragging.group] = (TimeTableGroup)m_editing_group.Clone(); + AppManager.SaveData[m_dragging.type, m_dragging.group].Interrup( m_dragging.track, begin, end ); + } + pictureBox1.Cursor = Cursors.Arrow; + } else if ( m_edit_mode == EditMode.Sliding ) { + // 繧ィ繝ウ繝医Μ繧偵ラ繝ゥ繝繧ー縺励※繧ケ繝ゥ繧、繝峨&縺帙k繝「繝シ繝 + m_slide_moved = true; + m_editing_t2 = SecFromXCoord( e.X ); + int group = m_dragging.group; + int track = m_dragging.track; + int entry = m_dragging.entry; + float diff = (m_editing_t2 - m_editing_t1); + float original_begin; + if ( m_dragging.type == TimeTableType.telop ) { + original_begin = m_editing_telop_original.Start; + } else { + original_begin = m_slide_original.begin; + } + float begin = original_begin + diff; + + if ( AppManager.Config.QuantizeMode != QuantizeMode.off && m_grids != null ) { + begin = GetSnapPoint( begin ); + diff = begin - original_begin; + } + float end = 0; + float length = 0; + + if ( m_dragging.type == TimeTableType.telop ) { + end = m_editing_telop_original.End + diff; + length = m_editing_telop_original.Length; + } else if ( m_dragging.type != TimeTableType.vsq ) { + end = AppManager.SaveData[m_dragging.type, group][track][entry].end + diff; + length = AppManager.SaveData[m_dragging.type, group][track][entry].Length; + if ( begin < m_expandRange.X ) { + begin = m_expandRange.X; + end = begin + length; + } else { + if ( m_expandRange.Y < end ) { + end = m_expandRange.Y; + begin = end - length; + } else { + end = begin + length; + } + } + } + + int ibegin = XCoordFromSec( begin ); + int y = m_dragging.row_index * AppManager.Config.TrackHeight - m_startToDrawY; + int width = (int)(length * AppManager.Config.PixelPerSec); + m_rcHilight = new Rectangle( ibegin, y, width, AppManager.Config.TrackHeight ); + + if ( m_dragging.type == TimeTableType.telop ) { + AppManager.SaveData[m_editing_telop_original.ID].Start = begin; + AppManager.SaveData[m_editing_telop_original.ID].End = end; + } else if ( m_dragging.type != TimeTableType.vsq ) { + AppManager.SaveData[m_dragging.type, group][track][entry].begin = begin; + AppManager.SaveData[m_dragging.type, group][track][entry].end = end; + } + pictureBox1.Cursor = Cursors.Arrow; + } else if ( m_edit_mode == EditMode.EditingLeft || m_edit_mode == EditMode.EditingRight ) { + TimeTableType type = m_edit_handle_ed_item.type; + if ( type != TimeTableType.vsq ) { + int group = m_edit_handle_ed_item.group; + int track = m_edit_handle_ed_item.track; + int entry = m_edit_handle_ed_item.entry; + if ( entry < 0 ) { + m_edit_mode = EditMode.None; + return; + } + float draft_begin, draft_end; + if ( type == TimeTableType.telop ) { + draft_begin = m_editing_telop_original.Start; + draft_end = m_editing_telop_original.End; + } else { + draft_begin = m_editing_group[track][entry].begin; + draft_end = m_editing_group[track][entry].end; + } + if ( m_edit_mode == EditMode.EditingLeft ) { + draft_begin = SecFromXCoord( e.X ); + if ( AppManager.Config.QuantizeMode != QuantizeMode.off && m_grids != null ) { + draft_begin = GetSnapPoint( draft_begin ); + } + if ( draft_begin < 0f ) { + draft_begin = 0f; + } + } else { + draft_end = SecFromXCoord( e.X ); + if ( AppManager.Config.QuantizeMode != QuantizeMode.off && m_grids != null ) { + draft_end = GetSnapPoint( draft_end ); + } + if ( AppManager.SaveData.m_totalSec < draft_end ) { + draft_end = AppManager.SaveData.m_totalSec; + } + } + if ( draft_begin < draft_end ) { + if ( type == TimeTableType.telop ) { + AppManager.SaveData[entry].Start = draft_begin; + AppManager.SaveData[entry].End = draft_end; + } else { + AppManager.SaveData[type, group] = null; + AppManager.SaveData[type, group] = (TimeTableGroup)m_editing_group.Clone(); + AppManager.SaveData[type, group][track].RemoveAt( entry ); + AppManager.SaveData[type, group].Interrup( track, draft_begin, draft_end ); + } + } + } + pictureBox1.Cursor = Cursors.VSplit; + } + } else { + Point pt = new Point( e.X, e.Y ); + if ( AppManager.IsInRectangle( pt, m_editHandleLeft ) ) { + pictureBox1.Cursor = Cursors.VSplit; + } else if ( AppManager.IsInRectangle( pt, m_editHandleRight ) ) { + pictureBox1.Cursor = Cursors.VSplit; + } else { + pictureBox1.Cursor = Cursors.Arrow; + } + } + pictureBox1.Refresh(); + } + + private void pictureBox1_MouseLeave( object sender, EventArgs e ) { + pictureBox1.Invalidate(); + } + + /// + /// + /// + /// + /// + private void pictureBox1_MouseDown( object sender, MouseEventArgs e ) { + pictureBox1.Focus(); + + m_mousePosition.X = e.X; + m_mousePosition.Y = e.Y; + + if ( m_edit_mode == EditMode.Selected ) { + if ( m_edit_handle_ed_item.type == TimeTableType.telop ) { + int id = m_edit_handle_ed_item.entry; + if ( AppManager.IsInRectangle( e.Location, m_editHandleLeft ) ) { + m_editing_telop_original = (Telop)AppManager.SaveData[id].Clone(); + m_edit_mode = EditMode.EditingLeft; + } else if ( AppManager.IsInRectangle( e.Location, m_editHandleRight ) ) { + m_editing_telop_original = (Telop)AppManager.SaveData[id].Clone(); + m_edit_mode = EditMode.EditingRight; + } + } else { + if ( AppManager.IsInRectangle( e.Location, m_editHandleLeft ) ) { + m_editing_group = null; + m_editing_group = (TimeTableGroup)AppManager.SaveData[m_edit_handle_ed_item.type, m_edit_handle_ed_item.group].Clone(); + m_edit_mode = EditMode.EditingLeft; + } else if ( AppManager.IsInRectangle( e.Location, m_editHandleRight ) ) { + m_editing_group = null; + m_editing_group = (TimeTableGroup)AppManager.SaveData[m_edit_handle_ed_item.type, m_edit_handle_ed_item.group].Clone(); + m_edit_mode = EditMode.EditingRight; + } + } +#if DEBUG + Common.DebugWriteLine( "pictureBox1_MouseDown; m_edit_handle_ed_item.entry=" + m_edit_handle_ed_item.entry ); +#endif + } else if ( e.Button == MouseButtons.Left ) { + m_editing_t1 = SecFromXCoord( e.X ); + if ( AppManager.Config.QuantizeMode != QuantizeMode.off ) { + m_editing_t1 = GetSnapPoint( m_editing_t1 ); + } + m_clicked = GetGroupItem( m_mousePosition.X + m_startToDrawX, m_mousePosition.Y + m_startToDrawY ); + if ( m_clicked.track >= 0 ) { + int track = m_clicked.track; + int group = m_clicked.group; + int entry = m_clicked.entry; + if ( m_clicked.type == TimeTableType.vsq ) { + m_edit_mode = EditMode.None; + } else if ( m_clicked.type == TimeTableType.telop ) { + m_slide_moved = false; + m_dragging = m_clicked; + if ( m_clicked.entry < 0 ) { + int id = AppManager.SaveData.GetNextID(); + m_editing_telop_original = new Telop( id ); + m_editing_telop_original.Text = "(none)"; + m_editing_telop_original.Start = SecFromXCoord( e.X ); + m_editing_telop_original.End = m_editing_telop_original.Start; + m_editing_telop_original.Lane = m_clicked.track; + Command run2 = Command.GCommandAddTelop( m_editing_telop_original ); + AppManager.SaveData.Execute( run2 ); + m_edit_mode = EditMode.Dragging; + } else { + m_editing_telop_original = (Telop)AppManager.SaveData[m_clicked.entry].Clone(); + m_edit_mode = EditMode.Sliding; + } + } else { + m_editing_group = null; + m_editing_group = (TimeTableGroup)AppManager.SaveData[m_clicked.type, m_clicked.group].Clone(); + m_dragging = new Item( m_clicked.type, m_clicked.group, m_clicked.track, m_clicked.entry, m_clicked.row_index ); + m_slide_moved = false; + if ( m_clicked.entry < 0 ) { + // 繧ィ繝ウ繝医Μ霑ス蜉繝「繝シ繝 + m_edit_mode = EditMode.Dragging; + } else { + // 繧ィ繝ウ繝医Μ繧ケ繝ゥ繧、繝峨Δ繝シ繝 + m_edit_mode = EditMode.Sliding; + UpdateExpandRange( SecFromXCoord( e.X ) ); + if ( m_clicked.type != TimeTableType.vsq ) { + m_slide_original = (TimeTableEntry)AppManager.SaveData[m_clicked.type, group][track][entry].Clone(); + } + } + } + } + } + } + + private void pictureBox1_MouseDoubleClick( object sender, MouseEventArgs e ) { + if ( m_edit_mode == EditMode.None ) { + Item clicked = GetGroupItem( e.X + m_startToDrawX, e.Y + m_startToDrawY ); + if ( clicked.type == TimeTableType.top ) { + float time = SecFromXCoord( e.X ); + int nof = (int)(time * AppManager.SaveData.FrameRate); + if ( previewer.TrackBarMinimum <= nof && nof <= previewer.TrackBarMaximum ) { + previewer.TrackBarValue = nof; + correctPosition(); + this.Invalidate(); + } + } else if ( clicked.track < 0 ) { + if ( clicked.type == TimeTableType.telop ) { + AppManager.SaveData.TelopListFolded = !AppManager.SaveData.TelopListFolded; + SetVScrollRange(); + Invalidate(); + } else { + if ( AppManager.SaveData[clicked.type, clicked.group] != null ) { + AppManager.SaveData[clicked.type, clicked.group].Folded = !AppManager.SaveData[clicked.type, clicked.group].Folded; + SetVScrollRange(); + this.Invalidate(); + } + } + } + } else { + Item clicked = GetGroupItem( e.X + m_startToDrawX, e.Y + m_startToDrawY ); + if ( clicked.entry >= 0 ) { + m_clicked = clicked; + h_editEntry( this, new EventArgs() ); + } + } + } + + private void pictureBox1_MouseUp( object sender, MouseEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "pictureBox1_MouseUp" ); + Common.DebugWriteLine( " m_slide_moved=" + m_slide_moved ); +#endif + if ( m_edit_mode == EditMode.EditingLeft || m_edit_mode == EditMode.EditingRight/* m_editEntry*/ ) { + #region EditMode.EditingLeft EditMode.EditRight + int x = e.X; + + float time = SecFromXCoord( x ); + float new_begin; + float new_end; + + TimeTableType type = m_edit_handle_ed_item.type; + int group = m_edit_handle_ed_item.group; + int track = m_edit_handle_ed_item.track; + int entry = m_edit_handle_ed_item.entry; +#if DEBUG + Common.DebugWriteLine( "pictureBox1_MouseUp; m_edit_mode==EditingLeft||EditingRight;" ); + Common.DebugWriteLine( "type=" + type + "; group=" + group + "; track=" + track + "; entry=" + entry ); +#endif + if ( track < 0 || entry < 0 ) { + AppManager.SaveData[type, group] = null; + AppManager.SaveData[type, group] = (TimeTableGroup)m_editing_group.Clone(); + return; + } + + if ( type == TimeTableType.telop ) { + new_begin = AppManager.SaveData[entry].Start; + new_end = AppManager.SaveData[entry].End; + } else if ( type != TimeTableType.vsq ) { + new_begin = m_editing_group[track][entry].begin; + new_end = m_editing_group[track][entry].end; + } else { + m_edit_mode = EditMode.None; + return; + } + + TimeTableEntry item; + if ( new_end <= new_begin ) { + // 邨ゆコ譎ょ綾縺ィ縺励※髢句ァ区凾蛻サ縺ィ蜷後§縺句ー上&縺譎ょ綾繧呈欠螳壹&繧後◆蝣エ蜷医ゅお繝ウ繝医Μ繧貞炎髯、 + if ( type == TimeTableType.telop ) { + Command run = Command.GCommandDeleteTelop( AppManager.SaveData[entry] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } else if ( type != TimeTableType.vsq ) { + int g = group; + if ( type != TimeTableType.character ) { + g = -1; + } + Command run = Command.GCommandDeleteTimeTableEntry( type, g, track, AppManager.SaveData[type, group][track][entry] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + AppManager.Edited = true; + this.Invalidate(); + m_edit_mode = EditMode.None; + return; + } + if ( type == TimeTableType.telop ) { + Telop edited = (Telop)AppManager.SaveData[entry].Clone(); + AppManager.SaveData[entry] = m_editing_telop_original; + Command run = Command.GCommandEditTelop( entry, edited ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } else if ( type != TimeTableType.vsq ) { + item = (TimeTableEntry)m_editing_group[track][entry].Clone(); + item.begin = new_begin; + item.end = new_end; + if ( type != TimeTableType.character ) { + group = -1; + } + Command run = Command.GCommandEditGroup( type, group, AppManager.SaveData[type, group] ); + AppManager.SaveData[type, group] = (TimeTableGroup)m_editing_group.Clone(); + AppManager.Register( AppManager.SaveData.Execute( run ) ); +#if DEBUG + Common.DebugWriteLine( "Command run & registered" ); +#endif + } else { + m_edit_mode = EditMode.None; + return; + } + pictureBox1.Cursor = Cursors.Arrow; + AppManager.Edited = true; + m_rcHilight = GetHilightRect( e.X, e.Y ); + this.Invalidate(); + m_edit_mode = EditMode.None; + #endregion + } else if ( m_edit_mode == EditMode.Dragging ) { + #region EditMode.Dragging + m_edit_mode = EditMode.None; + TimeTableType type = m_dragging.type; + int group = m_dragging.group; + int track = m_dragging.track; + if ( type == TimeTableType.telop ) { + Telop added = null; + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + if ( AppManager.SaveData.m_telop_ex2[i].ID == m_editing_telop_original.ID ) { + added = (Telop)AppManager.SaveData.m_telop_ex2[i].Clone(); + AppManager.SaveData.m_telop_ex2.RemoveAt( i ); + break; + } + } + if ( added != null && m_slide_moved ) { + Telop.DecideLane( AppManager.SaveData.m_telop_ex2 ); + Command run2 = Command.GCommandAddTelop( added ); + Command inv = AppManager.SaveData.Execute( run2 ); + property.Editing = new ZorderItem( inv.telop.Text, ZorderItemType.telop, inv.telop.ID ); + AppManager.Register( inv ); + UpdateEditHandle(); + SetVScrollRange(); + AppManager.Edited = true; + } + } else if ( type != TimeTableType.vsq ) { + int g = group; + if ( type != TimeTableType.character ) { + g = -1; + } + Command run = Command.GCommandEditGroup( type, g, AppManager.SaveData[type, group] ); + AppManager.SaveData[type, group] = null; + AppManager.SaveData[type, group] = (TimeTableGroup)m_editing_group.Clone(); + if ( m_slide_moved ) { + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + m_slide_moved = false; + //timerTimeLine.Enabled = true; + this.Invalidate(); + #endregion + } else if ( m_edit_mode == EditMode.Sliding ) { + #region EditMode.Sliding + TimeTableType type = m_dragging.type; + int group = m_dragging.group; + int track = m_dragging.track; + int entry = m_dragging.entry; + m_edit_mode = EditMode.None; + m_slide_moved = false; + if ( type == TimeTableType.telop ) { + Telop edited = (Telop)AppManager.SaveData[m_editing_telop_original.ID].Clone(); + AppManager.SaveData[m_editing_telop_original.ID] = (Telop)m_editing_telop_original.Clone(); + Command run2 = Command.GCommandEditTelop( edited.ID, edited ); + AppManager.Register( AppManager.SaveData.Execute( run2 ) ); + AppManager.Edited = true; + } else if ( type != TimeTableType.vsq ) { + int g = group; + if ( type != TimeTableType.character ) { + g = -1; + } + Command run = Command.GCommandEditTimeTableEntry( type, g, track, entry, AppManager.SaveData[type, group][track][entry] ); + AppManager.SaveData[type, group][track][entry] = null; + AppManager.SaveData[type, group][track][entry] = (TimeTableEntry)m_slide_original.Clone(); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + //timerTimeLine.Enabled = true; + this.Invalidate(); + #endregion + } + } + + private void pictureBox1_Paint( object sender, PaintEventArgs e ) { + if ( m_skip_paint ) { + return; + } + Graphics g = e.Graphics; + g.Clear( SystemColors.Control ); + + int[] lanes = AppManager.GetTimeLineLanes(); + int height; + bool always_show_vsq = AppManager.Config.FixVsqTrackPosition; + Rectangle clip_for_vsq = new Rectangle(); + if ( always_show_vsq ) { + m_vsq_height = (AppManager.SaveData.m_group_vsq.VisibleTracks + 2) * AppManager.Config.TrackHeight; + clip_for_vsq = new Rectangle( 0, + AppManager.Config.TrackHeight, + pictureBox1.Width, + (AppManager.SaveData.m_group_vsq.VisibleTracks + 1) * AppManager.Config.TrackHeight ); + } + + int total_height = 0; + for ( int lane = 0; lane < lanes.Length; lane++ ) { + total_height += AppManager.Config.TrackHeight; + for ( int i = 2; i <= lanes[lane]; i++ ) { + int y = (i - 1) * AppManager.Config.TrackHeight - m_startToDrawY; + if ( always_show_vsq && lane == 0 ) { + y += m_startToDrawY; + } + Rectangle outline = new Rectangle( 0, total_height + y, pictureBox1.Width, AppManager.Config.TrackHeight ); + if ( i % 2 == 0 ) { + g.FillRectangle( _BRS_TRACKBG_ODD, outline ); + } else { + g.FillRectangle( _BRS_TRACKBG_EVEN, outline ); + } + } + if ( always_show_vsq && lane == 0 ) { + g.ExcludeClip( clip_for_vsq ); + } + if ( lanes[lane] >= 2 ) { + total_height += (lanes[lane] - 1) * AppManager.Config.TrackHeight; + } + } + + // 蟆冗ッ豈弱ョ邱 + g.ResetClip(); + if ( menuVisualBars.Checked ) { + IEnumerable blte = AppManager.SaveData.GetBarLineTypeEnumerator( AppManager.Config.QuantizeMode, AppManager.Config.QuantizeTripletEnabled ); + foreach ( BarLineType barsec in blte ) { + int x = (int)(barsec.Time * AppManager.Config.PixelPerSec) - m_startToDrawX; + if ( x > pictureBox1.Width ) { + break; + } else if ( 0 < x ) { + if ( barsec.IsSeparator ) { + g.DrawLine( new Pen( Color.FromArgb( 161, 157, 136 ) ), + new Point( x, 0 ), + new Point( x, pictureBox1.Height ) ); + } else { + g.DrawLine( new Pen( Color.FromArgb( 209, 204, 172 ) ), + new Point( x, 0 ), + new Point( x, pictureBox1.Height ) ); + } + } + } + } + + g.ExcludeClip( clip_for_vsq ); + total_height = AppManager.Config.TrackHeight; + if ( !always_show_vsq ) { + DrawTimeTableGroup( g, + new Point( 0, total_height - m_startToDrawY ), + out height, + AppManager.SaveData.m_group_vsq, + _( "VSQ Tracks" ) ); + total_height += height; + } else { + total_height = m_vsq_height; + } + + for ( int i = 0; i < AppManager.SaveData.m_groups_character.Count; i++ ) { + DrawTimeTableGroup( g, + new Point( 0, total_height - m_startToDrawY ), + out height, + AppManager.SaveData.m_groups_character[i], + _( "Character" ) + "(" + AppManager.SaveData.m_groups_character[i].Character.Name + ")" ); + total_height += height; + } + + DrawTelop( g, + new Point( 0, total_height - m_startToDrawY ), + out height, + _( "Telop" ) ); + total_height += height; + + DrawTimeTableGroup( g, + new Point( 0, total_height - m_startToDrawY ), + out height, + AppManager.SaveData.m_group_another, + _( "Another Images" ) ); + total_height += height; + + DrawTimeTableGroup( g, + new Point( 0, total_height - m_startToDrawY ), + out height, + AppManager.SaveData.m_group_plugin, + _( "Plugin" ) ); + + if ( always_show_vsq ) { + g.ResetClip(); + DrawTimeTableGroup( g, + new Point( 0, AppManager.Config.TrackHeight ), + out height, + AppManager.SaveData.m_group_vsq, + _( "VSQ Tracks" ) ); + total_height += height; + } + + // 逕サ髱「縺ォ荳螳壽凾髢薙#縺ィ縺ョ繝ゥ繧、繝ウ繧貞シ輔¥ + g.FillRectangle( new SolidBrush( TOOL_COLOR ), 0, 0, pictureBox1.Width, AppManager.Config.TrackHeight ); + // 繝ェ繝斐シ繝医お繝ェ繧「繧貞挨濶イ縺ァ謠上¥ + g.FillRectangle( new SolidBrush( REPEAT_AREA ), + new Rectangle( (int)(RepeatStart * AppManager.Config.PixelPerSec - m_startToDrawX), + 0, + (int)((RepeatEnd - RepeatStart) * AppManager.Config.PixelPerSec), + AppManager.Config.TrackHeight ) ); + int start_to_draw_x = m_startToDrawX; + int start_sec = (int)((double)(start_to_draw_x) / AppManager.Config.PixelPerSec) / AppManager.Config.TimeLineInterval; + if ( start_sec == 0 ) { + start_sec = 1; + } + int end_sec = (int)((double)(start_to_draw_x + pictureBox1.Width) / AppManager.Config.PixelPerSec) / AppManager.Config.TimeLineInterval + 1; + for ( int i = start_sec; i <= end_sec; i++ ) { + int x = (int)(i * AppManager.Config.TimeLineInterval * AppManager.Config.PixelPerSec) - start_to_draw_x; + g.DrawString( i * AppManager.Config.TimeLineInterval + " sec", + AppManager.Config.Font.GetFont(), + Brushes.Black, + new Point( x, AppManager.Config.VerticalStringOffset ) ); + g.DrawLine( new Pen( Color.FromArgb( 128, Color.Black ) ), + new Point( x, 0 ), new Point( x, pictureBox1.Height ) ); + } + + if ( m_edit_mode == EditMode.Selected/* m_editMode*/ ) { + g.DrawRectangle( HILIGHT_EDIT, m_rcHilight ); + } else { + g.DrawRectangle( HILIGHT, m_rcHilight ); + } + + // 繧ォ繝シ繧ス繝ォ菴咲スョ縺ォ邵ヲ邱 + int cursor; + float now = Now; + if ( menuVisualSync.Checked && AppManager.Config.SyncAtCentre ) { + float w = pictureBox1.Width / 2 / AppManager.Config.PixelPerSec; + if ( now < w || AppManager.SaveData.m_totalSec - w < now ) { + cursor = (int)(now * AppManager.Config.PixelPerSec - m_startToDrawX); + } else { + cursor = pictureBox1.Width / 2; + } + } else { + cursor = (int)(now * AppManager.Config.PixelPerSec - m_startToDrawX); + } + g.DrawLine( new Pen( Color.Black, 2.0f ), new Point( cursor, 0 ), new Point( cursor, pictureBox1.Height ) ); + g.DrawLine( + Pens.Black, + new Point( m_mousePosition.X, 0 ), + new Point( m_mousePosition.X, pictureBox1.Height ) ); + + if ( always_show_vsq ) { + g.DrawLine( new Pen( Color.Black, 2 ), + new Point( 0, m_vsq_height ), + new Point( pictureBox1.Width, m_vsq_height ) ); + } + } + #endregion + + private void preview_image_MouseLeave( object sender, EventArgs e ) { + TimeSpan ts = DateTime.Now.Subtract( m_preview_time ); + if ( ts.TotalMilliseconds > 200 ) { + preview_image.Visible = false; + } + } + + #region menuHelp + private void menuHelpDebugExtract_Click( object sender, EventArgs e ) { +#if DEBUG + /* using ( OpenFileDialog dlg = new OpenFileDialog() ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + string file = dlg.FileName; + string dir = Path.GetDirectoryName( file ); + string fname = Path.GetFileNameWithoutExtension( file ); + float scale = 0.45f; + using ( Character3 chara = new Character3( file ) ) { + foreach ( ImageEntry img in chara ) { + float width = img.image.Width;// * scale; + float height = img.image.Height;// *scale; + //using ( Bitmap t = new Bitmap( (int)width, (int)height, PixelFormat.Format32bppArgb ) ) + //using ( Graphics g = Graphics.FromImage( t ) ) { + //g.InterpolationMode = InterpolationMode.HighQualityBicubic; + //g.DrawImage( img.image, 0f, 0f, width, height ); + img.image.Save( Path.Combine( dir, fname + "_" + img.title + ".png" ) ); + //} + } + } + } + } +*/ +#endif + } + + private void menuHelpBugReport_Click( object sender, EventArgs e ) { + BugReport dlg = new BugReport(); + dlg.Show(); + } + + private void menuHelpDebugEditCharacter_Click( object sender, EventArgs e ) { +#if DEBUG + +#endif + } + + private void menuHelpDebugInverseImages_Click( object sender, EventArgs e ) { +#if DEBUG + +#endif + } + + private static string GetAssemblyNameAndVersion( Type t ) { + Assembly a = Assembly.GetAssembly( t ); + AssemblyFileVersionAttribute afva = (AssemblyFileVersionAttribute)Attribute.GetCustomAttribute( a, typeof( AssemblyFileVersionAttribute ) ); + return a.GetName().Name + " v" + afva.Version; + } + + /// + /// 繝舌シ繧ク繝ァ繝ウ諠蝣ア繧定。ィ遉コ + /// + /// + /// + private void menuHelpVersionInfo_Click( object sender, EventArgs e ) { + if ( m_version_form == null ) { + string version_str = AppManager.VERSION + "\n\n" + + GetAssemblyNameAndVersion( typeof( Boare.Lib.AppUtil.Misc ) ) + "\n" + + GetAssemblyNameAndVersion( typeof( Boare.Lib.Media.AviWriterVcm ) ) + "\n" + + GetAssemblyNameAndVersion( typeof( Boare.Lib.Vsq.VsqFile ) ) + "\n" + +#if DEBUG + GetAssemblyNameAndVersion( typeof( Boare.Lib.Swf.SwfWriter ) ) + "\n" + +#endif + GetAssemblyNameAndVersion( typeof( bocoree.math ) ); + m_version_form = new Boare.Lib.AppUtil.VersionInfo( _( "LipSync" ), version_str ); + m_version_form.Font = AppManager.Config.Font.GetFont(); + m_version_form.AuthorList = m_credit; + m_version_form.AppNameColor = Color.RoyalBlue; + m_version_form.VersionColor = Color.DimGray; +#if !DEBUG + m_version_form.Credit = AppManager.author_list; +#endif + m_version_form.FormClosed += new FormClosedEventHandler( m_version_form_FormClosed ); + m_version_form.Show(); + } + } + #endregion + + void m_version_form_FormClosed( object sender, FormClosedEventArgs e ) { + m_version_form.Dispose(); + m_version_form = null; + } + + #region Form1 + private void Form1_Shown( object sender, EventArgs e ) { + m_initialized = true; + ResizePanel2(); + } + + private void Form1_Load( object sender, EventArgs e ) { +#if MONO + Common.DebugWriteLine( "this assembly was compiled under the define of \"NET_2_0\"" ); +#endif + ResizePanel2(); + ApplyFont( AppManager.Config.Font.GetFont() ); + + // 繝励Λ繧ー繧、繝ウ繧定ェュ縺ソ霎シ縺ソ + //繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺繧九励Λ繧ー繧、繝ウ繧定ェソ縺ケ繧 + //縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ繧ッ繝ゥ繧ケ縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧剃ス懈舌☆繧 + AppManager.SaveData.m_plugins = PluginInfo.FindPlugins(); + + AppManager.SaveData.m_group_plugin = new TimeTableGroup( _( "Plugin" ), -1, null ); + + AppManager.SaveData.m_plugins_config = new List(); + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + AppManager.SaveData.m_plugins_config.Add( new PluginConfig( AppManager.SaveData.m_plugins[i].Instance.Name, AppManager.SaveData.m_plugins[i].Instance.Config, Path.GetFileName( AppManager.SaveData.m_plugins[i].Location ) ) ); + AppManager.SaveData.m_group_plugin.Add( new TimeTable( AppManager.SaveData.m_plugins_config[i].ID, 0, TimeTableType.plugin, null ) ); + } + + /* + * 繝励Λ繧ー繧、繝ウ縺ョ遞ョ鬘槭↓蠢懊§縺ヲ縲√Γ繧、繝ウ繝。繝九Η繝シ繧呈峩譁ー + */ + // 繝励Λ繧ー繧、繝ウ險ュ螳 + if ( AppManager.SaveData.m_plugins.Length > 0 ) { + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + if ( (AppManager.SaveData.m_plugins[i].Instance.Type & Plugin.Constants.LS_NO_EVENT_HANDLER) != Plugin.Constants.LS_NO_EVENT_HANDLER ) { + menuToolPluginConfig.DropDownItems.Add( AppManager.SaveData.m_plugins_config[i].ID, null, new EventHandler( h_pluginSetting ) ); + } + } + } + + // 繝励Λ繧ー繧、繝ウ縺ョ諠蝣ア + menuHelpPluginInfo.DropDownItems.Clear(); + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + menuHelpPluginInfo.DropDownItems.Add( AppManager.SaveData.m_plugins[i].Instance.Name, null, new EventHandler( h_pluginInfo ) ); + } + + AppManager.SaveData.m_group_vsq = new TimeTableGroup( _( "VSQ Tracks" ), -1, null ); + AppManager.SaveData.m_groups_character = new List(); + AppManager.SaveData.m_group_another = new TimeTableGroup( _( "Another images" ), -1, null ); + SettingsEx.CommandExecuted += new CommandExecutedEventHandler( SettingsEx_CommandExecuted ); + + AppManager.SaveData.m_screenWidth = this.Width; + AppManager.SaveData.m_screenHeight = this.Height; + + AppManager.Edited = false; + + if ( m_filePath != "" ) { + Read( m_filePath ); + } + SetHScrollRange(); + SetVScrollRange(); + + AppManager.SaveData.UpdateZorder(); + + preview_image.Parent = pictureBox1; + + QuantizeMenuCheckedStateUpdate(); + UpdateGridList(); + + property.PropertyValueChanged += new PropertyValueChangedEventHandler( property_PropertyValueChanged ); + property.TelopAdding += new TelopAddingEventHandler( property_TelopAdding ); + property.EditingItemChanged += new EditingItemChangedEventHandler( property_EditingItemChanged ); + property.TelopDeleting += new TelopDeletingEventHandler( property_TelopDeleting ); + property.ListUpdateRequired += new ListUpdateRequiredEventHandler( UpdateObjectList ); + property.UpdateLayout(); + + previewer.Image = new Bitmap( AppManager.SaveData.m_movieSize.Width, AppManager.SaveData.m_movieSize.Height ); + using ( Graphics g = Graphics.FromImage( previewer.Image ) ) { + AppManager.SaveData.DrawTo( g, new Size( AppManager.SaveData.m_movieSize.Width, AppManager.SaveData.m_movieSize.Height ), 0.0f, false ); + } + +#if DEBUG + FormCommandHistory fch = new FormCommandHistory(); + fch.Show(); +#endif + } + + private void Form1_FormClosing( object sender, FormClosingEventArgs e ) { + if ( AppManager.Edited ) { + //MessageBox.Show( "Form1_FormClosing" ); + DialogResult result = requestIntention(); + switch ( result ) { + case DialogResult.Yes: + if ( m_filePath == "" ) { + if ( saveFileDialog1.ShowDialog() == DialogResult.OK ) { + m_filePath = saveFileDialog1.FileName; + Save( m_filePath ); + } else { + return; + } + } else { + Save( m_filePath ); + } + break; + case DialogResult.Cancel: + e.Cancel = true; + return; + } + } + if ( m_player != null ) { + m_player.Stop(); + m_player.Close(); + } + if ( m_preview_thread != null ) { + m_preview_thread.Abort(); + while ( m_preview_thread.IsAlive ) { + Application.DoEvents(); + } + } + SaveConfig(); + } + + private void Form1_DragEnter( object sender, DragEventArgs e ) { + e.Effect = DragDropEffects.All; + } + + private void Form1_DragDrop( object sender, DragEventArgs e ) { + if ( e.Data.GetDataPresent( DataFormats.FileDrop ) ) { + string[] filename = (string[])e.Data.GetData( DataFormats.FileDrop ); + if ( Path.GetExtension( filename[0] ).ToLower() == ".vsq" || Path.GetExtension( filename[0] ).ToLower() == ".ust" ) { + // vsq繝輔ぃ繧、繝ォ + ReadVsq( filename[0] ); + } else if ( Path.GetExtension( filename[0] ).ToLower() == ".lse" ) { + // LipSync Editor繝輔ぃ繧、繝ォ + Read( filename[0] ); + m_filePath = filename[0]; + UpdateFormTitle(); + SetHScrollRange(); + SetVScrollRange(); + //rebuildDrawing(); + this.Invalidate(); + } + } + } + + private void Form1_Paint( object sender, PaintEventArgs e ) { + if ( m_skip_paint ) { + return; + } + float now; + if ( !AviWriting && !AppManager.Config.PreviewHidden ) { +#if OBSOLETE_MODE + if ( PreviewP.Image != null ) { + PreviewP.Image.Dispose(); + } + PreviewP.Image = getPicture( now ); +#endif + //PreviewP.Refresh(); + //previewer.Preview.Invalidate(); + } + + float speed = m_player.Speed; + previewer.LabelSpeedText = "x" + speed.ToString( "0.00" ); + + pictureBox1.Refresh(); + side.Refresh(); + } + + private void Form1_LocationOrSizeChanged( object sender, EventArgs e ) { + if ( AppManager.Config != null ) { + if ( this.WindowState == FormWindowState.Normal ) { + AppManager.Config.WindowPosition = this.Bounds; + } + AppManager.Config.WindowIsMaximized = (this.WindowState == FormWindowState.Maximized); + } + } + + private void Form1_Activated( object sender, EventArgs e ) { + m_edit_mode = EditMode.None; + } + + private void Form1_Deactivate( object sender, EventArgs e ) { + m_edit_mode = EditMode.None; + } + #endregion + + #region bgWorkAvi + private void bgWorkAvi_DoWork( object sender, DoWorkEventArgs e ) { + IAviWriter writer = null; + AviOutputArguments args = (AviOutputArguments)e.Argument; + if ( File.Exists( args.AviFile ) ) { + File.Delete( args.AviFile ); + } + Size size = AppManager.SaveData.m_movieSize; + m_avi_cancel = false; + + long start_frame; + if ( args.StartSpecified ) { + start_frame = (long)(args.Start * AppManager.SaveData.FrameRate); + } else { + start_frame = 0L; + } + + long end_frame; + if ( args.EndSpecified ) { + end_frame = (long)(args.End * AppManager.SaveData.FrameRate); + } else { + end_frame = (long)((AppManager.SaveData.m_totalSec) * AppManager.SaveData.FrameRate); + } + long total_frames = end_frame - start_frame + 1; +#if !DEBUG + try { +#endif + Bitmap bmp = null; + if ( args.UseVfwEncoder ) { + bmp = new Bitmap( size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb ); + AviWriterVfw awvfw = new AviWriterVfw(); + bool ret = awvfw.Open( args.AviFile, + AppManager.SaveData.DwScale, + AppManager.SaveData.DwRate, + size.Width, + size.Height, + Process.GetCurrentProcess().MainWindowHandle ); + if ( !ret ) { + return; + } + writer = awvfw; + } else { + bmp = args.IsTransparent ? + new Bitmap( size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) : + new Bitmap( size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb ); + AviWriterVcm awvcm = new AviWriterVcm(); + bool ret = awvcm.Open( args.AviFile, + AppManager.SaveData.DwScale, + AppManager.SaveData.DwRate, + size.Width, + size.Height, + !m_is_rawmode, + args.IsTransparent, + Process.GetCurrentProcess().MainWindowHandle ); + if ( !ret ) { + return; + } + writer = awvcm; + } + using ( Graphics g = Graphics.FromImage( bmp ) ) { + for ( long frame = start_frame; frame <= end_frame; frame++ ) { + float now = (float)frame / AppManager.SaveData.FrameRate; + using ( Bitmap frm = GetPicture( now, args.IsTransparent ) ) { + frm.RotateFlip( RotateFlipType.Rotate180FlipX ); + g.DrawImage( frm, 0, 0, size.Width, size.Height ); + } + try { + writer.AddFrame( bmp ); + } catch ( Exception ex ) { +#if DEBUG + Common.LogPush( ex ); +#endif + writer.Close(); + this.Invoke( new Form1_AviWritingChange( ChangeAviWriting ), new object[] { false } ); + return; + } + bgWorkAvi.ReportProgress( (int)((double)(frame - start_frame) / (double)(total_frames) * 100.0), new long[] { frame - start_frame, total_frames } ); + if ( m_avi_cancel ) { + bmp.Dispose(); + g.Dispose(); + writer.Close(); + m_avi_cancel = false; + return; + } + } + writer.Close(); + + string audio_file = AppManager.SaveData.m_audioFile; + +#if DEBUG + Common.DebugWriteLine( "bgWorkAvi_DoWork" ); + Common.DebugWriteLine( " args.IsWaveMergeRequired=" + args.IsWaveMergeRequired ); +#endif + if ( args.IsWaveMergeRequired ) { + #region merge wave file + if ( File.Exists( audio_file ) && AppManager.Config.PathFFmpeg != "" && File.Exists( AppManager.Config.PathFFmpeg ) ) { + string tmp_avi = Misc.GetTempFileNameIn( Path.GetDirectoryName( args.AviFile ), ".avi" ); + File.Move( args.AviFile, tmp_avi ); + // ffmpeg -i movie.mpeg -i audio.wav combined.avi + long frames = end_frame - start_frame + 1; + m_ffmpeg = new Process(); + m_ffmpeg.StartInfo.FileName = "\"" + AppManager.Config.PathFFmpeg + "\""; + m_ffmpeg.StartInfo.Arguments = "-i \"" + audio_file + "\" -i \"" + tmp_avi + "\" -vframes " + frames + " -vcodec copy -acodec copy \"" + args.AviFile + "\""; +#if DEBUG + Common.DebugWriteLine( " m_ffmpeg.StarInfo.Arguments=" + m_ffmpeg.StartInfo.Arguments ); +#endif + m_ffmpeg.StartInfo.CreateNoWindow = true; + m_ffmpeg.StartInfo.UseShellExecute = false; + m_ffmpeg.StartInfo.RedirectStandardError = true; + m_ffmpeg.Start(); + + this.m_stdout = new Thread( new ParameterizedThreadStart( this.FFMpegOutputRead ) ); + this.m_stdout.Name = "output_ffmpeg"; + this.m_stdout.Start( end_frame - start_frame ); + m_ffmpeg.WaitForExit(); + if ( args.IsDeleteIntermediateRequired ) { + File.Delete( tmp_avi ); + } + } + #endregion + } + + if ( args.IsFlvEncodeRequired && AppManager.Config.PathMEncoder != "" && File.Exists( AppManager.Config.PathMEncoder ) ) { + #region encode flv + //string flv_file = @"C:\test.flv"; + string flv_file = Path.Combine( Path.GetDirectoryName( args.AviFile ), Path.GetFileNameWithoutExtension( args.AviFile ) + ".flv" ); + string arguments = "\"" + args.AviFile + "\" -of lavf -lavfopts format=flv -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:ss:aiv:umv:preme=2:mv0:qprd:trell:v4mv:cbp -oac mp3lame -lameopts abr:br=128 -vf scale=" + size.Width + ":" + size.Height + " -sws 9 -af resample=44100 -o \"" + flv_file + "\""; + m_mencoder = new Process(); + m_mencoder.StartInfo.FileName = "\"" + AppManager.Config.PathMEncoder + "\""; + m_mencoder.StartInfo.Arguments = arguments; + m_mencoder.StartInfo.CreateNoWindow = true; + m_mencoder.StartInfo.UseShellExecute = false; + m_mencoder.StartInfo.RedirectStandardOutput = true; + m_mencoder.Start(); + + m_stdout = new Thread( new ParameterizedThreadStart( this.MEncoderOutputRead ) ); + m_stdout.Name = "stdout_mencoder"; + m_stdout.Start( end_frame - start_frame ); + + m_mencoder.WaitForExit(); + + if ( args.IsDeleteIntermediateRequired ) { + File.Delete( args.AviFile ); + } + + #endregion + } else if ( args.IsMp4EncodeRequired && AppManager.Config.PathFFmpeg != "" && File.Exists( AppManager.Config.PathFFmpeg ) ) { + #region encode mp4 + try { + // ffmpeg -i teaser8000k1280_720_3.avi -r 24 -s 512x288 -refs 1 -bf 2 -flags2 dct8x8 -partitions parti8x8+partp8x8+partb8x8 -sc_threshold 50 -qpel -trell -me hex -directpred 3 -bufsize 128 -b 472k -bt 472k -mbd 2 -preme 2 -f mp4 -vcodec libx264 -an -pass 1 -passlogfile "passlog" enc.mp4 + // ffmpeg -i teaser8000k1280_720_3.avi -r 24 -s 512x288 -refs 1 -bf 2 -flags2 dct8x8 -partitions parti8x8+partp8x8+partb8x8 -sc_threshold 50 -qpel -trell -me hex -directpred 3 -bufsize 128 -b 472k -bt 472k -mbd 2 -preme 2 -ab 64k -f mp4 -vcodec libx264 -acodec libfaac -pass 2 -passlogfile "passlog" enc.mp4 + string mp4_file = Path.Combine( Path.GetDirectoryName( args.AviFile ), Path.GetFileNameWithoutExtension( args.AviFile ) + ".mp4" ); + string arguments = ""; + string work_dir = Path.Combine( Application.StartupPath, "temp" ); + if ( !Directory.Exists( work_dir ) ) { + Directory.CreateDirectory( work_dir ); + } + + // first pass + arguments = "-i \"" + args.AviFile + "\" -refs 1 -bf 2 -flags2 dct8x8 -partitions parti8x8+partp8x8+partb8x8 -sc_threshold 40 -qpel -trell -me hex -directpred 3 -bufsize 128 -b 472k -bt 472k -mbd 2 -preme 2 -f mp4 -vcodec libx264 -an -pass 1 -passlogfile \"passlog\" -y \"" + mp4_file + "\""; +#if DEBUG + Common.DebugWriteLine( "1st pass arguments=" + arguments ); +#endif + m_ffmpeg = new Process(); + m_ffmpeg.StartInfo.WorkingDirectory = work_dir; + m_ffmpeg.StartInfo.FileName = "\"" + AppManager.Config.PathFFmpeg + "\""; + m_ffmpeg.StartInfo.Arguments = arguments; + m_ffmpeg.StartInfo.CreateNoWindow = true; + m_ffmpeg.StartInfo.UseShellExecute = false; + m_ffmpeg.StartInfo.RedirectStandardError = true; + m_ffmpeg.Start(); + this.m_stdout = new Thread( new ParameterizedThreadStart( this.FFMpegOutputRead ) ); + this.m_stdout.Name = "output_ffmpeg"; + this.m_stdout.Start( end_frame - start_frame ); + m_ffmpeg.WaitForExit(); + + // 2nd pass + arguments = "-i \"" + args.AviFile + "\" -refs 1 -bf 2 -flags2 dct8x8 -partitions parti8x8+partp8x8+partb8x8 -sc_threshold 40 -qpel -trell -me hex -directpred 3 -bufsize 128 -b 472k -bt 472k -mbd 2 -preme 2 -ab 64k -f mp4 -vcodec libx264 -acodec libfaac -pass 2 -passlogfile \"passlog\" -y \"" + mp4_file + "\""; +#if DEBUG + Common.DebugWriteLine( "2nd pass arguments=" + arguments ); +#endif + m_ffmpeg = new Process(); + m_ffmpeg.StartInfo.WorkingDirectory = work_dir; + m_ffmpeg.StartInfo.FileName = "\"" + AppManager.Config.PathFFmpeg + "\""; + m_ffmpeg.StartInfo.Arguments = arguments; + m_ffmpeg.StartInfo.CreateNoWindow = true; + m_ffmpeg.StartInfo.UseShellExecute = false; + m_ffmpeg.StartInfo.RedirectStandardError = true; + m_ffmpeg.Start(); + this.m_stdout = new Thread( new ParameterizedThreadStart( this.FFMpegOutputRead ) ); + this.m_stdout.Name = "output_ffmpeg"; + this.m_stdout.Start( end_frame - start_frame ); + m_ffmpeg.WaitForExit(); + } catch ( Exception ex ) { +#if DEBUG + Common.DebugWriteLine( ex.ToString() ); +#endif + } + #endregion + } + + } + + + //mencoder test.avi -of lavf -lavfopts format=flv -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:ss:aiv:umv:preme=2:mv0:qprd:trell:v4mv:cbp -oac mp3lame -lameopts abr:br=128 -passlogfile pass.log -vf scale=512:384 -sws 9 -af resample=44100 -o test.flv +#if !DEBUG + } catch { + writer.Close(); + MessageBox.Show( + _( "Initialization of video compression failed.\nThis video codec may require image width in multiples of certain number." ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation + ); + } +#endif + } + + private void bgWorkAvi_ProgressChanged( object sender, ProgressChangedEventArgs e ) { + long[] stat = (long[])e.UserState; + this.Text = _( "AVI Progress" ) + " " + e.ProgressPercentage + "% [" + stat[0] + "/" + stat[1] + "]"; + } + + private void bgWorkAvi_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e ) { + this.Invoke( new Form1_AviWritingChange( ChangeAviWriting ), new object[] { false } ); + m_avi_cancel = false; + UpdateFormTitle(); + } + #endregion + + #region menuEdit + /// + /// 繧ュ繝」繝ウ繝舌せ閭梧勹濶イ縺ョ螟画峩 + /// + /// + /// + private void menuEditBGColor_Click( object sender, EventArgs e ) { + colorDialog1.Color = AppManager.SaveData.CANVAS_BACKGROUND; + if ( colorDialog1.ShowDialog() == DialogResult.OK ) { + Command run = Command.GCommandChangeBackgroundColor( colorDialog1.Color ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + this.Invalidate(); + } + } + + private void menuEditAddCharacter_Click( object sender, EventArgs e ) { + List plugins = new List(); + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + if ( (AppManager.SaveData.m_plugins[i].Instance.Type & Plugin.Constants.LS_TYPE_CHARACTER) == Plugin.Constants.LS_TYPE_CHARACTER ) { + plugins.Add( AppManager.SaveData.m_plugins_config[i].ID ); + } + } + using ( SelectCharacater sc = new SelectCharacater( plugins ) ) { + if ( sc.ShowDialog() == DialogResult.OK ) { + using ( TimeTable tempo = new TimeTable( "", 0, TimeTableType.vsq, null ) ) { + GenerateLipsyncFromVsq( tempo, sc.Character, true ); + } + AppManager.Edited = true; + AppManager.Config.LastCharacterPath = sc.Path; + UpdateObjectList(); + SetVScrollRange(); + this.Invalidate(); + } + } + } + + private void menuEditVideoLength_Click( object sender, EventArgs e ) { + using ( InputBox box = new InputBox( _( "Video size configuration" ), _( "Input video length in second" ) ) ) { + box.rText = AppManager.SaveData.m_totalSec.ToString(); + if ( box.ShowDialog() == DialogResult.OK ) { + float buff = AppManager.SaveData.m_totalSec; + try { + buff = float.Parse( box.rText ); + } catch { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation + ); + buff = AppManager.SaveData.m_totalSec; + } finally { + AppManager.SaveData.m_totalSec = buff; + } + //rebuildDrawing(); + AppManager.Edited = true; + AppManager.SaveData.UpdateZorder(); + SetHScrollRange(); + this.Invalidate(); + } + } + } + + private void menuEditShiftTimeline_Click( object sender, EventArgs e ) { + using ( InputBox ibox = new InputBox( _( "Shift all time-tables" ), _( "Input shift time in second (you can enter minus value)" ) ) ) { + if ( ibox.ShowDialog() == DialogResult.OK ) { + float shift; + try { + shift = float.Parse( ibox.rText ); + } catch { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation + ); + return; + } + Command run = Command.GCommandShiftTimeTable( TimeTableType.whole, -1, shift ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + + private void menuEditFrameRate_Click( object sender, EventArgs e ) { + using ( FormSetFrameRate dlg = new FormSetFrameRate( AppManager.SaveData.DwRate, AppManager.SaveData.DwScale ) ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + uint rate = dlg.DwRate; + uint scale = dlg.DwScale; + if ( rate <= 0 || scale <= 0 ) { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation + ); + } else { +#if DEBUG + Common.DebugWriteLine( "menuEditFrameRate_Click; rate=" + rate + "; scale=" + scale ); +#endif + Command run = Command.GCommandChangeFps( rate, scale ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + ChangeBitrate(); + AppManager.Edited = true; +#if DEBUG + Common.DebugWriteLine( "menuEditFrameRate_Click; s.DwRate=" + AppManager.SaveData.DwRate + "; s.DwScale=" + AppManager.SaveData.DwScale ); +#endif + } + } + } + } + + private void menuEditUndo_Click( object sender, EventArgs e ) { + CommandType next = AppManager.GetNextUndoCommandType(); + AppManager.Undo(); + if ( next == CommandType.changeFps ) { + ChangeBitrate(); + } + UpdateObjectList(); + AppManager.Edited = true; + this.Invalidate(); + } + + private void menuEditRedo_Click( object sender, EventArgs e ) { + CommandType next = AppManager.GetNextRedoCommandType(); + AppManager.Redo(); + if ( next == CommandType.changeFps ) { + ChangeBitrate(); + } + UpdateObjectList(); + AppManager.Edited = true; + this.Invalidate(); + } + + /// + /// + /// + /// + /// + private void menuEditZOrder_Click( object sender, EventArgs e ) { + ZOrder zorder = new ZOrder(); + zorder.Clear(); + int count = 0; + int cur_z = -1; + + #region 繝輔か繝シ繝繧剃ス懈 + + // 縺セ縺壹】繧ェ繝シ繝繝シ繧定ィュ螳壼庄閭ス縺ェ繧ェ繝悶ず繧ァ繧ッ繝医ョ蛟区焚繧呈焚縺医k + // 繝励Λ繧ー繧、繝ウ + count += AppManager.SaveData.m_plugins.Length; + bool[] b_plugins = new bool[AppManager.SaveData.m_group_plugin.Count]; + for ( int i = 0; i < AppManager.SaveData.m_group_plugin.Count; i++ ) { + b_plugins[i] = false; + cur_z = Math.Max( cur_z, AppManager.SaveData.m_group_plugin[i].ZOrder ); + } + // 繧ュ繝」繝ゥ繧ッ繧ソ + count += AppManager.SaveData.m_groups_character.Count; + bool[] b_groups_character = new bool[AppManager.SaveData.m_groups_character.Count]; + for ( int i = 0; i < b_groups_character.Length; i++ ) { + b_groups_character[i] = false; + cur_z = Math.Max( cur_z, AppManager.SaveData.m_groups_character[i].ZOrder ); + } + // 縺昴ョ莉悶ョ繧、繝。繝シ繧ク + count += AppManager.SaveData.m_group_another.Count; + bool[] b_group_another = new bool[AppManager.SaveData.m_group_another.Count]; + for ( int i = 0; i < b_group_another.Length; i++ ) { + b_group_another[i] = false; + cur_z = Math.Max( cur_z, AppManager.SaveData.m_group_another[i].ZOrder ); + } + + //MessageBox.Show( "count=" + count ); + + ZorderItem[] list = new ZorderItem[count]; + int[] eval = new int[count]; + int[] order = new int[count]; + int index = -1; + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + index++; + list[index] = new ZorderItem( AppManager.SaveData.m_plugins_config[i].ID, ZorderItemType.plugin, i ); + eval[index] = AppManager.SaveData.m_group_plugin[i].ZOrder; + } + for ( int i = 0; i < AppManager.SaveData.m_groups_character.Count; i++ ) { + index++; + list[index] = new ZorderItem( AppManager.SaveData.m_groups_character[i].Text, ZorderItemType.character, i ); + eval[index] = AppManager.SaveData.m_groups_character[i].ZOrder; + } + for ( int i = 0; i < AppManager.SaveData.m_group_another.Count; i++ ) { + index++; + list[index] = new ZorderItem( AppManager.SaveData.m_group_another[i].Text, ZorderItemType.another, i ); + eval[index] = AppManager.SaveData.m_group_another[i].ZOrder; + } + + // 荳ヲ縺ケ螟峨∴ + int change = 1; + ZorderItem tmp; + int itemp; + while ( change > 0 ) { + change = 0; + for ( int i = 0; i < count - 1; i++ ) { + if ( eval[i] > eval[i + 1] ) { + tmp = list[i]; + list[i] = list[i + 1]; + list[i + 1] = tmp; + itemp = eval[i]; + eval[i] = eval[i + 1]; + eval[i + 1] = itemp; + change++; + } + } + } + + // ス壹が繝シ繝繝シ縺ョ螟ァ縺阪>繧ゅョ縺九i縲〕istBox1縺ォ逋サ骭イ + for ( int i = 0; i < count; i++ ) { + zorder.itemAdd( list[i] ); + } + #endregion + + //MessageBox.Show( "zorder.Count=" + zorder.Count ); + + if ( zorder.ShowDialog() == DialogResult.OK ) { + + // 繝輔か繝シ繝縺ョ蠢懃ュ斐°繧峨】order繧貞崎ィ育ョ + for ( int i = 0; i < zorder.Count; i++ ) { + AppManager.SaveData.SetZorder( zorder[i], i + 1 ); + } + + AppManager.Edited = true; + AppManager.SaveData.UpdateZorder(); + } + zorder.Dispose(); + } + + private void menuEditRealTime_Click( object sender, EventArgs e ) { + UpdateFormTitle(); + } + + private void menuEdit_DropDownOpening( object sender, EventArgs e ) { + menuEditUndo.Enabled = AppManager.IsUndoAvailable; + menuEditRedo.Enabled = AppManager.IsRedoAvailable; + if ( AppManager.SaveData.m_totalSec <= 0.0f ) { + menuEditShiftTimeline.Enabled = false; + menuEditAddCharacter.Enabled = false; + } else { + menuEditShiftTimeline.Enabled = true; + menuEditAddCharacter.Enabled = true; + } + if ( AppManager.SaveData.m_groups_character.Count == 0 ) { + menuEditRealTime.Enabled = false; + } else { + menuEditRealTime.Enabled = true; + } + menuEditAddCharacter.Enabled = !AppManager.Playing; + } + + private void menuEditVideoSize_Click( object sender, EventArgs e ) { + sizeChange(); + } + + private void menuFileOutputAvi_Click( object sender, EventArgs e ) { + if ( AppManager.Playing ) { + StopMusic(); + } + initializeFirstEntry(); + m_is_rawmode = false; + ShowDialogCore(); + } + + private void menuFileOutputRawAvi_Click( object sender, EventArgs e ) { + if ( AppManager.Playing ) { + StopMusic(); + } + initializeFirstEntry(); + m_is_rawmode = true; + ShowDialogCore(); + } + #endregion + + #region xmenuFile + private void xmenuFileClose_Click( object sender, EventArgs e ) { + if ( AppManager.Edited ) { + //MessageBox.Show( "Form1_FormClosing" ); + DialogResult result = requestIntention(); + switch ( result ) { + case DialogResult.Yes: + if ( m_filePath == "" ) { + if ( saveFileDialog1.ShowDialog() == DialogResult.OK ) { + m_filePath = saveFileDialog1.FileName; + Save( m_filePath ); + } else { + return; + } + } else { + Save( m_filePath ); + } + break; + case DialogResult.Cancel: + return; + } + } + if ( m_player != null ) { + m_player.Stop(); + m_player.Close(); + } + + AppManager.Edited = false; + m_filePath = ""; + UpdateFormTitle(); + ClearExistingData(); + AppManager.ClearCommandBuffer(); + AppManager.SaveData.UpdateZorder(); + this.Invalidate(); + } + + private void xmenuFileOpenVsq_Click( object sender, EventArgs e ) { + // 譌「蟄倥ョ繝医Λ繝繧ッ縺後↑縺縺九←縺縺狗「コ隱阪 + int count = 0; + count += AppManager.SaveData.m_group_vsq.Count; + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + count += AppManager.SaveData.m_groups_character[group].Count; + } + count += AppManager.SaveData.m_group_another.Count; + count += AppManager.SaveData.m_telop_ex2.Count; + if ( count > 0 ) { + if ( MessageBox.Show( + _( "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" ) + "\n\n" + _( "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" ), + _( "Confirmation" ), + MessageBoxButtons.OKCancel, + MessageBoxIcon.Question ) != DialogResult.OK ) { + return; + } + } + + List track_name = new List(); + int tracks; + + // VSQ繝輔ぃ繧、繝ォ繧帝幕縺縺ヲ縲∬ァ」譫 + openVsqDialog.FileName = AppManager.Config.LastVsqPath; + try { + openVsqDialog.Filter = _( "VOCALOID2 Sequence File(*.vsq)|*.vsq" ) + "|" + + _( "UTAU Script File(*.ust)|*.ust" ) + "|" + + _( "All Files(*.*)|*.*" ); + } catch { + openVsqDialog.Filter = "VOCALOID2 Sequence File(*.vsq)|*.vsq|UTAU Script File(*.ust)|*.ust|All Files(*.*)|*.*"; + } + if ( openVsqDialog.ShowDialog() != DialogResult.OK ) { + return; + } + AppManager.Config.LastVsqPath = openVsqDialog.FileName; + + // 譌「蟄倥ョtime table繧堤エ譽 + ClearExistingData(); + tracks = 0; + + if ( openVsqDialog.FilterIndex == 0 || Path.GetExtension( openVsqDialog.FileName ).ToLower() == ".vsq" ) { + // VsqFile繧貞叙蠕 + int most_lyrics_track = 0; // 荳逡ェ豁瑚ゥ槭ョ譁蟄玲焚縺悟、壹°縺」縺溘ヨ繝ゥ繝繧ッ縺ョ逡ェ蜿キ + VsqFile vsqFile = new VsqFile( openVsqDialog.FileName ); + AppManager.SaveData.m_totalSec = (float)vsqFile.getTotalSec(); + + AppManager.SaveData.m_timesig_ex = new List( vsqFile.getTimeSigList().ToArray() ); + AppManager.SaveData.m_tempo = new List( vsqFile.getTempoList().ToArray() ); + AppManager.SaveData.m_base_tempo = vsqFile.getBaseTempo(); + + // 豁瑚ゥ槭ョ蜷ォ縺セ繧後k繝医Λ繝繧ッ謨ー繧貞叙蠕 + { + int most_lyrics = 0; + for ( int i = 0; i < vsqFile.getTrackCount(); i++ ) { + int track_num = vsqFile.getTrack( i ).getLyricLength(); + if ( most_lyrics < track_num ) { + most_lyrics_track = i; + most_lyrics = track_num; + } + if ( track_num > 0 ) { + track_name.Add( vsqFile.getTrack( i ).Name ); + tracks++; + } + } + } + most_lyrics_track--; + + // table繧呈峩譁ー + for ( int track = 0; track < vsqFile.getTrackCount(); track++ ) { + int lyrics = vsqFile.getTrack( track ).getLyricLength(); + if ( lyrics <= 0 ) { + continue; + } + addTimeLineFromTrack( vsqFile, track, false ); + // todo 縺薙ョ霎コ縺縺セ縺剰。後▲縺ヲ縺ェ縺シ + } + + if ( AppManager.Config.GenerateCharacterAutomatically ) { + // 荳逡ェ豁瑚ゥ槭ョ譁蟄玲焚縺悟、壹°縺」縺溘ヨ繝ゥ繝繧ッ縺ョ豁瑚ゥ槭r繧ゅ→縺ォ + // 蜿」縺ョ蜍輔″繧呈アコ繧√k + GenerateLipsyncFromVsq( AppManager.SaveData.m_group_vsq[most_lyrics_track], Character3.Miku, false ); + } + } else { + UstFile ust_file = new UstFile( openVsqDialog.FileName ); + for ( int track = 0; track < ust_file.getTrackCount(); track++ ) { + foreach ( UstEvent ue in ust_file.getTrack( track ).getNoteEventEnumerator() ) { + if ( ue.Lyric == "u" ) { + ue.Lyric = "縺"; + } + } + } + AppManager.SaveData.m_totalSec = (float)ust_file.getTotalSec(); + + AppManager.SaveData.m_timesig_ex = new List(); + AppManager.SaveData.m_timesig_ex.Add( new TimeSigTableEntry( 0, 4, 4, 0 ) ); //todo: bar_count縺ッ髮カシ + AppManager.SaveData.m_tempo = new List( ust_file.getTempoList().ToArray() ); + AppManager.SaveData.m_base_tempo = ust_file.getBaseTempo(); + + // table繧呈峩譁ー + for ( int track = 0; track < ust_file.getTrackCount(); track++ ) { + AddTimeLineFromUst( ust_file, track, false ); + } + + if ( AppManager.Config.GenerateCharacterAutomatically ) { + // 荳逡ェ豁瑚ゥ槭ョ譁蟄玲焚縺悟、壹°縺」縺溘ヨ繝ゥ繝繧ッ縺ョ豁瑚ゥ槭r繧ゅ→縺ォ + // 蜿」縺ョ蜍輔″繧呈アコ繧√k + GenerateLipsyncFromVsq( AppManager.SaveData.m_group_vsq[0], Character3.Miku, false ); + } + } + + // 縺昴ョ縺サ縺九ョ繧、繝。繝シ繧ク繝医Λ繝繧ッ逕ィ縺ョ繧ー繝ォ繝シ繝励r霑ス蜉 + AppManager.SaveData.m_group_another = null; + AppManager.SaveData.m_group_another = new TimeTableGroup( _( "Another images" ), -1, null ); + + // 繧ケ繧ッ繝ェ繝シ繝ウ縺ョシ井サョ諠ウシ峨し繧、繧コ繧呈峩譁ー + SetHScrollRange(); + SetVScrollRange(); + + AppManager.ClearCommandBuffer(); + AppManager.SaveData.UpdateZorder(); + AppManager.Edited = true; + UpdateGridList(); + UpdateObjectList(); + + // 蜀肴緒逕サ繧定ヲ∵ア + this.Invalidate(); + } + + private void xmenuFileOutputAbort_Click( object sender, EventArgs e ) { + if ( !m_avi_cancel ) { + m_avi_cancel = true; + AviWriting = false; + UpdateFormTitle(); + } + } + + private void xmenuFile_DropDownOpening( object sender, EventArgs e ) { + bool value = !AviWriting && AppManager.SaveData.m_totalSec > 0.0f; + xmenuFileOutputAvi.Enabled = value; + xmenuFileOutputRawAvi.Enabled = value; + xmenuFileSeriesBitmap.Enabled = value; + + if ( AppManager.SaveData.m_groups_character.Count <= 0 ) { + xmenuFileExportHatwune.Enabled = false; + xmenuFileExportVocaloMark.Enabled = false; + } else { + xmenuFileExportHatwune.Enabled = true; + xmenuFileExportVocaloMark.Enabled = true; + } + } + + private void xmenuFileExportHatwune_Click( object sender, EventArgs e ) { + int target = 0; + if ( AppManager.SaveData.m_groups_character.Count > 1 ) { + string msg = _( "Specify the index of target character" ); + for ( int i = 0; i < AppManager.SaveData.m_groups_character.Count; i++ ) { + msg += "\n" + i + " : " + AppManager.SaveData.m_groups_character[i].Text; + } + using ( InputBox dlg = new InputBox( msg, "LipSync" ) ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + try { + target = int.Parse( dlg.rText ); + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + if ( target < 0 || AppManager.SaveData.m_groups_character.Count <= target ) { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + } + } + } + using ( SaveFileDialog dlg2 = new SaveFileDialog() ) { + if ( dlg2.ShowDialog() == DialogResult.OK ) { + string file = dlg2.FileName; + using ( StreamWriter sw = new StreamWriter( file, false, Encoding.GetEncoding( "Shift_JIS" ) ) ) + using ( TimeTable table = new TimeTable( "", 0, TimeTableType.none, null ) ) { + sw.WriteLine( "Init{" ); + sw.WriteLine( "\tSetFog( 10.0, 180.0, 200, 225, 255 )" ); + sw.WriteLine( "\tSetGlareFilter( 1.0, 1.0, 1.0, 0.20, -0.81, -0.80, -0.78, 0.0 )" ); + sw.WriteLine( "\tSetDirectionLight( -1.0, -0.6, -0.4 )" ); + sw.WriteLine( "\tSetAmbientLight( 1.0, 1.0, 1.0 )" ); + sw.WriteLine( "\tSetBGColor( 0, 0, 0 )" ); + sw.WriteLine( "\tLoadStage( \"data\\xsi\\stage01\\\", \"stage01.xsibin\" )" ); + bool wave_exists = false; + if ( Path.GetExtension( AppManager.SaveData.m_audioFile ).ToLower() == ".wav" ) { + wave_exists = true; + sw.WriteLine( "\tLoadBGM( \"" + Path.GetDirectoryName( AppManager.SaveData.m_audioFile ) + "\", \"" + Path.GetFileName( AppManager.SaveData.m_audioFile ) + "\" )" ); + } + sw.WriteLine( "}" ); + sw.WriteLine( "Main{" ); + sw.WriteLine( "\tCamera( 0, Offset, 0, 1.45, 3.2, 0, 1.0, 0, 0, Linear, 0 )" ); + sw.WriteLine( "\tMotion( 0, GoMyWay, 0, 1.5, 0 )" ); + if ( wave_exists ) { + sw.WriteLine( " PlayBGM( 1.0 )" ); + } + sw.WriteLine( "\tAppendTriggerUncondition( 1.0, Face_Group )" ); + sw.WriteLine( "\tEnd( " + (AppManager.SaveData.m_totalSec + 1) + ", Return )" ); + sw.WriteLine( "}" ); + sw.WriteLine( "Face_Group{" ); + + // 繧ィ繝ウ繝医Μ繧貞玲嫌 + for ( int track = 0; track < AppManager.SaveData.m_groups_character[target].Count; track++ ) { + for ( int entry = 0; entry < AppManager.SaveData.m_groups_character[target][track].Count; entry++ ) { + TimeTableEntry ent = AppManager.SaveData.m_groups_character[target][track][entry]; + table.Add( (TimeTableEntry)ent.Clone() ); + } + } + table.Sort(); + + //郢九′縺」縺ヲ繧句・エ縺ッ騾」邨舌&縺帙※縺翫¥ + bool change = true; + while ( change ) { + change = false; + for ( int entry = 0; entry < table.Count - 1; entry++ ) { + if ( table[entry].body == table[entry + 1].body && table[entry].end == table[entry + 1].begin ) { + table[entry].end = table[entry + 1].end; + table.RemoveAt( entry + 1 ); + change = true; + break; + } + } + } + + for ( int entry = 0; entry < table.Count; entry++ ) { + string type; + float begin = table[entry].begin; + float end = table[entry].end; + switch ( table[entry].body ) { + case "a": + type = "L_A"; + break; + case "i": + type = "L_I"; + break; + case "u": + type = "L_U"; + break; + case "e": + type = "L_E"; + break; + case "o": + case "xo": + type = "L_O"; + break; + case "nn": + type = "L_Default"; + break; + default: + type = ""; + break; + } + if ( type != "" ) { + bool force_default = true; + if ( entry + 1 < table.Count ) { + if ( end == table[entry + 1].begin ) { + force_default = false; + } + } + + if ( force_default ) { + //todo: 0.30繧医j遏ュ縺蝣エ蜷医ッシ + sw.WriteLine( "\tFace( " + begin + ", " + type + ", " + 0.15 + " )" ); + sw.WriteLine( "\tFace( " + (end - 0.15) + ", L_Default, " + 0.15 + " )" ); + } else { + sw.WriteLine( "\tFace( " + begin + ", " + type + ", " + 0.15 + " )" ); + } + } + } + sw.WriteLine( "}" ); + } + } + } + } + + private void xmenuFileExportVocaloMark_Click( object sender, EventArgs e ) { + using ( FormVocalomark fv = new FormVocalomark( AppManager.SaveData.m_groups_character[0].Character ) ) { + fv.ShowDialog(); + int target = 0; + if ( AppManager.SaveData.m_groups_character.Count > 1 ) { + string msg = _( "Specify the index of target character" ); + for ( int i = 0; i < AppManager.SaveData.m_groups_character.Count; i++ ) { + msg += "\n" + i + " : " + AppManager.SaveData.m_groups_character[i].Text; + } + using ( InputBox dlg = new InputBox( msg, "LipSync" ) ) { + if ( dlg.ShowDialog() == DialogResult.OK ) { + try { + target = int.Parse( dlg.rText ); + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + if ( target < 0 || AppManager.SaveData.m_groups_character.Count <= target ) { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + } + } + } + using ( SaveFileDialog dlg2 = new SaveFileDialog() ) { + if ( dlg2.ShowDialog() == DialogResult.OK ) { + string file = dlg2.FileName; + using ( StreamWriter sw = new StreamWriter( file, false, Encoding.GetEncoding( "Shift_JIS" ) ) ) + using ( TimeTable table = new TimeTable( "", 0, TimeTableType.none, null ) ) { + // 繧ィ繝ウ繝医Μ繧貞玲嫌 + for ( int track = 0; track < AppManager.SaveData.m_groups_character[target].Count; track++ ) { + for ( int entry = 0; entry < AppManager.SaveData.m_groups_character[target][track].Count; entry++ ) { + TimeTableEntry ent = AppManager.SaveData.m_groups_character[target][track][entry]; + table.Add( (TimeTableEntry)ent.Clone() ); + } + } + table.Sort(); + + //郢九′縺」縺ヲ繧句・エ縺ッ騾」邨舌&縺帙※縺翫¥ + bool change = true; + while ( change ) { + change = false; + for ( int entry = 0; entry < table.Count - 1; entry++ ) { + if ( table[entry].body == table[entry + 1].body && table[entry].end == table[entry + 1].begin ) { + table[entry].end = table[entry + 1].end; + table.RemoveAt( entry + 1 ); + change = true; + break; + } + } + } + + Dictionary dict = new Dictionary(); + foreach ( KeyValuePair kvp in fv.Assignment ) { + dict.Add( kvp.Value, kvp.Key ); + } + + sw.WriteLine( "ShapeAnime_LipSync{" ); + for ( int i = 0; i < table.Count; i++ ) { + if ( dict.ContainsKey( table[i].body ) ) { + string type = dict[table[i].body]; + float blend_from_default = 0.05f; + float blend_to_default = 0.05f; + string def = "L_Default"; + if ( type.StartsWith( "E_" ) ){ + blend_from_default = fv.BlendEyeFromDefault; + blend_to_default = fv.BlendEyeToDefault; + def = "E_Default"; + } else if ( type.StartsWith( "EB_" ) ){ + blend_from_default = fv.BlendEyebrowFromDefault; + blend_to_default = fv.BlendEyebrowToDefault; + def = "EB_Default"; + } else if ( type.StartsWith( "L_" ) ){ + blend_from_default = fv.BlendLipFromDefault; + blend_to_default = fv.BlendLipToDefault; + } + sw.WriteLine( "\tSetShape(" + table[i].begin.ToString( "0.000000" ) + ", DefaultUnit, " + type + ", " + blend_from_default.ToString( "0.000000" ) + ")" ); + sw.WriteLine( "\tSetShape(" + table[i].end.ToString( "0.000000" ) + ", DefaultUnit, " + def + ", " + blend_to_default.ToString( "0.000000" ) + ")" ); + sw.WriteLine(); + } + } + sw.WriteLine( "}" ); + } + } + } + } + //todo: Form1+xmenuFileExportVocaloMark_Click + //ShapeAnime_LipSync + //{ + // SetShape(4.195052, DefaultUnit, L_O, 0.1) + // SetShape(4.375056, DefaultUnit, L_Default, 0.2) + + //ShapeAnime_Eye + //{ + // SetShape(1.945060, DefaultUnit, E_Close, 0.05) + // SetShape(2.020068, DefaultUnit, E_Default, 0.05) + //E_Close + //E_Default + //E_Sad + //E_Serious + //E_Smile + //E_Surprise + //E_WinkL + //E_WinkR + //EB_Confuse + //EB_Default + //EB_Sad + //EB_Serious + //EB_Surprise + //L_Default + //L_A + //L_E + //L_I + //L_N + //L_O + //L_U + } + + private void xmenuFileImportRipsync_Click( object sender, EventArgs e ) { + if ( MessageBox.Show( _( "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" ), + _( "Confirmation" ), + MessageBoxButtons.OKCancel, + MessageBoxIcon.Question ) != DialogResult.OK ) { + return; + } + if ( openRseDialog.ShowDialog() == DialogResult.OK ) { + string file = openRseDialog.FileName; + if ( File.Exists( file ) ) { + ClearExistingData(); + RspImporter.Import( file, ref AppManager.SaveData ); + AppManager.Edited = true; + SetVScrollRange(); + SetHScrollRange(); + if ( m_player.SoundLocation != "" ) { + m_player.Close(); + AppManager.Playing = false; + StopPauseCore(); + previewer.PlayPauseText = _( "Play" ); + } + m_player.Load( AppManager.SaveData.m_audioFile ); + } else { + MessageBox.Show( _( "File not found" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + } + } + } + + private void xmenuFileExit_Click( object sender, EventArgs e ) { + SaveConfig(); + this.Close(); + } + + private void xmenuFileSaveAs_Click( object sender, EventArgs e ) { + if ( saveFileDialog1.ShowDialog() == DialogResult.OK ) { + if ( Path.GetExtension( saveFileDialog1.FileName ).ToLower() == ".lse" ) { + m_filePath = saveFileDialog1.FileName; + Save( m_filePath ); + } else { + MessageBox.Show( _( "Extension must be *.lse" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + } + } + } + + private void xmenuFileOpen_Click( object sender, EventArgs e ) { + if ( openLse.ShowDialog() == DialogResult.OK ) { + Read( openLse.FileName ); + m_filePath = openLse.FileName; + UpdateFormTitle(); + SetHScrollRange(); + SetVScrollRange(); + AppManager.SaveData.UpdateZorder(); + UpdateObjectList(); + pictureBox1.Invalidate(); + } + } + + private void xmenuFileSave_Click( object sender, EventArgs e ) { + if ( m_filePath == "" ) { + if ( saveFileDialog1.ShowDialog() == DialogResult.OK ) { + if ( Path.GetExtension( saveFileDialog1.FileName ).ToLower() == ".lse" ) { + m_filePath = saveFileDialog1.FileName; + Save( m_filePath ); + } else { + MessageBox.Show( _( "Extension must be *.lse" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + } + } else { + return; + } + } else { + if ( Path.GetExtension( m_filePath ).ToLower() == ".lse" ) { + Save( m_filePath ); + } else { + MessageBox.Show( _( "Extension must be *.lse" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + } + } + } + + private void xmenuFileSeriesBitmap_Click( object sender, EventArgs e ) { + using ( FormSeriesImage fsi = new FormSeriesImage() ) { + if ( fsi.ShowDialog() == DialogResult.OK ) { + AviWriting = true; + m_avi_cancel = false; + AviOutputArguments args = new AviOutputArguments(); + args.AviFile = fsi.DirectoryName; + args.StartSpecified = fsi.StartSpecified; + args.EndSpecified = fsi.EndSpecified; + args.Start = fsi.Start; + args.End = fsi.End; + args.FileNameParser = fsi.ParserString; + args.ImageFormat = fsi.ImageFormat; + bgWorkSeriesImage.RunWorkerAsync( args ); + } + } + } + #endregion + + #region side + private void side_MouseClick( object sender, MouseEventArgs e ) { + if ( e.Button == MouseButtons.Left ) { + int y = e.Y + m_startToDrawY; + + int rows = 1; + bool vsq_fixed = AppManager.Config.FixVsqTrackPosition; + // VSQ繝医Λ繝繧ッ + if ( vsq_fixed ) { + if ( rows * AppManager.Config.TrackHeight <= e.Y && e.Y < (rows + 1) * AppManager.Config.TrackHeight ) { + AppManager.SaveData.m_group_vsq.Folded = !AppManager.SaveData.m_group_vsq.Folded; + m_vsq_height = AppManager.Config.TrackHeight * (AppManager.SaveData.m_group_vsq.VisibleTracks + 2); + SetVScrollRange(); + this.Invalidate(); + return; + } + } else { + if ( rows * AppManager.Config.TrackHeight <= y && y < (rows + 1) * AppManager.Config.TrackHeight ) { + AppManager.SaveData.m_group_vsq.Folded = !AppManager.SaveData.m_group_vsq.Folded; + m_vsq_height = AppManager.Config.TrackHeight * (AppManager.SaveData.m_group_vsq.VisibleTracks + 2); + SetVScrollRange(); + this.Invalidate(); + return; + } + } + rows++; + if ( !AppManager.SaveData.m_group_vsq.Folded ) { + rows += AppManager.SaveData.m_group_vsq.Count; + } + // character + if ( AppManager.SaveData.m_groups_character.Count > 0 ) { + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + if ( rows * AppManager.Config.TrackHeight <= y && y < (rows + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && e.Y >= m_vsq_height) ) { + AppManager.SaveData.m_groups_character[group].Folded = !AppManager.SaveData.m_groups_character[group].Folded; + SetVScrollRange(); + m_startToDrawY = StartToDrawY(); + this.Invalidate(); + return; + } + } + rows++; + if ( !AppManager.SaveData.m_groups_character[group].Folded ) { + rows += AppManager.SaveData.m_groups_character[group].Count; + } + } + } + // telop + if ( rows * AppManager.Config.TrackHeight <= y && y < (rows + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && e.Y >= m_vsq_height) ) { + AppManager.SaveData.TelopListFolded = !AppManager.SaveData.TelopListFolded; + SetVScrollRange(); + m_startToDrawY = StartToDrawY(); + this.Invalidate(); + return; + } + } + rows++; + if ( !AppManager.SaveData.TelopListFolded ) { + rows += AppManager.MaxTelopLanes; + } + // another + if ( rows * AppManager.Config.TrackHeight <= y && y < (rows + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && e.Y >= m_vsq_height) ) { + AppManager.SaveData.m_group_another.Folded = !AppManager.SaveData.m_group_another.Folded; + SetVScrollRange(); + m_startToDrawY = StartToDrawY(); + this.Invalidate(); + return; + } + } + rows++; + if ( !AppManager.SaveData.m_group_another.Folded ) { + rows += AppManager.SaveData.m_group_another.Count; + } + // plugin + if ( rows * AppManager.Config.TrackHeight <= y && y < (rows + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && e.Y >= m_vsq_height) ) { + AppManager.SaveData.m_group_plugin.Folded = !AppManager.SaveData.m_group_plugin.Folded; + SetVScrollRange(); + m_startToDrawY = StartToDrawY(); + this.Invalidate(); + return; + } + } + rows++; + if ( !AppManager.SaveData.m_group_plugin.Folded ) { + rows += AppManager.SaveData.m_group_plugin.Count; + } + } else if ( e.Button == MouseButtons.Right ) { + if ( !cmenu.IsDisposed || cmenu != null ) { + cmenu.Dispose(); + } + cmenu = new ContextMenuStrip(); + cmenu.RenderMode = ToolStripRenderMode.ManagerRenderMode; + cmenu.ShowCheckMargin = false; + cmenu.ShowImageMargin = false; + cmenu.Font = AppManager.Config.Font.GetFont(); + cmenu.Items.Add( _( "Expand All" ), null, new EventHandler( h_expandAll ) ); + cmenu.Items.Add( _( "Fold All" ), null, new EventHandler( h_foldAll ) ); + cmenu.Show( side, new Point( e.X, e.Y ) ); + } + } + + private void side_Paint( object sender, PaintEventArgs e ) { + if ( m_skip_paint ) { + return; + } + Graphics g = e.Graphics; + g.Clear( TOOL_COLOR ); + int rows = 1; + // VSQ繝医Λ繝繧ッ + bool vsq_fixed = AppManager.Config.FixVsqTrackPosition; + if ( !vsq_fixed ) { + DrawTriangle( g, rows * AppManager.Config.TrackHeight - m_startToDrawY, AppManager.SaveData.m_group_vsq.Folded ); + } + rows++; + if ( !AppManager.SaveData.m_group_vsq.Folded ) { + rows += AppManager.SaveData.m_group_vsq.Count; + } + + // character + if ( AppManager.SaveData.m_groups_character.Count > 0 ) { + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + DrawTriangle( g, rows * AppManager.Config.TrackHeight - m_startToDrawY, AppManager.SaveData.m_groups_character[group].Folded ); + rows++; + if ( !AppManager.SaveData.m_groups_character[group].Folded ) { + rows += AppManager.SaveData.m_groups_character[group].Count; + } + } + } + + // telop + DrawTriangle( g, rows * AppManager.Config.TrackHeight - m_startToDrawY, AppManager.SaveData.TelopListFolded ); + rows++; + if ( !AppManager.SaveData.TelopListFolded ) { + rows += AppManager.MaxTelopLanes; + } + + // another + DrawTriangle( g, rows * AppManager.Config.TrackHeight - m_startToDrawY, AppManager.SaveData.m_group_another.Folded ); + rows++; + if ( !AppManager.SaveData.m_group_another.Folded ) { + rows += AppManager.SaveData.m_group_another.Count; + } + // plugin + DrawTriangle( g, rows * AppManager.Config.TrackHeight - m_startToDrawY, AppManager.SaveData.m_group_plugin.Folded ); + rows++; + if ( !AppManager.SaveData.m_group_plugin.Folded ) { + rows += AppManager.SaveData.m_group_plugin.Count; + } + if ( vsq_fixed ) { + g.FillRectangle( + new SolidBrush( TOOL_COLOR ), + new Rectangle( 0, 0, side.Width, m_vsq_height ) ); + g.DrawLine( + new Pen( Color.Black, 2 ), + new Point( 0, m_vsq_height ), + new Point( side.Width, m_vsq_height ) ); + DrawTriangle( g, AppManager.Config.TrackHeight, AppManager.SaveData.m_group_vsq.Folded ); + } + } + #endregion + + private void SettingsEx_CommandExecuted( TimeTableType command_target, CommandType command_type ) { +#if DEBUG + Common.DebugWriteLine( "AppManager_CommandExecuted" ); +#endif + if ( command_type == CommandType.deleteEntry || + command_type == CommandType.deleteGroup || + command_type == CommandType.deleteTelop || + command_type == CommandType.deleteTimeTable ) { + + } + menuEditRedo.Enabled = AppManager.IsRedoAvailable; + menuEditUndo.Enabled = AppManager.IsUndoAvailable; + this.Refresh(); + } + + private void previewer_SpeedClicked( object sender, EventArgs e ) { + previewer.TrackSpeedValue = 1000; + ChangeSpeed( 1000 ); + } + + #region trackSpeed + private void previewer_TrackSpeedMouseUp( object sender, MouseEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "trackSpeed_MouseUp" ); +#endif + ChangeSpeed( previewer.TrackSpeedValue ); + } + + private void previewer_TrackSpeedScroll( object sender, EventArgs e ) { + float speed = previewer.TrackSpeedValue * 0.001f; + previewer.LabelSpeedText = "x" + speed.ToString( "0.00" ); + } + #endregion + + #region cmenuRepeat + private void cmenuRepeatStart_Click( object sender, EventArgs e ) { + AppManager.SaveData.REPEAT_START = SecFromXCoord( m_mousePosition.X ); + } + + private void cmenuRepeatEnd_Click( object sender, EventArgs e ) { + AppManager.SaveData.REPEAT_END = SecFromXCoord( m_mousePosition.X ); + } + + private void cmenuRepeatReset_Click( object sender, EventArgs e ) { + AppManager.SaveData.REPEAT_START = 0f; + AppManager.SaveData.REPEAT_END = -1f; + } + + private void cmenuRepeat_Opening( object sender, CancelEventArgs e ) { + float pos = SecFromXCoord( m_mousePosition.X ); + if ( RepeatEnd < pos ) { + cmenuRepeatStart.Enabled = false; + } else { + cmenuRepeatStart.Enabled = true; + } + if ( RepeatStart > pos ) { + cmenuRepeatEnd.Enabled = false; + } else { + cmenuRepeatEnd.Enabled = true; + } + } + #endregion + + #region menuVisual* + private void menuVisualTop_Click( object sender, EventArgs e ) { + if ( hScrollBar1.Value != hScrollBar1.Minimum ) { + hScrollBar1.Value = hScrollBar1.Minimum; + m_startToDrawX = StartToDrawX(); + this.Invalidate(); + } + } + + private void menuVisualEnd_Click( object sender, EventArgs e ) { + if ( hScrollBar1.Value != hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange ) { + hScrollBar1.Value = hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange; + m_startToDrawX = StartToDrawX(); + this.Invalidate(); + } + } + + /// + /// 繧ソ繧、繝繝ゥ繧、繝ウ縺ョ譎る俣諡。螟ァ邇繧偵Μ繧サ繝繝医@縺セ縺 + /// + /// + /// + private void menuVisualZoomReset_Click( object sender, EventArgs e ) { + AppManager.Config.PixelPerSec = 150.0f; + SetHScrollRange(); + correctPosition(); + //rebuildDrawing(); + this.Invalidate(); + } + + private void menuVisualZoomOut_Click( object sender, EventArgs e ) { + if ( AppManager.Config.PixelPerSec >= 20.0f ) { + AppManager.Config.PixelPerSec -= 10.0f; + SetHScrollRange(); + correctPosition(); + //rebuildDrawing(); + base.Invalidate(); + } + } + + private void menuVisualRepeatPlayPause_Click( object sender, EventArgs e ) { + m_is_repeat_mode = true; + if ( AppManager.Playing ) { + Pause(); + } else { + Play(); + } + } + + private void menuVisualRepeatTop_Click( object sender, EventArgs e ) { + m_is_repeat_mode = true; + if ( AppManager.Playing ) { + Pause(); + previewer.TrackBarValue = (int)(RepeatStart * AppManager.SaveData.FrameRate); + Play(); + } else { + previewer.TrackBarValue = (int)(RepeatStart * AppManager.SaveData.FrameRate); + } + this.Invalidate(); + } + + private void menuVisualRepeatEnd_Click( object sender, EventArgs e ) { + m_is_repeat_mode = true; + if ( AppManager.Playing ) { + Pause(); + } + previewer.TrackBarValue = (int)(RepeatEnd * AppManager.SaveData.FrameRate); + this.Invalidate(); + } + + private void menuVisualTransform_CheckedChanged( object sender, EventArgs e ) { + m_curve.Visible = menuVisualTransform.Checked; + } + + private void menuVisualPlayPause_Click( object sender, EventArgs e ) { + m_is_repeat_mode = false; + if ( AppManager.Playing ) { + Pause(); + } else { + Play(); + } + } + + private void menuVisualObjectList_Click( object sender, EventArgs e ) { + ChangePropertyHidden(); + } + + private void menuVisualZoomIn_Click( object sender, EventArgs e ) { + AppManager.Config.PixelPerSec += 10.0f; + SetHScrollRange(); + correctPosition(); + //rebuildDrawing(); + base.Invalidate(); + } + + private void menuVisualPreviewFlipVisible_Click( object sender, EventArgs e ) { + ChangePreviewHidden(); + } + + private void menuVisualPreviewSeparate_Click( object sender, EventArgs e ) { + PreviewWindowFlipMode(); + } + #endregion + + #region menuTool* + private void menuToolMusic_Click( object sender, EventArgs e ) { + if ( m_player.SoundLocation != "" ) { + m_player.Close(); + AppManager.Playing = false; + StopPauseCore();//timerPreview.Enabled = false; + previewer.PlayPauseText = _( "Play" ); + } + openMusicDialog.FileName = AppManager.Config.LastMusicPath; + try { + openMusicDialog.Filter = _( "Audio File(*.mp3;*.wav)|*.mp3;*.wav" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + openMusicDialog.Filter = "Audio File(*.mp3;*.wav)|*.mp3;*.wav|All Files(*.*)|*.*"; + } + if ( openMusicDialog.ShowDialog() == DialogResult.OK ) { + AppManager.Config.LastMusicPath = openMusicDialog.FileName; + Command run = Command.GCommandSetMp3( openMusicDialog.FileName ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + m_player.Load( AppManager.SaveData.m_audioFile ); + AppManager.Edited = true; + } + } + + private void menuToolMoveTo_Click( object sender, EventArgs e ) { + using ( InputBox ib = new InputBox( _( "Go to specified frame" ), _( "please input frame index" ) ) ) { + if ( ib.ShowDialog() == DialogResult.OK ) { + int frame; + try { + frame = int.Parse( ib.rText.Trim() ); + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + ib.Dispose(); + return; + } + if ( previewer.TrackBarMaximum < frame || frame < previewer.TrackBarMinimum ) { + MessageBox.Show( _( "invalid frame index" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + previewer.TrackBarValue = frame; + this.Invalidate(); + } + } + } + + private void menuToolQuantize04_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.q04; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantize08_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.q08; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantize16_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.q16; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantize32_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.q32; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantize64_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.q64; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantizeOff_Click( object sender, EventArgs e ) { + AppManager.Config.QuantizeMode = QuantizeMode.off; + QuantizeMenuCheckedStateUpdate(); + } + + private void menuToolQuantizeTriplet_CheckedChanged( object sender, EventArgs e ) { + AppManager.Config.QuantizeTripletEnabled = menuToolQuantizeTriplet.Checked; + UpdateGridList(); + } + + private void menuToolOption_Click( object sender, EventArgs e ) { + using ( EnvConfiguration env = new EnvConfiguration( AppManager.Config ) ) { + if ( env.ShowDialog() == DialogResult.OK ) { + // language + AppManager.Config = null; + AppManager.Config = (EnvSettings)env.EnvSettings.Clone(); + + ApplyFont( AppManager.Config.Font.GetFont() ); + property.UpdateLayout(); + if ( m_curve != null ) { + m_curve.ApplyFont( AppManager.Config.Font.GetFont() ); + } + if ( m_version_form != null ) { + m_version_form.Font = AppManager.Config.Font.GetFont(); + } + if ( m_form_preview != null ) { + m_form_preview.ApplyFont( AppManager.Config.Font.GetFont() ); + } + + string lang = AppManager.Config.Language; + string[] t_list = Messaging.GetRegisteredLanguage(); + bool found = false; + foreach ( string lng in t_list ) { + if ( lng == lang ) { + AppManager.Config.Language = lng; + Messaging.Language = lng; + found = true; + break; + } + } + if ( !found ) { + AppManager.Config.Language = ""; + Messaging.Language = ""; + } + ApplyLanguage(); + UpdateFormTitle(); + this.Invalidate(); + } + } + } + #endregion + + private void previewer_PlayPauseClicked( object sender, EventArgs e ) { + m_is_repeat_mode = false; + if ( AppManager.Playing ) { + Pause(); + } else { + Play(); + } + } + + private void previewer_StopClicked( object sender, EventArgs e ) { + StopMusic(); + } + + private void previewer_CheckMuteCheckedChanged( object sender, EventArgs e ) { + if ( previewer.CheckMuteChecked ) { + m_player.IsMuted = true; + } else { + m_player.IsMuted = false; + } + } + + private void previewer_TrackVolumeScroll( object sender, EventArgs e ) { + int volume = previewer.TrackVolumeValue; + m_player.Volume = volume; + } + + #region previewer + private void previewer_PreviewMouseDown( object sender, MouseEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "PreviewP_MouseDown" ); +#endif + if ( AppManager.Playing || AviWriting ) { + return; + } + + timerScreenUpdater.Enabled = true; + // 繧ェ繝悶ず繧ァ繧ッ繝医ョz繧ェ繝シ繝繝シ鬆縺ォ縲√け繝ェ繝繧ッ縺輔l縺滉ス咲スョ縺ォ + // 陦ィ遉コ縺輔l縺ヲ縺繧九が繝悶ず繧ァ繧ッ繝医′菴輔°繧呈、懃エ「縺吶k + float now = Now; + + //譛蛻昴↓繝繝ュ繝繝励r讀懃エ「 + foreach ( Telop telop in AppManager.SaveData.m_telop_ex2 ) { + if ( telop.Start <= now && now <= telop.End ) { + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( telop.GetPosition( now ) ), + Common.SizeFromSizeF( telop.ImageSize ) ), + telop.GetScale( now ) ), + telop.PositionFixed, + telop.IsXFixedAt( now ), + telop.IsYFixedAt( now ) ); +#if DEBUG + Common.DebugWriteLine( " telop.ImageSize=" + telop.ImageSize ); + Common.DebugWriteLine( " m_editing.Bounds=" + m_editing.Bounds ); +#endif + if ( AppManager.IsInRectangle( e.Location, m_editing.Bounds ) ) { + ZorderItem zi = new ZorderItem( telop.Text, ZorderItemType.telop, telop.ID ); + property.Editing = (ZorderItem)zi.Clone(); + if ( !telop.PositionFixed ) { + m_editing_item = zi; + m_init_position = Common.PointFromPointF( telop.Position ); + m_base_point = ICoordFromC( e.Location ); + } + return; + } + } + } + + bool found = false; + for ( int i = AppManager.SaveData.m_zorder.Count - 1; i >= 0; i-- ) { + #region s.m_zorder繧呈、懃エ「 + ZorderItem item = AppManager.SaveData.m_zorder[i]; + switch ( item.Type ) { + case ZorderItemType.another: + for ( int entry = 0; entry < AppManager.SaveData.m_group_another[item.Index].Count; entry++ ) { + TimeTable table = AppManager.SaveData.m_group_another[item.Index]; + if ( table[entry].begin <= now && now <= table[entry].end ) { + if ( table.IsAviMode || + (!table.IsAviMode && table.Image != null) ) { + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table.GetPosition( now ) ), + table.ImageSize ), + Math.Abs( table.GetScale( now ) ) ), + table.PositionFixed, + table.IsXFixedAt( now ), + table.IsYFixedAt( now ) ); + if ( AppManager.IsInRectangle( e.Location, m_editing.Bounds ) ) { + if ( !table.PositionFixed ) { + m_editing_item = item; + m_init_position = Common.PointFromPointF( table.Position ); + } + property.Editing = (ZorderItem)item.Clone(); + found = true; + break; + } + } + m_editing = new EditingBounds(); + } else { + break; + } + } + break; + case ZorderItemType.character: + TimeTableGroup table_group = AppManager.SaveData.m_groups_character[item.Index]; + string[] spl = table_group.GetDrawObjectNames( now ); + if ( spl.Length > 0 ) { + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table_group.GetPosition( now ) ), + table_group.Character.Size ), + Math.Abs( table_group.GetScale( now ) ) ), + table_group.PositionFixed, + table_group.IsXFixedAt( now ), + table_group.IsYFixedAt( now ) ); + if ( AppManager.IsInRectangle( e.Location, m_editing.Bounds ) ) { + if ( !table_group.PositionFixed ) { + m_editing_item = item; + m_init_position = Common.PointFromPointF( table_group.GetPosition( now ) ); + } + property.Editing = (ZorderItem)item.Clone(); + found = true; + break; + } + m_editing = new EditingBounds(); + } + break; + } + #endregion + if ( found ) { + m_base_point = ICoordFromC( e.Location ); + break; + } + } + + if ( !found ) { + m_editing = new EditingBounds(); + if ( m_text_edit && m_text != null ) { + int id = m_text_id; + Telop item = (Telop)AppManager.SaveData[id].Clone(); + item.Text = m_text.Text; + Command run = Command.GCommandEditTelop( id, item ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + m_text.Dispose(); + m_text = null; + } + m_text_edit = false; + m_editing_item = null; + } + this.Invalidate(); + } + + private void previewer_PreviewMouseMove( object sender, MouseEventArgs e ) { + if ( m_editing_item != null ) { +#if DEBUG + Common.DebugWriteLine( "PreviewP_MouseMove" ); +#endif + float now = Now; + Point iCurrent = ICoordFromC( e.Location ); + int index = m_editing_item.Index; + + Point new_point = new Point( m_init_position.X + (iCurrent.X - m_base_point.X), + m_init_position.Y + (iCurrent.Y - m_base_point.Y) ); + switch ( m_editing_item.Type ) { + case ZorderItemType.telop: + if ( !m_text_edit ) { + Telop telop = AppManager.SaveData[index]; + telop.Position = new_point; + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( telop.GetPosition( now ) ), + Common.SizeFromSizeF( telop.ImageSize ) ), + telop.GetScale( now ) ), + telop.PositionFixed, + telop.IsXFixedAt( now ), + telop.IsYFixedAt( now ) ); + } + break; + case ZorderItemType.another: + TimeTable table = AppManager.SaveData.m_group_another[index]; + table.Position = new_point; + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table.GetPosition( now ) ), + Common.SizeFromSizeF( table.ImageSize ) ), + Math.Abs( table.GetScale( now ) ) ), + table.PositionFixed, + table.IsXFixedAt( now ), + table.IsYFixedAt( now ) ); + break; + case ZorderItemType.character: +#if DEBUG + Common.DebugWriteLine( " new_point=" + new_point ); +#endif + TimeTableGroup table_group = AppManager.SaveData.m_groups_character[index]; + table_group.Position = new_point; + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table_group.GetPosition( now ) ), + Common.SizeFromSizeF( table_group.Character.Size ) ), + Math.Abs( table_group.GetScale( now ) ) ), + table_group.PositionFixed, + table_group.IsXFixedAt( now ), + table_group.IsYFixedAt( now ) ); + break; + } + previewer.Invalidate(); + } + } + + private void previewer_PreviewMouseUp( object sender, MouseEventArgs e ) { + timerScreenUpdater.Enabled = false; +#if DEBUG + Common.DebugWriteLine( "PreviewP_MouseUp" ); +#endif + if ( m_editing_item != null ) { + bool found = false; + int index = m_editing_item.Index; + Point new_pos; + switch ( m_editing_item.Type ) { + case ZorderItemType.telop: + new_pos = AppManager.SaveData[index].Position; + if ( new_pos.X != m_init_position.X || new_pos.Y != m_init_position.Y ) { + Command run = Command.GCommandEditTelop( index, AppManager.SaveData[index] ); + AppManager.SaveData[index].Position = m_init_position; + AppManager.Register( AppManager.SaveData.Execute( run ) ); + property.Editing = new ZorderItem( "", ZorderItemType.telop, index ); + AppManager.Edited = true; + } + found = true; + break; + case ZorderItemType.another: + new_pos = AppManager.SaveData.m_group_another[index].Position; + if ( new_pos.X != m_init_position.X || new_pos.Y != m_init_position.Y ) { + Command run = Command.GCommandSetPosition( TimeTableType.another, -1, index, AppManager.SaveData.m_group_another[index].Position ); + AppManager.SaveData.m_group_another[index].Position = m_init_position; + AppManager.Register( AppManager.SaveData.Execute( run ) ); + property.Editing = new ZorderItem( "", ZorderItemType.another, index ); + AppManager.Edited = true; + } else { + AppManager.SaveData.m_group_another[index].Position = m_init_position; + } + found = true; + break; + case ZorderItemType.character: + new_pos = AppManager.SaveData.m_groups_character[index].Position; +#if DEBUG + Common.DebugWriteLine( " new_pos=" + new_pos.ToString() ); + Common.DebugWriteLine( " m_init_position=" + m_init_position ); + Common.DebugWriteLine( " AppManager.SaveData.m_groups_character[index].Position=" + AppManager.SaveData.m_groups_character[index].Position ); +#endif + if ( new_pos.X != m_init_position.X || new_pos.Y != m_init_position.Y ) { + Command run = Command.GCommandSetPosition( TimeTableType.character, index, -1, AppManager.SaveData.m_groups_character[index].Position ); + AppManager.SaveData.m_groups_character[index].Position = m_init_position; + AppManager.Register( AppManager.SaveData.Execute( run ) ); + property.Editing = new ZorderItem( "", ZorderItemType.character, index ); + AppManager.Edited = true; + } else { + AppManager.SaveData.m_groups_character[index].Position = m_init_position; + } + found = true; + break; + } + + if ( found ) { + m_editing_item = null; + this.Invalidate(); + return; + } + } + } + + private void previewer_PreviewMouseDoubleClick( object sender, MouseEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "PreviewP_MouseDoubleClick" ); +#endif + if ( m_editing_item != null ) { + if ( m_editing_item.Type == ZorderItemType.telop ) { + Telop item = AppManager.SaveData[m_editing_item.Index]; + m_text_edit = true; + m_text = new TextBox(); + m_text.Visible = false; + m_text.Text = item.Text; + m_text_original = item.Text; + m_text_id = m_editing_item.Index; + Rectangle rc_telop = new Rectangle( Common.PointFromPointF( item.Position ), Common.SizeFromSizeF( item.ImageSize ) ); + float dum_x, dum_y, scale; + GetScaleAndOrigin( out dum_x, out dum_y, out scale ); + Rectangle rc_text = CRectFromIRect( rc_telop, scale ); + m_text.Parent = previewer.Preview; + m_text.Location = new Point( (int)(rc_text.Left + 1 * scale), (int)(rc_text.Top - 3 * scale) ); + m_text.Font = new Font( item.Font.FontFamily, item.Font.Size * scale, item.Font.Style ); + m_text.Multiline = true; + m_text.Size = m_text.PreferredSize; + m_text.Tag = m_text.Size.Width; + m_text.ImeMode = ImeMode.NoControl; + m_text.TextChanged += new EventHandler( m_text_TextChanged ); + m_text.Show(); + m_text.BringToFront(); + m_text.Visible = true; + m_text.Focus(); + } + } + } + + private void previewer_PreviewSizeChanged( object sender, EventArgs e ) { + UpdateEditHandle(); + } + + private void previewer_PreviewPaint( object sender, PaintEventArgs e ) { + if ( !m_avi_writing ) { + using ( Graphics g = Graphics.FromImage( previewer.Image ) ) { + string mouth = ""; + if ( menuEditRealTime.Checked ) { + if ( m_last_key == Keys.A ) { + mouth = "a"; + } else if ( m_last_key == Keys.I ) { + mouth = "i"; + } else if ( m_last_key == Keys.U ) { + mouth = "u"; + } else if ( m_last_key == Keys.E ) { + mouth = "e"; + } else if ( m_last_key == Keys.O ) { + mouth = "o"; + } + } + AppManager.SaveData.DrawTo( g, AppManager.SaveData.m_movieSize, Now, false, mouth, m_realtime_group ); + } + bool pos_fixed = m_editing.Fixed || (m_editing.XFixed && m_editing.YFixed); + if ( pos_fixed ) { + e.Graphics.DrawRectangle( _PEN_FIXED_BOUNDS, m_editing.Bounds ); + } else { + int x = m_editing.Bounds.X; + int y = m_editing.Bounds.Y; + int width = m_editing.Bounds.Width; + int height = m_editing.Bounds.Height; + int pen_width = (int)(_PEN_FIXED_BOUNDS.Width / 2f); +#if DEBUG + //Common.DebugWriteLine( "previewer_PreviewPaint" ); + //Common.DebugWriteLine( " m_editing.XFixed=" + m_editing.XFixed ); + //Common.DebugWriteLine( " m_Editing.YFixed=" + m_editing.YFixed ); +#endif + if ( m_editing.XFixed ) { + e.Graphics.DrawLine( _PEN_FIXED_BOUNDS, + new Point( x, y - pen_width ), + new Point( x, y + height + pen_width ) ); + e.Graphics.DrawLine( _PEN_FIXED_BOUNDS, + new Point( x + width, y - pen_width ), + new Point( x + width, y + height + pen_width ) ); + e.Graphics.DrawLine( _PEN_BOUNDS, + new Point( x + pen_width, y ), + new Point( x - pen_width + width, y ) ); + e.Graphics.DrawLine( _PEN_BOUNDS, + new Point( x + pen_width, y + height ), + new Point( x - pen_width + width, y + height ) ); + } else if ( m_editing.YFixed ){ + e.Graphics.DrawLine( _PEN_BOUNDS, + new Point( x, y + pen_width ), + new Point( x, y - pen_width + height ) ); + e.Graphics.DrawLine( _PEN_BOUNDS, + new Point( x + width, y + pen_width ), + new Point( x + width, y - pen_width + height ) ); + e.Graphics.DrawLine( _PEN_FIXED_BOUNDS, + new Point( x - pen_width, y ), + new Point( x + pen_width + width, y ) ); + e.Graphics.DrawLine( _PEN_FIXED_BOUNDS, + new Point( x - pen_width, y + height ), + new Point( x + pen_width + width, y + height ) ); + } else { + e.Graphics.DrawRectangle( _PEN_BOUNDS, m_editing.Bounds ); + } + } + } + } + #endregion + + private void previewer_TrackBarScroll( object sender, EventArgs e ) { + if ( menuVisualSync.Checked ) { + correctPosition(); + } + this.Invalidate(); + } + + /// + /// + /// + /// + /// + private void previewer_MenuHundredClick( object sender, EventArgs e ) { + previewer.PreviewSizeMode = PictureBoxSizeMode.CenterImage; + AppManager.Config.PreviewZoomMode = previewer.PreviewSizeMode; + } + + private void previewer_MenuFitClick( object sender, EventArgs e ) { + previewer.PreviewSizeMode = PictureBoxSizeMode.Zoom; + AppManager.Config.PreviewZoomMode = previewer.PreviewSizeMode; + } + + private void previewer_LabelTimeMouseDoubleClick( object sender, EventArgs e ) { + PreviewWindowFlipMode(); + } + + private void m_container_Panel2_SizeChanged( object sender, EventArgs e ) { + ResizePanel2(); + } + + #region bgWorkSeriesImage + private void bgWorkSeriesImage_DoWork( object sender, DoWorkEventArgs e ) { + Size size = AppManager.SaveData.m_movieSize; + m_avi_cancel = false; + + long start_frame; + AviOutputArguments args = (AviOutputArguments)e.Argument; + if ( args.StartSpecified ) { + start_frame = (long)(args.Start * AppManager.SaveData.FrameRate); + } else { + start_frame = 0L; + } + + long end_frame; + if ( args.EndSpecified ) { + end_frame = (long)(args.End * AppManager.SaveData.FrameRate); + } else { + end_frame = (long)((AppManager.SaveData.m_totalSec) * AppManager.SaveData.FrameRate); + } + long total_frames = end_frame - start_frame + 1; +#if !DEBUG + try { +#endif + long count = -1; + for ( long frame = start_frame; frame <= end_frame; frame++ ) { + count++; + float now = (float)frame / AppManager.SaveData.FrameRate; + Bitmap frm = GetPicture( now, false ); + try { + string file = Path.Combine( args.AviFile, string.Format( args.FileNameParser, count ) ); + frm.Save( file, args.ImageFormat ); + } catch ( Exception ex ) { +#if DEBUG + Common.LogPush( ex ); +#endif + this.Invoke( new Form1_AviWritingChange( ChangeAviWriting ), new object[] { false } ); + return; + } + bgWorkSeriesImage.ReportProgress( (int)((double)(frame - start_frame) / (double)(total_frames) * 100.0), new long[] { frame - start_frame, total_frames } ); + if ( m_avi_cancel ) { + m_avi_cancel = false; + return; + } + } +#if !DEBUG + } catch { + } +#endif + } + + private void bgWorkSeriesImage_ProgressChanged( object sender, ProgressChangedEventArgs e ) { + long[] stat = (long[])e.UserState; + this.Text = _( "Series Image Progress" ) + " " + e.ProgressPercentage + "% [" + stat[0] + "/" + stat[1] + "]"; + } + + private void bgWorkSeriesImage_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e ) { + this.Invoke( new Form1_AviWritingChange( ChangeAviWriting ), new object[] { false } ); + m_avi_cancel = false; + UpdateFormTitle(); + } + #endregion + + private void timerScreenUpdater_Tick( object sender, EventArgs e ) { + previewer.Invalidate(); + } + + private void menuVisualVsqTrack_CheckedChanged( object sender, EventArgs e ) { + AppManager.Config.FixVsqTrackPosition = menuVisualVsqTrack.Checked; + } + } + +} diff --git a/trunk/LipSync/Editor/Form1.designer.cs b/trunk/LipSync/Editor/Form1.designer.cs new file mode 100644 index 0000000..356eae6 --- /dev/null +++ b/trunk/LipSync/Editor/Form1.designer.cs @@ -0,0 +1,1294 @@ +/* + * Form1.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using Boare.Lib.AppUtil; + +namespace LipSync { + + partial class Form1 { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.preview_image = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.vScrollBar1 = new System.Windows.Forms.VScrollBar(); + this.hScrollBar1 = new System.Windows.Forms.HScrollBar(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.side = new System.Windows.Forms.PictureBox(); + this.openVsqDialog = new System.Windows.Forms.OpenFileDialog(); + this.dialogImage = new System.Windows.Forms.OpenFileDialog(); + this.cmenu = new System.Windows.Forms.ContextMenuStrip( this.components ); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.openLse = new System.Windows.Forms.OpenFileDialog(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.statusTime = new System.Windows.Forms.ToolStripStatusLabel(); + this.statusComment = new System.Windows.Forms.ToolStripStatusLabel(); + this.openRseDialog = new System.Windows.Forms.OpenFileDialog(); + this.saveAviFile = new System.Windows.Forms.SaveFileDialog(); + this.bgWorkAvi = new System.ComponentModel.BackgroundWorker(); + this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.openMusicDialog = new System.Windows.Forms.OpenFileDialog(); + this.cmenuRepeat = new System.Windows.Forms.ContextMenuStrip( this.components ); + this.cmenuRepeatStart = new System.Windows.Forms.ToolStripMenuItem(); + this.cmenuRepeatEnd = new System.Windows.Forms.ToolStripMenuItem(); + this.cmenuRepeatReset = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip2 = new System.Windows.Forms.MenuStrip(); + this.xmenuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileOpen = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileClose = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator(); + this.xmenuFileSave = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileSaveAs = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileImport = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileImportRipsync = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileExport = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileExportHatwune = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileExportVocaloMark = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator(); + this.xmenuFileOpenVsq = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileOutputAvi = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileOutputRawAvi = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileSeriesBitmap = new System.Windows.Forms.ToolStripMenuItem(); + this.xmenuFileOutputAbort = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem10 = new System.Windows.Forms.ToolStripSeparator(); + this.xmenuFileExit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditUndo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditRedo = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.menuEditVideoSize = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditFrameRate = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditZOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditVideoLength = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditShiftTimeline = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator(); + this.menuEditAddCharacter = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditBGColor = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditRealTime = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisual = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualZoomIn = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualZoomOut = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualZoomReset = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualTop = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualEnd = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + this.menuVisualPlayPause = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualRepeat = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualRepeatPlayPause = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualRepeatTop = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualRepeatEnd = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); + this.menuVisualPreview = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualPreviewFlipVisible = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualPreviewSeparate = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualSync = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualObjectList = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + this.menuVisualTransform = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualVsqTrack = new System.Windows.Forms.ToolStripMenuItem(); + this.menuVisualBars = new System.Windows.Forms.ToolStripMenuItem(); + this.menuTool = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolOption = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolMusic = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolMoveTo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize04 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize08 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize16 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize32 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantize64 = new System.Windows.Forms.ToolStripMenuItem(); + this.menuToolQuantizeOff = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); + this.menuToolQuantizeTriplet = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.menuToolPluginConfig = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelp = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpPluginInfo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpVersionInfo = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpBugReport = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpDebug = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpDebugEditCharacter = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpDebugInverseImages = new System.Windows.Forms.ToolStripMenuItem(); + this.menuHelpDebugExtract = new System.Windows.Forms.ToolStripMenuItem(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); + this.previewer = new LipSync.Previewer(); + this.property = new LipSync.Property(); + this.m_container = new Boare.Lib.AppUtil.BSplitContainer(); + this.bgWorkSeriesImage = new System.ComponentModel.BackgroundWorker(); + this.timerScreenUpdater = new System.Windows.Forms.Timer( this.components ); + ((System.ComponentModel.ISupportInitialize)(this.preview_image)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.side)).BeginInit(); + this.statusStrip1.SuspendLayout(); + this.cmenuRepeat.SuspendLayout(); + this.menuStrip2.SuspendLayout(); + this.toolStripContainer1.BottomToolStripPanel.SuspendLayout(); + this.toolStripContainer1.ContentPanel.SuspendLayout(); + this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); + this.toolStripContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // preview_image + // + this.preview_image.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.preview_image.Location = new System.Drawing.Point( 114, 17 ); + this.preview_image.Name = "preview_image"; + this.preview_image.Size = new System.Drawing.Size( 196, 138 ); + this.preview_image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.preview_image.TabIndex = 7; + this.preview_image.TabStop = false; + this.preview_image.Visible = false; + this.preview_image.MouseLeave += new System.EventHandler( this.preview_image_MouseLeave ); + // + // pictureBox2 + // + this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox2.Location = new System.Drawing.Point( 428, 241 ); + this.pictureBox2.MaximumSize = new System.Drawing.Size( 16, 16 ); + this.pictureBox2.MinimumSize = new System.Drawing.Size( 16, 16 ); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size( 16, 16 ); + this.pictureBox2.TabIndex = 18; + this.pictureBox2.TabStop = false; + // + // vScrollBar1 + // + this.vScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.vScrollBar1.Enabled = false; + this.vScrollBar1.Location = new System.Drawing.Point( 428, 0 ); + this.vScrollBar1.Maximum = 200; + this.vScrollBar1.Name = "vScrollBar1"; + this.vScrollBar1.Size = new System.Drawing.Size( 16, 241 ); + this.vScrollBar1.TabIndex = 17; + this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler( this.vScrollBar1_Scroll ); + // + // hScrollBar1 + // + this.hScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hScrollBar1.Enabled = false; + this.hScrollBar1.Location = new System.Drawing.Point( 19, 241 ); + this.hScrollBar1.Name = "hScrollBar1"; + this.hScrollBar1.Size = new System.Drawing.Size( 409, 16 ); + this.hScrollBar1.TabIndex = 16; + this.hScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler( this.hScrollBar1_Scroll ); + // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.Location = new System.Drawing.Point( 19, 0 ); + this.pictureBox1.Margin = new System.Windows.Forms.Padding( 0 ); + this.pictureBox1.MinimumSize = new System.Drawing.Size( 100, 100 ); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size( 409, 241 ); + this.pictureBox1.TabIndex = 15; + this.pictureBox1.TabStop = false; + this.pictureBox1.MouseLeave += new System.EventHandler( this.pictureBox1_MouseLeave ); + this.pictureBox1.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler( this.pictureBox1_PreviewKeyDown ); + this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseMove ); + this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseDoubleClick ); + this.pictureBox1.MouseClick += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseClick ); + this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseDown ); + this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler( this.pictureBox1_Paint ); + this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseUp ); + // + // side + // + this.side.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.side.BackColor = System.Drawing.Color.Silver; + this.side.Location = new System.Drawing.Point( 0, 0 ); + this.side.Margin = new System.Windows.Forms.Padding( 0 ); + this.side.Name = "side"; + this.side.Size = new System.Drawing.Size( 19, 257 ); + this.side.TabIndex = 11; + this.side.TabStop = false; + this.side.MouseClick += new System.Windows.Forms.MouseEventHandler( this.side_MouseClick ); + this.side.Paint += new System.Windows.Forms.PaintEventHandler( this.side_Paint ); + // + // openVsqDialog + // + this.openVsqDialog.Filter = "VOCALOID2 Sequence File(*.vsq)|*.vsq|all files(*.*)|*.*"; + // + // dialogImage + // + this.dialogImage.Filter = "Image Files|*.bmp;*.png;*.jpg|All Files|*.*"; + // + // cmenu + // + this.cmenu.Name = "cmenu"; + this.cmenu.ShowImageMargin = false; + this.cmenu.ShowItemToolTips = false; + this.cmenu.Size = new System.Drawing.Size( 36, 4 ); + // + // saveFileDialog1 + // + this.saveFileDialog1.Filter = "Lip Sync(*.lse)|*.lse|all files(*.*)|*.*"; + // + // openLse + // + this.openLse.Filter = "Lip Sync(*.lse)|*.lse|all files(*.*)|*.*"; + // + // statusStrip1 + // + this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None; + this.statusStrip1.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.statusLabel, + this.statusTime, + this.statusComment} ); + this.statusStrip1.Location = new System.Drawing.Point( 0, 0 ); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size( 958, 22 ); + this.statusStrip1.TabIndex = 8; + this.statusStrip1.Text = "statusStrip1"; + // + // statusLabel + // + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size( 0, 17 ); + // + // statusTime + // + this.statusTime.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); + this.statusTime.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; + this.statusTime.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.statusTime.Name = "statusTime"; + this.statusTime.Size = new System.Drawing.Size( 51, 17 ); + this.statusTime.Text = "0.00 sec"; + // + // statusComment + // + this.statusComment.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) + | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); + this.statusComment.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; + this.statusComment.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.statusComment.Name = "statusComment"; + this.statusComment.Size = new System.Drawing.Size( 4, 17 ); + // + // openRseDialog + // + this.openRseDialog.Filter = "Rip Sync(*.rsp)|*.rsp|all files(*.*)|*.*"; + // + // saveAviFile + // + this.saveAviFile.Filter = "avi|*.avi"; + // + // bgWorkAvi + // + this.bgWorkAvi.WorkerReportsProgress = true; + this.bgWorkAvi.WorkerSupportsCancellation = true; + this.bgWorkAvi.DoWork += new System.ComponentModel.DoWorkEventHandler( this.bgWorkAvi_DoWork ); + this.bgWorkAvi.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler( this.bgWorkAvi_RunWorkerCompleted ); + this.bgWorkAvi.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler( this.bgWorkAvi_ProgressChanged ); + // + // openMusicDialog + // + this.openMusicDialog.FileName = "openFileDialog1"; + // + // cmenuRepeat + // + this.cmenuRepeat.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.cmenuRepeatStart, + this.cmenuRepeatEnd, + this.cmenuRepeatReset} ); + this.cmenuRepeat.Name = "cmenuRepeat"; + this.cmenuRepeat.ShowImageMargin = false; + this.cmenuRepeat.Size = new System.Drawing.Size( 161, 70 ); + this.cmenuRepeat.Opening += new System.ComponentModel.CancelEventHandler( this.cmenuRepeat_Opening ); + // + // cmenuRepeatStart + // + this.cmenuRepeatStart.Name = "cmenuRepeatStart"; + this.cmenuRepeatStart.Size = new System.Drawing.Size( 160, 22 ); + this.cmenuRepeatStart.Text = "繝ェ繝斐シ繝磯幕蟋倶ス咲スョ縺ォ謖螳"; + this.cmenuRepeatStart.Click += new System.EventHandler( this.cmenuRepeatStart_Click ); + // + // cmenuRepeatEnd + // + this.cmenuRepeatEnd.Name = "cmenuRepeatEnd"; + this.cmenuRepeatEnd.Size = new System.Drawing.Size( 160, 22 ); + this.cmenuRepeatEnd.Text = "繝ェ繝斐シ繝育オゆコ菴咲スョ縺ォ謖螳"; + this.cmenuRepeatEnd.Click += new System.EventHandler( this.cmenuRepeatEnd_Click ); + // + // cmenuRepeatReset + // + this.cmenuRepeatReset.Name = "cmenuRepeatReset"; + this.cmenuRepeatReset.Size = new System.Drawing.Size( 160, 22 ); + this.cmenuRepeatReset.Text = "繝ェ繝斐シ繝育ッ蝗イ繧偵Μ繧サ繝繝"; + this.cmenuRepeatReset.Click += new System.EventHandler( this.cmenuRepeatReset_Click ); + // + // menuStrip2 + // + this.menuStrip2.Dock = System.Windows.Forms.DockStyle.None; + this.menuStrip2.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.xmenuFile, + this.menuEdit, + this.menuVisual, + this.menuTool, + this.menuHelp} ); + this.menuStrip2.Location = new System.Drawing.Point( 0, 0 ); + this.menuStrip2.Name = "menuStrip2"; + this.menuStrip2.Size = new System.Drawing.Size( 958, 24 ); + this.menuStrip2.TabIndex = 12; + this.menuStrip2.Text = "menuStrip2"; + // + // xmenuFile + // + this.xmenuFile.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.xmenuFileOpen, + this.xmenuFileClose, + this.toolStripMenuItem8, + this.xmenuFileSave, + this.xmenuFileSaveAs, + this.xmenuFileImport, + this.xmenuFileExport, + this.toolStripMenuItem9, + this.xmenuFileOpenVsq, + this.xmenuFileOutputAvi, + this.xmenuFileOutputRawAvi, + this.xmenuFileSeriesBitmap, + this.xmenuFileOutputAbort, + this.toolStripMenuItem10, + this.xmenuFileExit} ); + this.xmenuFile.Name = "xmenuFile"; + this.xmenuFile.Size = new System.Drawing.Size( 66, 20 ); + this.xmenuFile.Text = "繝輔ぃ繧、繝ォ(&F)"; + this.xmenuFile.DropDownOpening += new System.EventHandler( this.xmenuFile_DropDownOpening ); + // + // xmenuFileOpen + // + this.xmenuFileOpen.Name = "xmenuFileOpen"; + this.xmenuFileOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.xmenuFileOpen.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileOpen.Text = "髢九¥(&O)"; + this.xmenuFileOpen.Click += new System.EventHandler( this.xmenuFileOpen_Click ); + // + // xmenuFileClose + // + this.xmenuFileClose.Name = "xmenuFileClose"; + this.xmenuFileClose.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileClose.Text = "髢峨§繧(&C)"; + this.xmenuFileClose.Click += new System.EventHandler( this.xmenuFileClose_Click ); + // + // toolStripMenuItem8 + // + this.toolStripMenuItem8.Name = "toolStripMenuItem8"; + this.toolStripMenuItem8.Size = new System.Drawing.Size( 155, 6 ); + // + // xmenuFileSave + // + this.xmenuFileSave.Name = "xmenuFileSave"; + this.xmenuFileSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.xmenuFileSave.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileSave.Text = "菫晏ュ(&S)"; + this.xmenuFileSave.Click += new System.EventHandler( this.xmenuFileSave_Click ); + // + // xmenuFileSaveAs + // + this.xmenuFileSaveAs.Name = "xmenuFileSaveAs"; + this.xmenuFileSaveAs.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileSaveAs.Text = "蛻・蜷阪〒菫晏ュ(&A)"; + this.xmenuFileSaveAs.Click += new System.EventHandler( this.xmenuFileSaveAs_Click ); + // + // xmenuFileImport + // + this.xmenuFileImport.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.xmenuFileImportRipsync} ); + this.xmenuFileImport.Name = "xmenuFileImport"; + this.xmenuFileImport.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileImport.Text = "繧、繝ウ繝昴シ繝(&I)"; + // + // xmenuFileImportRipsync + // + this.xmenuFileImportRipsync.Name = "xmenuFileImportRipsync"; + this.xmenuFileImportRipsync.Size = new System.Drawing.Size( 140, 22 ); + this.xmenuFileImportRipsync.Text = "RipSync繝繝シ繧ソ"; + this.xmenuFileImportRipsync.Click += new System.EventHandler( this.xmenuFileImportRipsync_Click ); + // + // xmenuFileExport + // + this.xmenuFileExport.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.xmenuFileExportHatwune, + this.xmenuFileExportVocaloMark} ); + this.xmenuFileExport.Name = "xmenuFileExport"; + this.xmenuFileExport.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileExport.Text = "繧ィ繧ッ繧ケ繝昴シ繝"; + // + // xmenuFileExportHatwune + // + this.xmenuFileExportHatwune.Name = "xmenuFileExportHatwune"; + this.xmenuFileExportHatwune.Size = new System.Drawing.Size( 200, 22 ); + this.xmenuFileExportHatwune.Text = "縺ッ縺ィ縺縺ュ繝吶Φ繝∫畑繧ケ繧ッ繝ェ繝励ヨ"; + this.xmenuFileExportHatwune.Click += new System.EventHandler( this.xmenuFileExportHatwune_Click ); + // + // xmenuFileExportVocaloMark + // + this.xmenuFileExportVocaloMark.Name = "xmenuFileExportVocaloMark"; + this.xmenuFileExportVocaloMark.Size = new System.Drawing.Size( 200, 22 ); + this.xmenuFileExportVocaloMark.Text = "Script for VOCALOMARK"; + this.xmenuFileExportVocaloMark.Click += new System.EventHandler( this.xmenuFileExportVocaloMark_Click ); + // + // toolStripMenuItem9 + // + this.toolStripMenuItem9.Name = "toolStripMenuItem9"; + this.toolStripMenuItem9.Size = new System.Drawing.Size( 155, 6 ); + // + // xmenuFileOpenVsq + // + this.xmenuFileOpenVsq.Name = "xmenuFileOpenVsq"; + this.xmenuFileOpenVsq.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileOpenVsq.Text = "VSQ繧帝幕縺(&O)"; + this.xmenuFileOpenVsq.Click += new System.EventHandler( this.xmenuFileOpenVsq_Click ); + // + // xmenuFileOutputAvi + // + this.xmenuFileOutputAvi.Name = "xmenuFileOutputAvi"; + this.xmenuFileOutputAvi.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileOutputAvi.Text = "AVI蜃コ蜉(&S)"; + this.xmenuFileOutputAvi.Click += new System.EventHandler( this.menuFileOutputAvi_Click ); + // + // xmenuFileOutputRawAvi + // + this.xmenuFileOutputRawAvi.Name = "xmenuFileOutputRawAvi"; + this.xmenuFileOutputRawAvi.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileOutputRawAvi.Text = "辟。蝨ァ邵ョAVI繧貞コ蜉"; + this.xmenuFileOutputRawAvi.Click += new System.EventHandler( this.menuFileOutputRawAvi_Click ); + // + // xmenuFileSeriesBitmap + // + this.xmenuFileSeriesBitmap.Name = "xmenuFileSeriesBitmap"; + this.xmenuFileSeriesBitmap.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileSeriesBitmap.Text = "騾」逡ェ繝薙ャ繝医槭ャ繝"; + this.xmenuFileSeriesBitmap.Click += new System.EventHandler( this.xmenuFileSeriesBitmap_Click ); + // + // xmenuFileOutputAbort + // + this.xmenuFileOutputAbort.Enabled = false; + this.xmenuFileOutputAbort.Name = "xmenuFileOutputAbort"; + this.xmenuFileOutputAbort.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileOutputAbort.Text = "蜃コ蜉帙ョ荳ュ譁ュ(&E)"; + this.xmenuFileOutputAbort.Click += new System.EventHandler( this.xmenuFileOutputAbort_Click ); + // + // toolStripMenuItem10 + // + this.toolStripMenuItem10.Name = "toolStripMenuItem10"; + this.toolStripMenuItem10.Size = new System.Drawing.Size( 155, 6 ); + // + // xmenuFileExit + // + this.xmenuFileExit.Name = "xmenuFileExit"; + this.xmenuFileExit.Size = new System.Drawing.Size( 158, 22 ); + this.xmenuFileExit.Text = "邨ゆコ(&X)"; + this.xmenuFileExit.Click += new System.EventHandler( this.xmenuFileExit_Click ); + // + // menuEdit + // + this.menuEdit.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuEditUndo, + this.menuEditRedo, + this.toolStripMenuItem1, + this.menuEditVideoSize, + this.menuEditFrameRate, + this.menuEditZOrder, + this.menuEditVideoLength, + this.menuEditShiftTimeline, + this.toolStripMenuItem11, + this.menuEditAddCharacter, + this.menuEditBGColor, + this.menuEditRealTime} ); + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size( 56, 20 ); + this.menuEdit.Text = "邱ィ髮(&E)"; + this.menuEdit.DropDownOpening += new System.EventHandler( this.menuEdit_DropDownOpening ); + // + // menuEditUndo + // + this.menuEditUndo.Enabled = false; + this.menuEditUndo.Name = "menuEditUndo"; + this.menuEditUndo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.menuEditUndo.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditUndo.Text = "蜈縺ォ謌サ縺(&U)"; + this.menuEditUndo.Click += new System.EventHandler( this.menuEditUndo_Click ); + // + // menuEditRedo + // + this.menuEditRedo.Enabled = false; + this.menuEditRedo.Name = "menuEditRedo"; + this.menuEditRedo.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.Z))); + this.menuEditRedo.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditRedo.Text = "繧繧顔峩縺(&R)"; + this.menuEditRedo.Click += new System.EventHandler( this.menuEditRedo_Click ); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size( 189, 6 ); + // + // menuEditVideoSize + // + this.menuEditVideoSize.Name = "menuEditVideoSize"; + this.menuEditVideoSize.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditVideoSize.Text = "繝薙ョ繧ェ繧オ繧、繧コ(&V)"; + this.menuEditVideoSize.Click += new System.EventHandler( this.menuEditVideoSize_Click ); + // + // menuEditFrameRate + // + this.menuEditFrameRate.Name = "menuEditFrameRate"; + this.menuEditFrameRate.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditFrameRate.Text = "繝輔Ξ繝シ繝繝ャ繝シ繝(&F)"; + this.menuEditFrameRate.Click += new System.EventHandler( this.menuEditFrameRate_Click ); + // + // menuEditZOrder + // + this.menuEditZOrder.Name = "menuEditZOrder"; + this.menuEditZOrder.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditZOrder.Text = "謠冗判鬆蠎(&Z)"; + this.menuEditZOrder.Click += new System.EventHandler( this.menuEditZOrder_Click ); + // + // menuEditVideoLength + // + this.menuEditVideoLength.Name = "menuEditVideoLength"; + this.menuEditVideoLength.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditVideoLength.Text = "繝薙ョ繧ェ縺ョ髟キ縺輔r螟画峩(&C)"; + this.menuEditVideoLength.Click += new System.EventHandler( this.menuEditVideoLength_Click ); + // + // menuEditShiftTimeline + // + this.menuEditShiftTimeline.Name = "menuEditShiftTimeline"; + this.menuEditShiftTimeline.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditShiftTimeline.Text = "蜈ィ繧ソ繧、繝繝ゥ繧、繝ウ繧偵す繝輔ヨ(&S)"; + this.menuEditShiftTimeline.Click += new System.EventHandler( this.menuEditShiftTimeline_Click ); + // + // toolStripMenuItem11 + // + this.toolStripMenuItem11.Name = "toolStripMenuItem11"; + this.toolStripMenuItem11.Size = new System.Drawing.Size( 189, 6 ); + // + // menuEditAddCharacter + // + this.menuEditAddCharacter.Name = "menuEditAddCharacter"; + this.menuEditAddCharacter.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditAddCharacter.Text = "遨コ縺ョ繧ュ繝」繝ゥ繧ッ繧ソ繧定ソス蜉(&A)"; + this.menuEditAddCharacter.Click += new System.EventHandler( this.menuEditAddCharacter_Click ); + // + // menuEditBGColor + // + this.menuEditBGColor.Name = "menuEditBGColor"; + this.menuEditBGColor.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditBGColor.Text = "閭梧勹濶イ(&B)"; + this.menuEditBGColor.Click += new System.EventHandler( this.menuEditBGColor_Click ); + // + // menuEditRealTime + // + this.menuEditRealTime.CheckOnClick = true; + this.menuEditRealTime.Name = "menuEditRealTime"; + this.menuEditRealTime.ShortcutKeys = System.Windows.Forms.Keys.F4; + this.menuEditRealTime.Size = new System.Drawing.Size( 192, 22 ); + this.menuEditRealTime.Text = "繝ェ繧「繝ォ繧ソ繧、繝謇薙■霎シ縺ソ"; + this.menuEditRealTime.Click += new System.EventHandler( this.menuEditRealTime_Click ); + // + // menuVisual + // + this.menuVisual.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuVisualZoomIn, + this.menuVisualZoomOut, + this.menuVisualZoomReset, + this.menuVisualTop, + this.menuVisualEnd, + this.toolStripMenuItem6, + this.menuVisualPlayPause, + this.menuVisualRepeat, + this.toolStripMenuItem12, + this.menuVisualPreview, + this.menuVisualSync, + this.menuVisualObjectList, + this.toolStripMenuItem13, + this.menuVisualTransform, + this.menuVisualVsqTrack, + this.menuVisualBars} ); + this.menuVisual.Name = "menuVisual"; + this.menuVisual.Size = new System.Drawing.Size( 57, 20 ); + this.menuVisual.Text = "陦ィ遉コ(&V)"; + // + // menuVisualZoomIn + // + this.menuVisualZoomIn.Name = "menuVisualZoomIn"; + this.menuVisualZoomIn.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Up))); + this.menuVisualZoomIn.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualZoomIn.Text = "諡。螟ァ(&I)"; + this.menuVisualZoomIn.Click += new System.EventHandler( this.menuVisualZoomIn_Click ); + // + // menuVisualZoomOut + // + this.menuVisualZoomOut.Name = "menuVisualZoomOut"; + this.menuVisualZoomOut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Down))); + this.menuVisualZoomOut.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualZoomOut.Text = "邵ョ蟆(&O)"; + this.menuVisualZoomOut.Click += new System.EventHandler( this.menuVisualZoomOut_Click ); + // + // menuVisualZoomReset + // + this.menuVisualZoomReset.Name = "menuVisualZoomReset"; + this.menuVisualZoomReset.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualZoomReset.Text = "蜈縺ョ蛟咲紫(&R)"; + this.menuVisualZoomReset.Click += new System.EventHandler( this.menuVisualZoomReset_Click ); + // + // menuVisualTop + // + this.menuVisualTop.Name = "menuVisualTop"; + this.menuVisualTop.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Home))); + this.menuVisualTop.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualTop.Text = "蜈磯ュ縺ク"; + this.menuVisualTop.Click += new System.EventHandler( this.menuVisualTop_Click ); + // + // menuVisualEnd + // + this.menuVisualEnd.Name = "menuVisualEnd"; + this.menuVisualEnd.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.End))); + this.menuVisualEnd.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualEnd.Text = "譛蠕後∈"; + this.menuVisualEnd.Click += new System.EventHandler( this.menuVisualEnd_Click ); + // + // toolStripMenuItem6 + // + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size( 205, 6 ); + // + // menuVisualPlayPause + // + this.menuVisualPlayPause.Name = "menuVisualPlayPause"; + this.menuVisualPlayPause.ShortcutKeys = System.Windows.Forms.Keys.F5; + this.menuVisualPlayPause.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualPlayPause.Text = "蜀咲函/荳譎ょ●豁「"; + this.menuVisualPlayPause.Click += new System.EventHandler( this.menuVisualPlayPause_Click ); + // + // menuVisualRepeat + // + this.menuVisualRepeat.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuVisualRepeatPlayPause, + this.menuVisualRepeatTop, + this.menuVisualRepeatEnd} ); + this.menuVisualRepeat.Name = "menuVisualRepeat"; + this.menuVisualRepeat.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualRepeat.Text = "繝ェ繝斐シ繝亥咲函"; + // + // menuVisualRepeatPlayPause + // + this.menuVisualRepeatPlayPause.Name = "menuVisualRepeatPlayPause"; + this.menuVisualRepeatPlayPause.ShortcutKeys = System.Windows.Forms.Keys.F3; + this.menuVisualRepeatPlayPause.Size = new System.Drawing.Size( 166, 22 ); + this.menuVisualRepeatPlayPause.Text = "蜀咲函/荳譎ょ●豁「"; + this.menuVisualRepeatPlayPause.Click += new System.EventHandler( this.menuVisualRepeatPlayPause_Click ); + // + // menuVisualRepeatTop + // + this.menuVisualRepeatTop.Name = "menuVisualRepeatTop"; + this.menuVisualRepeatTop.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Left))); + this.menuVisualRepeatTop.Size = new System.Drawing.Size( 166, 22 ); + this.menuVisualRepeatTop.Text = "蜈磯ュ縺ク"; + this.menuVisualRepeatTop.Click += new System.EventHandler( this.menuVisualRepeatTop_Click ); + // + // menuVisualRepeatEnd + // + this.menuVisualRepeatEnd.Name = "menuVisualRepeatEnd"; + this.menuVisualRepeatEnd.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Right))); + this.menuVisualRepeatEnd.Size = new System.Drawing.Size( 166, 22 ); + this.menuVisualRepeatEnd.Text = "譛蠕後∈"; + this.menuVisualRepeatEnd.Click += new System.EventHandler( this.menuVisualRepeatEnd_Click ); + // + // toolStripMenuItem12 + // + this.toolStripMenuItem12.Name = "toolStripMenuItem12"; + this.toolStripMenuItem12.Size = new System.Drawing.Size( 205, 6 ); + // + // menuVisualPreview + // + this.menuVisualPreview.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuVisualPreviewFlipVisible, + this.menuVisualPreviewSeparate} ); + this.menuVisualPreview.Name = "menuVisualPreview"; + this.menuVisualPreview.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualPreview.Text = "繝励Ξ繝薙Η繝シ"; + // + // menuVisualPreviewFlipVisible + // + this.menuVisualPreviewFlipVisible.Name = "menuVisualPreviewFlipVisible"; + this.menuVisualPreviewFlipVisible.ShortcutKeys = System.Windows.Forms.Keys.F6; + this.menuVisualPreviewFlipVisible.Size = new System.Drawing.Size( 199, 22 ); + this.menuVisualPreviewFlipVisible.Text = "繝励Ξ繝薙Η繝シ繧帝撼陦ィ遉コ"; + this.menuVisualPreviewFlipVisible.Click += new System.EventHandler( this.menuVisualPreviewFlipVisible_Click ); + // + // menuVisualPreviewSeparate + // + this.menuVisualPreviewSeparate.CheckOnClick = true; + this.menuVisualPreviewSeparate.Name = "menuVisualPreviewSeparate"; + this.menuVisualPreviewSeparate.Size = new System.Drawing.Size( 199, 22 ); + this.menuVisualPreviewSeparate.Text = "繝励Ξ繝薙Η繝シ繧偵え繧」繝ウ繝峨え縺ォ蛻髮「"; + this.menuVisualPreviewSeparate.Click += new System.EventHandler( this.menuVisualPreviewSeparate_Click ); + // + // menuVisualSync + // + this.menuVisualSync.CheckOnClick = true; + this.menuVisualSync.Name = "menuVisualSync"; + this.menuVisualSync.ShortcutKeys = System.Windows.Forms.Keys.F7; + this.menuVisualSync.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualSync.Text = "繧ソ繧、繝繝繝シ繝悶Ν縺ィ繧キ繝ウ繧ッ繝ュ"; + // + // menuVisualObjectList + // + this.menuVisualObjectList.Name = "menuVisualObjectList"; + this.menuVisualObjectList.ShortcutKeys = System.Windows.Forms.Keys.F8; + this.menuVisualObjectList.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualObjectList.Text = "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医r髱櫁。ィ遉コ"; + this.menuVisualObjectList.Click += new System.EventHandler( this.menuVisualObjectList_Click ); + // + // toolStripMenuItem13 + // + this.toolStripMenuItem13.Name = "toolStripMenuItem13"; + this.toolStripMenuItem13.Size = new System.Drawing.Size( 205, 6 ); + // + // menuVisualTransform + // + this.menuVisualTransform.CheckOnClick = true; + this.menuVisualTransform.Name = "menuVisualTransform"; + this.menuVisualTransform.ShortcutKeys = System.Windows.Forms.Keys.F9; + this.menuVisualTransform.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualTransform.Text = "螟我ス阪ョ蛻カ蠕。"; + this.menuVisualTransform.CheckedChanged += new System.EventHandler( this.menuVisualTransform_CheckedChanged ); + // + // menuVisualVsqTrack + // + this.menuVisualVsqTrack.CheckOnClick = true; + this.menuVisualVsqTrack.Name = "menuVisualVsqTrack"; + this.menuVisualVsqTrack.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualVsqTrack.Text = "VSQ繝医Λ繝繧ッ繧貞クク縺ォ陦ィ遉コ"; + this.menuVisualVsqTrack.CheckedChanged += new System.EventHandler( this.menuVisualVsqTrack_CheckedChanged ); + // + // menuVisualBars + // + this.menuVisualBars.CheckOnClick = true; + this.menuVisualBars.Name = "menuVisualBars"; + this.menuVisualBars.Size = new System.Drawing.Size( 208, 22 ); + this.menuVisualBars.Text = "蟆冗ッ縺ョ蠅逡後r陦ィ遉コ"; + // + // menuTool + // + this.menuTool.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuToolOption, + this.menuToolMusic, + this.menuToolMoveTo, + this.menuToolQuantize, + this.toolStripMenuItem2, + this.menuToolPluginConfig} ); + this.menuTool.Name = "menuTool"; + this.menuTool.Size = new System.Drawing.Size( 61, 20 ); + this.menuTool.Text = "繝繝シ繝ォ(&T)"; + // + // menuToolOption + // + this.menuToolOption.Name = "menuToolOption"; + this.menuToolOption.Size = new System.Drawing.Size( 218, 22 ); + this.menuToolOption.Text = "繧ェ繝励す繝ァ繝ウ(&O)"; + this.menuToolOption.Click += new System.EventHandler( this.menuToolOption_Click ); + // + // menuToolMusic + // + this.menuToolMusic.Name = "menuToolMusic"; + this.menuToolMusic.Size = new System.Drawing.Size( 218, 22 ); + this.menuToolMusic.Text = "蜷梧凾蜀咲函縺吶k譖イ(&M)"; + this.menuToolMusic.Click += new System.EventHandler( this.menuToolMusic_Click ); + // + // menuToolMoveTo + // + this.menuToolMoveTo.Name = "menuToolMoveTo"; + this.menuToolMoveTo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); + this.menuToolMoveTo.Size = new System.Drawing.Size( 218, 22 ); + this.menuToolMoveTo.Text = "謖螳壹ヵ繝ャ繝シ繝縺ォ遘サ蜍(&G)"; + this.menuToolMoveTo.Click += new System.EventHandler( this.menuToolMoveTo_Click ); + // + // menuToolQuantize + // + this.menuToolQuantize.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuToolQuantize04, + this.menuToolQuantize08, + this.menuToolQuantize16, + this.menuToolQuantize32, + this.menuToolQuantize64, + this.menuToolQuantizeOff, + this.toolStripMenuItem3, + this.menuToolQuantizeTriplet} ); + this.menuToolQuantize.Name = "menuToolQuantize"; + this.menuToolQuantize.Size = new System.Drawing.Size( 218, 22 ); + this.menuToolQuantize.Text = "繧ッ繧ゥ繝ウ繧ソ繧、繧コ(&Q)"; + // + // menuToolQuantize04 + // + this.menuToolQuantize04.Name = "menuToolQuantize04"; + this.menuToolQuantize04.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantize04.Text = "1/4"; + this.menuToolQuantize04.Click += new System.EventHandler( this.menuToolQuantize04_Click ); + // + // menuToolQuantize08 + // + this.menuToolQuantize08.Name = "menuToolQuantize08"; + this.menuToolQuantize08.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantize08.Text = "1/8"; + this.menuToolQuantize08.Click += new System.EventHandler( this.menuToolQuantize08_Click ); + // + // menuToolQuantize16 + // + this.menuToolQuantize16.Name = "menuToolQuantize16"; + this.menuToolQuantize16.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantize16.Text = "1/16"; + this.menuToolQuantize16.Click += new System.EventHandler( this.menuToolQuantize16_Click ); + // + // menuToolQuantize32 + // + this.menuToolQuantize32.Name = "menuToolQuantize32"; + this.menuToolQuantize32.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantize32.Text = "1/32"; + this.menuToolQuantize32.Click += new System.EventHandler( this.menuToolQuantize32_Click ); + // + // menuToolQuantize64 + // + this.menuToolQuantize64.Name = "menuToolQuantize64"; + this.menuToolQuantize64.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantize64.Text = "1/64"; + this.menuToolQuantize64.Click += new System.EventHandler( this.menuToolQuantize64_Click ); + // + // menuToolQuantizeOff + // + this.menuToolQuantizeOff.Checked = true; + this.menuToolQuantizeOff.CheckState = System.Windows.Forms.CheckState.Checked; + this.menuToolQuantizeOff.Name = "menuToolQuantizeOff"; + this.menuToolQuantizeOff.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantizeOff.Text = "繧ェ繝"; + this.menuToolQuantizeOff.Click += new System.EventHandler( this.menuToolQuantizeOff_Click ); + // + // toolStripMenuItem3 + // + this.toolStripMenuItem3.Name = "toolStripMenuItem3"; + this.toolStripMenuItem3.Size = new System.Drawing.Size( 97, 6 ); + // + // menuToolQuantizeTriplet + // + this.menuToolQuantizeTriplet.CheckOnClick = true; + this.menuToolQuantizeTriplet.Name = "menuToolQuantizeTriplet"; + this.menuToolQuantizeTriplet.Size = new System.Drawing.Size( 100, 22 ); + this.menuToolQuantizeTriplet.Text = "3騾」隨ヲ"; + this.menuToolQuantizeTriplet.CheckedChanged += new System.EventHandler( this.menuToolQuantizeTriplet_CheckedChanged ); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size( 215, 6 ); + // + // menuToolPluginConfig + // + this.menuToolPluginConfig.Name = "menuToolPluginConfig"; + this.menuToolPluginConfig.Size = new System.Drawing.Size( 218, 22 ); + this.menuToolPluginConfig.Text = "繝励Λ繧ー繧、繝ウ險ュ螳(&G)"; + // + // menuHelp + // + this.menuHelp.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuHelpPluginInfo, + this.menuHelpVersionInfo, + this.menuHelpBugReport, + this.menuHelpDebug} ); + this.menuHelp.Name = "menuHelp"; + this.menuHelp.Size = new System.Drawing.Size( 62, 20 ); + this.menuHelp.Text = "繝倥Ν繝(&H)"; + // + // menuHelpPluginInfo + // + this.menuHelpPluginInfo.Name = "menuHelpPluginInfo"; + this.menuHelpPluginInfo.Size = new System.Drawing.Size( 163, 22 ); + this.menuHelpPluginInfo.Text = "繝励Λ繧ー繧、繝ウ諠蝣ア(&P)"; + // + // menuHelpVersionInfo + // + this.menuHelpVersionInfo.Name = "menuHelpVersionInfo"; + this.menuHelpVersionInfo.Size = new System.Drawing.Size( 163, 22 ); + this.menuHelpVersionInfo.Text = "LipSync縺ォ縺、縺縺ヲ(&A)"; + this.menuHelpVersionInfo.Click += new System.EventHandler( this.menuHelpVersionInfo_Click ); + // + // menuHelpBugReport + // + this.menuHelpBugReport.Name = "menuHelpBugReport"; + this.menuHelpBugReport.Size = new System.Drawing.Size( 163, 22 ); + this.menuHelpBugReport.Text = "繝舌げ繝ャ繝昴シ繝(&B)"; + this.menuHelpBugReport.Click += new System.EventHandler( this.menuHelpBugReport_Click ); + // + // menuHelpDebug + // + this.menuHelpDebug.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuHelpDebugEditCharacter, + this.menuHelpDebugInverseImages, + this.menuHelpDebugExtract} ); + this.menuHelpDebug.Name = "menuHelpDebug"; + this.menuHelpDebug.Size = new System.Drawing.Size( 163, 22 ); + this.menuHelpDebug.Text = "繝繝舌ャ繧ー"; + this.menuHelpDebug.Visible = false; + // + // menuHelpDebugEditCharacter + // + this.menuHelpDebugEditCharacter.Name = "menuHelpDebugEditCharacter"; + this.menuHelpDebugEditCharacter.ShortcutKeys = ((System.Windows.Forms.Keys)((((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) + | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.Q))); + this.menuHelpDebugEditCharacter.Size = new System.Drawing.Size( 295, 22 ); + this.menuHelpDebugEditCharacter.Text = "繧ュ繝」繝ゥ繧ッ繧ソ繧堤キィ髮"; + this.menuHelpDebugEditCharacter.Click += new System.EventHandler( this.menuHelpDebugEditCharacter_Click ); + // + // menuHelpDebugInverseImages + // + this.menuHelpDebugInverseImages.Name = "menuHelpDebugInverseImages"; + this.menuHelpDebugInverseImages.ShortcutKeys = ((System.Windows.Forms.Keys)((((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) + | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.W))); + this.menuHelpDebugInverseImages.Size = new System.Drawing.Size( 295, 22 ); + this.menuHelpDebugInverseImages.Text = "縺昴ョ莉悶ョ繧、繝。繝シ繧ク繧貞キヲ蜿ウ蜿崎サ「"; + this.menuHelpDebugInverseImages.Click += new System.EventHandler( this.menuHelpDebugInverseImages_Click ); + // + // menuHelpDebugExtract + // + this.menuHelpDebugExtract.Name = "menuHelpDebugExtract"; + this.menuHelpDebugExtract.ShortcutKeys = ((System.Windows.Forms.Keys)((((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) + | System.Windows.Forms.Keys.Shift) + | System.Windows.Forms.Keys.E))); + this.menuHelpDebugExtract.Size = new System.Drawing.Size( 295, 22 ); + this.menuHelpDebugExtract.Text = "謚ス蜃コ"; + this.menuHelpDebugExtract.Click += new System.EventHandler( this.menuHelpDebugExtract_Click ); + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // toolStripContainer1 + // + // + // toolStripContainer1.BottomToolStripPanel + // + this.toolStripContainer1.BottomToolStripPanel.Controls.Add( this.statusStrip1 ); + // + // toolStripContainer1.ContentPanel + // + this.toolStripContainer1.ContentPanel.Controls.Add( this.pictureBox1 ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.hScrollBar1 ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.pictureBox2 ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.side ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.vScrollBar1 ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.previewer ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.preview_image ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.property ); + this.toolStripContainer1.ContentPanel.Controls.Add( this.m_container ); + this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size( 958, 437 ); + this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.toolStripContainer1.Location = new System.Drawing.Point( 1, 1 ); + this.toolStripContainer1.Name = "toolStripContainer1"; + this.toolStripContainer1.Size = new System.Drawing.Size( 958, 483 ); + this.toolStripContainer1.TabIndex = 20; + this.toolStripContainer1.Text = "toolStripContainer1"; + // + // toolStripContainer1.TopToolStripPanel + // + this.toolStripContainer1.TopToolStripPanel.Controls.Add( this.menuStrip2 ); + // + // previewer + // + this.previewer.CheckMuteChecked = false; + this.previewer.Image = null; + this.previewer.LabelSpeedText = "x1.0"; + this.previewer.LabelTimeText = "0.0s"; + this.previewer.Location = new System.Drawing.Point( 0, 0 ); + this.previewer.Name = "previewer"; + this.previewer.PlayPauseEnabled = true; + this.previewer.PlayPauseText = "蜀咲函"; + this.previewer.PreviewSizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.previewer.Size = new System.Drawing.Size( 373, 252 ); + this.previewer.TabIndex = 17; + this.previewer.TrackBarEnabled = true; + this.previewer.TrackBarMaximum = 10; + this.previewer.TrackBarMinimum = 0; + this.previewer.TrackBarValue = 0; + this.previewer.TrackSpeedValue = 1000; + this.previewer.TrackVolumeValue = 1000; + this.previewer.TrackBarScroll += new System.EventHandler( this.previewer_TrackBarScroll ); + this.previewer.TrackVolumeScroll += new System.EventHandler( this.previewer_TrackVolumeScroll ); + this.previewer.MenuHundredClick += new System.EventHandler( this.previewer_MenuHundredClick ); + this.previewer.LabelTimeMouseDoubleClick += new System.EventHandler( this.previewer_LabelTimeMouseDoubleClick ); + this.previewer.TrackSpeedScroll += new System.EventHandler( this.previewer_TrackSpeedScroll ); + this.previewer.TrackSpeedMouseUp += new System.Windows.Forms.MouseEventHandler( this.previewer_TrackSpeedMouseUp ); + this.previewer.PreviewSizeChanged += new System.EventHandler( this.previewer_PreviewSizeChanged ); + this.previewer.CheckMuteCheckedChanged += new System.EventHandler( this.previewer_CheckMuteCheckedChanged ); + this.previewer.StopClicked += new System.EventHandler( this.previewer_StopClicked ); + this.previewer.PreviewMouseUp += new System.Windows.Forms.MouseEventHandler( this.previewer_PreviewMouseUp ); + this.previewer.SpeedClicked += new System.EventHandler( this.previewer_SpeedClicked ); + this.previewer.PreviewMouseMove += new System.Windows.Forms.MouseEventHandler( this.previewer_PreviewMouseMove ); + this.previewer.PreviewMouseDoubleClick += new System.Windows.Forms.MouseEventHandler( this.previewer_PreviewMouseDoubleClick ); + this.previewer.PreviewPaint += new System.Windows.Forms.PaintEventHandler( this.previewer_PreviewPaint ); + this.previewer.PreviewMouseDown += new System.Windows.Forms.MouseEventHandler( this.previewer_PreviewMouseDown ); + this.previewer.PlayPauseClicked += new System.EventHandler( this.previewer_PlayPauseClicked ); + this.previewer.MenuFitClick += new System.EventHandler( this.previewer_MenuFitClick ); + // + // property1 + // + this.property.Editing = null; + this.property.Location = new System.Drawing.Point( 0, 0 ); + this.property.Name = "property1"; + this.property.SelectedIndex = -1; + this.property.SelectedObject = null; + this.property.Size = new System.Drawing.Size( 174, 436 ); + this.property.TabIndex = 0; + // + // m_container + // + this.m_container.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_container.FixedPanel = System.Windows.Forms.FixedPanel.None; + this.m_container.IsSplitterFixed = false; + this.m_container.Location = new System.Drawing.Point( 0, 0 ); + this.m_container.Name = "m_container"; + this.m_container.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // + // + this.m_container.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.m_container.Panel1.BorderColor = System.Drawing.Color.Black; + this.m_container.Panel1.Location = new System.Drawing.Point( 0, 0 ); + this.m_container.Panel1.Margin = new System.Windows.Forms.Padding( 0, 0, 0, 4 ); + this.m_container.Panel1.Name = "m_panel1"; + this.m_container.Panel1.Size = new System.Drawing.Size( 200, 437 ); + this.m_container.Panel1.TabIndex = 0; + this.m_container.Panel1MinSize = 0; + // + // + // + this.m_container.Panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.m_container.Panel2.BorderColor = System.Drawing.Color.Black; + this.m_container.Panel2.Location = new System.Drawing.Point( 204, 0 ); + this.m_container.Panel2.Margin = new System.Windows.Forms.Padding( 0 ); + this.m_container.Panel2.Name = "m_panel2"; + this.m_container.Panel2.Size = new System.Drawing.Size( 754, 437 ); + this.m_container.Panel2.TabIndex = 1; + this.m_container.Panel2.SizeChanged += new System.EventHandler( this.m_container_Panel2_SizeChanged ); + this.m_container.Panel2MinSize = 25; + this.m_container.Size = new System.Drawing.Size( 958, 437 ); + this.m_container.SplitterDistance = 200; + this.m_container.SplitterWidth = 4; + this.m_container.TabIndex = 19; + this.m_container.Text = "splitContainerEx1"; + // + // bgWorkSeriesImage + // + this.bgWorkSeriesImage.WorkerReportsProgress = true; + this.bgWorkSeriesImage.WorkerSupportsCancellation = true; + this.bgWorkSeriesImage.DoWork += new System.ComponentModel.DoWorkEventHandler( this.bgWorkSeriesImage_DoWork ); + this.bgWorkSeriesImage.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler( this.bgWorkSeriesImage_RunWorkerCompleted ); + this.bgWorkSeriesImage.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler( this.bgWorkSeriesImage_ProgressChanged ); + // + // timerScreenUpdater + // + this.timerScreenUpdater.Tick += new System.EventHandler( this.timerScreenUpdater_Tick ); + // + // Form1 + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 960, 485 ); + this.Controls.Add( this.toolStripContainer1 ); + this.MainMenuStrip = this.menuStrip2; + this.Name = "Form1"; + this.Padding = new System.Windows.Forms.Padding( 1 ); + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "LipSync"; + this.Deactivate += new System.EventHandler( this.Form1_Deactivate ); + this.Load += new System.EventHandler( this.Form1_Load ); + this.Paint += new System.Windows.Forms.PaintEventHandler( this.Form1_Paint ); + this.Shown += new System.EventHandler( this.Form1_Shown ); + this.Activated += new System.EventHandler( this.Form1_Activated ); + this.DragDrop += new System.Windows.Forms.DragEventHandler( this.Form1_DragDrop ); + this.DragEnter += new System.Windows.Forms.DragEventHandler( this.Form1_DragEnter ); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.Form1_FormClosing ); + ((System.ComponentModel.ISupportInitialize)(this.preview_image)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.side)).EndInit(); + this.statusStrip1.ResumeLayout( false ); + this.statusStrip1.PerformLayout(); + this.cmenuRepeat.ResumeLayout( false ); + this.menuStrip2.ResumeLayout( false ); + this.menuStrip2.PerformLayout(); + this.toolStripContainer1.BottomToolStripPanel.ResumeLayout( false ); + this.toolStripContainer1.BottomToolStripPanel.PerformLayout(); + this.toolStripContainer1.ContentPanel.ResumeLayout( false ); + this.toolStripContainer1.TopToolStripPanel.ResumeLayout( false ); + this.toolStripContainer1.TopToolStripPanel.PerformLayout(); + this.toolStripContainer1.ResumeLayout( false ); + this.toolStripContainer1.PerformLayout(); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.OpenFileDialog openVsqDialog; + private System.Windows.Forms.OpenFileDialog dialogImage; + private System.Windows.Forms.PictureBox preview_image; + private System.Windows.Forms.ContextMenuStrip cmenu; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.OpenFileDialog openLse; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel statusLabel; + private System.Windows.Forms.OpenFileDialog openRseDialog; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.VScrollBar vScrollBar1; + private System.Windows.Forms.HScrollBar hScrollBar1; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox side; + private System.Windows.Forms.SaveFileDialog saveAviFile; + private System.ComponentModel.BackgroundWorker bgWorkAvi; + private System.Windows.Forms.ColorDialog colorDialog1; + private System.Windows.Forms.ToolStripStatusLabel statusTime; + private System.Windows.Forms.ToolStripStatusLabel statusComment; + public LipSync.Property property; + private System.Windows.Forms.OpenFileDialog openMusicDialog; + private System.Windows.Forms.ContextMenuStrip cmenuRepeat; + private System.Windows.Forms.ToolStripMenuItem cmenuRepeatStart; + private System.Windows.Forms.ToolStripMenuItem cmenuRepeatEnd; + private System.Windows.Forms.ToolStripMenuItem cmenuRepeatReset; + private System.Windows.Forms.MenuStrip menuStrip2; + private System.Windows.Forms.ToolStripMenuItem xmenuFile; + private System.Windows.Forms.ToolStripMenuItem xmenuFileOpen; + private System.Windows.Forms.ToolStripMenuItem xmenuFileClose; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem8; + private System.Windows.Forms.ToolStripMenuItem xmenuFileSave; + private System.Windows.Forms.ToolStripMenuItem xmenuFileSaveAs; + private System.Windows.Forms.ToolStripMenuItem xmenuFileImport; + private System.Windows.Forms.ToolStripMenuItem xmenuFileExport; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem9; + private System.Windows.Forms.ToolStripMenuItem xmenuFileOpenVsq; + private System.Windows.Forms.ToolStripMenuItem xmenuFileOutputAvi; + private System.Windows.Forms.ToolStripMenuItem xmenuFileOutputRawAvi; + private System.Windows.Forms.ToolStripMenuItem xmenuFileOutputAbort; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem10; + private System.Windows.Forms.ToolStripMenuItem xmenuFileExit; + private System.Windows.Forms.ToolStripMenuItem xmenuFileImportRipsync; + private System.Windows.Forms.ToolStripMenuItem xmenuFileExportHatwune; + private System.Windows.Forms.ToolStripMenuItem menuEdit; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem menuEditVideoSize; + private System.Windows.Forms.ToolStripMenuItem menuEditFrameRate; + private System.Windows.Forms.ToolStripMenuItem menuEditZOrder; + private System.Windows.Forms.ToolStripMenuItem menuEditVideoLength; + private System.Windows.Forms.ToolStripMenuItem menuEditShiftTimeline; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem11; + private System.Windows.Forms.ToolStripMenuItem menuEditAddCharacter; + private System.Windows.Forms.ToolStripMenuItem menuEditBGColor; + private System.Windows.Forms.ToolStripMenuItem menuEditRealTime; + public System.Windows.Forms.ToolStripMenuItem menuEditUndo; + public System.Windows.Forms.ToolStripMenuItem menuEditRedo; + private System.Windows.Forms.ToolStripMenuItem menuVisual; + private System.Windows.Forms.ToolStripMenuItem menuVisualZoomIn; + private System.Windows.Forms.ToolStripMenuItem menuVisualZoomOut; + private System.Windows.Forms.ToolStripMenuItem menuVisualZoomReset; + private System.Windows.Forms.ToolStripMenuItem menuVisualTop; + private System.Windows.Forms.ToolStripMenuItem menuVisualEnd; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6; + private System.Windows.Forms.ToolStripMenuItem menuVisualPlayPause; + private System.Windows.Forms.ToolStripMenuItem menuVisualRepeat; + private System.Windows.Forms.ToolStripMenuItem menuVisualRepeatPlayPause; + private System.Windows.Forms.ToolStripMenuItem menuVisualRepeatTop; + private System.Windows.Forms.ToolStripMenuItem menuVisualRepeatEnd; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem12; + private System.Windows.Forms.ToolStripMenuItem menuVisualSync; + private System.Windows.Forms.ToolStripMenuItem menuVisualObjectList; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem13; + private System.Windows.Forms.ToolStripMenuItem menuVisualVsqTrack; + private System.Windows.Forms.ToolStripMenuItem menuVisualBars; + public System.Windows.Forms.ToolStripMenuItem menuVisualTransform; + private System.Windows.Forms.ToolStripMenuItem menuTool; + private System.Windows.Forms.ToolStripMenuItem menuToolOption; + private System.Windows.Forms.ToolStripMenuItem menuToolMusic; + private System.Windows.Forms.ToolStripMenuItem menuToolMoveTo; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem menuToolPluginConfig; + private System.Windows.Forms.ToolStripMenuItem menuHelp; + private System.Windows.Forms.ToolStripMenuItem menuHelpPluginInfo; + private System.Windows.Forms.ToolStripMenuItem menuHelpVersionInfo; + private System.Windows.Forms.ToolStripMenuItem menuHelpBugReport; + private System.Windows.Forms.ToolStripMenuItem menuHelpDebug; + private System.Windows.Forms.ToolStripMenuItem menuHelpDebugEditCharacter; + private System.Windows.Forms.ToolStripMenuItem menuHelpDebugInverseImages; + private System.Windows.Forms.ToolStripMenuItem menuHelpDebugExtract; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize04; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize08; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize16; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize32; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantize64; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantizeOff; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; + private System.Windows.Forms.ToolStripMenuItem menuToolQuantizeTriplet; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.ToolStripMenuItem xmenuFileSeriesBitmap; + private Previewer previewer; + private System.Windows.Forms.ToolStripMenuItem menuVisualPreview; + private System.Windows.Forms.ToolStripMenuItem menuVisualPreviewSeparate; + private System.Windows.Forms.ToolStripMenuItem menuVisualPreviewFlipVisible; + private BSplitContainer m_container; + private System.Windows.Forms.ToolStripContainer toolStripContainer1; + private System.ComponentModel.BackgroundWorker bgWorkSeriesImage; + private System.Windows.Forms.Timer timerScreenUpdater; + private System.Windows.Forms.ToolStripMenuItem xmenuFileExportVocaloMark; + + } + +} + diff --git a/trunk/LipSync/Editor/Form1Util.cs b/trunk/LipSync/Editor/Form1Util.cs new file mode 100644 index 0000000..56e6cd4 --- /dev/null +++ b/trunk/LipSync/Editor/Form1Util.cs @@ -0,0 +1,2228 @@ +サソ/* + * Form1Util.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using System.Threading; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; +using Boare.Lib.Vsq; + +namespace LipSync { + + public partial class Form1 { + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + private void ChangeAviWriting( bool value ) { + AviWriting = value; + } + + private void ResizePanel2() { + if ( m_initialized ) { + side.Height = m_panels.Panel2.Height; + pictureBox1.Width = m_panels.Panel2.Width - side.Width - vScrollBar1.Width; + pictureBox1.Height = m_panels.Panel2.Height - hScrollBar1.Height; + + vScrollBar1.Left = pictureBox1.Left + pictureBox1.Width; + vScrollBar1.Height = pictureBox1.Height; + + hScrollBar1.Top = m_panels.Panel2.Height - hScrollBar1.Height; + hScrollBar1.Width = pictureBox1.Width; + + pictureBox2.Top = pictureBox1.Top + pictureBox1.Height; + pictureBox2.Left = vScrollBar1.Left; + this.Invalidate(); + SetHScrollRange(); + SetVScrollRange(); + m_startToDrawY = StartToDrawY(); + } + } + + private float GetSnapPoint( float time ) { + if ( m_grids != null ) { + if ( m_grids.Length > 0 ) { + float nearest = m_grids[0]; + float dif = Math.Abs( m_grids[0] - time ); + for ( int i = 1; i < m_grids.Length; i++ ) { + float d = Math.Abs( m_grids[i] - time ); + if ( d < dif ) { + dif = d; + nearest = m_grids[i]; + } + } + return nearest; + } + } + return time; + } + + private void PreviewWindowFlipMode() { + if ( previewer.Parent == m_form_preview ) { + previewer.Parent = m_panels.Panel1; + m_form_preview.Hide(); + int total_height = m_panels.Panel1.Height + m_panels.Panel2.Height; + int new_distance = (int)(total_height * AppManager.Config.LastPreviewAspecto); + m_panels.SplitterDistance = new_distance; + m_panels.IsSplitterFixed = false; + menuVisualPreviewSeparate.Checked = false; + } else { + AppManager.Config.LastPreviewAspecto = ((float)m_panels.Panel1.Height) / ((float)(m_panels.Panel2.Height + m_panels.Panel1.Height)); + m_panels.SplitterDistance = 0; + m_panels.IsSplitterFixed = true; + previewer.Parent = m_form_preview; + menuVisualPreviewSeparate.Checked = true; + m_form_preview.Show(); + } + } + + /// + /// 陦ィ遉コ險隱槭ョ險ュ螳壹r驕ゥ逕ィ縺励∪縺吶 + /// + public void ApplyLanguage() { + this.xmenuFile.Text = _( "File" ) + "(&F)"; + this.xmenuFileOpen.Text = _( "Open" ) + "(&O)"; + this.xmenuFileSave.Text = _( "Save" ) + "(&S)"; + this.xmenuFileSaveAs.Text = _( "Save As" ) + "(&A)"; + this.xmenuFileImport.Text = _( "Import" ) + "(&I)"; + this.xmenuFileImportRipsync.Text = _( "from RipSync data" ); + this.xmenuFileOpenVsq.Text = _( "Open VSQ/UST file" ) + "(&V)"; + this.xmenuFileExit.Text = _( "Exit" ) + "(&X)"; + this.xmenuFileExportVocaloMark.Text = _( "Script for VOCALOMARK" ); + //this.menuWindow.Text = MessageEx.GetMessage( MessageID.WINDOW ) + "(&W)"; + //this.menuPreview.Text = MessageEx.GetMessage( MessageID.SHOW_PREVIEW ) + "(&P)"; + //this.menuMove.Text = MessageEx.GetMessage( MessageID.GOTO_PREVIEW ) + "(&M)"; + this.menuHelp.Text = _( "Help" ) + "(&H)"; + this.menuHelpPluginInfo.Text = _( "Plugin Information" ) + "(&P)"; + this.menuHelpVersionInfo.Text = _( "About LipSync" ) + "(&A)"; + this.menuHelpDebug.Text = _( "Debug" ); + this.menuHelpDebugEditCharacter.Text = _( "Edit Character" ); + this.menuHelpDebugInverseImages.Text = _( "Flip Images Horizontaly" ); + this.menuEdit.Text = _( "Edit" ) + "(&E)"; + this.menuEditUndo.Text = _( "Undo" ) + "(&U)"; + this.menuEditRedo.Text = _( "Redo" ) + "(&R)"; + this.menuEditVideoSize.Text = _( "Video Size" ) + "(&V)"; + this.menuEditFrameRate.Text = _( "Frame Rate" ) + "(&F)"; + this.menuEditZOrder.Text = _( "Z order" ) + "(&Z)"; + this.menuEditVideoLength.Text = _( "Video Length" ) + "(&C)"; + this.menuEditShiftTimeline.Text = _( "Shift All Time-tables" ) + "(&S)"; + this.menuTool.Text = _( "Tool" ) + "(&T)"; + this.menuToolOption.Text = _( "Option" ) + "(&O)"; + this.menuToolPluginConfig.Text = _( "Plugin Config" ) + "(&P)"; + this.menuEditAddCharacter.Text = _( "Add Empty Character" ) + "(&A)"; + + this.xmenuFileOutputAvi.Text = _( "Generate Avi" ) + "(&G)"; + this.menuToolMusic.Text = _( "Chose Sound File" ) + "(&M)"; + this.menuToolMoveTo.Text = _( "Go to Specified Frame" ) + "(&G)"; + this.xmenuFileOutputAbort.Text = _( "Stop Writing Avi" ) + "(&E)"; + this.menuEditBGColor.Text = _( "Background Color" ) + "(&B)"; + this.xmenuFileClose.Text = _( "Close" ) + "(&C)"; + this.xmenuFileOutputRawAvi.Text = _( "Generate Raw Avi" ) + "(&R)"; + this.xmenuFileExport.Text = _( "Export" ); + this.xmenuFileExportHatwune.Text = _( "Script for H@TWUNEBENCH" ); + if ( AppManager.Config.PropertyHidden ) { + this.menuVisualObjectList.Text = _( "Show Object List" ); + } else { + this.menuVisualObjectList.Text = _( "Hide Object List" ); + } + this.menuHelpBugReport.Text = _( "Bug Report" ) + "(&B)"; + + string draft_filter = _( "VOCALOID2 Sequence File(*.vsq)|*.vsq" ) + "|" + + _( "All Files(*.*)|*.*" ); + if ( Common.CheckFilterValidity( draft_filter ) ){ + this.openVsqDialog.Filter = draft_filter; + } else { + this.openVsqDialog.Filter = "VOCALOID2 Sequence File(*.vsq)|*.vsq|All Files(*.*)|*.*"; + } + + draft_filter = _( "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" ) + "|" + + _( "Avi File(*.avi)|*.avi" ) + "|" + + _( "All Files(*.*)|*.*" ); + if ( Common.CheckFilterValidity( draft_filter ) ){ + this.dialogImage.Filter = draft_filter; + } else { + this.dialogImage.Filter = "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg|Avi File(*.avi)|*.avi|All Files(*.*)|*.*"; + } + + draft_filter = _( "LipSync Data File(*.lse)|*.lse" ) + "|" + + _( "All Files(*.*)|*.*" ); + if ( Common.CheckFilterValidity( draft_filter ) ){ + this.openLse.Filter = draft_filter; + } else { + this.openLse.Filter = "LipSync Data File(*.lse)|*.lse|All Files(*.*)|*.*"; + } + + draft_filter = _( "LipSync Data file(*.lse)|*.lse" ) + "|" + + _( "All Files(*.*)|*.*" ); + if ( Common.CheckFilterValidity( draft_filter ) ){ + this.saveFileDialog1.Filter = draft_filter; + } else { + this.saveFileDialog1.Filter = "LipSync Data file(*.lse)|*.lse|All Files(*.*)|*.*"; + } + //this.menuGenTelop.Text = MessageEx.GetMessage( MessageID.GENERATE_TELOP_FROM_VSQ ) + "(&T)"; + menuEditRealTime.Text = _( "Real Time \"lipsync\"" ); + cmenuRepeatEnd.Text = _( "End Repeat Here" ); + cmenuRepeatStart.Text = _( "Start Repeat Here" ); + cmenuRepeatReset.Text = _( "Reset Repeat region" ); + + #region menuVisual* + menuVisual.Text = _( "View" ) + "(&V)"; + menuVisualZoomIn.Text = _( "Zoom" ) + "(&I)"; + menuVisualZoomOut.Text = _( "Mooz" ) + "(&O)"; + menuVisualZoomReset.Text = _( "Set Default Scale" ) + "(&R)"; + menuVisualTop.Text = _( "Move to Top" ); + menuVisualEnd.Text = _( "Move to End" ); + menuVisualRepeat.Text = _( "Repeat play" ); + menuVisualRepeatEnd.Text = _( "Move to End" ); + menuVisualRepeatTop.Text = _( "Move to Top" ); + menuVisualTransform.Text = _( "Edit Motion Curve" ); + menuVisualRepeatPlayPause.Text = _( "Play" ) + "/" + _( "Pause" ); + menuVisualVsqTrack.Text = _( "Show VSQ Tracks Allways" ); + menuVisualBars.Text = _( "Show Bars" ); + menuVisualPreview.Text = _( "Preview" ) + "(&P)"; + menuVisualPlayPause.Text = _( "Play" ) + "/" + _( "Pause" ); + menuVisualSync.Text = _( "Sync with Time-table" ); + if ( AppManager.Config.PreviewHidden ) { + menuVisualPreviewFlipVisible.Text = _( "Enable Preview" ); + } else { + menuVisualPreviewFlipVisible.Text = _( "Disable Preview" ); + } + menuVisualPreviewSeparate.Text = _( "Separate Preview Window" ) + "(&S)"; + #endregion + + menuToolQuantize.Text = _( "Quantize" ) + "(&Q)"; + menuToolQuantizeOff.Text = _( "Off" ); + menuToolQuantizeTriplet.Text = _( "Triplet" ); + + property.titleUpper.Text = _( "List of Object" ); + property.titleLower.Text = _( "Property" ); + property.ApplyLanguage(); + + if ( AppManager.SaveData.m_plugins != null ) { + foreach ( PluginInfo plugin in AppManager.SaveData.m_plugins ) { + plugin.Instance.ApplyLanguage( AppManager.Config.Language ); + } + } + + if ( m_version_form != null ) { + m_version_form.ApplyLanguage(); + } + xmenuFileSeriesBitmap.Text = _( "Series Image" ) + "(&B)"; + + previewer.ApplyLanguage(); + + if ( m_curve != null ) { + m_curve.ApplyLanguage(); + } + if ( m_version_form != null ) { + m_version_form.ApplyLanguage(); + } + if ( m_form_preview != null ) { + m_form_preview.ApplyLanguage(); + } + } + + private void ReadVsq( string filename ) { + if ( Path.GetExtension( filename ).ToLower() == ".ust" ) { + UstFile ust = new UstFile( filename ); + if ( MessageBox.Show( _( "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" ), + _( "Confirmation" ), MessageBoxButtons.YesNo, + MessageBoxIcon.Exclamation ) == DialogResult.Yes ) { + if ( AppManager.SaveData.m_timesig_ex != null ) { + AppManager.SaveData.m_timesig_ex.Clear(); + AppManager.SaveData.m_timesig_ex = null; + } + if ( AppManager.SaveData.m_tempo != null ) { + AppManager.SaveData.m_tempo.Clear(); + AppManager.SaveData.m_tempo = null; + } + AppManager.SaveData.m_timesig_ex = new List(); + AppManager.SaveData.m_timesig_ex.Add( new TimeSigTableEntry( 0, 4, 4, 0 ) ); + AppManager.SaveData.m_tempo = new List( ust.getTempoList().ToArray() ); + AppManager.SaveData.m_base_tempo = ust.getBaseTempo(); + } + for ( int i = 0; i < ust.getTrackCount(); i++ ) { + AddTimeLineFromUst( ust, i, true ); + } + AppManager.SaveData.m_totalSec = Math.Max( AppManager.SaveData.m_totalSec, (float)ust.getTotalSec() ); + } else { + VsqFile vsqFile = new VsqFile( filename ); + int tracks = vsqFile.getTrackCount(); + string[] track_names = new string[tracks]; + for ( int track = 0; track < tracks; track++ ) { + track_names[track] = vsqFile.getTrack( track ).Name; + } + using ( TrackSelecter selecter = new TrackSelecter( filename, track_names ) ) { + selecter.ImportTempoAndTimesig = false; + if ( selecter.ShowDialog() == DialogResult.OK ) { + foreach ( int i in selecter.CheckedItem ) { + addTimeLineFromTrack( vsqFile, i, true ); + } + if ( selecter.ImportTempoAndTimesig ) { + if ( MessageBox.Show( _( "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" ), + _( "Confirmation" ), MessageBoxButtons.YesNo, + MessageBoxIcon.Exclamation ) == DialogResult.Yes ) { + if ( AppManager.SaveData.m_timesig_ex != null ) { + AppManager.SaveData.m_timesig_ex.Clear(); + AppManager.SaveData.m_timesig_ex = null; + } + if ( AppManager.SaveData.m_tempo != null ) { + AppManager.SaveData.m_tempo.Clear(); + AppManager.SaveData.m_tempo = null; + } + AppManager.SaveData.m_timesig_ex = new List( vsqFile.getTimeSigList().ToArray() ); + AppManager.SaveData.m_tempo = new List( vsqFile.getTempoList().ToArray() ); + AppManager.SaveData.m_base_tempo = vsqFile.getBaseTempo(); + } + } + } + } + + AppManager.SaveData.m_totalSec = Math.Max( AppManager.SaveData.m_totalSec, (float)vsqFile.getTotalSec() ); + + } + SetHScrollRange(); + SetVScrollRange(); + UpdateGridList(); + + AppManager.Edited = true; + this.Invalidate(); + } + + /// + /// + /// + /// + /// + /// + /// + private float nextInterval( ref Random rnd, float base_interval, bool randomize ) { + const float BAND_WIDTH = 0.8f; + if ( randomize ) { + return base_interval - (BAND_WIDTH / 2f) * base_interval + + (float)(rnd.NextDouble()) * base_interval * BAND_WIDTH; + } else { + return base_interval; + } + } + + /// + /// 繝繝シ繝ォ繝。繝九Η繝シ縺ョ繧ッ繧ェ繝ウ繧ソ繧、繧コ縺ョ繝√ぉ繝繧ッ迥カ諷九rシ稽_quantize_*縺ォ縺ゅo縺帙※譖エ譁ー縺励∪縺 + /// + private void QuantizeMenuCheckedStateUpdate() { + menuToolQuantize04.Checked = false; + menuToolQuantize08.Checked = false; + menuToolQuantize16.Checked = false; + menuToolQuantize32.Checked = false; + menuToolQuantize64.Checked = false; + menuToolQuantizeOff.Checked = false; + switch ( AppManager.Config.QuantizeMode ) { + case QuantizeMode.q04: + menuToolQuantize04.Checked = true; + break; + case QuantizeMode.q08: + menuToolQuantize08.Checked = true; + break; + case QuantizeMode.q16: + menuToolQuantize16.Checked = true; + break; + case QuantizeMode.q32: + menuToolQuantize32.Checked = true; + break; + case QuantizeMode.q64: + menuToolQuantize64.Checked = true; + break; + case QuantizeMode.off: + menuToolQuantizeOff.Checked = true; + break; + } + menuToolQuantizeTriplet.Checked = AppManager.Config.QuantizeTripletEnabled; + UpdateGridList(); + pictureBox1.Refresh(); + } + + private void ChangeSpeed( int speed ) { + if ( AppManager.Playing ) { + m_player.Pause(); + } + float current = m_player.GetPosition() * 0.001f; + m_player.Speed = speed * 0.001f; + m_started_date = DateTime.Now; + m_started_date = m_started_date.AddSeconds( -current / (0.001f * speed) ); + if ( AppManager.Playing ) { + m_player.PlayFrom( current ); + } + float t_speed = speed * 0.001f; + previewer.LabelSpeedText = "x" + t_speed.ToString( "0.00" ); + } + + public bool AviWriting { + get { + return m_avi_writing; + } + set { + m_avi_writing = value; + xmenuFileOutputAvi.Enabled = !value; + previewer.PlayPauseEnabled = !value; + previewer.TrackBarEnabled = !value; + menuEdit.Enabled = !value; + xmenuFileOpen.Enabled = !value; + xmenuFileImportRipsync.Enabled = !value; + xmenuFileOpenVsq.Enabled = !value; + pictureBox1.Enabled = !value; + xmenuFileClose.Enabled = !value; + xmenuFileSeriesBitmap.Enabled = !value; + xmenuFileOutputAbort.Enabled = value; + if ( m_avi_writing ) { + m_player.Close(); + } else { + if ( AppManager.SaveData.m_audioFile != "" ) { + m_player.Load( AppManager.SaveData.m_audioFile ); + } + } + } + } + + private void ChangePropertyHidden() { + float total_width = m_container.Panel1.Width + m_container.Panel2.Width; + if ( AppManager.Config.PropertyHidden ) { + m_container.SplitterDistance = AppManager.Config.LastPropertyWidth; + AppManager.Config.PropertyHidden = false; + menuVisualObjectList.Text = _( "Hide object list" ); + m_container.IsSplitterFixed = false; + } else { + AppManager.Config.LastPropertyWidth = m_container.SplitterDistance; + m_container.SplitterDistance = 0; + AppManager.Config.PropertyHidden = true; + menuVisualObjectList.Text = _( "Show object list" ); + m_container.IsSplitterFixed = true; + } + } + + /// + /// 繝薙ャ繝医Ξ繝シ繝医r螟画峩縺励◆縺ィ縺阪↓蜻シ縺ウ蜃コ縺輔l繧 + /// + private void ChangeBitrate() { + previewer.TrackBarMaximum = (int)(AppManager.SaveData.m_totalSec * AppManager.SaveData.FrameRate); + } + + private void UpdateFormTitle() { + string changed_title; + if ( menuEditRealTime.Checked ) { + changed_title = "[REAL TIME] "; + } else { + changed_title = ""; + } + if ( AppManager.Edited ) { + changed_title += "* "; + } else { + changed_title += ""; + } + if ( m_filePath == "" ) { + changed_title += _( "(no name)" ); + } else { + changed_title += Path.GetFileName( m_filePath ); + } + changed_title += " - LipSync"; + if ( this.Text != changed_title ) { + this.Text = changed_title; + } + } + + /// + /// 繝励Ξ繝薙Η繝シ縺ョ髱櫁。ィ遉コ繝サ陦ィ遉コ繧貞繧頑崛縺医∪縺 + /// + private void ChangePreviewHidden() { + if ( AppManager.Config.PreviewHidden ) { + int total_height = m_panels.Panel1.Height + m_panels.Panel2.Height; + int new_distance = (int)(total_height * AppManager.Config.LastPreviewAspecto); + m_panels.SplitterDistance = new_distance; + AppManager.Config.PreviewHidden = false; + menuVisualPreviewFlipVisible.Text = _( "Disable Preview" ); + m_panels.IsSplitterFixed = false; + } else { + AppManager.Config.LastPreviewAspecto = ((float)m_panels.Panel1.Height) / ((float)(m_panels.Panel2.Height + m_panels.Panel1.Height)); + m_panels.SplitterDistance = 0; + AppManager.Config.PreviewHidden = true; + menuVisualPreviewFlipVisible.Text = _( "Enable Preview" ); + m_panels.IsSplitterFixed = true; + } + } + + private void Save( string file ) { + bool backup_created = false; + string new_file = ""; + if ( File.Exists( file ) ) { + new_file = file + "_"; + while ( File.Exists( new_file ) ) { + new_file += "_"; + } + File.Move( file, new_file ); + backup_created = true; + } + using ( SettingsEx temp = (SettingsEx)AppManager.SaveData.Clone() ) + using ( FileStream fs = new FileStream( file, FileMode.Create ) ) { + BinaryFormatter bf = new BinaryFormatter(); + for ( int i = 0; i < m_not_used_plugin.Count; i++ ) { + temp.m_group_plugin.Add( (TimeTable)m_not_used_plugin[i].Clone() ); + } + for ( int i = 0; i < m_not_used_plugin_config.Count; i++ ) { + temp.m_plugins_config.Add( m_not_used_plugin_config[i].Clone() ); + } + try { + bf.Serialize( fs, temp ); + AppManager.Edited = false; + } catch ( Exception ex ) { + Common.LogPush( ex ); + MessageBox.Show( + _( "Failed file saving" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + fs.Close(); + if ( backup_created ) { + try { + File.Delete( file ); + File.Move( new_file, file ); + } catch { + } + } + } finally { + bf = null; + if ( backup_created && File.Exists( new_file ) ) { + File.Delete( new_file ); + } + } + } + } + + private void Read( string file ) { +#if DEBUG + Common.DebugWriteLine( "read(string)" ); +#endif + StopPauseCore(); //timerPreview.Enabled = false; + + if ( AppManager.Edited ) { + DialogResult result = requestIntention(); + if ( result == DialogResult.Yes ) { + if ( m_filePath != "" ) { + Save( m_filePath ); + } else { + if ( saveFileDialog1.ShowDialog() == DialogResult.OK ) { + Save( saveFileDialog1.FileName ); + } else { + return; + } + } + } else if ( result == DialogResult.Cancel ) { + return; + } + } + + previewer.TrackBarValue = previewer.TrackBarMinimum; + using ( FileStream fs = new FileStream( file, FileMode.Open ) ) { + BinaryFormatter bf = new BinaryFormatter(); + m_skip_paint = true; + + List t_plugin_info = new List(); + foreach ( PluginInfo pinfo in AppManager.SaveData.m_plugins ) { + t_plugin_info.Add( (PluginInfo)pinfo.Clone() ); + } + + object tmp = bf.Deserialize( fs ); + if ( tmp.GetType() == typeof( LipSync.Settings ) ) { +#if DEBUG + Common.DebugWriteLine( " deserialized object is LipSync.Settings" ); +#endif + Settings tSettings = (Settings)tmp; + AppManager.SaveData.Dispose(); + AppManager.SaveData = new SettingsEx( tSettings ); + } else if ( tmp.GetType() == typeof( LipSync.SettingsEx ) ) { +#if DEBUG + Common.DebugWriteLine( " deserialized object is LipSync.SettingsEx" ); +#endif + AppManager.SaveData.Dispose(); + AppManager.SaveData = (SettingsEx)tmp; + } else { + // 隱ュ縺ソ霎シ縺ソ螟ア謨 + MessageBox.Show( + _( "Failed file reading" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Error ); + return; + } + + AppManager.SaveData.m_zorder.Clear(); + + int n_plugin = t_plugin_info.Count; + if ( n_plugin > 0 ) { + AppManager.SaveData.m_plugins = new PluginInfo[t_plugin_info.Count]; + for ( int i = 0; i < t_plugin_info.Count; i++ ) { + AppManager.SaveData.m_plugins[i] = (PluginInfo)t_plugin_info[i].Clone(); + } + } + + AppManager.Edited = false; + + // 縺縺セ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺ヲ縺繧九励Λ繧ー繧、繝ウ縺ョ諠蝣ア繧貞縺ォ縲 + // 菴ソ逕ィ縺ァ縺阪k繝励Λ繧ー繧、繝ウ縺ョ諠蝣ア縺ョ縺ソ繧知_螟画焚縺ォ蜈・繧後k + // 菴ソ縺医↑縺繧ゅョ縺ッ縲[_not_used_螟画焚縺ォ菫晉ョ。縺励※縺翫¥縲 + m_not_used_plugin.Clear(); + m_not_used_plugin_config.Clear(); + + List tmp_ttable = new List(); + List tmp_config = new List(); + for ( int i = 0; i < AppManager.SaveData.m_plugins_config.Count; i++ ) { +#if DEBUG + Common.DebugWriteLine( "Form1.read(String); m_plugins_config[]; id=" + AppManager.SaveData.m_plugins_config[i].ID + "; config=" + AppManager.SaveData.m_plugins_config[i].Config ); +#endif + bool found = false; + for ( int j = 0; j < AppManager.SaveData.m_plugins.Length; j++ ) { + if ( AppManager.SaveData.m_plugins_config[i].ID == AppManager.SaveData.m_plugins[j].ID ) { + found = true; + break; + } + } + if ( found ) { + tmp_ttable.Add( (TimeTable)AppManager.SaveData.m_group_plugin[i].Clone() ); + tmp_config.Add( AppManager.SaveData.m_plugins_config[i].Clone() ); + } else { + m_not_used_plugin.Add( (TimeTable)AppManager.SaveData.m_group_plugin[i].Clone() ); + m_not_used_plugin_config.Add( AppManager.SaveData.m_plugins_config[i].Clone() ); + } + } + + // Settings縺ォ霆「騾 + AppManager.SaveData.m_group_plugin.Clear(); + AppManager.SaveData.m_plugins_config.Clear(); + for ( int i = 0; i < tmp_ttable.Count; i++ ) { + AppManager.SaveData.m_group_plugin.Add( (TimeTable)tmp_ttable[i].Clone() ); + AppManager.SaveData.m_plugins_config.Add( tmp_config[i].Clone() ); + } + + // 繝励Λ繧ー繧、繝ウ縺ョ蜈ィ菴楢ィュ螳壹r驕ゥ逕ィ + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + string id = AppManager.SaveData.m_plugins[i].ID; + AppManager.SaveData.m_plugins[i].Instance.Config = ""; + for ( int j = 0; j < AppManager.SaveData.m_group_plugin.Count; j++ ) { + if ( AppManager.SaveData.m_plugins_config[j].ID == id ) { + AppManager.SaveData.m_plugins[i].Instance.Config = AppManager.SaveData.m_plugins_config[j].Config; + break; + } + } + } + + bf = null; + } + AppManager.ClearCommandBuffer(); + AppManager.SaveData.UpdateZorder(); + Telop.DecideLane( AppManager.SaveData.m_telop_ex2 ); + m_skip_paint = false; + + if ( AppManager.SaveData.m_audioFile.Length > 0 && File.Exists( AppManager.SaveData.m_audioFile ) ) { + m_player.Load( AppManager.SaveData.m_audioFile ); + } + + previewer.Image = new Bitmap( AppManager.SaveData.m_movieSize.Width, AppManager.SaveData.m_movieSize.Height ); + using ( Graphics g = Graphics.FromImage( previewer.Image ) ) { + AppManager.SaveData.DrawTo( g, previewer.Image.Size, Now, false ); + } + previewer.Invalidate(); + + UpdateFormTitle(); + this.Invalidate(); +#if DEBUG + for ( int i = 0; i < AppManager.SaveData.m_plugins_config.Count; i++ ) { + Common.DebugWriteLine( "Form1.read(String); registered; id=" + AppManager.SaveData.m_plugins_config[i].ID + "; config=" + AppManager.SaveData.m_plugins_config[i].Config ); + } + for ( int i = 0; i < m_not_used_plugin_config.Count; i++ ) { + Common.DebugWriteLine( "Form1.read(String); not registered; id=" + m_not_used_plugin_config[i].ID ); + } + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + Common.DebugWriteLine( "Form1.read(String); current plugin; id=" + AppManager.SaveData.m_plugins[i].ID + "; Config=" + AppManager.SaveData.m_plugins[i].Instance.Config ); + } +#endif + } + + private void sizeChange() { + using ( SetSize setsize = new SetSize( _( "Video size configuration" ), _( "Width" ), _( "Height" ), AppManager.SaveData.m_movieSize.Width, AppManager.SaveData.m_movieSize.Height ) ) { + if ( setsize.ShowDialog() == DialogResult.OK ) { + Command run = Command.GCommandChangeVideoSize( new Size( (int)setsize.ResultWidth, (int)setsize.ResultHeight ) ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + previewer.Image = new Bitmap( (int)setsize.ResultWidth, (int)setsize.ResultHeight ); + using ( Graphics g = Graphics.FromImage( previewer.Image ) ) { + AppManager.SaveData.DrawTo( g, previewer.Image.Size, Now, false ); + } + previewer.Invalidate(); + AppManager.Edited = true; + } + } + } + + public Bitmap GetPicture( float now, bool is_transparent ) { + if ( m_skip_paint ) { + return null; + } + Size mSize = AppManager.SaveData.m_movieSize; + Bitmap bmp = is_transparent ? + new Bitmap( mSize.Width, mSize.Height, PixelFormat.Format32bppArgb ) : + new Bitmap( mSize.Width, mSize.Height, PixelFormat.Format24bppRgb ); + using ( Graphics g = Graphics.FromImage( bmp ) ) { + AppManager.SaveData.DrawTo( g, mSize, now, is_transparent ); + } + return bmp; + } + + private void DeleteEntry() { + if ( m_edit_mode == EditMode.Selected/* m_editMode*/ ) { + bool changed = false; + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + if ( type == TimeTableType.character || type == TimeTableType.another || type == TimeTableType.plugin ) { + Command run = Command.GCommandDeleteTimeTableEntry( type, group, track, AppManager.SaveData[type, group][track][entry] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + changed = true; + } + if ( changed ) { + m_edit_mode = EditMode.None; + AppManager.Edited = true; + pictureBox1.Invalidate(); + } + } + } + + private float RepeatStart { + get { + return AppManager.SaveData.REPEAT_START; + } + } + + private float RepeatEnd { + get { + if ( AppManager.SaveData.REPEAT_END < 0 ) { + return AppManager.SaveData.m_totalSec; + } else { + return AppManager.SaveData.REPEAT_END; + } + } + } + + private void UpdateExpandRange( float time ) { + bool exclusion_mode = false; + + if ( m_clicked.type == TimeTableType.character ) { + string title = AppManager.SaveData.m_groups_character[m_clicked.group][m_clicked.track].Text; + string tag = AppManager.SaveData.m_groups_character[m_clicked.group].Character[title].tag; + if ( tag != "" ) { + exclusion_mode = true; + } + } + + if ( exclusion_mode ) { + m_expandRange = GetEntryLimit( m_clicked, time, true ); + } else { + m_expandRange = GetEntryLimitSingle( m_clicked, time, true ); + } + } + + private void UpdateEditHandle( int x, int y ) { + Rectangle hilight = GetHilightRect( x, y ); + m_editHandleLeft.X = hilight.X - HANDLE_WIDTH / 2; + m_editHandleLeft.Y = hilight.Y; + m_editHandleLeft.Width = HANDLE_WIDTH; + m_editHandleLeft.Height = AppManager.Config.TrackHeight; + + m_editHandleRight.X = hilight.X + hilight.Width - HANDLE_WIDTH / 2; + m_editHandleRight.Y = hilight.Y; + m_editHandleRight.Width = HANDLE_WIDTH; + m_editHandleRight.Height = AppManager.Config.TrackHeight; + } + + private void SetHScrollRange() { + AppManager.SaveData.m_screenWidth = (int)(AppManager.SaveData.m_totalSec * AppManager.Config.PixelPerSec); + previewer.TrackBarMaximum = (int)(AppManager.SaveData.m_totalSec * AppManager.SaveData.FrameRate); + if ( AppManager.SaveData.m_totalSec == 0.0f ) { + hScrollBar1.Maximum = 109; + } else { + hScrollBar1.Maximum = (int)(AppManager.SaveData.m_totalSec * AppManager.Config.PixelPerSec); + hScrollBar1.LargeChange = pictureBox1.Width; + if ( AppManager.SaveData.m_screenWidth > pictureBox1.Width ) { + hScrollBar1.Enabled = true; + } else { + hScrollBar1.Enabled = false; + } + } + } + + private void SetVScrollRange() { + if ( AppManager.SaveData.m_group_vsq == null ) { + return; + } + int[] lane = AppManager.GetTimeLineLanes(); + int tracks = 1; + for ( int i = 0; i < lane.Length; i++ ) { + tracks += lane[i]; + } + AppManager.SaveData.m_screenHeight = tracks * AppManager.Config.TrackHeight; + vScrollBar1.Maximum = AppManager.SaveData.m_screenHeight; + vScrollBar1.LargeChange = pictureBox1.Height; + if ( AppManager.SaveData.m_screenHeight > pictureBox1.Height ) { + vScrollBar1.Enabled = true; + } else { + vScrollBar1.Value = vScrollBar1.Minimum; + vScrollBar1.Enabled = false; + } + } + + private int XCoordFromSec( float time ) { + return (int)(time * AppManager.Config.PixelPerSec) - m_startToDrawX; + } + + /// + /// pictureBox1荳翫ョx蠎ァ讓吩ス咲スョ繧偵∫ァ呈焚縺ォ螟画鋤縺励∪縺 + /// + /// + /// + private float SecFromXCoord( int pixel ) { + return (pixel + m_startToDrawX) / AppManager.Config.PixelPerSec; + } + + private int StartToDrawX() { + float ratio = ((float)(hScrollBar1.Value) / (float)(hScrollBar1.Maximum - hScrollBar1.Minimum + 1 - hScrollBar1.LargeChange)); + if ( AppManager.SaveData.m_screenWidth - pictureBox1.Width >= 0 ) { + return (int)((AppManager.SaveData.m_screenWidth - pictureBox1.Width) * ratio); + } else { + return 0; + } + } + + private int StartToDrawY() { + float ratio = ((float)(vScrollBar1.Value) / ((float)(vScrollBar1.Maximum - vScrollBar1.Minimum + 1 - vScrollBar1.LargeChange))); + //MessageBox.Show( "StartToDrawY=" + (int)(ratio * (m_screenHeight - pictureBox1.Height)) ); + if ( AppManager.SaveData.m_screenHeight - pictureBox1.Height >= 0 ) { + return (int)(ratio * (AppManager.SaveData.m_screenHeight - pictureBox1.Height)); + } else { + return 0; + } + } + + /// + /// s.m_groups_character縺ョ隨ャgroup逡ェ繧ー繝ォ繝シ繝励ョ縲∵凾蛻サtime縺ョ菴咲スョ縺ォ縺翫>縺ヲ縲 + /// 蟒カ髟キ蜿ッ閭ス縺ェ譎ょ綾繧単ointEx蝙九〒霑斐@縺セ縺 + /// + /// 繧ー繝ォ繝シ繝励ョ繧、繝ウ繝繝繧ッ繧ケ + /// 譎ょ綾 + /// + /// 謖螳壹&繧後◆繧ー繝ォ繝シ繝励ョ莉悶ョTimeTableType.mouth縺ィ陲ォ繧峨★縺ォ蜑榊セ後↓蟒カ髟キ縺吶k縺薙→縺後〒縺阪k遽蝗イ縲 + /// + private PointF GetEntryLimit( Item item, float time, bool ignore_me ) { + if ( item.type == TimeTableType.character ) { + string title = AppManager.SaveData.m_groups_character[item.group][item.track].Text; + string tag = AppManager.SaveData.m_groups_character[item.group].Character[title].tag; + + int track_num = AppManager.SaveData.m_groups_character[item.group].Count; + PointF[] points = new PointF[track_num]; + for ( int track = 0; track < track_num; track++ ) { + Item tmp = new Item( item.type, item.group, item.track, item.entry, item.row_index ); + string tmp_title = AppManager.SaveData.m_groups_character[item.group][track].Text; + string tmp_tag = AppManager.SaveData.m_groups_character[item.group].Character[tmp_title].tag; + if ( tag != "" && tag == tmp_tag ) { + tmp.track = track; + if ( track == item.track ) { + points[track] = GetEntryLimitSingle( tmp, time, ignore_me ); + } else { + points[track] = GetEntryLimitSingle( tmp, time, false ); + } + } else { + points[track].X = 0.0f; + points[track].Y = AppManager.SaveData.m_totalSec; + } + } + PointF result = new PointF( 0.0f, AppManager.SaveData.m_totalSec ); + for ( int track = 0; track < track_num; track++ ) { + result.X = Math.Max( result.X, points[track].X ); + result.Y = Math.Min( result.Y, points[track].Y ); + } + return result; + + } else { + return new PointF( time, time ); + } + } + + /// + /// Item讒矩菴薙〒謖螳壹&繧後k縲√ヨ繝ゥ繝繧ッ縺ョ譎ょ綾time縺ョ菴咲スョ縺ォ繧ィ繝ウ繝医Μ繧定ソス蜉縺励◆蝣エ蜷医↓縲 + /// 蜷後§繝医Λ繝繧ッ縺ョ蜑榊セ後ョ繧ィ繝ウ繝医Μ縺ィ陲ォ繧峨★縺ォ蟒カ髟キ縺吶k縺薙→縺ョ縺ァ縺阪k譎る俣縺ョ遽蝗イ繧定ェソ縺ケ縺セ縺吶 + /// ignore_me == true縺ョ譎ゅ(tem.entry縺ョ蟄伜惠繧堤┌隕悶@縺セ縺吶 + /// + /// + /// + /// + /// + private PointF GetEntryLimitSingle( Item item, float time, bool ignore_me ) { + TimeTableType type = item.type; + int group = item.group; + int track = item.track; + + if ( type == TimeTableType.character || type == TimeTableType.another || type == TimeTableType.plugin ) { + return GetEntryLimitSinglePart( AppManager.SaveData[type, group][track], time, ignore_me, item ); + } else { + return new PointF( time, time ); + } + } + + private PointF GetEntryLimitSinglePart( TimeTable table, float time, bool ignore_me, Item item ) { + if ( table.Count == 0 ) { + return new PointF( 0.0f, AppManager.SaveData.m_totalSec ); + } + int index_before; + int index_after; + index_before = -1; + index_after = table.Count; + float begin; + float end; + for ( int entry = 0; entry < table.Count; entry++ ) { + if ( ignore_me && entry == item.entry ) { + continue; + } + if ( time < table[entry].begin ) { + index_after = entry; + break; + } + } + for ( int entry = index_after - 1; entry >= 0; entry-- ) { + if ( ignore_me && entry == item.entry ) { + continue; + } + if ( table[entry].end < time ) { + index_before = entry; + break; + } + } + + // 譁ー縺励¥險ュ螳壹☆繧区凾蛻サ繧偵そ繝繝 + if ( index_before == -1 ) { + begin = 0.0f; + } else { + begin = table[index_before].end; + } + if ( index_after == table.Count ) { + end = AppManager.SaveData.m_totalSec; + } else { + end = table[index_after].begin; + } + + // + if ( index_after == index_before + 1 ) { + return new PointF( begin, end ); + } else { + if ( ignore_me && index_before == item.entry - 1 && index_after == item.entry + 1 ) { + return new PointF( begin, end ); + } else { + return new PointF( time, time ); + } + } + } + + /// + /// 繝槭え繧ケ縺ョy蠎ァ讓吶°繧峨√ち繧、繝繝繝シ繝悶Ν繝サ繧ー繝ォ繝シ繝励ョ逡ェ蜿キ繧貞叙蠕励@縺セ縺 + /// + /// 莉ョ諠ウ繧ケ繧ッ繝ェ繝シ繝ウ荳翫ョ繝槭え繧ケ縺ョ蠎ァ讓 + /// + /// 隨ャi繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ繧ソ繧、繝医Ν縺ォ繝槭え繧ケ縺後≠縺」縺溘→縺 + /// new Item( i, -1, -1) + /// 隨ャi繧ソ繧、繝繝繝シ繝悶Ν繝サ繧ー繝ォ繝シ繝励ョ隨ャj繧ソ繧、繝繝繝シ繝悶Ν縺ョ縲√ユ繝シ繝悶Ν繧ィ繝ウ繝医Μ莉・螟悶ョ蝣エ謇縺ォ繝槭え繧ケ縺後≠縺」縺溘→縺 + /// new Item( i, j, -1 ) + /// 隨ャi繧ソ繧、繝繝繝シ繝悶Ν繝サ繧ー繝ォ繝シ繝励ョ隨ャj繧ソ繧、繝繝繝シ繝悶Ν縺ョ隨ャk繧ィ繝ウ繝医Μ繝シ縺ォ繝槭え繧ケ縺後≠縺」縺溘→縺 + /// new Item( i, j, k ) + /// + private Item GetGroupItem( int x, int y ) { + int track_count = 0; + Item item = new Item( TimeTableType.none, -1, -1, -1, -1 ); + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + item.type = TimeTableType.top; + return item; + } + + bool vsq_fixed = menuVisualVsqTrack.Checked; + /* + * vsq縺ョ繧ー繝ォ繝シ繝励r讀懃エ「 + */ + // 繧ソ繧、繝医Ν + track_count++; + int yy = y; + if ( vsq_fixed ) { + yy = y - m_startToDrawY; + } + if ( track_count * AppManager.Config.TrackHeight <= yy && yy < (track_count + 1) * AppManager.Config.TrackHeight ) { + item.type = TimeTableType.vsq; + item.group = 0; + item.row_index = track_count; + return item; + } + if ( !AppManager.SaveData.m_group_vsq.Folded ) { + // 譛ャ菴 + for ( int i = 0; i < AppManager.SaveData.m_group_vsq.Count; i++ ) { + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= yy && yy < (track_count + 1) * AppManager.Config.TrackHeight ) { + item.type = TimeTableType.vsq; + item.group = 0; + item.track = i; + item.row_index = track_count; + for ( int entry = 0; entry < AppManager.SaveData.m_group_vsq[item.track].Count; entry++ ) { + int xx = (int)(AppManager.SaveData.m_group_vsq[item.track][entry].begin * AppManager.Config.PixelPerSec); + int xend = (int)(AppManager.SaveData.m_group_vsq[item.track][entry].end * AppManager.Config.PixelPerSec); + if ( xx <= x && x < xend ) { + item.entry = entry; + break; + } + } + return item; + } + } + } + + /* + * 繧ュ繝」繝ゥ繧ッ繧ソ縺ョ繧ー繝ォ繝シ繝励r讀懃エ「 + */ + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + // 繧ソ繧、繝医Ν + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = TimeTableType.character; + item.group = group; + item.row_index = track_count; + return item; + } + } + if ( !AppManager.SaveData.m_groups_character[group].Folded ) { + for ( int track = 0; track < AppManager.SaveData.m_groups_character[group].Count; track++ ) { + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = AppManager.SaveData.m_groups_character[group][track].Type; + item.group = group; + item.track = track; + item.row_index = track_count; + for ( int entry = 0; entry < AppManager.SaveData.m_groups_character[item.group][item.track].Count; entry++ ) { + int xx = (int)(AppManager.SaveData.m_groups_character[item.group][item.track][entry].begin * AppManager.Config.PixelPerSec); + int xend = (int)(AppManager.SaveData.m_groups_character[item.group][item.track][entry].end * AppManager.Config.PixelPerSec); + if ( xx <= x && x < xend ) { + item.entry = entry; + break; + } + } + return item; + } + } + } + } + } + + /* + * 蟄怜ケ輔r讀懃エ「 + */ + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ){ + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height ) ){ + item.type = TimeTableType.telop; + item.group = 0; + item.track = -1; + item.row_index = track_count; + return item; + } + } + if ( !AppManager.SaveData.TelopListFolded ){ + if ( (track_count + 1) * AppManager.Config.TrackHeight <= y && y < (track_count + AppManager.MaxTelopLanes + 1) * AppManager.Config.TrackHeight ) { + item.type = TimeTableType.telop; + item.group = 0; + item.track = 0; + item.row_index = track_count; + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + int xx = (int)(AppManager.SaveData.m_telop_ex2[i].Start * AppManager.Config.PixelPerSec); + int xend = (int)(AppManager.SaveData.m_telop_ex2[i].End * AppManager.Config.PixelPerSec); + int y1 = (track_count + AppManager.SaveData.m_telop_ex2[i].Lane + 1) * AppManager.Config.TrackHeight; + if ( xx <= x && x < xend && y1 <= y && y < y1 + AppManager.Config.TrackHeight ) { + item.row_index = track_count + AppManager.SaveData.m_telop_ex2[i].Lane + 1; + item.entry = AppManager.SaveData.m_telop_ex2[i].ID; + break; + } + } + return item; + } + track_count += AppManager.MaxTelopLanes; + } + + /* + * 縺昴ョ莉悶ョ繧、繝。繝シ繧ク繧呈、懃エ「 + */ + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = TimeTableType.another; + item.group = 0; + item.row_index = track_count; + return item; + } + } + // 譛ャ菴 + if ( !AppManager.SaveData.m_group_another.Folded ) { + for ( int i = 0; i < AppManager.SaveData.m_group_another.Count; i++ ) { + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = TimeTableType.another; + item.group = 0; + item.track = i; + item.row_index = track_count; + for ( int entry = 0; entry < AppManager.SaveData.m_group_another[item.track].Count; entry++ ) { + int xx = (int)(AppManager.SaveData.m_group_another[item.track][entry].begin * AppManager.Config.PixelPerSec); + int xend = (int)(AppManager.SaveData.m_group_another[item.track][entry].end * AppManager.Config.PixelPerSec); + if ( xx <= x && x < xend ) { + item.entry = entry; + break; + } + } + return item; + } + } + } + } + + // 繝励Λ繧ー繧、繝ウ繧呈、懃エ「 + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = TimeTableType.plugin; + item.group = 0; + item.row_index = track_count; + return item; + } + } + // 譛ャ菴 + if ( !AppManager.SaveData.m_group_plugin.Folded ) { + for ( int i = 0; i < AppManager.SaveData.m_group_plugin.Count; i++ ) { + track_count++; + if ( track_count * AppManager.Config.TrackHeight <= y && y < (track_count + 1) * AppManager.Config.TrackHeight ) { + if ( !vsq_fixed || (vsq_fixed && yy >= m_vsq_height) ) { + item.type = TimeTableType.plugin; + item.group = 0; + item.track = i; + item.row_index = track_count; + for ( int entry = 0; entry < AppManager.SaveData.m_group_plugin[item.track].Count; entry++ ) { + int xx = (int)(AppManager.SaveData.m_group_plugin[item.track][entry].begin * AppManager.Config.PixelPerSec); + int xend = (int)(AppManager.SaveData.m_group_plugin[item.track][entry].end * AppManager.Config.PixelPerSec); + if ( xx <= x && x < xend ) { + item.entry = entry; + break; + } + } + return item; + } + } + } + } + return item; + } + + /// + /// 謖螳壹&繧後◆逕サ蜒上r謖螳壹@縺滉ス咲スョ縺ォ繝励Ξ繝薙Η繝シ陦ィ遉コ縺励∪縺 + /// + /// 陦ィ遉コ縺吶k逕サ蜒 + /// pictureBox1荳翫ョ繝励Ξ繝薙Η繝シ逕サ蜒上ョ陦ィ遉コ菴咲スョ菴咲スョ + private void ShowPreviewPictureBox( Image image, Point position ) { + if ( image == null ) { + return; + } + int width = image.Width; + int height = image.Height; + preview_image.Width = width; + preview_image.Height = height; + preview_image.Image = image; + int x = position.X; + int y = position.Y; + bool right = false; + bool down = false; + if ( pictureBox1.Width / 2 < x ) { + x -= width; + right = true; + } + if ( pictureBox1.Height / 2 < y ) { + y -= height; + down = true; + } + float scale_x = 1f; + if ( x + width > pictureBox1.Width ) { + scale_x = (float)(pictureBox1.Width - x) / (float)width; + } else if ( x < 0 ) { + scale_x = (float)(x + width) / (float)width; + } + float scale_y = 1f; + if ( y + height > pictureBox1.Height ) { + scale_y = (float)(pictureBox1.Height - y) / (float)height; + } else if ( y < 0 ) { + scale_y = (float)(y + height) / (float)height; + } + float scale = Math.Min( scale_x, scale_y ); + if ( scale < 1f ) { + preview_image.Size = new Size( (int)(width * scale), (int)(height * scale) ); + if ( right ) { + x += (int)(width - width * scale); + } else { + if ( x < 0 ) { + x = 0; + } + } + if ( down ) { + y += (int)(height - height * scale); + } else { + if ( y < 0 ) { + y = 0; + } + } + } + preview_image.Top = y;//position.Y;// + Panels.Panel2.Top + 1; + preview_image.Left = x;//position.X;// + Panels.Panel2.Left + 1; + + m_preview_time = DateTime.Now; + preview_image.Visible = true; + this.Invalidate(); + } + + /// + /// 譌「蟄倥ョ繝繝シ繧ソ繧堤エ譽縺励∪縺吶よ悴菫晏ュ俶凾縺ョ繝√ぉ繝繧ッ縺ッ陦後o縺ェ縺縲 + /// + private void ClearExistingData() { + StopPauseCore(); //timerPreview.Enabled = false; + previewer.TrackBarValue = 0; + previewer.TrackBarMaximum = 0; + AppManager.SaveData.m_zorder.Clear(); + AppManager.SaveData.m_group_vsq.Clear(); + AppManager.SaveData.m_groups_character.Clear(); + AppManager.SaveData.m_group_another.Clear(); + for ( int i = 0; i < AppManager.SaveData.m_group_plugin.Count; i++ ) { + AppManager.SaveData.m_group_plugin[i].Clear(); + AppManager.SaveData.m_plugins_config[i].Config = ""; + } + AppManager.ClearCommandBuffer(); + AppManager.SaveData.m_totalSec = 0.0f; + m_not_used_plugin.Clear(); + m_not_used_plugin_config.Clear(); + m_player.Close(); + AppManager.SaveData.m_telop_ex2.Clear(); + AppManager.MaxTelopLanes = 0; + property.Editing = null; + AppManager.SaveData.REPEAT_START = 0f; + AppManager.SaveData.REPEAT_END = -1f; + if ( AppManager.SaveData.m_timesig_ex != null ) { + AppManager.SaveData.m_timesig_ex.Clear(); + } + if ( AppManager.SaveData.m_tempo != null ) { + AppManager.SaveData.m_tempo.Clear(); + } + m_curve.Clear(); + menuEditRedo.Enabled = false; + menuEditUndo.Enabled = false; + UpdateObjectList(); + } + + /// + /// 謖螳壹&繧後◆繝医Λ繝繧ッ縺九i縲∵ュ瑚ゥ槭ョ繧ソ繧、繝繝ゥ繧、繝ウ繧定ェュ縺ソ霎シ縺ソ縲∫樟蝨ィ縺ョvsq繝医Λ繝繧ッ繝ェ繧ケ繝医 + /// s.m_group_vsq縺ォ霑ス蜉縺励∪縺吶 + /// + /// 霑ス蜉縺吶k繝医Λ繝繧ッ + private void addTimeLineFromTrack( VsqFile vsqFile, int track_number, bool enable_undo ) { + string tmp_lyric = Path.GetTempFileName(); + vsqFile.printLyricTable( track_number, tmp_lyric ); + using ( TimeTable temp = new TimeTable( vsqFile.getTrack( track_number ).Name, 0, TimeTableType.vsq, null ) ) { + using ( StreamReader sr = new StreamReader( tmp_lyric ) ) { + string line; + while ( sr.Peek() >= 0 ) { + line = sr.ReadLine(); + string[] spl = line.Split( new char[] { ',' } ); + float begin = float.Parse( spl[1] ); + float end = float.Parse( spl[2] ); + string body = spl[3] + "(" + spl[4] + ")"; + temp.Add( new TimeTableEntry( begin, end, body ) ); + } + } + Command run = Command.GCommandAddTimeTable( TimeTableType.vsq, -1, AppManager.SaveData.m_group_vsq.Count, temp ); + Command inv = AppManager.SaveData.Execute( run ); + if ( enable_undo ) { + AppManager.Register( inv ); + } + + } + + File.Delete( tmp_lyric ); + AppManager.Edited = true; + } + + private void AddTimeLineFromUst( UstFile ust_file, int track_number, bool enable_undo ) { + TimeTable temp = new TimeTable( ust_file.getProjectName(), 0, TimeTableType.vsq, null ); + int count = 0; + for ( int i = 0; i < ust_file.getTrack( track_number ).getEventCount(); i++ ) { + UstEvent ue = ust_file.getTrack( track_number ).getEvent( i ); + float start = (float)ust_file.getSecFromClock( count ); + float end = (float)ust_file.getSecFromClock( (int)(count + ue.Length) ); + string phrase = ue.Lyric; + if ( phrase != "R" ) { + string symbol = "a"; + if ( !SymbolTable.attatch( phrase, out symbol ) ) { + symbol = "a"; + } + temp.Add( new TimeTableEntry( start, end, phrase + "(" + symbol + ")" ) ); + } + count += (int)ue.Length; + } + Command run = Command.GCommandAddTimeTable( TimeTableType.vsq, -1, AppManager.SaveData.m_group_vsq.Count, temp ); + Command inv = AppManager.SaveData.Execute( run ); + if ( enable_undo ) { + AppManager.Register( inv ); + } + } + + /// + /// VSQ繝輔ぃ繧、繝ォ縺ョ繝医Λ繝繧ッ諠蝣ア縺九i縲∝哨縺ョ蜍輔″縺ョ繧ソ繧、繝繝ゥ繧、繝ウ繧剃ス懈舌@縺セ縺 + /// + /// + private void GenerateLipsyncFromVsq( TimeTable time_table, Character3 character, bool enable_undo ) { + string name = character.Name; + TimeTableGroup temp = new TimeTableGroup( name, 0, character ); + + TimeTableGroup.GenerateLipSyncFromVsq( time_table, + ref temp, + character, + AppManager.SaveData.m_totalSec, + AppManager.Config.CloseMouthWhenSameVowelsRepeated, + AppManager.SaveData.FrameRate, + AppManager.Config.EntryCombineThreshold ); + + Command run = Command.GCommandAddGroup( TimeTableType.character, + AppManager.SaveData.m_groups_character.Count, + temp ); + Command inv = AppManager.SaveData.Execute( run ); + if ( enable_undo ) { + AppManager.Register( inv ); + } + temp.Dispose(); + + if ( enable_undo ) { + AppManager.Edited = true; + } + UpdateObjectList(); + AppManager.SaveData.UpdateZorder(); + } + + private DialogResult requestIntention() { + if ( m_filePath != "" ) { + return MessageBox.Show( "'" + Path.GetFileName( m_filePath ) + "'" + _( " has been changed. Do you wish to save changes to file?" ), "LipSync", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation ); + } else { + return MessageBox.Show( _( "Do you wish to save changes to file?" ), "LipSync", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation ); + } + } + + /// + /// 謫堺ス懃腸蠅縺ョ險ュ螳夐逶ョ繧剃ソ晏ュ倥@縺セ縺 + /// + private void SaveConfig() { + AppManager.Config.CloseMouthPhoneticSymbols.Clear(); + foreach ( string s in VowelType.m_list_nn ) { + AppManager.Config.CloseMouthPhoneticSymbols.Add( s ); + } + AppManager.Config.IMouthPhoneticSymbols.Clear(); + foreach ( string s in VowelType.m_list_i ) { + AppManager.Config.IMouthPhoneticSymbols.Add( s ); + } + AppManager.Config.UMouthPhoneticSymbols.Clear(); + foreach ( string s in VowelType.m_list_u ) { + AppManager.Config.UMouthPhoneticSymbols.Add( s ); + } + AppManager.Config.CleanUpMouthList(); + string config_file = Path.Combine( Application.StartupPath, "LipSync.config" ); + AppManager.Config.Save( config_file ); + } + + /// + /// 謫堺ス懃腸蠅縺ョ險ュ螳夐逶ョ繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ縲驕ゥ逕ィ縺励∪縺 + /// + private void LoadConfig() { + string config_file = Path.Combine( Application.StartupPath, "LipSync.config" ); + AppManager.Config = EnvSettings.FromFile( config_file ); + AppManager.Config.CleanUpMouthList(); + VowelType.m_list_i.Clear(); + foreach ( string s in AppManager.Config.IMouthPhoneticSymbols ) { + VowelType.m_list_i.Add( s ); + } + VowelType.m_list_nn.Clear(); + foreach ( string s in AppManager.Config.CloseMouthPhoneticSymbols ) { + VowelType.m_list_nn.Add( s ); + } + VowelType.m_list_u.Clear(); + foreach ( string s in AppManager.Config.UMouthPhoneticSymbols ) { + VowelType.m_list_u.Add( s ); + } + + // restore window size & location | 繧ヲ繧」繝ウ繝峨え菴咲スョ繝サ繧オ繧、繧コ縺ョ蠕ゥ蜈 + bool visible = false; + Point pt_lu = AppManager.Config.WindowPosition.Location; + Point pt_ll = new Point( AppManager.Config.WindowPosition.Left, AppManager.Config.WindowPosition.Bottom ); + Point pt_ru = new Point( AppManager.Config.WindowPosition.Right, AppManager.Config.WindowPosition.Top ); + Point pt_rl = new Point( AppManager.Config.WindowPosition.Right, AppManager.Config.WindowPosition.Bottom ); + foreach ( Screen s in Screen.AllScreens ) { + Rectangle r = s.Bounds; + visible = visible | (AppManager.IsInRectangle( pt_lu, r ) | AppManager.IsInRectangle( pt_ll, r ) | AppManager.IsInRectangle( pt_ru, r ) | AppManager.IsInRectangle( pt_rl, r )); + } + if ( visible ) { + this.Top = AppManager.Config.WindowPosition.Top; + this.Left = AppManager.Config.WindowPosition.Left; + this.Width = AppManager.Config.WindowPosition.Width; + this.Height = AppManager.Config.WindowPosition.Height; + } else { + this.Width = Screen.PrimaryScreen.Bounds.Width / 2; + this.Height = Screen.PrimaryScreen.Bounds.Height / 2; + this.Top = this.Height / 2; + this.Left = this.Width / 2; + } + if ( AppManager.Config.WindowIsMaximized ) { + base.WindowState = FormWindowState.Maximized; + } + + Messaging.Language = AppManager.Config.Language; + ApplyLanguage(); + + // 諡。蠑オ蜑阪ョ險ュ螳壹ヵ繧。繧、繝ォ縺ォ蟇セ蠢 + // 縺縺セ繧薙→縺薙↑縺ォ繧ゅ↑縺 + + previewer.PreviewSizeMode = AppManager.Config.PreviewZoomMode; + + AppManager.Config.PreviewHidden = !AppManager.Config.PreviewHidden; + ChangePreviewHidden(); + AppManager.Config.PropertyHidden = !AppManager.Config.PropertyHidden; + ChangePropertyHidden(); + + menuVisualBars.Checked = AppManager.Config.DrawBars; + } + + /// + /// 繧ッ繧ェ繝ウ繧ソ繧、繧コ繝「繝シ繝臥畑縺ョ繧ー繝ェ繝繝峨Μ繧ケ繝医稽_grids縲阪r譖エ譁ー縺励∪縺 + /// + private void UpdateGridList() { + IEnumerable blte = AppManager.SaveData.GetBarLineTypeEnumerator( AppManager.Config.QuantizeMode, AppManager.Config.QuantizeTripletEnabled ); + float start = m_startToDrawX / (float)AppManager.Config.PixelPerSec; + float end = (m_startToDrawX + pictureBox1.Width) / (float)AppManager.Config.PixelPerSec; + List c = new List(); + foreach ( BarLineType bar in blte ) { + if ( start <= bar.Time && bar.Time <= end && !bar.NeverUseForSnapPoint ) { + c.Add( (float)bar.Time ); + } else if ( bar.Time > end ) { + break; + } + } + m_grids = c.ToArray(); + } + + public float Now { + get { + if ( AppManager.Playing ) { + TimeSpan ts = (DateTime.Now).Subtract( m_started_date ); + return (float)ts.TotalSeconds * m_player.Speed; + } else { + int nof = previewer.TrackBarValue; + return nof / AppManager.SaveData.FrameRate; + } + } + } + + /// + /// 繧ソ繧、繝繝ゥ繧、繝ウ蟾ヲ遶ッ縺ョシ後げ繝ォ繝シ繝玲釜繧翫◆縺溘∩迥カ諷九r陦ィ縺吩ク芽ァ貞ス「繧呈緒逕サ縺吶k + /// + /// + /// + /// + private void DrawTriangle( Graphics g, int y, bool folded ) { + SmoothingMode past = g.SmoothingMode; + g.SmoothingMode = SmoothingMode.AntiAlias; + using ( SolidBrush brs = new SolidBrush( TRIANGLE_COLOR ) ) { + using ( Pen pen = new Pen( brs ) ) { + pen.LineJoin = LineJoin.Round; + Point[] list = new Point[6]; + if ( folded ) { + list[0] = new Point( 6, y + 15 ); + list[1] = new Point( 6, y + 2 ); + list[2] = new Point( 7, y + 2 ); + list[3] = new Point( 13, y + 8 ); + list[4] = new Point( 13, y + 9 ); + list[5] = new Point( 7, y + 15 ); + } else { + list[0] = new Point( 2, y + 5 ); + list[1] = new Point( 15, y + 5 ); + list[2] = new Point( 15, y + 6 ); + list[3] = new Point( 9, y + 12 ); + list[4] = new Point( 8, y + 12 ); + list[5] = new Point( 2, y + 6 ); + } + g.DrawLines( pen, list ); + g.FillPolygon( brs, list ); + } + } + g.SmoothingMode = past; + } + + /// + /// 繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝葉able繧偵√げ繝ゥ繝輔ぅ繧ッ繧ケg繧堤畑縺縺ヲ縲∽ス咲スョposition縺ォ謠冗判縺励∪縺吶 + /// 謠冗判縺ョ邨先棡縲∵緒縺九l縺溘ち繧、繝繝繝シ繝悶Ν縺ョ逕サ髱「荳翫ョ鬮倥&(繝斐け繧サ繝ォ)繧檀eight縺ォ霑斐@縺セ縺吶 + /// + /// + /// + /// + /// + /// + private void DrawTimeTableGroup( Graphics g, Point position, out int height, TimeTableGroup table, string title ) { + //int y = position.Y; + Rectangle outline = new Rectangle( position.X, position.Y, pictureBox1.Width, AppManager.Config.TrackHeight ); + g.FillRectangle( new SolidBrush( AppManager.Config.TimeLineTitleColor.Color ), + outline ); + g.DrawString( title, + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X, position.Y + AppManager.Config.VerticalStringOffset ) ); + if ( table.Folded ) { + height = AppManager.Config.TrackHeight; + return; + } + if ( table.Count > 0 ) { + TimeTableType type = table[0].Type; + for ( int j = 0; j < table.Count; j++ ) { + int i = j; + int y = (i + 1) * AppManager.Config.TrackHeight; + bool first_draw = true; + for ( int list_index = 0; list_index < table[i].Count; list_index++ ) { + int x = (int)(table[i][list_index].begin * AppManager.Config.PixelPerSec) - m_startToDrawX; + int xend = (int)(table[i][list_index].end * AppManager.Config.PixelPerSec) - m_startToDrawX; + if ( first_draw ) { + if ( xend >= 0 ) { + first_draw = false; + } else { + continue; + } + } else { + if ( x > pictureBox1.Width ) { + break; + } + } + int yend = y + AppManager.Config.TrackHeight; + Color col; + switch ( table[i].Type ) { + case TimeTableType.vsq: + col = AppManager.Config.TimeLineVsqColor.Color; + break; + case TimeTableType.plugin: + col = AppManager.Config.TimeLinePluginColor.Color; + break; + default: + col = AppManager.Config.TimeLineDefaultColor.Color; + break; + } + using ( Brush fill = new SolidBrush( col ) ) { + Rectangle rc = new Rectangle( + new Point( position.X + x, position.Y + y ), + new Size( xend - x, AppManager.Config.TrackHeight - 1 ) ); + g.FillRectangle( fill, rc ); + if ( table[i].Type == TimeTableType.plugin ) { + g.DrawString( "[]", + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X + x, position.Y + y + AppManager.Config.VerticalStringOffset ) ); + } else if ( table[i].Type == TimeTableType.vsq ) { + string bd = table[i][list_index].body; + bd = bd.Replace( @"\\", @"\" ); + g.DrawString( bd, + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X + x, position.Y + y + AppManager.Config.VerticalStringOffset ) ); + } else { + g.DrawString( table[i][list_index].body, + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X + x, position.Y + y + AppManager.Config.VerticalStringOffset ) ); + } + if ( x <= m_mousePosition.X && m_mousePosition.X < xend && + y <= m_mousePosition.Y && m_mousePosition.Y < yend ) { + } else { + g.DrawRectangle( _PEN_123_123_123, rc ); + } + } + } + + g.DrawString( table[i].Text, + AppManager.Config.Font.GetFont(), + _BRS_TRACK_NAME, + new PointF( position.X, position.Y + y + AppManager.Config.VerticalStringOffset ) ); + } + } + height = (table.Count + 1) * AppManager.Config.TrackHeight; + } + + /// + /// Draw telop(s) to the specified position using specified Graphics + /// + /// + /// + /// + /// + private void DrawTelop( Graphics g, Point position, out int height, string title ) { + height = (AppManager.MaxTelopLanes + 1) * AppManager.Config.TrackHeight; + Rectangle outline = new Rectangle( position.X, position.Y, pictureBox1.Width, AppManager.Config.TrackHeight ); + g.FillRectangle( new SolidBrush( AppManager.Config.TimeLineTitleColor.Color ), + outline ); + g.DrawString( title, + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X, position.Y + AppManager.Config.VerticalStringOffset ) ); + if ( AppManager.SaveData.TelopListFolded ) { + height = AppManager.Config.TrackHeight; + return; + } + using ( Brush fill = new SolidBrush( AppManager.Config.TimeLineDefaultColor.Color ) ) { + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + int y = (AppManager.SaveData.m_telop_ex2[i].Lane + 1) * AppManager.Config.TrackHeight; + int x = (int)(AppManager.SaveData.m_telop_ex2[i].Start * AppManager.Config.PixelPerSec) - m_startToDrawX; + int xend = (int)(AppManager.SaveData.m_telop_ex2[i].End * AppManager.Config.PixelPerSec) - m_startToDrawX; + Rectangle rc = new Rectangle( + new Point( position.X + x, position.Y + y ), + new Size( xend - x, AppManager.Config.TrackHeight - 1 ) ); + g.FillRectangle( fill, rc ); + g.DrawString( AppManager.SaveData.m_telop_ex2[i].Text.Replace( '\n', ' ' ), + AppManager.Config.Font.GetFont(), + Brushes.Black, + new PointF( position.X + x, position.Y + y + AppManager.Config.VerticalStringOffset ) ); + g.DrawRectangle( _PEN_123_123_123, rc ); + } + } + } + + public string _( string s ) { + return Messaging.GetMessage( s ); + } + + private void m_text_TextChanged( object sender, EventArgs e ) { + Size size = m_text.PreferredSize; + if ( size.Width <= (int)m_text.Tag ) { + size = new Size( (int)m_text.Tag, size.Height ); + } + m_text.Size = size; + property.Editing = new ZorderItem( "", ZorderItemType.telop, m_text_id ); + UpdateEditHandle(); + } + + public void UpdateEditHandle() { + ZorderItem item = property.Selected; + if ( item == null ) { + return; + } + int index = item.Index; + float now = Now; + Rectangle rc; + bool item_fixed; + switch ( item.Type ) { + case ZorderItemType.telop: + Telop telop = AppManager.SaveData[index]; + if ( telop.Start <= now && now <= telop.End ) { + rc = CRectFromIRect( new Rectangle( Common.PointFromPointF( telop.GetPosition( now ) ), + Common.SizeFromSizeF( telop.ImageSize ) ), + telop.GetScale( now ) ); + item_fixed = telop.PositionFixed; + } else { + rc = new Rectangle(); + item_fixed = false; + } + m_editing = new EditingBounds( rc, item_fixed, telop.IsXFixedAt( now ), telop.IsYFixedAt( now ) ); + break; + case ZorderItemType.another: + TimeTable table = AppManager.SaveData.m_group_another[index]; + if ( table.IsOn( now ) ) { + if ( table.Image != null ) { + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table.GetPosition( now ) ), + Common.SizeFromSizeF( table.ImageSize ) ), + Math.Abs( table.Scale ) ), + table.PositionFixed, + table.IsXFixedAt( now ), + table.IsYFixedAt( now ) ); + } + } else { + m_editing = new EditingBounds(); + } + break; + case ZorderItemType.character: + TimeTableGroup table_group = AppManager.SaveData.m_groups_character[index]; + m_editing = new EditingBounds( CRectFromIRect( new Rectangle( Common.PointFromPointF( table_group.GetPosition( now ) ), + table_group.Character.Size ), + Math.Abs( table_group.Scale ) ), + table_group.PositionFixed, + table_group.IsXFixedAt( now ), + table_group.IsYFixedAt( now ) ); + break; + } + previewer.Invalidate(); + } + + /// + /// 繝薙ョ繧ェ逕サ蜒丈ク翫ョ蠎ァ讓吶r縲 ̄reviewP荳翫ョ蠎ァ讓吶↓霑秘d縺励∪縺 + /// + /// + /// + /// + private Rectangle CRectFromIRect( Rectangle iRect, float scale ) { + Point p = iRect.Location; + Size size = iRect.Size; + int xx, yy, width, height; + xx = p.X; + yy = p.Y; + width = (int)(size.Width * scale); + height = (int)(size.Height * scale); + Point iTopLeft = new Point( xx, yy ); + Point iBottomRight = new Point( xx + width, yy + height ); + Point cTopLeft = CCoordFromI( iTopLeft ); + Point cBottomRight = CCoordFromI( iBottomRight ); + return new Rectangle( cTopLeft, new Size( cBottomRight.X - cTopLeft.X, cBottomRight.Y - cTopLeft.Y ) ); + } + + private void timerPreview_Tick( object sender, EventArgs e ) { + float now; + if ( AppManager.Playing ) { + now = Now; + int nof = (int)(now * AppManager.SaveData.FrameRate); + if ( m_is_repeat_mode ) { + if ( previewer.TrackBarValue < (int)(RepeatStart * AppManager.SaveData.FrameRate) || (int)(RepeatEnd * AppManager.SaveData.FrameRate) < previewer.TrackBarValue ) { +#if DEBUG + Common.DebugWriteLine( "trackBar1.Value,(int)(RepeatStart * s.fps)=" + previewer.TrackBarValue + "," + (int)(RepeatStart * AppManager.SaveData.FrameRate) ); +#endif + Pause(); + previewer.TrackBarValue = (int)(RepeatStart * AppManager.SaveData.FrameRate); + Play(); + return; + } + } else { + if ( nof > previewer.TrackBarMaximum ) { + StopMusic(); + return; + } + } + if ( nof < previewer.TrackBarMinimum || previewer.TrackBarMaximum < nof ) { + StopMusic(); + } else { + previewer.TrackBarValue = nof; + } + } else { + now = Now; + } + + DateTime n = DateTime.Now; + TimeSpan ts = n.Subtract( m_last_ignitted ); + m_last_ignitted = n; + double diff = ts.TotalSeconds; + for ( int i = 0; i < BUF_LEN - 1; i++ ) { + m_buf[i] = m_buf[i + 1] + diff; + } + m_buf[BUF_LEN - 1] = diff; + m_fps = BUF_LEN / m_buf[0]; + correctPosition(); + if ( m_last_key != Keys.None ) { + AppManager.SaveData.m_groups_character[m_realtime_group][m_realtime_track][m_realtime_entry].end = Now; + } + previewer.LabelTimeText = now.ToString( "0.00" ) + "s"; + previewer.Invalidate();// PreviewP.Invalidate(); + pictureBox1.Invalidate(); + //lblTime.Invalidate(); + } + + private int GetDraftStartToDrawX( int scroll_value ) { + float ratio = ((float)(scroll_value) / (float)(hScrollBar1.Maximum - hScrollBar1.Minimum + 1 - hScrollBar1.LargeChange)); + if ( AppManager.SaveData.m_screenWidth - pictureBox1.Width >= 0 ) { + return (int)((AppManager.SaveData.m_screenWidth - pictureBox1.Width) * ratio); + } else { + return 0; + } + } + + /// + /// 繝励Ξ繝薙Η繝シ縺ィ繧ソ繧、繝繝繝シ繝悶Ν縺後す繝ウ繧ッ繝ュ縺吶k繧医≧縺ォ縲”ScrollBar1.Value繧貞、画峩縺励∪縺 + /// + private void correctPosition() { + if ( menuVisualSync.Checked ) { + if ( AppManager.Config.SyncAtCentre ) { + float now = Now;// t * m_player.Speed * 0.001f; + int draft_start_to_draw_x = (int)(now * AppManager.Config.PixelPerSec) - pictureBox1.Width / 2; + int scroll_value = (int)(draft_start_to_draw_x * (float)(hScrollBar1.Maximum - hScrollBar1.Minimum + 1 - hScrollBar1.LargeChange) / (AppManager.SaveData.m_screenWidth - pictureBox1.Width)); + if ( scroll_value < hScrollBar1.Minimum ) { + scroll_value = hScrollBar1.Minimum; + } else if ( scroll_value > hScrollBar1.Maximum - hScrollBar1.LargeChange ) { + scroll_value = hScrollBar1.Maximum - hScrollBar1.LargeChange; + } + hScrollBar1.Value = scroll_value; + m_startToDrawX = StartToDrawX(); + } else { + int new_value; + int draft_hScrollBar1_Value = hScrollBar1.Value; // hScrollBar1.Value縺ョ蛟呵」懷、縲DorrectPosition縺檎カ壹¢縺ヲ蜻シ縺ー繧後k縺ョ繧帝亟縺舌◆繧√ + int draft_start_to_draw_x = m_startToDrawX; + float t_start = m_startToDrawX / AppManager.Config.PixelPerSec; + float t_end = t_start + pictureBox1.Width / AppManager.Config.PixelPerSec; + float band_width = (t_end - t_start) * SIDE_WIDTH; + float now = Now; + int count = 0; + while ( t_end - band_width < now || now < t_start ) { // 谺。縺ョpreviewTimer.Tick縺ァcorrectPosition縺悟他縺ー繧後↑縺繧医≧縺ォ縲 + count++; + if ( count > 100 ) { + break; + } + if ( t_end - band_width < now ) { + // 谺。縺ョ逕サ髱「縺ク繧ケ繧ッ繝ュ繝シ繝ォ縺吶k蠢隕√′縺ゅk縲 + new_value = draft_hScrollBar1_Value + (int)((t_end - t_start - band_width) * AppManager.Config.PixelPerSec); + if ( new_value <= hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange ) { + draft_hScrollBar1_Value = new_value; + } else { + draft_hScrollBar1_Value = hScrollBar1.Maximum + 1 - hScrollBar1.LargeChange; + } + draft_start_to_draw_x = GetDraftStartToDrawX( draft_hScrollBar1_Value ); + } else if ( now < t_start ) { + // 蜑阪ョ逕サ髱「縺ク繧ケ繧ッ繝ュ繝シ繝ォ縺吶k蠢隕√′縺ゅk + new_value = draft_hScrollBar1_Value - (int)((t_end - t_start - band_width) * AppManager.Config.PixelPerSec); + if ( new_value >= hScrollBar1.Minimum ) { + draft_hScrollBar1_Value = new_value; + } else { + draft_hScrollBar1_Value = hScrollBar1.Minimum; + } + draft_start_to_draw_x = GetDraftStartToDrawX( draft_hScrollBar1_Value ); + } + t_start = draft_start_to_draw_x / AppManager.Config.PixelPerSec; + t_end = t_start + pictureBox1.Width / AppManager.Config.PixelPerSec; + band_width = (t_end - t_start) * SIDE_WIDTH; + now = Now; + } + hScrollBar1.Value = draft_hScrollBar1_Value; + m_startToDrawX = StartToDrawX(); + } + } + } + + private void UpdateScreenCore() { + timerPreview_Tick( null, null ); + Application.DoEvents(); + } + + private void UpdateScreen() { + while ( true ) { + this.Invoke( new ForceScreenUpdateDelegate( UpdateScreenCore ) ); + Application.DoEvents(); + } + } + + private void Play() { + m_editing_item = null; + m_editing = new EditingBounds(); + + Size size = AppManager.SaveData.m_movieSize; + previewer.PlayPauseText = _( "Pause" ); + m_current_frame = previewer.TrackBarValue; + initializeFirstEntry(); + + bool ret = m_player.PlayFrom( ((double)m_current_frame) / AppManager.SaveData.FrameRate ); +#if DEBUG + Common.DebugWriteLine( "m_current_frame=" + m_current_frame ); + Common.DebugWriteLine( "AppManager.SaveData.FrameRate=" + AppManager.SaveData.FrameRate ); +#endif + m_started_date = DateTime.Now; + //timerPreview.Enabled = true; + m_preview_thread = new Thread( new ThreadStart( this.UpdateScreen ) ); + m_preview_thread.Priority = ThreadPriority.BelowNormal; + m_preview_thread.Start(); + m_started_date = m_started_date.AddSeconds( -Now / (m_player.Speed) ); + + //m_fit_centre_a = 3f * (Now * m_config.PIXEL_PER_SEC - m_startToDrawX - pictureBox1.Width / 2) / (FIT_CENTER_BREND_TIME * FIT_CENTER_BREND_TIME * FIT_CENTER_BREND_TIME); + //m_fit_centre_init_starttodrawx = m_startToDrawX; +#if DEBUG + //Common.DebugWriteLine( "Play; m_fit_centre_a=" + m_fit_centre_a ); +#endif + + AppManager.Playing = true; + if ( menuEditRealTime.Checked ) { + pictureBox1.Focus(); + } + m_rcHilight = new Rectangle(); + } + + private void Pause() { + pauseMusic(); + UpdateGridList(); + } + + private void pauseMusic() { + StopPauseCore(); + m_player.Pause(); + } + + /// + /// 讀懃エ「髢句ァ九う繝ウ繝繝繧ッ繧ケ縺ョ蛟、繧偵☆縺ケ縺ヲ0縺ォ縺昴m縺医∪縺吶 + /// + public void initializeFirstEntry() { + for ( int track = 0; track < AppManager.SaveData.m_group_another.Count; track++ ) { + AppManager.SaveData.m_group_another[track].Value = 0; + } + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + for ( int track = 0; track < AppManager.SaveData.m_groups_character[group].Count; track++ ) { + AppManager.SaveData.m_groups_character[group][track].Value = 0; + } + } + for ( int track = 0; track < AppManager.SaveData.m_group_plugin.Count; track++ ) { + AppManager.SaveData.m_group_plugin[track].Value = 0; + } + } + + public void StopPauseCore() { + previewer.PlayPauseText = _( "Play" ); + if ( m_preview_thread != null ) { + m_preview_thread.Abort(); + m_preview_thread = null; + } + AppManager.Playing = false; + } + + private void StopMusic() { + StopPauseCore(); + m_player.Stop(); + previewer.TrackBarValue = 0; + } + + /// + /// PreviewP荳翫ョ菴咲スョ蠎ァ讓吶°繧峨∝ッセ蠢懊☆繧狗判蜒上ョ菴咲スョ蠎ァ讓吶r豎ゅa縺セ縺 + /// + /// + /// + private Point ICoordFromC( Point cCoord ) { + int x = cCoord.X; + int y = cCoord.Y; + float base_x, base_y; + float scale; + GetScaleAndOrigin( out base_x, out base_y, out scale ); + x = (int)(x / scale + base_x); + y = (int)(y / scale + base_y); + return new Point( x, y ); + } + + private Point CCoordFromI( PointF iCoord ) { + float x = iCoord.X; + float y = iCoord.Y; + float base_x, base_y; + float scale; + GetScaleAndOrigin( out base_x, out base_y, out scale ); + x = (x - base_x) * scale; + y = (y - base_y) * scale; + return new Point( (int)x, (int)y ); + } + + /// + /// 逕サ髱「縺ョ蟾ヲ荳翫ョ蠎ァ讓吶r縲∫判蜒上ョ蠎ァ讓咏ウサ縺ァ隕九◆縺ィ縺阪ョ蠎ァ讓吶↓螟画鋤縺励∪縺 + /// + /// + /// + /// + private void GetScaleAndOrigin( out float origin_x, out float origin_y, out float scale ) { + if ( previewer.PreviewSizeMode == PictureBoxSizeMode.CenterImage ) { + scale = 1.0f; + origin_x = (previewer.Image.Width - previewer.PreviewWidth) / 2f; + origin_y = (previewer.Image.Height - previewer.PreviewHeight) / 2f; + } else { + float aspecto_image = ((float)previewer.Image.Width) / ((float)previewer.Image.Height); + float aspecto_control = ((float)previewer.PreviewWidth) / ((float)previewer.PreviewHeight); + if ( aspecto_control > aspecto_image ) { + scale = ((float)previewer.PreviewHeight) / ((float)previewer.Image.Height); + origin_x = (previewer.Image.Width * scale - previewer.PreviewWidth) / 2f / scale; + origin_y = 0; + } else { + scale = ((float)previewer.PreviewWidth) / ((float)previewer.Image.Width); + origin_x = 0; + origin_y = (previewer.Image.Height * scale - previewer.PreviewHeight) / 2f / scale; + } + } + } + + private void ShowDialogCore() { + using ( AviOutput aviOutput = new AviOutput( m_is_rawmode ) ) { + if ( aviOutput.ShowDialog() == DialogResult.OK ) { + AviWriting = true; + m_avi_cancel = false; + AviOutputArguments args = aviOutput.Arguments; + bgWorkAvi.RunWorkerAsync( args ); + } + } + } + + private void ChangeFormTitle( string encoder_type, int percent, int current_frame, int max_frames ) { + this.Text = encoder_type + " " + _( "Progress" ) + " " + percent + "% [" + current_frame + "/" + max_frames + "]"; + } + + private void FFMpegOutputRead( object start_args ) { + // frame= 151 fps= 7 q=12.5 Lsize= 568kB time=5.0 bitrate= 930.6kbits/s + long max_frames = 1; + if ( start_args is long ) { + max_frames = (long)start_args; + } + StreamReader reader = this.m_ffmpeg.StandardError;//.StandardOutput; + string line = ""; + while ( !this.m_ffmpeg.HasExited ) { + char ch = (char)reader.Read(); + if ( char.IsControl( ch ) ) { + if ( line.StartsWith( "frame=" ) ) { + line = line.Substring( 6 ); // line=" 151 fps= 7 q=12.5 Lsize= 568kB time=5.0 bitrate= 930.6kbits/s" + line = line.Replace( " ", "" );// line="151fps=7q=12.5Lsize=568kBtime=5.0bitrate=930.6kbits/s" + string[] spl = line.Split( "fps=".ToCharArray(), 2 ); + if ( spl.Length > 0 ) { + line = spl[0]; // s="151" + line = line.Trim(); + int current_frame = 1; + int i; + if ( int.TryParse( line, out i ) ) { + current_frame = i; + } + int percent = (int)(current_frame / (float)max_frames * 100f); + this.Invoke( new ChangeTitleTextDelegate( this.ChangeFormTitle ), new object[] { "ffmpeg", percent, current_frame, (int)max_frames } ); + } + } + line = ""; + } else { + line += ch.ToString(); + } + if ( m_avi_cancel ) { + this.m_ffmpeg.Kill(); + m_avi_cancel = false; + } + } + reader.Close(); + } + + private void MEncoderOutputRead( object start_args ) { + long max_frames = 1; + if ( start_args is long ) { + max_frames = (long)start_args; + } + StreamReader reader = this.m_mencoder.StandardOutput; + string line = ""; + while ( !this.m_mencoder.HasExited ) { + char ch = (char)reader.Read(); + if ( char.IsControl( ch ) ) { + if ( line.StartsWith( "Pos:" ) ) { + line = line.Substring( 4 ); // 1.4s 42f (13%) 3.04fps Trem: 1min 1mb A-V:0.000 [1516:0] + line = line.Replace( " ", "" );//1.4s42f(13%)3.04fpsTrem:1min1mbA-V:0.000[1516:0] + string[] spl = line.Split( "f".ToCharArray(), 2 ); + if ( spl.Length > 0 ) { + line = spl[0]; // s="1.4s42" + spl = line.Split( "s".ToCharArray(), 2 ); + if ( spl.Length > 1 ) { + line = spl[1]; // line="42" + int current_frame = 1; + int i; + if ( int.TryParse( line, out i ) ) { + current_frame = i; + } + int percent = (int)(current_frame / (float)max_frames * 100f); + this.Invoke( new ChangeTitleTextDelegate( this.ChangeFormTitle ), new object[] { "mencoder", percent, current_frame, (int)max_frames } ); + } + } + } + line = ""; + } else { + line += ch.ToString(); + } + //mencoder縺悟コ蜉帙☆繧矩イ謐励ョ蠖「蠑 + //Pos: 1.4s 42f (13%) 3.04fps Trem: 1min 1mb A-V:0.000 [1516:0] + if ( m_avi_cancel ) { + this.m_mencoder.Kill(); + m_avi_cancel = false; + } + } + reader.Close(); + } + + /// + /// m_curve縺ィproperty1縺ョ繝ェ繧ケ繝医懊ャ繧ッ繧ケ縺ョ荳ュ霄ォ繧呈峩譁ー縺励∪縺 + /// + public void UpdateObjectList() { + List adding = new List(); + bool exist = false; + ZorderItem zi = property.Editing; + foreach ( ZorderItem item in AppManager.SaveData.GetZorderItemEnumerator() ) { + if ( zi != null ) { + if ( zi.Type == item.Type && zi.Index == item.Index ) { + exist = true; + } + } + if ( item.Type == ZorderItemType.character ) { + int i = item.Index; + float start = 0f; + string[] titles = new string[] { start.ToString(), "character", AppManager.SaveData.m_groups_character[i].Text }; + ListViewItem add_item = new ListViewItem( titles ); + item.Start = start; + add_item.Tag = (ZorderItem)item.Clone(); + adding.Add( add_item ); + } else if ( item.Type == ZorderItemType.another ) { + int i = item.Index; + float start = AppManager.SaveData.m_group_another.GetFirstOn( i ); + string[] titles = new string[] { start.ToString(), + "another", + AppManager.SaveData.m_group_another[i].Text }; + ListViewItem add_item = new ListViewItem( titles ); + item.Start = start; + add_item.Tag = (ZorderItem)item.Clone(); + adding.Add( add_item ); + } else if ( item.Type == ZorderItemType.telop ) { + int i = item.Index; + float start = AppManager.SaveData[i].Start; + string[] titles = new string[]{ start.ToString(), + "telop", + AppManager.SaveData[i].Text }; + ListViewItem add_item = new ListViewItem( titles ); + item.Start = start; + add_item.Tag = (ZorderItem)item.Clone(); + adding.Add( add_item ); + } + } + property.ListView.Items.Clear(); + property.ListView.Items.AddRange( adding.ToArray() ); + property.Sort(); + if ( !exist ) { + property.Editing = null; + property.SelectedObject = null; + } + + m_curve.comboObjects.Items.Clear(); + for ( int i = 0; i < AppManager.SaveData.m_groups_character.Count; i++ ) { + m_curve.comboObjects.Items.Add( new TagForTreeNode( ZorderItemType.character, i ) ); + } + for ( int i = 0; i < AppManager.SaveData.m_group_another.Count; i++ ) { + m_curve.comboObjects.Items.Add( new TagForTreeNode( ZorderItemType.another, i ) ); + } + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + m_curve.comboObjects.Items.Add( new TagForTreeNode( ZorderItemType.telop, AppManager.SaveData.m_telop_ex2[i].ID ) ); + } + + } + + /// + /// 繝槭え繧ケ縺ョ迴セ蝨ィ菴咲スョ繧貞縺ォ縲√ワ繧、繝ゥ繧、繝医☆繧九∋縺埼Κ蛻縺ョRectangle繧貞叙蠕励@縺セ縺 + /// mouse_position縺セ縺溘ッX, Y縺ォ縺ッ縲}ictureBox1荳翫ョ繝槭え繧ケ菴咲スョ繧剃ク弱∴縺ェ縺代l縺ー縺ェ繧峨↑縺 + /// + /// + /// 繝上う繝ゥ繧、繝医☆繧九∋縺咲ッ蝗イ繧定。ィ縺儚ectangle縲1aint繧、繝吶Φ繝医〒邏逶エ縺ォ謠上¢縺ーOK + private Rectangle GetHilightRect( int X, int Y ) { + int start_to_draw_x = m_startToDrawX;// StartToDrawX; + int start_to_draw_y = m_startToDrawY;// StartToDrawY; + Item clicked = GetGroupItem( X + start_to_draw_x, Y + start_to_draw_y ); + TimeTableType type = clicked.type; + int group = clicked.group; + int track = clicked.track; + int row_index = clicked.row_index; + if ( group < 0 ) { + return new Rectangle(); + } + bool vsq_fixed = menuVisualVsqTrack.Checked; + if ( track < 0 ) { + int group_tracks = 0; + if ( clicked.type == TimeTableType.telop ) { + if ( AppManager.SaveData.TelopListFolded ) { + group_tracks = 0; + } else { + group_tracks = AppManager.MaxTelopLanes; + } + } else { + if ( AppManager.SaveData[clicked.type, group].Folded ) { + group_tracks = 0; + } else { + group_tracks = AppManager.SaveData[clicked.type, group].Count; + } + } + if ( clicked.type == TimeTableType.vsq && vsq_fixed ) { + return new Rectangle( 0, row_index * AppManager.Config.TrackHeight, pictureBox1.Width, (group_tracks + 1) * AppManager.Config.TrackHeight ); + } else { + return new Rectangle( 0, row_index * AppManager.Config.TrackHeight - start_to_draw_y, pictureBox1.Width, (group_tracks + 1) * AppManager.Config.TrackHeight ); + } + } else { + int y = row_index * AppManager.Config.TrackHeight - start_to_draw_y; + Rectangle current; + switch ( clicked.type ) { + case TimeTableType.vsq: + int yy = y + m_startToDrawY; + for ( int entry = 0; entry < AppManager.SaveData.m_group_vsq[track].Count; entry++ ) { + int x = (int)(AppManager.SaveData.m_group_vsq[track][entry].begin * AppManager.Config.PixelPerSec) - start_to_draw_x; + int xend = (int)(AppManager.SaveData.m_group_vsq[track][entry].end * AppManager.Config.PixelPerSec) - start_to_draw_x; + if ( vsq_fixed ) { + current = new Rectangle( x, yy, xend - x, AppManager.Config.TrackHeight ); + if ( AppManager.IsInRectangle( new Point( X, Y ), current ) ) { + return current; + } + } else { + current = new Rectangle( x, y, xend - x, AppManager.Config.TrackHeight ); + if ( AppManager.IsInRectangle( new Point( X, Y ), current ) ) { + return current; + } + } + } + if ( vsq_fixed ) { + return new Rectangle( 0, yy, pictureBox1.Width, AppManager.Config.TrackHeight ); + } else { + return new Rectangle( 0, y, pictureBox1.Width, AppManager.Config.TrackHeight ); + } + case TimeTableType.character: + case TimeTableType.another: + case TimeTableType.plugin: + for ( int entry = 0; entry < AppManager.SaveData[type, group][track].Count; entry++ ) { + int x = (int)(AppManager.SaveData[type, group][track][entry].begin * AppManager.Config.PixelPerSec) - start_to_draw_x; + int xend = (int)(AppManager.SaveData[type, group][track][entry].end * AppManager.Config.PixelPerSec) - start_to_draw_x; + current = new Rectangle( x, y, xend - x, AppManager.Config.TrackHeight ); + if ( AppManager.IsInRectangle( new Point( X, Y ), current ) ) { + return current; + } + } + return new Rectangle( 0, y, pictureBox1.Width, AppManager.Config.TrackHeight ); + case TimeTableType.telop: + for ( int i = 0; i < AppManager.SaveData.m_telop_ex2.Count; i++ ) { + if ( AppManager.SaveData.m_telop_ex2[i].ID == clicked.entry ) { + int x = (int)(AppManager.SaveData.m_telop_ex2[i].Start * AppManager.Config.PixelPerSec) - start_to_draw_x; + int xend = (int)(AppManager.SaveData.m_telop_ex2[i].End * AppManager.Config.PixelPerSec) - start_to_draw_x; + return new Rectangle( x, y, xend - x, AppManager.Config.TrackHeight ); + } + } + return new Rectangle(); + default: + return new Rectangle(); + } + + } + } + } + +} diff --git a/trunk/LipSync/Editor/Form1_EventHandler.cs b/trunk/LipSync/Editor/Form1_EventHandler.cs new file mode 100644 index 0000000..d267851 --- /dev/null +++ b/trunk/LipSync/Editor/Form1_EventHandler.cs @@ -0,0 +1,1183 @@ +/* + * Form1_EventHandler.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Windows.Forms; + +namespace LipSync { + + partial class Form1 : Form { + /// + /// 繝繝ュ繝繝励r霑ス蜉縺励∪縺 + /// + /// + /// + private void h_addTelop( object sender, EventArgs e ) { + if ( m_text_edit && m_text != null ) { + Command run = Command.GCommandEditTelop( m_text_id, AppManager.SaveData[m_text_id] ); + AppManager.SaveData[m_text_id].Text = m_text_original; + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + + m_text.Dispose(); + m_text = null; + m_text_edit = false; + } + + int id = AppManager.SaveData.GetNextID(); + Telop work = new Telop( id ); + work.Text = "(none)"; + work.Start = Now; + work.End = work.Start + 1f; + Command run2 = Command.GCommandAddTelop( work ); + Command inv = AppManager.SaveData.Execute( run2 ); + Telop.DecideLane( AppManager.SaveData.m_telop_ex2 ); + property.Editing = new ZorderItem( work.Text, ZorderItemType.telop, id ); + AppManager.Register( inv ); + UpdateObjectList(); + UpdateEditHandle(); + SetVScrollRange(); + AppManager.Edited = true; + } + + /// + /// 繧ィ繝ウ繝医Μ縺ョON/OFF繧貞渚霆「縺励※繧ウ繝斐シ縺励∪縺 + /// + /// + /// + void h_copyTimeTableInvert( object sender, EventArgs e ) { + int group = m_clicked.group; + int track = m_clicked.track; + if ( m_copied_timetable != null ) { + m_copied_timetable.Dispose(); + m_copied_timetable = null; + } + TimeTableType type = m_clicked.type; + if( type != TimeTableType.vsq && type != TimeTableType.character && type != TimeTableType.another && type != TimeTableType.plugin ){ + return; + } + TimeTable table = (TimeTable)AppManager.SaveData[m_clicked.type, m_clicked.group][m_clicked.track].Clone(); + table.Type = TimeTableType.another; + m_copied_timetable = (TimeTable)table.Clone(); + m_copied_timetable.Clear(); + for ( int i = 0; i < table.Count; i++ ) { + if ( i > 0 ) { + m_copied_timetable.Add( new TimeTableEntry( table[i - 1].end, table[i].begin, "" ) ); + } else { + if ( table[0].begin > 0f ) { + m_copied_timetable.Add( new TimeTableEntry( 0f, table[0].begin, "" ) ); + } + } + } + if ( table[table.Count - 1].end < AppManager.SaveData.m_totalSec ) { + m_copied_timetable.Add( new TimeTableEntry( table[table.Count - 1].end, AppManager.SaveData.m_totalSec, "" ) ); + } + } + + private void h_shiftEntries( object sender, EventArgs e ) { + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + TimeTableType type = m_clicked.type; + if ( type != TimeTableType.vsq && + type != TimeTableType.character && + type != TimeTableType.another && + type != TimeTableType.plugin && + type != TimeTableType.telop ) { + return; + } + using ( InputBox ib = new InputBox( _( "Shift all time-tables" ), _( "Input shift time in second (you can enter minus value)" ) ) ) { + if ( ib.ShowDialog() == DialogResult.OK ) { + float shift; + try { + shift = float.Parse( ib.rText ); + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + return; + } + Command run = Command.GCommandShiftTimeTable( type, (type == TimeTableType.character ? group : track), shift ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + + private void h_splitEntry( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + if ( type != TimeTableType.character && + type != TimeTableType.another && + type != TimeTableType.plugin && + type != TimeTableType.telop ) { + return; + } + if ( type == TimeTableType.telop ) { + Telop edit = (Telop)AppManager.SaveData[entry].Clone(); + float split_position = SecFromXCoord( m_mousePosition.X ); + edit.End = split_position; + Telop adding = (Telop)AppManager.SaveData[entry].Clone(); + adding.Start = split_position; + Command run = Command.GCommandEditTelop( entry, edit ); + run.child = Command.GCommandAddTelop( adding ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + TimeTable table = (TimeTable)AppManager.SaveData[type, group][track].Clone(); + float begin = SecFromXCoord( m_mousePosition.X ); + float buf = table[entry].end; + table[entry].end = begin; + table.Add( new TimeTableEntry( begin, buf, table[entry].body ) ); + table.Sort(); + Command run = Command.GCommandEditTimeTable( m_clicked.type, group, track, table ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + table.Dispose(); + } + } + + /// + /// 繝繧ュ繧ケ繝医°繧峨ョ繧、繝ウ繝昴シ繝 + /// + /// + /// + private void h_importFromText( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + using ( OpenFileDialog dlg = new OpenFileDialog() ) { + try { + dlg.Filter = _( "Text file(*.txt)|*.txt" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Text file(*.txt)|*.txt|All Files(*.*)|*.*"; + } + if ( dlg.ShowDialog() == DialogResult.OK ) { + string file = dlg.FileName; + // 邱ィ髮蟇セ雎。繧偵さ繝斐シ + if ( type != TimeTableType.vsq && type != TimeTableType.another && type != TimeTableType.character && type != TimeTableType.plugin ) { + return; + } + TimeTableGroup table = (TimeTableGroup)AppManager.SaveData[type, group].Clone(); + //int target_group = -1; + using ( StreamReader sr = new StreamReader( file ) ) { + float begin, end; + string line; + while ( sr.Peek() > -1 ) { + line = sr.ReadLine(); + string[] spl = line.Split( new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries ); + if ( spl.Length >= 2 ) { + if ( m_clicked.type == TimeTableType.vsq ) { + try { + begin = float.Parse( spl[0] ); + end = float.Parse( spl[1] ); + } catch { + continue; + } + string body = ""; + if ( spl.Length >= 3 ) { + body = spl[2]; + } + table.Interrup( track, begin, end, body ); + } else { + try { + begin = float.Parse( spl[0] ); + end = float.Parse( spl[1] ); + table.Interrup( track, begin, end ); + } catch { + } + } + } + } + } + Command run = Command.GCommandEditGroup( m_clicked.type, group, table ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + table.Dispose(); + table = null; + } + } + } + + /// + /// 繝繧ュ繧ケ繝医∈縺ョ蜃コ蜉 + /// + /// + /// + private void h_exportToText( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + using ( SaveFileDialog dlg = new SaveFileDialog() ) { + try { + dlg.Filter = _( "Text file(*.txt)|*.txt" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Text file(*.txt)|*.txt|All Files(*.*)|*.*"; + } + dlg.AddExtension = true; + if ( dlg.ShowDialog() == DialogResult.OK ) { + string file = dlg.FileName; + TimeTable table = null; + using ( StreamWriter sw = new StreamWriter( file ) ) { + table = AppManager.SaveData[type, group][track]; + if ( table == null ) { + return; + } + for ( int entry = 0; entry < table.Count; entry++ ) { + if ( m_clicked.type == TimeTableType.vsq ) { + sw.WriteLine( table[entry].begin + "\t" + table[entry].end + "\t" + table[entry].body ); + } else { + sw.WriteLine( table[entry].begin + "\t" + table[entry].end ); + } + } + } + } + } + + } + + /// + /// 繧ィ繝ウ繝医Μ縺ョ雋シ莉倥¢ + /// + /// + /// + private void h_pasteEntry( object sender, EventArgs e ) { + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + float begin = SecFromXCoord( m_mousePosition.X ); + switch ( m_clicked.type ) { + case TimeTableType.another: + if ( m_copied.type == TimeTableType.telop ) { + TimeTableEntry ent = new TimeTableEntry(); + ent.end = begin + m_copied_telop.End - m_copied_telop.Start; + ent.begin = begin; + ent.body = AppManager.SaveData.m_group_another[track].Text; + TimeTableGroup ttg = (TimeTableGroup)AppManager.SaveData.m_group_another.Clone(); + ttg.Interrup( track, ent.begin, ent.end, ent.body ); + Command run = Command.GCommandEditTimeTable( TimeTableType.another, -1, track, ttg[track] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + using ( TimeTableEntry ent = (TimeTableEntry)m_copied_entry.Clone() ) + using ( TimeTableGroup tablegroup = (TimeTableGroup)AppManager.SaveData.m_group_another.Clone() ) { + ent.end = begin + (ent.end - ent.begin); + ent.begin = begin; + ent.body = AppManager.SaveData.m_group_another[track].Text; + tablegroup.Interrup( track, ent.begin, ent.end, ent.body ); + Command run = Command.GCommandEditTimeTable( TimeTableType.another, -1, track, tablegroup[track] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + break; + case TimeTableType.character: + if ( m_copied.type == TimeTableType.telop ) { + TimeTableEntry tte = new TimeTableEntry(); + tte.end = begin + m_copied_telop.End - m_copied_telop.Start; + tte.begin = begin; + TimeTableGroup ttg = (TimeTableGroup)AppManager.SaveData.m_groups_character[group].Clone(); + ttg.Interrup( track, tte.begin, tte.end ); + Command run = Command.GCommandEditGroup( TimeTableType.character, group, ttg ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + using ( TimeTableEntry ent = (TimeTableEntry)m_copied_entry.Clone() ) + using ( TimeTableGroup tablegroup = (TimeTableGroup)AppManager.SaveData.m_groups_character[group].Clone() ) { + ent.end = begin + (ent.end - ent.begin); + ent.begin = begin; + tablegroup.Interrup( track, ent.begin, ent.end ); + Command run = Command.GCommandEditGroup( TimeTableType.character, group, tablegroup ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + break; + case TimeTableType.plugin: + if ( m_copied.type == TimeTableType.telop ) { + TimeTableEntry tte = new TimeTableEntry(); + tte.end = begin + m_copied_telop.End - m_copied_telop.Start; + tte.begin = begin; + TimeTableGroup ttg = (TimeTableGroup)AppManager.SaveData.m_group_plugin.Clone(); + ttg.Interrup( track, tte.begin, tte.end ); + Command run = Command.GCommandEditTimeTable( TimeTableType.plugin, -1, track, ttg[track] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + using ( TimeTableEntry ent = (TimeTableEntry)m_copied_entry.Clone() ) + using ( TimeTableGroup tablegroup = (TimeTableGroup)AppManager.SaveData.m_group_plugin.Clone() ) { + ent.end = begin + (ent.end - ent.begin); + ent.begin = begin; + if ( m_copied.track == m_clicked.track && m_copied.type == TimeTableType.plugin ) { + ent.body = m_copied_entry.body; + } else { + ent.body = ""; + } + tablegroup.Interrup( track, ent.begin, ent.end, ent.body ); + Command run = Command.GCommandEditTimeTable( TimeTableType.plugin, -1, track, tablegroup[track] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + break; + case TimeTableType.telop: + if ( m_copied.type == TimeTableType.telop ) { + Telop edited = (Telop)m_copied_telop.Clone(); + edited.End = begin + m_copied_telop.End - m_copied_telop.Start; + edited.Start = begin; + Command run = Command.GCommandAddTelop( edited ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + break; + } + UpdateObjectList(); + } + + /// + /// 繧ィ繝ウ繝医Μ縺ョ蛻蜿 + /// + /// + /// + private void h_cutEntry( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + if ( type == TimeTableType.telop ) { + m_copied_telop = (Telop)AppManager.SaveData[entry].Clone(); + m_copied = m_clicked; + Command run = Command.GCommandDeleteTelop( m_copied_telop ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } else { + m_copied_entry = (TimeTableEntry)AppManager.SaveData[type, group][track][entry].Clone(); + m_copied = m_clicked; + Command run = Command.GCommandDeleteTimeTableEntry( type, group, track, AppManager.SaveData[type, group][track][entry] ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + UpdateObjectList(); + AppManager.Edited = true; + } + + /// + /// 繧ィ繝ウ繝医Μ縺ョ繧ウ繝斐シ + /// + /// + /// + private void h_copyEntry( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + if ( type == TimeTableType.telop ) { + m_copied_telop = (Telop)AppManager.SaveData[entry].Clone(); + } else { + m_copied_entry = (TimeTableEntry)AppManager.SaveData[type, group][track][entry].Clone(); + } + m_copied = m_clicked; + } + + /// + /// 繧ソ繧、繝繝ゥ繧、繝ウ縺ョ繧ー繝ォ繝シ繝励#縺ィ縺ョ謚倥j縺溘◆縺ソ繧定。後≧ + /// + /// + /// + private void h_foldAll( object sender, EventArgs e ) { + AppManager.SaveData.m_group_vsq.Folded = true; + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + AppManager.SaveData.m_groups_character[group].Folded = true; + } + AppManager.SaveData.m_group_another.Folded = true; + AppManager.SaveData.m_group_plugin.Folded = true; + AppManager.SaveData.TelopListFolded = true; + this.Invalidate(); + } + + /// + /// 謚倥j縺溘◆縺セ繧後◆繧ソ繧、繝繝ゥ繧、繝ウ繝サ繧ー繝ォ繝シ繝励r螻暮幕縺吶k + /// + /// + /// + private void h_expandAll( object sender, EventArgs e ) { + AppManager.SaveData.m_group_vsq.Folded = false; + for ( int group = 0; group < AppManager.SaveData.m_groups_character.Count; group++ ) { + AppManager.SaveData.m_groups_character[group].Folded = false; + } + AppManager.SaveData.m_group_another.Folded = false; + AppManager.SaveData.m_group_plugin.Folded = false; + AppManager.SaveData.TelopListFolded = false; + SetVScrollRange(); + this.Invalidate(); + } + + /// + /// 驕ク謚槭&繧後◆繧ィ繝ウ繝医Μ繧貞庄閭ス縺ェ髯舌j諡。蠑オ縺吶k + /// + /// + /// + private void h_expandEntry( object sender, EventArgs e ) { + PointF px; + float time = SecFromXCoord( m_mousePosition.X ); + if ( m_clicked.type == TimeTableType.character ) { + px = GetEntryLimit( m_clicked, time, true ); + } else { + px = GetEntryLimitSingle( m_clicked, time, true ); + } + Command run, inv; + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + TimeTableEntry item = new TimeTableEntry( px.X, px.Y, "" ); + if ( type != TimeTableType.another && type != TimeTableType.character && type != TimeTableType.plugin ) { + return; + } + if ( type == TimeTableType.plugin ) { + item.body = ""; + } else { + item.body = AppManager.SaveData[type, group][track].Text; + } + run = Command.GCommandEditTimeTableEntry( type, group, track, entry, item ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + + /// + /// 繧ソ繧、繝繝繝シ繝悶Ν縺ョ雋シ莉倥¢ + /// + /// + /// + private void h_pasteTimeTable( object sender, EventArgs e ) { + if ( m_copied_timetable == null ) { + return; + } + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + + bool overwrite = false; + TimeTableGroup tmp; + TimeTableType command_target; + int target_group; + if ( AppManager.SaveData[type, group][track].Count > 0 ) { + overwrite = true; + } + command_target = type; + if ( type == TimeTableType.character ) { + target_group = group; + } else { + target_group = -1; + } + tmp = (TimeTableGroup)AppManager.SaveData[type, group].Clone(); + + if ( overwrite ) { + using ( PasteModeDialog dlg = new PasteModeDialog() ) { + dlg.ShowDialog(); + PasteModeDialogResult result = dlg.DialogResult; + switch ( result ) { + case PasteModeDialogResult.Cancel: + tmp.Dispose(); + tmp = null; + return; + case PasteModeDialogResult.Overwrite: + tmp[track].Clear(); + break; + } + } + } + + for ( int entry = 0; entry < m_copied_timetable.Count; entry++ ) { + if ( command_target == TimeTableType.vsq && m_copied_timetable.Type == TimeTableType.vsq ) { + tmp.Interrup( + track, + m_copied_timetable[entry].begin, + m_copied_timetable[entry].end, + m_copied_timetable[entry].body ); + } else { + tmp.Interrup( track, m_copied_timetable[entry].begin, m_copied_timetable[entry].end ); + } + } + Command run = Command.GCommandEditGroup( command_target, target_group, tmp ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + + if ( tmp != null ) { + tmp.Dispose(); + tmp = null; + } + this.Invalidate(); + } + + /// + /// 繧ソ繧、繝繝繝シ繝悶Ν縺ョ繧ウ繝斐シ + /// + /// + /// + private void h_copyTimeTable( object sender, EventArgs e ){ + int group = m_clicked.group; + int track = m_clicked.track; + if ( m_copied_timetable != null ) { + m_copied_timetable.Dispose(); + m_copied_timetable = null; + } + m_copied_timetable = (TimeTable)AppManager.SaveData[m_clicked.type, group][track].Clone(); + } + + /// + /// 陦ィ遉コ蛟咲紫縺ョ險ュ螳 + /// + /// + /// + private void h_setScale( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + if ( type != TimeTableType.character && type != TimeTableType.another ) { + return; + } + using ( InputBox ib = new InputBox( _( "Scale setting" ), _( "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" ) ) ) { + float sscale; + switch ( m_clicked.type ) { + case TimeTableType.character: + sscale = AppManager.SaveData.m_groups_character[group].Scale; + break; + case TimeTableType.another: + sscale = AppManager.SaveData.m_group_another[track].Scale; + break; + default: + return; + } + ib.rText = sscale.ToString(); + if ( ib.ShowDialog() == DialogResult.OK ) { + //float scale = 1.0f; + try { + sscale = float.Parse( ib.rText ); + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), _( "Error" ), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + return; + } + Command run = Command.GCommandChangeScale( type, group, track, sscale ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + UpdateEditHandle(); + } + } + } + + /// + /// 繧ッ繝ェ繝繧ッ縺輔l縺溘ヨ繝ゥ繝繧ッ荳翫ョ繧ィ繝ウ繝医Μ繧偵け繝ェ繧「縺励∪縺 + /// + /// + /// + private void h_clearEntry( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + if ( MessageBox.Show( _( "...clearing entries of selected time-table.\nWould you like to continue?" ), _( "Confirmation" ), MessageBoxButtons.OKCancel, MessageBoxIcon.Question ) == DialogResult.OK ) { + if ( type == TimeTableType.telop ) { + Telop[] edit = AppManager.SaveData.m_telop_ex2.ToArray(); + Command run = Command.GCommandDeleteTelopRange( edit ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + using ( TimeTable table = (TimeTable)AppManager.SaveData[type, group][track].Clone() ) { + table.Clear(); + Command run = Command.GCommandEditTimeTable( type, group, track, table ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + } + + private void h_editEntry( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + if ( type != TimeTableType.character && + type != TimeTableType.another && + type != TimeTableType.plugin && + type != TimeTableType.telop ) { + return; + } + PointF bound; + float begin, end; + if ( type == TimeTableType.telop ) { + begin = AppManager.SaveData[entry].Start; + end = AppManager.SaveData[entry].End; + } else { + begin = AppManager.SaveData[type, group][track][entry].begin; + end = AppManager.SaveData[type, group][track][entry].end; + } + if ( type == TimeTableType.character ) { + bound = GetEntryLimit( m_clicked, (begin + end) / 2f, true ); + } else if ( type == TimeTableType.telop ) { + bound = new PointF( 0f, AppManager.SaveData.m_totalSec ); + } else { + bound = GetEntryLimitSingle( m_clicked, (begin + end) / 2f, true ); + } + using ( EditEntry eden = new EditEntry( begin, end, bound.X, bound.Y ) ) { + if ( eden.ShowDialog() == DialogResult.OK ) { + if ( type == TimeTableType.telop ) { + Telop edited = (Telop)AppManager.SaveData[entry].Clone(); + edited.Start = eden.Start; + edited.End = eden.End; + Command run = Command.GCommandEditTelop( entry, edited ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } else { + using ( TimeTableEntry item = new TimeTableEntry( eden.Start, eden.End, AppManager.SaveData[type, group][track][entry].body ) ) { + Command run = Command.GCommandEditTimeTableEntry( type, group, track, entry, item ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + } + } + + private void h_pluginSetting( object sender, EventArgs e ) { + ToolStripDropDownItem item = (ToolStripDropDownItem)sender; + string plugin_name = item.Text; + for ( int i = 0; i < AppManager.SaveData.m_plugins_config.Count; i++ ) { + if ( plugin_name == AppManager.SaveData.m_plugins_config[i].ID ) { + string old_config = AppManager.SaveData.m_plugins[i].Instance.Config; + if ( AppManager.SaveData.m_plugins[i].Instance.BaseSetting() == DialogResult.OK ) { + string new_config = AppManager.SaveData.m_plugins[i].Instance.Config; + AppManager.SaveData.m_plugins[i].Instance.Config = old_config; //縺。繧縺」縺ィ繧サ繧ウ繧、縺ェス + if ( old_config != new_config ) { + Command run = Command.GCommandChangePluginConfig( i, new_config ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.SaveData.m_plugins[i].Instance.Config = new_config; + AppManager.Edited = true; + } + } + break; + } + } + } + + private void h_entrySetting( object sender, EventArgs e ) { + int track = m_clicked.track; + int entry = m_clicked.entry; + string current = AppManager.SaveData.m_group_plugin[track][entry].body; + if ( AppManager.SaveData.m_plugins[track].Instance.EntrySetting( ref current ) == DialogResult.OK ) { + using ( TimeTableEntry tmp = new TimeTableEntry( AppManager.SaveData.m_group_plugin[track][entry].begin, AppManager.SaveData.m_group_plugin[track][entry].end, current ) ) { + Command run = Command.GCommandEditTimeTableEntry( TimeTableType.plugin, -1, track, entry, tmp ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + + /// + /// 逶ョ繝代メ繧定ェ蜍輔〒霑ス蜉縺励∪縺吶 + /// + /// + /// + private void h_addWink( object sender, EventArgs e ) { + List titles = new List(); + foreach ( ImageEntry img in AppManager.SaveData.m_groups_character[m_clicked.group].Character ) { + titles.Add( img.title ); + } + using ( Winker winkconfig = new Winker( titles.ToArray(), AppManager.SaveData.m_totalSec ) ) { + if ( winkconfig.ShowDialog() != DialogResult.OK ) { + return; + } + bool randomize = winkconfig.Randomize; + + float interval = winkconfig.WinkInterval; + float begin; + if ( winkconfig.BeginForced ) { + begin = winkconfig.ForcedBegin; + } else { + begin = 0.0f; + } + float end; + if ( winkconfig.EndForced ) { + end = winkconfig.ForcedEnd; + } else { + end = AppManager.SaveData.m_totalSec; + } + string closed = winkconfig.ClosedEye; + string in_between = winkconfig.InBetween; + float close_frames = winkconfig.CloseFrames; + + Random rnd = new Random(); + float total; + if ( begin == 0.0f ) { + total = nextInterval( ref rnd, interval, randomize ); + } else { + total = begin; + } + + //title縺慶losed縺ァ縺ゅkImages縺ョ繧、繝ウ繝繧ッ繧ケ繧呈、懃エ「 + int track = -1; + for ( int i = 0; i < AppManager.SaveData.m_groups_character[m_clicked.group].Count; i++ ) { + if ( AppManager.SaveData.m_groups_character[m_clicked.group][i].Text == closed ) { + track = i; + break; + } + } + if ( track < 0 ) { + winkconfig.Dispose(); + return; + } + + //title縺景n_between縺ァ縺ゅkImages縺ョ繧、繝ウ繝繧ッ繧ケ繧呈、懃エ「 + int bet_track = -1; + for ( int i = 0; i < AppManager.SaveData.m_groups_character[m_clicked.group].Count; i++ ) { + if ( AppManager.SaveData.m_groups_character[m_clicked.group][i].Text == in_between ) { + bet_track = i; + break; + } + } + + using ( TimeTableGroup temp = (TimeTableGroup)AppManager.SaveData.m_groups_character[m_clicked.group].Clone() ) { + float unit_frame; + if ( bet_track < 0 ) { + unit_frame = close_frames / AppManager.SaveData.FrameRate; + } else { + unit_frame = close_frames / 2f / AppManager.SaveData.FrameRate; + } + while ( total <= end ) { + temp.Interrup( track, total, total + unit_frame ); + if ( bet_track >= 0 ) { + temp.Interrup( bet_track, total + unit_frame, total + 2f * unit_frame ); + } + total += (close_frames / AppManager.SaveData.FrameRate + nextInterval( ref rnd, interval, randomize )); + } + temp[track].Sort(); + if ( bet_track >= 0 ) { + temp[bet_track].Sort(); + } + Command run = Command.GCommandEditGroup( TimeTableType.character, m_clicked.group, temp ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + this.Invalidate(); + } + } + + /// + /// 譁ー縺励>繝医Λ繝繧ッ繧定ソス蜉縺励∪縺 + /// + /// + /// + private void h_addTrack( object sender, EventArgs e ) { + switch ( m_clicked.type ) { + case TimeTableType.another: + using ( TimeTable temp = new TimeTable( "test track", 0, TimeTableType.another, null ) ) { + Command run = Command.GCommandAddTimeTable( TimeTableType.another, -1, AppManager.SaveData.m_group_another.Count, temp ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + AppManager.SaveData.UpdateZorder(); + AppManager.Edited = true; + UpdateObjectList(); + SetVScrollRange(); + break; + } + } + + /// + /// 繧ッ繝ェ繝繧ッ縺輔l縺滉ス咲スョ縺ョ繝医Λ繝繧ッ縺梧球蠖薙☆繧狗判蜒上r螟画峩縺励∪縺 + /// + /// + /// + private void h_setImage( object sender, EventArgs e ) { + int group = m_clicked.group; + int track = m_clicked.track; + if ( group < 0 ) { + return; + } + + switch ( m_clicked.type ) { + case TimeTableType.another: + if ( dialogImage.ShowDialog() == DialogResult.OK ) { + if ( track >= 0 ) { + string file = dialogImage.FileName; + if ( Path.GetExtension( file ).ToLower() == ".avi" ) { + Command run = Command.GCommandSetAvi( track, file ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); +#if DEBUG + Common.DebugWriteLine( "Form1.h_setImage; mode avi" ); +#endif + } else { + Command run = Command.GCommandSetImage( track, new Bitmap( Common.ImageFromFile( dialogImage.FileName ) ) ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); +#if DEBUG + Common.DebugWriteLine( "Form1.h_setImage; mode image" ); +#endif + } + AppManager.Edited = true; + } + } + UpdateEditHandle(); + break; + } + } + + private void h_previewImage( object sender, EventArgs e ) { + int group = m_clicked.group; + int track = m_clicked.track; + if ( group < 0 ) { + return; + } + switch ( m_clicked.type ) { + case TimeTableType.character: + if ( track < 0 ) { + ShowPreviewPictureBox( AppManager.SaveData.m_groups_character[group].Character.DefaultFace, m_mousePosition ); + } else { + string title = AppManager.SaveData[m_clicked.type, group][track].Text; + Character3 ch = AppManager.SaveData.m_groups_character[group].Character; + if ( ch == null ) { + return; + } + List list = new List(); + list.Add( track ); + string tag = ch[title].tag; + foreach ( ImageEntry ie in ch ) { + if ( tag != "" ) { + if ( ie.IsDefault ) { + list.Add( ie.Z ); + } + } else { + if ( ie.IsDefault && (tag != "" && ie.tag == tag) ) { + list.Add( ie.Z ); + } + } + } + /*for ( int i = 0; i < ch.Count; i++ ) { + if ( tag != "" ) { + if ( ch[i].IsDefault ) { + list.Add( i ); + } + } else { + if ( ch[i].IsDefault && (tag != "" && ch[i].tag == tag) ) { + list.Add( i ); + } + } + }*/ + Image img = AppManager.SaveData.m_groups_character[group].Character.Face( list.ToArray() ); + ShowPreviewPictureBox( img, m_mousePosition ); + } + break; + case TimeTableType.another: + if ( track >= 0 ) { + ShowPreviewPictureBox( AppManager.SaveData.m_group_another[track].Image, m_mousePosition ); + //showPreviewPictureBox( s.m_group_another[track].GetImage( 0f ), m_mousePosition ); + } + break; + default: + break; + } + } + + /// + /// time_table縺ォ譬シ邏阪&繧後※縺繧区ュ瑚ゥ槭ョ諠蝣ア縺九i縲∝哨繝代け繝医Λ繝繧ッ繧剃ス懈舌@縲∬ソス蜉縺励∪縺 + /// 繧「繝ウ繝峨ぇ繝サ繝ェ繝峨ぇ逕ィ縺ョ蜃ヲ逅縺ッgenMouthFromVsq縺ァ繧縺」縺ヲ繧九 + /// + /// + /// + private void h_genMouthFromVsq( object sender, EventArgs e ) { + if ( m_clicked.type != TimeTableType.vsq ) { + return; + } + List plugins = new List(); + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + if ( (AppManager.SaveData.m_plugins[i].Instance.Type & Plugin.Constants.LS_TYPE_CHARACTER) == Plugin.Constants.LS_TYPE_CHARACTER ) { + plugins.Add( AppManager.SaveData.m_plugins_config[i].ID ); + } + } + using ( SelectCharacater sc = new SelectCharacater( plugins ) ) { + if ( sc.ShowDialog() == DialogResult.OK ) { + //if ( sc.SaveCharacterConfigOutside ) { + // genMouthFromVsq( s.m_group_vsq[m_clicked.track], sc.Character, true, sc.Path ); + //} else { + GenerateLipsyncFromVsq( AppManager.SaveData.m_group_vsq[m_clicked.track], sc.Character, true ); + //} + AppManager.Edited = true; + SetVScrollRange(); + this.Invalidate(); + } + } + } + + /// + /// vsq繝輔ぃ繧、繝ォ縺九i縲√ヨ繝ゥ繝繧ッ繧定ェュ縺ソ霎シ縺ソ縺セ縺 + /// + /// + /// + private void h_readVsq( object sender, EventArgs e ) { + openVsqDialog.FileName = AppManager.Config.LastVsqPath; + try { + openVsqDialog.Filter = _( "VOCALOID2 Sequence File(*.vsq)|*.vsq" ) + "|" + + _( "UTAU Script File(*.ust)|*.ust" ) + "|" + + _( "All Files(*.*)|*.*" ); + } catch { + openVsqDialog.Filter = "VOCALOID2 Sequence File(*.vsq)|*.vsq|UTAU Script File(*.ust)|*.ust|All Files(*.*)|*.*"; + } + if ( openVsqDialog.ShowDialog() == DialogResult.OK ) { + AppManager.Config.LastVsqPath = openVsqDialog.FileName; + string file_name = openVsqDialog.FileName; + ReadVsq( file_name ); + } + } + + /// + /// + /// + /// + /// + private void h_setVideoSize( object sender, EventArgs e ) { + sizeChange(); + } + + private void h_setImagePosition( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + Point point; + if ( type == TimeTableType.another ) { + point = AppManager.SaveData.m_group_another[m_clicked.track].Position; + } else if ( type == TimeTableType.character ) { + point = AppManager.SaveData.m_groups_character[m_clicked.group].Position; + } else { + return; + } + + using ( SetSize setsize = new SetSize( _( "Image placement" ), "X", "Y", point.X, point.Y ) ) { + if ( setsize.ShowDialog() == DialogResult.OK ) { + Point point_new = new Point( setsize.ResultWidth, setsize.ResultHeight ); + Command run = Command.GCommandSetPosition( type, m_clicked.group, m_clicked.track, point_new ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + + private void h_editCharacter( object sender, EventArgs e ) { + if ( AppManager.SaveData.m_groups_character[m_clicked.group].Character.Type == CharacterType.def ) { + int prev = AppManager.SaveData.m_groups_character[m_clicked.group].Character.Count; + int group = m_clicked.group; + using ( GenerateCharacter gc = new GenerateCharacter( AppManager.SaveData.m_groups_character[group] ) ) { + gc.LastPath = AppManager.Config.LastCharacterPath; + if ( gc.ShowDialog() == DialogResult.OK ) { + AppManager.Config.LastCharacterPath = gc.LastPath; + /*List old = new List(); + for ( int i = 0; i < AppManager.SaveData.m_groups_character[group].Count; i++ ) { + old.Add( (TimeTable)AppManager.SaveData.m_groups_character[group][i].Clone() ); + } + TimeTableGroup ttg = (TimeTableGroup)AppManager.SaveData.m_groups_character[group].Clone(); + ttg.list.Clear(); + foreach ( ImageEntry ie in gc.EditedResult.Character ) { + for ( int j = 0; j < old.Count; j++ ) { + if ( ie.title == old[j].Text ) { + ttg.list.Add( old[j] ); + break; + } + } + }*/ + /*for ( int i = 0; i < gc.EditedResult.Count; i++ ) { + for ( int j = 0; j < old.Count; j++ ) { + if ( gc.EditedResult[i].title == old[j].Text ) { + ttg.list.Add( old[j] ); + break; + } + } + }*/ + /*using ( TimeTableGroup temp = (TimeTableGroup)AppManager.SaveData.m_groups_character[group].Clone() ) { + temp.Character = gc.EditedResult.Character; + //temp.Character = (Character3)gc.Character.Clone(); + temp.Clear(); + bool found = false; + // Images + foreach ( ImageEntry item in temp.Character ) { + found = false; + for ( int track = 0; track < AppManager.SaveData.m_groups_character[group].Count; track++ ) { + if ( AppManager.SaveData.m_groups_character[group][track].Text == item.title ) { + temp.Add( (TimeTable)AppManager.SaveData.m_groups_character[group][track].Clone() ); + found = true; + break; + } + } + if ( !found ) { + temp.Add( new TimeTable( item.title, 0, TimeTableType.character, null ) ); + } + } + + temp.Text = gc.Character.Name; + Command run = Command.GCommandEditGroup( TimeTableType.character, group, temp ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + }*/ + TimeTableGroup ttg = gc.EditedResult; + ttg.Text = ttg.Character.Name; + Command run = Command.GCommandEditGroup( TimeTableType.character, group, ttg ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + SetVScrollRange(); + this.Invalidate(); + AppManager.Edited = true; + } + } + } else { + string id = AppManager.SaveData.m_groups_character[m_clicked.group].Character.PluginConfig.ID; + int index = -1; + for ( int i = 0; i < AppManager.SaveData.m_plugins_config.Count; i++ ) { + if ( id == AppManager.SaveData.m_plugins_config[i].ID ) { + index = i; + break; + } + } + if ( index >= 0 ) { + if ( AppManager.SaveData.m_plugins[index].Instance.BaseSetting() == DialogResult.OK ) { + Command run = Command.GCommandChangePluginConfig( index, AppManager.SaveData.m_plugins[index].Instance.Config ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + } + } + } + } + + /// + /// m_clicked縺ァ謖螳壹&繧後◆繝医Λ繝繧ッ縲√∪縺溘ッ繝医Λ繝繧ッ繧ー繝ォ繝シ繝励r蜑企勁縺励∪縺吶 + /// + /// + /// + private void h_deleteTrack( object sender, EventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "Form1+h_deleteTrack" ); + Common.DebugWriteLine( " m_curve.comboObjects.SelectedIndex=" + m_curve.comboObjects.SelectedIndex ); +#endif + if ( m_curve.comboObjects.SelectedIndex < 0 ) { + m_curve.SetSelectedNone(); + } + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + bool deleted = false; + StopPauseCore(); + m_player.Pause(); + if ( type == TimeTableType.character ) { + if ( track < 0 ) { + if ( MessageBox.Show( _( "...deleting selected character.\nWould you like to continue?" ), _( "Confirmation" ), MessageBoxButtons.OKCancel, MessageBoxIcon.Question ) == DialogResult.OK ) { + Command run = Command.GCommandDeleteTimeTableGroup( TimeTableType.character, group ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + deleted = true; + } + } + } else if ( type == TimeTableType.another || type == TimeTableType.vsq ) { + if ( MessageBox.Show( _( "...deleting selected track.\nWould you like to continue?" ), _( "Confirmation" ), MessageBoxButtons.OKCancel, MessageBoxIcon.Question ) == DialogResult.OK ) { + Command run = Command.GCommandDeleteTimeTable( type, -1, track ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + deleted = true; + } + } +#if DEBUG + Common.DebugWriteLine( " deleted=" + deleted ); +#endif + if ( deleted ) { + if ( m_curve.comboObjects.SelectedItem != null ) { + bool clear_required = false; + TagForTreeNode t = (TagForTreeNode)m_curve.comboObjects.SelectedItem; + if ( type == TimeTableType.character && t.type == ZorderItemType.character && t.id_or_index == group ) { + clear_required = true; + } else if ( type == TimeTableType.another && t.type == ZorderItemType.character && t.id_or_index == track ) { + clear_required = true; + } + if ( clear_required ) { + m_curve.SetSelectedNone(); + } + } + AppManager.SaveData.UpdateZorder(); + AppManager.Edited = true; + UpdateObjectList(); + this.Invalidate(); + } + } + + private void h_noteON( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + float begin = SecFromXCoord( m_mousePosition.X ); + PointF bound; + string body; + if ( type == TimeTableType.character ) { + body = AppManager.SaveData.m_groups_character[group][track].Text; + bound = GetEntryLimit( m_clicked, begin, false ); + } else if ( type == TimeTableType.another || type == TimeTableType.plugin ) { + body = AppManager.SaveData[type, -1][track].Text; + bound = GetEntryLimitSingle( m_clicked, begin, false ); + } else { + return; + } + if ( bound.Y > begin ) { + Command run = Command.GCommandAddTimeTableEntry( type, group, track, new TimeTableEntry( begin, bound.Y, body ) ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + AppManager.Edited = true; + this.Invalidate(); + } + } + + private void h_pluginInfo( object sender, EventArgs e ) { + ToolStripMenuItem c_sender = (ToolStripMenuItem)sender; + int index = -1; + for ( int i = 0; i < AppManager.SaveData.m_plugins.Length; i++ ) { + if ( AppManager.SaveData.m_plugins[i].Instance.Name == c_sender.Text ) { + index = i; + break; + } + } + if ( index >= 0 ) { + VersionBox info = new VersionBox( AppManager.SaveData.m_plugins[index].Instance.Name, AppManager.SaveData.m_plugins[index].Instance.Abstract ); + info.ShowDialog(); + info.Dispose(); + } + } + + private void h_noteOFF( object sender, EventArgs e ) { + TimeTableType type = m_clicked.type; + int group = m_clicked.group; + int track = m_clicked.track; + int entry = m_clicked.entry; + float end = (m_mousePosition.X + m_startToDrawX) / AppManager.Config.PixelPerSec; + if ( type != TimeTableType.character && + type != TimeTableType.another && + type != TimeTableType.plugin && + type != TimeTableType.telop ) { + return; + } + if ( type == TimeTableType.telop ) { + Telop item = (Telop)AppManager.SaveData[entry].Clone(); + item.End = end; + Command run = Command.GCommandEditTelop( entry, item ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } else { + TimeTableEntry item; + item = (TimeTableEntry)AppManager.SaveData[type, group][track][entry].Clone(); + item.end = end; + Command run = Command.GCommandEditTimeTableEntry( type, group, track, entry, item ); + AppManager.Register( AppManager.SaveData.Execute( run ) ); + } + AppManager.Edited = true; + this.Invalidate(); + } + } + +} diff --git a/trunk/LipSync/Editor/FormCommandHistory.Designer.cs b/trunk/LipSync/Editor/FormCommandHistory.Designer.cs new file mode 100644 index 0000000..59210ef --- /dev/null +++ b/trunk/LipSync/Editor/FormCommandHistory.Designer.cs @@ -0,0 +1,113 @@ +サソ/* + * FormCommandHistory.Designer.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class FormCommandHistory { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.panel = new System.Windows.Forms.Panel(); + this.lblLookMe = new System.Windows.Forms.Label(); + this.pictCommands = new System.Windows.Forms.PictureBox(); + this.vScrollBar1 = new System.Windows.Forms.VScrollBar(); + this.panel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictCommands)).BeginInit(); + this.SuspendLayout(); + // + // panel + // + this.panel.Controls.Add( this.pictCommands ); + this.panel.Controls.Add( this.vScrollBar1 ); + this.panel.Controls.Add( this.lblLookMe ); + this.panel.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel.Location = new System.Drawing.Point( 0, 0 ); + this.panel.Name = "panel"; + this.panel.Size = new System.Drawing.Size( 169, 431 ); + this.panel.TabIndex = 0; + // + // lblLookMe + // + this.lblLookMe.AutoSize = true; + this.lblLookMe.Location = new System.Drawing.Point( 29, 8 ); + this.lblLookMe.Name = "lblLookMe"; + this.lblLookMe.Size = new System.Drawing.Size( 0, 12 ); + this.lblLookMe.TabIndex = 1; + // + // pictCommands + // + this.pictCommands.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictCommands.Dock = System.Windows.Forms.DockStyle.Top; + this.pictCommands.Location = new System.Drawing.Point( 0, 0 ); + this.pictCommands.Margin = new System.Windows.Forms.Padding( 0 ); + this.pictCommands.Name = "pictCommands"; + this.pictCommands.Size = new System.Drawing.Size( 153, 20 ); + this.pictCommands.TabIndex = 0; + this.pictCommands.TabStop = false; + this.pictCommands.MouseDown += new System.Windows.Forms.MouseEventHandler( this.pictCommands_MouseDown ); + this.pictCommands.Paint += new System.Windows.Forms.PaintEventHandler( this.pictCommands_Paint ); + // + // vScrollBar1 + // + this.vScrollBar1.Dock = System.Windows.Forms.DockStyle.Right; + this.vScrollBar1.Location = new System.Drawing.Point( 153, 0 ); + this.vScrollBar1.Name = "vScrollBar1"; + this.vScrollBar1.Size = new System.Drawing.Size( 16, 431 ); + this.vScrollBar1.TabIndex = 2; + // + // FormCommandHistory + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 169, 431 ); + this.Controls.Add( this.panel ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Name = "FormCommandHistory"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "Command History"; + this.Load += new System.EventHandler( this.FormCommandHistory_Load ); + this.panel.ResumeLayout( false ); + this.panel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictCommands)).EndInit(); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.Panel panel; + private System.Windows.Forms.PictureBox pictCommands; + private System.Windows.Forms.Label lblLookMe; + private System.Windows.Forms.VScrollBar vScrollBar1; + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/FormCommandHistory.cs b/trunk/LipSync/Editor/FormCommandHistory.cs new file mode 100644 index 0000000..4668e53 --- /dev/null +++ b/trunk/LipSync/Editor/FormCommandHistory.cs @@ -0,0 +1,154 @@ +サソ/* + * FormCommandHistory.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class FormCommandHistory : Form, IMultiLanguageControl { + private const int _LABEL_HEIGT = 15; + private ToolStripMenuItem m_redo; + private ToolStripMenuItem m_undo; + private MenuStrip m_menu; + + public FormCommandHistory() { + InitializeComponent(); + + m_redo = new ToolStripMenuItem(); + m_undo = new ToolStripMenuItem(); + + m_menu = new MenuStrip(); + m_menu.Visible = false; + m_menu.Items.AddRange( new ToolStripItem[] { m_redo, m_undo } ); + + m_redo.Visible = false; + m_redo.ShortcutKeys = Keys.Control | Keys.Shift | Keys.Z; + m_redo.Click += new EventHandler( m_redo_Click ); + + m_undo.Visible = false; + m_undo.ShortcutKeys = Keys.Control | Keys.Z; + m_undo.Click += new EventHandler( m_undo_Click ); + + this.Controls.Add( m_menu ); + + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + pictCommands.Height = _LABEL_HEIGT; + SettingsEx.CommandExecuted += new CommandExecutedEventHandler( SettingsEx_CommandExecuted ); + pictCommands.MouseWheel += new MouseEventHandler( pictCommands_MouseWheel ); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + private void m_undo_Click( object sender, EventArgs e ) { + if ( AppManager.IsUndoAvailable ) { + AppManager.Undo(); + } + } + + private void m_redo_Click( object sender, EventArgs e ) { + if ( AppManager.IsRedoAvailable ) { + AppManager.Redo(); + } + } + + public void ApplyLanguage() { + this.Text = _( "Command History" ); + this.Invalidate(); + } + + private static string _( string id ) { + return Messaging.GetMessage( id ); + } + + private void SettingsEx_CommandExecuted( TimeTableType command_target, CommandType command_type ) { + pictCommands.Height = (AppManager.m_commands.Count + 2) * _LABEL_HEIGT; + //lblLookMe.Location = new Point( 0, (AppManager.m_command_position + 2) * _LABEL_HEIGT ); + //panel.ScrollControlIntoView( lblLookMe ); + pictCommands.Invalidate(); + } + + private void pictCommands_Paint( object sender, PaintEventArgs e ) { + e.Graphics.FillRectangle( Brushes.Pink, new Rectangle( 0, 0, pictCommands.Width, _LABEL_HEIGT ) ); + e.Graphics.DrawString( _( "Command History" ), SystemFonts.MenuFont, Brushes.Black, new PointF( 0, 0 ) ); + + e.Graphics.FillRectangle( Brushes.White, new Rectangle( 0, _LABEL_HEIGT, pictCommands.Width, _LABEL_HEIGT ) ); + Font font = SystemFonts.MenuFont; + if ( AppManager.m_command_position < 0 ) { + font = new Font( font.FontFamily, font.Size, FontStyle.Bold ); + } + e.Graphics.DrawString( "Root", font, Brushes.Black, new PointF( 0, _LABEL_HEIGT ) ); + + for ( int i = 0; i < AppManager.m_commands.Count; i++ ) { + Brush brs; + if ( i % 2 == 0 ) { + brs = Brushes.LightGray; + } else { + brs = Brushes.White; + } + font = SystemFonts.MenuFont; + if ( i == AppManager.m_command_position ) { + font = new Font( font.FontFamily, font.Size, FontStyle.Bold ); + } + e.Graphics.FillRectangle( brs, new Rectangle( 0, (i + 2) * _LABEL_HEIGT, pictCommands.Width, _LABEL_HEIGT ) ); + e.Graphics.DrawString( StringFromCommand( AppManager.m_commands[i] ), + font, + Brushes.Black, + new PointF( 0, (i + 2) * _LABEL_HEIGT ) ); + } + } + + private void pictCommands_MouseWheel( object sender, MouseEventArgs e ) { + + } + + private void pictCommands_MouseDown( object sender, MouseEventArgs e ) { + pictCommands.Focus(); + } + + private string StringFromCommand( Command command ) { + if ( command.target == TimeTableType.another ) { + if ( command.type == CommandType.addEntry ) { + return string.Format( _( "Delete entry of 'Another Image' at Index {0}" ), command.track ); + } else if ( command.type == CommandType.deleteEntry ) { + return string.Format( _( "Add entry of 'Another Image' at Index {0}" ), command.track ); + } else if ( command.type == CommandType.editEntry ) { + return string.Format( _( "Edit entry of 'Another Image' at Track {0}, Index {1}" ), command.track, command.entry ); + } + } else if ( command.target == TimeTableType.telop ) { + if ( command.type == CommandType.addTelop ) { + return string.Format( _( "Delete telop '{0}'" ), command.telop.Text ); + } else if ( command.type == CommandType.editTelop ) { + return string.Format( _( "Edit telop '{0}' at Index {1}" ), command.telop.Text, command.entry ); + } else if ( command.type == CommandType.deleteTelop ) { + return string.Format( _( "Add telop '{0}'" ), command.telop.Text ); + } + } + return command.target + ", " + command.type; + } + + private void FormCommandHistory_Load( object sender, EventArgs e ) { + SettingsEx_CommandExecuted( TimeTableType.none, CommandType.nothing ); + } + } + +} diff --git a/trunk/LipSync/Editor/FormObjectList.Designer.cs b/trunk/LipSync/Editor/FormObjectList.Designer.cs new file mode 100644 index 0000000..c18dcc3 --- /dev/null +++ b/trunk/LipSync/Editor/FormObjectList.Designer.cs @@ -0,0 +1,64 @@ +/* + * FormObjectList.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class FormObjectList { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.SuspendLayout(); + // + // FormObjectList + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 292, 273 ); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormObjectList"; + this.ShowIcon = false; + this.Text = "FormObjectList"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.FormObjectList_FormClosing ); + this.ResumeLayout( false ); + + } + + #endregion + + public void ApplyLanguage() { + this.Text = _( "List of object" ); + } + + } +} diff --git a/trunk/LipSync/Editor/FormObjectList.cs b/trunk/LipSync/Editor/FormObjectList.cs new file mode 100644 index 0000000..f8bb231 --- /dev/null +++ b/trunk/LipSync/Editor/FormObjectList.cs @@ -0,0 +1,55 @@ +/* + * FormObjectList.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class FormObjectList : Form { + ListView m_listview; + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + protected override void WndProc( ref Message m ) { + const int WM_NCLBUTTONDBLCLK = 0xa3; + if ( m.Msg == WM_NCLBUTTONDBLCLK ) { + this.Close(); + } else { + base.WndProc( ref m ); + } + } + + public FormObjectList() { + InitializeComponent(); + } + + public new void Show( ListView listView ) { + m_listview = listView; + m_listview.Parent = this; + this.Controls.Add( m_listview ); + m_listview.Dock = DockStyle.Fill; + this.Text = _( "List of object" ); + base.Show(); + } + + private void FormObjectList_FormClosing( object sender, FormClosingEventArgs e ) { + e.Cancel = true; + this.Hide(); + } + } + +} diff --git a/trunk/LipSync/Editor/FormPreview.Designer.cs b/trunk/LipSync/Editor/FormPreview.Designer.cs new file mode 100644 index 0000000..3f9f173 --- /dev/null +++ b/trunk/LipSync/Editor/FormPreview.Designer.cs @@ -0,0 +1,55 @@ +サソ/* + * FormPreview.Designer.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class FormPreview { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.SuspendLayout(); + // + // FormPreview + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 465, 320 ); + this.Name = "FormPreview"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "FormPreview"; + this.ResumeLayout( false ); + + } + + #endregion + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/FormPreview.cs b/trunk/LipSync/Editor/FormPreview.cs new file mode 100644 index 0000000..12fc37a --- /dev/null +++ b/trunk/LipSync/Editor/FormPreview.cs @@ -0,0 +1,87 @@ +サソ/* + * FormPreview.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace LipSync { + + public partial class FormPreview : Form, IMultiLanguageControl { + public FormPreview() { + InitializeComponent(); + Rectangle r = AppManager.Config.PreviewWindowPos; + Point pt_lt = new Point( r.Left, r.Top ); + Point pt_lb = new Point( r.Left, r.Bottom ); + Point pt_rt = new Point( r.Right, r.Top ); + Point pt_rb = new Point( r.Right, r.Bottom ); + bool visible = false; + foreach ( Screen s in Screen.AllScreens ) { + visible = visible | (IsInRectangle( pt_lt, s.Bounds ) | IsInRectangle( pt_lb, s.Bounds ) | IsInRectangle( pt_rt, s.Bounds ) | IsInRectangle( pt_rb, s.Bounds )); + } + if ( visible ) { + this.Left = r.Left; + this.Top = r.Top; + this.Width = r.Width; + this.Height = r.Height; + } else { + this.Width = Screen.PrimaryScreen.Bounds.Width / 2; + this.Height = Screen.PrimaryScreen.Bounds.Height / 2; + this.Left = this.Width / 2; + this.Top = this.Height / 2; + } + if ( AppManager.Config.PreviewMaximized ) { + this.WindowState = FormWindowState.Maximized; + } else { + this.WindowState = FormWindowState.Normal; + } + this.SizeChanged += new EventHandler( FormPreview_LocationOrSizeChanged ); + this.LocationChanged += new EventHandler( FormPreview_LocationOrSizeChanged ); + } + + /// + /// rect縺ョ荳ュ縺ォpoint縺悟・縺」縺ヲ縺繧九°縺ゥ縺縺九r蛻、螳 + /// + /// + /// + /// + private static bool IsInRectangle( Point point, Rectangle rect ) { + if ( rect.X <= point.X && point.X <= rect.X + rect.Width ) { + if ( rect.Y <= point.Y && point.Y <= rect.Y + rect.Height ) { + return true; + } + } + return false; + } + + public void ApplyLanguage() { + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + private void FormPreview_LocationOrSizeChanged( object sender, EventArgs e ) { + if ( AppManager.Config != null ) { + if ( this.WindowState == FormWindowState.Normal ) { + AppManager.Config.PreviewWindowPos = this.Bounds; + } + AppManager.Config.PreviewMaximized = (this.WindowState == FormWindowState.Maximized); + } + } + } + +} diff --git a/trunk/LipSync/Editor/FormSeriesImage.Designer.cs b/trunk/LipSync/Editor/FormSeriesImage.Designer.cs new file mode 100644 index 0000000..92689b2 --- /dev/null +++ b/trunk/LipSync/Editor/FormSeriesImage.Designer.cs @@ -0,0 +1,293 @@ +サソ/* + * FormSeriesImage.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class FormSeriesImage { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.txtDirectory = new System.Windows.Forms.TextBox(); + this.lblFileName = new System.Windows.Forms.Label(); + this.btnFile = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.chkStart = new System.Windows.Forms.CheckBox(); + this.groupStartEnd = new System.Windows.Forms.GroupBox(); + this.txtEnd = new System.Windows.Forms.TextBox(); + this.txtStart = new System.Windows.Forms.TextBox(); + this.chkEnd = new System.Windows.Forms.CheckBox(); + this.groupFileName = new System.Windows.Forms.GroupBox(); + this.chkAutomaticallyAddExtension = new System.Windows.Forms.CheckBox(); + this.lblFormat = new System.Windows.Forms.Label(); + this.txtParser = new System.Windows.Forms.TextBox(); + this.comboFormat = new System.Windows.Forms.ComboBox(); + this.lblParser = new System.Windows.Forms.Label(); + this.txtPreview = new System.Windows.Forms.TextBox(); + this.groupStartEnd.SuspendLayout(); + this.groupFileName.SuspendLayout(); + this.SuspendLayout(); + // + // txtDirectory + // + this.txtDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtDirectory.BackColor = System.Drawing.SystemColors.Window; + this.txtDirectory.Location = new System.Drawing.Point( 73, 14 ); + this.txtDirectory.Name = "txtDirectory"; + this.txtDirectory.Size = new System.Drawing.Size( 346, 19 ); + this.txtDirectory.TabIndex = 0; + // + // lblFileName + // + this.lblFileName.AutoSize = true; + this.lblFileName.Location = new System.Drawing.Point( 15, 17 ); + this.lblFileName.Name = "lblFileName"; + this.lblFileName.Size = new System.Drawing.Size( 51, 12 ); + this.lblFileName.TabIndex = 4; + this.lblFileName.Text = "繝輔ぃ繧、繝ォ蜷"; + // + // btnFile + // + this.btnFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnFile.Location = new System.Drawing.Point( 425, 12 ); + this.btnFile.Name = "btnFile"; + this.btnFile.Size = new System.Drawing.Size( 24, 23 ); + this.btnFile.TabIndex = 1; + this.btnFile.Text = "..."; + this.btnFile.UseVisualStyleBackColor = true; + this.btnFile.Click += new System.EventHandler( this.btnFile_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 371, 283 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 13; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 272, 283 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 12; + this.btnOK.Text = "菫晏ュ"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // chkStart + // + this.chkStart.AutoSize = true; + this.chkStart.Location = new System.Drawing.Point( 19, 27 ); + this.chkStart.Name = "chkStart"; + this.chkStart.Size = new System.Drawing.Size( 48, 16 ); + this.chkStart.TabIndex = 8; + this.chkStart.Text = "髢句ァ"; + this.chkStart.UseVisualStyleBackColor = true; + this.chkStart.CheckedChanged += new System.EventHandler( this.chkStart_CheckedChanged ); + // + // groupStartEnd + // + this.groupStartEnd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupStartEnd.Controls.Add( this.txtEnd ); + this.groupStartEnd.Controls.Add( this.txtStart ); + this.groupStartEnd.Controls.Add( this.chkEnd ); + this.groupStartEnd.Controls.Add( this.chkStart ); + this.groupStartEnd.Location = new System.Drawing.Point( 14, 41 ); + this.groupStartEnd.Name = "groupStartEnd"; + this.groupStartEnd.Size = new System.Drawing.Size( 432, 89 ); + this.groupStartEnd.TabIndex = 7; + this.groupStartEnd.TabStop = false; + this.groupStartEnd.Text = "蜃コ蜉帷ッ蝗イ繧呈欠螳"; + // + // txtEnd + // + this.txtEnd.Enabled = false; + this.txtEnd.Location = new System.Drawing.Point( 90, 53 ); + this.txtEnd.Name = "txtEnd"; + this.txtEnd.Size = new System.Drawing.Size( 144, 19 ); + this.txtEnd.TabIndex = 11; + this.txtEnd.Text = "0"; + // + // txtStart + // + this.txtStart.Enabled = false; + this.txtStart.Location = new System.Drawing.Point( 90, 25 ); + this.txtStart.Name = "txtStart"; + this.txtStart.Size = new System.Drawing.Size( 144, 19 ); + this.txtStart.TabIndex = 9; + this.txtStart.Text = "0"; + // + // chkEnd + // + this.chkEnd.AutoSize = true; + this.chkEnd.Location = new System.Drawing.Point( 19, 55 ); + this.chkEnd.Name = "chkEnd"; + this.chkEnd.Size = new System.Drawing.Size( 48, 16 ); + this.chkEnd.TabIndex = 10; + this.chkEnd.Text = "邨ゆコ"; + this.chkEnd.UseVisualStyleBackColor = true; + this.chkEnd.CheckedChanged += new System.EventHandler( this.checkBox1_CheckedChanged ); + // + // groupFileName + // + this.groupFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupFileName.Controls.Add( this.chkAutomaticallyAddExtension ); + this.groupFileName.Controls.Add( this.lblFormat ); + this.groupFileName.Controls.Add( this.txtParser ); + this.groupFileName.Controls.Add( this.comboFormat ); + this.groupFileName.Controls.Add( this.lblParser ); + this.groupFileName.Controls.Add( this.txtPreview ); + this.groupFileName.Location = new System.Drawing.Point( 14, 136 ); + this.groupFileName.Name = "groupFileName"; + this.groupFileName.Size = new System.Drawing.Size( 432, 132 ); + this.groupFileName.TabIndex = 20; + this.groupFileName.TabStop = false; + this.groupFileName.Text = "File Name"; + // + // chkAutomaticallyAddExtension + // + this.chkAutomaticallyAddExtension.AutoSize = true; + this.chkAutomaticallyAddExtension.Checked = true; + this.chkAutomaticallyAddExtension.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkAutomaticallyAddExtension.Location = new System.Drawing.Point( 19, 60 ); + this.chkAutomaticallyAddExtension.Name = "chkAutomaticallyAddExtension"; + this.chkAutomaticallyAddExtension.Size = new System.Drawing.Size( 172, 16 ); + this.chkAutomaticallyAddExtension.TabIndex = 5; + this.chkAutomaticallyAddExtension.Text = "Automatically Add Extension"; + this.chkAutomaticallyAddExtension.UseVisualStyleBackColor = true; + this.chkAutomaticallyAddExtension.CheckedChanged += new System.EventHandler( this.chkAutomaticallyAddExtension_CheckedChanged ); + // + // lblFormat + // + this.lblFormat.AutoSize = true; + this.lblFormat.Location = new System.Drawing.Point( 17, 99 ); + this.lblFormat.Name = "lblFormat"; + this.lblFormat.Size = new System.Drawing.Size( 75, 12 ); + this.lblFormat.TabIndex = 4; + this.lblFormat.Text = "Image Format"; + // + // txtParser + // + this.txtParser.Location = new System.Drawing.Point( 124, 22 ); + this.txtParser.Name = "txtParser"; + this.txtParser.Size = new System.Drawing.Size( 137, 19 ); + this.txtParser.TabIndex = 3; + this.txtParser.Text = "{0}"; + this.txtParser.TextChanged += new System.EventHandler( this.txtParser_TextChanged ); + // + // comboFormat + // + this.comboFormat.FormattingEnabled = true; + this.comboFormat.Location = new System.Drawing.Point( 124, 96 ); + this.comboFormat.Name = "comboFormat"; + this.comboFormat.Size = new System.Drawing.Size( 121, 20 ); + this.comboFormat.TabIndex = 0; + this.comboFormat.SelectedIndexChanged += new System.EventHandler( this.comboFormat_SelectedIndexChanged ); + // + // lblParser + // + this.lblParser.AutoSize = true; + this.lblParser.Location = new System.Drawing.Point( 17, 25 ); + this.lblParser.Name = "lblParser"; + this.lblParser.Size = new System.Drawing.Size( 72, 12 ); + this.lblParser.TabIndex = 2; + this.lblParser.Text = "Parser String"; + // + // txtPreview + // + this.txtPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtPreview.Location = new System.Drawing.Point( 267, 22 ); + this.txtPreview.Multiline = true; + this.txtPreview.Name = "txtPreview"; + this.txtPreview.ReadOnly = true; + this.txtPreview.Size = new System.Drawing.Size( 159, 94 ); + this.txtPreview.TabIndex = 1; + // + // FormSeriesImage + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 460, 323 ); + this.Controls.Add( this.groupFileName ); + this.Controls.Add( this.groupStartEnd ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnFile ); + this.Controls.Add( this.lblFileName ); + this.Controls.Add( this.txtDirectory ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSeriesImage"; + this.ShowInTaskbar = false; + this.Text = "Series Image"; + this.groupStartEnd.ResumeLayout( false ); + this.groupStartEnd.PerformLayout(); + this.groupFileName.ResumeLayout( false ); + this.groupFileName.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox txtDirectory; + private System.Windows.Forms.Label lblFileName; + private System.Windows.Forms.Button btnFile; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.CheckBox chkStart; + private System.Windows.Forms.GroupBox groupStartEnd; + private System.Windows.Forms.TextBox txtEnd; + private System.Windows.Forms.TextBox txtStart; + private System.Windows.Forms.CheckBox chkEnd; + private System.Windows.Forms.GroupBox groupFileName; + private System.Windows.Forms.ComboBox comboFormat; + private System.Windows.Forms.TextBox txtPreview; + private System.Windows.Forms.TextBox txtParser; + private System.Windows.Forms.Label lblParser; + private System.Windows.Forms.Label lblFormat; + private System.Windows.Forms.CheckBox chkAutomaticallyAddExtension; + } +} diff --git a/trunk/LipSync/Editor/FormSeriesImage.cs b/trunk/LipSync/Editor/FormSeriesImage.cs new file mode 100644 index 0000000..7d6f38e --- /dev/null +++ b/trunk/LipSync/Editor/FormSeriesImage.cs @@ -0,0 +1,207 @@ +サソ/* + * FormSeriesImage.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.IO; +using System.Drawing; +using System.Windows.Forms; +using System.Reflection; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class FormSeriesImage : Form, IMultiLanguageControl { + float m_start = 0f; + float m_end = 0f; + + public FormSeriesImage() { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + Type type = typeof( System.Drawing.Imaging.ImageFormat ); + PropertyInfo[] properties = type.GetProperties(); + int i = -1; + foreach ( PropertyInfo pi in properties ) { + if ( pi.PropertyType.Equals( typeof( System.Drawing.Imaging.ImageFormat ) ) ) { + System.Drawing.Imaging.ImageFormat ifm = (System.Drawing.Imaging.ImageFormat)pi.GetValue( null, null ); + string ext = Misc.GetExtensionFromImageFormat( ifm ); + if ( ext.Length > 0 ) { + i++; + comboFormat.Items.Add( pi.Name ); + if ( i == 0 ) { + comboFormat.SelectedIndex = 0; + } + if ( ext == "bmp" ) { + comboFormat.SelectedIndex = i; + } + } + } + } + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public string ParserString { + get { + if ( chkAutomaticallyAddExtension.Checked ) { + return txtParser.Text + "." + Misc.GetExtensionFromImageFormat( ImageFormat ); + } else { + return txtParser.Text; + } + } + } + + public System.Drawing.Imaging.ImageFormat ImageFormat { + get { + if ( comboFormat.SelectedItem == null ){ + return System.Drawing.Imaging.ImageFormat.Bmp; + } + string title = (string)comboFormat.SelectedItem; +#if DEBUG + Console.WriteLine( "ImageFormat.get()" ); + Console.WriteLine( " System.Drawing.Imaging.ImageFormat.Bmp.ToString()=" + System.Drawing.Imaging.ImageFormat.Bmp.ToString() ); +#endif + PropertyInfo[] properties = typeof( System.Drawing.Imaging.ImageFormat ).GetProperties(); + foreach ( PropertyInfo pi in properties ) { + if ( pi.PropertyType.Equals( typeof( System.Drawing.Imaging.ImageFormat ) ) ) { + if ( pi.Name == title ) { + return (System.Drawing.Imaging.ImageFormat)pi.GetValue( null, null ); + } + } + } + return System.Drawing.Imaging.ImageFormat.Bmp; + } + } + + public string DirectoryName { + get { + return txtDirectory.Text; + } + } + + public void ApplyLanguage() { + this.Text = _( "Series Image" ); + btnCancel.Text = _( "Cancel" ); + btnOK.Text = _( "Save" ); + lblFileName.Text = _( "Directory" ); + groupStartEnd.Text = _( "Specify output range" ); + chkStart.Text = _( "Start" ); + chkEnd.Text = _( "End" ); + groupFileName.Text = _( "File Name" ); + lblParser.Text = _( "Parser String" ); + chkAutomaticallyAddExtension.Text = _( "Automatically Add Extension" ); + lblFormat.Text = _( "Image Format" ); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public float Start { + get { + return m_start; + } + } + + public float End { + get { + return m_end; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + try { + m_start = float.Parse( txtStart.Text ); + m_end = float.Parse( txtEnd.Text ); + this.DialogResult = DialogResult.OK; + } catch ( Exception ex ) { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation + ); + Common.LogPush( ex ); + } + } + + private void btnFile_Click( object sender, EventArgs e ) { + using ( FolderBrowserDialog fbd = new FolderBrowserDialog() ) { + if ( fbd.ShowDialog() == DialogResult.OK ) { + txtDirectory.Text = fbd.SelectedPath; + } + } + } + + private void chkStart_CheckedChanged( object sender, EventArgs e ) { + txtStart.Enabled = chkStart.Checked; + if ( txtStart.Enabled ) { + txtStart.Focus(); + } + } + + private void checkBox1_CheckedChanged( object sender, EventArgs e ) { + txtEnd.Enabled = chkEnd.Checked; + if ( txtEnd.Enabled ) { + txtEnd.Focus(); + } + } + + public bool StartSpecified { + get { + return chkStart.Checked; + } + } + + public bool EndSpecified { + get { + return chkEnd.Checked; + } + } + + private void txtParser_TextChanged( object sender, EventArgs e ) { + UpdateSampleFileNames(); + } + + private void comboFormat_SelectedIndexChanged( object sender, EventArgs e ) { + UpdateSampleFileNames(); + } + + private void UpdateSampleFileNames() { + string ret = _( "Sample File Name" ) + Environment.NewLine; + System.Drawing.Imaging.ImageFormat ifm = ImageFormat; + string ext = Misc.GetExtensionFromImageFormat( ifm ); + string parser = ParserString; + try { + ret += string.Format( parser, 0 ) + Environment.NewLine; + ret += string.Format( parser, 1 ) + Environment.NewLine; + ret += " ... " + Environment.NewLine; + ret += string.Format( parser, 1234 ); + } catch { + ret += _( "Error: Invalid parser string." ); + } + txtPreview.Text = ret; + } + + private void chkAutomaticallyAddExtension_CheckedChanged( object sender, EventArgs e ) { + UpdateSampleFileNames(); + } + } + +} diff --git a/trunk/LipSync/Editor/FormSetFrameRate.Designer.cs b/trunk/LipSync/Editor/FormSetFrameRate.Designer.cs new file mode 100644 index 0000000..ecb3f33 --- /dev/null +++ b/trunk/LipSync/Editor/FormSetFrameRate.Designer.cs @@ -0,0 +1,197 @@ +/* + * FormSetFrameRate.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + partial class FormSetFrameRate { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.btnExpand = new System.Windows.Forms.Button(); + this.txtFrameRate = new System.Windows.Forms.TextBox(); + this.lblFrameRate = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.txtNumerator = new System.Windows.Forms.TextBox(); + this.lblNumerator = new System.Windows.Forms.Label(); + this.lblDenominator = new System.Windows.Forms.Label(); + this.txtDenominator = new System.Windows.Forms.TextBox(); + this.btnImport = new System.Windows.Forms.Button(); + this.toolTipImport = new System.Windows.Forms.ToolTip( this.components ); + this.SuspendLayout(); + // + // btnExpand + // + this.btnExpand.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.btnExpand.Image = global::LipSync.Properties.Resources.closed; + this.btnExpand.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnExpand.Location = new System.Drawing.Point( 12, 96 ); + this.btnExpand.Name = "btnExpand"; + this.btnExpand.Size = new System.Drawing.Size( 308, 23 ); + this.btnExpand.TabIndex = 3; + this.btnExpand.Text = " 隧ウ邏ー縺ェ險ュ螳"; + this.btnExpand.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnExpand.UseVisualStyleBackColor = true; + this.btnExpand.Click += new System.EventHandler( this.btnExpand_Click ); + // + // txtFrameRate + // + this.txtFrameRate.Location = new System.Drawing.Point( 87, 15 ); + this.txtFrameRate.Name = "txtFrameRate"; + this.txtFrameRate.Size = new System.Drawing.Size( 189, 19 ); + this.txtFrameRate.TabIndex = 0; + this.txtFrameRate.Text = "30"; + this.txtFrameRate.TextChanged += new System.EventHandler( this.txtFrameRate_TextChanged ); + // + // lblFrameRate + // + this.lblFrameRate.AutoSize = true; + this.lblFrameRate.Location = new System.Drawing.Point( 12, 18 ); + this.lblFrameRate.Name = "lblFrameRate"; + this.lblFrameRate.Size = new System.Drawing.Size( 69, 12 ); + this.lblFrameRate.TabIndex = 2; + this.lblFrameRate.Text = "繝輔Ξ繝シ繝繝ャ繝シ繝"; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 245, 58 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 151, 58 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 1; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // txtNumerator + // + this.txtNumerator.Location = new System.Drawing.Point( 151, 137 ); + this.txtNumerator.Name = "txtNumerator"; + this.txtNumerator.Size = new System.Drawing.Size( 60, 19 ); + this.txtNumerator.TabIndex = 4; + this.txtNumerator.Text = "30"; + this.txtNumerator.TextChanged += new System.EventHandler( this.txtNumerator_TextChanged ); + // + // lblNumerator + // + this.lblNumerator.AutoSize = true; + this.lblNumerator.Location = new System.Drawing.Point( 12, 140 ); + this.lblNumerator.Name = "lblNumerator"; + this.lblNumerator.Size = new System.Drawing.Size( 103, 12 ); + this.lblNumerator.TabIndex = 6; + this.lblNumerator.Text = "繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻蟄"; + // + // lblDenominator + // + this.lblDenominator.AutoSize = true; + this.lblDenominator.Location = new System.Drawing.Point( 12, 165 ); + this.lblDenominator.Name = "lblDenominator"; + this.lblDenominator.Size = new System.Drawing.Size( 103, 12 ); + this.lblDenominator.TabIndex = 8; + this.lblDenominator.Text = "繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻豈"; + // + // txtDenominator + // + this.txtDenominator.Location = new System.Drawing.Point( 151, 162 ); + this.txtDenominator.Name = "txtDenominator"; + this.txtDenominator.Size = new System.Drawing.Size( 60, 19 ); + this.txtDenominator.TabIndex = 5; + this.txtDenominator.Text = "1"; + this.txtDenominator.TextChanged += new System.EventHandler( this.txtDenominator_TextChanged ); + // + // btnImport + // + this.btnImport.Location = new System.Drawing.Point( 234, 147 ); + this.btnImport.Name = "btnImport"; + this.btnImport.Size = new System.Drawing.Size( 75, 23 ); + this.btnImport.TabIndex = 6; + this.btnImport.Text = "蠑慕畑"; + this.toolTipImport.SetToolTip( this.btnImport, "AVI繝輔ぃ繧、繝ォ縺九i繝輔Ξ繝シ繝繝ャ繝シ繝医ョ險ュ螳壹r蠑慕畑縺励∪縺" ); + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler( this.btnImport_Click ); + // + // FormSetFrameRate + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 332, 192 ); + this.Controls.Add( this.btnImport ); + this.Controls.Add( this.lblDenominator ); + this.Controls.Add( this.txtDenominator ); + this.Controls.Add( this.lblNumerator ); + this.Controls.Add( this.txtNumerator ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.lblFrameRate ); + this.Controls.Add( this.txtFrameRate ); + this.Controls.Add( this.btnExpand ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSetFrameRate"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "FormSetFrameRate"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnExpand; + private System.Windows.Forms.TextBox txtFrameRate; + private System.Windows.Forms.Label lblFrameRate; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.TextBox txtNumerator; + private System.Windows.Forms.Label lblNumerator; + private System.Windows.Forms.Label lblDenominator; + private System.Windows.Forms.TextBox txtDenominator; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.ToolTip toolTipImport; + + } + +} diff --git a/trunk/LipSync/Editor/FormSetFrameRate.cs b/trunk/LipSync/Editor/FormSetFrameRate.cs new file mode 100644 index 0000000..32acf77 --- /dev/null +++ b/trunk/LipSync/Editor/FormSetFrameRate.cs @@ -0,0 +1,188 @@ +/* + * FormSetFrameRate.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; +using Boare.Lib.Media; + +namespace LipSync { + + public partial class FormSetFrameRate : Form, IMultiLanguageControl { + private uint m_dwRate = 30; + private uint m_dwScale = 1; + private bool m_expanded = false; + private bool m_forbid_text_change = false; + + const int HEIGHT_EXPANDED = 224; + const int HEIGHT_FOLDED = 160; + + public FormSetFrameRate( uint rate, uint scale ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + m_expanded = false; + txtFrameRate.Enabled = !m_expanded; + txtNumerator.Enabled = m_expanded; + txtDenominator.Enabled = m_expanded; + btnImport.Enabled = m_expanded; + this.Height = HEIGHT_FOLDED; + m_dwRate = rate; + m_dwScale = scale; + txtDenominator.Text = m_dwScale + ""; + txtNumerator.Text = m_dwRate + ""; + m_forbid_text_change = true; // 譛蛻昴↓邏蛻縺檎匱逕溘☆繧九ョ繧帝亟縺 + txtFrameRate.Text = (float)m_dwRate / (float)m_dwScale + ""; + m_forbid_text_change = false; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public void ApplyLanguage() { + btnExpand.Text = " " + _( "detail" ); + this.Text = _( "configure frame rate" ); + lblFrameRate.Text = _( "Frame rate" ); + btnOK.Text = _( "OK" ); + btnCancel.Text = _( "Cancel" ); + lblDenominator.Text = _( "denominator of frame rate" ); + lblNumerator.Text = _( "numerator of frame rate" ); + btnImport.Text = _( "Import" ); + toolTipImport.SetToolTip( btnImport, _( "import frame rate from AVI file" ) ); + } + + /// + /// 譛臥炊謨ー縺ァ陦ィ縺励◆繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻蟄舌ョ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public uint DwRate { + get { + return m_dwRate; + } + } + + /// + /// 譛臥炊謨ー縺ァ陦ィ縺励◆繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻豈阪ョ蛟、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public uint DwScale { + get { + return m_dwScale; + } + } + + private void btnExpand_Click( object sender, EventArgs e ) { + m_expanded = !m_expanded; + txtFrameRate.Enabled = !m_expanded; + txtNumerator.Enabled = m_expanded; + txtDenominator.Enabled = m_expanded; + btnImport.Enabled = m_expanded; + if ( m_expanded ) { + btnExpand.Image = LipSync.Properties.Resources.opened; + this.Height = HEIGHT_EXPANDED; + } else { + btnExpand.Image = LipSync.Properties.Resources.closed; + this.Height = HEIGHT_FOLDED; + } + } + + private void txtFrameRate_TextChanged( object sender, EventArgs e ) { + if ( m_forbid_text_change ) { + return; + } + if ( !m_expanded ) { + try { + float fps = Math.Abs( float.Parse( txtFrameRate.Text ) ); + m_dwScale = 1000; + m_dwRate = (uint)(fps * m_dwScale); + uint gcd = (uint)Common.GetGCD( m_dwRate, m_dwScale ); + if ( gcd > 1 ) { + m_dwScale = m_dwScale / gcd; + m_dwRate = m_dwRate / gcd; + } + txtNumerator.Text = m_dwRate + ""; + txtDenominator.Text = m_dwScale + ""; + }catch{ + } + } + } + + private void txtNumerator_TextChanged( object sender, EventArgs e ) { + try { + uint num = uint.Parse( txtNumerator.Text ); + m_dwRate = num; + m_forbid_text_change = true; + txtFrameRate.Text = ((float)m_dwRate / (float)m_dwScale) + ""; + m_forbid_text_change = false; + } catch { + } + } + + private void txtDenominator_TextChanged( object sender, EventArgs e ) { + try { + uint den = uint.Parse( txtDenominator.Text ); + m_dwScale = den; + m_forbid_text_change = true; + txtFrameRate.Text = ((float)m_dwRate / (float)m_dwScale) + ""; + m_forbid_text_change = false; + } catch { + } + } + + private void btnImport_Click( object sender, EventArgs e ) { + using ( OpenFileDialog dlg = new OpenFileDialog() ) { + try { + dlg.Filter = _( "Avi file(*.avi)|*.avi" ) + "|" + + _( "All Files(*.*)|*.*" ); + } catch { + dlg.Filter = "Avi file(*.avi)|*.avi|All Files(*.*)|*.*"; + } + if ( dlg.ShowDialog() == DialogResult.OK ) { + AviReader ar = new AviReader(); + try { + ar.Open( dlg.FileName ); + m_dwRate = ar.dwRate; + m_dwScale = ar.dwScale; + ar.Close(); + txtNumerator.Text = m_dwRate + ""; + txtDenominator.Text = m_dwScale + ""; + } catch { + MessageBox.Show( + _( "failed getting frame rate" ), + _( "Error" ), + MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + if ( ar.Opened ) { + try { + ar.Close(); + } catch { + } + } + } + } + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + DialogResult = DialogResult.OK; + } + } + +} diff --git a/trunk/LipSync/Editor/FormVocalomark.Designer.cs b/trunk/LipSync/Editor/FormVocalomark.Designer.cs new file mode 100644 index 0000000..511dc27 --- /dev/null +++ b/trunk/LipSync/Editor/FormVocalomark.Designer.cs @@ -0,0 +1,729 @@ +サソnamespace LipSync { + partial class FormVocalomark { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.lblLipA = new System.Windows.Forms.Label(); + this.lblLipE = new System.Windows.Forms.Label(); + this.lblLipI = new System.Windows.Forms.Label(); + this.lblLipO = new System.Windows.Forms.Label(); + this.lblLipU = new System.Windows.Forms.Label(); + this.groupLip = new System.Windows.Forms.GroupBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.txtLipBlendToDefault = new System.Windows.Forms.TextBox(); + this.lblLipBlendToDefault = new System.Windows.Forms.Label(); + this.txtLipBlendFromDefault = new System.Windows.Forms.TextBox(); + this.lblLipBlendFromDefault = new System.Windows.Forms.Label(); + this.comboLipU = new System.Windows.Forms.ComboBox(); + this.comboLipO = new System.Windows.Forms.ComboBox(); + this.comboLipI = new System.Windows.Forms.ComboBox(); + this.comboLipE = new System.Windows.Forms.ComboBox(); + this.comboLipA = new System.Windows.Forms.ComboBox(); + this.groupEye = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtEyeBlendToDefault = new System.Windows.Forms.TextBox(); + this.lblEyeBlendToDefault = new System.Windows.Forms.Label(); + this.txtEyeBlendFromDefault = new System.Windows.Forms.TextBox(); + this.lblEyeBlendFromDefault = new System.Windows.Forms.Label(); + this.comboEyeWinkL = new System.Windows.Forms.ComboBox(); + this.comboEyeWinkR = new System.Windows.Forms.ComboBox(); + this.lblEyeWinkR = new System.Windows.Forms.Label(); + this.lblEyeWinkL = new System.Windows.Forms.Label(); + this.comboEyeSad = new System.Windows.Forms.ComboBox(); + this.comboEyeSerious = new System.Windows.Forms.ComboBox(); + this.comboEyeSurprise = new System.Windows.Forms.ComboBox(); + this.comboEyeSmile = new System.Windows.Forms.ComboBox(); + this.comboEyeClose = new System.Windows.Forms.ComboBox(); + this.lblEyeSad = new System.Windows.Forms.Label(); + this.lblEyeClose = new System.Windows.Forms.Label(); + this.lblEyeSerious = new System.Windows.Forms.Label(); + this.lblEyeSmile = new System.Windows.Forms.Label(); + this.lblEyeSurprise = new System.Windows.Forms.Label(); + this.groupEyebrow = new System.Windows.Forms.GroupBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.txtEyebrowBlendToDefault = new System.Windows.Forms.TextBox(); + this.lblEyebrowBlendToDefault = new System.Windows.Forms.Label(); + this.txtEyebrowBlendFromDefault = new System.Windows.Forms.TextBox(); + this.lblEyebrowBlendFromDefault = new System.Windows.Forms.Label(); + this.comboEyebrowSad = new System.Windows.Forms.ComboBox(); + this.comboEyebrowConfuse = new System.Windows.Forms.ComboBox(); + this.comboEyebrowSerious = new System.Windows.Forms.ComboBox(); + this.comboEyebrowSurprise = new System.Windows.Forms.ComboBox(); + this.lblEyebrowSurprise = new System.Windows.Forms.Label(); + this.lblEyebrowSad = new System.Windows.Forms.Label(); + this.lblEyebrowSerious = new System.Windows.Forms.Label(); + this.lblEyebrowConfuse = new System.Windows.Forms.Label(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.groupLip.SuspendLayout(); + this.groupEye.SuspendLayout(); + this.groupEyebrow.SuspendLayout(); + this.SuspendLayout(); + // + // lblLipA + // + this.lblLipA.AutoSize = true; + this.lblLipA.Location = new System.Drawing.Point( 17, 26 ); + this.lblLipA.Name = "lblLipA"; + this.lblLipA.Size = new System.Drawing.Size( 23, 12 ); + this.lblLipA.TabIndex = 2; + this.lblLipA.Text = "L_A"; + // + // lblLipE + // + this.lblLipE.AutoSize = true; + this.lblLipE.Location = new System.Drawing.Point( 17, 53 ); + this.lblLipE.Name = "lblLipE"; + this.lblLipE.Size = new System.Drawing.Size( 22, 12 ); + this.lblLipE.TabIndex = 3; + this.lblLipE.Text = "L_E"; + // + // lblLipI + // + this.lblLipI.AutoSize = true; + this.lblLipI.Location = new System.Drawing.Point( 17, 80 ); + this.lblLipI.Name = "lblLipI"; + this.lblLipI.Size = new System.Drawing.Size( 18, 12 ); + this.lblLipI.TabIndex = 4; + this.lblLipI.Text = "L_I"; + // + // lblLipO + // + this.lblLipO.AutoSize = true; + this.lblLipO.Location = new System.Drawing.Point( 17, 107 ); + this.lblLipO.Name = "lblLipO"; + this.lblLipO.Size = new System.Drawing.Size( 23, 12 ); + this.lblLipO.TabIndex = 5; + this.lblLipO.Text = "L_O"; + // + // lblLipU + // + this.lblLipU.AutoSize = true; + this.lblLipU.Location = new System.Drawing.Point( 17, 134 ); + this.lblLipU.Name = "lblLipU"; + this.lblLipU.Size = new System.Drawing.Size( 23, 12 ); + this.lblLipU.TabIndex = 6; + this.lblLipU.Text = "L_U"; + // + // groupLip + // + this.groupLip.Controls.Add( this.label5 ); + this.groupLip.Controls.Add( this.label6 ); + this.groupLip.Controls.Add( this.txtLipBlendToDefault ); + this.groupLip.Controls.Add( this.lblLipBlendToDefault ); + this.groupLip.Controls.Add( this.txtLipBlendFromDefault ); + this.groupLip.Controls.Add( this.lblLipBlendFromDefault ); + this.groupLip.Controls.Add( this.comboLipU ); + this.groupLip.Controls.Add( this.comboLipO ); + this.groupLip.Controls.Add( this.comboLipI ); + this.groupLip.Controls.Add( this.comboLipE ); + this.groupLip.Controls.Add( this.comboLipA ); + this.groupLip.Controls.Add( this.lblLipU ); + this.groupLip.Controls.Add( this.lblLipA ); + this.groupLip.Controls.Add( this.lblLipO ); + this.groupLip.Controls.Add( this.lblLipE ); + this.groupLip.Controls.Add( this.lblLipI ); + this.groupLip.Location = new System.Drawing.Point( 12, 12 ); + this.groupLip.Name = "groupLip"; + this.groupLip.Size = new System.Drawing.Size( 211, 319 ); + this.groupLip.TabIndex = 7; + this.groupLip.TabStop = false; + this.groupLip.Text = "Lip Assignment"; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point( 173, 287 ); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size( 23, 12 ); + this.label5.TabIndex = 24; + this.label5.Text = "sec"; + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point( 173, 241 ); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size( 23, 12 ); + this.label6.TabIndex = 23; + this.label6.Text = "sec"; + // + // txtLipBlendToDefault + // + this.txtLipBlendToDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtLipBlendToDefault.Location = new System.Drawing.Point( 47, 284 ); + this.txtLipBlendToDefault.Name = "txtLipBlendToDefault"; + this.txtLipBlendToDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtLipBlendToDefault.TabIndex = 22; + this.txtLipBlendToDefault.Text = "0.2"; + this.txtLipBlendToDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtLipBlendToDefault.TextChanged += new System.EventHandler( this.txtLipBlendToDefault_TextChanged ); + // + // lblLipBlendToDefault + // + this.lblLipBlendToDefault.AutoSize = true; + this.lblLipBlendToDefault.Location = new System.Drawing.Point( 17, 269 ); + this.lblLipBlendToDefault.Name = "lblLipBlendToDefault"; + this.lblLipBlendToDefault.Size = new System.Drawing.Size( 165, 12 ); + this.lblLipBlendToDefault.TabIndex = 21; + this.lblLipBlendToDefault.Text = "Blend time for L_* -> L_Default"; + // + // txtLipBlendFromDefault + // + this.txtLipBlendFromDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtLipBlendFromDefault.Location = new System.Drawing.Point( 47, 238 ); + this.txtLipBlendFromDefault.Name = "txtLipBlendFromDefault"; + this.txtLipBlendFromDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtLipBlendFromDefault.TabIndex = 20; + this.txtLipBlendFromDefault.Text = "0.1"; + this.txtLipBlendFromDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtLipBlendFromDefault.TextChanged += new System.EventHandler( this.txtLipBlendFromDefault_TextChanged ); + // + // lblLipBlendFromDefault + // + this.lblLipBlendFromDefault.AutoSize = true; + this.lblLipBlendFromDefault.Location = new System.Drawing.Point( 17, 223 ); + this.lblLipBlendFromDefault.Name = "lblLipBlendFromDefault"; + this.lblLipBlendFromDefault.Size = new System.Drawing.Size( 165, 12 ); + this.lblLipBlendFromDefault.TabIndex = 19; + this.lblLipBlendFromDefault.Text = "Blend time for L_Default -> L_*"; + // + // comboLipU + // + this.comboLipU.FormattingEnabled = true; + this.comboLipU.Location = new System.Drawing.Point( 75, 131 ); + this.comboLipU.Name = "comboLipU"; + this.comboLipU.Size = new System.Drawing.Size( 121, 20 ); + this.comboLipU.TabIndex = 12; + // + // comboLipO + // + this.comboLipO.FormattingEnabled = true; + this.comboLipO.Location = new System.Drawing.Point( 75, 104 ); + this.comboLipO.Name = "comboLipO"; + this.comboLipO.Size = new System.Drawing.Size( 121, 20 ); + this.comboLipO.TabIndex = 11; + // + // comboLipI + // + this.comboLipI.FormattingEnabled = true; + this.comboLipI.Location = new System.Drawing.Point( 75, 77 ); + this.comboLipI.Name = "comboLipI"; + this.comboLipI.Size = new System.Drawing.Size( 121, 20 ); + this.comboLipI.TabIndex = 10; + // + // comboLipE + // + this.comboLipE.FormattingEnabled = true; + this.comboLipE.Location = new System.Drawing.Point( 75, 50 ); + this.comboLipE.Name = "comboLipE"; + this.comboLipE.Size = new System.Drawing.Size( 121, 20 ); + this.comboLipE.TabIndex = 9; + // + // comboLipA + // + this.comboLipA.FormattingEnabled = true; + this.comboLipA.Location = new System.Drawing.Point( 75, 23 ); + this.comboLipA.Name = "comboLipA"; + this.comboLipA.Size = new System.Drawing.Size( 121, 20 ); + this.comboLipA.TabIndex = 8; + // + // groupEye + // + this.groupEye.Controls.Add( this.label1 ); + this.groupEye.Controls.Add( this.label2 ); + this.groupEye.Controls.Add( this.txtEyeBlendToDefault ); + this.groupEye.Controls.Add( this.lblEyeBlendToDefault ); + this.groupEye.Controls.Add( this.txtEyeBlendFromDefault ); + this.groupEye.Controls.Add( this.lblEyeBlendFromDefault ); + this.groupEye.Controls.Add( this.comboEyeWinkL ); + this.groupEye.Controls.Add( this.comboEyeWinkR ); + this.groupEye.Controls.Add( this.lblEyeWinkR ); + this.groupEye.Controls.Add( this.lblEyeWinkL ); + this.groupEye.Controls.Add( this.comboEyeSad ); + this.groupEye.Controls.Add( this.comboEyeSerious ); + this.groupEye.Controls.Add( this.comboEyeSurprise ); + this.groupEye.Controls.Add( this.comboEyeSmile ); + this.groupEye.Controls.Add( this.comboEyeClose ); + this.groupEye.Controls.Add( this.lblEyeSad ); + this.groupEye.Controls.Add( this.lblEyeClose ); + this.groupEye.Controls.Add( this.lblEyeSerious ); + this.groupEye.Controls.Add( this.lblEyeSmile ); + this.groupEye.Controls.Add( this.lblEyeSurprise ); + this.groupEye.Location = new System.Drawing.Point( 229, 12 ); + this.groupEye.Name = "groupEye"; + this.groupEye.Size = new System.Drawing.Size( 219, 319 ); + this.groupEye.TabIndex = 8; + this.groupEye.TabStop = false; + this.groupEye.Text = "Eye Assignment"; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 173, 287 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 23, 12 ); + this.label1.TabIndex = 30; + this.label1.Text = "sec"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 173, 241 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 23, 12 ); + this.label2.TabIndex = 29; + this.label2.Text = "sec"; + // + // txtEyeBlendToDefault + // + this.txtEyeBlendToDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEyeBlendToDefault.Location = new System.Drawing.Point( 47, 284 ); + this.txtEyeBlendToDefault.Name = "txtEyeBlendToDefault"; + this.txtEyeBlendToDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtEyeBlendToDefault.TabIndex = 28; + this.txtEyeBlendToDefault.Text = "0.1"; + this.txtEyeBlendToDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtEyeBlendToDefault.TextChanged += new System.EventHandler( this.txtEyeBlendToDefault_TextChanged ); + // + // lblEyeBlendToDefault + // + this.lblEyeBlendToDefault.AutoSize = true; + this.lblEyeBlendToDefault.Location = new System.Drawing.Point( 17, 269 ); + this.lblEyeBlendToDefault.Name = "lblEyeBlendToDefault"; + this.lblEyeBlendToDefault.Size = new System.Drawing.Size( 167, 12 ); + this.lblEyeBlendToDefault.TabIndex = 27; + this.lblEyeBlendToDefault.Text = "Blend time for E_* -> E_Default"; + // + // txtEyeBlendFromDefault + // + this.txtEyeBlendFromDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEyeBlendFromDefault.Location = new System.Drawing.Point( 47, 238 ); + this.txtEyeBlendFromDefault.Name = "txtEyeBlendFromDefault"; + this.txtEyeBlendFromDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtEyeBlendFromDefault.TabIndex = 26; + this.txtEyeBlendFromDefault.Text = "0.05"; + this.txtEyeBlendFromDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtEyeBlendFromDefault.TextChanged += new System.EventHandler( this.txtEyeBlendFromDefault_TextChanged ); + // + // lblEyeBlendFromDefault + // + this.lblEyeBlendFromDefault.AutoSize = true; + this.lblEyeBlendFromDefault.Location = new System.Drawing.Point( 17, 223 ); + this.lblEyeBlendFromDefault.Name = "lblEyeBlendFromDefault"; + this.lblEyeBlendFromDefault.Size = new System.Drawing.Size( 167, 12 ); + this.lblEyeBlendFromDefault.TabIndex = 25; + this.lblEyeBlendFromDefault.Text = "Blend time for E_Default -> E_*"; + // + // comboEyeWinkL + // + this.comboEyeWinkL.FormattingEnabled = true; + this.comboEyeWinkL.Location = new System.Drawing.Point( 81, 185 ); + this.comboEyeWinkL.Name = "comboEyeWinkL"; + this.comboEyeWinkL.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeWinkL.TabIndex = 18; + // + // comboEyeWinkR + // + this.comboEyeWinkR.FormattingEnabled = true; + this.comboEyeWinkR.Location = new System.Drawing.Point( 81, 158 ); + this.comboEyeWinkR.Name = "comboEyeWinkR"; + this.comboEyeWinkR.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeWinkR.TabIndex = 17; + // + // lblEyeWinkR + // + this.lblEyeWinkR.AutoSize = true; + this.lblEyeWinkR.Location = new System.Drawing.Point( 17, 161 ); + this.lblEyeWinkR.Name = "lblEyeWinkR"; + this.lblEyeWinkR.Size = new System.Drawing.Size( 48, 12 ); + this.lblEyeWinkR.TabIndex = 15; + this.lblEyeWinkR.Text = "E_WinkR"; + // + // lblEyeWinkL + // + this.lblEyeWinkL.AutoSize = true; + this.lblEyeWinkL.Location = new System.Drawing.Point( 17, 188 ); + this.lblEyeWinkL.Name = "lblEyeWinkL"; + this.lblEyeWinkL.Size = new System.Drawing.Size( 46, 12 ); + this.lblEyeWinkL.TabIndex = 14; + this.lblEyeWinkL.Text = "E_WinkL"; + // + // comboEyeSad + // + this.comboEyeSad.FormattingEnabled = true; + this.comboEyeSad.Location = new System.Drawing.Point( 81, 131 ); + this.comboEyeSad.Name = "comboEyeSad"; + this.comboEyeSad.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeSad.TabIndex = 12; + // + // comboEyeSerious + // + this.comboEyeSerious.FormattingEnabled = true; + this.comboEyeSerious.Location = new System.Drawing.Point( 81, 104 ); + this.comboEyeSerious.Name = "comboEyeSerious"; + this.comboEyeSerious.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeSerious.TabIndex = 11; + // + // comboEyeSurprise + // + this.comboEyeSurprise.FormattingEnabled = true; + this.comboEyeSurprise.Location = new System.Drawing.Point( 81, 77 ); + this.comboEyeSurprise.Name = "comboEyeSurprise"; + this.comboEyeSurprise.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeSurprise.TabIndex = 10; + // + // comboEyeSmile + // + this.comboEyeSmile.FormattingEnabled = true; + this.comboEyeSmile.Location = new System.Drawing.Point( 81, 50 ); + this.comboEyeSmile.Name = "comboEyeSmile"; + this.comboEyeSmile.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeSmile.TabIndex = 9; + // + // comboEyeClose + // + this.comboEyeClose.FormattingEnabled = true; + this.comboEyeClose.Location = new System.Drawing.Point( 81, 23 ); + this.comboEyeClose.Name = "comboEyeClose"; + this.comboEyeClose.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyeClose.TabIndex = 8; + // + // lblEyeSad + // + this.lblEyeSad.AutoSize = true; + this.lblEyeSad.Location = new System.Drawing.Point( 17, 134 ); + this.lblEyeSad.Name = "lblEyeSad"; + this.lblEyeSad.Size = new System.Drawing.Size( 35, 12 ); + this.lblEyeSad.TabIndex = 6; + this.lblEyeSad.Text = "E_Sad"; + // + // lblEyeClose + // + this.lblEyeClose.AutoSize = true; + this.lblEyeClose.Location = new System.Drawing.Point( 17, 26 ); + this.lblEyeClose.Name = "lblEyeClose"; + this.lblEyeClose.Size = new System.Drawing.Size( 45, 12 ); + this.lblEyeClose.TabIndex = 2; + this.lblEyeClose.Text = "E_Close"; + // + // lblEyeSerious + // + this.lblEyeSerious.AutoSize = true; + this.lblEyeSerious.Location = new System.Drawing.Point( 17, 107 ); + this.lblEyeSerious.Name = "lblEyeSerious"; + this.lblEyeSerious.Size = new System.Drawing.Size( 54, 12 ); + this.lblEyeSerious.TabIndex = 5; + this.lblEyeSerious.Text = "E_Serious"; + // + // lblEyeSmile + // + this.lblEyeSmile.AutoSize = true; + this.lblEyeSmile.Location = new System.Drawing.Point( 17, 53 ); + this.lblEyeSmile.Name = "lblEyeSmile"; + this.lblEyeSmile.Size = new System.Drawing.Size( 44, 12 ); + this.lblEyeSmile.TabIndex = 3; + this.lblEyeSmile.Text = "E_Smile"; + // + // lblEyeSurprise + // + this.lblEyeSurprise.AutoSize = true; + this.lblEyeSurprise.Location = new System.Drawing.Point( 17, 80 ); + this.lblEyeSurprise.Name = "lblEyeSurprise"; + this.lblEyeSurprise.Size = new System.Drawing.Size( 58, 12 ); + this.lblEyeSurprise.TabIndex = 4; + this.lblEyeSurprise.Text = "E_Surprise"; + // + // groupEyebrow + // + this.groupEyebrow.Controls.Add( this.label9 ); + this.groupEyebrow.Controls.Add( this.label10 ); + this.groupEyebrow.Controls.Add( this.txtEyebrowBlendToDefault ); + this.groupEyebrow.Controls.Add( this.lblEyebrowBlendToDefault ); + this.groupEyebrow.Controls.Add( this.txtEyebrowBlendFromDefault ); + this.groupEyebrow.Controls.Add( this.lblEyebrowBlendFromDefault ); + this.groupEyebrow.Controls.Add( this.comboEyebrowSad ); + this.groupEyebrow.Controls.Add( this.comboEyebrowConfuse ); + this.groupEyebrow.Controls.Add( this.comboEyebrowSerious ); + this.groupEyebrow.Controls.Add( this.comboEyebrowSurprise ); + this.groupEyebrow.Controls.Add( this.lblEyebrowSurprise ); + this.groupEyebrow.Controls.Add( this.lblEyebrowSad ); + this.groupEyebrow.Controls.Add( this.lblEyebrowSerious ); + this.groupEyebrow.Controls.Add( this.lblEyebrowConfuse ); + this.groupEyebrow.Location = new System.Drawing.Point( 454, 12 ); + this.groupEyebrow.Name = "groupEyebrow"; + this.groupEyebrow.Size = new System.Drawing.Size( 228, 319 ); + this.groupEyebrow.TabIndex = 9; + this.groupEyebrow.TabStop = false; + this.groupEyebrow.Text = "Eyebrow Assignment"; + // + // label9 + // + this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point( 173, 287 ); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size( 23, 12 ); + this.label9.TabIndex = 30; + this.label9.Text = "sec"; + // + // label10 + // + this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point( 173, 241 ); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size( 23, 12 ); + this.label10.TabIndex = 29; + this.label10.Text = "sec"; + // + // txtEyebrowBlendToDefault + // + this.txtEyebrowBlendToDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEyebrowBlendToDefault.Location = new System.Drawing.Point( 47, 284 ); + this.txtEyebrowBlendToDefault.Name = "txtEyebrowBlendToDefault"; + this.txtEyebrowBlendToDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtEyebrowBlendToDefault.TabIndex = 28; + this.txtEyebrowBlendToDefault.Text = "0.1"; + this.txtEyebrowBlendToDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtEyebrowBlendToDefault.TextChanged += new System.EventHandler( this.txtEyebrowBlendToDefault_TextChanged ); + // + // lblEyebrowBlendToDefault + // + this.lblEyebrowBlendToDefault.AutoSize = true; + this.lblEyebrowBlendToDefault.Location = new System.Drawing.Point( 17, 269 ); + this.lblEyebrowBlendToDefault.Name = "lblEyebrowBlendToDefault"; + this.lblEyebrowBlendToDefault.Size = new System.Drawing.Size( 183, 12 ); + this.lblEyebrowBlendToDefault.TabIndex = 27; + this.lblEyebrowBlendToDefault.Text = "Blend time for EB_* -> EB_Default"; + // + // txtEyebrowBlendFromDefault + // + this.txtEyebrowBlendFromDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEyebrowBlendFromDefault.Location = new System.Drawing.Point( 47, 238 ); + this.txtEyebrowBlendFromDefault.Name = "txtEyebrowBlendFromDefault"; + this.txtEyebrowBlendFromDefault.Size = new System.Drawing.Size( 120, 19 ); + this.txtEyebrowBlendFromDefault.TabIndex = 26; + this.txtEyebrowBlendFromDefault.Text = "0.1"; + this.txtEyebrowBlendFromDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtEyebrowBlendFromDefault.TextChanged += new System.EventHandler( this.txtEyebrowBlendFromDefault_TextChanged ); + // + // lblEyebrowBlendFromDefault + // + this.lblEyebrowBlendFromDefault.AutoSize = true; + this.lblEyebrowBlendFromDefault.Location = new System.Drawing.Point( 17, 223 ); + this.lblEyebrowBlendFromDefault.Name = "lblEyebrowBlendFromDefault"; + this.lblEyebrowBlendFromDefault.Size = new System.Drawing.Size( 183, 12 ); + this.lblEyebrowBlendFromDefault.TabIndex = 25; + this.lblEyebrowBlendFromDefault.Text = "Blend time for EB_Default -> EB_*"; + // + // comboEyebrowSad + // + this.comboEyebrowSad.FormattingEnabled = true; + this.comboEyebrowSad.Location = new System.Drawing.Point( 90, 102 ); + this.comboEyebrowSad.Name = "comboEyebrowSad"; + this.comboEyebrowSad.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyebrowSad.TabIndex = 11; + // + // comboEyebrowConfuse + // + this.comboEyebrowConfuse.FormattingEnabled = true; + this.comboEyebrowConfuse.Location = new System.Drawing.Point( 90, 76 ); + this.comboEyebrowConfuse.Name = "comboEyebrowConfuse"; + this.comboEyebrowConfuse.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyebrowConfuse.TabIndex = 10; + // + // comboEyebrowSerious + // + this.comboEyebrowSerious.FormattingEnabled = true; + this.comboEyebrowSerious.Location = new System.Drawing.Point( 90, 50 ); + this.comboEyebrowSerious.Name = "comboEyebrowSerious"; + this.comboEyebrowSerious.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyebrowSerious.TabIndex = 9; + // + // comboEyebrowSurprise + // + this.comboEyebrowSurprise.FormattingEnabled = true; + this.comboEyebrowSurprise.Location = new System.Drawing.Point( 90, 23 ); + this.comboEyebrowSurprise.Name = "comboEyebrowSurprise"; + this.comboEyebrowSurprise.Size = new System.Drawing.Size( 121, 20 ); + this.comboEyebrowSurprise.TabIndex = 8; + // + // lblEyebrowSurprise + // + this.lblEyebrowSurprise.AutoSize = true; + this.lblEyebrowSurprise.Location = new System.Drawing.Point( 17, 26 ); + this.lblEyebrowSurprise.Name = "lblEyebrowSurprise"; + this.lblEyebrowSurprise.Size = new System.Drawing.Size( 66, 12 ); + this.lblEyebrowSurprise.TabIndex = 2; + this.lblEyebrowSurprise.Text = "EB_Surprise"; + // + // lblEyebrowSad + // + this.lblEyebrowSad.AutoSize = true; + this.lblEyebrowSad.Location = new System.Drawing.Point( 17, 107 ); + this.lblEyebrowSad.Name = "lblEyebrowSad"; + this.lblEyebrowSad.Size = new System.Drawing.Size( 43, 12 ); + this.lblEyebrowSad.TabIndex = 5; + this.lblEyebrowSad.Text = "EB_Sad"; + // + // lblEyebrowSerious + // + this.lblEyebrowSerious.AutoSize = true; + this.lblEyebrowSerious.Location = new System.Drawing.Point( 17, 53 ); + this.lblEyebrowSerious.Name = "lblEyebrowSerious"; + this.lblEyebrowSerious.Size = new System.Drawing.Size( 62, 12 ); + this.lblEyebrowSerious.TabIndex = 3; + this.lblEyebrowSerious.Text = "EB_Serious"; + // + // lblEyebrowConfuse + // + this.lblEyebrowConfuse.AutoSize = true; + this.lblEyebrowConfuse.Location = new System.Drawing.Point( 17, 80 ); + this.lblEyebrowConfuse.Name = "lblEyebrowConfuse"; + this.lblEyebrowConfuse.Size = new System.Drawing.Size( 66, 12 ); + this.lblEyebrowConfuse.TabIndex = 4; + this.lblEyebrowConfuse.Text = "EB_Confuse"; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 518, 353 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 10; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 607, 353 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 11; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // FormVocalomark + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 693, 388 ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.groupEye ); + this.Controls.Add( this.groupLip ); + this.Controls.Add( this.groupEyebrow ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormVocalomark"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FormVocalomark"; + this.groupLip.ResumeLayout( false ); + this.groupLip.PerformLayout(); + this.groupEye.ResumeLayout( false ); + this.groupEye.PerformLayout(); + this.groupEyebrow.ResumeLayout( false ); + this.groupEyebrow.PerformLayout(); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.Label lblLipA; + private System.Windows.Forms.Label lblLipE; + private System.Windows.Forms.Label lblLipI; + private System.Windows.Forms.Label lblLipO; + private System.Windows.Forms.Label lblLipU; + private System.Windows.Forms.GroupBox groupLip; + private System.Windows.Forms.ComboBox comboLipA; + private System.Windows.Forms.ComboBox comboLipU; + private System.Windows.Forms.ComboBox comboLipO; + private System.Windows.Forms.ComboBox comboLipI; + private System.Windows.Forms.ComboBox comboLipE; + private System.Windows.Forms.GroupBox groupEye; + private System.Windows.Forms.ComboBox comboEyeSad; + private System.Windows.Forms.ComboBox comboEyeSerious; + private System.Windows.Forms.ComboBox comboEyeSurprise; + private System.Windows.Forms.ComboBox comboEyeSmile; + private System.Windows.Forms.ComboBox comboEyeClose; + private System.Windows.Forms.Label lblEyeSad; + private System.Windows.Forms.Label lblEyeClose; + private System.Windows.Forms.Label lblEyeSerious; + private System.Windows.Forms.Label lblEyeSmile; + private System.Windows.Forms.Label lblEyeSurprise; + private System.Windows.Forms.GroupBox groupEyebrow; + private System.Windows.Forms.ComboBox comboEyebrowSad; + private System.Windows.Forms.ComboBox comboEyebrowConfuse; + private System.Windows.Forms.ComboBox comboEyebrowSerious; + private System.Windows.Forms.ComboBox comboEyebrowSurprise; + private System.Windows.Forms.Label lblEyebrowSurprise; + private System.Windows.Forms.Label lblEyebrowSad; + private System.Windows.Forms.Label lblEyebrowSerious; + private System.Windows.Forms.Label lblEyebrowConfuse; + private System.Windows.Forms.Label lblEyeWinkR; + private System.Windows.Forms.Label lblEyeWinkL; + private System.Windows.Forms.ComboBox comboEyeWinkR; + private System.Windows.Forms.ComboBox comboEyeWinkL; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtLipBlendToDefault; + private System.Windows.Forms.Label lblLipBlendToDefault; + private System.Windows.Forms.TextBox txtLipBlendFromDefault; + private System.Windows.Forms.Label lblLipBlendFromDefault; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtEyeBlendToDefault; + private System.Windows.Forms.Label lblEyeBlendToDefault; + private System.Windows.Forms.TextBox txtEyeBlendFromDefault; + private System.Windows.Forms.Label lblEyeBlendFromDefault; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox txtEyebrowBlendToDefault; + private System.Windows.Forms.Label lblEyebrowBlendToDefault; + private System.Windows.Forms.TextBox txtEyebrowBlendFromDefault; + private System.Windows.Forms.Label lblEyebrowBlendFromDefault; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/FormVocalomark.cs b/trunk/LipSync/Editor/FormVocalomark.cs new file mode 100644 index 0000000..c6ae596 --- /dev/null +++ b/trunk/LipSync/Editor/FormVocalomark.cs @@ -0,0 +1,198 @@ +サソusing System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class FormVocalomark : Form, IMultiLanguageControl { + private string[] m_image_titles; + public float BlendLipFromDefault = 0.1f; + public float BlendLipToDefault = 0.2f; + public float BlendEyeFromDefault = 0.05f; + public float BlendEyeToDefault = 0.1f; + public float BlendEyebrowFromDefault = 0.1f; + public float BlendEyebrowToDefault = 0.1f; + + public FormVocalomark( Character3 character ) { + InitializeComponent(); + ApplyFont( AppManager.Config.Font.GetFont() ); + ApplyLanguage(); + m_image_titles = new string[character.Count + 1]; + m_image_titles[0] = ""; + for ( int i = 0; i < character.Count; i++ ) { + m_image_titles[i + 1] = character[i].title; + } + comboLipA.Items.AddRange( m_image_titles ); + comboLipE.Items.AddRange( m_image_titles ); + comboLipI.Items.AddRange( m_image_titles ); + comboLipO.Items.AddRange( m_image_titles ); + comboLipU.Items.AddRange( m_image_titles ); + for ( int i = 0; i < m_image_titles.Length; i++ ) { + switch ( m_image_titles[i] ) { + case "a": + comboLipA.SelectedIndex = i; + break; + case "e": + comboLipE.SelectedIndex = i; + break; + case "i": + comboLipI.SelectedIndex = i; + break; + case "o": + comboLipO.SelectedIndex = i; + break; + case "u": + comboLipU.SelectedIndex = i; + break; + } + } + + comboEyeClose.Items.AddRange( m_image_titles ); + comboEyeSad.Items.AddRange( m_image_titles ); + comboEyeSerious.Items.AddRange( m_image_titles ); + comboEyeSmile.Items.AddRange( m_image_titles ); + comboEyeSurprise.Items.AddRange( m_image_titles ); + comboEyeWinkL.Items.AddRange( m_image_titles ); + comboEyeWinkR.Items.AddRange( m_image_titles ); + + comboEyebrowConfuse.Items.AddRange( m_image_titles ); + comboEyebrowSad.Items.AddRange( m_image_titles ); + comboEyebrowSerious.Items.AddRange( m_image_titles ); + comboEyebrowSurprise.Items.AddRange( m_image_titles ); + + txtLipBlendFromDefault.Text = BlendLipFromDefault.ToString(); + txtLipBlendToDefault.Text = BlendLipToDefault.ToString(); + txtEyeBlendFromDefault.Text = BlendEyeFromDefault.ToString(); + txtEyeBlendToDefault.Text = BlendEyeToDefault.ToString(); + txtEyebrowBlendFromDefault.Text = BlendEyebrowFromDefault.ToString(); + txtEyebrowBlendToDefault.Text = BlendEyebrowToDefault.ToString(); + } + + private static string _( string id ) { + return Messaging.GetMessage( id ); + } + + public void ApplyLanguage() { + groupLip.Text = _( "Lip Assignment" ); + groupEye.Text = _( "Eye Assignment" ); + groupEyebrow.Text = _( "Eyebrow Assignment" ); + btnOK.Text = _( "OK" ); + btnCancel.Text = _( "Cancel" ); + lblEyeBlendFromDefault.Text = _( "Blend time for E_Default -> E_*" ); + lblEyeBlendToDefault.Text = _( "Blend time for E_* -> E_Default" ); + lblEyebrowBlendFromDefault.Text = _( "Blend time for EB_Default -> EB_*" ); + lblEyebrowBlendToDefault.Text = _( "Blend time for EB_* -> EB_Default" ); + lblLipBlendFromDefault.Text = _( "Blend time for L_Default -> L_*" ); + lblLipBlendToDefault.Text = _( "Blend time for L_* -> L_Default" ); + } + + public void ApplyFont( Font font ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( this, font ); + } + + public KeyValuePair[] Assignment { + get { + List> ret = new List>(); + if ( comboLipA.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "L_A", m_image_titles[comboLipA.SelectedIndex] ) ); + } + if ( comboLipE.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "L_E", m_image_titles[comboLipE.SelectedIndex] ) ); + } + if ( comboLipI.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "L_I", m_image_titles[comboLipI.SelectedIndex] ) ); + } + if ( comboLipO.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "L_O", m_image_titles[comboLipO.SelectedIndex] ) ); + } + if ( comboLipU.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "L_U", m_image_titles[comboLipU.SelectedIndex] ) ); + } + if ( comboEyebrowConfuse.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "EB_Confuse", m_image_titles[comboEyebrowConfuse.SelectedIndex] ) ); + } + if ( comboEyebrowSad.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "EB_Sad", m_image_titles[comboEyebrowSad.SelectedIndex] ) ); + } + if ( comboEyebrowSerious.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "EB_Serious", m_image_titles[comboEyebrowSerious.SelectedIndex] ) ); + } + if ( comboEyebrowSurprise.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "EB_Surprise", m_image_titles[comboEyebrowSurprise.SelectedIndex] ) ); + } + if ( comboEyeClose.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_Close", m_image_titles[comboEyeClose.SelectedIndex] ) ); + } + if ( comboEyeSad.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_Sad", m_image_titles[comboEyeSad.SelectedIndex] ) ); + } + if ( comboEyeSerious.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_Serious", m_image_titles[comboEyeSerious.SelectedIndex] ) ); + } + if ( comboEyeSmile.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_Smile", m_image_titles[comboEyeSmile.SelectedIndex] ) ); + } + if ( comboEyeSurprise.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_Surprise", m_image_titles[comboEyeSurprise.SelectedIndex] ) ); + } + if ( comboEyeWinkL.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_WinkL", m_image_titles[comboEyeWinkL.SelectedIndex] ) ); + } + if ( comboEyeWinkR.SelectedIndex > 0 ) { + ret.Add( new KeyValuePair( "E_WinkR", m_image_titles[comboEyeWinkR.SelectedIndex] ) ); + } + return ret.ToArray(); + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + } + + private void txtLipBlendFromDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtLipBlendFromDefault.Text, out value ) ) { + BlendLipFromDefault = value; + } + } + + private void txtLipBlendToDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtLipBlendToDefault.Text, out value ) ) { + BlendLipToDefault = value; + } + } + + private void txtEyeBlendFromDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtEyeBlendFromDefault.Text, out value ) ) { + BlendEyeFromDefault = value; + } + } + + private void txtEyeBlendToDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtEyeBlendToDefault.Text, out value ) ){ + BlendEyeToDefault = value; + } + } + + private void txtEyebrowBlendFromDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtEyebrowBlendFromDefault.Text, out value ) ) { + BlendEyebrowFromDefault = value; + } + } + + private void txtEyebrowBlendToDefault_TextChanged( object sender, EventArgs e ) { + float value; + if ( float.TryParse( txtEyebrowBlendToDefault.Text, out value ) ) { + BlendEyebrowToDefault = value; + } + } + } + +} diff --git a/trunk/LipSync/Editor/GenerateCharacter.cs b/trunk/LipSync/Editor/GenerateCharacter.cs new file mode 100644 index 0000000..d618445 --- /dev/null +++ b/trunk/LipSync/Editor/GenerateCharacter.cs @@ -0,0 +1,931 @@ +/* + * GenerateCharacter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class GenerateCharacter : Form, IMultiLanguageControl { + //Character3 m_table_group.Character; + private TimeTableGroup m_table_group; + private bool m_setTrans = false; // 騾城℃濶イ繧定ィュ螳壹@縺ヲ縺繧区凾縺ォ遶九▽繝輔Λ繧ー + bool m_loading = true; + string m_last_path = ""; + PictureBox m_dlg_picture; + string m_selected_path; + string m_last_image_folder = ""; + ExtensibleDialogs.OpenFileDialog m_heavy_dialog; + bool m_abort_thread = false; + + public GenerateCharacter( TimeTableGroup table_group ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + //m_table_group.Character = (Character3)character.Clone(); + m_table_group = (TimeTableGroup)table_group.Clone(); + this.menuFileOpen.Enabled = false; + columnTag.Width = 50; + columnTitle.Width = 130; +#if DEBUG + menuEditDebugEditVersionInfo.Visible = true; +#endif + } + + public GenerateCharacter( Character3 character ) { + m_table_group = new TimeTableGroup( character.Name, 0, character ); + m_table_group.list.Clear(); + for ( int i = 0; i < character.Count; i++ ) { + m_table_group.list.Add( new TimeTable( character[i].title, 0, TimeTableType.character, null ) ); + } + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + this.menuFileOpen.Enabled = true; + columnTag.Width = 50; + columnTitle.Width = 130; +#if DEBUG + menuEditDebugEditVersionInfo.Visible = true; +#endif + } + + public void ApplyLanguage() { + this.lblTitle.Text = _( "Title" ); + this.lblTag.Text = _( "Tag" ); + this.columnTag.Text = _( "Tag" ); + this.columnTitle.Text = _( "Title" ); + this.btnUp.Text = _( "Up" ); + this.btnDown.Text = _( "Down" ); + this.btnAdd.Text = _( "Add" ); + this.btnOK.Text = _( "OK" ); + this.btnCancel.Text = _( "Cancel" ); + this.menuSetImage.Text = _( "Select image file" ); + this.menuTransparent.Text = _( "Select transparent color" ); + this.menuFile.Text = _( "File" ) + "(&F)"; + this.menuFileOpen.Text = _( "Open" ) + "(&O)"; + this.menuFileSave.Text = _( "Save" ) + "(&S)"; + this.label2.Text = _( "Character name" ); + this.Text = _( "Edit character" ); + this.menuEditTitle.Text = _( "Change title" ); + this.menuDelete.Text = _( "Delete" ); + this.groupBox1.Text = _( "Selected image" ); + + this.menuFileImport.Text = _( "Import" ) + "(&I)"; + this.menuFileImportRsi.Text = _( "Open *.rsi" ) + "(&R)"; + + this.menuFileExport.Text = _( "Export" ) + "(&E)"; + this.menuFileExportRsi.Text = _( "Save as *.rsi" ) + "(&R)"; + this.menuFileExportXml.Text = _( "Save as XML" ) + "(&X)"; + + try { + this.openLsc.Filter = _( "LipSync Character Config(*.lsc)|*.lsc" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + this.openLsc.Filter = "LipSync Character Config(*.lsc)|*.lsc|All Files(*.*)|*.*"; + } + try { + this.saveLsc.Filter = _( "LipSync Character Config(*.lsc)|*.lsc" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + this.saveLsc.Filter = "LipSync Character Config(*.lsc)|*.lsc|All Files(*.*)|*.*"; + } + this.menuReset.Text = _( "Reset image" ); + try { + this.openRsi.Filter = _( "RipSync Image(*.rsi)|*.rsi" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + this.openRsi.Filter = "RipSync Image(*.rsi)|*.rsi|All Files(*.*)|*.*"; + } + try { + this.saveRsi.Filter = _( "RipSync Image(*.rsi)|*.rsi" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + this.saveRsi.Filter = "RipSync Image(*.rsi)|*.rsi|All Files(*.*)|*.*" ; + } + this.menuEdit.Text = _( "Edit" ) + "(&E)"; + this.menuEditAdd.Text = _( "Add" ); + this.menuEditDelete.Text = _( "Delete" ); + this.menuEditDown.Text = _( "Down" ); + this.menuEditEditTitle.Text = _( "Change title" ); + this.menuEditReset.Text = _( "Reset image" ); + this.menuEditSetImage.Text = _( "Set image" ); + this.menuEditTransparent.Text = _( "Select transparent color" ); + this.menuEditUp.Text = _( "Up" ); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public TimeTableGroup EditedResult { + get { + return m_table_group; + } + } + /*public Character3 EditedResult { + get { + return m_table_group.Character; + } + }*/ + + public string LastPath { + get { + return m_last_path; + } + set { + m_last_path = value; + } + } + + private void picturePreview_DoubleClick( object sender, EventArgs e ) { + SetImage(); + } + + private void menuFileSave_Click( object sender, EventArgs e ) { + try { + saveLsc.Filter = _( "LipSync Character Config(*.lsc)|*.lsc" ) + "|" + _( "All Files(*.*)|*.*" ); + } catch { + saveLsc.Filter = "LipSync Character Config(*.lsc)|*.lsc|All Files(*.*)|*.*"; + } + if ( saveLsc.ShowDialog() == DialogResult.OK ) { + m_last_path = saveLsc.FileName; + using ( FileStream fs = new FileStream( saveLsc.FileName, FileMode.Create ) ) { + m_table_group.Character.Write( fs ); + } + } + } + + private void menuFileOpen_Click( object sender, EventArgs e ) { + bool dialog_result = false; + string f1 = _( "LipSync Character Config(*.lsc)|*.lsc" ); + string f2 = _( "LipSync Character Config(content.xml)|content.xml" ); + string f3 = _( "All Files(*.*)|*.*" ); + string filter = f1 + "|" + f2 + "|" + f3; + string def_filter = "LipSync Character Config(*.lsc)|*.lsc|LipSync Character Config(content.xml)|content.xml|All Files(*.*)|*.*"; + //string path = ""; + if ( AppManager.Config.UseHeavyDialogInOpeningCharacterSettings ) { + Panel p = new Panel(); + p.BorderStyle = BorderStyle.Fixed3D; + m_dlg_picture = new PictureBox(); + p.Controls.Add( m_dlg_picture ); + m_dlg_picture.Dock = DockStyle.Fill; + m_dlg_picture.SizeMode = PictureBoxSizeMode.Zoom; + + // filter縺ョ譛牙柑諤ァ繧偵∪縺壹メ繧ァ繝繧ッ + try { + OpenFileDialog d = new OpenFileDialog(); + d.Filter = filter; + } catch { + filter = def_filter; + } + + m_heavy_dialog = new ExtensibleDialogs.OpenFileDialog( p ); + m_heavy_dialog.DefaultExt = "lsc"; + m_heavy_dialog.FileName = m_last_path; + m_heavy_dialog.Filter = filter; + + m_heavy_dialog.SelectionChanged += new ExtensibleDialogs.OpenFileDialog.SelectionChangedHandler( dlg_SelectionChanged ); + m_heavy_dialog.FolderChanged += new ExtensibleDialogs.OpenFileDialog.FolderChangedHandler( dlg_FolderChanged ); + m_abort_thread = false; + bgWork.RunWorkerAsync( m_last_path ); + if ( m_heavy_dialog.ShowDialog() == DialogResult.OK ) { + dialog_result = true; + } else { + dialog_result = false; + } + m_abort_thread = true; + } else { + try { + openLsc.Filter = filter; + } catch { + openLsc.Filter = def_filter; + } + openLsc.FileName = m_last_path; + if ( openLsc.ShowDialog() == DialogResult.OK ) { + dialog_result = true; + } else { + dialog_result = false; + } + m_selected_path = openLsc.FileName; + } + if ( dialog_result ) { + Bitmap preview; + FileStream fs = null; + try { + if ( Path.GetFileName( m_selected_path ).ToLower() == "content.xml" ) { + m_table_group.Character = Character3.FromXml( m_selected_path ); + } else { + fs = new FileStream( m_selected_path, FileMode.Open ); + BinaryFormatter bf = new BinaryFormatter(); + m_table_group.Character = (Character3)bf.Deserialize( fs ); + fs.Close(); + } + } catch ( Exception ex1 ) { +#if DEBUG + MessageBox.Show( "GenerateCharacter.menuFileOpen_Click; ex1=" + ex1.ToString() ); +#endif + if ( fs != null ) { + fs.Close(); + } + try { + LipSync.Character t = LipSync.Character.FromFile( m_selected_path ); + m_table_group.Character = new Character3( t ); + } catch ( Exception ex3 ) { +#if DEBUG + MessageBox.Show( "GenerateCharacter.menuFileOpen_Click; ex3=" + ex3.ToString() ); +#endif + MessageBox.Show( _( "Failed file reading" ) ); + return; + } + } + if ( m_table_group.Character != null ) { + picturePreview.Image = m_table_group.Character.DefaultFace; + } + update(); + m_last_path = m_selected_path; + } + } + + private void bgWork_DoWork( object sender, DoWorkEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "bgWork_DoWork; start..." ); +#endif + string file = (string)e.Argument; + if ( file == "" ) { +#if DEBUG + Common.DebugWriteLine( "bgWork_DoWork; ...complete" ); +#endif + return; + } + string folder; + if ( Directory.Exists( file ) ) { + folder = file; + } else { + folder = Path.GetDirectoryName( file ); + } + if ( !Directory.Exists( folder ) ) { +#if DEBUG + Common.DebugWriteLine( "bgWork_DoWork; ...complete" ); +#endif + return; + } + string[] file_lsc = Directory.GetFiles( folder, "*.lsc", SearchOption.TopDirectoryOnly ); + string[] file_xml = Directory.GetFiles( folder, "content.xml", SearchOption.TopDirectoryOnly ); + List files = new List( file_lsc ); + files.AddRange( file_xml ); + //m_dictionaty.Clear(); + foreach ( string f in files ) { + if ( m_abort_thread ) { + break; + } + CharacterConfigCollection.Register( f ); + } + m_abort_thread = false; +#if DEBUG + Common.DebugWriteLine( "bgWork_DoWork; ...complete" ); +#endif + } + + void dlg_FolderChanged( string path ) { +#if DEBUG + Common.DebugWriteLine( "dlg_FolderChanged; path=" + path ); +#endif + if ( bgWork.IsBusy ) { + m_abort_thread = true; + while ( bgWork.IsBusy ) { + Application.DoEvents(); + } + } + m_abort_thread = false; + bgWork.RunWorkerAsync( path ); + } + + void dlg_SelectionChanged( string path ) { + if ( !File.Exists( path ) ) { + return; + } + m_selected_path = path; + string file = Path.GetFileName( path ); + StringFormat sf = new StringFormat(); + sf.Alignment = StringAlignment.Center; + sf.LineAlignment = StringAlignment.Center; + if ( CharacterConfigCollection.IsRegistered( path ) ) { + Image img = CharacterConfigCollection.GetPreviewImage( path ); + if ( img != null ) { + m_dlg_picture.Image = img; + } else { + m_dlg_picture.Image = new Bitmap( m_dlg_picture.Width, m_dlg_picture.Height ); + using ( Graphics g = Graphics.FromImage( m_dlg_picture.Image ) ) { + g.DrawString( + "preview unavailable", + new Font( "Arial", 11 ), + Brushes.Black, + new RectangleF( 0, 0, m_dlg_picture.Width, m_dlg_picture.Height ), + sf ); + } + } + } else { + m_dlg_picture.Image = new Bitmap( m_dlg_picture.Width, m_dlg_picture.Height ); + using ( Graphics g = Graphics.FromImage( m_dlg_picture.Image ) ) { + g.DrawString( + "loading ...", + new Font( "Arial", 11 ), + Brushes.Black, + new RectangleF( 0, 0, m_dlg_picture.Width, m_dlg_picture.Height ), + sf ); + } + } + } + + /// + /// 迴セ蝨ィ縺ョm_table_group.Character縺ョ蜀螳ケ繧偵〕istView1縺ォ驕ゥ逕ィ縺励∪縺 + /// + private void update() { + if ( m_table_group.Character == null ) { + return; + } + m_loading = true; + textBox1.Text = m_table_group.Character.Name; + string title = SelectedTitle; + + // 逋サ骭イ縺吶kシ + listView1.Items.Clear(); + for ( int i = 0; i < m_table_group.Character.Count; i++ ) { + ListViewItem adding = new ListViewItem( new string[] { m_table_group.Character[i].title, m_table_group.Character[i].tag } ); + adding.Checked = m_table_group.Character[i].IsDefault; // Add縺励※縺九iChecked繧貞、画峩縺吶k縺ィシ後う繝吶Φ繝医′逋コ逕溘@縺ヲ繧√s縺ゥ縺シ + listView1.Items.Add( adding ); + } + if ( title != "" ) { + for( int i = 0; i < listView1.Items.Count; i++ ){ + if ( listView1.Items[i].Text == title ) { + listView1.Items[i].EnsureVisible(); + break; + } + } + } + this.Invalidate(); + m_loading = false; + } + + private void btnOK_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + } + + private void textBox1_TextChanged( object sender, EventArgs e ) { + m_table_group.Character.Name = textBox1.Text; + } + + private void btnAdd_Click( object sender, EventArgs e ) { + Add(); + } + + private void menuSetImage_Click( object sender, EventArgs e ) { + SetImage(); + } + + private void GenerateCharacter_DragDrop( object sender, DragEventArgs e ) { +#if DEBUG + Common.DebugWriteLine( "GenerateCharacter_DragDrop" ); +#endif + if ( e.Data.GetDataPresent( DataFormats.FileDrop ) ) { + object data = e.Data.GetData( DataFormats.FileDrop ); + if ( data is string[] ) { + string[] filename = (string[])data; + for ( int i = 0; i < filename.Length; i++ ) { + Image img = Common.ImageFromFile( filename[i] ); + string title = Path.GetFileNameWithoutExtension( filename[i] ); +#if DEBUG + Common.DebugWriteLine( " filename[i]=" + filename[i] ); + Common.DebugWriteLine( " title=" + title ); +#endif + if ( title != "" ) { +#if DEBUG + Common.DebugWriteLine( " SetImage..." ); +#endif + if ( m_table_group.Character[title] != null ) { + m_table_group.Character.SetImage( img, title ); + picturePreview.Image = img; + int width = Math.Max( m_table_group.Character.Size.Width, img.Width ); + int height = Math.Max( m_table_group.Character.Size.Height, img.Height ); +#if DEBUG + Common.DebugWriteLine( " Character3+Size..set()" ); +#endif + m_table_group.Character.Size = new Size( width, height ); + } else { + m_table_group.Character.Add( new ImageEntry( title, null, "", false, m_table_group.Character.Count ) ); + m_table_group.Character.SetImage( img, title ); + m_table_group.list.Add( new TimeTable( title, 0, TimeTableType.character, null ) ); + int width = Math.Max( m_table_group.Character.Size.Width, img.Width ); + int height = Math.Max( m_table_group.Character.Size.Height, img.Height ); + m_table_group.Character.Size = new Size( width, height ); + listView1.Items.Add( new ListViewItem( new string[] { title, "" } ) ); + listView1.Items[listView1.Items.Count - 1].Selected = true; + } + } + } + this.Invalidate(); + } + } + } + + private void GenerateCharacter_DragEnter( object sender, DragEventArgs e ) { + e.Effect = DragDropEffects.All; + } + + private void menuTransparent_Click( object sender, EventArgs e ) { + Transparent(); + } + + /// + /// listView1縺ォ縺ヲ迴セ蝨ィ驕ク謚槭&繧後※縺繧九い繧、繝繝縺ョ蜷榊燕繧貞叙蠕励@縺セ縺 + /// + private string SelectedTitle { + get { + for( int i = 0; i < listView1.Items.Count; i++ ) { + if( listView1.Items[i].Selected ) { + return listView1.Items[i].Text; + } + } + return ""; + } + } + + private void pictureBox1_MouseClick( object sender, MouseEventArgs e ) { + if ( m_setTrans ) { + int x = e.X; + int y = e.Y; + string title = SelectedTitle; + Image img = null; + for ( int i = 0; i < m_table_group.Character.Count; i++ ) { + if ( m_table_group.Character[i].title == title ) { + m_table_group.Character[i].GetImage( m_table_group.Character.Size ); + } + } + if ( img != null ) { + if ( x <= img.Width && y <= img.Height ) { + Bitmap bmp = new Bitmap( img ); + Color tmp = bmp.GetPixel( x, y ); + bmp.MakeTransparent( tmp ); + m_table_group.Character.SetImage( bmp, title ); + if ( picturePreview.Image != null ) { + picturePreview.Image.Dispose(); + } + picturePreview.Image = (Image)bmp.Clone(); + bmp.Dispose(); + update(); + picturePreview.Invalidate(); + } + } + picturePreview.Cursor = Cursors.Arrow; + m_setTrans = false; + } + } + + private void txtTag_TextChanged( object sender, EventArgs e ) { + if ( txtTag.Enabled ) { + string title = SelectedTitle; + ImageEntry t = m_table_group.Character[title]; + if ( t != null ) { + t.tag = txtTag.Text; + for ( int i = 0; i < listView1.Items.Count; i++ ) { + if ( listView1.Items[i].Text == m_table_group.Character[title].title ) { + listView1.Items[i].SubItems[1].Text = txtTag.Text; + return; + } + } + } + } + } + + private void menuEditTitle_Click( object sender, EventArgs e ) { + Title(); + } + + private void menuDelete_Click( object sender, EventArgs e ) { + Delete(); + } + + private void listView1_SelectedIndexChanged( object sender, EventArgs e ) { + string title = SelectedTitle; + if ( title == "" ) { + List draw = new List(); + foreach ( ListViewItem item in listView1.Items ) { + if ( item.Checked ) { + ImageEntry ie = m_table_group.Character[item.Text]; + if ( ie != null ) { + draw.Add( ie.Z ); + } + } + } + picturePreview.Image = m_table_group.Character.Face( draw.ToArray() ); + return; + } + ImageEntry ie2 = m_table_group.Character[title]; + if ( ie2 != null ) { + int index = ie2.Z; + picturePreview.Image = m_table_group.Character.Face( new int[] { index } ); + lblThisTitle.Text = m_table_group.Character[title].title; + txtTag.Enabled = false; + txtTag.Text = m_table_group.Character[title].tag; + if ( 0 <= index && index < 9 ) { + txtTag.Text += "(" + _( "NOT editable" ) + ")"; + txtTag.Enabled = false; + } else { + txtTag.Enabled = true; + } + this.Invalidate(); + } + } + + private void mstripImage_Opening( object sender, CancelEventArgs e ) { + string title = SelectedTitle; + if ( title == "" ) { + menuDelete.Enabled = false; + menuEditTitle.Enabled = false; + menuSetImage.Enabled = false; + menuTransparent.Enabled = false; + } else { + int index = m_table_group.Character[title].Z; + if ( 9 <= index ) { + menuDelete.Enabled = true; + menuEditTitle.Enabled = true; + } else { + menuDelete.Enabled = false; + menuEditTitle.Enabled = false; + } + menuSetImage.Enabled = true; + menuTransparent.Enabled = true; + } + } + + private void listView1_ItemChecked( object sender, ItemCheckedEventArgs e ) { + if ( m_loading ) { + return; + } + int changed_item = e.Item.Index; + string title = listView1.Items[changed_item].Text; +#if DEBUG + Common.DebugWriteLine( "listView1_ItemChecked; title=" + title ); +#endif + string tag = m_table_group.Character[title].tag; + m_table_group.Character[title].IsDefault = e.Item.Checked; + if ( tag != "" && e.Item.Checked ) { + for ( int i = 0; i < listView1.Items.Count; i++ ) { + string temp_title = listView1.Items[i].Text; + string temp_tag = m_table_group.Character[temp_title].tag; + if ( temp_tag == tag && temp_title != title ) { + m_table_group.Character[temp_title].IsDefault = false; + listView1.Items[i].Checked = false; + } + } + } + if ( SelectedTitle == "" ) { + List draw = new List(); + foreach ( ListViewItem item in listView1.Items ) { + if ( item.Checked ) { + int index = m_table_group.Character[item.Text].Z; + if( index >= 0 ) { + draw.Add( index ); + } + } + } + picturePreview.Image = m_table_group.Character.Face( draw.ToArray() ); + } + this.Invalidate(); + //update(); //縺薙%縺ァ蜻シ縺カ縺ィ縲∵ーク荵蜀榊クー蜻シ縺ウ蜃コ縺励〒StackOverFlow縺吶k + } + + private void GenerateCharacter_Load( object sender, EventArgs e ) { + update(); + } + + private void btnUp_Click( object sender, EventArgs e ) { + Up(); + } + + private void btnDown_Click( object sender, EventArgs e ) { + Down(); + } + + private void menuReset_Click( object sender, EventArgs e ) { + Reset(); + } + + private void menuFileImportRsi_Click( object sender, EventArgs e ) { + if( openRsi.ShowDialog() == DialogResult.OK ){ + CharacterEx character_ex = RsiReader.Read( openRsi.FileName ); + if ( character_ex.character != null ) { + m_table_group.Character = (Character3)character_ex.character.Clone(); + update(); + } + } + } + + private void menuFileExportRsi_Click( object sender, EventArgs e ) { + if ( saveRsi.ShowDialog() == DialogResult.OK ) { + RsiWriter.Write( m_table_group.Character, saveRsi.FileName ); + } + } + + private void bgWork_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e ) { + bgWork.CancelAsync(); + } + + private void menuEditSetImage_Click( object sender, EventArgs e ) { + SetImage(); + } + + private void menuEditTransparent_Click( object sender, EventArgs e ) { + Transparent(); + } + + #region Core of EditHandle + private void Add() { + using ( InputBox ib = new InputBox( _( "Title of image" ), + _( "Input the title of image" ) ) ) { + if ( ib.ShowDialog() == DialogResult.OK ) { + string new_title = ib.rText; + bool found = false; + foreach ( ImageEntry ie in m_table_group.Character ) { + if ( ie.title == new_title ) { + found = true; + break; + } + } + if ( !found ) { + m_table_group.Character.Add( new ImageEntry( ib.rText, null, "", false, m_table_group.Character.Count ) ); + m_table_group.list.Add( new TimeTable( ib.rText, 0, TimeTableType.character, null ) ); + listView1.Items.Add( new ListViewItem( new string[] { ib.rText, "" } ) ); + listView1.Items[listView1.Items.Count - 1].Selected = true; + } else { + MessageBox.Show( + _( "This image title has been already registered" ), + _( "Error" ) ); + } + } + } + update(); + } + + private void Up() { +#if DEBUG + Common.DebugWriteLine( "Up()" ); +#endif + string selected_title = SelectedTitle; + int selected_index = -1; + for ( int i = 0; i < listView1.Items.Count; i++ ) { + if ( listView1.Items[i].Text == selected_title ) { + selected_index = i; + break; + } + } + if ( selected_index >= 1 ) { + string upper_title = listView1.Items[selected_index - 1].Text; + ListViewItem b = (ListViewItem)listView1.Items[selected_index].Clone(); + listView1.Items[selected_index] = (ListViewItem)listView1.Items[selected_index - 1].Clone(); + listView1.Items[selected_index - 1] = b; + listView1.Items[selected_index].Selected = false; + listView1.Items[selected_index - 1].Selected = false; + + int upper_z = m_table_group.Character[upper_title].Z; + int selected_z = m_table_group.Character[selected_title].Z; +#if DEBUG + Common.DebugWriteLine( " selected_title=" + selected_title ); + Common.DebugWriteLine( " upper_title=" + upper_title ); +#endif + m_table_group.Character[selected_title].Z = upper_z; + m_table_group.Character[upper_title].Z = selected_z; + + update(); + listView1.Items[selected_index - 1].Selected = true; + listView1.Items[selected_index - 1].EnsureVisible(); + + TimeTable ttable_upper = (TimeTable)m_table_group[selected_index - 1].Clone(); + m_table_group[selected_index - 1] = (TimeTable)m_table_group[selected_index].Clone(); + m_table_group[selected_index] = ttable_upper; + } +#if DEBUG + Common.DebugWriteLine( "-------------------------------" ); +#endif + } + + private void Down() { +#if DEBUG + Common.DebugWriteLine( "Down()" ); +#endif + string selected_title = SelectedTitle; + int selected_index = -1; + for ( int i = 0; i < listView1.Items.Count; i++ ) { + if ( listView1.Items[i].Text == selected_title ) { + selected_index = i; + break; + } + } + if ( selected_index >= 0 && selected_index < listView1.Items.Count - 1 ) { + string lower_title = listView1.Items[selected_index + 1].Text; + ListViewItem b = (ListViewItem)listView1.Items[selected_index].Clone(); + listView1.Items[selected_index] = (ListViewItem)listView1.Items[selected_index + 1].Clone(); + listView1.Items[selected_index + 1] = b; + listView1.Items[selected_index].Selected = false; + listView1.Items[selected_index + 1].Selected = false; + + int lower_z = m_table_group.Character[lower_title].Z; + int selected_z = m_table_group.Character[selected_title].Z; +#if DEBUG + Common.DebugWriteLine( " selected_title=" + selected_title ); + Common.DebugWriteLine( " lower_title=" + lower_title ); +#endif + m_table_group.Character[lower_title].Z = selected_z; + m_table_group.Character[selected_title].Z = lower_z; + + update(); + listView1.Items[selected_index + 1].Selected = true; + listView1.Items[selected_index + 1].EnsureVisible(); + + TimeTable ttable_lower = (TimeTable)m_table_group.list[selected_index + 1].Clone(); + m_table_group.list[selected_index + 1] = (TimeTable)m_table_group.list[selected_index].Clone(); + m_table_group.list[selected_index] = ttable_lower; + } +#if DEBUG + Common.DebugWriteLine( "-------------------------------" ); +#endif + } + + private void SetImage() { + string title = SelectedTitle; + if ( title != "" ) { + openImage.FileName = ""; + if ( m_last_image_folder != "" ) { + openImage.InitialDirectory = m_last_image_folder; + } + if ( openImage.ShowDialog() == DialogResult.OK ) { + Image img = Common.ImageFromFile( openImage.FileName ); + m_table_group.Character.SetImage( img, title ); + picturePreview.Image = img; + if ( img != null ) { + int width = Math.Max( m_table_group.Character.Size.Width, img.Width ); + int height = Math.Max( m_table_group.Character.Size.Height, img.Height ); + m_table_group.Character.Size = new Size( width, height ); + } + this.Invalidate(); + m_last_image_folder = Path.GetDirectoryName( openImage.FileName ); + } else { + m_last_image_folder = openImage.InitialDirectory; + } + } + } + + private void Transparent() { + if ( SelectedTitle != "" ) { + m_setTrans = true; + picturePreview.Cursor = Cursors.Cross; + } + } + + private void Reset() { + string title = SelectedTitle; + if ( title != "" ) { + m_table_group.Character[title].ResetImage(); + picturePreview.Image = null; + } + } + + private void Delete() { + string title = SelectedTitle; + if ( title == "" ) { + return; + } + m_table_group.Character.Remove( title ); + for ( int i = 0; i < m_table_group.list.Count; i++ ) { + if ( m_table_group.list[i].Text == title ) { + m_table_group.list.RemoveAt( i ); + break; + } + } + UpdateZOrder(); + picturePreview.Image = null; + update(); + } + + /// + /// m_table_group.list縺ョ鬆蠎上r蜈縺ォ縲[_table_group.Character縺ョz繧ェ繝シ繝繝シ繧呈眠縺溘↓蟷。逡ェ縺吶k + /// + private void UpdateZOrder() { + for ( int i = 0; i < m_table_group.list.Count; i++ ) { + foreach ( ImageEntry ie in m_table_group.Character ) { + if ( ie.title == m_table_group.list[i].Text ) { + ie.Z = i; + break; + } + } + } + } + + private void Title() { + string title = SelectedTitle; + if ( title == "" ) { + return; + } + string edited_title = ""; + using ( InputBox ib = new InputBox( + _( "Change title" ), + _( "Input new title" ) ) ) { + ib.rText = title; + if ( ib.ShowDialog() == DialogResult.OK ) { + edited_title = ib.rText; + foreach ( ImageEntry ie in m_table_group.Character ) { + if ( title == ie.title ) { + ie.title = edited_title; + break; + } + } + for ( int i = 0; i < m_table_group.list.Count; i++ ) { + if ( title == m_table_group.list[i].Text ) { + m_table_group.list[i].Text = edited_title; + break; + } + } + } + } + update(); + } + #endregion + + private void menuEditDelete_Click( object sender, EventArgs e ) { + Delete(); + } + + private void menuEditReset_Click( object sender, EventArgs e ) { + Reset(); + } + + private void menuEditEditTitle_Click( object sender, EventArgs e ) { + Title(); + } + + private void menuEditUp_Click( object sender, EventArgs e ) { + Up(); + } + + private void menuEditDown_Click( object sender, EventArgs e ) { + Down(); + } + + private void menuEditAdd_Click( object sender, EventArgs e ) { + Add(); + } + + private void menuEditDebugEditVersionInfo_Click( object sender, EventArgs e ) { +#if DEBUG + using ( InputBox ib = new InputBox( "", "input author" ) ) { + if ( ib.ShowDialog() == DialogResult.OK ) { + m_table_group.Character.Author = ib.rText; + } + } + using ( InputBox ib = new InputBox( "", "input version" ) ) { + if ( ib.ShowDialog() == DialogResult.OK ) { + m_table_group.Character.Version = ib.rText; + } + } +#endif + } + + private void menuFileExportXml_Click( object sender, EventArgs e ) { + saveLsc.FileName = m_last_path; + string f1 = _( "LipSync Character Config(content.xml)|content.xml" ); + string f2 = _( "All Files(*.*)|*.*" ); + string filter = f1 + "|" + f2; + string def_filter = "LipSync Character Config(content.xml)|content.xml|All Files(*.*)|*.*"; + try { + saveLsc.Filter = filter; + } catch { + saveLsc.Filter = def_filter; + } + if ( saveLsc.ShowDialog() == DialogResult.OK ) { + this.m_table_group.Character.WriteXml( saveLsc.FileName ); + m_last_path = saveLsc.FileName; + } + } + } + +} diff --git a/trunk/LipSync/Editor/GenerateCharacter.designer.cs b/trunk/LipSync/Editor/GenerateCharacter.designer.cs new file mode 100644 index 0000000..b0da07e --- /dev/null +++ b/trunk/LipSync/Editor/GenerateCharacter.designer.cs @@ -0,0 +1,641 @@ +/* + * GenerateCharacter.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class GenerateCharacter { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.mstripImage = new System.Windows.Forms.ContextMenuStrip( this.components ); + this.menuSetImage = new System.Windows.Forms.ToolStripMenuItem(); + this.menuTransparent = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditTitle = new System.Windows.Forms.ToolStripMenuItem(); + this.menuDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.menuReset = new System.Windows.Forms.ToolStripMenuItem(); + this.openLsc = new System.Windows.Forms.OpenFileDialog(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.menuFile = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileOpen = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileSave = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileImport = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileImportRsi = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileExport = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileExportRsi = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFileExportXml = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditSetImage = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditTransparent = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditEditTitle = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditReset = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.menuEditUp = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditDown = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditAdd = new System.Windows.Forms.ToolStripMenuItem(); + this.menuEditDebugEditVersionInfo = new System.Windows.Forms.ToolStripMenuItem(); + this.saveLsc = new System.Windows.Forms.SaveFileDialog(); + this.openImage = new System.Windows.Forms.OpenFileDialog(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnTitle = new System.Windows.Forms.ColumnHeader(); + this.columnTag = new System.Windows.Forms.ColumnHeader(); + this.btnDown = new System.Windows.Forms.Button(); + this.btnUp = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.lblThisTitle = new System.Windows.Forms.Label(); + this.txtTag = new System.Windows.Forms.TextBox(); + this.lblTag = new System.Windows.Forms.Label(); + this.lblTitle = new System.Windows.Forms.Label(); + this.picturePreview = new System.Windows.Forms.PictureBox(); + this.splitContainer1 = new Boare.Lib.AppUtil.BSplitContainer(); + this.openRsi = new System.Windows.Forms.OpenFileDialog(); + this.saveRsi = new System.Windows.Forms.SaveFileDialog(); + this.bgWork = new System.ComponentModel.BackgroundWorker(); + this.mstripImage.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturePreview)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.SuspendLayout(); + // + // btnAdd + // + this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnAdd.Location = new System.Drawing.Point( 143, 324 ); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size( 60, 23 ); + this.btnAdd.TabIndex = 4; + this.btnAdd.Text = "霑ス蜉"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler( this.btnAdd_Click ); + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 34, 324 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 6; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 123, 324 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 7; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // mstripImage + // + this.mstripImage.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuSetImage, + this.menuTransparent, + this.menuEditTitle, + this.menuDelete, + this.menuReset} ); + this.mstripImage.Name = "contextMenuStrip1"; + this.mstripImage.ShowImageMargin = false; + this.mstripImage.Size = new System.Drawing.Size( 115, 114 ); + this.mstripImage.Opening += new System.ComponentModel.CancelEventHandler( this.mstripImage_Opening ); + // + // menuSetImage + // + this.menuSetImage.Name = "menuSetImage"; + this.menuSetImage.Size = new System.Drawing.Size( 114, 22 ); + this.menuSetImage.Text = "逕サ蜒上r險ュ螳"; + this.menuSetImage.Click += new System.EventHandler( this.menuSetImage_Click ); + // + // menuTransparent + // + this.menuTransparent.Name = "menuTransparent"; + this.menuTransparent.Size = new System.Drawing.Size( 114, 22 ); + this.menuTransparent.Text = "騾城℃濶イ繧定ィュ螳"; + this.menuTransparent.Click += new System.EventHandler( this.menuTransparent_Click ); + // + // menuEditTitle + // + this.menuEditTitle.Name = "menuEditTitle"; + this.menuEditTitle.Size = new System.Drawing.Size( 114, 22 ); + this.menuEditTitle.Text = "繧ソ繧、繝医Ν繧貞、画峩"; + this.menuEditTitle.Click += new System.EventHandler( this.menuEditTitle_Click ); + // + // menuDelete + // + this.menuDelete.Name = "menuDelete"; + this.menuDelete.Size = new System.Drawing.Size( 114, 22 ); + this.menuDelete.Text = "蜑企勁"; + this.menuDelete.Click += new System.EventHandler( this.menuDelete_Click ); + // + // menuReset + // + this.menuReset.Name = "menuReset"; + this.menuReset.Size = new System.Drawing.Size( 114, 22 ); + this.menuReset.Text = "逕サ蜒上r繝ェ繧サ繝繝"; + this.menuReset.Click += new System.EventHandler( this.menuReset_Click ); + // + // openLsc + // + this.openLsc.Filter = "Character setting|*.lsc;content.xml|All files|*.*"; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuFile, + this.menuEdit} ); + this.menuStrip1.Location = new System.Drawing.Point( 0, 0 ); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size( 422, 24 ); + this.menuStrip1.TabIndex = 6; + this.menuStrip1.Text = "menuStrip1"; + // + // menuFile + // + this.menuFile.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuFileOpen, + this.menuFileSave, + this.menuFileImport, + this.menuFileExport} ); + this.menuFile.Name = "menuFile"; + this.menuFile.Size = new System.Drawing.Size( 66, 20 ); + this.menuFile.Text = "繝輔ぃ繧、繝ォ(&F)"; + // + // menuFileOpen + // + this.menuFileOpen.Name = "menuFileOpen"; + this.menuFileOpen.Size = new System.Drawing.Size( 139, 22 ); + this.menuFileOpen.Text = "髢九¥(&O)"; + this.menuFileOpen.Click += new System.EventHandler( this.menuFileOpen_Click ); + // + // menuFileSave + // + this.menuFileSave.Name = "menuFileSave"; + this.menuFileSave.Size = new System.Drawing.Size( 139, 22 ); + this.menuFileSave.Text = "菫晏ュ(&S)"; + this.menuFileSave.Click += new System.EventHandler( this.menuFileSave_Click ); + // + // menuFileImport + // + this.menuFileImport.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuFileImportRsi} ); + this.menuFileImport.Name = "menuFileImport"; + this.menuFileImport.Size = new System.Drawing.Size( 139, 22 ); + this.menuFileImport.Text = "繧、繝ウ繝昴シ繝(&I)"; + // + // menuFileImportRsi + // + this.menuFileImportRsi.Name = "menuFileImportRsi"; + this.menuFileImportRsi.Size = new System.Drawing.Size( 131, 22 ); + this.menuFileImportRsi.Text = "RSI繧帝幕縺(&R)"; + this.menuFileImportRsi.Click += new System.EventHandler( this.menuFileImportRsi_Click ); + // + // menuFileExport + // + this.menuFileExport.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuFileExportRsi, + this.menuFileExportXml} ); + this.menuFileExport.Name = "menuFileExport"; + this.menuFileExport.Size = new System.Drawing.Size( 139, 22 ); + this.menuFileExport.Text = "繧ィ繧ッ繧ケ繝昴シ繝(&E)"; + // + // menuFileExportRsi + // + this.menuFileExportRsi.Name = "menuFileExportRsi"; + this.menuFileExportRsi.Size = new System.Drawing.Size( 165, 22 ); + this.menuFileExportRsi.Text = "RSI縺ァ菫晏ュ(&R)"; + this.menuFileExportRsi.Click += new System.EventHandler( this.menuFileExportRsi_Click ); + // + // menuFileExportXml + // + this.menuFileExportXml.Name = "menuFileExportXml"; + this.menuFileExportXml.Size = new System.Drawing.Size( 165, 22 ); + this.menuFileExportXml.Text = "XML蠖「蠑上〒菫晏ュ(&X)"; + this.menuFileExportXml.Click += new System.EventHandler( this.menuFileExportXml_Click ); + // + // menuEdit + // + this.menuEdit.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuEditSetImage, + this.menuEditTransparent, + this.menuEditEditTitle, + this.menuEditDelete, + this.menuEditReset, + this.toolStripMenuItem1, + this.menuEditUp, + this.menuEditDown, + this.menuEditAdd, + this.menuEditDebugEditVersionInfo} ); + this.menuEdit.Name = "menuEdit"; + this.menuEdit.Size = new System.Drawing.Size( 56, 20 ); + this.menuEdit.Text = "邱ィ髮(&E)"; + // + // menuEditSetImage + // + this.menuEditSetImage.Name = "menuEditSetImage"; + this.menuEditSetImage.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditSetImage.Text = "逕サ蜒上r險ュ螳"; + this.menuEditSetImage.Click += new System.EventHandler( this.menuEditSetImage_Click ); + // + // menuEditTransparent + // + this.menuEditTransparent.Name = "menuEditTransparent"; + this.menuEditTransparent.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditTransparent.Text = "騾乗手牡繧定ィュ螳"; + this.menuEditTransparent.Click += new System.EventHandler( this.menuEditTransparent_Click ); + // + // menuEditEditTitle + // + this.menuEditEditTitle.Name = "menuEditEditTitle"; + this.menuEditEditTitle.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditEditTitle.Text = "繧ソ繧、繝医Ν繧貞、画峩"; + this.menuEditEditTitle.Click += new System.EventHandler( this.menuEditEditTitle_Click ); + // + // menuEditDelete + // + this.menuEditDelete.Name = "menuEditDelete"; + this.menuEditDelete.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditDelete.Text = "蜑企勁"; + this.menuEditDelete.Click += new System.EventHandler( this.menuEditDelete_Click ); + // + // menuEditReset + // + this.menuEditReset.Name = "menuEditReset"; + this.menuEditReset.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditReset.Text = "逕サ蜒上r繝ェ繧サ繝繝"; + this.menuEditReset.Click += new System.EventHandler( this.menuEditReset_Click ); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size( 150, 6 ); + // + // menuEditUp + // + this.menuEditUp.Name = "menuEditUp"; + this.menuEditUp.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditUp.Text = "荳"; + this.menuEditUp.Click += new System.EventHandler( this.menuEditUp_Click ); + // + // menuEditDown + // + this.menuEditDown.Name = "menuEditDown"; + this.menuEditDown.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditDown.Text = "荳"; + this.menuEditDown.Click += new System.EventHandler( this.menuEditDown_Click ); + // + // menuEditAdd + // + this.menuEditAdd.Name = "menuEditAdd"; + this.menuEditAdd.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditAdd.Text = "霑ス蜉"; + this.menuEditAdd.Click += new System.EventHandler( this.menuEditAdd_Click ); + // + // menuEditDebugEditVersionInfo + // + this.menuEditDebugEditVersionInfo.Name = "menuEditDebugEditVersionInfo"; + this.menuEditDebugEditVersionInfo.Size = new System.Drawing.Size( 153, 22 ); + this.menuEditDebugEditVersionInfo.Text = "edit version info"; + this.menuEditDebugEditVersionInfo.Visible = false; + this.menuEditDebugEditVersionInfo.Click += new System.EventHandler( this.menuEditDebugEditVersionInfo_Click ); + // + // saveLsc + // + this.saveLsc.Filter = "Character setting|*.lsc|All files|*.*"; + // + // openImage + // + this.openImage.Filter = "Image Files|*.bmp;*.png;*.jpg|All Files|*.*"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 13, 17 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 81, 12 ); + this.label2.TabIndex = 7; + this.label2.Text = "繧ュ繝」繝ゥ繧ッ繧ソ縺ョ蜷榊燕"; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point( 100, 14 ); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 103, 19 ); + this.textBox1.TabIndex = 0; + this.textBox1.Text = "(character name)"; + this.textBox1.TextChanged += new System.EventHandler( this.textBox1_TextChanged ); + // + // listView1 + // + this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView1.CheckBoxes = true; + this.listView1.Columns.AddRange( new System.Windows.Forms.ColumnHeader[] { + this.columnTitle, + this.columnTag} ); + this.listView1.ContextMenuStrip = this.mstripImage; + this.listView1.Location = new System.Drawing.Point( 15, 51 ); + this.listView1.MultiSelect = false; + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size( 188, 256 ); + this.listView1.TabIndex = 1; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler( this.listView1_ItemChecked ); + this.listView1.SelectedIndexChanged += new System.EventHandler( this.listView1_SelectedIndexChanged ); + // + // columnTitle + // + this.columnTitle.Text = "逕サ蜒丞錐"; + this.columnTitle.Width = 130; + // + // columnTag + // + this.columnTag.Text = "繧ソ繧ー"; + this.columnTag.Width = 50; + // + // btnDown + // + this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnDown.Location = new System.Drawing.Point( 81, 324 ); + this.btnDown.Name = "btnDown"; + this.btnDown.Size = new System.Drawing.Size( 60, 23 ); + this.btnDown.TabIndex = 3; + this.btnDown.Text = "荳"; + this.btnDown.UseVisualStyleBackColor = true; + this.btnDown.Click += new System.EventHandler( this.btnDown_Click ); + // + // btnUp + // + this.btnUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnUp.Location = new System.Drawing.Point( 15, 324 ); + this.btnUp.Name = "btnUp"; + this.btnUp.Size = new System.Drawing.Size( 60, 23 ); + this.btnUp.TabIndex = 2; + this.btnUp.Text = "荳"; + this.btnUp.UseVisualStyleBackColor = true; + this.btnUp.Click += new System.EventHandler( this.btnUp_Click ); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add( this.lblThisTitle ); + this.groupBox1.Controls.Add( this.txtTag ); + this.groupBox1.Controls.Add( this.lblTag ); + this.groupBox1.Controls.Add( this.lblTitle ); + this.groupBox1.Controls.Add( this.picturePreview ); + this.groupBox1.Location = new System.Drawing.Point( 4, 4 ); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size( 194, 303 ); + this.groupBox1.TabIndex = 14; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "驕ク謚槭&繧後◆逕サ蜒"; + // + // lblThisTitle + // + this.lblThisTitle.AutoSize = true; + this.lblThisTitle.Location = new System.Drawing.Point( 58, 27 ); + this.lblThisTitle.Name = "lblThisTitle"; + this.lblThisTitle.Size = new System.Drawing.Size( 0, 12 ); + this.lblThisTitle.TabIndex = 9; + // + // txtTag + // + this.txtTag.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtTag.Location = new System.Drawing.Point( 58, 52 ); + this.txtTag.Name = "txtTag"; + this.txtTag.Size = new System.Drawing.Size( 130, 19 ); + this.txtTag.TabIndex = 5; + this.txtTag.TextChanged += new System.EventHandler( this.txtTag_TextChanged ); + // + // lblTag + // + this.lblTag.AutoSize = true; + this.lblTag.Location = new System.Drawing.Point( 11, 55 ); + this.lblTag.Name = "lblTag"; + this.lblTag.Size = new System.Drawing.Size( 22, 12 ); + this.lblTag.TabIndex = 6; + this.lblTag.Text = "繧ソ繧ー"; + // + // lblTitle + // + this.lblTitle.AutoSize = true; + this.lblTitle.Location = new System.Drawing.Point( 11, 27 ); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size( 41, 12 ); + this.lblTitle.TabIndex = 3; + this.lblTitle.Text = "逕サ蜒丞錐"; + // + // picturePreview + // + this.picturePreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.picturePreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picturePreview.ContextMenuStrip = this.mstripImage; + this.picturePreview.Location = new System.Drawing.Point( 6, 77 ); + this.picturePreview.Name = "picturePreview"; + this.picturePreview.Size = new System.Drawing.Size( 182, 220 ); + this.picturePreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.picturePreview.TabIndex = 5; + this.picturePreview.TabStop = false; + this.picturePreview.DoubleClick += new System.EventHandler( this.picturePreview_DoubleClick ); + this.picturePreview.MouseClick += new System.Windows.Forms.MouseEventHandler( this.pictureBox1_MouseClick ); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = false; + this.splitContainer1.Location = new System.Drawing.Point( 0, 24 ); + this.splitContainer1.Margin = new System.Windows.Forms.Padding( 0 ); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // + // + this.splitContainer1.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Panel1.BorderColor = System.Drawing.SystemColors.ControlDark; + this.splitContainer1.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer1.Panel1.Controls.Add( this.label2 ); + this.splitContainer1.Panel1.Controls.Add( this.btnAdd ); + this.splitContainer1.Panel1.Controls.Add( this.textBox1 ); + this.splitContainer1.Panel1.Controls.Add( this.btnDown ); + this.splitContainer1.Panel1.Controls.Add( this.listView1 ); + this.splitContainer1.Panel1.Controls.Add( this.btnUp ); + this.splitContainer1.Panel1.Location = new System.Drawing.Point( 1, 1 ); + this.splitContainer1.Panel1.Margin = new System.Windows.Forms.Padding( 0, 0, 0, 4 ); + this.splitContainer1.Panel1.Name = "m_panel1"; + this.splitContainer1.Panel1.Padding = new System.Windows.Forms.Padding( 1 ); + this.splitContainer1.Panel1.Size = new System.Drawing.Size( 208, 369 ); + this.splitContainer1.Panel1.TabIndex = 0; + this.splitContainer1.Panel1MinSize = 210; + // + // + // + this.splitContainer1.Panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Panel2.BorderColor = System.Drawing.SystemColors.ControlDark; + this.splitContainer1.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer1.Panel2.Controls.Add( this.groupBox1 ); + this.splitContainer1.Panel2.Controls.Add( this.btnOK ); + this.splitContainer1.Panel2.Controls.Add( this.btnCancel ); + this.splitContainer1.Panel2.Location = new System.Drawing.Point( 215, 1 ); + this.splitContainer1.Panel2.Margin = new System.Windows.Forms.Padding( 0 ); + this.splitContainer1.Panel2.Name = "m_panel2"; + this.splitContainer1.Panel2.Padding = new System.Windows.Forms.Padding( 1 ); + this.splitContainer1.Panel2.Size = new System.Drawing.Size( 206, 369 ); + this.splitContainer1.Panel2.TabIndex = 1; + this.splitContainer1.Panel2MinSize = 25; + this.splitContainer1.Size = new System.Drawing.Size( 422, 371 ); + this.splitContainer1.SplitterDistance = 210; + this.splitContainer1.SplitterWidth = 4; + this.splitContainer1.TabIndex = 10; + this.splitContainer1.TabStop = false; + // + // bgWork + // + this.bgWork.WorkerSupportsCancellation = true; + this.bgWork.DoWork += new System.ComponentModel.DoWorkEventHandler( this.bgWork_DoWork ); + this.bgWork.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler( this.bgWork_RunWorkerCompleted ); + // + // GenerateCharacter + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 422, 395 ); + this.Controls.Add( this.splitContainer1 ); + this.Controls.Add( this.menuStrip1 ); + this.MainMenuStrip = this.menuStrip1; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size( 402, 327 ); + this.Name = "GenerateCharacter"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "繧ュ繝」繝ゥ繧ッ繧ソ繧堤キィ髮"; + this.Load += new System.EventHandler( this.GenerateCharacter_Load ); + this.DragDrop += new System.Windows.Forms.DragEventHandler( this.GenerateCharacter_DragDrop ); + this.DragEnter += new System.Windows.Forms.DragEventHandler( this.GenerateCharacter_DragEnter ); + this.mstripImage.ResumeLayout( false ); + this.menuStrip1.ResumeLayout( false ); + this.menuStrip1.PerformLayout(); + this.groupBox1.ResumeLayout( false ); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picturePreview)).EndInit(); + this.splitContainer1.Panel1.ResumeLayout( false ); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout( false ); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.PictureBox picturePreview; + private System.Windows.Forms.OpenFileDialog openLsc; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem menuFile; + private System.Windows.Forms.ToolStripMenuItem menuFileOpen; + private System.Windows.Forms.ToolStripMenuItem menuFileSave; + private System.Windows.Forms.SaveFileDialog saveLsc; + private System.Windows.Forms.OpenFileDialog openImage; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.ContextMenuStrip mstripImage; + private System.Windows.Forms.ToolStripMenuItem menuSetImage; + private System.Windows.Forms.ToolStripMenuItem menuTransparent; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnTitle; + private System.Windows.Forms.ColumnHeader columnTag; + private System.Windows.Forms.Button btnDown; + private System.Windows.Forms.Button btnUp; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.TextBox txtTag; + private System.Windows.Forms.Label lblTag; + private System.Windows.Forms.Label lblThisTitle; + private System.Windows.Forms.ToolStripMenuItem menuEditTitle; + private System.Windows.Forms.ToolStripMenuItem menuDelete; + //private System.Windows.Forms.SplitContainer splitContainer1; + private Boare.Lib.AppUtil.BSplitContainer splitContainer1; + private System.Windows.Forms.ToolStripMenuItem menuReset; + private System.Windows.Forms.OpenFileDialog openRsi; + private System.Windows.Forms.SaveFileDialog saveRsi; + private System.ComponentModel.BackgroundWorker bgWork; + private System.Windows.Forms.ToolStripMenuItem menuEdit; + private System.Windows.Forms.ToolStripMenuItem menuEditSetImage; + private System.Windows.Forms.ToolStripMenuItem menuEditTransparent; + private System.Windows.Forms.ToolStripMenuItem menuEditEditTitle; + private System.Windows.Forms.ToolStripMenuItem menuEditDelete; + private System.Windows.Forms.ToolStripMenuItem menuEditReset; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem menuEditUp; + private System.Windows.Forms.ToolStripMenuItem menuEditDown; + private System.Windows.Forms.ToolStripMenuItem menuEditAdd; + private System.Windows.Forms.ToolStripMenuItem menuEditDebugEditVersionInfo; + private System.Windows.Forms.ToolStripMenuItem menuFileExport; + private System.Windows.Forms.ToolStripMenuItem menuFileImport; + private System.Windows.Forms.ToolStripMenuItem menuFileImportRsi; + private System.Windows.Forms.ToolStripMenuItem menuFileExportRsi; + private System.Windows.Forms.ToolStripMenuItem menuFileExportXml; + + } + +} diff --git a/trunk/LipSync/Editor/IDrawObject.cs b/trunk/LipSync/Editor/IDrawObject.cs new file mode 100644 index 0000000..64c65b2 --- /dev/null +++ b/trunk/LipSync/Editor/IDrawObject.cs @@ -0,0 +1,49 @@ +サソ/* + * IDrawObject.cs + * Copyright (c) 2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.ComponentModel; + +namespace LipSync { + + public interface IDrawObject { + [Browsable( false )] + int ZOrder { + get; + set; + } + + bool PositionFixed { + get; + set; + } + + PointF GetPosition( float time ); + + float GetScale( float time ); + + float GetAlpha( float time ); + + float GetRotate( float time ); + + bool IsXFixedAt( float time ); + + bool IsYFixedAt( float time ); + + Size ImageSize { + get; + } + } + +} diff --git a/trunk/LipSync/Editor/IMultiLanguageControl.cs b/trunk/LipSync/Editor/IMultiLanguageControl.cs new file mode 100644 index 0000000..74b3be5 --- /dev/null +++ b/trunk/LipSync/Editor/IMultiLanguageControl.cs @@ -0,0 +1,24 @@ +サソ/* + * IMultiLanguageControl.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; + +namespace LipSync { + + interface IMultiLanguageControl { + void ApplyLanguage(); + void ApplyFont( Font font ); + } + +} diff --git a/trunk/LipSync/Editor/ImageEntry.cs b/trunk/LipSync/Editor/ImageEntry.cs new file mode 100644 index 0000000..d065e33 --- /dev/null +++ b/trunk/LipSync/Editor/ImageEntry.cs @@ -0,0 +1,196 @@ +サソ/* + * ImageEntry.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Runtime.Serialization; +using System.Xml.Serialization; + +namespace LipSync { + + [Serializable] + public class ImageEntry : IComparable, ICloneable { + [XmlElement("Title")] + public string title; + [XmlIgnore] + Image image; + [XmlElement("Tag")] + public string tag; + [OptionalField] + bool is_default; + [OptionalField, XmlIgnore] + int xoffset; + [OptionalField, XmlIgnore] + int yoffset; + [OptionalField] + int m_zorder; + + public ImageEntry( string title, Image image, string tag, bool is_default ) { + this.title = title; + if ( image != null ) { + this.image = (Image)image.Clone(); + } else { + this.image = null; + } + this.tag = tag; + this.IsDefault = is_default; + m_zorder = 0; + } + + public ImageEntry( string title, Image image, string tag, bool is_default, int zorder ) + : this( title, image, tag, is_default ) { + m_zorder = zorder; + } + + private ImageEntry() { + title = ""; + image = null; + tag = ""; + is_default = false; + xoffset = 0; + yoffset = 0; + m_zorder = 0; + } + + public Image Image { + get { + return image; + } + } + + public override string ToString() { + if ( image != null ) { + return "title=" + title + ";tag=" + tag + ";image.width=" + image.Width + ";image.height=" + image.Height + ";xoffset=" + xoffset + ";yoffset=" + yoffset + ";z=" + m_zorder; + } else { + return "title=" + title + ";tag=" + tag + ";image=null;xoffset=" + xoffset + ";yoffset=" + yoffset + ";z=" + m_zorder; + } + } + + public int XOffset { + get { + return xoffset; + } + } + + public int YOffset { + get { + return yoffset; + } + } + + public void ResetImage() { + if ( image != null ) { + image = null; + xoffset = 0; + yoffset = 0; + } + } + + public Bitmap GetImage() { + if ( image != null ) { + int width = xoffset + image.Width; + int height = yoffset + image.Height; + return GetImage( width, height ); + } else { + return null; + } + } + + public Bitmap GetImage( Size size ) { + return GetImage( size.Width, size.Height ); + } + + public Bitmap GetImage( int width, int height ) { + Bitmap res = new Bitmap( width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ); + using ( Graphics g = Graphics.FromImage( res ) ) { + this.DrawTo( g ); + } + return res; + } + + public void DrawTo( Graphics g ) { + if ( image != null ) { + g.DrawImage( image, xoffset, yoffset, image.Width, image.Height ); + } + } + + public void SetImage( Image img ) { + if ( img == null ) { + return; + } + Bitmap t = new Bitmap( img ); + Rectangle rc = Common.GetNonTransparentRegion( t ); +#if DEBUG + Common.DebugWriteLine( "ImageEntry.SetImage; rc=" + rc ); +#endif + if ( image != null ) { + image = null; + } + image = new Bitmap( rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ); + using ( Graphics g = Graphics.FromImage( image ) ) { + g.DrawImage( img, 0, 0, rc, GraphicsUnit.Pixel ); + } + xoffset = rc.X; + yoffset = rc.Y; + } + + public int CompareTo( ImageEntry item ) { + if ( this.Z > item.Z ) { + return 1; + } else if ( this.Z < item.Z ) { + return -1; + } else { + return 0; + } + } + + [XmlElement("FileId")] + public int Z { + get { + return m_zorder; + } + set { + m_zorder = value; + } + } + + public bool IsDefault { + get { + return is_default; + } + set { + is_default = value; + } + } + + [OnDeserializing] + private void onDeserializing( StreamingContext sc ) { + IsDefault = false; + xoffset = 0; + yoffset = 0; + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { + } + + public object Clone() { + ImageEntry result = new ImageEntry( title, image, tag, is_default ); + result.xoffset = this.xoffset; + result.yoffset = this.yoffset; + result.m_zorder = this.m_zorder; + return result; + } + } + +} diff --git a/trunk/LipSync/Editor/InputBox.cs b/trunk/LipSync/Editor/InputBox.cs new file mode 100644 index 0000000..737a15e --- /dev/null +++ b/trunk/LipSync/Editor/InputBox.cs @@ -0,0 +1,53 @@ +サソ/* + * InputBox.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace LipSync { + + public partial class InputBox : Form, IMultiLanguageControl { + public InputBox( string title, string message ) { + InitializeComponent(); + ApplyFont( AppManager.Config.Font.GetFont() ); + this.message.Text = message; + this.Text = title; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + } + + public string rText { + get{ + return input.Text; + } + set { + input.Text = value; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + this.Close(); + } + } + +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/InputBox.designer.cs b/trunk/LipSync/Editor/InputBox.designer.cs new file mode 100644 index 0000000..70b4456 --- /dev/null +++ b/trunk/LipSync/Editor/InputBox.designer.cs @@ -0,0 +1,113 @@ +サソ/* + * InputBox.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class InputBox { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.message = new System.Windows.Forms.Label(); + this.input = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 114, 73 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 1; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 208, 73 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // message + // + this.message.AutoEllipsis = true; + this.message.AutoSize = true; + this.message.Location = new System.Drawing.Point( 12, 9 ); + this.message.Name = "message"; + this.message.Size = new System.Drawing.Size( 50, 12 ); + this.message.TabIndex = 2; + this.message.Text = "message"; + // + // input + // + this.input.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.input.Location = new System.Drawing.Point( 29, 35 ); + this.input.Name = "input"; + this.input.Size = new System.Drawing.Size( 254, 19 ); + this.input.TabIndex = 0; + // + // InputBox + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 298, 113 ); + this.Controls.Add( this.input ); + this.Controls.Add( this.message ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "InputBox"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "InputBox"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label message; + private System.Windows.Forms.TextBox input; + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/Item.cs b/trunk/LipSync/Editor/Item.cs new file mode 100644 index 0000000..b303e61 --- /dev/null +++ b/trunk/LipSync/Editor/Item.cs @@ -0,0 +1,35 @@ +サソ/* + * Item.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + /// + /// + /// + public struct Item { + public TimeTableType type; + public int group; + public int track; + public int entry; + public int row_index; + + public Item( TimeTableType type, int group, int track, int entry, int row_index ) { + this.type = type; + this.group = group; + this.track = track; + this.entry = entry; + this.row_index = row_index; + } + } + +} diff --git a/trunk/LipSync/Editor/MListView.Designer.cs b/trunk/LipSync/Editor/MListView.Designer.cs new file mode 100644 index 0000000..84d4fda --- /dev/null +++ b/trunk/LipSync/Editor/MListView.Designer.cs @@ -0,0 +1,97 @@ +サソ/* + * MListView.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class MListView { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region 繧ウ繝ウ繝昴シ繝阪Φ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); + System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem( "dumyitem" ); + this.listView1 = new System.Windows.Forms.ListView(); + this.listView2 = new System.Windows.Forms.ListView(); + this.SuspendLayout(); + // + // listView1 + // + this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + listViewGroup1.Header = "ListViewGroup"; + listViewGroup1.Name = "titleGroup"; + this.listView1.Groups.AddRange( new System.Windows.Forms.ListViewGroup[] { + listViewGroup1} ); + listViewItem1.Group = listViewGroup1; + this.listView1.Items.AddRange( new System.Windows.Forms.ListViewItem[] { + listViewItem1} ); + this.listView1.Location = new System.Drawing.Point( 0, 0 ); + this.listView1.Name = "listView1"; + this.listView1.OwnerDraw = true; + this.listView1.Scrollable = false; + this.listView1.Size = new System.Drawing.Size( 360, 26 ); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // listView2 + // + this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listView2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView2.CheckBoxes = true; + this.listView2.Location = new System.Drawing.Point( 0, 24 ); + this.listView2.Name = "listView2"; + this.listView2.Size = new System.Drawing.Size( 360, 83 ); + this.listView2.TabIndex = 1; + this.listView2.UseCompatibleStateImageBehavior = false; + this.listView2.View = System.Windows.Forms.View.SmallIcon; + // + // MListView + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.listView2 ); + this.Controls.Add( this.listView1 ); + this.Name = "MListView"; + this.Size = new System.Drawing.Size( 360, 107 ); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ListView listView2; + } +} diff --git a/trunk/LipSync/Editor/MListView.cs b/trunk/LipSync/Editor/MListView.cs new file mode 100644 index 0000000..7b45efe --- /dev/null +++ b/trunk/LipSync/Editor/MListView.cs @@ -0,0 +1,71 @@ +サソ/* + * MListView.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System.Drawing; +using System.Windows.Forms; + +namespace LipSync { + + public partial class MListView : UserControl { + private Color m_back_color = SystemColors.Window; + + public MListView() { + InitializeComponent(); + } + + public ListView.ListViewItemCollection Items { + get { + return listView2.Items; + } + } + + public bool CheckBoxes { + get { + return listView2.CheckBoxes; + } + set { + listView2.CheckBoxes = value; + } + } + + new public Color BackColor { + get { + return m_back_color; + } + set { + m_back_color = value; + listView1.BackColor = m_back_color; + listView2.BackColor = m_back_color; + } + } + + public string Header { + get { + return listView1.Groups[0].Header; + } + set { + listView1.Groups[0].Header = value; + } + } + + public HorizontalAlignment HeaderAlignment { + get { + return listView1.Groups[0].HeaderAlignment; + } + set { + listView1.Groups[0].HeaderAlignment = value; + } + } + } + +} diff --git a/trunk/LipSync/Editor/PasteModeDialog.Designer.cs b/trunk/LipSync/Editor/PasteModeDialog.Designer.cs new file mode 100644 index 0000000..2cbb014 --- /dev/null +++ b/trunk/LipSync/Editor/PasteModeDialog.Designer.cs @@ -0,0 +1,114 @@ +/* + * PasteModeDialog.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class PasteModeDialog { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnInterrupt = new System.Windows.Forms.Button(); + this.btnOverwrite = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnInterrupt + // + this.btnInterrupt.Location = new System.Drawing.Point( 12, 56 ); + this.btnInterrupt.Name = "btnInterrupt"; + this.btnInterrupt.Size = new System.Drawing.Size( 88, 23 ); + this.btnInterrupt.TabIndex = 6; + this.btnInterrupt.Text = "蜑イ繧願セシ縺セ縺帙k"; + this.btnInterrupt.UseVisualStyleBackColor = true; + this.btnInterrupt.Click += new System.EventHandler( this.btnInterrupt_Click ); + // + // btnOverwrite + // + this.btnOverwrite.Location = new System.Drawing.Point( 119, 56 ); + this.btnOverwrite.Name = "btnOverwrite"; + this.btnOverwrite.Size = new System.Drawing.Size( 88, 23 ); + this.btnOverwrite.TabIndex = 7; + this.btnOverwrite.Text = "荳頑嶌縺"; + this.btnOverwrite.UseVisualStyleBackColor = true; + this.btnOverwrite.Click += new System.EventHandler( this.btnOverwrite_Click ); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 226, 56 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 88, 23 ); + this.btnCancel.TabIndex = 8; + this.btnCancel.Text = "繧ュ繝」繝ウ繧サ繝ォ"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler( this.btnCancel_Click ); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 22, 23 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 151, 12 ); + this.label1.TabIndex = 9; + this.label1.Text = "雋シ莉倥¢繝「繝シ繝峨r謖螳壹@縺ヲ縺上□縺輔>"; + // + // PasteModeDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 329, 107 ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOverwrite ); + this.Controls.Add( this.btnInterrupt ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "PasteModeDialog"; + this.ShowInTaskbar = false; + this.Text = "PasteMode"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnInterrupt; + private System.Windows.Forms.Button btnOverwrite; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label1; + } +} diff --git a/trunk/LipSync/Editor/PasteModeDialog.cs b/trunk/LipSync/Editor/PasteModeDialog.cs new file mode 100644 index 0000000..f48e14c --- /dev/null +++ b/trunk/LipSync/Editor/PasteModeDialog.cs @@ -0,0 +1,77 @@ +サソ/* + * PasteModeDialog.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public enum PasteModeDialogResult { + Interrupt, + Overwrite, + Cancel, + } + + public partial class PasteModeDialog : Form, IMultiLanguageControl { + PasteModeDialogResult m_result = PasteModeDialogResult.Cancel; + + public PasteModeDialog() { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.label1.Text = gettext( "Specify paste mode" ); + this.btnCancel.Text = gettext( "Cancel" ); + this.btnInterrupt.Text = gettext( "Interrupt" ); + this.btnOverwrite.Text = gettext( "Overwrite" ); + } + + public static string gettext( string s ) { + return Messaging.GetMessage( s ); + } + + new public PasteModeDialogResult DialogResult { + get { + return m_result; + } + } + + private void btnCancel_Click( object sender, EventArgs e ) { + this.m_result = PasteModeDialogResult.Cancel; + this.Close(); + } + + private void btnInterrupt_Click( object sender, EventArgs e ) { + this.m_result = PasteModeDialogResult.Interrupt; + this.Close(); + } + + private void btnOverwrite_Click( object sender, EventArgs e ) { + this.m_result = PasteModeDialogResult.Overwrite; + this.Close(); + } + } + +} diff --git a/trunk/LipSync/Editor/PluginConfig.cs b/trunk/LipSync/Editor/PluginConfig.cs new file mode 100644 index 0000000..528690d --- /dev/null +++ b/trunk/LipSync/Editor/PluginConfig.cs @@ -0,0 +1,39 @@ +サソ/* + * PluginConfig.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + [Serializable] + public class PluginConfig { + public string ID; + public string Config; + public PluginConfig() { + ID = ""; + Config = ""; + } + public PluginConfig Clone() { + return new PluginConfig( ID, Config ); + } + public PluginConfig( string name, string config, string filename ) { + ID = name + "@" + filename; + Config = config; + } + public PluginConfig( string id, string config ) { + ID = id; + Config = config; + } + } + +} diff --git a/trunk/LipSync/Editor/PluginInfo.cs b/trunk/LipSync/Editor/PluginInfo.cs new file mode 100644 index 0000000..3a6b3b1 --- /dev/null +++ b/trunk/LipSync/Editor/PluginInfo.cs @@ -0,0 +1,142 @@ +サソ/* + * PluginInfo.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.IO; + +using Plugin; + +namespace LipSync { + + /// + /// 繝励Λ繧ー繧、繝ウ縺ォ髢「縺吶k諠蝣ア + /// + public class PluginInfo : ICloneable { + private string _location; + private string _className; + private IPlugin _instance = null; + private string _id; + + public object Clone() { + return new PluginInfo( _location, _className ); + } + + /// + /// PluginInfo繧ッ繝ゥ繧ケ縺ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 繧「繧サ繝ウ繝悶Μ繝輔ぃ繧、繝ォ縺ョ繝代せ + /// 繧ッ繝ゥ繧ケ縺ョ蜷榊燕 + private PluginInfo( string path, string full_name ) { + this._location = path; + this._className = full_name; + this._id = this.Instance.Name + "@" + Path.GetFileName( path ); + } + + public string ID { + get { + return _id; + } + } + + public IPlugin Instance { + get { + if ( _instance == null ) { + _instance = CreateInstance(); + } + return _instance; + } + } + + /// + /// 繧「繧サ繝ウ繝悶Μ繝輔ぃ繧、繝ォ縺ョ繝代せ + /// + public string Location { + get { + return _location; + } + } + + /// + /// 繧ッ繝ゥ繧ケ縺ョ蜷榊燕 + /// + public string ClassName { + get { + return _className; + } + } + + /// + /// 譛牙柑縺ェ繝励Λ繧ー繧、繝ウ繧呈爾縺 + /// + /// 譛牙柑縺ェ繝励Λ繧ー繧、繝ウ縺ョPluginInfo驟榊 + public static PluginInfo[] FindPlugins() { + System.Collections.ArrayList plugins = + new System.Collections.ArrayList(); + //IPlugin蝙九ョ蜷榊燕 + string ipluginName = typeof( Plugin.IPlugin ).FullName; + + //繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 + string folder = System.IO.Path.GetDirectoryName( + System.Reflection.Assembly + .GetExecutingAssembly().Location ); + /*folder += "\\plugins"; + if ( !System.IO.Directory.Exists( folder ) ) + throw new ApplicationException( + "繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝\"" + folder + + "\"縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲" );*/ + + //.dll繝輔ぃ繧、繝ォ繧呈爾縺 + string[] dlls = + System.IO.Directory.GetFiles( folder, "*.dll" ); + + foreach ( string dll in dlls ) { + try { + //繧「繧サ繝ウ繝悶Μ縺ィ縺励※隱ュ縺ソ霎シ繧 + System.Reflection.Assembly asm = + System.Reflection.Assembly.LoadFrom( dll ); + foreach ( Type t in asm.GetTypes() ) { + //繧「繧サ繝ウ繝悶Μ蜀縺ョ縺吶∋縺ヲ縺ョ蝙九↓縺、縺縺ヲ縲 + //繝励Λ繧ー繧、繝ウ縺ィ縺励※譛牙柑縺玖ェソ縺ケ繧 + if ( t.IsClass && t.IsPublic && !t.IsAbstract && + t.GetInterface( ipluginName ) != null ) { + //PluginInfo繧偵さ繝ャ繧ッ繧キ繝ァ繝ウ縺ォ霑ス蜉縺吶k + plugins.Add( new PluginInfo( dll, t.FullName ) ); + } + } + } catch { + } + } + + //繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧帝榊励↓縺励※霑斐☆ + return (PluginInfo[])plugins.ToArray( typeof( PluginInfo ) ); + } + + /// + /// 繝励Λ繧ー繧、繝ウ繧ッ繝ゥ繧ケ縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧剃ス懈舌☆繧 + /// + /// 繝励Λ繧ー繧、繝ウ繧ッ繝ゥ繧ケ縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ + private IPlugin CreateInstance() { + try { + //繧「繧サ繝ウ繝悶Μ繧定ェュ縺ソ霎シ繧 + System.Reflection.Assembly asm = + System.Reflection.Assembly.LoadFrom( this.Location ); + //繧ッ繝ゥ繧ケ蜷阪°繧峨う繝ウ繧ケ繧ソ繝ウ繧ケ繧剃ス懈舌☆繧 + return (Plugin.IPlugin) + asm.CreateInstance( this.ClassName ); + } catch { + return null; + } + } + } + +} diff --git a/trunk/LipSync/Editor/Position.cs b/trunk/LipSync/Editor/Position.cs new file mode 100644 index 0000000..f554999 --- /dev/null +++ b/trunk/LipSync/Editor/Position.cs @@ -0,0 +1,47 @@ +サソ/* + * Position.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System.ComponentModel; + +namespace LipSync { + + [TypeConverter( typeof( PositionConverter ) )] + public class Position { + private float m_x = 0f; + private float m_y = 0f; + + public Position( float x, float y ) { + m_x = x; + m_y = y; + } + + public float X { + get { + return m_x; + } + set { + m_x = value; + } + } + + public float Y { + get { + return m_y; + } + set { + m_y = value; + } + } + } + +} diff --git a/trunk/LipSync/Editor/PositionConverter.cs b/trunk/LipSync/Editor/PositionConverter.cs new file mode 100644 index 0000000..694f687 --- /dev/null +++ b/trunk/LipSync/Editor/PositionConverter.cs @@ -0,0 +1,67 @@ +サソ/* + * PositionConverter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.ComponentModel; + +namespace LipSync { + + public class PositionConverter : ExpandableObjectConverter { + //繧ウ繝ウ繝舌シ繧ソ縺後が繝悶ず繧ァ繧ッ繝医r謖螳壹@縺溷梛縺ォ螟画鋤縺ァ縺阪k縺 + //シ亥、画鋤縺ァ縺阪k譎ゅッTrue繧定ソ斐☆シ + //縺薙%縺ァ縺ッ縲,ustomClass蝙九ョ繧ェ繝悶ず繧ァ繧ッ繝医↓縺ッ螟画鋤蜿ッ閭ス縺ィ縺吶k + public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType ) { + if ( destinationType == typeof( Position ) ) { + return true; + } + return base.CanConvertTo( context, destinationType ); + } + + //謖螳壹@縺溷、繧ェ繝悶ず繧ァ繧ッ繝医r縲∵欠螳壹@縺溷梛縺ォ螟画鋤縺吶k + //CustomClass蝙九ョ繧ェ繝悶ず繧ァ繧ッ繝医rString蝙九↓螟画鋤縺吶k譁ケ豕輔r謠蝉セ帙☆繧 + public override object ConvertTo( ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType ) { + if ( destinationType == typeof( string ) && value is Position ) { + Position cc = (Position)value; + return cc.X + ", " + cc.Y; + } + return base.ConvertTo( context, culture, value, destinationType ); + } + + //繧ウ繝ウ繝舌シ繧ソ縺檎音螳壹ョ蝙九ョ繧ェ繝悶ず繧ァ繧ッ繝医r繧ウ繝ウ繝舌シ繧ソ縺ョ蝙九↓螟画鋤縺ァ縺阪k縺 + //シ亥、画鋤縺ァ縺阪k譎ゅッTrue繧定ソ斐☆シ + //縺薙%縺ァ縺ッ縲ヾtring蝙九ョ繧ェ繝悶ず繧ァ繧ッ繝医↑繧牙、画鋤蜿ッ閭ス縺ィ縺吶k + public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType ) { + if ( sourceType == typeof( string ) ) { + return true; + } + return base.CanConvertFrom( context, sourceType ); + } + + //謖螳壹@縺溷、繧偵さ繝ウ繝舌シ繧ソ縺ョ蝙九↓螟画鋤縺吶k + //String蝙九ョ繧ェ繝悶ず繧ァ繧ッ繝医rCustomClass蝙九↓螟画鋤縺吶k譁ケ豕輔r謠蝉セ帙☆繧 + public override object ConvertFrom( ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value ) { + if ( value is string ) { + string[] ss = value.ToString().Split( new char[] { ',' }, 2 ); + Position cc = new Position( 0f, 0f ); + try { + cc.X = float.Parse( ss[0] ); + cc.Y = float.Parse( ss[1] ); + } catch { + } + return cc; + } + return base.ConvertFrom( context, culture, value ); + } + } + +} diff --git a/trunk/LipSync/Editor/Previewer.Designer.cs b/trunk/LipSync/Editor/Previewer.Designer.cs new file mode 100644 index 0000000..f66c6a9 --- /dev/null +++ b/trunk/LipSync/Editor/Previewer.Designer.cs @@ -0,0 +1,328 @@ +/* + * Previewer.Designer.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class Previewer { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region 繧ウ繝ウ繝昴シ繝阪Φ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.panel1 = new System.Windows.Forms.Panel(); + this.btnSpeed = new System.Windows.Forms.Button(); + this.checkMute = new System.Windows.Forms.CheckBox(); + this.lblSpeed = new System.Windows.Forms.Label(); + this.trackSpeed = new System.Windows.Forms.TrackBar(); + this.play_pause = new System.Windows.Forms.Button(); + this.trackVolume = new System.Windows.Forms.TrackBar(); + this.stop = new System.Windows.Forms.Button(); + this.trackBar1 = new System.Windows.Forms.TrackBar(); + this.lblTime = new System.Windows.Forms.Label(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip( this.components ); + this.menuHundred = new System.Windows.Forms.ToolStripMenuItem(); + this.menuFit = new System.Windows.Forms.ToolStripMenuItem(); + this.menuSet = new System.Windows.Forms.ToolStripMenuItem(); + this.panel2 = new System.Windows.Forms.Panel(); + this.PreviewP = new System.Windows.Forms.PictureBox(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackSpeed)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackVolume)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); + this.contextMenuStrip1.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.PreviewP)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.panel1.BackColor = System.Drawing.Color.DarkGray; + this.panel1.Controls.Add( this.btnSpeed ); + this.panel1.Controls.Add( this.checkMute ); + this.panel1.Controls.Add( this.lblSpeed ); + this.panel1.Controls.Add( this.trackSpeed ); + this.panel1.Controls.Add( this.play_pause ); + this.panel1.Controls.Add( this.trackVolume ); + this.panel1.Controls.Add( this.stop ); + this.panel1.Location = new System.Drawing.Point( 0, 0 ); + this.panel1.Margin = new System.Windows.Forms.Padding( 0 ); + this.panel1.MinimumSize = new System.Drawing.Size( 82, 0 ); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size( 82, 389 ); + this.panel1.TabIndex = 13; + // + // btnSpeed + // + this.btnSpeed.BackColor = System.Drawing.SystemColors.Control; + this.btnSpeed.Location = new System.Drawing.Point( 2, 81 ); + this.btnSpeed.Name = "btnSpeed"; + this.btnSpeed.Size = new System.Drawing.Size( 36, 24 ); + this.btnSpeed.TabIndex = 17; + this.btnSpeed.Text = "spd."; + this.btnSpeed.UseVisualStyleBackColor = false; + this.btnSpeed.Click += new System.EventHandler( this.btnSpeed_Click ); + // + // checkMute + // + this.checkMute.Appearance = System.Windows.Forms.Appearance.Button; + this.checkMute.BackColor = System.Drawing.SystemColors.Control; + this.checkMute.Location = new System.Drawing.Point( 42, 81 ); + this.checkMute.Name = "checkMute"; + this.checkMute.Size = new System.Drawing.Size( 36, 24 ); + this.checkMute.TabIndex = 16; + this.checkMute.Text = "vol."; + this.checkMute.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.checkMute.UseVisualStyleBackColor = false; + this.checkMute.CheckedChanged += new System.EventHandler( this.checkMute_CheckedChanged ); + // + // lblSpeed + // + this.lblSpeed.Location = new System.Drawing.Point( 3, 222 ); + this.lblSpeed.Name = "lblSpeed"; + this.lblSpeed.Size = new System.Drawing.Size( 35, 21 ); + this.lblSpeed.TabIndex = 15; + this.lblSpeed.Text = "x1.0"; + this.lblSpeed.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // trackSpeed + // + this.trackSpeed.AutoSize = false; + this.trackSpeed.BackColor = System.Drawing.Color.DarkGray; + this.trackSpeed.Location = new System.Drawing.Point( 11, 105 ); + this.trackSpeed.Maximum = 1500; + this.trackSpeed.Minimum = 500; + this.trackSpeed.Name = "trackSpeed"; + this.trackSpeed.Orientation = System.Windows.Forms.Orientation.Vertical; + this.trackSpeed.Size = new System.Drawing.Size( 20, 114 ); + this.trackSpeed.TabIndex = 12; + this.trackSpeed.TickFrequency = 50; + this.trackSpeed.Value = 1000; + this.trackSpeed.Scroll += new System.EventHandler( this.trackSpeed_Scroll ); + this.trackSpeed.MouseUp += new System.Windows.Forms.MouseEventHandler( this.trackSpeed_MouseUp ); + // + // play_pause + // + this.play_pause.BackColor = System.Drawing.SystemColors.Control; + this.play_pause.Location = new System.Drawing.Point( 11, 9 ); + this.play_pause.Name = "play_pause"; + this.play_pause.Size = new System.Drawing.Size( 61, 22 ); + this.play_pause.TabIndex = 8; + this.play_pause.Text = "蜀咲函"; + this.play_pause.UseVisualStyleBackColor = false; + this.play_pause.Click += new System.EventHandler( this.play_pause_Click ); + // + // trackVolume + // + this.trackVolume.AutoSize = false; + this.trackVolume.BackColor = System.Drawing.Color.DarkGray; + this.trackVolume.Location = new System.Drawing.Point( 52, 105 ); + this.trackVolume.Maximum = 2000; + this.trackVolume.Name = "trackVolume"; + this.trackVolume.Orientation = System.Windows.Forms.Orientation.Vertical; + this.trackVolume.Size = new System.Drawing.Size( 20, 114 ); + this.trackVolume.SmallChange = 100; + this.trackVolume.TabIndex = 10; + this.trackVolume.TickFrequency = 100; + this.trackVolume.Value = 1000; + this.trackVolume.Scroll += new System.EventHandler( this.trackVolume_Scroll ); + // + // stop + // + this.stop.BackColor = System.Drawing.SystemColors.Control; + this.stop.Location = new System.Drawing.Point( 11, 39 ); + this.stop.Name = "stop"; + this.stop.Size = new System.Drawing.Size( 61, 22 ); + this.stop.TabIndex = 9; + this.stop.Text = "蛛懈ュ「"; + this.stop.UseVisualStyleBackColor = false; + this.stop.Click += new System.EventHandler( this.stop_Click ); + // + // trackBar1 + // + this.trackBar1.AutoSize = false; + this.trackBar1.Dock = System.Windows.Forms.DockStyle.Fill; + this.trackBar1.Location = new System.Drawing.Point( 0, 0 ); + this.trackBar1.Margin = new System.Windows.Forms.Padding( 0 ); + this.trackBar1.Name = "trackBar1"; + this.trackBar1.Size = new System.Drawing.Size( 559, 22 ); + this.trackBar1.TabIndex = 5; + this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None; + this.trackBar1.Scroll += new System.EventHandler( this.trackBar1_Scroll ); + // + // lblTime + // + this.lblTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblTime.BackColor = System.Drawing.Color.DarkGray; + this.lblTime.Location = new System.Drawing.Point( 82, 0 ); + this.lblTime.Margin = new System.Windows.Forms.Padding( 0 ); + this.lblTime.Name = "lblTime"; + this.lblTime.Size = new System.Drawing.Size( 477, 16 ); + this.lblTime.TabIndex = 18; + this.lblTime.Text = "0.0s"; + this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lblTime.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler( this.lblTime_MouseDoubleClick ); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuHundred, + this.menuFit, + this.menuSet} ); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.ShowImageMargin = false; + this.contextMenuStrip1.Size = new System.Drawing.Size( 120, 70 ); + // + // menuHundred + // + this.menuHundred.Name = "menuHundred"; + this.menuHundred.Size = new System.Drawing.Size( 119, 22 ); + this.menuHundred.Text = "100%"; + this.menuHundred.Click += new System.EventHandler( this.menuHundred_Click ); + // + // menuFit + // + this.menuFit.Name = "menuFit"; + this.menuFit.Size = new System.Drawing.Size( 119, 22 ); + this.menuFit.Text = "逕サ髱「縺ォ蜷医o縺帙k"; + this.menuFit.Click += new System.EventHandler( this.menuFit_Click ); + // + // menuSet + // + this.menuSet.Enabled = false; + this.menuSet.Name = "menuSet"; + this.menuSet.Size = new System.Drawing.Size( 119, 22 ); + this.menuSet.Text = "謖螳壹し繧、繧コ"; + // + // panel2 + // + this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel2.Controls.Add( this.PreviewP ); + this.panel2.Location = new System.Drawing.Point( 82, 17 ); + this.panel2.Margin = new System.Windows.Forms.Padding( 0 ); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size( 477, 372 ); + this.panel2.TabIndex = 19; + // + // PreviewP + // + this.PreviewP.ContextMenuStrip = this.contextMenuStrip1; + this.PreviewP.Dock = System.Windows.Forms.DockStyle.Fill; + this.PreviewP.Location = new System.Drawing.Point( 0, 0 ); + this.PreviewP.Margin = new System.Windows.Forms.Padding( 0 ); + this.PreviewP.Name = "PreviewP"; + this.PreviewP.Size = new System.Drawing.Size( 477, 372 ); + this.PreviewP.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.PreviewP.TabIndex = 4; + this.PreviewP.TabStop = false; + this.PreviewP.MouseMove += new System.Windows.Forms.MouseEventHandler( this.PreviewP_MouseMove ); + this.PreviewP.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler( this.PreviewP_MouseDoubleClick ); + this.PreviewP.MouseDown += new System.Windows.Forms.MouseEventHandler( this.PreviewP_MouseDown ); + this.PreviewP.Paint += new System.Windows.Forms.PaintEventHandler( this.PreviewP_Paint ); + this.PreviewP.MouseUp += new System.Windows.Forms.MouseEventHandler( this.PreviewP_MouseUp ); + this.PreviewP.SizeChanged += new System.EventHandler( this.PreviewP_SizeChanged ); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer1.Location = new System.Drawing.Point( 0, 0 ); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add( this.panel1 ); + this.splitContainer1.Panel1.Controls.Add( this.lblTime ); + this.splitContainer1.Panel1.Controls.Add( this.panel2 ); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add( this.trackBar1 ); + this.splitContainer1.Panel2MinSize = 22; + this.splitContainer1.Size = new System.Drawing.Size( 559, 412 ); + this.splitContainer1.SplitterDistance = 389; + this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.TabIndex = 20; + // + // Previewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.splitContainer1 ); + this.Name = "Previewer"; + this.Size = new System.Drawing.Size( 559, 412 ); + this.Paint += new System.Windows.Forms.PaintEventHandler( this.Previewer_Paint ); + this.FontChanged += new System.EventHandler( this.Previewer_FontChanged ); + this.panel1.ResumeLayout( false ); + ((System.ComponentModel.ISupportInitialize)(this.trackSpeed)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackVolume)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); + this.contextMenuStrip1.ResumeLayout( false ); + this.panel2.ResumeLayout( false ); + ((System.ComponentModel.ISupportInitialize)(this.PreviewP)).EndInit(); + this.splitContainer1.Panel1.ResumeLayout( false ); + this.splitContainer1.Panel2.ResumeLayout( false ); + this.splitContainer1.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Button btnSpeed; + private System.Windows.Forms.CheckBox checkMute; + private System.Windows.Forms.Label lblSpeed; + private System.Windows.Forms.TrackBar trackSpeed; + private System.Windows.Forms.TrackBar trackVolume; + private System.Windows.Forms.Button stop; + private System.Windows.Forms.TrackBar trackBar1; + private System.Windows.Forms.Label lblTime; + private System.Windows.Forms.Button play_pause; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem menuHundred; + private System.Windows.Forms.ToolStripMenuItem menuFit; + private System.Windows.Forms.ToolStripMenuItem menuSet; + private System.Windows.Forms.PictureBox PreviewP; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.SplitContainer splitContainer1; + } +} diff --git a/trunk/LipSync/Editor/Previewer.cs b/trunk/LipSync/Editor/Previewer.cs new file mode 100644 index 0000000..b206a3c --- /dev/null +++ b/trunk/LipSync/Editor/Previewer.cs @@ -0,0 +1,318 @@ +サソ/* + * Previewer.cs + * Copyright (c) 2008-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class Previewer : UserControl { + /// + /// 繝励Ξ繝薙Η繝シ逕ィ縺ョ繧、繝。繝シ繧クシ傘reviewP.Image縺ョ譛ャ菴薙→縺励※謖螳壹&繧後k + /// + Bitmap m_preview = null; + + public event EventHandler PlayPauseClicked; + public event EventHandler StopClicked; + public event EventHandler SpeedClicked; + public event EventHandler CheckMuteCheckedChanged; + public event MouseEventHandler TrackSpeedMouseUp; + public event EventHandler TrackSpeedScroll; + public event EventHandler TrackVolumeScroll; + public event EventHandler TrackBarScroll; + public event MouseEventHandler PreviewMouseDoubleClick; + public event MouseEventHandler PreviewMouseDown; + public event MouseEventHandler PreviewMouseMove; + public event MouseEventHandler PreviewMouseUp; + public event PaintEventHandler PreviewPaint; + public event EventHandler MenuHundredClick; + public event EventHandler MenuFitClick; + public event EventHandler LabelTimeMouseDoubleClick; + public event EventHandler PreviewSizeChanged; + + public Previewer() { + InitializeComponent(); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public void ApplyLanguage() { + this.play_pause.Text = _( "Play" ); + this.stop.Text = _( "Stop" ); + this.menuFit.Text = _( "Stretch image" ); + this.menuSet.Text = _( "Specified size" ); + } + + public Bitmap Image { + get { + return m_preview; + } + set { + m_preview = value; + PreviewP.Image = m_preview; + } + } + + #region PropertyProxy + public string PlayPauseText { + get { + return play_pause.Text; + } + set { + play_pause.Text = value; + } + } + + public bool PlayPauseEnabled { + get { + return play_pause.Enabled; + } + set { + play_pause.Enabled = value; + } + } + + public bool CheckMuteChecked { + get { + return checkMute.Checked; + } + set { + checkMute.Checked = value; + } + } + + public int TrackSpeedValue { + get { + return trackSpeed.Value; + } + set { + trackSpeed.Value = value; + } + } + + public int TrackVolumeValue { + get { + return trackVolume.Value; + } + set { + trackVolume.Value = value; + } + } + + public int TrackBarValue { + get { + return trackBar1.Value; + } + set { + trackBar1.Value = value; + } + } + + public int TrackBarMaximum { + get { + return trackBar1.Maximum; + } + set { + trackBar1.Maximum = value; + } + } + + public int TrackBarMinimum { + get { + return trackBar1.Minimum; + } + set { + trackBar1.Minimum = value; + } + } + + public bool TrackBarEnabled { + get { + return trackBar1.Enabled; + } + set { + trackBar1.Enabled = value; + } + } + + public string LabelTimeText { + get { + return lblTime.Text; + } + set { + lblTime.Text = value; + } + } + + public string LabelSpeedText { + get { + return lblSpeed.Text; + } + set { + lblSpeed.Text = value; + } + } + + public PictureBoxSizeMode PreviewSizeMode { + get { + return PreviewP.SizeMode; + } + set { + PreviewP.SizeMode = value; + } + } + + public int PreviewWidth { + get { + return PreviewP.Width; + } + } + + + public int PreviewHeight { + get { + return PreviewP.Height; + } + } + + public PictureBox Preview { + get { + return PreviewP; + } + } + #endregion + + #region EventHandlerProxy + private void play_pause_Click( object sender, EventArgs e ) { + if ( PlayPauseClicked != null ) { + PlayPauseClicked( sender, e ); + } + } + + private void stop_Click( object sender, EventArgs e ) { + if ( StopClicked != null ) { + StopClicked( sender, e ); + } + } + + private void btnSpeed_Click( object sender, EventArgs e ) { + if ( SpeedClicked != null ) { + SpeedClicked( sender, e ); + } + } + + private void checkMute_CheckedChanged( object sender, EventArgs e ) { + if ( CheckMuteCheckedChanged != null ) { + CheckMuteCheckedChanged( sender, e ); + } + } + + private void trackSpeed_MouseUp( object sender, MouseEventArgs e ) { + if ( TrackSpeedMouseUp != null ) { + TrackSpeedMouseUp( sender, e ); + } + } + + private void trackSpeed_Scroll( object sender, EventArgs e ) { + if ( TrackSpeedScroll != null ) { + TrackSpeedScroll( sender, e ); + } + } + + private void trackVolume_Scroll( object sender, EventArgs e ) { + if ( TrackVolumeScroll != null ) { + TrackVolumeScroll( sender, e ); + } + } + + private void trackBar1_Scroll( object sender, EventArgs e ) { + if ( TrackBarScroll != null ) { + TrackBarScroll( sender, e ); + } + } + + private void PreviewP_MouseDoubleClick( object sender, MouseEventArgs e ) { + if ( PreviewMouseDoubleClick != null ) { + PreviewMouseDoubleClick( sender, e ); + } + } + + private void PreviewP_MouseDown( object sender, MouseEventArgs e ) { + if ( PreviewMouseDown != null ) { + PreviewMouseDown( sender, e ); + } + } + + private void PreviewP_MouseMove( object sender, MouseEventArgs e ) { + if ( AppManager.Playing ) { + return; + } + if ( PreviewMouseMove != null ) { + PreviewMouseMove( sender, e ); + } + PreviewP.Invalidate(); + } + + private void PreviewP_MouseUp( object sender, MouseEventArgs e ) { + if ( PreviewMouseUp != null ) { + PreviewMouseUp( sender, e ); + } + } + + private void PreviewP_Paint( object sender, PaintEventArgs e ) { + if ( PreviewPaint != null ) { + PreviewPaint( sender, e ); + } + } + + private void menuHundred_Click( object sender, EventArgs e ) { + if ( MenuHundredClick != null ) { + MenuHundredClick( sender, e ); + } + } + + private void menuFit_Click( object sender, EventArgs e ) { + if ( MenuFitClick != null ) { + MenuFitClick( sender, e ); + } + } + + private void lblTime_MouseDoubleClick( object sender, MouseEventArgs e ) { + if ( LabelTimeMouseDoubleClick != null ) { + LabelTimeMouseDoubleClick( sender, e ); + } + } + #endregion + + private void Previewer_Paint( object sender, PaintEventArgs e ) { + PreviewP.Refresh(); + } + + private void Previewer_FontChanged( object sender, EventArgs e ) { + contextMenuStrip1.Font = this.Font; + } + + private void PreviewP_SizeChanged( object sender, EventArgs e ) { + + if ( PreviewSizeChanged != null ) { + PreviewSizeChanged( sender, e ); + } + } + } + +} diff --git a/trunk/LipSync/Editor/Property.Designer.cs b/trunk/LipSync/Editor/Property.Designer.cs new file mode 100644 index 0000000..edd406a --- /dev/null +++ b/trunk/LipSync/Editor/Property.Designer.cs @@ -0,0 +1,273 @@ +/* + * Property.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class Property { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region 繧ウ繝ウ繝昴シ繝阪Φ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.cmenu = new System.Windows.Forms.ContextMenuStrip( this.components ); + this.menuAddTelop = new System.Windows.Forms.ToolStripMenuItem(); + this.menuDeleteTelop = new System.Windows.Forms.ToolStripMenuItem(); + this.sContainer = new Boare.Lib.AppUtil.BSplitContainer(); + this.panelListView = new System.Windows.Forms.Panel(); + this.listView = new System.Windows.Forms.ListView(); + this.columnHeaderStart = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderType = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderAbst = new System.Windows.Forms.ColumnHeader(); + this.titleUpper = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.PropertyGrid = new System.Windows.Forms.PropertyGrid(); + this.titleLower = new System.Windows.Forms.Label(); + this.cmenu.SuspendLayout(); + this.sContainer.Panel1.SuspendLayout(); + this.sContainer.Panel2.SuspendLayout(); + this.panelListView.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // cmenu + // + this.cmenu.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.menuAddTelop, + this.menuDeleteTelop} ); + this.cmenu.Name = "cmenu"; + this.cmenu.ShowImageMargin = false; + this.cmenu.Size = new System.Drawing.Size( 104, 48 ); + // + // menuAddTelop + // + this.menuAddTelop.Name = "menuAddTelop"; + this.menuAddTelop.Size = new System.Drawing.Size( 103, 22 ); + this.menuAddTelop.Text = "繝繝ュ繝繝苓ソス蜉"; + this.menuAddTelop.Click += new System.EventHandler( this.menuAddTelop_Click ); + // + // menuDeleteTelop + // + this.menuDeleteTelop.Name = "menuDeleteTelop"; + this.menuDeleteTelop.Size = new System.Drawing.Size( 103, 22 ); + this.menuDeleteTelop.Text = "繝繝ュ繝繝怜炎髯、"; + this.menuDeleteTelop.Click += new System.EventHandler( this.menuDeleteTelop_Click ); + // + // sContainer + // + this.sContainer.BackColor = System.Drawing.SystemColors.Control; + this.sContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.sContainer.ForeColor = System.Drawing.SystemColors.ControlText; + this.sContainer.IsSplitterFixed = false; + this.sContainer.Location = new System.Drawing.Point( 0, 0 ); + this.sContainer.Name = "sContainer"; + this.sContainer.Orientation = System.Windows.Forms.Orientation.Vertical; + // + // + // + this.sContainer.Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.sContainer.Panel1.AutoScroll = true; + this.sContainer.Panel1.BorderColor = System.Drawing.SystemColors.ControlDark; + this.sContainer.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.sContainer.Panel1.Controls.Add( this.panelListView ); + this.sContainer.Panel1.Controls.Add( this.titleUpper ); + this.sContainer.Panel1.Location = new System.Drawing.Point( 1, 1 ); + this.sContainer.Panel1.Margin = new System.Windows.Forms.Padding( 0, 0, 0, 4 ); + this.sContainer.Panel1.Name = "m_panel1"; + this.sContainer.Panel1.Padding = new System.Windows.Forms.Padding( 1 ); + this.sContainer.Panel1.Size = new System.Drawing.Size( 192, 124 ); + this.sContainer.Panel1.TabIndex = 0; + this.sContainer.Panel1.Enter += new System.EventHandler( this.splitContainer1_Panel1_Enter ); + this.sContainer.Panel1.Leave += new System.EventHandler( this.splitContainer1_Panel1_Leave ); + this.sContainer.Panel1MinSize = 0; + // + // + // + this.sContainer.Panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.sContainer.Panel2.BorderColor = System.Drawing.SystemColors.ControlDark; + this.sContainer.Panel2.Controls.Add( this.panel1 ); + this.sContainer.Panel2.Controls.Add( this.titleLower ); + this.sContainer.Panel2.Location = new System.Drawing.Point( 0, 130 ); + this.sContainer.Panel2.Margin = new System.Windows.Forms.Padding( 0 ); + this.sContainer.Panel2.Name = "m_panel2"; + this.sContainer.Panel2.Size = new System.Drawing.Size( 194, 199 ); + this.sContainer.Panel2.TabIndex = 1; + this.sContainer.Panel2.Enter += new System.EventHandler( this.splitContainer1_Panel2_Enter ); + this.sContainer.Panel2.Leave += new System.EventHandler( this.splitContainer1_Panel2_Leave ); + this.sContainer.Panel2MinSize = 25; + this.sContainer.Size = new System.Drawing.Size( 194, 329 ); + this.sContainer.SplitterDistance = 126; + this.sContainer.SplitterWidth = 4; + this.sContainer.TabIndex = 0; + // + // panelListView + // + this.panelListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panelListView.Controls.Add( this.listView ); + this.panelListView.Location = new System.Drawing.Point( 1, 20 ); + this.panelListView.Margin = new System.Windows.Forms.Padding( 0 ); + this.panelListView.Name = "panelListView"; + this.panelListView.Size = new System.Drawing.Size( 190, 103 ); + this.panelListView.TabIndex = 3; + // + // listView + // + this.listView.AllowColumnReorder = true; + this.listView.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView.Columns.AddRange( new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderStart, + this.columnHeaderType, + this.columnHeaderAbst} ); + this.listView.ContextMenuStrip = this.cmenu; + this.listView.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView.ForeColor = System.Drawing.SystemColors.WindowText; + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Location = new System.Drawing.Point( 0, 0 ); + this.listView.Margin = new System.Windows.Forms.Padding( 0 ); + this.listView.MultiSelect = false; + this.listView.Name = "listView"; + this.listView.ShowGroups = false; + this.listView.Size = new System.Drawing.Size( 190, 103 ); + this.listView.TabIndex = 2; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.SelectedIndexChanged += new System.EventHandler( this.listView_SelectedIndexChanged ); + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler( this.listView_ColumnClick ); + // + // columnHeaderStart + // + this.columnHeaderStart.Text = "start"; + this.columnHeaderStart.Width = 50; + // + // columnHeaderType + // + this.columnHeaderType.Text = "type"; + this.columnHeaderType.Width = 50; + // + // columnHeaderAbst + // + this.columnHeaderAbst.Text = "abstract"; + this.columnHeaderAbst.Width = 88; + // + // titleUpper + // + this.titleUpper.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.titleUpper.BackColor = System.Drawing.SystemColors.InactiveCaption; + this.titleUpper.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; + this.titleUpper.Location = new System.Drawing.Point( 1, 0 ); + this.titleUpper.Margin = new System.Windows.Forms.Padding( 0, 2, 0, 2 ); + this.titleUpper.Name = "titleUpper"; + this.titleUpper.Size = new System.Drawing.Size( 190, 15 ); + this.titleUpper.TabIndex = 1; + this.titleUpper.Text = "label1"; + this.titleUpper.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.titleUpper.DoubleClick += new System.EventHandler( this.titleUpper_DoubleClick ); + this.titleUpper.MouseDown += new System.Windows.Forms.MouseEventHandler( this.titleUpper_MouseDown ); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.Controls.Add( this.PropertyGrid ); + this.panel1.Location = new System.Drawing.Point( 0, 17 ); + this.panel1.Margin = new System.Windows.Forms.Padding( 0 ); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size( 194, 182 ); + this.panel1.TabIndex = 3; + // + // PropertyGrid + // + this.PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.PropertyGrid.Location = new System.Drawing.Point( 0, 0 ); + this.PropertyGrid.Margin = new System.Windows.Forms.Padding( 0 ); + this.PropertyGrid.Name = "PropertyGrid"; + this.PropertyGrid.Size = new System.Drawing.Size( 194, 182 ); + this.PropertyGrid.TabIndex = 0; + this.PropertyGrid.Click += new System.EventHandler( this.PropertyGrid_Click ); + this.PropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler( this.PropertyGrid_PropertyValueChanged ); + // + // titleLower + // + this.titleLower.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.titleLower.BackColor = System.Drawing.SystemColors.InactiveCaption; + this.titleLower.ForeColor = System.Drawing.SystemColors.InactiveCaptionText; + this.titleLower.Location = new System.Drawing.Point( 0, 0 ); + this.titleLower.Margin = new System.Windows.Forms.Padding( 0, 0, 0, 2 ); + this.titleLower.Name = "titleLower"; + this.titleLower.Size = new System.Drawing.Size( 194, 15 ); + this.titleLower.TabIndex = 2; + this.titleLower.Text = "label2"; + this.titleLower.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.titleLower.MouseDown += new System.Windows.Forms.MouseEventHandler( this.titleLower_MouseDown ); + // + // Property + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.sContainer ); + this.Name = "Property"; + this.Size = new System.Drawing.Size( 194, 329 ); + this.FontChanged += new System.EventHandler( this.Property_FontChanged ); + this.cmenu.ResumeLayout( false ); + this.sContainer.Panel1.ResumeLayout( false ); + this.sContainer.Panel2.ResumeLayout( false ); + this.panelListView.ResumeLayout( false ); + this.panel1.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private Boare.Lib.AppUtil.BSplitContainer sContainer; + public System.Windows.Forms.Label titleUpper; + public System.Windows.Forms.Label titleLower; + private System.Windows.Forms.ContextMenuStrip cmenu; + private System.Windows.Forms.ToolStripMenuItem menuAddTelop; + private System.Windows.Forms.ToolStripMenuItem menuDeleteTelop; + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader columnHeaderStart; + private System.Windows.Forms.ColumnHeader columnHeaderType; + private System.Windows.Forms.ColumnHeader columnHeaderAbst; + private System.Windows.Forms.Panel panelListView; + private System.Windows.Forms.PropertyGrid PropertyGrid; + private System.Windows.Forms.Panel panel1; + } +} diff --git a/trunk/LipSync/Editor/Property.cs b/trunk/LipSync/Editor/Property.cs new file mode 100644 index 0000000..0cfa3a8 --- /dev/null +++ b/trunk/LipSync/Editor/Property.cs @@ -0,0 +1,389 @@ +サソ/* + * Property.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public delegate void TelopAddingEventHandler(); + public delegate void TelopDeletingEventHandler( ZorderItem e ); + public delegate void EditingItemChangedEventHandler( ZorderItem e ); + public delegate void ListUpdateRequiredEventHandler(); + + public partial class Property : UserControl { + private ZorderItem m_editing = null; + FormObjectList m_form_objectlist; + int m_last_splitter_distance = 126; + bool[] m_sort_ascend = new bool[] { true, true, true }; // start, type, abst縺ョ蜷鬆逶ョ縺梧鬆縺ァ荳ヲ縺ケ譖ソ縺医i繧後※縺繧九°縺ゥ縺縺九r陦ィ縺 + int[] m_sort_order = new int[] { 0, 1, 2 }; // start, type, abst縺ョ蛻励ョ繝繝シ繧ソ縺鯉シ碁逶ョ繧剃クヲ縺ケ譖ソ縺医k髫帙↓鬆逡ェ縺ョ蛻、螳壹↓菴ソ逕ィ縺輔l繧矩菴搾シ + private static Property m_instance = null; + + /// + /// 繝励Ο繝代ユ繧」繝サ繝薙Η繝シ縺ョ蛟、縺悟、画峩縺輔l縺溘→縺阪↓逋コ逕溘@縺セ縺 + /// + public event PropertyValueChangedEventHandler PropertyValueChanged; + /// + /// 繝繝ュ繝繝励ョ霑ス蜉縺瑚ヲ∵アゅ&繧後◆縺ィ縺阪↓逋コ逕溘@縺セ縺 + /// + public event TelopAddingEventHandler TelopAdding; + /// + /// 繝繝ュ繝繝励ョ蜑企勁縺瑚ヲ∵アゅ&繧後◆縺ィ縺阪↓逋コ逕溘@縺セ縺 + /// + public event TelopDeletingEventHandler TelopDeleting; + /// + /// 繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医〒驕ク謚槭い繧、繝繝縺悟、画峩縺輔l縺溘→縺咲匱逕溘@縺セ縺 + /// + public event EventHandler SelectedIndexChanged; + public event EditingItemChangedEventHandler EditingItemChanged; + /// + /// 繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医ョ譖エ譁ー縺悟ソ隕√→縺ェ縺」縺溘→縺咲匱逕溘@縺セ縺 + /// + public event ListUpdateRequiredEventHandler ListUpdateRequired; + + public void UpdateLayout() { + // panel1 + titleUpper.Left = 0; + titleUpper.Top = 0; + titleUpper.Width = sContainer.Panel1.Width; + panelListView.Left = 0; + panelListView.Top = titleUpper.Height; + panelListView.Width = sContainer.Panel1.Width; + panelListView.Height = sContainer.Panel1.Height - titleUpper.Height; + + // panel2 + titleLower.Left = 0; + titleLower.Top = 0; + titleLower.Width = sContainer.Panel2.Width; + panel1.Left = 0; + panel1.Top = titleLower.Height; + panel1.Width = sContainer.Panel2.Width; + panel1.Height = sContainer.Panel2.Height - titleLower.Height; + } + + public void ApplyLanguage() { + menuAddTelop.Text = _( "Add Telop" ) + "(&A)"; + menuDeleteTelop.Text = _( "Delte Delop" ) + "(&D)"; + m_form_objectlist.ApplyLanguage(); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public static Property Instance { + get { + return m_instance; + } + } + + public void Sort() { + if ( listView.Items.Count < 2 ) { + return; + } + bool changed = true; + List sorting = new List(); + for ( int i = 0; i < listView.Items.Count; i++ ) { + sorting.Add( listView.Items[i] ); + } + while ( changed ) { + changed = false; + for ( int i = 0; i < sorting.Count - 1; i++ ) { + if ( Compare( sorting[i], sorting[i + 1] ) > 0 ) { + ListViewItem cp = (ListViewItem)sorting[i].Clone(); + sorting[i] = (ListViewItem)sorting[i + 1].Clone(); + sorting[i + 1] = cp; + changed = true; + } + } + } + listView.Items.Clear(); + listView.Items.AddRange( sorting.ToArray() ); + } + + /// + /// 隨ャindex1鬆逶ョ縺檎ャャindex2鬆逶ョ繧医j鬆菴阪′菴弱>縺ィ縺衡rueシ後◎縺縺ァ縺ェ縺縺ィ縺糠alse + /// + /// + /// + /// + public int Compare( ListViewItem item1, ListViewItem item2 ) { + int[] order = new int[3]; + order[0] = CompareWithStart( item1, item2 ); + order[1] = CompareWithType( item1, item2 ); + order[2] = CompareWithAbst( item1, item2 ); + if ( order[m_sort_order[0]] == 0 ) { + if ( order[m_sort_order[1]] == 0 ) { + return order[m_sort_order[2]]; + } else { + return order[m_sort_order[1]]; + } + } else { + return order[m_sort_order[0]]; + } + } + + private int CompareWithAbst( ListViewItem item1, ListViewItem item2 ) { + string t1 = item1.SubItems[2].Text; + string t2 = item2.SubItems[2].Text; + int res = t1.CompareTo( t2 ); + if ( !m_sort_ascend[2] ) { + res = -1 * res; + } + return res; + } + + private int CompareWithType( ListViewItem item1, ListViewItem item2 ) { + if ( !(item1.Tag is ZorderItem) || !(item2.Tag is ZorderItem) ) { + return 0; + } + ZorderItem zitem1 = (ZorderItem)item1.Tag; + ZorderItem zitem2 = (ZorderItem)item2.Tag; + ZorderItemType t1 = zitem1.Type; + ZorderItemType t2 = zitem2.Type; + int res = t1.CompareTo( t2 ); + if ( !m_sort_ascend[1] ) { + res = -1 * res; + } + return res; + } + + private int CompareWithStart( ListViewItem item1, ListViewItem item2 ) { + float titem1 = ((ZorderItem)item1.Tag).Start; + float titem2 = ((ZorderItem)item2.Tag).Start; + int res = 0; + if ( titem1 > titem2 ) { + res = 1; + } else if ( titem1 < titem2 ) { + res = -1; + } else { + res = 0; + } + if ( !m_sort_ascend[0] ) { + res = -1 * res; + } + return res; + } + + public ZorderItem this[int index] { + get { + return (ZorderItem)listView.Items[index].Tag; + } + } + + public int Count { + get { + return listView.Items.Count; + } + } + + public int SelectedIndex { + get { + if ( listView.SelectedItems.Count > 0 ) { + foreach ( ListViewItem item in listView.SelectedItems ) { + return item.Index; + } + } + return -1; + } + set { + for ( int i = 0; i < listView.Items.Count; i++ ) { + if ( i == value ) { + listView.Items[i].Selected = true; + } else { + listView.Items[i].Selected = false; + } + } + } + } + + public ZorderItem SelectedItem { + get { + int index = SelectedIndex; + if ( index < 0 || listView.Items.Count <= index ) { + return null; + } else { + return (ZorderItem)listView.Items[index].Tag; + } + } + } + + public ListView ListView { + get { + return listView; + } + } + + public ZorderItem Editing { + get { + return m_editing; + } + set { + m_editing = value; + if ( this.EditingItemChanged != null ) { + this.EditingItemChanged( m_editing ); + } + } + } + + public object SelectedObject { + get { + return PropertyGrid.SelectedObject; + } + set { + PropertyGrid.SelectedObject = value; + } + } + + public Property() { + InitializeComponent(); + m_form_objectlist = new FormObjectList(); + m_form_objectlist.FormClosing += new FormClosingEventHandler( m_form_objectlist_FormClosing ); + m_instance = this; + } + + void m_form_objectlist_FormClosing( object sender, FormClosingEventArgs e ) { + listView.Parent = panelListView; + listView.Dock = DockStyle.Fill; + sContainer.SplitterDistance = m_last_splitter_distance; + sContainer.IsSplitterFixed = false; + } + + private void PropertyGrid_Click( object sender, EventArgs e ) { + this.sContainer.Panel2.Focus(); + } + + private void splitContainer1_Panel2_Enter( object sender, EventArgs e ) { + this.titleLower.BackColor = SystemColors.ActiveCaption; + this.titleLower.ForeColor = SystemColors.ActiveCaptionText; + } + + private void splitContainer1_Panel2_Leave( object sender, EventArgs e ) { + this.titleLower.BackColor = SystemColors.InactiveCaption; + this.titleLower.ForeColor = SystemColors.InactiveCaptionText; + } + + private void splitContainer1_Panel1_Leave( object sender, EventArgs e ) { + this.titleUpper.BackColor = SystemColors.InactiveCaption; + this.titleUpper.ForeColor = SystemColors.InactiveCaptionText; + } + + private void splitContainer1_Panel1_Enter( object sender, EventArgs e ) { + this.titleUpper.BackColor = SystemColors.ActiveCaption; + this.titleUpper.ForeColor = SystemColors.ActiveCaptionText; + } + + private void titleUpper_MouseDown( object sender, MouseEventArgs e ) { + this.sContainer.Panel1.Focus(); + } + + private void titleLower_MouseDown( object sender, MouseEventArgs e ) { + this.sContainer.Panel2.Focus(); + } + + private void ListView_Enter( object sender, EventArgs e ) { + this.titleUpper.BackColor = SystemColors.ActiveCaption; + this.titleUpper.ForeColor = SystemColors.ActiveCaptionText; + } + + private void PropertyGrid_PropertyValueChanged( object s, PropertyValueChangedEventArgs e ) { + if ( this.PropertyValueChanged != null ) { + this.PropertyValueChanged( s, e ); + } + if ( ListUpdateRequired != null ) { + ListUpdateRequired(); + } + } + + private void menuAddTelop_Click( object sender, EventArgs e ) { + if ( this.TelopAdding != null ) { + this.TelopAdding(); + } + if ( ListUpdateRequired != null ) { + ListUpdateRequired(); + } + } + + private void menuDeleteTelop_Click( object sender, EventArgs e ) { + if ( this.SelectedIndex < 0 ) { + return; + } + if ( this.TelopDeleting != null ) { + this.TelopDeleting( this.SelectedItem ); + } + if ( ListUpdateRequired != null ) { + ListUpdateRequired(); + } + } + + public ZorderItem Selected { + get { + return m_editing; + } + } + + void listView_SelectedIndexChanged( object sender, EventArgs e ) { + if ( listView.SelectedItems.Count > 0 && this.EditingItemChanged != null ) { + ZorderItem zi = (ZorderItem)listView.SelectedItems[0].Tag; + Editing = zi; + } + } + + private void TreeView_MouseDown( object sender, MouseEventArgs e ) { + if ( this.PropertyValueChanged != null ) { + this.PropertyValueChanged( sender, null ); + } + } + + private void titleUpper_DoubleClick( object sender, EventArgs e ) { + m_form_objectlist.Show( listView ); + m_last_splitter_distance = sContainer.SplitterDistance; + sContainer.SplitterDistance = 0; + sContainer.IsSplitterFixed = true; + } + + private void listView_ColumnClick( object sender, ColumnClickEventArgs e ) { + int column = e.Column; + if ( m_sort_order[0] == column ) { + m_sort_ascend[column] = !m_sort_ascend[column]; + List coll = new List(); + for ( int i = listView.Items.Count - 1; i >= 0; i-- ) { + coll.Add( listView.Items[i] ); + } + listView.Items.Clear(); + listView.Items.AddRange( coll.ToArray() ); + this.Sort(); + } else { + List list = new List(); + for ( int i = 0; i < 3; i++ ) { + if ( m_sort_order[i] != column ) { + list.Add( m_sort_order[i] ); + } + } + m_sort_order[0] = column; + m_sort_order[1] = list[0]; + m_sort_order[2] = list[1]; + this.Sort(); + } + } + + private void Property_FontChanged( object sender, EventArgs e ) { + cmenu.Font = this.Font; + } + } + +} diff --git a/trunk/LipSync/Editor/QuantizeMode.cs b/trunk/LipSync/Editor/QuantizeMode.cs new file mode 100644 index 0000000..1e143f8 --- /dev/null +++ b/trunk/LipSync/Editor/QuantizeMode.cs @@ -0,0 +1,28 @@ +サソ/* + * QuantizeMode.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + /// + /// 髻ウ隨ヲ縺ョ驥丞ュ仙喧險ュ螳 + /// + public enum QuantizeMode { + q04, + q08, + q16, + q32, + q64, + off + } + +} diff --git a/trunk/LipSync/Editor/RipSync/RsiImporter.cs b/trunk/LipSync/Editor/RipSync/RsiImporter.cs new file mode 100644 index 0000000..095bf0d --- /dev/null +++ b/trunk/LipSync/Editor/RipSync/RsiImporter.cs @@ -0,0 +1,28 @@ +サソ/* + * RsiImporter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; + +namespace LipSync { + + public class CharacterEx{ + public Character3 character; + public List exclusion; + public CharacterEx(){ + character = new Character3(); + exclusion = new List(); + } + } + +} diff --git a/trunk/LipSync/Editor/RipSync/RsiReader.cs b/trunk/LipSync/Editor/RipSync/RsiReader.cs new file mode 100644 index 0000000..e70b293 --- /dev/null +++ b/trunk/LipSync/Editor/RipSync/RsiReader.cs @@ -0,0 +1,162 @@ +/* + * RsiReader.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Web; +using System.Xml; + +namespace LipSync { + + /// + /// RipSync縺ョ繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹ヵ繧。繧、繝ォ*.rsi繧定ェュ霎シ繧縺溘a縺ョ繧ッ繝ゥ繧ケ + /// + public class RsiReader { + public static CharacterEx Read( string filepath ) { + CharacterEx result = new CharacterEx(); + filepath = HttpUtility.UrlDecode( filepath ); + XmlDocument doc = new XmlDocument(); + doc.Load( filepath ); + string base_path = Path.GetDirectoryName( filepath ); + List exclusion = new List(); + + foreach ( XmlNode level0 in doc.DocumentElement.ChildNodes ) { + switch ( level0.LocalName ) { + case "Title": + result.character.Name = level0.InnerText; + break; + case "Size": + string t_string = level0.InnerText; + string[] spl = t_string.Split( ",".ToCharArray() ); + int width = int.Parse( spl[0] ); + int height = int.Parse( spl[1] ); + result.character.Size = new Size( width, height ); + break; + case "Triggers": + // 謗剃サ冶ィュ螳壹□縺題ェュ縺ソ蜿悶k + foreach ( XmlNode level1 in level0.ChildNodes ) { + if ( level1.LocalName == "Selection" ) { + foreach ( XmlNode level2 in level1.ChildNodes ) { + if ( level2.LocalName == "Item" ) { + foreach ( XmlAttribute attr in level2.Attributes ) { + if ( attr.LocalName == "Trigger" ) { + result.exclusion.Add( attr.InnerText ); + } + } + } + } + } + } + break; + } + } + + foreach ( XmlNode level0 in doc.DocumentElement.ChildNodes ) { + if ( level0.LocalName == "Images" ) { + foreach ( XmlNode level1 in level0.ChildNodes ) { + switch ( level1.LocalName ) { + case "Image": + string image_path = ""; + string name = ""; + string trigger = ""; + Point center = new Point( 0, 0 ); + foreach ( XmlAttribute attr in level1.Attributes ) { + switch ( attr.LocalName ) { + case "name": + name = attr.InnerText; + break; + case "path": + image_path = Path.Combine( base_path, attr.InnerText ); + break; + case "trigger": + trigger = attr.InnerText; + break; + case "center": + string tmp = attr.InnerText; + tmp = tmp.Replace( " ", "" ); + tmp = tmp.Trim(); + string[] spl = tmp.Split( ",".ToCharArray() ); + center = new Point( -int.Parse( spl[0] ), -int.Parse( spl[1] ) ); + break; + } + } + Image img = null; + if ( File.Exists( image_path ) ) { + img = Common.ImageFromFile( image_path ); + } + bool found = false; +#if DEBUG + Common.DebugWriteLine( "RsiReader.Read(String); name=" + name ); + Common.DebugWriteLine( "RsiReader.Read(String); center=" + center ); +#endif + for ( int i = 0; i < result.character.Count; i++ ) { + if ( result.character[i].title == name ) { + found = true; + if ( img != null ) { + if ( center.X == 0 && center.Y == 0 ) { + result.character.SetImage( img, name ); + } else { + int width = result.character.Size.Width; + int height = result.character.Size.Height; + using ( Bitmap bmp = new Bitmap( width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) ) + using ( Graphics g = Graphics.FromImage( bmp ) ) { + g.DrawImage( img, center.X, center.Y, img.Width, img.Height ); +#if DEBUG + string temp = @"C:\" + name + ".png"; + Common.DebugWriteLine( "temp=" + temp ); + bmp.Save( temp, System.Drawing.Imaging.ImageFormat.Png ); +#endif + result.character.SetImage( bmp, name ); + } + } + } else { + result.character.SetImage( null, name ); + } + } + } + if ( !found ) { + result.character.Add( new ImageEntry( name, null, "", false ) ); + if ( center.X == 0 && center.Y == 0 ) { + result.character.SetImage( img, name ); + } else { + int width = result.character.Size.Width; + int height = result.character.Size.Height; + using ( Bitmap bmp = new Bitmap( width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) ) + using ( Graphics g = Graphics.FromImage( bmp ) ) { + g.DrawImage( img, center.X, center.Y, img.Width, img.Height ); +#if DEBUG + string temp = @"C:\" + name + ".png"; + Common.DebugWriteLine( "temp=" + temp ); + bmp.Save( temp, System.Drawing.Imaging.ImageFormat.Png ); +#endif + result.character.SetImage( bmp, name ); + } + } + } + break; + } + + } + } + } +#if DEBUG + Common.DebugWriteLine( "RsiReader.Read(String); result.character.Size=" + result.character.Size ); +#endif + return result; + } + + } + +} diff --git a/trunk/LipSync/Editor/RipSync/RsiWriter.cs b/trunk/LipSync/Editor/RipSync/RsiWriter.cs new file mode 100644 index 0000000..7fa119c --- /dev/null +++ b/trunk/LipSync/Editor/RipSync/RsiWriter.cs @@ -0,0 +1,530 @@ +サソ/* + * RsiWriter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public class RsiWriter { + #region Constant String + static readonly string[] mouth_set = new string[]{ + "a", + "aa", + "i", + "u", + "e", + "o", + "xo", + "nn" + }; + static readonly string[] mouth_set_ja = new string[]{ + "縺", + "縺ゅ≠", + "縺", + "縺", + "縺", + "縺", + "縺", + "繧" + }; // mouth_set縺ィ蜷碁縺ァ蟇セ蠢懊@縺ヲ辟。縺縺ィNG + static readonly string[] dict_text = new string[]{ + "縺,a", + "縺,a", + "縺,a", + "縺,a", + "縺,a", + "縺,a", + "縺,a", + "縺ェ,a", + "縺ッ,a", + "縺ー,a", + "縺ア,a", + "縺セ,a", + "繧,a", + "繧,a", + "繧,a", + "縺,i", + "縺,i", + "縺,i", + "縺,i", + "縺,i", + "縺。,i", + "縺「,i", + "縺ォ,i", + "縺イ,i", + "縺ウ,i", + "縺エ,i", + "縺ソ,i", + "繧,i", + "縺,u", + "縺,u", + "縺,u", + "縺,u", + "縺,u", + "縺、,u", + "縺・,u", + "縺ャ,u", + "縺オ,u", + "縺カ,u", + "繧,u", + "繧,u", + "繧,u", + "縺,e", + "縺,e", + "縺,e", + "縺,e", + "縺,e", + "縺ヲ,e", + "縺ァ,e", + "縺ュ,e", + "縺ク,e", + "縺ケ,e", + "繧,e", + "繧,e", + "縺,o", + "縺,o", + "縺,o", + "縺,o", + "縺,o", + "縺ィ,o", + "縺ゥ,o", + "縺ョ,o", + "縺サ,o", + "縺シ,o", + "縺ス,o", + "繧,o", + "繧,o", + "繧,o", + "繧,xo", + "繧,nn" + }; + static readonly string[] dict_symbol = new string[]{ + "a,a", + "i,i", + "M,u", + "e,e", + "o,o", + "k,xo", + "k',i", + "g,e", + "g',i", + "s,a", + "S,i", + "z,u", + "Z,i", + "dz,u", + "dZ,i", + "t,e", + "t',i", + "ts,u", + "tS,i", + "d,a", + "d',i", + "n,a", + "J,i", + "h,a", + @"h\,xo", + "C,i", + @"p\,u", + @"p\',i", + "b,o", + "b',i", + "p,o", + "p',i", + "m,a", + "m',i", + "j,u", + "4,aa", + "4',i", + "w,a", + @"N\,nn" + }; + #endregion + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + /// + /// a, aa, i, u, e, o, xo, nn繧偵√≠繝サ縺ゅ≠繝サ縺繝サ縺繝サ縺医サ縺翫サ縺峨サ繧薙↓螟画鋤縺励∪縺吶ゅ◎繧御サ・螟悶ッ""繧定ソ斐☆ + /// + /// + /// + private static string Translate( string symbol ) { + for ( int i = 0; i < mouth_set.Length; i++ ) { + if ( mouth_set[i] == symbol ) { + return mouth_set_ja[i]; + } + } + return ""; + } + + + /// + /// 荳弱∴繧峨l縺溘ち繧、繝医Ν縺ョ逕サ蜒上′蜿」繝代け逕ィ縺ョ蝓コ譛ャ逕サ蜒上そ繝繝医ョ迚ゥ縺九←縺縺九r蛻、螳壹@縺セ縺 + /// + /// + /// + private static bool IsImageNameForMouth( string name ) { + foreach ( string s in mouth_set ) { + if ( s == name ) { + return true; + } + } + return false; + } + + + public static void Write( Character3 character, string fpath ) { + string image_folder_name = Path.GetFileNameWithoutExtension( fpath ); + string image_folder = Path.Combine( Path.GetDirectoryName( fpath ), image_folder_name ); + if ( Directory.Exists( image_folder ) ) { + DialogResult res = MessageBox.Show( + _( "Image directory already exists. Would you like to overwrite them?" ), + _( "warning" ), + MessageBoxButtons.YesNoCancel, + MessageBoxIcon.Exclamation, + MessageBoxDefaultButton.Button2 ); + if ( res == DialogResult.No ) { + using ( OpenFileDialog dlg = new OpenFileDialog() ) { + dlg.FileName = Path.GetDirectoryName( fpath ); + if ( dlg.ShowDialog() == DialogResult.OK ) { + image_folder = dlg.FileName; + image_folder_name = Path.GetFileName( image_folder ); + } else { + return; + } + } + } else if ( res == DialogResult.Cancel ) { + return; + } + } else { + Directory.CreateDirectory( image_folder ); + } +#if DEBUG + Common.DebugWriteLine( "image_folder_name=" + image_folder_name ); + Common.DebugWriteLine( "image_folder=" + image_folder ); +#endif + XmlTextWriter doc = new XmlTextWriter( fpath, Encoding.UTF8 ); + doc.Formatting = Formatting.Indented; + doc.Indentation = 2; + doc.IndentChar = ' '; + + // 繧ソ繧ー縺梧悴謖螳壹↑迚ゥ縺ョgroup蜷阪r豎コ繧√※縺翫¥ + string group_name_for_empty = "Another"; + bool found = true; + int count = 0; + while ( found ) { + found = false; + foreach ( ImageEntry img in character ) { + if ( img.tag == group_name_for_empty ) { + found = true; + break; + } + } + if ( found ) { + count++; + group_name_for_empty = "Another" + count; + } + } + + doc.WriteStartElement( "SingerConfig" ); + { + doc.WriteElementString( "Title", character.Name ); + doc.WriteElementString( "Size", character.Size.Width + "," + character.Size.Height ); + doc.WriteElementString( "RootImageName", "root" ); + List sets = new List(); // root莉・荳九ョset縺ョ繝ェ繧ケ繝 + + #region "SingerConfig/Images" + doc.WriteStartElement( "Images" ); + { + // 繝医Μ繧ャ繝シ霎シ縺ソ + foreach ( ImageEntry img in character ) { + if ( IsImageNameForMouth( img.title ) ) { + continue; + } + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "center", (-img.XOffset) + ", " + (-img.YOffset) ); + doc.WriteAttributeString( "name", img.title ); + doc.WriteAttributeString( "size", img.Image.Width + ", " + img.Image.Height ); + string img_fname = img.title + ".png"; + img.Image.Save( Path.Combine( image_folder, img_fname ), System.Drawing.Imaging.ImageFormat.Png ); + doc.WriteAttributeString( "path", image_folder_name + "/" + img_fname ); + doc.WriteAttributeString( "trigger", img.title ); + } + doc.WriteEndElement(); + } + // 蝓コ譛ャ蜿」逕サ蜒上ゅヨ繝ェ繧ャ繝シ謖螳壹ョ辟。縺螂エ繧ょコ蜉帙@縺ェ縺縺ィ縺縺代↑縺シ滂シ域悴遒コ隱 + foreach ( ImageEntry img in character ) { + if ( !IsImageNameForMouth( img.title ) ) { + continue; + } + + // 閾ェ蜍慕畑 + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "center", (-img.XOffset) + ", " + (-img.YOffset) ); + doc.WriteAttributeString( "name", img.title ); + doc.WriteAttributeString( "size", img.Image.Width + ", " + img.Image.Height ); + string img_fname = img.title + ".png"; + img.Image.Save( Path.Combine( image_folder, img_fname ), System.Drawing.Imaging.ImageFormat.Png ); + doc.WriteAttributeString( "path", image_folder_name + "/" + "mouth_" + img_fname ); + } + doc.WriteEndElement(); + + // 繝医Μ繧ャ繝シ逕ィ + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "center", (-img.XOffset) + ", " + (-img.YOffset) ); + doc.WriteAttributeString( "name", "mouth_" + img.title ); + doc.WriteAttributeString( "size", img.Image.Width + ", " + img.Image.Height ); + string img_fname = "mouth_" + img.title + ".png"; + img.Image.Save( Path.Combine( image_folder, img_fname ), System.Drawing.Imaging.ImageFormat.Png ); + doc.WriteAttributeString( "path", image_folder_name + "/" + img_fname ); + doc.WriteAttributeString( "trigger", Translate( img.title ) ); + } + doc.WriteEndElement(); + } + + // root/mouth_auto_set + doc.WriteStartElement( "Set" ); + { + doc.WriteAttributeString( "name", "mouth_auto_set" ); + doc.WriteAttributeString( "size", character.Size.Width + "," + character.Size.Height ); + doc.WriteAttributeString( "count", 1 + "" ); + doc.WriteAttributeString( "trigger", "mouth_auto" ); + + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "index", 0 + "" ); + doc.WriteAttributeString( "imageName", "mouth" ); + doc.WriteAttributeString( "offset", "0,0" ); + } + doc.WriteEndElement(); + sets.Add( "mouth_auto" ); + } + doc.WriteEndElement(); + + // root/{tag}_manual + List listed_tag = new List(); // 蜃コ蜉帶ク医∩縺ョ繧ソ繧ー縺ョ繝ェ繧ケ繝 + bool added = true; + while ( added ) { + added = false; + // 谺。縺ォ蜃コ蜉帙☆縺ケ縺阪ち繧ー繧呈、懃エ「 + string next_tag = ""; + List print = new List(); + foreach ( ImageEntry img in character ) { + bool found2 = false; + foreach ( string s in listed_tag ) { + if ( s == img.tag ) { + found2 = true; + break; + } + } + if ( !found2 ) { + if ( img.tag == "" ) { + next_tag = group_name_for_empty; + } else { + next_tag = img.tag; + } + break; + } + } + + if ( next_tag != "" ) { + added = true; + if ( next_tag == group_name_for_empty ) { + listed_tag.Add( "" ); + } else { + listed_tag.Add( next_tag ); + } + foreach ( ImageEntry img in character ) { + if ( img.tag == next_tag ) { + print.Add( img.title ); + } + } + foreach ( string s in print ) { + // 譛ャ菴鍋判蜒上′蜷ォ縺セ繧後※縺溘i繧ュ繝」繝ウ繧サ繝ォ + if ( s == "base" ) { + print.Clear(); + break; + } + } + if ( print.Count > 0 ) { + doc.WriteStartElement( "Set" ); + { + doc.WriteAttributeString( "name", next_tag + "_manual_set" ); + doc.WriteAttributeString( "trigger", next_tag + "_manual" ); + sets.Add( next_tag + "_manual" ); + doc.WriteAttributeString( "size", character.Size.Width + ", " + character.Size.Height ); + doc.WriteAttributeString( "count", print.Count + "" ); + for ( int i = 0; i < print.Count; i++ ) { + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "index", i + "" ); + if ( IsImageNameForMouth( print[i] ) ) { + doc.WriteAttributeString( "imageName", "mouth_" + print[i] ); + } else { + doc.WriteAttributeString( "imageName", print[i] ); + } + doc.WriteAttributeString( "offset", "0,0" ); + } + doc.WriteEndElement(); + } + } + doc.WriteEndElement(); + } + } else { + break; + } + } + + // root + doc.WriteStartElement( "Set" ); + { + doc.WriteAttributeString( "name", "root" ); + doc.WriteAttributeString( "size", character.Size.Width + ", " + character.Size.Height ); + doc.WriteAttributeString( "count", (1 + sets.Count) + "" ); + + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "index", 0 + "" ); + doc.WriteAttributeString( "imageName", "base" ); + doc.WriteAttributeString( "offset", "0,0" ); + } + doc.WriteEndElement(); + + for ( int i = 0; i < sets.Count; i++ ) { + doc.WriteStartElement( "Image" ); + { + doc.WriteAttributeString( "index", (i + 1) + "" ); + doc.WriteAttributeString( "imageName", sets[i] + "_set" ); + doc.WriteAttributeString( "offset", "0,0" ); + } + doc.WriteEndElement(); + } + + } + doc.WriteEndElement(); + } + doc.WriteEndElement(); + #endregion + + #region "SingerConfig/Triggers" + doc.WriteStartElement( "Triggers" ); + { + foreach ( string s in sets ) { + doc.WriteStartElement( "Trigger" ); + { + doc.WriteAttributeString( "group", s + "_control" ); + doc.WriteAttributeString( "name", s ); + if ( s == "mouth_auto" ) { + doc.WriteAttributeString( "default", "on" ); + } + } + doc.WriteEndElement(); + } + + foreach ( ImageEntry img in character ) { + if ( img.title == "base" ) { + continue; + } + doc.WriteStartElement( "Trigger" ); + { + if ( img.tag == "" ) { + doc.WriteAttributeString( "group", group_name_for_empty ); + } else { + doc.WriteAttributeString( "group", img.tag ); + } + if ( IsImageNameForMouth( img.title ) ) { + doc.WriteAttributeString( "name", Translate( img.title ) ); + } else { + doc.WriteAttributeString( "name", img.title ); + } + } + doc.WriteEndElement(); + } + + Dictionary dic = new Dictionary(); + foreach ( ImageEntry img in character ) { + if ( img.tag == "" || img.title == "base" ) { + continue; + } + if ( dic.ContainsKey( img.tag ) ) { + dic[img.tag] = dic[img.tag] + "\n" + img.title; + } else { + dic[img.tag] = img.title; + } + } + foreach ( string key in dic.Keys ) { + string items = dic[key]; + string[] spl = items.Split( "\n".ToCharArray() ); + doc.WriteStartElement( "Selection" ); + { + foreach ( string s in spl ) { + doc.WriteStartElement( "Item" ); + { + doc.WriteAttributeString( "Trigger", s ); + } + doc.WriteEndElement(); + } + } + doc.WriteEndElement(); + } + } + doc.WriteEndElement(); + #endregion + + #region "SingerConfig/Mouths" + doc.WriteStartElement( "Mouths" ); + { + doc.WriteStartElement( "Default" ); + { + doc.WriteAttributeString( "imageName", "nn" ); + } + doc.WriteEndElement(); + foreach ( string s in dict_text ) { + string[] spl = s.Split( ",".ToCharArray() ); + doc.WriteStartElement( "Attach" ); + { + doc.WriteAttributeString( "text", spl[0] ); + doc.WriteAttributeString( "imageName", spl[1] ); + } + doc.WriteEndElement(); + } + foreach ( string s in dict_symbol ) { + string[] spl = s.Split( ",".ToCharArray() ); + doc.WriteStartElement( "Attach" ); + { + doc.WriteAttributeString( "symbol", spl[0] ); + doc.WriteAttributeString( "imageName", spl[1] ); + } + doc.WriteEndElement(); + } + } + doc.WriteEndElement(); + #endregion + + } + doc.WriteEndElement(); + doc.Close(); + } + } +} diff --git a/trunk/LipSync/Editor/RipSync/RspImporter.cs b/trunk/LipSync/Editor/RipSync/RspImporter.cs new file mode 100644 index 0000000..53ac631 --- /dev/null +++ b/trunk/LipSync/Editor/RipSync/RspImporter.cs @@ -0,0 +1,692 @@ +サソ/* + * RspImporter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Web; +using System.Xml; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + class RspTriggerEvent : IComparable{ + public float time; + public string triggerName; + public RspTriggerStatus status; + public RspTriggerEvent( float time, string triggerName, string status ){ + this.time = time; + this.triggerName = triggerName.Trim(); + if( status.Trim() == "ON" ){ + this.status = RspTriggerStatus.ON; + }else{ + this.status = RspTriggerStatus.OFF; + } + } + public int CompareTo( object obj ) { + RspTriggerEvent item = (RspTriggerEvent)obj; + if ( this.time > item.time ) { + return 1; + } else if ( this.time < item.time ) { + return -1; + } else { + if ( this.status == RspTriggerStatus.OFF && item.status == RspTriggerStatus.ON ) { + return -1; + } else if ( this.status == RspTriggerStatus.ON && item.status == RspTriggerStatus.OFF ) { + return 1; + } + return 0; + } + } + new public string ToString() { + return time.ToString() + "," + triggerName + "," + status.ToString(); + } + } + + enum RspTriggerStatus{ + ON, + OFF, + } + + public class RspImporter { + + private static XmlDocument doc; + + private static TimeTableGroup group_vsq; + private static List groups_character; + private static TimeTableGroup group_another; + private static List telop = new List(); + private static float optional_length; + private static int width; + private static int height; + private static int back_color; + private static string sound_file; + + public static string gettext( string s ) { + return Messaging.GetMessage( s ); + } + + + public static string _( string s ) { + return gettext( s ); + } + + + public static bool Import( string filepath, ref SettingsEx save ) { + string rsp_path = Path.GetDirectoryName( filepath ); + + doc = new XmlDocument(); + doc.Load( filepath ); + + group_vsq = new TimeTableGroup( _( "VSQ Tracks" ), 0, null ); + groups_character = new List(); + group_another = new TimeTableGroup( _( "Another images" ), 0, null ); + + // 譛蛻昴↓total_length繧貞叙蠕 + foreach( XmlNode level1 in doc.DocumentElement.ChildNodes ){ + if( level1.LocalName == "View" ){ + optional_length = -1f; + foreach ( XmlNode level2 in level1.ChildNodes ) { + if ( level2.LocalName == "OptionalLength" ) { + optional_length = float.Parse( level2.InnerText ); + break; + } + } + break; + } + } + + foreach ( XmlNode level1 in doc.DocumentElement.ChildNodes ) { + switch ( level1.LocalName ) { + case "Canvas": + #region Canvas + width = 100; + height = 100; + back_color = -1; + foreach ( XmlNode level2 in level1.ChildNodes ) { + switch ( level2.LocalName ) { + case "Width": + width = int.Parse( level2.InnerText ); + break; + + case "Height": + height = int.Parse( level2.InnerText ); + break; + + case "BackColor": + back_color = int.Parse( level2.InnerText ); + break; + } + } + #endregion + break; + case "Sound": + #region Sound + sound_file = ""; + foreach ( XmlNode level2 in level1.ChildNodes ) { + switch ( level2.LocalName ) { + case "FileName": + sound_file = level2.InnerText; + break; + } + } + #endregion + break; + case "TimeTable": + #region TimeTable + foreach ( XmlNode level2 in level1.ChildNodes ) { + if ( level2.LocalName == "Table" ) { + group_vsq.Add( new TimeTable( "", 0, TimeTableType.vsq, null ) ); + int index = group_vsq.Count - 1; + foreach ( XmlNode level3 in level2.ChildNodes ) { + switch ( level3.LocalName ) { + case "Name": + group_vsq[index].Text = level3.InnerText; + break; + case "Unit": + float start = 0f; + float end = 0f; + string lyric = ""; + string symbol = ""; + foreach ( XmlNode level4 in level3.ChildNodes ) { + switch ( level4.LocalName ) { + case "Start": + start = float.Parse( level4.InnerText ); + break; + case "End": + end = float.Parse( level4.InnerText ); + break; + case "Text": + lyric = level4.InnerText; + break; + case "Symbol": + symbol = level4.InnerText; + break; + } + } + group_vsq[index].Add( new TimeTableEntry( start, end, lyric + "(" + symbol + ")" ) ); + break; + } + } + } + } + #endregion + break; + case "DrawObject": + #region DrawObject + foreach ( XmlNode level2 in level1.ChildNodes ) { + if ( level2.LocalName == "Object" ) { + // 縺セ縺嗾ype繧定ェソ縺ケ繧 + string type_name = ""; + foreach ( XmlNode level3 in level2.ChildNodes ) { + if ( level3.LocalName == "TypeName" ) { + type_name = level3.InnerText; + break; + } + } + + // type縺ァ蜍穂ス懊r蛻繧頑崛縺 + switch ( type_name ) { + case "RipSync.Plugins.Extensions.RipSyncImage.RipSyncImage": + #region RipSync.Plugins.Extensions.RipSyncImage.RipSyncImage + string source_table = ""; + CharacterEx cex = new CharacterEx(); + List events = new List(); + groups_character.Add( new TimeTableGroup( "", 0, null ) ); + int index = groups_character.Count - 1; + foreach ( XmlNode level3 in level2.ChildNodes ) { + switch( level3.LocalName ){ + case "Name": + groups_character[index].Text = level3.InnerText; + break; + case "Parameter": + //MessageBox.Show( "Parameter node" ); + foreach( XmlNode level4 in level3.ChildNodes ){ + switch( level4.LocalName ){ + case "FileName": + string rsi_path = Path.Combine( rsp_path, level4.InnerText ); + cex = RsiReader.Read( rsi_path ); + groups_character[index].Character = cex.character; + break; + case "Table": + source_table = level4.InnerText; + break; + case "Triggers": + foreach( XmlNode level5 in level4.ChildNodes ){ + if ( level5.LocalName == "TriggerEvent" ) { + float time = 0f; + string trigger_name = ""; + string status = ""; + foreach ( XmlNode level6 in level5.ChildNodes ) { + switch ( level6.LocalName ) { + case "Time": + time = float.Parse( level6.InnerText ); + break; + case "TriggerName": + trigger_name = level6.InnerText; + break; + case "Status": + status = level6.InnerText; + break; + } + } + events.Add( new RspTriggerEvent( time, trigger_name, status ) ); + } + } + break; + } + } + break; + } + } + // source_table縺九i縲∝哨繝代け繧剃ス懈 + // group_vsq縺九i縲√ち繧、繝医Ν縺茎ource_table縺ァ謌悶k繧縺、繧呈、懃エ「 + int source = -1; + for ( int i = 0; i < group_vsq.Count; i++ ) { + if ( group_vsq[i].Text == source_table ) { + source = i; + break; + } + } + if ( source >= 0 ) { + // 蜿」繝代け逕ィ縺ョ繧ソ繧、繝繝繝シ繝悶Ν縺梧欠螳壹&繧後※縺縺溷エ蜷 + TimeTableGroup temp = (TimeTableGroup)groups_character[index].Clone(); + TimeTableGroup.GenerateLipSyncFromVsq( + group_vsq[source], + ref temp, + groups_character[index].Character, + optional_length, + true, + save.FrameRate, + 0f ); //todo: 縺薙%縺ョoptional_length縺梧ェ縺励> + groups_character[index] = temp; + } else { + //蜿」繝代け逕ィ繧ソ繧、繝繝繝シ繝悶Ν縺梧欠螳壹&繧後※縺縺ェ縺九▲縺溷エ蜷 + // 逕サ蜒丞縺縺代ヨ繝ゥ繝繧ッ繧堤畑諢 + /*groups_character[index].Add( new TimeTable( "base", 0, TimeTableType.eye, cex.character.Base ) ); + groups_character[index].Add( new TimeTable( "a", 0, TimeTableType.mouth, cex.character.a ) ); + groups_character[index].Add( new TimeTable( "aa", 0, TimeTableType.mouth, cex.character.aa ) ); + groups_character[index].Add( new TimeTable( "i", 0, TimeTableType.mouth, cex.character.i ) ); + groups_character[index].Add( new TimeTable( "u", 0, TimeTableType.mouth, cex.character.u ) ); + groups_character[index].Add( new TimeTable( "e", 0, TimeTableType.mouth, cex.character.e ) ); + groups_character[index].Add( new TimeTable( "o", 0, TimeTableType.mouth, cex.character.o ) ); + groups_character[index].Add( new TimeTable( "xo", 0, TimeTableType.mouth, cex.character.xo ) ); + groups_character[index].Add( new TimeTable( "nn", 0, TimeTableType.mouth, cex.character.nn ) );*/ + for ( int k = 0; k < groups_character[index].Character.Count; k++ ) { + groups_character[index].Add( new TimeTable( groups_character[index].Character[k].title, 0, TimeTableType.character, null ) ); + } + } + + // trigger縺九i縲∬。ィ諠繧定ソス蜉縲 + // 縺セ縺壹∵賜莉悶b閠諷ョ縺励※縲^FF縺ョ繧、繝吶Φ繝医r霑ス蜉 + events.Sort(); + //MessageBox.Show( "events.Cocunt=" + events.Count ); + #region 謗剃サ悶r閠諷ョ縺励※縲^FF繧、繝吶Φ繝医r霑ス蜉 + int ii = -1; + while( (ii + 1) < events.Count ){ + ii++; + //for ( int i = 0; i < events.Count; i++ ) { + string trigger_name = events[ii].triggerName; + //MessageBox.Show( "trigger_name=" + trigger_name ); + float begin = events[ii].time; + float end = begin - 10f; // begin > end縺ァ縺ゅl縺ー-10縺倥c縺ェ縺上※繧ゅ>縺 + // 謗剃サ悶↓隧イ蠖薙@縺ヲ辟。縺縺九←縺縺区、懈渊 + bool exclusion = isExclusionTrigger( cex, trigger_name ); + bool defined = false; // 謗剃サ門宛蠕。縺ァ縲^FF菴咲スョ縺悟ョ夂セゥ縺ァ縺阪◆縺句凄縺 + if ( exclusion ) { + // 謗剃サ門宛蠕。繧偵☆繧句ソ隕√′縺ゅk蝣エ蜷 + // 莉悶ョ謗剃サ冶ヲ∫エ縺ョ荳ュ縺ァ縲|egin繧医j蠕後↓ON縺励※縺縺ヲ縲√°縺、縺昴l縺後b縺」縺ィ繧よ掠縺繧ゅョ繧呈、懃エ「 + float first_begin = end; + //bool int_exclusion = false; + for ( int j = ii + 1; j < events.Count; j++ ) { + if ( isExclusionTrigger( cex, events[j].triggerName ) ) { + defined = true; + end = events[j].time; + break; + } + } + } + //MessageBox.Show( "defined=" + defined ); + if ( !defined ) { + // 縺薙ョ蠕後〒蜷後§繝医Μ繧ャ縺悟阪ウON謖螳壹↓縺ェ縺」縺ヲ縺溘j縲∽ス懃ぜ逧縺ォOFF縺ォ縺輔l縺ヲ辟。縺縺九←縺縺九r讀懈渊 + for ( int j = ii + 1; j < events.Count; j++ ) { + if ( events[j].triggerName == trigger_name ) { + end = events[j].time; + defined = true; + break; + } + } + } + if ( defined ) { + events.Add( new RspTriggerEvent( end, trigger_name, "OFF" ) ); + events.Sort(); + ii++; //++縺励↑縺縺ィ竏槭Ν繝シ繝励□縺ェ + } + } + #endregion + + for ( int i = 0; i < events.Count; i++ ) { + float begin, end; + if ( events[i].status == RspTriggerStatus.ON ){ + // 縺セ縺壹髢句ァ九→邨ゆコ縺ョ譎ょ綾繧定ィュ螳 + begin = events[i].time; + end = -1f; + if ( i + 1 < events.Count ) { + if ( events[i + 1].triggerName == events[i].triggerName && events[i + 1].status == RspTriggerStatus.OFF ) { + end = events[i + 1].time; + } + } + + // 縺ゥ縺ョ繧ソ繧、繝繝ゥ繧、繝ウ縺ォ霑ス蜉縺吶k縺ョ縺九r豎コ螳 + string trigger = events[i].triggerName; + int target = -1; + for ( int j = 0; j < groups_character[index].Count; j++ ) { + if ( groups_character[index][j].Text == trigger ) { + target = j; + break; + } + } + + // 霑ス蜉繧貞ョ溯。 + if ( target >= 0 ) { + groups_character[index][target].Add( new TimeTableEntry( begin, end, trigger ) ); + } + } + } + + #endregion + break; + case "RipSync.Plugins.Extensions.SimpleImage.SimpleImage": + #region RipSync.Plugins.Extensions.SimpleImage.SimpleImage + string image_file = ""; + string name = ""; + foreach ( XmlNode level3 in level2.ChildNodes ) { + switch ( level3.LocalName ) { + case "Parameter": + foreach ( XmlNode level4 in level3.ChildNodes ) { + if ( level4.LocalName == "FileName" ) { + image_file = level3.InnerText; + break; + } + } + break; + case "Name": + name = level3.InnerText; + break; + } + } + + image_file = HttpUtility.UrlDecode( image_file ); + string file = Path.Combine( rsp_path, image_file ); + if ( File.Exists( file ) ) { + Bitmap img = new Bitmap( Common.ImageFromFile( file ) ); + group_another.Add( new TimeTable( name, 0, TimeTableType.another, img ) ); + } else { + group_another.Add( new TimeTable( name, 0, TimeTableType.another, null ) ); + } + + #endregion + break; + case "RipSync.Plugins.Extensions.TextObject.TextObject": + #region RipSync.Plugins.Extensions.TextObject.TextObject + string tname = ""; + string text = ""; + Color color = Color.Black; + Font font = new Font( "MS UI Gothc", 10 ); + foreach ( XmlNode level3 in level2.ChildNodes ) { + switch ( level3.LocalName ) { + case "Name": + tname = level3.InnerText; + break; + case "Parameter": + foreach ( XmlNode level4 in level3.ChildNodes ) { + switch ( level4.LocalName ) { + case "Text": + text = level4.InnerText; + break; + case "Color": + int col = int.Parse( level4.InnerText ); + color = Color.FromArgb( col ); + break; + case "Font": + string font_name = level4.InnerText; + //Microsoft Sans Serif, 12pt, style=Bold + string[] spl = font_name.Split( new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries ); + string font_family = spl[0]; + string font_size = spl[1]; + font_size = font_size.Replace( "pt", "" ); + int em_size = int.Parse( font_size ); + string font_style = ""; + //style=Bold, Italic, Underline, Strikeout + FontStyle t_font_style = FontStyle.Regular; + if ( spl.Length >= 3 ) { + //spl[2]縺ョ縺ソ縲ヾtyle=縺後▽縺縺ヲ繧九ョ縺ァ縺昴l繧偵ッ縺壹☆ + string[] spl2 = spl[2].Split( new string[] { "=" }, StringSplitOptions.RemoveEmptyEntries ); + font_style = spl2[1]; + } + for ( int ic = 3; ic < spl.Length; ic++ ) { + font_style += "," + spl[ic]; + } + spl = font_style.Split( new string[] { "," }, StringSplitOptions.RemoveEmptyEntries ); + foreach ( string style_name in spl ) { + switch ( style_name ) { + case "Bold": + t_font_style = t_font_style | FontStyle.Bold; + break; + case "Italic": + t_font_style = t_font_style | FontStyle.Italic; + break; + case "Underline": + t_font_style = t_font_style | FontStyle.Underline; + break; + case "Strikeout": + t_font_style = t_font_style | FontStyle.Strikeout; + break; + } + } + font = new Font( font_family, em_size, t_font_style ); + break; + } + } + break; + } + } + Telop temp_telop = new Telop( save.GetNextID() ); + temp_telop.Text = text; + temp_telop.Color = color; + temp_telop.Font = font; + temp_telop.Tag = tname; + telop.Add( temp_telop ); + #endregion + break; + } + } + } + #endregion + break; + case "TimeLine": + #region TimeLine + foreach ( XmlNode level2 in level1.ChildNodes ) { + if ( level2.LocalName == "Unit" ) { + int zindex = 0; + float start = 0f; + float end = -10f; + int position_x = 0; + int position_y = 0; + float scale = 1f; + string draw_object = ""; + bool fadein = false; + bool fadeout = false; + foreach ( XmlNode level3 in level2.ChildNodes ) { + switch ( level3.LocalName ) { + case "ZIndex": + zindex = int.Parse( level3.InnerText ); + break; + case "Start": + start = float.Parse( level3.InnerText ); + break; + case "End": + end = float.Parse( level3.InnerText ); + break; + case "PositionX": + position_x = int.Parse( level3.InnerText ); + break; + case "PositionY": + position_y = int.Parse( level3.InnerText ); + break; + case "Scale": + scale = float.Parse( level3.InnerText ); + break; + case "DrawObject": + draw_object = level3.InnerText; + break; + case "FadeIn": + if( level3.InnerText == "True" ){ + fadein = true; + } + break; + case "FadeOut": + if( level3.InnerText == "True" ){ + fadeout = true; + } + break; + } + } + + // 蜷榊燕縺慧raw_object縺ァ縺ゅk繝医Λ繝繧ッシor繧ュ繝」繝ゥ繧ッ繧ソシ峨r讀懃エ「 + // group_another + for ( int i = 0; i < group_another.Count; i++ ) { + if ( draw_object == group_another[i].Text ) { + group_another[i].ZOrder = zindex; + group_another[i].Clear(); + group_another[i].Add( new TimeTableEntry( start, end, draw_object ) ); + group_another[i].Position = new Point( position_x, position_y ); + group_another[i].Scale = scale; + } + } + + // group_character + for ( int i = 0; i < groups_character.Count; i++ ) { + if ( draw_object == groups_character[i].Text ) { + groups_character[i].ZOrder = zindex; + groups_character[i].Position = new Point( position_x, position_y ); + } + } + + // telop + for ( int i = 0; i < telop.Count; i++ ) { + if ( draw_object == (string)telop[i].Tag ) { + telop[i].Start = start; + telop[i].End = end; + telop[i].FadeIn = fadein; + telop[i].FadeOut = fadeout; + telop[i].Position = new Point( position_x, position_y ); + if ( scale != 1 ) { + Font tnew = new Font( telop[i].Font.FontFamily, telop[i].Font.SizeInPoints * scale, telop[i].Font.Style ); + telop[i].Font.Dispose(); + telop[i].Font = null; + telop[i].Font = tnew; + } + } + } + } + } + #endregion + break; + } + } + //MessageBox.Show( "tables=" + group_vsq.Count ); + if ( optional_length < 0 ) { + float thismax = -1; + for ( int track = 0; track < group_vsq.Count; track++ ) { + int last = group_vsq[track].Count - 1; + if ( last >= 0 ) { + thismax = group_vsq[track][last].end; + optional_length = Math.Max( optional_length, thismax ); + } + } + + for ( int group = 0; group < groups_character.Count; group++ ) { + for ( int track = 0; track < groups_character[group].Count; track++ ) { + int last = groups_character[group][track].Count - 1; + if ( last >= 0 ) { + thismax = groups_character[group][track][last].end; + optional_length = Math.Max( optional_length, thismax ); + } + } + } + } + + // 譎る俣縺瑚イ縺ォ縺ェ縺」縺ヲ繧玖。ィ諠逕ィ繧ィ繝ウ繝医Μ繧呈紛逅 + for ( int group = 0; group < groups_character.Count; group++ ) { + for ( int track = 0; track < groups_character[group].Count; track++ ) { + for( int entry = 0; entry < groups_character[group][track].Count; entry++ ){ + if ( groups_character[group][track][entry].end < 0 ) { + groups_character[group][track][entry].end = optional_length; + } + } + } + } + // 譎る俣縺瑚イ縺ォ縺ェ縺」縺ヲ縺繧九◎縺ョ莉悶ョ繧、繝。繝シ繧ク縺ョ繧ィ繝ウ繝医Μ繧呈紛逅 + for ( int track = 0; track < group_another.Count; track++ ) { + for ( int entry = 0; entry < group_another[track].Count; entry++ ) { + if ( group_another[track][entry].end < 0f ) { + group_another[track][entry].end = optional_length; + } + } + } + // 譎る俣縺瑚イ縺ォ縺ェ縺」縺ヲ縺繧九ユ繝ュ繝繝励ョ繧ィ繝ウ繝医Μ繧呈紛逅 + for ( int i = 0; i < telop.Count; i++ ) { + if ( telop[i].End < 0f ) { + telop[i].End = optional_length; + } + } + + // base逕サ蜒上お繝ウ繝医Μ縺ョ菫ョ豁」縲HenMouthFromVsqCore螳溯。梧凾縺ォ縺ッoptional_length == 0縺ェ縺ョ縺ァ縲∽ソョ豁」縲 + for ( int group = 0; group < groups_character.Count; group++ ) { + int index_base = -1; + for ( int track = 0; track < groups_character[group].Count; track++ ) { + if ( groups_character[group][track].Text == "base" ) { + index_base = track; + break; + } + } + if ( index_base >= 0 ) { + groups_character[group][index_base].Clear(); + groups_character[group][index_base].Add( new TimeTableEntry( 0.0f, optional_length, "base" ) ); + } + } + + // zorder縺ョ謨ー蛟、縺罫ip sync縺ァ縺ッ騾縺ェ縺ョ縺ァ菫ョ豁」 + // 縺セ縺營order縺ョ譛螟ァ蛟、繧呈爾縺 + int zmax = -100; + for ( int i = 0; i < group_another.Count; i++ ) { + zmax = Math.Max( zmax, group_another[i].ZOrder ); + } + for ( int i = 0; i < groups_character.Count; i++ ) { + zmax = Math.Max( zmax, groups_character[i].ZOrder ); + } + // 菫ョ豁」 + for ( int i = 0; i < group_another.Count; i++ ) { + group_another[i].ZOrder = zmax - group_another[i].ZOrder; + } + for ( int i = 0; i < groups_character.Count; i++ ) { + groups_character[i].ZOrder = zmax - groups_character[i].ZOrder; + } + + if ( optional_length > 0 ) { + save.m_totalSec = optional_length; + } else { + save.m_totalSec = 0; + } + save.m_group_vsq = (TimeTableGroup)group_vsq.Clone(); + save.m_groups_character.Clear(); + for ( int i = 0; i < groups_character.Count; i++ ) { + save.m_groups_character.Add( groups_character[i] ); + } + save.m_group_another = (TimeTableGroup)group_another.Clone(); + save.m_movieSize = new Size( width, height ); + save.m_telop_ex2.Clear(); + save.m_telop_ex2 = new List(); + for ( int i = 0; i < telop.Count; i++ ) { + save.m_telop_ex2.Add( telop[i] ); + } + save.UpdateZorder(); + save.m_audioFile = sound_file; + //s.InvertZOrder(); + return true; + } + + + /// + /// 謖螳壹&繧後◆蜷榊燕縺ョ繝医Μ繧ャ繝シ縺後∵賜莉匁欠螳壹&繧後※縺繧九°蜷ヲ縺九r蛻、螳壹@縺セ縺 + /// + /// 蛻、螳壹↓菴ソ逕ィ縺輔l繧気haracterEx + /// 讀懈渊縺吶k繝医Μ繧ャ繝シ縺ョ蜷榊燕 + /// + private static bool isExclusionTrigger( CharacterEx cex, string name ) { + for ( int i = 0; i < cex.exclusion.Count; i++ ) { + if ( cex.exclusion[i] == name ) { + return true; + } + } + return false; + } + + } + + + +} diff --git a/trunk/LipSync/Editor/ScoreUnit.cs b/trunk/LipSync/Editor/ScoreUnit.cs new file mode 100644 index 0000000..11451a6 --- /dev/null +++ b/trunk/LipSync/Editor/ScoreUnit.cs @@ -0,0 +1,52 @@ +サソ/* + * ScoreUnit.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; + +using Boare.Lib.Vsq; + +namespace LipSync { + + /// + /// 讌ス隴懊ョ荳驛ィ蛻繧貞叙繧頑桶縺縺セ縺吶ゅ◆縺縺怜腰荳縺ョ諡榊ュ舌〒陦ィ迴セ縺ァ縺阪k驛ィ蛻縺ョ縺ソ + /// + [Serializable, Obsolete] + public class ScoreUnit { + /// + /// 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺瑚。ィ縺呎・ス隴懊ョ縲∵峇鬆ュ縺九i縺ョ譎ょ綾繧定。ィ縺励∪縺 + /// + public float Start; + /// + /// 諡榊ュ舌ョ蛻蟄 + /// + public int Numerator; + /// + /// 諡榊ュ舌ョ蛻豈 + /// + public int Denominator; + /// + /// 繝繝ウ繝昴ョ螟画峩諠蝣ア繧呈シ邏阪@縺溘Μ繧ケ繝 + /// + public List TempoList; + + public ScoreUnit() { + Start = 0f; + Numerator = 4; + Denominator = 4; + TempoList = new List(); + TempoList.Add( new TempoTableEntry( 0, 480000, 0.0 ) ); + } + } + +} diff --git a/trunk/LipSync/Editor/SelectCharacter.cs b/trunk/LipSync/Editor/SelectCharacter.cs new file mode 100644 index 0000000..55a0be1 --- /dev/null +++ b/trunk/LipSync/Editor/SelectCharacter.cs @@ -0,0 +1,132 @@ +サソ/* + * SelectCharacter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class SelectCharacater : Form, IMultiLanguageControl { + Character3 m_character; + string m_path; + + public SelectCharacater( List plugins ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + m_character = Character3.Miku; + comboBox1.Items.Clear(); + for ( int i = 0; i < plugins.Count; i++ ) { + comboBox1.Items.Add( plugins[i] ); + } + if ( comboBox1.Items.Count == 0 ) { + radioPlugin.Enabled = false; + } + chkImport.Checked = !AppManager.Config.SaveCharacterConfigOutside; + chkImport.Enabled = false; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.radioPlugin.Text = _( "Plugin" ); + this.radioCustom.Text = _( "Custom" ); + this.radioBuiltIn.Text = _( "Built-in" ) + " (Miku)"; + this.label1.Text = _( "Select character to generate lip-sync" ); + this.btnOK.Text = _( "OK" ); + this.btnCancel.Text = _( "Cancel" ); + this.radioRin.Text = _( "Built-in" ) + " (Rin)"; + this.radioLen.Text = _( "Built-in" ) + " (Len)"; + this.Text = _( "Character selection" ); + } + + private static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public string Path { + get { + return m_path; + } + } + + public Character3 Character { + get { + return m_character; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + if ( radioBuiltIn.Checked ) { + chkImport.Checked = false; + this.DialogResult = DialogResult.OK; + this.Close(); + } else if ( radioRin.Checked ) { + chkImport.Checked = false; + m_character = Character3.Rin; + this.DialogResult = DialogResult.OK; + this.Close(); + } else if ( radioLen.Checked ) { + chkImport.Checked = false; + m_character = Character3.Len; + this.DialogResult = DialogResult.OK; + this.Close(); + } else if ( radioCustom.Checked ) { + GenerateCharacter gc = new GenerateCharacter( new Character3() ); + gc.LastPath = AppManager.Config.LastCharacterPath; + if ( gc.ShowDialog() == DialogResult.OK ) { + //Form1.Instatnce.Config.LAST_CHARACTER_PATH = gc.LastPath; + m_character = gc.EditedResult.Character; + m_path = gc.LastPath; + this.DialogResult = DialogResult.OK; + this.Close(); + } + gc.Dispose(); + } else { + string id = (string)comboBox1.SelectedItem; + int index = -1; + for ( int i = 0; i < AppManager.SaveData.m_plugins_config.Count; i++ ) { + if ( id == AppManager.SaveData.m_plugins_config[i].ID ) { + index = i; + break; + } + } + if ( index >= 0 ) { + m_character = new Character3( AppManager.SaveData.m_plugins_config[index] ); + this.DialogResult = DialogResult.OK; + } else { + this.DialogResult = DialogResult.Cancel; + } + this.Close(); + } + } + + private void radioPlugin_CheckedChanged( object sender, EventArgs e ) { + comboBox1.Enabled = radioPlugin.Checked; + } + + private void radioCustom_CheckedChanged( object sender, EventArgs e ) { + chkImport.Enabled = radioCustom.Checked; + } + } + +} diff --git a/trunk/LipSync/Editor/SelectCharacter.designer.cs b/trunk/LipSync/Editor/SelectCharacter.designer.cs new file mode 100644 index 0000000..f03f79c --- /dev/null +++ b/trunk/LipSync/Editor/SelectCharacter.designer.cs @@ -0,0 +1,219 @@ +/* + * SelectCharacter.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class SelectCharacater { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.panel1 = new System.Windows.Forms.Panel(); + this.radioLen = new System.Windows.Forms.RadioButton(); + this.radioRin = new System.Windows.Forms.RadioButton(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.radioPlugin = new System.Windows.Forms.RadioButton(); + this.radioCustom = new System.Windows.Forms.RadioButton(); + this.radioBuiltIn = new System.Windows.Forms.RadioButton(); + this.label1 = new System.Windows.Forms.Label(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.chkImport = new System.Windows.Forms.CheckBox(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.AutoSize = true; + this.panel1.Controls.Add( this.radioLen ); + this.panel1.Controls.Add( this.radioRin ); + this.panel1.Controls.Add( this.comboBox1 ); + this.panel1.Controls.Add( this.radioPlugin ); + this.panel1.Controls.Add( this.radioCustom ); + this.panel1.Controls.Add( this.radioBuiltIn ); + this.panel1.Location = new System.Drawing.Point( 12, 41 ); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size( 254, 140 ); + this.panel1.TabIndex = 0; + // + // radioLen + // + this.radioLen.AutoSize = true; + this.radioLen.Location = new System.Drawing.Point( 16, 56 ); + this.radioLen.Name = "radioLen"; + this.radioLen.Size = new System.Drawing.Size( 97, 16 ); + this.radioLen.TabIndex = 3; + this.radioLen.Text = "繝薙Ν繝医う繝ウシLenシ"; + this.radioLen.UseVisualStyleBackColor = true; + // + // radioRin + // + this.radioRin.AutoSize = true; + this.radioRin.Location = new System.Drawing.Point( 16, 34 ); + this.radioRin.Name = "radioRin"; + this.radioRin.Size = new System.Drawing.Size( 96, 16 ); + this.radioRin.TabIndex = 2; + this.radioRin.Text = "繝薙Ν繝医う繝ウシRinシ"; + this.radioRin.UseVisualStyleBackColor = true; + // + // comboBox1 + // + this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBox1.Enabled = false; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point( 99, 109 ); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size( 141, 20 ); + this.comboBox1.TabIndex = 6; + // + // radioPlugin + // + this.radioPlugin.AutoSize = true; + this.radioPlugin.Location = new System.Drawing.Point( 16, 100 ); + this.radioPlugin.Name = "radioPlugin"; + this.radioPlugin.Size = new System.Drawing.Size( 67, 16 ); + this.radioPlugin.TabIndex = 5; + this.radioPlugin.Text = "繝励Λ繧ー繧、繝ウ"; + this.radioPlugin.UseVisualStyleBackColor = true; + this.radioPlugin.CheckedChanged += new System.EventHandler( this.radioPlugin_CheckedChanged ); + // + // radioCustom + // + this.radioCustom.AutoSize = true; + this.radioCustom.Location = new System.Drawing.Point( 16, 78 ); + this.radioCustom.Name = "radioCustom"; + this.radioCustom.Size = new System.Drawing.Size( 59, 16 ); + this.radioCustom.TabIndex = 4; + this.radioCustom.Text = "繧ォ繧ケ繧ソ繝"; + this.radioCustom.UseVisualStyleBackColor = true; + this.radioCustom.CheckedChanged += new System.EventHandler( this.radioCustom_CheckedChanged ); + // + // radioBuiltIn + // + this.radioBuiltIn.AutoSize = true; + this.radioBuiltIn.Checked = true; + this.radioBuiltIn.Location = new System.Drawing.Point( 16, 12 ); + this.radioBuiltIn.Name = "radioBuiltIn"; + this.radioBuiltIn.Size = new System.Drawing.Size( 103, 16 ); + this.radioBuiltIn.TabIndex = 1; + this.radioBuiltIn.TabStop = true; + this.radioBuiltIn.Text = "繝薙Ν繝医う繝ウシMikuシ"; + this.radioBuiltIn.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoEllipsis = true; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 10, 9 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 237, 12 ); + this.label1.TabIndex = 1; + this.label1.Text = "蜿」繝代け逕滓舌↓菴ソ逕ィ縺吶k繧ュ繝」繝ゥ繧ッ繧ソ繧帝∈謚槭@縺ヲ縺上□縺輔>"; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 99, 223 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 8; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 195, 223 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 9; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // chkImport + // + this.chkImport.AutoSize = true; + this.chkImport.Location = new System.Drawing.Point( 26, 195 ); + this.chkImport.Name = "chkImport"; + this.chkImport.Size = new System.Drawing.Size( 206, 16 ); + this.chkImport.TabIndex = 7; + this.chkImport.Text = "LSE繝輔ぃ繧、繝ォ縺ォ繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳壹r蝓九a霎シ繧"; + this.chkImport.UseVisualStyleBackColor = true; + this.chkImport.Visible = false; + // + // SelectCharacater + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 282, 262 ); + this.Controls.Add( this.chkImport ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.panel1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SelectCharacater"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "繧ュ繝」繝ゥ繧ッ繧ソ縺ョ驕ク謚"; + this.panel1.ResumeLayout( false ); + this.panel1.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.RadioButton radioCustom; + private System.Windows.Forms.RadioButton radioBuiltIn; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.RadioButton radioPlugin; + private System.Windows.Forms.RadioButton radioLen; + private System.Windows.Forms.RadioButton radioRin; + private System.Windows.Forms.CheckBox chkImport; + + } +} diff --git a/trunk/LipSync/Editor/SetSize.cs b/trunk/LipSync/Editor/SetSize.cs new file mode 100644 index 0000000..d8bf04e --- /dev/null +++ b/trunk/LipSync/Editor/SetSize.cs @@ -0,0 +1,133 @@ +/* + * SetSize.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Reflection; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class SetSize : Form, IMultiLanguageControl { + private T x; + private T y; + private MethodInfo m_parse_method_info = null; + + public SetSize( string dialog_title, string title_x, string title_y, T def_x, T def_y ) { + Assembly a = Assembly.GetAssembly( typeof( T ) ); + Type[] ts = a.GetTypes(); + bool found = false; + foreach ( Type t in ts ) { + if ( t.Equals( typeof( T ) ) ) { + MethodInfo[] mis = t.GetMethods(); + foreach ( MethodInfo mi in mis ) { + if ( mi.ReturnType.Equals( typeof( T ) ) && mi.Name == "Parse" && mi.IsStatic && mi.IsPublic ) { + ParameterInfo[] pis = mi.GetParameters(); + if ( pis.Length == 1 ) { + if ( pis[0].ParameterType.Equals( typeof( string ) ) ) { + m_parse_method_info = mi; + found = true; + break; + } + } + } + } + if ( found ) { + break; + } + } + } + if ( !found ) { + throw new NotSupportedException( "generic type T must support 'public static T Parse( string ){...}' method" ); + } + InitializeComponent(); + ApplyFont( AppManager.Config.Font.GetFont() ); + label1.Text = title_x; + label2.Text = title_y; + txtHeight.Text = def_y.ToString(); + txtWidth.Text = def_x.ToString(); + x = def_x; + y = def_y; + this.Text = dialog_title; + } + + public void ApplyLanguage() { + this.btnCancel.Text = _( "Cancel" ); + this.btnOK.Text = _( "OK" ); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public T ResultWidth { + get { + return x; + } + } + + public T ResultHeight { + get { + return y; + } + } + + public string Title { + get { + return this.Text; + } + set { + this.Text = value; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + T xx = x; + T yy = y; + try { + xx = (T)m_parse_method_info.Invoke( typeof( T ), new object[]{ txtWidth.Text } ); + yy = (T)m_parse_method_info.Invoke( typeof( T ), new object[]{ txtHeight.Text } ); + } catch { + MessageBox.Show( + _( "Invalid value has been entered" ), + _( "Error" ), + MessageBoxButtons.OK, + MessageBoxIcon.Exclamation ); + xx = x; + yy = y; + return; + } finally { + x = xx; + y = yy; + } + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void btnCancel_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + } + +} diff --git a/trunk/LipSync/Editor/SetSize.designer.cs b/trunk/LipSync/Editor/SetSize.designer.cs new file mode 100644 index 0000000..76a3735 --- /dev/null +++ b/trunk/LipSync/Editor/SetSize.designer.cs @@ -0,0 +1,136 @@ +/* + * SetSize.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class SetSize { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtWidth = new System.Windows.Forms.TextBox(); + this.txtHeight = new System.Windows.Forms.TextBox(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 21, 19 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 17, 12 ); + this.label1.TabIndex = 0; + this.label1.Text = "蟷"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 21, 48 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 25, 12 ); + this.label2.TabIndex = 1; + this.label2.Text = "鬮倥&"; + // + // txtWidth + // + this.txtWidth.Location = new System.Drawing.Point( 67, 16 ); + this.txtWidth.Name = "txtWidth"; + this.txtWidth.Size = new System.Drawing.Size( 114, 19 ); + this.txtWidth.TabIndex = 2; + // + // txtHeight + // + this.txtHeight.Location = new System.Drawing.Point( 67, 45 ); + this.txtHeight.Name = "txtHeight"; + this.txtHeight.Size = new System.Drawing.Size( 114, 19 ); + this.txtHeight.TabIndex = 3; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 123, 87 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 71, 24 ); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler( this.btnCancel_Click ); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 12, 87 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 71, 24 ); + this.btnOK.TabIndex = 4; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // SetSize + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 206, 123 ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.txtHeight ); + this.Controls.Add( this.txtWidth ); + this.Controls.Add( this.label2 ); + this.Controls.Add( this.label1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SetSize"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "SetSize"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtWidth; + private System.Windows.Forms.TextBox txtHeight; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + } + +} diff --git a/trunk/LipSync/Editor/Settings.cs b/trunk/LipSync/Editor/Settings.cs new file mode 100644 index 0000000..4ca1952 --- /dev/null +++ b/trunk/LipSync/Editor/Settings.cs @@ -0,0 +1,214 @@ +/* + * Settings.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Runtime.Serialization; + +using Boare.Lib.AppUtil; +using Boare.Lib.Vsq; + +namespace LipSync { + + [Serializable] + public class Settings : IDisposable/*, ICloneable*/ { + const double tpq_sec = 480000000.0; + + public TimeTableGroup m_group_vsq; //ok + public List m_groups_character; //ok + public TimeTableGroup m_group_another; //ok + public TimeTableGroup m_group_plugin; //ok + [Obsolete] + //public float fps = 30.0f; //ok + float fps = 30f; + public int m_screenWidth; //ok + public int m_screenHeight; //ok + public float m_totalSec = 0.0f; //ok + public Size m_movieSize; // = new Size( 512, 384 ); //ok + public List m_plugins_config; //ok + public string m_audioFile = ""; //ok + [OptionalField] + public Color CANVAS_BACKGROUND; // = Color.White; //ok + [OptionalField, Obsolete] + public List m_telop; //ok + [OptionalField] + public float REPEAT_START; //ok + [OptionalField] + public float REPEAT_END; //ok + [OptionalField, Obsolete]//[OptionalField] + public SortedDictionary m_telop_ex = new SortedDictionary(); //OK + [OptionalField, Obsolete] + public List m_score_unit; + [OptionalField, Obsolete] + public List m_timesig; + [OptionalField] + public List m_timesig_ex; + [OptionalField] + public List m_tempo; + [OptionalField] + public int m_base_tempo; + [OptionalField] + public uint m_dwRate = 30; + [OptionalField] + public uint m_dwScale = 1; + [NonSerialized] + private float m_fps_buffer = 30f; + [NonSerialized] + public PluginInfo[] m_plugins; + [OptionalField] + public List m_telop_ex2 = new List(); + + /// + /// 謠冗判鬆蠎上〒譬シ邏阪&繧後◆謠冗判迚ゥ縺ョ繝ェ繧ケ繝 + /// + [NonSerialized] + public List m_zorder = new List(); + [NonSerialized] + public List m_commands = new List(); + [NonSerialized] + public int m_command_position = -1; + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public Settings() { + m_zorder = new List(); + m_commands = new List(); + m_command_position = -1; + m_group_vsq = new TimeTableGroup( _( "VSQ Tracks" ), -1, null ); + m_groups_character = new List(); + m_group_another = new TimeTableGroup( _( "Another images" ), -1, null ); + m_group_plugin = new TimeTableGroup( _( "Plugin" ), -1, null ); + m_telop_ex2 = new List(); + m_screenWidth = 512; + m_screenHeight = 384; + m_totalSec = 0.0f; + m_movieSize = new Size( 512, 384 ); + m_plugins_config = new List(); + m_audioFile = ""; + CANVAS_BACKGROUND = Color.White; + //m_telop = new List(); + //m_telop_ex = new SortedDictionary(); + m_telop_ex2 = new List(); + m_score_unit = new List(); + m_score_unit.Add( new ScoreUnit() ); + m_timesig_ex = new List(); + m_tempo = new List(); + m_base_tempo = 480000; + m_dwRate = 30; + m_dwScale = 1; + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; + } + + [OnSerializing] + private void onSerializing( StreamingContext sc ) { + m_telop = null; + m_telop_ex = null; + } + + [OnDeserializing] + private void onDeserializing( StreamingContext sc ) { + CANVAS_BACKGROUND = Color.White; + m_telop_ex2 = new List(); + REPEAT_START = 0f; + REPEAT_END = -1f; + m_score_unit = new List(); + m_dwRate = 0; + m_dwScale = 0; + } + + + [OnDeserialized] + void onDeserialized( StreamingContext sc ) { +#if DEBUG + Console.WriteLine( "Settings.onDeserialized(StreamingContext)" ); +#endif + m_score_unit = new List(); + m_score_unit.Add( new ScoreUnit() ); + if ( m_telop != null ) { + if ( m_telop_ex2 != null ) { + m_telop_ex2.Clear(); + m_telop_ex2 = null; + } + m_telop_ex2 = new List(); + for ( int i = 0; i < m_telop.Count; i++ ) { + m_telop_ex2.Add( (Telop)m_telop[i].Clone( i ) ); + } + m_telop.Clear(); + m_telop = null; + } + if ( m_telop_ex != null ) { + if ( m_telop_ex2 != null ) { + m_telop_ex2.Clear(); + m_telop_ex2 = null; + } + m_telop_ex2 = new List(); + int index = -1; + foreach ( KeyValuePair telop in m_telop_ex ) { + index++; + m_telop_ex2.Add( (Telop)telop.Value.Clone( index ) ); + } + m_telop_ex.Clear(); + m_telop_ex = null; + } + m_commands = new List(); + m_command_position = -1; + m_zorder = new List(); + if ( m_timesig_ex == null ) { + m_timesig_ex = new List(); + } + if ( m_tempo == null ) { + m_tempo = new List(); + } + if ( m_dwRate == 0 ) { + m_dwScale = 1000; + m_dwRate = (uint)(fps * m_dwScale); + } + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; +#if DEBUG + Common.DebugWriteLine( "----------" ); + Common.DebugWriteLine( "Settings.onDeserialized(StreamingContext)" ); + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + Common.DebugWriteLine( "i=" + i + "; ID=" + m_telop_ex2[i].ID + "; Text=" + m_telop_ex2[i].Text ); + } + Common.DebugWriteLine( "----------" ); +#endif + } + + public void Dispose() { + if ( m_group_vsq != null ) { + m_group_vsq.Dispose(); + m_group_vsq = null; + } + if ( m_groups_character != null ) { + m_groups_character.Clear(); + m_groups_character = null; + } + if ( m_group_another != null ) { + m_group_another.Dispose(); + m_group_another = null; + } + if ( m_group_plugin != null ) { + m_group_plugin.Dispose(); + m_group_plugin = null; + } + if ( m_plugins_config != null ) { + m_plugins_config.Clear(); + m_plugins_config = null; + } + } + } + +} diff --git a/trunk/LipSync/Editor/SettingsEx.cs b/trunk/LipSync/Editor/SettingsEx.cs new file mode 100644 index 0000000..edf315e --- /dev/null +++ b/trunk/LipSync/Editor/SettingsEx.cs @@ -0,0 +1,1115 @@ +/* + * SettingsEx.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.Runtime.Serialization; + +using Boare.Lib.AppUtil; +using Boare.Lib.Vsq; + +namespace LipSync { + + public delegate void CommandExecutedEventHandler( TimeTableType command_target, CommandType command_type ); + + [Serializable] + public class SettingsEx : IDisposable, ICloneable { + const double tpq_sec = 480000000.0; + + public TimeTableGroup m_group_vsq; //ok + public List m_groups_character; //ok + public TimeTableGroup m_group_another; //ok + public TimeTableGroup m_group_plugin; //ok + public int m_screenWidth = 512; //ok + public int m_screenHeight = 384; //ok + public float m_totalSec = 0.0f; //ok + public Size m_movieSize; // = new Size( 512, 384 ); //ok + public List m_plugins_config; //ok + public string m_audioFile = ""; //ok + [OptionalField] + public Color CANVAS_BACKGROUND; // = Color.White; //ok + [OptionalField] + public float REPEAT_START; //ok + [OptionalField] + public float REPEAT_END; //ok + [OptionalField] + public List m_timesig_ex; + [OptionalField] + public List m_tempo; + [OptionalField] + public int m_base_tempo; + [OptionalField] + public uint m_dwRate = 30; + [OptionalField] + public uint m_dwScale = 1; + [NonSerialized] + private float m_fps_buffer = 30f; + [NonSerialized] + public PluginInfo[] m_plugins; + [OptionalField] + public List m_telop_ex2 = new List(); + [OptionalField] + public bool TelopListFolded = false; + /// + /// 謠冗判鬆蠎上〒譬シ邏阪&繧後◆謠冗判迚ゥ縺ョ繝ェ繧ケ繝 + /// + [NonSerialized] + public List m_zorder = new List(); + [OptionalField] + public string VersionMarker = AppManager.VERSION;// "2.4.4"; + + public static event CommandExecutedEventHandler CommandExecuted; + + private static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public void DrawTo( Graphics g, Size mSize, float now, bool is_transparent ) { + DrawTo( g, mSize, now, is_transparent, "", 0 ); + } + + public void DrawTo( Graphics g, Size mSize, float now, bool is_transparent, string mouth, int mouth_force_group_index ) { + if ( mouth.Length == 0 ) { + mouth_force_group_index = -1; + } +#if DEBUG + //Common.DebugWriteLine( "SettingsEx+DrawTo(Graphics,Size,float,bool)" ); + int chrpos = 10; +#endif + g.SmoothingMode = SmoothingMode.AntiAlias; + g.InterpolationMode = InterpolationMode.HighQualityBicubic; + + if ( is_transparent ) { + g.Clear( Color.Transparent ); + } else { + g.Clear( CANVAS_BACKGROUND ); + } + + ColorMatrix cm = new ColorMatrix(); + cm.Matrix00 = 1; + cm.Matrix11 = 1; + cm.Matrix22 = 1; + cm.Matrix33 = 1f; + cm.Matrix44 = 1; + + for ( int z = 0; z < m_zorder.Count; z++ ) { + ZorderItemType type = m_zorder[z].Type; + int index = m_zorder[z].Index; + + Bitmap tmp = null; + PointF position = new PointF(); + float scale = 1f; + float alpha = 1f; + float rotate = 0f; + Size size = new Size(); + + if ( type == ZorderItemType.another ) { + if ( !m_group_another[index].IsAviMode ) { + if ( m_group_another[index].Image == null ) { + continue; + } + int start_entry = m_group_another[index].Value; + for ( int entry = start_entry; entry < m_group_another[index].Count; entry++ ) { + if ( m_group_another[index][entry].begin <= now && now <= m_group_another[index][entry].end ) { + m_group_another[index].Value = entry; + tmp = m_group_another[index].Image; + break; + } + } + } else { + tmp = m_group_another[index].GetImage( now ); + } + position = m_group_another[index].GetPosition( now ); + size = m_group_another[index].ImageSize; + scale = m_group_another[index].GetScale( now ); + alpha = m_group_another[index].GetAlpha( now ); + rotate = m_group_another[index].GetRotate( now ); + } else if ( type == ZorderItemType.character ) { + if ( m_groups_character[index].Character.Type == CharacterType.def ) { + int[] draw; + if ( mouth_force_group_index == index ) { + draw = m_groups_character[index].GetDrawObjectIndex( now, mouth ); + } else { + draw = m_groups_character[index].GetDrawObjectIndex( now, "" ); + } + position = m_groups_character[index].GetPosition( now ); + size = m_groups_character[index].Character.Size; + scale = m_groups_character[index].GetScale( now ); + float tscale = Math.Abs( scale ); + if ( tscale == 0.0f ) { + continue; + } + alpha = m_groups_character[index].GetAlpha( now ); + if ( alpha <= 0.0f ) { + continue; + } + rotate = m_groups_character[index].GetRotate( now ); +#if DEBUG + chrpos += 10; + g.DrawString( "character: position=" + position + ", m_groups_character[group].Position=" + m_groups_character[index].Position, AppManager.Config.Font.GetFont(), Brushes.Black, new PointF( 0, chrpos ) ); +#endif + tmp = m_groups_character[index].Character.Face( draw ); + } else { + string[] draw = m_groups_character[index].GetDrawObjectNames( now ); + int target_plugin = -1; + for ( int i = 0; i < m_plugins_config.Count; i++ ) { + if ( m_plugins_config[i].ID == m_groups_character[index].Character.PluginConfig.ID ) { + target_plugin = i; + break; + } + } + if ( target_plugin >= 0 ) { + string s = ""; + bool first = true; + for ( int i = 0; i < draw.Length; i++ ) { + if ( first ) { + s += draw[i]; + first = false; + } else { + s += "\n" + draw[i]; + } + } + m_plugins[target_plugin].Instance.Render( g, mSize, now, s, "" ); + } + continue; + } + } else if ( type == ZorderItemType.plugin ) { + int start_entry = m_group_plugin[index].Value; + for ( int entry = start_entry; entry < m_group_plugin[index].Count; entry++ ) { + if ( m_group_plugin[index][entry].begin <= now && now <= m_group_plugin[index][entry].end ) { + m_group_plugin[index].Value = entry; +#if DEBUG + chrpos += 10; + g.DrawString( "plugin", AppManager.Config.Font.GetFont(), Brushes.Black, new PointF( 0, chrpos ) ); +#endif + tmp = new Bitmap( mSize.Width, mSize.Height ); + TimeTableEntry tmptt = m_group_plugin[index][entry]; + m_plugins[index].Instance.Apply( ref tmp, now, tmptt.begin, tmptt.end, ref tmptt.body ); + m_group_plugin[index][entry] = tmptt; + size = mSize; + position = new PointF( 0f, 0f ); + alpha = 1f; + scale = 1f; + rotate = 0f; + break; + } + } + } else { + continue; + } + + if ( tmp != null ) { + float tscale = Math.Abs( scale ); + if ( scale < 0 ) { + tmp.RotateFlip( RotateFlipType.RotateNoneFlipX ); + } + if ( scale != 0.0f ) { + g.ResetTransform(); + float half_width = size.Width / 2f; + float half_height = size.Height / 2f; + g.TranslateTransform( position.X + half_width * tscale, position.Y + half_height * tscale ); + if ( scale != 1f ) { + g.ScaleTransform( tscale, tscale ); + } + InterpolationMode im = g.InterpolationMode; + SmoothingMode sm = g.SmoothingMode; + if ( scale == 1f && rotate == 0f ) { + g.InterpolationMode = InterpolationMode.Default; + g.SmoothingMode = SmoothingMode.Default; + } + if ( rotate != 0f ) { + g.RotateTransform( rotate ); + } + if ( 0 < alpha && alpha < 1f ) { + cm.Matrix33 = alpha; + ImageAttributes ia = new ImageAttributes(); + ia.SetColorMatrix( cm ); + g.DrawImage( tmp, + new PointF[]{ new PointF( -half_width, - half_height ), + new PointF( half_width, -half_height ), + new PointF( -half_width, half_height ) }, + new RectangleF( 0f, 0f, size.Width, size.Height ), + GraphicsUnit.Pixel, + ia ); + } else if ( alpha != 0f ) { + g.DrawImage( tmp, -half_width, -half_height, (float)size.Width, (float)size.Height ); + } + g.InterpolationMode = im; + g.SmoothingMode = sm; + g.ResetTransform(); + } + } + } + + //譛蠕後↓蟄怜ケ輔r蜈・繧後k + foreach ( Telop telop in m_telop_ex2 ) { + if ( telop.Start <= now && now <= telop.End ) { + float alpha = 1f; + if ( telop.FadeIn ) { + float diff = now - telop.Start; + if ( 0f <= diff && diff <= telop.FadeInSpan ) { + alpha = 1.0f / telop.FadeInSpan * diff; + } + } + if ( telop.FadeOut ) { + float diff = telop.End - now; + if ( 0f <= diff && diff <= telop.FadeOutSpan ) { + alpha = 1.0f / telop.FadeOutSpan * diff; + } + } + PointF position = telop.GetPosition( now ); + Size size = telop.ImageSize; + float scale = telop.GetScale( now ); + float talpha = telop.GetAlpha( now ); + float rotate = telop.GetRotate( now ); + g.ResetTransform(); + if ( scale != 0.0f ) { + g.TranslateTransform( position.X + size.Width / 2f * scale, position.Y + size.Height / 2f * scale ); + if ( scale != 1f ) { + g.ScaleTransform( scale, scale ); + } + if ( rotate != 0f ) { + g.RotateTransform( rotate ); + } + g.DrawString( telop.Text, + telop.Font, + new SolidBrush( Color.FromArgb( (int)(talpha * alpha * 255), telop.Color ) ), + (int)(-size.Width / 2), + (int)(-size.Height / 2) ); + g.ResetTransform(); + } + } + } + //} + //return bmp; + } + + + /// + /// Settings縺九i縺ョ繧ウ繝ウ繝舌シ繝 + /// + /// + public SettingsEx( Settings s ) { +#if DEBUG + Common.DebugWriteLine( "SettingsEx..ctor(Settings)" ); +#endif + m_group_vsq = (TimeTableGroup)s.m_group_vsq.Clone(); + m_groups_character = new List(); + for( int i = 0; i < s.m_groups_character.Count; i++ ){ + m_groups_character.Add( (TimeTableGroup)s.m_groups_character[i].Clone() ); + } + m_group_another = (TimeTableGroup)s.m_group_another.Clone(); + m_group_plugin = (TimeTableGroup)s.m_group_plugin.Clone(); + m_screenWidth = s.m_screenWidth; + m_screenHeight = s.m_screenHeight; + m_totalSec = s.m_totalSec; + m_movieSize = s.m_movieSize; + m_plugins_config = new List(); + for( int i = 0; i < s.m_plugins_config.Count; i++ ){ + m_plugins_config.Add( s.m_plugins_config[i].Clone() ); + } + m_audioFile = s.m_audioFile; + CANVAS_BACKGROUND = s.CANVAS_BACKGROUND; + REPEAT_START = s.REPEAT_START; + REPEAT_END = s.REPEAT_START; + m_timesig_ex = new List(); + for( int i = 0; i < s.m_timesig_ex.Count; i++ ){ + if ( s.m_timesig_ex[i].Numerator == 0 || s.m_timesig_ex[i].Denominator == 0 ) { + m_timesig_ex.Clear(); + break; + } + m_timesig_ex.Add( (TimeSigTableEntry)s.m_timesig_ex[i].Clone() ); + } + m_tempo = new List(); + for( int i = 0; i < s.m_tempo.Count; i++ ){ + m_tempo.Add( (TempoTableEntry)s.m_tempo[i].Clone() ); + } + m_base_tempo = s.m_base_tempo; + m_dwRate = s.m_dwRate; + m_dwScale = s.m_dwScale; + m_fps_buffer = m_dwRate / (float)m_dwScale; + m_telop_ex2 = new List(); + for ( int i = 0; i < s.m_telop_ex2.Count; i++ ) { + m_telop_ex2.Add( (Telop)s.m_telop_ex2[i].Clone() ); + } + } + + public Telop this[int id] { + get { + foreach ( Telop item in m_telop_ex2 ) { + if ( item.ID == id ) { + return item; + } + } + return null; + } + set { + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + if ( m_telop_ex2[i].ID == id ) { + m_telop_ex2[i] = value; + break; + } + } + } + } + + public float FrameRate { + get { + return m_fps_buffer; + } + } + + public uint DwRate { + get { + return m_dwRate; + } + set { + m_dwRate = value; + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; + } + } + + public uint DwScale { + get { + return m_dwScale; + } + set { + m_dwScale = value; + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; + } + } + + public object Clone() { + SettingsEx res = new SettingsEx(); + res.m_group_vsq = (TimeTableGroup)m_group_vsq.Clone(); + res.m_groups_character = new List(); + for ( int i = 0; i < m_groups_character.Count; i++ ) { + res.m_groups_character.Add( (TimeTableGroup)m_groups_character[i].Clone() ); + } + res.m_group_another = (TimeTableGroup)m_group_another.Clone(); + res.m_group_plugin = (TimeTableGroup)m_group_plugin.Clone(); + //res.fps = fps; + res.m_screenWidth = m_screenWidth; + res.m_screenHeight = m_screenHeight; + res.m_totalSec = m_totalSec; + res.m_movieSize = m_movieSize; + res.m_plugins_config = new List(); + for ( int i = 0; i < m_plugins_config.Count; i++ ) { + res.m_plugins_config.Add( m_plugins_config[i].Clone() ); + } + res.m_audioFile = m_audioFile; + res.CANVAS_BACKGROUND = CANVAS_BACKGROUND; + res.REPEAT_START = REPEAT_START; + res.REPEAT_END = REPEAT_END; + res.m_telop_ex2 = new List(); + foreach ( Telop item in m_telop_ex2 ) { + res.m_telop_ex2.Add( (Telop)item.Clone() ); + } + res.m_timesig_ex = new List(); + for ( int i = 0; i < m_timesig_ex.Count; i++ ) { + res.m_timesig_ex.Add( (TimeSigTableEntry)m_timesig_ex[i].Clone() ); + } + res.m_tempo = new List(); + for ( int i = 0; i < m_tempo.Count; i++ ) { + res.m_tempo.Add( (TempoTableEntry)m_tempo[i].Clone() ); + } + res.m_base_tempo = m_base_tempo; + res.m_zorder = new List(); + for ( int i = 0; i < m_zorder.Count; i++ ) { + res.m_zorder.Add( (ZorderItem)m_zorder[i].Clone() ); + } + /*res.m_commands = new List(); + for ( int i = 0; i < m_commands.Count; i++ ) { + res.m_commands.Add( m_commands[i].Clone() ); + } + res.m_command_position = m_command_position;*/ + res.DwRate = m_dwRate; + res.DwScale = m_dwScale; + return res; + } + + + public TimeTableGroup this[TimeTableType type, int group] { + get { + if ( type == TimeTableType.character ) { + return m_groups_character[group]; + } else { + switch ( type ) { + case TimeTableType.another: + return m_group_another; + case TimeTableType.plugin: + return m_group_plugin; + case TimeTableType.vsq: + return m_group_vsq; + default: + return null; + } + } + } + set { + if ( type == TimeTableType.character ) { + m_groups_character[group] = value; + } else { + switch ( type ) { + case TimeTableType.another: + m_group_another = value; + break; + case TimeTableType.plugin: + m_group_plugin = value; + break; + case TimeTableType.vsq: + m_group_vsq = value; + break; + } + } + } + } + + public SettingsEx() { + m_zorder = new List(); + m_group_vsq = new TimeTableGroup( _( "VSQ Tracks" ), -1, null ); + m_groups_character = new List(); + m_group_another = new TimeTableGroup( _( "Another images" ), -1, null ); + m_group_plugin = new TimeTableGroup( _( "Plugin" ), -1, null ); + m_telop_ex2 = new List(); + m_screenWidth = 512; + m_screenHeight = 384; + m_totalSec = 0.0f; + m_movieSize = new Size( 512, 384 ); + m_plugins_config = new List(); + m_audioFile = ""; + CANVAS_BACKGROUND = Color.White; + m_telop_ex2 = new List(); + m_timesig_ex = new List(); + m_tempo = new List(); + m_base_tempo = 480000; + m_dwRate = 30; + m_dwScale = 1; + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; + } + + [OnDeserializing] + private void onDeserializing( StreamingContext sc ) { + CANVAS_BACKGROUND = Color.White; + m_telop_ex2 = new List(); + REPEAT_START = 0f; + REPEAT_END = -1f; + m_dwRate = 0; + m_dwScale = 0; + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { +#if DEBUG + Common.DebugWriteLine( "SettingsEx.onDeserialized(StreamingContext)" ); + Common.DebugWriteLine( " m_timesig_ex" ); +#endif + m_zorder = new List(); + if ( m_timesig_ex == null ) { + m_timesig_ex = new List(); + } else { + for ( int i = 0; i < m_timesig_ex.Count; i++ ) { +#if DEBUG + Common.DebugWriteLine( " " + m_timesig_ex[i].ToString() ); +#endif + if ( m_timesig_ex[i].Numerator == 0 || m_timesig_ex[i].Denominator == 0 ) { + m_timesig_ex.Clear(); + break; + } + } + } + if( m_tempo == null ) { + m_tempo = new List(); + } + if ( m_dwRate == 0 ) { + m_dwScale = 1; + m_dwRate = 30; + } + m_fps_buffer = (float)m_dwRate / (float)m_dwScale; +#if DEBUG + Common.DebugWriteLine( " m_telop_ex2" ); + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + Common.DebugWriteLine( " i=" + i + "; ID=" + m_telop_ex2[i].ID + "; Text=" + m_telop_ex2[i].Text ); + } +#endif + } + + public void Dispose() { + if ( m_group_vsq != null ) { + m_group_vsq.Dispose(); + m_group_vsq = null; + } + if ( m_groups_character != null ) { + m_groups_character.Clear(); + m_groups_character = null; + } + if ( m_group_another != null ) { + m_group_another.Dispose(); + m_group_another = null; + } + if ( m_group_plugin != null ) { + m_group_plugin.Dispose(); + m_group_plugin = null; + } + if ( m_plugins_config != null ) { + m_plugins_config.Clear(); + m_plugins_config = null; + } + } + + /// + /// m_telop_ex逕ィ縲よャ。縺ォ蛻ゥ逕ィ蜿ッ閭ス縺ェID繧定ェソ縺ケ縺セ縺 + /// + /// + public int GetNextID() { + return GetNextID( 0 ); + } + + public int GetNextID( int skip ) { + int draft = -1; + while ( true ) { + draft++; + bool found = false; + foreach ( Telop item in m_telop_ex2 ) { + if ( draft == item.ID ) { + found = true; + } + } + if ( !found ) { + break; + } + } + return draft + skip; + } + + public void SetZorder( ZorderItem item, int zorder ) { + switch ( item.Type ) { + case ZorderItemType.plugin: + m_group_plugin[item.Index].ZOrder = zorder; + break; + case ZorderItemType.another: + m_group_another[item.Index].ZOrder = zorder; + break; + case ZorderItemType.character: + m_groups_character[item.Index].ZOrder = zorder; + break; + } + } + + public int GetZorder( ZorderItem item ) { + switch ( item.Type ) { + case ZorderItemType.plugin: + return m_group_plugin[item.Index].ZOrder; + case ZorderItemType.another: + return m_group_another[item.Index].ZOrder; + case ZorderItemType.character: + return m_groups_character[item.Index].ZOrder; + } + return 0; + } + + public void UpdateZorder() { + m_zorder.Clear(); + for ( int i = 0; i < m_plugins_config.Count; i++ ) { + m_zorder.Add( new ZorderItem( m_plugins_config[i].ID, ZorderItemType.plugin, i ) ); + } + for ( int i = 0; i < m_groups_character.Count; i++ ) { + m_zorder.Add( new ZorderItem( m_groups_character[i].Text, ZorderItemType.character, i ) ); + } + for ( int i = 0; i < m_group_another.Count; i++ ) { + m_zorder.Add( new ZorderItem( m_group_another[i].Text, ZorderItemType.another, i ) ); + } + + bool changed = true; + ZorderItem tmp; + while ( changed ) { + changed = false; + for ( int i = 0; i < m_zorder.Count - 1; i++ ) { + int order_i = GetZorder( m_zorder[i] ); + int order_ipp = GetZorder( m_zorder[i + 1] ); + if ( order_i < order_ipp || (order_i == order_ipp && m_zorder[i + 1].Type.CompareTo( m_zorder[i].Type ) > 0) ) { + tmp = (ZorderItem)m_zorder[i].Clone(); + m_zorder[i] = (ZorderItem)m_zorder[i + 1].Clone(); + m_zorder[i + 1] = (ZorderItem)tmp.Clone(); + changed = true; + } + } + } + + for ( int i = 0; i < m_zorder.Count; i++ ) { + SetZorder( m_zorder[i], m_zorder.Count - 1 - i ); + } + + } + + /// + /// 謖螳壹&繧後◆繧ウ繝槭Φ繝峨r螳溯。後@縺セ縺 + /// + /// + public Command Execute( Command command ) { + int group = command.group; + int track = command.track; + int entry = command.entry; + TimeTableType target = command.target; + + Command ret = null; + switch ( command.target ) { + case TimeTableType.telop: + #region telop + switch ( command.type ) { + case CommandType.addTelop: + Telop adding = (Telop)command.telop.Clone( GetNextID() ); + ret = Command.GCommandDeleteTelop( adding ); + m_telop_ex2.Add( adding ); + break; + case CommandType.editTelop: + ret = Command.GCommandEditTelop( command.telop.ID, this[command.telop.ID] ); + this[command.telop.ID] = (Telop)command.telop.Clone(); + break; + case CommandType.deleteTelop: + ret = Command.GCommandAddTelop( this[command.telop.ID] ); + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + if ( m_telop_ex2[i].ID == command.telop.ID ) { + m_telop_ex2.RemoveAt( i ); + break; + } + } + Property.Instance.Editing = null; //dirty... + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( target, -1, -command.floatValue ); + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + m_telop_ex2[i].Start += command.floatValue; + m_telop_ex2[i].End += command.floatValue; + } + break; + case CommandType.addTelopRange: + Telop[] adding2 = (Telop[])command.args[0]; + for ( int i = 0; i < adding2.Length; i++ ) { + adding2[i] = (Telop)adding2[i].Clone( GetNextID( i ) ); + } + ret = Command.GCommandDeleteTelopRange( adding2 ); + m_telop_ex2.AddRange( adding2 ); + break; + case CommandType.deleteTelopRange: + Telop[] adding3 = (Telop[])command.args[0]; + ret = Command.GCommandAddTelopRange( adding3 ); + for ( int i = 0; i < adding3.Length; i++ ) { + for ( int j = 0; j < m_telop_ex2.Count; j++ ) { + if ( m_telop_ex2[j].ID == adding3[i].ID ) { + m_telop_ex2.RemoveAt( j ); + break; + } + } + } + break; + } + Telop.DecideLane( m_telop_ex2 ); + #endregion + break; + case TimeTableType.another: + #region another + switch ( command.type ) { + case CommandType.addEntry: + ret = Command.GCommandDeleteTimeTableEntry( target, -1, track, command.item ); + m_group_another[track].Add( (TimeTableEntry)command.item.Clone() ); + m_group_another[track].Sort(); + break; + case CommandType.deleteEntry: + ret = Command.GCommandAddTimeTableEntry( target, -1, track, command.item ); + m_group_another[track].Remove( command.item ); + break; + case CommandType.editEntry: + ret = Command.GCommandEditTimeTableEntry( target, -1, track, entry, m_group_another[track][entry] ); + m_group_another[track][entry] = (TimeTableEntry)command.item.Clone(); + break; + case CommandType.addTimeTable: + ret = Command.GCommandDeleteTimeTable( target, -1, m_group_another.Count ); + m_group_another.Insert( command.track, (TimeTable)command.table.Clone() ); + UpdateZorder(); + break; + case CommandType.deleteTimeTable: + ret = Command.GCommandAddTimeTable( target, -1, track, m_group_another[track] ); + m_group_another.RemoveAt( command.track ); + UpdateZorder(); + break; + case CommandType.editTimeTable: + ret = Command.GCommandEditTimeTable( target, -1, track, m_group_another[track] ); + m_group_another[command.track].Clear(); + m_group_another[command.track] = (TimeTable)command.table.Clone(); + break; + case CommandType.setImage: + if ( m_group_another[track].IsAviMode ) { + ret = Command.GCommandSetAvi( track, m_group_another[track].AviConfig ); + } else { + ret = Command.GCommandSetImage( track, m_group_another[track].Image ); + } + m_group_another[command.track].SetImage( command.image ); + break; + case CommandType.setPosition: + ret = Command.GCommandSetPosition( target, -1, track, m_group_another[track].Position ); + m_group_another[command.track].Position = command.position; + break; + case CommandType.changeScale: + ret = Command.GCommandChangeScale( target, -1, track, m_group_another[track].Scale ); + m_group_another[command.track].Scale = command.floatValue; + break; + case CommandType.editGroup: + ret = Command.GCommandEditGroup( target, -1, m_group_another ); + m_group_another = null; + m_group_another = (TimeTableGroup)command.tablegroup.Clone(); + break; + case CommandType.setAvi: + if ( m_group_another[track].IsAviMode ) { + ret = Command.GCommandSetAvi( track, m_group_another[track].AviConfig ); + } else { + ret = Command.GCommandSetImage( track, m_group_another[track].Image ); + } + m_group_another[command.track].SetAvi( command.str ); + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( target, track, -command.floatValue ); + for ( int i = 0; i < m_group_another[track].Count; i++ ) { + m_group_another[track][i].begin += command.floatValue; + m_group_another[track][i].end += command.floatValue; + } + break; + } + #endregion + break; + case TimeTableType.character: + #region character + switch ( command.type ) { + case CommandType.addEntry: + ret = Command.GCommandDeleteTimeTableEntry( target, group, track, command.item ); + m_groups_character[group][track].Add( (TimeTableEntry)command.item.Clone() ); + m_groups_character[group][track].Sort(); + break; + case CommandType.deleteEntry: + ret = Command.GCommandAddTimeTableEntry( target, group, track, command.item ); + m_groups_character[group][track].Remove( command.item ); + break; + case CommandType.editEntry: + ret = Command.GCommandEditTimeTableEntry( target, group, track, entry, m_groups_character[group][track][entry] ); + m_groups_character[group][track][entry] = (TimeTableEntry)command.item.Clone(); + break; + case CommandType.addTimeTable: + ret = Command.GCommandDeleteTimeTable( target, group, m_groups_character[group].Count ); + m_groups_character[group].Insert( command.track, (TimeTable)command.table.Clone() ); + UpdateZorder(); + break; + case CommandType.deleteTimeTable: + ret = Command.GCommandAddTimeTable( target, group, track, m_groups_character[group][track] ); + m_groups_character[group].RemoveAt( command.track ); + UpdateZorder(); + break; + case CommandType.editTimeTable: + ret = Command.GCommandEditTimeTable( target, group, track, m_groups_character[group][track] ); + m_groups_character[command.group][command.track].Clear(); + m_groups_character[command.group][command.track] = (TimeTable)command.table.Clone(); + break; + case CommandType.addGroup: + ret = Command.GCommandDeleteTimeTableGroup( target, m_groups_character.Count ); + m_groups_character.Insert( command.group, (TimeTableGroup)command.tablegroup.Clone() ); + UpdateZorder(); + break; + case CommandType.deleteGroup: + ret = Command.GCommandAddGroup( target, group, m_groups_character[group] ); + m_groups_character.RemoveAt( command.group ); + Property.Instance.Editing = null; + UpdateZorder(); + break; + case CommandType.editGroup: + ret = Command.GCommandEditGroup( target, group, m_groups_character[group] ); + m_groups_character[command.group].Dispose(); + m_groups_character[command.group] = (TimeTableGroup)command.tablegroup.Clone(); + break; + case CommandType.setPosition: + ret = Command.GCommandSetPosition( target, group, track, m_groups_character[group].Position ); + m_groups_character[command.group].Position = command.position; + break; + case CommandType.changeScale: + ret = Command.GCommandChangeScale( target, group, -1, m_groups_character[group].Scale ); + m_groups_character[command.group].Scale = command.floatValue; + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( target, group, -command.floatValue ); + for ( int i = 0; i < m_groups_character[group].Count; i++ ) { + for ( int j = 0; j < m_groups_character[group][i].Count; j++ ) { + m_groups_character[group][i][j].begin += command.floatValue; + m_groups_character[group][i][j].end += command.floatValue; + } + } + break; + } + #endregion + break; + case TimeTableType.plugin: + #region plugin + switch ( command.type ) { + case CommandType.addEntry: + ret = Command.GCommandDeleteTimeTableEntry( target, -1, track, command.item ); + m_group_plugin[track].Add( (TimeTableEntry)command.item.Clone() ); + m_group_plugin[track].Sort(); + break; + case CommandType.deleteEntry: + ret = Command.GCommandAddTimeTableEntry( target, -1, track, command.item ); + m_group_plugin[track].Remove( command.item ); + break; + case CommandType.editEntry: + ret = Command.GCommandEditTimeTableEntry( target, -1, track, entry, m_group_plugin[track][entry] ); + m_group_plugin[track][entry] = (TimeTableEntry)command.item.Clone(); + break; + case CommandType.addTimeTable: + ret = Command.GCommandDeleteTimeTable( target, -1, m_group_plugin.Count ); + m_group_plugin.Insert( command.track, (TimeTable)command.table.Clone() ); + UpdateZorder(); + break; + case CommandType.deleteTimeTable: + ret = Command.GCommandAddTimeTable( target, -1, track, m_group_plugin[track] ); + m_group_plugin.RemoveAt( command.track ); + UpdateZorder(); + break; + case CommandType.editTimeTable: + ret = Command.GCommandEditTimeTable( target, -1, track, m_group_plugin[track] ); + m_group_plugin[command.track].Clear(); + m_group_plugin[command.track] = (TimeTable)command.table.Clone(); + break; + case CommandType.editGroup: + ret = Command.GCommandEditGroup( target, -1, m_group_plugin ); + m_group_plugin = null; + m_group_plugin = (TimeTableGroup)command.tablegroup.Clone(); + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( target, track, -command.floatValue ); + for ( int i = 0; i < m_group_plugin[track].Count; i++ ) { + m_group_plugin[track][i].begin += command.floatValue; + m_group_plugin[track][i].end += command.floatValue; + } + break; + } + #endregion + break; + case TimeTableType.vsq: + #region vsq + switch ( command.type ) { + case CommandType.addEntry: + ret = Command.GCommandDeleteTimeTableEntry( target, -1, track, command.item ); + m_group_vsq[track].Add( (TimeTableEntry)command.item.Clone() ); + m_group_vsq[track].Sort(); + break; + case CommandType.deleteEntry: + ret = Command.GCommandAddTimeTableEntry( target, -1, track, command.item ); + m_group_vsq[track].Remove( command.item ); + break; + case CommandType.editEntry: + ret = Command.GCommandEditTimeTableEntry( target, -1, track, entry, m_group_vsq[track][entry] ); + m_group_vsq[track][entry] = (TimeTableEntry)command.item.Clone(); + break; + case CommandType.addTimeTable: + ret = Command.GCommandDeleteTimeTable( target, -1, m_group_vsq.Count ); + m_group_vsq.Insert( command.track, (TimeTable)command.table.Clone() ); + break; + case CommandType.deleteTimeTable: + ret = Command.GCommandAddTimeTable( target, -1, track, m_group_vsq[track] ); + m_group_vsq.RemoveAt( command.track ); + break; + case CommandType.editTimeTable: + ret = Command.GCommandEditTimeTable( target, -1, track, m_group_vsq[track] ); + m_group_vsq[command.track].Clear(); + m_group_vsq[command.track] = (TimeTable)command.table.Clone(); + break; + case CommandType.editGroup: + ret = Command.GCommandEditGroup( target, -1, m_group_vsq ); + m_group_vsq = null; + m_group_vsq = (TimeTableGroup)command.tablegroup.Clone(); + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( target, track, -command.floatValue ); + for ( int i = 0; i < m_group_vsq[track].Count; i++ ) { + m_group_vsq[track][i].begin += command.floatValue; + m_group_vsq[track][i].end += command.floatValue; + } + break; + } + #endregion + break; + case TimeTableType.whole: + #region whole + switch ( command.type ) { + case CommandType.changePluginConfig: + ret = Command.GCommandChangePluginConfig( track, m_plugins_config[track].Config ); + m_plugins_config[command.track].Config = command.str; + // 繧ュ繝」繝ゥ繧ッ繧ソ謠冗判逕ィ繝励Λ繧ー繧、繝ウ縺ョ蝣エ蜷医ッ縲∬ゥイ蠖薙く繝」繝ゥ繧ッ繧ソ繝医Λ繝繧ッ縺ョ繧ー繝ォ繝シ繝礼分蜿キ縺ォ蠢懊§縺ヲ縲…ommand.group(>=0)縺ォ蛟、縺後そ繝繝医&繧後k + if ( command.group >= 0 ) { + m_groups_character[command.group].Character.PluginConfig.Config = command.str; + } + m_plugins[command.track].Instance.Config = command.str; + break; + case CommandType.changeFps: + ret = Command.GCommandChangeFps( m_dwRate, m_dwScale ); + DwRate = command.dwRate; + DwScale = command.dwScale; + break; + case CommandType.changeVideoSize: + ret = Command.GCommandChangeVideoSize( m_movieSize ); + m_movieSize = command.size; + break; + case CommandType.shiftTimeTable: + ret = Command.GCommandShiftTimeTable( TimeTableType.whole, -1, -command.floatValue ); + float shift = command.floatValue; + // vsq + shiftTimeTable( ref m_group_vsq, shift ); + // character + for ( int i = 0; i < m_groups_character.Count; i++ ) { + TimeTableGroup tmp = m_groups_character[i]; + shiftTimeTable( ref tmp, shift ); + m_groups_character[i] = tmp; + } + // another + shiftTimeTable( ref m_group_another, shift ); + // plugin + shiftTimeTable( ref m_group_plugin, shift ); + // telop + for ( int i = 0; i < m_telop_ex2.Count; i++ ) { + m_telop_ex2[i].Start += shift; + m_telop_ex2[i].End += shift; + } + break; + case CommandType.setMP3: + ret = Command.GCommandSetMp3( m_audioFile ); + m_audioFile = command.str; + break; + case CommandType.changeBackgroundColor: + ret = Command.GCommandChangeBackgroundColor( CANVAS_BACKGROUND ); + CANVAS_BACKGROUND = command.color; + break; + } + #endregion + break; + } + if ( command.child != null ) { + ret.child = Execute( command.child ); + } + if ( CommandExecuted != null ) { + CommandExecuted( command.target, command.type ); + } + return ret; + } + + private void shiftTimeTable( ref TimeTableGroup table, float shift ) { + for ( int track = 0; track < table.Count; track++ ) { + for ( int entry = 0; entry < table[track].Count; entry++ ) { + table[track][entry].begin += shift; + table[track][entry].end += shift; + } + } + } + + public IEnumerable GetZorderItemEnumerator() { + for( int i = 0; i < m_groups_character.Count; i++ ) { + yield return new ZorderItem( m_groups_character[i].Text, ZorderItemType.character, i ); + } + for( int i = 0; i < m_group_another.Count; i++ ) { + yield return new ZorderItem( m_group_another[i].Text, ZorderItemType.another, i ); + } + for( int i = 0; i < m_telop_ex2.Count; i++ ) { + yield return new ZorderItem( m_telop_ex2[i].Text, ZorderItemType.telop, m_telop_ex2[i].ID ); + } + } + + public IEnumerable GetBarLineTypeEnumerator( QuantizeMode mode, bool triplet ) { + int local_denominator; + int local_numerator; + int local_clock; + int local_bar_count; + int clock_step; + int end_clock; + int clock_per_bar; + for( int i = 0; i < m_timesig_ex.Count; i++ ) { + local_denominator = m_timesig_ex[i].Denominator; + local_numerator = m_timesig_ex[i].Numerator; + local_clock = m_timesig_ex[i].Clock; + local_bar_count = m_timesig_ex[i].BarCount; + clock_per_bar = 480 * 4 * local_numerator / local_denominator; + clock_step = 480 * 4 / local_denominator; + switch( mode ) { + case QuantizeMode.off: + clock_step = 480 * 4 / local_denominator; + break; + case QuantizeMode.q04: + clock_step = 480 * 4 / 4; + break; + case QuantizeMode.q08: + clock_step = 480 * 4 / 8; + break; + case QuantizeMode.q16: + clock_step = 480 * 4 / 16; + break; + case QuantizeMode.q32: + clock_step = 480 * 4 / 32; + break; + case QuantizeMode.q64: + clock_step = 480 * 4 / 64; + break; + } + if ( mode != QuantizeMode.off && triplet ) { + clock_step = clock_step * 4 / 3; + } + if( i == m_timesig_ex.Count - 1 ) { + double tempo; + if( m_tempo.Count > 0 ) { + tempo = m_tempo[m_tempo.Count - 1].Tempo; + } else { + tempo = m_base_tempo; + } + end_clock = (int)((m_totalSec - SecFromClock( m_timesig_ex[i].Clock ) + 1.0) * tpq_sec / tempo); + } else { + end_clock = m_timesig_ex[i + 1].Clock; + } + // todo: SettingsEx+GetBarLineTypeEnumerator; clock_per_bar縺慶lock_step縺ョ謨エ謨ー蛟阪→縺ェ繧峨↑縺蝣エ蜷医ョ蜃ヲ逅 + for( int clock = local_clock; clock < end_clock; clock += clock_step ) { + if( (clock - local_clock) % clock_per_bar == 0 ) { + yield return new BarLineType( SecFromClock( clock ), true, false ); + } else { + yield return new BarLineType( SecFromClock( clock ), false, false ); + } + } + } + } + + /// + /// 謖螳壹@縺溘け繝ュ繝繧ッ縺ォ縺翫¢繧九…lock=0縺九i縺ョ貍泌・冗オ碁℃譎る俣(sec) + /// + /// + /// + private double SecFromClock( int clock ) { + if( m_tempo.Count == 0 ) { + return (double)m_base_tempo * (double)clock / tpq_sec; + } else { + int index = 0; + for( int i = 0; i < m_tempo.Count; i++ ) { + if( clock <= m_tempo[i].Clock ) { + index = i; + break; + } + } + return m_tempo[index].Time + (double)(m_tempo[index].Tempo) * (clock - m_tempo[index].Clock) / tpq_sec; + } + } + } + +} diff --git a/trunk/LipSync/Editor/TagForTreeNode.cs b/trunk/LipSync/Editor/TagForTreeNode.cs new file mode 100644 index 0000000..5d99da7 --- /dev/null +++ b/trunk/LipSync/Editor/TagForTreeNode.cs @@ -0,0 +1,45 @@ +サソ/* + * TagForTreeNode.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + [Obsolete] + public class TagForTreeNode { + public ZorderItemType type; + public int id_or_index; + public bool is_checked; // 繝√ぉ繝繧ッ貂医∩縺九←縺縺九r陦ィ縺 + + public TagForTreeNode( ZorderItemType type, int id_or_index ) { + this.type = type; + this.id_or_index = id_or_index; + this.is_checked = false; + } + + public override string ToString() { + switch( type ) { + case ZorderItemType.another: + return AppManager.SaveData.m_group_another[id_or_index].Text; + case ZorderItemType.character: + return AppManager.SaveData.m_groups_character[id_or_index].Text; + case ZorderItemType.plugin: + return AppManager.SaveData.m_group_plugin[id_or_index].Text; + case ZorderItemType.telop: + return AppManager.SaveData.m_telop_ex2[id_or_index].Text; + } + return ""; + } + } + +} diff --git a/trunk/LipSync/Editor/Telop.cs b/trunk/LipSync/Editor/Telop.cs new file mode 100644 index 0000000..eeadd0d --- /dev/null +++ b/trunk/LipSync/Editor/Telop.cs @@ -0,0 +1,444 @@ +サソ/* + * Telop.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Runtime.Serialization; + +using CurveEditor; + +namespace LipSync { + + [Serializable] + public class Telop : IComparable, ICloneable, IDrawObject { + string m_text = ""; + float m_start = 0f; + float m_end = 0f; + Font m_font = null; + bool m_fadein = false; + bool m_fadeout = false; + float m_alpha = 1.0f; + Point m_position = new Point( 0, 0 ); + Color m_fore_color; + Size m_size; + float m_fadein_ratio = 1f; + float m_fadeout_ratio = 1f; + [NonSerialized] + object m_tag; + [OptionalField] + public BezierChain mc_x; + [OptionalField] + public BezierChain mc_y; + [OptionalField] + public BezierChain mc_scale; + [OptionalField] + public BezierChain mc_alpha; + [OptionalField] + public BezierChain mc_rotate; + [OptionalField] + private int m_id; + [NonSerialized] + public int Lane; + [OptionalField] + private bool m_position_fixed = false; + [OptionalField] + private int m_z_order; + + private static Color m_telop_default_color = Color.Black; + private static Font m_default_font; + + [Browsable(false)] + public int ZOrder { + get { + return m_z_order; + } + set { + m_z_order = value; + } + } + + public bool IsXFixedAt( float time ) { + float min, max; + if ( mc_x.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + public bool IsYFixedAt( float time ) { + float min, max; + if ( mc_y.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + /// + /// 謠冗判繧ェ繝悶ず繧ァ繧ッ繝医ョ菴咲スョ縺悟崋螳壹&繧後k縺九←縺縺九r遉コ縺吝、繧貞叙蠕暦シ後∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool PositionFixed { + get { + return m_position_fixed; + } + set { + m_position_fixed = value; + } + } + + public static void DecideLane( List list ) { + if ( list.Count <= 0 ) { + AppManager.MaxTelopLanes = 0; + return; + } + list.Sort(); + list[0].Lane = 0; + int max = 0; + for ( int i = 1; i < list.Count; i++ ) { + int decided_lane = 0; + for ( int index = 0; index < int.MaxValue; index++ ) { + decided_lane = index; + int count = 0; + for ( int j = 0; j < i; j++ ) { + if ( list[j].Lane == index ){ + if ( Boare.Lib.AppUtil.Misc.IsOverwrapped( list[i].Start, list[i].End, list[j].Start, list[j].End ) ) { + count++; + break; + } + } + } + if ( count == 0 ) { + break; + } + } + max = Math.Max( max, decided_lane ); + list[i].Lane = decided_lane; + } + AppManager.MaxTelopLanes = max + 1; + } + + [Browsable(false)] + public int ID { + get { + return m_id; + } + } + + public PointF GetPosition( float time ) { + return new PointF( mc_x.GetValue( time ), mc_y.GetValue( time ) ); + } + + public float GetScale( float time ) { + return mc_scale.GetValue( time ); + } + + public float GetAlpha( float time ) { + float a = mc_alpha.GetValue( time ); + if ( a > 1f ) { + a = 1f; + } else if ( a < 0f ) { + a = 0f; + } + return a; + } + + public float GetRotate( float time ) { + float r = mc_rotate.GetValue( time ); + if ( r > 360f ) { + r = r % 360f; + } else if ( r < 0f ) { + r = r % 360f + 360f; + } + return r; + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { + if ( mc_x == null ) { + mc_x = new BezierChain( Common.CURVE_X ); + mc_x.Default = m_position.X; + } + if ( mc_y == null ) { + mc_y = new BezierChain( Common.CURVE_Y ); + mc_y.Default = m_position.Y; + } + if ( mc_scale == null ) { + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = 1f; + } + if ( mc_alpha == null ) { + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = m_alpha; + } + if ( mc_rotate == null ) { + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + } + mc_x.Color = Common.CURVE_X; + mc_y.Color = Common.CURVE_Y; + mc_scale.Color = Common.CURVE_SCALE; + mc_alpha.Color = Common.CURVE_ALPHA; + if ( m_font != null ) { + m_size = Boare.Lib.AppUtil.Misc.MeasureString( m_text, m_font ); + } + } + + public Telop( int id ) { + mc_x = new BezierChain( Common.CURVE_X ); + mc_y = new BezierChain( Common.CURVE_Y ); + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = 1f; + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = 1f; + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + if ( m_default_font != null ) { + m_font = (Font)m_default_font.Clone(); + } else { + m_default_font = new Font( "MS UI Gothic", 18 ); + m_font = (Font)m_default_font.Clone(); + } + m_size = Boare.Lib.AppUtil.Misc.MeasureString( m_text, m_font ); + m_id = id; + m_fore_color = m_telop_default_color; + } + + [Browsable( false )] + public object Tag { + get { + return m_tag; + } + set { + m_tag = value; + } + } + + public float FadeInSpan { + get { + return m_fadein_ratio; + } + set { + m_fadein_ratio = value; + if ( m_fadein_ratio <= 0f ) { + m_fadein_ratio = 1f; + m_fadein = false; + } + } + } + + public float FadeOutSpan { + get { + return m_fadeout_ratio; + } + set { + m_fadeout_ratio = value; + if ( m_fadeout_ratio <= 0f ) { + m_fadeout_ratio = 1f; + m_fadeout = false; + } + } + + } + + [Browsable( false )] + public Size ImageSize { + get { + return m_size; + } + } + + public int CompareTo( Telop item ) { + if ( item.m_start < this.m_start ) { + return 1; + } else if ( item.m_start > this.m_start ) { + return -1; + } else { + if ( item.m_end > this.m_end ) { + return 1; + } else if ( item.m_end < this.m_end ) { + return -1; + } else { + if ( item.m_id < this.m_id ) { + return 1; + } else if ( item.m_id > this.m_id ) { + return -1; + } else { + return 0; + } + } + } + } + + [Browsable(false)] + public Point Position { + get { + return new Point( (int)mc_x.Default, (int)mc_y.Default ); + } + set { + mc_x.Default = value.X; + mc_y.Default = value.Y; + } + } + + public Position Location { + get { + return new Position( mc_x.Default, mc_y.Default ); + } + set { + mc_x.Default = value.X; + mc_y.Default = value.Y; + } + } + + public Color Color { + get { + return m_fore_color; + } + set { + m_fore_color = value; + m_telop_default_color = value; + } + } + + /// + /// ID繧貞、画峩縺励※螳滓命縺吶k繧ッ繝ュ繝シ繝ウ + /// + /// + /// + public object Clone( int change_id ) { + Telop result = new Telop( change_id ); + result.m_text = this.m_text; + result.m_start = this.m_start; + result.m_end = this.m_end; + result.m_font = (Font)this.m_font.Clone(); + result.m_fadein = this.m_fadein; + result.m_fadeout = this.m_fadeout; + result.m_alpha = this.m_alpha; + result.m_position = this.m_position; + result.m_fore_color = this.m_fore_color; + result.m_fadein_ratio = this.m_fadein_ratio; + result.m_fadeout_ratio = this.m_fadeout_ratio; + result.mc_alpha = (BezierChain)this.mc_alpha.Clone(); + result.mc_rotate = (BezierChain)this.mc_rotate.Clone(); + result.mc_scale = (BezierChain)this.mc_scale.Clone(); + result.mc_x = (BezierChain)this.mc_x.Clone(); + result.mc_y = (BezierChain)this.mc_y.Clone(); + result.Lane = this.Lane; + result.m_position_fixed = this.m_position_fixed; + result.m_size = this.m_size; + return result; + } + + /// + /// 騾壼クク縺ョ繧ッ繝ュ繝シ繝九Φ繧ー謫堺ス + /// + /// + public object Clone() { + return this.Clone( m_id ); + } + + public string Text { + get { + return m_text; + } + set { + m_text = value; + if ( m_font != null ) { + m_size = Boare.Lib.AppUtil.Misc.MeasureString( this.m_text, this.m_font ); + } else { + m_size = new Size(); + } + } + } + + public float Start { + get { + return m_start; + } + set { + m_start = value; + } + } + + public float Length { + get { + return m_end - m_start; + } + set { + m_end = m_start + value; + } + } + + [Browsable(false)] + public float End { + get { + return m_end; + } + set { + m_end = value; + } + } + + public Font Font { + get { + return m_font; + } + set { + m_font = value; + m_default_font = (Font)m_font.Clone(); + if ( m_font != null ) { + m_size = Boare.Lib.AppUtil.Misc.MeasureString( m_text, m_font ); + } else { + m_size = new Size(); + } + } + } + + public bool FadeIn { + get { + return m_fadein; + } + set { + m_fadein = value; + } + } + + public bool FadeOut { + get { + return m_fadeout; + } + set { + m_fadeout = value; + } + } + + public float Alpha { + get { + return m_alpha; + } + set { + if ( value > 1.0f ) { + m_alpha = 1.0f; + } else if ( value < 0.0f ) { + m_alpha = 0.0f; + } else { + m_alpha = value; + } + } + } + } + +} diff --git a/trunk/LipSync/Editor/TimeSig.cs b/trunk/LipSync/Editor/TimeSig.cs new file mode 100644 index 0000000..8c968c3 --- /dev/null +++ b/trunk/LipSync/Editor/TimeSig.cs @@ -0,0 +1,50 @@ +サソ/* + * TimeSig.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + /// + /// 譌ァ繝舌シ繧ク繝ァ繝ウ逕ィ縲ら樟蝨ィ縺ッ菴ソ繧上l縺ヲ縺縺ェ縺縲 + /// + [Serializable, Obsolete] + public class TimeSig { + public TimeSigType Type; + /// + /// 諡榊ュ舌サ縺セ縺溘ッ繝繝ウ繝昴′螟画峩縺輔l繧区凾髢謎ス咲スョ + /// + public float Start; + /// + /// 諡榊ュ仙、画峩蠕後ョ4蛻髻ウ隨ヲ縺ョ髟キ縺 + /// + public float Length; + /// + /// 諡榊ュ舌ョ蛻豈 + /// + public int Denominator; + /// + /// 諡榊ュ舌ョ蛻蟄 + /// + public int Numerator; + + public TimeSig( TimeSigType type, float start, float length, int denominator, int numerator ) { + Type = type; + Start = start; + Length = length; + Denominator = denominator; + Numerator = numerator; + } + } + +} diff --git a/trunk/LipSync/Editor/TimeSigType.cs b/trunk/LipSync/Editor/TimeSigType.cs new file mode 100644 index 0000000..44a6d94 --- /dev/null +++ b/trunk/LipSync/Editor/TimeSigType.cs @@ -0,0 +1,27 @@ +サソ/* + * TimeSigType.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + /// + /// 譌ァ繝舌シ繧ク繝ァ繝ウ逕ィ縲 + /// + [Obsolete] + public enum TimeSigType { + Tempo, + TimeSig, + } + +} diff --git a/trunk/LipSync/Editor/TimeTable/TimeTable.cs b/trunk/LipSync/Editor/TimeTable/TimeTable.cs new file mode 100644 index 0000000..4bb3331 --- /dev/null +++ b/trunk/LipSync/Editor/TimeTable/TimeTable.cs @@ -0,0 +1,538 @@ +サソ/* + * TimeTable.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Runtime.Serialization; + +using CurveEditor; + +namespace LipSync { + + [Serializable] + public class TimeTable : IDisposable, ICloneable, IDrawObject { + private List list; + private string stringValue; + private int type; + [Obsolete] + private Image image; + private Point position; + private int intValue; + private int m_zOrder; + private float scale; + [OptionalField] + public BezierChain mc_x; + [OptionalField] + public BezierChain mc_y; + [OptionalField] + public BezierChain mc_scale; + [OptionalField] + public BezierChain mc_alpha; + [OptionalField] + public BezierChain mc_rotate; + /// + /// avi繧偵ッ縺」縺、縺代k繝「繝シ繝 + /// + [OptionalField] + private bool m_avi_mode = false; + [OptionalField] + private string m_avi_config = ""; + [NonSerialized] + private AviReaderEx m_avi_reader; + [NonSerialized] + private bool m_avi_reader_opened = false; + [OptionalField] + private bool m_position_fixed = false; + [OptionalField] + private Bitmap m_image; + + /// + /// avi繝輔ぃ繧、繝ォ縺ョOpen譎ゅ↓險ア縺輔l繧句、ア謨怜屓謨ー + /// + const int THRESHOLD_FAILED = 10; + + public bool IsXFixedAt( float time ) { + float min, max; + if ( mc_x.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + public bool IsYFixedAt( float time ) { + float min, max; + if ( mc_y.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + /// + /// 謠冗判繧ェ繝悶ず繧ァ繧ッ繝医ョ菴咲スョ縺悟崋螳壹&繧後k縺九←縺縺九r遉コ縺吝、繧貞叙蠕暦シ後∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool PositionFixed { + get { + return m_position_fixed; + } + set { + m_position_fixed = value; + } + } + + [Browsable(false)] + public Size ImageSize { + get { + if ( m_avi_mode ) { + if ( m_avi_reader.Opened ) { + return m_avi_reader.BitmapSize; + } + } else { + if ( m_image != null ) { + return m_image.Size; + } + } + return new Size(); + } + } + + public string GetAviPath() { + if ( !m_avi_mode ) { + return ""; + } else { + string[] spl = m_avi_config.Split( "\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries ); + if ( spl.Length > 0 ) { + return spl[0]; + } else { + return ""; + } + } + } + + [Browsable(false)] + public string AviConfig { + get { + return m_avi_config; + } + } + + [Browsable(false)] + public bool IsAviMode { + get { + return m_avi_mode; + } + } + + public void SetAvi( string avi_config ) { + m_avi_mode = true; + m_avi_config = avi_config; + string avi_file = GetAviPath(); + /*if ( m_bmp != null ) { + m_bmp = null; //.Dispose(); + }*/ + if ( m_avi_reader != null ) { + if ( m_avi_reader.Opened ) { + m_avi_reader.Close(); + m_avi_reader = null; + m_avi_reader = new AviReaderEx(); + } + } else { + m_avi_reader = new AviReaderEx(); + } + if ( m_avi_reader.NumFailed < THRESHOLD_FAILED ) { + if ( File.Exists( avi_file ) ) { + m_avi_reader.Open( avi_file ); + m_avi_reader_opened = true; +#if DEBUG + Common.DebugWriteLine( "TimeTable.SetAvi; avi_file exists" ); +#endif + } + } + } + + public void SetImage( Image img ) { + /*if ( m_bmp != null ) { + //m_bmp.Dispose(); + m_bmp = null; + }*/ +#if DEBUG + Common.DebugWriteLine( "TimeTable.SetImage; before clone from argument \"img\"" ); + try { + int i = image.Width; + } catch { + } +#endif + if ( img != null ) { + m_image = new Bitmap( img ); + } +#if DEBUG + Common.DebugWriteLine( "TimeTable.SetImage; after cloned from argument \"img\"" ); + try { + int i = image.Width; + } catch { + } +#endif + m_avi_mode = false; + if ( m_avi_reader_opened ) { + if ( m_avi_reader.Opened ) { + m_avi_reader.Close(); + } + m_avi_reader_opened = false; + } + } + + public Bitmap GetImage( float time ) { +#if DEBUG + Common.DebugWriteLine( "TimeTable.GetImage(float); m_avi_mode=" + m_avi_mode ); +#endif + if ( m_avi_mode ) { +#if DEBUG + Common.DebugWriteLine( "TimeTable.GetImage(float); m_avi_reader_opened=" + m_avi_reader_opened ); +#endif + if ( !m_avi_reader_opened ) { + if ( m_avi_reader == null ) { + m_avi_reader = new AviReaderEx(); + } + if ( File.Exists( GetAviPath() ) ) { + try { + m_avi_reader.Open( GetAviPath() ); + m_avi_reader_opened = m_avi_reader.Opened; + } catch { + + } + } + } + if ( m_avi_reader_opened ) { + bool found = false; + float dt = 0f; + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].begin <= time && time <= list[i].end ) { + dt = time - list[i].begin; + found = true; + break; + } + } +#if DEBUG + Common.DebugWriteLine( "TimeTable.GetImage(float); found=" + found ); +#endif + if ( found ) { + int frame = (int)((double)m_avi_reader.dwRate / (double)m_avi_reader.dwScale * dt); + if ( 0 <= frame && frame < m_avi_reader.CountFrames ) { + return m_avi_reader.Export( frame ); + } + } + } + return null; + } else { + if ( m_image != null ) { + return m_image; + } else { + return null; + } + } + } + + public PointF GetPosition( float time ) { + return new PointF( mc_x.GetValue( time ), mc_y.GetValue( time ) ); + } + + public float GetScale( float time ) { + return mc_scale.GetValue( time ); + } + + public float GetAlpha( float time ) { + float a = mc_alpha.GetValue( time ); + if ( a > 1f ) { + a = 1f; + } else if ( a < 0f ) { + a = 0f; + } + return a; + } + + public float GetRotate( float time ) { + float r = mc_rotate.GetValue( time ); + if ( r > 360f ) { + r = r % 360f; + } else if ( r < 0f ) { + r = r % 360f + 360f; + } + return r; + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { + if ( type == 3 ) { + type = (int)TimeTableType.character; + } + + if ( mc_x == null ) { + mc_x = new BezierChain( Common.CURVE_X ); + mc_x.Default = position.X; + } + if ( mc_y == null ) { + mc_y = new BezierChain( Common.CURVE_Y ); + mc_y.Default = position.Y; + } + if ( mc_scale == null ) { + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = scale; + } + if ( mc_alpha == null ) { + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = 1.0f; + } + if ( mc_rotate == null ) { + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + } + mc_x.Color = Common.CURVE_X; + mc_y.Color = Common.CURVE_Y; + mc_scale.Color = Common.CURVE_SCALE; + mc_alpha.Color = Common.CURVE_ALPHA; + if ( image != null ) { + m_image = new Bitmap( image ); + image.Dispose(); + } + } + + public float Scale { + get { + return mc_scale.Default; + } + set { + mc_scale.Default = value; + } + } + + /// + /// 譎ょ綾now縺ォOn縺ィ縺ェ縺」縺ヲ縺繧九お繝ウ繝医Μ縺悟ュ伜惠縺吶k縺九←縺縺九r蛻、螳壹@縺セ縺 + /// + /// + /// + public bool IsOn( float now ) { + foreach ( TimeTableEntry entry in list ) { + if ( entry.begin <= now && now <= entry.end ) { + return true; + } + } + return false; + } + + public void Dispose() { + if ( list != null ) { + list.Clear(); + } + if ( image != null ) { + image.Dispose(); + } + if ( m_image != null ) { + m_image.Dispose(); + } + if ( mc_x != null ) { + mc_x.Dispose(); + } + if ( mc_y != null ) { + mc_y.Dispose(); + } + if ( mc_alpha != null ) { + mc_alpha.Dispose(); + } + if ( mc_rotate != null ) { + mc_rotate.Dispose(); + } + if ( mc_scale != null ) { + mc_scale.Dispose(); + } + if ( m_avi_reader != null ) { + if ( m_avi_reader.Opened ) { + m_avi_reader.Close(); + } + } + } + + public void Remove( TimeTableEntry item ) { + int index = -1; + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].begin == item.begin && list[i].end == item.end && list[i].body == item.body ) { + index = i; + break; + } + } + if ( index >= 0 ) { + list.RemoveAt( index ); + } + } + + public object Clone() { + TimeTable tmp = new TimeTable( stringValue, intValue, this.Type, m_image ); + for ( int i = 0; i < list.Count; i++ ) { + tmp.list.Add( (TimeTableEntry)list[i].Clone() ); + } + tmp.position = position; + tmp.intValue = intValue; + tmp.m_zOrder = m_zOrder; + tmp.scale = scale; + tmp.mc_alpha = (BezierChain)this.mc_alpha.Clone(); + tmp.mc_rotate = (BezierChain)this.mc_rotate.Clone(); + tmp.mc_scale = (BezierChain)this.mc_scale.Clone(); + tmp.mc_x = (BezierChain)this.mc_x.Clone(); + tmp.mc_y = (BezierChain)this.mc_y.Clone(); + tmp.m_avi_config = this.m_avi_config; + tmp.m_avi_mode = this.m_avi_mode; + tmp.m_avi_reader = new AviReaderEx(); + tmp.m_avi_reader_opened = false; + tmp.m_position_fixed = this.m_position_fixed; + return tmp; + } + + [Browsable(false)] + public TimeTableType Type { + get { + foreach ( TimeTableType t in Enum.GetValues( System.Type.GetType( "LipSync.TimeTableType" ) ) ) { + if ( (int)t == type ) { + return t; + } + } + return TimeTableType.none; + } + set { + type = (int)value; + } + } + + public void Sort() { + list.Sort(); + } + + public void RemoveAt( int entry ) { + list.RemoveAt( entry ); + } + + public TimeTable( string stringValue, int intValue, TimeTableType type, Bitmap image ) + : this( stringValue, intValue, type, image, 1f ) { + } + + public TimeTable( string stringValue, int intValue, TimeTableType type, Bitmap img, float scale ) { + this.list = new List(); + this.stringValue = stringValue; + this.type = (int)type; + if ( img != null ) { + m_image =(Bitmap)img.Clone(); + } else { + m_image = null; + } + this.intValue = intValue; + this.position = new Point( 0, 0 ); + this.scale = scale; + this.m_zOrder = 0; + mc_x = new BezierChain( Common.CURVE_X ); + mc_y = new BezierChain( Common.CURVE_Y ); + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = 1f; + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = 1f; + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + m_avi_reader = new AviReaderEx(); + m_avi_reader_opened = false; + } + + [Browsable(false)] + public int ZOrder { + get { + return m_zOrder; + } + set { + m_zOrder = value; + } + } + + [Browsable(false)] + public int Value { + get { + return intValue; + } + set { + intValue = value; + } + } + + public string Text { + get { + return stringValue; + } + set { + stringValue = value; + } + } + + [Browsable(false)] + public Bitmap Image { + get { + return m_image; + } + } + + [Browsable(false)] + public int Count { + get { + return list.Count; + } + } + + public void Clear() { + list.Clear(); + } + + [Browsable(false)] + public TimeTableEntry this[int entry] { + get { + return list[entry]; + } + set { + list[entry] = (TimeTableEntry)value; + } + } + + public void Add( TimeTableEntry entry ) { + list.Add( entry ); + } + + [Browsable(false)] + public Point Position { + get { + return new Point( (int)mc_x.Default, (int)mc_y.Default ); + } + set { + mc_x.Default = value.X; + mc_y.Default = value.Y; + } + } + + public Position Location { + get { + return new Position( mc_x.Default, mc_y.Default ); + } + set { + mc_x.Default = value.X; + mc_y.Default = value.Y; + } + } + } + +} diff --git a/trunk/LipSync/Editor/TimeTable/TimeTableEntry.cs b/trunk/LipSync/Editor/TimeTable/TimeTableEntry.cs new file mode 100644 index 0000000..c8db695 --- /dev/null +++ b/trunk/LipSync/Editor/TimeTable/TimeTableEntry.cs @@ -0,0 +1,70 @@ +サソ/* + * TimeTableEntry.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + [Serializable] + public class TimeTableEntry : IComparable, IDisposable, ICloneable { + public float begin; + public float end; + public string body; + + public TimeTableEntry() { + begin = 0.0f; + end = 0.0f; + body = ""; + } + + public float Length { + get { + return end - begin; + } + } + + public void Dispose() { + this.body = null; + } + + public object Clone() { + return new TimeTableEntry( begin, end, body ); + } + + public int CompareTo( TimeTableEntry obj ) { + double diff = this.begin - obj.begin; + if ( this.begin == obj.begin ) { + return 0; + } else if ( diff > 0.0f ) { + return 1; + } else { + return -1; + } + } + + public bool Equals( TimeTableEntry obj ) { + if ( this.begin == obj.begin ) { + return true; + } else { + return false; + } + } + + public TimeTableEntry( float begin, float end, string body ) { + this.begin = begin; + this.end = end; + this.body = body; + } + } + +} diff --git a/trunk/LipSync/Editor/TimeTable/TimeTableGroup.cs b/trunk/LipSync/Editor/TimeTable/TimeTableGroup.cs new file mode 100644 index 0000000..e34e250 --- /dev/null +++ b/trunk/LipSync/Editor/TimeTable/TimeTableGroup.cs @@ -0,0 +1,1087 @@ +サソ/* + * TimeTableGroup.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Runtime.Serialization; +using System.Windows.Forms; + +using CurveEditor; + +namespace LipSync { + + /// + /// TimeTable繧偵げ繝ォ繝シ繝怜喧縺励※蜿悶j謇ア縺縺溘a縺ョ繧ッ繝ゥ繧ケ + /// + [Serializable] + public class TimeTableGroup : IDisposable, ICloneable, IDrawObject { + [Obsolete] + private Character m_character; + internal List list; + private string m_Text; + private int m_intValue; + [Obsolete] + private Point position; + private int m_zOrder; + [Obsolete] + private float scale; + [OptionalField] + private bool folded; + [OptionalField] + public BezierChain mc_x; + [OptionalField] + public BezierChain mc_y; + [OptionalField] + public BezierChain mc_scale; + [OptionalField] + public BezierChain mc_alpha; + [OptionalField] + public BezierChain mc_rotate; + [OptionalField] + private Character3 m_character3; + [OptionalField] + private string m_character_path; + [OptionalField] + private bool m_position_fixed = false; + + public Size ImageSize { + get { + if ( m_character3 != null ) { + return m_character3.Size; + } else { + return new Size(); + } + } + } + + public bool IsXFixedAt( float time ) { + float min, max; + if ( mc_x.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + public bool IsYFixedAt( float time ) { + float min, max; + if ( mc_y.GetKeyMinMax( out min, out max ) ) { + if ( min <= time && time <= max ) { + return true; + } + } + return false; + } + + /// + /// 謠冗判繧ェ繝悶ず繧ァ繧ッ繝医ョ菴咲スョ縺悟崋螳壹&繧後k縺九←縺縺九r遉コ縺吝、繧貞叙蠕暦シ後∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public bool PositionFixed { + get { + return m_position_fixed; + } + set { + m_position_fixed = value; + } + } + + public static void GenerateLipSyncFromVsq( + TimeTable a_time_table, + ref TimeTableGroup temp, + Character3 character, + float total_sec, + bool close_mouth_when_same_vowel_repeated, + float frame_rate, + float combine_threshold ) + { + TimeTable time_table = (TimeTable)a_time_table.Clone(); + for ( int i = 0; i < time_table.Count - 1; i++ ) { + if ( time_table[i + 1].begin - time_table[i].end <= combine_threshold ) { + time_table[i].end = time_table[i + 1].begin; + } + } + const float CLOSE_LENGTH = 2.99f; + const float CLOSE_LENGTH_SHORT = 1.99f; + if ( time_table.Type != TimeTableType.vsq ) { + return; + } + + // 蜿」繝代け縺ョ豈埼浹繝医Λ繝繧ッ繧定ソス蜉 + int base_image = -1; + for ( int k = 0; k < character.Count; k++ ) { + switch ( character[k].title ) { + case "a": + case "aa": + case "i": + case "u": + case "e": + case "o": + case "xo": + case "nn": + temp.Add( new TimeTable( character[k].title, 0, TimeTableType.character, null ) ); + break; + case "base": + temp.Add( new TimeTable( character[k].title, 0, TimeTableType.character, null ) ); + base_image = temp.Count - 1; + break; + default: + temp.Add( new TimeTable( character[k].title, 0, TimeTableType.character, null ) ); + break; + } + } + + float begin; + float end; + float last_end = -1f; + string body; + string lyric;//豁瑚ゥ + string phonetics;//逋コ髻ウ險伜捷 + VowelType last_vowel = VowelType.def; + for ( int entry = 0; entry < time_table.Count; entry++ ) { + #region 繧ィ繝ウ繝医Μ繧定ソス蜉 + begin = time_table[entry].begin; + end = time_table[entry].end; + body = time_table[entry].body; + string[] spl = body.Split( new char[] { '(' } ); + + phonetics = spl[1].Replace( ")", "" ); + lyric = spl[0].Replace( " ", "" ); + + VowelType type = VowelType.Attach( lyric ); + if ( entry > 0 && lyric == "繝シ" ) { + type = last_vowel; + } + if ( phonetics == "br1" || phonetics == "br2" || phonetics == "br3" || phonetics == "br4" || phonetics == "br5" ) { + type = VowelType.aa; + } + string separate = ""; + if ( type.Equals( VowelType.def ) ) { + // VowelType.Attach縺ァ縺ッ蛻、螳壹〒縺阪↑縺九▲縺溘→縺阪 + MouthSet mouth_set = VowelType.AttachEx( phonetics ); + type = mouth_set.main; + separate = mouth_set.prep.ToString(); + if ( separate == "def" ) { + separate = ""; + } + } else { + switch ( lyric ) { + #region NN + //b + case "縺ー": + case "縺カ": + case "縺ケ": + case "縺シ": + if ( VowelType.IsRegisteredToNN( "b" ) ) { + separate = "nn"; + } + break; + //p + case "縺ア": + case "縺キ": + case "縺コ": + case "縺ス": + if ( VowelType.IsRegisteredToNN( "p" ) ) { + separate = "nn"; + } + break; + //m + case "縺セ": + case "繧": + case "繧": + case "繧": + if ( VowelType.IsRegisteredToNN( "m" ) ) { + separate = "nn"; + } + break; + //b' + case "縺ウ繧": + case "縺ウ": + case "縺ウ繧": + case "縺ウ縺": + case "縺ウ繧": + if ( VowelType.IsRegisteredToNN( "b'" ) ) { + separate = "nn"; + } + break; + //p' + case "縺エ繧": + case "縺エ": + case "縺エ繧": + case "縺エ縺": + case "縺エ繧": + if ( VowelType.IsRegisteredToNN( "p'" ) ) { + separate = "nn"; + } + break; + //m' + case "縺ソ繧": + case "縺ソ": + case "縺ソ繧": + case "縺ソ縺": + case "縺ソ繧": + if ( VowelType.IsRegisteredToNN( "m'" ) ) { + separate = "nn"; + } + break; + #endregion + + #region U + //p\ + case "縺オ縺": + //case "縺オ": + case "縺オ縺": + case "縺オ縺": + if ( VowelType.IsRegisteredToU( @"p\" ) ) { + separate = "u"; + } + break; + //p\' + case "縺オ縺": + case "縺オ繧": + if ( VowelType.IsRegisteredToU( @"p\'" ) ) { + separate = "u"; + } + break; + //w + case "繧": + case "縺縺": + case "縺縺": + //case "繧": + case "縺縺": + if ( VowelType.IsRegisteredToU( "w" ) ) { + separate = "u"; + } + break; + //ts + case "縺、縺": + case "縺、縺": + //case "縺、": + case "縺、縺": + case "縺、縺": + if ( VowelType.IsRegisteredToU( "ts" ) ) { + separate = "u"; + } + break; + //dz + case "縺・縺": + case "縺・縺": + //case "縺・": + case "縺・縺": + case "縺・縺": + if ( VowelType.IsRegisteredToU( "dz" ) ) { + separate = "u"; + } + break; + #endregion + + #region I + //k' + case "縺阪c": + //case "縺": + case "縺阪e": + case "縺阪g": + if ( VowelType.IsRegisteredToI( "k'" ) ) { + separate = "i"; + } + break; + //g' + case "縺弱c": + //case "縺": + case "縺弱e": + case "縺弱g": + if ( VowelType.IsRegisteredToI( "g'" ) ) { + separate = "i"; + } + break; + //S + case "縺励c": + //case "縺": + case "縺励e": + case "縺励∞": + case "縺励g": + if ( VowelType.IsRegisteredToI( "S" ) ) { + separate = "i"; + } + break; + //dZ + //case "縺「": + case "縺「繧": + case "縺「縺": + case "縺「繧": + if ( VowelType.IsRegisteredToI( "dZ" ) ) { + separate = "i"; + } + break; + //tS + case "縺。繧": + //case "縺。": + case "縺。繧": + case "縺。縺": + case "縺。繧": + if ( VowelType.IsRegisteredToI( "tS" ) ) { + separate = "i"; + } + break; + //J + case "縺ォ繧": + //case "縺ォ": + case "縺ォ繧": + case "縺ォ縺": + case "縺ォ繧": + if ( VowelType.IsRegisteredToI( "J" ) ) { + separate = "i"; + } + break; + //C + case "縺イ繧": + //case "縺イ": + case "縺イ繧": + case "縺イ縺": + case "縺イ繧": + if ( VowelType.IsRegisteredToI( "C" ) ) { + separate = "i"; + } + break; + // another + case "縺縺": + separate = "i"; + break; + #endregion + } + } + + bool mode_sp = false; + if ( close_mouth_when_same_vowel_repeated ) { + // 豈埼浹縺碁」邯壹☆繧句エ蜷医r讀懷コ + if ( separate == "" && begin == last_end && last_vowel.Equals( type ) && lyric != "繝シ" ) { + if ( type.Equals( VowelType.a ) ) { + if ( lyric != "縺" && !phonetics.StartsWith( "a" ) ) { + separate = "nn"; + mode_sp = true; + } + } else if ( type.Equals( VowelType.i ) ) { + if ( lyric != "縺" && !phonetics.StartsWith( "i" ) ) { + separate = "nn"; + mode_sp = true; + } + } else if ( type.Equals( VowelType.u ) ) { + if ( lyric != "縺" && !phonetics.StartsWith( "u" ) ) { + separate = "nn"; + mode_sp = true; + } + } else if ( type.Equals( VowelType.e ) ) { + if ( lyric != "縺" && !phonetics.StartsWith( "e" ) ) { + separate = "nn"; + mode_sp = true; + } + } else if ( type.Equals( VowelType.o ) ) { + if ( lyric != "縺" && !phonetics.StartsWith( "o" ) ) { + separate = "nn"; + mode_sp = true; + } + } + } + } + + last_end = end; + last_vowel = type; + + if ( separate != "" ) { + float total = end - begin; + float tmp_begin = begin; + float tmp_end; + float close_length; + if ( mode_sp ) { + close_length = CLOSE_LENGTH_SHORT; + } else { + close_length = CLOSE_LENGTH; + } + if ( total > 2f * close_length / frame_rate ) { + //繧ィ繝ウ繝医Μ縺ョ髟キ縺輔′縲∝香蛻髟キ縺蝣エ蜷 + tmp_end = begin + close_length / frame_rate; + } else { + tmp_end = begin + total / 2f; + } + begin = tmp_end; + //for ( int base_track = 0; base_track < s.m_groups_character[mouth_group].Count; base_track++ ) { + for ( int base_track = 0; base_track < temp.Count; base_track++ ) { + if ( temp[base_track].Text == separate ) { + //temp[base_track].Add( new TimeTableEntry( tmp_begin, tmp_end, separate ) ); + temp.Interrup( base_track, tmp_begin, tmp_end ); + break; + } + } + } + for ( int base_track = 0; base_track < temp.Count; base_track++ ) { + if ( temp[base_track].Text == type.ToString() ) { + //temp[base_track].Add( new TimeTableEntry( begin, end, type.ToString() ) ); + temp.Interrup( base_track, begin, end ); + break; + } + } + #endregion + } + + // 騾」邯壹@縺ヲ縺繧九d縺、縺後≠繧後ー繝槭シ繧ク縺吶k + bool change = true; + while ( change ) { + change = false; + for ( int track = 0; track < temp.Count; track++ ) { + for ( int entry = 0; entry < temp[track].Count - 1; entry++ ) { + if ( temp[track][entry].body == temp[track][entry + 1].body && temp[track][entry].end == temp[track][entry + 1].begin ) { + temp[track][entry].end = temp[track][entry + 1].end; + temp[track].RemoveAt( entry + 1 ); + change = true; + break; + } + } + } + } + + // is_default縺ェ逕サ蜒冗畑縺ョ繧ィ繝ウ繝医Μ繧定ソス蜉 + for ( int k = 0; k < character.Count; k++ ) { + if ( character[k].IsDefault ) { + temp.Fill( k, total_sec ); + } + } + + } + + /// + /// 逕サ髱「荳翫↓陦ィ遉コ縺輔l繧九ヨ繝ゥ繝繧ッ縺ョ謨ー + /// + [Browsable(false)] + public int VisibleTracks { + get { + if ( folded ) { + return 0; + } else { + return list.Count; + } + } + } + + /// + /// 隨ャtrack逡ェ逶ョ縺ョ繝医Λ繝繧ッ縺ョ縲∵怙蛻昴ョ繧ィ繝ウ繝医Μ縺ョON譎ょ綾繧定ソ斐@縺セ縺吶ゅお繝ウ繝医Μ縺梧悴縺辟。縺蝣エ蜷医∬イ縺ョ蛟、繧定ソ斐@縺セ縺 + /// + /// + /// + public float GetFirstOn( int track ) { + if ( list[track].Count > 0 ) { + return list[track][0].begin; + } else { + return -1f; + } + } + + public float GetFirstOn() { + if ( list.Count > 0 ) { + float[] first = new float[list.Count]; + for ( int i = 0; i < list.Count; i++ ) { + if ( list[i].Count > 0 ) { + first[i] = list[i][0].begin; + } else { + first[i] = -1f; + } + } + float res = float.MaxValue; + foreach ( float val in first ) { + if ( val >= 0f ) { + res = Math.Min( res, val ); + } + } + if ( res == float.MaxValue ) { + return -1f; + } else { + return res; + } + } else { + return -1f; + } + } + + [Browsable(false)] + public Character3 Character { + get { + return m_character3; + } + set { + m_character3 = value; + } + } + + /// + /// 謖螳壹@縺滓凾蛻サ縺ォ縺翫¢繧九√%縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ菴咲スョ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public PointF GetPosition( float time ) { + return new PointF( mc_x.GetValue( time ), mc_y.GetValue( time ) ); + } + + /// + /// 謖螳壹@縺滓凾蛻サ縺ォ縺翫¢繧九√%縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ繧ケ繧ア繝シ繝ォ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public float GetScale( float time ) { + return mc_scale.GetValue( time ); + } + + /// + /// 謖螳壹@縺滓凾蛻サ縺ォ縺翫¢繧九√%縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ繧「繝ォ繝輔ぃ蛟、繧貞叙蠕励@縺セ縺 + /// + /// + /// + public float GetAlpha( float time ) { + float a = mc_alpha.GetValue( time ); + if( a > 1f ) { + a = 1f; + } else if( a < 0f ) { + a = 0f; + } + return a; + } + + /// + /// 謖螳壹@縺滓凾蛻サ縺ォ縺翫¢繧九√%縺ョ繧ェ繝悶ず繧ァ繧ッ繝医ョ蝗櫁サ「隗貞コヲ繧貞叙蠕励@縺セ縺 + /// + /// + /// + public float GetRotate( float time ) { + float r = mc_rotate.GetValue( time ); + if( r > 360f ) { + r = r % 360f; + } else if( r < 0f ) { + r = r % 360f + 360f; + } + return r; + } + + [OnDeserializing] + private void onDeserializing( StreamingContext sc ) { + folded = false; + } + + [OnDeserialized] + private void onDeserialized( StreamingContext sc ) { +#if DEBUG + Console.WriteLine( "TimeTableGroup.onDeserialized(StreamingContext)" ); +#endif + if( mc_x == null ) { + mc_x = new BezierChain( Common.CURVE_X ); + mc_x.Default = position.X; + } + if( mc_y == null ) { + mc_y = new BezierChain( Common.CURVE_Y ); + mc_y.Default = position.Y; + } + if( mc_scale == null ) { + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = scale; + } + if( mc_alpha == null ) { + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = 1.0f; + } + if( mc_rotate == null ) { + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + } + mc_x.Color = Common.CURVE_X; + mc_y.Color = Common.CURVE_Y; + mc_scale.Color = Common.CURVE_SCALE; + mc_alpha.Color = Common.CURVE_ALPHA; +#if DEBUG + Common.DebugWriteLine( "TimeTableGroup.onDeserialized; (m_character==null);" + (m_character == null) ); +#endif + if( m_character != null ) { + m_character3 = new Character3( m_character ); + m_character.Dispose(); + m_character = null; + } + if ( list != null ) { + if ( list.Count > 0 ) { + if ( list[0].Type == TimeTableType.character && m_character3 != null ) { + List buf = new List(); + for ( int i = 0; i < list.Count; i++ ) { + buf.Add( (TimeTable)list[i].Clone() ); + } + list.Clear(); + for ( int i = 0; i < m_character3.Count; i++ ) { + for ( int j = 0; j < buf.Count; j++ ) { + if ( buf[j].Text == m_character3[i].title ) { + list.Add( buf[j] ); + } + } + } + } + } + } + } + + public void Dispose() { + if( m_character != null ) { + m_character.Dispose(); + } + if( list != null ) { + list.Clear(); + } + } + + public void Fill( int target, float total_sec ) { + string title = list[target].Text; + string tag = m_character3[title].tag; + + //蜷後§繧ソ繧ー繧呈戟縺、繧ソ繧、繝繝繝シ繝悶Ν縺ョ繧、繝ウ繝繧ッ繧ケ繧貞玲嫌 + List same_tag = new List(); + for( int i = 0; i < list.Count; i++ ) { + if( i != target ) { + string t_title = list[i].Text; + string t_tag = m_character3[t_title].tag; + if( t_tag == tag ) { + same_tag.Add( i ); + } + } + } + list[target].Clear(); + if( same_tag.Count == 0 || tag == "" ) { + list[target].Add( new TimeTableEntry( 0f, total_sec, title ) ); + return; + } + + //縺セ縺夐幕蟋区凾髢薙ョ荳ュ縺九i荳逡ェ騾溘>繧ィ繝ウ繝医Μ繧呈爾縺 + float min = float.MaxValue; + int track_of_min = -1; + foreach( int index in same_tag ) { + if( list[index].Count > 0 ) { + min = Math.Min( min, list[index][0].begin ); + track_of_min = index; + } + } + if( track_of_min < 0 ) { + // 謗剃サ悶ョ縺九°繧九ち繧ー縺ッ縺ゅk縺後√◎縺ョ縺縺。縺ョ縺縺・繧後↓繧ゅ∪縺繧ィ繝ウ繝医Μ縺悟性縺セ繧後※縺縺ェ縺蝣エ蜷 + list[target].Add( new TimeTableEntry( 0f, total_sec, title ) ); + return; + } +#if DEBUG + MessageBox.Show( "min=" + min ); +#endif + + if( min != 0f ) { + list[target].Add( new TimeTableEntry( 0f, min, title ) ); + list[target].Sort(); + } + + bool added = true; + while( added ) { + added = false; + // 邨ゆコ譎ょ綾縺稽in繧医j蠕後〒縲√°縺、髢句ァ区凾蛻サ縺稽in縺ィ蜷後§縺矩溘>縺檎┌縺縺九←縺縺区、懃エ「 + bool found = true; + while( found ) { + found = false; + foreach( int index in same_tag ) { + for( int entry = 0; entry < list[index].Count; entry++ ) { + if( list[index][entry].end > min && list[index][entry].begin <= min ) { + found = true; + //track_of_min = index; + //entry_of_min = entry; + min = list[index][entry].end; + break; + } + } + if( found ) { + break; + } + } + } + + // 譁ー縺励>min繧呈、懃エ「 + float begin = min; + + // 髢句ァ区凾蛻サ縺恵egin繧医j蠕後ョ繧ィ繝ウ繝医Μ縺ョ縺縺。荳逡ェ譌ゥ縺繧ゅョ繧呈、懃エ「 + min = float.MaxValue; + found = false; + foreach( int index in same_tag ) { + for( int entry = 0; entry < list[index].Count; entry++ ) { + if( begin < list[index][entry].begin ) { + min = Math.Min( min, list[index][entry].begin ); + //track_of_min = index; + //entry_of_min = entry; + found = true; + break; + } + } + } + + float end; + if( found ) { + end = min; + added = true; + } else { + end = total_sec; + } + + list[target].Add( new TimeTableEntry( begin, end, title ) ); +#if DEBUG + Common.DebugWriteLine( "" + (end - begin) ); +#endif + list[target].Sort(); + + } + } + + /// + /// 謖螳壹@縺鬱imeTableGroup縺ョ縲∫ャャtrack逡ェ逶ョ縺ョTimeTable縺ォ縲√お繝ウ繝医Μitem繧貞牡繧願セシ縺セ縺帙∪縺 + /// 謗剃サ門宛蠕。縺後°縺九k蝣エ蜷医ッ縲∵諺蜈・縺輔l縺殃tem莉・螟悶ョ驛ィ蛻縺悟炎繧峨l縺セ縺 + /// Undo, redo逕ィ縺ョ蜃ヲ逅縺ッ縲√%縺ョ髢「謨ー縺ョ蜻シ縺ウ蜃コ縺怜縺ァ陦後o繧後k + /// + /// + /// + /// + public void Interrup( int target, float t1, float t2 ) { + InterrupCore( target, t1, t2, "", false ); + } + + public void Interrup( int target, float t1, float t2, string str ) { + InterrupCore( target, t1, t2, str, true ); + } + + private void InterrupCore( int target, float t1, float t2, string str, bool body_specified ) { + if( target < 0 ) { + return; + } + + float begin, end; + if( t1 > t2 ) { + begin = t2; + end = t1; + } else if( t2 > t1 ) { + begin = t1; + end = t2; + } else { + return; + } + + string title; + if( body_specified ) { + title = str; + } else { + title = list[target].Text; + } + using( TimeTableEntry item = new TimeTableEntry( begin, end, title ) ) { + + // 繧ソ繧ー縺瑚ィュ螳壹&繧後※縺繧九°シ + string tag;// = ""; + if( m_character3 != null ) { + tag = m_character3[title].tag; + } else { + tag = ""; + } + + trimToInterrup( target, item ); + + // 繧ソ繧ー險ュ螳壹′縺ゅk蝣エ蜷医よ賜莉悶ョ縺九°繧九⊇縺九ョ繧ィ繝ウ繝医Μ繧りェソ遽 + if( tag != "" ) { + for( int track = 0; track < list.Count; track++ ) { + if( track != target ) { + string this_tag = m_character3[list[track].Text].tag; + if( this_tag == tag ) { + trimToInterrup( track, item ); + } + } + } + } + + list[target].Add( (TimeTableEntry)item.Clone() ); + list[target].Sort(); + } + } + + private void trimToInterrup( int track, TimeTableEntry item ) { + // 蜑イ繧願セシ縺ソ蟇セ雎。縺ョ繧ソ繧、繝繝繝シ繝悶Ν縺ァ縺九カ縺」縺ヲ縺繧九お繝ウ繝医Μ繧定ェソ遽 + bool changed = true; + while( changed ) { + changed = false; + for( int entry = 0; entry < list[track].Count; entry++ ) { + float list_begin = list[track][entry].begin; + float list_end = list[track][entry].end; + if( item.begin <= list_begin && list_begin < item.end && item.end < list_end ) { + // list : [***********] + // item : [*****] + // 竊凪鍋オ先棡 + // list : [*****][*******] + list[track][entry].begin = item.end; + changed = true; + break; + } else if( item.begin <= list_begin && list_end <= item.end/*item.begin < list_begin && list_begin <= item.end && list_end <= item.end*/ ) { + // list : [***********] + // item : [*****************] + // 竊凪鍋オ先棡 + // list : [*****************] + list[track].RemoveAt( entry ); + changed = true; + break; + } else if( list_begin < item.begin && item.begin < list_end && item.end < list_end ) { + // list : [***********] + // item : [*****] + // 竊凪鍋オ先棡 + // list : [*][*****][*] + float old_end = list[track][entry].end; + list[track][entry].end = item.begin; + list[track].Add( new TimeTableEntry( item.end, old_end, list[track][entry].body ) ); + list[track].Sort(); + changed = true; + break; + } else if( list_begin < item.begin && item.begin < list_end && list_end < item.end ) { + // list : [***********] + // item : [***********] + // 竊凪鍋オ先棡 + // list : [*][***********] + list[track][entry].end = item.begin; + changed = true; + break; + } else if( Math.Abs( list_begin - item.begin ) <= float.Epsilon && Math.Abs( list_end - item.end ) <= float.Epsilon ) { + // list : [***********] + // item : [***********] + // 竊凪鍋オ先棡 + // list : [***********] + list[track].RemoveAt( entry ); + changed = true; + break; + } + } + } + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ縲∵凾蛻サtime縺ョ譎らせ縺ァON縺ィ縺ェ縺」縺ヲ縺繧九お繝ウ繝医Μ蜷 + /// 縺ョ繝ェ繧ケ繝医r縲―n蛹コ蛻繧翫ョ譁蟄怜励〒霑斐@縺セ縺 + /// + /// + /// + public string[] GetDrawObjectNames( float time ) { + List draw = new List(); + for( int track = 0; track < list.Count; track++ ) { + int start_entry = list[track].Value; + for( int entry = start_entry; entry < list[track].Count; entry++ ) { + if( list[track][entry].begin <= time && time <= list[track][entry].end ) { + draw.Add( list[track].Text ); + } + } + } + return draw.ToArray(); + } + + public int[] GetDrawObjectIndex( float time, string mouth ) { + string exclude_tag = ""; + if ( mouth.Length > 0 && m_character3 != null ) { + int index_of_mouth = m_character3[mouth].Z; + if ( index_of_mouth >= 0 ) { + exclude_tag = m_character3[index_of_mouth].tag; + } + } + List draw = new List(); + for( int track = 0; track < list.Count; track++ ) { + if ( exclude_tag.Length > 0 && m_character3 != null ) { + if ( m_character3[list[track].Text].tag == exclude_tag ) { + if ( m_character3[list[track].Text].title == mouth ) { + draw.Add( track ); + } + continue; + } + } + int start_entry = list[track].Value; + for( int entry = start_entry; entry < list[track].Count; entry++ ) { + if( list[track][entry].begin <= time && time < list[track][entry].end ) { + draw.Add( track ); + break; + } + } + } + return draw.ToArray(); + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励′縲∫判髱「荳翫〒謚倥j縺溘◆縺ソ陦ィ遉コ縺輔l縺ヲ縺繧九°縺ゥ縺縺九r陦ィ縺吝、繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + [Browsable( false )] + public bool Folded { + get { + return folded; + } + set { + folded = value; + } + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ繝繝輔か繝ォ繝医ョ陦ィ遉コ繧ケ繧ア繝シ繝ォ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + public float Scale { + get { + return mc_scale.Default; + } + set { + mc_scale.Default = value; + } + } + + public void Insert( int index, TimeTable table ) { + list.Insert( index, table ); + } + + public object Clone() { + TimeTableGroup tmp = new TimeTableGroup( m_Text, m_intValue, m_character3 ); + for( int i = 0; i < list.Count; i++ ) { + tmp.list.Add( (TimeTable)list[i].Clone() ); + } + //tmp.position = position; + tmp.m_zOrder = m_zOrder; + //tmp.scale = scale; + tmp.folded = folded; + tmp.mc_alpha = (BezierChain)this.mc_alpha.Clone(); + tmp.mc_rotate = (BezierChain)this.mc_rotate.Clone(); + tmp.mc_scale = (BezierChain)this.mc_scale.Clone(); + tmp.mc_x = (BezierChain)this.mc_x.Clone(); + tmp.mc_y = (BezierChain)this.mc_y.Clone(); + tmp.m_position_fixed = this.m_position_fixed; + return tmp; + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョZ繧ェ繝シ繝繝シ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + [Browsable( false )] + public int ZOrder { + get { + return m_zOrder; + } + set { + m_zOrder = value; + } + } + + public void RemoveAt( int track ) { + list.RemoveAt( track ); + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ陦ィ遉コ菴咲スョ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺 + /// + [Browsable( false )] + public Point Position { + get { + return new Point( (int)mc_x.Default, (int)mc_y.Default ); + } + set { + PointF t = value; + mc_x.Default = t.X; + mc_y.Default = t.Y; + } + } + + /// + /// 縺薙ョ繧ソ繧、繝繝繝シ繝悶Ν繧ー繝ォ繝シ繝励ョ陦ィ遉コ菴咲スョ繧貞叙蠕励∪縺溘ッ險ュ螳壹@縺セ縺吶 + /// 縺薙ョ繝励Ο繝代ユ繧」縺ッ繝励Ο繝代ユ繧」繝薙Η繝シ縺ァ縺ョ陦ィ遉コ逕ィ縺ァ縺吶 + /// + public Position Location { + get { + return new Position( mc_x.Default, mc_y.Default ); + } + set { + mc_x.Default = value.X; + mc_y.Default = value.Y; + } + } + + [Browsable( false )] + public int Value { + get { + return m_intValue; + } + set { + m_intValue = value; + } + } + + public string Text { + get { + return m_Text; + } + set { + m_Text = value; + } + } + + public void Clear() { + for( int i = 0; i < list.Count; i++ ) { + list[i].Clear(); + } + list.Clear(); + } + + [Browsable( false )] + public TimeTable this[int track] { + get { + return list[track]; + } + set { + list[track] = (TimeTable)value; + } + } + + public TimeTableGroup( string text, int value, Character3 character/*, Image baseImage*/ ) { + list = new List(); + m_Text = text; + /*m_baseImage = baseImage;*/ + if( character != null ) { + m_character3 = (Character3)character.Clone(); + } else { + m_character3 = null; + } + m_intValue = value; + //position = new Point( 0, 0 ); + m_zOrder = 0; + scale = 1.0f; + mc_x = new BezierChain( Common.CURVE_X ); + mc_y = new BezierChain( Common.CURVE_Y ); + mc_scale = new BezierChain( Common.CURVE_SCALE ); + mc_scale.Default = 1f; + mc_alpha = new BezierChain( Common.CURVE_ALPHA ); + mc_alpha.Default = 1f; + mc_rotate = new BezierChain( Common.CURVE_ROTATE ); + folded = false; + } + + + public void Add( TimeTable new_time_table ) { + list.Add( (TimeTable)new_time_table.Clone() ); + } + + [Browsable( false )] + public int Count { + get { + if( list != null ) { + return list.Count; + } else { + return 0; + } + } + } + + } + +} diff --git a/trunk/LipSync/Editor/TimeTable/TimeTableType.cs b/trunk/LipSync/Editor/TimeTable/TimeTableType.cs new file mode 100644 index 0000000..0a32672 --- /dev/null +++ b/trunk/LipSync/Editor/TimeTable/TimeTableType.cs @@ -0,0 +1,27 @@ +サソ/* + * TimeTableType.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + public enum TimeTableType { + vsq = 0, + another = 1, + character = 2, + plugin = 4, + none = 5, + top = 6, + telop = 7, + whole = 8, + } + +} diff --git a/trunk/LipSync/Editor/TrackSelecter.cs b/trunk/LipSync/Editor/TrackSelecter.cs new file mode 100644 index 0000000..bc9d231 --- /dev/null +++ b/trunk/LipSync/Editor/TrackSelecter.cs @@ -0,0 +1,98 @@ +サソ/* + * TrackSelecter.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class TrackSelecter : Form, IMultiLanguageControl { + public TrackSelecter( string file_name, string[] track_names ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + checkedListBox1.Items.Clear(); + for ( int i = 0; i < track_names.Length; i++ ) { + if ( track_names[i] != "Master Track" ) { + checkedListBox1.Items.Add( track_names[i], true ); + } else { + checkedListBox1.Items.Add( track_names[i], false ); + } + } + textBox1.Text = file_name; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.button1.Text = _( "Cancel" ); + this.button2.Text = _( "OK" ); + this.Text = _( "Select track" ); + this.checkImportTempoAndTimesig.Text = _( "import tempo and time-signal information" ); + } + + public string _( string s ) { + return Messaging.GetMessage( s ); + } + + public bool ImportTempoAndTimesig { + get { + return checkImportTempoAndTimesig.Checked; + } + set { + checkImportTempoAndTimesig.Checked = value; + } + } + + public int[] CheckedItem { + get { + int count = 0; + for ( int i = 0; i < checkedListBox1.Items.Count; i++ ) { + if ( checkedListBox1.GetItemChecked( i ) ) { + count++; + } + } + int[] list = new int[count]; + //MessageBox.Show( "count=" + count ); + count = -1; + for ( int i = 0; i < checkedListBox1.Items.Count; i++ ) { + //MessageBox.Show( "item no." + i + " GetItemChecked=" + checkedListBox1.GetItemChecked( i ) ); + if ( checkedListBox1.GetItemChecked( i ) ) { + count++; + list[count] = i; + } + } + return list; + } + } + + private void button2_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void button1_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + } + +} diff --git a/trunk/LipSync/Editor/TrackSelecter.designer.cs b/trunk/LipSync/Editor/TrackSelecter.designer.cs new file mode 100644 index 0000000..ed1654f --- /dev/null +++ b/trunk/LipSync/Editor/TrackSelecter.designer.cs @@ -0,0 +1,139 @@ +/* + * TrackSelecter.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class TrackSelecter { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.Label(); + this.checkImportTempoAndTimesig = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // checkedListBox1 + // + this.checkedListBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.checkedListBox1.FormattingEnabled = true; + this.checkedListBox1.HorizontalScrollbar = true; + this.checkedListBox1.Items.AddRange( new object[] { + "a"} ); + this.checkedListBox1.Location = new System.Drawing.Point( 12, 68 ); + this.checkedListBox1.Name = "checkedListBox1"; + this.checkedListBox1.Size = new System.Drawing.Size( 264, 200 ); + this.checkedListBox1.TabIndex = 0; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.button1.Location = new System.Drawing.Point( 201, 311 ); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size( 75, 23 ); + this.button1.TabIndex = 3; + this.button1.Text = "Cancel"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler( this.button1_Click ); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button2.Location = new System.Drawing.Point( 100, 311 ); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size( 75, 23 ); + this.button2.TabIndex = 2; + this.button2.Text = "OK"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler( this.button2_Click ); + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point( 12, 9 ); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 264, 56 ); + this.textBox1.TabIndex = 4; + this.textBox1.Text = "file path"; + // + // checkImportTempoAndTimesig + // + this.checkImportTempoAndTimesig.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkImportTempoAndTimesig.AutoSize = true; + this.checkImportTempoAndTimesig.Checked = true; + this.checkImportTempoAndTimesig.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkImportTempoAndTimesig.Location = new System.Drawing.Point( 14, 279 ); + this.checkImportTempoAndTimesig.Name = "checkImportTempoAndTimesig"; + this.checkImportTempoAndTimesig.Size = new System.Drawing.Size( 169, 16 ); + this.checkImportTempoAndTimesig.TabIndex = 1; + this.checkImportTempoAndTimesig.Text = "繝繝ウ繝昴→諡榊ュ舌ョ諠蝣ア繧貞叙繧願セシ繧"; + this.checkImportTempoAndTimesig.UseVisualStyleBackColor = true; + // + // TrackSelecter + // + this.AcceptButton = this.button2; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.button1; + this.ClientSize = new System.Drawing.Size( 288, 346 ); + this.Controls.Add( this.checkImportTempoAndTimesig ); + this.Controls.Add( this.textBox1 ); + this.Controls.Add( this.button2 ); + this.Controls.Add( this.button1 ); + this.Controls.Add( this.checkedListBox1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "TrackSelecter"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "TrackSelecter"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckedListBox checkedListBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label textBox1; + private System.Windows.Forms.CheckBox checkImportTempoAndTimesig; + + } +} diff --git a/trunk/LipSync/Editor/VersionBox.cs b/trunk/LipSync/Editor/VersionBox.cs new file mode 100644 index 0000000..efd30a6 --- /dev/null +++ b/trunk/LipSync/Editor/VersionBox.cs @@ -0,0 +1,44 @@ +サソ/* + * VersionBox.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace LipSync { + + public partial class VersionBox : Form, IMultiLanguageControl { + public VersionBox( string title, string message ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + label1.Text = message; + this.Text = title; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + } + + private void button1_Click( object sender, EventArgs e ) { + this.Close(); + } + } + +} diff --git a/trunk/LipSync/Editor/VersionBox.designer.cs b/trunk/LipSync/Editor/VersionBox.designer.cs new file mode 100644 index 0000000..a2a71bb --- /dev/null +++ b/trunk/LipSync/Editor/VersionBox.designer.cs @@ -0,0 +1,89 @@ +サソ/* + * VersionInfo.designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class VersionBox { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Font = new System.Drawing.Font( "Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)) ); + this.label1.Location = new System.Drawing.Point( 53, 9 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 212, 43 ); + this.label1.TabIndex = 0; + this.label1.Text = "Lip Sync version 0.0\r\nby kbinani"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // button1 + // + this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.button1.Location = new System.Drawing.Point( 115, 60 ); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size( 83, 25 ); + this.button1.TabIndex = 1; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler( this.button1_Click ); + // + // VersionBox + // + this.AcceptButton = this.button1; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.button1; + this.ClientSize = new System.Drawing.Size( 323, 111 ); + this.Controls.Add( this.button1 ); + this.Controls.Add( this.label1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VersionBox"; + this.ShowInTaskbar = false; + this.Text = "VersionInfo"; + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + } +} \ No newline at end of file diff --git a/trunk/LipSync/Editor/VowelType.cs b/trunk/LipSync/Editor/VowelType.cs new file mode 100644 index 0000000..f2f83da --- /dev/null +++ b/trunk/LipSync/Editor/VowelType.cs @@ -0,0 +1,552 @@ +サソ/* + * VowelType.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; + +namespace LipSync { + + public struct MouthSet { + public VowelType prep; + public VowelType main; + } + + /// + /// 蜿」縺ョ蠖「縺ョ遞ョ鬘槭r螳夂セゥ縺吶k繧ッ繝ゥ繧ケ縲Kava縺ス縺 + /// + public struct VowelType { + public static List m_list_nn = new List( new string[] { "b", "p", "m", "b'", "p'", "m'" } ); + public static List m_list_i = new List( new string[] { "k'", "g'", "S", "dZ", "tS", "J", "C" } ); + public static List m_list_u = new List( new string[] { @"p\", @"p\'", "w", "ts", "dz" } ); + public static VowelType def = new VowelType( -1 ); + public static VowelType a = new VowelType( 0 ); + public static VowelType aa = new VowelType( 1 ); + public static VowelType i = new VowelType( 2 ); + public static VowelType u = new VowelType( 3 ); + public static VowelType e = new VowelType( 4 ); + public static VowelType o = new VowelType( 5 ); + public static VowelType xo = new VowelType( 6 ); + public static VowelType nn = new VowelType( 7 ); + + private int m_iValue; + + public static bool IsRegisteredToNN( string type ) { + foreach ( string s in m_list_nn ) { + if ( type == s ) { + return true; + } + } + return false; + } + + public bool Equals( VowelType item ) { + if ( this.m_iValue == item.m_iValue ) { + return true; + } else { + return false; + } + } + + public static bool IsRegisteredToI( string type ) { + foreach ( string s in m_list_i ) { + if ( type == s ) { + return true; + } + } + return false; + } + + public static bool IsRegisteredToU( string type ) { + foreach ( string s in m_list_u ) { + if ( type == s ) { + return true; + } + } + return false; + } + + private VowelType( int value ) { + this.m_iValue = value; + } + + public int value { + get { + return m_iValue; + } + } + + new public string ToString() { + switch ( m_iValue ) { + case -1: + return "def"; + case 0: + return "a"; + case 1: + return "aa"; + case 2: + return "i"; + case 3: + return "u"; + case 4: + return "e"; + case 5: + return "o"; + case 6: + return "xo"; + case 7: + return "nn"; + default: + return "def"; + } + } + + /// + /// + /// + /// + /// + public static MouthSet AttachEx( string lyric ) { + string[] spl = lyric.Split( " ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries ); + string vowel, consonant; + MouthSet result = new MouthSet(); + result.main = VowelType.def; + result.prep = VowelType.def; + if ( spl.Length == 0 ) { + return result; + } + if ( spl.Length == 1 ) { + vowel = spl[0]; + consonant = ""; + } else { + consonant = spl[0]; + vowel = spl[1]; + } + switch ( vowel ) { + case "a": + result.main = VowelType.a; + break; + case "i": + result.main = VowelType.i; + break; + case "M": + result.main = VowelType.u; + break; + case "e": + result.main = VowelType.e; + break; + case "o": + result.main = VowelType.o; + break; + // 莉・荳九∝ュ宣浹縺ョ縺ソ縺ョ逋コ髻ウ縺梧欠螳壹&繧後k蝣エ蜷 + case "n": + case "N": + case "J": + case "m": + case "N\\\\": + case "N\\": + case "N'": + case "m'": + result.main = VowelType.nn; + break; + case "ts": + case "s": + result.main = VowelType.u; + break; + case "@": //the sun + case "V": //strut + case "{": //trap + case "aI": //buy + case "aU": //loud + case "Q@": //star + result.main = VowelType.a; + break; + case "I": //kit + case "i:": //beef + case "I@": //beer + result.main = VowelType.i; + break; + case "U": //put + case "u:": //boot + case "U@": //poor + result.main = VowelType.u; + break; + //case "e": //them + case "@r": //maker + case "eI": //pay + case "e@": //bear + result.main = VowelType.e; + break; + case "O:": //taught + case "Q": //lot + case "OI": //boy + case "@U": //boat + case "O@": //pour + result.main = VowelType.o; + break; + } + switch ( consonant ) { + case "g": + case "N": + case "s": + case "z": + case "t": + case "d": + case "k": + case "Z": + case "t'": + case "d'": + case "h": + case "h\\\\": + case "j": + case "4'": + case "N'": + case "n": + break; + case "b": + case "p": + case "m": + case "b'": + case "p'": + case "m'": + //foreach ( string s in Form1.Instatnce.Config.LIST_NN ) { + foreach ( string s in m_list_i ) { + if ( s == consonant ) { + result.prep = VowelType.nn; + break; + } + } + break; + case "p\\\\": + case "p\\\\'": + case "w": + case "ts": + case "dz": + //foreach ( string s in Form1.Instatnce.Config.LIST_U ) { + foreach ( string s in m_list_u ) { + if ( s == consonant ) { + result.prep = VowelType.u; + break; + } else { + if ( s == @"p\" && consonant == "p\\\\" ) { + result.prep = VowelType.u; + } else if ( s == @"p\'" && consonant == "p\\\\'" ) { + result.prep = VowelType.u; + } + } + } + break; + case "k'": + case "g'": + case "S": + case "dZ": + case "tS": + case "J": + case "C": + //foreach ( string s in Form1.Instatnce.Config.LIST_I ) { + foreach ( string s in m_list_i ) { + if ( s == consonant ) { + result.prep = VowelType.i; + } + } + break; + case "y": //[en] yellow + result.prep = VowelType.i; + break; + //case "w": //[en] way + // result.prep = VowelType.u; + // break; + case "bh": //[en] big + case "v": //[en] vote + //case "m": //[en] mind + case "ph": //[en] peace + result.prep = VowelType.nn; + break; + } + return result; + } + + public static VowelType Attach( string alyric ) { + string lyric = RemoveNonKanaLetter( alyric ); + switch ( lyric ) { + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺ェ": + case "縺ッ": + case "縺ー": + case "縺ア": + case "縺セ": + case "繧": + case "繧": + case "繧": + case "a": + /*case "s": + case "d": + case "n": + case "h": + case "m": + case "w": + case "na":*/ + case "縺励c": + case "縺オ縺": + case "縺。繧": + case "繧翫c": + case "縺倥c": + return VowelType.a; + + /*case "4": + return VowelType.aa;*/ + + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺。": + case "縺「": + case "縺ォ": + case "縺イ": + case "縺ウ": + case "縺エ": + case "縺ソ": + case "繧": + case "i": + /*case "k'": + case "g'": + case "S": + case "Z": + case "dZ": + case "t'": + case "tS": + case "d'": + case "J": + case "C": + case "p\\\\'": + case "b'": + case "p'": + case "m'": + case "4'":*/ + case "縺オ縺": + return VowelType.i; + + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺、": + case "縺・": + case "縺ャ": + case "縺オ": + case "縺カ": + case "繧": + case "繧": + case "繧": + case "M": + /*case "z": + case "dz": + case "ts": + case "p\\\\": + case "j": + case "u":*/ + case "縺。繧": + case "繧翫e": + //case "U": + case "縺励e": + case "縺倥e": + return VowelType.u; + + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺ヲ": + case "縺ァ": + case "縺ュ": + case "縺ク": + case "縺ケ": + case "繧": + case "繧": + case "e": + /*case "g": + case "t":*/ + case "縺縺": + return VowelType.e; + + case "縺": + case "縺": + case "縺": + case "縺": + case "縺": + case "縺ィ": + case "縺ゥ": + case "縺ョ": + case "縺サ": + case "縺シ": + case "縺ス": + case "繧": + case "繧": + case "繧": + case "o": + /*case "b": + case "p": + case "yo": + case "wo":*/ + case "縺縺": + case "縺励g": + case "縺。繧": + case "繧翫g": + case "縺倥g": + return VowelType.o; + + //case "k": + case "繧": + //case "h\\\\": + return VowelType.xo; + + case "繧": + //case "N\\\\": + return VowelType.nn; + + default: + /*if ( lyric != "繝シ" ) { + Form1.Instatnce.ErrorLog( "LipSync.VowelType.attach", "error", "cannot attach: \"" + lyric + "\"" ); + }*/ + return VowelType.def; + } + } + + /// + /// 譁蟄怜耀tr縺九i縲∝ケウ莉ョ蜷阪〒縺ェ縺譁蟄励r髯、蜴サ縺励∪縺吶ゅき繧ソ繧ォ繝翫ョ蝣エ蜷医ッ蟷ウ莉ョ蜷阪↓螟画鋤縺励∪縺吶 + /// VOCALOID縺御スソ逕ィ縺吶k逋コ髻ウ險伜捷縺ョ蝣エ蜷医ッ縺昴ョ縺セ縺セ谿九j縺セ縺 + /// + /// + /// + private static string RemoveNonKanaLetter( string str ) { + bool changed = true; + string result = str; + while ( changed ) { + changed = false; + for ( int i = 0; i < result.Length; i++ ) { + char ch = result[i]; + bool iskatakana = IsKatakana( ch ); + bool ishiragana = IsHiragana( ch ); + bool isphonetic = IsPhoneticSymbol( ch ); + //System.Windows.Forms.MessageBox.Show( "ch,IsKatakana,IsHiragana=" + ch + "," + iskatakana + "," + ishiragana ); + if ( !iskatakana && !ishiragana && !isphonetic ) { + string sch = new string( ch, 1 ); + result = result.Replace( sch, "" ); + changed = true; + break; + } else if ( iskatakana ) { + result = result.Replace( ch, (char)((int)ch - 96) ); + changed = true; + break; + } + } + } + return result; + } + + /// + /// 譁蟄様etter縺悟ケウ莉ョ蜷阪°縺ゥ縺縺九r蛻、螳壹@縺セ縺吶 + /// + /// + /// + private static bool IsHiragana( char letter ) { + int code = (int)letter; + if ( 0x3041 <= code && code <= 0x3093 ) { + return true; + } else { + return false; + } + } + + /// + /// 譁蟄様etter縺後き繧ソ繧ォ繝翫°縺ゥ縺縺九r蛻、螳壹@縺セ縺 + /// + /// + /// + private static bool IsKatakana( char letter ) { + int code = (int)letter; + if ( 0x30A1 <= code && code <= 0x30F6 ) { + return true; + } else { + return false; + } + } + + /// + /// 譁蟄様etter縺計ocaloid縺ョ逋コ髻ウ險伜捷縺九←縺縺九r蛻、螳壹@縺セ縺 + /// + /// + /// + private static bool IsPhoneticSymbol( char letter ) { + switch ( letter ) { + case 'a': + case 'i': + case 'M': + case 'e': + case 'o': + case 'k': + case 'g': + case 'N': + case 's': + case 'z': + case 't': + case 'd': + case '\'': + case 'S': + case 'Z': + case 'n': + case 'h': + case '\\': + case 'p': + case 'b': + case 'm': + case 'j': + case '4': + case 'w': + case 'J': + case 'C': + case 'r'://br1-5 + case '1': + case '2': + case '3': + case '5': + return true; + default: + return false; + } + } + + /// + /// 譁蟄様etter縺後°縺ェ譁蟄励°縺ゥ縺縺九r蛻、螳壹@縺セ縺吶 + /// + /// + /// + private static bool IsKana( char letter ) { + if ( IsHiragana( letter ) && IsKatakana( letter ) ) { + return true; + } else { + return false; + } + } + } + +} diff --git a/trunk/LipSync/Editor/Winker.Designer.cs b/trunk/LipSync/Editor/Winker.Designer.cs new file mode 100644 index 0000000..e591fd3 --- /dev/null +++ b/trunk/LipSync/Editor/Winker.Designer.cs @@ -0,0 +1,266 @@ +/* + * Winker.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class Winker { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.comboBox2 = new System.Windows.Forms.ComboBox(); + this.checkForceBegin = new System.Windows.Forms.CheckBox(); + this.checkForceEnd = new System.Windows.Forms.CheckBox(); + this.txtForceBegin = new System.Windows.Forms.TextBox(); + this.txtForceEnd = new System.Windows.Forms.TextBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 270, 249 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 11; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 156, 249 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 10; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 12, 15 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 100, 12 ); + this.label1.TabIndex = 7; + this.label1.Text = "縺セ縺ー縺溘″縺ョ髢馴囈シ育ァ抵シ"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point( 118, 12 ); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 100, 19 ); + this.textBox1.TabIndex = 0; + this.textBox1.Text = "4"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Location = new System.Drawing.Point( 230, 14 ); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size( 121, 16 ); + this.checkBox1.TabIndex = 1; + this.checkBox1.Text = "髢馴囈繧偵Λ繝ウ繝繝縺ォ縺吶k"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point( 139, 44 ); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size( 82, 19 ); + this.textBox2.TabIndex = 2; + this.textBox2.Text = "4"; + this.textBox2.TextChanged += new System.EventHandler( this.textBox2_TextChanged ); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point( 12, 47 ); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size( 121, 12 ); + this.label4.TabIndex = 14; + this.label4.Text = "髢峨§逶ョ縺ョ陦ィ遉コ繝輔Ξ繝シ繝謨ー"; + // + // groupBox1 + // + this.groupBox1.Controls.Add( this.label2 ); + this.groupBox1.Controls.Add( this.comboBox1 ); + this.groupBox1.Controls.Add( this.label3 ); + this.groupBox1.Controls.Add( this.comboBox2 ); + this.groupBox1.Location = new System.Drawing.Point( 17, 78 ); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size( 328, 85 ); + this.groupBox1.TabIndex = 3; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "逕サ蜒上r謖螳"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 14, 21 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 72, 12 ); + this.label2.TabIndex = 11; + this.label2.Text = "髢峨§逶ョ縺ョ逕サ蜒"; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point( 121, 18 ); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size( 174, 20 ); + this.comboBox1.TabIndex = 4; + this.comboBox1.SelectedIndexChanged += new System.EventHandler( this.comboBox1_SelectedIndexChanged ); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point( 14, 54 ); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size( 61, 12 ); + this.label3.TabIndex = 13; + this.label3.Text = "荳ュ蜑イ繧顔判蜒"; + // + // comboBox2 + // + this.comboBox2.FormattingEnabled = true; + this.comboBox2.Location = new System.Drawing.Point( 121, 51 ); + this.comboBox2.Name = "comboBox2"; + this.comboBox2.Size = new System.Drawing.Size( 173, 20 ); + this.comboBox2.TabIndex = 5; + this.comboBox2.SelectedIndexChanged += new System.EventHandler( this.comboBox2_SelectedIndexChanged ); + // + // checkForceBegin + // + this.checkForceBegin.AutoSize = true; + this.checkForceBegin.Location = new System.Drawing.Point( 36, 184 ); + this.checkForceBegin.Name = "checkForceBegin"; + this.checkForceBegin.Size = new System.Drawing.Size( 105, 16 ); + this.checkForceBegin.TabIndex = 6; + this.checkForceBegin.Text = "髢句ァ区凾蛻サ繧呈欠螳"; + this.checkForceBegin.UseVisualStyleBackColor = true; + this.checkForceBegin.CheckedChanged += new System.EventHandler( this.checkForceBegin_CheckedChanged ); + // + // checkForceEnd + // + this.checkForceEnd.AutoSize = true; + this.checkForceEnd.Location = new System.Drawing.Point( 206, 184 ); + this.checkForceEnd.Name = "checkForceEnd"; + this.checkForceEnd.Size = new System.Drawing.Size( 105, 16 ); + this.checkForceEnd.TabIndex = 8; + this.checkForceEnd.Text = "邨ゆコ譎ょ綾繧呈欠螳"; + this.checkForceEnd.UseVisualStyleBackColor = true; + this.checkForceEnd.CheckedChanged += new System.EventHandler( this.checkForceEnd_CheckedChanged ); + // + // txtForceBegin + // + this.txtForceBegin.Enabled = false; + this.txtForceBegin.Location = new System.Drawing.Point( 59, 206 ); + this.txtForceBegin.Name = "txtForceBegin"; + this.txtForceBegin.Size = new System.Drawing.Size( 82, 19 ); + this.txtForceBegin.TabIndex = 7; + this.txtForceBegin.Text = "4"; + // + // txtForceEnd + // + this.txtForceEnd.Enabled = false; + this.txtForceEnd.Location = new System.Drawing.Point( 229, 206 ); + this.txtForceEnd.Name = "txtForceEnd"; + this.txtForceEnd.Size = new System.Drawing.Size( 82, 19 ); + this.txtForceEnd.TabIndex = 9; + this.txtForceEnd.Text = "4"; + // + // Winker + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 362, 287 ); + this.Controls.Add( this.txtForceEnd ); + this.Controls.Add( this.txtForceBegin ); + this.Controls.Add( this.checkForceEnd ); + this.Controls.Add( this.checkForceBegin ); + this.Controls.Add( this.groupBox1 ); + this.Controls.Add( this.textBox2 ); + this.Controls.Add( this.label4 ); + this.Controls.Add( this.checkBox1 ); + this.Controls.Add( this.textBox1 ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Winker"; + this.Text = "Winker"; + this.groupBox1.ResumeLayout( false ); + this.groupBox1.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox comboBox2; + private System.Windows.Forms.CheckBox checkForceBegin; + private System.Windows.Forms.CheckBox checkForceEnd; + private System.Windows.Forms.TextBox txtForceBegin; + private System.Windows.Forms.TextBox txtForceEnd; + + } +} diff --git a/trunk/LipSync/Editor/Winker.cs b/trunk/LipSync/Editor/Winker.cs new file mode 100644 index 0000000..0ac0c46 --- /dev/null +++ b/trunk/LipSync/Editor/Winker.cs @@ -0,0 +1,197 @@ +サソ/* + * Winker.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class Winker : Form, IMultiLanguageControl { + private string m_closedeye; + private string m_in_between; + public bool Randomize; + private float m_winkInterval; + private int m_close_frames = 3; + private float m_forced_begin; + private float m_forced_end; + private float m_max_end; + + public Winker( string[] titles, float total_sec ) { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + comboBox1.Items.Clear(); + comboBox2.Items.Clear(); + for ( int i = 0; i < titles.Length; i++ ) { + comboBox1.Items.Add( titles[i] ); + comboBox2.Items.Add( titles[i] ); + } + m_closedeye = ""; + m_in_between = ""; + m_forced_begin = 0f; + m_forced_end = total_sec; + m_max_end = total_sec; + txtForceBegin.Text = m_forced_begin.ToString(); + txtForceEnd.Text = m_forced_end.ToString(); + Randomize = false; + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.btnCancel.Text = _( "Cancel" ); + this.btnOK.Text = _( "OK" ); + this.label1.Text = _( "Wink interval (sec)" ); + this.checkBox1.Text = _( "Randomize" ); + this.label2.Text = _( "Closed Eye" ); + this.label3.Text = _( "In-between Image" ); + this.label4.Text = _( "Eye-closing frames" ); + this.Text = _( "Generate wink" ); + this.groupBox1.Text = _( "Set image" ); + this.checkForceBegin.Text = _( "Limit start time" ); + this.checkForceEnd.Text = _( "Limit end time" ); + } + + private static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public float WinkInterval { + get { + return m_winkInterval; + } + } + + /// + /// 髢峨§逶ョ逕ィ逕サ蜒上ョ繧ソ繧、繝医Ν + /// + public string ClosedEye { + get { + return m_closedeye; + } + } + + /// + /// 髢峨§逶ョ縺ョ荳ュ蜑イ繧顔畑逕サ蜒上ョ繧ソ繧、繝医Ν + /// + public string InBetween { + get { + return m_in_between; + } + } + + /// + /// 逶ョ縺碁哩縺倥※陦ィ遉コ縺輔l繧九ヵ繝ャ繝シ繝謨ー + /// + public int CloseFrames { + get { + return m_close_frames; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + try { + m_winkInterval = float.Parse( textBox1.Text ); + if ( checkForceBegin.Checked ) { + m_forced_begin = float.Parse( txtForceBegin.Text ); + } + if ( checkForceEnd.Checked ) { + m_forced_end = float.Parse( txtForceEnd.Text ); + } + if ( m_forced_begin < 0.0f ) { + MessageBox.Show( _( "Invalid value has been entered" ), _( "Error" ), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + this.DialogResult = DialogResult.Cancel; + } else if ( m_max_end < m_forced_end ) { + MessageBox.Show( _( "Invalid value has been entered" ), _( "Error" ), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + this.DialogResult = DialogResult.Cancel; + } else { + this.DialogResult = DialogResult.OK; + } + } catch { + MessageBox.Show( _( "Invalid value has been entered" ), _( "Error" ), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); + this.DialogResult = DialogResult.Cancel; + } + Randomize = checkBox1.Checked; + } + + private void comboBox1_SelectedIndexChanged( object sender, EventArgs e ) { + m_closedeye = (string)comboBox1.Items[comboBox1.SelectedIndex]; + } + + private void comboBox2_SelectedIndexChanged( object sender, EventArgs e ) { + m_in_between = (string)comboBox2.Items[comboBox2.SelectedIndex]; + } + + private void textBox2_TextChanged( object sender, EventArgs e ) { + int old = m_close_frames; + try { + m_close_frames = int.Parse( textBox2.Text ); + } catch { + m_close_frames = old; + } + } + + private void checkForceBegin_CheckedChanged( object sender, EventArgs e ) { + txtForceBegin.Enabled = checkForceBegin.Checked; + if ( txtForceBegin.Enabled ) { + txtForceBegin.Focus(); + } + } + + private void checkForceEnd_CheckedChanged( object sender, EventArgs e ) { + txtForceEnd.Enabled = checkForceEnd.Checked; + if ( txtForceEnd.Enabled ) { + txtForceEnd.Focus(); + } + } + + public bool BeginForced { + get { + return checkForceBegin.Checked; + } + } + + public bool EndForced { + get { + return checkForceEnd.Checked; + } + } + + public float ForcedBegin { + get { + return m_forced_begin; + } + set { + m_forced_begin = value; + } + } + + public float ForcedEnd { + get { + return m_forced_end; + } + set { + m_forced_end = value; + } + } + } + +} diff --git a/trunk/LipSync/Editor/ZOrder.Designer.cs b/trunk/LipSync/Editor/ZOrder.Designer.cs new file mode 100644 index 0000000..f1dc754 --- /dev/null +++ b/trunk/LipSync/Editor/ZOrder.Designer.cs @@ -0,0 +1,150 @@ +/* + * ZOrder.Designer.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace LipSync { + + partial class ZOrder { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.btnUp = new System.Windows.Forms.Button(); + this.btnDown = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listBox1.FormattingEnabled = true; + this.listBox1.ItemHeight = 12; + this.listBox1.Location = new System.Drawing.Point( 12, 39 ); + this.listBox1.Name = "listBox1"; + this.listBox1.ScrollAlwaysVisible = true; + this.listBox1.Size = new System.Drawing.Size( 293, 268 ); + this.listBox1.TabIndex = 0; + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.Location = new System.Drawing.Point( 188, 320 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 289, 320 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 4; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoEllipsis = true; + this.label1.Location = new System.Drawing.Point( 12, 9 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 352, 17 ); + this.label1.TabIndex = 6; + this.label1.Text = "謠冗判鬆蠎上r螟画峩縺励◆縺繧ェ繝悶ず繧ァ繧ッ繝医r驕ク謚槭@縲∽ク翫サ荳九懊ち繝ウ縺ァ遘サ蜍輔&縺帙∪縺"; + // + // btnUp + // + this.btnUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnUp.Location = new System.Drawing.Point( 311, 39 ); + this.btnUp.Name = "btnUp"; + this.btnUp.Size = new System.Drawing.Size( 60, 23 ); + this.btnUp.TabIndex = 1; + this.btnUp.Text = "荳"; + this.btnUp.UseVisualStyleBackColor = true; + this.btnUp.Click += new System.EventHandler( this.btnUp_Click ); + // + // btnDown + // + this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnDown.Location = new System.Drawing.Point( 311, 68 ); + this.btnDown.Name = "btnDown"; + this.btnDown.Size = new System.Drawing.Size( 60, 23 ); + this.btnDown.TabIndex = 2; + this.btnDown.Text = "荳"; + this.btnDown.UseVisualStyleBackColor = true; + this.btnDown.Click += new System.EventHandler( this.btnDown_Click ); + // + // ZOrder + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 376, 355 ); + this.Controls.Add( this.btnDown ); + this.Controls.Add( this.btnUp ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.btnOK ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.listBox1 ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ZOrder"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "謠冗判鬆蠎上ョ險ュ螳"; + this.Load += new System.EventHandler( this.ZOrder_Load ); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnUp; + private System.Windows.Forms.Button btnDown; + } +} diff --git a/trunk/LipSync/Editor/ZOrder.cs b/trunk/LipSync/Editor/ZOrder.cs new file mode 100644 index 0000000..b812b31 --- /dev/null +++ b/trunk/LipSync/Editor/ZOrder.cs @@ -0,0 +1,117 @@ +サソ/* + * ZOrder.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; + +using Boare.Lib.AppUtil; + +namespace LipSync { + + public partial class ZOrder : Form, IMultiLanguageControl { + private List m_list; + + public ZOrder() { + InitializeComponent(); + ApplyLanguage(); + ApplyFont( AppManager.Config.Font.GetFont() ); + m_list = new List(); + listBox1.Items.Clear(); + } + + public void ApplyFont( Font font ) { + this.Font = font; + foreach ( Control c in this.Controls ) { + Boare.Lib.AppUtil.Misc.ApplyFontRecurse( c, font ); + } + } + + public void ApplyLanguage() { + this.btnOK.Text = _( "OK" ); + this.btnCancel.Text = _( "Cancel" ); + this.label1.Text = _( "Select target item, and push [Up] or [Down] button" ); + this.btnUp.Text = _( "Up" ); + this.btnDown.Text = _( "Down" ); + this.Text = _( "Z order" ); + } + + public static string _( string s ) { + return Messaging.GetMessage( s ); + } + + public void itemAdd( ZorderItem item ) { + m_list.Add( item ); + } + + public ZorderItem this[int index] { + get { + return m_list[index]; + } + } + + public void Clear() { + m_list.Clear(); + } + + public int Count { + get { + return m_list.Count; + } + } + + private void btnOK_Click( object sender, EventArgs e ) { + this.DialogResult = DialogResult.OK; + } + + private void ZOrder_Load( object sender, EventArgs e ) { + listBox1.Items.Clear(); + for ( int i = 0; i < m_list.Count; i++ ) { + listBox1.Items.Add( m_list[i].Name ); + } + } + + private void btnUp_Click( object sender, EventArgs e ) { + int index = listBox1.SelectedIndex; + if ( index > 0 ) { + string upper_item = (string)listBox1.Items[index - 1]; + string selected_item = (string)listBox1.Items[index]; + listBox1.Items[index] = upper_item; + listBox1.Items[index - 1] = selected_item; + + ZorderItem zupper_item = m_list[index - 1]; + ZorderItem zselected_item = m_list[index]; + m_list[index] = zupper_item; + m_list[index - 1] = zselected_item; + listBox1.SelectedIndex = index - 1; + } + } + + private void btnDown_Click( object sender, EventArgs e ) { + int index = listBox1.SelectedIndex; + if ( index < listBox1.Items.Count - 1 ) { + string lower_item = (string)listBox1.Items[index + 1]; + string selected_item = (string)listBox1.Items[index]; + listBox1.Items[index] = lower_item; + listBox1.Items[index + 1] = selected_item; + ZorderItem zlower_item = m_list[index + 1]; + ZorderItem zselected_item = m_list[index]; + m_list[index] = zlower_item; + m_list[index + 1] = zselected_item; + listBox1.SelectedIndex = index + 1; + } + } + } + +} diff --git a/trunk/LipSync/Editor/ZorderItem.cs b/trunk/LipSync/Editor/ZorderItem.cs new file mode 100644 index 0000000..5768f61 --- /dev/null +++ b/trunk/LipSync/Editor/ZorderItem.cs @@ -0,0 +1,75 @@ +サソ/* + * ZorderItem.cs + * Copyright (c) 2007-2009 kbinani + * + * This file is part of LipSync. + * + * LipSync is free software; you can redistribute it and/or + * modify it under the terms of the BSD License. + * + * LipSync is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +using System; + +namespace LipSync { + + public enum ZorderItemType { + plugin, + character, + another, + telop, + } + + public class ZorderItem : IComparable, ICloneable { + private string m_name; + private ZorderItemType m_type; + private int m_index; + public float Start; + + public object Clone() { + return new ZorderItem( this.m_name, this.m_type, this.m_index, this.Start ); + } + + public int CompareTo( ZorderItem item ) { + if( this.Index > item.Index ){ + return 1; + } else if ( this.Index < item.Index ) { + return -1; + } else { + return this.Type.CompareTo( item.Type ); + } + } + + public ZorderItem( string name, ZorderItemType type, int index ) + : this( name, type, index, 0f ) { + } + + public ZorderItem( string name, ZorderItemType type, int index, float start ) { + m_name = name; + m_type = type; + m_index = index; + Start = start; + } + + public string Name { + get { + return m_name; + } + } + + public ZorderItemType Type { + get { + return m_type; + } + } + + public int Index { + get { + return m_index; + } + } + } + +} diff --git a/trunk/LipSync/LipSync.csproj b/trunk/LipSync/LipSync.csproj new file mode 100644 index 0000000..34c5e76 --- /dev/null +++ b/trunk/LipSync/LipSync.csproj @@ -0,0 +1,444 @@ +サソ + + Debug + AnyCPU + 9.0.21022 + 2.0 + {15B51EEA-0D7F-4B59-AC7B-879A7BDB4A56} + WinExe + Properties + LipSync + LipSync + DD70A36EF76DD2E2B895E5CEB906324CE8147A67 + LipSync_TemporaryKey.pfx + false + false + false + LocalIntranet + + + 2.0 + v2.0 + + + false + true + LipSync.AppManager + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + http://www32.atwiki.jp/lipsync/ + LipSync + LipSync + true + 1 + 1.1.0.1 + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;NO_OBSOLETE_MODE + prompt + 4 + true + true + + + pdbonly + true + bin\Release\ + TRACE;NO_OBSOLETE_MODE + prompt + 4 + true + true + + + + + + + + + + + + + + + + + + + + + + + Form + + + AviOutput.cs + + + + + UserControl + + + CurveEditor.cs + + + + Component + + + NumericUpDownEx.cs + + + + + Form + + + BugReport.cs + + + + Form + + + DisplacementControl.cs + + + Form + + + EditEntry.cs + + + + Form + + + Form1.cs + + + Form + + + Form + + + GenerateCharacter.cs + + + + + UserControl + + + Property.cs + + + + + + + + Form + + + ZOrder.cs + + + Form + + + EnvConfiguration.cs + + + UserControl + + + MListView.cs + + + Form + + + PasteModeDialog.cs + + + Form + + + InputBox.cs + + + + + + + + + + Form + + + FormObjectList.cs + + + Form + + + FormSetFrameRate.cs + + + + Form + + + FormPreview.cs + + + UserControl + + + Previewer.cs + + + Form + + + Form + + + FormCommandHistory.cs + + + Form + + + FormSeriesImage.cs + + + + Form + + + FormVocalomark.cs + + + + Previewer.cs + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Form + + + SelectCharacter.cs + + + Form + + + SetSize.cs + + + Form + + + TrackSelecter.cs + + + + + + Form + + + Winker.cs + + + + + + + + + + + + + Form + + + VersionBox.cs + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + + Always + + + PreserveNewest + + + PreserveNewest + + + + + Always + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {0C58B068-272F-4390-A14F-3D72AFCF3DFB} + Boare.Lib.AppUtil + + + {F4F8F601-4E3D-43F5-A8A8-AA1FB7F48452} + Boare.Lib.Media + + + {D861973B-3BC6-4F52-83BE-49A8C269C09F} + Boare.Lib.Swf + + + {673347F3-6FC2-4F82-9273-BF158E0F8CB1} + Boare.Lib.Vsq + + + {C8AAE632-9C6C-4372-8175-811528A66742} + bocoree + + + {F3B0AB64-CEEE-4003-9DA1-BCD4109ECBA9} + Background + + + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00} + IPlugin + + + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1} + NicoComment + + + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650} + VFlip + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/LipSync/MP3/CVS/Entries b/trunk/LipSync/MP3/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/MP3/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/MP3/CVS/Entries.Extra b/trunk/LipSync/MP3/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/MP3/CVS/Entries.Extra.Old b/trunk/LipSync/MP3/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/MP3/CVS/Entries.Old b/trunk/LipSync/MP3/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/MP3/CVS/Repository b/trunk/LipSync/MP3/CVS/Repository new file mode 100644 index 0000000..8804af6 --- /dev/null +++ b/trunk/LipSync/MP3/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/MP3 diff --git a/trunk/LipSync/MP3/CVS/Root b/trunk/LipSync/MP3/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/MP3/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/MP3/CVS/Template b/trunk/LipSync/MP3/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Properties/AssemblyInfo.cs b/trunk/LipSync/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4cc4ccd --- /dev/null +++ b/trunk/LipSync/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "LipSync" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Boare" )] +[assembly: AssemblyProduct( "LipSync" )] +[assembly: AssemblyCopyright( "Copyright (C) 2007-2009 kbinani. All Rights Reserved." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√%縺ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九ッ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医↓縺ッ +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "5e752734-c724-41db-a919-931aea7770b7" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "2.4.8" )] diff --git a/trunk/LipSync/Properties/CVS/Entries b/trunk/LipSync/Properties/CVS/Entries new file mode 100644 index 0000000..b699ec2 --- /dev/null +++ b/trunk/LipSync/Properties/CVS/Entries @@ -0,0 +1,5 @@ +/AssemblyInfo.cs/1.10/Mon Mar 9 15:45:53 2009// +/Resources.Designer.cs/1.11/Sat Dec 6 17:33:53 2008// +/Resources.resx/1.9/Sat Dec 6 17:33:54 2008// +/Settings.Designer.cs/1.2/Tue Jul 29 15:58:01 2008// +D diff --git a/trunk/LipSync/Properties/CVS/Entries.Extra b/trunk/LipSync/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..3bdd153 --- /dev/null +++ b/trunk/LipSync/Properties/CVS/Entries.Extra @@ -0,0 +1,4 @@ +/AssemblyInfo.cs////*/// +/Resources.Designer.cs////*/// +/Resources.resx////*/// +/Settings.Designer.cs////*/// diff --git a/trunk/LipSync/Properties/CVS/Entries.Extra.Old b/trunk/LipSync/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Properties/CVS/Entries.Old b/trunk/LipSync/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Properties/CVS/Repository b/trunk/LipSync/Properties/CVS/Repository new file mode 100644 index 0000000..68a9387 --- /dev/null +++ b/trunk/LipSync/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/Properties diff --git a/trunk/LipSync/Properties/CVS/Root b/trunk/LipSync/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/Properties/CVS/Template b/trunk/LipSync/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Properties/Resources.Designer.cs b/trunk/LipSync/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e1b9940 --- /dev/null +++ b/trunk/LipSync/Properties/Resources.Designer.cs @@ -0,0 +1,448 @@ +サソ//------------------------------------------------------------------------------ +// +// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲 +// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:2.0.50727.3053 +// +// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲 +// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶 +// +//------------------------------------------------------------------------------ + +namespace LipSync.Properties { + using System; + + + /// + /// 繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励↑縺ゥ繧呈、懃エ「縺吶k縺溘a縺ョ縲∝宍蟇縺ォ蝙区欠螳壹&繧後◆繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ縺ァ縺吶 + /// + // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ StronglyTypedResourceBuilder 繧ッ繝ゥ繧ケ縺 ResGen + // 縺セ縺溘ッ Visual Studio 縺ョ繧医≧縺ェ繝繝シ繝ォ繧剃スソ逕ィ縺励※閾ェ蜍慕函謌舌&繧後∪縺励◆縲 + // 繝。繝ウ繝舌r霑ス蜉縺セ縺溘ッ蜑企勁縺吶k縺ォ縺ッ縲.ResX 繝輔ぃ繧、繝ォ繧堤キィ髮縺励※縲/str 繧ェ繝励す繝ァ繝ウ縺ィ蜈ア縺ォ + // ResGen 繧貞ョ溯。後@逶エ縺吶°縲√∪縺溘ッ VS 繝励Ο繧ク繧ァ繧ッ繝医r繝薙Ν繝峨@逶エ縺励∪縺吶 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 縺薙ョ繧ッ繝ゥ繧ケ縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧九く繝」繝繧キ繝・縺輔l縺 ResourceManager 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LipSync.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 蜴ウ蟇縺ォ蝙区欠螳壹&繧後◆縺薙ョ繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ繧剃スソ逕ィ縺励※縲√☆縺ケ縺ヲ縺ョ讀懃エ「繝ェ繧ス繝シ繧ケ縺ォ蟇セ縺励 + /// 迴セ蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + public static System.Drawing.Bitmap b_len100_a { + get { + object obj = ResourceManager.GetObject("b_len100_a", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_aa { + get { + object obj = ResourceManager.GetObject("b_len100_aa", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_base { + get { + object obj = ResourceManager.GetObject("b_len100_base", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_e { + get { + object obj = ResourceManager.GetObject("b_len100_e", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_e1 { + get { + object obj = ResourceManager.GetObject("b_len100_e1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_eyeclose { + get { + object obj = ResourceManager.GetObject("b_len100_eyeclose", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_eyethin { + get { + object obj = ResourceManager.GetObject("b_len100_eyethin", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_i { + get { + object obj = ResourceManager.GetObject("b_len100_i", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_kisisi { + get { + object obj = ResourceManager.GetObject("b_len100_kisisi", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_nn { + get { + object obj = ResourceManager.GetObject("b_len100_nn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_o { + get { + object obj = ResourceManager.GetObject("b_len100_o", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_shakin { + get { + object obj = ResourceManager.GetObject("b_len100_shakin", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_smile { + get { + object obj = ResourceManager.GetObject("b_len100_smile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_u { + get { + object obj = ResourceManager.GetObject("b_len100_u", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_winkleft { + get { + object obj = ResourceManager.GetObject("b_len100_winkleft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_winkright { + get { + object obj = ResourceManager.GetObject("b_len100_winkright", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_len100_xo { + get { + object obj = ResourceManager.GetObject("b_len100_xo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_a { + get { + object obj = ResourceManager.GetObject("b_miku175_a", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_aa { + get { + object obj = ResourceManager.GetObject("b_miku175_aa", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_base { + get { + object obj = ResourceManager.GetObject("b_miku175_base", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_bee { + get { + object obj = ResourceManager.GetObject("b_miku175_bee", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_e { + get { + object obj = ResourceManager.GetObject("b_miku175_e", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_eyeclose { + get { + object obj = ResourceManager.GetObject("b_miku175_eyeclose", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_eyethin { + get { + object obj = ResourceManager.GetObject("b_miku175_eyethin", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_i { + get { + object obj = ResourceManager.GetObject("b_miku175_i", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_konata { + get { + object obj = ResourceManager.GetObject("b_miku175_konata", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_kudo { + get { + object obj = ResourceManager.GetObject("b_miku175_kudo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_neko { + get { + object obj = ResourceManager.GetObject("b_miku175_neko", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_nn { + get { + object obj = ResourceManager.GetObject("b_miku175_nn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_o { + get { + object obj = ResourceManager.GetObject("b_miku175_o", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_smile { + get { + object obj = ResourceManager.GetObject("b_miku175_smile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_u { + get { + object obj = ResourceManager.GetObject("b_miku175_u", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_winkleft { + get { + object obj = ResourceManager.GetObject("b_miku175_winkleft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_winkright { + get { + object obj = ResourceManager.GetObject("b_miku175_winkright", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_miku175_xo { + get { + object obj = ResourceManager.GetObject("b_miku175_xo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_a { + get { + object obj = ResourceManager.GetObject("b_rin100_a", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_aa { + get { + object obj = ResourceManager.GetObject("b_rin100_aa", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_base { + get { + object obj = ResourceManager.GetObject("b_rin100_base", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_bee { + get { + object obj = ResourceManager.GetObject("b_rin100_bee", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_e { + get { + object obj = ResourceManager.GetObject("b_rin100_e", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_eyeclose { + get { + object obj = ResourceManager.GetObject("b_rin100_eyeclose", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_eyethin { + get { + object obj = ResourceManager.GetObject("b_rin100_eyethin", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_i { + get { + object obj = ResourceManager.GetObject("b_rin100_i", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_kisisi { + get { + object obj = ResourceManager.GetObject("b_rin100_kisisi", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_kudo { + get { + object obj = ResourceManager.GetObject("b_rin100_kudo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_neko { + get { + object obj = ResourceManager.GetObject("b_rin100_neko", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_nn { + get { + object obj = ResourceManager.GetObject("b_rin100_nn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_o { + get { + object obj = ResourceManager.GetObject("b_rin100_o", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_smile { + get { + object obj = ResourceManager.GetObject("b_rin100_smile", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_u { + get { + object obj = ResourceManager.GetObject("b_rin100_u", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_winkleft { + get { + object obj = ResourceManager.GetObject("b_rin100_winkleft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_winkright { + get { + object obj = ResourceManager.GetObject("b_rin100_winkright", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap b_rin100_xo { + get { + object obj = ResourceManager.GetObject("b_rin100_xo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap closed { + get { + object obj = ResourceManager.GetObject("closed", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + public static System.Drawing.Bitmap opened { + get { + object obj = ResourceManager.GetObject("opened", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/trunk/LipSync/Properties/Resources.resx b/trunk/LipSync/Properties/Resources.resx new file mode 100644 index 0000000..dcd49f0 --- /dev/null +++ b/trunk/LipSync/Properties/Resources.resx @@ -0,0 +1,286 @@ +サソ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\resources\sanari_len\b_len100_a.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_aa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_base.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_e.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_e.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_eyeclose.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_eyethin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_i.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_kisisi.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_nn.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_o.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_shakin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_smile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_u.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_winkleft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_winkright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_len\b_len100_xo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_a.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_aa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_base.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_bee.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_e.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_eyeclose.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_eyethin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_i.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_konata.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_kudo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_neko.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_nn.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_o.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_smile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_u.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_winkleft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_winkright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_miku\b_miku175_xo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_a.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_aa.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_base.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_bee.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_e.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_eyeclose.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_eyethin.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_i.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_kisisi.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_kudo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_neko.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_nn.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_o.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_smile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_u.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_winkleft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_winkright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\sanari_rin\b_rin100_xo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\closed.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\opened.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/trunk/LipSync/Properties/Settings.Designer.cs b/trunk/LipSync/Properties/Settings.Designer.cs new file mode 100644 index 0000000..e031fe4 --- /dev/null +++ b/trunk/LipSync/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +サソ//------------------------------------------------------------------------------ +// +// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲 +// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:2.0.50727.1433 +// +// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲 +// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶 +// +//------------------------------------------------------------------------------ + +namespace LipSync.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/trunk/LipSync/RawAvi/CVS/Entries b/trunk/LipSync/RawAvi/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/RawAvi/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/RawAvi/CVS/Entries.Extra b/trunk/LipSync/RawAvi/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/RawAvi/CVS/Entries.Extra.Old b/trunk/LipSync/RawAvi/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/RawAvi/CVS/Entries.Old b/trunk/LipSync/RawAvi/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/RawAvi/CVS/Repository b/trunk/LipSync/RawAvi/CVS/Repository new file mode 100644 index 0000000..386c683 --- /dev/null +++ b/trunk/LipSync/RawAvi/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/RawAvi diff --git a/trunk/LipSync/RawAvi/CVS/Root b/trunk/LipSync/RawAvi/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/RawAvi/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/RawAvi/CVS/Template b/trunk/LipSync/RawAvi/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/CVS/Entries b/trunk/LipSync/Resources/CVS/Entries new file mode 100644 index 0000000..d13e776 --- /dev/null +++ b/trunk/LipSync/Resources/CVS/Entries @@ -0,0 +1,5 @@ +/author_list.png/1.3/Fri Sep 26 10:50:02 2008/-kb/ +/closed.png/1.1/Tue Aug 12 06:23:17 2008/-kb/ +/cursor.cur/1.1/Mon Feb 25 12:28:44 2008/-kb/ +/opened.png/1.1/Tue Aug 12 06:23:17 2008/-kb/ +D diff --git a/trunk/LipSync/Resources/CVS/Entries.Extra b/trunk/LipSync/Resources/CVS/Entries.Extra new file mode 100644 index 0000000..878fa22 --- /dev/null +++ b/trunk/LipSync/Resources/CVS/Entries.Extra @@ -0,0 +1,4 @@ +/author_list.png////*/// +/closed.png////*/// +/cursor.cur////*/// +/opened.png////*/// diff --git a/trunk/LipSync/Resources/CVS/Entries.Extra.Old b/trunk/LipSync/Resources/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/CVS/Entries.Log b/trunk/LipSync/Resources/CVS/Entries.Log new file mode 100644 index 0000000..504bc68 --- /dev/null +++ b/trunk/LipSync/Resources/CVS/Entries.Log @@ -0,0 +1,3 @@ +A D/sanari_len//// +A D/sanari_miku//// +A D/sanari_rin//// diff --git a/trunk/LipSync/Resources/CVS/Entries.Old b/trunk/LipSync/Resources/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/CVS/Repository b/trunk/LipSync/Resources/CVS/Repository new file mode 100644 index 0000000..8e561ff --- /dev/null +++ b/trunk/LipSync/Resources/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/Resources diff --git a/trunk/LipSync/Resources/CVS/Root b/trunk/LipSync/Resources/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/Resources/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/Resources/CVS/Template b/trunk/LipSync/Resources/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/author_list.png b/trunk/LipSync/Resources/author_list.png new file mode 100644 index 0000000..7e52a7f Binary files /dev/null and b/trunk/LipSync/Resources/author_list.png differ diff --git a/trunk/LipSync/Resources/closed.png b/trunk/LipSync/Resources/closed.png new file mode 100644 index 0000000..6cd315e Binary files /dev/null and b/trunk/LipSync/Resources/closed.png differ diff --git a/trunk/LipSync/Resources/cursor.cur b/trunk/LipSync/Resources/cursor.cur new file mode 100644 index 0000000..277f368 Binary files /dev/null and b/trunk/LipSync/Resources/cursor.cur differ diff --git a/trunk/LipSync/Resources/opened.png b/trunk/LipSync/Resources/opened.png new file mode 100644 index 0000000..c26983d Binary files /dev/null and b/trunk/LipSync/Resources/opened.png differ diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Entries b/trunk/LipSync/Resources/sanari_len/CVS/Entries new file mode 100644 index 0000000..4eed5a3 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_len/CVS/Entries @@ -0,0 +1,17 @@ +/b_len100_a.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_aa.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_base.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_e.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_eyeclose.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_eyethin.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_i.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_kisisi.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_nn.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_o.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_shakin.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_smile.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_u.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_winkleft.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_winkright.png/1.1/Thu Feb 7 02:08:07 2008/-kb/ +/b_len100_xo.png/1.3/Thu Feb 7 02:08:07 2008/-kb/ +D diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Entries.Extra b/trunk/LipSync/Resources/sanari_len/CVS/Entries.Extra new file mode 100644 index 0000000..f5303c9 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_len/CVS/Entries.Extra @@ -0,0 +1,16 @@ +/b_len100_a.png////*/// +/b_len100_aa.png////*/// +/b_len100_base.png////*/// +/b_len100_e.png////*/// +/b_len100_eyeclose.png////*/// +/b_len100_eyethin.png////*/// +/b_len100_i.png////*/// +/b_len100_kisisi.png////*/// +/b_len100_nn.png////*/// +/b_len100_o.png////*/// +/b_len100_shakin.png////*/// +/b_len100_smile.png////*/// +/b_len100_u.png////*/// +/b_len100_winkleft.png////*/// +/b_len100_winkright.png////*/// +/b_len100_xo.png////*/// diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Entries.Extra.Old b/trunk/LipSync/Resources/sanari_len/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Entries.Old b/trunk/LipSync/Resources/sanari_len/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Repository b/trunk/LipSync/Resources/sanari_len/CVS/Repository new file mode 100644 index 0000000..70e692b --- /dev/null +++ b/trunk/LipSync/Resources/sanari_len/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/Resources/sanari_len diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Root b/trunk/LipSync/Resources/sanari_len/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_len/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/Resources/sanari_len/CVS/Template b/trunk/LipSync/Resources/sanari_len/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_a.png b/trunk/LipSync/Resources/sanari_len/b_len100_a.png new file mode 100644 index 0000000..466cfcd Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_a.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_aa.png b/trunk/LipSync/Resources/sanari_len/b_len100_aa.png new file mode 100644 index 0000000..a302ed5 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_aa.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_base.png b/trunk/LipSync/Resources/sanari_len/b_len100_base.png new file mode 100644 index 0000000..db94923 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_base.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_e.png b/trunk/LipSync/Resources/sanari_len/b_len100_e.png new file mode 100644 index 0000000..06236f3 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_e.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_eyeclose.png b/trunk/LipSync/Resources/sanari_len/b_len100_eyeclose.png new file mode 100644 index 0000000..2645fe8 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_eyeclose.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_eyethin.png b/trunk/LipSync/Resources/sanari_len/b_len100_eyethin.png new file mode 100644 index 0000000..8180675 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_eyethin.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_i.png b/trunk/LipSync/Resources/sanari_len/b_len100_i.png new file mode 100644 index 0000000..fb6a6e9 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_i.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_kisisi.png b/trunk/LipSync/Resources/sanari_len/b_len100_kisisi.png new file mode 100644 index 0000000..6531a8e Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_kisisi.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_nn.png b/trunk/LipSync/Resources/sanari_len/b_len100_nn.png new file mode 100644 index 0000000..6b60243 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_nn.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_o.png b/trunk/LipSync/Resources/sanari_len/b_len100_o.png new file mode 100644 index 0000000..0a7b16e Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_o.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_shakin.png b/trunk/LipSync/Resources/sanari_len/b_len100_shakin.png new file mode 100644 index 0000000..052cba5 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_shakin.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_smile.png b/trunk/LipSync/Resources/sanari_len/b_len100_smile.png new file mode 100644 index 0000000..fc5690c Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_smile.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_u.png b/trunk/LipSync/Resources/sanari_len/b_len100_u.png new file mode 100644 index 0000000..099af40 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_u.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_winkleft.png b/trunk/LipSync/Resources/sanari_len/b_len100_winkleft.png new file mode 100644 index 0000000..e83f7e6 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_winkleft.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_winkright.png b/trunk/LipSync/Resources/sanari_len/b_len100_winkright.png new file mode 100644 index 0000000..6bf0d12 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_winkright.png differ diff --git a/trunk/LipSync/Resources/sanari_len/b_len100_xo.png b/trunk/LipSync/Resources/sanari_len/b_len100_xo.png new file mode 100644 index 0000000..70b1f41 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_len/b_len100_xo.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Entries b/trunk/LipSync/Resources/sanari_miku/CVS/Entries new file mode 100644 index 0000000..ed96a21 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_miku/CVS/Entries @@ -0,0 +1,19 @@ +/b_miku175_a.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_aa.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_base.png/1.3/Thu Feb 7 02:09:26 2008/-kb/ +/b_miku175_bee.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_e.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_eyeclose.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_eyethin.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_i.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_konata.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_kudo.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_neko.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_nn.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_o.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_smile.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_u.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_winkleft.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_winkright.png/1.2/Sat Mar 1 09:32:52 2008/-kb/ +/b_miku175_xo.png/1.4/Sat Mar 1 09:32:52 2008/-kb/ +D diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Extra b/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Extra new file mode 100644 index 0000000..5a303a1 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Extra @@ -0,0 +1,18 @@ +/b_miku175_a.png////*/// +/b_miku175_aa.png////*/// +/b_miku175_base.png////*/// +/b_miku175_bee.png////*/// +/b_miku175_e.png////*/// +/b_miku175_eyeclose.png////*/// +/b_miku175_eyethin.png////*/// +/b_miku175_i.png////*/// +/b_miku175_konata.png////*/// +/b_miku175_kudo.png////*/// +/b_miku175_neko.png////*/// +/b_miku175_nn.png////*/// +/b_miku175_o.png////*/// +/b_miku175_smile.png////*/// +/b_miku175_u.png////*/// +/b_miku175_winkleft.png////*/// +/b_miku175_winkright.png////*/// +/b_miku175_xo.png////*/// diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Extra.Old b/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Old b/trunk/LipSync/Resources/sanari_miku/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Repository b/trunk/LipSync/Resources/sanari_miku/CVS/Repository new file mode 100644 index 0000000..391d782 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_miku/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/Resources/sanari_miku diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Root b/trunk/LipSync/Resources/sanari_miku/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_miku/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/Resources/sanari_miku/CVS/Template b/trunk/LipSync/Resources/sanari_miku/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_a.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_a.png new file mode 100644 index 0000000..95a3069 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_a.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_aa.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_aa.png new file mode 100644 index 0000000..1febf29 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_aa.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_base.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_base.png new file mode 100644 index 0000000..3289d47 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_base.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_bee.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_bee.png new file mode 100644 index 0000000..5c13fdf Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_bee.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_e.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_e.png new file mode 100644 index 0000000..0a936e3 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_e.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_eyeclose.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_eyeclose.png new file mode 100644 index 0000000..be1b149 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_eyeclose.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_eyethin.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_eyethin.png new file mode 100644 index 0000000..d10e20d Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_eyethin.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_i.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_i.png new file mode 100644 index 0000000..166f66d Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_i.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_konata.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_konata.png new file mode 100644 index 0000000..25bef88 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_konata.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_kudo.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_kudo.png new file mode 100644 index 0000000..efda155 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_kudo.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_neko.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_neko.png new file mode 100644 index 0000000..86f188e Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_neko.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_nn.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_nn.png new file mode 100644 index 0000000..6de5efd Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_nn.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_o.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_o.png new file mode 100644 index 0000000..1c7f4a0 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_o.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_smile.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_smile.png new file mode 100644 index 0000000..74e49d4 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_smile.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_u.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_u.png new file mode 100644 index 0000000..02723cd Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_u.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_winkleft.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_winkleft.png new file mode 100644 index 0000000..3a53743 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_winkleft.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_winkright.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_winkright.png new file mode 100644 index 0000000..82fae49 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_winkright.png differ diff --git a/trunk/LipSync/Resources/sanari_miku/b_miku175_xo.png b/trunk/LipSync/Resources/sanari_miku/b_miku175_xo.png new file mode 100644 index 0000000..b379611 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_miku/b_miku175_xo.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Entries b/trunk/LipSync/Resources/sanari_rin/CVS/Entries new file mode 100644 index 0000000..57a0891 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_rin/CVS/Entries @@ -0,0 +1,19 @@ +/b_rin100_a.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_aa.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_base.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_bee.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_e.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_eyeclose.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_eyethin.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_i.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_kisisi.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_kudo.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_neko.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_nn.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_o.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_smile.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_u.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_winkleft.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_winkright.png/1.1/Thu Feb 7 02:10:05 2008/-kb/ +/b_rin100_xo.png/1.3/Thu Feb 7 02:10:05 2008/-kb/ +D diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Extra b/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Extra new file mode 100644 index 0000000..dc83106 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Extra @@ -0,0 +1,18 @@ +/b_rin100_a.png////*/// +/b_rin100_aa.png////*/// +/b_rin100_base.png////*/// +/b_rin100_bee.png////*/// +/b_rin100_e.png////*/// +/b_rin100_eyeclose.png////*/// +/b_rin100_eyethin.png////*/// +/b_rin100_i.png////*/// +/b_rin100_kisisi.png////*/// +/b_rin100_kudo.png////*/// +/b_rin100_neko.png////*/// +/b_rin100_nn.png////*/// +/b_rin100_o.png////*/// +/b_rin100_smile.png////*/// +/b_rin100_u.png////*/// +/b_rin100_winkleft.png////*/// +/b_rin100_winkright.png////*/// +/b_rin100_xo.png////*/// diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Extra.Old b/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Old b/trunk/LipSync/Resources/sanari_rin/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Repository b/trunk/LipSync/Resources/sanari_rin/CVS/Repository new file mode 100644 index 0000000..466921c --- /dev/null +++ b/trunk/LipSync/Resources/sanari_rin/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/Resources/sanari_rin diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Root b/trunk/LipSync/Resources/sanari_rin/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/Resources/sanari_rin/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/Resources/sanari_rin/CVS/Template b/trunk/LipSync/Resources/sanari_rin/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_a.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_a.png new file mode 100644 index 0000000..6e7eaf3 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_a.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_aa.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_aa.png new file mode 100644 index 0000000..8c01662 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_aa.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_base.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_base.png new file mode 100644 index 0000000..6aea17a Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_base.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_bee.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_bee.png new file mode 100644 index 0000000..2756721 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_bee.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_e.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_e.png new file mode 100644 index 0000000..32f7f29 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_e.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_eyeclose.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_eyeclose.png new file mode 100644 index 0000000..bd6ae02 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_eyeclose.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_eyethin.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_eyethin.png new file mode 100644 index 0000000..ec58300 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_eyethin.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_i.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_i.png new file mode 100644 index 0000000..97ad11d Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_i.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_kisisi.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_kisisi.png new file mode 100644 index 0000000..d21ff56 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_kisisi.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_kudo.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_kudo.png new file mode 100644 index 0000000..06c2714 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_kudo.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_neko.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_neko.png new file mode 100644 index 0000000..1c2b6eb Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_neko.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_nn.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_nn.png new file mode 100644 index 0000000..d9c5170 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_nn.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_o.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_o.png new file mode 100644 index 0000000..b4fd90e Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_o.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_smile.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_smile.png new file mode 100644 index 0000000..4f9b94d Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_smile.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_u.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_u.png new file mode 100644 index 0000000..7641260 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_u.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_winkleft.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_winkleft.png new file mode 100644 index 0000000..8c834b9 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_winkleft.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_winkright.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_winkright.png new file mode 100644 index 0000000..dedf98e Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_winkright.png differ diff --git a/trunk/LipSync/Resources/sanari_rin/b_rin100_xo.png b/trunk/LipSync/Resources/sanari_rin/b_rin100_xo.png new file mode 100644 index 0000000..d6a3da7 Binary files /dev/null and b/trunk/LipSync/Resources/sanari_rin/b_rin100_xo.png differ diff --git a/trunk/LipSync/SearchUsageOfMessageIDEx.pl b/trunk/LipSync/SearchUsageOfMessageIDEx.pl new file mode 100644 index 0000000..63defe2 --- /dev/null +++ b/trunk/LipSync/SearchUsageOfMessageIDEx.pl @@ -0,0 +1,71 @@ +# 現在のディレクトリにあるC#コードを読み込み、使用されていないMessage.IDを +# result.txtに出力する。サブディレクトリも検索。 +$listname = "_"; +while( -e $listname ){ + $listname = $listname . "_"; +} + +system "dir /s /b>" . $listname; + +%hash; +%defined; + +open( FILE, $listname ); +while( $line = ){ + chomp $line; + # MessageIDの定義から,定義済みのenumを列挙 + if( index( $line, "MessageID.cs" ) >= 0 ){ + open( CS, $line ); + $mode = 0; + while( $cs_line = ){ + if( $mode == 1 && index( $cs_line, "}" ) >= 0 ){ + $mode = 2; + next; + } + if( $mode == 1 ){ + $line2 = "" . $cs_line; + chomp $line2; + $line2 =~ s/ //g; + $line2 =~ s/,//g; + $line3 = $line2; + $defined{$line3} = 0; + } + if( $mode == 0 && index( $cs_line, "enum MessageID" ) >= 0 ){ + $mode = 1; + } + } + close( CS ); + next; + }else{ + open( CS, $line ); + while( $cs_line = ){ + $index = index( $cs_line, "MessageID." ); + while( $index >= 0 ){ + $spl = substr( $cs_line, $index + 10 ); + $index2 = index( $spl, ")" ); + $cs_line = substr( $spl, $index2 ); + $spl2 = substr( $spl, 0, $index2 ); + $spl2 =~ s/ //g; + $hash{$spl2} = $hash{$spl2} + 1; + $index = index( $cs_line, "MessageID." ); + } + } + close( CS ); + } +} +close( FILE ); + +@keys = keys( %hash ); +foreach $entry( @keys ){ + $defined{$entry} = 1; +} +open( RESULT, ">result.txt" ); +@keys2 = keys( %defined ); +foreach $entry( @keys2 ){ + if( $defined{$entry} == 0 ){ + print RESULT $entry . "," . $defined{$entry} . "\n"; + } +} +close( RESULT ); + +system "del " . $listname; diff --git a/trunk/LipSync/VSQ/CVS/Entries b/trunk/LipSync/VSQ/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/VSQ/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/VSQ/CVS/Entries.Extra b/trunk/LipSync/VSQ/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/CVS/Entries.Extra.Old b/trunk/LipSync/VSQ/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/CVS/Entries.Log b/trunk/LipSync/VSQ/CVS/Entries.Log new file mode 100644 index 0000000..e8674e8 --- /dev/null +++ b/trunk/LipSync/VSQ/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/SMFReader//// +A D/VsqMetaText//// diff --git a/trunk/LipSync/VSQ/CVS/Entries.Old b/trunk/LipSync/VSQ/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/CVS/Repository b/trunk/LipSync/VSQ/CVS/Repository new file mode 100644 index 0000000..43c1b5b --- /dev/null +++ b/trunk/LipSync/VSQ/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/VSQ diff --git a/trunk/LipSync/VSQ/CVS/Root b/trunk/LipSync/VSQ/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/VSQ/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/VSQ/CVS/Template b/trunk/LipSync/VSQ/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Entries b/trunk/LipSync/VSQ/SMFReader/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/VSQ/SMFReader/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Extra b/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Extra.Old b/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Old b/trunk/LipSync/VSQ/SMFReader/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Repository b/trunk/LipSync/VSQ/SMFReader/CVS/Repository new file mode 100644 index 0000000..bdd696a --- /dev/null +++ b/trunk/LipSync/VSQ/SMFReader/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/VSQ/SMFReader diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Root b/trunk/LipSync/VSQ/SMFReader/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/VSQ/SMFReader/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/VSQ/SMFReader/CVS/Template b/trunk/LipSync/VSQ/SMFReader/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries b/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Extra b/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Extra.Old b/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Old b/trunk/LipSync/VSQ/VsqMetaText/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Repository b/trunk/LipSync/VSQ/VsqMetaText/CVS/Repository new file mode 100644 index 0000000..3b67d16 --- /dev/null +++ b/trunk/LipSync/VSQ/VsqMetaText/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/VSQ/VsqMetaText diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Root b/trunk/LipSync/VSQ/VsqMetaText/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/VSQ/VsqMetaText/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/VSQ/VsqMetaText/CVS/Template b/trunk/LipSync/VSQ/VsqMetaText/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/bin/Debug/LipSync.vshost.exe b/trunk/LipSync/bin/Debug/LipSync.vshost.exe new file mode 100644 index 0000000..70862c7 Binary files /dev/null and b/trunk/LipSync/bin/Debug/LipSync.vshost.exe differ diff --git a/trunk/LipSync/de.po b/trunk/LipSync/de.po new file mode 100644 index 0000000..9d93910 --- /dev/null +++ b/trunk/LipSync/de.po @@ -0,0 +1,1033 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-10-15 21:07+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" +"X-Poedit-Country: GERMANY\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-Basepath: .\\\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-SearchPath-0: Editor\n" +"X-Poedit-SearchPath-1: Common\n" +"X-Poedit-SearchPath-2: AviFile\n" + +#: Editor/AviOutput.cs:111 +msgid "Directory" +msgstr "" + +#: Editor/AviOutput.cs:111 +msgid "does not exist." +msgstr "" + +#: Editor/AviOutput.cs:112 +#: Editor/AviOutput.cs:137 +msgid "Error" +msgstr "" + +#: Editor/AviOutput.cs:122 +msgid "already exists." +msgstr "" + +#: Editor/AviOutput.cs:122 +msgid "Do you want to replace it?" +msgstr "" + +#: Editor/AviOutput.cs:136 +msgid "Invalid value has been entered" +msgstr "" + +#: Editor/AviOutput.cs:159 +msgid "Avi file(*.avi)|*.avi" +msgstr "" + +#: Editor/AviOutput.cs:159 +msgid "All Files(*.*)|*.*" +msgstr "" + +#: Editor/AviOutput.designer.cs:302 +msgid "Cancel" +msgstr "" + +#: Editor/AviOutput.designer.cs:303 +msgid "Save" +msgstr "Speichern" + +#: Editor/AviOutput.designer.cs:304 +msgid "file name" +msgstr "" + +#: Editor/AviOutput.designer.cs:305 +#, fuzzy +msgid "Video" +msgstr "Anzeige" + +#: Editor/AviOutput.designer.cs:306 +msgid "Audio" +msgstr "" + +#: Editor/AviOutput.designer.cs:307 +msgid "Convert to FLV" +msgstr "" + +#: Editor/AviOutput.designer.cs:308 +msgid "Merge wave to AVI" +msgstr "" + +#: Editor/AviOutput.designer.cs:309 +msgid "Delete intermediate file" +msgstr "" + +#: Editor/AviOutput.designer.cs:310 +msgid "Video Compression" +msgstr "" + +#: Editor/AviOutput.designer.cs:311 +msgid "Specify output range" +msgstr "" + +#: Editor/AviOutput.designer.cs:312 +msgid "Start" +msgstr "" + +#: Editor/AviOutput.designer.cs:313 +msgid "End" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:187 +msgid "Edit motion curve" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:188 +msgid "Close" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:189 +msgid "File" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:190 +msgid "Redo" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:191 +msgid "Undo" +msgstr "" + +#: Editor/DisplacementControl.designer.cs:192 +#, fuzzy +msgid "Edit" +msgstr "Beenden" + +#: Editor/EditEntry.Designer.cs:207 +msgid "ON time (sec)" +msgstr "" + +#: Editor/EditEntry.Designer.cs:208 +msgid "OFF time (sec)" +msgstr "" + +#: Editor/EditEntry.Designer.cs:210 +#: Editor/EnvConfiguration.Designer.cs:827 +msgid "OK" +msgstr "" + +#: Editor/EditEntry.Designer.cs:211 +msgid "Use this value" +msgstr "" + +#: Editor/EditEntry.Designer.cs:212 +msgid "Expandable range of this entry" +msgstr "" + +#: Editor/EditEntry.Designer.cs:213 +#: Editor/Form1.cs:1348 +msgid "Numeric entry" +msgstr "" + +#: Editor/EnvConfiguration.cs:250 +#: Editor/EnvConfiguration.cs:268 +msgid "Executable file(*.exe)|*.exe" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:829 +msgid "Language" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:830 +#: Editor/Form1.designer.cs:1160 +#, fuzzy +msgid "Option" +msgstr "Offnen" + +#: Editor/EnvConfiguration.Designer.cs:832 +msgid "User Config" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:833 +msgid "Appearance" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:834 +msgid "lip-sync Option" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:835 +msgid "System" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:837 +msgid "Title of timeline" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:838 +msgid "VSQ Entry" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:839 +msgid "Plugin Entry" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:840 +msgid "Another Entry" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:841 +msgid "Entry height (pixel)" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:842 +#: Editor/EnvConfiguration.Designer.cs:843 +#: Editor/EnvConfiguration.Designer.cs:844 +#: Editor/EnvConfiguration.Designer.cs:845 +#: Editor/EnvConfiguration.Designer.cs:855 +msgid "Change" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:846 +msgid "Check phonetic symbol to configure detailed mouth shape control" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:847 +msgid "Close mouth before pronunciation" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:848 +msgid "\"i\" shaped mouth before pronunciation" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:849 +msgid "\"u\" shaped mouth before pronunciation" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:850 +msgid "Color" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:851 +msgid "Design" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:852 +msgid "Path of ffmpeg" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:853 +msgid "Path of mencoder" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:854 +msgid "Font" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:856 +#: Editor/EnvConfiguration.Designer.cs:861 +msgid "Another settings" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:857 +msgid "Close mouth when same vowels repeated" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:858 +msgid "Encoder/Decoder" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:859 +msgid "Generate character automaticaly when importing vsq" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:860 +msgid "Threshold silence length(sec)" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:862 +msgid "Use preview-enabled dialog in character selection" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:863 +msgid "Reload language configurations" +msgstr "" + +#: Editor/EnvConfiguration.Designer.cs:864 +#, fuzzy +msgid "Operation" +msgstr "Offnen" + +#: Editor/EnvConfiguration.Designer.cs:865 +msgid "mouse wheel rate" +msgstr "" + +#: Editor/Form1.cs:853 +msgid " has been changed. Do you wish to save changes to file?" +msgstr "" + +#: Editor/Form1.cs:855 +msgid "Do you wish to save changes to file?" +msgstr "" + +#: Editor/Form1.cs:1206 +#: Editor/Form1.cs:2936 +#: Editor/Form1.cs:3859 +msgid "Video size configuration" +msgstr "" + +#: Editor/Form1.cs:1215 +msgid "Read from VSQ file" +msgstr "" + +#: Editor/Form1.cs:1219 +#: Editor/Form1.designer.cs:1143 +msgid "Edit character" +msgstr "" + +#: Editor/Form1.cs:1222 +#: Editor/Form1.cs:1260 +#: Editor/Form1.cs:1280 +#: Editor/Form1.cs:1343 +#: Editor/Form1.cs:1366 +msgid "Preview image" +msgstr "" + +#: Editor/Form1.cs:1223 +#: Editor/Form1.cs:1292 +#: Editor/Form1.cs:1378 +#: Editor/Form1_EventHandler.cs:975 +msgid "Image placement" +msgstr "" + +#: Editor/Form1.cs:1224 +#: Editor/Form1.cs:1296 +#: Editor/Form1.cs:1382 +#: Editor/Form1_EventHandler.cs:506 +msgid "Scale setting" +msgstr "" + +#: Editor/Form1.cs:1226 +msgid "Generate wink" +msgstr "" + +#: Editor/Form1.cs:1230 +#: Editor/Form1.cs:1459 +msgid "Delete" +msgstr "" + +#: Editor/Form1.cs:1233 +msgid "Add track" +msgstr "" + +#: Editor/Form1.cs:1247 +msgid "Generate Lipsync from this track" +msgstr "" + +#: Editor/Form1.cs:1256 +#: Editor/Form1.cs:1269 +#: Editor/Form1.cs:1308 +msgid "Note ON from here" +msgstr "" + +#: Editor/Form1.cs:1275 +#: Editor/Form1.cs:1361 +msgid "Set image" +msgstr "" + +#: Editor/Form1.cs:1284 +#: Editor/Form1.cs:1370 +msgid "Change image" +msgstr "" + +#: Editor/Form1.cs:1289 +#: Editor/Form1.cs:1375 +msgid "Image" +msgstr "" + +#: Editor/Form1.cs:1320 +#: Editor/Form1.cs:1435 +msgid "Paste" +msgstr "" + +#: Editor/Form1.cs:1338 +msgid "Note OFF" +msgstr "" + +#: Editor/Form1.cs:1351 +msgid "Expand" +msgstr "" + +#: Editor/Form1.cs:1391 +msgid "Plugin config. of this entry" +msgstr "" + +#: Editor/Form1.cs:1398 +#: Editor/Form1.cs:1421 +msgid "Copy" +msgstr "" + +#: Editor/Form1.cs:1402 +msgid "Cut" +msgstr "" + +#: Editor/Form1.cs:1406 +msgid "Split entry" +msgstr "" + +#: Editor/Form1.cs:1418 +msgid "Timeline" +msgstr "" + +#: Editor/Form1.cs:1428 +msgid "Copy On/Off inverted" +msgstr "" + +#: Editor/Form1.cs:1442 +msgid "Import from TEXT" +msgstr "" + +#: Editor/Form1.cs:1446 +msgid "Export to TEXT" +msgstr "" + +#: Editor/Form1.cs:1464 +msgid "Delete entries" +msgstr "" + +#: Editor/Form1.cs:1471 +msgid "Shift this time-line" +msgstr "" + +#: Editor/Form1.cs:1957 +#: Editor/Form1.cs:1997 +#: Editor/Form1.cs:2707 +msgid "VSQ Tracks" +msgstr "" + +#: Editor/Form1.cs:1969 +msgid "Character" +msgstr "" + +#: Editor/Form1.cs:1977 +#: Editor/Form1.cs:2709 +#: Editor/Form1.cs:3305 +msgid "Another images" +msgstr "" + +#: Editor/Form1.cs:1984 +#: Editor/Form1.cs:2681 +msgid "Plugin" +msgstr "" + +#: Editor/Form1.cs:2936 +msgid "Input video length in second" +msgstr "" + +#: Editor/Form1.cs:2964 +#: Editor/Form1.designer.cs:1152 +#: Editor/Form1_EventHandler.cs:78 +msgid "Shift all time-tables" +msgstr "" + +#: Editor/Form1.cs:2964 +#: Editor/Form1_EventHandler.cs:78 +msgid "Input shift time in second (you can enter minus value)" +msgstr "" + +#: Editor/Form1.cs:3223 +#: Editor/Form1.cs:3490 +msgid "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" +msgstr "" + +#: Editor/Form1.cs:3223 +msgid "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" +msgstr "" + +#: Editor/Form1.cs:3224 +#: Editor/Form1.cs:3491 +#: Editor/Form1_EventHandler.cs:548 +#: Editor/Form1_EventHandler.cs:925 +#: Editor/Form1_EventHandler.cs:1090 +#: Editor/Form1_EventHandler.cs:1100 +msgid "Confirmation" +msgstr "" + +#: Editor/Form1.cs:3239 +#: Editor/Form1.designer.cs:1187 +#: Editor/Form1_EventHandler.cs:898 +msgid "VOCALOID2 Sequence File(*.vsq)|*.vsq" +msgstr "" + +#: Editor/Form1.cs:3509 +#: Editor/Form1.cs:4408 +#: Editor/Form1.designer.cs:1169 +#: Editor/Form1.designer.cs:1224 +#: Editor/Form1_Preview.cs:352 +msgid "Play" +msgstr "" + +#: Editor/Form1.cs:3514 +msgid "File not found" +msgstr "" + +#: Editor/Form1.cs:3538 +#: Editor/Form1.cs:3569 +#: Editor/Form1.cs:3583 +msgid "Extension must be *.lse" +msgstr "" + +#: Editor/Form1.cs:3650 +msgid "Failed file saving" +msgstr "" + +#: Editor/Form1.cs:3748 +msgid "Failed file reading" +msgstr "" + +#: Editor/Form1.cs:3859 +msgid "Width" +msgstr "" + +#: Editor/Form1.cs:3859 +msgid "Height" +msgstr "" + +#: Editor/Form1.cs:3992 +msgid "Expand all" +msgstr "" + +#: Editor/Form1.cs:3993 +msgid "Fold all" +msgstr "" + +#: Editor/Form1.cs:4028 +msgid "(no name)" +msgstr "" + +#: Editor/Form1.cs:4048 +#: Editor/Form1.designer.cs:1164 +msgid "Disable preview" +msgstr "" + +#: Editor/Form1.cs:4054 +#: Editor/Form1.designer.cs:1162 +msgid "Enable preview" +msgstr "" + +#: Editor/Form1.cs:4168 +#: Editor/Form1.designer.cs:1183 +msgid "Hide object list" +msgstr "" + +#: Editor/Form1.cs:4174 +#: Editor/Form1.designer.cs:1181 +msgid "Show object list" +msgstr "" + +#: Editor/Form1.cs:4412 +msgid "Audio file(*.mp3;*.wav)|*.mp3;*.wav" +msgstr "" + +#: Editor/Form1.cs:4430 +#: Editor/Form1.designer.cs:1173 +msgid "Go to specified frame" +msgstr "" + +#: Editor/Form1.cs:4430 +msgid "please input frame index" +msgstr "" + +#: Editor/Form1.cs:4446 +msgid "invalid frame index" +msgstr "" + +#: Editor/Form1.designer.cs:1129 +msgid "Open" +msgstr "Offnen" + +#: Editor/Form1.designer.cs:1131 +#, fuzzy +msgid "Save As" +msgstr "Speichern" + +#: Editor/Form1.designer.cs:1132 +msgid "Import" +msgstr "" + +#: Editor/Form1.designer.cs:1133 +msgid "from RipSync data" +msgstr "" + +#: Editor/Form1.designer.cs:1134 +msgid "Open VSQ file" +msgstr "" + +#: Editor/Form1.designer.cs:1135 +msgid "Exit" +msgstr "Beenden" + +#: Editor/Form1.designer.cs:1139 +msgid "Help" +msgstr "" + +#: Editor/Form1.designer.cs:1140 +msgid "Plugin information" +msgstr "" + +#: Editor/Form1.designer.cs:1141 +msgid "About LipSync" +msgstr "" + +#: Editor/Form1.designer.cs:1142 +msgid "Debug" +msgstr "" + +#: Editor/Form1.designer.cs:1144 +msgid "Flip images horizontaly" +msgstr "" + +#: Editor/Form1.designer.cs:1148 +msgid "Video size" +msgstr "" + +#: Editor/Form1.designer.cs:1149 +msgid "Frame rate" +msgstr "" + +#: Editor/Form1.designer.cs:1150 +msgid "Z order" +msgstr "" + +#: Editor/Form1.designer.cs:1151 +msgid "Video length" +msgstr "" + +#: Editor/Form1.designer.cs:1153 +msgid "View" +msgstr "Anzeige" + +#: Editor/Form1.designer.cs:1154 +msgid "Zoom" +msgstr "" + +#: Editor/Form1.designer.cs:1155 +msgid "Mooz" +msgstr "" + +#: Editor/Form1.designer.cs:1156 +msgid "Set default scale" +msgstr "" + +#: Editor/Form1.designer.cs:1157 +#: Editor/Form1.designer.cs:1219 +msgid "Move to Top" +msgstr "" + +#: Editor/Form1.designer.cs:1158 +#: Editor/Form1.designer.cs:1218 +msgid "Move to End" +msgstr "" + +#: Editor/Form1.designer.cs:1159 +msgid "Tool" +msgstr "" + +#: Editor/Form1.designer.cs:1166 +msgid "Plugin config" +msgstr "" + +#: Editor/Form1.designer.cs:1167 +msgid "Sync with Time table" +msgstr "" + +#: Editor/Form1.designer.cs:1168 +msgid "Add empty character" +msgstr "" + +#: Editor/Form1.designer.cs:1169 +#: Editor/Form1.designer.cs:1224 +#: Editor/Form1_Preview.cs:295 +msgid "Pause" +msgstr "" + +#: Editor/Form1.designer.cs:1171 +msgid "Generate AVI" +msgstr "" + +#: Editor/Form1.designer.cs:1172 +msgid "Chose sound file" +msgstr "" + +#: Editor/Form1.designer.cs:1174 +msgid "Stop writing avi" +msgstr "" + +#: Editor/Form1.designer.cs:1175 +msgid "Background color" +msgstr "" + +#: Editor/Form1.designer.cs:1177 +msgid "Generate raw AVI" +msgstr "" + +#: Editor/Form1.designer.cs:1178 +#, fuzzy +msgid "Export" +msgstr "Beenden" + +#: Editor/Form1.designer.cs:1179 +msgid "script for H@TWUNEBENCH" +msgstr "" + +#: Editor/Form1.designer.cs:1185 +msgid "Bug report" +msgstr "" + +#: Editor/Form1.designer.cs:1193 +msgid "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" +msgstr "" + +#: Editor/Form1.designer.cs:1202 +#: Editor/Form1.designer.cs:1209 +msgid "LipSync data file(*.lse)|*.lse" +msgstr "" + +#: Editor/Form1.designer.cs:1216 +msgid "Real time \"lipsync\"" +msgstr "" + +#: Editor/Form1.designer.cs:1217 +msgid "Repeat play" +msgstr "" + +#: Editor/Form1.designer.cs:1220 +msgid "End repeat at" +msgstr "" + +#: Editor/Form1.designer.cs:1221 +msgid "Start repeat from" +msgstr "" + +#: Editor/Form1.designer.cs:1222 +msgid "Reset repeat region" +msgstr "" + +#: Editor/Form1.designer.cs:1225 +msgid "Show VSQ tracks allways" +msgstr "" + +#: Editor/Form1.designer.cs:1226 +msgid "Show bars" +msgstr "" + +#: Editor/Form1.designer.cs:1227 +msgid "Quantize" +msgstr "" + +#: Editor/Form1.designer.cs:1228 +msgid "off" +msgstr "" + +#: Editor/Form1.designer.cs:1229 +msgid "triplet" +msgstr "" + +#: Editor/Form1.designer.cs:1231 +#: Editor/FormObjectList.cs:60 +#: Editor/FormObjectList.Designer.cs:62 +msgid "List of object" +msgstr "" + +#: Editor/Form1.designer.cs:1232 +msgid "Property" +msgstr "" + +#: Editor/Form1.designer.cs:1246 +msgid "Series bitmap" +msgstr "" + +#: Editor/Form1_AviOutput.cs:203 +msgid "insertion of wav file has failed" +msgstr "" + +#: Editor/Form1_AviOutput.cs:262 +msgid "" +"Initialization of video compression failed.\n" +"This video codec may require image width in multiples of certain number." +msgstr "" + +#: Editor/Form1_AviOutput.cs:293 +msgid "FLV Progress" +msgstr "" + +#: Editor/Form1_AviOutput.cs:332 +msgid "AVI Progress" +msgstr "" + +#: Editor/Form1_EventHandler.cs:144 +#: Editor/Form1_EventHandler.cs:210 +msgid "Text file(*.txt)|*.txt" +msgstr "" + +#: Editor/Form1_EventHandler.cs:506 +msgid "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" +msgstr "" + +#: Editor/Form1_EventHandler.cs:548 +msgid "" +"...clearing entries of selected time-table.\n" +"Would you like to continue?" +msgstr "" + +#: Editor/Form1_EventHandler.cs:924 +msgid "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" +msgstr "" + +#: Editor/Form1_EventHandler.cs:1090 +msgid "" +"...deleting selected character.\n" +"Would you like to continue?" +msgstr "" + +#: Editor/Form1_EventHandler.cs:1100 +msgid "" +"...deleting selected track.\n" +"Would you like to continue?" +msgstr "" + +#: Editor/FormSetFrameRate.cs:167 +msgid "failed getting frame rate" +msgstr "" + +#: Editor/FormSetFrameRate.Designer.cs:186 +msgid "detail" +msgstr "" + +#: Editor/FormSetFrameRate.Designer.cs:187 +msgid "configure frame rate" +msgstr "" + +#: Editor/FormSetFrameRate.Designer.cs:191 +msgid "denominator of frame rate" +msgstr "" + +#: Editor/FormSetFrameRate.Designer.cs:192 +msgid "numerator of frame rate" +msgstr "" + +#: Editor/FormSetFrameRate.Designer.cs:194 +msgid "import frame rate from AVI file" +msgstr "" + +#: Editor/GenerateCharacter.cs:121 +#: Editor/GenerateCharacter.cs:146 +#: Editor/GenerateCharacter.designer.cs:614 +#: Editor/GenerateCharacter.designer.cs:619 +msgid "LipSync Character Config(*.lsc)|*.lsc" +msgstr "" + +#: Editor/GenerateCharacter.cs:147 +#: Editor/GenerateCharacter.cs:879 +msgid "LipSync Character Config(content.xml)|content.xml" +msgstr "" + +#: Editor/GenerateCharacter.cs:512 +msgid "NOT editable" +msgstr "" + +#: Editor/GenerateCharacter.cs:636 +msgid "Title of image" +msgstr "" + +#: Editor/GenerateCharacter.cs:637 +msgid "Input the title of image" +msgstr "" + +#: Editor/GenerateCharacter.cs:653 +msgid "This image title has been already registered" +msgstr "" + +#: Editor/GenerateCharacter.cs:809 +#: Editor/GenerateCharacter.designer.cs:602 +#: Editor/GenerateCharacter.designer.cs:638 +msgid "Change title" +msgstr "" + +#: Editor/GenerateCharacter.cs:810 +msgid "Input new title" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:586 +#: Editor/GenerateCharacter.designer.cs:589 +msgid "Title" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:587 +#: Editor/GenerateCharacter.designer.cs:588 +msgid "Tag" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:590 +#: Editor/GenerateCharacter.designer.cs:642 +msgid "Up" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:591 +#: Editor/GenerateCharacter.designer.cs:637 +msgid "Down" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:592 +#: Editor/GenerateCharacter.designer.cs:635 +msgid "Add" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:595 +msgid "Select image file" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:596 +#: Editor/GenerateCharacter.designer.cs:641 +msgid "Select transparent color" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:600 +msgid "Character name" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:604 +msgid "Selected image" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:607 +msgid "Open *.rsi" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:610 +msgid "Save as *.rsi" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:611 +msgid "Save as XML" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:623 +#: Editor/GenerateCharacter.designer.cs:639 +msgid "Reset image" +msgstr "" + +#: Editor/GenerateCharacter.designer.cs:625 +#: Editor/GenerateCharacter.designer.cs:630 +msgid "RipSync Image(*.rsi)|*.rsi" +msgstr "" + +#: Editor/Previewer.Designer.cs:297 +msgid "Stop" +msgstr "" + +#: Editor/Previewer.Designer.cs:298 +msgid "Stretch image" +msgstr "" + +#: Editor/Previewer.Designer.cs:299 +msgid "Specified size" +msgstr "" + +#: Editor/Property.Designer.cs:241 +msgid "Add telop" +msgstr "" + +#: Editor/Property.Designer.cs:242 +msgid "Delte telop" +msgstr "" + +#: Editor/SelectCharacter.designer.cs:219 +msgid "Custom" +msgstr "" + +#: Editor/SelectCharacter.designer.cs:220 +#: Editor/SelectCharacter.designer.cs:224 +#: Editor/SelectCharacter.designer.cs:225 +msgid "Built-in" +msgstr "" + +#: Editor/SelectCharacter.designer.cs:221 +msgid "Select character to generate lip-sync" +msgstr "" + +#: Editor/SelectCharacter.designer.cs:226 +msgid "Character selection" +msgstr "" + +#: Editor/TrackSelecter.designer.cs:141 +msgid "Select track" +msgstr "" + +#: Editor/TrackSelecter.designer.cs:142 +msgid "import tempo and time-signal information" +msgstr "" + +#: Editor/VersionInfoEx.cs:191 +#: Editor/VersionInfoEx.Designer.cs:118 +msgid "credit" +msgstr "" + +#: Editor/Winker.Designer.cs:261 +msgid "Wink interval (sec)" +msgstr "" + +#: Editor/Winker.Designer.cs:262 +msgid "Randomize" +msgstr "" + +#: Editor/Winker.Designer.cs:263 +msgid "Closed Eye" +msgstr "" + +#: Editor/Winker.Designer.cs:264 +msgid "In-between Image" +msgstr "" + +#: Editor/Winker.Designer.cs:265 +msgid "Eye-closing frames" +msgstr "" + +#: Editor/Winker.Designer.cs:268 +msgid "Limit start time" +msgstr "" + +#: Editor/Winker.Designer.cs:269 +msgid "Limit end time" +msgstr "" + +#: Editor/RipSync/RsiWriter.cs:208 +msgid "Image directory already exists. Would you like to overwrite them?" +msgstr "" + +#: Editor/RipSync/RsiWriter.cs:209 +msgid "warning" +msgstr "" + diff --git a/trunk/LipSync/en.lang b/trunk/LipSync/en.lang new file mode 100644 index 0000000..865f43a --- /dev/null +++ b/trunk/LipSync/en.lang @@ -0,0 +1,246 @@ +SERIES_BITMAP Series bitmap +SAVE_AS_XML Save as *.XML +TTIP_IMPORT_FRAME_RATE_FROM_AVI import frame rate from AVI file +IMPORT2 Import +DENOMINATOR_OF_FRAME_RATE denominator of frame rate +NUMERATOR_OF_FRAME_RATE numerator of frame rate +CONFIG_FRAME_RATE configure frame rate +DETAIL detail +FAILED_GETTING_FRAME_RATE failed getting frame rate +FILTER_ALLFILES All Files(*.*)|*.* +MOUSE_WHEEL_RATE mouse wheel rate +OPERATION Operation +CREDIT credit +RESET_IMAGE Reset image +FILTER_CHARACTER_XML LipSync Character Config(content.xml)|content.xml +FILTER_CHARACTER LipSync Character Config(*.lsc)|*.lsc +OFF off +APPEARANCE Appearance +IMPORT_TEMPO_AND_TIMESIG import tempo and time-signal information +WARN_OVERWRITE_TIMESIG This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue? +WARN_EXIST_SAME_FOLDER Image directory already exists. Would you like to overwrite them? +WARNING warning +SAVE_AS_RSI Save as *.RSI +OPEN_RSI Open *.RSI +TRIPLET triplet +QUANTIZE Quantize +SHOW_BARS Show bars +SHOW_VSQ_ALLWAYS Show VSQ tracks allways +RELOAD_LANG_CONFIG Reload language configurations +PLUGIN Plugin +VSQ_TRACK VSQ Tracks +CHARACTER Character +ANOTHER_IMAGE Another images +CONFIRMATION Confirmation +IMAGE Image +COPY_TIME_LINE Copy time-line +PASTE_TIME_LINE Paste time-line +NOTE_ON Note ON from here +NOTE_OFF Note OFF +SET_SCALE Scale setting +DELETING_TRACK ...deleting selected track.\nWould you like to continue? +DELETING_CHARACTER ...deleting selected character.\nWould you like to continue? +CLEAR_ENTRIES ...clearing entries of selected time-table.\nWould you like to continue? +ENTER_SCALE Please enter scale. (If entered value is minus, character or image will be flipped horizontally.) +INVALID_VALUE Invalid value has been entered +ERROR Error +SET_IMAGE_POSITION Image placement +AVI_INITIALIZATION_FAILED Initialization of video compression failed.\nThis video codec may require image width in multiples of certain number. +DELETE Delete +WARN_DELETE_ALL_TRACKS This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue? +INCASE_APPEND_TRACK ( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. ) +READ_VSQ Read from VSQ file +SET_VIDEO_SIZE Video size configuration +GEN_LIPSYNC_FROM_THIS Generate Lipsync from this track +SAVE_FILE has been changed. Do you wish to save changes to file? +SAVE_FILE_CREATE Do you wish to save changes to file? +TIMELINE Timeline +PREVIEW_IMAGE Preview image +FILE File +OPEN Open +SAVE Save +SAVE_AS Save As +IMPORT Import +RIPSYNC_DATA from RipSync data +OPEN_VSQ Open VSQ file +EXIT Exit +WINDOW Window +SHOW_PREVIEW Show preview +GOTO_PREVIEW Go to preview +HELP Help +PLUGIN_INFO Plugin information +VERSION_INFO About LipSync +DEBUG Debug +EDIT_CHARACTER Edit character +FLIP_HORIZONTALY Flip images horizontaly +EDIT Edit +UNDO Undo +REDO Redo +VIDEO_SIZE Video size +FRAME_RATE Frame rate +Z_ORDER Z order +CHANGE_VIDEO_LENGTH Video length +SHIFT_TIME_TABLE Shift all time-tables +VIEW View +ZOOM Zoom +MOOZ Mooz +DEFAULT_SCALE Set default scale +MOVE_TO_TOP Move to Top +MOVE_TO_END Move to End +TOOL Tool +OPTION Option +CANCEL Cancel +ON_TIME ON time (sec) +OFF_TIME OFF time (sec) +OK OK +USE_THIS_VALUE Use this value +EXPANDABLE_RANGE Expandable range of this entry +INPUT_NUMBER Numeric entry +LANGUAGE Language +SELECT_CONFIG_TARGET_BELOW select configuration item from the list box below +ADD Add +SELECT_IMAGE_FILE Select image file +SELECT_TRANSPARENT_COLOR Select transparent color +CHARACTER_NAME Character name +SHIFT_THIS_TIMELINE Shift this time-line +CLOSE Close +GENERATE_AVI Generate AVI +CHOSE_SOUND_FILE Chose sound file +GOTO_SPECIFIED_FRAME Go to specified frame +FILTER_TEXT Text file(*.txt)|*.txt +STRETCH_IMAGE Stretch image +SPECIFIED_SIZE Specified size +PLAY Play +STOP Stop +OVER_2GB AVI file size will exceed 2Gbyte.\nDo you wish to continue? +PAUSE Pause +REQUIRE_FRAME_INDEX please input frame index +INVALID_FRAME_INDEX invalid frame index +BUILT_IN Built-in +CUSTOM Custom +SELECT_CHARACTER Select character to generate lip-sync +CHARACTER_SELECTION Character selection +WIDTH Width +HEIGHT Height +SELECT_TRACK Select track +WINK_INTERVAL Wink interval (sec) +RANDOMIZE Randomize +CLOSED_EYE Closed Eye +IN_BETWEEN_IMAGE In-between Image +EYE_CLOSING_FRAME Eye-closing frames +GENERATE_WINK Generate wink +UP Up +DOWN Down +SELECT_TARGET_ITEM Select target item, and push [Up] or [Down] button +DELETE_ENTRIES Delete entries +ADD_TRACK Add track +SET_IMAGE Set image +CHANGE_IMAGE Change image +THIS_PLUGIN_CONFIG Plugin config. of this entry +EXPAND Expand +FAILED_FILE_SAVING Failed file saving +FAILED_FILE_READING Failed file reading +INPUT_VIDEO_LENGTH Input video length in second +INPUT_SHIFT_TIME Input shift time in second (you can enter minus value) +INPUT_FRAME_RATE Input frame rate +FILE_NOT_FOUND File not found +GENERATE_TELOP_FROM_VSQ Generate telop from VSQ +CHANGE_TITLE Change title +INPUT_NEW_TITLE Input new title +TITLE_OF_IMAGE Title of image +INPUT_IMAGE_TITLE Input the title of image +NOT_EDITABLE NOT editable +EXPAND_ALL Expand all +FOLD_ALL Fold all +NO_NAME (no name) +ENABLE_PREVIEW Enable preview +DISABLE_PREVIEW Disable preview +PLUGIN_CONFIG Plugin config +SYNC_WITH_TIMETABLE Sync with Time table +ADD_EMPTY_CHARACTER Add empty character +START_TIME_LIMITATION Limit start time +END_TIME_LIMITATION Limit end time +COPY Copy +PASTE Paste +CUT Cut +WAV_ADDITION_FAILED insertion of wav file has failed +STOP_WRITING_AVI Stop writing avi +FILE_NAME file name +BGCOLOR Background color +USER_CONFIG User Config +LIPSYNC_OPTION lip-sync Option +TITLE_OF_TIMELINE Title of timeline +VSQ_ENTRY VSQ Entry +PLUGIN_ENTRY Plugin Entry +ANOTHER_ENTRY Another Entry +ENTRY_HEIGHT Entry height (pixel) +CHANGE Change +CHECK_PHONETIC_SYMBOL Check phonetic symbol to configure detailed mouth shape control +U_SHAPED_MOUTH "u" shaped mouth before pronunciation +CLOSED_MOUTH Close mouth before pronunciation +I_SHAPED_MOUTH "i" shaped mouth before pronunciation +EXPORT_TO_TEXT Export to TEXT +IMPORT_FROM_TEXT Import from TEXT +COLOR Color +DESIGN Design +SYSTEM System +PATH_OF_FFMPEG Path of ffmpeg +PATH_OF_MENCODER Path of mencoder +INVALID_IMAGE_TITLE Image title can't be set to "base", "a", "aa", "i", "u", "e", "o", "xo", "nn" +TITLE_ALREADY_EXIST This image title has been already registered +PROGRESS AVI Progress +FILTER_AVI Avi file(*.avi)|*.avi +INVALID_EXTENSION Extension must be *.lse +SPECIFY_PASTE_MODE Specify paste mode +INTERRUPT Interrupt +OVERWRITE Overwrite +NON_COMPRESSED_AVI Generate raw AVI +VIDEO Video +AUDIO Audio +CONVERT_TO_FLV Convert to FLV +DELETE_INTERMEDIATE Delete intermediate file +MERGE_WAVE_TO_AVI Merge wave to AVI +VIDEO_COMPRESSION Video Compression +OUTPUT_RANGE Specify output range +START Start +END End +FILTER_AUDIO Audio file(*.mp3;*.wav)|*.mp3;*.wav +ALREADY_EXISTS already exists. +REPLACE_IT Do you want to replace it? +DIRECTORY Directory +DOES_NOT_EXIST does not exist. +TITLE Title +TAG Tag +SELECTED_IMAGE Selected Image +EXPORT Export +HATWUNE script for H@TWUNEBENCH +LIST_OF_OBJECTS List of object +PROPERTY Property +OBJECT_NAME Object name +ADD_TELOP Add telop +ENABLE_PROPERTY Show object list +DISABLE_PROPERTY Hide object list +BUG_REPORT Bug report +FONT Font +DELETE_TELOP Delte telop +SPLIT Split entry +ANOTHER_CONFIG Another settings +SERIAL_VOWEL Close mouth when same vowels repeated +FLV_PROGRESS FLV Progress +FILTER_EXE Executable file(*.exe)|*.exe +FILTER_VSQ VOCALOID2 Sequence File(*.vsq)|*.vsq +FILTER_IMAGE Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg +FILTER_LSE LipSync data file(*.lse)|*.lse +RAW (Non-compressed) +ENCODER_DECODER Encoder/Decoder +GEN_CHARACTER_AUTOMATICALY Generate character automaticaly when importing vsq +COMBINE_THRESHOLD Threshold silence length(sec) +REALTIME Real time "lipsync" +INVERSE_ON_OFF Copy On/Off inverted +REPEAT_PLAY Repeat play +MOTION_CURVE Edit motion curve +SET_REPEAT_START Start repeat from +SET_REPEAT_END End repeat at +RESET_REPEAT_REGION Reset repeat region +USE_PREVIEWABLE_DIALOG Use preview-enabled dialog in character selection +FILTER_RSI RipSync Image(*.rsi)|*.rsi \ No newline at end of file diff --git a/trunk/LipSync/hogehoge/CVS/Entries b/trunk/LipSync/hogehoge/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync/hogehoge/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync/hogehoge/CVS/Entries.Extra b/trunk/LipSync/hogehoge/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/hogehoge/CVS/Entries.Extra.Old b/trunk/LipSync/hogehoge/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/hogehoge/CVS/Entries.Old b/trunk/LipSync/hogehoge/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/hogehoge/CVS/Repository b/trunk/LipSync/hogehoge/CVS/Repository new file mode 100644 index 0000000..28df5af --- /dev/null +++ b/trunk/LipSync/hogehoge/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync/hogehoge diff --git a/trunk/LipSync/hogehoge/CVS/Root b/trunk/LipSync/hogehoge/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync/hogehoge/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync/hogehoge/CVS/Template b/trunk/LipSync/hogehoge/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync/ja.po b/trunk/LipSync/ja.po new file mode 100644 index 0000000..c5ebf11 --- /dev/null +++ b/trunk/LipSync/ja.po @@ -0,0 +1,1301 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-09 00:16+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: kbinani \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Japanese\n" +"X-Poedit-Country: JAPAN\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-Basepath: ..\\..\\\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-SearchPath-0: lipsync\\LipSync\\Editor\n" +"X-Poedit-SearchPath-1: lipsync\\LipSync\\Common\n" +"X-Poedit-SearchPath-2: Boare.Lib.AppUtil\n" + +#: lipsync\LipSync\Editor/AviOutput.cs:59 +msgid "Cancel" +msgstr "繧ュ繝」繝ウ繧サ繝ォ" + +#: lipsync\LipSync\Editor/AviOutput.cs:60 +msgid "Save" +msgstr "菫晏ュ" + +#: lipsync\LipSync\Editor/AviOutput.cs:61 +msgid "File Name" +msgstr "繝輔ぃ繧、繝ォ蜷" + +#: lipsync\LipSync\Editor/AviOutput.cs:63 +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Audio" +msgstr "繧ェ繝シ繝繧」繧ェ" + +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Set the path of ffmpeg to enable this option" +msgstr "縺薙ョ繧ェ繝励す繝ァ繝ウ繧剃スソ縺縺ォ縺ッffmpeg縺ク縺ョ繝代せ繧定ィュ螳壹@縺ヲ荳九&縺" + +#: lipsync\LipSync\Editor/AviOutput.cs:70 +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "FLV and MP4" +msgstr "FLV縺ィMP4" + +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "Set the path of mencoder and ffmpeg to enable this option" +msgstr "縺薙ョ繧ェ繝励す繝ァ繝ウ繧剃スソ縺縺ォ縺ッmencoder縺ィffmpeg縺ク縺ョ繝代せ繧定ィュ螳壹@縺ヲ荳九&縺" + +#: lipsync\LipSync\Editor/AviOutput.cs:76 +msgid "Convert to FLV" +msgstr "flv縺ォ螟画鋤" + +#: lipsync\LipSync\Editor/AviOutput.cs:77 +msgid "Convert to MP4" +msgstr "mp4縺ォ螟画鋤" + +#: lipsync\LipSync\Editor/AviOutput.cs:78 +msgid "Merge WAVE to AVI" +msgstr "AVI縺ォ蝓九a霎シ繧" + +#: lipsync\LipSync\Editor/AviOutput.cs:79 +msgid "Delete Intermediate File" +msgstr "荳ュ髢薙ヵ繧。繧、繝ォ繧貞炎髯、縺吶k" + +#: lipsync\LipSync\Editor/AviOutput.cs:80 +msgid "Video Compression" +msgstr "繝薙ョ繧ェ蝨ァ邵ョ" + +#: lipsync\LipSync\Editor/AviOutput.cs:81 +msgid "Specify Output Range" +msgstr "蜃コ蜉帷ッ蝗イ繧呈欠螳" + +#: lipsync\LipSync\Editor/AviOutput.cs:82 +msgid "Start" +msgstr "髢句ァ" + +#: lipsync\LipSync\Editor/AviOutput.cs:83 +msgid "End" +msgstr "邨ゆコ" + +#: lipsync\LipSync\Editor/AviOutput.cs:84 +msgid "Add Alpha" +msgstr "繧「繝ォ繝輔ぃ蛟、繧貞性繧√k" + +#: lipsync\LipSync\Editor/AviOutput.cs:118 +#, csharp-format +msgid "Directory {0} does not exist." +msgstr "繝繧」繝ャ繧ッ繝医Μ {0} 縺ッ蟄伜惠縺励∪縺帙s縲" + +#: lipsync\LipSync\Editor/AviOutput.cs:119 +#: lipsync\LipSync\Editor/AviOutput.cs:140 +msgid "Error" +msgstr "繧ィ繝ゥ繝シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:127 +#, csharp-format +msgid "" +"{0} already exists.\n" +"Do you want to replace it?" +msgstr "" +"{0} 縺ッ譌「縺ォ蟄伜惠縺励∪縺兔n" +"鄂ョ縺肴鋤縺医∪縺吶°シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:139 +msgid "Invalid value has been entered" +msgstr "辟。蜉ケ縺ェ蛟、縺ァ縺" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "Avi file(*.avi)|*.avi" +msgstr "AVI繝輔ぃ繧、繝ォ(*.avi)|*.avi" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "All Files(*.*)|*.*" +msgstr "蜈ィ縺ヲ縺ョ繝輔ぃ繧、繝ォ|*.*" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:88 +msgid "Edit Motion Curve" +msgstr "螟我ス阪ョ蛻カ蠕。" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:89 +msgid "Close" +msgstr "髢峨§繧" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:90 +msgid "File" +msgstr "繝輔ぃ繧、繝ォ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:91 +msgid "Redo" +msgstr "繧繧顔峩縺" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:92 +msgid "Undo" +msgstr "蜈縺ォ謌サ縺" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:93 +msgid "Edit" +msgstr "邱ィ髮" + +#: lipsync\LipSync\Editor/EditEntry.cs:58 +msgid "ON time (sec)" +msgstr "ON譎ょ綾 (遘)" + +#: lipsync\LipSync\Editor/EditEntry.cs:59 +msgid "OFF time (sec)" +msgstr "OFF譎ょ綾 (遘)" + +#: lipsync\LipSync\Editor/EditEntry.cs:61 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:101 +msgid "OK" +msgstr "OK" + +#: lipsync\LipSync\Editor/EditEntry.cs:62 +msgid "Use this value" +msgstr "縺薙ョ蛟、繧剃スソ縺" + +#: lipsync\LipSync\Editor/EditEntry.cs:63 +msgid "Expandable range of this entry" +msgstr "螟画峩蜿ッ閭ス縺ェ蛟、縺ョ遽蝗イ" + +#: lipsync\LipSync\Editor/EditEntry.cs:64 +msgid "Numeric entry" +msgstr "謨ー蛟、蜈・蜉" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:103 +msgid "Language" +msgstr "險隱" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:104 +#: lipsync\LipSync\Editor/Form1Util.cs:130 +msgid "Option" +msgstr "繧ェ繝励す繝ァ繝ウ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:106 +msgid "User Config" +msgstr "繝ヲ繝シ繧カ繝シ險ュ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:107 +msgid "Appearance" +msgstr "螟冶ヲウ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:108 +msgid "lip-sync Option" +msgstr "蜿」繝代け逕滓" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:109 +msgid "System" +msgstr "繧キ繧ケ繝繝" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:111 +msgid "Title of timeline" +msgstr "繧ソ繧、繝繝ゥ繧、繝ウ縺ョ繧ソ繧、繝医Ν" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:112 +msgid "VSQ Entry" +msgstr "VSQ繧ィ繝ウ繝医Μ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:113 +msgid "Plugin Entry" +msgstr "繝励Λ繧ー繧、繝ウ繧ィ繝ウ繝医Μ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:114 +msgid "Another Entry" +msgstr "縺昴ョ莉悶ョ繧ィ繝ウ繝医Μ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:115 +msgid "Entry height (pixel)" +msgstr "繧ィ繝ウ繝医Μ縺ョ鬮倥& (繝斐け繧サ繝ォ)" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:116 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:117 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:118 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:119 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:129 +msgid "Change" +msgstr "螟画峩" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:120 +msgid "Check phonetic symbol to configure detailed mouth shape control" +msgstr "逋コ髻ウ縺ョ逶エ蜑阪↓蜿」縺ョ蠖「繧貞、牙喧縺輔○繧狗匱髻ウ險伜捷繧呈欠螳壹@縺セ縺" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:121 +msgid "Close mouth before pronunciation" +msgstr "逋コ髻ウ縺ョ逶エ蜑阪↓蜿」繧帝哩縺倥k" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:122 +msgid "\"i\" shaped mouth before pronunciation" +msgstr "逋コ髻ウ縺ョ逶エ蜑阪↓\"縺Ы"縺ョ蜿」縺ョ蠖「縺ォ縺吶k" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:123 +msgid "\"u\" shaped mouth before pronunciation" +msgstr "逋コ髻ウ縺ョ逶エ蜑阪↓\"縺\"縺ョ蜿」縺ョ蠖「縺ォ縺吶k" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:124 +msgid "Color" +msgstr "驟崎牡" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:125 +msgid "Design" +msgstr "陦ィ遉コ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:126 +msgid "Path of ffmpeg" +msgstr "ffmpeg縺ョ蝣エ謇" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:127 +msgid "Path of mencoder" +msgstr "mencoder縺ョ蝣エ謇" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:128 +msgid "Font" +msgstr "繝輔か繝ウ繝" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:130 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:135 +msgid "Another settings" +msgstr "縺昴ョ莉悶ョ險ュ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:131 +msgid "Close mouth when same vowels repeated" +msgstr "蜷御ク豈埼浹縺碁」邯壹☆繧九→縺阪∝哨繧帝哩縺倥k" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:132 +msgid "Encoder/Decoder" +msgstr "繧ィ繝ウ繧ウ繝シ繝/繝繧ウ繝シ繝" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:133 +msgid "Generate character automaticaly when importing vsq" +msgstr "VSQ隱ュ霎シ縺ソ譎ゅ↓繧ュ繝」繝ゥ繧ッ繧ソ繧定ェ蜍慕函謌舌☆繧" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:134 +msgid "Threshold silence length(sec)" +msgstr "騾」邯夐浹縺ィ縺ソ縺ェ縺咏┌髻ウ譎る俣(遘)" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:136 +msgid "Use preview-enabled dialog in character selection" +msgstr "繝励Ξ繝薙Η繝シ蜿ッ閭ス縺ェ繧ュ繝」繝ゥ繧ッ繧ソ繝輔ぃ繧、繝ォ驕ク謚槭ム繧、繧「繝ュ繧ー繧剃スソ逕ィ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:137 +msgid "Reload language configurations" +msgstr "險隱櫁ィュ螳壹ヵ繧。繧、繝ォ繧偵Μ繝ュ繝シ繝" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:138 +msgid "Operation" +msgstr "謫堺ス" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:139 +msgid "mouse wheel rate" +msgstr "繝槭え繧ケ繝帙う繝シ繝ォ騾溷コヲ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:140 +msgid "Fix cursor to center in Sync mode" +msgstr "繧キ繝ウ繧ッ繝ュ陦ィ遉コ譎ゅ↓繧ォ繝シ繧ス繝ォ縺御クュ螟ョ縺ォ陦ィ遉コ縺輔l繧九h縺縺ォ縺吶k" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:281 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:305 +msgid "Executable file(*.exe)|*.exe" +msgstr "螳溯。悟庄閭ス繝輔ぃ繧、繝ォ(*.exe)|*.exe" + +#: lipsync\LipSync\Editor/Form1.cs:604 +#: lipsync\LipSync\Editor/Form1.cs:2011 +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Video size configuration" +msgstr "繝薙ョ繧ェ縺ョ繧オ繧、繧コ繧定ィュ螳" + +#: lipsync\LipSync\Editor/Form1.cs:612 +msgid "Read from VSQ file" +msgstr "VSQ繝輔ぃ繧、繝ォ縺九i隱ュ霎シ" + +#: lipsync\LipSync\Editor/Form1.cs:616 +msgid "Edit character" +msgstr "繧ュ繝」繝ゥ繧ッ繧ソ繧堤キィ髮" + +#: lipsync\LipSync\Editor/Form1.cs:619 +#: lipsync\LipSync\Editor/Form1.cs:652 +#: lipsync\LipSync\Editor/Form1.cs:668 +msgid "Preview image" +msgstr "逕サ蜒上ョ繝励Ξ繝薙Η繝シ" + +#: lipsync\LipSync\Editor/Form1.cs:620 +#: lipsync\LipSync\Editor/Form1.cs:677 +#: lipsync\LipSync\Editor/Form1.cs:737 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:964 +msgid "Image placement" +msgstr "繧、繝。繝シ繧ク菴咲スョ縺ョ險ュ螳" + +#: lipsync\LipSync\Editor/Form1.cs:621 +#: lipsync\LipSync\Editor/Form1.cs:680 +#: lipsync\LipSync\Editor/Form1.cs:740 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Scale setting" +msgstr "陦ィ遉コ蛟咲紫縺ョ險ュ螳" + +#: lipsync\LipSync\Editor/Form1.cs:623 +msgid "Generate wink" +msgstr "逶ョ繝代メ縺ョ逕滓" + +#: lipsync\LipSync\Editor/Form1.cs:627 +#: lipsync\LipSync\Editor/Form1.cs:791 +msgid "Delete" +msgstr "蜑企勁" + +#: lipsync\LipSync\Editor/Form1.cs:630 +msgid "Add Telop" +msgstr "繝繝ュ繝繝励r霑ス蜉" + +#: lipsync\LipSync\Editor/Form1.cs:633 +msgid "Add track" +msgstr "繝医Λ繝繧ッ繧定ソス蜉" + +#: lipsync\LipSync\Editor/Form1.cs:643 +msgid "Generate Lipsync from this track" +msgstr "縺薙ョ繝医Λ繝繧ッ縺九i蜿」繝代け繧堤函謌" + +#: lipsync\LipSync\Editor/Form1.cs:649 +#: lipsync\LipSync\Editor/Form1.cs:660 +#: lipsync\LipSync\Editor/Form1.cs:691 +msgid "Note ON from here" +msgstr "縺薙ョ菴咲スョ縺ァ繝弱シ繝ON" + +#: lipsync\LipSync\Editor/Form1.cs:664 +msgid "Set image" +msgstr "逕サ蜒上r謖螳" + +#: lipsync\LipSync\Editor/Form1.cs:671 +msgid "Change image" +msgstr "逕サ蜒上r螟画峩" + +#: lipsync\LipSync\Editor/Form1.cs:675 +#: lipsync\LipSync\Editor/Form1.cs:735 +msgid "Image" +msgstr "逕サ蜒" + +#: lipsync\LipSync\Editor/Form1.cs:702 +#: lipsync\LipSync\Editor/Form1.cs:775 +msgid "Paste" +msgstr "雋シ莉" + +#: lipsync\LipSync\Editor/Form1.cs:716 +msgid "Note OFF" +msgstr "縺薙ョ菴咲スョ縺ァ繝弱シ繝OFF" + +#: lipsync\LipSync\Editor/Form1.cs:718 +msgid "Image Preview" +msgstr "繝励Ξ繝薙Η繝シ繧定。ィ遉コ" + +#: lipsync\LipSync\Editor/Form1.cs:720 +msgid "Numeric Entry" +msgstr "謨ー蛟、蜈・蜉" + +#: lipsync\LipSync\Editor/Form1.cs:722 +msgid "Expand" +msgstr "諡。蠑オ" + +#: lipsync\LipSync\Editor/Form1.cs:730 +msgid "Set Image" +msgstr "逕サ蜒上r謖螳" + +#: lipsync\LipSync\Editor/Form1.cs:732 +msgid "Preview Image" +msgstr "逕サ蜒上ョ繝励Ξ繝薙Η繝シ" + +#: lipsync\LipSync\Editor/Form1.cs:733 +msgid "Change Image" +msgstr "逕サ蜒上r螟画峩" + +#: lipsync\LipSync\Editor/Form1.cs:749 +msgid "Plugin config. of this entry" +msgstr "縺薙ョ繧ィ繝ウ繝医Μ縺ョ繝励Λ繧ー繧、繝ウ險ュ螳" + +#: lipsync\LipSync\Editor/Form1.cs:755 +#: lipsync\LipSync\Editor/Form1.cs:767 +msgid "Copy" +msgstr "繧ウ繝斐シ" + +#: lipsync\LipSync\Editor/Form1.cs:756 +msgid "Cut" +msgstr "蛻蜿" + +#: lipsync\LipSync\Editor/Form1.cs:757 +msgid "Split Entry" +msgstr "繧ィ繝ウ繝医Μ繧貞蜑イ" + +#: lipsync\LipSync\Editor/Form1.cs:765 +msgid "Timeline" +msgstr "繧ソ繧、繝繝ゥ繧、繝ウ" + +#: lipsync\LipSync\Editor/Form1.cs:771 +msgid "Copy On/Off inverted" +msgstr "ON/OFF蜿崎サ「繧ウ繝斐シ" + +#: lipsync\LipSync\Editor/Form1.cs:779 +msgid "Import from TEXT" +msgstr "繝繧ュ繧ケ繝医°繧峨う繝ウ繝昴シ繝" + +#: lipsync\LipSync\Editor/Form1.cs:780 +msgid "Export to TEXT" +msgstr "繝繧ュ繧ケ繝医↓繧ィ繧ッ繧ケ繝昴シ繝" + +#: lipsync\LipSync\Editor/Form1.cs:793 +msgid "Delete entries" +msgstr "繝医Λ繝繧ッ荳翫ョ繧ィ繝ウ繝医Μ繧貞炎髯、" + +#: lipsync\LipSync\Editor/Form1.cs:797 +msgid "Shift this time-line" +msgstr "謖螳夂ァ呈焚繧キ繝輔ヨ" + +#: lipsync\LipSync\Editor/Form1.cs:1367 +#: lipsync\LipSync\Editor/Form1.cs:1407 +#: lipsync\LipSync\Editor/Form1.cs:1603 +msgid "VSQ Tracks" +msgstr "VSQ繝医Λ繝繧ッ" + +#: lipsync\LipSync\Editor/Form1.cs:1378 +msgid "Character" +msgstr "繧ュ繝」繝ゥ繧ッ繧ソ" + +#: lipsync\LipSync\Editor/Form1.cs:1385 +msgid "Telop" +msgstr "蟄怜ケ" + +#: lipsync\LipSync\Editor/Form1.cs:1392 +msgid "Another Images" +msgstr "縺昴ョ莉悶ョ繧、繝。繝シ繧ク" + +#: lipsync\LipSync\Editor/Form1.cs:1399 +#: lipsync\LipSync\Editor/Form1.cs:1577 +msgid "Plugin" +msgstr "繝励Λ繧ー繧、繝ウ" + +#: lipsync\LipSync\Editor/Form1.cs:1540 +msgid "LipSync" +msgstr "LipSync" + +#: lipsync\LipSync\Editor/Form1.cs:1605 +#: lipsync\LipSync\Editor/Form1.cs:2394 +msgid "Another images" +msgstr "縺昴ョ莉悶ョ繧、繝。繝シ繧ク" + +#: lipsync\LipSync\Editor/Form1.cs:1952 +msgid "" +"Initialization of video compression failed.\n" +"This video codec may require image width in multiples of certain number." +msgstr "" +"繝薙ョ繧ェ蝨ァ邵ョ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆\n" +"逕サ蜒上し繧、繧コ繧堤音螳壹ョ蛟肴焚縺ォ縺励↑縺縺ィ菴ソ逕ィ蜃コ譚・縺ェ縺繧ウ繝シ繝繝繧ッ縺ョ蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶" + +#: lipsync\LipSync\Editor/Form1.cs:1963 +msgid "AVI Progress" +msgstr "AVI蜃コ蜉帑クュ" + +#: lipsync\LipSync\Editor/Form1.cs:2011 +msgid "Input video length in second" +msgstr "繝薙ョ繧ェ縺ョ髟キ縺輔r遘貞腰菴阪〒蜈・蜉帙@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Shift all time-tables" +msgstr "蜈ィ繧ソ繧、繝繝ゥ繧、繝ウ繧偵す繝輔ヨ" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Input shift time in second (you can enter minus value)" +msgstr "繧キ繝輔ヨ縺吶k遘呈焚繧貞・蜉帙@縺ヲ縺上□縺輔>(繝槭う繝翫せ蜿ッ)" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +#: lipsync\LipSync\Editor/Form1.cs:2689 +msgid "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" +msgstr "縺薙ョ謫堺ス懊ッ譌「蟄倥ョ繝医Λ繝繧ッ繧貞ィ縺ヲ荳頑嶌縺阪@縺セ縺吶ゅ∪縺溘√d繧顔峩縺励b縺ァ縺阪∪縺帙s縲ゅh繧阪@縺縺ァ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +msgid "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" +msgstr "" +"シ育樟蝨ィ縺ョ繝医Λ繝繧ッ縺ォ霑ス蜉縺吶k縺ィ縺阪ッ縲√祁SQ繝医Λ繝繧ッ縲阪r蜿ウ繧ッ繝ェ繝繧ッ縺励―n" +"縲祁SQ繝輔ぃ繧、繝ォ縺九i隱ュ霎シ縲阪r驕ク謚槭@縺ヲ縺上□縺輔>シ" + +#: lipsync\LipSync\Editor/Form1.cs:2300 +#: lipsync\LipSync\Editor/Form1.cs:2690 +#: lipsync\LipSync\Editor/Form1Util.cs:249 +#: lipsync\LipSync\Editor/Form1Util.cs:283 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "Confirmation" +msgstr "遒コ隱" + +#: lipsync\LipSync\Editor/Form1.cs:2313 +#: lipsync\LipSync\Editor/Form1Util.cs:150 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:931 +msgid "VOCALOID2 Sequence File(*.vsq)|*.vsq" +msgstr "VOCALOID2 繝繝シ繧ソ繝輔ぃ繧、繝ォ(*.vsq)|*.vsq" + +#: lipsync\LipSync\Editor/Form1.cs:2314 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:932 +msgid "UTAU Script File(*.ust)|*.ust" +msgstr "UTAU繧ケ繧ッ繝ェ繝励ヨ蠖「蠑(*.ust)|*.ust" + +#: lipsync\LipSync\Editor/Form1.cs:2436 +#: lipsync\LipSync\Editor/Form1.cs:2569 +msgid "Specify the index of target character" +msgstr "蜃コ蜉帛ッセ雎。縺ョ繧ュ繝」繝ゥ繧ッ繧ソ繧堤分蜿キ縺ァ謖螳壹@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/Form1.cs:2707 +#: lipsync\LipSync\Editor/Form1.cs:3134 +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1907 +msgid "Play" +msgstr "蜀咲函" + +#: lipsync\LipSync\Editor/Form1.cs:2711 +msgid "File not found" +msgstr "繝輔ぃ繧、繝ォ縺後≠繧翫∪縺帙s" + +#: lipsync\LipSync\Editor/Form1.cs:2730 +#: lipsync\LipSync\Editor/Form1.cs:2758 +#: lipsync\LipSync\Editor/Form1.cs:2770 +msgid "Extension must be *.lse" +msgstr "*.lse莉・螟悶ョ諡。蠑オ蟄舌↓縺吶k縺薙→縺ッ縺ァ縺阪∪縺帙s" + +#: lipsync\LipSync\Editor/Form1.cs:2895 +msgid "Expand All" +msgstr "蜈ィ縺ヲ螻暮幕" + +#: lipsync\LipSync\Editor/Form1.cs:2896 +msgid "Fold All" +msgstr "蜈ィ縺ヲ謚倥j逡ウ縺ソ" + +#: lipsync\LipSync\Editor/Form1.cs:3138 +msgid "Audio File(*.mp3;*.wav)|*.mp3;*.wav" +msgstr "髻ウ螢ー繝輔ぃ繧、繝ォ(*.mp3,*.wav)|*.mp3;*.wav" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "Go to specified frame" +msgstr "謖螳壹ヵ繝ャ繝シ繝縺ォ遘サ蜍" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "please input frame index" +msgstr "繝輔Ξ繝シ繝繧、繝ウ繝繝繧ッ繧ケ繧貞・蜉帙@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/Form1.cs:3166 +msgid "invalid frame index" +msgstr "縺昴ョ繧医≧縺ェ繝輔Ξ繝シ繝縺ッ縺ゅj縺セ縺帙s" + +#: lipsync\LipSync\Editor/Form1.cs:3702 +msgid "Series Image Progress" +msgstr "騾」逡ェ逕サ蜒丞コ蜉帑クュ" + +#: lipsync\LipSync\Editor/Form1Util.cs:104 +msgid "Open" +msgstr "髢九¥" + +#: lipsync\LipSync\Editor/Form1Util.cs:106 +msgid "Save As" +msgstr "蛻・蜷阪〒菫晏ュ" + +#: lipsync\LipSync\Editor/Form1Util.cs:107 +msgid "Import" +msgstr "繧、繝ウ繝昴シ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:108 +msgid "from RipSync data" +msgstr "RipSync繝繝シ繧ソ" + +#: lipsync\LipSync\Editor/Form1Util.cs:109 +msgid "Open VSQ/UST file" +msgstr "VSQ/UST繧帝幕縺" + +#: lipsync\LipSync\Editor/Form1Util.cs:110 +msgid "Exit" +msgstr "邨ゆコ" + +#: lipsync\LipSync\Editor/Form1Util.cs:111 +msgid "Script for VOCALOMARK" +msgstr "VOCALOMARK逕ィ繧ケ繧ッ繝ェ繝励ヨ" + +#: lipsync\LipSync\Editor/Form1Util.cs:115 +msgid "Help" +msgstr "繝倥Ν繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:116 +msgid "Plugin Information" +msgstr "繝励Λ繧ー繧、繝ウ諠蝣ア" + +#: lipsync\LipSync\Editor/Form1Util.cs:117 +msgid "About LipSync" +msgstr "LipSync縺ォ縺、縺縺ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:118 +msgid "Debug" +msgstr "繝繝舌ャ繧ー" + +#: lipsync\LipSync\Editor/Form1Util.cs:119 +msgid "Edit Character" +msgstr "繧ュ繝」繝ゥ繧ッ繧ソ繧堤キィ髮" + +#: lipsync\LipSync\Editor/Form1Util.cs:120 +msgid "Flip Images Horizontaly" +msgstr "繧、繝。繝シ繧ク繧貞キヲ蜿ウ蜿崎サ「" + +#: lipsync\LipSync\Editor/Form1Util.cs:124 +msgid "Video Size" +msgstr "繝薙ョ繧ェ繧オ繧、繧コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:125 +msgid "Frame Rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:126 +msgid "Z order" +msgstr "謠冗判鬆蠎" + +#: lipsync\LipSync\Editor/Form1Util.cs:127 +msgid "Video Length" +msgstr "繝薙ョ繧ェ縺ョ髟キ縺輔r螟画峩" + +#: lipsync\LipSync\Editor/Form1Util.cs:128 +msgid "Shift All Time-tables" +msgstr "蜈ィ繧ソ繧、繝繝ゥ繧、繝ウ繧偵す繝輔ヨ" + +#: lipsync\LipSync\Editor/Form1Util.cs:129 +msgid "Tool" +msgstr "繝繝シ繝ォ" + +#: lipsync\LipSync\Editor/Form1Util.cs:131 +msgid "Plugin Config" +msgstr "繝励Λ繧ー繧、繝ウ險ュ螳" + +#: lipsync\LipSync\Editor/Form1Util.cs:132 +msgid "Add Empty Character" +msgstr "遨コ縺ョ繧ュ繝」繝ゥ繧ッ繧ソ繧定ソス蜉" + +#: lipsync\LipSync\Editor/Form1Util.cs:134 +msgid "Generate Avi" +msgstr "Avi蜃コ蜉" + +#: lipsync\LipSync\Editor/Form1Util.cs:135 +msgid "Chose Sound File" +msgstr "蜷梧凾蜀咲函縺吶k譖イ" + +#: lipsync\LipSync\Editor/Form1Util.cs:136 +msgid "Go to Specified Frame" +msgstr "謖螳壹ヵ繝ャ繝シ繝縺ォ遘サ蜍" + +#: lipsync\LipSync\Editor/Form1Util.cs:137 +msgid "Stop Writing Avi" +msgstr "蜃コ蜉帙ョ荳ュ譁ュ" + +#: lipsync\LipSync\Editor/Form1Util.cs:138 +msgid "Background Color" +msgstr "閭梧勹濶イ" + +#: lipsync\LipSync\Editor/Form1Util.cs:140 +msgid "Generate Raw Avi" +msgstr "辟。蝨ァ邵ョ縺ョAvi繧貞コ蜉" + +#: lipsync\LipSync\Editor/Form1Util.cs:141 +msgid "Export" +msgstr "繧ィ繧ッ繧ケ繝昴シ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:142 +msgid "Script for H@TWUNEBENCH" +msgstr "縺ッ縺ィ縺縺ュ繝吶Φ繝∫畑繧ケ繧ッ繝ェ繝励ヨ" + +#: lipsync\LipSync\Editor/Form1Util.cs:144 +msgid "Show Object List" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医r陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:146 +msgid "Hide Object List" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医r髱櫁。ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:148 +msgid "Bug Report" +msgstr "繝舌げ繝ャ繝昴シ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:158 +msgid "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" +msgstr "逕サ蜒上ヵ繧。繧、繝ォ(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" + +#: lipsync\LipSync\Editor/Form1Util.cs:159 +msgid "Avi File(*.avi)|*.avi" +msgstr "Avi繝輔ぃ繧、繝ォ(*.avi)|*.avi" + +#: lipsync\LipSync\Editor/Form1Util.cs:167 +msgid "LipSync Data File(*.lse)|*.lse" +msgstr "LipSync繝繝シ繧ソ險ュ螳(*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:175 +msgid "LipSync Data file(*.lse)|*.lse" +msgstr "LipSync繝繝シ繧ソ險ュ螳(*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:183 +msgid "Real Time \"lipsync\"" +msgstr "繝ェ繧「繝ォ繧ソ繧、繝謇薙■霎シ縺ソ" + +#: lipsync\LipSync\Editor/Form1Util.cs:184 +msgid "End Repeat Here" +msgstr "繝ェ繝斐シ繝育オゆコ菴咲スョ縺ォ謖螳" + +#: lipsync\LipSync\Editor/Form1Util.cs:185 +msgid "Start Repeat Here" +msgstr "繝ェ繝斐シ繝磯幕蟋倶ス咲スョ縺ォ謖螳" + +#: lipsync\LipSync\Editor/Form1Util.cs:186 +msgid "Reset Repeat region" +msgstr "繝ェ繝斐シ繝育ッ蝗イ繧偵Μ繧サ繝繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:189 +msgid "View" +msgstr "陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:190 +msgid "Zoom" +msgstr "諡。螟ァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:191 +msgid "Mooz" +msgstr "邵ョ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:192 +msgid "Set Default Scale" +msgstr "蜈縺ョ蛟咲紫" + +#: lipsync\LipSync\Editor/Form1Util.cs:193 +#: lipsync\LipSync\Editor/Form1Util.cs:197 +msgid "Move to Top" +msgstr "蜈磯ュ縺ク" + +#: lipsync\LipSync\Editor/Form1Util.cs:194 +#: lipsync\LipSync\Editor/Form1Util.cs:196 +msgid "Move to End" +msgstr "譛蠕後∈" + +#: lipsync\LipSync\Editor/Form1Util.cs:195 +msgid "Repeat play" +msgstr "繝ェ繝斐シ繝亥咲函" + +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1850 +msgid "Pause" +msgstr "荳譎ょ●豁「" + +#: lipsync\LipSync\Editor/Form1Util.cs:200 +msgid "Show VSQ Tracks Allways" +msgstr "VSQ繝医Λ繝繧ッ繧貞クク縺ォ陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:201 +msgid "Show Bars" +msgstr "蟆冗ッ縺ョ蠅逡後r陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:202 +msgid "Preview" +msgstr "繝励Ξ繝薙Η繝シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:204 +msgid "Sync with Time-table" +msgstr "繧ソ繧、繝繝繝シ繝悶Ν縺ィ繧キ繝ウ繧ッ繝ュ" + +#: lipsync\LipSync\Editor/Form1Util.cs:206 +#: lipsync\LipSync\Editor/Form1Util.cs:467 +msgid "Enable Preview" +msgstr "繝励Ξ繝薙Η繝シ繧定。ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:208 +#: lipsync\LipSync\Editor/Form1Util.cs:461 +msgid "Disable Preview" +msgstr "繝励Ξ繝薙Η繝シ繧帝撼陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:210 +msgid "Separate Preview Window" +msgstr "繝励Ξ繝薙Η繝シ繧偵え繧」繝ウ繝峨え縺ォ蛻髮「" + +#: lipsync\LipSync\Editor/Form1Util.cs:213 +msgid "Quantize" +msgstr "繧ッ繧ェ繝ウ繧ソ繧、繧コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:214 +msgid "Off" +msgstr "繧ェ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:215 +msgid "Triplet" +msgstr "3騾」隨ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:217 +msgid "List of Object" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝" + +#: lipsync\LipSync\Editor/Form1Util.cs:218 +msgid "Property" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医ョ繝励Ο繝代ユ繧」" + +#: lipsync\LipSync\Editor/Form1Util.cs:230 +msgid "Series Image" +msgstr "騾」逡ェ逕サ蜒" + +#: lipsync\LipSync\Editor/Form1Util.cs:248 +#: lipsync\LipSync\Editor/Form1Util.cs:282 +msgid "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" +msgstr "繝繝ウ繝昴サ諡榊ュ先ュ蝣ア繧剃ク頑嶌縺阪@縺セ縺吶ゅ%縺ョ謫堺ス懊ッ繧繧顔峩縺怜コ譚・縺セ縺帙s縺後∫カ壹¢縺セ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:411 +msgid "Hide object list" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医r髱櫁。ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:417 +msgid "Show object list" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝医r陦ィ遉コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:442 +msgid "(no name)" +msgstr "辟。鬘" + +#: lipsync\LipSync\Editor/Form1Util.cs:498 +msgid "Failed file saving" +msgstr "菫晏ュ倥↓螟ア謨励@縺セ縺励◆" + +#: lipsync\LipSync\Editor/Form1Util.cs:569 +msgid "Failed file reading" +msgstr "隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Width" +msgstr "蟷" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Height" +msgstr "鬮倥&" + +#: lipsync\LipSync\Editor/Form1Util.cs:1343 +msgid " has been changed. Do you wish to save changes to file?" +msgstr "縺ク縺ョ螟画峩繧剃ソ晏ュ倥@縺セ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1345 +msgid "Do you wish to save changes to file?" +msgstr "繝輔ぃ繧、繝ォ縺ォ菫晏ュ倥@縺セ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1986 +msgid "Progress" +msgstr "騾イ謐" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:167 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:229 +msgid "Text file(*.txt)|*.txt" +msgstr "繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ(*.txt)|*.txt" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" +msgstr "蛟咲紫繧貞・蜉帙@縺ヲ縺上□縺輔>(雋縺ョ蛟、繧貞・繧後k縺ィ蟾ヲ蜿ウ縺悟渚霆「縺輔l縺セ縺)" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +msgid "" +"...clearing entries of selected time-table.\n" +"Would you like to continue?" +msgstr "" +"驕ク謚槭@縺溘ヨ繝ゥ繝繧ッ荳翫ョ繧ィ繝ウ繝医Μ繧偵け繝ェ繧「縺励∪縺吶\n" +"繧医m縺励>縺ァ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +msgid "" +"...deleting selected character.\n" +"Would you like to continue?" +msgstr "" +"驕ク謚槭@縺溘く繝」繝ゥ繧ッ繧ソ繧偵け繝ェ繧「縺励∪縺吶\n" +"繧医m縺励>縺ァ縺吶°シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "" +"...deleting selected track.\n" +"Would you like to continue?" +msgstr "" +"驕ク謚槭@縺溘ヨ繝ゥ繝繧ッ繧貞炎髯、縺励∪縺吶\n" +"繧医m縺励>縺ァ縺吶°シ" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:75 +#: lipsync\LipSync\Editor/FormCommandHistory.cs:92 +msgid "Command History" +msgstr "繧ウ繝槭Φ繝峨ョ螻・豁エ" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:131 +#, csharp-format +msgid "Delete entry of 'Another Image' at Index {0}" +msgstr "縺昴ョ莉悶ョ繧、繝。繝シ繧ク縺ョ繧ィ繝ウ繝医Μ繧貞炎髯、: Index{0}" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:133 +#, csharp-format +msgid "Add entry of 'Another Image' at Index {0}" +msgstr "縺昴ョ莉悶ョ繧、繝。繝シ繧ク縺ョ繧ィ繝ウ繝医Μ繧定ソス蜉: Index{0}" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:135 +#, csharp-format +msgid "Edit entry of 'Another Image' at Track {0}, Index {1}" +msgstr "縺昴ョ莉悶ョ繧、繝。繝シ繧ク縺ョ繧ィ繝ウ繝医Μ繧堤キィ髮: Track{0}: Index {1}" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:139 +#, csharp-format +msgid "Delete telop '{0}'" +msgstr "蟄怜ケ輔r蜑企勁: '{0}'" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:141 +#, csharp-format +msgid "Edit telop '{0}' at Index {1}" +msgstr "蟄怜ケ輔r邱ィ髮: '{0}': Index {1}" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:143 +#, csharp-format +msgid "Add telop '{0}'" +msgstr "蟄怜ケ輔r霑ス蜉 '{0}'" + +#: lipsync\LipSync\Editor/FormObjectList.cs:45 +msgid "List of object" +msgstr "繧ェ繝悶ず繧ァ繧ッ繝医Μ繧ケ繝" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:102 +msgid "Directory" +msgstr "繝繧」繝ャ繧ッ繝医Μ" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:103 +msgid "Specify output range" +msgstr "蜃コ蜉帷ッ蝗イ繧呈欠螳" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:107 +msgid "Parser String" +msgstr "繝輔ぃ繧、繝ォ蜷阪ョ譖ク蠑" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:108 +msgid "Automatically Add Extension" +msgstr "諡。蠑オ蟄舌r閾ェ蜍輔〒霑ス蜉" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:109 +msgid "Image Format" +msgstr "逕サ蜒上ヵ繧ゥ繝シ繝槭ャ繝" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:187 +msgid "Sample File Name" +msgstr "繝輔ぃ繧、繝ォ蜷阪ョ繧オ繝ウ繝励Ν" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:197 +msgid "Error: Invalid parser string." +msgstr "繧ィ繝ゥ繝シ: 辟。蜉ケ縺ェ譖ク蠑乗欠螳壹〒縺" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:63 +msgid "detail" +msgstr "隧ウ邏ー" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:64 +msgid "configure frame rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝医ョ險ュ螳" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:65 +msgid "Frame rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:68 +msgid "denominator of frame rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻豈" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:69 +msgid "numerator of frame rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝医ョ蛻蟄" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:71 +msgid "import frame rate from AVI file" +msgstr "AVI繝輔ぃ繧、繝ォ縺九i繝輔Ξ繝シ繝繝ャ繝シ繝医ョ險ュ螳壹r蠑慕畑縺励∪縺" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:169 +msgid "failed getting frame rate" +msgstr "繝輔Ξ繝シ繝繝ャ繝シ繝医′蜿門セ励〒縺阪∪縺帙s縺ァ縺励◆" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:79 +msgid "Lip Assignment" +msgstr "蜿」縺ョ逕サ蜒丞牡蠖薙※" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:80 +msgid "Eye Assignment" +msgstr "逶ョ縺ョ逕サ蜒丞牡蠖薙※" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:81 +msgid "Eyebrow Assignment" +msgstr "逵峨ョ逕サ蜒丞牡蠖薙※" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:84 +msgid "Blend time for E_Default -> E_*" +msgstr "E_Default縺九iE_*縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:85 +msgid "Blend time for E_* -> E_Default" +msgstr "E_*縺九iE_Default縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:86 +msgid "Blend time for EB_Default -> EB_*" +msgstr "EB_Default縺九iEB_*縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:87 +msgid "Blend time for EB_* -> EB_Default" +msgstr "EB_*縺九iEB_Default縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:88 +msgid "Blend time for L_Default -> L_*" +msgstr "L_Default縺九iL_*縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:89 +msgid "Blend time for L_* -> L_Default" +msgstr "L_*縺九iL_Default縺ク縺ョ繝悶Ξ繝ウ繝画凾髢" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:70 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:73 +msgid "Title" +msgstr "繧ソ繧、繝医Ν" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:71 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:72 +msgid "Tag" +msgstr "繧ソ繧ー" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:74 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:126 +msgid "Up" +msgstr "荳" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:75 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:121 +msgid "Down" +msgstr "荳" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:76 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:119 +msgid "Add" +msgstr "霑ス蜉" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:79 +msgid "Select image file" +msgstr "逕サ蜒上r隱ュ霎シ縺ソ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:80 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:125 +msgid "Select transparent color" +msgstr "騾城℃濶イ繧定ィュ螳" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:84 +msgid "Character name" +msgstr "繧ュ繝」繝ゥ繧ッ繧ソ縺ョ蜷榊燕" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:86 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:122 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:851 +msgid "Change title" +msgstr "繧ソ繧、繝医Ν繧貞、画峩" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:88 +msgid "Selected image" +msgstr "驕ク謚槭&繧後◆逕サ蜒" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:91 +msgid "Open *.rsi" +msgstr "RSI繧帝幕縺" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:94 +msgid "Save as *.rsi" +msgstr "RSI縺ァ菫晏ュ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:95 +msgid "Save as XML" +msgstr "XML蠖「蠑上〒菫晏ュ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:98 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:103 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:166 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:180 +msgid "LipSync Character Config(*.lsc)|*.lsc" +msgstr "LipSync繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳(*.lsc)|*.lsc" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:107 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:123 +msgid "Reset image" +msgstr "逕サ蜒上r繝ェ繧サ繝繝" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:109 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:114 +msgid "RipSync Image(*.rsi)|*.rsi" +msgstr "RipSync繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳(*.rsi)|*.rsi" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:181 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:915 +msgid "LipSync Character Config(content.xml)|content.xml" +msgstr "LipSync繧ュ繝」繝ゥ繧ッ繧ソ險ュ螳(content.xml)|content.xml" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:551 +msgid "NOT editable" +msgstr "螟画峩縺ァ縺阪∪縺帙s" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:664 +msgid "Title of image" +msgstr "逕サ蜒上ョ繧ソ繧、繝医Ν" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:665 +msgid "Input the title of image" +msgstr "逕サ蜒上ョ繧ソ繧、繝医Ν繧貞・蜉帙@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:682 +msgid "This image title has been already registered" +msgstr "譌「縺ォ逋サ骭イ貂医∩縺ョ蜷榊燕縺ァ縺" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:852 +msgid "Input new title" +msgstr "譁ー縺励>繧ソ繧、繝医Ν繧貞・蜉帙@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/Previewer.cs:56 +msgid "Stop" +msgstr "蛛懈ュ「" + +#: lipsync\LipSync\Editor/Previewer.cs:57 +msgid "Stretch image" +msgstr "逕サ髱「縺ォ蜷医o縺帙k" + +#: lipsync\LipSync\Editor/Previewer.cs:58 +msgid "Specified size" +msgstr "謖螳壹し繧、繧コ" + +#: lipsync\LipSync\Editor/Property.cs:80 +msgid "Delte Delop" +msgstr "繝繝ュ繝繝励r蜑企勁" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:52 +msgid "Custom" +msgstr "繧ォ繧ケ繧ソ繝" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:53 +#: lipsync\LipSync\Editor/SelectCharacter.cs:57 +#: lipsync\LipSync\Editor/SelectCharacter.cs:58 +msgid "Built-in" +msgstr "繝薙Ν繝医う繝ウ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:54 +msgid "Select character to generate lip-sync" +msgstr "蜿」繝代け逕滓舌↓菴ソ逕ィ縺吶k繧ュ繝」繝ゥ繧ッ繧ソ繧帝∈謚槭@縺ヲ縺上□縺輔>" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:59 +msgid "Character selection" +msgstr "繧ュ繝」繝ゥ繧ッ繧ソ縺ョ驕ク謚" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:48 +msgid "Select track" +msgstr "繝医Λ繝繧ッ縺ョ驕ク謚" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:49 +msgid "import tempo and time-signal information" +msgstr "繝繝ウ繝昴→諡榊ュ舌ョ諠蝣ア繧貞叙繧願セシ繧" + +#: lipsync\LipSync\Editor/Winker.cs:62 +msgid "Wink interval (sec)" +msgstr "縺セ縺ー縺溘″縺ョ髢馴囈シ育ァ抵シ" + +#: lipsync\LipSync\Editor/Winker.cs:63 +msgid "Randomize" +msgstr "髢馴囈繧偵Λ繝ウ繝繝縺ォ縺吶k" + +#: lipsync\LipSync\Editor/Winker.cs:64 +msgid "Closed Eye" +msgstr "髢峨§逶ョ縺ョ逕サ蜒" + +#: lipsync\LipSync\Editor/Winker.cs:65 +msgid "In-between Image" +msgstr "荳ュ蜑イ繧顔判蜒" + +#: lipsync\LipSync\Editor/Winker.cs:66 +msgid "Eye-closing frames" +msgstr "髢峨§逶ョ縺ョ陦ィ遉コ繝輔Ξ繝シ繝謨ー" + +#: lipsync\LipSync\Editor/Winker.cs:69 +msgid "Limit start time" +msgstr "髢句ァ区凾蛻サ繧呈欠螳" + +#: lipsync\LipSync\Editor/Winker.cs:70 +msgid "Limit end time" +msgstr "邨ゆコ譎ょ綾繧呈欠螳" + +#: lipsync\LipSync\Editor/ZOrder.cs:44 +msgid "Select target item, and push [Up] or [Down] button" +msgstr "謠冗判鬆蠎上r螟画峩縺励◆縺繧ェ繝悶ず繧ァ繧ッ繝医r驕ク謚槭@縲∽ク翫サ荳九懊ち繝ウ縺ァ遘サ蜍輔&縺帙∪縺" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:199 +msgid "Image directory already exists. Would you like to overwrite them?" +msgstr "逕サ蜒上そ繝シ繝也畑縺ョ繝輔か繝ォ繝縺梧里縺ォ蟄伜惠縺励∪縺吶ゆク頑嶌縺阪@縺セ縺吶°シ" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:200 +msgid "warning" +msgstr "隴ヲ蜻" + +#: Boare.Lib.AppUtil/VersionInfo.cs:177 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:116 +#, csharp-format +msgid "About {0}" +msgstr "{0} 縺ォ縺、縺縺ヲ" + +#: Boare.Lib.AppUtil/VersionInfo.cs:186 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:117 +msgid "Credit" +msgstr "繧ッ繝ャ繧ク繝繝" + +#~ msgid "FLV" +#~ msgstr "FLV" +#~ msgid "FLV Progress" +#~ msgstr "FLV蜃コ蜉帑クュ" +#~ msgid "Video" +#~ msgstr "繝薙ョ繧ェ" +#~ msgid "insertion of wav file has failed" +#~ msgstr "wav繝輔ぃ繧、繝ォ縺ョ蝓九a霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆" +#~ msgid "Disable preview" +#~ msgstr "繝励Ξ繝薙Η繝シ繧帝撼陦ィ遉コ" +#~ msgid "Enable preview" +#~ msgstr "繝励Ξ繝薙Η繝シ繧定。ィ遉コ" +#~ msgid "Edit motion curve" +#~ msgstr "螟我ス阪ョ蛻カ蠕。" +#~ msgid "already exists." +#~ msgstr "縺ッ譌「縺ォ蟄伜惠縺励∪縺吶" +#~ msgid "Add telop at Index {0}" +#~ msgstr "蟄怜ケ輔r霑ス蜉: Index {0}" +#~ msgid "Copy time-line" +#~ msgstr "繧ソ繧、繝繝ゥ繧、繝ウ繧偵さ繝斐シ" +#~ msgid "Generate telop from VSQ" +#~ msgstr "VSQ縺九i蟄怜ケ慕函謌" +#~ msgid "Go to preview" +#~ msgstr "繝励Ξ繝薙Η繝シ縺ォ遘サ蜍" +#~ msgid "Input frame rate" +#~ msgstr "繝薙ョ繧ェ縺ョ繝輔Ξ繝シ繝繝ャ繝シ繝医r蜈・蜉帙@縺ヲ縺上□縺輔>" +#~ msgid "Interrupt" +#~ msgstr "蜑イ繧願セシ縺セ縺帙k" +#~ msgid "" +#~ "Image title can't be set to \"base\", \"a\", \"aa\", \"i\", \"u\", \"e\", " +#~ "\"o\", \"xo\", \"nn\"" +#~ msgstr "" +#~ "繧ュ繝」繝ゥ繧ッ繧ソ逕サ蜒上ョ繧ソ繧、繝医Ν縺ッ縲|ase, a, aa, i, u, e, o, xo, nn莉・螟悶ョ蜷榊燕縺ァ縺" +#~ "繧句ソ隕√′縺ゅj縺セ縺" +#~ msgid "Object name" +#~ msgstr "繧ェ繝悶ず繧ァ繧ッ繝亥錐" +#~ msgid "" +#~ "AVI file size will exceed 2Gbyte.\n" +#~ "Do you wish to continue?" +#~ msgstr "" +#~ "縺薙ョ縺セ縺セAVI繧貞コ蜉帙☆繧九→繝輔ぃ繧、繝ォ繧オ繧、繧コ縺2Gbyte繧定カ縺医k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶\n" +#~ "蜃コ蜉帙r邯壹¢縺セ縺吶°シ" +#~ msgid "Overwrite" +#~ msgstr "荳頑嶌縺" +#~ msgid "Paste time-line" +#~ msgstr "繧ソ繧、繝繝ゥ繧、繝ウ繧定イシ莉" +#~ msgid "(Non-compressed)" +#~ msgstr "(辟。蝨ァ邵ョ)" +#~ msgid "select configuration item from the list box below" +#~ msgstr "荳九ョ繝ェ繧ケ繝医懊ャ繧ッ繧ケ縺九i險ュ螳壹☆繧矩逶ョ繧帝∈謚槭@縺セ縺" +#~ msgid "Show preview" +#~ msgstr "繝励Ξ繝薙Η繝シ陦ィ遉コ" +#~ msgid "Specify paste mode" +#~ msgstr "雋シ莉倥¢繝「繝シ繝峨r謖螳壹@縺ヲ縺上□縺輔>" +#~ msgid "Window" +#~ msgstr "繧ヲ繧」繝ウ繝峨え" + diff --git a/trunk/LipSync/makefile b/trunk/LipSync/makefile new file mode 100644 index 0000000..9b55edf --- /dev/null +++ b/trunk/LipSync/makefile @@ -0,0 +1,17 @@ +OPT= +RM=rm +CP=cp +LipSync.exe: Boare.Lib.Media.dll Boare.Lib.Vsq.dll Boare.Lib.AppUtil.dll IPlugin.dll Boare.Lib.Swf.dll bocoree.dll Properties/Resources.resources + gmcs -unsafe+ -recurse:*.cs -target:exe -out:LipSync.exe -warn:0 -define:MONO -codepage:utf8 \ + -resource:Properties/Resources.resources,LipSync.Properties.Resources.resources \ + -r:System.Windows.Forms,System.Drawing,System.Web \ + -r:Boare.Lib.Media.dll,Boare.Lib.Vsq.dll,Boare.Lib.AppUtil.dll,IPlugin.dll,Boare.Lib.Swf,bocoree.dll + +Properties/Resources.resources: Properties/Resources.resx + perl EditResx.pl Properties/Resources.resx + cd Properties && resgen Resources_.resx Resources.resources + $(RM) Properties/Resources_.resx + +clean: + $(RM) LipSync.exe Boare.Lib.Media.dll Boare.Lib.Vsq.dll Boare.Lib.AppUtil.dll IPlugin.dll Boare.Lib.Swf.dll \ + bocoree.dll Background.dll NicoComment.dll VFlip.dll diff --git a/trunk/LipSync/readme_ja.txt b/trunk/LipSync/readme_ja.txt new file mode 100644 index 0000000..761c0a1 --- /dev/null +++ b/trunk/LipSync/readme_ja.txt @@ -0,0 +1,31 @@ +*はじめに* + LipSyncは、クリプトン・フューチャー・メディア株式会社のDTM製品 + 「VOCALOID2キャラクターボーカルシリーズ」で使用されるシーケンス + ファイル(*.vsq)を解析し、口パク動画の作成を支援するツールです。 + +*インストール* + .NET Framework version 2.0以降のランタイム,または相当する実行環境 + が必要です。これらを別途インストールしてから、本ツールをご使用ください。 + 初回の起動直後は、表示言語が英語になっているので、日本語に切り替えたい場合は + 「Tool」->「Option」と選んだ後に出てくるダイアログの「User Config」タブの + 「Language」を「ja」に変更して下さい。 + +*実行環境の入手先* + Windows: + .NET Framework : http://www.microsoft.com/japan/msdn/netframework/downloads/ + Windows, Macintosh, Linux, etc.: + mono .NET : http://www.mono-project.com/ + +*アンインストール* + ディレクトリごと削除してください。 + +*注意事項* + LipSyncはフリーソフトです。著作権はkbinaniにあります。また、 + LipSyncは有用であることを願って頒布されますが、 全くの無保証です。各 + 自の責任で使用してください。 + +*連絡先* + 開発拠点 : http://sourceforge.jp/projects/lipsync/ + 最新版配布元URL : http://www32.atwiki.jp/lipsync/ + 連絡用掲示板 : http://joy.atbbs.jp/lipsync/ + 上記掲示板が使えない場合の連絡先 : kbinani@msn.com diff --git a/trunk/LipSync/zh-CN.po b/trunk/LipSync/zh-CN.po new file mode 100644 index 0000000..124f970 --- /dev/null +++ b/trunk/LipSync/zh-CN.po @@ -0,0 +1,1270 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-09 00:18+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: kbinani \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Chinese\n" +"X-Poedit-Country: CHINA\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-Basepath: ..\\..\\\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-SearchPath-0: lipsync\\LipSync\\Editor\n" +"X-Poedit-SearchPath-1: lipsync\\LipSync\\Common\n" +"X-Poedit-SearchPath-2: Boare.Lib.AppUtil\n" + +#: lipsync\LipSync\Editor/AviOutput.cs:59 +msgid "Cancel" +msgstr "蜈ウ髣ュ" + +#: lipsync\LipSync\Editor/AviOutput.cs:60 +msgid "Save" +msgstr "菫晏ュ" + +#: lipsync\LipSync\Editor/AviOutput.cs:61 +msgid "File Name" +msgstr "譁莉カ蜷" + +#: lipsync\LipSync\Editor/AviOutput.cs:63 +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Audio" +msgstr "髻ウ鬚" + +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Set the path of ffmpeg to enable this option" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:70 +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "FLV and MP4" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "Set the path of mencoder and ffmpeg to enable this option" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:76 +msgid "Convert to FLV" +msgstr "霓ャ荳コflv" + +#: lipsync\LipSync\Editor/AviOutput.cs:77 +msgid "Convert to MP4" +msgstr "霓ャ荳コmp4" + +#: lipsync\LipSync\Editor/AviOutput.cs:78 +msgid "Merge WAVE to AVI" +msgstr "蜷亥ケカWAVE蜥窟VI" + +#: lipsync\LipSync\Editor/AviOutput.cs:79 +msgid "Delete Intermediate File" +msgstr "蛻髯、荳エ譌カ譁莉カ" + +#: lipsync\LipSync\Editor/AviOutput.cs:80 +msgid "Video Compression" +msgstr "隗鬚大視郛ゥ" + +#: lipsync\LipSync\Editor/AviOutput.cs:81 +msgid "Specify Output Range" +msgstr "謖螳夊セ灘コ闌蝗エ" + +#: lipsync\LipSync\Editor/AviOutput.cs:82 +msgid "Start" +msgstr "蠑蟋" + +#: lipsync\LipSync\Editor/AviOutput.cs:83 +msgid "End" +msgstr "扈捺據" + +#: lipsync\LipSync\Editor/AviOutput.cs:84 +msgid "Add Alpha" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:118 +#, csharp-format +msgid "Directory {0} does not exist." +msgstr "逶ョ蠖 {0} 荳榊ュ伜惠縲" + +#: lipsync\LipSync\Editor/AviOutput.cs:119 +#: lipsync\LipSync\Editor/AviOutput.cs:140 +msgid "Error" +msgstr "髞呵ッッ" + +#: lipsync\LipSync\Editor/AviOutput.cs:127 +#, csharp-format +msgid "" +"{0} already exists.\n" +"Do you want to replace it?" +msgstr "" +"{0} 蟾イ扈丞ュ伜惠縲\n" +"譏ッ蜷ヲ譖ソ謐「シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:139 +msgid "Invalid value has been entered" +msgstr "譌謨域焚蛟シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "Avi file(*.avi)|*.avi" +msgstr "AVI 譁莉カ (*.avi)|*.avi" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "All Files(*.*)|*.*" +msgstr "謇譛臥噪譁莉カ螟ケ (*.*)|*.*" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:88 +msgid "Edit Motion Curve" +msgstr "郛冶セ醍ァサ蜉ィ譖イ郤ソ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:89 +msgid "Close" +msgstr "蜈ウ髣ュ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:90 +msgid "File" +msgstr "譁莉カ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:91 +msgid "Redo" +msgstr "驥榊★" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:92 +msgid "Undo" +msgstr "謦、髞" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:93 +msgid "Edit" +msgstr "郛冶セ" + +#: lipsync\LipSync\Editor/EditEntry.cs:58 +msgid "ON time (sec)" +msgstr "ON 譌カ髣エ (遘 )" + +#: lipsync\LipSync\Editor/EditEntry.cs:59 +msgid "OFF time (sec)" +msgstr "OFF 譌カ髣エ (遘 )" + +#: lipsync\LipSync\Editor/EditEntry.cs:61 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:101 +msgid "OK" +msgstr "遑ョ螳" + +#: lipsync\LipSync\Editor/EditEntry.cs:62 +msgid "Use this value" +msgstr "菴ソ逕ィ霑吩クェ謨ー蛟シ" + +#: lipsync\LipSync\Editor/EditEntry.cs:63 +msgid "Expandable range of this entry" +msgstr "蜿ッ蜿俶峩謨ー蛟シ逧闌蝗エ" + +#: lipsync\LipSync\Editor/EditEntry.cs:64 +msgid "Numeric entry" +msgstr "謨ー蛟シ霎灘・" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:103 +msgid "Language" +msgstr "隸ュ險" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:104 +#: lipsync\LipSync\Editor/Form1Util.cs:130 +msgid "Option" +msgstr "騾蛾。ケ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:106 +msgid "User Config" +msgstr "逕ィ謌キ隶セ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:107 +msgid "Appearance" +msgstr "陦ィ諠" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:108 +msgid "lip-sync Option" +msgstr "蝌エ蠖「蜷梧ュ・騾蛾。ケ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:109 +msgid "System" +msgstr "邉サ扈" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:111 +msgid "Title of timeline" +msgstr "譌カ髣エ霓エ譬鬚" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:112 +msgid "VSQ Entry" +msgstr "VSQ 鬘ケ逶ョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:113 +msgid "Plugin Entry" +msgstr "謠剃サカ鬘ケ逶ョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:114 +msgid "Another Entry" +msgstr "蜈カ莉夜。ケ逶ョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:115 +msgid "Entry height (pixel)" +msgstr "鬘ケ逶ョ鬮伜コヲ (雎。邏)" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:116 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:117 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:118 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:119 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:129 +msgid "Change" +msgstr "蜿俶峩" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:120 +msgid "Check phonetic symbol to configure detailed mouth shape control" +msgstr "譽鬪悟書髻ウ隨ヲ蜿キシ瑚ッヲ扈隶セ螳壼亢蠖「蜿よ焚" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:121 +msgid "Close mouth before pronunciation" +msgstr "蝨ィ蜿鷹浹荵句燕髣ュ荳雁亢" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:122 +msgid "\"i\" shaped mouth before pronunciation" +msgstr "蝨ィ蜿鷹浹荵句燕逕滓絶彿窶晉噪蝌エ蠖「" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:123 +msgid "\"u\" shaped mouth before pronunciation" +msgstr "蝨ィ蜿鷹浹荵句燕逕滓絶忖窶晉噪蝌エ蠖「" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:124 +msgid "Color" +msgstr "驟崎牡" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:125 +msgid "Design" +msgstr "隶セ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:126 +msgid "Path of ffmpeg" +msgstr "ffmpeg菴咲スョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:127 +msgid "Path of mencoder" +msgstr "mencoder菴咲スョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:128 +msgid "Font" +msgstr "蟄怜梛" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:130 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:135 +msgid "Another settings" +msgstr "蜈カ莉冶ョセ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:131 +msgid "Close mouth when same vowels repeated" +msgstr "蜷御ク蜈髻ウ霑樒サュ逧譌カ蛟呻シ碁溜荳雁亢" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:132 +msgid "Encoder/Decoder" +msgstr "郛也∝勣 /dekoda" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:133 +msgid "Generate character automaticaly when importing vsq" +msgstr "VSQ霎灘・譌カ閾ェ蜉ィ逕滓仙ュ礼ャヲ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:134 +msgid "Threshold silence length(sec)" +msgstr "蛻、螳壽弍霑樒サュ髻ウ譌カ荳榊書髻ウ逧譌カ髣エ (遘 )" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:136 +msgid "Use preview-enabled dialog in character selection" +msgstr "騾画叫蟄礼ャヲ譌カ菴ソ逕ィ蜿ッ莉・鬚隗育噪蟇ケ隸" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:137 +msgid "Reload language configurations" +msgstr "蛻キ譁ー隸ュ險隶セ螳壽枚莉カ螟ケ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:138 +msgid "Operation" +msgstr "謫堺ス" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:139 +msgid "mouse wheel rate" +msgstr "鮠譬貊題スョ騾溷コヲ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:140 +msgid "Fix cursor to center in Sync mode" +msgstr "" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:281 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:305 +msgid "Executable file(*.exe)|*.exe" +msgstr "蜿ッ謇ァ陦梧枚莉カ(*.exe)|*.exe" + +#: lipsync\LipSync\Editor/Form1.cs:604 +#: lipsync\LipSync\Editor/Form1.cs:2011 +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Video size configuration" +msgstr "隶セ螳夊ァ鬚大崟蜒丞、ァ蟆" + +#: lipsync\LipSync\Editor/Form1.cs:612 +msgid "Read from VSQ file" +msgstr "莉 VSQ 譁莉カ螟ケ隸サ蜿" + +#: lipsync\LipSync\Editor/Form1.cs:616 +msgid "Edit character" +msgstr "郛冶セ題ァ定牡" + +#: lipsync\LipSync\Editor/Form1.cs:619 +#: lipsync\LipSync\Editor/Form1.cs:652 +#: lipsync\LipSync\Editor/Form1.cs:668 +msgid "Preview image" +msgstr "蝗セ蜒城「隗" + +#: lipsync\LipSync\Editor/Form1.cs:620 +#: lipsync\LipSync\Editor/Form1.cs:677 +#: lipsync\LipSync\Editor/Form1.cs:737 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:964 +msgid "Image placement" +msgstr "隶セ螳壼崟蜒丈ス咲スョ" + +#: lipsync\LipSync\Editor/Form1.cs:621 +#: lipsync\LipSync\Editor/Form1.cs:680 +#: lipsync\LipSync\Editor/Form1.cs:740 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Scale setting" +msgstr "隶セ螳壼、ァ蟆" + +#: lipsync\LipSync\Editor/Form1.cs:623 +msgid "Generate wink" +msgstr "逵ィ逵シ逧逕滓" + +#: lipsync\LipSync\Editor/Form1.cs:627 +#: lipsync\LipSync\Editor/Form1.cs:791 +msgid "Delete" +msgstr "蛻髯、" + +#: lipsync\LipSync\Editor/Form1.cs:630 +msgid "Add Telop" +msgstr "豺サ蜉蟄怜ケ" + +#: lipsync\LipSync\Editor/Form1.cs:633 +msgid "Add track" +msgstr "豺サ蜉霓ィ驕" + +#: lipsync\LipSync\Editor/Form1.cs:643 +msgid "Generate Lipsync from this track" +msgstr "莉手ソ吩クェ霓ィ驕鍋函謌仙亢蠖「" + +#: lipsync\LipSync\Editor/Form1.cs:649 +#: lipsync\LipSync\Editor/Form1.cs:660 +#: lipsync\LipSync\Editor/Form1.cs:691 +msgid "Note ON from here" +msgstr "莉手ソ咎瑚セ灘・髻ウ隨ヲ" + +#: lipsync\LipSync\Editor/Form1.cs:664 +msgid "Set image" +msgstr "謖螳壼崟蜒" + +#: lipsync\LipSync\Editor/Form1.cs:671 +msgid "Change image" +msgstr "蜿俶峩蝗セ蜒" + +#: lipsync\LipSync\Editor/Form1.cs:675 +#: lipsync\LipSync\Editor/Form1.cs:735 +msgid "Image" +msgstr "蝗セ蜒" + +#: lipsync\LipSync\Editor/Form1.cs:702 +#: lipsync\LipSync\Editor/Form1.cs:775 +msgid "Paste" +msgstr "邊倩エエ" + +#: lipsync\LipSync\Editor/Form1.cs:716 +msgid "Note OFF" +msgstr "謦、髞髻ウ隨ヲ" + +#: lipsync\LipSync\Editor/Form1.cs:718 +msgid "Image Preview" +msgstr "譏セ遉コ鬚隗" + +#: lipsync\LipSync\Editor/Form1.cs:720 +msgid "Numeric Entry" +msgstr "謨ー蛟シ霎灘・" + +#: lipsync\LipSync\Editor/Form1.cs:722 +msgid "Expand" +msgstr "謾セ螟ァ" + +#: lipsync\LipSync\Editor/Form1.cs:730 +msgid "Set Image" +msgstr "謖螳壼崟蜒" + +#: lipsync\LipSync\Editor/Form1.cs:732 +msgid "Preview Image" +msgstr "蝗セ蜒城「隗" + +#: lipsync\LipSync\Editor/Form1.cs:733 +msgid "Change Image" +msgstr "蜿俶峩蝗セ蜒" + +#: lipsync\LipSync\Editor/Form1.cs:749 +msgid "Plugin config. of this entry" +msgstr "豁、鬘ケ逶ョ逧謠剃サカ隶セ螳" + +#: lipsync\LipSync\Editor/Form1.cs:755 +#: lipsync\LipSync\Editor/Form1.cs:767 +msgid "Copy" +msgstr "螟榊宛" + +#: lipsync\LipSync\Editor/Form1.cs:756 +msgid "Cut" +msgstr "蜑ェ蛻" + +#: lipsync\LipSync\Editor/Form1.cs:757 +msgid "Split Entry" +msgstr "蛻遖サ蜈・蜿」" + +#: lipsync\LipSync\Editor/Form1.cs:765 +msgid "Timeline" +msgstr "譌カ髣エ霓エ" + +#: lipsync\LipSync\Editor/Form1.cs:771 +msgid "Copy On/Off inverted" +msgstr "ON/OFF 鄙サ霓ャ螟榊宛" + +#: lipsync\LipSync\Editor/Form1.cs:779 +msgid "Import from TEXT" +msgstr "莉取枚譛ャ隸サ蜿" + +#: lipsync\LipSync\Editor/Form1.cs:780 +msgid "Export to TEXT" +msgstr "霎灘コ譁譛ャ" + +#: lipsync\LipSync\Editor/Form1.cs:793 +msgid "Delete entries" +msgstr "蛻髯、霓ィ驕謎ク顔噪蜀螳ケ" + +#: lipsync\LipSync\Editor/Form1.cs:797 +msgid "Shift this time-line" +msgstr "遘サ蜉ィ譌カ髣エ霓エ" + +#: lipsync\LipSync\Editor/Form1.cs:1367 +#: lipsync\LipSync\Editor/Form1.cs:1407 +#: lipsync\LipSync\Editor/Form1.cs:1603 +msgid "VSQ Tracks" +msgstr "VSQ 霓ィ驕" + +#: lipsync\LipSync\Editor/Form1.cs:1378 +msgid "Character" +msgstr "隗定牡" + +#: lipsync\LipSync\Editor/Form1.cs:1385 +msgid "Telop" +msgstr "蟄怜ケ" + +#: lipsync\LipSync\Editor/Form1.cs:1392 +msgid "Another Images" +msgstr "蜈カ莉門崟蜒" + +#: lipsync\LipSync\Editor/Form1.cs:1399 +#: lipsync\LipSync\Editor/Form1.cs:1577 +msgid "Plugin" +msgstr "謠剃サカ" + +#: lipsync\LipSync\Editor/Form1.cs:1540 +msgid "LipSync" +msgstr "LipSync" + +#: lipsync\LipSync\Editor/Form1.cs:1605 +#: lipsync\LipSync\Editor/Form1.cs:2394 +msgid "Another images" +msgstr "蜈カ莉門崟蜒" + +#: lipsync\LipSync\Editor/Form1.cs:1952 +msgid "" +"Initialization of video compression failed.\n" +"This video codec may require image width in multiples of certain number." +msgstr "" +"隗鬚大視郛ゥ逧蛻晏ァ句喧螟ア雍・\n" +"豁、隗」遐∝勣蜿ッ閭ス髴隕∫音螳壽ッ比セ狗噪蝗セ蜒丞ーコ蟇ク" + +#: lipsync\LipSync\Editor/Form1.cs:1963 +msgid "AVI Progress" +msgstr "AVI 霎灘コ荳ュ" + +#: lipsync\LipSync\Editor/Form1.cs:2011 +msgid "Input video length in second" +msgstr "霎灘・蠖ア蜒冗噪髟ソ蠎ヲシ育ァ抵シ" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Shift all time-tables" +msgstr "謨エ菴鍋ァサ蜉ィ譌カ髣エ霓エ" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Input shift time in second (you can enter minus value)" +msgstr "霎灘・遘サ蜉ィ謨ー驥 (蜿ッ莉・霎灘・雍溷シ )" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +#: lipsync\LipSync\Editor/Form1.cs:2689 +msgid "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" +msgstr "霑吩クェ謫堺ス應シ夊ヲ逶匁園譛臥鴫蟄倩スィ驕薙ょケカ荳疲裏豕墓彫髞縲らサァ扈ュ蜷暦シ" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +msgid "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" +msgstr "シ亥承蜃サ縲祁SQ 霓ィ驕薙埼画叫縲御サ VSQ 譁莉カ螟ケ隸サ蜿悶肴キサ蜉荳荳ェ譁ー霓ィ驕難シ" + +#: lipsync\LipSync\Editor/Form1.cs:2300 +#: lipsync\LipSync\Editor/Form1.cs:2690 +#: lipsync\LipSync\Editor/Form1Util.cs:249 +#: lipsync\LipSync\Editor/Form1Util.cs:283 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "Confirmation" +msgstr "遑ョ隶、" + +#: lipsync\LipSync\Editor/Form1.cs:2313 +#: lipsync\LipSync\Editor/Form1Util.cs:150 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:931 +msgid "VOCALOID2 Sequence File(*.vsq)|*.vsq" +msgstr "VOCALOID2霑樒サュ譁莉カ(*.vsq)|*.vsq" + +#: lipsync\LipSync\Editor/Form1.cs:2314 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:932 +msgid "UTAU Script File(*.ust)|*.ust" +msgstr "" + +#: lipsync\LipSync\Editor/Form1.cs:2436 +#: lipsync\LipSync\Editor/Form1.cs:2569 +msgid "Specify the index of target character" +msgstr "" + +#: lipsync\LipSync\Editor/Form1.cs:2707 +#: lipsync\LipSync\Editor/Form1.cs:3134 +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1907 +msgid "Play" +msgstr "謦ュ謾セ" + +#: lipsync\LipSync\Editor/Form1.cs:2711 +msgid "File not found" +msgstr "譁莉カ譛ェ謇セ蛻ー" + +#: lipsync\LipSync\Editor/Form1.cs:2730 +#: lipsync\LipSync\Editor/Form1.cs:2758 +#: lipsync\LipSync\Editor/Form1.cs:2770 +msgid "Extension must be *.lse" +msgstr "*.譌豕募、逅lse莉・螟也噪譁莉カ譬シ蠑" + +#: lipsync\LipSync\Editor/Form1.cs:2895 +msgid "Expand All" +msgstr "蜈ィ驛ィ螻募シ" + +#: lipsync\LipSync\Editor/Form1.cs:2896 +msgid "Fold All" +msgstr "蜈ィ驛ィ蜷域兇" + +#: lipsync\LipSync\Editor/Form1.cs:3138 +#, fuzzy +msgid "Audio File(*.mp3;*.wav)|*.mp3;*.wav" +msgstr "螢ー髻ウ譁莉カ(*.mp3,*.wav)|*.mp3;*.wav" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "Go to specified frame" +msgstr "遘サ蜉ィ蛻ー謖螳壼クァ" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "please input frame index" +msgstr "隸キ霎灘・譌カ髣エ霓エ邏「蠑" + +#: lipsync\LipSync\Editor/Form1.cs:3166 +msgid "invalid frame index" +msgstr "霑吩クェ譌カ髣エ霓エ邏「蠑穂ク榊ュ伜惠" + +#: lipsync\LipSync\Editor/Form1.cs:3702 +msgid "Series Image Progress" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:104 +msgid "Open" +msgstr "謇灘シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:106 +msgid "Save As" +msgstr "蜿ヲ蟄倅クコ" + +#: lipsync\LipSync\Editor/Form1Util.cs:107 +msgid "Import" +msgstr "蟇シ蜈・" + +#: lipsync\LipSync\Editor/Form1Util.cs:108 +msgid "from RipSync data" +msgstr "RipSync 謨ー謐ョ" + +#: lipsync\LipSync\Editor/Form1Util.cs:109 +msgid "Open VSQ/UST file" +msgstr "謇灘シ VSQ/UST" + +#: lipsync\LipSync\Editor/Form1Util.cs:110 +msgid "Exit" +msgstr "騾蜃コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:111 +msgid "Script for VOCALOMARK" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:115 +msgid "Help" +msgstr "蟶ョ蜉ゥ" + +#: lipsync\LipSync\Editor/Form1Util.cs:116 +msgid "Plugin Information" +msgstr "謠剃サカ菫。諱ッ" + +#: lipsync\LipSync\Editor/Form1Util.cs:117 +msgid "About LipSync" +msgstr "蜈ウ莠 LipSync" + +#: lipsync\LipSync\Editor/Form1Util.cs:118 +msgid "Debug" +msgstr "謨髫懈賜髯、" + +#: lipsync\LipSync\Editor/Form1Util.cs:119 +msgid "Edit Character" +msgstr "郛冶セ題ァ定牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:120 +msgid "Flip Images Horizontaly" +msgstr "蟾ヲ蜿ウ鄙サ霓ャ蝗セ蜒" + +#: lipsync\LipSync\Editor/Form1Util.cs:124 +msgid "Video Size" +msgstr "蝗セ蜒丞、ァ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:125 +msgid "Frame Rate" +msgstr "蟶ァ騾溽紫" + +#: lipsync\LipSync\Editor/Form1Util.cs:126 +msgid "Z order" +msgstr "z霓エ鬘コ蠎" + +#: lipsync\LipSync\Editor/Form1Util.cs:127 +msgid "Video Length" +msgstr "隗鬚鷹柄蠎ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:128 +msgid "Shift All Time-tables" +msgstr "謨エ菴鍋ァサ蜉ィ譌カ髣エ霓エ" + +#: lipsync\LipSync\Editor/Form1Util.cs:129 +msgid "Tool" +msgstr "蟾・蜈キ" + +#: lipsync\LipSync\Editor/Form1Util.cs:131 +msgid "Plugin Config" +msgstr "謠剃サカ隶セ螳" + +#: lipsync\LipSync\Editor/Form1Util.cs:132 +msgid "Add Empty Character" +msgstr "豺サ蜉遨コ逋ス隗定牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:134 +msgid "Generate Avi" +msgstr "霎灘コAVI" + +#: lipsync\LipSync\Editor/Form1Util.cs:135 +msgid "Chose Sound File" +msgstr "蜷梧慮謦ュ謾セ逧髻ウ荵" + +#: lipsync\LipSync\Editor/Form1Util.cs:136 +msgid "Go to Specified Frame" +msgstr "遘サ蜉ィ蛻ー謖螳壼クァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:137 +msgid "Stop Writing Avi" +msgstr "荳ュ譁ュ霎灘コavi" + +#: lipsync\LipSync\Editor/Form1Util.cs:138 +msgid "Background Color" +msgstr "閭梧勹鬚懆牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:140 +msgid "Generate Raw Avi" +msgstr "霎灘コ譌蜴狗シゥ逧 AVI" + +#: lipsync\LipSync\Editor/Form1Util.cs:141 +msgid "Export" +msgstr "蟇シ蜃コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:142 +msgid "Script for H@TWUNEBENCH" +msgstr "H@TWUNEBENCH閼壽悽" + +#: lipsync\LipSync\Editor/Form1Util.cs:144 +msgid "Show Object List" +msgstr "譏セ遉コ蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:146 +msgid "Hide Object List" +msgstr "蜈ウ髣ュ蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:148 +msgid "Bug Report" +msgstr "髞呵ッッ謚・蜻" + +#: lipsync\LipSync\Editor/Form1Util.cs:158 +msgid "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" +msgstr "蝗セ迚譁莉カ(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" + +#: lipsync\LipSync\Editor/Form1Util.cs:159 +msgid "Avi File(*.avi)|*.avi" +msgstr "AVI 譁莉カ (*.avi)|*.avi" + +#: lipsync\LipSync\Editor/Form1Util.cs:167 +msgid "LipSync Data File(*.lse)|*.lse" +msgstr "LipSync 謨ー謐ョ隶セ螳 (*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:175 +msgid "LipSync Data file(*.lse)|*.lse" +msgstr "LipSync 謨ー謐ョ隶セ螳 (*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:183 +msgid "Real Time \"lipsync\"" +msgstr "蜊ウ譌カ蜿」蝙句酔豁・" + +#: lipsync\LipSync\Editor/Form1Util.cs:184 +msgid "End Repeat Here" +msgstr "謖螳夐肴眺扈捺據菴咲スョ" + +#: lipsync\LipSync\Editor/Form1Util.cs:185 +msgid "Start Repeat Here" +msgstr "謖螳夐肴眺蠑蟋倶ス咲スョ" + +#: lipsync\LipSync\Editor/Form1Util.cs:186 +msgid "Reset Repeat region" +msgstr "驥咲スョ驥肴眺闌蝗エ" + +#: lipsync\LipSync\Editor/Form1Util.cs:189 +msgid "View" +msgstr "隗蝗セ" + +#: lipsync\LipSync\Editor/Form1Util.cs:190 +msgid "Zoom" +msgstr "謇ゥ螟ァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:191 +msgid "Mooz" +msgstr "郛ゥ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:192 +msgid "Set Default Scale" +msgstr "鮟倩ョ、螟ァ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:193 +#: lipsync\LipSync\Editor/Form1Util.cs:197 +msgid "Move to Top" +msgstr "蝗槫芦蠑螟エ" + +#: lipsync\LipSync\Editor/Form1Util.cs:194 +#: lipsync\LipSync\Editor/Form1Util.cs:196 +msgid "Move to End" +msgstr "霓ャ蛻ー扈灘ーセ" + +#: lipsync\LipSync\Editor/Form1Util.cs:195 +msgid "Repeat play" +msgstr "驥榊、肴眺謾セ" + +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1850 +msgid "Pause" +msgstr "證ょ●" + +#: lipsync\LipSync\Editor/Form1Util.cs:200 +msgid "Show VSQ Tracks Allways" +msgstr "諤サ譏ッ譏セ遉コ VSQ 霓ィ驕" + +#: lipsync\LipSync\Editor/Form1Util.cs:201 +msgid "Show Bars" +msgstr "譏セ遉コ譬シ譬" + +#: lipsync\LipSync\Editor/Form1Util.cs:202 +msgid "Preview" +msgstr "鬚隗" + +#: lipsync\LipSync\Editor/Form1Util.cs:204 +msgid "Sync with Time-table" +msgstr "荳取慮髣エ霓エ蜷梧ュ・" + +#: lipsync\LipSync\Editor/Form1Util.cs:206 +#: lipsync\LipSync\Editor/Form1Util.cs:467 +msgid "Enable Preview" +msgstr "譏セ遉コ鬚隗" + +#: lipsync\LipSync\Editor/Form1Util.cs:208 +#: lipsync\LipSync\Editor/Form1Util.cs:461 +msgid "Disable Preview" +msgstr "蜈ウ髣ュ鬚隗" + +#: lipsync\LipSync\Editor/Form1Util.cs:210 +msgid "Separate Preview Window" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:213 +msgid "Quantize" +msgstr "驥丞喧" + +#: lipsync\LipSync\Editor/Form1Util.cs:214 +msgid "Off" +msgstr "蜈ウ謗" + +#: lipsync\LipSync\Editor/Form1Util.cs:215 +msgid "Triplet" +msgstr "荳芽ソ樣浹" + +#: lipsync\LipSync\Editor/Form1Util.cs:217 +msgid "List of Object" +msgstr "蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:218 +msgid "Property" +msgstr "蟇ケ雎。迚ケ諤ァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:230 +msgid "Series Image" +msgstr "霑樒サュ逧蝗セ蜒乗枚莉カ" + +#: lipsync\LipSync\Editor/Form1Util.cs:248 +#: lipsync\LipSync\Editor/Form1Util.cs:282 +msgid "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" +msgstr "隕逶也鴫譛画牛蟄仙柱諡榊捷シ悟ケカ荳疲裏豕墓彫髞シ檎サァ扈ュ蜷暦シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:411 +msgid "Hide object list" +msgstr "蜈ウ髣ュ蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:417 +msgid "Show object list" +msgstr "譏セ遉コ蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:442 +msgid "(no name)" +msgstr "譌譬鬚" + +#: lipsync\LipSync\Editor/Form1Util.cs:498 +msgid "Failed file saving" +msgstr "譁莉カ菫晏ュ伜、ア雍・ " + +#: lipsync\LipSync\Editor/Form1Util.cs:569 +msgid "Failed file reading" +msgstr "譁莉カ隸サ蜿門、ア雍・" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Width" +msgstr "螳ス蠎ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Height" +msgstr "鬮伜コヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1343 +msgid " has been changed. Do you wish to save changes to file?" +msgstr "譁莉カ蟆陲ォ譖エ謾ケシ梧弍蜷ヲ菫晏ュ伜序譖エシ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1345 +msgid "Do you wish to save changes to file?" +msgstr "譏ッ蜷ヲ菫晏ュ伜序譖エシ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1986 +#, fuzzy +msgid "Progress" +msgstr "AVI 霎灘コ荳ュ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:167 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:229 +msgid "Text file(*.txt)|*.txt" +msgstr "txt譁莉カ(*.txt)|*.txt" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" +msgstr "隸キ霎灘・謾セ螟ァ蛟肴焚 (霎灘・雍溽噪謨ー蛟シシ悟ーア蟾ヲ蜿ウ鄙サ霓ャ )" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +msgid "" +"...clearing entries of selected time-table.\n" +"Would you like to continue?" +msgstr "" +"貂髯、騾画叫逧譌カ髣エ陦ィ譚。逶ョ縲\n" +" 扈ァ扈ュ蜷暦シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +msgid "" +"...deleting selected character.\n" +"Would you like to continue?" +msgstr "" +"蛻髯、騾画叫逧隗定牡縲\n" +" 扈ァ扈ュ蜷暦シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "" +"...deleting selected track.\n" +"Would you like to continue?" +msgstr "" +"蟆隕∝唖髯、謇騾芽スィ驕薙\n" +" 譏ッ蜷ヲ扈ァ扈ュシ" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:75 +#: lipsync\LipSync\Editor/FormCommandHistory.cs:92 +msgid "Command History" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:131 +#, csharp-format +msgid "Delete entry of 'Another Image' at Index {0}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:133 +#, csharp-format +msgid "Add entry of 'Another Image' at Index {0}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:135 +#, csharp-format +msgid "Edit entry of 'Another Image' at Track {0}, Index {1}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:139 +#, csharp-format +msgid "Delete telop '{0}'" +msgstr "蛻髯、蟄怜ケ '{0}'" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:141 +#, csharp-format +msgid "Edit telop '{0}' at Index {1}" +msgstr "郛冶セ大ュ怜ケ: '{0}': Index {1}" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:143 +#, csharp-format +msgid "Add telop '{0}'" +msgstr "豺サ蜉蟄怜ケ '{0}'" + +#: lipsync\LipSync\Editor/FormObjectList.cs:45 +msgid "List of object" +msgstr "蟇ケ雎。蛻苓。ィ" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:102 +msgid "Directory" +msgstr "逶ョ蠖" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:103 +msgid "Specify output range" +msgstr "謖螳夊セ灘コ闌蝗エ" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:107 +msgid "Parser String" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:108 +msgid "Automatically Add Extension" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:109 +msgid "Image Format" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:187 +msgid "Sample File Name" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:197 +msgid "Error: Invalid parser string." +msgstr "" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:63 +msgid "detail" +msgstr "隸ヲ諠" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:64 +msgid "configure frame rate" +msgstr "FPS隶セ螳" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:65 +msgid "Frame rate" +msgstr "蟶ァ騾溽紫" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:68 +msgid "denominator of frame rate" +msgstr "FPS蛻豈" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:69 +msgid "numerator of frame rate" +msgstr "FPS蛻蟄" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:71 +msgid "import frame rate from AVI file" +msgstr "菴ソ逕ィAVI閾ェ霄ォ逧ЁPSシ亥クァ邇シ" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:169 +msgid "failed getting frame rate" +msgstr "譌豕募叙蠕友PS" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:79 +msgid "Lip Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:80 +msgid "Eye Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:81 +msgid "Eyebrow Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:84 +msgid "Blend time for E_Default -> E_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:85 +msgid "Blend time for E_* -> E_Default" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:86 +msgid "Blend time for EB_Default -> EB_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:87 +msgid "Blend time for EB_* -> EB_Default" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:88 +msgid "Blend time for L_Default -> L_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:89 +msgid "Blend time for L_* -> L_Default" +msgstr "" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:70 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:73 +msgid "Title" +msgstr "譬鬚" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:71 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:72 +msgid "Tag" +msgstr "譬遲セ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:74 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:126 +msgid "Up" +msgstr "荳顔ァサ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:75 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:121 +msgid "Down" +msgstr "荳狗ァサ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:76 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:119 +msgid "Add" +msgstr "豺サ蜉" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:79 +msgid "Select image file" +msgstr "騾画叫蝗セ迚譁莉カ螟ケ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:80 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:125 +msgid "Select transparent color" +msgstr "隶セ螳夐剰ソ逧鬚懆牡" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:84 +msgid "Character name" +msgstr "隗定牡蜷" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:86 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:122 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:851 +msgid "Change title" +msgstr "蜿俶峩譬鬚" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:88 +msgid "Selected image" +msgstr "陲ォ騾画叫逧蝗セ蜒" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:91 +msgid "Open *.rsi" +msgstr "謇灘シ RSI" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:94 +msgid "Save as *.rsi" +msgstr "菫晏ュ倅クコXML譬シ蠑" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:95 +msgid "Save as XML" +msgstr "菫晏ュ倅クコXML譬シ蠑" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:98 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:103 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:166 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:180 +msgid "LipSync Character Config(*.lsc)|*.lsc" +msgstr "LipSync 隗定牡隶セ螳 (*.lsc)|*.lsc" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:107 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:123 +msgid "Reset image" +msgstr "驥咲スョ蝗セ蜒" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:109 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:114 +msgid "RipSync Image(*.rsi)|*.rsi" +msgstr "RipSync 隗定牡隶セ螳 (*.rsi)|*.rsi" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:181 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:915 +msgid "LipSync Character Config(content.xml)|content.xml" +msgstr "LipSync 隗定牡隶セ螳 (content.xml)|content.xml" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:551 +msgid "NOT editable" +msgstr "譌豕墓峩謾ケ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:664 +msgid "Title of image" +msgstr "蝗セ蜒冗噪譬鬚" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:665 +msgid "Input the title of image" +msgstr "隸キ霎灘・蝗セ蜒冗噪譬鬚" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:682 +msgid "This image title has been already registered" +msgstr "蟾イ扈剰「ォ逋サ隶ー逧蜷榊ュ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:852 +msgid "Input new title" +msgstr "隸キ霎灘・譁ー逧譬鬚" + +#: lipsync\LipSync\Editor/Previewer.cs:56 +msgid "Stop" +msgstr "蛛懈ュ「" + +#: lipsync\LipSync\Editor/Previewer.cs:57 +msgid "Stretch image" +msgstr "莨ク螻募崟蜒" + +#: lipsync\LipSync\Editor/Previewer.cs:58 +msgid "Specified size" +msgstr "謖螳壼ーコ蟇ク" + +#: lipsync\LipSync\Editor/Property.cs:80 +msgid "Delte Delop" +msgstr "蛻髯、蟄怜ケ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:52 +msgid "Custom" +msgstr "閾ェ螳壻ケ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:53 +#: lipsync\LipSync\Editor/SelectCharacter.cs:57 +#: lipsync\LipSync\Editor/SelectCharacter.cs:58 +msgid "Built-in" +msgstr "蜀蟒コ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:54 +msgid "Select character to generate lip-sync" +msgstr "隸キ騾画叫隕∫函謌仙亢蠖「逧隗定牡" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:59 +msgid "Character selection" +msgstr "隗定牡逧騾画叫" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:48 +msgid "Select track" +msgstr "騾画叫霓ィ驕" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:49 +msgid "import tempo and time-signal information" +msgstr "霎灘・諡榊ュ仙柱諡榊捷" + +#: lipsync\LipSync\Editor/Winker.cs:62 +msgid "Wink interval (sec)" +msgstr "逵ィ逵シ髣エ髫費シ育ァ抵シ" + +#: lipsync\LipSync\Editor/Winker.cs:63 +msgid "Randomize" +msgstr "髫乗惻髣エ髫" + +#: lipsync\LipSync\Editor/Winker.cs:64 +msgid "Closed Eye" +msgstr "髣ュ逵シ逧蝗セ蜒" + +#: lipsync\LipSync\Editor/Winker.cs:65 +msgid "In-between Image" +msgstr "莨エ髫冗噪蝗セ蜒" + +#: lipsync\LipSync\Editor/Winker.cs:66 +msgid "Eye-closing frames" +msgstr "髣ュ逵シ逧蝗セ蜒" + +#: lipsync\LipSync\Editor/Winker.cs:69 +msgid "Limit start time" +msgstr "謖螳壼シ蟋区慮髣エ" + +#: lipsync\LipSync\Editor/Winker.cs:70 +msgid "Limit end time" +msgstr "謖螳夂サ捺據譌カ髣エ" + +#: lipsync\LipSync\Editor/ZOrder.cs:44 +msgid "Select target item, and push [Up] or [Down] button" +msgstr "騾画叫逶ョ譬蝗セ蜒擾シ檎せ蜃サ蜷台ク顔ァサ謌門髄荳狗ァサ" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:199 +msgid "Image directory already exists. Would you like to overwrite them?" +msgstr "蝗セ蜒丞キイ蟄伜惠シ梧弍蜷ヲ隕逶厄シ" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:200 +msgid "warning" +msgstr "隴ヲ蜻" + +#: Boare.Lib.AppUtil/VersionInfo.cs:177 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:116 +#, csharp-format +msgid "About {0}" +msgstr "" + +#: Boare.Lib.AppUtil/VersionInfo.cs:186 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:117 +#, fuzzy +msgid "Credit" +msgstr "蛻カ菴懃セ、" + +#~ msgid "Video" +#~ msgstr "隗鬚" +#~ msgid "insertion of wav file has failed" +#~ msgstr "wav譁莉カ螟ケ謠貞・螟ア雍・" +#~ msgid "FLV Progress" +#~ msgstr "豁」蝨ィ霎灘コFLV" +#~ msgid "Disable preview" +#~ msgstr "蜈ウ髣ュ鬚隗" +#~ msgid "Enable preview" +#~ msgstr "譏セ遉コ鬚隗" +#~ msgid "Edit motion curve" +#~ msgstr "郛冶セ醍ァサ蜉ィ譖イ郤ソ" +#~ msgid "already exists." +#~ msgstr "蟾イ扈丞ュ伜惠" +#~ msgid "Initialization of video compression failed" +#~ msgstr "" +#~ "隗鬚大視郛ゥ逧蛻晏ァ句喧螟ア雍・ \n" +#~ " 豁、隗」遐∝勣蜿ッ閭ス髴隕∫音螳壽ッ比セ狗噪蝗セ蜒丞ーコ蟇ク" +#~ msgid "Specify paste mode" +#~ msgstr "隸キ謖螳夂イ倩エエ讓。蠑" +#~ msgid "Interrupt" +#~ msgstr "荳ュ譁ュ" +#~ msgid "Overwrite" +#~ msgstr "隕逶" + diff --git a/trunk/LipSync/zh-TW.po b/trunk/LipSync/zh-TW.po new file mode 100644 index 0000000..c161a34 --- /dev/null +++ b/trunk/LipSync/zh-TW.po @@ -0,0 +1,1268 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-03-09 00:19+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: kbinani \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Chinese\n" +"X-Poedit-Country: TAIWAN\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-Basepath: ..\\..\\\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-SearchPath-0: lipsync\\LipSync\\Editor\n" +"X-Poedit-SearchPath-1: lipsync\\LipSync\\Common\n" +"X-Poedit-SearchPath-2: Boare.Lib.AppUtil\n" + +#: lipsync\LipSync\Editor/AviOutput.cs:59 +msgid "Cancel" +msgstr "髣憺哩" + +#: lipsync\LipSync\Editor/AviOutput.cs:60 +msgid "Save" +msgstr "菫晏ュ" + +#: lipsync\LipSync\Editor/AviOutput.cs:61 +msgid "File Name" +msgstr "讙疲。亥錐" + +#: lipsync\LipSync\Editor/AviOutput.cs:63 +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Audio" +msgstr "髻ウ鬆サ" + +#: lipsync\LipSync\Editor/AviOutput.cs:66 +msgid "Set the path of ffmpeg to enable this option" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:70 +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "FLV and MP4" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:73 +msgid "Set the path of mencoder and ffmpeg to enable this option" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:76 +msgid "Convert to FLV" +msgstr "霓臥梓flv" + +#: lipsync\LipSync\Editor/AviOutput.cs:77 +msgid "Convert to MP4" +msgstr "霓臥梓mp4" + +#: lipsync\LipSync\Editor/AviOutput.cs:78 +msgid "Merge WAVE to AVI" +msgstr "蜷井スオWAVE蜥窟VI" + +#: lipsync\LipSync\Editor/AviOutput.cs:79 +msgid "Delete Intermediate File" +msgstr "蛻ェ髯、證ォ蟄俶ェ疲。" + +#: lipsync\LipSync\Editor/AviOutput.cs:80 +msgid "Video Compression" +msgstr "隕夜サ螢鍋クョ" + +#: lipsync\LipSync\Editor/AviOutput.cs:81 +msgid "Specify Output Range" +msgstr "謖螳夊シク蜃コ遽蝨" + +#: lipsync\LipSync\Editor/AviOutput.cs:82 +msgid "Start" +msgstr "髢句ァ" + +#: lipsync\LipSync\Editor/AviOutput.cs:83 +msgid "End" +msgstr "邨先據" + +#: lipsync\LipSync\Editor/AviOutput.cs:84 +msgid "Add Alpha" +msgstr "" + +#: lipsync\LipSync\Editor/AviOutput.cs:118 +#, csharp-format +msgid "Directory {0} does not exist." +msgstr "逶ョ骭 {0} 荳榊ュ伜惠縲" + +#: lipsync\LipSync\Editor/AviOutput.cs:119 +#: lipsync\LipSync\Editor/AviOutput.cs:140 +msgid "Error" +msgstr "骭ッ隱、" + +#: lipsync\LipSync\Editor/AviOutput.cs:127 +#, csharp-format +msgid "" +"{0} already exists.\n" +"Do you want to replace it?" +msgstr "" +"{0} 蟾イ邯灘ュ伜惠縲\n" +"譏ッ蜷ヲ譖ソ謠幢シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:139 +msgid "Invalid value has been entered" +msgstr "辟。謨域丙蛟シ" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "Avi file(*.avi)|*.avi" +msgstr "AVI 譁莉カ (*.avi)|*.avi" + +#: lipsync\LipSync\Editor/AviOutput.cs:166 +msgid "All Files(*.*)|*.*" +msgstr "謇譛臥噪譁莉カ螟セ (*.*)|*.*" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:88 +msgid "Edit Motion Curve" +msgstr "邱ィ霈ッ遘サ蜍墓峇邱" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:89 +msgid "Close" +msgstr "髣憺哩" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:90 +msgid "File" +msgstr "譁莉カ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:91 +msgid "Redo" +msgstr "驥榊★" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:92 +msgid "Undo" +msgstr "謦、驫キ" + +#: lipsync\LipSync\Editor/DisplacementControl.cs:93 +msgid "Edit" +msgstr "邱ィ霈ッ" + +#: lipsync\LipSync\Editor/EditEntry.cs:58 +msgid "ON time (sec)" +msgstr "ON 譎る俣 (遘 )" + +#: lipsync\LipSync\Editor/EditEntry.cs:59 +msgid "OFF time (sec)" +msgstr "OFF 譎る俣 (遘 )" + +#: lipsync\LipSync\Editor/EditEntry.cs:61 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:101 +msgid "OK" +msgstr "遒コ螳" + +#: lipsync\LipSync\Editor/EditEntry.cs:62 +msgid "Use this value" +msgstr "菴ソ逕ィ騾吝区丙蛟シ" + +#: lipsync\LipSync\Editor/EditEntry.cs:63 +msgid "Expandable range of this entry" +msgstr "蜿ッ隶頑峩謨ク蛟シ逧遽蝨" + +#: lipsync\LipSync\Editor/EditEntry.cs:64 +msgid "Numeric entry" +msgstr "謨ク蛟シ霈ク蜈・" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:103 +msgid "Language" +msgstr "隱櫁ィ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:104 +#: lipsync\LipSync\Editor/Form1Util.cs:130 +msgid "Option" +msgstr "驕ク鬆" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:106 +msgid "User Config" +msgstr "逕ィ謌カ險ュ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:107 +msgid "Appearance" +msgstr "陦ィ諠" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:108 +msgid "lip-sync Option" +msgstr "蝌エ蠖「蜷梧ュ・驕ク鬆" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:109 +msgid "System" +msgstr "邉サ邨ア" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:111 +msgid "Title of timeline" +msgstr "譎る俣霆ク讓咎。" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:112 +msgid "VSQ Entry" +msgstr "VSQ 蟆域。" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:113 +msgid "Plugin Entry" +msgstr "謠剃サカ蟆域。" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:114 +msgid "Another Entry" +msgstr "蜈カ莉門ー域。" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:115 +msgid "Entry height (pixel)" +msgstr "蟆域。磯ォ伜コヲ (雎。邏)" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:116 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:117 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:118 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:119 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:129 +msgid "Change" +msgstr "隶頑峩" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:120 +msgid "Check phonetic symbol to configure detailed mouth shape control" +msgstr "讙「鬩礼匸髻ウ隨ヲ陌滂シ瑚ゥウ邏ー險ュ螳壼亢蠖「蜿謨ク" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:121 +msgid "Close mouth before pronunciation" +msgstr "蝨ィ逋シ髻ウ荵句燕髢我ク雁亢" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:122 +msgid "\"i\" shaped mouth before pronunciation" +msgstr "蝨ィ逋シ髻ウ荵句燕逕滓絶彿窶晉噪蝌エ蠖「" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:123 +msgid "\"u\" shaped mouth before pronunciation" +msgstr "蝨ィ逋シ髻ウ荵句燕逕滓絶忖窶晉噪蝌エ蠖「" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:124 +msgid "Color" +msgstr "驟崎牡" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:125 +msgid "Design" +msgstr "險ュ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:126 +msgid "Path of ffmpeg" +msgstr "ffmpeg菴咲スョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:127 +msgid "Path of mencoder" +msgstr "mencoder菴咲スョ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:128 +msgid "Font" +msgstr "蟄怜梛" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:130 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:135 +msgid "Another settings" +msgstr "蜈カ莉冶ィュ螳" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:131 +msgid "Close mouth when same vowels repeated" +msgstr "蜷御ク豈埼浹騾」郤檎噪譎ょ呻シ碁哩荳雁亢" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:132 +msgid "Encoder/Decoder" +msgstr "邱ィ遒シ蝎ィ /dekoda" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:133 +msgid "Generate character automaticaly when importing vsq" +msgstr "VSQ霈ク蜈・譎りェ蜍慕函謌仙ュ怜" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:134 +msgid "Threshold silence length(sec)" +msgstr "蛻、螳壽弍騾」郤碁浹譎ゆク咲匸髻ウ逧譎る俣 (遘 )" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:136 +msgid "Use preview-enabled dialog in character selection" +msgstr "驕ク謫蟄怜譎ゆスソ逕ィ蜿ッ莉・鬆占ヲス逧蟆崎ゥア" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:137 +msgid "Reload language configurations" +msgstr "蛻キ譁ー隱櫁ィ險ュ螳壽枚莉カ螟セ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:138 +msgid "Operation" +msgstr "謫堺ス" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:139 +msgid "mouse wheel rate" +msgstr "貊鷹シ貊題シェ騾溷コヲ" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:140 +msgid "Fix cursor to center in Sync mode" +msgstr "" + +#: lipsync\LipSync\Editor/EnvConfiguration.cs:281 +#: lipsync\LipSync\Editor/EnvConfiguration.cs:305 +msgid "Executable file(*.exe)|*.exe" +msgstr "蜿ッ蝓キ陦梧枚莉カ(*.exe)|*.exe" + +#: lipsync\LipSync\Editor/Form1.cs:604 +#: lipsync\LipSync\Editor/Form1.cs:2011 +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Video size configuration" +msgstr "險ュ螳夊ヲ夜サ蝨門ワ螟ァ蟆" + +#: lipsync\LipSync\Editor/Form1.cs:612 +msgid "Read from VSQ file" +msgstr "蠕 VSQ 譁莉カ螟セ隶蜿" + +#: lipsync\LipSync\Editor/Form1.cs:616 +msgid "Edit character" +msgstr "邱ィ霈ッ隗定牡" + +#: lipsync\LipSync\Editor/Form1.cs:619 +#: lipsync\LipSync\Editor/Form1.cs:652 +#: lipsync\LipSync\Editor/Form1.cs:668 +msgid "Preview image" +msgstr "蝨門ワ鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1.cs:620 +#: lipsync\LipSync\Editor/Form1.cs:677 +#: lipsync\LipSync\Editor/Form1.cs:737 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:964 +msgid "Image placement" +msgstr "險ュ螳壼恂蜒丈ス咲スョ" + +#: lipsync\LipSync\Editor/Form1.cs:621 +#: lipsync\LipSync\Editor/Form1.cs:680 +#: lipsync\LipSync\Editor/Form1.cs:740 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Scale setting" +msgstr "險ュ螳壼、ァ蟆" + +#: lipsync\LipSync\Editor/Form1.cs:623 +msgid "Generate wink" +msgstr "逵ィ逵シ逧逕滓" + +#: lipsync\LipSync\Editor/Form1.cs:627 +#: lipsync\LipSync\Editor/Form1.cs:791 +msgid "Delete" +msgstr "蛻ェ髯、" + +#: lipsync\LipSync\Editor/Form1.cs:630 +msgid "Add Telop" +msgstr "豺サ蜉蟄怜ケ" + +#: lipsync\LipSync\Editor/Form1.cs:633 +msgid "Add track" +msgstr "豺サ蜉霆碁%" + +#: lipsync\LipSync\Editor/Form1.cs:643 +msgid "Generate Lipsync from this track" +msgstr "蠕樣吝玖サ碁%逕滓仙亢蠖「" + +#: lipsync\LipSync\Editor/Form1.cs:649 +#: lipsync\LipSync\Editor/Form1.cs:660 +#: lipsync\LipSync\Editor/Form1.cs:691 +msgid "Note ON from here" +msgstr "蠕樣呵」剰シク蜈・髻ウ隨ヲ" + +#: lipsync\LipSync\Editor/Form1.cs:664 +msgid "Set image" +msgstr "謖螳壼恂蜒" + +#: lipsync\LipSync\Editor/Form1.cs:671 +msgid "Change image" +msgstr "隶頑峩蝨門ワ" + +#: lipsync\LipSync\Editor/Form1.cs:675 +#: lipsync\LipSync\Editor/Form1.cs:735 +msgid "Image" +msgstr "蝨門ワ" + +#: lipsync\LipSync\Editor/Form1.cs:702 +#: lipsync\LipSync\Editor/Form1.cs:775 +msgid "Paste" +msgstr "邊倩イシ" + +#: lipsync\LipSync\Editor/Form1.cs:716 +msgid "Note OFF" +msgstr "謦、驫キ髻ウ隨ヲ" + +#: lipsync\LipSync\Editor/Form1.cs:718 +msgid "Image Preview" +msgstr "鬘ッ遉コ鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1.cs:720 +msgid "Numeric Entry" +msgstr "謨ク蛟シ霈ク蜈・" + +#: lipsync\LipSync\Editor/Form1.cs:722 +msgid "Expand" +msgstr "謾セ螟ァ" + +#: lipsync\LipSync\Editor/Form1.cs:730 +msgid "Set Image" +msgstr "謖螳壼恂蜒" + +#: lipsync\LipSync\Editor/Form1.cs:732 +msgid "Preview Image" +msgstr "蝨門ワ鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1.cs:733 +msgid "Change Image" +msgstr "隶頑峩蝨門ワ" + +#: lipsync\LipSync\Editor/Form1.cs:749 +msgid "Plugin config. of this entry" +msgstr "豁、蟆域。育噪謠剃サカ險ュ螳" + +#: lipsync\LipSync\Editor/Form1.cs:755 +#: lipsync\LipSync\Editor/Form1.cs:767 +msgid "Copy" +msgstr "隍陬ス" + +#: lipsync\LipSync\Editor/Form1.cs:756 +msgid "Cut" +msgstr "蜑ェ蛻" + +#: lipsync\LipSync\Editor/Form1.cs:757 +msgid "Split Entry" +msgstr "蛻髮「蜈・蜿」" + +#: lipsync\LipSync\Editor/Form1.cs:765 +msgid "Timeline" +msgstr "譎る俣霆ク" + +#: lipsync\LipSync\Editor/Form1.cs:771 +msgid "Copy On/Off inverted" +msgstr "ON/OFF 鄙サ霓芽、陬ス" + +#: lipsync\LipSync\Editor/Form1.cs:779 +msgid "Import from TEXT" +msgstr "蠕樊枚譛ャ隶蜿" + +#: lipsync\LipSync\Editor/Form1.cs:780 +msgid "Export to TEXT" +msgstr "霈ク蜃コ譁譛ャ" + +#: lipsync\LipSync\Editor/Form1.cs:793 +msgid "Delete entries" +msgstr "蛻ェ髯、霆碁%荳顔噪蜈ァ螳ケ" + +#: lipsync\LipSync\Editor/Form1.cs:797 +msgid "Shift this time-line" +msgstr "遘サ蜍墓凾髢楢サク" + +#: lipsync\LipSync\Editor/Form1.cs:1367 +#: lipsync\LipSync\Editor/Form1.cs:1407 +#: lipsync\LipSync\Editor/Form1.cs:1603 +msgid "VSQ Tracks" +msgstr "VSQ 霆碁%" + +#: lipsync\LipSync\Editor/Form1.cs:1378 +msgid "Character" +msgstr "隗定牡" + +#: lipsync\LipSync\Editor/Form1.cs:1385 +msgid "Telop" +msgstr "蟄怜ケ" + +#: lipsync\LipSync\Editor/Form1.cs:1392 +msgid "Another Images" +msgstr "蜈カ莉門恂蜒" + +#: lipsync\LipSync\Editor/Form1.cs:1399 +#: lipsync\LipSync\Editor/Form1.cs:1577 +msgid "Plugin" +msgstr "謠剃サカ" + +#: lipsync\LipSync\Editor/Form1.cs:1540 +msgid "LipSync" +msgstr "LipSync" + +#: lipsync\LipSync\Editor/Form1.cs:1605 +#: lipsync\LipSync\Editor/Form1.cs:2394 +msgid "Another images" +msgstr "蜈カ莉門恂蜒" + +#: lipsync\LipSync\Editor/Form1.cs:1952 +msgid "" +"Initialization of video compression failed.\n" +"This video codec may require image width in multiples of certain number." +msgstr "" +"隕夜サ螢鍋クョ逧蛻晏ァ句喧螟ア謨予n" +"豁、隗」遒シ蝎ィ蜿ッ閭ス髴隕∫音螳壽ッ比セ狗噪蝨門ワ蟆コ蟇ク" + +#: lipsync\LipSync\Editor/Form1.cs:1963 +msgid "AVI Progress" +msgstr "AVI 霈ク蜃コ荳ュ" + +#: lipsync\LipSync\Editor/Form1.cs:2011 +msgid "Input video length in second" +msgstr "霈ク蜈・蠖ア蜒冗噪髟キ蠎ヲシ育ァ抵シ" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Shift all time-tables" +msgstr "謨エ鬮皮ァサ蜍墓凾髢楢サク" + +#: lipsync\LipSync\Editor/Form1.cs:2038 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:102 +msgid "Input shift time in second (you can enter minus value)" +msgstr "霈ク蜈・遘サ蜍墓丙驥 (蜿ッ莉・霈ク蜈・雋蛟シ )" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +#: lipsync\LipSync\Editor/Form1.cs:2689 +msgid "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" +msgstr "騾吝区桃菴懈怎隕闢区園譛臥樟蟄倩サ碁%縲ゆクヲ荳皮┌豕墓彫驫キ縲らケシ郤悟落シ" + +#: lipsync\LipSync\Editor/Form1.cs:2299 +msgid "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" +msgstr "シ亥承謫翫祁SQ 霆碁%縲埼∈謫縲悟セ VSQ 譁莉カ螟セ隶蜿悶肴キサ蜉荳蛟区眠霆碁%シ" + +#: lipsync\LipSync\Editor/Form1.cs:2300 +#: lipsync\LipSync\Editor/Form1.cs:2690 +#: lipsync\LipSync\Editor/Form1Util.cs:249 +#: lipsync\LipSync\Editor/Form1Util.cs:283 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "Confirmation" +msgstr "遒コ隱" + +#: lipsync\LipSync\Editor/Form1.cs:2313 +#: lipsync\LipSync\Editor/Form1Util.cs:150 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:931 +msgid "VOCALOID2 Sequence File(*.vsq)|*.vsq" +msgstr "VOCALOID2騾」郤梧枚莉カ(*.vsq)|*.vsq" + +#: lipsync\LipSync\Editor/Form1.cs:2314 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:932 +msgid "UTAU Script File(*.ust)|*.ust" +msgstr "" + +#: lipsync\LipSync\Editor/Form1.cs:2436 +#: lipsync\LipSync\Editor/Form1.cs:2569 +msgid "Specify the index of target character" +msgstr "" + +#: lipsync\LipSync\Editor/Form1.cs:2707 +#: lipsync\LipSync\Editor/Form1.cs:3134 +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1907 +msgid "Play" +msgstr "謦ュ謾セ" + +#: lipsync\LipSync\Editor/Form1.cs:2711 +msgid "File not found" +msgstr "譁莉カ譛ェ謇セ蛻ー" + +#: lipsync\LipSync\Editor/Form1.cs:2730 +#: lipsync\LipSync\Editor/Form1.cs:2758 +#: lipsync\LipSync\Editor/Form1.cs:2770 +msgid "Extension must be *.lse" +msgstr "*.辟。豕戊剳逅lse莉・螟也噪譁莉カ譬シ蠑" + +#: lipsync\LipSync\Editor/Form1.cs:2895 +msgid "Expand All" +msgstr "蜈ィ驛ィ螻暮幕" + +#: lipsync\LipSync\Editor/Form1.cs:2896 +msgid "Fold All" +msgstr "蜈ィ驛ィ蜷域拍" + +#: lipsync\LipSync\Editor/Form1.cs:3138 +msgid "Audio File(*.mp3;*.wav)|*.mp3;*.wav" +msgstr "髻ウ謨域ェ疲。(*.mp3,*.wav)|*.mp3;*.wav" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "Go to specified frame" +msgstr "遘サ蜍募芦謖螳壼ケ" + +#: lipsync\LipSync\Editor/Form1.cs:3152 +msgid "please input frame index" +msgstr "隲玖シク蜈・譎る俣霆ク邏「蠑" + +#: lipsync\LipSync\Editor/Form1.cs:3166 +msgid "invalid frame index" +msgstr "騾吝区凾髢楢サク邏「蠑穂ク榊ュ伜惠" + +#: lipsync\LipSync\Editor/Form1.cs:3702 +msgid "Series Image Progress" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:104 +msgid "Open" +msgstr "謇馴幕" + +#: lipsync\LipSync\Editor/Form1Util.cs:106 +msgid "Save As" +msgstr "蜿ヲ蟄倡梓" + +#: lipsync\LipSync\Editor/Form1Util.cs:107 +msgid "Import" +msgstr "蟆主・" + +#: lipsync\LipSync\Editor/Form1Util.cs:108 +msgid "from RipSync data" +msgstr "RipSync 雉譁" + +#: lipsync\LipSync\Editor/Form1Util.cs:109 +msgid "Open VSQ/UST file" +msgstr "謇馴幕 VSQ/UST" + +#: lipsync\LipSync\Editor/Form1Util.cs:110 +msgid "Exit" +msgstr "騾蜃コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:111 +msgid "Script for VOCALOMARK" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:115 +msgid "Help" +msgstr "蟷ォ蜉ゥ" + +#: lipsync\LipSync\Editor/Form1Util.cs:116 +msgid "Plugin Information" +msgstr "謠剃サカ雉險" + +#: lipsync\LipSync\Editor/Form1Util.cs:117 +msgid "About LipSync" +msgstr "髣懈名 LipSync" + +#: lipsync\LipSync\Editor/Form1Util.cs:118 +msgid "Debug" +msgstr "謨髫懈賜髯、" + +#: lipsync\LipSync\Editor/Form1Util.cs:119 +msgid "Edit Character" +msgstr "邱ィ霈ッ隗定牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:120 +msgid "Flip Images Horizontaly" +msgstr "蟾ヲ蜿ウ鄙サ霓牙恂蜒" + +#: lipsync\LipSync\Editor/Form1Util.cs:124 +msgid "Video Size" +msgstr "蝨門ワ螟ァ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:125 +msgid "Frame Rate" +msgstr "蟷騾溽紫" + +#: lipsync\LipSync\Editor/Form1Util.cs:126 +msgid "Z order" +msgstr "z霆ク鬆蠎" + +#: lipsync\LipSync\Editor/Form1Util.cs:127 +msgid "Video Length" +msgstr "隕夜サ髟キ蠎ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:128 +msgid "Shift All Time-tables" +msgstr "謨エ鬮皮ァサ蜍墓凾髢楢サク" + +#: lipsync\LipSync\Editor/Form1Util.cs:129 +msgid "Tool" +msgstr "蟾・蜈キ" + +#: lipsync\LipSync\Editor/Form1Util.cs:131 +msgid "Plugin Config" +msgstr "謠剃サカ險ュ螳" + +#: lipsync\LipSync\Editor/Form1Util.cs:132 +msgid "Add Empty Character" +msgstr "豺サ蜉遨コ逋ス隗定牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:134 +msgid "Generate Avi" +msgstr "霈ク蜃コAVI" + +#: lipsync\LipSync\Editor/Form1Util.cs:135 +msgid "Chose Sound File" +msgstr "蜷梧凾謦ュ謾セ逧髻ウ讓" + +#: lipsync\LipSync\Editor/Form1Util.cs:136 +msgid "Go to Specified Frame" +msgstr "遘サ蜍募芦謖螳壼ケ" + +#: lipsync\LipSync\Editor/Form1Util.cs:137 +msgid "Stop Writing Avi" +msgstr "荳ュ譁キ霈ク蜃コavi" + +#: lipsync\LipSync\Editor/Form1Util.cs:138 +msgid "Background Color" +msgstr "閭梧勹鬘碑牡" + +#: lipsync\LipSync\Editor/Form1Util.cs:140 +msgid "Generate Raw Avi" +msgstr "霈ク蜃コ辟。螢鍋クョ逧 AVI" + +#: lipsync\LipSync\Editor/Form1Util.cs:141 +msgid "Export" +msgstr "蟆主コ" + +#: lipsync\LipSync\Editor/Form1Util.cs:142 +msgid "Script for H@TWUNEBENCH" +msgstr "H@TWUNEBENCH閻ウ譛ャ" + +#: lipsync\LipSync\Editor/Form1Util.cs:144 +msgid "Show Object List" +msgstr "鬘ッ遉コ迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:146 +msgid "Hide Object List" +msgstr "髣憺哩迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:148 +msgid "Bug Report" +msgstr "骭ッ隱、蝣ア蜻" + +#: lipsync\LipSync\Editor/Form1Util.cs:158 +msgid "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" +msgstr "蝨也援譁莉カ(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" + +#: lipsync\LipSync\Editor/Form1Util.cs:159 +msgid "Avi File(*.avi)|*.avi" +msgstr "AVI 譁莉カ (*.avi)|*.avi" + +#: lipsync\LipSync\Editor/Form1Util.cs:167 +msgid "LipSync Data File(*.lse)|*.lse" +msgstr "LipSync 雉譁呵ィュ螳 (*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:175 +msgid "LipSync Data file(*.lse)|*.lse" +msgstr "LipSync 雉譁呵ィュ螳 (*.lse)|*.lse" + +#: lipsync\LipSync\Editor/Form1Util.cs:183 +msgid "Real Time \"lipsync\"" +msgstr "蜊ウ譎ょ哨蝙句酔豁・" + +#: lipsync\LipSync\Editor/Form1Util.cs:184 +msgid "End Repeat Here" +msgstr "謖螳夐肴眺邨先據菴咲スョ" + +#: lipsync\LipSync\Editor/Form1Util.cs:185 +msgid "Start Repeat Here" +msgstr "謖螳夐肴眺髢句ァ倶ス咲スョ" + +#: lipsync\LipSync\Editor/Form1Util.cs:186 +msgid "Reset Repeat region" +msgstr "驥咲スョ驥肴眺遽蝨" + +#: lipsync\LipSync\Editor/Form1Util.cs:189 +msgid "View" +msgstr "隕門恂" + +#: lipsync\LipSync\Editor/Form1Util.cs:190 +msgid "Zoom" +msgstr "謫エ螟ァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:191 +msgid "Mooz" +msgstr "邵ョ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:192 +msgid "Set Default Scale" +msgstr "鮟倩ェ榊、ァ蟆" + +#: lipsync\LipSync\Editor/Form1Util.cs:193 +#: lipsync\LipSync\Editor/Form1Util.cs:197 +msgid "Move to Top" +msgstr "蝗槫芦髢矩ュ" + +#: lipsync\LipSync\Editor/Form1Util.cs:194 +#: lipsync\LipSync\Editor/Form1Util.cs:196 +msgid "Move to End" +msgstr "霓牙芦邨仙ーセ" + +#: lipsync\LipSync\Editor/Form1Util.cs:195 +msgid "Repeat play" +msgstr "驥榊セゥ謦ュ謾セ" + +#: lipsync\LipSync\Editor/Form1Util.cs:199 +#: lipsync\LipSync\Editor/Form1Util.cs:203 +#: lipsync\LipSync\Editor/Form1Util.cs:1850 +msgid "Pause" +msgstr "證ォ蛛" + +#: lipsync\LipSync\Editor/Form1Util.cs:200 +msgid "Show VSQ Tracks Allways" +msgstr "邵ス譏ッ鬘ッ遉コ VSQ 霆碁%" + +#: lipsync\LipSync\Editor/Form1Util.cs:201 +msgid "Show Bars" +msgstr "鬘ッ遉コ譬シ譟オ" + +#: lipsync\LipSync\Editor/Form1Util.cs:202 +msgid "Preview" +msgstr "蝨門ワ鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1Util.cs:204 +msgid "Sync with Time-table" +msgstr "闊譎る俣霆ク蜷梧ュ・" + +#: lipsync\LipSync\Editor/Form1Util.cs:206 +#: lipsync\LipSync\Editor/Form1Util.cs:467 +msgid "Enable Preview" +msgstr "鬘ッ遉コ鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1Util.cs:208 +#: lipsync\LipSync\Editor/Form1Util.cs:461 +msgid "Disable Preview" +msgstr "髣憺哩鬆占ヲス" + +#: lipsync\LipSync\Editor/Form1Util.cs:210 +msgid "Separate Preview Window" +msgstr "" + +#: lipsync\LipSync\Editor/Form1Util.cs:213 +msgid "Quantize" +msgstr "驥丞喧" + +#: lipsync\LipSync\Editor/Form1Util.cs:214 +msgid "Off" +msgstr "髣懈脂" + +#: lipsync\LipSync\Editor/Form1Util.cs:215 +msgid "Triplet" +msgstr "荳蛾」髻ウ" + +#: lipsync\LipSync\Editor/Form1Util.cs:217 +msgid "List of Object" +msgstr "迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:218 +msgid "Property" +msgstr "迚ゥ莉カ迚ケ諤ァ" + +#: lipsync\LipSync\Editor/Form1Util.cs:230 +msgid "Series Image" +msgstr "騾」郤檎噪蝨門ワ譁莉カ" + +#: lipsync\LipSync\Editor/Form1Util.cs:248 +#: lipsync\LipSync\Editor/Form1Util.cs:282 +msgid "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" +msgstr "隕闢狗樟譛画牛蟄仙柱諡崎辧シ御クヲ荳皮┌豕墓彫驫キシ檎ケシ郤悟落シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:411 +msgid "Hide object list" +msgstr "髣憺哩迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:417 +msgid "Show object list" +msgstr "鬘ッ遉コ迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/Form1Util.cs:442 +msgid "(no name)" +msgstr "辟。讓咎。" + +#: lipsync\LipSync\Editor/Form1Util.cs:498 +msgid "Failed file saving" +msgstr "譁莉カ菫晏ュ伜、ア謨 " + +#: lipsync\LipSync\Editor/Form1Util.cs:569 +msgid "Failed file reading" +msgstr "譁莉カ隶蜿門、ア謨" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Width" +msgstr "蟇ャ蠎ヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:669 +msgid "Height" +msgstr "鬮伜コヲ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1343 +msgid " has been changed. Do you wish to save changes to file?" +msgstr "譁莉カ蟆陲ォ譖エ謾ケシ梧弍蜷ヲ菫晏ュ倩ョ頑峩シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1345 +msgid "Do you wish to save changes to file?" +msgstr "譏ッ蜷ヲ菫晏ュ倩ョ頑峩シ" + +#: lipsync\LipSync\Editor/Form1Util.cs:1986 +#, fuzzy +msgid "Progress" +msgstr "AVI 霈ク蜃コ荳ュ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:167 +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:229 +msgid "Text file(*.txt)|*.txt" +msgstr "txt譁莉カ(*.txt)|*.txt" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:554 +msgid "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" +msgstr "隲玖シク蜈・謾セ螟ァ蛟肴丙 (霈ク蜈・雋逧謨ク蛟シシ悟ーア蟾ヲ蜿ウ鄙サ霓 )" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:592 +msgid "" +"...clearing entries of selected time-table.\n" +"Would you like to continue?" +msgstr "" +"貂髯、驕ク謫逧譎る俣陦ィ譴晉岼縲\n" +" 郢シ郤悟落シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1077 +msgid "" +"...deleting selected character.\n" +"Would you like to continue?" +msgstr "" +"蛻ェ髯、驕ク謫逧隗定牡縲\n" +" 郢シ郤悟落シ" + +#: lipsync\LipSync\Editor/Form1_EventHandler.cs:1084 +msgid "" +"...deleting selected track.\n" +"Would you like to continue?" +msgstr "" +"蟆隕∝穐髯、謇驕ク霆碁%縲\n" +" 譏ッ蜷ヲ郢シ郤鯉シ" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:75 +#: lipsync\LipSync\Editor/FormCommandHistory.cs:92 +msgid "Command History" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:131 +#, csharp-format +msgid "Delete entry of 'Another Image' at Index {0}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:133 +#, csharp-format +msgid "Add entry of 'Another Image' at Index {0}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:135 +#, csharp-format +msgid "Edit entry of 'Another Image' at Track {0}, Index {1}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:139 +#, csharp-format +msgid "Delete telop '{0}'" +msgstr "蛻ェ髯、蟄怜ケ: '{0}'" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:141 +#, csharp-format +msgid "Edit telop '{0}' at Index {1}" +msgstr "" + +#: lipsync\LipSync\Editor/FormCommandHistory.cs:143 +#, csharp-format +msgid "Add telop '{0}'" +msgstr "豺サ蜉蟄怜ケ: '{0}'" + +#: lipsync\LipSync\Editor/FormObjectList.cs:45 +msgid "List of object" +msgstr "迚ゥ莉カ蛻苓。ィ" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:102 +msgid "Directory" +msgstr "逶ョ骭" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:103 +msgid "Specify output range" +msgstr "謖螳夊シク蜃コ遽蝨" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:107 +msgid "Parser String" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:108 +msgid "Automatically Add Extension" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:109 +msgid "Image Format" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:187 +msgid "Sample File Name" +msgstr "" + +#: lipsync\LipSync\Editor/FormSeriesImage.cs:197 +msgid "Error: Invalid parser string." +msgstr "" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:63 +msgid "detail" +msgstr "隧ウ諠" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:64 +msgid "configure frame rate" +msgstr "FPS險ュ螳" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:65 +msgid "Frame rate" +msgstr "蟷騾溽紫" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:68 +msgid "denominator of frame rate" +msgstr "FPS蛻豈" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:69 +msgid "numerator of frame rate" +msgstr "FPS蛻蟄" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:71 +msgid "import frame rate from AVI file" +msgstr "菴ソ逕ィAVI閾ェ霄ォ逧ЁPSシ亥ケ邇シ" + +#: lipsync\LipSync\Editor/FormSetFrameRate.cs:169 +msgid "failed getting frame rate" +msgstr "辟。豕募叙蠕友PS" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:79 +msgid "Lip Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:80 +msgid "Eye Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:81 +msgid "Eyebrow Assignment" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:84 +msgid "Blend time for E_Default -> E_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:85 +msgid "Blend time for E_* -> E_Default" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:86 +msgid "Blend time for EB_Default -> EB_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:87 +msgid "Blend time for EB_* -> EB_Default" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:88 +msgid "Blend time for L_Default -> L_*" +msgstr "" + +#: lipsync\LipSync\Editor/FormVocalomark.cs:89 +msgid "Blend time for L_* -> L_Default" +msgstr "" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:70 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:73 +msgid "Title" +msgstr "讓咎。" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:71 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:72 +msgid "Tag" +msgstr "讓咏ース" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:74 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:126 +msgid "Up" +msgstr "荳顔ァサ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:75 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:121 +msgid "Down" +msgstr "荳狗ァサ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:76 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:119 +msgid "Add" +msgstr "豺サ蜉" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:79 +msgid "Select image file" +msgstr "驕ク謫蝨也援譁莉カ螟セ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:80 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:125 +msgid "Select transparent color" +msgstr "險ュ螳夐城℃逧鬘碑牡" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:84 +msgid "Character name" +msgstr "隗定牡蜷" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:86 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:122 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:851 +msgid "Change title" +msgstr "隶頑峩讓咎。" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:88 +msgid "Selected image" +msgstr "陲ォ驕ク謫逧蝨門ワ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:91 +msgid "Open *.rsi" +msgstr "謇馴幕 RSI" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:94 +msgid "Save as *.rsi" +msgstr "菫晏ュ倡梓XML譬シ蠑" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:95 +msgid "Save as XML" +msgstr "菫晏ュ倡梓XML譬シ蠑" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:98 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:103 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:166 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:180 +msgid "LipSync Character Config(*.lsc)|*.lsc" +msgstr "LipSync 隗定牡險ュ螳 (*.lsc)|*.lsc" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:107 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:123 +msgid "Reset image" +msgstr "驥咲スョ蝨門ワ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:109 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:114 +msgid "RipSync Image(*.rsi)|*.rsi" +msgstr "RipSync 隗定牡險ュ螳 (*.rsi)|*.rsi" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:181 +#: lipsync\LipSync\Editor/GenerateCharacter.cs:915 +msgid "LipSync Character Config(content.xml)|content.xml" +msgstr "LipSync 隗定牡險ュ螳 (content.xml)|content.xml" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:551 +msgid "NOT editable" +msgstr "辟。豕墓峩謾ケ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:664 +msgid "Title of image" +msgstr "蝨門ワ逧讓咎。" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:665 +msgid "Input the title of image" +msgstr "隲玖シク蜈・蝨門ワ逧讓咎。" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:682 +msgid "This image title has been already registered" +msgstr "蟾イ邯楢「ォ逋サ險倡噪蜷榊ュ" + +#: lipsync\LipSync\Editor/GenerateCharacter.cs:852 +msgid "Input new title" +msgstr "隲玖シク蜈・譁ー逧讓咎。" + +#: lipsync\LipSync\Editor/Previewer.cs:56 +msgid "Stop" +msgstr "蛛懈ュ「" + +#: lipsync\LipSync\Editor/Previewer.cs:57 +msgid "Stretch image" +msgstr "莨ク螻募恂蜒" + +#: lipsync\LipSync\Editor/Previewer.cs:58 +msgid "Specified size" +msgstr "謖螳壼ーコ蟇ク" + +#: lipsync\LipSync\Editor/Property.cs:80 +msgid "Delte Delop" +msgstr "蛻ェ髯、蟄怜ケ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:52 +msgid "Custom" +msgstr "閾ェ螳夂セゥ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:53 +#: lipsync\LipSync\Editor/SelectCharacter.cs:57 +#: lipsync\LipSync\Editor/SelectCharacter.cs:58 +msgid "Built-in" +msgstr "蜈ァ蟒コ" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:54 +msgid "Select character to generate lip-sync" +msgstr "隲矩∈謫隕∫函謌仙亢蠖「逧隗定牡" + +#: lipsync\LipSync\Editor/SelectCharacter.cs:59 +msgid "Character selection" +msgstr "隗定牡逧驕ク謫" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:48 +msgid "Select track" +msgstr "驕ク謫霆碁%" + +#: lipsync\LipSync\Editor/TrackSelecter.cs:49 +msgid "import tempo and time-signal information" +msgstr "霈ク蜈・諡榊ュ仙柱諡崎辧" + +#: lipsync\LipSync\Editor/Winker.cs:62 +msgid "Wink interval (sec)" +msgstr "逵ィ逵シ髢馴囈シ育ァ抵シ" + +#: lipsync\LipSync\Editor/Winker.cs:63 +msgid "Randomize" +msgstr "髫ィ讖滄俣髫" + +#: lipsync\LipSync\Editor/Winker.cs:64 +msgid "Closed Eye" +msgstr "髢臥愍逧蝨門ワ" + +#: lipsync\LipSync\Editor/Winker.cs:65 +msgid "In-between Image" +msgstr "莨エ髫ィ逧蝨門ワ" + +#: lipsync\LipSync\Editor/Winker.cs:66 +msgid "Eye-closing frames" +msgstr "髢臥愍逧蝨門ワ" + +#: lipsync\LipSync\Editor/Winker.cs:69 +msgid "Limit start time" +msgstr "謖螳夐幕蟋区凾髢" + +#: lipsync\LipSync\Editor/Winker.cs:70 +msgid "Limit end time" +msgstr "謖螳夂オ先據譎る俣" + +#: lipsync\LipSync\Editor/ZOrder.cs:44 +msgid "Select target item, and push [Up] or [Down] button" +msgstr "驕ク謫逶ョ讓吝恂蜒擾シ碁サ樊投蜷台ク顔ァサ謌門髄荳狗ァサ" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:199 +msgid "Image directory already exists. Would you like to overwrite them?" +msgstr "蝨門ワ蟾イ蟄伜惠シ梧弍蜷ヲ隕闢具シ" + +#: lipsync\LipSync\Editor/RipSync/RsiWriter.cs:200 +msgid "warning" +msgstr "隴ヲ蜻" + +#: Boare.Lib.AppUtil/VersionInfo.cs:177 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:116 +#, csharp-format +msgid "About {0}" +msgstr "" + +#: Boare.Lib.AppUtil/VersionInfo.cs:186 +#: Boare.Lib.AppUtil/VersionInfo.Designer.cs:117 +msgid "Credit" +msgstr "陬ス菴懃セ、" + +#~ msgid "Video" +#~ msgstr "隕夜サ" +#~ msgid "insertion of wav file has failed" +#~ msgstr "wav譁莉カ螟セ謠貞・螟ア謨" +#~ msgid "FLV Progress" +#~ msgstr "豁」蝨ィ霈ク蜃コFLV" +#~ msgid "Edit motion curve" +#~ msgstr "邱ィ霈ッ遘サ蜍墓峇邱" +#~ msgid "Disable preview" +#~ msgstr "髣憺哩鬆占ヲス" +#~ msgid "Enable preview" +#~ msgstr "鬘ッ遉コ鬆占ヲス" +#~ msgid "already exists." +#~ msgstr "蟾イ邯灘ュ伜惠" +#~ msgid "Initialization of video compression failed" +#~ msgstr "" +#~ "隕夜サ螢鍋クョ逧蛻晏ァ句喧螟ア謨 \n" +#~ " 豁、隗」遒シ蝎ィ蜿ッ閭ス髴隕∫音螳壽ッ比セ狗噪蝨門ワ蟆コ蟇ク" +#~ msgid "Specify paste mode" +#~ msgstr "隲区欠螳夂イ倩イシ讓。蠑" +#~ msgid "Interrupt" +#~ msgstr "荳ュ譁キ" +#~ msgid "Overwrite" +#~ msgstr "隕闢" + diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Entries b/trunk/LipSync_2_3_x/AviFile/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/AviFile/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Extra b/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Old b/trunk/LipSync_2_3_x/AviFile/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Repository b/trunk/LipSync_2_3_x/AviFile/CVS/Repository new file mode 100644 index 0000000..bd7dd55 --- /dev/null +++ b/trunk/LipSync_2_3_x/AviFile/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/AviFile diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Root b/trunk/LipSync_2_3_x/AviFile/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/AviFile/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/AviFile/CVS/Template b/trunk/LipSync_2_3_x/AviFile/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/CVS/Entries b/trunk/LipSync_2_3_x/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/CVS/Entries.Extra b/trunk/LipSync_2_3_x/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/CVS/Entries.Log b/trunk/LipSync_2_3_x/CVS/Entries.Log new file mode 100644 index 0000000..0af914a --- /dev/null +++ b/trunk/LipSync_2_3_x/CVS/Entries.Log @@ -0,0 +1,5 @@ +A D/AviFile//// +A D/Common//// +A D/Editor//// +A D/Properties//// +A D/Resources//// diff --git a/trunk/LipSync_2_3_x/CVS/Entries.Old b/trunk/LipSync_2_3_x/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/CVS/Repository b/trunk/LipSync_2_3_x/CVS/Repository new file mode 100644 index 0000000..9c7277c --- /dev/null +++ b/trunk/LipSync_2_3_x/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x diff --git a/trunk/LipSync_2_3_x/CVS/Root b/trunk/LipSync_2_3_x/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/CVS/Template b/trunk/LipSync_2_3_x/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Common/CVS/Entries b/trunk/LipSync_2_3_x/Common/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Common/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Common/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Common/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Common/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Common/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Common/CVS/Entries.Old b/trunk/LipSync_2_3_x/Common/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Common/CVS/Repository b/trunk/LipSync_2_3_x/Common/CVS/Repository new file mode 100644 index 0000000..398238c --- /dev/null +++ b/trunk/LipSync_2_3_x/Common/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Common diff --git a/trunk/LipSync_2_3_x/Common/CVS/Root b/trunk/LipSync_2_3_x/Common/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Common/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Common/CVS/Template b/trunk/LipSync_2_3_x/Common/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Entries b/trunk/LipSync_2_3_x/Editor/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Editor/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Editor/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Entries.Log b/trunk/LipSync_2_3_x/Editor/CVS/Entries.Log new file mode 100644 index 0000000..ca1cf70 --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/RipSync//// +A D/TimeTable//// diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Entries.Old b/trunk/LipSync_2_3_x/Editor/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Repository b/trunk/LipSync_2_3_x/Editor/CVS/Repository new file mode 100644 index 0000000..864306b --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Editor diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Root b/trunk/LipSync_2_3_x/Editor/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Editor/CVS/Template b/trunk/LipSync_2_3_x/Editor/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Old b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Repository b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Repository new file mode 100644 index 0000000..b24814a --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Editor/RipSync diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Root b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Template b/trunk/LipSync_2_3_x/Editor/RipSync/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Old b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Repository b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Repository new file mode 100644 index 0000000..d1d6c4d --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Editor/TimeTable diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Root b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Template b/trunk/LipSync_2_3_x/Editor/TimeTable/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Entries b/trunk/LipSync_2_3_x/Properties/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Properties/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Entries.Old b/trunk/LipSync_2_3_x/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Repository b/trunk/LipSync_2_3_x/Properties/CVS/Repository new file mode 100644 index 0000000..cd93578 --- /dev/null +++ b/trunk/LipSync_2_3_x/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Properties diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Root b/trunk/LipSync_2_3_x/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Properties/CVS/Template b/trunk/LipSync_2_3_x/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Entries b/trunk/LipSync_2_3_x/Resources/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Resources/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Resources/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Entries.Log b/trunk/LipSync_2_3_x/Resources/CVS/Entries.Log new file mode 100644 index 0000000..504bc68 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/CVS/Entries.Log @@ -0,0 +1,3 @@ +A D/sanari_len//// +A D/sanari_miku//// +A D/sanari_rin//// diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Entries.Old b/trunk/LipSync_2_3_x/Resources/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Repository b/trunk/LipSync_2_3_x/Resources/CVS/Repository new file mode 100644 index 0000000..9cfe0c3 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Resources diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Root b/trunk/LipSync_2_3_x/Resources/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Resources/CVS/Template b/trunk/LipSync_2_3_x/Resources/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Old b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Repository b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Repository new file mode 100644 index 0000000..7476a78 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Resources/sanari_len diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Root b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Template b/trunk/LipSync_2_3_x/Resources/sanari_len/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Old b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Repository b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Repository new file mode 100644 index 0000000..f8543c8 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Resources/sanari_miku diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Root b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Template b/trunk/LipSync_2_3_x/Resources/sanari_miku/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Extra b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Extra.Old b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Old b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Repository b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Repository new file mode 100644 index 0000000..5b70797 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Repository @@ -0,0 +1 @@ +lipsync/LipSync_2_3_x/Resources/sanari_rin diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Root b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Template b/trunk/LipSync_2_3_x/Resources/sanari_rin/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/CVS/Entries b/trunk/NicoComment/CVS/Entries new file mode 100644 index 0000000..017249b --- /dev/null +++ b/trunk/NicoComment/CVS/Entries @@ -0,0 +1,14 @@ +/Config.Designer.cs/1.1.1.1/Wed Feb 6 12:55:06 2008// +/Config.cs/1.2/Wed Aug 20 07:56:57 2008// +/Config.resx/1.1.1.1/Wed Feb 6 12:55:06 2008// +/FConfig.Designer.cs/1.1.1.1/Wed Feb 6 12:55:06 2008// +/FConfig.cs/1.3/Sat Aug 23 07:45:14 2008// +/FConfig.resx/1.1.1.1/Wed Feb 6 12:55:06 2008// +/Form1.Designer.cs/1.1.1.1/Wed Feb 6 12:55:06 2008// +/Form1.cs/1.3/Sat Aug 23 07:45:14 2008// +/Form1.resx/1.1.1.1/Wed Feb 6 12:55:06 2008// +/NicoComment.cs/1.3/Wed Aug 20 07:56:57 2008// +/NicoComment.csproj/1.3/Wed Apr 16 16:32:58 2008// +/Program.cs/1.2/Fri Feb 8 08:37:09 2008// +/makefile/1.1/Sat Aug 23 07:45:14 2008// +D diff --git a/trunk/NicoComment/CVS/Entries.Extra b/trunk/NicoComment/CVS/Entries.Extra new file mode 100644 index 0000000..c2bf8c8 --- /dev/null +++ b/trunk/NicoComment/CVS/Entries.Extra @@ -0,0 +1,13 @@ +/Config.Designer.cs////*/// +/Config.cs////*/// +/Config.resx////*/// +/FConfig.Designer.cs////*/// +/FConfig.cs////*/// +/FConfig.resx////*/// +/Form1.Designer.cs////*/// +/Form1.cs////*/// +/Form1.resx////*/// +/NicoComment.cs////*/// +/NicoComment.csproj////*/// +/Program.cs////*/// +/makefile////*/// diff --git a/trunk/NicoComment/CVS/Entries.Extra.Old b/trunk/NicoComment/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/CVS/Entries.Log b/trunk/NicoComment/CVS/Entries.Log new file mode 100644 index 0000000..713f716 --- /dev/null +++ b/trunk/NicoComment/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Properties//// diff --git a/trunk/NicoComment/CVS/Entries.Old b/trunk/NicoComment/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/CVS/Repository b/trunk/NicoComment/CVS/Repository new file mode 100644 index 0000000..79a1d8b --- /dev/null +++ b/trunk/NicoComment/CVS/Repository @@ -0,0 +1 @@ +lipsync/NicoComment diff --git a/trunk/NicoComment/CVS/Root b/trunk/NicoComment/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/NicoComment/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/NicoComment/CVS/Template b/trunk/NicoComment/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/Config.Designer.cs b/trunk/NicoComment/Config.Designer.cs new file mode 100644 index 0000000..8d328df --- /dev/null +++ b/trunk/NicoComment/Config.Designer.cs @@ -0,0 +1,41 @@ +サソnamespace NicoComment { + partial class Config { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.SuspendLayout(); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 294, 206 ); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout( false ); + + } + + #endregion + } +} \ No newline at end of file diff --git a/trunk/NicoComment/Config.cs b/trunk/NicoComment/Config.cs new file mode 100644 index 0000000..6cb8727 --- /dev/null +++ b/trunk/NicoComment/Config.cs @@ -0,0 +1,15 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace NicoComment { + public partial class Config : Form { + public Config() { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/trunk/NicoComment/Config.resx b/trunk/NicoComment/Config.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/trunk/NicoComment/Config.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/trunk/NicoComment/FConfig.Designer.cs b/trunk/NicoComment/FConfig.Designer.cs new file mode 100644 index 0000000..f77e180 --- /dev/null +++ b/trunk/NicoComment/FConfig.Designer.cs @@ -0,0 +1,116 @@ +サソnamespace NicoComment { + partial class FConfig { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.button1 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point( 108, 63 ); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); + this.btnOK.TabIndex = 1; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point( 207, 63 ); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // openFileDialog1 + // + this.openFileDialog1.Filter = "text file(*.txt)|*.txt|xml format(*.xml)|*.xml|all files(*.*)|*.*"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point( 258, 30 ); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size( 24, 23 ); + this.button1.TabIndex = 3; + this.button1.Text = "..."; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler( this.button1_Click ); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point( 12, 32 ); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 240, 19 ); + this.textBox1.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 10, 9 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 73, 12 ); + this.label1.TabIndex = 5; + this.label1.Text = "隱ュ霎シ繧繝輔ぃ繧、繝ォ"; + // + // FConfig + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size( 294, 97 ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.textBox1 ); + this.Controls.Add( this.button1 ); + this.Controls.Add( this.btnCancel ); + this.Controls.Add( this.btnOK ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FConfig"; + this.Text = "Nico Comment縺ョ險ュ螳"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + + } +} \ No newline at end of file diff --git a/trunk/NicoComment/FConfig.cs b/trunk/NicoComment/FConfig.cs new file mode 100644 index 0000000..cc4d9cf --- /dev/null +++ b/trunk/NicoComment/FConfig.cs @@ -0,0 +1,45 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace NicoComment { + public partial class FConfig : Form { + private string config = ""; + public string ConfigString { + get { + return config; + } + } + public FConfig( string configure ) { + InitializeComponent(); + string[] result = configure.Split( new char[] { '\n' } ); + textBox1.Text = result[0]; + //textBox2.Lines = configure.Split( new char[]{'\n'}); + } + private void btnOK_Click( object sender, EventArgs e ) { + string path = textBox1.Text; + if ( File.Exists( path ) ) { + config = path; + using ( StreamReader sr = new StreamReader( path ) ) { + while ( sr.Peek() >= 0 ) { + config += '\n' + sr.ReadLine(); + } + } + this.DialogResult = DialogResult.OK; + } else { + this.DialogResult = DialogResult.Cancel; + } + base.Close(); + } + + private void button1_Click( object sender, EventArgs e ) { + if ( openFileDialog1.ShowDialog() == DialogResult.OK ) { + textBox1.Text = openFileDialog1.FileName; + } + } + } +} \ No newline at end of file diff --git a/trunk/NicoComment/FConfig.resx b/trunk/NicoComment/FConfig.resx new file mode 100644 index 0000000..8dc6b17 --- /dev/null +++ b/trunk/NicoComment/FConfig.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/trunk/NicoComment/Form1.Designer.cs b/trunk/NicoComment/Form1.Designer.cs new file mode 100644 index 0000000..b29f1a4 --- /dev/null +++ b/trunk/NicoComment/Form1.Designer.cs @@ -0,0 +1,100 @@ +サソnamespace NicoComment { + partial class Form1 { + /// + /// 蠢隕√↑繝繧カ繧、繝雁、画焚縺ァ縺吶 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 菴ソ逕ィ荳ュ縺ョ繝ェ繧ス繝シ繧ケ繧偵☆縺ケ縺ヲ繧ッ繝ェ繝シ繝ウ繧「繝繝励@縺セ縺吶 + /// + /// 繝槭ロ繝シ繧ク 繝ェ繧ス繝シ繧ケ縺檎エ譽縺輔l繧句エ蜷 true縲∫エ譽縺輔l縺ェ縺蝣エ蜷医ッ false 縺ァ縺吶 + protected override void Dispose( bool disposing ) { + if ( disposing && (components != null) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows 繝輔か繝シ繝 繝繧カ繧、繝翫〒逕滓舌&繧後◆繧ウ繝シ繝 + + /// + /// 繝繧カ繧、繝 繧オ繝昴シ繝医↓蠢隕√↑繝。繧ス繝繝峨〒縺吶ゅ%縺ョ繝。繧ス繝繝峨ョ蜀螳ケ繧 + /// 繧ウ繝シ繝 繧ィ繝繧」繧ソ縺ァ螟画峩縺励↑縺縺ァ縺上□縺輔>縲 + /// + private void InitializeComponent() { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.textBox3 = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pictureBox1.Location = new System.Drawing.Point( 12, 12 ); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size( 512, 384 ); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point( 18, 450 ); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size( 100, 19 ); + this.textBox1.TabIndex = 1; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point( 146, 453 ); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size( 221, 19 ); + this.textBox2.TabIndex = 2; + // + // button1 + // + this.button1.Location = new System.Drawing.Point( 423, 453 ); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size( 75, 23 ); + this.button1.TabIndex = 3; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler( this.button1_Click ); + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point( 104, 478 ); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size( 101, 19 ); + this.textBox3.TabIndex = 4; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 537, 509 ); + this.Controls.Add( this.textBox3 ); + this.Controls.Add( this.button1 ); + this.Controls.Add( this.textBox2 ); + this.Controls.Add( this.textBox1 ); + this.Controls.Add( this.pictureBox1 ); + this.Name = "Form1"; + this.Text = "Form1"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox textBox3; + } +} \ No newline at end of file diff --git a/trunk/NicoComment/Form1.cs b/trunk/NicoComment/Form1.cs new file mode 100644 index 0000000..a8e01fa --- /dev/null +++ b/trunk/NicoComment/Form1.cs @@ -0,0 +1,25 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace NicoComment { + public partial class Form1 : Form { + public Form1() { + InitializeComponent(); + pictureBox1.Image = new Bitmap( 512, 384 ); + } + + private void button1_Click( object sender, EventArgs e ) { + using ( Graphics g = Graphics.FromImage( pictureBox1.Image ) ) { + g.Clear( Color.Black ); + double time = double.Parse( textBox3.Text ); + NComment entry = new NComment( 0.0f, textBox1.Text, textBox2.Text, 0 ); + NicoComment.drawString( g, entry, pictureBox1.Bounds, time, 1 ); + } + pictureBox1.Invalidate(); + } + } +} \ No newline at end of file diff --git a/trunk/NicoComment/Form1.resx b/trunk/NicoComment/Form1.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/trunk/NicoComment/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/trunk/NicoComment/NicoComment.cs b/trunk/NicoComment/NicoComment.cs new file mode 100644 index 0000000..858f6ff --- /dev/null +++ b/trunk/NicoComment/NicoComment.cs @@ -0,0 +1,508 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using Plugin; +using System.Drawing; +using System.Drawing.Imaging; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace NicoComment { + + public class NicoComment : IPlugin{ + private List config = new List(); + private List comments = new List(); + + public void ApplyLanguage( string language_code ) { + + } + + + public string Name { + get { + return "Nico Comment"; + } + } + + public ulong Type { + get { + return 0; + } + } + + public string Abstract { + get { + return "繝九さ繝九さ蜍慕判縺ス縺蟄怜ケ輔r縲√ル繧ウ繝九さ蜍慕判縺ィ蜷梧ァ倥↑繧ウ繝槭Φ繝峨〒霑ス蜉縺ァ縺阪k繝励Λ繧ー繧、繝ウ縲"; + } + } + + public void Apply( ref Bitmap frame, float time, float e_begin, float e_end, ref string e_body ) { + using ( Graphics g = Graphics.FromImage( frame ) ) { + Rectangle rc = new Rectangle( 0, 0, frame.Width, frame.Height ); + int skip_count_def = 0; + bool first_def = true; + bool first_shita = true; + bool first_ue = true; + int y_def = 0; + int y_shita = rc.Height; + int y_ue = 0; + for ( int i = 0; i < comments.Count; i++ ) { + if ( comments[i].time <= time && time < comments[i].time + 3.0 ) { + double t = time - comments[i].time; + int height = (int)comments[i].type.Size.Size; + if ( comments[i].type.Position == NComTypePosition.def ) { + if ( !first_def ) { + y_def += height; + if ( y_def > rc.Height ) { + y_def -= rc.Height; + skip_count_def++; + } + t += 0.1 * skip_count_def; + } else { + first_def = false; + } + if ( comments[i].y == NComment.NULL ) { + comments[i].y = y_def; + } + + } else if ( comments[i].type.Position == NComTypePosition.shita ) { + if ( !first_shita ) { + y_shita -= (int)(1.1f * height); + if ( y_shita + height < 0 ) { + y_shita += rc.Height; + } + } else { + y_shita -= (int)(1.1f * height); + first_shita = false; + } + if ( comments[i].y == NComment.NULL ) { + comments[i].y = y_shita; + } + + } else if ( comments[i].type.Position == NComTypePosition.ue ) { + if ( !first_ue ) { + y_ue += (int)(1.1f * height); + if ( y_ue > rc.Height ) { + y_ue += rc.Height; + } + } else { + first_ue = false; + } + if ( comments[i].y == NComment.NULL ) { + comments[i].y = y_ue; + } + + } + NComment entry = comments[i]; + drawString( g, entry, rc, t, comments.Count ); + comments[i] = entry; + } + } + } + } + + public string Config { + get { + string result = ""; + if( config.Count > 0 ){ + result = config[0]; + } + for ( int i = 1; i < config.Count; i++ ) { + result += "\n" + config[i]; + } + return result; + } + set { + List work_config = new List(); + foreach ( string item in config ) { + work_config.Add( item ); + } + config.Clear(); + List work_comments = new List(); + foreach ( NComment item in comments ) { + work_comments.Add( item ); + } + comments.Clear(); + //timing.Clear(); + string[] result = value.Split( new char[] { '\n' } ); + config.Add( result[0] ); + for( int i = 1; i < result.Length; i++ ){ + config.Add( result[i] ); + string[] spl = result[i].Split( new char[] { '\t' } ); + if ( spl.Length < 3 ) { + config.Clear(); + foreach ( string item in work_config ) { + config.Add( item ); + } + work_config.Clear(); + comments.Clear(); + foreach ( NComment item in work_comments ) { + comments.Add( item ); + } + work_comments.Clear(); + MessageBox.Show( "繧ウ繝。繝ウ繝医↓繧ィ繝ゥ繝シ縺後≠繧翫∪縺励◆縲ゅお繝ゥ繝シ縺ョ縺ゅ▲縺溯。後ッ谺。縺ョ騾壹j縺ァ縺兔n" + i + "陦檎岼\n" + result[i] ); + return; + } + //timing.Add( double.Parse( spl[0] ) ); + float time; + try { + time = float.Parse( spl[0] ); + } catch { + config.Clear(); + foreach ( string item in work_config ) { + config.Add( item ); + } + work_config.Clear(); + comments.Clear(); + foreach ( NComment item in work_comments ) { + comments.Add( item ); + } + work_comments.Clear(); + MessageBox.Show( "繧ウ繝。繝ウ繝医↓繧ィ繝ゥ繝シ縺後≠繧翫∪縺励◆縲ゅお繝ゥ繝シ縺ョ縺ゅ▲縺溯。後ッ谺。縺ョ騾壹j縺ァ縺兔n" + i + "陦檎岼\n" + result[i] ); + return; + } + comments.Add( new NComment( float.Parse( spl[0] ), spl[1], spl[2], i ) ); + //MessageBox.Show( "Config::set; comments[i-1].type.Position.ToString()=" + comments[i - 1].type.Position.ToString() ); + } + comments.Sort(); + } + } + + public DialogResult EntrySetting( ref string entry_config ) { + return DialogResult.Cancel; + } + + public DialogResult BaseSetting() { + FConfig fconf = new FConfig( Config ); + DialogResult result = fconf.ShowDialog(); + if ( result == DialogResult.OK ) { + Config = fconf.ConfigString; + } + fconf.Dispose(); + return result; + } + + /// + /// com縺ァ謖螳壹&繧後◆繧ウ繝。繝ウ繝医サ繧ソ繧、繝励ョ繝九さ繝九さ繧ウ繝。繝ウ繝医r縲 + /// Graphics g縺ョ菴咲スョx縺ォ謠冗判縺励∪縺吶 + /// + /// 縺薙ョ繧ウ繝。繝ウ繝医′陦ィ遉コ縺輔l蟋九a縺ヲ縺九i縺ョ邨碁℃譎る俣 + /// + /// + /// + public static void drawString( Graphics g, NComment com, Rectangle rc, double time, int comment_num ) { + const string font_name = "シュシウ 繧エ繧キ繝繧ッ"; + Font font = new Font( font_name, com.type.Size.Size, FontStyle.Bold, GraphicsUnit.Pixel ); + Color color = com.type.Color.Color; + int axy = com.type.Position.getPosition( rc.Height, com.type.Size.Size ); + int x; + if ( com.type.Position == NComTypePosition.ue || com.type.Position == NComTypePosition.shita ) { + x = (int)(rc.Width / 2.0f - com.width / 2.0f); + } else { + x = (int)(rc.Width - time * ((com.width + rc.Width) / 3.0f)); + } + GraphicsPath path = new GraphicsPath(); + //FontFamily ff = new FontFamily( font_name ); + FontFamily ff = font.FontFamily; + path.AddString( com.message, ff, (int)FontStyle.Bold, com.type.Size.Size, new Point( 0, 0 ), StringFormat.GenericDefault ); + using ( Bitmap tmp = new Bitmap( com.width, com.height, PixelFormat.Format32bppArgb ) ) { + using ( Graphics gx = Graphics.FromImage( tmp ) ) { + gx.Clear( Color.FromArgb( 0, Color.White ) ); + Color shadow; + if ( color != Color.Black ) { + shadow = Color.Black; + } else { + shadow = Color.White; + } + gx.DrawPath( new Pen( Color.FromArgb( 50, shadow ), 3.5f ), path ); + gx.DrawPath( new Pen( Color.FromArgb( 180, shadow ), 2.5f ), path ); + gx.FillPath( new SolidBrush( color ), path ); + //gx.DrawString( com.message, font, new SolidBrush( color ), new PointF( 0, 0 ) ); + } + float alpha = 0.6f + 0.4f * ((float)com.count / (float)comment_num); + ColorMatrix cm = new ColorMatrix(); + cm.Matrix00 = 1; + cm.Matrix11 = 1; + cm.Matrix22 = 1; + cm.Matrix33 = alpha; + cm.Matrix44 = 1; + ImageAttributes ia = new ImageAttributes(); + ia.SetColorMatrix( cm ); + + g.DrawImage( tmp, new Rectangle( x, com.y, tmp.Width, tmp.Height ), + 0, 0, tmp.Width, tmp.Height, GraphicsUnit.Pixel, ia ); + } + } + public void Render( Graphics g, Size size, float time, string mouth, string reserved ) { + } + + } + + public class NComment : IComparable { + public const int NULL = -999; + public float time; + public NComType type; + public string message; + public int width; + public int height; + public int count; + public int y; + + public NComment( float time, string command, string message, int count ) { + this.time = time; + this.type = new NComType( command ); + this.message = message; + this.count = count; + this.y = NULL; + SizeF sizef; + Bitmap dumy = new Bitmap( 1, 1 ); + Font font = new Font( "シュシウ 繧エ繧キ繝繧ッ", this.type.Size.Size, FontStyle.Bold, GraphicsUnit.Pixel ); + using ( Graphics g = Graphics.FromImage( dumy ) ) { + sizef = g.MeasureString( message, font ); + } + this.width = (int)sizef.Width; + this.height = (int)sizef.Height; + dumy.Dispose(); + font.Dispose(); + } + + public int CompareTo( object obj ) { + NComment com = (NComment)obj; + if ( this.time > com.time ) { + return 1; + } else if ( this.time < com.time ) { + return -1; + } else { + return 0; + } + } + } + + public class NComType { + public NComTypePosition Position; + public NComTypeColor Color; + public NComTypeSize Size; + public NComType( string command ) { + Position = NComTypePosition.def; + Color = NComTypeColor.def; + Size = NComTypeSize.def; + string[] spl = command.Split( new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries ); + for ( int i = spl.Length - 1; i >= 0; i-- ) { + NComTypePosition pos = NComTypePosition.fromCommand( spl[i] ); + if ( pos != NComTypePosition.INVALID ) { + Position = pos; + continue; + } + NComTypeColor col = NComTypeColor.fromCommand( spl[i] ); + if ( col != NComTypeColor.INVALID ) { + Color = col; + continue; + } + NComTypeSize size = NComTypeSize.fromCommand( spl[i] ); + if ( size != NComTypeSize.INVALID ) { + Size = size; + continue; + } + } + } + } + + public class NComTypePosition { + private int m_value; + public static NComTypePosition ue = new NComTypePosition( 0 ); + public static NComTypePosition shita = new NComTypePosition( 1 ); + public static NComTypePosition def = new NComTypePosition( 2 ); + public static NComTypePosition INVALID = new NComTypePosition( -1 ); + private NComTypePosition( int value ) { + m_value = value; + } + public static NComTypePosition fromCommand( string command ) { + switch ( command ) { + case "ue": + return ue; + case "shita": + return shita; + case "naka": + return def; + default: + return INVALID; + } + } + public int getPosition( float height, float fontsize ) { + switch ( m_value ) { + case 0: + return 0; + case 1: + return (int)(height - fontsize * 1.2f); + default: + return -1; + + } + } + new public string ToString() { + switch ( m_value ) { + case 0: + return "ue"; + case 1: + return "shita"; + case 2: + return "def"; + default: + return "INVALID"; + } + } + } + + public class NComTypeColor { + private int m_value; + public static NComTypeColor white = new NComTypeColor( 0 ); + public static NComTypeColor def = new NComTypeColor( 0 ); + public static NComTypeColor red = new NComTypeColor( 1 ); + public static NComTypeColor pink = new NComTypeColor( 2 ); + public static NComTypeColor orange = new NComTypeColor( 3 ); + public static NComTypeColor yellow = new NComTypeColor( 4 ); + public static NComTypeColor green = new NComTypeColor( 5 ); + public static NComTypeColor cyan = new NComTypeColor( 6 ); + public static NComTypeColor blue = new NComTypeColor( 7 ); + public static NComTypeColor purple = new NComTypeColor( 8 ); + public static NComTypeColor niconicowhite = new NComTypeColor( 9 ); + public static NComTypeColor truered = new NComTypeColor( 10 ); + public static NComTypeColor passionorange = new NComTypeColor( 11 ); + public static NComTypeColor madyellow = new NComTypeColor( 12 ); + public static NComTypeColor elementalgreen = new NComTypeColor( 13 ); + public static NComTypeColor marineblue = new NComTypeColor( 14 ); + public static NComTypeColor nobleviolet = new NComTypeColor( 15 ); + public static NComTypeColor black = new NComTypeColor( 16 ); + public static NComTypeColor INVALID = new NComTypeColor( -1 ); + private NComTypeColor( int value ) { + m_value = value; + } + public static NComTypeColor fromCommand( string command ) { + switch ( command ) { + case "white": + return white; + case "red": + return red; + case "pink": + return pink; + case "orange": + return orange; + case "yellow": + return yellow; + case "green": + return green; + case "cyan": + return cyan; + case "blue": + return blue; + case "purple": + return purple; + case "niconicowhite": + case "white2": + return niconicowhite; + case "truered": + case "red2": + return truered; + case "passionorange": + case "orange2": + return passionorange; + case "madyellow": + case "yellow2": + return madyellow; + case "elementalgree": + case "green2": + return elementalgreen; + case "marineblue": + case "blue2": + return marineblue; + case "nobleviolet": + case "purple2": + return nobleviolet; + case "black": + return black; + default: + return INVALID; + } + } + public Color Color { + get { + switch ( m_value ) { + case 0: + return Color.White; + case 1: + return Color.Red; + case 2: + return Color.Pink; + case 3: + return Color.Orange; + case 4: + return Color.Yellow; + case 5: + return Color.FromArgb( 0, 255, 0 ); + case 6: + return Color.Cyan; + case 7: + return Color.Blue; + case 8: + return Color.Purple; + case 9: + return Color.FromArgb( 204, 204, 153 ); + case 10: + return Color.FromArgb( 204, 0, 51 ); + case 11: + return Color.FromArgb( 255, 102, 0 ); + case 12: + return Color.FromArgb( 153, 153, 0 ); + case 13: + return Color.FromArgb( 0, 204, 102 ); + case 14: + return Color.FromArgb( 51, 255, 252 ); + case 15: + return Color.FromArgb( 102, 51, 204 ); + case 16: + return Color.Black; + } + return Color.White; + } + } + } + + public class NComTypeSize { + private int m_value; + public static NComTypeSize big = new NComTypeSize( 0 ); + public static NComTypeSize medium = new NComTypeSize( 1 ); + public static NComTypeSize small = new NComTypeSize( 2 ); + public static NComTypeSize def = new NComTypeSize( 1 ); + public static NComTypeSize INVALID = new NComTypeSize( -1 ); + private NComTypeSize( int value ) { + m_value = value; + } + public static NComTypeSize fromCommand( string command ) { + switch ( command ) { + case "big": + return big; + case "medium": + return medium; + case "small": + return small; + default: + return INVALID; + } + } + public float Size { + get { + switch ( m_value ) { + case 0: + return 39f; + case 1: + return 24f; + case 2: + return 15f; + default: + return 24f; + } + } + } + } + +} diff --git a/trunk/NicoComment/NicoComment.csproj b/trunk/NicoComment/NicoComment.csproj new file mode 100644 index 0000000..ebb042a --- /dev/null +++ b/trunk/NicoComment/NicoComment.csproj @@ -0,0 +1,92 @@ +サソ + + Debug + AnyCPU + 9.0.21022 + 2.0 + {6CBD22A6-34C4-4444-8F90-9EE0D150CEC1} + Library + Properties + NicoComment + NicoComment + + + + + 2.0 + v3.5 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + Form + + + FConfig.cs + + + Form + + + Form1.cs + + + + + + + + Designer + FConfig.cs + + + Designer + Form1.cs + + + + + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00} + IPlugin + + + + + + + + + + + \ No newline at end of file diff --git a/trunk/NicoComment/Program.cs b/trunk/NicoComment/Program.cs new file mode 100644 index 0000000..5c18d4f --- /dev/null +++ b/trunk/NicoComment/Program.cs @@ -0,0 +1,30 @@ +サソusing System; +using System.Collections.Generic; +using System.Windows.Forms; +using System.IO; + +namespace NicoComment { + static class Program { + /// + /// 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ繝。繧、繝ウ 繧ィ繝ウ繝医Μ 繝昴う繝ウ繝医〒縺吶 + /// + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault( false ); +#if !DEBUG + //DEBUG縺ョ縺ィ縺阪ッIDE縺ァ繧ィ繝ゥ繝シ繧偵ワ繝ウ繝峨Ν縺励◆縺縺ョ縺ァ縲 + try { +#endif + Application.Run( new Form1() ); +#if !DEBUG + } catch ( Exception e ) { + using ( StreamWriter sw = new StreamWriter( "error.log", true ) ) { + sw.WriteLine( e.Message ); + sw.WriteLine( e.StackTrace ); + } + } +#endif + } + } +} \ No newline at end of file diff --git a/trunk/NicoComment/Properties/AssemblyInfo.cs b/trunk/NicoComment/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..995b9c8 --- /dev/null +++ b/trunk/NicoComment/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "NicoComment" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Boare" )] +[assembly: AssemblyProduct( "NicoComment" )] +[assembly: AssemblyCopyright( "Copyright (C) 2007" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√%縺ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九ッ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医↓縺ッ +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "93627cb9-8b0e-49ee-aa9c-149d8e3e1a3f" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝ェ繝薙ず繝ァ繝ウ縺翫h縺ウ繝薙Ν繝臥分蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/NicoComment/Properties/CVS/Entries b/trunk/NicoComment/Properties/CVS/Entries new file mode 100644 index 0000000..191052b --- /dev/null +++ b/trunk/NicoComment/Properties/CVS/Entries @@ -0,0 +1,2 @@ +/AssemblyInfo.cs/1.2/Thu Jul 31 11:12:29 2008// +D diff --git a/trunk/NicoComment/Properties/CVS/Entries.Extra b/trunk/NicoComment/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..583c942 --- /dev/null +++ b/trunk/NicoComment/Properties/CVS/Entries.Extra @@ -0,0 +1 @@ +/AssemblyInfo.cs////*/// diff --git a/trunk/NicoComment/Properties/CVS/Entries.Extra.Old b/trunk/NicoComment/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/Properties/CVS/Entries.Old b/trunk/NicoComment/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/Properties/CVS/Repository b/trunk/NicoComment/Properties/CVS/Repository new file mode 100644 index 0000000..7b66916 --- /dev/null +++ b/trunk/NicoComment/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/NicoComment/Properties diff --git a/trunk/NicoComment/Properties/CVS/Root b/trunk/NicoComment/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/NicoComment/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/NicoComment/Properties/CVS/Template b/trunk/NicoComment/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/NicoComment/makefile b/trunk/NicoComment/makefile new file mode 100644 index 0000000..9cc7a9e --- /dev/null +++ b/trunk/NicoComment/makefile @@ -0,0 +1,11 @@ +RM=rm +CP=cp + +NicoComment.dll: FConfig.cs FConfig.Designer.cs Form1.cs Form1.Designer.cs NicoComment.cs Program.cs \ + IPlugin.dll + gmcs -target:library -out:NicoComment.dll \ + -r:System.Windows.Forms,System.Drawing,IPlugin.dll \ + FConfig.cs FConfig.Designer.cs Form1.cs Form1.Designer.cs NicoComment.cs Program.cs + +clean: + $(RM) NicoComment.dll IPlugin.dll diff --git a/trunk/OSVersion/CVS/Entries b/trunk/OSVersion/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/OSVersion/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/OSVersion/CVS/Entries.Extra b/trunk/OSVersion/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/CVS/Entries.Extra.Old b/trunk/OSVersion/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/CVS/Entries.Log b/trunk/OSVersion/CVS/Entries.Log new file mode 100644 index 0000000..713f716 --- /dev/null +++ b/trunk/OSVersion/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Properties//// diff --git a/trunk/OSVersion/CVS/Entries.Old b/trunk/OSVersion/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/CVS/Repository b/trunk/OSVersion/CVS/Repository new file mode 100644 index 0000000..0df045c --- /dev/null +++ b/trunk/OSVersion/CVS/Repository @@ -0,0 +1 @@ +lipsync/OSVersion diff --git a/trunk/OSVersion/CVS/Root b/trunk/OSVersion/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/OSVersion/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/OSVersion/CVS/Template b/trunk/OSVersion/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/Properties/CVS/Entries b/trunk/OSVersion/Properties/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/OSVersion/Properties/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/OSVersion/Properties/CVS/Entries.Extra b/trunk/OSVersion/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/Properties/CVS/Entries.Extra.Old b/trunk/OSVersion/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/Properties/CVS/Entries.Old b/trunk/OSVersion/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/OSVersion/Properties/CVS/Repository b/trunk/OSVersion/Properties/CVS/Repository new file mode 100644 index 0000000..68abc2d --- /dev/null +++ b/trunk/OSVersion/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/OSVersion/Properties diff --git a/trunk/OSVersion/Properties/CVS/Root b/trunk/OSVersion/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/OSVersion/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/OSVersion/Properties/CVS/Template b/trunk/OSVersion/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/CVS/Entries b/trunk/RIFFChecker/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/RIFFChecker/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/RIFFChecker/CVS/Entries.Extra b/trunk/RIFFChecker/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/CVS/Entries.Extra.Old b/trunk/RIFFChecker/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/CVS/Entries.Log b/trunk/RIFFChecker/CVS/Entries.Log new file mode 100644 index 0000000..713f716 --- /dev/null +++ b/trunk/RIFFChecker/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Properties//// diff --git a/trunk/RIFFChecker/CVS/Entries.Old b/trunk/RIFFChecker/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/CVS/Repository b/trunk/RIFFChecker/CVS/Repository new file mode 100644 index 0000000..bd49f93 --- /dev/null +++ b/trunk/RIFFChecker/CVS/Repository @@ -0,0 +1 @@ +lipsync/RIFFChecker diff --git a/trunk/RIFFChecker/CVS/Root b/trunk/RIFFChecker/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/RIFFChecker/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/RIFFChecker/CVS/Template b/trunk/RIFFChecker/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/Properties/CVS/Entries b/trunk/RIFFChecker/Properties/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/RIFFChecker/Properties/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/RIFFChecker/Properties/CVS/Entries.Extra b/trunk/RIFFChecker/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/Properties/CVS/Entries.Extra.Old b/trunk/RIFFChecker/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/Properties/CVS/Entries.Old b/trunk/RIFFChecker/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/RIFFChecker/Properties/CVS/Repository b/trunk/RIFFChecker/Properties/CVS/Repository new file mode 100644 index 0000000..267f273 --- /dev/null +++ b/trunk/RIFFChecker/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/RIFFChecker/Properties diff --git a/trunk/RIFFChecker/Properties/CVS/Root b/trunk/RIFFChecker/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/RIFFChecker/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/RIFFChecker/Properties/CVS/Template b/trunk/RIFFChecker/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/CVS/Entries b/trunk/VFlip/CVS/Entries new file mode 100644 index 0000000..3204896 --- /dev/null +++ b/trunk/VFlip/CVS/Entries @@ -0,0 +1,4 @@ +/VFlip.cs/1.5/Wed Aug 20 07:56:57 2008// +/VFlip.csproj/1.3/Wed Apr 16 16:32:58 2008// +/makefile/1.1/Sat Aug 23 07:45:14 2008// +D diff --git a/trunk/VFlip/CVS/Entries.Extra b/trunk/VFlip/CVS/Entries.Extra new file mode 100644 index 0000000..108a6b3 --- /dev/null +++ b/trunk/VFlip/CVS/Entries.Extra @@ -0,0 +1,3 @@ +/VFlip.cs////*/// +/VFlip.csproj////*/// +/makefile////*/// diff --git a/trunk/VFlip/CVS/Entries.Extra.Old b/trunk/VFlip/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/CVS/Entries.Log b/trunk/VFlip/CVS/Entries.Log new file mode 100644 index 0000000..713f716 --- /dev/null +++ b/trunk/VFlip/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Properties//// diff --git a/trunk/VFlip/CVS/Entries.Old b/trunk/VFlip/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/CVS/Repository b/trunk/VFlip/CVS/Repository new file mode 100644 index 0000000..96b51f7 --- /dev/null +++ b/trunk/VFlip/CVS/Repository @@ -0,0 +1 @@ +lipsync/VFlip diff --git a/trunk/VFlip/CVS/Root b/trunk/VFlip/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VFlip/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VFlip/CVS/Template b/trunk/VFlip/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/Properties/AssemblyInfo.cs b/trunk/VFlip/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3b01d8b --- /dev/null +++ b/trunk/VFlip/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "VFlip" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Boare" )] +[assembly: AssemblyProduct( "VFlip" )] +[assembly: AssemblyCopyright( "Copyright (C) 2007" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√%縺ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九ッ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医↓縺ッ +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "4614ec4b-a485-47a6-a7ce-8e5d4869896f" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝ェ繝薙ず繝ァ繝ウ縺翫h縺ウ繝薙Ν繝臥分蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/VFlip/Properties/CVS/Entries b/trunk/VFlip/Properties/CVS/Entries new file mode 100644 index 0000000..191052b --- /dev/null +++ b/trunk/VFlip/Properties/CVS/Entries @@ -0,0 +1,2 @@ +/AssemblyInfo.cs/1.2/Thu Jul 31 11:12:29 2008// +D diff --git a/trunk/VFlip/Properties/CVS/Entries.Extra b/trunk/VFlip/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..583c942 --- /dev/null +++ b/trunk/VFlip/Properties/CVS/Entries.Extra @@ -0,0 +1 @@ +/AssemblyInfo.cs////*/// diff --git a/trunk/VFlip/Properties/CVS/Entries.Extra.Old b/trunk/VFlip/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/Properties/CVS/Entries.Old b/trunk/VFlip/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/Properties/CVS/Repository b/trunk/VFlip/Properties/CVS/Repository new file mode 100644 index 0000000..c34f788 --- /dev/null +++ b/trunk/VFlip/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/VFlip/Properties diff --git a/trunk/VFlip/Properties/CVS/Root b/trunk/VFlip/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VFlip/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VFlip/Properties/CVS/Template b/trunk/VFlip/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VFlip/VFlip.cs b/trunk/VFlip/VFlip.cs new file mode 100644 index 0000000..b5065f4 --- /dev/null +++ b/trunk/VFlip/VFlip.cs @@ -0,0 +1,86 @@ +サソusing System; +using System.Drawing; +using System.Windows.Forms; +using Plugin; + +namespace VFlip { + public class VFlip : IPlugin{ + + private string m_language = "en"; + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ蜷咲ァー + /// + public string Name { + get { + return "VFlip"; + } + } + + + public void ApplyLanguage( string language_code ) { + if ( ISO639.CheckValidity( language_code ) ) { + m_language = language_code; + } + } + + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ繧ソ繧、繝励r陦ィ縺吶 + /// + public ulong Type { + get { + return Plugin.Constants.LS_NO_EVENT_HANDLER; + } + } + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ邁。貎斐↑隱ャ譏取枚縲 + /// + public string Abstract { + get { + if ( m_language == "ja" ) { + return "逕サ蜒上ョ荳贋ク九r蜿崎サ「縺輔○繧九励Λ繧ー繧、繝ウ縺ァ縺"; + } else { + return "vertically flip the image"; + } + } + } + + /// + /// 繧、繝吶Φ繝医ワ繝ウ繝峨Λ縲ゅ%縺ョ繝励Λ繧ー繧、繝ウ縺ョ險ュ螳壹Γ繝九Η繝シ縺梧款縺輔l縺滓凾蜻シ縺ウ蜃コ縺輔l縺セ縺吶 + /// + /// + /// + public DialogResult BaseSetting() { + return DialogResult.Cancel; + } + + public DialogResult EntrySetting(ref string entry_config ) { + return DialogResult.Cancel; + } + + /// + /// 險ュ螳壼、繧呈シ邏阪@縺滓枚蟄怜励r謖螳壹@縺セ縺吶 + /// + /// + public string Config { + get { + return ""; + } + set { } + } + + /// + /// 繝輔Ξ繝シ繝縺ォ蜉蟾・繧呈命縺咎未謨ー + /// + /// + /// + public void Apply( ref Bitmap bmp, float time, float e_begin, float e_end, ref string e_body ) { + bmp.RotateFlip( RotateFlipType.RotateNoneFlipY ); + } + + public void Render( Graphics g, Size size, float time, string mouth, string reserved ) { + } + } +} diff --git a/trunk/VFlip/VFlip.csproj b/trunk/VFlip/VFlip.csproj new file mode 100644 index 0000000..a2c72e4 --- /dev/null +++ b/trunk/VFlip/VFlip.csproj @@ -0,0 +1,65 @@ +サソ + + Debug + AnyCPU + 9.0.21022 + 2.0 + {E5F9AD85-0C02-4286-AC4C-F5B34EA10650} + Library + Properties + VFlip + VFlip + + + 2.0 + v3.5 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + + + + + + + + + + + + + {FB0C1FBD-3CB7-46BF-8E39-57BE2C8D1F00} + IPlugin + + + + + + + + + \ No newline at end of file diff --git a/trunk/VFlip/makefile b/trunk/VFlip/makefile new file mode 100644 index 0000000..399ec57 --- /dev/null +++ b/trunk/VFlip/makefile @@ -0,0 +1,10 @@ +RM=rm +CP=cp + +VFlip.dll: VFlip.cs IPlugin.dll + gmcs -target:library -out:VFlip.dll \ + -r:System.Drawing,System.Windows.Forms,IPlugin.dll \ + VFlip.cs + +clean: + $(RM) VFlip.dll IPlugin.dll diff --git a/trunk/VSQ/CVS/Entries b/trunk/VSQ/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/CVS/Entries.Extra b/trunk/VSQ/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/CVS/Entries.Extra.Old b/trunk/VSQ/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/CVS/Entries.Log b/trunk/VSQ/CVS/Entries.Log new file mode 100644 index 0000000..87c1b1f --- /dev/null +++ b/trunk/VSQ/CVS/Entries.Log @@ -0,0 +1,6 @@ +A D/Properties//// +A D/SMF//// +A D/SMFReader//// +A D/VsqMetaText//// +A D/bin//// +A D/obj//// diff --git a/trunk/VSQ/CVS/Entries.Old b/trunk/VSQ/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/CVS/Repository b/trunk/VSQ/CVS/Repository new file mode 100644 index 0000000..f77a07d --- /dev/null +++ b/trunk/VSQ/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ diff --git a/trunk/VSQ/CVS/Root b/trunk/VSQ/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/CVS/Template b/trunk/VSQ/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/Properties/CVS/Entries b/trunk/VSQ/Properties/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/Properties/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/Properties/CVS/Entries.Extra b/trunk/VSQ/Properties/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/Properties/CVS/Entries.Extra.Old b/trunk/VSQ/Properties/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/Properties/CVS/Entries.Old b/trunk/VSQ/Properties/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/Properties/CVS/Repository b/trunk/VSQ/Properties/CVS/Repository new file mode 100644 index 0000000..57e2c6d --- /dev/null +++ b/trunk/VSQ/Properties/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/Properties diff --git a/trunk/VSQ/Properties/CVS/Root b/trunk/VSQ/Properties/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/Properties/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/Properties/CVS/Template b/trunk/VSQ/Properties/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/CVS/Entries b/trunk/VSQ/SMF/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/SMF/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/SMF/CVS/Entries.Extra b/trunk/VSQ/SMF/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/CVS/Entries.Extra.Old b/trunk/VSQ/SMF/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/CVS/Entries.Log b/trunk/VSQ/SMF/CVS/Entries.Log new file mode 100644 index 0000000..8c72b00 --- /dev/null +++ b/trunk/VSQ/SMF/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/SMFReader//// +A D/SMFWriter//// diff --git a/trunk/VSQ/SMF/CVS/Entries.Old b/trunk/VSQ/SMF/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/CVS/Repository b/trunk/VSQ/SMF/CVS/Repository new file mode 100644 index 0000000..5ae3489 --- /dev/null +++ b/trunk/VSQ/SMF/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/SMF diff --git a/trunk/VSQ/SMF/CVS/Root b/trunk/VSQ/SMF/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/SMF/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/SMF/CVS/Template b/trunk/VSQ/SMF/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Entries b/trunk/VSQ/SMF/SMFReader/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/SMF/SMFReader/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Entries.Extra b/trunk/VSQ/SMF/SMFReader/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Entries.Extra.Old b/trunk/VSQ/SMF/SMFReader/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Entries.Old b/trunk/VSQ/SMF/SMFReader/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Repository b/trunk/VSQ/SMF/SMFReader/CVS/Repository new file mode 100644 index 0000000..3aa6eda --- /dev/null +++ b/trunk/VSQ/SMF/SMFReader/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/SMF/SMFReader diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Root b/trunk/VSQ/SMF/SMFReader/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/SMF/SMFReader/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/SMF/SMFReader/CVS/Template b/trunk/VSQ/SMF/SMFReader/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Entries b/trunk/VSQ/SMF/SMFWriter/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/SMF/SMFWriter/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Extra b/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Extra.Old b/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Old b/trunk/VSQ/SMF/SMFWriter/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Repository b/trunk/VSQ/SMF/SMFWriter/CVS/Repository new file mode 100644 index 0000000..b11953d --- /dev/null +++ b/trunk/VSQ/SMF/SMFWriter/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/SMF/SMFWriter diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Root b/trunk/VSQ/SMF/SMFWriter/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/SMF/SMFWriter/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/SMF/SMFWriter/CVS/Template b/trunk/VSQ/SMF/SMFWriter/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMFReader/CVS/Entries b/trunk/VSQ/SMFReader/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/SMFReader/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/SMFReader/CVS/Entries.Extra b/trunk/VSQ/SMFReader/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMFReader/CVS/Entries.Extra.Old b/trunk/VSQ/SMFReader/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMFReader/CVS/Entries.Old b/trunk/VSQ/SMFReader/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/SMFReader/CVS/Repository b/trunk/VSQ/SMFReader/CVS/Repository new file mode 100644 index 0000000..dac0568 --- /dev/null +++ b/trunk/VSQ/SMFReader/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/SMFReader diff --git a/trunk/VSQ/SMFReader/CVS/Root b/trunk/VSQ/SMFReader/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/SMFReader/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/SMFReader/CVS/Template b/trunk/VSQ/SMFReader/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/VsqMetaText/CVS/Entries b/trunk/VSQ/VsqMetaText/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/VsqMetaText/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/VsqMetaText/CVS/Entries.Extra b/trunk/VSQ/VsqMetaText/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/VsqMetaText/CVS/Entries.Extra.Old b/trunk/VSQ/VsqMetaText/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/VsqMetaText/CVS/Entries.Old b/trunk/VSQ/VsqMetaText/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/VsqMetaText/CVS/Repository b/trunk/VSQ/VsqMetaText/CVS/Repository new file mode 100644 index 0000000..8c8996b --- /dev/null +++ b/trunk/VSQ/VsqMetaText/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/VsqMetaText diff --git a/trunk/VSQ/VsqMetaText/CVS/Root b/trunk/VSQ/VsqMetaText/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/VsqMetaText/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/VsqMetaText/CVS/Template b/trunk/VSQ/VsqMetaText/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/CVS/Entries b/trunk/VSQ/bin/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/bin/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/bin/CVS/Entries.Extra b/trunk/VSQ/bin/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/CVS/Entries.Extra.Old b/trunk/VSQ/bin/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/CVS/Entries.Log b/trunk/VSQ/bin/CVS/Entries.Log new file mode 100644 index 0000000..5951819 --- /dev/null +++ b/trunk/VSQ/bin/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/Debug//// +A D/Release//// diff --git a/trunk/VSQ/bin/CVS/Entries.Old b/trunk/VSQ/bin/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/CVS/Repository b/trunk/VSQ/bin/CVS/Repository new file mode 100644 index 0000000..0ab03c7 --- /dev/null +++ b/trunk/VSQ/bin/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/bin diff --git a/trunk/VSQ/bin/CVS/Root b/trunk/VSQ/bin/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/bin/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/bin/CVS/Template b/trunk/VSQ/bin/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Debug/CVS/Entries b/trunk/VSQ/bin/Debug/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/bin/Debug/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/bin/Debug/CVS/Entries.Extra b/trunk/VSQ/bin/Debug/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Debug/CVS/Entries.Extra.Old b/trunk/VSQ/bin/Debug/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Debug/CVS/Entries.Old b/trunk/VSQ/bin/Debug/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Debug/CVS/Repository b/trunk/VSQ/bin/Debug/CVS/Repository new file mode 100644 index 0000000..57c8f9f --- /dev/null +++ b/trunk/VSQ/bin/Debug/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/bin/Debug diff --git a/trunk/VSQ/bin/Debug/CVS/Root b/trunk/VSQ/bin/Debug/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/bin/Debug/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/bin/Debug/CVS/Template b/trunk/VSQ/bin/Debug/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Release/CVS/Entries b/trunk/VSQ/bin/Release/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/bin/Release/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/bin/Release/CVS/Entries.Extra b/trunk/VSQ/bin/Release/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Release/CVS/Entries.Extra.Old b/trunk/VSQ/bin/Release/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Release/CVS/Entries.Old b/trunk/VSQ/bin/Release/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/bin/Release/CVS/Repository b/trunk/VSQ/bin/Release/CVS/Repository new file mode 100644 index 0000000..61061f0 --- /dev/null +++ b/trunk/VSQ/bin/Release/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/bin/Release diff --git a/trunk/VSQ/bin/Release/CVS/Root b/trunk/VSQ/bin/Release/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/bin/Release/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/bin/Release/CVS/Template b/trunk/VSQ/bin/Release/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/CVS/Entries b/trunk/VSQ/obj/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/obj/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/obj/CVS/Entries.Extra b/trunk/VSQ/obj/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/CVS/Entries.Extra.Old b/trunk/VSQ/obj/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/CVS/Entries.Log b/trunk/VSQ/obj/CVS/Entries.Log new file mode 100644 index 0000000..5951819 --- /dev/null +++ b/trunk/VSQ/obj/CVS/Entries.Log @@ -0,0 +1,2 @@ +A D/Debug//// +A D/Release//// diff --git a/trunk/VSQ/obj/CVS/Entries.Old b/trunk/VSQ/obj/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/CVS/Repository b/trunk/VSQ/obj/CVS/Repository new file mode 100644 index 0000000..8b79bb9 --- /dev/null +++ b/trunk/VSQ/obj/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/obj diff --git a/trunk/VSQ/obj/CVS/Root b/trunk/VSQ/obj/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/obj/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/obj/CVS/Template b/trunk/VSQ/obj/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/CVS/Entries b/trunk/VSQ/obj/Debug/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/obj/Debug/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/obj/Debug/CVS/Entries.Extra b/trunk/VSQ/obj/Debug/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/CVS/Entries.Extra.Old b/trunk/VSQ/obj/Debug/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/CVS/Entries.Log b/trunk/VSQ/obj/Debug/CVS/Entries.Log new file mode 100644 index 0000000..f591b50 --- /dev/null +++ b/trunk/VSQ/obj/Debug/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Refactor//// diff --git a/trunk/VSQ/obj/Debug/CVS/Entries.Old b/trunk/VSQ/obj/Debug/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/CVS/Repository b/trunk/VSQ/obj/Debug/CVS/Repository new file mode 100644 index 0000000..64c84b8 --- /dev/null +++ b/trunk/VSQ/obj/Debug/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/obj/Debug diff --git a/trunk/VSQ/obj/Debug/CVS/Root b/trunk/VSQ/obj/Debug/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/obj/Debug/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/obj/Debug/CVS/Template b/trunk/VSQ/obj/Debug/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Entries b/trunk/VSQ/obj/Debug/Refactor/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/obj/Debug/Refactor/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Extra b/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Extra.Old b/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Old b/trunk/VSQ/obj/Debug/Refactor/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Repository b/trunk/VSQ/obj/Debug/Refactor/CVS/Repository new file mode 100644 index 0000000..a51d5c8 --- /dev/null +++ b/trunk/VSQ/obj/Debug/Refactor/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/obj/Debug/Refactor diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Root b/trunk/VSQ/obj/Debug/Refactor/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/obj/Debug/Refactor/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/obj/Debug/Refactor/CVS/Template b/trunk/VSQ/obj/Debug/Refactor/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/CVS/Entries b/trunk/VSQ/obj/Release/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/obj/Release/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/obj/Release/CVS/Entries.Extra b/trunk/VSQ/obj/Release/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/CVS/Entries.Extra.Old b/trunk/VSQ/obj/Release/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/CVS/Entries.Log b/trunk/VSQ/obj/Release/CVS/Entries.Log new file mode 100644 index 0000000..f591b50 --- /dev/null +++ b/trunk/VSQ/obj/Release/CVS/Entries.Log @@ -0,0 +1 @@ +A D/Refactor//// diff --git a/trunk/VSQ/obj/Release/CVS/Entries.Old b/trunk/VSQ/obj/Release/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/CVS/Repository b/trunk/VSQ/obj/Release/CVS/Repository new file mode 100644 index 0000000..75c3142 --- /dev/null +++ b/trunk/VSQ/obj/Release/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/obj/Release diff --git a/trunk/VSQ/obj/Release/CVS/Root b/trunk/VSQ/obj/Release/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/obj/Release/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/obj/Release/CVS/Template b/trunk/VSQ/obj/Release/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Entries b/trunk/VSQ/obj/Release/Refactor/CVS/Entries new file mode 100644 index 0000000..3f0496f --- /dev/null +++ b/trunk/VSQ/obj/Release/Refactor/CVS/Entries @@ -0,0 +1 @@ +D diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Extra b/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Extra new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Extra.Old b/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Extra.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Old b/trunk/VSQ/obj/Release/Refactor/CVS/Entries.Old new file mode 100644 index 0000000..e69de29 diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Repository b/trunk/VSQ/obj/Release/Refactor/CVS/Repository new file mode 100644 index 0000000..3716e42 --- /dev/null +++ b/trunk/VSQ/obj/Release/Refactor/CVS/Repository @@ -0,0 +1 @@ +lipsync/VSQ/obj/Release/Refactor diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Root b/trunk/VSQ/obj/Release/Refactor/CVS/Root new file mode 100644 index 0000000..a516206 --- /dev/null +++ b/trunk/VSQ/obj/Release/Refactor/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@cvs.sourceforge.jp:/cvsroot/lipsync diff --git a/trunk/VSQ/obj/Release/Refactor/CVS/Template b/trunk/VSQ/obj/Release/Refactor/CVS/Template new file mode 100644 index 0000000..e69de29 diff --git a/trunk/lang2po/Program.cs b/trunk/lang2po/Program.cs new file mode 100644 index 0000000..2563939 --- /dev/null +++ b/trunk/lang2po/Program.cs @@ -0,0 +1,79 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +using Boare.Lib.AppUtil; + +namespace Boare { + class lang2po { + static void Main( string[] args ) { + Console.WriteLine( "input source *.lang file name" ); + string name = Console.ReadLine(); + Console.WriteLine( "input result file name" ); + string result = Console.ReadLine(); + if ( File.Exists( result ) ) { + Console.WriteLine( "error; file \"" + result + "\" already exists." ); + return; + } + Messaging.AppendFromFile( "template.po" ); + Messaging.Language = "template"; + Dictionary dict = new Dictionary(); + using ( StreamReader sr = new StreamReader( name ) ) { + string line; + while ( (line = sr.ReadLine()) != null ) { + string[] spl = line.Split( "\t".ToCharArray() ); + if ( spl.Length >= 2 ) { + string id = spl[0]; + string item = spl[1]; + item = item.Replace( "\"", "\\\"" ); + dict.Add( id, item ); + } + } + } + using ( StreamWriter sw = new StreamWriter( result, false, Encoding.UTF8 ) ) { + sw.WriteLine( "msgid \"\"" ); + sw.WriteLine( "msgstr \"\"" ); + sw.WriteLine( "\"Project-Id-Version: \\n\"" ); + sw.WriteLine( "\"Report-Msgid-Bugs-To: \\n\"" ); + DateTime now = DateTime.Now; + DateTime utc = now.ToUniversalTime(); + DateTime local = now.ToLocalTime(); + TimeSpan ts = local.Subtract( utc ); + int minutes = (int)ts.TotalMinutes; + int absmin = Math.Abs( minutes ); + int hours = absmin / 60; + int mins = absmin - hours * 60; + string dt = (minutes > 0) ? "+" : "-"; + dt += hours.ToString( "00" ) + mins.ToString( "00" ); + sw.WriteLine( "\"POT-Creation-Date: " + local.Year + "-" + local.Month.ToString( "00" ) + "-" + local.Day.ToString( "00" ) + " " + local.Hour.ToString( "00" ) + ":" + local.Minute.ToString( "00" ) + dt + "\\n\"" ); + sw.WriteLine( "\"PO-Revision-Date: \\n\"" ); + sw.WriteLine( "\"Last-Translator: \\n\"" ); + sw.WriteLine( "\"Language-Team: \\n\"" ); + sw.WriteLine( "\"MIME-Version: 1.0\\n\"" ); + sw.WriteLine( "\"Content-Type: text/plain; charset=UTF-8\\n\"" ); + sw.WriteLine( "\"Content-Transfer-Encoding: 8bit\\n\"" ); + sw.WriteLine( "\"X-Poedit-Language: \\n\"" ); + sw.WriteLine( "\"X-Poedit-Country: \\n\"" ); + sw.WriteLine( "\"X-Poedit-SourceCharset: utf-8\\n\"" ); + sw.WriteLine( "\"X-Poedit-Basepath: .\\\\" + "\\n\"" ); + sw.WriteLine( "\"X-Poedit-KeywordsList: _\\n\"" ); + sw.WriteLine( "\"X-Poedit-SearchPath-0: Editor\\n\"" ); + sw.WriteLine( "\"X-Poedit-SearchPath-1: Common\\n\"" ); + sw.WriteLine( "\"X-Poedit-SearchPath-2: AviFile\\n\"" ); + string[] keys = Messaging.GetKeys( "template" ); + foreach ( string key in keys ) { + string oldid = Messaging.GetMessage( key ); + if ( dict.ContainsKey( oldid ) ) { + string item = dict[oldid]; + item = item.Replace( "\"", "\\\"" ); + string key2 = key.Replace( "\"", "\\\"" ); + sw.WriteLine( "msgid \"" + key2 + "\"" ); + sw.WriteLine( "msgstr \"" + item + "\"" ); + sw.WriteLine(); + } + } + } + } + } +} diff --git a/trunk/lang2po/Properties/AssemblyInfo.cs b/trunk/lang2po/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c488382 --- /dev/null +++ b/trunk/lang2po/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "lang2po" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "" )] +[assembly: AssemblyProduct( "lang2po" )] +[assembly: AssemblyCopyright( "Copyright ツゥ 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧 +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible( false )] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid( "8154a642-4ae5-4ca6-83f9-95df9878de3d" )] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/trunk/lang2po/lang2po.csproj b/trunk/lang2po/lang2po.csproj new file mode 100644 index 0000000..bdb42a1 --- /dev/null +++ b/trunk/lang2po/lang2po.csproj @@ -0,0 +1,70 @@ +サソ + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {D60A11E0-8FFA-4CBC-A2F9-7365AFDF47A9} + Exe + Properties + lang2po + lang2po + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + PreserveNewest + + + + + {0C58B068-272F-4390-A14F-3D72AFCF3DFB} + Boare.Lib.AppUtil + + + + + \ No newline at end of file diff --git a/trunk/lang2po/template.po b/trunk/lang2po/template.po new file mode 100644 index 0000000..2737499 --- /dev/null +++ b/trunk/lang2po/template.po @@ -0,0 +1,1076 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-11-03 23:44+0900\n" +"PO-Revision-Date: \n" +"Last-Translator: kbinani \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: UNITED STATES\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _;gettext\n" +"X-Poedit-Basepath: .\\\n" +"X-Poedit-SearchPath-0: Editor\n" +"X-Poedit-SearchPath-1: Common\n" +"X-Poedit-SearchPath-2: AviFile\n" + +#: Editor/AviOutput.cs:111 +msgid "Directory" +msgstr "DIRECTORY" + +#: Editor/AviOutput.cs:111 +msgid "does not exist." +msgstr "DOES_NOT_EXIST" + +#: Editor/AviOutput.cs:112 +#: Editor/AviOutput.cs:137 +msgid "Error" +msgstr "ERROR" + +#: Editor/AviOutput.cs:122 +msgid "already exists." +msgstr "ALREADY_EXISTS" + +#: Editor/AviOutput.cs:122 +msgid "Do you want to replace it?" +msgstr "REPLACE_IT" + +#: Editor/AviOutput.cs:136 +msgid "Invalid value has been entered" +msgstr "INVALID_VALUE" + +#: Editor/AviOutput.cs:159 +msgid "Avi file(*.avi)|*.avi" +msgstr "FILTER_AVI" + +#: Editor/AviOutput.cs:159 +msgid "All Files(*.*)|*.*" +msgstr "FILTER_ALLFILES" + +#: Editor/AviOutput.designer.cs:302 +msgid "Cancel" +msgstr "CANCEL" + +#: Editor/AviOutput.designer.cs:303 +msgid "Save" +msgstr "SAVE" + +#: Editor/AviOutput.designer.cs:304 +msgid "file name" +msgstr "FILE_NAME" + +#: Editor/AviOutput.designer.cs:305 +msgid "Video" +msgstr "VIDEO" + +#: Editor/AviOutput.designer.cs:306 +msgid "Audio" +msgstr "AUDIO" + +#: Editor/AviOutput.designer.cs:307 +msgid "Convert to FLV" +msgstr "CONVERT_TO_FLV" + +#: Editor/AviOutput.designer.cs:308 +msgid "Merge wave to AVI" +msgstr "MERGE_WAVE_TO_AVI" + +#: Editor/AviOutput.designer.cs:309 +msgid "Delete intermediate file" +msgstr "DELETE_INTERMEDIATE" + +#: Editor/AviOutput.designer.cs:310 +msgid "Video Compression" +msgstr "VIDEO_COMPRESSION" + +#: Editor/AviOutput.designer.cs:311 +msgid "Specify output range" +msgstr "OUTPUT_RANGE" + +#: Editor/AviOutput.designer.cs:312 +msgid "Start" +msgstr "START" + +#: Editor/AviOutput.designer.cs:313 +msgid "End" +msgstr "END" + +#: Editor/DisplacementControl.designer.cs:187 +msgid "Edit motion curve" +msgstr "MOTION_CURVE" + +#: Editor/DisplacementControl.designer.cs:188 +msgid "Close" +msgstr "CLOSE" + +#: Editor/DisplacementControl.designer.cs:189 +msgid "File" +msgstr "FILE" + +#: Editor/DisplacementControl.designer.cs:190 +msgid "Redo" +msgstr "REDO" + +#: Editor/DisplacementControl.designer.cs:191 +msgid "Undo" +msgstr "UNDO" + +#: Editor/DisplacementControl.designer.cs:192 +msgid "Edit" +msgstr "EDIT" + +#: Editor/EditEntry.Designer.cs:207 +msgid "ON time (sec)" +msgstr "ON_TIME" + +#: Editor/EditEntry.Designer.cs:208 +msgid "OFF time (sec)" +msgstr "OFF_TIME" + +#: Editor/EditEntry.Designer.cs:210 +#: Editor/EnvConfiguration.Designer.cs:827 +msgid "OK" +msgstr "OK" + +#: Editor/EditEntry.Designer.cs:211 +msgid "Use this value" +msgstr "USE_THIS_VALUE" + +#: Editor/EditEntry.Designer.cs:212 +msgid "Expandable range of this entry" +msgstr "EXPANDABLE_RANGE" + +#: Editor/EditEntry.Designer.cs:213 +#: Editor/Form1.cs:1348 +msgid "Numeric entry" +msgstr "INPUT_NUMBER" + +#: Editor/EnvConfiguration.cs:250 +#: Editor/EnvConfiguration.cs:268 +msgid "Executable file(*.exe)|*.exe" +msgstr "FILTER_EXE" + +#: Editor/EnvConfiguration.Designer.cs:829 +msgid "Language" +msgstr "LANGUAGE" + +#: Editor/EnvConfiguration.Designer.cs:830 +#: Editor/Form1.designer.cs:1160 +msgid "Option" +msgstr "OPTION" + +#: Editor/EnvConfiguration.Designer.cs:832 +msgid "User Config" +msgstr "USER_CONFIG" + +#: Editor/EnvConfiguration.Designer.cs:833 +msgid "Appearance" +msgstr "APPEARANCE" + +#: Editor/EnvConfiguration.Designer.cs:834 +msgid "lip-sync Option" +msgstr "LIPSYNC_OPTION" + +#: Editor/EnvConfiguration.Designer.cs:835 +msgid "System" +msgstr "SYSTEM" + +#: Editor/EnvConfiguration.Designer.cs:837 +msgid "Title of timeline" +msgstr "TITLE_OF_TIMELINE" + +#: Editor/EnvConfiguration.Designer.cs:838 +msgid "VSQ Entry" +msgstr "VSQ_ENTRY" + +#: Editor/EnvConfiguration.Designer.cs:839 +msgid "Plugin Entry" +msgstr "PLUGIN_ENTRY" + +#: Editor/EnvConfiguration.Designer.cs:840 +msgid "Another Entry" +msgstr "ANOTHER_ENTRY" + +#: Editor/EnvConfiguration.Designer.cs:841 +msgid "Entry height (pixel)" +msgstr "ENTRY_HEIGHT" + +#: Editor/EnvConfiguration.Designer.cs:842 +#: Editor/EnvConfiguration.Designer.cs:843 +#: Editor/EnvConfiguration.Designer.cs:844 +#: Editor/EnvConfiguration.Designer.cs:845 +#: Editor/EnvConfiguration.Designer.cs:855 +msgid "Change" +msgstr "CHANGE" + +#: Editor/EnvConfiguration.Designer.cs:846 +msgid "Check phonetic symbol to configure detailed mouth shape control" +msgstr "CHECK_PHONETIC_SYMBOL" + +#: Editor/EnvConfiguration.Designer.cs:847 +msgid "Close mouth before pronunciation" +msgstr "CLOSED_MOUTH" + +#: Editor/EnvConfiguration.Designer.cs:848 +msgid "\"i\" shaped mouth before pronunciation" +msgstr "I_SHAPED_MOUTH" + +#: Editor/EnvConfiguration.Designer.cs:849 +msgid "\"u\" shaped mouth before pronunciation" +msgstr "U_SHAPED_MOUTH" + +#: Editor/EnvConfiguration.Designer.cs:850 +msgid "Color" +msgstr "COLOR" + +#: Editor/EnvConfiguration.Designer.cs:851 +msgid "Design" +msgstr "DESIGN" + +#: Editor/EnvConfiguration.Designer.cs:852 +msgid "Path of ffmpeg" +msgstr "PATH_OF_FFMPEG" + +#: Editor/EnvConfiguration.Designer.cs:853 +msgid "Path of mencoder" +msgstr "PATH_OF_MENCODER" + +#: Editor/EnvConfiguration.Designer.cs:854 +msgid "Font" +msgstr "FONT" + +#: Editor/EnvConfiguration.Designer.cs:856 +#: Editor/EnvConfiguration.Designer.cs:861 +msgid "Another settings" +msgstr "ANOTHER_CONFIG" + +#: Editor/EnvConfiguration.Designer.cs:857 +msgid "Close mouth when same vowels repeated" +msgstr "SERIAL_VOWEL" + +#: Editor/EnvConfiguration.Designer.cs:858 +msgid "Encoder/Decoder" +msgstr "ENCODER_DECODER" + +#: Editor/EnvConfiguration.Designer.cs:859 +msgid "Generate character automaticaly when importing vsq" +msgstr "GEN_CHARACTER_AUTOMATICALY" + +#: Editor/EnvConfiguration.Designer.cs:860 +msgid "Threshold silence length(sec)" +msgstr "COMBINE_THRESHOLD" + +#: Editor/EnvConfiguration.Designer.cs:862 +msgid "Use preview-enabled dialog in character selection" +msgstr "USE_PREVIEWABLE_DIALOG" + +#: Editor/EnvConfiguration.Designer.cs:863 +msgid "Reload language configurations" +msgstr "RELOAD_LANG_CONFIG" + +#: Editor/EnvConfiguration.Designer.cs:864 +msgid "Operation" +msgstr "OPERATION" + +#: Editor/EnvConfiguration.Designer.cs:865 +msgid "mouse wheel rate" +msgstr "MOUSE_WHEEL_RATE" + +#: Editor/Form1.cs:853 +msgid " has been changed. Do you wish to save changes to file?" +msgstr "SAVE_FILE" + +#: Editor/Form1.cs:855 +msgid "Do you wish to save changes to file?" +msgstr "SAVE_FILE_CREATE" + +#: Editor/Form1.cs:1206 +#: Editor/Form1.cs:2936 +#: Editor/Form1.cs:3859 +msgid "Video size configuration" +msgstr "SET_VIDEO_SIZE" + +#: Editor/Form1.cs:1215 +msgid "Read from VSQ file" +msgstr "READ_VSQ" + +#: Editor/Form1.cs:1219 +#: Editor/Form1.designer.cs:1143 +msgid "Edit character" +msgstr "EDIT_CHARACTER" + +#: Editor/Form1.cs:1222 +#: Editor/Form1.cs:1260 +#: Editor/Form1.cs:1280 +#: Editor/Form1.cs:1343 +#: Editor/Form1.cs:1366 +msgid "Preview image" +msgstr "PREVIEW_IMAGE" + +#: Editor/Form1.cs:1223 +#: Editor/Form1.cs:1292 +#: Editor/Form1.cs:1378 +#: Editor/Form1_EventHandler.cs:975 +msgid "Image placement" +msgstr "SET_IMAGE_POSITION" + +#: Editor/Form1.cs:1224 +#: Editor/Form1.cs:1296 +#: Editor/Form1.cs:1382 +#: Editor/Form1_EventHandler.cs:506 +msgid "Scale setting" +msgstr "SET_SCALE" + +#: Editor/Form1.cs:1226 +msgid "Generate wink" +msgstr "GENERATE_WINK" + +#: Editor/Form1.cs:1230 +#: Editor/Form1.cs:1459 +msgid "Delete" +msgstr "DELETE" + +#: Editor/Form1.cs:1233 +msgid "Add track" +msgstr "ADD_TRACK" + +#: Editor/Form1.cs:1247 +msgid "Generate Lipsync from this track" +msgstr "GEN_LIPSYNC_FROM_THIS" + +#: Editor/Form1.cs:1256 +#: Editor/Form1.cs:1269 +#: Editor/Form1.cs:1308 +msgid "Note ON from here" +msgstr "NOTE_ON" + +#: Editor/Form1.cs:1275 +#: Editor/Form1.cs:1361 +msgid "Set image" +msgstr "SET_IMAGE" + +#: Editor/Form1.cs:1284 +#: Editor/Form1.cs:1370 +msgid "Change image" +msgstr "CHANGE_IMAGE" + +#: Editor/Form1.cs:1289 +#: Editor/Form1.cs:1375 +msgid "Image" +msgstr "IMAGE" + +#: Editor/Form1.cs:1320 +#: Editor/Form1.cs:1435 +msgid "Paste" +msgstr "PASTE" + +#: Editor/Form1.cs:1338 +msgid "Note OFF" +msgstr "NOTE_OFF" + +#: Editor/Form1.cs:1351 +msgid "Expand" +msgstr "EXPAND" + +#: Editor/Form1.cs:1391 +msgid "Plugin config. of this entry" +msgstr "THIS_PLUGIN_CONFIG" + +#: Editor/Form1.cs:1398 +#: Editor/Form1.cs:1421 +msgid "Copy" +msgstr "COPY" + +#: Editor/Form1.cs:1402 +msgid "Cut" +msgstr "CUT" + +#: Editor/Form1.cs:1406 +msgid "Split entry" +msgstr "SPLIT" + +#: Editor/Form1.cs:1418 +msgid "Timeline" +msgstr "TIMELINE" + +#: Editor/Form1.cs:1428 +msgid "Copy On/Off inverted" +msgstr "INVERSE_ON_OFF" + +#: Editor/Form1.cs:1442 +msgid "Import from TEXT" +msgstr "IMPORT_FROM_TEXT" + +#: Editor/Form1.cs:1446 +msgid "Export to TEXT" +msgstr "EXPORT_TO_TEXT" + +#: Editor/Form1.cs:1464 +msgid "Delete entries" +msgstr "DELETE_ENTRIES" + +#: Editor/Form1.cs:1471 +msgid "Shift this time-line" +msgstr "SHIFT_THIS_TIMELINE" + +#: Editor/Form1.cs:1957 +#: Editor/Form1.cs:1997 +#: Editor/Form1.cs:2707 +msgid "VSQ Tracks" +msgstr "VSQ_TRACK" + +#: Editor/Form1.cs:1969 +msgid "Character" +msgstr "CHARACTER" + +#: Editor/Form1.cs:1977 +#: Editor/Form1.cs:2709 +#: Editor/Form1.cs:3305 +msgid "Another images" +msgstr "ANOTHER_IMAGE" + +#: Editor/Form1.cs:1984 +#: Editor/Form1.cs:2681 +msgid "Plugin" +msgstr "PLUGIN" + +#: Editor/Form1.cs:2936 +msgid "Input video length in second" +msgstr "INPUT_VIDEO_LENGTH" + +#: Editor/Form1.cs:2964 +#: Editor/Form1.designer.cs:1152 +#: Editor/Form1_EventHandler.cs:78 +msgid "Shift all time-tables" +msgstr "SHIFT_TIME_TABLE" + +#: Editor/Form1.cs:2964 +#: Editor/Form1_EventHandler.cs:78 +msgid "Input shift time in second (you can enter minus value)" +msgstr "INPUT_SHIFT_TIME" + +#: Editor/Form1.cs:3223 +#: Editor/Form1.cs:3490 +msgid "This operation will overwrite all exisiting time-tables, and can NOT undo. Would you like to continue?" +msgstr "WARN_DELETE_ALL_TRACKS" + +#: Editor/Form1.cs:3223 +msgid "( In case you want to append new track, please right-click [VSQ Tracks] to select [Read from VSQ file]. )" +msgstr "INCASE_APPEND_TRACK" + +#: Editor/Form1.cs:3224 +#: Editor/Form1.cs:3491 +#: Editor/Form1_EventHandler.cs:548 +#: Editor/Form1_EventHandler.cs:925 +#: Editor/Form1_EventHandler.cs:1090 +#: Editor/Form1_EventHandler.cs:1100 +msgid "Confirmation" +msgstr "CONFIRMATION" + +#: Editor/Form1.cs:3239 +#: Editor/Form1.designer.cs:1187 +#: Editor/Form1_EventHandler.cs:898 +msgid "VOCALOID2 Sequence File(*.vsq)|*.vsq" +msgstr "FILTER_VSQ" + +#: Editor/Form1.cs:3509 +#: Editor/Form1.cs:4408 +#: Editor/Form1.designer.cs:1169 +#: Editor/Form1.designer.cs:1224 +#: Editor/Form1_Preview.cs:353 +msgid "Play" +msgstr "PLAY" + +#: Editor/Form1.cs:3514 +msgid "File not found" +msgstr "FILE_NOT_FOUND" + +#: Editor/Form1.cs:3538 +#: Editor/Form1.cs:3569 +#: Editor/Form1.cs:3583 +msgid "Extension must be *.lse" +msgstr "INVALID_EXTENSION" + +#: Editor/Form1.cs:3650 +msgid "Failed file saving" +msgstr "FAILED_FILE_SAVING" + +#: Editor/Form1.cs:3748 +msgid "Failed file reading" +msgstr "FAILED_FILE_READING" + +#: Editor/Form1.cs:3859 +msgid "Width" +msgstr "WIDTH" + +#: Editor/Form1.cs:3859 +msgid "Height" +msgstr "HEIGHT" + +#: Editor/Form1.cs:3992 +msgid "Expand all" +msgstr "EXPAND_ALL" + +#: Editor/Form1.cs:3993 +msgid "Fold all" +msgstr "FOLD_ALL" + +#: Editor/Form1.cs:4028 +msgid "(no name)" +msgstr "NO_NAME" + +#: Editor/Form1.cs:4048 +#: Editor/Form1.designer.cs:1164 +msgid "Disable preview" +msgstr "DISABLE_PREVIEW" + +#: Editor/Form1.cs:4054 +#: Editor/Form1.designer.cs:1162 +msgid "Enable preview" +msgstr "ENABLE_PREVIEW" + +#: Editor/Form1.cs:4168 +#: Editor/Form1.designer.cs:1183 +msgid "Hide object list" +msgstr "DISABLE_PROPERTY" + +#: Editor/Form1.cs:4174 +#: Editor/Form1.designer.cs:1181 +msgid "Show object list" +msgstr "ENABLE_PROPERTY" + +#: Editor/Form1.cs:4412 +msgid "Audio file(*.mp3;*.wav)|*.mp3;*.wav" +msgstr "FILTER_AUDIO" + +#: Editor/Form1.cs:4430 +#: Editor/Form1.designer.cs:1173 +msgid "Go to specified frame" +msgstr "GOTO_SPECIFIED_FRAME" + +#: Editor/Form1.cs:4430 +msgid "please input frame index" +msgstr "REQUIRE_FRAME_INDEX" + +#: Editor/Form1.cs:4446 +msgid "invalid frame index" +msgstr "INVALID_FRAME_INDEX" + +#: Editor/Form1.designer.cs:1129 +msgid "Open" +msgstr "OPEN" + +#: Editor/Form1.designer.cs:1131 +msgid "Save As" +msgstr "SAVE_AS" + +#: Editor/Form1.designer.cs:1132 +msgid "Import" +msgstr "IMPORT2" + +# msgid "Import" +# msgstr "IMPORT" +#: Editor/Form1.designer.cs:1133 +msgid "from RipSync data" +msgstr "RIPSYNC_DATA" + +#: Editor/Form1.designer.cs:1134 +msgid "Open VSQ file" +msgstr "OPEN_VSQ" + +#: Editor/Form1.designer.cs:1135 +msgid "Exit" +msgstr "EXIT" + +#: Editor/Form1.designer.cs:1139 +msgid "Help" +msgstr "HELP" + +#: Editor/Form1.designer.cs:1140 +msgid "Plugin information" +msgstr "PLUGIN_INFO" + +#: Editor/Form1.designer.cs:1141 +msgid "About LipSync" +msgstr "VERSION_INFO" + +#: Editor/Form1.designer.cs:1142 +msgid "Debug" +msgstr "DEBUG" + +#: Editor/Form1.designer.cs:1144 +msgid "Flip images horizontaly" +msgstr "FLIP_HORIZONTALY" + +#: Editor/Form1.designer.cs:1148 +msgid "Video size" +msgstr "VIDEO_SIZE" + +#: Editor/Form1.designer.cs:1149 +msgid "Frame rate" +msgstr "FRAME_RATE" + +#: Editor/Form1.designer.cs:1150 +msgid "Z order" +msgstr "Z_ORDER" + +#: Editor/Form1.designer.cs:1151 +msgid "Video length" +msgstr "CHANGE_VIDEO_LENGTH" + +#: Editor/Form1.designer.cs:1153 +msgid "View" +msgstr "VIEW" + +#: Editor/Form1.designer.cs:1154 +msgid "Zoom" +msgstr "ZOOM" + +#: Editor/Form1.designer.cs:1155 +msgid "Mooz" +msgstr "MOOZ" + +#: Editor/Form1.designer.cs:1156 +msgid "Set default scale" +msgstr "DEFAULT_SCALE" + +#: Editor/Form1.designer.cs:1157 +#: Editor/Form1.designer.cs:1219 +msgid "Move to Top" +msgstr "MOVE_TO_TOP" + +#: Editor/Form1.designer.cs:1158 +#: Editor/Form1.designer.cs:1218 +msgid "Move to End" +msgstr "MOVE_TO_END" + +#: Editor/Form1.designer.cs:1159 +msgid "Tool" +msgstr "TOOL" + +#: Editor/Form1.designer.cs:1166 +msgid "Plugin config" +msgstr "PLUGIN_CONFIG" + +#: Editor/Form1.designer.cs:1167 +msgid "Sync with Time table" +msgstr "SYNC_WITH_TIMETABLE" + +#: Editor/Form1.designer.cs:1168 +msgid "Add empty character" +msgstr "ADD_EMPTY_CHARACTER" + +#: Editor/Form1.designer.cs:1169 +#: Editor/Form1.designer.cs:1224 +#: Editor/Form1_Preview.cs:296 +msgid "Pause" +msgstr "PAUSE" + +#: Editor/Form1.designer.cs:1171 +msgid "Generate AVI" +msgstr "GENERATE_AVI" + +#: Editor/Form1.designer.cs:1172 +msgid "Chose sound file" +msgstr "CHOSE_SOUND_FILE" + +#: Editor/Form1.designer.cs:1174 +msgid "Stop writing avi" +msgstr "STOP_WRITING_AVI" + +#: Editor/Form1.designer.cs:1175 +msgid "Background color" +msgstr "BGCOLOR" + +#: Editor/Form1.designer.cs:1177 +msgid "Generate raw AVI" +msgstr "NON_COMPRESSED_AVI" + +#: Editor/Form1.designer.cs:1178 +msgid "Export" +msgstr "EXPORT" + +#: Editor/Form1.designer.cs:1179 +msgid "script for H@TWUNEBENCH" +msgstr "HATWUNE" + +#: Editor/Form1.designer.cs:1185 +msgid "Bug report" +msgstr "BUG_REPORT" + +#: Editor/Form1.designer.cs:1193 +msgid "Image Files(*.bmp,*.png,*.jpg,*.jpeg)|*.bmp;*.png;*.jpg;*.jpeg" +msgstr "FILTER_IMAGE" + +#: Editor/Form1.designer.cs:1202 +#: Editor/Form1.designer.cs:1209 +msgid "LipSync data file(*.lse)|*.lse" +msgstr "FILTER_LSE" + +#: Editor/Form1.designer.cs:1216 +msgid "Real time \"lipsync\"" +msgstr "REALTIME" + +#: Editor/Form1.designer.cs:1217 +msgid "Repeat play" +msgstr "REPEAT_PLAY" + +#: Editor/Form1.designer.cs:1220 +msgid "End repeat at" +msgstr "SET_REPEAT_END" + +#: Editor/Form1.designer.cs:1221 +msgid "Start repeat from" +msgstr "SET_REPEAT_START" + +#: Editor/Form1.designer.cs:1222 +msgid "Reset repeat region" +msgstr "RESET_REPEAT_REGION" + +#: Editor/Form1.designer.cs:1225 +msgid "Show VSQ tracks allways" +msgstr "SHOW_VSQ_ALLWAYS" + +#: Editor/Form1.designer.cs:1226 +msgid "Show bars" +msgstr "SHOW_BARS" + +#: Editor/Form1.designer.cs:1227 +msgid "Quantize" +msgstr "QUANTIZE" + +#: Editor/Form1.designer.cs:1228 +msgid "off" +msgstr "OFF" + +#: Editor/Form1.designer.cs:1229 +msgid "triplet" +msgstr "TRIPLET" + +#: Editor/Form1.designer.cs:1231 +#: Editor/FormObjectList.cs:60 +#: Editor/FormObjectList.Designer.cs:62 +msgid "List of object" +msgstr "LIST_OF_OBJECTS" + +#: Editor/Form1.designer.cs:1232 +msgid "Property" +msgstr "PROPERTY" + +#: Editor/Form1.designer.cs:1246 +msgid "Series bitmap" +msgstr "SERIES_BITMAP" + +#: Editor/Form1_AviOutput.cs:203 +msgid "insertion of wav file has failed" +msgstr "WAV_ADDITION_FAILED" + +#: Editor/Form1_AviOutput.cs:262 +msgid "" +"Initialization of video compression failed.\n" +"This video codec may require image width in multiples of certain number." +msgstr "AVI_INITIALIZATION_FAILED" + +#: Editor/Form1_AviOutput.cs:293 +msgid "FLV Progress" +msgstr "FLV_PROGRESS" + +#: Editor/Form1_AviOutput.cs:332 +msgid "AVI Progress" +msgstr "PROGRESS" + +#: Editor/Form1_EventHandler.cs:144 +#: Editor/Form1_EventHandler.cs:210 +msgid "Text file(*.txt)|*.txt" +msgstr "FILTER_TEXT" + +#: Editor/Form1_EventHandler.cs:506 +msgid "Please enter scale. (If entered value is minus, character or image will be flipped horizontally.)" +msgstr "ENTER_SCALE" + +#: Editor/Form1_EventHandler.cs:548 +msgid "" +"...clearing entries of selected time-table.\n" +"Would you like to continue?" +msgstr "CLEAR_ENTRIES" + +#: Editor/Form1_EventHandler.cs:924 +msgid "This operation will overwrite all exisiting tempo and time-signal information, and can NOT undo. Would you like to continue?" +msgstr "WARN_OVERWRITE_TIMESIG" + +#: Editor/Form1_EventHandler.cs:1090 +msgid "" +"...deleting selected character.\n" +"Would you like to continue?" +msgstr "DELETING_CHARACTER" + +#: Editor/Form1_EventHandler.cs:1100 +msgid "" +"...deleting selected track.\n" +"Would you like to continue?" +msgstr "DELETING_TRACK" + +#: Editor/FormSetFrameRate.cs:167 +msgid "failed getting frame rate" +msgstr "FAILED_GETTING_FRAME_RATE" + +#: Editor/FormSetFrameRate.Designer.cs:186 +msgid "detail" +msgstr "DETAIL" + +#: Editor/FormSetFrameRate.Designer.cs:187 +msgid "configure frame rate" +msgstr "CONFIG_FRAME_RATE" + +#: Editor/FormSetFrameRate.Designer.cs:191 +msgid "denominator of frame rate" +msgstr "DENOMINATOR_OF_FRAME_RATE" + +#: Editor/FormSetFrameRate.Designer.cs:192 +msgid "numerator of frame rate" +msgstr "NUMERATOR_OF_FRAME_RATE" + +#: Editor/FormSetFrameRate.Designer.cs:194 +msgid "import frame rate from AVI file" +msgstr "TTIP_IMPORT_FRAME_RATE_FROM_AVI" + +#: Editor/GenerateCharacter.cs:121 +#: Editor/GenerateCharacter.cs:146 +#: Editor/GenerateCharacter.designer.cs:614 +#: Editor/GenerateCharacter.designer.cs:619 +msgid "LipSync Character Config(*.lsc)|*.lsc" +msgstr "FILTER_CHARACTER" + +#: Editor/GenerateCharacter.cs:147 +#: Editor/GenerateCharacter.cs:883 +msgid "LipSync Character Config(content.xml)|content.xml" +msgstr "FILTER_CHARACTER_XML" + +#: Editor/GenerateCharacter.cs:516 +msgid "NOT editable" +msgstr "NOT_EDITABLE" + +#: Editor/GenerateCharacter.cs:640 +msgid "Title of image" +msgstr "TITLE_OF_IMAGE" + +#: Editor/GenerateCharacter.cs:641 +msgid "Input the title of image" +msgstr "INPUT_IMAGE_TITLE" + +#: Editor/GenerateCharacter.cs:657 +msgid "This image title has been already registered" +msgstr "TITLE_ALREADY_EXIST" + +#: Editor/GenerateCharacter.cs:813 +#: Editor/GenerateCharacter.designer.cs:602 +#: Editor/GenerateCharacter.designer.cs:638 +msgid "Change title" +msgstr "CHANGE_TITLE" + +#: Editor/GenerateCharacter.cs:814 +msgid "Input new title" +msgstr "INPUT_NEW_TITLE" + +#: Editor/GenerateCharacter.designer.cs:586 +#: Editor/GenerateCharacter.designer.cs:589 +msgid "Title" +msgstr "TITLE" + +#: Editor/GenerateCharacter.designer.cs:587 +#: Editor/GenerateCharacter.designer.cs:588 +msgid "Tag" +msgstr "TAG" + +#: Editor/GenerateCharacter.designer.cs:590 +#: Editor/GenerateCharacter.designer.cs:642 +msgid "Up" +msgstr "UP" + +#: Editor/GenerateCharacter.designer.cs:591 +#: Editor/GenerateCharacter.designer.cs:637 +msgid "Down" +msgstr "DOWN" + +#: Editor/GenerateCharacter.designer.cs:592 +#: Editor/GenerateCharacter.designer.cs:635 +msgid "Add" +msgstr "ADD" + +#: Editor/GenerateCharacter.designer.cs:595 +msgid "Select image file" +msgstr "SELECT_IMAGE_FILE" + +#: Editor/GenerateCharacter.designer.cs:596 +#: Editor/GenerateCharacter.designer.cs:641 +msgid "Select transparent color" +msgstr "SELECT_TRANSPARENT_COLOR" + +#: Editor/GenerateCharacter.designer.cs:600 +msgid "Character name" +msgstr "CHARACTER_NAME" + +#: Editor/GenerateCharacter.designer.cs:604 +msgid "Selected image" +msgstr "SELECTED_IMAGE" + +#: Editor/GenerateCharacter.designer.cs:607 +msgid "Open *.rsi" +msgstr "OPEN_RSI" + +#: Editor/GenerateCharacter.designer.cs:610 +msgid "Save as *.rsi" +msgstr "SAVE_AS_XML" + +#: Editor/GenerateCharacter.designer.cs:611 +msgid "Save as XML" +msgstr "SAVE_AS_XML" + +#: Editor/GenerateCharacter.designer.cs:623 +#: Editor/GenerateCharacter.designer.cs:639 +msgid "Reset image" +msgstr "RESET_IMAGE" + +#: Editor/GenerateCharacter.designer.cs:625 +#: Editor/GenerateCharacter.designer.cs:630 +msgid "RipSync Image(*.rsi)|*.rsi" +msgstr "FILTER_RSI" + +#: Editor/PasteModeDialog.Designer.cs:112 +msgid "Specify paste mode" +msgstr "SPECIFY_PASTE_MODE" + +#: Editor/PasteModeDialog.Designer.cs:114 +msgid "Interrupt" +msgstr "INTERRUPT" + +#: Editor/PasteModeDialog.Designer.cs:115 +msgid "Overwrite" +msgstr "OVERWRITE" + +#: Editor/Previewer.Designer.cs:297 +msgid "Stop" +msgstr "STOP" + +#: Editor/Previewer.Designer.cs:298 +msgid "Stretch image" +msgstr "STRETCH_IMAGE" + +#: Editor/Previewer.Designer.cs:299 +msgid "Specified size" +msgstr "SPECIFIED_SIZE" + +#: Editor/Property.Designer.cs:241 +msgid "Add telop" +msgstr "ADD_TELOP" + +#: Editor/Property.Designer.cs:242 +msgid "Delte telop" +msgstr "DELETE_TELOP" + +#: Editor/SelectCharacter.designer.cs:219 +msgid "Custom" +msgstr "CUSTOM" + +#: Editor/SelectCharacter.designer.cs:220 +#: Editor/SelectCharacter.designer.cs:224 +#: Editor/SelectCharacter.designer.cs:225 +msgid "Built-in" +msgstr "BUILT_IN" + +#: Editor/SelectCharacter.designer.cs:221 +msgid "Select character to generate lip-sync" +msgstr "SELECT_CHARACTER" + +#: Editor/SelectCharacter.designer.cs:226 +msgid "Character selection" +msgstr "CHARACTER_SELECTION" + +#: Editor/TrackSelecter.designer.cs:141 +msgid "Select track" +msgstr "SELECT_TRACK" + +#: Editor/TrackSelecter.designer.cs:142 +msgid "import tempo and time-signal information" +msgstr "IMPORT_TEMPO_AND_TIMESIG" + +#: Editor/VersionInfoEx.cs:191 +#: Editor/VersionInfoEx.Designer.cs:118 +msgid "credit" +msgstr "CREDIT" + +#: Editor/Winker.Designer.cs:261 +msgid "Wink interval (sec)" +msgstr "WINK_INTERVAL" + +#: Editor/Winker.Designer.cs:262 +msgid "Randomize" +msgstr "RANDOMIZE" + +#: Editor/Winker.Designer.cs:263 +msgid "Closed Eye" +msgstr "CLOSED_EYE" + +#: Editor/Winker.Designer.cs:264 +msgid "In-between Image" +msgstr "IN_BETWEEN_IMAGE" + +#: Editor/Winker.Designer.cs:265 +msgid "Eye-closing frames" +msgstr "EYE_CLOSING_FRAME" + +#: Editor/Winker.Designer.cs:268 +msgid "Limit start time" +msgstr "START_TIME_LIMITATION" + +#: Editor/Winker.Designer.cs:269 +msgid "Limit end time" +msgstr "END_TIME_LIMITATION" + +#: Editor/ZOrder.Designer.cs:156 +msgid "Select target item, and push [Up] or [Down] button" +msgstr "SELECT_TARGET_ITEM" + +#: Editor/RipSync/RsiWriter.cs:208 +msgid "Image directory already exists. Would you like to overwrite them?" +msgstr "WARN_EXIST_SAME_FOLDER" + +#: Editor/RipSync/RsiWriter.cs:209 +msgid "warning" +msgstr "WARNING" + +#~ msgid "Save as *.RSI" +#~ msgstr "SAVE_AS_RSI" +#~ msgid "Copy time-line" +#~ msgstr "COPY_TIME_LINE" +#~ msgid "Paste time-line" +#~ msgstr "PASTE_TIME_LINE" +#~ msgid "Window" +#~ msgstr "WINDOW" +#~ msgid "Show preview" +#~ msgstr "SHOW_PREVIEW" +#~ msgid "Go to preview" +#~ msgstr "GOTO_PREVIEW" +#~ msgid "select configuration item from the list box below" +#~ msgstr "SELECT_CONFIG_TARGET_BELOW" +#~ msgid "" +#~ "AVI file size will exceed 2Gbyte.\n" +#~ "Do you wish to continue?" +#~ msgstr "OVER_2GB" +#~ msgid "Input frame rate" +#~ msgstr "INPUT_FRAME_RATE" +#~ msgid "Generate telop from VSQ" +#~ msgstr "GENERATE_TELOP_FROM_VSQ" +#~ msgid "" +#~ "Image title can't be set to \"base\", \"a\", \"aa\", \"i\", \"u\", \"e\", " +#~ "\"o\", \"xo\", \"nn\"" +#~ msgstr "INVALID_IMAGE_TITLE" +#~ msgid "Object name" +#~ msgstr "OBJECT_NAME" +#~ msgid "(Non-compressed)" +#~ msgstr "RAW" + diff --git a/trunk/makefile b/trunk/makefile new file mode 100644 index 0000000..9def7aa --- /dev/null +++ b/trunk/makefile @@ -0,0 +1,64 @@ +CP=cp +RM=rm + +all: IPlugin/IPlugin.dll ../Boare.Lib.Vsq/Boare.Lib.Vsq.dll ../Boare.Lib.Media/Boare.Lib.Media.dll \ + ../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll Background/Background.dll \ + NicoComment/NicoComment.dll VFlip/VFlip.dll ../Boare.Lib.Swf/Boare.Lib.Swf.dll ../bocoree/bocoree.dll + $(CP) IPlugin/IPlugin.dll LipSync/IPlugin.dll + $(CP) ../Boare.Lib.Vsq/Boare.Lib.Vsq.dll LipSync/Boare.Lib.Vsq.dll + $(CP) ../Boare.Lib.Media/Boare.Lib.Media.dll LipSync/Boare.Lib.Media.dll + $(CP) ../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll LipSync/Boare.Lib.AppUtil.dll + $(CP) Background/Background.dll LipSync/Background.dll + $(CP) NicoComment/NicoComment.dll LipSync/NicoComment.dll + $(CP) VFlip/VFlip.dll LipSync/VFlip.dll + $(CP) ../Boare.Lib.Swf/Boare.Lib.Swf.dll LipSync/Boare.Lib.Swf.dll + $(CP) ../bocoree/bocoree.dll LipSync/bocoree.dll + cd LipSync && $(MAKE) CP=$(CP) + +../bocoree/bocoree.dll: + cd ../bocoree && $(MAKE) + +../Boare.Lib.Swf/Boare.Lib.Swf.dll: + cd ../Boare.Lib.Swf && $(MAKE) + +VFlip/VFlip.dll: VFlip/IPlugin.dll + cd VFlip && $(MAKE) + +VFlip/IPlugin.dll: IPlugin/IPlugin.dll + cp IPlugin/IPlugin.dll VFlip/IPlugin.dll + +NicoComment/NicoComment.dll: NicoComment/IPlugin.dll + cd NicoComment && $(MAKE) + +NicoComment/IPlugin.dll: IPlugin/IPlugin.dll + cp IPlugin/IPlugin.dll NicoComment/IPlugin.dll + +Background/Background.dll: Background/IPlugin.dll + cd Background && $(MAKE) + +Background/IPlugin.dll: IPlugin/IPlugin.dll + cp IPlugin/IPlugin.dll Background/IPlugin.dll + +IPlugin/IPlugin.dll: + cd IPlugin && $(MAKE) + +../Boare.Lib.Vsq/Boare.Lib.Vsq.dll: + cd ../Boare.Lib.Vsq && $(MAKE) + +../Boare.Lib.Media/Boare.Lib.Media.dll: + cd ../Boare.Lib.Media && $(MAKE) + +../Boare.Lib.AppUtil/Boare.Lib.AppUtil.dll: + cd ../Boare.Lib.AppUtil && $(MAKE) + +clean: + cd LipSync && $(MAKE) RM=$(RM) clean + cd IPlugin && $(MAKE) RM=$(RM) clean + cd ../Boare.Lib.Vsq && $(MAKE) RM=$(RM) clean + cd ../Boare.Lib.Media && $(MAKE) RM=$(RM) clean + cd ../Boare.Lib.AppUtil && $(MAKE) RM=$(RM) clean + cd Background && $(MAKE) RM=$(RM) clean + cd NicoComment && $(MAKE) RM=$(RM) clean + cd VFlip && $(MAKE) RM=$(RM) clean + cd ../Boare.Lib.Swf && $(MAKE) RM=$(RM) clean + cd ../bocoree && $(MAKE) RM=$(RM) clean