<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
- <Compile Include="Form_FInished.cs">
+ <Compile Include="Form_FInished_OK.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Form_FInished.Designer.cs">
- <DependentUpon>Form_FInished.cs</DependentUpon>
+ <Compile Include="Form_FInished_OK.Designer.cs">
+ <DependentUpon>Form_FInished_OK.cs</DependentUpon>
</Compile>
<Compile Include="Form_Recording.cs">
<SubType>Form</SubType>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Form_FInished.resx">
- <DependentUpon>Form_FInished.cs</DependentUpon>
+ <EmbeddedResource Include="Form_FInished_OK.resx">
+ <DependentUpon>Form_FInished_OK.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form_Recording.resx">
<DependentUpon>Form_Recording.cs</DependentUpon>
public partial class Main : Form
{
Form_Recording formRecording;
-
+ Form_Finished_OK formFinishedOK;
+
public Main()
{
InitializeComponent();
// MessageBoxIcon.Information
//);
- using (Form_Finished f = new Form_Finished())
- {
- f.ShowDialog();
- }
+ formFinishedOK = new Form_Finished_OK();
+ //formFinishedOK.StartPosition = FormStartPosition.CenterParent;
+ formFinishedOK.ShowDialog(this);
+
+ formFinishedOK.Dispose();
+ formFinishedOK = null;
}
/// <summary>
{
COPYDATASTRUCT cds = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT));
string strMessage = Marshal.PtrToStringUni(cds.lpData);
-//Debug.WriteLine("Msg received: " + strMessage);
formRecording.label_state.Text = strMessage; // Form_Recordingにメッセージの内容を伝える
}
base.WndProc(ref m);
namespace DTX2WAV
{
- partial class Form_Finished
+ partial class Form_Finished_OK
{
/// <summary>
/// Required designer variable.
/// </summary>
private void InitializeComponent()
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Finished));
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Finished_OK));
this.button_OK = new System.Windows.Forms.Button();
this.label_finished = new System.Windows.Forms.Label();
this.SuspendLayout();
namespace DTX2WAV
{
- public partial class Form_Finished : Form
+ public partial class Form_Finished_OK : Form
{
- public Form_Finished()
+ public Form_Finished_OK()
{
InitializeComponent();
}
private void button_OK_Click(object sender, EventArgs e)
{
- this.Close(); }
+ this.Close();
+ }
}
}
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.IO;
namespace DTX2WAV
{
[STAThread]
static void Main()
{
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Main());
+ // 以下、DOBON.NETを参照した。mutexを使って二重起動を抑制。
+ //Mutex名を決める(必ずアプリケーション固有の文字列に変更すること!)
+ string mutexName = "DTX2WAV";
+ //Mutexオブジェクトを作成する
+ System.Threading.Mutex mutex = new System.Threading.Mutex(false, mutexName);
+
+ bool hasHandle = false;
+ try
+ {
+ try
+ {
+ // mutexの所有権を要求する
+ hasHandle = mutex.WaitOne(0, false);
+ }
+ //.NET Framework 2.0以降の場合
+ catch (System.Threading.AbandonedMutexException)
+ {
+ //別のアプリケーションがmutexを解放しないで終了した時
+ hasHandle = true;
+ }
+ #region [ mutexを得られなければ、既に起動済みと判断して、そっちを最前面に出して、こっちは終了 ]
+ if (hasHandle == false)
+ {
+ //得られなかった場合は、すでに起動していると判断して終了
+ //MessageBox.Show("多重起動はできません。");
+
+ // 得られなかった場合は、既に起動していると判断して、
+ // 既に起動しているほうを最前面に出す
+ Process prevProcess = GetPreviousProcess();
+ if (prevProcess != null)
+ {
+ WakeupWindow(prevProcess.MainWindowHandle);
+ }
+ return;
+ }
+ #endregion
+
+ #region [ DTXMania本体が既に起動されていないか確認する。既に起動済みなら警告して終了 ]
+ Process dtxmaniaProcess = GetProcessesByFileName("DTXManiaGR.exe");
+ if (dtxmaniaProcess != null)
+ {
+ MessageBox.Show(
+ "既にDTXMania本体が起動しています。DTX2WAVを起動する前に、DTXMania本体を終了してください。",
+ "DTX2WAV",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Exclamation
+ );
+ return;
+ }
+
+ #endregion
+
+ #region [ アプリを通常通り起動する ]
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Main());
+ #endregion
+ }
+ finally
+ {
+ if (hasHandle)
+ {
+ // mutexを解放する
+ mutex.ReleaseMutex();
+ }
+ mutex.Close();
+ }
+
+
}
+
+ // .NET TIPSより
+ // 実行中の同じアプリケーションのプロセスを取得する
+ // http://www.atmarkit.co.jp/fdotnet/dotnettips/151winshow/winshow.html
+ public static Process GetPreviousProcess()
+ {
+ Process curProcess = Process.GetCurrentProcess();
+ Process[] allProcesses = Process.GetProcessesByName(curProcess.ProcessName);
+
+ foreach (Process checkProcess in allProcesses)
+ {
+ // 自分自身のプロセスIDは無視する
+ if (checkProcess.Id != curProcess.Id)
+ {
+ // プロセスのフルパス名を比較して同じアプリケーションか検証
+ if (String.Compare(
+ checkProcess.MainModule.FileName,
+ curProcess.MainModule.FileName, true) == 0)
+ {
+ // 同じフルパス名のプロセスを取得
+ return checkProcess;
+ }
+ }
+ }
+
+ // 同じアプリケーションのプロセスが見つからない!
+ return null;
+ }
+
+ /// <summary>
+ /// 指定した実行ファイル名のプロセスを取得する。
+ /// https://dobon.net/vb/dotnet/process/getprocessesbyfilename.html
+ /// </summary>
+ /// <param name="searchFileName">検索する実行ファイル名。</param>
+ /// <returns>最初に一致したProcess。</returns>
+ public static System.Diagnostics.Process GetProcessesByFileName(string searchFileName)
+ {
+ searchFileName = searchFileName.ToLower();
+
+ //すべてのプロセスを列挙する
+ foreach (System.Diagnostics.Process p
+ in System.Diagnostics.Process.GetProcesses())
+ {
+ string fileName;
+ try
+ {
+ //メインモジュールのパスを取得する
+ fileName = p.MainModule.FileName;
+ }
+ catch (System.ComponentModel.Win32Exception)
+ {
+ //MainModuleの取得に失敗
+ fileName = "";
+ }
+ if (0 < fileName.Length)
+ {
+ //ファイル名の部分を取得する
+ fileName = System.IO.Path.GetFileName(fileName);
+ //探しているファイル名と一致した時、コレクションに追加
+ if (searchFileName.Equals(fileName.ToLower()))
+ {
+ return p;
+ }
+ }
+ }
+
+ return null;
+ }
+
+
+ // .NET TIPSより
+ // 外部プロセスのウィンドウを最前面にする
+ // http://www.atmarkit.co.jp/fdotnet/dotnettips/151winshow/winshow.html
+ public static void WakeupWindow(IntPtr hWnd)
+ {
+ // メイン・ウィンドウが最小化されていれば元に戻す
+ if (IsIconic(hWnd))
+ {
+ ShowWindowAsync(hWnd, SW_RESTORE);
+ }
+
+ // メイン・ウィンドウを最前面に表示する
+ SetForegroundWindow(hWnd);
+ }
+ // 外部プロセスのメイン・ウィンドウを起動するためのWin32 API
+ [DllImport("user32.dll")]
+ private static extern bool SetForegroundWindow(IntPtr hWnd);
+ [DllImport("user32.dll")]
+ private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
+ [DllImport("user32.dll")]
+ private static extern bool IsIconic(IntPtr hWnd);
+ // ShowWindowAsync関数のパラメータに渡す定義値
+ private const int SW_RESTORE = 9; // 画面を元の大きさに戻す
+
}
}
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0.0")]
-[assembly: AssemblyFileVersion("2.0.0.0")]
+[assembly: AssemblyVersion("4.0.0.0")]
+[assembly: AssemblyFileVersion("4.0.0.0")]
this.strSTAGEFILE = CSkin.Path(@"Graphics\\ScreenNowLoading background.jpg");
this.b音符を表示する = true;
}
- if (((cdtx.SOUND_NOWLOADING != null) && (cdtx.SOUND_NOWLOADING.Length > 0)) && File.Exists(cdtx.strフォルダ名 + cdtx.SOUND_NOWLOADING))
+ if (((cdtx.SOUND_NOWLOADING != null) && (cdtx.SOUND_NOWLOADING.Length > 0)) && File.Exists(cdtx.strフォルダ名 + cdtx.SOUND_NOWLOADING)
+ && (!CDTXMania.Instance.DTX2WAVmode.Enabled))
{
string strNowLoadingサウンドファイルパス = cdtx.strフォルダ名 + cdtx.SOUND_NOWLOADING;
try
case CStage.Eフェーズ.NOWLOADING_BMPファイルを読み込む:
{
- TimeSpan span;
- DateTime timeBeginLoadBMPAVI = DateTime.Now;
- if (CDTXMania.Instance.ConfigIni.bBGA)
- CDTXMania.Instance.DTX.tBMP_BMPTEXの読み込み();
+ if (!CDTXMania.Instance.DTX2WAVmode.Enabled)
+ {
+ TimeSpan span;
+ DateTime timeBeginLoadBMPAVI = DateTime.Now;
+ if (CDTXMania.Instance.ConfigIni.bBGA)
+ CDTXMania.Instance.DTX.tBMP_BMPTEXの読み込み();
- if (CDTXMania.Instance.ConfigIni.bAVI)
- CDTXMania.Instance.DTX.tAVIの読み込み();
- span = (TimeSpan)(DateTime.Now - timeBeginLoadBMPAVI);
- Trace.TraceInformation("BMP/AVI読込所要時間({0,4}): {1}", (CDTXMania.Instance.DTX.listBMP.Count + CDTXMania.Instance.DTX.listBMPTEX.Count + CDTXMania.Instance.DTX.listAVI.Count), span.ToString());
+ if (CDTXMania.Instance.ConfigIni.bAVI)
+ CDTXMania.Instance.DTX.tAVIの読み込み();
+ span = (TimeSpan)(DateTime.Now - timeBeginLoadBMPAVI);
+ Trace.TraceInformation("BMP/AVI読込所要時間({0,4}): {1}", (CDTXMania.Instance.DTX.listBMP.Count + CDTXMania.Instance.DTX.listBMPTEX.Count + CDTXMania.Instance.DTX.listAVI.Count), span.ToString());
- if (bitmapFilename != null)
- {
- bitmapFilename.Dispose();
- bitmapFilename = null;
- }
- if (graphicsFilename != null)
- {
- graphicsFilename.Dispose();
- graphicsFilename = null;
- }
- if (ftFilename != null)
- {
- ftFilename.Dispose();
- ftFilename = null;
+ if (bitmapFilename != null)
+ {
+ bitmapFilename.Dispose();
+ bitmapFilename = null;
+ }
+ if (graphicsFilename != null)
+ {
+ graphicsFilename.Dispose();
+ graphicsFilename = null;
+ }
+ if (ftFilename != null)
+ {
+ ftFilename.Dispose();
+ ftFilename = null;
+ }
}
CDTXMania.Instance.Timer.t更新();
+
base.eフェーズID = CStage.Eフェーズ.NOWLOADING_LPを再配置する;
return (int)E曲読込画面の戻り値.継続;
}
}
}
- // AVI / BGA
if (base.eフェーズID != CStage.Eフェーズ.演奏_STAGE_FAILED &&
base.eフェーズID != CStage.Eフェーズ.演奏_STAGE_FAILED_フェードアウト)
{
+ // AVI / BGA
actAVI.t進行描画(
CDTXMania.Instance.ConfigIni.cdMovieX[CDTXMania.Instance.ConfigIni.eActiveInst],
CDTXMania.Instance.ConfigIni.cdMovieY[CDTXMania.Instance.ConfigIni.eActiveInst],
private void t進行描画_チップ_ウェイリング(ref CChip pChip)
{
- if (CDTXMania.Instance.ConfigIni.bGuitar有効)
+ if (CDTXMania.Instance.ConfigIni.bGuitar有効 && (!CDTXMania.Instance.DTX2WAVmode.Enabled))
{
EPart indexInst = pChip.bGuitar可視チップ_Wailing含む ? EPart.Guitar : EPart.Bass;
#region [ Sud Hid Inv 処理 ]