From: <sag...@us...> - 2009-08-29 14:56:28
|
Revision: 347 http://modplug.svn.sourceforge.net/modplug/?rev=347&view=rev Author: saga-games Date: 2009-08-29 14:56:14 +0000 (Sat, 29 Aug 2009) Log Message: ----------- [Fix] MP3 Tagging: Synchsafe integers were calculated wrong; Writing the comments field last so the chance of fucking up everything is lower (Winamp's tag reader seems to have some problems with my long comments, but they seem to be encoded correctly? :-S) [Fix] XM Compatibility: Note Off with instrument number causes fadeout for samples that have no envelope. [Imp] Comments tab: Default view mode is instruments instead of samples for XM files. Modified Paths: -------------- trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2009-08-29 00:40:26 UTC (rev 346) +++ trunk/OpenMPT/mptrack/tagging.cpp 2009-08-29 14:56:14 UTC (rev 347) @@ -1,5 +1,5 @@ /* - * Purpose: File tagging (ID3v2, RIFF + more in the future) + * Purpose: File tagging (ID3v2, RIFF + more iIn the future) * Authors: OpenMPT Devs */ @@ -23,15 +23,15 @@ // 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) +UINT32 CFileTagging::intToSynchsafe(UINT32 iIn) { - in = LittleEndian(in); - UINT32 out = 0; + iIn = LittleEndian(iIn); + UINT32 iOut = 0, iSteps = 0; do { - out <<= 8; - out |= (in & 0x7F); - } while(in >>= 7); - return BigEndian(out); + iOut |= (iIn & 0x7F) << iSteps; + iSteps += 8; + } while(iIn >>= 7); + return BigEndian(iOut); } // Write Tags @@ -53,7 +53,7 @@ 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) + // Write TIT2 (Title), TCOM / TPE1 (Composer), TALB (Album), TCON (Genre), TYER (Date), WXXX (URL), TENC (Encoder), COMM (Comment) WriteID3v2Frame("TIT2", title, f); WriteID3v2Frame("TPE1", artist, f); WriteID3v2Frame("TCOM", artist, f); @@ -61,8 +61,8 @@ WriteID3v2Frame("TCON", genre, f); WriteID3v2Frame("TYER", year, f); WriteID3v2Frame("WXXX", url, f); + WriteID3v2Frame("TENC", encoder, f); WriteID3v2Frame("COMM", comments, f); - WriteID3v2Frame("TENC", encoder, f); // Write Padding for(UINT i = 0; i < ID3v2_PADDING; i++) Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2009-08-29 00:40:26 UTC (rev 346) +++ trunk/OpenMPT/mptrack/view_com.cpp 2009-08-29 14:56:14 UTC (rev 347) @@ -97,13 +97,30 @@ //---------------------------- { m_nCurrentListId = 0; - m_nListId = IDC_LIST_SAMPLES; + m_nListId = 0;//IDC_LIST_SAMPLES; } void CViewComments::OnInitialUpdate() //----------------------------------- { + if(m_nListId == 0) + { + m_nListId = IDC_LIST_SAMPLES; + + // For XM, set the instrument list as the default list + CModDoc *pModDoc = GetDocument(); + CSoundFile *pSndFile; + if(pModDoc) + { + pSndFile= pModDoc->GetSoundFile(); + if(pSndFile && (pSndFile->m_nType & MOD_TYPE_XM)) + { + m_nListId = IDC_LIST_INSTRUMENTS; + } + } + } + CChildFrame *pFrame = (CChildFrame *)GetParentFrame(); CRect rect; Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2009-08-29 00:40:26 UTC (rev 346) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2009-08-29 14:56:14 UTC (rev 347) @@ -15,6 +15,7 @@ * - Sinaria - Seems to work (never played the game, so I can't really tell...) * * Effect conversion should be about right... + * If OpenMPT will ever support subtunes properly, the subtune crap should be rewritten completely. */ #include "stdafx.h" Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-08-29 00:40:26 UTC (rev 346) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-08-29 14:56:14 UTC (rev 347) @@ -1233,8 +1233,8 @@ note = instr = 0; } - // XM: Key-Off + Sample == Note Cut - if ((note == NOTE_KEYOFF) && ((!pChn->pModInstrument) || (!(pChn->pModInstrument->dwFlags & ENV_VOLUME)))) + // XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number is present!) + if ((note == NOTE_KEYOFF) && (!pChn->pModInstrument || !IsCompatibleMode(TRK_FASTTRACKER2)) && ((!pChn->pModInstrument) || (!(pChn->pModInstrument->dwFlags & ENV_VOLUME)))) { pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nVolume = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |