summaryrefslogtreecommitdiffstats
path: root/src/EditQuantizeDlg.cpp
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-09-15 21:57:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2013-09-15 21:57:55 -0700
commit672e606b6d857e370ac75c076a1b2982e5bccd67 (patch)
tree46dcaace1126e2b2c2f785e42f562fe5c7718484 /src/EditQuantizeDlg.cpp
downloadsekaiju-672e606b6d857e370ac75c076a1b2982e5bccd67.tar.gz
sekaiju-672e606b6d857e370ac75c076a1b2982e5bccd67.tar.bz2
sekaiju-672e606b6d857e370ac75c076a1b2982e5bccd67.zip
Converted Sekaiju 3.6 to Visual Studio 2008.
Diffstat (limited to 'src/EditQuantizeDlg.cpp')
-rw-r--r--src/EditQuantizeDlg.cpp142
1 files changed, 142 insertions, 0 deletions
diff --git a/src/EditQuantizeDlg.cpp b/src/EditQuantizeDlg.cpp
new file mode 100644
index 0000000..1fc6b22
--- /dev/null
+++ b/src/EditQuantizeDlg.cpp
@@ -0,0 +1,142 @@
+//******************************************************************************
+// MIDIシーケンサーソフト『世界樹』
+// クォンタイズダイアログクラス
+// (C)2002-2010 おーぷんMIDIぷろじぇくと/くず
+//******************************************************************************
+
+/* This library is free software; you can redistribute it and/or */
+/* modify it under the terms of the GNU Lesser General Public */
+/* License as published by the Free Software Foundation; either */
+/* version 2.1 of the License, or (at your option) any later version. */
+
+/* This library is distributed in the hope that it will be useful, */
+/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
+/* Lesser General Public License for more details. */
+
+/* You should have received a copy of the GNU Lesser General Public */
+/* License along with this library; if not, write to the Free Software */
+/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+#include "winver.h"
+#include <afxwin.h>
+#include <afxcmn.h>
+#include "resource.h"
+#include "EditQuantizeDlg.h"
+
+#ifndef CLIP
+#define CLIP(A,B,C) ((B)<(A)?(A):((B)>(C)?(C):(B)))
+#endif
+
+//-----------------------------------------------------------------------------
+// 構築と破壊
+//-----------------------------------------------------------------------------
+
+// コンストラクタ
+CEditQuantizeDlg::CEditQuantizeDlg () : CDialog (CEditQuantizeDlg::IDD) {
+ m_lTimeMode = 0;
+ m_lTimeResolution = 0;
+ m_nSnapTimeIndex = 3;
+ //m_strSnapTime = _T("");
+ m_nStrength = 0;
+ m_nTargetNoteOn = 0;
+ m_nTargetNoteOff = 0;
+}
+
+//-----------------------------------------------------------------------------
+// オペレーション
+//-----------------------------------------------------------------------------
+
+// 値の範囲設定
+BOOL CEditQuantizeDlg::SetAmountRange () {
+ ((CSpinButtonCtrl*)GetDlgItem (IDC_EDITQUANTIZE_STRENGTHSP))->SetRange (0, 100);
+ return TRUE;
+}
+
+// スナップタイムコンボボックスの充満
+BOOL CEditQuantizeDlg::FillSnapTimeCombo () {
+ CComboBox* pSnapTimeCombo = (CComboBox*)GetDlgItem (IDC_EDITQUANTIZE_SNAPTIME);
+ CString strTextLine;
+ CString strFormat;
+ if (m_lTimeMode == 0) {
+ VERIFY (strFormat.LoadString (IDS_D_4DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 1);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_8DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 2);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_12DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 3);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_16DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 4);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_24DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 6);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_32DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 8);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_48DIVNOTE));
+ strTextLine.Format (strFormat, m_lTimeResolution / 12);
+ pSnapTimeCombo->AddString (strTextLine);
+ }
+ else {
+ VERIFY (strFormat.LoadString (IDS_D_1FRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 1);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_2DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 2);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_3DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 3);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_4DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 4);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_6DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 6);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_8DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 8);
+ pSnapTimeCombo->AddString (strTextLine);
+ VERIFY (strFormat.LoadString (IDS_D_12DIVFRAME));
+ strTextLine.Format (strFormat, m_lTimeResolution / 12);
+ pSnapTimeCombo->AddString (strTextLine);
+ }
+
+ return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+// オーバーライド
+//-----------------------------------------------------------------------------
+
+// データエクスチェンジ
+void CEditQuantizeDlg::DoDataExchange (CDataExchange* pDX) {
+ CDialog::DoDataExchange (pDX);
+ //DDX_CBString (pDX, IDC_EDITQUANTIZE_SNAPTIME, m_strSnapTime);
+ DDX_CBIndex (pDX, IDC_EDITQUANTIZE_SNAPTIME, m_nSnapTimeIndex);
+ DDX_Text (pDX, IDC_EDITQUANTIZE_STRENGTH, m_nStrength);
+ DDX_Check (pDX, IDC_EDITQUANTIZE_TARGETNOTEON, m_nTargetNoteOn);
+ DDX_Check (pDX, IDC_EDITQUANTIZE_TARGETNOTEOFF, m_nTargetNoteOff);
+ DDV_MinMaxInt (pDX, m_nStrength, 0, 100);
+}
+
+// ダイアログ初期化時
+BOOL CEditQuantizeDlg::OnInitDialog () {
+ FillSnapTimeCombo ();
+ BOOL bRet = CDialog::OnInitDialog ();
+ SetAmountRange ();
+ return bRet;
+}
+
+//-----------------------------------------------------------------------------
+// メッセージマップ
+//-----------------------------------------------------------------------------
+BEGIN_MESSAGE_MAP (CEditQuantizeDlg, CDialog)
+END_MESSAGE_MAP ()
+
+
+