|
From: <re...@us...> - 2006-08-13 15:49:39
|
Revision: 161 Author: rewbs Date: 2006-08-13 08:49:22 -0700 (Sun, 13 Aug 2006) ViewCVS: http://svn.sourceforge.net/modplug/?rev=161&view=rev Log Message: ----------- v1.17.02.44 + <rewbs> Added release section to volume envelope (see: http://openmpt.xwiki.com/xwiki/bin/view/Manual/InstrumentReleaseEnvelope). IT only. . <rewbs> Overflow fixes in file loading functions (see: http://aluigi.altervista.org/adv/mptho-adv.txt) . <rewbs> Greyed out irrelevant items in the orderlist context menu. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/fxp.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -623,19 +623,25 @@ SetCurSel(m_nXScroll + (pt.x - rect.left) / m_cxFont); SetFocus(); HMENU hMenu = ::CreatePopupMenu(); + + UINT nCurrentPattern = GetCurrentPattern(); + bool patternExists = (nCurrentPattern<MAX_PATTERNS + && m_pModDoc->GetSoundFile()->Patterns[nCurrentPattern] != NULL); + DWORD greyed = patternExists?FALSE:MF_GRAYED; + if (hMenu) { AppendMenu(hMenu, MF_STRING, ID_ORDERLIST_INSERT, "&Insert Pattern\tIns"); AppendMenu(hMenu, MF_STRING, ID_ORDERLIST_DELETE, "&Remove Pattern\tDel"); AppendMenu(hMenu, MF_SEPARATOR, NULL, ""); AppendMenu(hMenu, MF_STRING, ID_ORDERLIST_NEW, "Create &New Pattern"); - AppendMenu(hMenu, MF_STRING, ID_ORDERLIST_COPY, "&Duplicate Pattern"); - AppendMenu(hMenu, MF_STRING, ID_PATTERNCOPY, "&Copy Pattern"); - AppendMenu(hMenu, MF_STRING, ID_PATTERNPASTE, "P&aste Pattern"); + AppendMenu(hMenu, MF_STRING|greyed, ID_ORDERLIST_COPY, "&Duplicate Pattern"); + AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERNCOPY, "&Copy Pattern"); + AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERNPASTE, "P&aste Pattern"); if ((m_pModDoc) && (m_pModDoc->GetSoundFile()->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT))) { AppendMenu(hMenu, MF_SEPARATOR, NULL, ""); - AppendMenu(hMenu, MF_STRING, ID_PATTERN_PROPERTIES, "&Properties..."); + AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_PROPERTIES, "&Properties..."); } ClientToScreen(&pt); ::TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -212,6 +212,7 @@ HPEN CMainFrame::penHalfDarkGray = NULL; HPEN CMainFrame::penSample = NULL; HPEN CMainFrame::penEnvelope = NULL; +HPEN CMainFrame::penEnvelopeHighlight = NULL; HPEN CMainFrame::penSeparator = NULL; HBRUSH CMainFrame::brushGray = NULL; HBRUSH CMainFrame::brushBlack = NULL; @@ -220,6 +221,7 @@ //CBrush *CMainFrame::pbrushWhite = NULL;//rewbs.envRowGrid HBRUSH CMainFrame::brushHighLight = NULL; +HBRUSH CMainFrame::brushHighLightRed = NULL; HBRUSH CMainFrame::brushWindow = NULL; HCURSOR CMainFrame::curDragging = NULL; HCURSOR CMainFrame::curArrow = NULL; @@ -767,6 +769,7 @@ DeleteGDIObject(penDarkGray); DeleteGDIObject(penSample); DeleteGDIObject(penEnvelope); + DeleteGDIObject(penEnvelopeHighlight); DeleteGDIObject(m_hFixedFont); DeleteGDIObject(penScratch); DeleteGDIObject(penGray00); @@ -1672,6 +1675,9 @@ penSample = ::CreatePen(PS_SOLID, 0, rgbCustomColors[MODCOLOR_SAMPLE]); if (penEnvelope) DeleteObject(penEnvelope); penEnvelope = ::CreatePen(PS_SOLID, 0, rgbCustomColors[MODCOLOR_ENVELOPES]); + if (penEnvelopeHighlight) DeleteObject(penEnvelopeHighlight); + penEnvelopeHighlight = ::CreatePen(PS_SOLID, 0, RGB(0xFF, 0xFF, 0x00)); + for (UINT i=0; i<NUM_VUMETER_PENS*2; i++) { int r0,g0,b0, r1,g1,b1; @@ -1718,8 +1724,11 @@ COLORREF crBkgnd = GetSysColor(COLOR_WINDOW); if (brushHighLight) DeleteObject(brushHighLight); brushHighLight = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); + if (brushHighLightRed) DeleteObject(brushHighLight); + brushHighLightRed = CreateSolidBrush(RGB(0xFF,0x00,0x00)); + if (brushWindow) DeleteObject(brushWindow); - brushWindow = CreateSolidBrush(crBkgnd); + brushWindow = CreateSolidBrush(crBkgnd); if (penSeparator) DeleteObject(penSeparator); penSeparator = CreatePen(PS_SOLID, 0, RGB(GetRValue(crBkgnd)/2, GetGValue(crBkgnd)/2, GetBValue(crBkgnd)/2)); } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2006-08-13 15:49:22 UTC (rev 161) @@ -379,9 +379,9 @@ // GDI static HICON m_hIcon; static HFONT m_hGUIFont, m_hFixedFont, m_hLargeFixedFont; - static HBRUSH brushGray, brushBlack, brushWhite, brushHighLight, brushWindow; + static HBRUSH brushGray, brushBlack, brushWhite, brushHighLight, brushHighLightRed, brushWindow; // static CBrush *pbrushBlack, *pbrushWhite; - static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; + static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penEnvelopeHighlight, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; static HCURSOR curDragging, curNoDrop, curArrow, curNoDrop2, curVSplit; static COLORREF rgbCustomColors[MAX_MODCOLORS]; static LPMODPLUGDIB bmpPatterns, bmpNotes, bmpVUMeters, bmpVisNode; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -786,9 +786,7 @@ pChn->nNewNote = note; if (nins) { //Set instrument - pChn->nVolEnvPosition = 0; - pChn->nPanEnvPosition = 0; - pChn->nPitchEnvPosition = 0; + m_SndFile.resetEnvelopes(pChn); m_SndFile.InstrumentChange(pChn, nins); } else if ((nsmp) && (nsmp < MAX_SAMPLES)) { //Or set sample Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -1318,8 +1318,7 @@ penv->nGlobalVol = 64; penv->nPan = 128; penv->nPPC = 5*12; - penv->nResampling = SRCMODE_DEFAULT; - penv->nFilterMode = FLTMODE_UNCHANGED; + m_SndFile.SetDefaultInstrumentValues(penv); for (UINT n=0; n<128; n++) { penv->Keyboard[n] = nsample; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -2005,7 +2005,6 @@ Dispatch(effMainsChanged, 0, 1, NULL, 0.0f); // calls plugin's resume Dispatch(effStartProcess, 0, 0, NULL, 0.0f); m_bPlugResumed = true; -// ClearVSTEvents(); //DEBUG } catch (...) { CVstPluginManager::ReportPlugException("Exception in Resume() (Plugin=%s)\n", m_pFactory->szLibraryName); } @@ -2623,8 +2622,10 @@ dwMidiCode = 0x80|nCh|(vol<<16); //note off, on chan nCh; vol is note off velocity. for (UINT i=0; i<128; i++) //all notes { - pCh->uNoteOnMap[i][trackChannel]=0; - MidiSend(dwMidiCode|(i<<8)); + //if (!(m_pEffect->uniqueID==1413633619L) || pCh->uNoteOnMap[i][trackChannel]>0) { //only send necessary NOs for TBVS. + pCh->uNoteOnMap[i][trackChannel]=0; + MidiSend(dwMidiCode|(i<<8)); + //} } } Modified: trunk/OpenMPT/mptrack/fxp.cpp =================================================================== --- trunk/OpenMPT/mptrack/fxp.cpp 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/fxp.cpp 2006-08-13 15:49:22 UTC (rev 161) @@ -106,7 +106,7 @@ ChunkMagic == 'CcnK' && (fxMagic == 'FxCk' || fxMagic == 'FPCh'))) { - ::AfxMessageBox("Bad Magic."); + ::AfxMessageBox("Bad Magic number: this does not look like a preset file."); inStream.Close(); return false; } @@ -124,7 +124,7 @@ } } } - else if (fxMagic == 'FPCh') // load chunk list + else if (fxMagic == 'FPCh') // load chunk { if (!ReadLE(inStream, chunkSize)) { @@ -254,7 +254,7 @@ bool Cfxp::WriteLE(CFile &out, const long &l) { int size=sizeof(long); - long l2 = l; // maybe I should have made that arg a const.. + long l2 = l; if (NeedSwap()) SwapBytes(l2); out.Write(&l2, size); @@ -264,7 +264,7 @@ bool Cfxp::WriteLE(CFile &out, const float &f) { int size=sizeof(float); - float f2 = f; // maybe I should have made that arg a const.. + float f2 = f; if (NeedSwap()) SwapBytes(f2); out.Write(&f2, size); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/mptrack.rc 2006-08-13 15:49:22 UTC (rev 161) @@ -216,6 +216,8 @@ MENUITEM "C&arry envelope", ID_ENVELOPE_CARRY MENUITEM "&Insert Point", ID_ENVELOPE_INSERTPOINT MENUITEM "&Remove Point", ID_ENVELOPE_REMOVEPOINT + MENUITEM "&Toggle Release Node", ID_ENVELOPE_TOGGLERELEASENODE + MENUITEM SEPARATOR MENUITEM "&Copy envelope", ID_EDIT_COPY MENUITEM "&Paste envelope", ID_EDIT_PASTE @@ -1894,7 +1896,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,43 + FILEVERSION 1,17,2,44 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1912,9 +1914,9 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 43" + VALUE "FileVersion", "1, 17, 2, 44" VALUE "InternalName", "Modplug Tracker" - VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2005 GPL." + VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" VALUE "OriginalFilename", "mptrack.exe" VALUE "ProductName", "OpenMPT / ModPlug Tracker" @@ -2187,6 +2189,7 @@ "Display channel manager window\nChannel manager" ID_INDICATOR_CPU "-" ID_FILE_EXPORTCOMPAT "Export file to standard IT/XM." + ID_ENVELOPE_SETRELEASENODE "Set release node" END STRINGTABLE Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2006-08-13 09:05:57 UTC (rev 160) +++ trunk/OpenMPT/mptrack/resource.h 2006-08-13 15:49:22 UTC (rev 161) @@ -41,6 +41,7 @@ #define IDR_ENVELOPES 203 #define ID_INDICATOR_CPU 203 #define ID_FILE_EXPORTCOMPAT 204 +#define ID_ENVELOPE_SETRELEASENODE 205 #define IDB_MAINBAR 300 #define IDB_IMAGELIST 301 #define IDB_PATTERNS 302 @@ -943,6 +944,7 @@ #define ID_Menu 59200 #define ID_FILE_SAVECOMPAT 59202 #define ID_CLEANUP_PLUGS 59205 +#define ID_ENVELOPE_TOGGLERELEASENODE 59206 // Next default values for new objects // @@ -950,7 +952,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 510 -#define _APS_NEXT_COMMAND_VALUE 59206 +#define _APS_NEXT_COMMAND_VALUE 59207 #define _APS_NEXT_CONTROL_VALUE 2256 #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. |