MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等
リビジョン | 92e50990dc32044d3cc0eca9070bee18c934d064 (tree) |
---|---|
日時 | 2022-08-12 01:15:20 |
作者 | yoshy <yoshy.org.bitbucket@gz.j...> |
コミッター | yoshy |
[UPGRADE] original 1.3.4
@@ -102,6 +102,9 @@ MIDITrailApp::MIDITrailApp(void) | ||
102 | 102 | m_SpeedStepInPercent = 1; |
103 | 103 | m_MaxSpeedInPercent = 400; |
104 | 104 | |
105 | + //演奏制御 | |
106 | + m_DelayBetweenSongsInMsec = 0; | |
107 | + | |
105 | 108 | //次回オープン対象ファイルパス |
106 | 109 | m_NextFilePath[0] = _T('\0'); |
107 | 110 |
@@ -1772,7 +1775,8 @@ int MIDITrailApp::_OnRecvSequencerMsg( | ||
1772 | 1775 | if (m_MIDIFileList.GetFileCount() == 0) { |
1773 | 1776 | //リピート有効なら再生開始 |
1774 | 1777 | if (m_isRepeat) { |
1775 | - result = _OnMenuPlay(); | |
1778 | + //リピートによるMIDIファイル演奏開始 | |
1779 | + result = _StartTimer_Play(m_DelayBetweenSongsInMsec); | |
1776 | 1780 | if (result != 0) goto EXIT; |
1777 | 1781 | } |
1778 | 1782 | } |
@@ -1780,26 +1784,26 @@ int MIDITrailApp::_OnRecvSequencerMsg( | ||
1780 | 1784 | else { |
1781 | 1785 | //フォルダ演奏無効かつリピート有効なら再生開始 |
1782 | 1786 | if (!m_isFolderPlayback && m_isRepeat) { |
1783 | - result = _OnMenuPlay(); | |
1787 | + //リピートによるMIDIファイル演奏開始 | |
1788 | + result = _StartTimer_Play(m_DelayBetweenSongsInMsec); | |
1784 | 1789 | if (result != 0) goto EXIT; |
1785 | 1790 | } |
1786 | 1791 | //フォルダ演奏有効なら次ファイルを自動選択 |
1787 | 1792 | else if (m_isFolderPlayback) { |
1788 | 1793 | m_MIDIFileList.SelectNextFile(&isExist); |
1789 | 1794 | if (isExist) { |
1790 | - //次ファイルが存在する場合は開いて演奏開始 | |
1791 | - result = _LoadMIDIFile(m_MIDIFileList.GetFilePath(m_MIDIFileList.GetSelectedFileIndex())); | |
1792 | - if (result != 0) goto EXIT; | |
1793 | - result = _OnMenuPlay(); | |
1795 | + //次ファイルが存在する場合 | |
1796 | + //フォルダ演奏による次MIDIファイル演奏開始 | |
1797 | + result = _StartTimer_OpenFileAndPlay(m_DelayBetweenSongsInMsec); | |
1794 | 1798 | if (result != 0) goto EXIT; |
1795 | 1799 | } |
1796 | 1800 | else if (m_isRepeat) { |
1797 | - //次ファイルが存在しないがリピート有効の場合は先頭ファイルを開いて演奏開始 | |
1798 | - m_MIDIFileList.SelectFirstFile(); | |
1799 | - result = _LoadMIDIFile(m_MIDIFileList.GetFilePath(m_MIDIFileList.GetSelectedFileIndex())); | |
1800 | - if (result != 0) goto EXIT; | |
1801 | - result = _OnMenuPlay(); | |
1801 | + //次ファイルが存在しないがリピート有効の場合 | |
1802 | + //フォルダ演奏による次MIDIファイル演奏開始 | |
1803 | + result = _StartTimer_OpenFileAndPlay(m_DelayBetweenSongsInMsec); | |
1802 | 1804 | if (result != 0) goto EXIT; |
1805 | + //先頭ファイルを選択 | |
1806 | + m_MIDIFileList.SelectFirstFile(); | |
1803 | 1807 | } |
1804 | 1808 | } |
1805 | 1809 | } |
@@ -3084,6 +3088,20 @@ int MIDITrailApp::_LoadPlayerConf() | ||
3084 | 3088 | m_SpeedStepInPercent = (unsigned long)speedStepInPercent; |
3085 | 3089 | m_MaxSpeedInPercent = (unsigned long)maxSpeedInPercent; |
3086 | 3090 | |
3091 | + //---------------------------------- | |
3092 | + //演奏制御 | |
3093 | + //---------------------------------- | |
3094 | + result = confFile.SetCurSection("Playback"); | |
3095 | + if (result != 0) goto EXIT; | |
3096 | + result = confFile.GetInt("DelayBetweenSongsInMsec", &m_DelayBetweenSongsInMsec, 0); | |
3097 | + if (result != 0) goto EXIT; | |
3098 | + if (m_DelayBetweenSongsInMsec < 0) { | |
3099 | + m_DelayBetweenSongsInMsec = 0; | |
3100 | + } | |
3101 | + else if (m_DelayBetweenSongsInMsec > 10000) { | |
3102 | + m_DelayBetweenSongsInMsec = 10000; | |
3103 | + } | |
3104 | + | |
3087 | 3105 | EXIT:; |
3088 | 3106 | return result; |
3089 | 3107 | } |
@@ -3443,7 +3461,57 @@ int MIDITrailApp::_StopTimer() | ||
3443 | 3461 | int result = 0; |
3444 | 3462 | |
3445 | 3463 | KillTimer(m_hWnd, MIDITRAIL_TIMER_CHECK_KEY); |
3464 | + KillTimer(m_hWnd, MIDITRAIL_TIMER_PLAY); | |
3465 | + KillTimer(m_hWnd, MIDITRAIL_TIMER_OPEN_FILE_AND_PLAY); | |
3466 | + | |
3467 | + return result; | |
3468 | +} | |
3446 | 3469 | |
3470 | +//****************************************************************************** | |
3471 | +// タイマー開始:演奏開始 | |
3472 | +//****************************************************************************** | |
3473 | +int MIDITrailApp::_StartTimer_Play(int delayBetweenSongsInMsec) | |
3474 | +{ | |
3475 | + int result = 0; | |
3476 | + UINT_PTR apiresult = 0; | |
3477 | + | |
3478 | + //タイマー登録 | |
3479 | + apiresult = SetTimer( | |
3480 | + m_hWnd, //通知先ウィンドウ | |
3481 | + MIDITRAIL_TIMER_PLAY, //タイマーID | |
3482 | + delayBetweenSongsInMsec, //タイムアウト値(ミリ秒) | |
3483 | + NULL //タイマー関数 | |
3484 | + ); | |
3485 | + if (apiresult == 0) { | |
3486 | + result = YN_SET_ERR("Windows API error.", GetLastError(), 0); | |
3487 | + goto EXIT; | |
3488 | + } | |
3489 | + | |
3490 | +EXIT:; | |
3491 | + return result; | |
3492 | +} | |
3493 | + | |
3494 | +//****************************************************************************** | |
3495 | +// タイマー開始:ファイルオープン&演奏開始 | |
3496 | +//****************************************************************************** | |
3497 | +int MIDITrailApp::_StartTimer_OpenFileAndPlay(int delayBetweenSongsInMsec) | |
3498 | +{ | |
3499 | + int result = 0; | |
3500 | + UINT_PTR apiresult = 0; | |
3501 | + | |
3502 | + //タイマー登録 | |
3503 | + apiresult = SetTimer( | |
3504 | + m_hWnd, //通知先ウィンドウ | |
3505 | + MIDITRAIL_TIMER_OPEN_FILE_AND_PLAY, //タイマーID | |
3506 | + delayBetweenSongsInMsec, //タイムアウト値(ミリ秒) | |
3507 | + NULL //タイマー関数 | |
3508 | + ); | |
3509 | + if (apiresult == 0) { | |
3510 | + result = YN_SET_ERR("Windows API error.", GetLastError(), 0); | |
3511 | + goto EXIT; | |
3512 | + } | |
3513 | + | |
3514 | +EXIT:; | |
3447 | 3515 | return result; |
3448 | 3516 | } |
3449 | 3517 |
@@ -3466,7 +3534,27 @@ int MIDITrailApp::_OnTimer( | ||
3466 | 3534 | m_Sequencer.SetPlaybackSpeed(1); |
3467 | 3535 | } |
3468 | 3536 | } |
3537 | + //演奏開始タイマー | |
3538 | + else if (timerId == MIDITRAIL_TIMER_PLAY) { | |
3539 | + //タイマー停止 | |
3540 | + KillTimer(m_hWnd, MIDITRAIL_TIMER_PLAY); | |
3541 | + //演奏開始 | |
3542 | + result = _OnMenuPlay(); | |
3543 | + if (result != 0) goto EXIT; | |
3544 | + } | |
3545 | + //ファイルオープン&演奏開始タイマー | |
3546 | + else if (timerId == MIDITRAIL_TIMER_OPEN_FILE_AND_PLAY) { | |
3547 | + //タイマー停止 | |
3548 | + KillTimer(m_hWnd, MIDITRAIL_TIMER_OPEN_FILE_AND_PLAY); | |
3549 | + //ファイルを開く | |
3550 | + result = _LoadMIDIFile(m_MIDIFileList.GetFilePath(m_MIDIFileList.GetSelectedFileIndex())); | |
3551 | + if (result != 0) goto EXIT; | |
3552 | + //演奏開始 | |
3553 | + result = _OnMenuPlay(); | |
3554 | + if (result != 0) goto EXIT; | |
3555 | + } | |
3469 | 3556 | |
3557 | +EXIT:; | |
3470 | 3558 | return result; |
3471 | 3559 | } |
3472 | 3560 |
@@ -55,7 +55,9 @@ using namespace SMIDILib; | ||
55 | 55 | #define MIDITRAIL_MSG_FILE_NOT_FOUND _T("MIDI file (*.mid) not found.") |
56 | 56 | |
57 | 57 | //タイマーID |
58 | -#define MIDITRAIL_TIMER_CHECK_KEY (1) | |
58 | +#define MIDITRAIL_TIMER_CHECK_KEY (1) | |
59 | +#define MIDITRAIL_TIMER_PLAY (2) | |
60 | +#define MIDITRAIL_TIMER_OPEN_FILE_AND_PLAY (3) | |
59 | 61 | |
60 | 62 | //二重起動抑止用ミューテクス名称 |
61 | 63 | #define MIDITRAIL_MUTEX _T("yknk.MIDITrail") |
@@ -234,6 +236,9 @@ private: | ||
234 | 236 | unsigned long m_SpeedStepInPercent; |
235 | 237 | unsigned long m_MaxSpeedInPercent; |
236 | 238 | |
239 | + //演奏制御 | |
240 | + int m_DelayBetweenSongsInMsec; | |
241 | + | |
237 | 242 | //自動視点保存 |
238 | 243 | bool m_isAutoSaveViewpoint; |
239 | 244 |
@@ -330,6 +335,8 @@ private: | ||
330 | 335 | int _ParseCmdLine(LPTSTR pCmdLine); |
331 | 336 | int _StartTimer(); |
332 | 337 | int _StopTimer(); |
338 | + int _StartTimer_Play(int delayBetweenSongsInMsec); | |
339 | + int _StartTimer_OpenFileAndPlay(int delayBetweenSongsInMsec); | |
333 | 340 | int _OnTimer(WPARAM timerId); |
334 | 341 | int _CheckRenderer(); |
335 | 342 | int _AutoConfigMIDIOUT(); |
@@ -16,8 +16,8 @@ | ||
16 | 16 | //****************************************************************************** |
17 | 17 | |
18 | 18 | //バージョン文字列 |
19 | -#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.3.3 (32bit)") | |
20 | -#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.3.3 (64bit)") | |
19 | +#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.3.4 (32bit)") | |
20 | +#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.3.4 (64bit)") | |
21 | 21 | |
22 | 22 | //コピーライト |
23 | 23 | #define MIDITRAIL_COPYRIGHT _T("Copyright (C) 2010-2021 WADA Masashi"); |
@@ -1,6 +1,6 @@ | ||
1 | 1 | ****************************************************************************** |
2 | 2 | |
3 | - MIDITrail source code Ver.1.3.3 for Windows | |
3 | + MIDITrail source code Ver.1.3.4 for Windows | |
4 | 4 | |
5 | 5 | Copyright (C) 2010-2021 WADA Masashi. All Rights Reserved. |
6 | 6 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | ****************************************************************************** |
2 | 2 | |
3 | - MIDITrail ソースコード Ver.1.3.3 for Windows | |
3 | + MIDITrail ソースコード Ver.1.3.4 for Windows | |
4 | 4 | |
5 | 5 | Copyright (C) 2010-2021 WADA Masashi. All Rights Reserved. |
6 | 6 |
@@ -14,3 +14,6 @@ MovingTimeSpanInMsec=400 | ||
14 | 14 | SpeedStepInPercent=1 |
15 | 15 | MaxSpeedInPercent=400 |
16 | 16 | |
17 | +[Playback] | |
18 | +DelayBetweenSongsInMsec=0 | |
19 | + |
@@ -4,7 +4,7 @@ | ||
4 | 4 | <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
5 | 5 | <meta http-equiv="Content-Language" content="en"> |
6 | 6 | <link rel="stylesheet" href="Files/doc.css" type="text/css"> |
7 | -<title>MIDITrail Ver.1.3.3 for Windows User Manual</title> | |
7 | +<title>MIDITrail Ver.1.3.4 for Windows User Manual</title> | |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 |
@@ -15,7 +15,7 @@ | ||
15 | 15 | English / <a href="MANUAL.ja.html">Japanese</a> |
16 | 16 | </div> |
17 | 17 | |
18 | -<h1>MIDITrail Ver.1.3.3 for Windows User Manual</h1> | |
18 | +<h1>MIDITrail Ver.1.3.4 for Windows User Manual</h1> | |
19 | 19 | |
20 | 20 | <p> |
21 | 21 | Copyright (c) 2010-2021, WADA Masashi All rights reserved.<br> |
@@ -604,6 +604,17 @@ Edit [PlaybackSpeedControl] section.<br> | ||
604 | 604 | </table> |
605 | 605 | </p> |
606 | 606 | |
607 | +<h4>(e) Playback Control</h4> | |
608 | +<p> | |
609 | +Edit [Playback] section.<br> | |
610 | +</p> | |
611 | +<p> | |
612 | +<table> | |
613 | + <tr><th>Name</th><th>Details</th></tr> | |
614 | + <tr><td>DelayBetweenSongsInMsec</td><td>Delay between songs (msec)(0 - 10000)</td></tr> | |
615 | +</table> | |
616 | +</p> | |
617 | + | |
607 | 618 | <h3>(2) View Mode Configuration</h3> |
608 | 619 | |
609 | 620 | <h4>(a) Moving speed of viewpoint</h4> |
@@ -997,6 +1008,9 @@ This version was released with MIDITrail for Mac OS X.<br> | ||
997 | 1008 | #42236 Added sending "All Sound Off" messeage when pause/stop/skip<br> |
998 | 1009 | #42237 Fixed bug (The color of the ripples becomes dark in Piano Roll 3D)<br> |
999 | 1010 | </td></tr> |
1011 | + <tr><td>2021/09/13</td><td>Ver.1.3.4</td><td> | |
1012 | +#42859 Added setting of delay between songs<br> | |
1013 | + </td></tr> | |
1000 | 1014 | </table> |
1001 | 1015 | </p> |
1002 | 1016 |
@@ -4,7 +4,7 @@ | ||
4 | 4 | <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
5 | 5 | <meta http-equiv="Content-Language" content="ja"> |
6 | 6 | <link rel="stylesheet" href="Files/doc.css" type="text/css"> |
7 | -<title>MIDITrail Ver.1.3.3 for Windows ユーザーマニュアル</title> | |
7 | +<title>MIDITrail Ver.1.3.4 for Windows ユーザーマニュアル</title> | |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 |
@@ -14,7 +14,7 @@ | ||
14 | 14 | <a href="MANUAL.en.html">English</a> / Japanese |
15 | 15 | </div> |
16 | 16 | |
17 | -<h1>MIDITrail Ver.1.3.3 for Windows ユーザーマニュアル</h1> | |
17 | +<h1>MIDITrail Ver.1.3.4 for Windows ユーザーマニュアル</h1> | |
18 | 18 | |
19 | 19 | <p> |
20 | 20 | Copyright (c) 2010-2021, WADA Masashi All rights reserved.<br> |
@@ -608,6 +608,17 @@ MIDITrailインストール先のconfフォルダにある設定ファイルを | ||
608 | 608 | </table> |
609 | 609 | </p> |
610 | 610 | |
611 | +<h4>(e) 演奏制御</h4> | |
612 | +<p> | |
613 | +[Playback]セクションを編集します。<br> | |
614 | +</p> | |
615 | +<p> | |
616 | +<table> | |
617 | + <tr><th>値名</th><th>内容</th></tr> | |
618 | + <tr><td>DelayBetweenSongsInMsec</td><td>曲間待機時間 (msec)(0 - 10000)</td></tr> | |
619 | +</table> | |
620 | +</p> | |
621 | + | |
611 | 622 | <h3>(2) ビューモードの設定</h3> |
612 | 623 | |
613 | 624 | <h4>(a) 視点移動速度のカスタマイズ</h4> |
@@ -987,6 +998,9 @@ MIDITrail for Mac OS Xと同時にリリース<br> | ||
987 | 998 | #42236 機能追加:演奏一時停止時にサウンドオフメッセージを送信<br> |
988 | 999 | #42237 バグ修正:Piano Roll 3Dで波紋の色が暗くなる<br> |
989 | 1000 | </td></tr> |
1001 | + <tr><td>2021/09/13</td><td>Ver.1.3.4</td><td> | |
1002 | +#42859 機能追加:曲間待機時間の設定を追加<br> | |
1003 | + </td></tr> | |
990 | 1004 | </table> |
991 | 1005 | </p> |
992 | 1006 |