mirror of
https://git.femboyfinancial.jp/james/lipsync.git
synced 2026-05-17 08:02:55 -07:00
git-svn-id: http://svn.sourceforge.jp/svnroot/lipsync@14 b1f601f4-4f45-0410-8980-aecacb008692
This commit is contained in:
@@ -28,6 +28,7 @@ namespace LipSync {
|
||||
public System.Drawing.Imaging.ImageFormat ImageFormat;
|
||||
public bool UseVfwEncoder = true;
|
||||
public bool IsRawMode = false;
|
||||
public int Step = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ using System.Windows.Forms;
|
||||
using Boare.Lib.AppUtil;
|
||||
using Boare.Lib.Media;
|
||||
using Boare.Lib.Vsq;
|
||||
using bocoree;
|
||||
using Plugin;
|
||||
#if DEBUG
|
||||
using Boare.Lib.Swf;
|
||||
@@ -2343,7 +2344,7 @@ namespace LipSync {
|
||||
if ( openVsqDialog.FilterIndex == 0 || Path.GetExtension( openVsqDialog.FileName ).ToLower() == ".vsq" ) {
|
||||
// VsqFileを取得
|
||||
int most_lyrics_track = 0; // 一番歌詞の文字数が多かったトラックの番号
|
||||
VsqFile vsqFile = new VsqFile( openVsqDialog.FileName );
|
||||
VsqFile vsqFile = new VsqFile( openVsqDialog.FileName, Encoding.GetEncoding( "Shift_JIS" ) );
|
||||
AppManager.SaveData.m_totalSec = (float)vsqFile.getTotalSec();
|
||||
|
||||
AppManager.SaveData.m_timesig_ex = new List<TimeSigTableEntry>( vsqFile.TimesigTable.ToArray() );
|
||||
@@ -2810,6 +2811,7 @@ namespace LipSync {
|
||||
args.End = fsi.End;
|
||||
args.FileNameParser = fsi.ParserString;
|
||||
args.ImageFormat = fsi.ImageFormat;
|
||||
args.Step = fsi.Step;
|
||||
bgWorkSeriesImage.RunWorkerAsync( args );
|
||||
}
|
||||
}
|
||||
@@ -3643,6 +3645,7 @@ namespace LipSync {
|
||||
if ( menuVisualSync.Checked ) {
|
||||
correctPosition();
|
||||
}
|
||||
previewer.Invalidate();
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
@@ -3676,6 +3679,7 @@ namespace LipSync {
|
||||
|
||||
long start_frame;
|
||||
AviOutputArguments args = (AviOutputArguments)e.Argument;
|
||||
int step = args.Step;
|
||||
bool is_raw_mode = args.IsRawMode;
|
||||
if ( args.StartSpecified ) {
|
||||
start_frame = (long)(args.Start * AppManager.SaveData.FrameRate);
|
||||
@@ -3689,12 +3693,12 @@ namespace LipSync {
|
||||
} else {
|
||||
end_frame = (long)((AppManager.SaveData.m_totalSec) * AppManager.SaveData.FrameRate);
|
||||
}
|
||||
long total_frames = end_frame - start_frame + 1;
|
||||
long total_frames = (end_frame - start_frame) / Math.Abs( step ) + 1;
|
||||
#if !DEBUG
|
||||
try {
|
||||
#endif
|
||||
long count = -1;
|
||||
for ( long frame = start_frame; frame <= end_frame; frame++ ) {
|
||||
for ( long frame = start_frame; frame <= end_frame; frame+= step ) {
|
||||
count++;
|
||||
float now = (float)frame / AppManager.SaveData.FrameRate;
|
||||
Bitmap frm = GetPicture( now, false );
|
||||
@@ -3708,7 +3712,7 @@ namespace LipSync {
|
||||
this.Invoke( new Form1_AviWritingChange( ChangeAviWriting ), new object[] { false } );
|
||||
return;
|
||||
}
|
||||
bgWorkSeriesImage.ReportProgress( (int)((double)(frame - start_frame) / (double)(total_frames) * 100.0), new long[] { frame - start_frame, total_frames } );
|
||||
bgWorkSeriesImage.ReportProgress( (int)((double)(frame - start_frame) / (double)(total_frames) * 100.0), new long[] { (frame - start_frame) / Math.Abs( step ), total_frames } );
|
||||
if ( m_avi_cancel ) {
|
||||
m_avi_cancel = false;
|
||||
return;
|
||||
|
||||
@@ -20,6 +20,7 @@ using System.IO;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Text;
|
||||
|
||||
using Boare.Lib.AppUtil;
|
||||
using Boare.Lib.Vsq;
|
||||
@@ -266,7 +267,7 @@ namespace LipSync {
|
||||
}
|
||||
AppManager.SaveData.m_totalSec = Math.Max( AppManager.SaveData.m_totalSec, (float)ust.getTotalSec() );
|
||||
} else {
|
||||
VsqFile vsqFile = new VsqFile( filename );
|
||||
VsqFile vsqFile = new VsqFile( filename, Encoding.GetEncoding( "Shift_JIS" ) );
|
||||
int tracks = vsqFile.Track.Count;
|
||||
string[] track_names = new string[tracks];
|
||||
for ( int track = 0; track < tracks; track++ ) {
|
||||
|
||||
@@ -53,6 +53,11 @@ namespace LipSync {
|
||||
this.comboFormat = new System.Windows.Forms.ComboBox();
|
||||
this.lblParser = new System.Windows.Forms.Label();
|
||||
this.txtPreview = new System.Windows.Forms.TextBox();
|
||||
this.txtStep = new System.Windows.Forms.TextBox();
|
||||
this.chkStep = new System.Windows.Forms.CheckBox();
|
||||
this.lblStart = new System.Windows.Forms.Label();
|
||||
this.lblEnd = new System.Windows.Forms.Label();
|
||||
this.lblStep = new System.Windows.Forms.Label();
|
||||
this.groupStartEnd.SuspendLayout();
|
||||
this.groupFileName.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -91,7 +96,7 @@ namespace LipSync {
|
||||
//
|
||||
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.Location = new System.Drawing.Point( 371, 309 );
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size( 75, 23 );
|
||||
this.btnCancel.TabIndex = 13;
|
||||
@@ -101,7 +106,7 @@ namespace LipSync {
|
||||
// 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.Location = new System.Drawing.Point( 272, 309 );
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Size = new System.Drawing.Size( 75, 23 );
|
||||
this.btnOK.TabIndex = 12;
|
||||
@@ -124,13 +129,18 @@ namespace LipSync {
|
||||
//
|
||||
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.lblStep );
|
||||
this.groupStartEnd.Controls.Add( this.lblEnd );
|
||||
this.groupStartEnd.Controls.Add( this.lblStart );
|
||||
this.groupStartEnd.Controls.Add( this.txtStep );
|
||||
this.groupStartEnd.Controls.Add( this.chkStep );
|
||||
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.Size = new System.Drawing.Size( 432, 112 );
|
||||
this.groupStartEnd.TabIndex = 7;
|
||||
this.groupStartEnd.TabStop = false;
|
||||
this.groupStartEnd.Text = "出力範囲を指定";
|
||||
@@ -174,7 +184,7 @@ namespace LipSync {
|
||||
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.Location = new System.Drawing.Point( 14, 159 );
|
||||
this.groupFileName.Name = "groupFileName";
|
||||
this.groupFileName.Size = new System.Drawing.Size( 432, 132 );
|
||||
this.groupFileName.TabIndex = 20;
|
||||
@@ -241,13 +251,59 @@ namespace LipSync {
|
||||
this.txtPreview.Size = new System.Drawing.Size( 159, 94 );
|
||||
this.txtPreview.TabIndex = 1;
|
||||
//
|
||||
// txtStep
|
||||
//
|
||||
this.txtStep.Location = new System.Drawing.Point( 90, 78 );
|
||||
this.txtStep.Name = "txtStep";
|
||||
this.txtStep.Size = new System.Drawing.Size( 144, 19 );
|
||||
this.txtStep.TabIndex = 13;
|
||||
this.txtStep.Text = "1";
|
||||
this.txtStep.TextChanged += new System.EventHandler( this.txtStep_TextChanged );
|
||||
//
|
||||
// chkStep
|
||||
//
|
||||
this.chkStep.AutoSize = true;
|
||||
this.chkStep.Location = new System.Drawing.Point( 19, 80 );
|
||||
this.chkStep.Name = "chkStep";
|
||||
this.chkStep.Size = new System.Drawing.Size( 48, 16 );
|
||||
this.chkStep.TabIndex = 12;
|
||||
this.chkStep.Text = "増分";
|
||||
this.chkStep.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblStart
|
||||
//
|
||||
this.lblStart.AutoSize = true;
|
||||
this.lblStart.Location = new System.Drawing.Point( 240, 28 );
|
||||
this.lblStart.Name = "lblStart";
|
||||
this.lblStart.Size = new System.Drawing.Size( 23, 12 );
|
||||
this.lblStart.TabIndex = 14;
|
||||
this.lblStart.Text = "sec";
|
||||
//
|
||||
// lblEnd
|
||||
//
|
||||
this.lblEnd.AutoSize = true;
|
||||
this.lblEnd.Location = new System.Drawing.Point( 240, 56 );
|
||||
this.lblEnd.Name = "lblEnd";
|
||||
this.lblEnd.Size = new System.Drawing.Size( 23, 12 );
|
||||
this.lblEnd.TabIndex = 15;
|
||||
this.lblEnd.Text = "sec";
|
||||
//
|
||||
// lblStep
|
||||
//
|
||||
this.lblStep.AutoSize = true;
|
||||
this.lblStep.Location = new System.Drawing.Point( 240, 81 );
|
||||
this.lblStep.Name = "lblStep";
|
||||
this.lblStep.Size = new System.Drawing.Size( 34, 12 );
|
||||
this.lblStep.TabIndex = 16;
|
||||
this.lblStep.Text = "frame";
|
||||
//
|
||||
// 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.ClientSize = new System.Drawing.Size( 460, 349 );
|
||||
this.Controls.Add( this.groupFileName );
|
||||
this.Controls.Add( this.groupStartEnd );
|
||||
this.Controls.Add( this.btnCancel );
|
||||
@@ -289,5 +345,10 @@ namespace LipSync {
|
||||
private System.Windows.Forms.Label lblParser;
|
||||
private System.Windows.Forms.Label lblFormat;
|
||||
private System.Windows.Forms.CheckBox chkAutomaticallyAddExtension;
|
||||
private System.Windows.Forms.TextBox txtStep;
|
||||
private System.Windows.Forms.CheckBox chkStep;
|
||||
private System.Windows.Forms.Label lblStep;
|
||||
private System.Windows.Forms.Label lblEnd;
|
||||
private System.Windows.Forms.Label lblStart;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace LipSync {
|
||||
public partial class FormSeriesImage : Form, IMultiLanguageControl {
|
||||
float m_start = 0f;
|
||||
float m_end = 0f;
|
||||
int m_step = 1;
|
||||
|
||||
public FormSeriesImage() {
|
||||
InitializeComponent();
|
||||
@@ -60,7 +61,7 @@ namespace LipSync {
|
||||
public string ParserString {
|
||||
get {
|
||||
if ( chkAutomaticallyAddExtension.Checked ) {
|
||||
return txtParser.Text + "." + Misc.GetExtensionFromImageFormat( ImageFormat );
|
||||
return txtParser.Text + Misc.GetExtensionFromImageFormat( ImageFormat );
|
||||
} else {
|
||||
return txtParser.Text;
|
||||
}
|
||||
@@ -103,6 +104,7 @@ namespace LipSync {
|
||||
groupStartEnd.Text = _( "Specify output range" );
|
||||
chkStart.Text = _( "Start" );
|
||||
chkEnd.Text = _( "End" );
|
||||
chkStep.Text = _( "Step" );
|
||||
groupFileName.Text = _( "File Name" );
|
||||
lblParser.Text = _( "Parser String" );
|
||||
chkAutomaticallyAddExtension.Text = _( "Automatically Add Extension" );
|
||||
@@ -125,6 +127,12 @@ namespace LipSync {
|
||||
}
|
||||
}
|
||||
|
||||
public int Step {
|
||||
get {
|
||||
return m_step;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOK_Click( object sender, EventArgs e ) {
|
||||
try {
|
||||
m_start = float.Parse( txtStart.Text );
|
||||
@@ -202,6 +210,16 @@ namespace LipSync {
|
||||
private void chkAutomaticallyAddExtension_CheckedChanged( object sender, EventArgs e ) {
|
||||
UpdateSampleFileNames();
|
||||
}
|
||||
|
||||
private void txtStep_TextChanged( object sender, EventArgs e ) {
|
||||
int draft;
|
||||
if ( !int.TryParse( txtStep.Text, out draft ) ) {
|
||||
return;
|
||||
}
|
||||
if ( draft != 0 ) {
|
||||
m_step = draft;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -252,6 +252,9 @@
|
||||
<EmbeddedResource Include="Editor\FormCurveExport.resx">
|
||||
<DependentUpon>FormCurveExport.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Editor\FormSeriesImage.resx">
|
||||
<DependentUpon>FormSeriesImage.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion( "1.0.0.0" )]
|
||||
[assembly: AssemblyFileVersion( "2.4.8" )]
|
||||
[assembly: AssemblyFileVersion( "2.4.9_DRAFT_07Sep2009" )]
|
||||
|
||||
Reference in New Issue
Block a user