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

This commit is contained in:
kbinani 2009-07-29 17:37:34 +00:00
parent 8ab2a598b3
commit 3bbc320365
4 changed files with 41 additions and 18 deletions

View File

@ -38,9 +38,14 @@ namespace LipSync {
}
}
if ( m_raw_mode ) {
radioVcm.Enabled = false;
radioVfw.Enabled = false;
radioVcm.Checked = true;
btnVideoCompression.Enabled = false;
txtDescription.Enabled = false;
} else {
radioVcm.Enabled = true;
radioVfw.Enabled = true;
btnVideoCompression.Enabled = true;
txtDescription.Enabled = true;
}

View File

@ -27,6 +27,7 @@ namespace LipSync {
public string FileNameParser;
public System.Drawing.Imaging.ImageFormat ImageFormat;
public bool UseVfwEncoder = true;
public bool IsRawMode = false;
}
}

View File

@ -191,7 +191,7 @@ namespace LipSync {
Thread m_stdout;
Process m_ffmpeg;
Process m_mencoder;
bool m_is_rawmode = false;
//bool m_is_rawmode = false;
private int m_current_frame = 0;
private MediaPlayer m_player;
private ZorderItem m_editing_item = null;
@ -1746,6 +1746,7 @@ namespace LipSync {
private void bgWorkAvi_DoWork( object sender, DoWorkEventArgs e ) {
IAviWriter writer = null;
AviOutputArguments args = (AviOutputArguments)e.Argument;
bool is_raw_mode = args.IsRawMode;
if ( File.Exists( args.AviFile ) ) {
File.Delete( args.AviFile );
}
@ -1772,6 +1773,21 @@ namespace LipSync {
Bitmap bmp = null;
if ( args.UseVfwEncoder ) {
bmp = new Bitmap( size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb );
if ( is_raw_mode ) {
AviWriterVcm awvcm = new AviWriterVcm();
bool ret = awvcm.Open( args.AviFile,
AppManager.SaveData.DwScale,
AppManager.SaveData.DwRate,
size.Width,
size.Height,
!is_raw_mode,
args.IsTransparent,
Process.GetCurrentProcess().MainWindowHandle );
if ( !ret ) {
return;
}
writer = awvcm;
} else {
AviWriterVfw awvfw = new AviWriterVfw();
bool ret = awvfw.Open( args.AviFile,
AppManager.SaveData.DwScale,
@ -1783,6 +1799,7 @@ namespace LipSync {
return;
}
writer = awvfw;
}
} else {
bmp = args.IsTransparent ?
new Bitmap( size.Width, size.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) :
@ -1793,7 +1810,7 @@ namespace LipSync {
AppManager.SaveData.DwRate,
size.Width,
size.Height,
!m_is_rawmode,
!is_raw_mode,
args.IsTransparent,
Process.GetCurrentProcess().MainWindowHandle );
if ( !ret ) {
@ -2237,8 +2254,7 @@ namespace LipSync {
StopMusic();
}
initializeFirstEntry();
m_is_rawmode = false;
ShowDialogCore();
showDialogCore( false );
}
private void menuFileOutputRawAvi_Click( object sender, EventArgs e ) {
@ -2246,8 +2262,7 @@ namespace LipSync {
StopMusic();
}
initializeFirstEntry();
m_is_rawmode = true;
ShowDialogCore();
showDialogCore( true );
}
#endregion
@ -3663,6 +3678,7 @@ namespace LipSync {
long start_frame;
AviOutputArguments args = (AviOutputArguments)e.Argument;
bool is_raw_mode = args.IsRawMode;
if ( args.StartSpecified ) {
start_frame = (long)(args.Start * AppManager.SaveData.FrameRate);
} else {

View File

@ -1971,12 +1971,13 @@ namespace LipSync {
}
}
private void ShowDialogCore() {
using ( AviOutput aviOutput = new AviOutput( m_is_rawmode ) ) {
private void showDialogCore( bool is_raw_mode ) {
using ( AviOutput aviOutput = new AviOutput( is_raw_mode ) ) {
if ( aviOutput.ShowDialog() == DialogResult.OK ) {
AviWriting = true;
m_avi_cancel = false;
AviOutputArguments args = aviOutput.Arguments;
args.IsRawMode = is_raw_mode;
bgWorkAvi.RunWorkerAsync( args );
}
}