You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
| 2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
| 2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
| 2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
| 2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
| 2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
| 2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
| 2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
| 2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
| 2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
| 2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
| 2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
| 2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
| 2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
| 2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
| 2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
| 2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(203) |
Sep
(148) |
Oct
(109) |
Nov
(191) |
Dec
(209) |
| 2026 |
Jan
(127) |
Feb
(123) |
Mar
(160) |
Apr
(141) |
May
(45) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sag...@us...> - 2011-03-23 20:57:28
|
Revision: 826
http://modplug.svn.sourceforge.net/modplug/?rev=826&view=rev
Author: saga-games
Date: 2011-03-23 20:57:22 +0000 (Wed, 23 Mar 2011)
Log Message:
-----------
[Imp] Pattern Editor: Status bar now indicates if highpass filter is enabled on a channel.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Draw_pat.cpp
Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-03-23 20:48:08 UTC (rev 825)
+++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-03-23 20:57:22 UTC (rev 826)
@@ -1552,11 +1552,12 @@
if (!pSndFile) return;
//xtraInfo.Format("Chan: %d; macro: %X; cutoff: %X; reso: %X; pan: %X",
- xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X; Res:%X; Pan:%X",
+ xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X%s; Res:%X; Pan:%X",
nChn+1,
pSndFile->Chn[nChn].nGlobalVol,
pSndFile->Chn[nChn].nActiveMacro,
pSndFile->Chn[nChn].nCutOff,
+ (pSndFile->Chn[nChn].nFilterMode == FLTMODE_HIGHPASS) ? "-Hi" : "",
pSndFile->Chn[nChn].nResonance,
pSndFile->Chn[nChn].nPan);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-23 20:48:15
|
Revision: 825
http://modplug.svn.sourceforge.net/modplug/?rev=825&view=rev
Author: saga-games
Date: 2011-03-23 20:48:08 +0000 (Wed, 23 Mar 2011)
Log Message:
-----------
[Ref] MIDI Macro code cleanup.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Mptrack.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-23 20:48:08 UTC (rev 825)
@@ -1119,18 +1119,8 @@
m_pSndFile->m_dwSongFlags &= ~SONG_EMBEDMIDICFG;
// If this macro is not the default IT macro, display a warning.
- bool isDefault = (CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[0])) == sfx_cutoff)
- && (CModDoc::GetZxxType(dlg.m_MidiCfg.szMidiZXXExt) == 1);
- for(size_t i = 1; i <= 15; i++)
+ if(!m_pModDoc->IsMacroDefaultSetupUsed())
{
- if(CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused)
- {
- isDefault = false;
- break;
- }
- }
- if(!isDefault)
- {
if(AfxMessageBox(_T("You have chosen not to embed MIDI macros. However, the current macro configuration differs from the default macro configuration that is assumed when loading a file that has no macros embedded. This can result in data loss and broken playback.\nWould you like to embed MIDI macros now?"), MB_YESNO) == IDYES)
{
m_pSndFile->m_dwSongFlags |= SONG_EMBEDMIDICFG;
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-23 20:48:08 UTC (rev 825)
@@ -3165,8 +3165,8 @@
}
-int CModDoc::GetMacroType(CString value)
-//--------------------------------------
+enmParameteredMacroType CModDoc::GetMacroType(CString value)
+//----------------------------------------------------------
{
if (value.Compare("")==0) return sfx_unused;
if (value.Compare("F0F000z")==0) return sfx_cutoff;
@@ -3185,24 +3185,23 @@
{
int code=0;
char* param = (char *) (LPCTSTR) macro;
- param +=4;
+ param += 4;
if ((param[0] >= '0') && (param[0] <= '9')) code = (param[0] - '0') << 4; else
if ((param[0] >= 'A') && (param[0] <= 'F')) code = (param[0] - 'A' + 0x0A) << 4;
if ((param[1] >= '0') && (param[1] <= '9')) code += (param[1] - '0'); else
if ((param[1] >= 'A') && (param[1] <= 'F')) code += (param[1] - 'A' + 0x0A);
- if (macro.GetLength()>=4 && macro.GetAt(3)=='0') {
- return (code-128);
- } else {
- return (code+128);
- }
+ if (macro.GetLength()>=4 && macro.GetAt(3)=='0')
+ return (code - 128);
+ else
+ return (code + 128);
}
int CModDoc::MacroToMidiCC(CString macro)
//---------------------------------------
{
int code=0;
char* param = (char *) (LPCTSTR) macro;
- param +=2;
+ param += 2;
if ((param[0] >= '0') && (param[0] <= '9')) code = (param[0] - '0') << 4; else
if ((param[0] >= 'A') && (param[0] <= 'F')) code = (param[0] - 'A' + 0x0A) << 4;
if ((param[1] >= '0') && (param[1] <= '9')) code += (param[1] - '0'); else
@@ -3211,12 +3210,19 @@
return code;
}
-int CModDoc::FindMacroForParam(long param)
-//----------------------------------------
+int CModDoc::FindMacroForParam(long param) const
+//----------------------------------------------
{
- for (int macro=0; macro<16; macro++) { //what's the named_const for num macros?? :D
- CString macroString = &(GetSoundFile()->m_MidiCfg.szMidiSFXExt[macro*32]);
- if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param) {
+ const CSoundFile *pSndFile = GetSoundFile();
+ if(pSndFile == nullptr)
+ {
+ return -1;
+ }
+ for (int macro = 0; macro < NUM_MACROS; macro++)
+ {
+ CString macroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[macro * 32]);
+ if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param)
+ {
return macro;
}
}
@@ -3225,15 +3231,15 @@
}
// Retrieve Zxx (Z80-ZFF) type from current macro configuration
-int CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32])
-//-----------------------------------------------------------
+enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32])
+//-------------------------------------------------------------------------
{
// Compare with all possible preset patterns
- for(int i = 1; i <= 5; i++)
+ for(int i = 1; i < sfx_fixed_max; i++)
{
// Prepare pattern to compare
CHAR szPatterns[128 * 32];
- CreateZxxFromType(szPatterns, i);
+ CreateZxxFromType(szPatterns, static_cast<enmFixedMacroType>(i));
bool bFound = true;
for(int j = 0; j < 128; j++)
@@ -3244,41 +3250,41 @@
break;
}
}
- if(bFound) return i;
+ if(bFound) return static_cast<enmFixedMacroType>(i);
}
- return 0; // Type 0 - Custom setup
+ return sfx_fixed_custom; // Custom setup
}
// Create Zxx (Z80 - ZFF) from one out of five presets
-void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], int iZxxType)
-//---------------------------------------------------------------------------
+void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType)
+//-----------------------------------------------------------------------------------------
{
for(int i = 0; i < 128; i++)
{
switch(iZxxType)
{
- case 1:
+ case sfx_fixed_reso4Bit:
// Type 1 - Z80 - Z8F controls resonance
if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8);
else szMidiZXXExt[i * 32] = 0;
break;
- case 2:
+ case sfx_fixed_reso7Bit:
// Type 2 - Z80 - ZFF controls resonance
wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i);
break;
- case 3:
+ case sfx_fixed_cutoff:
// Type 3 - Z80 - ZFF controls cutoff
wsprintf(&szMidiZXXExt[i * 32], "F0F000%02X", i);
break;
- case 4:
+ case sfx_fixed_mode:
// Type 4 - Z80 - ZFF controls filter mode
wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", i);
break;
- case 5:
+ case sfx_fixed_resomode:
// Type 5 - Z80 - Z9F controls resonance + filter mode
if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8);
else if (i < 32) wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", (i - 16) * 8);
@@ -3289,6 +3295,38 @@
}
+// Check if the MIDI Macro configuration used is the default one,
+// i.e. the configuration that is assumed when loading a file that has no macros embedded.
+bool CModDoc::IsMacroDefaultSetupUsed() const
+//-------------------------------------------
+{
+ const CSoundFile *pSndFile = GetSoundFile();
+ if(pSndFile == nullptr)
+ {
+ return false;
+ }
+ // SF0: Z00-Z7F controls cutoff
+ if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[0])) != sfx_cutoff)
+ {
+ return false;
+ }
+ // Z80-Z8F controls resonance
+ if(GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt) != sfx_fixed_reso4Bit)
+ {
+ return false;
+ }
+ // All other parametered macros are unused
+ for(size_t i = 1; i < NUM_MACROS; i++)
+ {
+ if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
////////////////////////////////////////////////////////////////////////////////////////
// Playback
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-23 20:48:08 UTC (rev 825)
@@ -90,20 +90,35 @@
STATIC_ASSERT( ((-1 << HINT_SHIFT_SEQUENCE) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_SEQUENCE) );
-//parametered macro presets:
-enum
+// parametered macro presets:
+enum enmParameteredMacroType
{
- sfx_unused=0,
+ sfx_unused = 0,
sfx_cutoff,
sfx_reso,
sfx_mode,
sfx_drywet,
sfx_plug,
sfx_cc,
- sfx_custom
+ sfx_custom,
+
+ sfx_max
};
+// fixed macro presets:
+enum enmFixedMacroType
+{
+ sfx_fixed_custom = 0,
+ sfx_fixed_reso4Bit, // Type 1 - Z80 - Z8F controls resonance
+ sfx_fixed_reso7Bit, // Type 2 - Z80 - ZFF controls resonance
+ sfx_fixed_cutoff, // Type 3 - Z80 - ZFF controls cutoff
+ sfx_fixed_mode, // Type 4 - Z80 - ZFF controls filter mode
+ sfx_fixed_resomode, // Type 5 - Z80 - Z9F controls resonance + filter mode
+ sfx_fixed_max
+};
+
+
// pattern paste modes
enum enmPatternPasteModes
{
@@ -191,8 +206,10 @@
// public members
public:
+ CSoundFile *GetSoundFile() { return &m_SndFile; }
+ const CSoundFile *GetSoundFile() const { return &m_SndFile; }
+
void InitPlayer();
- CSoundFile *GetSoundFile() { return &m_SndFile; }
void SetPause(BOOL bPause) { m_bPaused = bPause; }
void SetModified(BOOL bModified=TRUE) { SetModifiedFlag(bModified); bModifiedAutosave = (bModified != FALSE); }
bool ModifiedSinceLastAutosave() { bool bRetval = bModifiedAutosave; bModifiedAutosave = false; return bRetval; } // return "IsModified" value and reset it until the next SetModified() (as this is only used for polling)
@@ -235,12 +252,16 @@
LONG GetIndexFromVolCmd(UINT volcmd);
UINT GetVolCmdFromIndex(UINT ndx);
BOOL GetVolCmdInfo(UINT ndx, LPSTR s, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL);
- static int GetMacroType(CString value); //rewbs.xinfo
- int MacroToPlugParam(CString value); //rewbs.xinfo
- int MacroToMidiCC(CString value);
- int FindMacroForParam(long param);
- static int GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]);
- static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], int iZxxType);
+
+ // Various MIDI Macro helpers
+ static enmParameteredMacroType GetMacroType(CString value); //rewbs.xinfo
+ static int MacroToPlugParam(CString value); //rewbs.xinfo
+ static int MacroToMidiCC(CString value);
+ static enmFixedMacroType GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]);
+ static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType);
+ bool IsMacroDefaultSetupUsed() const;
+ int FindMacroForParam(long param) const;
+
void SongProperties();
CPatternUndo *GetPatternUndo() { return &m_PatternUndo; }
Modified: trunk/OpenMPT/mptrack/Mptrack.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-03-23 20:48:08 UTC (rev 825)
@@ -614,7 +614,7 @@
strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0");
strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p");
strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z");
- CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, 1);
+ CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, sfx_fixed_reso4Bit);
#ifdef UPDATECHECKENABLED
m_pRequestContext = NULL;
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-03-23 20:48:08 UTC (rev 825)
@@ -946,9 +946,9 @@
void CMidiMacroSetup::OnZxxPresetChanged()
//----------------------------------------
{
- UINT zxx_preset = m_CbnZxxPreset.GetCurSel();
+ enmFixedMacroType zxx_preset = static_cast<enmFixedMacroType>(m_CbnZxxPreset.GetCurSel());
- if (zxx_preset && m_pModDoc != nullptr)
+ if (zxx_preset != sfx_fixed_custom && m_pModDoc != nullptr)
{
m_pModDoc->CreateZxxFromType(m_MidiCfg.szMidiZXXExt, zxx_preset);
UpdateDialog();
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-23 20:48:08 UTC (rev 825)
@@ -409,6 +409,11 @@
INST_NUMFILTERMODES
};*/
+// MIDI Macros
+#define MACRO_MASK 0x7F5F7F5F
+#define MACRO_INTERNAL 0x30463046 // internal macro, low 7 bits (f.e. cutoff, resonance, low plugin params)
+#define MACRO_INTERNALEX 0x31463046 // internal macro, high 7 bits (high plugin params)
+
// Vibrato Types
#define VIB_SINE 0
#define VIB_SQUARE 1
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 20:48:08 UTC (rev 825)
@@ -3012,11 +3012,11 @@
//---------------------------------------------------------------------------
{
MODCHANNEL *pChn = &Chn[nChn];
- DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & 0x7F5F7F5F;
+ DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK;
int nInternalCode;
// Not Internal Device ?
- if (dwMacro != 0x30463046 && dwMacro != 0x31463046)
+ if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX)
{
UINT pos = 0, nNib = 0, nBytes = 0;
DWORD dwMidiCode = 0, dwByteCode = 0;
@@ -3070,10 +3070,7 @@
// Internal device
//HACK:
- bool extendedParam = false;
- if (dwMacro == 0x31463046) {
- extendedParam = true;
- }
+ const bool extendedParam = (dwMacro == MACRO_INTERNALEX);
pszMidiMacro += 4;
nInternalCode = -256;
@@ -3179,14 +3176,13 @@
//---------------------------------------------------------------------------
{
MODCHANNEL *pChn = &Chn[nChn];
- DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & 0x7F5F7F5F;
+ DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK;
int nInternalCode;
CHAR cData1; // rewbs.smoothVST:
DWORD dwParam; // increased scope to fuction.
- bool extendedParam = false;
-
- if (dwMacro != 0x30463046 && dwMacro != 0x31463046) {
+ if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX)
+ {
// we don't cater for external devices at tick resolution.
if(m_dwSongFlags & SONG_FIRSTTICK) {
ProcessMidiMacro(nChn, pszMidiMacro, param);
@@ -3195,9 +3191,7 @@
}
//HACK:
- if (dwMacro == 0x31463046) {
- extendedParam = true;
- }
+ const bool extendedParam = (dwMacro == MACRO_INTERNALEX);
// not sure what we're doing here; some sort of info gathering from the macros
pszMidiMacro += 4;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-22 22:12:56 UTC (rev 824)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-23 20:48:08 UTC (rev 825)
@@ -446,6 +446,7 @@
};
+#define NUM_MACROS 16 // number of parametered macros
struct MODMIDICFG
{
CHAR szMidiGlb[9*32];
@@ -1006,9 +1007,6 @@
static LPSTR AllocateSample(UINT nbytes);
static void FreeSample(LPVOID p);
static UINT Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc);
-//private:
- static MODCOMMAND *AllocatePattern(UINT rows, UINT nchns);
- static void FreePattern(LPVOID pat);
// Song message helper functions
public:
@@ -1067,7 +1065,7 @@
size_t GetVisitedRowsVectorSize(const PATTERNINDEX nPat);
public:
- // "importance" of every FX command. Table is used for importing from formats with multiple effect colums
+ // "importance" of every FX command. Table is used for importing from formats with multiple effect columns
// and is approximately the same as in SchismTracker.
static uint16 CSoundFile::GetEffectWeight(MODCOMMAND::COMMAND cmd);
// try to convert a an effect into a volume column effect.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-22 22:13:02
|
Revision: 824
http://modplug.svn.sourceforge.net/modplug/?rev=824&view=rev
Author: saga-games
Date: 2011-03-22 22:12:56 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
[Imp] Macro Editor: User is now warned if the current macro configuration differs from the default configuration but embedding macro configuration is disabled.
[Mod] Updated DE_jojo.mkb (Play song from cursor, load sample)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-20 12:58:53 UTC (rev 823)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-22 22:12:56 UTC (rev 824)
@@ -1117,6 +1117,26 @@
{
if (m_pSndFile->m_dwSongFlags & SONG_EMBEDMIDICFG) m_pModDoc->SetModified();
m_pSndFile->m_dwSongFlags &= ~SONG_EMBEDMIDICFG;
+
+ // If this macro is not the default IT macro, display a warning.
+ bool isDefault = (CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[0])) == sfx_cutoff)
+ && (CModDoc::GetZxxType(dlg.m_MidiCfg.szMidiZXXExt) == 1);
+ for(size_t i = 1; i <= 15; i++)
+ {
+ if(CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused)
+ {
+ isDefault = false;
+ break;
+ }
+ }
+ if(!isDefault)
+ {
+ if(AfxMessageBox(_T("You have chosen not to embed MIDI macros. However, the current macro configuration differs from the default macro configuration that is assumed when loading a file that has no macros embedded. This can result in data loss and broken playback.\nWould you like to embed MIDI macros now?"), MB_YESNO) == IDYES)
+ {
+ m_pSndFile->m_dwSongFlags |= SONG_EMBEDMIDICFG;
+ m_pModDoc->SetModified();
+ }
+ }
}
}
}
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-20 12:58:53 UTC (rev 823)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-22 22:12:56 UTC (rev 824)
@@ -235,7 +235,7 @@
LONG GetIndexFromVolCmd(UINT volcmd);
UINT GetVolCmdFromIndex(UINT ndx);
BOOL GetVolCmdInfo(UINT ndx, LPSTR s, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL);
- int GetMacroType(CString value); //rewbs.xinfo
+ static int GetMacroType(CString value); //rewbs.xinfo
int MacroToPlugParam(CString value); //rewbs.xinfo
int MacroToMidiCC(CString value);
int FindMacroForParam(long param);
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-20 12:58:53 UTC (rev 823)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-22 22:12:56 UTC (rev 824)
@@ -16,6 +16,7 @@
0:1031:0:119:1 //Pause song: F8 (KeyDown)
0:1375:0:27:1 //Stop Song: ESC (KeyDown)
0:1029:0:117:1 //Play song from start: F6 (KeyDown)
+0:1028:2:117:1 //Play song from cursor: Ctrl+F6 (KeyDown)
0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold)
0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold)
0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown)
@@ -271,6 +272,7 @@
7:1262:0:70:1 //FX Param digit F: F (KeyDown)
//----( Sample Context [bottom] (8) )------------
+8:1673:0:13:1 //Load a Sample: EINGABE (KeyDown)
8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown)
8:1383:0:8:1 //Silence sample selection: R\xDCCK (KeyDown)
8:1384:1:78:1 //Normalise Sample: Shift+N (KeyDown)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-20 12:59:00
|
Revision: 823
http://modplug.svn.sourceforge.net/modplug/?rev=823&view=rev
Author: saga-games
Date: 2011-03-20 12:58:53 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
[Fix] Pattern Editor: Shrink selection is more consistent with Shrink pattern now... Commands on odd rows are now merged if there is no entry in the even rows. Also, cleaning of the pattern after shrinking the selection has been fixed (it cleaned whole commands instead of just the selected parts of the command).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 22:02:38 UTC (rev 822)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-20 12:58:53 UTC (rev 823)
@@ -775,7 +775,7 @@
for (int row=finalDest; row>(int)(startSel >> 16); row-=2)
{
int offset = row-(startSel>>16);
- for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) < 5)
+ for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) <= LAST_COLUMN)
{
UINT chn = i >> 3;
if ((chn >= pSndFile->m_nChannels) || (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue;
@@ -786,12 +786,12 @@
//Log("dst: %d; src: %d; blk: %d\n", row, (row-offset/2), (row-1));
switch(i & 7)
{
- case NOTE_COLUMN: dest->note = src->note; blank->note = 0; break;
- case INST_COLUMN: dest->instr = src->instr; blank->instr = 0; break;
- case VOL_COLUMN: dest->vol = src->vol; blank->vol = 0;
- dest->volcmd = src->volcmd; blank->volcmd = 0; break;
- case EFFECT_COLUMN: dest->command = src->command; blank->command = 0; break;
- case PARAM_COLUMN: dest->param = src->param; blank->param = 0; break;
+ case NOTE_COLUMN: dest->note = src->note; blank->note = NOTE_NONE; break;
+ case INST_COLUMN: dest->instr = src->instr; blank->instr = 0; break;
+ case VOL_COLUMN: dest->vol = src->vol; blank->vol = 0;
+ dest->volcmd = src->volcmd; blank->volcmd = VOLCMD_NONE; break;
+ case EFFECT_COLUMN: dest->command = src->command; blank->command = 0; break;
+ case PARAM_COLUMN: dest->param = src->param; blank->param = CMD_NONE; break;
}
}
}
@@ -817,24 +817,42 @@
if (!p) return;
BeginWaitCursor();
- DWORD startSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16))?m_dwBeginSel:m_dwEndSel;
- DWORD endSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16))?m_dwEndSel:m_dwBeginSel;
+ DWORD startSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16)) ? m_dwBeginSel : m_dwEndSel;
+ DWORD endSel = ((m_dwBeginSel>>16)<(m_dwEndSel>>16)) ? m_dwEndSel : m_dwBeginSel;
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->m_nChannels, pSndFile->Patterns[m_nPattern].GetNumRows());
int finalDest = (startSel>>16)+((endSel>>16)-(startSel>>16))/2;
- for (int row=(startSel>>16)+1; row<=finalDest; row++)
+ for (int row=(startSel >> 16); row <= finalDest; row++)
{
- int offset = row-(startSel>>16);
- int srcRow = (startSel>>16)+(offset*2);
+ int offset = row - (startSel >> 16);
+ int srcRow = (startSel >> 16) + (offset * 2);
- for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) < 5)
+ for (UINT i = (startSel & 0xFFFF); i <= (endSel & 0xFFFF); i++) if ((i & 7) <= LAST_COLUMN)
{
- UINT chn = i >> 3;
- if ((chn >= pSndFile->m_nChannels) || (srcRow >= pSndFile->Patterns[m_nPattern].GetNumRows())
+ const CHANNELINDEX chn = i >> 3;
+ if ((chn >= pSndFile->GetNumChannels()) || (srcRow >= pSndFile->Patterns[m_nPattern].GetNumRows())
|| (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue;
- MODCOMMAND *dest = &p[row * pSndFile->m_nChannels + chn];
- MODCOMMAND *src = &p[srcRow * pSndFile->m_nChannels + chn];
+ MODCOMMAND *dest = pSndFile->Patterns[m_nPattern].GetpModCommand(row, chn);
+ MODCOMMAND *src = pSndFile->Patterns[m_nPattern].GetpModCommand(srcRow, chn);
+ // if source command is empty, try next source row.
+ if(srcRow < pSndFile->Patterns[m_nPattern].GetNumRows() - 1)
+ {
+ const MODCOMMAND *srcNext = pSndFile->Patterns[m_nPattern].GetpModCommand(srcRow + 1, chn);
+ if(src->note == NOTE_NONE) src->note = srcNext->note;
+ if(src->instr == 0) src->instr = srcNext->instr;
+ if(src->volcmd == VOLCMD_NONE)
+ {
+ src->volcmd = srcNext->volcmd;
+ src->vol = srcNext->vol;
+ }
+ if(src->command == CMD_NONE)
+ {
+ src->command = srcNext->command;
+ src->param = srcNext->param;
+ }
+ }
+
//memcpy(dest/*+(i%5)*/, src/*+(i%5)*/, /*sizeof(MODCOMMAND) - (i-chn)*/ sizeof(BYTE));
Log("dst: %d; src: %d\n", row, srcRow);
switch(i & 7)
@@ -850,11 +868,19 @@
}
for (int row=finalDest+1; row<=(endSel>>16); row++)
{
- for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if ((i & 7) < 5)
+ for (UINT i = (startSel & 0xFFFF); i <= (endSel & 0xFFFF); i++) if ((i & 7) <= LAST_COLUMN)
{
UINT chn = i >> 3;
- MODCOMMAND *blank= &p[row * pSndFile->m_nChannels + chn];
- *blank = MODCOMMAND::Empty();
+ MODCOMMAND *dest = pSndFile->Patterns[m_nPattern].GetpModCommand(row, chn);
+ switch(i & 7)
+ {
+ case NOTE_COLUMN: dest->note = NOTE_NONE; break;
+ case INST_COLUMN: dest->instr = 0; break;
+ case VOL_COLUMN: dest->vol = 0;
+ dest->volcmd = VOLCMD_NONE; break;
+ case EFFECT_COLUMN: dest->command = CMD_NONE; break;
+ case PARAM_COLUMN: dest->param = 0; break;
+ }
}
}
m_dwBeginSel = startSel;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 22:02:47
|
Revision: 822
http://modplug.svn.sourceforge.net/modplug/?rev=822&view=rev
Author: saga-games
Date: 2011-03-19 22:02:38 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Fix] FreePattern() was not deallocating pattern data properly (delete vs. delete[]).
[Ref] Moved AllocatePattern() / FreePattern() to CPattern, as I think it makes more sense.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CleanupSong.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/Undo.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/soundlib/LOAD_AMF.CPP
trunk/OpenMPT/soundlib/Load_itp.cpp
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/pattern.cpp
trunk/OpenMPT/soundlib/pattern.h
trunk/OpenMPT/soundlib/patternContainer.cpp
trunk/OpenMPT/soundlib/patternContainer.h
Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -392,6 +392,7 @@
}
// Remove all completely empty patterns above last used pattern (those are safe to remove)
+ BEGIN_CRITICAL();
for (PATTERNINDEX nPat = maxpat; nPat < maxPatIndex; nPat++) if ((pSndFile->Patterns[nPat]) && (nPat >= nMinToRemove))
{
if(pSndFile->Patterns.IsPatternEmpty(nPat))
@@ -400,6 +401,7 @@
nPatRemoved++;
}
}
+ END_CRITICAL();
// Number of unused patterns
size_t nWaste = 0;
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -74,7 +74,7 @@
for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i])
{
MODCOMMAND *p = m_SndFile.Patterns[i];
- MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nNewChannels);
+ MODCOMMAND *newp = CPattern::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nNewChannels);
if (!newp)
{
END_CRITICAL();
@@ -86,7 +86,7 @@
memcpy(&newp[j*nNewChannels], &p[j*m_SndFile.m_nChannels], m_SndFile.m_nChannels*sizeof(MODCOMMAND));
}
m_SndFile.Patterns[i] = newp;
- CSoundFile::FreePattern(p);
+ CPattern::FreePattern(p);
}
//if channel was removed before and is added again, mute status has to be unset! (bug 1814)
@@ -134,7 +134,7 @@
for (i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i])
{
MODCOMMAND *p = m_SndFile.Patterns[i];
- MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nRemainingChannels);
+ MODCOMMAND *newp = CPattern::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nRemainingChannels);
if (!newp)
{
END_CRITICAL();
@@ -150,7 +150,7 @@
}
}
m_SndFile.Patterns[i] = newp;
- CSoundFile::FreePattern(p);
+ CPattern::FreePattern(p);
}
UINT tmpchn = 0;
for (i=0; i<m_SndFile.m_nChannels; i++)
@@ -517,10 +517,8 @@
if ((nPat < m_SndFile.Patterns.Size()) && (m_SndFile.Patterns[nPat]))
{
BEGIN_CRITICAL();
- LPVOID p = m_SndFile.Patterns[nPat];
- m_SndFile.Patterns[nPat] = nullptr;
m_SndFile.SetPatternName(nPat, "");
- CSoundFile::FreePattern(p);
+ m_SndFile.Patterns.Remove(nPat);
END_CRITICAL();
SetModified();
return true;
Modified: trunk/OpenMPT/mptrack/Undo.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Undo.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/mptrack/Undo.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -133,7 +133,7 @@
{
if((!pSndFile->Patterns[nPattern]) || (pSndFile->Patterns[nPattern].GetNumRows() < nRows))
{
- MODCOMMAND *newPattern = CSoundFile::AllocatePattern(nRows, pSndFile->m_nChannels);
+ MODCOMMAND *newPattern = CPattern::AllocatePattern(nRows, pSndFile->m_nChannels);
MODCOMMAND *oldPattern = pSndFile->Patterns[nPattern];
if (!newPattern) return PATTERNINDEX_INVALID;
const ROWINDEX nOldRowCount = pSndFile->Patterns[nPattern].GetNumRows();
@@ -141,7 +141,7 @@
if(oldPattern)
{
memcpy(newPattern, oldPattern, pSndFile->m_nChannels * nOldRowCount * sizeof(MODCOMMAND));
- CSoundFile::FreePattern(oldPattern);
+ CPattern::FreePattern(oldPattern);
}
}
linkToPrevious = pUndo->linkToPrevious;
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -2483,7 +2483,7 @@
dy = (int)(m_dwDragPos >> 16) - (int)(m_dwStartSel >> 16);
if ((!dx) && (!dy)) return;
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0,0, nChannels, nRows);
- pNewPattern = CSoundFile::AllocatePattern(nRows, nChannels);
+ pNewPattern = CPattern::AllocatePattern(nRows, nChannels);
if (!pNewPattern) return;
x1 = (m_dwBeginSel & 0xFFF8) >> 3;
y1 = (m_dwBeginSel) >> 16;
@@ -2559,7 +2559,7 @@
SetCursorPosition( y1, (x1<<3)|c1 );
SetCurSel((y1<<16)|(x1<<3)|c1, (y2<<16)|(x2<<3)|c2);
InvalidatePattern();
- CSoundFile::FreePattern(pOldPattern);
+ CPattern::FreePattern(pOldPattern);
pModDoc->SetModified();
EndWaitCursor();
}
Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP
===================================================================
--- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2011-03-19 22:02:38 UTC (rev 822)
@@ -312,13 +312,13 @@
}
// Setup sequence list
Order.resize(pfh->numorders, Order.GetInvalidPatIndex());
+ vector<ROWINDEX> patternLength(pfh->numorders, 64);
for (UINT iOrd=0; iOrd < pfh->numorders; iOrd++)
{
Order[iOrd] = iOrd;
- Patterns[iOrd].Resize(64, false);
if (pfh->version >= 14)
{
- Patterns[iOrd].Resize(LittleEndianW(*(USHORT *)(lpStream+dwMemPos)));
+ patternLength[iOrd] = LittleEndianW(*(uint16 *)(lpStream+dwMemPos));
dwMemPos += 2;
}
ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos);
@@ -386,9 +386,10 @@
// Create the patterns from the list of tracks
for (UINT iPat=0; iPat<pfh->numorders; iPat++)
{
- MODCOMMAND *p = AllocatePattern(Patterns[iPat].GetNumRows(), m_nChannels);
- if (!p) break;
- Patterns[iPat] = p;
+ if(Patterns.Insert(iPat, patternLength[iPat]))
+ {
+ break;
+ }
for (UINT iChn=0; iChn<m_nChannels; iChn++)
{
UINT nTrack = LittleEndianW(ptracks[iPat][iChn]);
@@ -400,7 +401,7 @@
realtrk--;
if ((realtrk < realtrackcnt) && (pTrackData[realtrk]))
{
- AMF_Unpack(p+iChn, pTrackData[realtrk], Patterns[iPat].GetNumRows(), m_nChannels);
+ AMF_Unpack(Patterns[iPat].GetpModCommand(0, iChn), pTrackData[realtrk], Patterns[iPat].GetNumRows(), m_nChannels);
}
}
}
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -256,21 +256,20 @@
for(PATTERNINDEX npat=0; npat<size; npat++)
{
- // Free pattern if not empty
- if(Patterns[npat]) { FreePattern(Patterns[npat]); Patterns[npat] = NULL; }
-
// Patterns[npat].GetNumRows()
ASSERT_CAN_READ(4);
memcpy(&id,lpStream+dwMemPos,sizeof(DWORD));
if(id > MAX_PATTERN_ROWS) return false;
- Patterns[npat].Resize(id, false);
+ const ROWINDEX nRows = id;
dwMemPos += sizeof(DWORD);
// Try to allocate & read only sized patterns
- if(Patterns[npat].GetNumRows()){
+ if(nRows)
+ {
// Allocate pattern
- if(Patterns.Insert(npat, Patterns[npat].GetNumRows())){
+ if(Patterns.Insert(npat, nRows))
+ {
dwMemPos += m_nChannels * Patterns[npat].GetNumRows() * n;
continue;
}
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -241,6 +241,7 @@
BYTE inspanenv[MAX_INSTRUMENTS];
LPCBYTE pvolenv, ppanenv, ppitchenv;
UINT nvolenv, npanenv, npitchenv;
+ vector<ROWINDEX> patternLength;
if ((!lpStream) || (dwMemLength < 1024)) return false;
if ((pmsh->id != 0x4C444D44) || ((pmsh->version & 0xF0) > 0x10)) return false;
@@ -313,6 +314,9 @@
npatterns = lpStream[dwMemPos];
if (npatterns > MAX_PATTERNS) npatterns = MAX_PATTERNS;
dwPos = dwMemPos + 1;
+
+ patternLength.assign(npatterns, 64);
+
for (i=0; i<npatterns; i++)
{
const WORD *pdata;
@@ -323,7 +327,7 @@
{
const MDLPATTERNDATA *pmpd = (const MDLPATTERNDATA *)(lpStream + dwPos);
if (pmpd->channels > 32) break;
- Patterns[i].Resize(pmpd->lastrow+1);
+ patternLength[i] = pmpd->lastrow + 1;
if (m_nChannels < pmpd->channels) m_nChannels = pmpd->channels;
dwPos += 18 + 2*pmpd->channels;
pdata = pmpd->data;
@@ -331,7 +335,7 @@
} else
{
pdata = (const WORD *)(lpStream + dwPos);
- Patterns[i].Resize(64, false);
+ //Patterns[i].Resize(64, false);
if (m_nChannels < 32) m_nChannels = 32;
dwPos += 2*32;
ch = 32;
@@ -527,7 +531,10 @@
{
for (UINT ipat=0; ipat<npatterns; ipat++)
{
- if ((Patterns[ipat] = AllocatePattern(Patterns[ipat].GetNumRows(), m_nChannels)) == NULL) break;
+ if(Patterns.Insert(ipat, patternLength[ipat]))
+ {
+ break;
+ }
for (UINT chn=0; chn<m_nChannels; chn++) if ((patterntracks[ipat*32+chn]) && (patterntracks[ipat*32+chn] <= ntracks))
{
MODCOMMAND *m = Patterns[ipat] + chn;
Modified: trunk/OpenMPT/soundlib/Load_mid.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mid.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/Load_mid.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -571,7 +571,6 @@
memset(midichstate, 0, sizeof(midichstate));
// Initializing Patterns
Order[0] = 0;
- for (UINT ipat=0; ipat<Patterns.Size(); ipat++) Patterns[ipat].Resize(gnMidiPatternLen, false);
// Initializing Channels
for (UINT ics=0; ics<MAX_BASECHANNELS; ics++)
{
@@ -628,10 +627,9 @@
do
{
// Allocate current pattern if not allocated yet
- if (!Patterns[pat])
+ if (!Patterns[pat] && Patterns.Insert(pat, gnMidiPatternLen))
{
- Patterns[pat] = AllocatePattern(Patterns[pat].GetNumRows(), m_nChannels);
- if (!Patterns[pat]) break;
+ break;
}
dwGlobalFlags |= MIDIGLOBAL_SONGENDED;
MODCOMMAND *m = Patterns[pat] + row * m_nChannels;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -517,9 +517,9 @@
BOOL CSoundFile::Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength)
-//---------------------------------------------------------------------------
+//----------------------------------------------------------------------------
{
- m_pModDoc=pModDoc;
+ m_pModDoc = pModDoc;
m_nType = MOD_TYPE_NONE;
m_dwSongFlags = 0;
m_nChannels = 0;
@@ -564,7 +564,6 @@
memset(&m_SongEQ, 0, sizeof(m_SongEQ));
ResetMidiCfg();
- //for (UINT npt=0; npt<Patterns.Size(); npt++) Patterns[npt].GetNumRows() = 64;
for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++)
{
InitChannel(nChn);
@@ -731,8 +730,8 @@
pSmp->nSustainStart = 0;
pSmp->nSustainEnd = 0;
}
- if (!pSmp->nLoopEnd) pSmp->uFlags &= ~CHN_LOOP;
- if (!pSmp->nSustainEnd) pSmp->uFlags &= ~CHN_SUSTAINLOOP;
+ if (!pSmp->nLoopEnd) pSmp->uFlags &= ~(CHN_LOOP|CHN_PINGPONGLOOP);
+ if (!pSmp->nSustainEnd) pSmp->uFlags &= ~(CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN);
if (pSmp->nGlobalVol > 64) pSmp->nGlobalVol = 64;
}
// Check invalid instruments
@@ -827,7 +826,7 @@
for(std::list<PLUGINDEX>::iterator i = notFoundIDs.begin(); i != notFoundIDs.end(); ++i)
{
CString sUrl;
- sUrl.Format("http://www.kvraudio.com/search.php?q=%s&lq=db", m_MixPlugins[*i].Info.szLibraryName);
+ sUrl.Format("http://www.kvraudio.com/search.php?lq=inurl%3Aget&q=%s", m_MixPlugins[*i].Info.szLibraryName);
CTrackApp::OpenURL(sUrl);
}
}
@@ -853,11 +852,7 @@
//------------------------
{
size_t i;
- for (i=0; i<Patterns.Size(); i++) if (Patterns[i])
- {
- FreePattern(Patterns[i]);
- Patterns[i] = NULL;
- }
+ Patterns.DestroyPatterns();
m_nPatternNames = 0;
delete[] m_lpszPatternNames;
@@ -903,23 +898,6 @@
//////////////////////////////////////////////////////////////////////////
// Memory Allocation
-MODCOMMAND *CSoundFile::AllocatePattern(UINT rows, UINT nchns)
-//------------------------------------------------------------
-{
- MODCOMMAND *p = new MODCOMMAND[rows*nchns];
- if (p) memset(p, 0, rows*nchns*sizeof(MODCOMMAND));
- return p;
-}
-
-
-void CSoundFile::FreePattern(LPVOID pat)
-//--------------------------------------
-{
-
- if (pat) delete pat;
-}
-
-
LPSTR CSoundFile::AllocateSample(UINT nbytes)
//-------------------------------------------
{
@@ -1551,7 +1529,7 @@
if (Patterns[nPat])
{
MODCOMMAND *p = Patterns[nPat];
- MODCOMMAND *newp = CSoundFile::AllocatePattern(Patterns[nPat].GetNumRows(), nRemainingChannels);
+ MODCOMMAND *newp = CPattern::AllocatePattern(Patterns[nPat].GetNumRows(), nRemainingChannels);
if (!newp)
{
END_CRITICAL();
@@ -1571,7 +1549,7 @@
}
}
Patterns[nPat] = newp;
- CSoundFile::FreePattern(p);
+ CPattern::FreePattern(p);
}
}
Modified: trunk/OpenMPT/soundlib/pattern.cpp
===================================================================
--- trunk/OpenMPT/soundlib/pattern.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/pattern.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -55,11 +55,11 @@
BEGIN_CRITICAL();
if (newRowCount > m_Rows)
{
- MODCOMMAND *p = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels);
+ MODCOMMAND *p = AllocatePattern(newRowCount, sndFile.m_nChannels);
if (p)
{
memcpy(p, m_ModCommands, sndFile.m_nChannels*m_Rows*sizeof(MODCOMMAND));
- CSoundFile::FreePattern(m_ModCommands);
+ FreePattern(m_ModCommands);
m_ModCommands = p;
m_Rows = newRowCount;
}
@@ -93,11 +93,11 @@
#endif // MODPLUG_TRACKER
if (bOk)
{
- MODCOMMAND *pnew = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels);
+ MODCOMMAND *pnew = AllocatePattern(newRowCount, sndFile.m_nChannels);
if (pnew)
{
memcpy(pnew, m_ModCommands, sndFile.m_nChannels*newRowCount*sizeof(MODCOMMAND));
- CSoundFile::FreePattern(m_ModCommands);
+ FreePattern(m_ModCommands);
m_ModCommands = pnew;
m_Rows = newRowCount;
}
@@ -121,11 +121,12 @@
void CPattern::Deallocate()
//-------------------------
{
- BEGIN_CRITICAL();
+ // Removed critical section as it can cause problems when destroying patterns in the CSoundFile constructor.
+ //BEGIN_CRITICAL();
m_Rows = m_RowsPerBeat = m_RowsPerMeasure = 0;
- CSoundFile::FreePattern(m_ModCommands);
+ FreePattern(m_ModCommands);
m_ModCommands = nullptr;
- END_CRITICAL();
+ //END_CRITICAL();
}
bool CPattern::Expand()
@@ -143,7 +144,7 @@
rModDoc.BeginWaitCursor();
const ROWINDEX nRows = m_Rows;
const CHANNELINDEX nChns = sndFile.m_nChannels;
- newPattern = CSoundFile::AllocatePattern(nRows * 2, nChns);
+ newPattern = AllocatePattern(nRows * 2, nChns);
if (!newPattern) return true;
const PATTERNINDEX nPattern = m_rPatternContainer.GetIndex(this);
@@ -155,7 +156,7 @@
}
m_ModCommands = newPattern;
m_Rows = nRows * 2;
- CSoundFile::FreePattern(oldPattern); oldPattern = nullptr;
+ FreePattern(oldPattern); oldPattern = nullptr;
rModDoc.SetModified();
rModDoc.UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL);
rModDoc.EndWaitCursor();
@@ -210,7 +211,22 @@
}
+MODCOMMAND *CPattern::AllocatePattern(ROWINDEX rows, CHANNELINDEX nchns)
+//----------------------------------------------------------------------
+{
+ MODCOMMAND *p = new MODCOMMAND[rows*nchns];
+ if (p) memset(p, 0, rows*nchns*sizeof(MODCOMMAND));
+ return p;
+}
+
+void CPattern::FreePattern(MODCOMMAND *pat)
+//-----------------------------------------
+{
+ if (pat) delete[] pat;
+}
+
+
bool CPattern::WriteITPdata(FILE* f) const
//----------------------------------------
{
Modified: trunk/OpenMPT/soundlib/pattern.h
===================================================================
--- trunk/OpenMPT/soundlib/pattern.h 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/pattern.h 2011-03-19 22:02:38 UTC (rev 822)
@@ -86,6 +86,10 @@
//4. Length of the stream.
//Returns true on error.
+ // Static allocation / deallocation helpers
+ static MODCOMMAND* AllocatePattern(ROWINDEX rows, CHANNELINDEX nchns);
+ static void FreePattern(MODCOMMAND *pat);
+
//END: INTERFACE METHODS
typedef MODCOMMAND* iterator;
Modified: trunk/OpenMPT/soundlib/patternContainer.cpp
===================================================================
--- trunk/OpenMPT/soundlib/patternContainer.cpp 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/patternContainer.cpp 2011-03-19 22:02:38 UTC (rev 822)
@@ -5,11 +5,30 @@
#include "../mptrack/serialization_utils.h"
#include "../mptrack/version.h"
+
+void CPatternContainer::ClearPatterns()
+//-------------------------------------
+{
+ DestroyPatterns();
+ m_Patterns.assign(m_Patterns.size(), MODPATTERN(*this));
+}
+
+
+void CPatternContainer::DestroyPatterns()
+//---------------------------------------
+{
+ for(PATTERNINDEX i = 0; i < m_Patterns.size(); i++)
+ {
+ Remove(i);
+ }
+}
+
+
PATTERNINDEX CPatternContainer::Insert(const ROWINDEX rows)
//---------------------------------------------------------
{
PATTERNINDEX i = 0;
- for(i = 0; i<m_Patterns.size(); i++)
+ for(i = 0; i < m_Patterns.size(); i++)
if(!m_Patterns[i]) break;
if(Insert(i, rows))
return PATTERNINDEX_INVALID;
@@ -38,7 +57,11 @@
}
}
- m_Patterns[index] = CSoundFile::AllocatePattern(rows, m_rSndFile.m_nChannels);
+ if(m_Patterns[index].m_ModCommands != nullptr)
+ {
+ CPattern::FreePattern(m_Patterns[index].m_ModCommands);
+ }
+ m_Patterns[index].m_ModCommands = CPattern::AllocatePattern(rows, m_rSndFile.m_nChannels);
m_Patterns[index].m_Rows = rows;
m_Patterns[index].RemoveSignature();
Modified: trunk/OpenMPT/soundlib/patternContainer.h
===================================================================
--- trunk/OpenMPT/soundlib/patternContainer.h 2011-03-19 16:37:10 UTC (rev 821)
+++ trunk/OpenMPT/soundlib/patternContainer.h 2011-03-19 22:02:38 UTC (rev 822)
@@ -31,8 +31,10 @@
// Clears existing patterns and resizes array to default size.
void Init();
- //Note: No memory handling here.
- void ClearPatterns() {m_Patterns.assign(m_Patterns.size(), MODPATTERN(*this));}
+ // Empty and initialize all patterns.
+ void ClearPatterns();
+ // Delete all patterns.
+ void DestroyPatterns();
//Insert (default)pattern to given position. If pattern already exists at that position,
//ignoring request. Returns true on failure, false otherwise.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 16:37:17
|
Revision: 821
http://modplug.svn.sourceforge.net/modplug/?rev=821&view=rev
Author: saga-games
Date: 2011-03-19 16:37:10 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Imp] Pattern Editor: Select beat / measure behaves more intelligent now (selection extension to all channels)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 14:03:32 UTC (rev 820)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 16:37:10 UTC (rev 821)
@@ -3697,24 +3697,7 @@
case kcSelectBeat:
case kcSelectMeasure:
- // Select whole beat / measure
- {
- const ROWINDEX adjust = (wParam == kcSelectBeat) ? GetRowsPerBeat() : GetRowsPerMeasure();
- const ROWINDEX startRow = GetSelectionStartRow() - (GetSelectionStartRow() % adjust); // Snap to start of beat / measure of upper-left corner of current selection
- const ROWINDEX endRow = GetSelectionEndRow() + adjust - (GetSelectionEndRow() % adjust) - 1; // Snap to end of beat / measure of lower-right corner of current selection
- DWORD startMask = (GetSelectionStartChan() << 3), endMask = (GetSelectionEndChan() << 3);
- if(m_dwBeginSel == m_dwEndSel)
- {
- endMask |= LAST_COLUMN; // Extend to param column;
- } else
- {
- // Remember start / end column
- startMask |= (m_dwBeginSel & 0x07);
- endMask |= (m_dwEndSel & 0x07);
- }
- SetCurSel((startRow << 16) | startMask, (endRow << 16) | endMask);
- }
- return wParam;
+ SelectBeatOrMeasure(wParam == kcSelectBeat); return wParam;
case kcClearRow: OnClearField(-1, false); return wParam;
case kcClearField: OnClearField(m_dwCursor & 0x07, false); return wParam;
@@ -5671,3 +5654,44 @@
}
EndWaitCursor();
}
+
+
+// Select a whole beat (selectBeat = true) or measure.
+void CViewPattern::SelectBeatOrMeasure(bool selectBeat)
+//-----------------------------------------------------
+{
+ const ROWINDEX adjust = selectBeat ? GetRowsPerBeat() : GetRowsPerMeasure();
+
+ // Snap to start of beat / measure of upper-left corner of current selection
+ const ROWINDEX startRow = GetSelectionStartRow() - (GetSelectionStartRow() % adjust);
+ // Snap to end of beat / measure of lower-right corner of current selection
+ const ROWINDEX endRow = GetSelectionEndRow() + adjust - (GetSelectionEndRow() % adjust) - 1;
+
+ DWORD startMask = (GetSelectionStartChan() << 3), endMask = (GetSelectionEndChan() << 3);
+
+ if(m_dwBeginSel == m_dwEndSel)
+ {
+ // No selection has been made yet => expand selection to whole channel.
+ endMask |= LAST_COLUMN; // Extend to param column;
+ } else if(startRow == GetSelectionStartRow() && endRow == GetSelectionEndRow())
+ {
+ // Whole beat or measure is already selected
+ if((m_dwBeginSel & 0x07) == 0 && (m_dwEndSel & 0x07) == LAST_COLUMN)
+ {
+ // Whole channel is already selected => expand selection to whole row.
+ startMask = 0;
+ endMask = 0xFFFF;
+ } else
+ {
+ // Channel is only partly selected => expand to whole channel first.
+ endMask |= LAST_COLUMN; // Extend to param column;
+ }
+ }
+ else
+ {
+ // Some arbitrary selection: Remember start / end column
+ startMask |= (m_dwBeginSel & 0x07);
+ endMask |= (m_dwEndSel & 0x07);
+ }
+ SetCurSel((startRow << 16) | startMask, (endRow << 16) | endMask);
+}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 14:03:32 UTC (rev 820)
+++ trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 16:37:10 UTC (rev 821)
@@ -186,6 +186,7 @@
// -! NEW_FEATURE#0014// -> CODE#0012
BOOL ShowEditWindow();
UINT GetCurrentInstrument() const;
+ void SelectBeatOrMeasure(bool selectBeat);
BOOL TransposeSelection(int transp);
BOOL PrepareUndo(DWORD dwBegin, DWORD dwEnd);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 14:03:42
|
Revision: 820
http://modplug.svn.sourceforge.net/modplug/?rev=820&view=rev
Author: saga-games
Date: 2011-03-19 14:03:32 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Mod] Updated DE_jojo.mkb to include new Select beat / measure shortcuts.
[Mod] Updated History.txt
[Mod] Installer also backups Keybindings.mkb now.
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-03-19 14:02:21 UTC (rev 819)
+++ trunk/OpenMPT/installer/install.iss 2011-03-19 14:03:32 UTC (rev 820)
@@ -81,6 +81,7 @@
Source: ..\packageTemplate\extraKeymaps\*.*; DestDir: {app}\extraKeymaps; Flags: ignoreversion sortfilesbyextension
; kind of auto-backup - handy!
+Source: {userappdata}\OpenMPT\Keybindings.mkb; DestDir: {userappdata}\OpenMPT; DestName: Keybindings.mkb.old; Flags: external skipifsourcedoesntexist; Tasks: not portable
Source: {userappdata}\OpenMPT\mptrack.ini; DestDir: {userappdata}\OpenMPT; DestName: mptrack.ini.old; Flags: external skipifsourcedoesntexist; Tasks: not portable
Source: {userappdata}\OpenMPT\plugin.cache; DestDir: {userappdata}\OpenMPT; DestName: plugin.cache.old; Flags: external skipifsourcedoesntexist; Tasks: not portable
@@ -246,31 +247,15 @@
begin
if(GetIniInt('Paths', 'UseAppDataDirectory', 1, 0, 0, ExpandConstant('{app}\mptrack.ini')) = 1) then
begin
- filepath := ExpandConstant('{userappdata}\OpenMPT\mptrack.ini');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{userappdata}\OpenMPT\Keybindings.mkb');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{userappdata}\OpenMPT\plugin.cache');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{userappdata}\OpenMPT\tunings\local_tunings.tc');
- if FileExists(filepath) then DeleteFile(filepath);
+ filepath := ExpandConstant('{userappdata}\OpenMPT\');
end else
+ filepath := ExpandConstant('{app}\');
begin
- filepath := ExpandConstant('{app}\mptrack.ini');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{app}\Keybindings.mkb');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{app}\plugin.cache');
- if FileExists(filepath) then DeleteFile(filepath);
-
- filepath := ExpandConstant('{app}\tunings\local_tunings.tc');
- if FileExists(filepath) then DeleteFile(filepath);
end;
+ DeleteFile(filepath + 'mptrack.ini');
+ DeleteFile(filepath + 'Keybindings.mkb');
+ DeleteFile(filepath + 'plugin.cache');
+ DeleteFile(filepath + 'tunings\local_tunings.tc');
end;
end;
end;
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-03-19 14:02:21 UTC (rev 819)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-03-19 14:03:32 UTC (rev 820)
@@ -10,10 +10,11 @@
(tx XYZ): thanks to XYZ for telling us about the bug
-v1.19.01.00 (February 2011, revision 813)
------------------------------------------
+v1.19.01.00 (March 2011, revision 820)
+--------------------------------------
Pattern tab
[New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45
+ [New] <Jojo> The new keyboard shortcuts "Select beat" and "Select measure" can be used to automatically extend the current selection to the beat / measure boundaries.
[New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen.
[Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space.
[Mod] <Jojo> Using the Goto Dialog should now update channel parameters and set the elapsed time. (http://bugs.openmpt.org/view.php?id=28)
@@ -68,6 +69,7 @@
[Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins?
[Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible.
[Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
+ [Fix] <Jojo> Fixed garbage characters shown in preset fields of plugins that don't return program names.
Mod Conversion
[Imp] <Jojo> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command.
@@ -87,7 +89,8 @@
IT
[New] <Jojo> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information.
- [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such.
+ [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore.
+ [Imp] <Jojo> IT Loader: Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT.
[Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again.
[Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker).
[Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29)
@@ -156,6 +159,7 @@
[Fix] <Jojo> The ID3v2 "comments" field was not formatted properly when exporting to MP3.
[Fix] <Jojo> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits.
[Fix] <Jojo> Editing a sample / instrument name on the comments tab didn't mark the module as modified (tx djmakas)
+ [Fix] <Jojo> When changing the font size of the song message while the comments tab is open, the message editor is now resized instantly. Previously, only the font size was updated.
[Reg] <Jojo> "Set highlights to songs' time signatures" is gone. Custom song highlighting is now always applied, and the values found in the colour options are now always applied to new modules.
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-19 14:02:21 UTC (rev 819)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-19 14:03:32 UTC (rev 820)
@@ -77,6 +77,8 @@
2:1050:1:16:1 //Selection key: Shift+UMSCHALT (KeyDown)
2:1051:2:17:1 //Copy select key: Ctrl+STRG (KeyDown)
2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown)
+2:1858:2:66:1 //Select beat: Ctrl+B (KeyDown)
+2:1859:3:66:1 //Select measure: Shift+Ctrl+B (KeyDown)
2:1663:0:19:1 //Toggle follow song: (KeyDown)
2:1003:0:13:1 //Quick copy: EINGABE (KeyDown)
2:1004:0:32:5 //Quick paste: LEER (KeyDown|KeyHold)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 14:02:27
|
Revision: 819
http://modplug.svn.sourceforge.net/modplug/?rev=819&view=rev
Author: saga-games
Date: 2011-03-19 14:02:21 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Imp] IT Loader: Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT.
[Imp] IT Loader: Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore.
[Mod] OpenMPT: Version is now 1.19.00.29
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-03-19 14:00:23 UTC (rev 818)
+++ trunk/OpenMPT/mptrack/version.h 2011-03-19 14:02:21 UTC (rev 819)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 28
+#define VER_MINORMINOR 29
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2011-03-19 14:00:23 UTC (rev 818)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-03-19 14:02:21 UTC (rev 819)
@@ -853,7 +853,7 @@
if(rows <= ModSpecs::itEx.patternRowsMax && rows > ModSpecs::it.patternRowsMax)
{
- interpretModPlugMade = true;
+ //interpretModPlugMade = true; // Chibi also does this.
hasModPlugExtensions = true;
}
@@ -970,6 +970,10 @@
pSmp->nVibRate = pis->vis;
pSmp->nVibDepth = pis->vid & 0x7F;
pSmp->nVibSweep = pis->vir; //(pis->vir + 3) / 4;
+ if(pSmp->nVibSweep == 0 && (pSmp->nVibDepth || pSmp->nVibRate) && m_dwLastSavedWithVersion && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 03, 02))
+ {
+ pSmp->nVibSweep = 255; // Let's correct this little stupid mistake in history.
+ }
if(pis->samplepointer) lastSampleOffset = pis->samplepointer; // MPTX hack
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 14:00:29
|
Revision: 818
http://modplug.svn.sourceforge.net/modplug/?rev=818&view=rev
Author: saga-games
Date: 2011-03-19 14:00:23 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Ref] Small bits of refactoring in various places.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AutoSaver.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/Vstplug.h
trunk/OpenMPT/mptrack/fxp.cpp
trunk/OpenMPT/mptrack/fxp.h
trunk/OpenMPT/soundlib/Load_mt2.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-03-19 14:00:23 UTC (rev 818)
@@ -378,8 +378,8 @@
CHAR szPath[_MAX_PATH] = "";
BROWSEINFO bi;
- GetDlgItemText(IDC_AUTOSAVE_PATH, szPath, sizeof(szPath));
- memset(&bi, 0, sizeof(bi));
+ GetDlgItemText(IDC_AUTOSAVE_PATH, szPath, CountOf(szPath));
+ MemsetZero(bi);
bi.hwndOwner = m_hWnd;
bi.lpszTitle = "Select a folder to store autosaved files in...";
bi.pszDisplayName = szPath;
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 14:00:23 UTC (rev 818)
@@ -30,9 +30,19 @@
#define PATSTATUS_PLUGNAMESINHEADERS 0x2000 // Show plugin names in channel headers //rewbs.patPlugName
#define PATSTATUS_SELECTROW 0x4000 // Selecting a whole pattern row by clicking the row numbers
+
// Row Spacing
#define MAX_SPACING 64 // MAX_PATTERN_ROWS
+
+// Selection - bit masks
+// ---------------------
+// A selection point (m_dwStartSel and the like) is stored in a 32-Bit variable. The structure is as follows (MSB to LSB):
+// | 16 bits - row | 13 bits - channel | 3 bits - channel component |
+// As you can see, the highest 16 bits contain a row index.
+// It is followed by a channel index, which is 13 bits wide.
+// The lowest 3 bits are used for addressing the components of a channel. They are *not* used as a bit set, but treated as one of the following integer numbers:
+
enum PatternColumns
{
NOTE_COLUMN=0,
@@ -43,7 +53,9 @@
LAST_COLUMN = PARAM_COLUMN
};
+static_assert(MAX_CHANNELS <= 0x1FFF, "Check: Channel index in pattern editor is only 13 bits wide!");
+
//Struct for controlling selection clearing. This is used to define which data fields
//should be cleared.
struct RowMask
@@ -67,10 +79,10 @@
struct FindReplaceStruct
{
MODCOMMAND cmdFind, cmdReplace; // Find/replace notes/instruments/effects
- DWORD dwFindFlags, dwReplaceFlags; // PATSEARCH_XXX flags
+ DWORD dwFindFlags, dwReplaceFlags; // PATSEARCH_XXX flags (=> PatternEditorDialogs.h)
CHANNELINDEX nFindMinChn, nFindMaxChn; // Find in these channels (if PATSEARCH_CHANNEL is set)
signed char cInstrRelChange; // relative instrument change (quick'n'dirty fix, this should be implemented in a less cryptic way)
- DWORD dwBeginSel, dwEndSel; // Find in this selection (if PATSEARCH_PATSEL is set)
+ DWORD dwBeginSel, dwEndSel; // Find in this selection (if PATSEARCH_PATSELECTION is set)
};
@@ -94,7 +106,8 @@
bool m_bDragging, m_bInItemRect, m_bContinueSearch, m_bWholePatternFitsOnScreen;
RECT m_rcDragItem;
DWORD m_dwStatus, m_dwCursor;
- DWORD m_dwBeginSel, m_dwEndSel, m_dwStartSel, m_dwDragPos;
+ DWORD m_dwBeginSel, m_dwEndSel; // Upper-left / Lower-right corners of selection
+ DWORD m_dwStartSel, m_dwDragPos; // Point where selection was started
WORD ChnVUMeters[MAX_BASECHANNELS];
WORD OldVUMeters[MAX_BASECHANNELS];
CListBox *ChnEffectList[MAX_BASECHANNELS]; //rewbs.patPlugName
Modified: trunk/OpenMPT/mptrack/Vstplug.h
===================================================================
--- trunk/OpenMPT/mptrack/Vstplug.h 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/mptrack/Vstplug.h 2011-03-19 14:00:23 UTC (rev 818)
@@ -205,7 +205,7 @@
UINT GetNumCommands() {return 0;}
VOID GetPluginType(LPSTR) {}
PlugParamIndex GetNumPrograms() {return 0;}
- bool GetProgramNameIndexed(long, long, char*) {return 0;}
+ bool GetProgramNameIndexed(long, long, char*) {return false;}
VOID SetParameter(PlugParamIndex nIndex, PlugParamValue fValue) {}
VOID GetParamLabel(UINT, LPSTR) {}
VOID GetParamDisplay(UINT, LPSTR) {}
Modified: trunk/OpenMPT/mptrack/fxp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/fxp.cpp 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/mptrack/fxp.cpp 2011-03-19 14:00:23 UTC (rev 818)
@@ -279,14 +279,14 @@
bool Cfxp::NeedSwap()
//-------------------
{
- if (m_bNeedSwap<0) //don't yet know if we need to swap - find out!
+ if (m_bNeedSwap < 0) //don't yet know if we need to swap - find out!
{
static char szChnk[] = "CcnK";
static long lChnk = 'CcnK';
m_bNeedSwap = !!memcmp(szChnk, &lChnk, 4);
}
- return m_bNeedSwap;
+ return m_bNeedSwap ? true : false;
}
Modified: trunk/OpenMPT/mptrack/fxp.h
===================================================================
--- trunk/OpenMPT/mptrack/fxp.h 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/mptrack/fxp.h 2011-03-19 14:00:23 UTC (rev 818)
@@ -26,7 +26,7 @@
bool Save(CString fileName);
protected:
- BOOL m_bNeedSwap;
+ int m_bNeedSwap;
bool Load(CString fileName);
bool ReadLE(CFile &in, long &l);
Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mt2.cpp 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2011-03-19 14:00:23 UTC (rev 818)
@@ -276,7 +276,7 @@
dwMemPos += 6;
if (dwMemPos + wDataLen > dwMemLength) break;
UINT nLines = pmp->wLines;
- if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= 256))
+ if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= MAX_PATTERN_ROWS))
{
#ifdef MT2DEBUG
Log("Pattern #%d @%04X: %d lines, %d bytes\n", iPat, dwMemPos-6, nLines, pmp->wDataLen);
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-19 13:56:03 UTC (rev 817)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-19 14:00:23 UTC (rev 818)
@@ -76,12 +76,12 @@
#define MAX_ENVPOINTS 240
#define MIN_PERIOD 0x0020
#define MAX_PERIOD 0xFFFF
-// String lengths
+// String lengths (including trailing null char)
#define MAX_SAMPLENAME 32 // also affects module name!
#define MAX_SAMPLEFILENAME 22
#define MAX_PATTERNNAME 32
#define MAX_CHANNELNAME 20
-#define MAX_INFONAME 80
+
#define MAX_EQ_BANDS 6
#define MAX_MIXPLUGINS 100 //50 // -> CODE#0006 -> DESC="misc quantity changes" -! BEHAVIOUR_CHANGE#0006
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 13:56:10
|
Revision: 817
http://modplug.svn.sourceforge.net/modplug/?rev=817&view=rev
Author: saga-games
Date: 2011-03-19 13:56:03 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[New] Pattern Editor: The new keyboard shortcuts "Select beat" and "Select measure" can be used to automatically extend the current selection to the beat / measure boundaries.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/PatternEditorDialogs.h
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-19 13:26:38 UTC (rev 816)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-19 13:56:03 UTC (rev 817)
@@ -604,6 +604,8 @@
DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History"));
DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade"));
DefineKeyCommand(kcSampleXFade, 1857, kcVisible, kcNoDummy, _T("Crossfade sample loop"));
+ DefineKeyCommand(kcSelectBeat, 1858, kcVisible, kcNoDummy, _T("Select beat"));
+ DefineKeyCommand(kcSelectMeasure, 1859, kcVisible, kcNoDummy, _T("Select measure"));
// Add new key commands here.
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2011-03-19 13:26:38 UTC (rev 816)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2011-03-19 13:56:03 UTC (rev 817)
@@ -201,7 +201,9 @@
kcCopySelectWithSelect,
kcCopySelectOffWithSelect,
kcSelectColumn,
- kcEndSelect=kcSelectColumn,
+ kcSelectBeat,
+ kcSelectMeasure,
+ kcEndSelect=kcSelectMeasure,
kcStartPatternEditMisc,
kcToggleFollowSong=kcStartPatternEditMisc,
Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h
===================================================================
--- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2011-03-19 13:26:38 UTC (rev 816)
+++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2011-03-19 13:56:03 UTC (rev 817)
@@ -35,7 +35,7 @@
//=========================================
{
protected:
- BOOL m_bReplace;
+ bool m_bReplace; // is this the replace tab?
CModDoc *m_pModDoc;
public:
@@ -69,7 +69,7 @@
void ChangeEffect();
public:
- CFindReplaceTab(UINT nIDD, BOOL bReplaceTab, CModDoc *pModDoc):CPropertyPage(nIDD) { m_bReplace = bReplaceTab; m_pModDoc = pModDoc; }
+ CFindReplaceTab(UINT nIDD, bool bReplaceTab, CModDoc *pModDoc):CPropertyPage(nIDD) { m_bReplace = bReplaceTab; m_pModDoc = pModDoc; }
protected:
virtual BOOL OnInitDialog();
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 13:26:38 UTC (rev 816)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 13:56:03 UTC (rev 817)
@@ -1694,8 +1694,8 @@
CModDoc *pModDoc = GetDocument();
if (pModDoc)
{
- CFindReplaceTab pageFind(IDD_EDIT_FIND, FALSE, pModDoc);
- CFindReplaceTab pageReplace(IDD_EDIT_REPLACE, TRUE, pModDoc);
+ CFindReplaceTab pageFind(IDD_EDIT_FIND, false, pModDoc);
+ CFindReplaceTab pageReplace(IDD_EDIT_REPLACE, true, pModDoc);
CPropertySheet dlg("Find/Replace");
pageFind.m_nNote = m_findReplace.cmdFind.note;
@@ -3695,6 +3695,27 @@
case kcCopySelectOffWithNav:
case kcCopySelectOff: m_dwStatus &= ~PATSTATUS_CTRLDRAGSEL; return wParam;
+ case kcSelectBeat:
+ case kcSelectMeasure:
+ // Select whole beat / measure
+ {
+ const ROWINDEX adjust = (wParam == kcSelectBeat) ? GetRowsPerBeat() : GetRowsPerMeasure();
+ const ROWINDEX startRow = GetSelectionStartRow() - (GetSelectionStartRow() % adjust); // Snap to start of beat / measure of upper-left corner of current selection
+ const ROWINDEX endRow = GetSelectionEndRow() + adjust - (GetSelectionEndRow() % adjust) - 1; // Snap to end of beat / measure of lower-right corner of current selection
+ DWORD startMask = (GetSelectionStartChan() << 3), endMask = (GetSelectionEndChan() << 3);
+ if(m_dwBeginSel == m_dwEndSel)
+ {
+ endMask |= LAST_COLUMN; // Extend to param column;
+ } else
+ {
+ // Remember start / end column
+ startMask |= (m_dwBeginSel & 0x07);
+ endMask |= (m_dwEndSel & 0x07);
+ }
+ SetCurSel((startRow << 16) | startMask, (endRow << 16) | endMask);
+ }
+ return wParam;
+
case kcClearRow: OnClearField(-1, false); return wParam;
case kcClearField: OnClearField(m_dwCursor & 0x07, false); return wParam;
case kcClearFieldITStyle: OnClearField(m_dwCursor & 0x07, false, true); return wParam;
@@ -4778,8 +4799,8 @@
if (newIns == 0)
{
- RowMask sp = {0,1,0,0,0}; // Setup mask to only clear instrument data in OnClearSelection
- OnClearSelection(false, sp); // Clears instrument selection from pattern
+ RowMask sp = {false, true, false, false, false}; // Setup mask to only clear instrument data in OnClearSelection
+ OnClearSelection(false, sp); // Clears instrument selection from pattern
} else
{
SetSelectionInstrument(newIns);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-19 13:26:44
|
Revision: 816
http://modplug.svn.sourceforge.net/modplug/?rev=816&view=rev
Author: saga-games
Date: 2011-03-19 13:26:38 +0000 (Sat, 19 Mar 2011)
Log Message:
-----------
[Fix] VST: Fixed garbage characters in preset fields of plugins that don't return program names.
[Fix] Comments Tab: When changing font size, the editor is now resized instantly.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
trunk/OpenMPT/mptrack/Ctrl_com.cpp
trunk/OpenMPT/mptrack/View_gen.cpp
trunk/OpenMPT/mptrack/Vstplug.cpp
trunk/OpenMPT/mptrack/Vstplug.h
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-03-09 12:35:25 UTC (rev 815)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-03-19 13:26:38 UTC (rev 816)
@@ -139,6 +139,7 @@
//TODO: exception handling
if (!(m_pVstPlugin->SaveProgram(files.first_file.c_str())))
::AfxMessageBox("Error saving preset.");
+
}
VOID CAbstractVstEditor::OnRandomizePreset()
@@ -172,25 +173,29 @@
void CAbstractVstEditor::UpdatePresetField()
//------------------------------------------
{
-
- if(m_pVstPlugin->GetNumPrograms() > 0 && m_pMenu->GetMenuItemCount() < 5)
+ if(m_pVstPlugin->GetNumPrograms() > 0)
{
- m_pMenu->AppendMenu(MF_BYPOSITION, ID_VSTPRESETBACKWARDJUMP, TEXT("<<"));
- m_pMenu->AppendMenu(MF_BYPOSITION, ID_PREVIOUSVSTPRESET, TEXT("<"));
- m_pMenu->AppendMenu(MF_BYPOSITION, ID_NEXTVSTPRESET, TEXT(">"));
- m_pMenu->AppendMenu(MF_BYPOSITION, ID_VSTPRESETFORWARDJUMP, TEXT(">>"));
- m_pMenu->AppendMenu(MF_BYPOSITION|MF_DISABLED, 0, TEXT(""));
+ if(m_pMenu->GetMenuItemCount() < 5)
+ {
+ m_pMenu->AppendMenu(MF_BYPOSITION, ID_VSTPRESETBACKWARDJUMP, TEXT("<<"));
+ m_pMenu->AppendMenu(MF_BYPOSITION, ID_PREVIOUSVSTPRESET, TEXT("<"));
+ m_pMenu->AppendMenu(MF_BYPOSITION, ID_NEXTVSTPRESET, TEXT(">"));
+ m_pMenu->AppendMenu(MF_BYPOSITION, ID_VSTPRESETFORWARDJUMP, TEXT(">>"));
+ m_pMenu->AppendMenu(MF_BYPOSITION|MF_DISABLED, 0, TEXT(""));
+ }
+ long index = m_pVstPlugin->GetCurrentProgram();
+ char name[266];
+ char rawname[256];
+ if(!m_pVstPlugin->GetProgramNameIndexed(index, -1, rawname))
+ {
+ strcpy(rawname, "");
+ }
+ SetNullTerminator(rawname);
+ CreateVerifiedProgramName(rawname, sizeof(rawname), name, sizeof(name), index);
+
+ m_pMenu->ModifyMenu(8, MF_BYPOSITION, 0, name);
}
- long index = m_pVstPlugin->GetCurrentProgram();
- char name[266];
- char rawname[256];
- m_pVstPlugin->GetProgramNameIndexed(index, -1, rawname);
- rawname[sizeof(rawname)-1] = 0;
- CreateVerifiedProgramName(rawname, sizeof(rawname), name, sizeof(name), index);
-
- m_pMenu->ModifyMenu(8, MF_BYPOSITION, 0, name);
-
DrawMenuBar();
}
@@ -255,7 +260,8 @@
//We handle keypresses before Windows has a chance to handle them (for alt etc..)
if ( (!m_pVstPlugin->m_bPassKeypressesToPlug) &&
((pMsg->message == WM_SYSKEYUP) || (pMsg->message == WM_KEYUP) ||
- (pMsg->message == WM_SYSKEYDOWN) || (pMsg->message == WM_KEYDOWN)) ) {
+ (pMsg->message == WM_SYSKEYDOWN) || (pMsg->message == WM_KEYDOWN)) )
+ {
CInputHandler* ih = (CMainFrame::GetMainFrame())->GetInputHandler();
@@ -267,13 +273,15 @@
InputTargetContext ctx = (InputTargetContext)(kCtxVSTGUI);
// If we successfully mapped to a command and plug does not listen for keypresses, no need to pass message on.
- if (ih->KeyEvent(ctx, nChar, nRepCnt, nFlags, kT, (CWnd*)this) != kcNull) {
+ if (ih->KeyEvent(ctx, nChar, nRepCnt, nFlags, kT, (CWnd*)this) != kcNull)
+ {
return true;
}
// Don't forward key repeats if plug does not listen for keypresses
// (avoids system beeps on note hold)
- if (kT == kKeyEventRepeat) {
+ if (kT == kKeyEventRepeat)
+ {
return true;
}
}
@@ -361,7 +369,7 @@
if(!pModDoc || !pSndFile)
return false;
- if(pModDoc->GetSoundFile()->GetModSpecifications().instrumentsMax == 0 ||
+ if(!m_pVstPlugin->isInstrument() || pModDoc->GetSoundFile()->GetModSpecifications().instrumentsMax == 0 ||
AfxMessageBox(_T("You need to assign an instrument to this plugin before you can play notes from here.\nCreate a new instrument and assign this plugin to the instrument?"), MB_YESNO | MB_ICONQUESTION) == IDNO)
{
return false;
@@ -376,8 +384,8 @@
MODINSTRUMENT *pIns = pSndFile->Instruments[nIns];
m_nInstrument = nIns;
- _snprintf(pIns->name, ARRAYELEMCOUNT(pIns->name) - 1, _T("%d: %s"), m_pVstPlugin->GetSlot() + 1, pSndFile->m_MixPlugins[m_pVstPlugin->GetSlot()].Info.szName);
- strncpy(pIns->filename, pSndFile->m_MixPlugins[m_pVstPlugin->GetSlot()].Info.szLibraryName, ARRAYELEMCOUNT(pIns->filename) - 1);
+ _snprintf(pIns->name, CountOf(pIns->name) - 1, _T("%d: %s"), m_pVstPlugin->GetSlot() + 1, pSndFile->m_MixPlugins[m_pVstPlugin->GetSlot()].Info.szName);
+ strncpy(pIns->filename, pSndFile->m_MixPlugins[m_pVstPlugin->GetSlot()].Info.szLibraryName, CountOf(pIns->filename) - 1);
pIns->nMixPlug = (PLUGINDEX)m_pVstPlugin->GetSlot() + 1;
pIns->nMidiChannel = 1;
// People will forget to change this anyway, so the following lines can lead to some bad surprises after re-opening the module.
@@ -432,9 +440,12 @@
}
for (long p=0; p<numProgs; p++) {
- m_pVstPlugin->GetProgramNameIndexed(p, -1, sname);
+ if(!m_pVstPlugin->GetProgramNameIndexed(p, -1, sname))
+ {
+ strcpy(sname, "");
+ }
+ SetNullTerminator(sname);
- sname[sizeof(sname)-1] = 0;
CreateVerifiedProgramName(sname, sizeof(sname), s, sizeof(s), p);
// Get menu item properties
Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-03-09 12:35:25 UTC (rev 815)
+++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-03-19 13:26:38 UTC (rev 816)
@@ -96,7 +96,6 @@
if ((pHint == this) || (!m_pSndFile) || (!(dwHint & (HINT_MODCOMMENTS|HINT_MPTOPTIONS|HINT_MODTYPE)))) return;
if (m_nLockCount) return;
m_nLockCount++;
- m_EditComments.SetRedraw(FALSE);
HFONT newfont;
if (CMainFrame::m_dwPatternSetup & PATTERN_LARGECOMMENTS)
newfont = CMainFrame::GetLargeFixedFont();
@@ -106,7 +105,9 @@
{
m_hFont = newfont;
m_EditComments.SendMessage(WM_SETFONT, (WPARAM)newfont);
+ RecalcLayout();
}
+ m_EditComments.SetRedraw(FALSE);
m_EditComments.SetSel(0, -1, TRUE);
m_EditComments.ReplaceSel("");
if (m_pSndFile->m_lpszSongComments)
Modified: trunk/OpenMPT/mptrack/View_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_gen.cpp 2011-03-09 12:35:25 UTC (rev 815)
+++ trunk/OpenMPT/mptrack/View_gen.cpp 2011-03-19 13:26:38 UTC (rev 816)
@@ -1507,7 +1507,11 @@
m_CbnPreset.SetItemData(m_CbnPreset.AddString(s2), 0);
for (UINT i = 0; i < nProg; i++)
{
- pVstPlugin->GetProgramNameIndexed(i, 0, sname);
+ if(!pVstPlugin->GetProgramNameIndexed(i, 0, sname))
+ {
+ strcpy(sname, "");
+ }
+ SetNullTerminator(sname);
if(sname[0] < ' ')
{
Modified: trunk/OpenMPT/mptrack/Vstplug.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-09 12:35:25 UTC (rev 815)
+++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-19 13:26:38 UTC (rev 816)
@@ -2093,32 +2093,38 @@
bool success;
//Collect required data
- PlugParamIndex numParams = GetNumParameters();
long ID = GetUID();
long plugVersion = GetVersion();
- float *params = new float[numParams];
- GetParams(params, 0, numParams);
- Cfxp* fxp = NULL;
+ Cfxp* fxp = nullptr;
//Construct & save fxp
+
+ // try chunk-based preset:
if(m_pEffect->flags & effFlagsProgramChunks)
- { // try chunk-based preset:
+ {
void *chunk = NULL;
long chunkSize = Dispatch(effGetChunk, 1,0, &chunk, 0);
- if ((chunkSize > 8) && (chunk)) //If chunk is less that 8 bytes, the plug must be kidding. :) (e.g.: imageline sytrus)
+ if ((chunkSize > 8) && (chunk)) //If chunk is less than 8 bytes, the plug must be kidding. :) (e.g.: imageline sytrus)
fxp = new Cfxp(ID, plugVersion, 1, chunkSize, chunk);
}
- if (fxp == NULL)
- { // fall back on parameter based preset:
+ // fall back on parameter based preset:
+ if (fxp == nullptr)
+ {
+ //Collect required data
+ PlugParamIndex numParams = GetNumParameters();
+ float *params = new float[numParams];
+ GetParams(params, 0, numParams);
+
fxp = new Cfxp(ID, plugVersion, numParams, params);
+
+ delete[] params;
}
success = fxp->Save(fileName);
if (fxp)
delete fxp;
- delete[] params;
return success;
}
@@ -2182,14 +2188,14 @@
return 0;
}
-long CVstPlugin::GetProgramNameIndexed(long index, long category, char *text)
+bool CVstPlugin::GetProgramNameIndexed(long index, long category, char *text)
//---------------------------------------------------------------------------
{
if ((m_pEffect) && (m_pEffect->numPrograms > 0))
{
- return Dispatch(effGetProgramNameIndexed, index, category, text, 0);
+ return (Dispatch(effGetProgramNameIndexed, index, category, text, 0) == 1);
}
- return 0;
+ return false;
}
@@ -2251,10 +2257,10 @@
pszName[0] = 0;
if ((m_pEffect) && (m_pEffect->numParams > 0) && (nIndex < (UINT)m_pEffect->numParams))
{
- CHAR s[64]; //Increased to 64 bytes since 32 bytes doesn't seem to suffice for all plugs.
+ CHAR s[64]; // Increased to 64 bytes since 32 bytes doesn't seem to suffice for all plugs. Kind of ridiculous if you consider that kVstMaxParamStrLen = 8...
s[0] = 0;
Dispatch(effGetParamName, nIndex, 0, s, 0);
- s[min(sizeof(s)-1, cbSize-1)] = 0;
+ s[min(CountOf(s) - 1, cbSize - 1)] = 0;
lstrcpyn(pszName, s, min(cbSize, sizeof(s)));
}
}
@@ -2295,7 +2301,7 @@
}
void CVstPlugin::Init(unsigned long /*nFreq*/, int /*bReset*/)
-//----------------------------------------------------
+//------------------------------------------------------------
{
}
Modified: trunk/OpenMPT/mptrack/Vstplug.h
===================================================================
--- trunk/OpenMPT/mptrack/Vstplug.h 2011-03-09 12:35:25 UTC (rev 815)
+++ trunk/OpenMPT/mptrack/Vstplug.h 2011-03-19 13:26:38 UTC (rev 816)
@@ -109,7 +109,7 @@
PlugParamIndex GetNumParameters();
long GetCurrentProgram();
long GetNumProgramCategories(); //rewbs.VSTpresets
- long GetProgramNameIndexed(long index, long category, char *text); //rewbs.VSTpresets
+ bool GetProgramNameIndexed(long index, long category, char *text); //rewbs.VSTpresets
bool LoadProgram(CString fileName);
bool SaveProgram(CString fileName);
VstInt32 GetUID(); //rewbs.VSTpresets
@@ -205,7 +205,7 @@
UINT GetNumCommands() {return 0;}
VOID GetPluginType(LPSTR) {}
PlugParamIndex GetNumPrograms() {return 0;}
- long GetProgramNameIndexed(long, long, char*) {return 0;}
+ bool GetProgramNameIndexed(long, long, char*) {return 0;}
VOID SetParameter(PlugParamIndex nIndex, PlugParamValue fValue) {}
VOID GetParamLabel(UINT, LPSTR) {}
VOID GetParamDisplay(UINT, LPSTR) {}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-09 12:35:32
|
Revision: 815
http://modplug.svn.sourceforge.net/modplug/?rev=815&view=rev
Author: saga-games
Date: 2011-03-09 12:35:25 +0000 (Wed, 09 Mar 2011)
Log Message:
-----------
[Mod] Updated some keymaps, history.txt, release notes
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb
trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/installer/install.iss 2011-03-09 12:35:25 UTC (rev 815)
@@ -72,8 +72,8 @@
; release notes
Source: ..\packageTemplate\ReleaseNotesImages\general\*.*; DestDir: {app}\ReleaseNotesImages\general\; Flags: ignoreversion sortfilesbyextension
-Source: ..\packageTemplate\ReleaseNotesImages\1.18\*.*; DestDir: {app}\ReleaseNotesImages\1.18\; Flags: ignoreversion sortfilesbyextension
-Source: ..\packageTemplate\OMPT_1.18_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion
+Source: ..\packageTemplate\ReleaseNotesImages\1.19\*.*; DestDir: {app}\ReleaseNotesImages\1.18\; Flags: ignoreversion sortfilesbyextension
+Source: ..\packageTemplate\OMPT_1.19_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion
; soundtouch license stuff
Source: ..\packageTemplate\SoundTouch\*.*; DestDir: {app}\SoundTouch; Flags: ignoreversion sortfilesbyextension
Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb
===================================================================
--- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -280,7 +280,9 @@
8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown)
8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown)
8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown)
-8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown)
+8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown)
+8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown)
+8:1857:2:76:1 //Crossfade sample loop: Ctrl+L (KeyDown)
//----( Instrument Context [bottom] (9) )------------
9:1837:0:107:5 //Zoom In: NUM PLUS (KeyDown|KeyHold)
@@ -325,6 +327,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-03-09 12:35:25 UTC (rev 815)
@@ -10,11 +10,12 @@
(tx XYZ): thanks to XYZ for telling us about the bug
-v1.19.01.00 (February 2011, revision 803)
+v1.19.01.00 (February 2011, revision 813)
-----------------------------------------
Pattern tab
[New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45
[New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen.
+ [Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space.
[Mod] <Jojo> Using the Goto Dialog should now update channel parameters and set the elapsed time. (http://bugs.openmpt.org/view.php?id=28)
[Mod] <Jojo> Undo steps have been increased from 100 to 1000.
[Fix] <Jojo> Cursor paste was possible even when editing was disabled.
@@ -34,7 +35,7 @@
[Fix] <Jojo> Changing a value didn't create an undo point. (http://bugs.openmpt.org/view.php?id=56)
Pattern tab::Find/replace
- [New] <Jojo> Added Find / Replace mode: Find in current pattern selection.
+ [New] <Jojo> Added Find / Replace mode: Find in current pattern selection. (http://bugs.openmpt.org/view.php?id=42)
[Imp] <Jojo> When changing the content of a combobox, the corresponding checkbox is now automatically checked. Likewise, the "Replace By" checkbox is checked if a checkbox or combobox on the "Replace" tab is enabled.
[Mod] <Jojo> "Replace All" just creates one undo point now.
@@ -43,11 +44,14 @@
[Mod] <Jojo> When removing a channel (via context menu) that contains no data in any pattern, no warning is shown anymore.
Sample tab
+ [New] <Jojo> There's a new tool to create seamless sample loops: The loop crossfader. Includes a new keyboard shortcut. (http://bugs.openmpt.org/view.php?id=53)
[New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples.
+ [New] <Jojo> New context menu item and keyboard shortcut: Quick fade for samples. If the sample start is selected, a fade-in is automatically performed. Likewise, if the sample end is selected, a fade-out is performed. If neither is selected, the default amplification dialog is shown.
[Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data.
[Mod] <Jojo> Undo steps have been increased from 100 to 1000 (per sample).
[Fix] <Jojo> When cutting samples with a loop, the loop end point was not always moved correctly if the cut start was in the loop.
- [Fix] <re> Changing zoom level should now preserve the view position better.
+ [Fix] <Jojo> Sample Undo didn't preserve the sample name.
+ [Fix] <re> Changing zoom level should now preserve the view position better. (http://bugs.openmpt.org/view.php?id=3)
Instrument tab
[Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the envelopes.
@@ -57,18 +61,28 @@
[Fix] <Jojo> The note mapping doesn't allow items anymore that aren't notes (such as "no note" or "note cut"). Such notes couldn't be entered manually, however when converting from other formats this was possible and it could crash the tracker (http://bugs.openmpt.org/view.php?id=61).
[Fix] <Jojo> Various actions in the instrument note map and envelope view should now also mark the instrument as modified (when working in the ITP format).
+VST
+ [New] <Jojo> Plugins can now request common file dialogs (file and directory selection).
+ [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing.
+ [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better.
+ [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins?
+ [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible.
+ [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
+
Mod Conversion
+ [Imp] <Jojo> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command.
[Imp] <Jojo> When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of.
[Imp] <Jojo> Sample sustain loops are now converted to normal loops if needed and possible.
[Imp] <Jojo> Bidi loops are disabled when converting to MOD / S3M now.
[Imp] <Jojo> More warnings are shown, old warning messages were improved.
[Imp] <Jojo> Volume command priority when converting from XM to IT / S3M has been changed - Cxx overrides vxx in XM, so this is now taken into account.
+ [Imp] <Jojo> When converting to XM, the E60 bug is now tried to be compensated.
[Fix] <Jojo> Q0y means "no volume change" in S3M / IT, but R0y means "continue volume change" in FT2, and converting from IT / S3M to XM didn't consider this. Q0y is now converted to R8y, and E9y is now converted to Q0y (instead of Q8y).
Playback
- [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on.
+ [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on. (http://bugs.openmpt.org/view.php?id=6)
[Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback).
- [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (hehe). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works...
+ [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (http://bugs.openmpt.org/view.php?id=21). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works... (it's not like this has worked properly before anyway)
[Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0)
IT
@@ -76,8 +90,8 @@
[Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such.
[Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again.
[Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker).
- [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer.
- [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode...
+ [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29)
+ [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... (http://bugs.openmpt.org/view.php?id=5)
[Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C.
[Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now.
[Fix] <Jojo> The extended sample map is not saved anymore in the instrument headers when using compatibility export.
@@ -94,7 +108,7 @@
[Fix] <Jojo> XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly.
MOD
- [Imp] <Jojo> It's now possible to create MOD files with more than 64 patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
+ [Imp] <Jojo> It's now possible to create MOD files with more than 64 distinct patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
[Fix] <Jojo> The maximum speed for MOD files was off by one in some places (31 instead of 32).
MOD::Loading
@@ -106,17 +120,10 @@
S3M
[Mod] <Jojo> Changed some code in the S3M loader that should only affect really broken S3M files which every player handles different anyway (at least my broken version of aa-polym.s3m sounds better now)
[Fix] <Jojo> Octave 8 was allowed in S3M files while it shouldn't (it wasn't even saved in the file)
+ [Fix] <Jojo> S3M Loader: Fix to pattern loader (for empty patterns)
[Fix] <Jojo> Removed the X param (#) effect from the supported effect list.
[Fix] <Jojo> Speed and tempo values are now adjusted to what Scream Tracker actually expects (speed 1 - 254, tempo 32 - 255) - anything out of this range is ignored by Scream Tracker, so it is now also ignored by OpenMPT.
-VST
- [New] <Jojo> Plugins can now request common file dialogs (file and directory selection).
- [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing.
- [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better.
- [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins?
- [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible.
- [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
-
Other modules
[Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names.
[Imp] <Jojo> Improved handling of the note cut effect in PTM (Polytracker) files a bit.
@@ -129,17 +136,19 @@
Misc
[New] <Jojo> WAV Export: Sample-exact cue points are now written at each pattern transition.
[Imp] <Jojo> Paths to VST plugins in mptrack.ini and plugin.cache are now also relative in portable mode. This means that finally, *all* stored paths are now relative in portable mode.
- [Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist)
+ [Imp] <Jojo> Additional new keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist), plus the ones mentioned in above categories
[Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer.
[Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown.
[Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now.
- [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function.
+ [Imp] <Jojo> Added Mix Paste (IT Style) to the "Paste Special" edit menu
+ [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. (http://bugs.openmpt.org/view.php?id=20)
[Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one).
[Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is.
[Mod] <Jojo> Updated genre list in the MP3 export dialog.
[Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now be available.
[Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE)
[Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1
+ [Mod] <Jojo> Updated the internet link list in the Help menu.
[Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven)
[Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes.
[Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected.
@@ -966,8 +975,8 @@
Sample tab
[New] <Jojo> Can now normalize sample selections. (rev. 254)
[New] <Jojo> Can now optionally normalize all samples instead of just one (click normalize with shift down) (rev. 249)
- [New] <Jojo & re> Status bar now displays offset value at given sample point. (rev. 232)
- [New] <Jojo & re> Sample amplify now accepts negative values(inverts sample phase) (request 2219) (rev. 234)
+ [New] <Jojo & re> Status bar now displays Oxx / 9xx offset value at current mouse cursor position. (rev. 232)
+ [New] <Jojo & re> Sample amplify now accepts negative values (inverts sample phase) (http://forum.openmpt.org/index.php?topic=2219.0) (rev. 234)
[New] <Jojo & re> Signed/unsigned sample conversion. (rev. 235)
[New] <re> Added button for phase invert to toolbar. (rev. 235)
[New] <Jojo> Ability to save sample as raw. (rev. 236)
Modified: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-09 12:35:25 UTC (rev 815)
@@ -91,10 +91,8 @@
<li>Based on an undocumented feature in Impulse Tracker, OpenMPT can now save an <strong>edit history</strong> in IT and MPTM files, which reveals when and for how long a module has been edited in the tracker.</li>
<li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li>
<li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li>
- <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li>
- <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li>
<li>The instrument list on the comments tab also shows <strong>assigned plugins</strong> now.</li>
- <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist)</li>
+ <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist), Quick fade (sample editor)</li>
<li>Changes to <strong>keymap file handling</strong>: The active keymap is now always saved to Keybindings.mkb. Any other keymaps are now only overwritten when using the "Save keys as" function.</li>
<li>When using the ACM MP3 codec, 320kbit/s bitrate should now be available.</li>
</ul>
@@ -105,12 +103,20 @@
</div>
<ul>
<li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li>
- <li>You can now <strong>select a whole row</strong> by clicking the row index on the left side of the pattern.</li>
+ <li>You can now <strong>select whole rows</strong> by clicking / dragging the row index on the left side of the pattern.</li>
<li>The search feature has been extended to allow for <strong>searching in pattern selections</strong>.</li>
<li>Furthermore, the usability of the Find / Replace dialog has been improved: Corresponding checkboxes are now automatically ticked when the value of a dropdown box has been changed. "Replace All" no longer creates an undo point for every replaced command.</li>
<li>It is now possible to <strong>play the whole pattern row when entering notes</strong> and chords into the pattern editor. This behaviour can be enabled from the setup screen.</li>
</ul>
+ <h3>Sample Editor / Instrument Editor</h3>
+ <ul>
+ <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li>
+ <li>You can now create seamless loop transitations using the <strong>sample loop crossfader</strong>.</li>
+ <li>There is a new context menu item for <strong>quickly fading</strong> in the sample start or fading out the sample end.</li>
+ <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li>
+ </ul>
+
<h3>Compatibility</h3>
<ul>
<li>Sample <strong>auto-vibrato</strong> in IT files sounds a lot closer to Impulse Tracker's implementation now.</li>
@@ -135,7 +141,7 @@
<i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i>
</p>
<ul>
- <li>Far from perfect VST support (routing, etc...)</li>
+ <li>Far from perfect VST support (no busses for routing, no MIDI routing, only a few tracker effects are supported, etc...)</li>
<li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li>
<li>Previewing samples from the treeview's file browser stops the playing module.</li>
<li>Cannot preview instruments directly from the MIDI library in the treeview.</li>
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -282,6 +282,7 @@
8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown)
8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown)
8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown)
+8:1857:2:76:1 //Crossfade sample loop: Ctrl+L (KeyDown)
//----( Instrument Context [bottom] (9) )------------
9:1837:0:107:5 //Zoom In: + (ZEHNERTASTATUR) (KeyDown|KeyHold)
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -274,6 +274,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -260,6 +260,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -184,6 +184,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -281,6 +281,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -252,6 +252,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -265,6 +265,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -319,6 +319,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2011-03-08 19:03:30 UTC (rev 814)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2011-03-09 12:35:25 UTC (rev 815)
@@ -319,6 +319,16 @@
//----( Sample Context [top] (16) )------------
//----( Instrument Context [top] (17) )------------
+17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown)
+17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown)
+17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown)
+17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown)
+17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown)
+17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown)
+17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown)
+17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown)
+17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown)
+17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown)
//----( Comments Context [top] (18) )------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-08 19:03:37
|
Revision: 814
http://modplug.svn.sourceforge.net/modplug/?rev=814&view=rev
Author: saga-games
Date: 2011-03-08 19:03:30 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
[Mod] Renamed "MPTM (experimental)" item in the "New" menu to "OpenMPT Module"
[Imp] Added Mix Paste (IT Style) to the "Paste Special" menu
[Imp] Special paste modes have been moved to a sub menu in the pattern editor's context menu, to save some space.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Globals.cpp
trunk/OpenMPT/mptrack/Globals.h
trunk/OpenMPT/mptrack/InputHandler.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/resource.h
Modified: trunk/OpenMPT/mptrack/Globals.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Globals.cpp 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/Globals.cpp 2011-03-08 19:03:30 UTC (rev 814)
@@ -192,6 +192,7 @@
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_MIXPASTE, OnEditMixPaste)
+ ON_COMMAND(ID_EDIT_MIXPASTE_ITSTYLE, OnEditMixPasteITStyle)
ON_COMMAND(ID_EDIT_FIND, OnEditFind)
ON_COMMAND(ID_EDIT_FINDNEXT, OnEditFindNext)
ON_COMMAND(ID_CONTROLTAB, OnSwitchToView)
Modified: trunk/OpenMPT/mptrack/Globals.h
===================================================================
--- trunk/OpenMPT/mptrack/Globals.h 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/Globals.h 2011-03-08 19:03:30 UTC (rev 814)
@@ -80,7 +80,8 @@
afx_msg void OnEditCut() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_CUT, 0); } //rewbs.customKeys
afx_msg void OnEditCopy() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_COPY, 0); } //rewbs.customKeys
afx_msg void OnEditPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PASTE, 0); } //rewbs.customKeys
- afx_msg void OnEditMixPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PASTE_SPECIAL, 0); } //rewbs.mixPaste
+ afx_msg void OnEditMixPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_MIXPASTE, 0); } //rewbs.mixPaste
+ afx_msg void OnEditMixPasteITStyle() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_MIXPASTE_ITSTYLE, 0); }
afx_msg void OnEditPasteFlood() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PASTEFLOOD, 0); }
afx_msg void OnEditPushForwardPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PUSHFORWARDPASTE, 0); }
afx_msg void OnEditFind() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_FIND, 0); } //rewbs.customKeys
@@ -171,7 +172,8 @@
afx_msg void OnEditCut() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_CUT, 0); }
afx_msg void OnEditCopy() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_COPY, 0); }
afx_msg void OnEditPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PASTE, 0); }
- afx_msg void OnEditMixPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_PASTE_SPECIAL, 0); } //rewbs.mixPaste
+ afx_msg void OnEditMixPaste() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_MIXPASTE, 0); } //rewbs.mixPaste
+ afx_msg void OnEditMixPasteITStyle() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_MIXPASTE_ITSTYLE, 0); }
afx_msg void OnEditFind() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_FIND, 0); }
afx_msg void OnEditFindNext() { if (m_hWndView) ::SendMessage(m_hWndView, WM_COMMAND, ID_EDIT_FINDNEXT, 0); }
afx_msg void OnSwitchToView() { if (m_hWndView) ::PostMessage(m_hWndView, WM_MOD_VIEWMSG, VIEWMSG_SETFOCUS, 0); }
Modified: trunk/OpenMPT/mptrack/InputHandler.cpp
===================================================================
--- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-03-08 19:03:30 UTC (rev 814)
@@ -447,6 +447,7 @@
case ID_EDIT_SPLITKEYBOARDSETTINGS: s="Split &Keyboard Settings\t"; c=kcShowSplitKeyboardSettings; break;
// "Paste Special" sub menu
case ID_EDIT_PASTE_SPECIAL: s="&Mix Paste\t"; c=kcEditMixPaste; break;
+ case ID_EDIT_MIXPASTE_ITSTYLE: s="&Mix Paste (IT Style)\t"; c=kcEditMixPasteITStyle; break;
case ID_EDIT_PASTEFLOOD: s="Paste Fl&ood\t"; c=kcEditPasteFlood; break;
case ID_EDIT_PUSHFORWARDPASTE: s="&Push Forward Paste\t"; c=kcEditPushForwardPaste; break;
@@ -511,6 +512,7 @@
pMenu->ModifyMenu(ID_EDIT_COPY, MF_BYCOMMAND | MF_STRING, ID_EDIT_COPY, GetMenuText(ID_EDIT_COPY));
pMenu->ModifyMenu(ID_EDIT_PASTE, MF_BYCOMMAND | MF_STRING, ID_EDIT_PASTE, GetMenuText(ID_EDIT_PASTE));
pMenu->ModifyMenu(ID_EDIT_PASTE_SPECIAL, MF_BYCOMMAND | MF_STRING, ID_EDIT_PASTE_SPECIAL, GetMenuText(ID_EDIT_PASTE_SPECIAL));
+ pMenu->ModifyMenu(ID_EDIT_MIXPASTE_ITSTYLE, MF_BYCOMMAND | MF_STRING, ID_EDIT_MIXPASTE_ITSTYLE, GetMenuText(ID_EDIT_MIXPASTE_ITSTYLE));
pMenu->ModifyMenu(ID_EDIT_PASTEFLOOD, MF_BYCOMMAND | MF_STRING, ID_EDIT_PASTEFLOOD, GetMenuText(ID_EDIT_PASTEFLOOD));
pMenu->ModifyMenu(ID_EDIT_PUSHFORWARDPASTE, MF_BYCOMMAND | MF_STRING, ID_EDIT_PUSHFORWARDPASTE, GetMenuText(ID_EDIT_PUSHFORWARDPASTE));
pMenu->ModifyMenu(ID_EDIT_SELECT_ALL, MF_BYCOMMAND | MF_STRING, ID_EDIT_SELECT_ALL, GetMenuText(ID_EDIT_SELECT_ALL));
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-08 19:03:30 UTC (rev 814)
@@ -59,6 +59,7 @@
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_MIXPASTE, OnEditMixPaste)
+ ON_COMMAND(ID_EDIT_MIXPASTE_ITSTYLE,OnEditMixPasteITStyle)
ON_COMMAND(ID_EDIT_PASTEFLOOD, OnEditPasteFlood)
ON_COMMAND(ID_EDIT_PUSHFORWARDPASTE,OnEditPushForwardPaste)
ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
@@ -5080,15 +5081,19 @@
bool CViewPattern::BuildEditCtxMenu(HMENU hMenu, CInputHandler* ih, CModDoc* pModDoc)
//-----------------------------------------------------------------------------------
{
+ HMENU pasteSpecialMenu = ::CreatePopupMenu();
AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut));
AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy));
AppendMenu(hMenu, MF_STRING, ID_EDIT_PASTE, "Paste\t" + ih->GetKeyTextFromCommand(kcEditPaste));
- AppendMenu(hMenu, MF_STRING, ID_EDIT_MIXPASTE, "Mix Paste\t" + ih->GetKeyTextFromCommand(kcEditMixPaste));
- AppendMenu(hMenu, MF_STRING, ID_EDIT_PASTEFLOOD, "Paste Flood\t" + ih->GetKeyTextFromCommand(kcEditPasteFlood));
- AppendMenu(hMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste));
+ AppendMenu(hMenu, MF_POPUP, (UINT)pasteSpecialMenu, "Paste Special");
+ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_MIXPASTE, "Mix Paste\t" + ih->GetKeyTextFromCommand(kcEditMixPaste));
+ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_MIXPASTE_ITSTYLE, "Mix Paste (IT Style)\t" + ih->GetKeyTextFromCommand(kcEditMixPasteITStyle));
+ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PASTEFLOOD, "Paste Flood\t" + ih->GetKeyTextFromCommand(kcEditPasteFlood));
+ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste));
DWORD greyed = pModDoc->GetPatternUndo()->CanUndo()?FALSE:MF_GRAYED;
- if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) {
+ if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE))
+ {
AppendMenu(hMenu, MF_STRING|greyed, ID_EDIT_UNDO, "Undo\t" + ih->GetKeyTextFromCommand(kcEditUndo));
}
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-03-08 19:03:30 UTC (rev 814)
@@ -1943,7 +1943,7 @@
MENUITEM "&S3M", ID_FILE_NEWS3M
MENUITEM "M&OD", ID_FILE_NEWMOD
MENUITEM "IT &Project", ID_NEW_ITPROJECT
- MENUITEM "&MPTM (experimental)", ID_NEW_MPT
+ MENUITEM "Open&MPT Module", ID_NEW_MPT
END
MENUITEM "&Open...\tCtrl+O", 57601
MENUITEM "&Close", ID_FILE_CLOSE
@@ -1982,6 +1982,7 @@
POPUP "Paste &Special"
BEGIN
MENUITEM "&Mix Paste\tCtrl+M", ID_EDIT_PASTE_SPECIAL
+ MENUITEM "Mix Paste (IT Style)", ID_EDIT_MIXPASTE_ITSTYLE
MENUITEM "Paste &Flood", ID_EDIT_PASTEFLOOD
MENUITEM "&Push Forward Paste", ID_EDIT_PUSHFORWARDPASTE
END
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2011-03-08 13:10:59 UTC (rev 813)
+++ trunk/OpenMPT/mptrack/resource.h 2011-03-08 19:03:30 UTC (rev 814)
@@ -1183,6 +1183,7 @@
#define ID_VIEW_EDITHISTORY 60452
#define ID_SAMPLE_GRID 60453
#define ID_SAMPLE_QUICKFADE 60454
+#define ID_EDIT_MIXPASTE_ITSTYLE 60455
// Next default values for new objects
//
@@ -1190,7 +1191,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 529
-#define _APS_NEXT_COMMAND_VALUE 60455
+#define _APS_NEXT_COMMAND_VALUE 60456
#define _APS_NEXT_CONTROL_VALUE 2435
#define _APS_NEXT_SYMED_VALUE 901
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-08 13:11:07
|
Revision: 813
http://modplug.svn.sourceforge.net/modplug/?rev=813&view=rev
Author: saga-games
Date: 2011-03-08 13:10:59 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
[Fix] S3M Loader: Fix to pattern loader (for empty patterns)... God this code is so ugly!
[Mod] Updated internet links.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/soundlib/Load_s3m.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 16:33:26 UTC (rev 812)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-08 13:10:59 UTC (rev 813)
@@ -92,16 +92,8 @@
ON_COMMAND(ID_PANIC, OnPanic)
ON_COMMAND(ID_PLAYER_PAUSE, OnPlayerPause)
ON_COMMAND_EX(IDD_TREEVIEW, OnBarCheck)
- ON_COMMAND_EX(ID_NETLINK_OPENMPTWIKI, OnInternetLink)
ON_COMMAND_EX(ID_NETLINK_MODPLUG, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_UT, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_OSMUSIC, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_MPTFR, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_HANDBOOK, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_FORUMS, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_PLUGINS, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_OPENMPTWIKI_GERMAN, OnInternetLink)
- ON_COMMAND_EX(ID_NETLINK_MODARCHIVE, OnInternetLink)
+ ON_COMMAND_EX(ID_NETLINK_TOP_PICKS, OnInternetLink)
ON_CBN_SELCHANGE(IDC_COMBO_BASEOCTAVE, OnOctaveChanged)
ON_UPDATE_COMMAND_UI(ID_MIDI_RECORD, OnUpdateMidiRecord)
ON_UPDATE_COMMAND_UI(ID_INDICATOR_TIME, OnUpdateTime)
@@ -2801,6 +2793,8 @@
switch(nID)
{
case ID_NETLINK_MODPLUG: pszURL = "http://openmpt.org/"; break;
+ case ID_NETLINK_TOP_PICKS: pszURL = "http://openmpt.org/top_picks"; break;
+ /*
case ID_NETLINK_OPENMPTWIKI:pszURL = "http://wiki.openmpt.org/"; break;
// case ID_NETLINK_UT: pszURL = "http://www.united-trackers.org"; break;
// case ID_NETLINK_OSMUSIC: pszURL = "http://www.osmusic.net/"; break;
@@ -2810,6 +2804,7 @@
case ID_NETLINK_PLUGINS: pszURL = "http://www.kvraudio.com/"; break;
case ID_NETLINK_MODARCHIVE: pszURL = "http://modarchive.org/"; break;
case ID_NETLINK_OPENMPTWIKI_GERMAN: pszURL = "http://wikide.openmpt.org/Hauptseite"; break;
+ */
}
if (pszURL) return CTrackApp::OpenURL(pszURL);
return FALSE;
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 16:33:26 UTC (rev 812)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-03-08 13:10:59 UTC (rev 813)
@@ -2031,15 +2031,8 @@
MENUITEM "&Search...", ID_HELP_SEARCH
MENUITEM "&Report a bug", ID_REPORT_BUG
MENUITEM SEPARATOR
- POPUP "&Internet"
- BEGIN
- MENUITEM "ModPlug Central &Forums", ID_NETLINK_FORUMS
- MENUITEM "OpenMPT Wiki", ID_NETLINK_OPENMPTWIKI
- MENUITEM "OpenMPT Wiki (German)", ID_NETLINK_OPENMPTWIKI_GERMAN
- MENUITEM "MPT-FR", ID_NETLINK_MPTFR
- MENUITEM "&Kvr Audio (plugins)", ID_NETLINK_PLUGINS
- MENUITEM "The Mod Archive", ID_NETLINK_MODARCHIVE
- END
+ MENUITEM "&OpenMPT Website", ID_NETLINK_MODPLUG
+ MENUITEM "&Web Resources", ID_NETLINK_TOP_PICKS
MENUITEM SEPARATOR
MENUITEM "&About OpenMPT...", ID_APP_ABOUT
END
@@ -2371,10 +2364,8 @@
ID_PATTERN_EXPAND "Expand pattern\nExpand Pattern"
ID_PATTERN_SHRINK "Shrink Pattern\nShrink Pattern"
ID_HELP_SEARCH "Displays the help index\nHelp Index"
- ID_NETLINK_MODPLUG "Go to ModPlug Central"
- ID_NETLINK_UT "Go to United Trackers"
- ID_NETLINK_OSMUSIC "Go to OSMusic.net"
- ID_NETLINK_HANDBOOK "Go to the Tracker's Handbook"
+ ID_NETLINK_MODPLUG "Visit the OpenMPT website"
+ ID_NETLINK_TOP_PICKS "Visit our list of free web resources!"
END
STRINGTABLE
@@ -2386,9 +2377,7 @@
BEGIN
ID_SAMPLE_TRIM "Delete everything except the current selection\nTrim Sample"
ID_FILE_SAVEMIDI "Export the current song to a standard MIDI file"
- ID_NETLINK_FORUMS "Go to the ModPlug Central Music Forums"
ID_INSTRUMENT_SAMPLEMAP "Edit the sample map"
- ID_NETLINK_PLUGINS "Go to KVR Audio to download plugins"
ID_PATTERNDETAIL_LO "Low pattern detail level\nLow pattern detail level"
ID_PATTERNDETAIL_MED "Medium pattern detail level\nMedium pattern detail level"
ID_PATTERNDETAIL_HI "High pattern detail level\nHigh pattern detail level"
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2011-03-07 16:33:26 UTC (rev 812)
+++ trunk/OpenMPT/mptrack/resource.h 2011-03-08 13:10:59 UTC (rev 813)
@@ -1036,17 +1036,13 @@
#define ID_PATTERNCOPY 32874
#define ID_PATTERNPASTE 32875
#define ID_NETLINK_MODPLUG 32876
-#define ID_NETLINK_UT 32877
-#define ID_NETLINK_OSMUSIC 32878
-#define ID_NETLINK_HANDBOOK 32879
+#define ID_NETLINK_TOP_PICKS 32877
#define ID_SAMPLE_TRIM 32880
#define ID_FILE_SAVEMIDI 32881
#define ID_MODTREE_OPENITEM 32882
-#define ID_NETLINK_FORUMS 32883
#define ID_CONTROLENTER 32885
#define ID_INSTRUMENT_SAMPLEMAP 32886
#define ID_SAMPLE_MONOCONVERT 32887
-#define ID_NETLINK_PLUGINS 32888
#define ID_SAMPLE_ZOOMUP 32889
#define ID_SAMPLE_ZOOMDOWN 32890
#define ID_PATTERNDETAIL_LO 32891
@@ -1116,7 +1112,6 @@
#define ID_VSTPRESETBACKWARDJUMP 36031
#define ID_VSTPRESETFORWARDJUMP 36032
#define ID_SELECTINST 36100
-#define ID_NETLINK_MPTFR 37001
#define ID_PLUG_RECORDAUTOMATION 37003
#define ID_LEARN_MACRO_FROM_PLUGGUI 37004
#define ID_CHANGE_INSTRUMENT 37020
@@ -1152,10 +1147,7 @@
#define ID_ENVELOPE_TOGGLERELEASENODE 59206
#define ID_Menu59207 59207
#define ID_ENVELOPE_SCALEPOINTS 59208
-#define ID_NETLINK_OPENMPTWIKI 59210
#define ID_VIEW_MIDIMAPPING 59211
-#define ID_NETLINK_OPENMPTWIKI_GERMAN 59213
-#define ID_NETLINK_MODARCHIVE 59214
#define ID_PATTERN_DUPLICATECHANNEL 59216
#define ID_EDIT_GOTO_MENU 59220
#define ID_CLEANUP_COMPO 59221
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-07 16:33:26 UTC (rev 812)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-08 13:10:59 UTC (rev 813)
@@ -222,11 +222,13 @@
if ((!lpStream) || (dwMemLength <= sizeof(S3MFILEHEADER) + 64)) return false;
UINT insnum, patnum, nins, npat;
- DWORD insfile[128];
- WORD ptr[256];
BYTE s[1024];
DWORD dwMemPos;
- BYTE insflags[128], inspack[128];
+ vector<DWORD> smpdatapos;
+ vector<WORD> smppos;
+ vector<WORD> patpos;
+ vector<BYTE> insflags;
+ vector<BYTE> inspack;
S3MFILEHEADER psfh = *(S3MFILEHEADER *)lpStream;
bool bKeepMidiMacros = false, bHasAdlibPatches = false;
@@ -321,44 +323,46 @@
m_nSamples = insnum;
patnum = npat = psfh.patnum;
if (patnum > MAX_PATTERNS) patnum = MAX_PATTERNS;
- memset(ptr, 0, sizeof(ptr));
- // this seems to be corrupted, the table can't really hold that many values.
- if(nins + npat > 256)
- return false;
-
- if (nins + npat)
+ // Read sample header offsets
+ smppos.resize(nins, 0);
+ for(UINT i = 0; i < nins; i++, dwMemPos += 2)
{
- memcpy(ptr, lpStream + dwMemPos, 2 * (nins + npat));
- dwMemPos += 2 * (nins + npat);
- const UINT nLoopEnd = min(256, nins + npat);
- for(UINT j = 0; j < nLoopEnd; ++j)
+ WORD ptr = *((WORD *)(lpStream + dwMemPos));
+ smppos[i] = LittleEndianW(ptr);
+ }
+ // Read pattern offsets
+ patpos.resize(npat, 0);
+ for(UINT i = 0; i < npat; i++, dwMemPos += 2)
+ {
+ WORD ptr = *((WORD *)(lpStream + dwMemPos));
+ patpos[i] = LittleEndianW(ptr);
+ }
+ // Read channel panning
+ if (psfh.panning_present == 0xFC)
+ {
+ const BYTE *chnpan = lpStream+dwMemPos;
+ for (UINT i=0; i<32; i++) if (chnpan[i] & 0x20)
{
- ptr[j] = LittleEndianW(ptr[j]);
+ ChnSettings[i].nPan = ((chnpan[i] & 0x0F) << 4) + 8;
}
- if (psfh.panning_present == 252)
- {
- const BYTE *chnpan = lpStream+dwMemPos;
- for (UINT i=0; i<32; i++) if (chnpan[i] & 0x20)
- {
- ChnSettings[i].nPan = ((chnpan[i] & 0x0F) << 4) + 8;
- }
- }
}
- if (!m_nChannels) return true;
+
// Reading instrument headers
- memset(insfile, 0, sizeof(insfile));
+ smpdatapos.resize(insnum, 0);
+ inspack.resize(insnum, 0);
+ insflags.resize(insnum, 0);
for (UINT iSmp=1; iSmp<=insnum; iSmp++)
{
- UINT nInd = ((DWORD)ptr[iSmp-1])*16;
+ UINT nInd = ((DWORD)smppos[iSmp - 1]) * 16;
if ((!nInd) || (nInd + 0x50 > dwMemLength)) continue;
- memcpy(s, lpStream+nInd, 0x50);
+ memcpy(s, lpStream + nInd, 0x50);
memcpy(Samples[iSmp].filename, s+1, 12);
SpaceToNullStringFixed<12>(Samples[iSmp].filename);
- insflags[iSmp-1] = s[0x1F];
- inspack[iSmp-1] = s[0x1E];
+ insflags[iSmp - 1] = s[0x1F];
+ inspack[iSmp - 1] = s[0x1E];
s[0x4C] = 0;
lstrcpy(m_szNames[iSmp], (LPCSTR)&s[0x30]);
SpaceToNullStringFixed<28>(m_szNames[iSmp]);
@@ -378,7 +382,7 @@
if (c5Speed < 1024) c5Speed = 1024;
Samples[iSmp].nC5Speed = c5Speed;
- insfile[iSmp - 1] = (s[0x0E] << 4) | (s[0x0F] << 12) | (s[0x0D] << 20);
+ smpdatapos[iSmp - 1] = (s[0x0E] << 4) | (s[0x0F] << 12) | (s[0x0D] << 20);
if(Samples[iSmp].nLoopEnd < 2)
Samples[iSmp].nLoopStart = Samples[iSmp].nLoopEnd = 0;
@@ -393,6 +397,8 @@
}
}
+ if (!m_nChannels) return true;
+
/* Try to find out if Zxx commands are supposed to be panning commands (PixPlay).
We won't convert if there are not enough Zxx commands, too "high" Zxx commands
or there are only "left" or "right" pannings (we assume that stereo should be somewhat balanced) */
@@ -400,13 +406,13 @@
int iZxxCountRight = 0, iZxxCountLeft = 0;
// Reading patterns
- for (UINT iPat=0; iPat<patnum; iPat++)
+ for (UINT iPat = 0; iPat < patnum; iPat++)
{
- UINT nInd = ((DWORD)ptr[nins+iPat]) << 4;
- if (nInd + 0x40 > dwMemLength) continue;
- WORD len = LittleEndianW(*((WORD *)(lpStream+nInd)));
+ bool fail = Patterns.Insert(iPat, 64);
+ UINT nInd = ((DWORD)patpos[iPat]) * 16;
+ if (nInd == 0 || nInd + 0x40 > dwMemLength) continue;
+ WORD len = LittleEndianW(*((WORD *)(lpStream + nInd)));
nInd += 2;
- bool fail = Patterns.Insert(iPat, 64);
if ((!len) || (nInd + len > dwMemLength - 6)
|| (fail) ) continue;
LPBYTE src = (LPBYTE)(lpStream+nInd);
@@ -426,7 +432,7 @@
UINT chn = b & 0x1F;
if (chn < m_nChannels)
{
- MODCOMMAND *m = &p[row*m_nChannels+chn];
+ MODCOMMAND *m = &p[row * m_nChannels + chn];
if (b & 0x20)
{
if(j + nInd + 2 >= dwMemLength) break;
@@ -498,15 +504,15 @@
}
// Reading samples
- for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (insfile[iRaw - 1]))
+ for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (smpdatapos[iRaw - 1]))
{
UINT flags = (psfh.version == 1) ? RS_PCM8S : RS_PCM8U;
if (insflags[iRaw-1] & 4) flags += 5;
if (insflags[iRaw-1] & 2) flags |= RSF_STEREO;
if (inspack[iRaw-1] == 4) flags = RS_ADPCM4;
- if(insfile[iRaw - 1] < dwMemLength)
+ if(smpdatapos[iRaw - 1] < dwMemLength)
{
- dwMemPos = insfile[iRaw - 1];
+ dwMemPos = smpdatapos[iRaw - 1];
}
if(dwMemPos < dwMemLength)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-07 16:33:33
|
Revision: 812
http://modplug.svn.sourceforge.net/modplug/?rev=812&view=rev
Author: saga-games
Date: 2011-03-07 16:33:26 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
[Fix] Made changes to song length detection code so that global variables aren't reset when looping a subsong in "no loop" mode.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-07 16:33:26 UTC (rev 812)
@@ -1615,7 +1615,7 @@
if (wsdlg.m_bSelectPlay)
{
m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder);
- m_SndFile.GetLength(true, wsdlg.m_nMinOrder, 0); // adjust playback variables / visited rows vector
+ m_SndFile.GetLength(eAdjust, wsdlg.m_nMinOrder, 0); // adjust playback variables / visited rows vector
m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder;
m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1;
}
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-07 16:33:26 UTC (rev 812)
@@ -1281,7 +1281,7 @@
//---------------------------------
{
bool result = false;
- GetLengthType length = m_SndFile.GetLength(false);
+ GetLengthType length = m_SndFile.GetLength(eNoAdjust);
if(length.endOrder != ORDERINDEX_INVALID && length.endRow != ROWINDEX_INVALID)
{
result = m_SndFile.TryWriteEffect(m_SndFile.Order[length.endOrder], length.endRow, CMD_POSITIONJUMP, m_SndFile.m_nRestartPos, false, CHANNELINDEX_INVALID, false, true);
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-07 16:33:26 UTC (rev 812)
@@ -75,7 +75,7 @@
// Get mod length in various cases. Parameters:
-// [in] bAdjust: If enabled, the mod parameters (such as global volume, speed, tempo, etc...) will be memorized (if the target has been reached) when leaving the function (i.e. they won't be reset to the previous values)
+// [in] adjustMode: See enmGetLengthResetMode for possible adjust modes.
// [in] endOrder: Order which should be reached (ORDERINDEX_INVALID means whole song)
// [in] endRow: Row in that order that should be reached
// [out] duration: total time in seconds
@@ -84,8 +84,8 @@
// [out] lastRow: last parsed row (dito)
// [out] endOrder: last order before module loops (UNDEFINED if a target is specified)
// [out] endRow: last row before module loops (dito)
-GetLengthType CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow)
-//-------------------------------------------------------------------------------------
+GetLengthType CSoundFile::GetLength(enmGetLengthResetMode adjustMode, ORDERINDEX endOrder, ROWINDEX endRow)
+//---------------------------------------------------------------------------------------------------------
{
GetLengthType retval;
retval.duration = 0.0;
@@ -219,7 +219,7 @@
if(!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM))
nNextRow = 0;
- if (bAdjust)
+ if ((adjustMode & eAdjust))
{
pChn->nPatternLoopCount = 0;
pChn->nPatternLoop = 0;
@@ -247,7 +247,7 @@
{
nNextPattern = nCurrentPattern + 1;
}
- if (bAdjust)
+ if ((adjustMode & eAdjust))
{
pChn->nPatternLoopCount = 0;
pChn->nPatternLoop = 0;
@@ -264,7 +264,7 @@
break;
// Set Tempo
case CMD_TEMPO:
- if ((bAdjust) && (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)))
+ if ((adjustMode & eAdjust) && (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)))
{
if (param) pChn->nOldTempo = (BYTE)param; else param = pChn->nOldTempo;
}
@@ -310,7 +310,7 @@
if (((param & 0xF0) == 0xA0) && !IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nOldHiOffset = param & 0x0F;
break;
}
- if (!bAdjust) continue;
+ if ((adjustMode & eAdjust) == 0) continue;
switch(command)
{
// Portamento Up/Down
@@ -434,7 +434,7 @@
retval.duration = dElapsedTime / 1000.0;
// Store final variables
- if (bAdjust)
+ if ((adjustMode & eAdjust))
{
if (retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID)
{
@@ -454,7 +454,7 @@
Chn[n].nVolume = vols[n] * 4;
}
}
- } else
+ } else if(adjustMode != eAdjustOnSuccess)
{
// Target not found (f.e. when jumping to a hidden sub song), reset global variables...
m_nMusicSpeed = m_nDefaultSpeed;
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-07 16:33:26 UTC (rev 812)
@@ -3059,7 +3059,7 @@
double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool updateVars)
//---------------------------------------------------------------------------------
{
- const GetLengthType t = GetLength(updateVars, ord, row);
+ const GetLengthType t = GetLength(updateVars ? eAdjust : eNoAdjust, ord, row);
if(t.targetReached) return t.duration;
else return -1; //Given position not found from play sequence.
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-07 16:33:26 UTC (rev 812)
@@ -498,7 +498,18 @@
ROWINDEX endRow; // last row before module loops (dito)
};
+// Reset mode for GetLength()
+enum enmGetLengthResetMode
+{
+ // Never adjust global variables / mod parameters
+ eNoAdjust = 0x00,
+ // Mod parameters (such as global volume, speed, tempo, etc...) will always be memorized if the target was reached (i.e. they won't be reset to the previous values). If target couldn't be reached, they are reset to their default values.
+ eAdjust = 0x01,
+ // Same as above, but global variables will only be memorized if the target could be reached. This does *NOT* influence the visited rows vector - it will *ALWAYS* be adjusted in this mode.
+ eAdjustOnSuccess = 0x02 | eAdjust,
+};
+
//Note: These are bit indeces. MSF <-> Mod(Specific)Flag.
//If changing these, ChangeModTypeTo() might need modification.
const BYTE MSF_COMPATIBLE_PLAY = 0; //IT/MPT/XM
@@ -705,11 +716,11 @@
//Get modlength in various cases: total length, length to
//specific order&row etc. Return value is in seconds.
- GetLengthType GetLength(bool bAdjust, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID);
+ GetLengthType GetLength(enmGetLengthResetMode adjustMode, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID);
public:
//Returns song length in seconds.
- DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(false).duration + 1.0 : GetLength(false).duration + 0.5); }
+ DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(eNoAdjust).duration + 1.0 : GetLength(eNoAdjust).duration + 0.5); }
// A repeat count value of -1 means infinite loop
void SetRepeatCount(int n) { m_nRepeatCount = n; }
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-07 14:58:28 UTC (rev 811)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-07 16:33:26 UTC (rev 812)
@@ -788,7 +788,7 @@
#ifdef MODPLUG_TRACKER
// Let's check again if this really is the end of the song.
// The visited rows vector might have been screwed up while editing...
- GetLengthType t = GetLength(false);
+ GetLengthType t = GetLength(eNoAdjust);
if(t.lastOrder == m_nCurrentPattern && t.lastRow == m_nRow)
#endif // MODPLUG_TRACKER
{
@@ -798,7 +798,7 @@
} else
{
// Ok, this is really dirty, but we have to update the visited rows vector...
- GetLength(true, m_nCurrentPattern, m_nRow);
+ GetLength(eAdjustOnSuccess, m_nCurrentPattern, m_nRow);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-07 14:58:35
|
Revision: 811
http://modplug.svn.sourceforge.net/modplug/?rev=811&view=rev
Author: saga-games
Date: 2011-03-07 14:58:28 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
[Mod] Code should now also compile without having the DirectX SDK installed by defining NO_DSOUND in StdAfx.h (since I have the SDK installed, I cannot tell at the moment if it will actually compile, but it should in theory)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Stdafx.h
trunk/OpenMPT/soundlib/SNDDEVX.H
trunk/OpenMPT/soundlib/Snddev.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 00:51:43 UTC (rev 810)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 14:58:28 UTC (rev 811)
@@ -187,7 +187,11 @@
DWORD CMainFrame::m_nBitsPerSample = 16;
DWORD CMainFrame::m_nPreAmp = 128;
DWORD CMainFrame::gbLoopSong = TRUE;
+#ifndef NO_DSOUND
LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND);
+#else
+LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT);
+#endif // NO_DSOUND
LONG CMainFrame::m_nMidiDevice = 0;
DWORD CMainFrame::m_nBufferLength = 75;
LONG CMainFrame::gnLVuMeter = 0;
@@ -412,12 +416,16 @@
rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile);
}
- DWORD defaultDevice = SNDDEV_DSOUND << 8; // first DirectSound device
+#ifndef NO_DSOUND
+ DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); // first DirectSound device
+#else
+ DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first DirectSound device
+#endif // NO_DSOUND
#ifndef NO_ASIO
// If there's an ASIO device available, prefer it over DirectSound
if(EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0))
{
- defaultDevice = SNDDEV_ASIO << 8;
+ defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_ASIO);
}
#endif // NO_ASIO
m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", defaultDevice, iniFile);
@@ -707,6 +715,9 @@
#ifdef NO_ASIO
title += " NO_ASIO";
#endif
+ #ifdef NO_DSOUND
+ title += " NO_DSOUND";
+ #endif
SetTitle(title);
OnUpdateFrameTitle(false);
Modified: trunk/OpenMPT/mptrack/Stdafx.h
===================================================================
--- trunk/OpenMPT/mptrack/Stdafx.h 2011-03-07 00:51:43 UTC (rev 810)
+++ trunk/OpenMPT/mptrack/Stdafx.h 2011-03-07 14:58:28 UTC (rev 811)
@@ -88,7 +88,10 @@
// Define to build without MO3 support.
//#define NO_MO3_SUPPORT
+// Define to build without DirectSound support.
+//#define NO_DSOUND
+
void Log(LPCSTR format,...);
#include "typedefs.h"
Modified: trunk/OpenMPT/soundlib/SNDDEVX.H
===================================================================
--- trunk/OpenMPT/soundlib/SNDDEVX.H 2011-03-07 00:51:43 UTC (rev 810)
+++ trunk/OpenMPT/soundlib/SNDDEVX.H 2011-03-07 14:58:28 UTC (rev 811)
@@ -2,7 +2,10 @@
#define _SNDDEVX_H_
#include <mmsystem.h>
+
+#ifndef NO_DSOUND
#include <dsound.h>
+#endif
#ifndef NO_ASIO
#include <iasiodrv.h>
@@ -50,11 +53,14 @@
static BOOL EnumerateDevices(UINT nIndex, LPSTR pszDescription, UINT cbSize);
};
+
////////////////////////////////////////////////////////////////////////////////////
//
// DirectSound device
//
+#ifndef NO_DSOUND
+
//======================================
class CDSoundDevice: public ISoundDevice
//======================================
@@ -89,7 +95,9 @@
static BOOL EnumerateDevices(UINT nIndex, LPSTR pszDescription, UINT cbSize);
};
+#endif // NO_DIRECTSOUND
+
////////////////////////////////////////////////////////////////////////////////////
//
// ASIO device
@@ -165,6 +173,7 @@
#endif // NO_ASIO
+
////////////////////////////////////////////////////////////////////////////////////
#endif // _SNDDEVX_H_
Modified: trunk/OpenMPT/soundlib/Snddev.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snddev.cpp 2011-03-07 00:51:43 UTC (rev 810)
+++ trunk/OpenMPT/soundlib/Snddev.cpp 2011-03-07 14:58:28 UTC (rev 811)
@@ -253,6 +253,8 @@
// DirectSound device
//
+#ifndef NO_DSOUND
+
#ifndef DSBCAPS_GLOBALFOCUS
#define DSBCAPS_GLOBALFOCUS 0x8000
#endif
@@ -537,7 +539,9 @@
return TRUE;
}
+#endif // NO_DIRECTSOUND
+
///////////////////////////////////////////////////////////////////////////////////////
//
// ASIO Device implementation
@@ -1378,10 +1382,12 @@
switch(nType)
{
case SNDDEV_WAVEOUT: return CWaveDevice::EnumerateDevices(nIndex, pszDesc, cbSize);
+#ifndef NO_DSOUND
case SNDDEV_DSOUND: return CDSoundDevice::EnumerateDevices(nIndex, pszDesc, cbSize);
+#endif // NO_DIRECTSOUND
#ifndef NO_ASIO
case SNDDEV_ASIO: return CASIODevice::EnumerateDevices(nIndex, pszDesc, cbSize);
-#endif
+#endif // NO_ASIO
}
return FALSE;
}
@@ -1394,10 +1400,12 @@
switch(nType)
{
case SNDDEV_WAVEOUT: *ppsd = new CWaveDevice(); break;
+#ifndef NO_DSOUND
case SNDDEV_DSOUND: *ppsd = new CDSoundDevice(); break;
+#endif // NO_DIRECTSOUND
#ifndef NO_ASIO
case SNDDEV_ASIO: *ppsd = new CASIODevice(); break;
-#endif
+#endif // NO_ASIO
}
return (*ppsd) ? TRUE : FALSE;
}
@@ -1406,12 +1414,14 @@
BOOL SndDevInitialize()
//---------------------
{
+#ifndef NO_DSOUND
if (ghDSoundDLL) return TRUE;
if ((ghDSoundDLL = LoadLibrary("dsound.dll")) == NULL) return FALSE;
static_assert(sizeof(TCHAR) == 1, "Check DirectSoundEnumerateA below");
if ((gpDSoundEnumerate = (LPDSOUNDENUMERATE)GetProcAddress(ghDSoundDLL, "DirectSoundEnumerateA")) == NULL) return FALSE;
if ((gpDSoundCreate = (LPDSOUNDCREATE)GetProcAddress(ghDSoundDLL, "DirectSoundCreate")) == NULL) return FALSE;
RtlZeroMemory(glpDSoundGUID, sizeof(glpDSoundGUID));
+#endif // NO_DIRECTSOUND
return TRUE;
}
@@ -1419,6 +1429,7 @@
BOOL SndDevUninitialize()
//-----------------------
{
+#ifndef NO_DSOUND
gpDSoundEnumerate = NULL;
gpDSoundCreate = NULL;
if (ghDSoundDLL)
@@ -1436,6 +1447,7 @@
}
gbDSoundEnumerated = FALSE;
gnDSoundDevices = 0;
+#endif // NO_DIRECTSOUND
return TRUE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-07 00:51:50
|
Revision: 810
http://modplug.svn.sourceforge.net/modplug/?rev=810&view=rev
Author: saga-games
Date: 2011-03-07 00:51:43 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
[New] Sample Editor: There's a new tool to create seamless sample loops: The loop crossfader. Includes a new keyboard shortcut.
[Mod] OpenMPT: Version is now 1.19.00.28
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
trunk/OpenMPT/mptrack/SampleEditorDialogs.h
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/mptrack.rc
trunk/OpenMPT/mptrack/res/patterns.bmp
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
trunk/OpenMPT/soundlib/modsmp_ctrl.h
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-07 00:51:43 UTC (rev 810)
@@ -603,6 +603,7 @@
DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index"));
DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History"));
DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade"));
+ DefineKeyCommand(kcSampleXFade, 1857, kcVisible, kcNoDummy, _T("Crossfade sample loop"));
// Add new key commands here.
#ifdef _DEBUG
@@ -1550,7 +1551,13 @@
CString err;
if (errorCount < 10)
{
- err.Format("Line %d was not understood.", l);
+ if(spos == -1)
+ {
+ err.Format("Line %d was not understood.", l);
+ } else
+ {
+ err.Format("Line %d contained an unknown command.", l);
+ }
errText += err + "\n";
Log(err);
} else if (errorCount == 10)
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -612,7 +612,8 @@
kcSampleSignUnsign,
kcSampleRemoveDCOffset,
kcSampleQuickFade,
- kcEndSampleEditing=kcSampleQuickFade,
+ kcSampleXFade,
+ kcEndSampleEditing=kcSampleXFade,
//kcSampStartNotes to kcInsNoteMapEndNoteStops must be contiguous.
kcSampStartNotes,
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-07 00:51:43 UTC (rev 810)
@@ -71,6 +71,7 @@
ON_COMMAND(IDC_SAMPLE_INVERT, OnInvert)
ON_COMMAND(IDC_SAMPLE_SIGN_UNSIGN, OnSignUnSign)
ON_COMMAND(IDC_SAMPLE_DCOFFSET, OnRemoveDCOffset)
+ ON_COMMAND(IDC_SAMPLE_XFADE, OnXFade)
ON_COMMAND(IDC_CHECK1, OnSetPanningChanged)
ON_COMMAND(ID_PREVINSTRUMENT, OnPrevInstrument)
ON_COMMAND(ID_NEXTINSTRUMENT, OnNextInstrument)
@@ -213,13 +214,16 @@
m_ToolBar2.AddButton(IDC_SAMPLE_SILENCE, TIMAGE_SAMPLE_SILENCE);
m_ToolBar2.AddButton(IDC_SAMPLE_INVERT, TIMAGE_SAMPLE_INVERT);
m_ToolBar2.AddButton(IDC_SAMPLE_SIGN_UNSIGN, TIMAGE_SAMPLE_UNSIGN);
+ m_ToolBar2.AddButton(IDC_SAMPLE_XFADE, TIMAGE_SAMPLE_FIXLOOP);
// Setup Controls
m_SpinVolume.SetRange(0, 64);
m_SpinGlobalVol.SetRange(0, 64);
//rewbs.fix36944
- if (m_pSndFile->m_nType == MOD_TYPE_XM) {
+ if (m_pSndFile->m_nType == MOD_TYPE_XM)
+ {
m_SpinPanning.SetRange(0, 255);
- } else {
+ } else
+ {
m_SpinPanning.SetRange(0, 64);
}
//end rewbs.fix36944
@@ -460,6 +464,9 @@
OnInvert();
break;
+ case IDC_SAMPLE_XFADE:
+ OnXFade();
+
case IDC_SAMPLE_SIGN_UNSIGN:
OnSignUnSign();
break;
@@ -3102,3 +3109,49 @@
viewstate.dwEndSel = nEnd;
SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate);
}
+
+
+// Crossfade loop to create smooth loop transitions
+#define DEFAULT_XFADE_LENGTH 16384 //4096
+#define LimitXFadeLength(x) min(min(x, pSmp->nLoopEnd - pSmp->nLoopStart), pSmp->nLoopEnd / 2)
+
+void CCtrlSamples::OnXFade()
+//--------------------------
+{
+ static UINT nFadeLength = DEFAULT_XFADE_LENGTH;
+ MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample];
+
+ if(pSmp->pSample == nullptr) return;
+ if(pSmp->nLoopEnd <= pSmp->nLoopStart || pSmp->nLoopEnd > pSmp->nLength) return;
+ // Case 1: The loop start is preceeded by > XFADE_LENGTH samples. Nothing has to be adjusted.
+ // Case 2: The actual loop is shorter than XFADE_LENGTH samples.
+ // Case 3: There is not enough sample material before the loop start. Move the loop start.
+ nFadeLength = LimitXFadeLength(nFadeLength);
+
+ CSampleXFadeDlg dlg(this, nFadeLength, LimitXFadeLength(GetDocument()->GetSoundFile()->Samples[m_nSample].nLength));
+ if(dlg.DoModal() == IDOK)
+ {
+ nFadeLength = dlg.m_nSamples;
+
+ if(nFadeLength < 4) return;
+
+ m_pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_update, pSmp->nLoopEnd - nFadeLength, pSmp->nLoopEnd);
+ // If we want to fade nFadeLength bytes, we need as much sample material before the loop point. nFadeLength has been adjusted above.
+ if(pSmp->nLoopStart < nFadeLength)
+ {
+ pSmp->nLoopStart = nFadeLength;
+ }
+
+ if(ctrlSmp::XFadeSample(pSmp, nFadeLength, m_pSndFile))
+ {
+ m_pModDoc->AdjustEndOfSample(m_nSample);
+ m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL);
+ m_pModDoc->SetModified();
+ } else
+ {
+ m_pModDoc->GetSampleUndo()->RemoveLastUndoStep(m_nSample);
+ }
+
+ }
+}
+
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -108,6 +108,7 @@
afx_msg void OnVibDepthChanged();
afx_msg void OnVibSweepChanged();
afx_msg void OnVibRateChanged();
+ afx_msg void OnXFade();
afx_msg void OnVScroll(UINT, UINT, CScrollBar *);
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -285,6 +285,7 @@
TIMAGE_SAMPLE_UNSIGN,
TIMAGE_SAMPLE_DCOFFSET,
TIMAGE_PATTERN_OVERFLOWPASTE,
+ TIMAGE_SAMPLE_FIXLOOP,
};
Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-03-07 00:51:43 UTC (rev 810)
@@ -170,3 +170,37 @@
CDialog::OnOK();
}
+
+/////////////////////////////////////////////////////////////////////////
+// Sample cross-fade dialog
+
+void CSampleXFadeDlg::DoDataExchange(CDataExchange* pDX)
+//------------------------------------------------------
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CSampleGridDlg)
+ DDX_Control(pDX, IDC_EDIT1, m_EditSamples);
+ DDX_Control(pDX, IDC_SPIN1, m_SpinSamples);
+ //}}AFX_DATA_MAP
+}
+
+
+BOOL CSampleXFadeDlg::OnInitDialog()
+//----------------------------------
+{
+ CDialog::OnInitDialog();
+ m_SpinSamples.SetRange32(0, m_nMaxSamples);
+ m_SpinSamples.SetPos(m_nSamples);
+ SetDlgItemInt(IDC_EDIT1, m_nSamples, FALSE);
+ GetDlgItem(IDC_EDIT1)->SetFocus();
+ return TRUE;
+}
+
+
+void CSampleXFadeDlg::OnOK()
+//--------------------------
+{
+ m_nSamples = GetDlgItemInt(IDC_EDIT1, NULL, FALSE);
+ CDialog::OnOK();
+}
+
Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.h
===================================================================
--- trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -96,4 +96,29 @@
virtual void OnOK();
};
+
+/////////////////////////////////////////////////////////////////////////
+// Sample cross-fade dialog
+
+//===================================
+class CSampleXFadeDlg: public CDialog
+//===================================
+{
+public:
+ UINT m_nSamples, m_nMaxSamples;
+
+protected:
+ CEdit m_EditSamples;
+ CSpinButtonCtrl m_SpinSamples;
+
+public:
+ CSampleXFadeDlg(CWnd *parent, UINT nSamples, UINT nMaxSamples) : CDialog(IDD_SAMPLE_XFADE, parent) { m_nSamples = nSamples; m_nMaxSamples = nMaxSamples; };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX);
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+};
+
+
#endif
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-07 00:51:43 UTC (rev 810)
@@ -2646,6 +2646,7 @@
case kcSampleInvert: PostCtrlMessage(IDC_SAMPLE_INVERT); return wParam;
case kcSampleSignUnsign: PostCtrlMessage(IDC_SAMPLE_SIGN_UNSIGN); return wParam;
case kcSampleRemoveDCOffset: PostCtrlMessage(IDC_SAMPLE_DCOFFSET); return wParam;
+ case kcSampleXFade: PostCtrlMessage(IDC_SAMPLE_XFADE); return wParam;
case kcSampleQuickFade: PostCtrlMessage(IDC_SAMPLE_QUICKFADE); return wParam;
// Those don't seem to work.
Modified: trunk/OpenMPT/mptrack/mptrack.rc
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 00:51:43 UTC (rev 810)
@@ -173,7 +173,20 @@
LTEXT "Grid Segments:",IDC_STATIC,6,8,60,8
END
+IDD_SAMPLE_XFADE DIALOGEX 0, 0, 178, 82
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Sample Crossfader"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,66,60,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,120,60,50,14
+ EDITTEXT IDC_EDIT1,108,6,54,12,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,144,6,11,14
+ LTEXT "Higher numbers generate smoother loop transitions. However, the number is limited by the loop length and the amount of samples before the loop start.",IDC_STATIC,6,24,168,36
+ LTEXT "Samples used for fading:",IDC_STATIC,6,8,96,8
+END
+
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@@ -245,6 +258,14 @@
TOPMARGIN, 7
BOTTOMMARGIN, 64
END
+
+ IDD_SAMPLE_XFADE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 171
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 75
+ END
END
#endif // APSTUDIO_INVOKED
@@ -723,7 +744,7 @@
CTEXT "Resampling",IDC_STATIC,7,151,39,13,SS_CENTERIMAGE,WS_EX_STATICEDGE
CONTROL "Highpass",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,181,19,45,10
CTEXT "Mode",IDC_STATIC,135,70,23,13,SS_CENTERIMAGE,WS_EX_STATICEDGE
- RTEXT "--",IDC_TEXT1,204,62,27,8
+ RTEXT "--",IDC_TEXT1,186,62,45,8
GROUPBOX "Pitch/Tempo Lock",IDC_STATIC,364,57,89,25
GROUPBOX "Sample Map",IDC_STATIC,461,27,62,141
CTEXT "Velocity handling",IDC_STATIC,367,102,83,10,SS_CENTERIMAGE,WS_EX_STATICEDGE
@@ -1309,7 +1330,7 @@
END
IDD_PLUGINEDITOR DIALOGEX 0, 0, 187, 95
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
CAPTION "Editor"
MENU IDR_PLUGINMENU
@@ -2455,6 +2476,11 @@
ID_VIEW_SONGPROPERTIES "Edit global song properties or convert the module to another format"
END
+STRINGTABLE
+BEGIN
+ IDC_SAMPLE_XFADE "Crossfade Loop Points\nCrossfade between loop start and loop end to create seamless sample loops."
+END
+
#endif // Englisch (USA) resources
/////////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/mptrack/res/patterns.bmp
===================================================================
(Binary files differ)
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/resource.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -137,6 +137,7 @@
#define IDD_SAMPLE_GENERATOR_PRESETS 525
#define IDD_EDITHISTORY 526
#define IDD_SAMPLE_GRID_SIZE 527
+#define IDD_SAMPLE_XFADE 528
#define IDC_BUTTON1 1001
#define IDC_BUTTON2 1002
#define IDC_BUTTON3 1003
@@ -928,6 +929,7 @@
#define IDC_TOTAL_EDIT_TIME 2431
#define IDC_EDIT_HISTORY 2432
#define IDC_SAMPLE_QUICKFADE 2433
+#define IDC_SAMPLE_XFADE 2434
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1195,9 +1197,9 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 528
+#define _APS_NEXT_RESOURCE_VALUE 529
#define _APS_NEXT_COMMAND_VALUE 60455
-#define _APS_NEXT_CONTROL_VALUE 2434
+#define _APS_NEXT_CONTROL_VALUE 2435
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/mptrack/version.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 27
+#define VER_MINORMINOR 28
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-03-07 00:51:43 UTC (rev 810)
@@ -37,7 +37,7 @@
SmpLength InsertSilence(MODSAMPLE& smp, const SmpLength nSilenceLength, const SmpLength nStartFrom, CSoundFile* pSndFile)
-//----------------------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------------
{
if(nSilenceLength == 0 || nSilenceLength >= MAX_SAMPLE_LENGTH || smp.nLength > MAX_SAMPLE_LENGTH - nSilenceLength)
return smp.nLength;
@@ -92,7 +92,7 @@
}
SmpLength ResizeSample(MODSAMPLE& smp, const SmpLength nNewLength, CSoundFile* pSndFile)
-//----------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
{
// Invalid sample size
if(nNewLength > MAX_SAMPLE_LENGTH || nNewLength == smp.nLength)
@@ -139,7 +139,7 @@
template <class T>
void AdjustEndOfSampleImpl(MODSAMPLE& smp)
-//--------------------------------------------
+//----------------------------------------
{
MODSAMPLE* const pSmp = &smp;
const UINT len = pSmp->nLength;
@@ -168,7 +168,7 @@
bool AdjustEndOfSample(MODSAMPLE& smp, CSoundFile* pSndFile)
-//--------------------------------------------------------------
+//----------------------------------------------------------
{
MODSAMPLE* const pSmp = &smp;
@@ -477,6 +477,43 @@
}
+template <class T>
+void XFadeSampleImpl(T* pStart, const SmpLength nOffset, SmpLength nFadeLength)
+//-----------------------------------------------------------------------------
+{
+ for(SmpLength i = 0; i <= nFadeLength; i++)
+ {
+ double dPercentage = sqrt((double)i / (double)nFadeLength); // linear fades are boring
+ pStart[nOffset + i] = (T)(((double)pStart[nOffset + i]) * (1 - dPercentage) + ((double)pStart[i]) * dPercentage);
+ }
+}
+
+// X-Fade sample data to create smooth loop transitions
+bool XFadeSample(MODSAMPLE *pSmp, SmpLength iFadeLength, CSoundFile *pSndFile)
+//----------------------------------------------------------------------------
+{
+ if(pSmp->pSample == nullptr) return false;
+ if(pSmp->nLoopEnd <= pSmp->nLoopStart || pSmp->nLoopEnd > pSmp->nLength) return false;
+ if(pSmp->nLoopStart < iFadeLength) return false;
+
+ SmpLength iStart = pSmp->nLoopStart - iFadeLength;
+ SmpLength iEnd = pSmp->nLoopEnd - iFadeLength;
+ iStart *= pSmp->GetNumChannels();
+ iEnd *= pSmp->GetNumChannels();
+ iFadeLength *= pSmp->GetNumChannels();
+
+ if(pSmp->GetElementarySampleSize() == 2)
+ XFadeSampleImpl(reinterpret_cast<int16*>(pSmp->pSample) + iStart, iEnd - iStart, iFadeLength);
+ else if(pSmp->GetElementarySampleSize() == 1)
+ XFadeSampleImpl(reinterpret_cast<int8*>(pSmp->pSample) + iStart, iEnd - iStart, iFadeLength);
+ else
+ return false;
+
+ AdjustEndOfSample(*pSmp, pSndFile);
+ return true;
+}
+
+
} // namespace ctrlSmp
Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.h
===================================================================
--- trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-03-07 00:21:50 UTC (rev 809)
+++ trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-03-07 00:51:43 UTC (rev 810)
@@ -62,6 +62,9 @@
// Invert sample data (flip by 180 degrees)
bool InvertSample(MODSAMPLE *pSmp, SmpLength iStart, SmpLength iEnd, CSoundFile *pSndFile);
+// Crossfade sample data to create smooth loops
+bool XFadeSample(MODSAMPLE *pSmp, SmpLength iFadeLength, CSoundFile *pSndFile);
+
} // Namespace ctrlSmp
namespace ctrlChn
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-07 00:22:00
|
Revision: 809
http://modplug.svn.sourceforge.net/modplug/?rev=809&view=rev
Author: saga-games
Date: 2011-03-07 00:21:50 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
[Ref] Moved code of various dialogs from dlg_misc.cpp to PatternEditorDialogs.cpp and SampleEditorDialogs.cpp (new files).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_pat.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/mptrack/dlg_misc.h
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/mptrack_08.vcproj
Added Paths:
-----------
trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
trunk/OpenMPT/mptrack/PatternEditorDialogs.h
trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
trunk/OpenMPT/mptrack/SampleEditorDialogs.h
Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-04 18:00:36 UTC (rev 808)
+++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-07 00:21:50 UTC (rev 809)
@@ -4,7 +4,7 @@
#include "childfrm.h"
#include "moddoc.h"
#include "globals.h"
-#include "dlg_misc.h"
+#include "PatternEditorDialogs.h"
#include "ctrl_pat.h"
#include "view_pat.h"
#include "ChannelManagerDlg.h"
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-04 18:00:36 UTC (rev 808)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-07 00:21:50 UTC (rev 809)
@@ -6,6 +6,7 @@
#include "globals.h"
#include "ctrl_smp.h"
#include "view_smp.h"
+#include "SampleEditorDialogs.h"
#include "dlg_misc.h"
#include "PSRatioCalc.h" //rewbs.timeStretchMods
#include "mpdlgs.h"
Added: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp (rev 0)
+++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-03-07 00:21:50 UTC (rev 809)
@@ -0,0 +1,1508 @@
+/*
+ *
+ * PatternEditorDialogs.cpp
+ * ------------------------
+ * Purpose: Code for various dialogs that are used in the pattern editor
+ * Notes : (currently none)
+ * Authors: Olivier Lapicque
+ * OpenMPT Devs
+ *
+ */
+
+#include "stdafx.h"
+#include "mptrack.h"
+#include "Mainfrm.h"
+#include "PatternEditorDialogs.h"
+
+
+// -> CODE#0010
+// -> DESC="add extended parameter mechanism to pattern effects"
+void getXParam(BYTE command, UINT nPat, UINT nRow, UINT nChannel, CSoundFile *pSndFile, UINT * xparam, UINT * multiplier)
+{
+ if(xparam == NULL || multiplier == NULL) return;
+
+ MODCOMMAND mca = MODCOMMAND::Empty();
+ UINT i,xp = 0, ml = 1;
+ int nCmdRow = (int)nRow;
+
+ // If the current command is a parameter extension command
+ if(command == CMD_XPARAM){
+
+ nCmdRow--;
+
+ // Try to find previous command parameter to be extended
+ while(nCmdRow >= 0){
+ i = nCmdRow * pSndFile->m_nChannels + nChannel;
+ mca = pSndFile->Patterns[nPat][i];
+ if(mca.command == CMD_OFFSET || mca.command == CMD_PATTERNBREAK || mca.command == CMD_PATTERNBREAK)
+ break;
+ if(mca.command != CMD_XPARAM){
+ nCmdRow = -1;
+ break;
+ }
+ nCmdRow--;
+ }
+ }
+ // Else if current row do not own any satisfying command parameter to extend, set return state
+ else if(command != CMD_OFFSET && command != CMD_PATTERNBREAK && command != CMD_TEMPO) nCmdRow = -1;
+
+ // If an 'extendable' command parameter has been found,
+ if(nCmdRow >= 0){
+ i = nCmdRow * pSndFile->m_nChannels + nChannel;
+ mca = pSndFile->Patterns[nPat][i];
+
+ // Find extension resolution (8 to 24 bits)
+ UINT n = 1;
+ while(n < 4 && nCmdRow+n < pSndFile->Patterns[nPat].GetNumRows()){
+ i = (nCmdRow+n) * pSndFile->m_nChannels + nChannel;
+ if(pSndFile->Patterns[nPat][i].command != CMD_XPARAM) break;
+ n++;
+ }
+
+ // Parameter extension found (above 8 bits non-standard parameters)
+ if(n > 1){
+ // Limit offset command to 24 bits, other commands to 16 bits
+ n = mca.command == CMD_OFFSET ? n : (n > 2 ? 2 : n);
+
+ // Compute extended value WITHOUT current row parameter value : this parameter
+ // is being currently edited (this is why this function is being called) so we
+ // only need to compute a multiplier so that we can add its contribution while
+ // its value is changed by user
+ for(UINT j = 0 ; j < n ; j++){
+ i = (nCmdRow+j) * pSndFile->m_nChannels + nChannel;
+ mca = pSndFile->Patterns[nPat][i];
+
+ UINT k = 8*(n-j-1);
+ if(nCmdRow+j == nRow) ml = 1<<k;
+ else xp += (mca.param<<k);
+ }
+ }
+ // No parameter extension to perform (8 bits standard parameter),
+ // just care about offset command special case (16 bits, fake)
+ else if(mca.command == CMD_OFFSET) ml <<= 8;
+ }
+
+ // Return x-parameter
+ *multiplier = ml;
+ *xparam = xp;
+}
+// -! NEW_FEATURE#0010
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// Find/Replace Dialog
+
+BEGIN_MESSAGE_MAP(CFindReplaceTab, CPropertyPage)
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnNoteChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO2, OnInstrChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO3, OnVolCmdChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO4, OnVolumeChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO5, OnEffectChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO6, OnParamChanged)
+ ON_COMMAND(IDC_CHECK1, OnCheckNote)
+ ON_COMMAND(IDC_CHECK2, OnCheckInstr)
+ ON_COMMAND(IDC_CHECK3, OnCheckVolCmd)
+ ON_COMMAND(IDC_CHECK4, OnCheckVolume)
+ ON_COMMAND(IDC_CHECK5, OnCheckEffect)
+ ON_COMMAND(IDC_CHECK6, OnCheckParam)
+
+ ON_COMMAND(IDC_CHECK7, OnCheckChannelSearch)
+END_MESSAGE_MAP()
+
+
+BOOL CFindReplaceTab::OnInitDialog()
+//----------------------------------
+{
+ CHAR s[256];
+ CComboBox *combo;
+ CSoundFile *pSndFile;
+
+ CPropertyPage::OnInitDialog();
+ if (!m_pModDoc) return TRUE;
+ pSndFile = m_pModDoc->GetSoundFile();
+ // Search flags
+ if (m_dwFlags & PATSEARCH_NOTE) CheckDlgButton(IDC_CHECK1, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_INSTR) CheckDlgButton(IDC_CHECK2, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_VOLCMD) CheckDlgButton(IDC_CHECK3, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_VOLUME) CheckDlgButton(IDC_CHECK4, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_COMMAND) CheckDlgButton(IDC_CHECK5, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_PARAM) CheckDlgButton(IDC_CHECK6, MF_CHECKED);
+ if (m_bReplace)
+ {
+ if (m_dwFlags & PATSEARCH_REPLACE) CheckDlgButton(IDC_CHECK7, MF_CHECKED);
+ if (m_dwFlags & PATSEARCH_REPLACEALL) CheckDlgButton(IDC_CHECK8, MF_CHECKED);
+ } else
+ {
+ if (m_dwFlags & PATSEARCH_CHANNEL) CheckDlgButton(IDC_CHECK7, MF_CHECKED);
+ int nButton = IDC_RADIO1;
+ if((m_dwFlags & PATSEARCH_FULLSEARCH))
+ {
+ nButton = IDC_RADIO2;
+ } else if(/*(m_dwFlags & PATSEARCH_PATSELECTION) &&*/ m_bPatSel)
+ {
+ nButton = IDC_RADIO3;
+ }
+ CheckRadioButton(IDC_RADIO1, IDC_RADIO3, nButton);
+ GetDlgItem(IDC_RADIO3)->EnableWindow(m_bPatSel ? TRUE : FALSE);
+ SetDlgItemInt(IDC_EDIT1, m_nMinChannel + 1);
+ SetDlgItemInt(IDC_EDIT2, m_nMaxChannel + 1);
+ }
+ // Note
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ combo->InitStorage(150, 6);
+ combo->SetItemData(combo->AddString("..."), 0);
+ if (m_bReplace)
+ {
+ combo->SetItemData(combo->AddString("note-1"), replaceNoteMinusOne);
+ combo->SetItemData(combo->AddString("note+1"), replaceNotePlusOne);
+ combo->SetItemData(combo->AddString("-1 oct"), replaceNoteMinusOctave);
+ combo->SetItemData(combo->AddString("+1 oct"), replaceNotePlusOctave);
+ } else
+ {
+ combo->SetItemData(combo->AddString("any"), findAny);
+ }
+ AppendNotesToControlEx(*combo, pSndFile);
+
+ UINT ncount = combo->GetCount();
+ for (UINT i=0; i<ncount; i++) if (m_nNote == combo->GetItemData(i))
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ // Instrument
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL)
+ {
+ combo->SetItemData(combo->AddString(".."), 0);
+ if (m_bReplace)
+ {
+ combo->SetItemData(combo->AddString("ins-1"), replaceInstrumentMinusOne);
+ combo->SetItemData(combo->AddString("ins+1"), replaceInstrumentPlusOne);
+ }
+ for (UINT n=1; n<MAX_INSTRUMENTS; n++)
+ {
+ if (pSndFile->m_nInstruments)
+ {
+ wsprintf(s, "%03d:%s", n, (pSndFile->Instruments[n]) ? (LPCTSTR)pSndFile->GetInstrumentName(n) : "");
+ } else
+ {
+ wsprintf(s, "%03d:%s", n, pSndFile->m_szNames[n]);
+ }
+ combo->SetItemData(combo->AddString(s), n);
+ }
+ UINT ncount = combo->GetCount();
+ for (UINT i=0; i<ncount; i++)
+ {
+ if (m_nInstr == combo->GetItemData(i) || (cInstrRelChange == -1 && combo->GetItemData(i) == replaceInstrumentMinusOne) || (cInstrRelChange == 1 && combo->GetItemData(i) == replaceInstrumentPlusOne))
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ }
+ // Volume Command
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO3)) != NULL)
+ {
+ combo->InitStorage(m_pModDoc->GetNumVolCmds(), 15);
+ combo->SetItemData(combo->AddString(" None"), (DWORD)-1);
+ UINT count = m_pModDoc->GetNumVolCmds();
+ for (UINT n=0; n<count; n++)
+ {
+ m_pModDoc->GetVolCmdInfo(n, s);
+ if (s[0]) combo->SetItemData(combo->AddString(s), n);
+ }
+ combo->SetCurSel(0);
+ UINT fxndx = m_pModDoc->GetIndexFromVolCmd(m_nVolCmd);
+ for (UINT i=0; i<=count; i++) if (fxndx == combo->GetItemData(i))
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ // Volume
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO4)) != NULL)
+ {
+ combo->InitStorage(64, 4);
+ for (UINT n=0; n<=64; n++)
+ {
+ wsprintf(s, "%02d", n);
+ combo->SetItemData(combo->AddString(s), n);
+ }
+ UINT ncount = combo->GetCount();
+ for (UINT i=0; i<ncount; i++) if (m_nVol == combo->GetItemData(i))
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ // Command
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO5)) != NULL)
+ {
+ combo->InitStorage(m_pModDoc->GetNumEffects(), 20);
+ combo->SetItemData(combo->AddString(" None"), (DWORD)-1);
+ UINT count = m_pModDoc->GetNumEffects();
+ for (UINT n=0; n<count; n++)
+ {
+ m_pModDoc->GetEffectInfo(n, s, true);
+ if (s[0]) combo->SetItemData(combo->AddString(s), n);
+ }
+ combo->SetCurSel(0);
+ UINT fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
+ for (UINT i=0; i<=count; i++) if (fxndx == combo->GetItemData(i))
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ ChangeEffect();
+ OnCheckChannelSearch();
+ return TRUE;
+}
+
+
+void CFindReplaceTab::ChangeEffect()
+//----------------------------------
+{
+ int fxndx = -1;
+ CComboBox *combo;
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO5)) != NULL)
+ {
+ fxndx = combo->GetItemData(combo->GetCurSel());
+ }
+ // Update Param range
+ if (((combo = (CComboBox *)GetDlgItem(IDC_COMBO6)) != NULL) && (m_pModDoc))
+ {
+ UINT oldcount = combo->GetCount();
+ UINT newcount = m_pModDoc->IsExtendedEffect(fxndx) ? 16 : 256;
+ if (oldcount != newcount)
+ {
+ CHAR s[16];
+ int newpos;
+ if (oldcount) newpos = combo->GetCurSel() % newcount; else newpos = m_nParam % newcount;
+ combo->ResetContent();
+ for (UINT i=0; i<newcount; i++)
+ {
+ wsprintf(s, (newcount == 256) ? "%02X" : "%X", i);
+ combo->SetItemData(combo->AddString(s), i);
+ }
+ combo->SetCurSel(newpos);
+ }
+ }
+}
+
+
+void CFindReplaceTab::OnCheckChannelSearch()
+//------------------------------------------
+{
+ if (!m_bReplace)
+ {
+ BOOL b = IsDlgButtonChecked(IDC_CHECK7);
+ ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT1), b);
+ ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2), b);
+ }
+}
+
+
+void CFindReplaceTab::OnOK()
+//--------------------------
+{
+ CComboBox *combo;
+
+ // Search flags
+ m_dwFlags = 0;
+ if (IsDlgButtonChecked(IDC_CHECK1)) m_dwFlags |= PATSEARCH_NOTE;
+ if (IsDlgButtonChecked(IDC_CHECK2)) m_dwFlags |= PATSEARCH_INSTR;
+ if (IsDlgButtonChecked(IDC_CHECK3)) m_dwFlags |= PATSEARCH_VOLCMD;
+ if (IsDlgButtonChecked(IDC_CHECK4)) m_dwFlags |= PATSEARCH_VOLUME;
+ if (IsDlgButtonChecked(IDC_CHECK5)) m_dwFlags |= PATSEARCH_COMMAND;
+ if (IsDlgButtonChecked(IDC_CHECK6)) m_dwFlags |= PATSEARCH_PARAM;
+ if (m_bReplace)
+ {
+ if (IsDlgButtonChecked(IDC_CHECK7)) m_dwFlags |= PATSEARCH_REPLACE;
+ if (IsDlgButtonChecked(IDC_CHECK8)) m_dwFlags |= PATSEARCH_REPLACEALL;
+ } else
+ {
+ if (IsDlgButtonChecked(IDC_CHECK7)) m_dwFlags |= PATSEARCH_CHANNEL;
+ if (IsDlgButtonChecked(IDC_RADIO2)) m_dwFlags |= PATSEARCH_FULLSEARCH;
+ if (IsDlgButtonChecked(IDC_RADIO3)) m_dwFlags |= PATSEARCH_PATSELECTION;
+ }
+ // Note
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ m_nNote = combo->GetItemData(combo->GetCurSel());
+ }
+ // Instrument
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL)
+ {
+ m_nInstr = 0;
+ cInstrRelChange = 0;
+ switch(combo->GetItemData(combo->GetCurSel()))
+ {
+ case replaceInstrumentMinusOne:
+ cInstrRelChange = -1;
+ break;
+ case replaceInstrumentPlusOne:
+ cInstrRelChange = 1;
+ break;
+ default:
+ m_nInstr = combo->GetItemData(combo->GetCurSel());
+ break;
+ }
+ }
+ // Volume Command
+ if (((combo = (CComboBox *)GetDlgItem(IDC_COMBO3)) != NULL) && (m_pModDoc))
+ {
+ m_nVolCmd = m_pModDoc->GetVolCmdFromIndex(combo->GetItemData(combo->GetCurSel()));
+ }
+ // Volume
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO4)) != NULL)
+ {
+ m_nVol = combo->GetItemData(combo->GetCurSel());
+ }
+ // Effect
+ int effectIndex = -1;
+ if (((combo = (CComboBox *)GetDlgItem(IDC_COMBO5)) != NULL) && (m_pModDoc))
+ {
+ int n = -1; // unused parameter adjustment
+ effectIndex = combo->GetItemData(combo->GetCurSel());
+ m_nCommand = m_pModDoc->GetEffectFromIndex(effectIndex, n);
+ }
+ // Param
+ m_nParam = 0;
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO6)) != NULL)
+ {
+ m_nParam = combo->GetItemData(combo->GetCurSel());
+
+ // Apply parameter value mask if required (e.g. SDx has mask D0).
+ if (effectIndex > -1)
+ {
+ m_nParam |= m_pModDoc->GetEffectMaskFromIndex(effectIndex);
+ }
+ }
+ // Min/Max channels
+ if (!m_bReplace)
+ {
+ m_nMinChannel = GetDlgItemInt(IDC_EDIT1) - 1;
+ m_nMaxChannel = GetDlgItemInt(IDC_EDIT2) - 1;
+ if (m_nMaxChannel < m_nMinChannel) m_nMaxChannel = m_nMinChannel;
+ }
+ CPropertyPage::OnOK();
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+// CPatternPropertiesDlg
+
+BEGIN_MESSAGE_MAP(CPatternPropertiesDlg, CDialog)
+ ON_COMMAND(IDC_BUTTON_HALF, OnHalfRowNumber)
+ ON_COMMAND(IDC_BUTTON_DOUBLE, OnDoubleRowNumber)
+ ON_COMMAND(IDC_CHECK1, OnOverrideSignature)
+END_MESSAGE_MAP()
+
+BOOL CPatternPropertiesDlg::OnInitDialog()
+//----------------------------------------
+{
+ CComboBox *combo;
+ CDialog::OnInitDialog();
+ combo = (CComboBox *)GetDlgItem(IDC_COMBO1);
+ const CSoundFile *pSndFile = (m_pModDoc) ? m_pModDoc->GetSoundFile() : nullptr;
+ if ((pSndFile) && (m_nPattern < pSndFile->Patterns.Size()) && (combo))
+ {
+ CHAR s[256];
+ UINT nrows = pSndFile->Patterns[m_nPattern].GetNumRows();
+
+ const CModSpecifications& specs = pSndFile->GetModSpecifications();
+ for (UINT irow = specs.patternRowsMin; irow <= specs.patternRowsMax; irow++)
+ {
+ wsprintf(s, "%d", irow);
+ combo->AddString(s);
+ }
+ combo->SetCurSel(nrows - specs.patternRowsMin);
+ wsprintf(s, "Pattern #%d: %d row%s (%dK)",
+ m_nPattern,
+ pSndFile->Patterns[m_nPattern].GetNumRows(),
+ (pSndFile->Patterns[m_nPattern].GetNumRows() == 1) ? "" : "s",
+ (pSndFile->Patterns[m_nPattern].GetNumRows() * pSndFile->m_nChannels * sizeof(MODCOMMAND)) / 1024);
+ SetDlgItemText(IDC_TEXT1, s);
+
+ // Window title
+ CHAR szName[MAX_PATTERNNAME + 2];
+ pSndFile->GetPatternName(m_nPattern, szName, MAX_PATTERNNAME);
+ if(strlen(szName))
+ {
+ strcat(szName, ")");
+ }
+ wsprintf(s, "Pattern Properties for Pattern #%d%s%s", m_nPattern, strlen(szName) ? " (" : "", szName);
+ SetWindowText(s);
+
+ // pattern time signature
+ const bool bOverride = pSndFile->Patterns[m_nPattern].GetOverrideSignature();
+ UINT nRPB = pSndFile->Patterns[m_nPattern].GetRowsPerBeat(), nRPM = pSndFile->Patterns[m_nPattern].GetRowsPerMeasure();
+ if(nRPB == 0 || !bOverride) nRPB = pSndFile->m_nDefaultRowsPerBeat;
+ if(nRPM == 0 || !bOverride) nRPM = pSndFile->m_nDefaultRowsPerMeasure;
+
+ GetDlgItem(IDC_CHECK1)->EnableWindow(pSndFile->GetModSpecifications().hasPatternSignatures ? TRUE : FALSE);
+ CheckDlgButton(IDC_CHECK1, bOverride ? MF_CHECKED : MF_UNCHECKED);
+ SetDlgItemInt(IDC_EDIT_ROWSPERBEAT, nRPB, FALSE);
+ SetDlgItemInt(IDC_EDIT_ROWSPERMEASURE, nRPM, FALSE);
+ OnOverrideSignature();
+ }
+ return TRUE;
+}
+
+
+void CPatternPropertiesDlg::OnHalfRowNumber()
+//-------------------------------------------
+{
+ const CSoundFile *pSndFile = (m_pModDoc) ? m_pModDoc->GetSoundFile() : nullptr;
+ if(pSndFile == nullptr)
+ return;
+
+ UINT nRows = GetDlgItemInt(IDC_COMBO1, NULL, FALSE);
+ nRows /= 2;
+ if(nRows < pSndFile->GetModSpecifications().patternRowsMin)
+ nRows = pSndFile->GetModSpecifications().patternRowsMin;
+ SetDlgItemInt(IDC_COMBO1, nRows, FALSE);
+}
+
+
+void CPatternPropertiesDlg::OnDoubleRowNumber()
+//---------------------------------------------
+{
+ const CSoundFile *pSndFile = (m_pModDoc) ? m_pModDoc->GetSoundFile() : nullptr;
+ if(pSndFile == nullptr)
+ return;
+
+ UINT nRows = GetDlgItemInt(IDC_COMBO1, NULL, FALSE);
+ nRows *= 2;
+ if(nRows > pSndFile->GetModSpecifications().patternRowsMax)
+ nRows = pSndFile->GetModSpecifications().patternRowsMax;
+ SetDlgItemInt(IDC_COMBO1, nRows, FALSE);
+}
+
+
+void CPatternPropertiesDlg::OnOverrideSignature()
+//-----------------------------------------------
+{
+ GetDlgItem(IDC_EDIT_ROWSPERBEAT)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1));
+ GetDlgItem(IDC_EDIT_ROWSPERMEASURE)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1));
+}
+
+
+void CPatternPropertiesDlg::OnOK()
+//--------------------------------
+{
+ CSoundFile *pSndFile = (m_pModDoc) ? m_pModDoc->GetSoundFile() : nullptr;
+ if(pSndFile)
+ {
+ // Update pattern signature if necessary
+ if(pSndFile->GetModSpecifications().hasPatternSignatures)
+ {
+ if(IsDlgButtonChecked(IDC_CHECK1)) // Enable signature
+ {
+ ROWINDEX nNewBeat = (ROWINDEX)GetDlgItemInt(IDC_EDIT_ROWSPERBEAT, NULL, FALSE), nNewMeasure = (ROWINDEX)GetDlgItemInt(IDC_EDIT_ROWSPERMEASURE, NULL, FALSE);
+ if(nNewBeat != pSndFile->Patterns[m_nPattern].GetRowsPerBeat() || nNewMeasure != pSndFile->Patterns[m_nPattern].GetRowsPerMeasure())
+ {
+ if(!pSndFile->Patterns[m_nPattern].SetSignature(nNewBeat, nNewMeasure))
+ {
+ MessageBox("Invalid time signature!", "Pattern Properties", MB_OK|MB_ICONEXCLAMATION);
+ GetDlgItem(IDC_EDIT_ROWSPERBEAT)->SetFocus();
+ return;
+ }
+ m_pModDoc->SetModified();
+ }
+ } else // Disable signature
+ {
+ if(pSndFile->Patterns[m_nPattern].GetOverrideSignature())
+ {
+ pSndFile->Patterns[m_nPattern].RemoveSignature();
+ m_pModDoc->SetModified();
+ }
+ }
+ }
+
+ UINT n = GetDlgItemInt(IDC_COMBO1, NULL, FALSE);
+ pSndFile->Patterns[m_nPattern].Resize(n);
+ }
+ CDialog::OnOK();
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// CEditCommand
+
+BEGIN_MESSAGE_MAP(CEditCommand, CPropertySheet)
+ ON_WM_ACTIVATE()
+ ON_WM_CLOSE()
+ ON_WM_DESTROY()
+END_MESSAGE_MAP()
+
+
+CEditCommand::CEditCommand()
+//--------------------------
+{
+ m_pModDoc = NULL;
+ m_hWndView = NULL;
+ m_nPattern = 0;
+ m_nRow = 0;
+ m_nChannel = 0;
+ m_pageNote = NULL;
+ m_pageVolume = NULL;
+ m_pageEffect = NULL;
+ m_bModified = false;
+}
+
+
+BOOL CEditCommand::SetParent(CWnd *parent, CModDoc *pModDoc)
+//----------------------------------------------------------
+{
+ if ((!parent) || (!pModDoc)) return FALSE;
+ m_hWndView = parent->m_hWnd;
+ m_pModDoc = pModDoc;
+ m_pageNote = new CPageEditNote(m_pModDoc, this);
+ m_pageVolume = new CPageEditVolume(m_pModDoc, this);
+ m_pageEffect = new CPageEditEffect(m_pModDoc, this);
+ AddPage(m_pageNote);
+ AddPage(m_pageVolume);
+ AddPage(m_pageEffect);
+ if (!CPropertySheet::Create(parent,
+ WS_SYSMENU|WS_POPUP|WS_CAPTION, WS_EX_DLGMODALFRAME)) return FALSE;
+ ModifyStyleEx(0, WS_EX_TOOLWINDOW|WS_EX_PALETTEWINDOW, SWP_FRAMECHANGED);
+ return TRUE;
+}
+
+void CEditCommand::OnDestroy()
+//----------------------------
+{
+ CPropertySheet::OnDestroy();
+
+ if (m_pageNote) {
+ m_pageNote->DestroyWindow();
+ delete m_pageNote;
+ }
+ if (m_pageVolume) {
+ m_pageVolume->DestroyWindow();
+ delete m_pageVolume;
+ }
+ if (m_pageEffect) {
+ m_pageEffect->DestroyWindow();
+ delete m_pageEffect;
+ }
+}
+
+BOOL CEditCommand::PreTranslateMessage(MSG *pMsg)
+//-----------------------------------------------
+{
+ if ((pMsg) && (pMsg->message == WM_KEYDOWN))
+ {
+ if ((pMsg->wParam == VK_ESCAPE) || (pMsg->wParam == VK_RETURN) || (pMsg->wParam == VK_APPS))
+ {
+ OnClose();
+ return TRUE;
+ }
+ }
+ return CPropertySheet::PreTranslateMessage(pMsg);
+}
+
+
+BOOL CEditCommand::ShowEditWindow(UINT nPat, DWORD dwCursor)
+//----------------------------------------------------------
+{
+ CHAR s[64];
+ CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ UINT nRow = dwCursor >> 16;
+ UINT nChannel = (dwCursor & 0xFFFF) >> 3;
+
+ if ((nPat >= pSndFile->Patterns.Size()) || (!m_pModDoc)
+ || (nRow >= pSndFile->Patterns[nPat].GetNumRows()) || (nChannel >= pSndFile->m_nChannels)
+ || (!pSndFile->Patterns[nPat])) return FALSE;
+ m_Command = pSndFile->Patterns[nPat][nRow * pSndFile->m_nChannels + nChannel];
+ m_nRow = nRow;
+ m_nChannel = nChannel;
+ m_nPattern = nPat;
+ // Init Pages
+ if (m_pageNote) m_pageNote->Init(m_Command);
+ if (m_pageVolume) m_pageVolume->Init(m_Command);
+
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ // if (m_pageEffect) m_pageEffect->Init(m_Command);
+ if (m_pageEffect){
+ UINT xp = 0, ml = 1;
+ getXParam(m_Command.command,nPat,nRow,nChannel,pSndFile,&xp,&ml);
+ m_pageEffect->Init(m_Command);
+ m_pageEffect->XInit(xp,ml);
+ }
+ // -! NEW_FEATURE#0010
+
+ // Update Window Title
+ wsprintf(s, "Note Properties - Row %d, Channel %d", m_nRow, m_nChannel+1);
+ SetTitle(s);
+ // Activate Page
+ UINT nPage = 2;
+ dwCursor &= 7;
+ if (dwCursor < 2) nPage = 0;
+ else if (dwCursor < 3) nPage = 1;
+ SetActivePage(nPage);
+ if (m_pageNote) m_pageNote->UpdateDialog();
+ if (m_pageVolume) m_pageVolume->UpdateDialog();
+ if (m_pageEffect) m_pageEffect->UpdateDialog();
+ //ShowWindow(SW_SHOW);
+ ShowWindow(SW_RESTORE);
+ return TRUE;
+}
+
+
+void CEditCommand::UpdateNote(UINT note, UINT instr)
+//--------------------------------------------------
+{
+ CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc)
+ || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows())
+ || (m_nChannel >= pSndFile->m_nChannels)
+ || (!pSndFile->Patterns[m_nPattern])) return;
+ MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel;
+ if ((m->note != note) || (m->instr != instr))
+ {
+ if(!m_bModified) // let's create just one undo step.
+ {
+ m_pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, m_nChannel, m_nRow, 1, 1);
+ m_bModified = true;
+ }
+ m->note = note;
+ m->instr = instr;
+ m_Command = *m;
+ m_pModDoc->SetModified();
+ // -> CODE#0008
+ // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)"
+ // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL);
+ // -! BEHAVIOUR_CHANGE#0008
+ }
+}
+
+
+void CEditCommand::UpdateVolume(UINT volcmd, UINT vol)
+//----------------------------------------------------
+{
+ CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc)
+ || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows())
+ || (m_nChannel >= pSndFile->m_nChannels)
+ || (!pSndFile->Patterns[m_nPattern])) return;
+ MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel;
+ if ((m->volcmd != volcmd) || (m->vol != vol))
+ {
+ if(!m_bModified) // let's create just one undo step.
+ {
+ m_pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, m_nChannel, m_nRow, 1, 1);
+ m_bModified = true;
+ }
+ m->volcmd = volcmd;
+ m->vol = vol;
+ m_pModDoc->SetModified();
+ // -> CODE#0008
+ // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)"
+ // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL);
+ // -! BEHAVIOUR_CHANGE#0008
+ }
+}
+
+
+void CEditCommand::UpdateEffect(UINT command, UINT param)
+//-------------------------------------------------------
+{
+ CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc)
+ || (m_nRow >= pSndFile->Patterns[m_nPattern].GetNumRows())
+ || (m_nChannel >= pSndFile->m_nChannels)
+ || (!pSndFile->Patterns[m_nPattern])) return;
+ MODCOMMAND *m = pSndFile->Patterns[m_nPattern]+m_nRow*pSndFile->m_nChannels+m_nChannel;
+
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ if(command == CMD_OFFSET || command == CMD_PATTERNBREAK || command == CMD_TEMPO || command == CMD_XPARAM){
+ UINT xp = 0, ml = 1;
+ getXParam(command,m_nPattern,m_nRow,m_nChannel,pSndFile,&xp,&ml);
+ m_pageEffect->XInit(xp,ml);
+ m_pageEffect->UpdateDialog();
+ }
+ // -! NEW_FEATURE#0010
+
+ if ((m->command != command) || (m->param != param))
+ {
+ if(!m_bModified) // let's create just one undo step.
+ {
+ m_pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, m_nChannel, m_nRow, 1, 1);
+ m_bModified = true;
+ }
+ m->command = command;
+ m->param = param;
+ m_pModDoc->SetModified();
+ // -> CODE#0008
+ // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)"
+ // m_pModDoc->UpdateAllViews(NULL, (m_nRow << 24) | HINT_PATTERNROW, NULL);
+ m_pModDoc->UpdateAllViews(NULL, (m_nRow << HINT_SHIFT_ROW) | HINT_PATTERNROW, NULL);
+ // -! BEHAVIOUR_CHANGE#0008
+ }
+}
+
+
+void CEditCommand::OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
+//--------------------------------------------------------------------------
+{
+ CWnd::OnActivate(nState, pWndOther, bMinimized);
+ if (nState == WA_INACTIVE) ShowWindow(SW_HIDE);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// CPageEditCommand
+
+BOOL CPageEditCommand::OnInitDialog()
+//-----------------------------------
+{
+ CPropertyPage::OnInitDialog();
+ m_bInitialized = true;
+ UpdateDialog();
+ return TRUE;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// CPageEditNote
+
+BEGIN_MESSAGE_MAP(CPageEditNote, CPageEditCommand)
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnNoteChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO2, OnInstrChanged)
+END_MESSAGE_MAP()
+
+
+void CPageEditNote::UpdateDialog()
+//--------------------------------
+{
+ char s[64];
+ CComboBox *combo;
+ CSoundFile *pSndFile;
+
+ if ((!m_bInitialized) || (!m_pModDoc)) return;
+ pSndFile = m_pModDoc->GetSoundFile();
+ // Note
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ combo->ResetContent();
+ combo->SetItemData(combo->AddString("No note"), 0);
+ AppendNotesToControlEx(*combo, pSndFile, m_nInstr);
+
+ if (NOTE_IS_VALID(m_nNote))
+ {
+ // Normal note / no note
+ const MODCOMMAND::NOTE noteStart = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMin : 1;
+ combo->SetCurSel(m_nNote - (noteStart - 1));
+ }
+ else
+ {
+ // Special notes
+ for(int i = combo->GetCount() - 1; i >= 0; --i)
+ {
+ if(combo->GetItemData(i) == m_nNote)
+ {
+ combo->SetCurSel(i);
+ break;
+ }
+ }
+ }
+
+ }
+ // Instrument
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL)
+ {
+ combo->ResetContent();
+
+ if(MODCOMMAND::IsPcNote(m_nNote))
+ {
+ // control plugin param note
+ combo->SetItemData(combo->AddString("No Effect"), 0);
+ AddPluginNamesToCombobox(*combo, pSndFile->m_MixPlugins, false);
+ } else
+ {
+ // instrument / sample
+ combo->SetItemData(combo->AddString("No Instrument"), 0);
+ const UINT nmax = pSndFile->GetNumInstruments() ? pSndFile->GetNumInstruments() : pSndFile->GetNumSamples();
+ for (UINT i = 1; i <= nmax; i++)
+ {
+ wsprintf(s, "%02d: ", i);
+ int k = strlen(s);
+ // instrument / sample
+ if (pSndFile->GetNumInstruments())
+ {
+ if (pSndFile->Instruments[i])
+ memcpy(s+k, pSndFile->Instruments[i]->name, 32);
+ } else
+ memcpy(s+k, pSndFile->m_szNames[i], MAX_SAMPLENAME);
+ s[k+32] = 0;
+ combo->SetItemData(combo->AddString(s), i);
+ }
+ }
+ combo->SetCurSel(m_nInstr);
+ }
+}
+
+
+void CPageEditNote::OnNoteChanged()
+//---------------------------------
+{
+ const bool bWasParamControl = MODCOMMAND::IsPcNote(m_nNote);
+
+ CComboBox *combo;
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ int n = combo->GetCurSel();
+ if (n >= 0) m_nNote = combo->GetItemData(n);
+ }
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL)
+ {
+ int n = combo->GetCurSel();
+ if(n >= 0)
+ {
+ const UINT oldInstr = m_nInstr;
+ CSoundFile* pSndFile = m_pModDoc->GetSoundFile();
+ m_nInstr = combo->GetItemData(n);
+ //Checking whether note names should be recreated.
+ if(pSndFile && pSndFile->Instruments[m_nInstr] && pSndFile->Instruments[oldInstr])
+ {
+ if(pSndFile->Instruments[m_nInstr]->pTuning != pSndFile->Instruments[oldInstr]->pTuning)
+ UpdateDialog();
+ }
+ }
+ }
+ const bool bIsNowParamControl = MODCOMMAND::IsPcNote(m_nNote);
+ if(bWasParamControl != bIsNowParamControl)
+ UpdateDialog();
+
+ if (m_pParent) m_pParent->UpdateNote(m_nNote, m_nInstr);
+}
+
+
+void CPageEditNote::OnInstrChanged()
+//----------------------------------
+{
+ OnNoteChanged();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// CPageEditVolume
+
+BEGIN_MESSAGE_MAP(CPageEditVolume, CPageEditCommand)
+ ON_WM_HSCROLL()
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnVolCmdChanged)
+END_MESSAGE_MAP()
+
+
+void CPageEditVolume::UpdateDialog()
+//----------------------------------
+{
+ CComboBox *combo;
+
+ if ((!m_bInitialized) || (!m_pModDoc)) return;
+ UpdateRanges();
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ CSoundFile *pSndFile = m_pModDoc->GetSoundFile();
+ if (pSndFile->m_nType == MOD_TYPE_MOD || m_bIsParamControl)
+ {
+ combo->EnableWindow(FALSE);
+ return;
+ }
+ combo->EnableWindow(TRUE);
+ combo->ResetContent();
+ UINT count = m_pModDoc->GetNumVolCmds();
+ combo->SetItemData(combo->AddString(" None"), (DWORD)-1);
+ combo->SetCurSel(0);
+ UINT fxndx = m_pModDoc->GetIndexFromVolCmd(m_nVolCmd);
+ for (UINT i=0; i<count; i++)
+ {
+ CHAR s[64];
+ if (m_pModDoc->GetVolCmdInfo(i, s))
+ {
+ int k = combo->AddString(s);
+ combo->SetItemData(k, i);
+ if (i == fxndx) combo->SetCurSel(k);
+ }
+ }
+ }
+}
+
+
+void CPageEditVolume::UpdateRanges()
+//----------------------------------
+{
+ CSliderCtrl *slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1);
+ if ((slider) && (m_pModDoc))
+ {
+ DWORD rangeMin = 0, rangeMax = 0;
+ LONG fxndx = m_pModDoc->GetIndexFromVolCmd(m_nVolCmd);
+ BOOL bOk = m_pModDoc->GetVolCmdInfo(fxndx, NULL, &rangeMin, &rangeMax);
+ if ((bOk) && (rangeMax > rangeMin))
+ {
+ slider->EnableWindow(TRUE);
+ slider->SetRange(rangeMin, rangeMax);
+ UINT pos = m_nVolume;
+ if (pos < rangeMin) pos = rangeMin;
+ if (pos > rangeMax) pos = rangeMax;
+ slider->SetPos(pos);
+ } else
+ {
+ slider->EnableWindow(FALSE);
+ }
+ }
+}
+
+
+void CPageEditVolume::OnVolCmdChanged()
+//-------------------------------------
+{
+ CComboBox *combo;
+ CSliderCtrl *slider;
+ if (((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) && (m_pModDoc))
+ {
+ int n = combo->GetCurSel();
+ if (n >= 0)
+ {
+ UINT volcmd = m_pModDoc->GetVolCmdFromIndex(combo->GetItemData(n));
+ if (volcmd != m_nVolCmd)
+ {
+ m_nVolCmd = volcmd;
+ UpdateRanges();
+ }
+ }
+ }
+ if ((slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1)) != NULL)
+ {
+ m_nVolume = slider->GetPos();
+ }
+ if (m_pParent) m_pParent->UpdateVolume(m_nVolCmd, m_nVolume);
+}
+
+
+void CPageEditVolume::OnHScroll(UINT, UINT, CScrollBar *)
+//-------------------------------------------------------
+{
+ OnVolCmdChanged();
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////
+// CPageEditEffect
+
+BEGIN_MESSAGE_MAP(CPageEditEffect, CPageEditCommand)
+ ON_WM_HSCROLL()
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnCommandChanged)
+END_MESSAGE_MAP()
+
+
+void CPageEditEffect::UpdateDialog()
+//----------------------------------
+{
+ CHAR s[128];
+ CComboBox *combo;
+ CSoundFile *pSndFile;
+
+ if ((!m_pModDoc) || (!m_bInitialized)) return;
+ pSndFile = m_pModDoc->GetSoundFile();
+ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL)
+ {
+ combo->ResetContent();
+ if(m_bIsParamControl)
+ {
+ // plugin param control note
+ AddPluginParameternamesToCombobox(*combo, pSndFile->m_MixPlugins[m_nPlugin]);
+ combo->SetCurSel(m_nPluginParam);
+ } else
+ {
+ // process as effect
+ UINT numfx = m_pModDoc->GetNumEffects();
+ UINT fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
+ combo->SetItemData(combo->AddString(" None"), (DWORD)-1);
+ if (!m_nCommand) combo->SetCurSel(0);
+ for (UINT i=0; i<numfx; i++)
+ {
+ if (m_pModDoc->GetEffectInfo(i, s, true))
+ {
+ int k = combo->AddString(s);
+ combo->SetItemData(k, i);
+ if (i == fxndx) combo->SetCurSel(k);
+ }
+ }
+ }
+ }
+ UpdateRange(FALSE);
+}
+
+
+void CPageEditEffect::UpdateRange(BOOL bSet)
+//------------------------------------------
+{
+ CSliderCtrl *slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1);
+ if ((slider) && (m_pModDoc))
+ {
+ DWORD rangeMin = 0, rangeMax = 0;
+ LONG fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
+ bool bEnable = ((fxndx >= 0) && (m_pModDoc->GetEffectInfo(fxndx, NULL, false, &rangeMin, &rangeMax)));
+ if (bEnable)
+ {
+ slider->EnableWindow(TRUE);
+ slider->SetPageSize(1);
+ slider->SetRange(rangeMin, rangeMax);
+ DWORD pos = m_pModDoc->MapValueToPos(fxndx, m_nParam);
+ if (pos > rangeMax) pos = rangeMin | (pos & 0x0F);
+ if (pos < rangeMin) pos = rangeMin;
+ if (pos > rangeMax) pos = rangeMax;
+ slider->SetPos(pos);
+ } else
+ {
+ slider->SetRange(0,0);
+ slider->EnableWindow(FALSE);
+ }
+ UpdateValue(bSet);
+ }
+}
+
+
+void CPageEditEffect::UpdateValue(BOOL bSet)
+//------------------------------------------
+{
+ if (m_pModDoc)
+ {
+ CHAR s[128] = "";
+ LONG fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ // if (fxndx >= 0) m_pModDoc->GetEffectNameEx(s, fxndx, m_nParam);
+ if (fxndx >= 0) m_pModDoc->GetEffectNameEx(s, fxndx, m_nParam * m_nMultiplier + m_nXParam);
+ // -! NEW_FEATURE#0010
+ SetDlgItemText(IDC_TEXT1, s);
+ }
+ if ((m_pParent) && (bSet)) m_pParent->UpdateEffect(m_nCommand, m_nParam);
+}
+
+
+void CPageEditEffect::OnCommandChanged()
+//--------------------------------------
+{
+ CComboBox *combo;
+
+ if (((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) && (m_pModDoc))
+ {
+ BOOL bSet = FALSE;
+ int n = combo->GetCurSel();
+ if (n >= 0)
+ {
+ int param = -1, ndx = combo->GetItemData(n);
+ m_nCommand = (ndx >= 0) ? m_pModDoc->GetEffectFromIndex(ndx, param) : 0;
+ if (param >= 0) m_nParam = param;
+ bSet = TRUE;
+ }
+ UpdateRange(bSet);
+ }
+}
+
+
+
+void CPageEditEffect::OnHScroll(UINT, UINT, CScrollBar *)
+//-------------------------------------------------------
+{
+ CSliderCtrl *slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1);
+ if ((slider) && (m_pModDoc))
+ {
+ LONG fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam);
+ if (fxndx >= 0)
+ {
+ int pos = slider->GetPos();
+ UINT param = m_pModDoc->MapPosToValue(fxndx, pos);
+ if (param != m_nParam)
+ {
+ m_nParam = param;
+ UpdateValue(TRUE);
+ }
+ }
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// Chord Editor
+
+BEGIN_MESSAGE_MAP(CChordEditor, CDialog)
+ ON_MESSAGE(WM_MOD_KBDNOTIFY, OnKeyboardNotify)
+ ON_CBN_SELCHANGE(IDC_COMBO1, OnChordChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO2, OnBaseNoteChanged)
+ ON_CBN_SELCHANGE(IDC_COMBO3, OnNote1Changed)
+ ON_CBN_SELCHANGE(IDC_COMBO4, OnNote2Changed)
+ ON_CBN_SELCHANGE(IDC_COMBO5, OnNote3Changed)
+END_MESSAGE_MAP()
+
+
+void CChordEditor::DoDataExchange(CDataExchange* pDX)
+//---------------------------------------------------
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CChordEditor)
+ DDX_Control(pDX, IDC_KEYBOARD1, m_Keyboard);
+ DDX_Control(pDX, IDC_COMBO1, m_CbnShortcut);
+ DDX_Control(pDX, IDC_COMBO2, m_CbnBaseNote);
+ DDX_Control(pDX, IDC_COMBO3, m_CbnNote1);
+ DDX_Control(pDX, IDC_COMBO4, m_CbnNote2);
+ DDX_Control(pDX, IDC_COMBO5, m_CbnNote3);
+ //}}AFX_DATA_MAP
+}
+
+
+BOOL CChordEditor::OnInitDialog()
+//-------------------------------
+{
+ CMainFrame *pMainFrm;
+ CHAR s[128];
+
+ CDialog::OnInitDialog();
+ m_Keyboard.Init(m_hWnd, 2);
+ pMainFrm = CMainFrame::GetMainFrame();
+ if (!pMainFrm) return TRUE;
+ // Fills the shortcut key combo box
+ AppendNotesToControl(m_CbnShortcut, 0, 3*12-1);
+
+ m_CbnShortcut.SetCurSel(0);
+ // Base Note combo box
+ AppendNotesToControl(m_CbnBaseNote, 0, 3*12-1);
+
+ // Minor notes
+ for (int inotes=-1; inotes<24; inotes++)
+ {
+ if (inotes < 0) strcpy(s, "--"); else
+ if (inotes < 12) wsprintf(s, "%s", szNoteNames[inotes % 12]);
+ else wsprintf(s, "%s (+%d)", szNoteNames[inotes % 12], inotes / 12);
+ m_CbnNote1.AddString(s);
+ m_CbnNote2.AddString(s);
+ m_CbnNote3.AddString(s);
+ }
+ // Update Dialog
+ OnChordChanged();
+ return TRUE;
+}
+
+
+LRESULT CChordEditor::OnKeyboardNotify(WPARAM wParam, LPARAM nKey)
+//----------------------------------------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+ int chord;
+
+ if (wParam != KBDNOTIFY_LBUTTONDOWN) return 0;
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return 0;
+ pChords = pMainFrm->GetChords();
+ chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ UINT cnote = NOTE_NONE;
+ pChords[chord].notes[0] = NOTE_NONE;
+ pChords[chord].notes[1] = NOTE_NONE;
+ pChords[chord].notes[2] = NOTE_NONE;
+ for (UINT i=0; i<2*12; i++) if (i != (UINT)(pChords[chord].key % 12))
+ {
+ UINT n = m_Keyboard.GetFlags(i);
+ if (i == (UINT)nKey) n = (n) ? 0 : 1;
+ if (n)
+ {
+ if ((cnote < 3) || (i == (UINT)nKey))
+ {
+ UINT k = (cnote < 3) ? cnote : 2;
+ pChords[chord].notes[k] = i+1;
+ if (cnote < 3) cnote++;
+ }
+ }
+ }
+ OnChordChanged();
+ return 0;
+}
+
+
+void CChordEditor::OnChordChanged()
+//---------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+ int chord;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ m_CbnBaseNote.SetCurSel(pChords[chord].key);
+ m_CbnNote1.SetCurSel(pChords[chord].notes[0]);
+ m_CbnNote2.SetCurSel(pChords[chord].notes[1]);
+ m_CbnNote3.SetCurSel(pChords[chord].notes[2]);
+ UpdateKeyboard();
+}
+
+
+void CChordEditor::UpdateKeyboard()
+//---------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+ int chord;
+ UINT note, octave;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ note = pChords[chord].key % 12;
+ octave = pChords[chord].key / 12;
+ for (UINT i=0; i<2*12; i++)
+ {
+ BOOL b = FALSE;
+
+ if (i == note) b = TRUE;
+ if ((pChords[chord].notes[0]) && (i+1 == pChords[chord].notes[0])) b = TRUE;
+ if ((pChords[chord].notes[1]) && (i+1 == pChords[chord].notes[1])) b = TRUE;
+ if ((pChords[chord].notes[2]) && (i+1 == pChords[chord].notes[2])) b = TRUE;
+ m_Keyboard.SetFlags(i, (b) ? 1 : 0);
+ }
+ m_Keyboard.InvalidateRect(NULL, FALSE);
+}
+
+
+void CChordEditor::OnBaseNoteChanged()
+//------------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ int chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ int basenote = m_CbnBaseNote.GetCurSel();
+ if (basenote >= 0)
+ {
+ pChords[chord].key = (BYTE)basenote;
+ UpdateKeyboard();
+ }
+}
+
+
+void CChordEditor::OnNote1Changed()
+//---------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ int chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ int note = m_CbnNote1.GetCurSel();
+ if (note >= 0)
+ {
+ pChords[chord].notes[0] = (BYTE)note;
+ UpdateKeyboard();
+ }
+}
+
+
+void CChordEditor::OnNote2Changed()
+//---------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ int chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ int note = m_CbnNote2.GetCurSel();
+ if (note >= 0)
+ {
+ pChords[chord].notes[1] = (BYTE)note;
+ UpdateKeyboard();
+ }
+}
+
+
+void CChordEditor::OnNote3Changed()
+//---------------------------------
+{
+ CMainFrame *pMainFrm;
+ MPTCHORD *pChords;
+
+ if ((pMainFrm = CMainFrame::GetMainFrame()) == NULL) return;
+ pChords = pMainFrm->GetChords();
+ int chord = m_CbnShortcut.GetCurSel();
+ if (chord >= 0) chord = m_CbnShortcut.GetItemData(chord);
+ if ((chord < 0) || (chord >= 3*12)) chord = 0;
+ int note = m_CbnNote3.GetCurSel();
+ if (note >= 0)
+ {
+ pChords[chord].notes[2] = (BYTE)note;
+ UpdateKeyboard();
+ }
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// Keyboard Split Settings (pattern editor)
+
+BEGIN_MESSAGE_MAP(CSplitKeyboadSettings, CDialog)
+ ON_CBN_SELCHANGE(IDC_COMBO_OCTAVEMODIFIER, OnOctaveModifierChanged)
+END_MESSAGE_MAP()
+
+
+void CSplitKeyboadSettings::DoDataExchange(CDataExchange* pDX)
+//------------------------------------------------------------
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CSplitKeyboadSettings)
+ DDX_Control(pDX, IDC_COMBO_SPLITINSTRUMENT, m_CbnSplitInstrument);
+ DDX_Control(pDX, IDC_COMBO_SPLITNOTE, m_CbnSplitNote);
+ DDX_Control(pDX, IDC_COMBO_OCTAVEMODIFIER, m_CbnOctaveModifier);
+ DDX_Control(pDX, IDC_COMBO_SPLITVOLUME, m_CbnSplitVolume);
+ //}}AFX_DATA_MAP
+}
+
+
+BOOL CSplitKeyboadSettings::OnInitDialog()
+//----------------------------------------
+{
+ if(!m_pSndFile || m_pSndFile->GetpModDoc() == nullptr) return FALSE;
+
+ CDialog::OnInitDialog();
+
+ CHAR s[64];
+
+ // Split Notes
+ AppendNotesToControl(m_CbnSplitNote, 0, NOTE_MAX - 1);
+ m_CbnSplitNote.SetCurSel(m_pOptions->splitNote);
+
+ // Octave modifier
+ for(int i = -SPLIT_OCTAVE_RANGE; i < SPLIT_OCTAVE_RANGE + 1; i++){
+ wsprintf(s,i < 0 ? "Octave -%d" : i > 0 ? "Octave +%d" : "No Change", abs(i));
+ int n = m_CbnOctaveModifier.AddString(s);
+ m_CbnOctaveModifier.SetItemData(n, i);
+ }
+
+ m_CbnOctaveModifier.SetCurSel(m_pOptions->octaveModifier + SPLIT_OCTAVE_RANGE);
+ CheckDlgButton(IDC_PATTERN_OCTAVELINK, (m_pOptions->octaveLink && m_pOptions->octaveModifier != 0) ? MF_CHECKED : MF_UNCHECKED);
+
+ // Volume
+ m_CbnSplitVolume.AddString("No Change");
+ m_CbnSplitVolume.SetItemData(0, 0);
+ for(int i = 1; i <= 64 ; i++){
+ wsprintf(s,"%d",i);
+ int n = m_CbnSplitVolume.AddString(s);
+ m_CbnSplitVolume.SetItemData(n, i);
+ }
+ m_CbnSplitVolume.SetCurSel(m_pOptions->splitVolume);
+
+ // Instruments
+ m_CbnSplitInstrument.ResetContent();
+ m_CbnSplitInstrument.SetItemData(m_CbnSplitInstrument.AddString("No Instrument"), 0);
+
+ if (m_pSndFile->m_nInstruments) {
+ for (INSTRUMENTINDEX nIns = 1; nIns <= m_pSndFile->m_nInstruments; nIns++)
+ {
+ if (m_pSndFile->Instruments[nIns] == nullptr)
+ continue;
+
+ CString displayName = m_pSndFile->GetpModDoc()->GetPatternViewInstrumentName(nIns);
+ int n = m_CbnSplitInstrument.AddString(displayName);
+ m_CbnSplitInstrument.SetItemData(n, nIns);
+ }
+ } else
+ {
+ for (SAMPLEINDEX nSmp = 1; nSmp <= m_pSndFile->m_nSamples; nSmp++)
+ {
+ if ((m_pSndFile->m_szNames[nSmp][0]) || (m_pSndFile->Samples[nSmp].pSample))
+ {
+ wsprintf(s, "%02d: %s", nSmp, m_pSndFile->m_szNames[nSmp]);
+ int n = m_CbnSplitInstrument.AddString(s);
+ m_CbnSplitInstrument.SetItemData(n, nSmp);
+ }
+ }
+ }
+ m_CbnSplitInstrument.SetCurSel(m_pOptions->splitInstrument);
+
+ return TRUE;
+}
+
+
+void CSplitKeyboadSettings::OnOK()
+//--------------------------------
+{
+ CDialog::OnOK();
+
+ m_pOptions->splitNote = m_CbnSplitNote.GetCurSel();
+ m_pOptions->octaveModifier = m_CbnOctaveModifier.GetCurSel() - SPLIT_OCTAVE_RANGE;
+ m_pOptions->octaveLink = (IsDlgButtonChecked(IDC_PATTERN_OCTAVELINK) == TRUE) ? true : false;
+ m_pOptions->splitVolume = m_CbnSplitVolume.GetCurSel();
+ m_pOptions->splitInstrument = m_CbnSplitInstrument.GetItemData(m_CbnSplitInstrument.GetCurSel());
+}
+
+
+void CSplitKeyboadSettings::OnCancel()
+//------------------------------------
+{
+ CDialog::OnCancel();
+}
+
+
+void CSplitKeyboadSettings::OnOctaveModifierChanged()
+//---------------------------------------------------
+{
+ CheckDlgButton(IDC_PATTERN_OCTAVELINK, (m_CbnOctaveModifier.GetCurSel() != 9) ? MF_CHECKED : MF_UNCHECKED);
+}
+
+
+///////////////////////////////////////////////////////////
+// Rename a channel from pattern editor
+
+BOOL CChannelRenameDlg::OnInitDialog()
+//------------------------------------
+{
+ CDialog::OnInitDialog();
+
+ CHAR s[32];
+ wsprintf(s, "Set name for channel %d:", m_nChannel);
+ SetDlgItemText(IDC_STATIC_CHANNEL_NAME, s);
+ SetDlgItemText(IDC_EDIT_CHANNEL_NAME, m_sName);
+ ((CEdit*)(GetDlgItem(IDC_EDIT_CHANNEL_NAME)))->LimitText(MAX_CHANNELNAME - 1);
+
+ return TRUE;
+}
+
+
+void CChannelRenameDlg::OnOK()
+//----------------------------
+{
+ CHAR sNewName[MAX_CHANNELNAME];
+ GetDlgItemText(IDC_EDIT_CHANNEL_NAME, sNewName, MAX_CHANNELNAME);
+ if(!strcmp(sNewName, m_sName))
+ {
+ bChanged = false;
+ CDialog::OnCancel();
+ } else
+ {
+ strcpy(m_sName, sNewName);
+ bChanged = true;
+ CDialog::OnOK();
+ }
+}
Added: trunk/OpenMPT/mptrack/PatternEditorDialogs.h
===================================================================
--- trunk/OpenMPT/mptrack/PatternEditorDialogs.h (rev 0)
+++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2011-03-07 00:21:50 UTC (rev 809)
@@ -0,0 +1,356 @@
+/*
+ * PatternEditorDialogs.h
+ * ----------------------
+ * Purpose: Header file for misc pattern editor dialog functionality
+ * Notes : (currently none)
+ * Authors: Olivier Lapicque
+ * OpenMPT Devs
+ */
+
+#ifndef PATTERNEDITORDIALOGS_H
+#define PATTERNEDITORDIALOGS_H
+#pragma once
+
+#include "dlg_misc.h" // for keyboard control
+#include "Moddoc.h" // for SplitKeyboardSettings
+
+
+/////////////////////////////////////////////////////////////////////////
+// Search/Replace
+
+#define PATSEARCH_NOTE 0x01 // Search for note
+#define PATSEARCH_INSTR 0x02 // Search for instrument
+#define PATSEARCH_VOLCMD 0x04 // Search for volume effect
+#define PATSEARCH_VOLUME 0x08 // Search for volume
+#define PATSEARCH_COMMAND 0x10 // Search for effect
+#define PATSEARCH_PARAM 0x20 // Search for effect parameter
+#define PATSEARCH_CHANNEL 0x40 // Limit search to channels
+#define PATSEARCH_FULLSEARCH 0x100 // Search whole song
+#define PATSEARCH_PATSELECTION 0x200 // Search in current pattern selection
+#define PATSEARCH_REPLACE 0x400 // Replace
+#define PATSEARCH_REPLACEALL 0x800 // Replace all
+
+//=========================================
+class CFindReplaceTab: public CPropertyPage
+//=========================================
+{
+protected:
+ BOOL m_bReplace;
+ CModDoc *m_pModDoc;
+
+public:
+ UINT m_nNote, m_nInstr, m_nVolCmd, m_nVol, m_nCommand, m_nParam;
+ CHANNELINDEX m_nMinChannel, m_nMaxChannel;
+ signed char cInstrRelChange;
+ bool m_bPatSel;
+ DWORD m_dwFlags;
+
+ enum findItem
+ {
+ findAny = NOTE_MIN_SPECIAL - 1
+ };
+
+
+ enum replaceItem
+ {
+ replaceNotePlusOne = NOTE_MAX + 1,
+ replaceNoteMinusOne = NOTE_MAX + 2,
+ replaceNotePlusOctave = NOTE_MAX + 3,
+ replaceNoteMinusOctave = NOTE_MAX + 4,
+
+ replaceInstrumentPlusOne = MAX_INSTRUMENTS + 1,
+ replaceInstrumentMinusOne = MAX_INSTRUMENTS + 2,
+ };
+
+ // Make sure there's unused notes between NOTE_MAX and NOTE_MIN_SPECIAL.
+ STATIC_ASSERT(NOTE_MIN_SPECIAL - 4 > NOTE_MAX);
+
+protected:
+ void ChangeEffect();
+
+public:
+ CFindReplaceTab(UINT nIDD, BOOL bReplaceTab, CModDoc *pModDoc):CPropertyPage(nIDD) { m_bReplace = bReplaceTab; m_pModDoc = pModDoc; }
+
+protected:
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+
+ // When a combobox is focussed, check the corresponding checkbox.
+ void CheckOnChange(int nIDButton) { CheckDlgButton(nIDButton, BST_CHECKED); CheckReplace(nIDButton); };
+ afx_msg void OnNoteChanged() { CheckOnChange(IDC_CHECK1); };
+ afx_msg void OnInstrChanged() { CheckOnChange(IDC_CHECK2); };
+ afx_msg void OnVolCmdChanged() { CheckOnChange(IDC_CHECK3); };
+ afx_msg void OnVolumeChanged() { CheckOnChange(IDC_CHECK4); };
+ afx_msg void OnEffectChanged() { CheckOnChange(IDC_CHECK5); ChangeEffect(); };
+ afx_msg void OnParamChanged() { CheckOnChange(IDC_CHECK6); };
+ // When a checkbox is checked, also check "Replace By".
+ afx_msg void OnCheckNote() { CheckReplace(IDC_CHECK1); };
+ afx_msg void OnCheckInstr() { CheckReplace(IDC_CHECK2); };
+ afx_msg void OnCheckVolCmd() { CheckReplace(IDC_CHECK3); };
+ afx_msg void OnCheckVolume() { CheckReplace(IDC_CHECK4); };
+ afx_msg void OnCheckEffect() { CheckReplace(IDC_CHECK5); };
+ afx_msg void OnCheckParam() { CheckReplace(IDC_CHECK6); };
+ // Check "Replace By"
+ afx_msg void CheckReplace(int nIDButton) { if(m_bReplace && IsDlgButtonChecked(nIDButton)) CheckDlgButton(IDC_CHECK7, BST_CHECKED); };
+
+ afx_msg void OnCheckChannelSearch();
+ DECLARE_MESSAGE_MAP()
+};
+
+
+//=========================================
+class CPatternPropertiesDlg: public CDialog
+//=========================================
+{
+protected:
+ CModDoc *m_pModDoc;
+ UINT m_nPattern;
+
+public:
+ CPatternPropertiesDlg(CModDoc *pModDoc, UINT nPat, CWnd *parent=NULL):CDialog(IDD_PATTERN_PROPERTIES, parent) { m_pModDoc = pModDoc; m_nPattern = nPat; }
+
+protected:
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+ afx_msg void OnHalfRowNumber();
+ afx_msg void OnDoubleRowNumber();
+ afx_msg void OnOverrideSignature();
+ DECLARE_MESSAGE_MAP()
+};
+
+
+//////////////////////////////////////////////////////////////////////////
+// Command Editing
+
+class CEditCommand;
+class CPageEditCommand;
+
+//==========================================
+class CPageEditCommand: public CPropertyPage
+//==========================================
+{
+protected:
+ CModDoc *m_pModDoc;
+ CEditCommand *m_pParent;
+ bool m_bInitialized;
+
+public:
+ CPageEditCommand(CModDoc *pModDoc, CEditCommand *parent, UINT id):CPropertyPage(id) { m_pModDoc = pModDoc; m_pParent = parent; m_bInitialized = false; }
+ virtual ~CPageEditCommand() {}
+ virtual BOOL OnInitDialog();
+ virtual void Init(MODCOMMAND&)=0;
+ virtual void UpdateDialog() {}
+};
+
+
+//==========================================
+class CPageEditNote: public CPageEditCommand
+//==========================================
+{
+protected:
+ UINT m_nNote, m_nInstr;
+
+public:
+ CPageEditNote(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITNOTE) {}
+ void Init(MODCOMMAND &m) { m_nNote = m.note; m_nInstr = m.instr; }
+ void UpdateDialog();
+
+protected:
+ //{{AFX_MSG(CPageEditNote)
+ afx_msg void OnNoteChanged();
+ afx_msg void OnInstrChanged();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+//============================================
+class CPageEditVolume: public CPageEditCommand
+//============================================
+{
+protected:
+ UINT m_nVolCmd, m_nVolume;
+ bool m_bIsParamControl;
+
+public:
+ CPageEditVolume(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITVOLUME) {}
+ void Init(MODCOMMAND &m) { m_nVolCmd = m.volcmd; m_nVolume = m.vol; m_bIsParamControl = (m.IsPcNote()) ? true : false;}
+ void UpdateDialog();
+ void UpdateRanges();
+
+protected:
+ //{{AFX_MSG(CPageEditVolume)
+ afx_msg void OnVolCmdChanged();
+ afx_msg void OnHScroll(UINT, UINT, CScrollBar *);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+//============================================
+class CPageEditEffect: public CPageEditCommand
+//============================================
+{
+protected:
+ UINT m_nCommand, m_nParam, m_nPlugin;
+ UINT m_nPluginParam;
+ bool m_bIsParamControl;
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ UINT m_nXParam, m_nMultiplier;
+ // -! NEW_FEATURE#0010
+
+ MODCOMMAND* m_pModcommand;
+
+public:
+ CPageEditEffect(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITEFFECT) {}
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ void Init(MODCOMMAND &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = (m.IsPcNote()) ? true : false; m_nPlugin = m.instr; m_nPluginParam = MODCOMMAND::GetValueVolCol(m.volcmd, m.vol);}
+ void XInit(UINT xparam = 0, UINT multiplier = 1) { m_nXParam = xparam; m_nMultiplier = multiplier; }
+ // -! NEW_FEATURE#0010
+ void UpdateDialog();
+ void UpdateRange(BOOL bSet);
+ void UpdateValue(BOOL bSet);
+
+protected:
+ //{{AFX_MSG(CPageEditEffect)
+ afx_msg void OnCommandChanged();
+ afx_msg void OnHScroll(UINT, UINT, CScrollBar *);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+
+//=======================================
+class CEditCommand: public CPropertySheet
+//=======================================
+{
+protected:
+ CPageEditNote *m_pageNote;
+ CPageEditVolume *m_pageVolume;
+ CPageEditEffect *m_pageEffect;
+ CModDoc *m_pModDoc;
+ HWND m_hWndView;
+ UINT m_nPattern, m_nRow, m_nChannel;
+ MODCOMMAND m_Command;
+ bool m_bModified;
+
+public:
+ CEditCommand();
+
+public:
+ BOOL SetParent(CWnd *parent, CModDoc *pModDoc);
+ BOOL ShowEditWindow(UINT nPat, DWORD dwCursor);
+ // -> CODE#0010
+ // -> DESC="add extended parameter mechanism to pattern effects"
+ void OnSelListChange();
+ // -! NEW_FEATURE#0010
+ void UpdateNote(UINT note, UINT instr);
+ void UpdateVolume(UINT volcmd, UINT vol);
+ void UpdateEffect(UINT command, UINT param);
+
+protected:
+ //{{AFX_VIRTUAL(CEditCommand)
+ virtual void OnOK() { ShowWindow(SW_HIDE); }
+ virtual void OnCancel() { ShowWindow(SW_HIDE); }
+ virtual BOOL PreTranslateMessage(MSG *pMsg);
+ //}}AFX_VIRTUAL
+ //{{AFX_MSG(CEditCommand)
+ afx_msg void OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized);
+ afx_msg void OnClose() { ShowWindow(SW_HIDE); }
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+public:
+ afx_msg void OnDestroy();
+};
+
+
+/////////////////////////////////////////////////////////////////////////
+// Chord Editor
+
+//================================
+class CChordEditor: public CDialog
+//================================
+{
+protected:
+ CKeyboardControl m_Keyboard;
+ CComboBox m_CbnShortcut, m_CbnBaseNote, m_CbnNote1, m_CbnNote2, m_CbnNote3;
+
+public:
+ CChordEditor(CWnd *parent=NULL):CDialog(IDD_CHORDEDIT, parent) {}
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX);
+ virtual BOOL OnInitDialog();
+ void UpdateKeyboard();
+ afx_msg LRESULT OnKeyboardNotify(WPARAM, LPARAM);
+ afx_msg void OnChordChanged();
+ afx_msg void OnBaseNoteChanged();
+ afx_msg void OnNote1Changed();
+ afx_msg void OnNote2Changed();
+ afx_msg void OnNote3Changed();
+ DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////
+// Keyboard Split Settings (pattern editor)
+
+//=========================================
+class CSplitKeyboadSettings: public CDialog
+//=========================================
+{
+protected:
+ CComboBox m_CbnSplitInstrument, m_CbnSplitNote, m_CbnOctaveModifier, m_CbnSplitVolume;
+ CSoundFile *m_pSndFile;
+
+public:
+ SplitKeyboardSettings *m_pOptions;
+
+ CSplitKeyboadSettings(CWnd *parent, CSoundFile *pSndFile, SplitKeyboardSettings *pOptions):CDialog(IDD_KEYBOARD_SPLIT, parent)
+ {
+ m_pSndFile = pSndFile;
+ m_pOptions = pOptions;
+ }
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX);
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+ virtual void OnCancel();
+
+ afx_msg void OnOctaveModifierChanged();
+
+ DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////
+// Rename a channel from pattern editor
+
+//=====================================
+class CChannelRenameDlg: public CDialog
+//=====================================
+{
+protected:
+ CHANNELINDEX m_nChannel;
+
+public:
+ CHAR m_sName[MAX_CHANNELNAME];
+ bool bChanged;
+
+public:
+ CChannelRenameDlg(CWnd *parent, CHAR *sName, CHANNELINDEX nChannel) : CDialog(IDD_CHANNEL_NAME, parent)
+ {
+ strcpy(m_sName, sName);
+ m_nChannel = nChannel;
+ bChanged = false;
+ }
+
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+};
+
+#endif
Added: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp
===================================================================
--- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp (rev 0)
+++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-03-07 00:21:50 UTC (rev 809)
@@ -0,0 +1,172 @@
+/*
+ *
+ * SampleEditorDialogs.cpp
+ * -----------------------
+ * Purpose: Code for various dialogs that are used in the sample editor
+ * Notes : (currently none)
+ * Authors: Olivier Lapicque
+ * OpenMPT Devs
+ *
+ */
+
+#include "stdafx.h"
+#include "mptrack.h"
+#include "SampleEditorDialogs.h"
+
+
+//////////////////////////////////////////////////////////////////////////
+// Sample amplification dialog
+
+CAmpDlg::CAmpDlg(CWnd *parent, int16 nFactor, int16 nFactorMin, int16 nFactorMax)
+//-------------------------------------------------------------------------------
+: CDialog(IDD_SAMPLE_AMPLIFY, parent), m_nFactor(nFactor),
+m_nFactorMin(nFactorMin), m_nFactorMax(nFactorMax),
+m_bFadeIn(FALSE), m_bFadeOut(FALSE)
+{}
+
+BOOL CAmpDlg::OnInitDialog()
+//--------------------------
+{
+ CDialog::OnInitDialog();
+ CSpinButtonCtrl *spin = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN1);
+ if (spin)
+ {
+ spin->SetRange32(m_nFactorMin, m_nFactorMax);
+ spin->SetPos32(m_nFactor);
+ }
+ SetDlgItemInt(IDC_EDIT1, m_nFactor);
+ return TRUE;
+}
+
+
+void CAmpDlg::OnOK()
+//------------------
+{
+ const int nVal = static_cast<int>(GetDlgItemInt(IDC_EDIT1));
+ if(nVal < m_nFactorMin || nVal > m_nFactorMax)
+ {
+ CString str; str.Format(GetStrI18N(__TEXT("Value should be within [%d, %d]")), m_nFactorMin, m_nFactorMax);
+ AfxMessageBox(str, MB_ICONINFORMATION);
+ return;
+ }
+ m_nFactor = static_cast<int16>(nVal);
+ m_bFadeIn = (IsDlgButtonChecked(IDC_CHECK1) != 0);
+ m_bFadeOut = (IsDlgButtonChecked(IDC_CHECK2) != 0);
+ CDialog::OnOK();
+}
+
+
+/////////////////////////////////////////////////////////////////////////
+// Add silence dialog - add silence to a sample
+
+BEGIN_MESSAGE_MAP(CAddSilenceDlg, CDialog)
+ ON_COMMAND(IDC_RADIO_ADDSILENCE_BEGIN, OnEditModeChanged)
+ ON_COMMAND(IDC_RADIO_ADDSILENCE_END, OnEditModeChanged)
+ ON_COMMAND(IDC_RADIO_RESIZETO, OnEditModeChanged)
+END_MESSAGE_MAP()
+
+
+BOOL CAddSilenceDlg::OnInitDialog()
+//---------------------------------
+{
+ CDialog::OnInitDialog();
+
+ CSpinButtonCtrl *spin = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_ADDSILENCE);
+ if (spin)
+ {
+ spin->SetRange(0, int16_max);
+ spin->SetPos(m_nSamples)...
[truncated message content] |
|
From: <sag...@us...> - 2011-03-04 18:00:43
|
Revision: 808
http://modplug.svn.sourceforge.net/modplug/?rev=808&view=rev
Author: saga-games
Date: 2011-03-04 18:00:36 +0000 (Fri, 04 Mar 2011)
Log Message:
-----------
[Imp] Mod Conversion: When converting to XM, the E60 bug is now tried to be compensated.
[Imp] Mod Conversion: If compatible play is disabled, it is recommended to be enabled when converting to XM / IT.
[New] Mod Conversion: If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command.
[Mod] OpenMPT: Version is now 1.19.00.27
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MPTHacks.cpp
trunk/OpenMPT/mptrack/ModConvert.cpp
trunk/OpenMPT/mptrack/ModConvert.h
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Modedit.cpp
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -10,7 +10,7 @@
#include "Moddoc.h"
/* TODO:
-stereo/16bit samples (only XM? maybe S3M? many new IT trackers support stereo samples)
+stereo/16bit samples (only XM? stereo/16bit flags are defined in the S3M and IT specs...)
out-of range sample pre-amp
song flags and properties (just look at the song properties window)
+++/--- orders in XM/MOD sequence
@@ -351,7 +351,9 @@
AddToLog("Found restart position\n");
foundHacks = true;
if(autofix)
- m_SndFile.m_nRestartPos = 0;
+ {
+ RestartPosToPattern();
+ }
}
if(m_SndFile.m_nMixLevels != mixLevels_compatible)
Modified: trunk/OpenMPT/mptrack/ModConvert.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/ModConvert.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -178,6 +178,7 @@
cEffectMemory[i].resize(MAX_EFFECTS, 0);
}
+ bool addBreak = false; // When converting to XM, avoid the E60 bug.
CHANNELINDEX nChannel = m_SndFile.m_nChannels - 1;
for (UINT len = m_SndFile.Patterns[nPat].GetNumRows() * m_SndFile.m_nChannels; len; m++, len--)
@@ -222,7 +223,29 @@
}
}
+
+ // When converting to XM, avoid the E60 bug.
+ if(newTypeIsXM)
+ {
+ switch(m->command)
+ {
+ case CMD_MODCMDEX:
+ if((m->param & 0xF0) == 0x60)
+ {
+ addBreak = true;
+ }
+ break;
+ case CMD_POSITIONJUMP:
+ case CMD_PATTERNBREAK:
+ addBreak = false;
+ break;
+ }
+ }
}
+ if(addBreak)
+ {
+ m_SndFile.TryWriteEffect(nPat, m_SndFile.Patterns[nPat].GetNumRows() - 1, CMD_PATTERNBREAK, 0, false, CHANNELINDEX_INVALID, false, false);
+ }
}
////////////////////////////////////////////////
@@ -370,7 +393,8 @@
// Is the "restart position" value allowed in this format?
if(m_SndFile.m_nRestartPos > 0 && !CSoundFile::GetModSpecifications(nNewType).hasRestartPos)
{
- m_SndFile.m_nRestartPos = 0;
+ // Try to fix it
+ RestartPosToPattern();
CHANGEMODTYPE_WARNING(wRestartPos);
}
@@ -439,6 +463,11 @@
CHANGEMODTYPE_WARNING(wMixmode);
}
+ if((nNewType & (MOD_TYPE_XM|MOD_TYPE_IT)) && !m_SndFile.GetModFlag(MSF_COMPATIBLE_PLAY))
+ {
+ CHANGEMODTYPE_WARNING(wCompatibilityMode);
+ }
+
END_CRITICAL();
ChangeFileExtension(nNewType);
@@ -475,6 +504,7 @@
CHANGEMODTYPE_CHECK(wReleaseNode, "Instrument envelope release nodes are not supported by the new format.\n");
CHANGEMODTYPE_CHECK(wEditHistory, "Edit history will not be saved in the new format.\n");
CHANGEMODTYPE_CHECK(wMixmode, "Consider setting the mix levels to \"Compatible\" in the song properties when working with legacy formats.\n");
+ CHANGEMODTYPE_CHECK(wCompatibilityMode, "Consider enabling the \"compatible playback\" option in the song properties to increase compatiblity with other players.\n");
SetModified();
GetPatternUndo()->ClearUndo();
Modified: trunk/OpenMPT/mptrack/ModConvert.h
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.h 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/ModConvert.h 2011-03-04 18:00:36 UTC (rev 808)
@@ -34,6 +34,7 @@
wReleaseNode,
wEditHistory,
wMixmode,
+ wCompatibilityMode,
wNumWarnings
};
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-04 18:00:36 UTC (rev 808)
@@ -323,6 +323,8 @@
bool RemoveChannels(bool bChnMask[MAX_BASECHANNELS]);
+ bool RestartPosToPattern();
+
bool HasMPTHacks(bool autofix = false);
void FixNullStrings();
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -474,7 +474,7 @@
{
if(pIns == nullptr)
return;
- memset(pIns, 0, sizeof(MODINSTRUMENT));
+ MemsetZero(*pIns);
pIns->nFadeOut = 256;
pIns->nGlobalVol = 64;
pIns->nPan = 128;
@@ -1276,3 +1276,16 @@
}
+// Convert the module's restart position information to a pattern command.
+bool CModDoc::RestartPosToPattern()
+//---------------------------------
+{
+ bool result = false;
+ GetLengthType length = m_SndFile.GetLength(false);
+ if(length.endOrder != ORDERINDEX_INVALID && length.endRow != ROWINDEX_INVALID)
+ {
+ result = m_SndFile.TryWriteEffect(m_SndFile.Order[length.endOrder], length.endRow, CMD_POSITIONJUMP, m_SndFile.m_nRestartPos, false, CHANNELINDEX_INVALID, false, true);
+ }
+ m_SndFile.m_nRestartPos = 0;
+ return result;
+}
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/mptrack/version.h 2011-03-04 18:00:36 UTC (rev 808)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 26
+#define VER_MINORMINOR 27
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -80,16 +80,18 @@
// [in] endRow: Row in that order that should be reached
// [out] duration: total time in seconds
// [out] targetReached: true if the specified order/row combination has been reached while going through the module.
-// [out] endOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order)
-// [out] endRow: last parsed row (dito)
+// [out] lastOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order)
+// [out] lastRow: last parsed row (dito)
+// [out] endOrder: last order before module loops (UNDEFINED if a target is specified)
+// [out] endRow: last row before module loops (dito)
GetLengthType CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow)
//-------------------------------------------------------------------------------------
{
GetLengthType retval;
retval.duration = 0.0;
retval.targetReached = false;
- retval.endOrder = ORDERINDEX_INVALID;
- retval.endRow = ROWINDEX_INVALID;
+ retval.lastOrder = retval.endOrder = ORDERINDEX_INVALID;
+ retval.lastRow = retval.endRow = ROWINDEX_INVALID;
// -> CODE#0022
// -> DESC="alternative BPM/Speed interpretation method"
@@ -174,6 +176,9 @@
if(IsRowVisited(nCurrentPattern, nRow, true, &visitedRows))
break;
+ retval.endOrder = nCurrentPattern;
+ retval.endRow = nRow;
+
// Update next position
nNextRow = nRow + 1;
@@ -423,8 +428,8 @@
if(retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID)
{
- retval.endOrder = nCurrentPattern;
- retval.endRow = nRow;
+ retval.lastOrder = nCurrentPattern;
+ retval.lastRow = nRow;
}
retval.duration = dElapsedTime / 1000.0;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-04 18:00:36 UTC (rev 808)
@@ -369,7 +369,7 @@
{
DWORD dwPluginId1;
DWORD dwPluginId2;
- DWORD dwInputRouting; // MIXPLUG_INPUTF_XXXX
+ DWORD dwInputRouting; // MIXPLUG_INPUTF_XXXX, bits 16-23 = gain
DWORD dwOutputRouting; // 0=mix 0x80+=fx
DWORD dwReserved[4]; // Reserved for routing info
CHAR szName[32];
@@ -492,8 +492,10 @@
{
double duration; // total time in seconds
bool targetReached; // true if the specified order/row combination has been reached while going through the module
- ORDERINDEX endOrder; // last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order)
- ROWINDEX endRow; // last parsed row (dito)
+ ORDERINDEX lastOrder; // last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order)
+ ROWINDEX lastRow; // last parsed row (dito)
+ ORDERINDEX endOrder; // last order before module loops (UNDEFINED if a target is specified)
+ ROWINDEX endRow; // last row before module loops (dito)
};
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -789,7 +789,7 @@
// Let's check again if this really is the end of the song.
// The visited rows vector might have been screwed up while editing...
GetLengthType t = GetLength(false);
- if(t.endOrder == m_nCurrentPattern && t.endRow == m_nRow)
+ if(t.lastOrder == m_nCurrentPattern && t.lastRow == m_nRow)
#endif // MODPLUG_TRACKER
{
// This is really the song's end!
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2011-03-04 17:52:53 UTC (rev 807)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-03-04 18:00:36 UTC (rev 808)
@@ -656,11 +656,17 @@
bAllowMultipleEffects - If false, No effect will be written if an effect of the same type is already present in the channel(s). Useful for f.e. tempo effects.
bAllowNextRow - Indicates whether it is allowed to use the next row if there's no space for the effect
bRetry - For internal use only. Indicates whether an effect "rewrite" has already taken place (for recursive calls)
+ NOTE: Effect remapping is only implemented for a few basic effects.
*/
bool CSoundFile::TryWriteEffect(PATTERNINDEX nPat, ROWINDEX nRow, BYTE nEffect, BYTE nParam, bool bIsVolumeEffect, CHANNELINDEX nChn, bool bAllowMultipleEffects, bool bAllowNextRow, bool bRetry)
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{
- // NOTE: Effect remapping is only implemented for a few basic effects.
+ // First, reject invalid parameters.
+ if(!Patterns.IsValidIndex(nPat) || nRow >= Patterns[nPat].GetNumRows() || (nChn >= GetNumChannels() && nChn != CHANNELINDEX_INVALID))
+ {
+ return false;
+ }
+
CHANNELINDEX nScanChnMin = nChn, nScanChnMax = nChn;
MODCOMMAND *p = Patterns[nPat], *m;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-03-04 17:53:00
|
Revision: 807
http://modplug.svn.sourceforge.net/modplug/?rev=807&view=rev
Author: saga-games
Date: 2011-03-04 17:52:53 +0000 (Fri, 04 Mar 2011)
Log Message:
-----------
[Imp] Installer: Recommends to install KernelEx on Win98 / WinME now.
[Ref] Updated installer documentation
Modified Paths:
--------------
trunk/OpenMPT/installer/install-unmo3-free-itd.iss
trunk/OpenMPT/installer/install-unmo3-free.iss
trunk/OpenMPT/installer/install.iss
Modified: trunk/OpenMPT/installer/install-unmo3-free-itd.iss
===================================================================
--- trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-02-27 22:24:02 UTC (rev 806)
+++ trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-03-04 17:52:53 UTC (rev 807)
@@ -6,8 +6,8 @@
; This file is provided for creating an install package without the proprietary unmo3.dll (for example for the SourceForge package).
; Instead of including the file in the setup package, the user instead has the possibility to automatically download unmo3.dll from
; our servers.
-; The download code requires the InnoIDE with its downloader extension which currently only works in ANSI version! ISPP is also required.
-; To download and install ISPP and InnoIDE, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp (don't use the unicode pack!)
+; The download code requires the InnoIDE with its downloader extension which currently only works in ANSI version!
+; To download and install InnoIDE, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp (don't use the unicode pack!)
; it_download.iss and it_download.dll have to be placed in same directory as the file you are currently viewing.
#define DOWNLOAD_MO3
Modified: trunk/OpenMPT/installer/install-unmo3-free.iss
===================================================================
--- trunk/OpenMPT/installer/install-unmo3-free.iss 2011-02-27 22:24:02 UTC (rev 806)
+++ trunk/OpenMPT/installer/install-unmo3-free.iss 2011-03-04 17:52:53 UTC (rev 807)
@@ -6,9 +6,7 @@
; This file is provided for creating an install package without the proprietary unmo3.dll (for example for the SourceForge package).
; Instead of including the file in the setup package, the user instead has the possibility to automatically download unmo3.dll from
; our servers.
-; The download code requires the ISTool IDE with its downloader extension. ISPP is also required.
-; To download and install ISPP, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp
-; The QuickStart Pack doesn't provide a ISTool downloader anymore, so you'll have to download it manually from http://www.istool.org/
+; The download code requires the ISTool IDE with its downloader extension. You can download it from http://www.istool.org/
#define DOWNLOAD_MO3
#define BaseNameAddition "_sf"
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-02-27 22:24:02 UTC (rev 806)
+++ trunk/OpenMPT/installer/install.iss 2011-03-04 17:52:53 UTC (rev 807)
@@ -3,10 +3,10 @@
; http://openmpt.org/
; http://sagamusix.de/
-; ISPP is needed for automated version retrieval.
+; ISPP is needed for automated version retrieval. Since InnoSetup 5.4.1, ISPP is included in the default InnoSetup installer.
; Furthermore, either the ISTool IDE or InnoIDE with their downloader extensions are required for "unmo3-free" packages which don't contain unmo3.dll, but download it from a server.
-; Check install-unmo3-free.iss and install-unmo3-free-itd.iss for details on this matter.
-; To download and install ISPP and InnoIDE, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp
+; Check install-unmo3-free.iss (ISTool) and install-unmo3-free-itd.iss (InnoIDE) for details on this matter.
+; To download and install InnoIDE, get the Inno Setup QuickStart Pack from http://www.jrsoftware.org/isdl.php#qsp
#define GetAppVersion StringChange(GetFileProductVersion("..\mptrack\bin\mptrack.exe"), ",", ".")
#define GetAppVersionShort Copy(GetAppVersion, 1, 4)
@@ -68,7 +68,7 @@
Source: ..\packageTemplate\ExampleSongs\*.*; DestDir: {app}\ExampleSongs\; Flags: ignoreversion sortfilesbyextension
Source: packageTemplate\readme.txt; DestDir: {app}; Flags: ignoreversion
-Source: ..\packageTemplate\history.txt; DestDir: {app}; Flags: ignoreversion
+Source: ..\packageTemplate\History.txt; DestDir: {app}; Flags: ignoreversion
; release notes
Source: ..\packageTemplate\ReleaseNotesImages\general\*.*; DestDir: {app}\ReleaseNotesImages\general\; Flags: ignoreversion sortfilesbyextension
@@ -114,6 +114,7 @@
[Run]
; duh
Filename: {app}\mptrack.exe; Parameters: """{app}\ExampleSongs\xaimus - digital sentience.it"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: nowait postinstall skipifsilent
+Filename: "https://sourceforge.net/projects/kernelex/"; Description: "Download KernelEx (required on Windows 98 / Me)"; Flags: shellexec nowait postinstall skipifsilent; Check: not UsingWinNT();
[UninstallDelete]
; internet shortcut has to be deleted manually
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-02-27 22:24:08
|
Revision: 806
http://modplug.svn.sourceforge.net/modplug/?rev=806&view=rev
Author: saga-games
Date: 2011-02-27 22:24:02 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
[Fix] Sample Undo didn't preserve the sample name.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Undo.cpp
trunk/OpenMPT/mptrack/Undo.h
Modified: trunk/OpenMPT/mptrack/Undo.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Undo.cpp 2011-02-27 17:20:20 UTC (rev 805)
+++ trunk/OpenMPT/mptrack/Undo.cpp 2011-02-27 22:24:02 UTC (rev 806)
@@ -251,6 +251,7 @@
// Save old sample header
memcpy(&sUndo.OldSample, &pSndFile->Samples[nSmp], sizeof(MODSAMPLE));
+ memcpy(sUndo.szOldName, pSndFile->m_szNames[nSmp], sizeof(sUndo.szOldName));
sUndo.nChangeType = nChangeType;
if(nChangeType == sundo_replace)
@@ -386,6 +387,7 @@
// Restore old sample header
memcpy(&pSndFile->Samples[nSmp], &pUndo->OldSample, sizeof(MODSAMPLE));
pSndFile->Samples[nSmp].pSample = pCurrentSample; // select the "correct" old sample
+ memcpy(pSndFile->m_szNames[nSmp], pUndo->szOldName, sizeof(pUndo->szOldName));
if(pNewSample != nullptr)
{
Modified: trunk/OpenMPT/mptrack/Undo.h
===================================================================
--- trunk/OpenMPT/mptrack/Undo.h 2011-02-27 17:20:20 UTC (rev 805)
+++ trunk/OpenMPT/mptrack/Undo.h 2011-02-27 22:24:02 UTC (rev 806)
@@ -82,6 +82,7 @@
struct SAMPLEUNDOBUFFER
{
MODSAMPLE OldSample;
+ CHAR szOldName[MAX_SAMPLENAME];
LPSTR SamplePtr;
UINT nChangeStart, nChangeEnd;
sampleUndoTypes nChangeType;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-02-27 17:20:26
|
Revision: 805
http://modplug.svn.sourceforge.net/modplug/?rev=805&view=rev
Author: saga-games
Date: 2011-02-27 17:20:20 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
[New] Sample Editor: New keyboard shortcut: Quick fade for samples. If the sample start is selected, a fade-in is automatically performed. Likewise, if the sample end is selected, a fade-out is performed. If neither is selected, the default amplification dialog is shown.
[Mod] Updated DE_jojo.mkb: Changed shortcut for DC Offset removal, added Quick fade shortcut for samples.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/CommandSet.cpp
trunk/OpenMPT/mptrack/CommandSet.h
trunk/OpenMPT/mptrack/Ctrl_smp.cpp
trunk/OpenMPT/mptrack/Ctrl_smp.h
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/View_smp.h
trunk/OpenMPT/mptrack/resource.h
trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
Modified: trunk/OpenMPT/mptrack/CommandSet.cpp
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-02-27 17:20:20 UTC (rev 805)
@@ -602,6 +602,7 @@
DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Ignore (+++) Index"));
DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index"));
DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History"));
+ DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade"));
// Add new key commands here.
#ifdef _DEBUG
Modified: trunk/OpenMPT/mptrack/CommandSet.h
===================================================================
--- trunk/OpenMPT/mptrack/CommandSet.h 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/CommandSet.h 2011-02-27 17:20:20 UTC (rev 805)
@@ -611,7 +611,8 @@
kcSampleInvert,
kcSampleSignUnsign,
kcSampleRemoveDCOffset,
- kcEndSampleEditing=kcSampleRemoveDCOffset,
+ kcSampleQuickFade,
+ kcEndSampleEditing=kcSampleQuickFade,
//kcSampStartNotes to kcInsNoteMapEndNoteStops must be contiguous.
kcSampStartNotes,
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-02-27 17:20:20 UTC (rev 805)
@@ -475,6 +475,10 @@
OnAmplify();
break;
+ case IDC_SAMPLE_QUICKFADE:
+ OnQuickFade();
+ break;
+
case IDC_SAMPLE_OPEN:
OnSampleOpen();
break;
@@ -1351,6 +1355,26 @@
}
+// Quickly fade the selection in/out without asking the user.
+// Fade-In is applied if the selection starts at the beginning of the sample.
+// Fade-Out is applied if the selection ends and the end of the sample.
+void CCtrlSamples::OnQuickFade()
+//------------------------------
+{
+ if ((!m_pSndFile) || (!m_pSndFile->Samples[m_nSample].pSample)) return;
+
+ SELECTIONPOINTS sel = GetSelectionPoints();
+ if(sel.bSelected && (sel.nStart == 0 || sel.nEnd == m_pSndFile->Samples[m_nSample].nLength))
+ {
+ ApplyAmplify(100, (sel.nStart == 0), (sel.nEnd == m_pSndFile->Samples[m_nSample].nLength));
+ } else
+ {
+ // Can't apply quick fade as no appropriate selection has been made, so ask the user to amplify the whole sample instead.
+ OnAmplify();
+ }
+}
+
+
const int gSinc2x16Odd[16] =
{ // Kaiser window, beta=7.400
-19, 97, -295, 710, -1494, 2958, -6155, 20582, 20582, -6155, 2958, -1494, 710, -295, 97, -19,
Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-02-27 17:20:20 UTC (rev 805)
@@ -82,6 +82,7 @@
afx_msg void OnSamplePlay();
afx_msg void OnNormalize();
afx_msg void OnAmplify();
+ afx_msg void OnQuickFade();
afx_msg void OnRemoveDCOffset();
afx_msg void OnUpsample();
afx_msg void OnDownsample();
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-02-27 17:20:20 UTC (rev 805)
@@ -92,6 +92,7 @@
ON_COMMAND(ID_SAMPLE_DRAW, OnDrawingToggle)
ON_COMMAND(ID_SAMPLE_ADDSILENCE, OnAddSilence)
ON_COMMAND(ID_SAMPLE_GRID, OnChangeGridSize)
+ ON_COMMAND(ID_SAMPLE_QUICKFADE, OnQuickFade)
ON_MESSAGE(WM_MOD_MIDIMSG, OnMidiMsg)
ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys
//}}AFX_MSG_MAP
@@ -1524,11 +1525,11 @@
sTrimMenuText += "\t" + ih->GetKeyTextFromCommand(kcSampleTrim);
- // change by jojo: "trim" menu item is also available
- // if there's no selection, but loop points
- //::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED,
- // ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim));
::AppendMenu(hMenu, MF_STRING|(bIsGrayed) ? MF_GRAYED : 0, ID_SAMPLE_TRIM, sTrimMenuText.c_str());
+ if((m_dwBeginSel == 0 && m_dwEndSel != 0) || (m_dwBeginSel < pSmp->nLength && m_dwEndSel == pSmp->nLength))
+ {
+ ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_QUICKFADE, "Quick fade\t" + ih->GetKeyTextFromCommand(kcSampleQuickFade));
+ }
::AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut));
::AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy));
}
@@ -2645,6 +2646,7 @@
case kcSampleInvert: PostCtrlMessage(IDC_SAMPLE_INVERT); return wParam;
case kcSampleSignUnsign: PostCtrlMessage(IDC_SAMPLE_SIGN_UNSIGN); return wParam;
case kcSampleRemoveDCOffset: PostCtrlMessage(IDC_SAMPLE_DCOFFSET); return wParam;
+ case kcSampleQuickFade: PostCtrlMessage(IDC_SAMPLE_QUICKFADE); return wParam;
case kcNoteOff: PlayNote(NOTE_KEYOFF); return wParam;
case kcNoteCut: PlayNote(NOTE_NOTECUT); return wParam;
Modified: trunk/OpenMPT/mptrack/View_smp.h
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.h 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/View_smp.h 2011-02-27 17:20:20 UTC (rev 805)
@@ -129,6 +129,7 @@
afx_msg void OnDrawingToggle();
afx_msg void OnAddSilence();
afx_msg void OnChangeGridSize();
+ afx_msg void OnQuickFade() { PostCtrlMessage(IDC_SAMPLE_QUICKFADE); };
afx_msg LRESULT OnMidiMsg(WPARAM, LPARAM);
afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
Modified: trunk/OpenMPT/mptrack/resource.h
===================================================================
--- trunk/OpenMPT/mptrack/resource.h 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/mptrack/resource.h 2011-02-27 17:20:20 UTC (rev 805)
@@ -927,6 +927,7 @@
#define IDC_BTN_CLEAR 2430
#define IDC_TOTAL_EDIT_TIME 2431
#define IDC_EDIT_HISTORY 2432
+#define IDC_SAMPLE_QUICKFADE 2433
#define ID_FILE_NEWMOD 32771
#define ID_FILE_NEWXM 32772
#define ID_FILE_NEWS3M 32773
@@ -1187,6 +1188,7 @@
#define ID_PANIC 60451
#define ID_VIEW_EDITHISTORY 60452
#define ID_SAMPLE_GRID 60453
+#define ID_SAMPLE_QUICKFADE 60454
// Next default values for new objects
//
@@ -1194,8 +1196,8 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 528
-#define _APS_NEXT_COMMAND_VALUE 60454
-#define _APS_NEXT_CONTROL_VALUE 2433
+#define _APS_NEXT_COMMAND_VALUE 60455
+#define _APS_NEXT_CONTROL_VALUE 2434
#define _APS_NEXT_SYMED_VALUE 901
#endif
#endif
Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb
===================================================================
--- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-02-26 19:24:53 UTC (rev 804)
+++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-02-27 17:20:20 UTC (rev 805)
@@ -280,7 +280,8 @@
8:1387:0:109:1 //Zoom In: - (ZEHNERTASTATUR) (KeyDown)
8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown)
8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown)
-8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown)
+8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown)
+8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown)
//----( Instrument Context [bottom] (9) )------------
9:1837:0:107:5 //Zoom In: + (ZEHNERTASTATUR) (KeyDown|KeyHold)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-02-26 19:25:02
|
Revision: 804
http://modplug.svn.sourceforge.net/modplug/?rev=804&view=rev
Author: saga-games
Date: 2011-02-26 19:24:53 +0000 (Sat, 26 Feb 2011)
Log Message:
-----------
[Mod] Updated various documents, installer URLs, etc.
Modified Paths:
--------------
trunk/OpenMPT/installer/install.iss
trunk/OpenMPT/installer/packageTemplate/readme.txt
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
trunk/OpenMPT/packageTemplate/readme.txt
Added Paths:
-----------
trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png
trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png
Modified: trunk/OpenMPT/installer/install.iss
===================================================================
--- trunk/OpenMPT/installer/install.iss 2011-02-26 19:22:28 UTC (rev 803)
+++ trunk/OpenMPT/installer/install.iss 2011-02-26 19:24:53 UTC (rev 804)
@@ -21,9 +21,9 @@
AppVersion={#GetAppVersion}
AppName=OpenMPT
AppPublisher=OpenMPT Devs / Olivier Lapicque
-AppPublisherURL=http://openmpt.com/
-AppSupportURL=http://openmpt.com/forum/
-AppUpdatesURL=http://openmpt.com/
+AppPublisherURL=http://openmpt.org/
+AppSupportURL=http://forum.openmpt.org/
+AppUpdatesURL=http://openmpt.org/
DefaultDirName={pf}\OpenMPT
DefaultGroupName=OpenMPT
AllowNoIcons=yes
@@ -109,7 +109,7 @@
; enable portable mode
Filename: {app}\mptrack.ini; Section: Paths; Key: UseAppDataDirectory; String: 0; Flags: createkeyifdoesntexist; Tasks: portable
; internet shortcut
-Filename: {app}\ModPlug Central.url; Section: InternetShortcut; Key: URL; String: http://openmpt.com/forum/; Flags: createkeyifdoesntexist
+Filename: {app}\ModPlug Central.url; Section: InternetShortcut; Key: URL; String: http://forum.openmpt.org/; Flags: createkeyifdoesntexist
[Run]
; duh
Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt
===================================================================
--- trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-02-26 19:22:28 UTC (rev 803)
+++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-02-26 19:24:53 UTC (rev 804)
@@ -1,5 +1,5 @@
******************
-* OpenMPT 1.18 *
+* OpenMPT 1.19 *
******************
@@ -21,13 +21,15 @@
Changes
-------
-See history.txt.
+See History.txt.
Questions, comments, bug reports...
-----------------------------------
-See forums at http://openmpt.com/forum/.
+For help and general talk, visit our forums at http://forum.openmpt.org/.
+If you found a bug or want to request a new feature, you can do so at our issue
+tracker at http://bugs.openmpt.org/
Release package contents:
@@ -45,14 +47,14 @@
stretching feature.
readme.txt: this document
unmo3.dll: Used in MO3-file import.
-OMPT_1.18_ReleaseNotes.html: Release notes for this version.
+OMPT_1.19_ReleaseNotes.html: Release notes for this version.
Misc:
-----
OpenMPT is partially under the following license:
-> Copyright (c) 2004-2010, OpenMPT contributors
+> Copyright (c) 2004-2011, OpenMPT contributors
> Copyright (c) 1997-2003, Olivier Lapicque
> All rights reserved.
>
@@ -86,7 +88,7 @@
unmo3.dll
---------
-Copyright (c) 2001-2009 Ian Luck. All rights reserved
+Copyright (c) 2001-2011 Ian Luck. All rights reserved
The MO3 software is free for non-commercial use; if anyone tries to
charge you for it, kick 'em where it hurts!
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-02-26 19:22:28 UTC (rev 803)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-02-26 19:24:53 UTC (rev 804)
@@ -10,7 +10,7 @@
(tx XYZ): thanks to XYZ for telling us about the bug
-v1.19.01.00 (February 2011, revision 802)
+v1.19.01.00 (February 2011, revision 803)
-----------------------------------------
Pattern tab
[New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45
@@ -26,6 +26,7 @@
[Fix] <Jojo> Changing a channel name from the pattern editor didn't set the document as modified (http://bugs.openmpt.org/view.php?id=65)
[Fix] <Jojo> When restarting a pattern, the timer was not reset properly.
[Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event.
+ [Fix] <Jojo> Automation data is not written to the pattern if the current module format does not support smooth midi macros.
[Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed.
Pattern tab::Note properties
@@ -114,6 +115,7 @@
[Mod] <Jojo> Various small improvements to support VST 2.4 plugins better.
[Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins?
[Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible.
+ [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
Other modules
[Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names.
Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2011-02-26 19:22:28 UTC (rev 803)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2011-02-26 19:24:53 UTC (rev 804)
@@ -196,7 +196,7 @@
</p>
<ul>
<li>Lacking support for VST 2.4+</li>
- <li>Some controls are vanishing randomly all the time, most notably under Windows Vista and Windows 7.</li>
+ <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li>
<li>Previewing samples from the treeview's file browser stops the playing module.</li>
<li>Cannot preview instruments directly from the MIDI library in the treeview.</li>
<li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li>
Added: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html (rev 0)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-02-26 19:24:53 UTC (rev 804)
@@ -0,0 +1,156 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>OpenMPT 1.19 Release Notes</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="language" content="en" />
+ <style type="text/css">
+ * { font-family: sans-serif; }
+ body
+ {
+ color: #000;
+ background: #fff;
+ font-size:12pt;
+ }
+
+ a { color: #00c; text-decoration: none; }
+ a:visited { color: #909; text-decoration: none; }
+ a:hover { text-decoration: underline; }
+
+ .screenshots
+ {
+ float:right;
+ text-align:right;
+ }
+
+ .screenshots img, h1
+ {
+ border: 1px solid #ccc;
+ padding: 3px;
+ background: #eee;
+ margin: 0 0 3px 3px;
+ }
+
+ p { padding: 5px; }
+
+ h1
+ {
+ margin: 0;
+ font-size:24pt;
+ }
+ h1 img { vertical-align: middle; }
+
+ h2, h3, h4
+ {
+ border: 1px solid #ddd;
+ border-width: 0 0 0 3em;
+ margin: 15px 5px;
+ padding: 0px 5px;
+ font-size: 18pt;
+ }
+
+ h3 { border-left-width: 2em; }
+ h4 { border-left-width: 1em; }
+
+ li {list-style-type: none; padding: 0 0 1em 0; }
+ li:before { content: "» "; }
+
+ li li { padding: 0; }
+
+ /* use this for pattern data */
+ pre
+ {
+ font-family: monospace;
+ display: inline;
+ color: #006;
+ }
+
+ </style>
+ </head>
+ <body>
+
+ <h1>
+ <img src="ReleaseNotesImages/general/modplug.png" width="114" height="110" alt="OpenMPT Logo" />
+ OpenMPT 1.19 - Release Notes
+ </h1>
+
+ <p>
+ OpenMPT has introduced a number of noteworthy new features since the last official release (version 1.18.03.00).
+ This document should give a rough overview about the greatest changes in OpenMPT 1.19.
+ </p>
+
+ <h2>What's new?</h2>
+
+ <h3>General</h3>
+ <div class="screenshots">
+ <a href="ReleaseNotesImages/1.19/edithistory.png"><img src="ReleaseNotesImages/1.19/edithistory.png" width="240" height="163" alt="Edit history dialog" title="Edit history dialog (click to view big screenshot)" /></a>
+ </div>
+ <ul>
+ <li>Based on an undocumented feature in Impulse Tracker, OpenMPT can now save an <strong>edit history</strong> in IT and MPTM files, which reveals when and for how long a module has been edited in the tracker.</li>
+ <li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li>
+ <li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li>
+ <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li>
+ <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li>
+ <li>The instrument list on the comments tab also shows <strong>assigned plugins</strong> now.</li>
+ <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist)</li>
+ <li>Changes to <strong>keymap file handling</strong>: The active keymap is now always saved to Keybindings.mkb. Any other keymaps are now only overwritten when using the "Save keys as" function.</li>
+ <li>When using the ACM MP3 codec, 320kbit/s bitrate should now be available.</li>
+ </ul>
+
+ <h3>Pattern Editor</h3>
+ <div class="screenshots">
+ <img src="ReleaseNotesImages/1.19/timesignature.png" width="291" height="228" alt="Per-pattern time signatures" title="Per-pattern time signatures" />
+ </div>
+ <ul>
+ <li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li>
+ <li>You can now <strong>select a whole row</strong> by clicking the row index on the left side of the pattern.</li>
+ <li>The search feature has been extended to allow for <strong>searching in pattern selections</strong>.</li>
+ <li>Furthermore, the usability of the Find / Replace dialog has been improved: Corresponding checkboxes are now automatically ticked when the value of a dropdown box has been changed. "Replace All" no longer creates an undo point for every replaced command.</li>
+ <li>It is now possible to <strong>play the whole pattern row when entering notes</strong> and chords into the pattern editor. This behaviour can be enabled from the setup screen.</li>
+ </ul>
+
+ <h3>Compatibility</h3>
+ <ul>
+ <li>Sample <strong>auto-vibrato</strong> in IT files sounds a lot closer to Impulse Tracker's implementation now.</li>
+ <li>IT files not saved using compatibility export can now finally be opened in Impulse Tracker again.</li>
+ <li>The new <strong>compatible mix mode</strong> should be used when composing music in the XM and IT format (it is automatically used when working with MOD and S3M). It uses the same volume levels and panning settings as Schism Tracker and should therefore allow for easier interchange of tracked tunes between various trackers.</li>
+ <li>The MOD loader has been extended with heuristic detection methods for files with 7-bit panning, VBlank MODs and MODs made with ProTracker 1.x.</li>
+ <li>As always, countless other <strong>playback compatibility fixes</strong> have made it into this version of OpenMPT.</li>
+ </ul>
+
+ <h3>VST Plugins</h3>
+ <ul>
+ <li><strong>Much improved compatibility</strong> with many VST 2.4 plugins! Examples of plugins that work better in this version: Voxengo SPAN 2, Angelina, EnergyXT, MetroGnome.</li>
+ </ul>
+
+ <h3>There's more...</h3>
+ <p>
+ For a detailed description of what has changed, check <a href="History.txt">History.txt</a>.
+ </p>
+
+ <h2>Known Issues</h2>
+ <p>
+ <i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i>
+ </p>
+ <ul>
+ <li>Far from perfect VST support (routing, etc...)</li>
+ <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li>
+ <li>Previewing samples from the treeview's file browser stops the playing module.</li>
+ <li>Cannot preview instruments directly from the MIDI library in the treeview.</li>
+ <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li>
+ <li>The Right Alt (or Alt Gr) key is not handled well by the keyboard configuration.</li>
+ <li>In Windows 98, the graphical parameter editor and instrument envelope editor grid display are messed up.</li>
+ <li>There is no real way to find out what features of the tracker are supported by the original trackers (Impulse Tracker, Fasttracker 2, etc...) when working with those file formats...</li>
+ </ul>
+
+ <h2>Contact</h2>
+ <p>
+ Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome!<br />
+ Our issue tracker is located at <a href="http://bugs.openmpt.org/">http://bugs.openmpt.org/</a> and can be used to report bugs and feature requests.<br />
+ You can also meet us at the ModPlug Central forums: <a href="http://forum.openmpt.org/">http://forum.openmpt.org/</a>.
+ </p>
+
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19
___________________________________________________________________
Added: tsvn:logminsize
+ 10
Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png
===================================================================
(Binary files differ)
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png
===================================================================
(Binary files differ)
Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/OpenMPT/packageTemplate/readme.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/readme.txt 2011-02-26 19:22:28 UTC (rev 803)
+++ trunk/OpenMPT/packageTemplate/readme.txt 2011-02-26 19:24:53 UTC (rev 804)
@@ -1,15 +1,17 @@
******************
-* OpenMPT 1.18 *
+* OpenMPT 1.19 *
******************
Installation
------------
--If you have an existing installation of OpenMPT and wish to re-use its
+-If you have an existing portable installation of OpenMPT and wish to re-use its
settings, copy your mptrack.ini and plugin.cache to the directory into which
you extract the archive.
--If not, you're done: just extract the archive and launch mptrack.exe.
+-If there is no previous installation or if you have an existing standard
+ installation of OpenMPT, you're done: just extract the archive and launch
+ mptrack.exe.
Uninstallation
@@ -28,17 +30,23 @@
[Paths]
UseAppDataDirectory=0
+Alternatively, you can copy your existing configuration file over from
+%appdata%\OpenMPT and add UseAppDataDirectory=0 in the [Paths] section of this
+file.
+
Changes
-------
-See history.txt.
+See History.txt.
Questions, comments, bug reports...
-----------------------------------
-See forums at http://openmpt.com/forum/.
+For help and general talk, visit our forums at http://forum.openmpt.org/.
+If you found a bug or want to request a new feature, you can do so at our issue
+tracker at http://bugs.openmpt.org/
Release package contents:
@@ -55,7 +63,7 @@
stretching feature.
readme.txt: this document
unmo3.dll: Used in MO3-file import.
-OMPT_1.18_ReleaseNotes.html: Release notes for this version.
+OMPT_1.19_ReleaseNotes.html: Release notes for this version.
Misc:
@@ -63,7 +71,7 @@
OpenMPT is partially under the following license:
-> Copyright (c) 2004-2010, OpenMPT contributors
+> Copyright (c) 2004-2011, OpenMPT contributors
> Copyright (c) 1997-2003, Olivier Lapicque
> All rights reserved.
>
@@ -97,7 +105,7 @@
unmo3.dll
---------
-Copyright (c) 2001-2009 Ian Luck. All rights reserved
+Copyright (c) 2001-2011 Ian Luck. All rights reserved
The MO3 software is free for non-commercial use; if anyone tries to
charge you for it, kick 'em where it hurts!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-02-26 19:22:35
|
Revision: 803
http://modplug.svn.sourceforge.net/modplug/?rev=803&view=rev
Author: saga-games
Date: 2011-02-26 19:22:28 +0000 (Sat, 26 Feb 2011)
Log Message:
-----------
[Fix] The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0)
[Fix] Pattern Editor: Automation data is not written to the pattern if the current module format does not support smooth midi macros.
[Mod] OpenMPT: Version is now 1.19.00.26
Modified Paths:
--------------
trunk/OpenMPT/mptrack/VSTEditor.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/VSTEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/VSTEditor.cpp 2011-02-20 15:28:53 UTC (rev 802)
+++ trunk/OpenMPT/mptrack/VSTEditor.cpp 2011-02-26 19:22:28 UTC (rev 803)
@@ -97,7 +97,7 @@
{
#ifdef VST_LOG
Log("CVstEditor::DoClose()\n");
-#endif
+#endif // VST_LOG
if ((m_pVstPlugin) && (m_hWnd))
{
CRect rect;
@@ -105,20 +105,23 @@
m_pVstPlugin->m_nEditorX = rect.left;
m_pVstPlugin->m_nEditorY = rect.top;
}
+ if (m_pVstPlugin)
+ {
+#ifdef VST_LOG
+ Log("Dispatching effEditClose...\n");
+#endif // VST_LOG
+ m_pVstPlugin->Dispatch(effEditClose, 0, 0, NULL, 0);
+ }
if (m_hWnd)
{
- #ifdef VST_LOG
+#ifdef VST_LOG
Log("Destroying window...\n");
- #endif
+#endif // VST_LOG
+ // Initially, this was called before the last Dispatch() call.
+ // Now it's done after that call so that energyXT's GUI still works after re-opening the VST editor.
+ // Let's hope that other plugins don't break...
DestroyWindow();
}
- if (m_pVstPlugin)
- {
- #ifdef VST_LOG
- Log("Dispatching effEditClose...\n");
- #endif
- m_pVstPlugin->Dispatch(effEditClose, 0, 0, NULL, 0);
- }
}
#endif // NO_VST
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-20 15:28:53 UTC (rev 802)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-26 19:22:28 UTC (rev 803)
@@ -3065,11 +3065,13 @@
{
CModDoc *pModDoc = GetDocument();
//if (!m_bRecord || !pModDoc) {
- if (!IsEditingEnabled() || !pModDoc) {
+ if (!IsEditingEnabled() || !pModDoc)
+ {
return 0;
}
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if (!pSndFile) {
+ if (!pSndFile)
+ {
return 0;
}
@@ -3081,8 +3083,6 @@
if(bUsePlaybackPosition == true)
SetEditPos(*pSndFile, nRow, nPattern, pSndFile->m_nRow, pSndFile->m_nPattern);
- pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1);
-
MODCOMMAND *pRow = pSndFile->Patterns[nPattern].GetpModCommand(nRow, nChn);
// TODO: Is the right plugin active? Move to a chan with the right plug
@@ -3098,10 +3098,12 @@
// only overwrite existing PC Notes
if(pRow->IsEmpty() || pRow->IsPcNote())
{
+ pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1);
+
pRow->Set(NOTE_PCS, plugSlot + 1, paramIndex, static_cast<uint16>(pPlug->GetParameter(paramIndex) * MODCOMMAND::maxColumnValue));
InvalidateRow(nRow);
}
- } else
+ } else if(pSndFile->GetModSpecifications().HasCommand(CMD_SMOOTHMIDI))
{
// Other formats: Use MIDI macros
@@ -3109,17 +3111,23 @@
long activePlugParam = -1;
BYTE activeMacro = pSndFile->Chn[nChn].nActiveMacro;
CString activeMacroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[activeMacro*32]);
- if (pModDoc->GetMacroType(activeMacroString) == sfx_plug) {
+ if (pModDoc->GetMacroType(activeMacroString) == sfx_plug)
+ {
activePlugParam = pModDoc->MacroToPlugParam(activeMacroString);
}
//If the wrong macro is active, see if we can find the right one.
//If we can, activate it for this chan by writing appropriate SFx command it.
- if (activePlugParam != paramIndex) {
+ if (activePlugParam != paramIndex)
+ {
int foundMacro = pModDoc->FindMacroForParam(paramIndex);
- if (foundMacro >= 0) {
+ if (foundMacro >= 0)
+ {
pSndFile->Chn[nChn].nActiveMacro = foundMacro;
- if (pRow->command == 0 || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) { //we overwrite existing Zxx and \xx only.
- pRow->command = (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))?CMD_S3MCMDEX:CMD_MODCMDEX;;
+ if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) //we overwrite existing Zxx and \xx only.
+ {
+ pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1);
+
+ pRow->command = (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) ? CMD_S3MCMDEX : CMD_MODCMDEX;;
pRow->param = 0xF0 + (foundMacro&0x0F);
InvalidateRow(nRow);
}
@@ -3128,7 +3136,10 @@
}
//Write the data, but we only overwrite if the command is a macro anyway.
- if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) {
+ if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI)
+ {
+ pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1);
+
pRow->command = CMD_SMOOTHMIDI;
pRow->param = pPlug->GetZxxParameter(paramIndex);
InvalidateRow(nRow);
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-02-20 15:28:53 UTC (rev 802)
+++ trunk/OpenMPT/mptrack/version.h 2011-02-26 19:22:28 UTC (rev 803)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 25
+#define VER_MINORMINOR 26
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2011-02-20 15:29:00
|
Revision: 802
http://modplug.svn.sourceforge.net/modplug/?rev=802&view=rev
Author: saga-games
Date: 2011-02-20 15:28:53 +0000 (Sun, 20 Feb 2011)
Log Message:
-----------
[Imp] Comments Tab: The instrument list also shows assigned plugins now.
[Fix] Pattern Editor: Entering a note-off event in the MOD format created an unnecessary undo event (one for the C effect, one of the 00 param).
[Mod] Updated History.txt
[Mod] OpenMPT: Version is now 1.19.00.25
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/mptrack/view_com.cpp
trunk/OpenMPT/packageTemplate/History.txt
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-16 13:26:26 UTC (rev 801)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-20 15:28:53 UTC (rev 802)
@@ -3913,8 +3913,8 @@
// Enter an effect letter in the pattenr
-void CViewPattern::TempEnterFX(int c)
-//-----------------------------------
+void CViewPattern::TempEnterFX(int c, int v)
+//------------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -3945,6 +3945,10 @@
m_cmdOld.command = c;
}
p->command = c;
+ if(v >= 0)
+ {
+ p->param = v;
+ }
// Check for MOD/XM Speed/Tempo command
if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM))
@@ -4261,8 +4265,7 @@
// Special case: Convert note off commands to C00 for MOD files
if((pSndFile->GetType() == MOD_TYPE_MOD) && (note == NOTE_NOTECUT || note == NOTE_FADE || note == NOTE_KEYOFF))
{
- TempEnterFX(CMD_VOLUME);
- TempEnterFXparam(0);
+ TempEnterFX(CMD_VOLUME, 0);
return;
}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2011-02-16 13:26:26 UTC (rev 801)
+++ trunk/OpenMPT/mptrack/View_pat.h 2011-02-20 15:28:53 UTC (rev 802)
@@ -201,7 +201,7 @@
void TempEnterIns(int val);
void TempEnterOctave(int val);
void TempEnterVol(int v);
- void TempEnterFX(int v);
+ void TempEnterFX(int c, int v = -1);
void TempEnterFXparam(int v);
void SetSpacing(int n);
void OnClearField(int, bool, bool=false);
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2011-02-16 13:26:26 UTC (rev 801)
+++ trunk/OpenMPT/mptrack/version.h 2011-02-20 15:28:53 UTC (rev 802)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 24
+#define VER_MINORMINOR 25
//Creates version number from version parts that appears in version string.
//For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of
Modified: trunk/OpenMPT/mptrack/view_com.cpp
===================================================================
--- trunk/OpenMPT/mptrack/view_com.cpp 2011-02-16 13:26:26 UTC (rev 801)
+++ trunk/OpenMPT/mptrack/view_com.cpp 2011-02-20 15:28:53 UTC (rev 802)
@@ -35,6 +35,7 @@
INSLIST_SAMPLES,
INSLIST_ENVELOPES,
INSLIST_FILENAME,
+ INSLIST_PLUGIN,
// -> CODE#0023
// -> DESC="IT project files (.itp)"
INSLIST_PATH,
@@ -68,6 +69,7 @@
{"Samples", 64},
{"Envelopes", 128},
{"File Name", 128},
+ {"Plugin", 128},
// -> CODE#0023
// -> DESC="IT project files (.itp)"
{"Path", 128},
@@ -398,6 +400,12 @@
s[sizeof(pIns->filename)] = 0;
}
break;
+ case INSLIST_PLUGIN:
+ if (pIns != nullptr && pIns->nMixPlug > 0 && pSndFile->m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin != nullptr)
+ {
+ wsprintf(s, "FX%02d: %s", pIns->nMixPlug, pSndFile->m_MixPlugins[pIns->nMixPlug - 1].Info.szLibraryName);
+ }
+ break;
// -> CODE#0023
// -> DESC="IT project files (.itp)"
case INSLIST_PATH:
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2011-02-16 13:26:26 UTC (rev 801)
+++ trunk/OpenMPT/packageTemplate/History.txt 2011-02-20 15:28:53 UTC (rev 802)
@@ -10,8 +10,8 @@
(tx XYZ): thanks to XYZ for telling us about the bug
-v1.19.01.00 (January 2011, revision 791)
-----------------------------------------
+v1.19.01.00 (February 2011, revision 802)
+-----------------------------------------
Pattern tab
[New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45
[New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen.
@@ -23,7 +23,9 @@
[Fix] <Jojo> When jumping to an order which is normally not played, the song variables are now reset (previously, if the main song had f.e. a global volume fade out at the end, this was retained when switching to an unplayed order, effectively muting all sub songs).
[Fix] <Jojo> OpenMPT should not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel.
[Fix] <Jojo> Queueing a "---" or "+++" item now automatically moves the queue "cursor" to the next available pattern. Previously, queueing a "---" pattern restarted the song.
+ [Fix] <Jojo> Changing a channel name from the pattern editor didn't set the document as modified (http://bugs.openmpt.org/view.php?id=65)
[Fix] <Jojo> When restarting a pattern, the timer was not reset properly.
+ [Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event.
[Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed.
Pattern tab::Note properties
@@ -35,6 +37,10 @@
[Imp] <Jojo> When changing the content of a combobox, the corresponding checkbox is now automatically checked. Likewise, the "Replace By" checkbox is checked if a checkbox or combobox on the "Replace" tab is enabled.
[Mod] <Jojo> "Replace All" just creates one undo point now.
+Pattern tab::GUI
+ [Imp] <Jojo> The dodgy note colour is now also customisable.
+ [Mod] <Jojo> When removing a channel (via context menu) that contains no data in any pattern, no warning is shown anymore.
+
Sample tab
[New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples.
[Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data.
@@ -61,6 +67,7 @@
Playback
[New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on.
[Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback).
+ [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (hehe). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works...
[Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0)
IT
@@ -68,6 +75,7 @@
[Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such.
[Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again.
[Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker).
+ [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer.
[Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode...
[Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C.
[Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now.
@@ -113,6 +121,7 @@
[Mod] <Jojo> Improved portamento import precision for DBM and ULT loaders (patch from Schism Tracker)
[Mod] <Jojo> Added a version check to the ITP loader (why was this not there in the first place?)
[Fix] <Jojo> As MTM files were converted to MOD automatically when being loaded, channel panning was lost. Now they're loaded as S3M instead.
+ [Fix] <Jojo> Short loops in AMF / MED files are now ignored (http://bugs.openmpt.org/view.php?id=70) - probably caused by bad MOD conversions, at least in the AMF example?
[Reg] <Jojo> Disabled the Velvet Studio loader for now, since it either crashes on almost all AMS files or at least imports them completely wrong.
Misc
@@ -121,16 +130,17 @@
[Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist)
[Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer.
[Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown.
+ [Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now.
[Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function.
[Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one).
[Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is.
[Mod] <Jojo> Updated genre list in the MP3 export dialog.
- [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now theoretically be available.
+ [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now be available.
[Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE)
[Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1
[Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven)
[Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes.
- [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings where expected.
+ [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected.
[Fix] <Jojo> When there was no INI file, the size of the upper pattern view was defaulting to a wrong value.
[Fix] <Jojo> The ID3v2 "comments" field was not formatted properly when exporting to MP3.
[Fix] <Jojo> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|