git-svn-id: http://svn.sourceforge.jp/svnroot/lipsync@5 b1f601f4-4f45-0410-8980-aecacb008692

This commit is contained in:
kbinani
2009-06-25 14:09:54 +00:00
parent 09b7366d95
commit 775d25e7fa
597 changed files with 0 additions and 64861 deletions

View File

@@ -1,45 +0,0 @@
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];
}*/
}

View File

@@ -1,264 +0,0 @@
/*
* 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 {
/// <summary>
/// LipSync共用の関数
/// </summary>
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;
/// <summary>
/// ファイルダイアログのFilterに指定しようとしている文字列がエラーを起こさないかどうかを確かめます
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 2つの整数の最大公約数を返します。
/// </summary>
/// <param name="m"></param>
/// <param name="n"></param>
/// <returns></returns>
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 );
}
/// <summary>
/// 画像から不透明領域を検出する。
/// </summary>
/// <param name="bmp"></param>
/// <returns></returns>
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を決める
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を決める
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を決める
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を決める
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;
}
}
/// <summary>
/// 指定したパスのファイルからイメージを読み込みます
/// </summary>
/// <param name="fpath">イメージファイルへのパス</param>
/// <returns></returns>
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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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
}
}

View File

@@ -1,290 +0,0 @@
/*================================================================================
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
{
/// <summary>
/// Defines the shape of hook procedures that can be called by the OpenFileDialog
/// </summary>
internal delegate IntPtr OfnHookProc( IntPtr hWnd, UInt16 msg, Int32 wParam, Int32 lParam );
/// <summary>
/// Values that can be placed in the OPENFILENAME structure, we don't use all of them
/// </summary>
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;
};
/// <summary>
/// Values that can be placed in the FlagsEx field of the OPENFILENAME structure
/// </summary>
internal class OpenFileNameFlagsEx
{
public const Int32 NoPlacesBar = 0x00000001;
};
/// <summary>
/// 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
/// </summary>
internal class WindowMessage
{
public const UInt16 InitDialog = 0x0110;
public const UInt16 Size = 0x0005;
public const UInt16 Notify = 0x004E;
};
/// <summary>
/// The possible notification messages that can be generated by the OpenFileDialog
/// We only look for CDN_SELCHANGE
/// </summary>
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);
}
/// <summary>
/// Messages that can be send to the common dialogs
/// We only use CDM_GETFILEPATH
/// </summary>
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;
};
/// <summary>
/// See the documentation for OPENFILENAME
/// </summary>
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;
};
/// <summary>
/// Part of the notification messages sent by the common dialogs
/// </summary>
[StructLayout(LayoutKind.Explicit)]
internal struct NMHDR
{
[FieldOffset(0)] public IntPtr hWndFrom;
[FieldOffset(4)] public UInt16 idFrom;
[FieldOffset(8)] public UInt16 code;
};
/// <summary>
/// Part of the notification messages sent by the common dialogs
/// </summary>
[StructLayout(LayoutKind.Explicit)]
internal struct OfNotify
{
[FieldOffset(0)] public NMHDR hdr;
[FieldOffset(12)] public IntPtr ipOfn;
[FieldOffset(16)] public IntPtr ipFile;
};
/// <summary>
/// Win32 window style constants
/// We use them to set up our child window
/// </summary>
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;
};
/// <summary>
/// Win32 "extended" window style constants
/// </summary>
internal class ExStyle
{
public const Int32 WsExNoParentNotify = 0x00000004;
public const Int32 WsExControlParent = 0x00010000;
};
/// <summary>
/// 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
/// </summary>
[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
};
/// <summary>
/// The rectangle structure used in Win32 API calls
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
};
/// <summary>
/// The point structure used in Win32 API calls
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal struct POINT
{
public int X;
public int Y;
};
/// <summary>
/// Contains all of the p/invoke declarations for the Win32 APIs used in this sample
/// </summary>
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();
}
}

View File

@@ -1,45 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent() {
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
}

View File

@@ -1,44 +0,0 @@
/*
* 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 {
/// <summary>
/// MouseWheelでIncrementずつ値を増減させることのできるNumericUpDown
/// </summary>
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;
}
}
}
}

View File

@@ -1,506 +0,0 @@
/*================================================================================
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 {
/// <summary>
/// The extensible OpenFileDialog
/// </summary>
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;
/// <summary>
/// Clients can implement handlers of this type to catch "selection changed" events
/// </summary>
public delegate void SelectionChangedHandler( string path );
/// <summary>
/// This event is fired whenever the user selects an item in the dialog
/// </summary>
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 ) {
}
/// <summary>
/// Sets up the data structures necessary to display the OpenFileDialog
/// </summary>
/// <param name="defaultExtension">The file extension to use if the user doesn't specify one (no "." required)</param>
/// <param name="fileName">You can specify a filename to appear in the dialog, although the user can change it</param>
/// <param name="filter">See the documentation for the OPENFILENAME structure for a description of filter strings</param>
/// <param name="userPanel">Any Windows Forms control, it will be placed inside the OpenFileDialog</param>
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(*.*)|*.*
// ↁE
// 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;
}
}
/// <summary>
/// The finalizer will release the unmanaged memory, if I should forget to call Dispose
/// </summary>
~OpenFileDialog() {
Dispose( false );
}
/// <summary>
/// Display the OpenFileDialog and allow user interaction
/// </summary>
/// <returns>true if the user clicked OK, false if they clicked cancel (or close)</returns>
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;
}
}
/// <summary>
/// Builds an in-memory Win32 dialog template. See documentation for DLGTEMPLATE.
/// </summary>
/// <returns>a pointer to an unmanaged memory buffer containing the dialog template</returns>
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;
}
/// <summary>
/// The hook procedure for window messages generated by the FileOpenDialog
/// </summary>
/// <param name="hWnd">the handle of the window at which this message is targeted</param>
/// <param name="msg">the message identifier</param>
/// <param name="wParam">message-specific parameter data</param>
/// <param name="lParam">mess-specific parameter data</param>
/// <returns></returns>
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;
}
}
}
/// <summary>
/// Layout the content of the OpenFileDialog, according to the overall size of the dialog
/// </summary>
/// <param name="hWnd">handle of window that received the WM_SIZE message</param>
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 );
}
}
/// <summary>
/// returns the path currently selected by the user inside the OpenFileDialog
/// </summary>
public string SelectedPath {
get {
return Marshal.PtrToStringUni( _fileNameBuffer );
}
}
#region IDisposable Members
public void Dispose() {
Dispose( true );
}
/// <summary>
/// Free any unamanged memory used by this instance of OpenFileDialog
/// </summary>
/// <param name="disposing">true if called by Dispose, false otherwise</param>
public void Dispose( bool disposing ) {
if ( disposing ) {
GC.SuppressFinalize( this );
}
Marshal.FreeCoTaskMem( _fileNameBuffer );
Marshal.FreeCoTaskMem( _fileTitleBuffer );
Marshal.FreeCoTaskMem( _initialDirBuffer );
Marshal.FreeCoTaskMem( _ipTemplate );
}
#endregion
}
}

View File

@@ -1,14 +0,0 @@
$file = $ARGV[0];
$index = rindex( $file, "." );
$newfile = substr( $file, 0, $index ) . "_.resx";
open( FILE, $file );
open( EDIT, ">" . $newfile );
while( $line = <FILE> ){
# chomp $line;
$line =~ s/[\\]/\//g;
print EDIT $line;
}
close( FILE );
close( EDIT );

View File

@@ -1,468 +0,0 @@
/*
* 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<Command> m_commands = new List<Command>();
internal static int m_command_position = -1;
private static readonly Bitmap m_author_list = null;
/// <summary>
/// telopの描画に必要な最大のトラック数
/// </summary>
public static int MaxTelopLanes = 0;
private static bool m_edited;
/// <summary>
/// Editedプロパティが変更された時発生します
/// </summary>
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
/// <summary>
/// rectの中にpointが入っているかどうかを判定
/// </summary>
/// <param name="point"></param>
/// <param name="rect"></param>
/// <returns></returns>
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;
}
/// <summary>
/// pictureBox1の行の表示状態を表す配列を取得します。
/// </summary>
/// <returns></returns>
public static int[] GetTimeLineLanes() {
List<int> ret = new List<int>();
// 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();
}
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[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 );
}
}
/// <summary>
/// 現在保持しているコマンドバッファをクリアします。
/// </summary>
public static void ClearCommandBuffer() {
m_commands.Clear();
m_command_position = -1;
}
/// <summary>
/// 次回アンドゥ処理されるコマンドの種類を調べます
/// </summary>
/// <returns></returns>
public static CommandType GetNextUndoCommandType() {
if ( IsUndoAvailable ) {
return m_commands[m_command_position].type;
} else {
return CommandType.nothing;
}
}
/// <summary>
/// アンドゥ処理を行います
/// </summary>
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--;
}
}
/// <summary>
/// 次回リドゥ処理されるコマンドの種類を調べます
/// </summary>
/// <returns></returns>
public static CommandType GetNextRedoCommandType() {
if ( IsRedoAvailable ) {
return m_commands[m_command_position + 1].type;
} else {
return CommandType.nothing;
}
}
/// <summary>
/// リドゥ処理を行います
/// </summary>
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++;
}
}
/// <summary>
/// リドゥ操作が可能かどうかを表すプロパティ
/// </summary>
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;
}
}
}
/// <summary>
/// アンドゥ操作が可能かどうかを表すプロパティ
/// </summary>
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;
}
}
}
/// <summary>
/// コマンドバッファに指定されたコマンドを登録します
/// </summary>
/// <param name="command"></param>
public static void Register( Command command ) {
if ( m_command_position == m_commands.Count - 1 ) {
// 新しいコマンドバッファを追加する場合
m_commands.Add( command );
m_command_position = m_commands.Count - 1;
} else {
// 既にあるコマンドバッファを上書きする場合
//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();
}
}
}
}

View File

@@ -1,220 +0,0 @@
/*
* 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 ) {
//ディレクトリが存在するかどうかを確認
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;
}
//既にファイルが存在することを警告
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;
}
}
}

View File

@@ -1,378 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "中間ファイルを削除する";
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 = "アルファ値を含める";
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に埋め込む";
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;
}
}

View File

@@ -1,32 +0,0 @@
/*
* 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;
}
}

View File

@@ -1,47 +0,0 @@
/*
* 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;
/// <summary>
/// aviファイルのOpenに失敗した累積回数を取得します
/// </summary>
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++;
}
}
}
}

View File

@@ -1,28 +0,0 @@
/*
* 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;
}
}
}

View File

@@ -1,75 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,84 +0,0 @@
/*
* 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;
}
}
}

View File

@@ -1,300 +0,0 @@
/*
* 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<ImageEntry> Images;
[NonSerialized]
private Bitmap m_cache = null;
[NonSerialized]
private string m_cache_draw = "";
[OptionalField]
public string version;//setDefaultで変更するので、readonlyにしたいけどできん
[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との互換性を保つため。
// base, a, ..., nnのデータをImagesに移動させる
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;
}
}
}

View File

@@ -1,739 +0,0 @@
/*
* 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 {
/// <summary>
/// キャラクタを取り扱うクラス。
/// 第3世代
/// </summary>
[Serializable]
public class Character3 : ICloneable, IDisposable {
string m_name;
CharacterType m_type;
ImageEntry[] m_basic = new ImageEntry[9];
List<ImageEntry> 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からアップデートされたものであることを表すフラグ
bool m_is_build_in = false;
/// <summary>
/// 使用上の注意など
/// </summary>
[OptionalField]
string m_lisence;
#region public static field
/// <summary>
/// ビルトイン・キャラクタ。
/// </summary>
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( "低目にっこり", 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( "低目にっこり", 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( "低目にっこり", 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<int, string> slist = new SortedList<int, string>();
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<ImageEntry>();
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 "";
}
/// <summary>
/// ファイルに保存する
/// </summary>
/// <param name="path"></param>
/// <param name="pack"></param>
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<ImageEntry> ) );
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;
}
}
/// <summary>
/// xmlファイルからのコンストラクタ
/// </summary>
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<ImageEntry> ) );
res.m_another = (List<ImageEntry>)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;
}
/// <summary>
/// 第2世代目のCharacterからのコンバート
/// </summary>
/// <param name="character"></param>
/// <returns></returns>
public Character3( Character character ) {
List<ImageEntry> basic = new List<ImageEntry>();
List<ImageEntry> another = new List<ImageEntry>();
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<ImageEntry>( 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<int> type = new List<int>();
int count = -1;
foreach ( ImageEntry img in this ) {
count++;
if ( img.IsDefault ) {
type.Add( count );
}
}
return Face( type.ToArray() );
}
}
public IEnumerator<ImageEntry> 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オーダー順に描画する画像を並べ替える
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;
}
}
// 前回描画したのと同じ描画要求であれば、キャッシュをそのまま返す
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<ImageEntry>( another );
} else {
m_another = new List<ImageEntry>();
}
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;
}
/// <summary>
/// キャラクタのタイプを取得します
/// </summary>
public CharacterType Type {
get {
return m_type;
}
}
/// <summary>
/// キャラクタの名称を取得します
/// </summary>
public string Name {
get {
return m_name;
}
set {
m_name = value;
}
}
}
}

View File

@@ -1,136 +0,0 @@
/*
* 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 {
/// <summary>
/// キャラクタ設定ファイルのリストを管理するクラス
/// </summary>
public static class CharacterConfigCollection {
/// <summary>
/// リストの最大長
/// </summary>
const int MAX_DICT_LEN = 128;
static List<CharacterConfigSpecifier> m_list = new List<CharacterConfigSpecifier>();
/// <summary>
/// IDがidであるキャラクタ設定ファイルがリストに登録されているかどうかを返します
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static bool IsRegistered( string id ) {
foreach ( CharacterConfigSpecifier item in m_list ) {
if ( item.ID == id ) {
return true;
}
}
return false;
}
/// <summary>
/// 現在のリストの内容を逐次返すiterator
/// </summary>
/// <returns></returns>
public static IEnumerator<CharacterConfigSpecifier> GetEnumerator() {
foreach ( CharacterConfigSpecifier item in m_list ) {
yield return item;
}
yield break;
}
/// <summary>
/// ファイル名がidであるキャラクタ設定ファイルのプレビューを返します未登録の場合はnullを返します
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static Image GetPreviewImage( string id ) {
foreach ( CharacterConfigSpecifier item in m_list ) {
if ( item.ID == id ) {
return item.Image;
}
}
return null;
}
/// <summary>
/// ファイル名がfileであるキャラクタ設定ファイルを読み込みリストに登録します
/// 既に登録済みであっても,登録された時点よりファイルが新しければ,登録内容を更新します
/// </summary>
/// <param name="file"></param>
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 );
}
}
}
}
}

View File

@@ -1,95 +0,0 @@
/*
* 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 {
/// <summary>
/// キャラクタ設定ファイルを識別するためのクラス
/// </summary>
public class CharacterConfigSpecifier {
Image m_preview;
string m_id;
DateTime m_last_modefied;
const int w = 256;
const int h = 256;
/// <summary>
/// キャラクタ設定ファイルを特定するID通常はファイルへのフルパス
/// </summary>
public string ID {
get {
return m_id;
}
}
/// <summary>
/// キャラクタ設定ファイルの最終更新時刻
/// </summary>
public DateTime LastModefied {
get {
return m_last_modefied;
}
}
/// <summary>
/// キャラクタ設定ファイルのプレビュー
/// </summary>
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;
}
}
}

View File

@@ -1,95 +0,0 @@
/*
* 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 );
}
}
}
}

View File

@@ -1,316 +0,0 @@
/*
* 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;
}
}
}

View File

@@ -1,44 +0,0 @@
/*
* 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,
}
}

View File

@@ -1,235 +0,0 @@
/*
* 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 );
}
/// <summary>
/// どのカーブも選択されていない状態にします
/// </summary>
public void SetSelectedNone() {
curveEditor.Clear();
curveEditor.ClearBuffer();
comboObjects.SelectedIndex = -1;
}
/// <summary>
/// rectの中にpointが入っているかどうかを判定
/// </summary>
/// <param name="point"></param>
/// <param name="rect"></param>
/// <returns></returns>
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 );
}
/// <summary>
/// 現在の編集情報を破棄します
/// </summary>
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();
}
}
}

View File

@@ -1,194 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,207 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,178 +0,0 @@
/*
* 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;
/// <summary>
/// On timeがテキストボックスによって編集されたかどうか
/// </summary>
private bool m_start_edited = false;
/// <summary>
/// Off timeがテキストボックスによって編集されたかどうか
/// </summary>
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();
}
}
}
}
}
}

View File

@@ -1,43 +0,0 @@
/*
* 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 {
/// <summary>
/// デフォルト。何も編集して無い
/// </summary>
None,
/// <summary>
/// エントリが選択されてるだけの状態
/// </summary>
Selected,
/// <summary>
/// エントリの右端をドラッグして終了時刻を編集するモード
/// </summary>
EditingRight,
/// <summary>
/// エントリの左端をドラッグして開始時刻を編集するモード
/// </summary>
EditingLeft,
/// <summary>
/// タイムライン上の左ボタンドラッグによりエントリを追加するモード
/// </summary>
Dragging,
/// <summary>
/// エントリをドラッグしてスライドさせるモード
/// </summary>
Sliding,
}
}

View File

@@ -1,76 +0,0 @@
/*
* 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;
}
}
}
}

View File

@@ -1,871 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "同一母音が連続するとき、口を閉じる";
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 = "口を閉じる";
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;
}
}

View File

@@ -1,412 +0,0 @@
/*
* 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<string> list = new List<string>( 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;
}
}
}

View File

@@ -1,351 +0,0 @@
/*
* 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 {
/// <summary>
/// 操作環境の設定値を格納します
/// </summary>
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;
/// <summary>
/// Vsqトラックを常に表示するかどうかを表す
/// </summary>
public bool FixVsqTrackPosition = false;
/// <summary>
/// 最後に使用されたAviファイルへのパス
/// </summary>
public string LastAviPath = "";
public FontConfig Font = new FontConfig( "MS UI Gothic", 9 );
/// <summary>
/// キャラクタ設定ファイルの編集時に、静止画ファイルの名前をそのまま画像のタイトルとするかどうか
/// </summary>
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<string> m_close_mouth_phonetic_symbols = new List<string>( new string[] { "b", "p", "m", "b'", "p'", "m'" } );
private List<string> m_i_mouth_phonetic_symbols = new List<string>( new string[] { "k'", "g'", "S", "dZ", "tS", "J", "C" } );
private List<string> m_u_mouth_phonetic_symbols = new List<string>( 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<string> CloseMouthPhoneticSymbols {
get {
return m_close_mouth_phonetic_symbols;
}
set {
m_close_mouth_phonetic_symbols = new List<string>( value.ToArray() );
}
}
[XmlArrayItem( typeof( string ), ElementName = "PhoneticSymbol" )]
public List<string> IMouthPhoneticSymbols {
get {
return m_i_mouth_phonetic_symbols;
}
set {
m_i_mouth_phonetic_symbols = new List<string>( value.ToArray() );
}
}
[XmlArrayItem( typeof( string ), ElementName = "PhoneticSymbol" )]
public List<string> UMouthPhoneticSymbols {
get {
return m_u_mouth_phonetic_symbols;
}
set {
m_u_mouth_phonetic_symbols = new List<string>( 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<string>( this.IMouthPhoneticSymbols.ToArray() );
res.CloseMouthPhoneticSymbols = new List<string>( this.CloseMouthPhoneticSymbols.ToArray() );
res.UMouthPhoneticSymbols = new List<string>( 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;
}
}
}

View File

@@ -1,89 +0,0 @@
/*
* 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 {
/// <summary>
/// フォントの設定値をXmlSerializerで"美しく"格納するためのクラス
/// </summary>
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;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,113 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,154 +0,0 @@
/*
* 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 );
}
}
}

View File

@@ -1,64 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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" );
}
}
}

View File

@@ -1,55 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,55 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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
}
}

View File

@@ -1,87 +0,0 @@
/*
* 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 );
}
/// <summary>
/// rectの中にpointが入っているかどうかを判定
/// </summary>
/// <param name="point"></param>
/// <param name="rect"></param>
/// <returns></returns>
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);
}
}
}
}

View File

@@ -1,293 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,207 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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ファイルからフレームレートの設定を引用します" );
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;
}
}

View File

@@ -1,188 +0,0 @@
/*
* 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" ) );
}
/// <summary>
/// 有理数で表したフレームレートの分子の値を取得または設定します
/// </summary>
public uint DwRate {
get {
return m_dwRate;
}
}
/// <summary>
/// 有理数で表したフレームレートの分母の値を取得または設定します
/// </summary>
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;
}
}
}

View File

@@ -1,729 +0,0 @@
namespace LipSync {
partial class FormVocalomark {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,198 +0,0 @@
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<string, string>[] Assignment {
get {
List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
if ( comboLipA.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "L_A", m_image_titles[comboLipA.SelectedIndex] ) );
}
if ( comboLipE.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "L_E", m_image_titles[comboLipE.SelectedIndex] ) );
}
if ( comboLipI.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "L_I", m_image_titles[comboLipI.SelectedIndex] ) );
}
if ( comboLipO.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "L_O", m_image_titles[comboLipO.SelectedIndex] ) );
}
if ( comboLipU.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "L_U", m_image_titles[comboLipU.SelectedIndex] ) );
}
if ( comboEyebrowConfuse.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "EB_Confuse", m_image_titles[comboEyebrowConfuse.SelectedIndex] ) );
}
if ( comboEyebrowSad.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "EB_Sad", m_image_titles[comboEyebrowSad.SelectedIndex] ) );
}
if ( comboEyebrowSerious.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "EB_Serious", m_image_titles[comboEyebrowSerious.SelectedIndex] ) );
}
if ( comboEyebrowSurprise.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "EB_Surprise", m_image_titles[comboEyebrowSurprise.SelectedIndex] ) );
}
if ( comboEyeClose.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_Close", m_image_titles[comboEyeClose.SelectedIndex] ) );
}
if ( comboEyeSad.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_Sad", m_image_titles[comboEyeSad.SelectedIndex] ) );
}
if ( comboEyeSerious.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_Serious", m_image_titles[comboEyeSerious.SelectedIndex] ) );
}
if ( comboEyeSmile.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_Smile", m_image_titles[comboEyeSmile.SelectedIndex] ) );
}
if ( comboEyeSurprise.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_Surprise", m_image_titles[comboEyeSurprise.SelectedIndex] ) );
}
if ( comboEyeWinkL.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "E_WinkL", m_image_titles[comboEyeWinkL.SelectedIndex] ) );
}
if ( comboEyeWinkR.SelectedIndex > 0 ) {
ret.Add( new KeyValuePair<string, string>( "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;
}
}
}
}

View File

@@ -1,931 +0,0 @@
/*
* 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<string> files = new List<string>( 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 );
}
}
}
/// <summary>
/// 現在のm_table_group.Characterの内容を、listView1に適用します
/// </summary>
private void update() {
if ( m_table_group.Character == null ) {
return;
}
m_loading = true;
textBox1.Text = m_table_group.Character.Name;
string title = SelectedTitle;
// 登録する.
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してからCheckedを変更するとイベントが発生してめんどい
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();
}
/// <summary>
/// listView1にて現在選択されているアイテムの名前を取得します
/// </summary>
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<int> draw = new List<int>();
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<int> draw = new List<int>();
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する
}
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();
}
/// <summary>
/// m_table_group.listの順序を元に、m_table_group.Characterのzオーダーを新たに幡番する
/// </summary>
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;
}
}
}
}

View File

@@ -1,641 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "画像を設定";
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 = "画像をリセット";
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 = "画像を設定";
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 = "画像をリセット";
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;
}
}

View File

@@ -1,49 +0,0 @@
/*
* 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;
}
}
}

View File

@@ -1,24 +0,0 @@
/*
* 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 );
}
}

View File

@@ -1,196 +0,0 @@
/*
* 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<ImageEntry>, 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;
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,113 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,35 +0,0 @@
/*
* 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 {
/// <summary>
///
/// </summary>
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;
}
}
}

View File

@@ -1,97 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,71 +0,0 @@
/*
* 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;
}
}
}
}

View File

@@ -1,114 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "割り込ませる";
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 = "貼付けモードを指定してください";
//
// 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;
}
}

View File

@@ -1,77 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,39 +0,0 @@
/*
* 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;
}
}
}

View File

@@ -1,142 +0,0 @@
/*
* 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 {
/// <summary>
/// プラグインに関する情報
/// </summary>
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 );
}
/// <summary>
/// PluginInfoクラスのコンストラクタ
/// </summary>
/// <param name="path">アセンブリファイルのパス</param>
/// <param name="cls">クラスの名前</param>
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;
}
}
/// <summary>
/// アセンブリファイルのパス
/// </summary>
public string Location {
get {
return _location;
}
}
/// <summary>
/// クラスの名前
/// </summary>
public string ClassName {
get {
return _className;
}
}
/// <summary>
/// 有効なプラグインを探す
/// </summary>
/// <returns>有効なプラグインのPluginInfo配列</returns>
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 +
"\"が見つかりませんでした。" );*/
//.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をコレクションに追加する
plugins.Add( new PluginInfo( dll, t.FullName ) );
}
}
} catch {
}
}
//コレクションを配列にして返す
return (PluginInfo[])plugins.ToArray( typeof( PluginInfo ) );
}
/// <summary>
/// プラグインクラスのインスタンスを作成する
/// </summary>
/// <returns>プラグインクラスのインスタンス</returns>
private IPlugin CreateInstance() {
try {
//アセンブリを読み込む
System.Reflection.Assembly asm =
System.Reflection.Assembly.LoadFrom( this.Location );
//クラス名からインスタンスを作成する
return (Plugin.IPlugin)
asm.CreateInstance( this.ClassName );
} catch {
return null;
}
}
}
}

View File

@@ -1,47 +0,0 @@
/*
* 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;
}
}
}
}

View File

@@ -1,67 +0,0 @@
/*
* 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 {
//コンバータがオブジェクトを指定した型に変換できるか
//変換できる時はTrueを返す
//ここでは、CustomClass型のオブジェクトには変換可能とする
public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType ) {
if ( destinationType == typeof( Position ) ) {
return true;
}
return base.CanConvertTo( context, destinationType );
}
//指定した値オブジェクトを、指定した型に変換する
//CustomClass型のオブジェクトをString型に変換する方法を提供する
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 );
}
//コンバータが特定の型のオブジェクトをコンバータの型に変換できるか
//変換できる時はTrueを返す
//ここでは、String型のオブジェクトなら変換可能とする
public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType ) {
if ( sourceType == typeof( string ) ) {
return true;
}
return base.CanConvertFrom( context, sourceType );
}
//指定した値をコンバータの型に変換する
//String型のオブジェクトをCustomClass型に変換する方法を提供する
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 );
}
}
}

View File

@@ -1,328 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "画面に合わせる";
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;
}
}

View File

@@ -1,318 +0,0 @@
/*
* 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 {
/// <summary>
/// プレビュー用のイメージPreviewP.Imageの本体として指定される
/// </summary>
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 );
}
}
}
}

View File

@@ -1,273 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,389 +0,0 @@
/*
* 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の各項目が昇順で並べ替えられているかどうかを表す
int[] m_sort_order = new int[] { 0, 1, 2 }; // start, type, abstの列のデータが項目を並べ替える際に順番の判定に使用される順位
private static Property m_instance = null;
/// <summary>
/// プロパティ・ビューの値が変更されたときに発生します
/// </summary>
public event PropertyValueChangedEventHandler PropertyValueChanged;
/// <summary>
/// テロップの追加が要求されたときに発生します
/// </summary>
public event TelopAddingEventHandler TelopAdding;
/// <summary>
/// テロップの削除が要求されたときに発生します
/// </summary>
public event TelopDeletingEventHandler TelopDeleting;
/// <summary>
/// オブジェクトリストで選択アイテムが変更されたとき発生します
/// </summary>
public event EventHandler SelectedIndexChanged;
public event EditingItemChangedEventHandler EditingItemChanged;
/// <summary>
/// オブジェクトリストの更新が必要となったとき発生します
/// </summary>
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<ListViewItem> sorting = new List<ListViewItem>();
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() );
}
/// <summary>
/// 第index1項目が第index2項目より順位が低いときtrueそうでないときfalse
/// </summary>
/// <param name="index1"></param>
/// <param name="index2"></param>
/// <returns></returns>
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<ListViewItem> coll = new List<ListViewItem>();
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<int> list = new List<int>();
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;
}
}
}

View File

@@ -1,28 +0,0 @@
/*
* 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 {
/// <summary>
/// 音符の量子化設定
/// </summary>
public enum QuantizeMode {
q04,
q08,
q16,
q32,
q64,
off
}
}

View File

@@ -1,28 +0,0 @@
/*
* 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<string> exclusion;
public CharacterEx(){
character = new Character3();
exclusion = new List<string>();
}
}
}

View File

@@ -1,162 +0,0 @@
/*
* 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 {
/// <summary>
/// RipSyncのキャラクタ設定ファイル*.rsiを読込むためのクラス
/// </summary>
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<string> exclusion = new List<string>();
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":
// 排他設定だけ読み取る
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;
}
}
}

View File

@@ -1,530 +0,0 @@
/*
* 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 );
}
/// <summary>
/// a, aa, i, u, e, o, xo, nnを、あ・ああ・い・う・え・お・ぉ・んに変換します。それ以外は""を返す
/// </summary>
/// <param name="symbol"></param>
/// <returns></returns>
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 "";
}
/// <summary>
/// 与えられたタイトルの画像が口パク用の基本画像セットの物かどうかを判定します
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
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名を決めておく
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<string> sets = new List<string>(); // 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<string> listed_tag = new List<string>(); // 出力済みのタグのリスト
bool added = true;
while ( added ) {
added = false;
// 次に出力すべきタグを検索
string next_tag = "";
List<string> print = new List<string>();
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 ) {
// 本体画像が含まれてたらキャンセル
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<string, string> dic = new Dictionary<string, string>();
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();
}
}
}

View File

@@ -1,692 +0,0 @@
/*
* 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<TimeTableGroup> groups_character;
private static TimeTableGroup group_another;
private static List<Telop> telop = new List<Telop>();
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<TimeTableGroup>();
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" ) {
// まずtypeを調べる
string type_name = "";
foreach ( XmlNode level3 in level2.ChildNodes ) {
if ( level3.LocalName == "TypeName" ) {
type_name = level3.InnerText;
break;
}
}
// typeで動作を切り替え
switch ( type_name ) {
case "RipSync.Plugins.Extensions.RipSyncImage.RipSyncImage":
#region RipSync.Plugins.Extensions.RipSyncImage.RipSyncImage
string source_table = "";
CharacterEx cex = new CharacterEx();
List<RspTriggerEvent> events = new List<RspTriggerEvent>();
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から、口パクを作成
// group_vsqから、タイトルがsource_tableで或るやつを検索
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から、表情を追加。
// まず、排他も考慮して、OFFのイベントを追加
events.Sort();
//MessageBox.Show( "events.Cocunt=" + events.Count );
#region OFFイベントを追加
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であれば-10じゃなくてもいい
// 排他に該当して無いかどうか検査
bool exclusion = isExclusionTrigger( cex, trigger_name );
bool defined = false; // 排他制御で、OFF位置が定義できたか否か
if ( exclusion ) {
// 排他制御をする必要がある場合
// 他の排他要素の中で、beginより後にONしていて、かつそれがもっとも早いものを検索
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指定になってたり、作為的にOFFにされて無いかどうかを検査
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;
}
}
// どのタイムラインに追加するのかを決定
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]のみ、Style=がついてるのでそれをはずす
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;
}
}
// 名前がdraw_objectであるトラックorキャラクタを検索
// 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画像エントリの修正。genMouthFromVsqCore実行時には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の数値がrip syncでは逆なので修正
// まずzorderの最大値を探す
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<Telop>();
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;
}
/// <summary>
/// 指定された名前のトリガーが、排他指定されているか否かを判定します
/// </summary>
/// <param name="cex">判定に使用されるCharacterEx</param>
/// <param name="name">検査するトリガーの名前</param>
/// <returns></returns>
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;
}
}
}

View File

@@ -1,52 +0,0 @@
/*
* 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 {
/// <summary>
/// 楽譜の一部分を取り扱います。ただし単一の拍子で表現できる部分のみ
/// </summary>
[Serializable, Obsolete]
public class ScoreUnit {
/// <summary>
/// このインスタンスが表す楽譜の、曲頭からの時刻を表します
/// </summary>
public float Start;
/// <summary>
/// 拍子の分子
/// </summary>
public int Numerator;
/// <summary>
/// 拍子の分母
/// </summary>
public int Denominator;
/// <summary>
/// テンポの変更情報を格納したリスト
/// </summary>
public List<TempoTableEntry> TempoList;
public ScoreUnit() {
Start = 0f;
Numerator = 4;
Denominator = 4;
TempoList = new List<TempoTableEntry>();
TempoList.Add( new TempoTableEntry( 0, 480000, 0.0 ) );
}
}
}

View File

@@ -1,132 +0,0 @@
/*
* 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<string> 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;
}
}
}

View File

@@ -1,219 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "口パク生成に使用するキャラクタを選択してください";
//
// 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ファイルにキャラクタ設定を埋め込む";
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;
}
}

View File

@@ -1,133 +0,0 @@
/*
* 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<T> : 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();
}
}
}

View File

@@ -1,136 +0,0 @@
/*
* 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<T> {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,214 +0,0 @@
/*
* 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<TimeTableGroup> 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<PluginConfig> m_plugins_config; //ok
public string m_audioFile = ""; //ok
[OptionalField]
public Color CANVAS_BACKGROUND; // = Color.White; //ok
[OptionalField, Obsolete]
public List<Telop> m_telop; //ok
[OptionalField]
public float REPEAT_START; //ok
[OptionalField]
public float REPEAT_END; //ok
[OptionalField, Obsolete]//[OptionalField]
public SortedDictionary<int, Telop> m_telop_ex = new SortedDictionary<int, Telop>(); //OK
[OptionalField, Obsolete]
public List<ScoreUnit> m_score_unit;
[OptionalField, Obsolete]
public List<TimeSig> m_timesig;
[OptionalField]
public List<TimeSigTableEntry> m_timesig_ex;
[OptionalField]
public List<TempoTableEntry> 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<Telop> m_telop_ex2 = new List<Telop>();
/// <summary>
/// 描画順序で格納された描画物のリスト
/// </summary>
[NonSerialized]
public List<ZorderItem> m_zorder = new List<ZorderItem>();
[NonSerialized]
public List<Command> m_commands = new List<Command>();
[NonSerialized]
public int m_command_position = -1;
public static string _( string s ) {
return Messaging.GetMessage( s );
}
public Settings() {
m_zorder = new List<ZorderItem>();
m_commands = new List<Command>();
m_command_position = -1;
m_group_vsq = new TimeTableGroup( _( "VSQ Tracks" ), -1, null );
m_groups_character = new List<TimeTableGroup>();
m_group_another = new TimeTableGroup( _( "Another images" ), -1, null );
m_group_plugin = new TimeTableGroup( _( "Plugin" ), -1, null );
m_telop_ex2 = new List<Telop>();
m_screenWidth = 512;
m_screenHeight = 384;
m_totalSec = 0.0f;
m_movieSize = new Size( 512, 384 );
m_plugins_config = new List<PluginConfig>();
m_audioFile = "";
CANVAS_BACKGROUND = Color.White;
//m_telop = new List<Telop>();
//m_telop_ex = new SortedDictionary<int, Telop>();
m_telop_ex2 = new List<Telop>();
m_score_unit = new List<ScoreUnit>();
m_score_unit.Add( new ScoreUnit() );
m_timesig_ex = new List<TimeSigTableEntry>();
m_tempo = new List<TempoTableEntry>();
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<Telop>();
REPEAT_START = 0f;
REPEAT_END = -1f;
m_score_unit = new List<ScoreUnit>();
m_dwRate = 0;
m_dwScale = 0;
}
[OnDeserialized]
void onDeserialized( StreamingContext sc ) {
#if DEBUG
Console.WriteLine( "Settings.onDeserialized(StreamingContext)" );
#endif
m_score_unit = new List<ScoreUnit>();
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<Telop>();
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<Telop>();
int index = -1;
foreach ( KeyValuePair<int, Telop> 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<Command>();
m_command_position = -1;
m_zorder = new List<ZorderItem>();
if ( m_timesig_ex == null ) {
m_timesig_ex = new List<TimeSigTableEntry>();
}
if ( m_tempo == null ) {
m_tempo = new List<TempoTableEntry>();
}
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;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +0,0 @@
/*
* 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; // チェック済みかどうかを表す
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 "";
}
}
}

View File

@@ -1,444 +0,0 @@
/*
* 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<Telop>, 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;
}
/// <summary>
/// 描画オブジェクトの位置が固定されるかどうかを示す値を取得,または設定します
/// </summary>
public bool PositionFixed {
get {
return m_position_fixed;
}
set {
m_position_fixed = value;
}
}
public static void DecideLane( List<Telop> 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;
}
}
/// <summary>
/// IDを変更して実施するクローン
/// </summary>
/// <param name="change_id"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 通常のクローニング操作
/// </summary>
/// <returns></returns>
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;
}
}
}
}
}

View File

@@ -1,50 +0,0 @@
/*
* 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 {
/// <summary>
/// 旧バージョン用。現在は使われていない。
/// </summary>
[Serializable, Obsolete]
public class TimeSig {
public TimeSigType Type;
/// <summary>
/// 拍子・またはテンポが変更される時間位置
/// </summary>
public float Start;
/// <summary>
/// 拍子変更後の4分音符の長さ
/// </summary>
public float Length;
/// <summary>
/// 拍子の分母
/// </summary>
public int Denominator;
/// <summary>
/// 拍子の分子
/// </summary>
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;
}
}
}

View File

@@ -1,27 +0,0 @@
/*
* 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 {
/// <summary>
/// 旧バージョン用。
/// </summary>
[Obsolete]
public enum TimeSigType {
Tempo,
TimeSig,
}
}

View File

@@ -1,538 +0,0 @@
/*
* 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<TimeTableEntry> 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;
/// <summary>
/// aviをはっつけるモード
/// </summary>
[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;
/// <summary>
/// aviファイルのOpen時に許される失敗回数
/// </summary>
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;
}
/// <summary>
/// 描画オブジェクトの位置が固定されるかどうかを示す値を取得,または設定します
/// </summary>
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;
}
}
/// <summary>
/// 時刻nowにOnとなっているエントリが存在するかどうかを判定します
/// </summary>
/// <param name="now"></param>
/// <returns></returns>
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<TimeTableEntry>();
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;
}
}
}
}

View File

@@ -1,70 +0,0 @@
/*
* 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<TimeTableEntry>, 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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +0,0 @@
/*
* 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,
}
}

View File

@@ -1,98 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,139 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,44 +0,0 @@
/*
* 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();
}
}
}

View File

@@ -1,89 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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;
}
}

View File

@@ -1,552 +0,0 @@
/*
* 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;
}
/// <summary>
/// 口の形の種類を定義するクラス。javaぽい
/// </summary>
public struct VowelType {
public static List<string> m_list_nn = new List<string>( new string[] { "b", "p", "m", "b'", "p'", "m'" } );
public static List<string> m_list_i = new List<string>( new string[] { "k'", "g'", "S", "dZ", "tS", "J", "C" } );
public static List<string> m_list_u = new List<string>( 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";
}
}
/// <summary>
///
/// </summary>
/// <param name="lyric"></param>
/// <returns></returns>
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;
// 以下、子音のみの発音が指定される場合
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 "しゃ":
case "ふぁ":
case "ちゃ":
case "りゃ":
case "じゃ":
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 "りゅ":
//case "U":
case "しゅ":
case "じゅ":
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 "しょ":
case "ちょ":
case "りょ":
case "じょ":
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;
}
}
/// <summary>
/// 文字列strから、平仮名でない文字を除去します。カタカナの場合は平仮名に変換します。
/// VOCALOIDが使用する発音記号の場合はそのまま残ります
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
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;
}
/// <summary>
/// 文字letterが平仮名かどうかを判定します。
/// </summary>
/// <param name="letter"></param>
/// <returns></returns>
private static bool IsHiragana( char letter ) {
int code = (int)letter;
if ( 0x3041 <= code && code <= 0x3093 ) {
return true;
} else {
return false;
}
}
/// <summary>
/// 文字letterがカタカナかどうかを判定します
/// </summary>
/// <param name="letter"></param>
/// <returns></returns>
private static bool IsKatakana( char letter ) {
int code = (int)letter;
if ( 0x30A1 <= code && code <= 0x30F6 ) {
return true;
} else {
return false;
}
}
/// <summary>
/// 文字letterがvocaloidの発音記号かどうかを判定します
/// </summary>
/// <param name="letter"></param>
/// <returns></returns>
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;
}
}
/// <summary>
/// 文字letterがかな文字かどうかを判定します。
/// </summary>
/// <param name="letter"></param>
/// <returns></returns>
private static bool IsKana( char letter ) {
if ( IsHiragana( letter ) && IsKatakana( letter ) ) {
return true;
} else {
return false;
}
}
}
}

View File

@@ -1,266 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "間隔をランダムにする";
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 = "画像を指定";
//
// 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;
}
}

View File

@@ -1,197 +0,0 @@
/*
* 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;
}
}
/// <summary>
/// 閉じ目用画像のタイトル
/// </summary>
public string ClosedEye {
get {
return m_closedeye;
}
}
/// <summary>
/// 閉じ目の中割り用画像のタイトル
/// </summary>
public string InBetween {
get {
return m_in_between;
}
}
/// <summary>
/// 目が閉じて表示されるフレーム数
/// </summary>
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;
}
}
}
}

View File

@@ -1,150 +0,0 @@
/*
* 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 {
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
protected override void Dispose( bool disposing ) {
if ( disposing && (components != null) ) {
components.Dispose();
}
base.Dispose( disposing );
}
#region Windows
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
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 = "描画順序を変更したいオブジェクトを選択し、上・下ボタンで移動させます";
//
// 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;
}
}

View File

@@ -1,117 +0,0 @@
/*
* 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<ZorderItem> m_list;
public ZOrder() {
InitializeComponent();
ApplyLanguage();
ApplyFont( AppManager.Config.Font.GetFont() );
m_list = new List<ZorderItem>();
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;
}
}
}
}

View File

@@ -1,75 +0,0 @@
/*
* 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<ZorderItem>, 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;
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More