• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

MIDITrail をピカピカにする。鍵盤方向自動切替・多ポート・歌詞対応等


Commit MetaInfo

修订版0a0ec4b3cd59ec39a89b1737f712e62dba5a52fa (tree)
时间2016-12-24 01:16:52
作者yoshy <yoshy@user...>
Commiteryoshy

Log Message

[UPGRADE] original 1.2.2

更改概述

差异

--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,5 +1,5 @@
11
2-Copyright (c) 2010-2014, WADA Masashi <yknk@users.sourceforge.jp>
2+Copyright (c) 2010-2016, WADA Masashi <yknk@users.osdn.me>
33 All rights reserved.
44
55 Redistribution and use in source and binary forms, with or without
--- a/MIDITrail/MIDITrail.rc
+++ b/MIDITrail/MIDITrail.rc
@@ -70,11 +70,12 @@ BEGIN
7070 MENUITEM "Piano Roll Rain", IDM_VIEW_PIANOROLLRAIN
7171 MENUITEM "Piano Roll Rain 2D", IDM_VIEW_PIANOROLLRAIN2D
7272 MENUITEM SEPARATOR
73- MENUITEM "Piano keyboard", IDM_ENABLE_PIANOKEYBOARD
73+ MENUITEM "Piano Keyboard", IDM_ENABLE_PIANOKEYBOARD
7474 MENUITEM "Ripple", IDM_ENABLE_RIPPLE
7575 MENUITEM "Pitch Bend Motion", IDM_ENABLE_PITCHBEND
7676 MENUITEM "Stars", IDM_ENABLE_STARS
7777 MENUITEM "Counter", IDM_ENABLE_COUNTER
78+ MENUITEM "Background Image", IDM_ENABLE_BACKGROUNDIMAGE
7879 MENUITEM SEPARATOR
7980 MENUITEM "Auto save viewpoint", 32838
8081 MENUITEM SEPARATOR
@@ -151,15 +152,20 @@ BEGIN
151152 PUSHBUTTON "Cancel",IDCANCEL,228,198,50,14
152153 END
153154
154-IDD_WINDOWSIZE_CFG DIALOGEX 0, 0, 160, 183
155+IDD_WINDOWSIZE_CFG DIALOGEX 0, 0, 256, 183
155156 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
156157 CAPTION "Window size configuration"
157158 FONT 8, "MS Shell Dlg", 400, 0, 0x1
158159 BEGIN
159- LISTBOX IDC_WINDOWSIZE_LIST,12,18,138,138,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
160- DEFPUSHBUTTON "OK",IDOK,42,162,50,14
161- PUSHBUTTON "Cancel",IDCANCEL,96,162,50,14
162160 LTEXT "Window size",IDC_STATIC,12,6,84,8
161+ LISTBOX IDC_WINDOWSIZE_LIST,12,18,96,138,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
162+ LTEXT "Width",IDC_STATIC,126,24,48,8
163+ EDITTEXT IDC_EDIT_WIDTH,126,36,48,12,ES_AUTOHSCROLL | ES_NUMBER
164+ LTEXT "Height",IDC_STATIC,186,24,48,8
165+ EDITTEXT IDC_EDIT_HEIGHT,186,36,48,12,ES_AUTOHSCROLL | ES_NUMBER
166+ CONTROL "Apply to the view area",IDC_CHECK_APPLY_TO_VIEW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,126,66,120,10
167+ DEFPUSHBUTTON "OK",IDOK,138,162,50,14
168+ PUSHBUTTON "Cancel",IDCANCEL,192,162,50,14
163169 END
164170
165171 IDD_HOWTOVIEW DIALOGEX 0, 0, 412, 291
@@ -175,15 +181,18 @@ BEGIN
175181 PUSHBUTTON "Close",IDC_BTN_CLOSE,346,267,54,14
176182 END
177183
178-IDD_GRAPHIC_CFG DIALOGEX 0, 0, 178, 75
184+IDD_GRAPHIC_CFG DIALOGEX 0, 0, 280, 111
179185 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
180186 CAPTION "Graphic configuration"
181187 FONT 8, "MS Shell Dlg", 400, 0, 0x1
182188 BEGIN
183- DEFPUSHBUTTON "OK",IDOK,60,54,50,14
184- PUSHBUTTON "Cancel",IDCANCEL,114,54,50,14
185189 LTEXT "Anti-aliasing",IDC_STATIC,18,20,54,8
186190 COMBOBOX IDC_COMBO_MULTISAMPLETYPE,72,18,78,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
191+ LTEXT "Background image file path",IDC_STATIC,18,42,126,8
192+ EDITTEXT IDC_EDIT_IMAGE_FILE_PATH,18,54,222,12,ES_AUTOHSCROLL
193+ PUSHBUTTON "...",IDC_BTN_BROWSE,240,53,25,14
194+ DEFPUSHBUTTON "OK",IDOK,162,84,50,14
195+ PUSHBUTTON "Cancel",IDCANCEL,216,84,50,14
187196 END
188197
189198 IDD_MIDIIN_CFG DIALOGEX 0, 0, 304, 99
@@ -227,7 +236,7 @@ BEGIN
227236 IDD_WINDOWSIZE_CFG, DIALOG
228237 BEGIN
229238 LEFTMARGIN, 7
230- RIGHTMARGIN, 153
239+ RIGHTMARGIN, 249
231240 TOPMARGIN, 7
232241 BOTTOMMARGIN, 176
233242 END
@@ -243,9 +252,9 @@ BEGIN
243252 IDD_GRAPHIC_CFG, DIALOG
244253 BEGIN
245254 LEFTMARGIN, 7
246- RIGHTMARGIN, 171
255+ RIGHTMARGIN, 273
247256 TOPMARGIN, 7
248- BOTTOMMARGIN, 68
257+ BOTTOMMARGIN, 104
249258 END
250259
251260 IDD_MIDIIN_CFG, DIALOG
--- a/MIDITrail/MIDITrail.vcproj
+++ b/MIDITrail/MIDITrail.vcproj
@@ -435,6 +435,14 @@
435435 Name="SceneObject"
436436 >
437437 <File
438+ RelativePath=".\MTBackgroundImage.cpp"
439+ >
440+ </File>
441+ <File
442+ RelativePath=".\MTBackgroundImage.h"
443+ >
444+ </File>
445+ <File
438446 RelativePath=".\MTDashboard.cpp"
439447 >
440448 </File>
--- a/MIDITrail/MIDITrailApp.cpp
+++ b/MIDITrail/MIDITrailApp.cpp
@@ -4,7 +4,7 @@
44 //
55 // MIDITrail アプリケーションクラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -73,6 +73,7 @@ MIDITrailApp::MIDITrailApp(void)
7373 m_isEnableStars = true;
7474 m_isEnableCounter = true;
7575 m_isEnableFileName = false;
76+ m_isEnableBackgroundImage = true;
7677
7778 //シーン種別
7879 m_SceneType = Title;
@@ -417,6 +418,7 @@ int MIDITrailApp::_SetWindowSize()
417418 int height = 0;
418419 RECT wrect, crect;
419420 int ww, wh, cw, ch, framew, frameh;
421+ int applyToViewArea = 0;
420422
421423 //ユーザ選択ウィンドウサイズ取得
422424 result = m_ViewConf.SetCurSection(_T("WindowSize"));
@@ -425,6 +427,8 @@ int MIDITrailApp::_SetWindowSize()
425427 if (result != 0) goto EXIT;
426428 result = m_ViewConf.GetInt(_T("Height"), &height, 0);
427429 if (result != 0) goto EXIT;
430+ result = m_ViewConf.GetInt(_T("ApplyToViewArea"), &applyToViewArea, 0);
431+ if (result != 0) goto EXIT;
428432
429433 //初回起動時のウィンドウサイズ
430434 if ((width <= 0) || (height <= 0)) {
@@ -446,10 +450,11 @@ int MIDITrailApp::_SetWindowSize()
446450 framew = ww - cw;
447451 frameh = wh - ch;
448452
449- //フルスクリーンモードでなければ枠を含めたサイズとする
450- //TODO: フルスクリーンモード対応
451- framew = 0;
452- frameh = 0;
453+ //描画領域に指定サイズを適用する場合
454+ if (applyToViewArea != 0) {
455+ width = width + framew;
456+ height = height + frameh;
457+ }
453458
454459 //ウィンドウサイズ変更
455460 bresult = SetWindowPos(
@@ -457,8 +462,8 @@ int MIDITrailApp::_SetWindowSize()
457462 HWND_TOP, //配置順序:Zオーダー先頭
458463 0, //横方向の位置
459464 0, //縦方向の位置
460- width + framew, //幅
461- height + frameh,//高さ
465+ width, //幅
466+ height, //高さ
462467 SWP_NOMOVE //ウィンドウ位置指定
463468 );
464469 if (!bresult) {
@@ -661,6 +666,11 @@ LRESULT MIDITrailApp::_WndProcImpl(
661666 result = _OnMenuEnableEffect(MTScene::EffectCounter);
662667 if (result != 0) goto EXIT;
663668 break;
669+ case IDM_ENABLE_BACKGROUNDIMAGE:
670+ //表示効果:背景画像
671+ result = _OnMenuEnableEffect(MTScene::EffectBackgroundImage);
672+ if (result != 0) goto EXIT;
673+ break;
664674 case IDM_WINDOWSIZE:
665675 //ウィンドウサイズ設定
666676 result = _OnMenuWindowSize();
@@ -1213,6 +1223,9 @@ int MIDITrailApp::_OnMenuEnableEffect(
12131223 case MTScene::EffectCounter:
12141224 m_isEnableCounter = m_isEnableCounter ? false : true;
12151225 break;
1226+ case MTScene::EffectBackgroundImage:
1227+ m_isEnableBackgroundImage = m_isEnableBackgroundImage ? false : true;
1228+ break;
12161229 default:
12171230 break;
12181231 }
@@ -1236,7 +1249,7 @@ int MIDITrailApp::_OnMenuWindowSize()
12361249 if (result != 0) goto EXIT;
12371250
12381251 //変更された場合はウィンドウサイズを更新
1239- if (m_WindowSizeCfgDlg.IsCahnged()) {
1252+ if (m_WindowSizeCfgDlg.IsChanged()) {
12401253 result = _ChangeWindowSize();
12411254 if (result != 0) goto EXIT;
12421255 }
@@ -1297,7 +1310,7 @@ int MIDITrailApp::_OnMenuOptionGraphic()
12971310 if (result != 0) goto EXIT;
12981311
12991312 //変更された場合はレンダラとシーンオブジェクトを再生成
1300- if (m_GraphicCfgDlg.IsCahnged()) {
1313+ if (m_GraphicCfgDlg.IsChanged()) {
13011314 result = _LoadGraphicConf();
13021315 if (result != 0) goto EXIT;
13031316 result = _ChangeWindowSize();
@@ -1987,6 +2000,7 @@ int MIDITrailApp::_ChangeMenuStyle()
19872000 IDM_ENABLE_PITCHBEND,
19882001 IDM_ENABLE_STARS,
19892002 IDM_ENABLE_COUNTER,
2003+ IDM_ENABLE_BACKGROUNDIMAGE,
19902004 IDM_WINDOWSIZE,
19912005 IDM_OPTION_MIDIOUT,
19922006 IDM_OPTION_MIDIIN,
@@ -2022,6 +2036,7 @@ int MIDITrailApp::_ChangeMenuStyle()
20222036 { MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED }, //IDM_ENABLE_PITCHBEND
20232037 { MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED }, //IDM_ENABLE_STARS
20242038 { MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED }, //IDM_ENABLE_COUNTER
2039+ { MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED, MF_ENABLED }, //IDM_ENABLE_BACKGROUNDIMAGE
20252040 { MF_ENABLED, MF_ENABLED, MF_GRAYED, MF_GRAYED, MF_ENABLED, MF_GRAYED }, //IDM_WINDOWSIZE
20262041 { MF_ENABLED, MF_ENABLED, MF_GRAYED, MF_GRAYED, MF_ENABLED, MF_GRAYED }, //IDM_OPTION_MIDIOUT
20272042 { MF_ENABLED, MF_ENABLED, MF_GRAYED, MF_GRAYED, MF_ENABLED, MF_GRAYED }, //IDM_OPTION_MIDIIN
@@ -2635,6 +2650,9 @@ int MIDITrailApp::_UpdateMenuCheckmark()
26352650 //カウンタ表示
26362651 _CheckMenuItem(IDM_ENABLE_COUNTER, m_isEnableCounter);
26372652
2653+ //背景画像表示
2654+ _CheckMenuItem(IDM_ENABLE_BACKGROUNDIMAGE, m_isEnableBackgroundImage);
2655+
26382656 //自動視点保存
26392657 _CheckMenuItem(IDM_AUTO_SAVE_VIEWPOINT, m_isAutoSaveViewpoint);
26402658
@@ -2676,6 +2694,7 @@ void MIDITrailApp::_UpdateEffect()
26762694 m_pScene->SetEffect(MTScene::EffectStars, m_isEnableStars);
26772695 m_pScene->SetEffect(MTScene::EffectCounter, m_isEnableCounter);
26782696 m_pScene->SetEffect(MTScene::EffectFileName, m_isEnableFileName);
2697+ m_pScene->SetEffect(MTScene::EffectBackgroundImage, m_isEnableBackgroundImage);
26792698 }
26802699 return;
26812700 }
--- a/MIDITrail/MIDITrailApp.h
+++ b/MIDITrail/MIDITrailApp.h
@@ -4,7 +4,7 @@
44 //
55 // MIDITrail アプリケーションクラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -43,7 +43,7 @@ using namespace SMIDILib;
4343 #define WM_FILEPATH_POSTED (WM_USER + 100)
4444
4545 //メニュースタイル制御
46-#define MT_MENU_NUM (30)
46+#define MT_MENU_NUM (31)
4747 #define MT_PLAYSTATUS_NUM (6)
4848
4949 //デバイスロスト警告メッセージ
@@ -178,6 +178,7 @@ private:
178178 bool m_isEnableStars;
179179 bool m_isEnableCounter;
180180 bool m_isEnableFileName;
181+ bool m_isEnableBackgroundImage;
181182
182183 //シーン種別
183184 SceneType m_SceneType;
--- a/MIDITrail/MIDITrailVersion.h
+++ b/MIDITrail/MIDITrailVersion.h
@@ -4,7 +4,7 @@
44 //
55 // MIDITrail バージョン定義
66 //
7-// Copyright (C) 2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2014-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -16,10 +16,10 @@
1616 //******************************************************************************
1717
1818 //バージョン文字列
19-#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.2.1b")
20-#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.2.1b (x64)")
19+#define MIDITRAIL_VERSION_STRING_X86 _T("Version 1.2.2 (32bit)")
20+#define MIDITRAIL_VERSION_STRING_X64 _T("Version 1.2.2 (64bit)")
2121
2222 //コピーライト
23-#define MIDITRAIL_COPYRIGHT _T("Copyright (C) 2010-2014 WADA Masashi");
23+#define MIDITRAIL_COPYRIGHT _T("Copyright (C) 2010-2016 WADA Masashi");
2424
2525
--- /dev/null
+++ b/MIDITrail/MTBackgroundImage.cpp
@@ -0,0 +1,371 @@
1+//******************************************************************************
2+//
3+// MIDITrail / MTBackgroundImage
4+//
5+// 背景画像描画クラス
6+//
7+// Copyright (C) 2016 WADA Masashi. All Rights Reserved.
8+//
9+//******************************************************************************
10+
11+#include "StdAfx.h"
12+#include "shlwapi.h"
13+#include "MTParam.h"
14+#include "MTConfFile.h"
15+#include "MTBackgroundImage.h"
16+
17+
18+//******************************************************************************
19+// コンストラクタ
20+//******************************************************************************
21+MTBackgroundImage::MTBackgroundImage(void)
22+{
23+ m_pTexture = NULL;
24+ ZeroMemory(&m_ImgInfo, sizeof(D3DXIMAGE_INFO));
25+ m_hWnd = NULL;
26+ m_isEnable = true;
27+ m_isFilterLinear = true;
28+}
29+
30+//******************************************************************************
31+// デストラクタ
32+//******************************************************************************
33+MTBackgroundImage::~MTBackgroundImage(void)
34+{
35+ Release();
36+}
37+
38+//******************************************************************************
39+// 背景画像生成
40+//******************************************************************************
41+int MTBackgroundImage::Create(
42+ LPDIRECT3DDEVICE9 pD3DDevice,
43+ HWND hWnd
44+ )
45+{
46+ int result = 0;
47+ unsigned long vertexNum = 0;
48+ unsigned long indexNum = 0;
49+ MTBACKGROUNDIMAGE_VERTEX* pVertex = NULL;
50+ unsigned long* pIndex = NULL;
51+
52+ Release();
53+
54+ m_hWnd = hWnd;
55+
56+ //設定ファイル初期化
57+ result = _InitConfFile();
58+ if (result != 0) goto EXIT;
59+
60+ //テクスチャ読み込み
61+ result = _LoadTexture(pD3DDevice);
62+ if (result != 0) goto EXIT;
63+
64+ //テクスチャを生成しなかった場合は何もしない
65+ if (m_pTexture == NULL) goto EXIT;
66+
67+ //プリミティブ初期化
68+ result = m_Primitive.Initialize(
69+ sizeof(MTBACKGROUNDIMAGE_VERTEX), //頂点サイズ
70+ _GetFVFFormat(), //頂点FVFフォーマット
71+ D3DPT_TRIANGLESTRIP //プリミティブ種別
72+ );
73+ if (result != 0) goto EXIT;
74+
75+ //頂点バッファ生成
76+ vertexNum = 4;
77+ result = m_Primitive.CreateVertexBuffer(pD3DDevice, vertexNum);
78+ if (result != 0) goto EXIT;
79+
80+ //インデックスバッファ生成
81+ indexNum = 4;
82+ result = m_Primitive.CreateIndexBuffer(pD3DDevice, indexNum);
83+ if (result != 0) goto EXIT;
84+
85+ //バッファのロック
86+ result = m_Primitive.LockVertex((void**)&pVertex);
87+ if (result != 0) goto EXIT;
88+ result = m_Primitive.LockIndex(&pIndex);
89+ if (result != 0) goto EXIT;
90+
91+ //バッファに頂点とインデックスを書き込む
92+ result = _CreateVertexOfBackground(
93+ pVertex, //頂点バッファ書き込み位置
94+ pIndex //インデックスバッファ書き込み位置
95+ );
96+ if (result != 0) goto EXIT;
97+
98+ //バッファのロック解除
99+ result = m_Primitive.UnlockVertex();
100+ if (result != 0) goto EXIT;
101+ result = m_Primitive.UnlockIndex();
102+ if (result != 0) goto EXIT;
103+
104+EXIT:;
105+ return result;
106+}
107+
108+//******************************************************************************
109+// 描画
110+//******************************************************************************
111+int MTBackgroundImage::Draw(
112+ LPDIRECT3DDEVICE9 pD3DDevice
113+ )
114+{
115+ int result = 0;
116+ DWORD value = 0;
117+
118+ if (!m_isEnable) goto EXIT;
119+ if (m_pTexture == NULL) goto EXIT;
120+
121+ //Zバッファを一時的に無効化する
122+ pD3DDevice->GetRenderState(D3DRS_ZENABLE, &value);
123+ pD3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
124+
125+ //テクスチャステージ設定
126+ // カラー演算:引数1を使用 引数1:テクスチャ
127+ pD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
128+ pD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
129+ // アルファ演算:引数1を使用 引数1:テクスチャ
130+ pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
131+ pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
132+
133+ //テクスチャフィルタ
134+ if (m_isFilterLinear) {
135+ pD3DDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
136+ pD3DDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
137+ }
138+ else {
139+ //ピクセル等倍で描画する場合ボケないようにする
140+ pD3DDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
141+ pD3DDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
142+ }
143+
144+ //描画
145+ result = m_Primitive.Draw(pD3DDevice, m_pTexture);
146+ if (result != 0) goto EXIT;
147+
148+ //Zバッファ有効化状態を戻す
149+ pD3DDevice->SetRenderState(D3DRS_ZENABLE, value);
150+
151+EXIT:;
152+ return result;
153+}
154+
155+//******************************************************************************
156+// 解放
157+//******************************************************************************
158+void MTBackgroundImage::Release()
159+{
160+ m_Primitive.Release();
161+
162+ if (m_pTexture != NULL) {
163+ m_pTexture->Release();
164+ m_pTexture = NULL;
165+ }
166+}
167+
168+//******************************************************************************
169+// 背景画像頂点生成
170+//******************************************************************************
171+int MTBackgroundImage::_CreateVertexOfBackground(
172+ MTBACKGROUNDIMAGE_VERTEX* pVertex,
173+ unsigned long* pIndex
174+ )
175+{
176+ int result = 0;
177+ BOOL bresult = 0;
178+ RECT rect;
179+ unsigned long i = 0;
180+ unsigned long cw = 0;
181+ unsigned long ch = 0;
182+ float ratio_cwh = 0.0f;
183+ float ratio_iwh = 0.0f;
184+ float x1 = 0.0f;
185+ float x2 = 0.0f;
186+ float y1 = 0.0f;
187+ float y2 = 0.0f;
188+
189+ //クライアント領域のサイズを取得
190+ bresult = GetClientRect(m_hWnd, &rect);
191+ if (!bresult) {
192+ result = YN_SET_ERR("Windows API error.", GetLastError(), 0);
193+ goto EXIT;
194+ }
195+ cw = rect.right - rect.left;
196+ ch = rect.bottom - rect.top;
197+
198+ ratio_cwh = (float)cw / (float)ch;
199+ ratio_iwh = (float)m_ImgInfo.Width / (float)m_ImgInfo.Height;
200+
201+ // クライアント領域より画像の方が横長の場合
202+ // |----- cw -----|
203+ // ---0--------------+-- +x
204+ // | | |
205+ // | +--------------+
206+ // ch | image |
207+ // | +--------------+
208+ // | | |
209+ // ---+--------------+
210+ // |
211+ // +y
212+ if (ratio_cwh < ratio_iwh) {
213+ x1 = 0.0f;
214+ x2 = (float)cw;
215+ y1 = ((float)ch - ((float)cw / ratio_iwh)) / 2.0f;
216+ y2 = (float)ch - y1;
217+
218+ //ピクセル等倍で描画する場合はリニアフィルタを解除してボケないようにする
219+ if (cw == m_ImgInfo.Width) {
220+ m_isFilterLinear = false;
221+ }
222+ }
223+ // クライアント領域より画像の方が縦長の場合
224+ // |----- cw -----|
225+ // ---0--+--------+--+-- +x
226+ // | | | | |
227+ // | | | | |
228+ // ch | | image | |
229+ // | | | | |
230+ // | | | | |
231+ // ---+--+--------+--+
232+ // |
233+ // +y
234+ else {
235+ x1 = ((float)cw - ((float)ch * ratio_iwh)) / 2.0f;
236+ x2 = (float)cw - x1 - 1.0f;
237+ y1 = 0.0f;
238+ y2 = (float)ch - 1.0f;
239+
240+ //ピクセル等倍で描画する場合はリニアフィルタを解除してボケないようにする
241+ if (ch == m_ImgInfo.Height) {
242+ m_isFilterLinear = false;
243+ }
244+ }
245+
246+ //ピクセル等倍で描画する場合を想定して座標を調整
247+ x1 -= 0.5f;
248+ x2 -= 0.5f;
249+ y1 -= 0.5f;
250+ y2 -= 0.5f;
251+
252+ //頂点座標
253+ pVertex[0].p = D3DXVECTOR3(x1, y1, 0.0f);
254+ pVertex[1].p = D3DXVECTOR3(x2, y1, 0.0f);
255+ pVertex[2].p = D3DXVECTOR3(x1, y2, 0.0f);
256+ pVertex[3].p = D3DXVECTOR3(x2, y2, 0.0f);
257+
258+ //各頂点のディフューズ色
259+ for (i = 0; i < 4; i++) {
260+ //各頂点の除算数
261+ pVertex[i].rhw = 1.0f;
262+ //各頂点のディフューズ色
263+ pVertex[i].c = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
264+ }
265+
266+ //各頂点のテクスチャ座標
267+ pVertex[0].t = D3DXVECTOR2(0.0f, 0.0f);
268+ pVertex[1].t = D3DXVECTOR2(1.0f, 0.0f);
269+ pVertex[2].t = D3DXVECTOR2(0.0f, 1.0f);
270+ pVertex[3].t = D3DXVECTOR2(1.0f, 1.0f);
271+
272+ //インデックス:TRIANGLESTRIP
273+ pIndex[0] = 0;
274+ pIndex[1] = 1;
275+ pIndex[2] = 2;
276+ pIndex[3] = 3;
277+
278+EXIT:;
279+ return result;
280+}
281+
282+//******************************************************************************
283+// 設定ファイル初期化
284+//******************************************************************************
285+int MTBackgroundImage::_InitConfFile()
286+{
287+ int result = 0;
288+ TCHAR userConfFilePath[_MAX_PATH] = {_T('\0')};
289+
290+ result = YNPathUtil::GetAppDataDirPath(userConfFilePath, _MAX_PATH);
291+ if (result != 0) goto EXIT;
292+
293+ _tcscat_s(userConfFilePath, _MAX_PATH, MT_USER_CONFFILE_DIR);
294+ _tcscat_s(userConfFilePath, _MAX_PATH, MT_USER_CONFFILE_GRAPHIC);
295+
296+ result = m_ConfFile.Initialize(userConfFilePath);
297+ if (result != 0) goto EXIT;
298+
299+EXIT:;
300+ return result;
301+}
302+
303+//******************************************************************************
304+// テクスチャ画像読み込み
305+//******************************************************************************
306+int MTBackgroundImage::_LoadTexture(
307+ LPDIRECT3DDEVICE9 pD3DDevice
308+ )
309+{
310+ int result = 0;
311+ HRESULT hresult = D3D_OK;
312+ TCHAR imageFilePath[_MAX_PATH] = {_T('\0')};
313+
314+ //ビットマップファイル名
315+ result = m_ConfFile.SetCurSection(_T("Background-image"));
316+ if (result != 0) goto EXIT;
317+ result = m_ConfFile.GetStr(_T("ImageFilePath"), imageFilePath, _MAX_PATH, _T(""));
318+ if (result != 0) goto EXIT;
319+
320+ //ファイル未指定なら何もしない
321+ if (_tcslen(imageFilePath) == 0) goto EXIT;
322+
323+ //ファイルが存在しない場合は何もしない
324+ if (!PathFileExists(imageFilePath)) goto EXIT;
325+
326+ //読み込む画像の縦横サイズを取得しておく
327+ hresult = D3DXGetImageInfoFromFile(imageFilePath, &m_ImgInfo);
328+ if (FAILED(hresult)) {
329+ result = YN_SET_ERR("DirectX API error.", hresult, 0);
330+ goto EXIT;
331+ }
332+
333+ //テクスチャ画像として読み込み
334+ // ピクセル等倍で描画する場合にボケないようにするため
335+ // 画像サイズを指定して読み込み
336+ hresult = D3DXCreateTextureFromFileEx(
337+ pD3DDevice, //デバイス
338+ imageFilePath, //ファイルパス
339+ m_ImgInfo.Width, //幅(ピクセル):直接指定
340+ m_ImgInfo.Height, //高さ(ピクセル):直接指定
341+ 1, //ミップレベル
342+ 0, //使用方法
343+ D3DFMT_A8R8G8B8, //ピクセルフォーマット
344+ D3DPOOL_MANAGED, //テクスチャ配置先メモリクラス
345+ D3DX_FILTER_NONE, //フィルタリング指定
346+ D3DX_FILTER_NONE, //フィルタリング指定(ミップ)
347+ 0xFF000000, //透明色の指定:不透明黒
348+ NULL, //ソースイメージ情報
349+ NULL, //256色パレット
350+ &m_pTexture //作成されたテクスチャオブジェクト
351+ );
352+ if (FAILED(hresult)) {
353+ result = YN_SET_ERR("DirectX API error.", hresult, 0);
354+ goto EXIT;
355+ }
356+
357+EXIT:;
358+ return result;
359+}
360+
361+//******************************************************************************
362+// 表示設定
363+//******************************************************************************
364+void MTBackgroundImage::SetEnable(
365+ bool isEnable
366+ )
367+{
368+ m_isEnable = isEnable;
369+}
370+
371+
--- /dev/null
+++ b/MIDITrail/MTBackgroundImage.h
@@ -0,0 +1,88 @@
1+//******************************************************************************
2+//
3+// MIDITrail / MTBackgroundImage
4+//
5+// 背景画像描画クラス
6+//
7+// Copyright (C) 2016 WADA Masashi. All Rights Reserved.
8+//
9+//******************************************************************************
10+
11+// MEMO:
12+// 背景画像を描画する。
13+// 画像ファイルは .bmp .dds .dib .jpg .png .tga を指定可能。
14+// (D3DXCreateTextureFromFile がサポートしている画像)
15+
16+#pragma once
17+
18+#include <d3d9.h>
19+#include <d3dx9.h>
20+#include "YNBaseLib.h"
21+#include "DXPrimitive.h"
22+
23+using namespace YNBaseLib;
24+
25+
26+//******************************************************************************
27+// 背景画像描画クラス
28+//******************************************************************************
29+class MTBackgroundImage
30+{
31+public:
32+
33+ //コンストラクタ/デストラクタ
34+ MTBackgroundImage(void);
35+ virtual ~MTBackgroundImage(void);
36+
37+ //生成
38+ int Create(LPDIRECT3DDEVICE9 pD3DDevice, HWND hWnd);
39+
40+ //描画
41+ int Draw(LPDIRECT3DDEVICE9 pD3DDevice);
42+
43+ //解放
44+ void Release();
45+
46+ //リセット
47+ void Reset();
48+
49+ //表示設定
50+ void SetEnable(bool isEnable);
51+
52+private:
53+
54+ HWND m_hWnd;
55+ DXPrimitive m_Primitive;
56+ LPDIRECT3DTEXTURE9 m_pTexture;
57+ D3DXIMAGE_INFO m_ImgInfo;
58+ bool m_isEnable;
59+ bool m_isFilterLinear;
60+
61+ //設定ファイル
62+ YNConfFile m_ConfFile;
63+
64+ //頂点バッファ構造体
65+ struct MTBACKGROUNDIMAGE_VERTEX {
66+ D3DXVECTOR3 p; //頂点座標
67+ float rhw; //除算数
68+ DWORD c; //ディフューズ色
69+ D3DXVECTOR2 t; //テクスチャ画像位置
70+ };
71+
72+ //頂点バッファFVFフォーマット
73+ DWORD _GetFVFFormat(){ return (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1); }
74+
75+ //頂点生成
76+ int _CreateVertexOfBackground(
77+ MTBACKGROUNDIMAGE_VERTEX* pVertex,
78+ unsigned long* pIbIndex
79+ );
80+
81+ //設定ファイル初期化
82+ int _InitConfFile();
83+
84+ //テクスチャ画像読み込み
85+ int _LoadTexture(LPDIRECT3DDEVICE9 pD3DDevice);
86+
87+};
88+
--- a/MIDITrail/MTGraphicCfgDlg.cpp
+++ b/MIDITrail/MTGraphicCfgDlg.cpp
@@ -4,12 +4,13 @@
44 //
55 // グラフィック設定ダイアログクラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
1111 #include "StdAfx.h"
1212 #include "resource.h"
13+#include "Commdlg.h"
1314 #include "MTParam.h"
1415 #include "MTGraphicCfgDlg.h"
1516
@@ -27,8 +28,12 @@ MTGraphicCfgDlg::MTGraphicCfgDlg(void)
2728 unsigned long type = 0;
2829
2930 m_pThis = this;
31+ m_hWnd = NULL;
3032 m_MultiSampleType = 0;
31- m_isCahnged = false;
33+ m_hComboMultiSampleType = NULL;
34+ m_hEditImageFilePath = NULL;
35+ m_ImageFilePath[0] = _T('\0');
36+ m_isChanged = false;
3237
3338 for (type = 0; type < DX_MULTI_SAMPLE_TYPE_MAX; type++) {
3439 m_MultSampleTypeSupport[type] = false;
@@ -42,7 +47,6 @@ MTGraphicCfgDlg::MTGraphicCfgDlg(void)
4247 //******************************************************************************
4348 MTGraphicCfgDlg::~MTGraphicCfgDlg(void)
4449 {
45- m_hComboMultiSampleType = NULL;
4650 }
4751
4852 //******************************************************************************
@@ -85,6 +89,10 @@ INT_PTR MTGraphicCfgDlg::_WndProcImpl(
8589 EndDialog(hDlg, LOWORD(wParam));
8690 bresult = TRUE;
8791 }
92+ else if (LOWORD(wParam) == IDC_BTN_BROWSE) {
93+ result = _OnBtnBrowse();
94+ if (result != 0) goto EXIT;
95+ }
8896 break;
8997 }
9098
@@ -153,7 +161,8 @@ int MTGraphicCfgDlg::_OnInitDlg(
153161 {
154162 int result = 0;
155163
156- m_isCahnged = false;
164+ m_hWnd = hDlg;
165+ m_isChanged = false;
157166
158167 //設定ファイル初期化
159168 result = _InitConfFile();
@@ -168,6 +177,11 @@ int MTGraphicCfgDlg::_OnInitDlg(
168177 result = _InitComboMultiSampleType(m_hComboMultiSampleType, m_MultiSampleType);
169178 if (result != 0) goto EXIT;
170179
180+ //背景画像ファイルパス初期化
181+ m_hEditImageFilePath = GetDlgItem(hDlg, IDC_EDIT_IMAGE_FILE_PATH);
182+ result = _InitBackgroundImageFilePath();
183+ if (result != 0) goto EXIT;
184+
171185 EXIT:;
172186 return result;
173187 }
@@ -201,6 +215,7 @@ int MTGraphicCfgDlg::_LoadConf()
201215 int result = 0;
202216 int multiSampleType = 0;
203217
218+ //アンチエイリアス設定値取得
204219 result = m_ConfFile.SetCurSection(_T("Anti-aliasing"));
205220 if (result != 0) goto EXIT;
206221
@@ -220,6 +235,13 @@ int MTGraphicCfgDlg::_LoadConf()
220235 m_MultiSampleType = 0;
221236 }
222237
238+ //背景画像ファイルパス設定値取得
239+ result = m_ConfFile.SetCurSection(_T("Background-image"));
240+ if (result != 0) goto EXIT;
241+
242+ result = m_ConfFile.GetStr(_T("ImageFilePath"), m_ImageFilePath, _MAX_PATH, _T(""));
243+ if (result != 0) goto EXIT;
244+
223245 EXIT:;
224246 return result;
225247 }
@@ -306,14 +328,38 @@ EXIT:;
306328 }
307329
308330 //******************************************************************************
309-// デバイス選択情報保存
331+// 背景画像ファイルパス初期化
332+//******************************************************************************
333+int MTGraphicCfgDlg::_InitBackgroundImageFilePath()
334+{
335+ int result = 0;
336+ BOOL bresult = FALSE;
337+
338+ //エディットボックスに入力可能最大文字数を設定
339+ SendMessage(m_hEditImageFilePath, EM_SETLIMITTEXT, (WPARAM)_MAX_PATH, 0);
340+
341+ //エディットボックスにファイルパスを設定
342+ bresult = SetWindowText(m_hEditImageFilePath, m_ImageFilePath);
343+ if (!bresult) {
344+ result = YN_SET_ERR("Windows API error.", GetLastError(), 0);
345+ goto EXIT;
346+ }
347+
348+EXIT:;
349+ return result;
350+}
351+
352+//******************************************************************************
353+// 設定情報保存
310354 //******************************************************************************
311355 int MTGraphicCfgDlg::_Save()
312356 {
313357 int result = 0;
358+ int apiresult = 0;
314359 LRESULT lresult = 0;
315360 unsigned long selectedIndex = 0;
316361 unsigned long selectedMultiSampleType = 0;
362+ TCHAR filePath[_MAX_PATH] = {_T('\0')};
317363
318364 //選択項目のインデックスを取得
319365 lresult = SendMessage(m_hComboMultiSampleType, CB_GETCURSEL, 0, 0);
@@ -331,17 +377,37 @@ int MTGraphicCfgDlg::_Save()
331377 }
332378 selectedMultiSampleType = (unsigned long)lresult;
333379
334- //設定保存
380+ //アンチエイリアス設定保存
335381 result = m_ConfFile.SetCurSection(_T("Anti-aliasing"));
336382 if (result != 0) goto EXIT;
337383 result = m_ConfFile.SetInt(_T("MultiSampleType"), selectedMultiSampleType);
338384 if (result != 0) goto EXIT;
339385
386+ //変更確認
340387 if (m_MultiSampleType != selectedMultiSampleType) {
341- m_isCahnged = true;
388+ m_isChanged = true;
342389 }
343390 m_MultiSampleType = selectedMultiSampleType;
344391
392+ //背景画像ファイルパスをエディットボックスから取得
393+ apiresult = GetWindowText(m_hEditImageFilePath, filePath, _MAX_PATH);
394+ if (apiresult == 0) {
395+ //テキスト無しまたはウィンドウハンドル無効の場合
396+ filePath[0] = _T('\0');
397+ }
398+
399+ //背景画像ファイルパス設定保存
400+ result = m_ConfFile.SetCurSection(_T("Background-image"));
401+ if (result != 0) goto EXIT;
402+ result = m_ConfFile.SetStr(_T("ImageFilePath"), filePath);
403+ if (result != 0) goto EXIT;
404+
405+ //変更確認
406+ if (_tcscmp(m_ImageFilePath, filePath) != 0) {
407+ m_isChanged = true;
408+ }
409+ _tcscpy_s(m_ImageFilePath, _MAX_PATH, filePath);
410+
345411 EXIT:;
346412 return result;
347413 }
@@ -349,9 +415,78 @@ EXIT:;
349415 //******************************************************************************
350416 // パラメータ変更確認
351417 //******************************************************************************
352-bool MTGraphicCfgDlg::IsCahnged()
418+bool MTGraphicCfgDlg::IsChanged()
353419 {
354- return m_isCahnged;
420+ return m_isChanged;
355421 }
356422
423+//******************************************************************************
424+// 背景画像ファイルパス ブラウズボタン押下
425+//******************************************************************************
426+int MTGraphicCfgDlg::_OnBtnBrowse()
427+{
428+ int result = 0;
429+ BOOL bresult = FALSE;
430+ TCHAR filePath[_MAX_PATH] = {_T('\0')};
431+ bool isSelected = false;
432+
433+ //ファイル選択ダイアログ表示
434+ result = _SelectImageFile(filePath, _MAX_PATH, &isSelected);
435+ if (result != 0) goto EXIT;
436+
437+ //ファイル未選択の場合は何もしない
438+ if (!isSelected) goto EXIT;
439+
440+ //エディットボックスにファイルパスを設定
441+ bresult = SetWindowText(m_hEditImageFilePath, filePath);
442+ if (!bresult) {
443+ result = YN_SET_ERR("Windows API error.", GetLastError(), 0);
444+ goto EXIT;
445+ }
446+
447+EXIT:;
448+ return result;
449+}
450+
451+//******************************************************************************
452+// 画像ファイル選択
453+//******************************************************************************
454+int MTGraphicCfgDlg::_SelectImageFile(
455+ TCHAR* pFilePath,
456+ unsigned long bufSize,
457+ bool* pIsSelected
458+ )
459+{
460+ int result = 0;
461+ BOOL apiresult = FALSE;
462+ OPENFILENAME ofn;
463+
464+ if ((pFilePath == NULL) || (bufSize == 0) || (pIsSelected ==NULL)) {
465+ result = YN_SET_ERR("Program error.", 0, 0);
466+ goto EXIT;
467+ }
468+
469+ pFilePath[0] = _T('\0');
470+ ZeroMemory(&ofn, sizeof(OPENFILENAME));
471+ ofn.lStructSize = sizeof(OPENFILENAME);
472+ ofn.hwndOwner = m_hWnd;
473+ ofn.lpstrFilter = _T("Image file (*.jpg *.png *.bmp)\0*.jpg;*.png;*.bmp\0");
474+ ofn.lpstrFile = pFilePath;
475+ ofn.nMaxFile = bufSize;
476+ ofn.lpstrTitle = _T("Select image file.");
477+ ofn.Flags = OFN_FILEMUSTEXIST; //OFN_HIDEREADONLY
478+
479+ //ファイル選択ダイアログ表示
480+ apiresult = GetOpenFileName(&ofn);
481+ if (!apiresult) {
482+ //キャンセルまたはエラー発生:エラーはチェックしない
483+ *pIsSelected = false;
484+ goto EXIT;
485+ }
486+
487+ *pIsSelected = true;
488+
489+EXIT:;
490+ return result;
491+}
357492
--- a/MIDITrail/MTGraphicCfgDlg.h
+++ b/MIDITrail/MTGraphicCfgDlg.h
@@ -4,7 +4,7 @@
44 //
55 // グラフィック設定ダイアログクラス
66 //
7-// Copyright (C) 2010 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -41,7 +41,7 @@ public:
4141 int Show(HWND hParentWnd);
4242
4343 //パラメータ変更確認
44- bool IsCahnged();
44+ bool IsChanged();
4545
4646 private:
4747
@@ -51,6 +51,9 @@ private:
5151 //アプリケーションインスタンス
5252 HINSTANCE m_hInstance;
5353
54+ //ウィンドウハンドル
55+ HWND m_hWnd;
56+
5457 //設定ファイル
5558 YNConfFile m_ConfFile;
5659
@@ -58,11 +61,17 @@ private:
5861 HWND m_hComboMultiSampleType;
5962 bool m_MultSampleTypeSupport[DX_MULTI_SAMPLE_TYPE_MAX+1];
6063
64+ //背景画像ファイルパスエディットボックスのウィンドウハンドル
65+ HWND m_hEditImageFilePath;
66+
6167 //アンチエイリアシング設定
6268 unsigned long m_MultiSampleType;
6369
70+ //背景画像ファイルパス
71+ TCHAR m_ImageFilePath[_MAX_PATH];
72+
6473 //更新フラグ
65- bool m_isCahnged;
74+ bool m_isChanged;
6675
6776 //ウィンドウプロシージャ
6877 static INT_PTR CALLBACK _WndProc(HWND, UINT, WPARAM, LPARAM);
@@ -80,9 +89,18 @@ private:
8089 //デバイス選択コンボボックス初期化
8190 int _InitComboMultiSampleType(HWND hCombo, unsigned long selMultiSampleType);
8291
92+ //背景画像ファイルパス初期化
93+ int _InitBackgroundImageFilePath();
94+
8395 //保存処理
8496 int _Save();
8597
98+ //背景画像ファイルパスブラウズボタン押下
99+ int _OnBtnBrowse();
100+
101+ //画像ファイル選択
102+ int _SelectImageFile(TCHAR* pFilePath, unsigned long bufSize, bool* pIsSelected);
103+
86104 };
87105
88106
--- a/MIDITrail/MTScene.h
+++ b/MIDITrail/MTScene.h
@@ -4,7 +4,7 @@
44 //
55 // MIDITrail シーン基底クラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -33,6 +33,7 @@ public:
3333 EffectPitchBend,
3434 EffectStars,
3535 EffectCounter,
36+ EffectBackgroundImage,
3637 EffectFileName
3738 };
3839
--- a/MIDITrail/MTScenePianoRoll3D.cpp
+++ b/MIDITrail/MTScenePianoRoll3D.cpp
@@ -4,7 +4,7 @@
44 //
55 // ピアノロール3Dシーン描画クラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -142,6 +142,10 @@ int MTScenePianoRoll3D::Create(
142142 result = m_MeshCtrl.Create(pD3DDevice, GetName());
143143 if (result != 0) goto EXIT;
144144
145+ //背景画像生成
146+ result = m_BackgroundImage.Create(pD3DDevice, hWnd);
147+ if (result != 0) goto EXIT;
148+
145149 //----------------------------------
146150 // レンダリングステート
147151 //----------------------------------
@@ -246,6 +250,10 @@ int MTScenePianoRoll3D::Draw(
246250 result = Transform(pD3DDevice);
247251 if (result != 0) goto EXIT;
248252
253+ //背景画像描画
254+ result = m_BackgroundImage.Draw(pD3DDevice);
255+ if (result != 0) goto EXIT;
256+
249257 //グリッドボックス描画
250258 result = m_GridBox.Draw(pD3DDevice);
251259 if (result != 0) goto EXIT;
@@ -295,6 +303,7 @@ void MTScenePianoRoll3D::Release()
295303 m_TimeIndicator.Release();
296304 m_NoteRipple.Release();
297305 m_MeshCtrl.Release();
306+ m_BackgroundImage.Release();
298307 }
299308
300309 //******************************************************************************
@@ -663,6 +672,9 @@ void MTScenePianoRoll3D::SetEffect(
663672 case EffectFileName:
664673 m_Dashboard.SetEnableFileName(isEnable);
665674 break;
675+ case EffectBackgroundImage:
676+ m_BackgroundImage.SetEnable(isEnable);
677+ break;
666678 default:
667679 break;
668680 }
--- a/MIDITrail/MTScenePianoRoll3D.h
+++ b/MIDITrail/MTScenePianoRoll3D.h
@@ -4,7 +4,7 @@
44 //
55 // ピアノロール3Dシーン描画クラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -25,6 +25,7 @@
2525 #include "MTStars.h"
2626 #include "MTTimeIndicator.h"
2727 #include "MTMeshCtrl.h"
28+#include "MTBackgroundImage.h"
2829 #include "SMIDILib.h"
2930
3031 using namespace SMIDILib;
@@ -119,6 +120,7 @@ private:
119120 MTStars m_Stars;
120121 MTTimeIndicator m_TimeIndicator;
121122 MTMeshCtrl m_MeshCtrl;
123+ MTBackgroundImage m_BackgroundImage;
122124
123125 //マウス視線移動モード
124126 bool m_IsMouseCamMode;
--- a/MIDITrail/MTScenePianoRoll3DLive.cpp
+++ b/MIDITrail/MTScenePianoRoll3DLive.cpp
@@ -4,7 +4,7 @@
44 //
55 // ライブモニタ用ピアノロール3Dシーン描画クラス
66 //
7-// Copyright (C) 2012-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2012-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -140,7 +140,11 @@ int MTScenePianoRoll3DLive::Create(
140140 //メッシュ制御生成
141141 result = m_MeshCtrl.Create(pD3DDevice, GetName());
142142 if (result != 0) goto EXIT;
143-
143+
144+ //背景画像生成
145+ result = m_BackgroundImage.Create(pD3DDevice, hWnd);
146+ if (result != 0) goto EXIT;
147+
144148 //----------------------------------
145149 // レンダリングステート
146150 //----------------------------------
@@ -245,6 +249,10 @@ int MTScenePianoRoll3DLive::Draw(
245249 result = Transform(pD3DDevice);
246250 if (result != 0) goto EXIT;
247251
252+ //背景画像描画
253+ result = m_BackgroundImage.Draw(pD3DDevice);
254+ if (result != 0) goto EXIT;
255+
248256 //グリッドボックス描画
249257 result = m_GridBoxLive.Draw(pD3DDevice);
250258 if (result != 0) goto EXIT;
@@ -294,6 +302,7 @@ void MTScenePianoRoll3DLive::Release()
294302 m_TimeIndicator.Release();
295303 m_NoteRipple.Release();
296304 m_MeshCtrl.Release();
305+ m_BackgroundImage.Release();
297306 }
298307
299308 //******************************************************************************
@@ -640,6 +649,9 @@ void MTScenePianoRoll3DLive::SetEffect(
640649 case EffectCounter:
641650 m_DashboardLive.SetEnable(isEnable);
642651 break;
652+ case EffectBackgroundImage:
653+ m_BackgroundImage.SetEnable(isEnable);
654+ break;
643655 default:
644656 break;
645657 }
--- a/MIDITrail/MTScenePianoRoll3DLive.h
+++ b/MIDITrail/MTScenePianoRoll3DLive.h
@@ -4,7 +4,7 @@
44 //
55 // ライブモニタ用ピアノロール3Dシーン描画クラス
66 //
7-// Copyright (C) 2012-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2012-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -25,6 +25,7 @@
2525 #include "MTStars.h"
2626 #include "MTTimeIndicator.h"
2727 #include "MTMeshCtrl.h"
28+#include "MTBackgroundImage.h"
2829 #include "SMIDILib.h"
2930
3031 using namespace SMIDILib;
@@ -116,6 +117,7 @@ private:
116117 MTStars m_Stars;
117118 MTTimeIndicator m_TimeIndicator;
118119 MTMeshCtrl m_MeshCtrl;
120+ MTBackgroundImage m_BackgroundImage;
119121
120122 //マウス視線移動モード
121123 bool m_IsMouseCamMode;
--- a/MIDITrail/MTScenePianoRollRain.cpp
+++ b/MIDITrail/MTScenePianoRollRain.cpp
@@ -4,7 +4,7 @@
44 //
55 // ピアノロールレインシーン描画クラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -137,6 +137,10 @@ int MTScenePianoRollRain::Create(
137137 result = m_MeshCtrl.Create(pD3DDevice, GetName());
138138 if (result != 0) goto EXIT;
139139
140+ //背景画像生成
141+ result = m_BackgroundImage.Create(pD3DDevice, hWnd);
142+ if (result != 0) goto EXIT;
143+
140144 //----------------------------------
141145 // レンダリングステート
142146 //----------------------------------
@@ -233,6 +237,10 @@ int MTScenePianoRollRain::Draw(
233237 result = Transform(pD3DDevice);
234238 if (result != 0) goto EXIT;
235239
240+ //背景画像描画
241+ result = m_BackgroundImage.Draw(pD3DDevice);
242+ if (result != 0) goto EXIT;
243+
236244 //ピアノキーボード描画
237245 result = m_PianoKeyboardCtrl.Draw(pD3DDevice);
238246 if (result != 0) goto EXIT;
@@ -267,6 +275,7 @@ void MTScenePianoRollRain::Release()
267275 m_Dashboard.Release();
268276 m_Stars.Release();
269277 m_MeshCtrl.Release();
278+ m_BackgroundImage.Release();
270279 }
271280
272281 //******************************************************************************
@@ -620,6 +629,9 @@ void MTScenePianoRollRain::SetEffect(
620629 case EffectFileName:
621630 m_Dashboard.SetEnableFileName(isEnable);
622631 break;
632+ case EffectBackgroundImage:
633+ m_BackgroundImage.SetEnable(isEnable);
634+ break;
623635 default:
624636 break;
625637 }
--- a/MIDITrail/MTScenePianoRollRain.h
+++ b/MIDITrail/MTScenePianoRollRain.h
@@ -4,7 +4,7 @@
44 //
55 // ピアノロールレインシーン描画クラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -21,6 +21,7 @@
2121 #include "MTDashboard.h"
2222 #include "MTNotePitchBend.h"
2323 #include "MTMeshCtrl.h"
24+#include "MTBackgroundImage.h"
2425 #include "SMIDILib.h"
2526
2627 using namespace SMIDILib;
@@ -115,6 +116,7 @@ private:
115116 MTNotePitchBend m_NotePitchBend;
116117 MTDashboard m_Dashboard;
117118 MTMeshCtrl m_MeshCtrl;
119+ MTBackgroundImage m_BackgroundImage;
118120
119121 //マウス視線移動モード
120122 bool m_IsMouseCamMode;
--- a/MIDITrail/MTScenePianoRollRainLive.cpp
+++ b/MIDITrail/MTScenePianoRollRainLive.cpp
@@ -4,7 +4,7 @@
44 //
55 // ライブモニタ用ピアノロールレインシーン描画クラス
66 //
7-// Copyright (C) 2012-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2012-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -136,7 +136,11 @@ int MTScenePianoRollRainLive::Create(
136136 //メッシュ制御生成
137137 result = m_MeshCtrl.Create(pD3DDevice, GetName());
138138 if (result != 0) goto EXIT;
139-
139+
140+ //背景画像生成
141+ result = m_BackgroundImage.Create(pD3DDevice, hWnd);
142+ if (result != 0) goto EXIT;
143+
140144 //----------------------------------
141145 // レンダリングステート
142146 //----------------------------------
@@ -233,6 +237,10 @@ int MTScenePianoRollRainLive::Draw(
233237 result = Transform(pD3DDevice);
234238 if (result != 0) goto EXIT;
235239
240+ //背景画像描画
241+ result = m_BackgroundImage.Draw(pD3DDevice);
242+ if (result != 0) goto EXIT;
243+
236244 //ピアノキーボード描画
237245 result = m_PianoKeyboardCtrlLive.Draw(pD3DDevice);
238246 if (result != 0) goto EXIT;
@@ -267,6 +275,7 @@ void MTScenePianoRollRainLive::Release()
267275 m_DashboardLive.Release();
268276 m_Stars.Release();
269277 m_MeshCtrl.Release();
278+ m_BackgroundImage.Release();
270279 }
271280
272281 //******************************************************************************
@@ -600,6 +609,9 @@ void MTScenePianoRollRainLive::SetEffect(
600609 case EffectCounter:
601610 m_DashboardLive.SetEnable(isEnable);
602611 break;
612+ case EffectBackgroundImage:
613+ m_BackgroundImage.SetEnable(isEnable);
614+ break;
603615 default:
604616 break;
605617 }
--- a/MIDITrail/MTScenePianoRollRainLive.h
+++ b/MIDITrail/MTScenePianoRollRainLive.h
@@ -4,7 +4,7 @@
44 //
55 // ライブモニタ用ピアノロールレインシーン描画クラス
66 //
7-// Copyright (C) 2012-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2012-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -21,6 +21,7 @@
2121 #include "MTDashboardLive.h"
2222 #include "MTNotePitchBend.h"
2323 #include "MTMeshCtrl.h"
24+#include "MTBackgroundImage.h"
2425 #include "SMIDILib.h"
2526
2627 using namespace SMIDILib;
@@ -112,7 +113,8 @@ private:
112113 MTNotePitchBend m_NotePitchBend;
113114 MTDashboardLive m_DashboardLive;
114115 MTMeshCtrl m_MeshCtrl;
115-
116+ MTBackgroundImage m_BackgroundImage;
117+
116118 //マウス視線移動モード
117119 bool m_IsMouseCamMode;
118120
--- a/MIDITrail/MTWindowSizeCfgDlg.cpp
+++ b/MIDITrail/MTWindowSizeCfgDlg.cpp
@@ -4,7 +4,7 @@
44 //
55 // ウィンドウサイズ設定ダイアログクラス
66 //
7-// Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -24,6 +24,10 @@ MTWindowSizeCfgDlg* MTWindowSizeCfgDlg::m_pThis = NULL;
2424 MTWindowSizeCfgDlg::MTWindowSizeCfgDlg(void)
2525 {
2626 m_pThis = this;
27+ m_hSizeList = NULL;
28+ m_hEditWidth = NULL;
29+ m_hEditHeight = NULL;
30+ m_hCheckApplyToView = NULL;
2731 m_isSaved = false;
2832 }
2933
@@ -75,6 +79,14 @@ INT_PTR MTWindowSizeCfgDlg::_WndProcImpl(
7579 EndDialog(hDlg, LOWORD(wParam));
7680 bresult = TRUE;
7781 }
82+ //リストボックス
83+ else if (LOWORD(wParam) == IDC_WINDOWSIZE_LIST) {
84+ //選択状態変化
85+ if (HIWORD(wParam) == LBN_SELCHANGE){
86+ result = _OnSizeListChanged();
87+ if (result != 0) goto EXIT;
88+ }
89+ }
7890 break;
7991 }
8092
@@ -124,7 +136,7 @@ EXIT:;
124136 //******************************************************************************
125137 // 変更確認
126138 //******************************************************************************
127-bool MTWindowSizeCfgDlg::IsCahnged()
139+bool MTWindowSizeCfgDlg::IsChanged()
128140 {
129141 //本当は値の変化を確認すべき
130142 return m_isSaved;
@@ -143,11 +155,20 @@ int MTWindowSizeCfgDlg::_OnInitDlg(
143155 result = _InitConfFile();
144156 if (result != 0) goto EXIT;
145157
146- //ウィンドウサイズ選択コンボボックス初期化
158+ //ウィンドウハンドル取得
147159 m_hSizeList = GetDlgItem(hDlg, IDC_WINDOWSIZE_LIST);
160+ m_hEditWidth = GetDlgItem(hDlg, IDC_EDIT_WIDTH);
161+ m_hEditHeight = GetDlgItem(hDlg, IDC_EDIT_HEIGHT);
162+ m_hCheckApplyToView = GetDlgItem(hDlg, IDC_CHECK_APPLY_TO_VIEW);
163+
164+ //ウィンドウサイズ選択コンボボックス初期化
148165 result = _InitSizeList();
149166 if (result != 0) goto EXIT;
150167
168+ //ウィンドウサイズエディットボックス初期化
169+ result = _InitSizeEditbox();
170+ if (result != 0) goto EXIT;
171+
151172 EXIT:;
152173 return result;
153174 }
@@ -194,10 +215,8 @@ int MTWindowSizeCfgDlg::_InitSizeList()
194215 MTWindowSizeList::iterator itr;
195216 bool isExist = false;
196217
197- //ユーザ選択ウィンドウサイズ取得
198- result = m_ConfFile.GetInt(_T("Width"), &curWidth, 0);
199- if (result != 0) goto EXIT;
200- result = m_ConfFile.GetInt(_T("Height"), &curHeight, 0);
218+ //ウィンドウサイズ取得
219+ result = _GetConfWindowSize(&curWidth, &curHeight);
201220 if (result != 0) goto EXIT;
202221
203222 m_SizeList.clear();
@@ -252,28 +271,164 @@ int MTWindowSizeCfgDlg::_InitSizeList()
252271 }
253272 }
254273
255- //一覧に前回設定値が見つからなかった場合はリストの先頭を選択状態とする
256- if (selectedIndex < 0) {
257- selectedIndex = 0;
274+ //リスト一致するサイズが見つかった場合は選択状態にする
275+ if (selectedIndex >= 0) {
276+ lresult = SendMessage(m_hSizeList, LB_SETCURSEL, selectedIndex, 0);
277+ if (lresult == LB_ERR) {
278+ result = YN_SET_ERR("Windows API error.", GetLastError(), selectedIndex);
279+ goto EXIT;
280+ }
258281 }
259282
260- //選択状態設定
261- lresult = SendMessage(m_hSizeList, LB_SETCURSEL, selectedIndex, 0);
262- if (lresult == LB_ERR) {
263- result = YN_SET_ERR("Windows API error.", GetLastError(), selectedIndex);
283+EXIT:;
284+ return result;
285+}
286+
287+//******************************************************************************
288+// ウィンドウサイズエディットボックス初期化
289+//******************************************************************************
290+int MTWindowSizeCfgDlg::_InitSizeEditbox()
291+{
292+ int result = 0;
293+ LRESULT lresult = 0;
294+ int width = 0;
295+ int height = 0;
296+ int maxsize = 0;
297+ int applyToViewArea = 0;
298+
299+ //ウィンドウサイズ取得
300+ result = _GetConfWindowSize(&width, &height);
301+ if (result != 0) goto EXIT;
302+
303+ //入力可能最大文字数を設定:5桁 99,999まで
304+ maxsize = sizeof(TCHAR) * MT_WINDOW_SIZE_CHAR_MAX;
305+ SendMessage(m_hEditWidth, EM_SETLIMITTEXT, (WPARAM)maxsize, 0);
306+ SendMessage(m_hEditHeight, EM_SETLIMITTEXT, (WPARAM)maxsize, 0);
307+
308+ //エディットボックスにウィンドウサイズの数値文字列を設定
309+ result = _UpdateSizeEditBox(width, height);
310+ if (result != 0) goto EXIT;
311+
312+ //ビュー領域適用フラグ取得
313+ result = m_ConfFile.GetInt(_T("ApplyToViewArea"), &applyToViewArea, 0);
314+ if (result != 0) goto EXIT;
315+
316+ //ビュー領域適用チェックボックス初期化
317+ if (applyToViewArea == 0) {
318+ SendMessage(m_hCheckApplyToView, BM_SETCHECK, BST_UNCHECKED, 0);
319+ }
320+ else {
321+ SendMessage(m_hCheckApplyToView, BM_SETCHECK, BST_CHECKED, 0);
322+ }
323+
324+EXIT:;
325+ return result;
326+}
327+
328+//******************************************************************************
329+// ウィンドウサイズ設定値取得
330+//******************************************************************************
331+int MTWindowSizeCfgDlg::_GetConfWindowSize(
332+ int* pWidth,
333+ int* pHeight
334+ )
335+{
336+ int result = 0;
337+ int width = 0;
338+ int height = 0;
339+
340+ if ((pHeight == NULL) || (pHeight == NULL)) {
341+ result = YN_SET_ERR("Program error.", 0, 0);
264342 goto EXIT;
265343 }
266344
345+ //ウィンドウサイズ設定値取得
346+ result = m_ConfFile.GetInt(_T("Width"), &width, 0);
347+ if (result != 0) goto EXIT;
348+ result = m_ConfFile.GetInt(_T("Height"), &height, 0);
349+ if (result != 0) goto EXIT;
350+
351+ //サイズが異常な場合は初回起動時のウィンドウサイズに更新
352+ if ((width <= 0)
353+ || (height <= 0)
354+ || (width > MT_WINDOW_SIZE_MAX)
355+ || (height > MT_WINDOW_SIZE_MAX)) {
356+ width = 800;
357+ height = 600;
358+ }
359+
360+ *pWidth = width;
361+ *pHeight = height;
362+
267363 EXIT:;
268364 return result;
269365 }
270366
271367 //******************************************************************************
272-// デバイス選択情報保存
368+// ウィンドウサイズ情報保存
273369 //******************************************************************************
274370 int MTWindowSizeCfgDlg::_Save()
275371 {
276372 int result = 0;
373+ int apiresult = 0;
374+ LRESULT lresult = 0;
375+ int width = 0;
376+ int height = 0;
377+ int applyToViewArea = 0;
378+ TCHAR str[32] = {_T('\0')};
379+
380+ //幅
381+ apiresult = GetWindowText(m_hEditWidth, str, 32);
382+ if (apiresult == 0) {
383+ //テキスト無しまたはウィンドウハンドル無効の場合
384+ width = 0;
385+ }
386+ else {
387+ width = _tstoi(str);
388+ }
389+
390+ //高さ
391+ apiresult = GetWindowText(m_hEditHeight, str, 32);
392+ if (apiresult == 0) {
393+ //テキスト無しまたはウィンドウハンドル無効の場合
394+ height = 0;
395+ }
396+ else {
397+ height = _tstoi(str);
398+ }
399+
400+ //クリッピング
401+ if (width < MT_WINDOW_SIZE_MIN) {
402+ width = MT_WINDOW_SIZE_MIN;
403+ }
404+ if (height < MT_WINDOW_SIZE_MIN) {
405+ height = MT_WINDOW_SIZE_MIN;
406+ }
407+
408+ //設定保存
409+ result = m_ConfFile.SetInt(_T("Width"), width);
410+ if (result != 0) goto EXIT;
411+ result = m_ConfFile.SetInt(_T("Height"), height);
412+ if (result != 0) goto EXIT;
413+
414+ //ビュー領域適用チェックボックス設定保存
415+ lresult = SendMessage(m_hCheckApplyToView, BM_GETCHECK, 0, 0);
416+ if (lresult == BST_CHECKED) {
417+ applyToViewArea = 1;
418+ }
419+ result = m_ConfFile.SetInt(_T("ApplyToViewArea"), applyToViewArea);
420+ if (result != 0) goto EXIT;
421+
422+EXIT:;
423+ return result;
424+}
425+
426+//******************************************************************************
427+// ウィンドウサイズリストボックス選択状態変化
428+//******************************************************************************
429+int MTWindowSizeCfgDlg::_OnSizeListChanged()
430+{
431+ int result = 0;
277432 LRESULT lresult = 0;
278433 int selectedIndex = 0;
279434 MTWindowSizeItem item;
@@ -281,23 +436,58 @@ int MTWindowSizeCfgDlg::_Save()
281436
282437 //選択項目のインデックスを取得
283438 lresult = SendMessage(m_hSizeList, LB_GETCURSEL, 0, 0);
284- if ((lresult == LB_ERR) || (lresult < 0)) {
439+ if (lresult == LB_ERR) {
440+ //未選択の場合は何もしない
441+ goto EXIT;
442+ }
443+ else if (lresult < 0) {
285444 result = YN_SET_ERR("Windows API error.", GetLastError(), (DWORD64)m_hSizeList);
286445 goto EXIT;
287446 }
288- selectedIndex = (unsigned long)lresult;
289447
448+ //選択サイズ取得
449+ selectedIndex = (unsigned long)lresult;
290450 itr = m_SizeList.begin();
291451 advance(itr, selectedIndex);
292452 item = *itr;
293453
294- //設定保存
295- result = m_ConfFile.SetInt(_T("Width"), item.width);
296- if (result != 0) goto EXIT;
297- result = m_ConfFile.SetInt(_T("Height"), item.height);
454+ //エディットボックスにウィンドウサイズの数値文字列を設定
455+ result = _UpdateSizeEditBox(item.width, item.height);
298456 if (result != 0) goto EXIT;
299457
300458 EXIT:;
301459 return result;
302460 }
303461
462+//******************************************************************************
463+// ウィンドウサイズエディットボックス更新
464+//******************************************************************************
465+int MTWindowSizeCfgDlg::_UpdateSizeEditBox(
466+ int width,
467+ int height
468+ )
469+{
470+ int result = 0;
471+ BOOL bresult = FALSE;
472+ TCHAR str[32] = {_T('\0')};
473+
474+ //幅
475+ _stprintf_s(str, 32, _T("%d"), width);
476+ bresult = SetWindowText(m_hEditWidth, str);
477+ if (!bresult) {
478+ result = YN_SET_ERR("Windows API error.", GetLastError(), width);
479+ goto EXIT;
480+ }
481+
482+ //高さ
483+ _stprintf_s(str, 32, _T("%d"), height);
484+ bresult = SetWindowText(m_hEditHeight, str);
485+ if (!bresult) {
486+ result = YN_SET_ERR("Windows API error.", GetLastError(), height);
487+ goto EXIT;
488+ }
489+
490+EXIT:;
491+ return result;
492+}
493+
--- a/MIDITrail/MTWindowSizeCfgDlg.h
+++ b/MIDITrail/MTWindowSizeCfgDlg.h
@@ -4,7 +4,7 @@
44 //
55 // ウィンドウサイズ設定ダイアログクラス
66 //
7-// Copyright (C) 2010 WADA Masashi. All Rights Reserved.
7+// Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
88 //
99 //******************************************************************************
1010
@@ -18,6 +18,20 @@ using namespace YNBaseLib;
1818
1919
2020 //******************************************************************************
21+//ウィンドウサイズ設定ダイアログクラス パラメタ定義
22+//******************************************************************************
23+
24+//ウィンドウサイズ設定最小値
25+#define MT_WINDOW_SIZE_MIN 200
26+
27+//ウィンドウサイズ設定最大値
28+#define MT_WINDOW_SIZE_MAX 99999
29+
30+//ウィンドウサイズ文字数最大値:99999→5桁
31+#define MT_WINDOW_SIZE_CHAR_MAX 5
32+
33+
34+//******************************************************************************
2135 //ウィンドウサイズ設定ダイアログクラス
2236 //******************************************************************************
2337 class MTWindowSizeCfgDlg
@@ -32,7 +46,7 @@ public:
3246 int Show(HWND hParentWnd);
3347
3448 //変更確認
35- bool IsCahnged();
49+ bool IsChanged();
3650
3751 private:
3852
@@ -57,6 +71,13 @@ private:
5771 //ウィンドウサイズリスト
5872 MTWindowSizeList m_SizeList;
5973
74+ //ウィンドウサイズエディットボックスウィンドウハンドル
75+ HWND m_hEditWidth;
76+ HWND m_hEditHeight;
77+
78+ //ビュー領域適用チェックボックスウィンドウハンドル
79+ HWND m_hCheckApplyToView;
80+
6081 //設定ファイル
6182 YNConfFile m_ConfFile;
6283
@@ -73,11 +94,23 @@ private:
7394 //設定ファイル初期化
7495 int _InitConfFile();
7596
76- //ウィンドウサイズ選択コンボボックス初期化
97+ //ウィンドウサイズ選択リストボックス初期化
7798 int _InitSizeList();
7899
100+ //ウィンドウサイズエディットボックス初期化
101+ int _InitSizeEditbox();
102+
103+ //ウィンドウサイズ取得
104+ int _GetConfWindowSize(int* pWidth, int* pHeight);
105+
79106 //保存処理
80107 int _Save();
81108
109+ //ウィンドウサイズリストボックス選択状態変化
110+ int _OnSizeListChanged();
111+
112+ //ウィンドウサイズエディットボックス更新
113+ int _UpdateSizeEditBox(int width, int height);
114+
82115 };
83116
--- a/MIDITrail/resource.h
+++ b/MIDITrail/resource.h
@@ -33,6 +33,11 @@
3333 #define IDC_CHECK_MIDITHRU 1016
3434 #define IDC_TEXT_VERSION 1017
3535 #define IDC_TEXT_COPYRIGHT 1018
36+#define IDC_CHECK_APPLY_TO_VIEW 1019
37+#define IDC_EDIT_WIDTH 1020
38+#define IDC_EDIT_HEIGHT 1021
39+#define IDC_EDIT_IMAGE_FILE_PATH 1022
40+#define IDC_BTN_BROWSE 1023
3641 #define IDM_OPEN_FILE 32771
3742 #define IDM_PLAY 32772
3843 #define IDM_STOP 32773
@@ -61,6 +66,7 @@
6166 #define IDM_STOP_MONITORING 32836
6267 #define IDM_AUTO_SAVE_VIEWPOINT 32838
6368 #define IDM_VIEW_PIANOROLLRAIN2D 32840
69+#define IDM_ENABLE_BACKGROUNDIMAGE 32842
6470 #define IDC_STATIC -1
6571
6672 // Next default values for new objects
@@ -69,8 +75,8 @@
6975 #ifndef APSTUDIO_READONLY_SYMBOLS
7076 #define _APS_NO_MFC 1
7177 #define _APS_NEXT_RESOURCE_VALUE 134
72-#define _APS_NEXT_COMMAND_VALUE 32841
73-#define _APS_NEXT_CONTROL_VALUE 1019
78+#define _APS_NEXT_COMMAND_VALUE 32843
79+#define _APS_NEXT_CONTROL_VALUE 1024
7480 #define _APS_NEXT_SYMED_VALUE 110
7581 #endif
7682 #endif
--- a/README.en.txt
+++ b/README.en.txt
@@ -1,11 +1,11 @@
11 ******************************************************************************
22
3- MIDITrail source code Ver.1.2.1b for Windows
3+ MIDITrail source code Ver.1.2.2 for Windows
44
5- Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
5+ Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
66
7- Web : http://sourceforge.jp/projects/miditrail/
8- Mail: yknk@users.sourceforge.jp
7+ Web : https://osdn.jp/projects/miditrail/
8+ Mail: yknk@users.osdn.me
99
1010 ******************************************************************************
1111
--- a/README.ja.txt
+++ b/README.ja.txt
@@ -1,11 +1,11 @@
11 ******************************************************************************
22
3- MIDITrail ソースコード Ver.1.2.1b for Windows
3+ MIDITrail ソースコード Ver.1.2.2 for Windows
44
5- Copyright (C) 2010-2014 WADA Masashi. All Rights Reserved.
5+ Copyright (C) 2010-2016 WADA Masashi. All Rights Reserved.
66
7- Web : http://sourceforge.jp/projects/miditrail/
8- Mail: yknk@users.sourceforge.jp
7+ Web : https://osdn.jp/projects/miditrail/
8+ Mail: yknk@users.osdn.me
99
1010 ******************************************************************************
1111