From: <sag...@us...> - 2010-02-07 15:33:51
|
Revision: 486 http://modplug.svn.sourceforge.net/modplug/?rev=486&view=rev Author: saga-games Date: 2010-02-07 15:33:33 +0000 (Sun, 07 Feb 2010) Log Message: ----------- Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-02-07 15:33:33 UTC (rev 486) @@ -775,6 +775,7 @@ CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; if ((!m_pModDoc) || (!m_pSndFile)) return TRUE; + m_NoteMap.Init(this); m_ToolBar.Init(); m_ToolBar.AddButton(IDC_INSTRUMENT_NEW, TIMAGE_INSTR_NEW); @@ -783,8 +784,6 @@ m_ToolBar.AddButton(IDC_INSTRUMENT_PLAY, TIMAGE_PREVIEW); m_SpinInstrument.SetRange(0, 0); m_SpinInstrument.EnableWindow(FALSE); - m_EditName.SetLimitText(32); - m_EditFileName.SetLimitText(20); // NNA m_ComboNNA.AddString("Note Cut"); m_ComboNNA.AddString("Continue"); @@ -1030,6 +1029,12 @@ if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; if (dwHintMask & HINT_MODTYPE) { + const CModSpecifications *specs = &m_pSndFile->GetModSpecifications(); + + // Limit text fields + m_EditName.SetLimitText(specs->instrNameLengthMax); + m_EditFileName.SetLimitText(specs->instrFilenameLengthMax); + BOOL bITandMPT = ((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; //rewbs.instroVSTi BOOL bITandXM = (((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (m_pSndFile->m_nType == MOD_TYPE_XM)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2010-02-07 15:33:33 UTC (rev 486) @@ -183,6 +183,7 @@ CModControlDlg::OnInitDialog(); if (!m_pSndFile) return TRUE; m_bInitialized = FALSE; + // Zoom Selection m_ComboZoom.AddString("Auto"); m_ComboZoom.AddString("1:1"); @@ -212,8 +213,6 @@ m_ToolBar2.AddButton(IDC_SAMPLE_INVERT, TIMAGE_SAMPLE_INVERT); m_ToolBar2.AddButton(IDC_SAMPLE_SIGN_UNSIGN, TIMAGE_SAMPLE_UNSIGN); // Setup Controls - m_EditName.SetLimitText(32); - m_EditFileName.SetLimitText(22); m_SpinVolume.SetRange(0, 64); m_SpinGlobalVol.SetRange(0, 64); //rewbs.fix36944 @@ -241,7 +240,7 @@ m_SpinVibRate.SetRange(0, 64); } - for (UINT i=BASENOTE_MIN; i<BASENOTE_MAX; i++) + for (UINT i = BASENOTE_MIN; i < BASENOTE_MAX; i++) { CHAR s[32]; wsprintf(s, "%s%d", szNoteNames[i%12], i/12); @@ -543,6 +542,12 @@ // Updating Ranges if (dwHintMask & HINT_MODTYPE) { + const CModSpecifications *specs = &m_pSndFile->GetModSpecifications(); + + // Limit text fields + m_EditName.SetLimitText(specs->sampleNameLengthMax); + m_EditFileName.SetLimitText(specs->sampleFilenameLengthMax); + BOOL b; // Loop Type m_ComboLoopType.ResetContent(); Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-07 13:23:29 UTC (rev 485) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-02-07 15:33:33 UTC (rev 486) @@ -30,7 +30,11 @@ TEMPO tempoMax; ROWINDEX patternRowsMin; ROWINDEX patternRowsMax; - uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. + uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. + uint16 sampleNameLengthMax; //Dito + uint16 sampleFilenameLengthMax; //Dito + uint16 instrNameLengthMax; //Dito + uint16 instrFilenameLengthMax; //Dito SAMPLEINDEX samplesMax; INSTRUMENTINDEX instrumentsMax; BYTE defaultMixLevels; @@ -71,6 +75,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 25, //Max mod name length + 26, //Max sample name length + 12, //Max sample filename length + 26, //Max instrument name length + 12, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels @@ -100,12 +108,16 @@ 64, //Pattern max. 128, //Order max. 4, //Channel min - 4, //Channel max + 32, //Channel max 32, //Min tempo 255, //Max tempo 64, //Min pattern rows 64, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -139,6 +151,10 @@ 64, //Min pattern rows 64, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -171,6 +187,10 @@ 1, //Min pattern rows 256, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 22, //Max instrument name length + 0, //Max instrument filename length 31, //SamplesMax (actually 16 per instrument) 128, //instrumentMax mixLevels_original, //defaultMixLevels @@ -204,6 +224,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 20, //Max mod name length + 22, //Max sample name length + 0, //Max sample filename length + 22, //Max instrument name length + 0, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels @@ -236,6 +260,10 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length + 27, //Max sample name length + 12, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -269,6 +297,10 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length + 27, //Max sample name length + 12, //Max sample filename length + 0, //Max instrument name length + 0, //Max instrument filename length 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels @@ -301,6 +333,10 @@ 1, //Min pattern rows 256, //Max pattern rows 25, //Max mod name length + 25, //Max sample name length + 12, //Max sample filename length + 25, //Max instrument name length + 12, //Max instrument filename length 99, //SamplesMax 99, //instrumentMax mixLevels_original, //defaultMixLevels @@ -333,6 +369,10 @@ 1, //Min pattern rows 1024, //Max pattern rows 25, //Max mod name length + 25, //Max sample name length + 12, //Max sample filename length + 25, //Max instrument name length + 12, //Max instrument filename length 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |