From: <sag...@us...> - 2009-08-08 21:26:22
|
Revision: 317 http://modplug.svn.sourceforge.net/modplug/?rev=317&view=rev Author: saga-games Date: 2009-08-08 21:26:10 +0000 (Sat, 08 Aug 2009) Log Message: ----------- [New] IT "Note Fade" command: This existed in IT's player routines already, but there was no way to actually use it in the editor. Triggering an invalid note would cause a note fade, so this is a new note type. Still needs to be mapped correctly on the keymaps. [Imp] Updated DE_jojo.mkb keymap ("Note Fade", "Remove DC Offset", "Invert Sample" and "Sign / Unsign Sample" shortcuts added) [Imp] Pattern editor: Added "~~" to drawable letters (for Note Fade) [Imp] Write ID3v2.4 instead of ID3v1 tags. Includes various changes to length limits, genre limitations and what's written in the tags. [Imp] Slight redesign of the WAV / MP3 export dialogs. [Ref] Tagging code (ID3, RIFF tags) has been moved to a seperate class (+ file), so adding different types of tags should be easier in the future. [Fix] General tab: VSTi / Sample volume sliders only go up to 255 instead of 256. Maybe this should be adjusted for every modtype in the future. [Fix] Find / Replace: Notes that cannot be used in the given format are not shown in the dropdown combo. [Fix] MOD Compatibility: 8-Bit Panning is not 7-Bit panning (using 800...8FF instead of 800...880 - fixes f.e. DOPE.MOD) [Imp] Note Properties: 8-Bit Panning slider also has the "Surround" state in S3M format now. [Imp] Format conversion: Even better conversion of various pattern effects, including 8-Bit Panning, Arpeggio (XM swaps the two parameters) including Surround, Note Cut/Off/Fade conversion, MOD retrigger, XM->IT volume column limitations, illegal notes) [Ref] Added IT_DEFS.H, tagging.cpp and tagging.h to the project files [Fix] Removed pelya's VST UID fix for now as it breaks loading of effect presets. It can be enabled by using the constant VST_USE_ALTERNATIVE_MAGIC. Adding a *third* ID for every plugin might be a better idea. [Fix] IT Loading: Proper adjustment of sample pre-amp [Fix] IT Loading/Saving: Changed the row highlight variables from signed to unsigned [Fix] IT Project files: The last commit broke IT Project files as row highlight was missing. [Fix] IT Compatibility: Changes various version numbers and settings in compatibility export to better match Impulse Tracker made IT files. [Fix] IT / S3M Saving: Ignore new MPT effects in compatibility export (always for S3M files) [Fix] XM Saving: The odd channel bugfix broke modules with an even channel count. [Imp] Pattern Editor: Shrinking patterns is now also possible with patterns < 32 rows. [Fix] FT2 Compatibility: Arpeggio was played wrong (0xy should play base note - y - x, not base note - x - y) [Ref] Using "Tracker" constants instead of "Format" constant for IsCompatibleMode() for more clarity. [Ref] Exchanged BOOL/TRUE/FALSE by bool/true/false in some places. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/PatternRandomizerGUI.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mod2wave.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/res/view_pat.bmp trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb trunk/OpenMPT/soundlib/IT_DEFS.H trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/modcommand.h trunk/OpenMPT/soundlib/pattern.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/tagging.h Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -1055,12 +1055,12 @@ commands[kcNoteCut].UID = 1200; commands[kcNoteCut].isHidden = false; commands[kcNoteCut].isDummy = false; - commands[kcNoteCut].Message = "Note cut"; + commands[kcNoteCut].Message = "Note Cut"; commands[kcNoteOff].UID = 1201; commands[kcNoteOff].isHidden = false; commands[kcNoteOff].isDummy = false; - commands[kcNoteOff].Message = "Note off"; + commands[kcNoteOff].Message = "Note Off"; commands[kcSetIns0].UID = 1202; commands[kcSetIns0].isHidden = false; @@ -2052,12 +2052,12 @@ commands[kcNoteCutOld].UID = 1667; commands[kcNoteCutOld].isHidden = false; commands[kcNoteCutOld].isDummy = false; - commands[kcNoteCutOld].Message = "Note cut (don't remember instrument)"; + commands[kcNoteCutOld].Message = "Note Cut (don't remember instrument)"; commands[kcNoteOffOld].UID = 1668; commands[kcNoteOffOld].isHidden = false; commands[kcNoteOffOld].isDummy = false; - commands[kcNoteOffOld].Message = "Note off (don't remember instrument)"; + commands[kcNoteOffOld].Message = "Note Off (don't remember instrument)"; commands[kcViewAddPlugin].UID = 1669; commands[kcViewAddPlugin].Message = "View Plugin Manager"; @@ -2333,6 +2333,16 @@ commands[kcSampleRemoveDCOffset].isHidden = false; commands[kcSampleRemoveDCOffset].isDummy = false; + commands[kcNoteFade].UID = 1791; + commands[kcNoteFade].Message = "Note Fade"; + commands[kcNoteFade].isHidden = false; + commands[kcNoteFade].isDummy = false; + + commands[kcNoteFadeOld].UID = 1792; + commands[kcNoteFadeOld].Message = "Note Fade (don't remember instrument)"; + commands[kcNoteFadeOld].isHidden = false; + commands[kcNoteFadeOld].isDummy = false; + #ifdef _DEBUG for (int i=0; i<kcNumCommands; i++) { if (commands[i].UID != 0) { // ignore unset UIDs Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/CommandSet.h 2009-08-08 21:26:10 UTC (rev 317) @@ -431,8 +431,10 @@ kcChordModifier=kcStartNoteMisc, kcNoteCut, kcNoteOff, + kcNoteFade, kcNoteCutOld, kcNoteOffOld, + kcNoteFadeOld, kcNotePC, kcNotePCS, kcEndNoteMisc=kcNotePCS, Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2009-08-08 21:26:10 UTC (rev 317) @@ -22,8 +22,8 @@ enum { MAX_SLIDER_GLOBAL_VOL=256, - MAX_SLIDER_VSTI_VOL=256, - MAX_SLIDER_SAMPLE_VOL=256 + MAX_SLIDER_VSTI_VOL=255, + MAX_SLIDER_SAMPLE_VOL=255 }; Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -337,7 +337,11 @@ { m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 16*COLUMN_HEIGHT); } else + if(note >= NOTE_FADE) { + m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 17*COLUMN_HEIGHT); + } else + { if(pTuning) { // Drawing custom note names string noteStr = pTuning->GetNoteName(note-NOTE_MIDDLEC); Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -7,45 +7,6 @@ #include "vstplug.h" #include "mod2wave.h" -#define NUM_GENRES 128 - -static LPCSTR gpszGenreNames[NUM_GENRES] = -{ - "Blues", "Classic Rock", "Country", "Dance", - "Disco", "Funk", "Grunge", "Hip Hop", - "Jazz", "Metal", "New_Age", "Oldies", - "Other", "Pop", "Rhythm n Blues", "Rap", - "Reggae", "Rock", "Techno", "Industrial", - "Alternative", "Ska", "Death Metal", "Pranks", - "Soundtrack", "Euro Techno", "Ambient", "Trip_Hop", - "Vocal", "Jazz Funk", "Fusion", "Trance", - "Classical", "Instrumental", "Acid", "House", - "Game", "Sound Clip", "Gospel", "Noise", - "Alternative Rock", "Bass", "Soul", "Punk", - "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", - "Ethnic", "Gothic", "Darkwave", "Techno Industrial", - "Electronic", "Pop Folk", "Eurodance", "Dream", - "Southern Rock", "Comedy", "Cult", "Gangsta", - "Top 40", "Christian Rap", "Pop Funk", "Jungle", - "Native_American", "Cabaret", "New_Wave", "Psychadelic", - "Rave", "ShowTunes", "Trailer", "Lo Fi", - "Tribal", "Acid Punk", "Acid Jazz", "Polka", - "Retro", "Musical", "Rock n Roll", "Hard_Rock", - "Folk", "Folk Rock", "National Folk", "Swing", - "Fast Fusion", "Bebob", "Latin", "Revival", - "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", - "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", - "Big Band", "Chorus", "Easy Listening", "Acoustic", - "Humour", "Speech", "Chanson", "Opera", - "Chamber Music", "Sonata", "Symphony", "Booty_Bass", - "Primus", "Porn Groove", "Satire", "Slow Jam", - "Club", "Tango", "Samba", "Folklore", - "Ballad", "Power Ballad", "Rhytmic Soul", "Freestyle", - "Duet", "Punk Rock", "Drum Solo", "Acapella", - "Euro House", "Dance Hall", "Goa", "Drum n Bass", -}; - - extern UINT nMixingRates[NUMMIXRATE]; extern LPCSTR gszChnCfgNames[3]; @@ -346,7 +307,7 @@ DDX_Control(pDX, IDC_COMBO2, m_CbnDriver); DDX_Control(pDX, IDC_COMBO3, m_CbnGenre); DDX_Control(pDX, IDC_EDIT3, m_EditAuthor); - DDX_Control(pDX, IDC_EDIT4, m_EditCopyright); + DDX_Control(pDX, IDC_EDIT4, m_EditURL); DDX_Control(pDX, IDC_EDIT5, m_EditAlbum); DDX_Control(pDX, IDC_EDIT6, m_EditYear); //}}AFX_DATA_MAP @@ -386,10 +347,10 @@ { m_CbnGenre.SetItemData(m_CbnGenre.AddString(gpszGenreNames[iGnr]), iGnr); } - UINT nSel = m_CbnGenre.AddString("Unspecified"); - m_CbnGenre.SetItemData(nSel, 0xff); - m_CbnGenre.SetCurSel(nSel); - m_EditYear.SetWindowText("2000"); + + m_EditYear.SetLimitText(4); + CTime tTime = CTime::GetCurrentTime(); + m_EditYear.SetWindowText(tTime.Format("%Y")); UpdateDialog(); return TRUE; } @@ -538,35 +499,56 @@ void CLayer3Convert::OnOK() //------------------------- { - CHAR s[40]; + CHAR sText[256] = {0}; if (m_dwFileLimit) m_dwFileLimit = GetDlgItemInt(IDC_EDIT1, NULL, FALSE); if (m_dwSongLimit) m_dwSongLimit = GetDlgItemInt(IDC_EDIT2, NULL, FALSE); m_nFormatIndex = m_CbnFormat.GetItemData(m_CbnFormat.GetCurSel()); m_nDriverIndex = m_CbnDriver.GetItemData(m_CbnDriver.GetCurSel()); m_bSaveInfoField = IsDlgButtonChecked(IDC_CHECK3); - memset(&m_id3tag, 0, sizeof(m_id3tag)); - m_id3tag.tag[0] = 'T'; m_id3tag.tag[1] = 'A'; m_id3tag.tag[2] = 'G'; - memset(s, 0, sizeof(s)); m_pSndFile->GetTitle(s); s[30] = 0; - memcpy(m_id3tag.title, s, 30); - memset(s, 0, sizeof(s)); m_EditAuthor.GetWindowText(s, 31); - memcpy(m_id3tag.artist, s, 30); - memset(s, 0, sizeof(s)); m_EditCopyright.GetWindowText(s, 31); - memcpy(m_id3tag.comments, s, 30); - memset(s, 0, sizeof(s)); m_EditAlbum.GetWindowText(s, 31); - memcpy(m_id3tag.album, s, 30); - strcpy(s, "2000"); - m_EditYear.GetWindowText(s, 5); - if (!s[0]) strcpy(s, "2000"); - memcpy(m_id3tag.year, s, 4); - m_id3tag.genre = (BYTE)m_CbnGenre.GetItemData(m_CbnGenre.GetCurSel()); - for (UINT i=0; i<30; i++) + + m_FileTags.title = m_pSndFile->GetTitle(); + + m_EditAuthor.GetWindowText(sText, sizeof(sText)); + m_FileTags.artist = sText; + + m_EditURL.GetWindowText(sText, sizeof(sText)); + m_FileTags.url = sText; + + m_EditAlbum.GetWindowText(sText, sizeof(sText)); + m_FileTags.album = sText; + + m_EditYear.GetWindowText(sText, min(5, sizeof(sText))); + m_FileTags.year = sText; + if(m_FileTags.year == "0") + m_FileTags.year = ""; + + m_CbnGenre.GetWindowText(sText, sizeof(sText)); + m_FileTags.genre = sText; + + if (m_pSndFile->m_lpszSongComments) { - if (m_id3tag.title[i] == 0) m_id3tag.title[i] = ' '; - if (m_id3tag.artist[i] == 0) m_id3tag.artist[i] = ' '; - if (m_id3tag.album[i] == 0) m_id3tag.album[i] = ' '; - if (m_id3tag.comments[i] == 0) m_id3tag.comments[i] = ' '; + m_FileTags.comments = m_pSndFile->m_lpszSongComments; + // convert \r to \n, remove bad characters + for(UINT i = 0; i < m_FileTags.comments.length(); i++) + { + if(m_FileTags.comments.substr(i, 1) == "\r") + m_FileTags.comments.replace(i, 1, "\n"); + if(m_FileTags.comments.substr(i, 1) < " " && m_FileTags.comments.substr(i, 1) != "\n") + m_FileTags.comments.replace(i, 1, " "); + } + + /*UINT spos; + while((spos = m_FileTags.comments.find("\r")) != string::npos) + { + m_FileTags.comments.replace(spos, 1, "\n"); + }*/ } + else + { + m_FileTags.comments = ""; + } + CDialog::OnOK(); } @@ -830,7 +812,7 @@ END_MESSAGE_MAP() -CDoAcmConvert::CDoAcmConvert(CSoundFile *sndfile, LPCSTR fname, PWAVEFORMATEX pwfx, HACMDRIVERID hadid, PTAGID3INFO pTag, CWnd *parent): +CDoAcmConvert::CDoAcmConvert(CSoundFile *sndfile, LPCSTR fname, PWAVEFORMATEX pwfx, HACMDRIVERID hadid, CFileTagging *pTag, CWnd *parent): CDialog(IDD_PROGRESS, parent) //-------------------------------------------------------------------------------------------------------------------------------------- { @@ -841,10 +823,9 @@ m_pwfx = pwfx; m_hadid = hadid; m_bSaveInfoField = FALSE; - memset(&m_id3tag, 0, sizeof(m_id3tag)); if (pTag) { - m_id3tag = *pTag; + m_FileTags = *pTag; m_bSaveInfoField = TRUE; } } @@ -940,6 +921,12 @@ data_ofs = ftell(f); fwrite(&wdh, 1, sizeof(wdh), f); wfh.filesize += sizeof(wdh); + } else + if(!bSaveWave && m_bSaveInfoField) + { + // Write ID3v2.4 Tags + m_FileTags.WriteID3v2Tags(f); + } oldsndcfg = CSoundFile::gdwSoundSetup; oldrepeat = m_pSndFile->GetRepeatCount(); @@ -1034,85 +1021,7 @@ { if (m_bSaveInfoField) { - WAVEFILEHEADER list; - DWORD info_ofs, end_ofs; - DWORD zero = 0; - - info_ofs = ftell(f); - if (info_ofs & 1) - { - wdh.length++; - fwrite(&zero, 1, 1, f); - info_ofs++; - } - list.id_RIFF = IFFID_LIST; - list.id_WAVE = IFFID_INFO; - list.filesize = 4; - fwrite(&list, 1, sizeof(list), f); - // ICMT - if (m_pSndFile->m_lpszSongComments) - { - CHAR *pszComments = NULL; - UINT szlen = m_pSndFile->GetSongComments(NULL, 8192, 80); - if (szlen > 1) pszComments = new CHAR[szlen+1]; - if (pszComments) - { - szlen = m_pSndFile->GetSongComments(pszComments, szlen, 80); - pszComments[szlen] = 0; - chunk.id_data = IFFID_ICMT; - chunk.length = strlen(pszComments)+1; - fwrite(&chunk, 1, sizeof(chunk), f); - fwrite(pszComments, 1, chunk.length, f); - list.filesize += chunk.length + sizeof(chunk); - if (chunk.length & 1) - { - fwrite(&zero, 1, 1, f); - list.filesize++; - } - delete[] pszComments; - } - } - for (UINT iCmt=0; iCmt<=6; iCmt++) - { - s[0] = 0; - switch(iCmt) - { - // INAM - case 0: memcpy(s, m_id3tag.title, 30); s[30] = 0; chunk.id_data = IFFID_INAM; break; - // IART - case 1: memcpy(s, m_id3tag.artist, 30); s[30] = 0; chunk.id_data = IFFID_IART; break; - // IPRD - case 2: memcpy(s, m_id3tag.album, 30); s[30] = 0; chunk.id_data = IFFID_IPRD; break; - // ICOP - case 3: memcpy(s, m_id3tag.comments, 30); s[30] = 0; chunk.id_data = IFFID_ICOP; break; - // IGNR - case 4: if (m_id3tag.genre < NUM_GENRES) strcpy(s, gpszGenreNames[m_id3tag.genre]); chunk.id_data = IFFID_IGNR; break; - // ISFT - case 5: strcpy(s, "OpenMPT"); chunk.id_data = IFFID_ISFT; break; - // ICRD - case 6: memcpy(s, m_id3tag.year, 4); s[4] = 0; strcat(s, "-01-01"); if (s[0] <= '0') s[0] = 0; chunk.id_data = IFFID_ICRD; break; - } - int l = strlen(s); - while ((l > 0) && (s[l-1] == ' ')) s[--l] = 0; - if (s[0]) - { - chunk.length = strlen(s)+1; - fwrite(&chunk, 1, sizeof(chunk), f); - fwrite(s, 1, chunk.length, f); - list.filesize += chunk.length + sizeof(chunk); - if (chunk.length & 1) - { - fwrite(&zero, 1, 1, f); - list.filesize++; - } - } - } - // Update INFO size - end_ofs = ftell(f); - fseek(f, info_ofs, SEEK_SET); - fwrite(&list, 1, sizeof(list), f); - fseek(f, end_ofs, SEEK_SET); - wfh.filesize += list.filesize + 8; + m_FileTags.WriteWaveTags(&wdh, &wfh, f); } wfh.filesize += wdh.length; fseek(f, 0, SEEK_SET); @@ -1123,10 +1032,6 @@ fwrite(&wdh, 1, sizeof(wdh), f); } } else - if (m_bSaveInfoField) - { - fwrite(&m_id3tag, 1, sizeof(m_id3tag), f); - } fclose(f); if (!m_bAbort) retval = IDOK; OnError: Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -1557,7 +1557,7 @@ m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; // Saving file - PTAGID3INFO pTag = (wsdlg.m_bSaveInfoField) ? &wsdlg.m_id3tag : NULL; + CFileTagging *pTag = (wsdlg.m_bSaveInfoField) ? &wsdlg.m_FileTags : NULL; CDoAcmConvert dwcdlg(&m_SndFile, s, &wfx.wfx, hadid, pTag, pMainFrm); dwcdlg.m_dwFileLimit = wsdlg.m_dwFileLimit; dwcdlg.m_dwSongLimit = wsdlg.m_dwSongLimit; @@ -2368,7 +2368,8 @@ nmax = (nType & MOD_TYPE_S3MITMPT) ? 58 : 30; break; case CMD_PANNING8: - if (nType & (MOD_TYPE_MOD|MOD_TYPE_S3M)) nmax = 0x80; + if (nType & (MOD_TYPE_S3M)) nmax = 0x81; + else nmax = 0xFF; break; case CMD_GLOBALVOLUME: nmax = (nType & MOD_TYPE_IT | MOD_TYPE_MPT) ? 128 : 64; @@ -2418,6 +2419,14 @@ else pos = (param >> 4) + 15; } break; + case CMD_PANNING8: + if(m_SndFile.m_nType & MOD_TYPE_S3M) + { + pos = CLAMP(param, 0, 0x80); + if(param == 0xA4) + pos = 0x81; + } + break; } return pos; } @@ -2452,6 +2461,10 @@ param = (pos - 15) << 4; } break; + case CMD_PANNING8: + if(m_SndFile.m_nType & MOD_TYPE_S3M) + param = (pos <= 0x80) ? pos : 0xA4; + break; } return param; } @@ -2514,13 +2527,21 @@ case CMD_TEMPO: if (param < 0x10) - wsprintf(s, "-%dbpm (slower)", param & 0x0F); + wsprintf(s, "-%d bpm (slower)", param & 0x0F); else if (param < 0x20) - wsprintf(s, "+%dbpm (faster)", param & 0x0F); + wsprintf(s, "+%d bpm (faster)", param & 0x0F); else - wsprintf(s, "%dbpm", param); + wsprintf(s, "%d bpm", param); break; + case CMD_PANNING8: + wsprintf(s, "%d", param); + if(m_SndFile.m_nType & MOD_TYPE_S3M) + { + if(param == 0xA4) + strcpy(s, "Surround"); + } + break; case CMD_RETRIG: switch(param >> 4) { @@ -2734,7 +2755,7 @@ case 0xC0: // note cut case 0xD0: // note delay //IT compatibility 22. SD0 == SD1, SC0 == SC1 - if(((param & 0x0F) == 1) || ((param & 0x0F) == 0 && m_SndFile.IsCompatibleMode(MOD_TYPE_IT))) + if(((param & 0x0F) == 1) || ((param & 0x0F) == 0 && m_SndFile.IsCompatibleMode(TRK_IMPULSETRACKER))) strcpy(s, "1 frame"); else strcat(s, " frames"); Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -165,6 +165,29 @@ for (UINT len = m_SndFile.PatternSize[nPat] * m_SndFile.m_nChannels; len; m++, len--) { + ////////////////////////// + // Convert 8-bit Panning + if(m->command == CMD_PANNING8) + { + if(newTypeIsS3M) + { + m->param = (m->param + 1) >> 1; + } + else if(oldTypeIsS3M) + { + if(m->param == 0xA4) + { + // surround remap + m->command = (newTypeIsIT_MPT) ? CMD_S3MCMDEX : CMD_XFINEPORTAUPDOWN; + m->param = 0x91; + } + else + { + m->param = min(m->param << 1, 0xFF); + } + } + } + ///////////////////////////////////////// // Convert MOD / XM to S3M / IT / MPTM if(oldTypeIsMOD_XM && newTypeIsS3M_IT_MPT) @@ -211,7 +234,15 @@ case 0x60: case 0x70: case 0x90: - case 0xA0: m->command = CMD_S3MCMDEX; break; + case 0xA0: + m->command = CMD_S3MCMDEX; + // surround remap (this is the "official" command) + if(newTypeIsS3M && m->param == 0x91) + { + m->command = CMD_PANNING8; + m->param = 0xA4; + } + break; } break; case CMD_KEYOFF: @@ -237,6 +268,9 @@ // Convert S3M / IT / MPTM to MOD / XM else if (oldTypeIsS3M_IT_MPT && newTypeIsMOD_XM) { + if(m->note == NOTE_NOTECUT || m->note == NOTE_FADE) + m->note = NOTE_KEYOFF; + switch(m->command) { case CMD_S3MCMDEX: @@ -308,38 +342,16 @@ } } // End if (oldTypeIsS3M_IT_MPT && newTypeIsMOD_XM) - /////////////////////// - // Convert S3M to IT - if (oldTypeIsS3M && newTypeIsIT_MPT) - { - switch(m->command) - { - case CMD_PANNING8: - if(m->param == 0xA4) - { - // surround remap - m->command = CMD_S3MCMDEX; - m->param = 0x91; - } - else - { - m->param = min(m->param << 1, 0xFF); - } - break; - default: - break; - } - } // End if (oldTypeIsS3M && newTypeIsIT_MPT) /////////////////////// // Convert IT to S3M else if (oldTypeIsIT_MPT && newTypeIsS3M) { + if(m->note == NOTE_KEYOFF || m->note == NOTE_FADE) + m->note = NOTE_NOTECUT; + switch(m->command) { - case CMD_PANNING8: - m->param = (m->param + 1) >> 1; - break; case CMD_S3MCMDEX: if(m->param == 0x91) { @@ -356,12 +368,30 @@ } } // End if (oldTypeIsIT_MPT && newTypeIsS3M) - /////////////////////////////////////////////////// - // Convert anything to MOD - remove volume column + + //////////////////////// + // Convert XM arpeggio + if(m->command == CMD_ARPEGGIO && (newTypeIsXM || oldTypeIsXM)) + { + // swap notes + m->param = ((m->param & 0x0F) << 4) | ((m->param & 0xF0) >> 4); + } + + + ////////////////////////////////////////////////////////////////// + // Convert anything to MOD - remove volume column, adjust retrig if (newTypeIsMOD) { - if(!m->command) switch(m->volcmd) + if(m->command) switch(m->command) { + case CMD_RETRIG: + m->command = CMD_MODCMDEX; + m->param = 0x90 | (m->param & 0x0F); + break; + } + + else switch(m->volcmd) + { case VOLCMD_VOLUME: m->command = CMD_VOLUME; m->param = m->vol; @@ -497,7 +527,7 @@ } } // End if (newTypeIsS3M) - /////////////////////////////////////////////////// + ////////////////////////////////////////////////// // Convert anything to XM - adjust volume column if (newTypeIsXM) { @@ -534,6 +564,19 @@ { if(!m->command) switch(m->volcmd) { + case VOLCMD_VOLSLIDEDOWN: + case VOLCMD_VOLSLIDEUP: + case VOLCMD_FINEVOLDOWN: + case VOLCMD_FINEVOLUP: + case VOLCMD_PORTADOWN: + case VOLCMD_PORTAUP: + case VOLCMD_TONEPORTAMENTO: + case VOLCMD_VIBRATODEPTH: + // OpenMPT-specific commands + case VOLCMD_OFFSET: + case VOLCMD_VELOCITY: + m->vol = min(m->vol, 9); + break; case VOLCMD_PANSLIDELEFT: m->command = CMD_PANNINGSLIDE; m->param = m->vol << 4; @@ -553,6 +596,9 @@ break; } } // End if (newTypeIsIT) + + if(!m_SndFile.GetModSpecifications().HasNote(m->note)) + m->note = 0; } } @@ -1884,6 +1930,7 @@ case 0: p[1] = p[2] = p[3] = '.'; break; case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break; case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break; + case NOTE_FADE: p[1] = p[2] = p[3] = '~'; break; case NOTE_PC: p[1] = 'P'; p[2] = 'C'; p[3] = ' '; break; case NOTE_PCS: p[1] = 'P'; p[2] = 'C'; p[3] = 'S'; break; default: @@ -2055,6 +2102,7 @@ m[col].note = 0; if (s[0] == '=') m[col].note = NOTE_KEYOFF; else if (s[0] == '^') m[col].note = NOTE_NOTECUT; else + if (s[0] == '~') m[col].note = NOTE_FADE; else if (s[0] == 'P') { if(s[2] == 'S') Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -243,7 +243,7 @@ "\n" " For more detailed list of changes, see history.txt."; - CMainFrame::GetMainFrame()->MessageBox(firstOpenMessage, "OpenMPT v." MPT_VERSION_STR, MB_ICONINFORMATION); + CMainFrame::GetMainFrame()->MessageBox(firstOpenMessage, "OpenMPT " MPT_VERSION_STR, MB_ICONINFORMATION); */ } @@ -1655,7 +1655,7 @@ m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); wsprintf(s, "Build Date: %s", gszBuildDate); SetDlgItemText(IDC_EDIT2, s); - SetDlgItemText(IDC_EDIT3, CString("OpenMPT, version ") + MptVersion::str + " (development build)"); + SetDlgItemText(IDC_EDIT3, CString("OpenMPT ") + MptVersion::str + " (development build)"); m_heContact.SetWindowText( "Contact / Discussion:\r\n\ @@ -1690,9 +1690,11 @@ "http://www.un4seen.com/mo3.html|" "coda for sample drawing code|" "http://coda.s3m.us/|" + "Storlek for all the IT compatibility hints and testcases|" + "http://schismtracker.org/|" "Pel K. Txnder for the scrolling credits control :)|" "http://tinyurl.com/4yze8|" - "The people at Modplug forums for crucial contribution|" + "|The people at Modplug forums for crucial contribution|" "in the form of ideas, testing and support; thanks|" "particularly to:|" "LPChip, Ganja, Diamond, Nofold, Goor00, Georg|" Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Mptrack.h 2009-08-08 21:26:10 UTC (rev 317) @@ -405,7 +405,7 @@ extern const BYTE gEffectColors[MAX_EFFECTS]; extern const LPCSTR szNoteNames[12]; extern const LPCTSTR szDefaultNoteNames[NOTE_MAX]; -const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL-NOTE_MIN_SPECIAL + 1] = {TEXT("PCs"), TEXT("PC"), TEXT("^^"), TEXT("==")}; +const LPCTSTR szSpecialNoteNames[NOTE_MAX_SPECIAL-NOTE_MIN_SPECIAL + 1] = {TEXT("~~"), TEXT("PCs"), TEXT("PC"), TEXT("^^"), TEXT("==")}; const LPCTSTR szSpecialNoteShortDesc[NOTE_MAX_SPECIAL-NOTE_MIN_SPECIAL + 1] = {TEXT("Param control(smooth)"), TEXT("Param control"), TEXT("Note Cut"), TEXT("Note Off")}; // Make sure that special note arrays include string for every note. Modified: trunk/OpenMPT/mptrack/PatternRandomizerGUI.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternRandomizerGUI.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/PatternRandomizerGUI.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -81,7 +81,7 @@ bool CPatternRandomizerGUI::isVisible() { //---------------------------------- - return IsWindowVisible(); + return (bool)IsWindowVisible(); } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -3548,6 +3548,8 @@ case kcNoteCutOld: TempEnterNote(NOTE_NOTECUT, true); return wParam; case kcNoteOff: TempEnterNote(NOTE_KEYOFF, false); return wParam; case kcNoteOffOld: TempEnterNote(NOTE_KEYOFF, true); return wParam; + case kcNoteFade: TempEnterNote(NOTE_FADE, false); return wParam; + case kcNoteFadeOld: TempEnterNote(NOTE_FADE, true); return wParam; case kcNotePC: TempEnterNote(NOTE_PC); return wParam; case kcNotePCS: TempEnterNote(NOTE_PCS); return wParam; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -14,7 +14,9 @@ #include "defaultvsteditor.h" //rewbs.defaultPlugGUI #include "midi.h" #include "version.h" +#ifdef VST_USE_ALTERNATIVE_MAGIC //Pelya's plugin ID fix. Breaks fx presets, so let's avoid it for now. #include "Unzip32.h" //For CRC calculation (to detect plugins with same UID) +#endif #ifndef NO_VST @@ -34,6 +36,7 @@ AEffect *DmoToVst(PVSTPLUGINLIB pLib); +#ifdef VST_USE_ALTERNATIVE_MAGIC class CalculateCRC32: public CZipArchive // Make Plugin ID unique for sure { public: @@ -55,6 +58,7 @@ }; CalculateCRC32 CRC32; +#endif long VSTCALLBACK CVstPluginManager::MasterCallBack(AEffect *effect, long opcode, long index, long value, void *ptr, float opt) //---------------------------------------------------------------------------------------------------------------------------- @@ -252,10 +256,12 @@ flagKey.Format("%s.Flags", IDs); int infoex = CMainFrame::GetPrivateProfileLong(cacheSection, flagKey, 0, cacheFile); if (infoex&1) p->bIsInstrument = TRUE; + #ifdef VST_USE_ALTERNATIVE_MAGIC if( p->dwPluginId1 == kEffectMagic ) { p->dwPluginId1 = CRC32.calculateFilename( p->szLibraryName ); // Make Plugin ID unique for sure (for VSTs with same UID) }; + #endif #ifdef VST_LOG Log("Plugin \"%s\" found in PluginCache\n", p->szLibraryName); #endif @@ -321,8 +327,11 @@ && (pEffect->dispatcher)) { pEffect->dispatcher(pEffect, effOpen, 0,0,0,0); - //p->dwPluginId1 = pEffect->magic; + #ifdef VST_USE_ALTERNATIVE_MAGIC p->dwPluginId1 = CRC32.calculateFilename( p->szLibraryName ); // Make Plugin ID unique for sure + #else + p->dwPluginId1 = pEffect->magic; + #endif p->dwPluginId2 = pEffect->uniqueID; if ((pEffect->flags & effFlagsIsSynth) || (!pEffect->numInputs)) p->bIsInstrument = TRUE; #ifdef VST_LOG Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -675,7 +675,7 @@ { combo->SetItemData(combo->AddString("any"), findAny); } - AppendNotesToControlEx(*combo); + AppendNotesToControlEx(*combo, pSndFile); UINT ncount = combo->GetCount(); for (UINT i=0; i<ncount; i++) if (m_nNote == combo->GetItemData(i)) @@ -1241,6 +1241,7 @@ } } } + } // Instrument if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL) @@ -1794,12 +1795,12 @@ m_CbnZxxPreset.SetCurSel(0); UpdateDialog(); - int offsetx=100, offsety=30, separatorx=4, separatory=2, + int offsetx=108, offsety=30, separatorx=4, separatory=2, height=18, widthMacro=30, widthVal=55, widthType=135, widthBtn=60; for (UINT m=0; m<NMACROS; m++) { - m_EditMacro[m].Create("", BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP /*| WS_BORDER*/, + m_EditMacro[m].Create("", /*BS_FLAT |*/ WS_CHILD | WS_VISIBLE | WS_TABSTOP /*| WS_BORDER*/, CRect(offsetx, offsety+m*(separatory+height), offsetx+widthMacro, offsety+m*(separatory+height)+height), this, ID_PLUGSELECT+NMACROS+m); m_EditMacro[m].SetFont(GetFont()); Modified: trunk/OpenMPT/mptrack/mod2wave.h =================================================================== --- trunk/OpenMPT/mptrack/mod2wave.h 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/mod2wave.h 2009-08-08 21:26:10 UTC (rev 317) @@ -1,17 +1,7 @@ #ifndef _MOD2WAVE_H_ #define _MOD2WAVE_H_ +#include "tagging.h" -typedef struct _TAGID3INFO -{ - CHAR tag[3]; - CHAR title[30]; - CHAR artist[30]; - CHAR album[30]; - CHAR year[4]; - CHAR comments[30]; - BYTE genre; -} TAGID3INFO, *PTAGID3INFO; - /////////////////////////////////////////////////////////////////////////////////////////////////// // Direct To Disk Recording @@ -86,12 +76,12 @@ enum { MAX_DRIVERS=32 }; DWORD m_dwFileLimit, m_dwSongLimit; BOOL m_bSaveInfoField; - TAGID3INFO m_id3tag; + CFileTagging m_FileTags; protected: CSoundFile *m_pSndFile; CComboBox m_CbnFormat, m_CbnDriver, m_CbnGenre; - CEdit m_EditAuthor, m_EditCopyright, m_EditAlbum, m_EditYear; + CEdit m_EditAuthor, m_EditURL, m_EditAlbum, m_EditYear; UINT m_nFormatIndex, m_nDriverIndex, m_nNumFormats, m_nNumDrivers; MPEGLAYER3WAVEFORMAT Formats[MAX_FORMATS]; HACMDRIVERID Drivers[MAX_DRIVERS]; @@ -131,15 +121,15 @@ BOOL m_bAbort, m_bSaveInfoField; PWAVEFORMATEX m_pwfx; HACMDRIVERID m_hadid; - TAGID3INFO m_id3tag; + CFileTagging m_FileTags; public: - CDoAcmConvert(CSoundFile *sndfile, LPCSTR fname, PWAVEFORMATEX pwfx, HACMDRIVERID hadid, PTAGID3INFO pInfo, CWnd *parent=NULL); + CDoAcmConvert(CSoundFile *sndfile, LPCSTR fname, PWAVEFORMATEX pwfx, HACMDRIVERID hadid, CFileTagging *pInfo, CWnd *parent=NULL); BOOL OnInitDialog(); void OnCancel() { m_bAbort = TRUE; } afx_msg void OnButton1(); DECLARE_MESSAGE_MAP() + }; - #endif // _MOD2WAVE_H_ Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/mptrack.rc 2009-08-08 21:26:10 UTC (rev 317) @@ -132,32 +132,33 @@ PUSHBUTTON "Default Settings",IDC_BUTTON_DEFAULT_RESAMPLING,186,180,66,12 END -IDD_WAVECONVERT DIALOGEX 0, 0, 211, 166 +IDD_WAVECONVERT DIALOGEX 0, 0, 262, 197 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Wave Convert" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK",IDOK,155,8,50,14 - PUSHBUTTON "Cancel",IDCANCEL,155,28,50,14 - GROUPBOX "",IDC_STATIC,4,4,146,157 - CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,111,10 - EDITTEXT IDC_EDIT1,21,24,50,12,ES_AUTOHSCROLL - CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,40,111,10 - EDITTEXT IDC_EDIT2,21,51,50,12,ES_AUTOHSCROLL - LTEXT "Play:",IDC_STATIC,10,67,37,8 - CONTROL "Entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,15,78,104,10 - CONTROL "From position",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,15,91,58,10 - CONTROL "Normalize Output",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,76,133,73,10 - COMBOBOX IDC_COMBO1,10,106,54,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO2,70,106,73,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "High quality resampling",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,76,122,104,10 - EDITTEXT IDC_EDIT3,75,90,19,12,ES_AUTOHSCROLL | ES_NUMBER - CTEXT "to",IDC_STATIC,99,91,8,8 - EDITTEXT IDC_EDIT4,109,90,19,12,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Channel mode",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,82,66,60,12 - DEFPUSHBUTTON "Change Player Options",IDC_PLAYEROPTIONS,10,124,81,14,BS_CENTER + DEFPUSHBUTTON "OK",IDOK,204,12,50,14 + PUSHBUTTON "Cancel",IDCANCEL,204,30,50,14 + GROUPBOX "Render",IDC_STATIC,6,6,192,90 + COMBOBOX IDC_COMBO1,18,18,54,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO2,78,18,73,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Change Player Options",IDC_PLAYEROPTIONS,18,36,81,14,BS_CENTER + CONTROL "Channel mode (one file per channel)",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,168,8 + CONTROL "Normalize Output",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,66,73,10 + CONTROL "High quality resampling",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,102,66,84,10 CONTROL "Slow render (for Kontakt+DFD)",IDC_GIVEPLUGSIDLETIME, - "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,10,142,133,17 + "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_MULTILINE | WS_TABSTOP,18,78,133,8 + GROUPBOX "Limit",IDC_STATIC,6,102,192,90 + CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,114,111,11 + EDITTEXT IDC_EDIT1,138,114,50,12,ES_AUTOHSCROLL + CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,134,111,10 + EDITTEXT IDC_EDIT2,138,133,50,12,ES_AUTOHSCROLL + LTEXT "Play:",IDC_STATIC,18,150,37,8 + CONTROL "Entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,18,162,104,10 + CONTROL "From position",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,18,175,58,10 + EDITTEXT IDC_EDIT3,78,174,19,12,ES_AUTOHSCROLL | ES_NUMBER + CTEXT "to",IDC_STATIC,102,176,8,8 + EDITTEXT IDC_EDIT4,114,174,19,12,ES_AUTOHSCROLL | ES_NUMBER END IDD_PROGRESS DIALOG 0, 0, 186, 55 @@ -1004,34 +1005,34 @@ LTEXT "Note: you need to enable multichannel-record in order to enter chords.",IDC_STATIC,4,136,237,10 END -IDD_LAYER3CONVERT DIALOGEX 0, 0, 220, 250 +IDD_LAYER3CONVERT DIALOGEX 0, 0, 280, 202 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "MPEG Layer3 Convert" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "",IDC_STATIC,6,6,150,132 - DEFPUSHBUTTON "OK",IDOK,162,12,50,14 - PUSHBUTTON "Cancel",IDCANCEL,162,30,50,14 - LTEXT "Encoder:",IDC_STATIC,12,18,109,8 - COMBOBOX IDC_COMBO2,12,30,131,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Format:",IDC_STATIC,12,48,109,8 - COMBOBOX IDC_COMBO1,12,60,131,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,78,111,10 - EDITTEXT IDC_EDIT1,24,90,50,12,ES_AUTOHSCROLL - CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,108,111,10 - EDITTEXT IDC_EDIT2,24,120,50,12,ES_AUTOHSCROLL - GROUPBOX "",IDC_STATIC,6,144,210,102 - CONTROL "Include Song Information",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,156,132,10 - RTEXT "Author:",IDC_STATIC,12,176,36,8 - EDITTEXT IDC_EDIT3,54,174,150,12,ES_AUTOHSCROLL - RTEXT "Comment:",IDC_STATIC,12,194,36,8 - EDITTEXT IDC_EDIT4,54,192,150,12,ES_AUTOHSCROLL - RTEXT "Album:",IDC_STATIC,12,210,36,8 - EDITTEXT IDC_EDIT5,54,208,150,12,ES_AUTOHSCROLL - RTEXT "Genre:",IDC_STATIC,12,230,35,8 - COMBOBOX IDC_COMBO3,54,228,92,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - RTEXT "Year:",IDC_STATIC,150,230,18,8 - EDITTEXT IDC_EDIT6,174,228,31,12,ES_AUTOHSCROLL | ES_NUMBER + GROUPBOX "",IDC_STATIC,6,6,210,84 + DEFPUSHBUTTON "OK",IDOK,222,12,50,14 + PUSHBUTTON "Cancel",IDCANCEL,222,30,50,14 + LTEXT "Encoder:",IDC_STATIC,18,20,42,8 + COMBOBOX IDC_COMBO2,60,18,144,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Format:",IDC_STATIC,18,38,42,8 + COMBOBOX IDC_COMBO1,60,36,144,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Limit file size to: (KBytes)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,55,111,10 + EDITTEXT IDC_EDIT1,150,54,48,12,ES_AUTOHSCROLL + CONTROL "Limit song length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,73,111,10 + EDITTEXT IDC_EDIT2,150,72,48,12,ES_AUTOHSCROLL + GROUPBOX "",IDC_STATIC,6,96,210,102 + CONTROL "Include Song Information",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,108,132,10 + LTEXT "Author:",IDC_STATIC,18,128,30,8 + EDITTEXT IDC_EDIT3,54,126,150,12,ES_AUTOHSCROLL + LTEXT "Album:",IDC_STATIC,18,146,30,8 + EDITTEXT IDC_EDIT5,54,144,150,12,ES_AUTOHSCROLL + LTEXT "URL:",IDC_STATIC,18,164,30,8 + EDITTEXT IDC_EDIT4,54,162,150,12,ES_AUTOHSCROLL + LTEXT "Genre:",IDC_STATIC,18,182,29,8 + COMBOBOX IDC_COMBO3,54,180,92,64,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + RTEXT "Year:",IDC_STATIC,150,182,18,8 + EDITTEXT IDC_EDIT6,174,180,31,12,ES_AUTOHSCROLL | ES_NUMBER END IDD_SPLASHSCREEN DIALOG 0, 0, 188, 95 @@ -1331,9 +1332,9 @@ CONTROL "",IDC_SPIN_ADDSILENCE,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,60,18,11,14 LTEXT "samples",IDC_STATIC,78,21,35,8 CONTROL "Add a beginning of sample",IDC_RADIO_ADDSILENCE_BEGIN, - "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,36,102,12 - CONTROL "Add at end of sample",IDC_RADIO_ADDSILENCE_END,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,48,102,12 - CONTROL "Resize to",IDC_RADIO_RESIZETO,"Button",BS_AUTORADIOBUTTON,12,60,102,12 + "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,36,102,8 + CONTROL "Add at end of sample",IDC_RADIO_ADDSILENCE_END,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,48,102,8 + CONTROL "Resize to",IDC_RADIO_RESIZETO,"Button",BS_AUTORADIOBUTTON,12,60,102,8 END IDD_PATTERNRANDOMIZER_EFFECT DIALOGEX 0, 0, 235, 172 @@ -1384,7 +1385,8 @@ IDD_WAVECONVERT, DIALOG BEGIN - BOTTOMMARGIN, 163 + RIGHTMARGIN, 211 + BOTTOMMARGIN, 194 END IDD_OPTIONS_KEYBOARD, DIALOG @@ -1529,8 +1531,8 @@ IDD_LAYER3CONVERT, DIALOG BEGIN - RIGHTMARGIN, 214 - BOTTOMMARGIN, 246 + RIGHTMARGIN, 274 + BOTTOMMARGIN, 198 END IDD_MOD2MIDI, DIALOG @@ -2326,18 +2328,18 @@ PUSHBUTTON "Restore",IDC_BUTTON8,480,2,42,11,0,WS_EX_STATICEDGE END -IDD_DEFAULTPLUGINEDITOR DIALOGEX 0, 0, 151, 242 +IDD_DEFAULTPLUGINEDITOR DIALOGEX 0, 0, 151, 241 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE +EXSTYLE WS_EX_TOOLWINDOW CAPTION "Editor" -FONT 8, "MS Sans Serif", 400, 0, 0x0 +FONT 8, "MS Shell Dlg", 400, 0, 0x0 BEGIN LISTBOX IDC_PARAMLIST,7,17,100,194,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_PARAMVALUESLIDE,"msctls_trackbar32",TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,115,18,18,177 EDITTEXT IDC_PARAMVALUETEXT,109,197,25,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER LTEXT "Static",IDC_PARAMLABEL,112,8,32,8 LTEXT "Parameters:",IDC_STATIC,7,7,38,8 - LTEXT "\x89",IDC_PARAMLABEL2,136,200,8,8 + LTEXT "\x89",IDC_PARAMLABEL2,136,200,14,8 END IDD_MOVEFXSLOT DIALOGEX 0, 0, 133, 78 @@ -2429,7 +2431,7 @@ LEFTMARGIN, 7 RIGHTMARGIN, 144 TOPMARGIN, 7 - BOTTOMMARGIN, 235 + BOTTOMMARGIN, 234 END IDD_MOVEFXSLOT, DIALOG Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2009-08-08 21:26:10 UTC (rev 317) @@ -352,16 +352,16 @@ RelativePath=".\mod2midi.cpp"> </File> <File - RelativePath=".\mod2wave.cpp"> + RelativePath=".\Mod2wave.cpp"> </File> <File RelativePath="..\soundlib\mod_specifications.cpp"> </File> <File - RelativePath=".\moddoc.cpp"> + RelativePath=".\Moddoc.cpp"> </File> <File - RelativePath=".\modedit.cpp"> + RelativePath=".\Modedit.cpp"> </File> <File RelativePath="..\soundlib\modsmp_ctrl.cpp"> @@ -475,6 +475,12 @@ RelativePath="..\soundlib\Tables.cpp"> </File> <File + RelativePath=".\tagging.cpp"> + </File> + <File + RelativePath=".\tagging.h"> + </File> + <File RelativePath=".\view_com.cpp"> </File> <File @@ -744,6 +750,9 @@ RelativePath="InputHandler.h"> </File> <File + RelativePath="..\soundlib\IT_DEFS.H"> + </File> + <File RelativePath=".\KeyboardSettings.h"> </File> <File Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2009-08-08 21:26:10 UTC (rev 317) @@ -473,7 +473,7 @@ > </File> <File - RelativePath=".\mod2wave.cpp" + RelativePath=".\Mod2wave.cpp" > </File> <File @@ -481,11 +481,11 @@ > </File> <File - RelativePath=".\moddoc.cpp" + RelativePath=".\Moddoc.cpp" > </File> <File - RelativePath=".\modedit.cpp" + RelativePath=".\Modedit.cpp" > </File> <File @@ -637,6 +637,14 @@ > </File> <File + RelativePath=".\tagging.cpp" + > + </File> + <File + RelativePath=".\tagging.h" + > + </File> + <File RelativePath=".\view_com.cpp" > </File> @@ -991,6 +999,10 @@ > </File> <File + RelativePath="..\soundlib\IT_DEFS.H" + > + </File> + <File RelativePath=".\KeyboardSettings.h" > </File> Modified: trunk/OpenMPT/mptrack/res/view_pat.bmp =================================================================== (Binary files differ) Added: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp (rev 0) +++ trunk/OpenMPT/mptrack/tagging.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -0,0 +1,189 @@ +/* + * Purpose: File tagging (ID3v2, RIFF + more in the future) + * Authors: OpenMPT Devs +*/ + +#include "stdafx.h" +#include "mptrack.h" +#include "tagging.h" +#include "version.h" +#include "sndfile.h" + +/////////////////////////////////////////////////// +// CFileTagging - helper class for writing tags + +CFileTagging::CFileTagging() +{ + encoder = "OpenMPT " MPT_VERSION_STR; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ID3v2.4 Tags + +// Convert Integer to Synchsafe Integer (see ID3v2.4 specs) +// Basically, it's a BigEndian integer, but the MSB of all bytes is 0. +// Thus, a 32-bit integer turns into a 28-bit integer. +UINT32 CFileTagging::intToSynchsafe(UINT32 in) +{ + in = LittleEndian(in); + UINT32 out = 0; + do { + out <<= 8; + out |= (in & 0x7F); + } while(in >>= 7); + return BigEndian(out); +} + +// Write Tags +void CFileTagging::WriteID3v2Tags(FILE *f) +{ + if(!f) return; + + TAGID3v2HEADER tHeader; + UINT fOffset = ftell(f); + + totalID3v2Size = 0; + + // Correct header will be written later (tag size missing) + tHeader.signature[0] = 'I'; + tHeader.signature[1] = 'D'; + tHeader.signature[2] = '3'; + tHeader.version[0] = 0x04; // Version 2.4.0 + tHeader.version[1] = 0x00; // Dito + tHeader.flags = 0x00; // No flags + fwrite(&tHeader, 1, sizeof(tHeader), f); + + // Write TIT2 (Title), TCOM / TPE1 (Composer), TALB (Album), TCON (Genre), TYER (Date), WXXX (URL), COMM (Comment), TENC (Encoder) + WriteID3v2Frame("TIT2", title, f); + WriteID3v2Frame("TPE1", artist, f); + WriteID3v2Frame("TCOM", artist, f); + WriteID3v2Frame("TALB", album, f); + WriteID3v2Frame("TCON", genre, f); + WriteID3v2Frame("TYER", year, f); + WriteID3v2Frame("WXXX", url, f); + WriteID3v2Frame("COMM", comments, f); + WriteID3v2Frame("TENC", encoder, f); + + // Write Padding + for(UINT i = 0; i < ID3v2_PADDING; i++) + { + fputc(0, f); + } + totalID3v2Size += ID3v2_PADDING; + + // Write correct header (update tag size) + tHeader.size = intToSynchsafe(totalID3v2Size); + fseek(f, fOffset, SEEK_SET); + fwrite(&tHeader, 1, sizeof(tHeader), f); + fseek(f, totalID3v2Size, SEEK_CUR); + +} + +// Write a ID3v2 frame +void CFileTagging::WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f) +{ + if(!strcmp(cFrameID, "") || sFramecontent.empty() || !f) return; + + if(!strcmp(cFrameID, "COMM")) + { + // English language for comments - no description following (hence the text ending nullchar(s)) + // HALP this is really lame, how is it done properly so the nullchar is not lost? + string sInfo; + sInfo = "eng"; // See http://en.wikipedia.org/wiki/ISO-639-2 + sInfo += ID3v2_TEXTENDING; + sFramecontent = sInfo + sFramecontent; + } + sFramecontent = ID3v2_CHARSET + sFramecontent; + + TAGID3v2FRAME tFrame; + + memcpy(&tFrame.frameid, cFrameID, 4); // ID + tFrame.size = intToSynchsafe(sFramecontent.size()); // Text size + tFrame.flags = 0x0000; // No flags + fwrite(&tFrame, 1, sizeof(tFrame), f); + fwrite(sFramecontent.c_str(), 1, sFramecontent.size(), f); + + totalID3v2Size += (sizeof(tFrame) + sFramecontent.size()); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// RIFF (WAVE) Tags + +// Write RIFF tags +void CFileTagging::WriteWaveTags(WAVEDATAHEADER *wdh, WAVEFILEHEADER *wfh, FILE *f) +{ + if(!f || !wdh || !wfh) return; + + WAVEFILEHEADER list; + WAVEDATAHEADER chunk; + CHAR s[256]; + DWORD info_ofs, end_ofs; + DWORD zero = 0; + + info_ofs = ftell(f); + if (info_ofs & 1) + { + wdh->length++; + fwrite(&zero, 1, 1, f); + info_ofs++; + } + list.id_RIFF = IFFID_LIST; + list.id_WAVE = IFFID_INFO; + list.filesize = 4; + fwrite(&list, 1, sizeof(list), f); + // ICMT + if (!comments.empty()) + { + chunk.id_data = IFFID_ICMT; + chunk.length = strlen(comments.c_str()) + 1; + fwrite(&chunk, 1, sizeof(chunk), f); + fwrite(comments.c_str(), 1, chunk.length, f); + list.filesize += chunk.length + sizeof(chunk); + if (chunk.length & 1) + { + fwrite(&zero, 1, 1, f); + list.filesize++; + } + } + for (UINT iCmt=0; iCmt<=6; iCmt++) + { + s[0] = 0; + switch(iCmt) + { + // INAM + case 0: memcpy(s, title.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_INAM; break; + // IART + case 1: memcpy(s, artist.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_IART; break; + // IPRD + case 2: memcpy(s, album.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_IPRD; break; + // ICOP + case 3: memcpy(s, url.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_ICOP; break; + // IGNR + case 4: memcpy(s, genre.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_IGNR; break; + // ISFT + case 5: memcpy(s, encoder.c_str(), 255); s[255] = 0; chunk.id_data = IFFID_ISFT; break; + // ICRD + case 6: memcpy(s, year.c_str(), 4); s[4] = 0; strcat(s, "-01-01"); if (s[0] <= '0') s[0] = 0; chunk.id_data = IFFID_ICRD; break; + } + int l = strlen(s); + while ((l > 0) && (s[l-1] == ' ')) s[--l] = 0; + if (s[0]) + { + chunk.length = strlen(s)+1; + fwrite(&chunk, 1, sizeof(chunk), f); + fwrite(s, 1, chunk.length, f); + list.filesize += chunk.length + sizeof(chunk); + if (chunk.length & 1) + { + fwrite(&zero, 1, 1, f); + list.filesize++; + } + } + } + // Update INFO size + end_ofs = ftell(f); + fseek(f, info_ofs, SEEK_SET); + fwrite(&list, 1, sizeof(list), f); + fseek(f, end_ofs, SEEK_SET); + wfh->filesize += list.filesize + 8; +} Added: trunk/OpenMPT/mptrack/tagging.h =================================================================== --- trunk/OpenMPT/mptrack/tagging.h (rev 0) +++ trunk/OpenMPT/mptrack/tagging.h 2009-08-08 21:26:10 UTC (rev 317) @@ -0,0 +1,112 @@ +#pragma once +// ID3v2.4 / etc. tagging class (for mp3 / wav / etc. support) + +#pragma pack(1) + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ID3v1 Genres + +#define NUM_GENRES 148 + +static LPCSTR gpszGenreNames[NUM_GENRES] = +{ + "Blues", "Classic Rock", "Country", "Dance", + "Disco", "Funk", "Grunge", "Hip Hop", + "Jazz", "Metal", "New_Age", "Oldies", + "Other", "Pop", "Rhythm n Blues", "Rap", + "Reggae", "Rock", "Techno", "Industrial", + "Alternative", "Ska", "Death Metal", "Pranks", + "Soundtrack", "Euro Techno", "Ambient", "Trip_Hop", + "Vocal", "Jazz Funk", "Fusion", "Trance", + "Classical", "Instrumental", "Acid", "House", + "Game", "Sound Clip", "Gospel", "Noise", + "Alternative Rock", "Bass", "Soul", "Punk", + "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", + "Ethnic", "Gothic", "Darkwave", "Techno Industrial", + "Electronic", "Pop Folk", "Eurodance", "Dream", + "Southern Rock", "Comedy", "Cult", "Gangsta", + "Top 40", "Christian Rap", "Pop Funk", "Jungle", + "Native_American", "Cabaret", "New_Wave", "Psychadelic", + "Rave", "ShowTunes", "Trailer", "Lo Fi", + "Tribal", "Acid Punk", "Acid Jazz", "Polka", + "Retro", "Musical", "Rock n Roll", "Hard_Rock", + "Folk", "Folk Rock", "National Folk", "Swing", + "Fast Fusion", "Bebob", "Latin", "Revival", + "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", + "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", + "Big Band", "Chorus", "Easy Listening", "Acoustic", + "Humour", "Speech", "Chanson", "Opera", + "Chamber Music", "Sonata", "Symphony", "Booty_Bass", + "Primus", "Porn Groove", "Satire", "Slow Jam", + "Club", "Tango", "Samba", "Folklore", + "Ballad", "Power Ballad", "Rhytmic Soul", "Freestyle", + "Duet", "Punk Rock", "Drum Solo", "Acapella", + "Euro House", "Dance Hall", "Goa", "Drum n Bass", + "Club-House", "Hardcore", "Terror", "Indie", + "BritPop", "Negerpunk", "Polsk Punk", "Beat", + "Christian Gangsta", "Heavy Metal", "Black Metal", "Crossover", + "Contemporary Christian","Christian Rock", "Merengue", "Salsa", + "Thrash Metal", "Anime", "JPop", "SynthPop", +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ID3v2.4 Tags + +typedef struct _TAGID3v2HEADER +{ + BYTE signature[3]; + BYTE version[2]; + BYTE flags; + UINT32 size; + // Total: 10 bytes +} TAGID3v2HEADER; + +typedef struct _TAGID3v2FRAME +{ + UINT32 frameid; + UINT32 size; + UINT16 flags; + // Total: 10 bytes +} TAGID3v2FRAME; + +// we will add some padding bytes to our id3v2 tag (extending tags will be easier this way) +#define ID3v2_PADDING 512 + +// charset... choose text ending accordingly. +// $00 = ISO-8859-1. Terminated with $00. +// $01 = UTF-16. Terminated with $00 00. +// $02 = UTF-16BE. Terminated with $00 00. +// $03 = UTF-8. Terminated with $00. +#ifdef UNICODE +#define ID3v2_CHARSET '\3' +#define ID3v2_TEXTENDING '\0' +#else +#define ID3v2_CHARSET '\0' +#define ID3v2_TEXTENDING '\0' +#endif + +//================ +class CFileTagging +//================ +{ +public: + // Write Tags + void WriteID3v2Tags(FILE *f); + void WriteWaveTags(WAVEDATAHEADER *wdh, WAVEFILEHEADER *wfh, FILE *f); + + // Tag data + string title, artist, album, year, comments, genre, url, encoder; + + CFileTagging(); + + +private: + // Convert Integer to Synchsafe Integer (see ID3v2.4 specs) + UINT32 intToSynchsafe(UINT32 in); + // Write a frame + void WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f); + // Size of our tag + UINT32 totalID3v2Size; +}; + +#pragma pack() Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2009-08-08 21:26:10 UTC (rev 317) @@ -6,7 +6,7 @@ //----( Global Context (0) )------------ 0:1347:2:78:1 //File/New: Ctrl+N (KeyDown) 0:1346:2:79:1 //File/Open: Ctrl+O (KeyDown) -0:1348:2:87:1 //File/Close: Ctrl+W (KeyDown) +0:1348:2:87:5 //File/Close: Ctrl+W (KeyDown|KeyHold) 0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) 0:1693:0:166:1 //Previous Document: (KeyDown) 0:1694:0:167:1 //Next Document: (KeyDown) @@ -108,9 +108,9 @@ 3:1070:0:85:1 //Base octave F#: U (KeyDown) 3:1071:0:73:1 //Base octave G: I (KeyDown) 3:1072:0:79:1 //Base octave G#: O (KeyDown) -3:1073:0:80:1 //Base octave +1 A: P (KeyDown) -3:1074:0:186:1 //Base octave +1 A#: \xFC (KeyDown) -3:1075:0:187:1 //Base octave +1 B: + (KeyDown) +3:1073:0:80:1 //Base octave A: P (KeyDown) +3:1074:0:186:1 //Base octave A#: \xFC (KeyDown) +3:1075:0:187:1 //Base octave B: + (KeyDown) 3:1076:0:65:1 //Base octave +1 C: A (KeyDown) 3:1077:0:83:1 //Base octave +1 C#: S (KeyDown) 3:1078:0:68:1 //Base octave +1 D: D (KeyDown) @@ -120,9 +120,9 @@ 3:1082:0:74:1 //Base octave +1 F#: J (KeyDown) 3:1083:0:75:1 //Base octave +1 G: K (KeyDown) 3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) -3:1085:0:192:1 //Base octave +2 A: \xF6 (KeyDown) -3:1086:0:222:1 //Base octave +2 A#: \xE4 (KeyDown) -3:1087:0:191:1 //Base octave +2 B: # (KeyDown) +3:1085:0:192:1 //Base octave +1 A: \xF6 (KeyDown) +3:1086:0:222:1 //Base octave +1 A#: \xE4 (KeyDown) +3:1087:0:191:1 //Base octave +1 B: # (KeyDown) 3:1088:0:89:1 //Base octave +2 C: Y (KeyDown) 3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) 3:1090:0:67:1 //Base octave +2 D: C (KeyDown) @@ -132,7 +132,7 @@ 3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) 3:1095:0:188:1 //Base octave +2 G: , (KeyDown) 3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) -3:1097:0:189:1 //Base octave +3 A: - (KeyDown) +3:1097:0:189:1 //Base octave +2 A: - (KeyDown) 3:1212:0:48:1 //Set octave 0: 0 (KeyDown) 3:1212:0:96:1 //Set octave 0: 0 (ZEHNERTASTATUR) (KeyDown) 3:1213:0:49:1 //Set octave 1: 1 (KeyDown) @@ -154,8 +154,9 @@ 3:1221:0:57:1 //Set octave 9: 9 (KeyDown) 3:1221:0:105:1 //Set octave 9: 9 (ZEHNERTASTATUR) (KeyDown) 3:1316:1:16:1 //Chord Modifier: Shift+UMSCHALT (KeyDown) -3:1200:0:220:1 //Note cut: ZIRKUMFLEX (KeyDown) -3:1201:0:221:1 //Note off: AKUT (KeyDown) +3:1200:0:220:1 //Note Cut: ZIRKUMFLEX (KeyDown) +3:1201:0:221:1 //Note Off: AKUT (KeyDown) +3:1791:0:219:1 //Note Fade: \xDF (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ 4:1202:0:96:1 //Set instrument digit 0: 0 (ZEHNERTASTATUR) (KeyDown) @@ -258,6 +259,9 @@ 8:1382:0:46:1 //Delete sample selection: ENTF (KeyDown) 8:1386:0:107:1 //Zoom Out: + (ZEHNERTASTATUR) (KeyDown) 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) //----( Instrument Context [bottom] (9) )------------ Modified: trunk/OpenMPT/soundlib/IT_DEFS.H =================================================================== --- trunk/OpenMPT/soundlib/IT_DEFS.H 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/soundlib/IT_DEFS.H 2009-08-08 21:26:10 UTC (rev 317) @@ -7,8 +7,8 @@ { DWORD id; // 0x4D504D49 CHAR songname[26]; - CHAR highlight_minor; - CHAR highlight_major; + BYTE highlight_minor; + BYTE highlight_major; WORD ordnum; WORD insnum; WORD smpnum; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2009-08-06 22:30:56 UTC (rev 316) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2009-08-08 21:26:10 UTC (rev 317) @@ -990,13 +990,12 @@ if (m_nDefaultGlobalVolume > 256) m_nDefaultGlobalVolume = 256; } if (pifh->speed) m_nDefaultSpeed = pifh->speed; - if (pifh->tempo) m_nDefaultTempo = pifh->tempo; - if(m_nDefaultTempo < 32) m_nDefaultTempo = 32; // tempo 31 is possible. due to conflicts with the rest of the engine, let's just clamp it to 32. + m_nDefaultTempo = max(32, pifh->tempo); // tempo 31 is possible. due to conflicts with the rest of the engine, let's just clamp it to 32. + m_nSamplePreAmp = min(pifh->mv, 128); + /*if (m_nSamplePreAmp<... [truncated message content] |