From: <man...@us...> - 2014-03-23 15:59:32
|
Revision: 3940 http://sourceforge.net/p/modplug/code/3940 Author: manxorist Date: 2014-03-23 15:59:24 +0000 (Sun, 23 Mar 2014) Log Message: ----------- [Ref] serialization_utils: Restrict member accesses. Modified Paths: -------------- trunk/OpenMPT/common/serialization_utils.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/pattern.cpp trunk/OpenMPT/soundlib/patternContainer.cpp trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuningCollection.cpp Modified: trunk/OpenMPT/common/serialization_utils.h =================================================================== --- trunk/OpenMPT/common/serialization_utils.h 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/common/serialization_utils.h 2014-03-23 15:59:24 UTC (rev 3940) @@ -284,20 +284,24 @@ void SetFlag(Rwf flag, bool val) {m_Flags.set(flag, val);} bool GetFlag(Rwf flag) const {return m_Flags[flag];} + SsbStatus GetStatus() const + { + return m_Status; + } + +protected: + // Write given string to log if log func is defined. void AddToLog(const char *psz); -protected: - void AddNote(const SsbStatus s, const char* sz); -public: +protected: SsbStatus m_Status; + uint32 m_nFixedEntrySize; // Read/write: If > 0, data entries have given fixed size. -protected: - Postype m_posStart; // Read/write: Stream position at the beginning of object. uint16 m_nIdbytes; // Read/Write: Tells map ID entry size in bytes. If size is variable, value is IdSizeVariable. @@ -305,7 +309,7 @@ std::bitset<RwfNumFlags> m_Flags; // Read/write: Various flags. -public: +protected: static const uint8 s_DefaultFlagbyte = 0; static const char s_EntryID[3]; @@ -398,8 +402,6 @@ std::istream* m_pIstrm; // Read: Pointer to read stream. -private: - std::vector<char> m_Idarray; // Read: Holds entry ids. std::vector<ReadEntry> mapData; // Read: Contains map information. @@ -469,8 +471,6 @@ std::ostream* m_pOstrm; // Write: Pointer to write stream. -private: - Postype m_posEntrycount; // Write: Pos of entrycount field. Postype m_posMapPosField; // Write: Pos of map position field. std::string m_MapStreamString; // Write: Map stream string. Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -1029,7 +1029,7 @@ ssb.ReadItem(Patterns, FileIdPatterns, strlen(FileIdPatterns), &ReadModPatterns); ssb.ReadItem(Order, FileIdSequences, strlen(FileIdSequences), &ReadModSequences); - if(ssb.m_Status & srlztn::SNT_FAILURE) + if(ssb.GetStatus() & srlztn::SNT_FAILURE) { AddToLog("Unknown error occured while deserializing file."); } @@ -1647,7 +1647,7 @@ ssb.FinishWrite(); - if(ssb.m_Status & srlztn::SNT_FAILURE) + if(ssb.GetStatus() & srlztn::SNT_FAILURE) { AddToLog("Error occured in writing MPTM extensions."); } Modified: trunk/OpenMPT/soundlib/ModSequence.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/ModSequence.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -827,7 +827,7 @@ { srlztn::SsbRead ssb(iStrm); ssb.BeginRead(FileIdSequence, MptVersion::num); - if ((ssb.m_Status & srlztn::SNT_FAILURE) != 0) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) != 0) return; std::string str; ssb.ReadItem(str, "n"); @@ -865,7 +865,7 @@ { srlztn::SsbRead ssb(iStrm); ssb.BeginRead(FileIdSequences, MptVersion::num); - if ((ssb.m_Status & srlztn::SNT_FAILURE) != 0) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) != 0) return; uint8 nSeqs = 0; uint8 nCurrent = 0; Modified: trunk/OpenMPT/soundlib/pattern.cpp =================================================================== --- trunk/OpenMPT/soundlib/pattern.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/pattern.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -499,7 +499,7 @@ { srlztn::SsbRead ssb(iStrm); ssb.BeginRead(FileIdPattern, MptVersion::num); - if ((ssb.m_Status & srlztn::SNT_FAILURE) != 0) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) != 0) return; ssb.ReadItem(pat, "data", strlen("data"), &ReadData); // pattern time signature Modified: trunk/OpenMPT/soundlib/patternContainer.cpp =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/patternContainer.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -211,7 +211,7 @@ { srlztn::SsbRead ssb(iStrm); ssb.BeginRead(FileIdPatterns, MptVersion::num); - if ((ssb.m_Status & srlztn::SNT_FAILURE) != 0) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) != 0) return; PATTERNINDEX nPatterns = patc.Size(); uint16 nCount = uint16_max; Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/tuning.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -396,7 +396,7 @@ ssb.ReadItem(pTuning->m_SerHelperRatiotableSize, "RTI4"); // If reader status is ok and m_StepMin is somewhat reasonable, process data. - if ((ssb.m_Status & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) { EDITMASK temp = pTuning->GetEditMask(); pTuning->m_EditMask = EM_ALLOWALL; //Allowing all while processing data. @@ -503,7 +503,7 @@ ssb.FinishWrite(); - return ((ssb.m_Status & srlztn::SNT_FAILURE) != 0) ? SERIALIZATION_FAILURE : SERIALIZATION_SUCCESS; + return ((ssb.GetStatus() & srlztn::SNT_FAILURE) != 0) ? SERIALIZATION_FAILURE : SERIALIZATION_SUCCESS; } Modified: trunk/OpenMPT/soundlib/tuningCollection.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningCollection.cpp 2014-03-23 15:12:27 UTC (rev 3939) +++ trunk/OpenMPT/soundlib/tuningCollection.cpp 2014-03-23 15:59:24 UTC (rev 3940) @@ -112,7 +112,7 @@ ssb.WriteItem(*m_Tunings[i], "2", 1, &WriteTuning); ssb.FinishWrite(); - if(ssb.m_Status & srlztn::SNT_FAILURE) + if(ssb.GetStatus() & srlztn::SNT_FAILURE) return true; else return false; @@ -179,7 +179,7 @@ ssb.ReadItem(iter, *this, &ReadTuning); } - if(ssb.m_Status & srlztn::SNT_FAILURE) + if(ssb.GetStatus() & srlztn::SNT_FAILURE) return true; else return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-24 02:32:03
|
Revision: 3943 http://sourceforge.net/p/modplug/code/3943 Author: saga-games Date: 2014-03-24 02:31:54 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Ref] Various small changes with no change in functionality. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/PatternClipboard.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/mptrack/Reporting.cpp trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/ITTools.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/modcommand.cpp trunk/OpenMPT/test/TestToolsTracker.h Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/common/BuildSettings.h 2014-03-24 02:31:54 UTC (rev 3943) @@ -103,7 +103,7 @@ // Disable the built-in reverb effect //#define NO_REVERB -// Disable built-in miscellaneous DSP effects (surround, mega bass) +// Disable built-in miscellaneous DSP effects (surround, mega bass, noise reduction) //#define NO_DSP // Disable the built-in equalizer. Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -124,7 +124,7 @@ CChannelManagerDlg::~CChannelManagerDlg(void) { - if(this == CChannelManagerDlg::sharedInstance_) CChannelManagerDlg::sharedInstance_ = NULL; + if(this == CChannelManagerDlg::sharedInstance_) CChannelManagerDlg::sharedInstance_ = nullptr; if(bkgnd) DeleteObject(bkgnd); } @@ -135,16 +135,16 @@ HWND menu = ::GetDlgItem(m_hWnd,IDC_TAB1); TCITEM tie; - tie.mask = TCIF_TEXT | TCIF_IMAGE; - tie.iImage = -1; - tie.pszText = "Solo/Mute"; - TabCtrl_InsertItem(menu, 0, &tie); - tie.pszText = "Record select"; - TabCtrl_InsertItem(menu, 1, &tie); - tie.pszText = "Fx plugins"; - TabCtrl_InsertItem(menu, 2, &tie); - tie.pszText = "Reorder/Remove"; - TabCtrl_InsertItem(menu, 3, &tie); + tie.mask = TCIF_TEXT | TCIF_IMAGE; + tie.iImage = -1; + tie.pszText = "Solo/Mute"; + TabCtrl_InsertItem(menu, 0, &tie); + tie.pszText = "Record select"; + TabCtrl_InsertItem(menu, 1, &tie); + tie.pszText = "Fx plugins"; + TabCtrl_InsertItem(menu, 2, &tie); + tie.pszText = "Reorder/Remove"; + TabCtrl_InsertItem(menu, 3, &tie); currentTab = 0; for(CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++) Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -2311,13 +2311,13 @@ m_modDoc.GetSampleUndo().PrepareUndo(m_nSample, sundo_update, "Silence", selection.nStart, selection.nEnd); SmpLength len = selection.nEnd - selection.nStart; - if (sample.uFlags & CHN_STEREO) + if (sample.uFlags[CHN_STEREO]) { - int smplsize = (sample.uFlags & CHN_16BIT) ? 4 : 2; + int smplsize = sample.GetBytesPerSample(); signed char *p = ((signed char *)sample.pSample) + selection.nStart * smplsize; - memset(p, 0, len*smplsize); + memset(p, 0, len * smplsize); } else - if (sample.uFlags & CHN_16BIT) + if (sample.uFlags[CHN_16BIT]) { short int *p = ((short int *)sample.pSample) + selection.nStart; int dest = (selection.nEnd < sample.nLength) ? p[len-1] : 0; @@ -2373,11 +2373,11 @@ void CCtrlSamples::OnNameChanged() //-------------------------------- { - char s[MAX_SAMPLENAME] = { '\0' }; + TCHAR s[MAX_SAMPLENAME] = _T(""); if(IsLocked() || !m_nSample) return; - m_EditName.GetWindowText(s, sizeof(s)); - if (strncmp(s, m_sndFile.m_szNames[m_nSample], MAX_SAMPLENAME)) + m_EditName.GetWindowText(s, CountOf(s)); + if (_tcscmp(s, m_sndFile.m_szNames[m_nSample])) { mpt::String::Copy(m_sndFile.m_szNames[m_nSample], s); m_modDoc.UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); @@ -2390,12 +2390,12 @@ void CCtrlSamples::OnFileNameChanged() //------------------------------------ { - char s[MAX_SAMPLEFILENAME] = { '\0' }; + TCHAR s[MAX_SAMPLEFILENAME] = _T(""); if(IsLocked()) return; - m_EditFileName.GetWindowText(s, sizeof(s)); + m_EditFileName.GetWindowText(s, CountOf(s)); - if (strncmp(s, m_sndFile.GetSample(m_nSample).filename, MAX_SAMPLEFILENAME)) + if (_tcscmp(s, m_sndFile.GetSample(m_nSample).filename)) { mpt::String::Copy(m_sndFile.GetSample(m_nSample).filename, s); m_modDoc.UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, this); @@ -2427,7 +2427,7 @@ Limit(nVol, 0, 64); if (nVol != m_sndFile.GetSample(m_nSample).nGlobalVol) { - m_sndFile.GetSample(m_nSample).nGlobalVol = (WORD)nVol; + m_sndFile.GetSample(m_nSample).nGlobalVol = (uint16)nVol; m_modDoc.SetModified(); } } @@ -2437,28 +2437,18 @@ //-------------------------------------- { if (IsLocked()) return; - BOOL b = FALSE; - if (m_sndFile.m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) + bool b = false; + if (m_sndFile.GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) { - b = IsDlgButtonChecked(IDC_CHECK1); + b = IsDlgButtonChecked(IDC_CHECK1) != FALSE; } ModSample &sample = m_sndFile.GetSample(m_nSample); - if (b) + if(b != sample.uFlags[CHN_PANNING]) { - if (!(sample.uFlags & CHN_PANNING)) - { - sample.uFlags |= CHN_PANNING; - m_modDoc.SetModified(); - } - } else - { - if (sample.uFlags & CHN_PANNING) - { - sample.uFlags &= ~CHN_PANNING; - m_modDoc.SetModified(); - } + sample.uFlags.set(CHN_PANNING, b); + m_modDoc.SetModified(); } } @@ -2481,7 +2471,7 @@ //end rewbs.fix36944 if (nPan != m_sndFile.GetSample(m_nSample).nPan) { - m_sndFile.GetSample(m_nSample).nPan = (WORD)nPan; + m_sndFile.GetSample(m_nSample).nPan = (uint16)nPan; if (m_sndFile.m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_modDoc.SetModified(); } } @@ -2512,7 +2502,7 @@ } } else { - if(m_sndFile.m_nType & MOD_TYPE_MOD) + if(m_sndFile.GetType() & MOD_TYPE_MOD) n = MOD2XMFineTune(n); if ((n >= -128) && (n <= 127)) { Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -34,7 +34,23 @@ #define VUMETERS_MEDWIDTH 24 #define VUMETERS_LOWIDTH 16 +enum +{ + COLUMN_BITS_NONE = 0x00, + COLUMN_BITS_NOTE = 0x01, + COLUMN_BITS_INSTRUMENT = 0x02, + COLUMN_BITS_VOLUME = 0x04, + COLUMN_BITS_FXCMD = 0x08, + COLUMN_BITS_FXPARAM = 0x10, + COLUMN_BITS_FXCMDANDPARAM = 0x18, + COLUMN_BITS_ALLCOLUMNS = 0x1F, + COLUMN_BITS_UNKNOWN = 0x20, // Appears to be unused + COLUMN_BITS_ALL = 0x3F, + COLUMN_BITS_SKIP = 0x40, + COLUMN_BITS_INVISIBLE = 0x80, +}; + struct PATTERNFONT { int nWidth, nHeight; // Column Width & Height, including 4-pixels border @@ -237,7 +253,7 @@ } -POINT CViewPattern::GetPointFromPosition(PatternCursor cursor) +POINT CViewPattern::GetPointFromPosition(PatternCursor cursor) //------------------------------------------------------------ { PCPATTERNFONT pfnt = GetCurrentPatternFont(); @@ -783,13 +799,13 @@ for(CHANNELINDEX cmk = startChan; cmk < ncols; cmk++) { selectedCols[cmk] = selEnable ? m_Selection.GetSelectionBits(cmk) : 0; - if (!::RectVisible(hdc, &rect)) selectedCols[cmk] |= 0x80; + if (!::RectVisible(hdc, &rect)) selectedCols[cmk] |= COLUMN_BITS_INVISIBLE; rect.left += nColumnWidth; rect.right += nColumnWidth; } // Max Visible Column CHANNELINDEX maxcol = ncols; - while ((maxcol > startChan) && (selectedCols[maxcol-1] & 0x80)) maxcol--; + while ((maxcol > startChan) && (selectedCols[maxcol-1] & COLUMN_BITS_INVISIBLE)) maxcol--; // Init bitmap border { UINT maxndx = pSndFile->GetNumChannels() * m_szCell.cx; @@ -821,7 +837,7 @@ if (!::RectVisible(hdc, &rect)) { // No speedup for these columns next time - for (CHANNELINDEX iup=startChan; iup<maxcol; iup++) selectedCols[iup] &= ~0x40; + for (CHANNELINDEX iup=startChan; iup<maxcol; iup++) selectedCols[iup] &= ~COLUMN_BITS_SKIP; goto SkipRow; } rect.right = rect.left + m_szHeader.cx; @@ -880,9 +896,9 @@ // Eliminate non-visible column xpaint = m_szHeader.cx; col = startChan; - while ((selectedCols[col] & 0x80) && (col < maxcol)) + while ((selectedCols[col] & COLUMN_BITS_INVISIBLE) && (col < maxcol)) { - selectedCols[col] &= ~0x40; + selectedCols[col] &= ~COLUMN_BITS_SKIP; col++; xpaint += nColumnWidth; } @@ -899,31 +915,31 @@ const bool drawDefaultVolume = DrawDefaultVolume(m); DWORD dwSpeedUpMask = 0; - if ((bSpeedUp) && (selectedCols[col] & 0x40) && (pPattern) && (row)) + if ((bSpeedUp) && (selectedCols[col] & COLUMN_BITS_SKIP) && (pPattern) && (row)) { const ModCommand *mold = m - ncols; const bool drawOldDefaultVolume = DrawDefaultVolume(mold); - if (m->note == mold->note) dwSpeedUpMask |= 0x01; - if ((m->instr == mold->instr) || (m_nDetailLevel < PatternCursor::instrColumn)) dwSpeedUpMask |= 0x02; + if (m->note == mold->note) dwSpeedUpMask |= COLUMN_BITS_NOTE; + if ((m->instr == mold->instr) || (m_nDetailLevel < PatternCursor::instrColumn)) dwSpeedUpMask |= COLUMN_BITS_INSTRUMENT; if ( m->IsPcNote() || mold->IsPcNote() ) - { // Handle speedup mask for PC notes. + { + // Handle speedup mask for PC notes. if(m->note == mold->note) { - if(m->GetValueVolCol() == mold->GetValueVolCol() || (m_nDetailLevel < PatternCursor::volumeColumn)) dwSpeedUpMask |= 0x04; - if(m->GetValueEffectCol() == mold->GetValueEffectCol() || (m_nDetailLevel < PatternCursor::effectColumn)) dwSpeedUpMask |= 0x18; - } - } - else + if(m->GetValueVolCol() == mold->GetValueVolCol() || (m_nDetailLevel < PatternCursor::volumeColumn)) dwSpeedUpMask |= COLUMN_BITS_VOLUME; + if(m->GetValueEffectCol() == mold->GetValueEffectCol() || (m_nDetailLevel < PatternCursor::effectColumn)) dwSpeedUpMask |= COLUMN_BITS_FXCMDANDPARAM; + } + } else { - if ((m->volcmd == mold->volcmd && (m->volcmd == VOLCMD_NONE || m->vol == mold->vol) && !drawDefaultVolume && !drawOldDefaultVolume) || (m_nDetailLevel < PatternCursor::volumeColumn)) dwSpeedUpMask |= 0x04; - if ((m->command == mold->command) || (m_nDetailLevel < PatternCursor::effectColumn)) dwSpeedUpMask |= (m->command != CMD_NONE) ? 0x08 : 0x18; + if ((m->volcmd == mold->volcmd && (m->volcmd == VOLCMD_NONE || m->vol == mold->vol) && !drawDefaultVolume && !drawOldDefaultVolume) || (m_nDetailLevel < PatternCursor::volumeColumn)) dwSpeedUpMask |= COLUMN_BITS_VOLUME; + if ((m->command == mold->command) || (m_nDetailLevel < PatternCursor::effectColumn)) dwSpeedUpMask |= (m->command != CMD_NONE) ? COLUMN_BITS_FXCMD : COLUMN_BITS_FXCMDANDPARAM; } - if (dwSpeedUpMask == 0x1F) goto DoBlit; + if (dwSpeedUpMask == COLUMN_BITS_ALLCOLUMNS) goto DoBlit; } - selectedCols[col] |= 0x40; + selectedCols[col] |= COLUMN_BITS_SKIP; col_sel = 0; - if (bRowSel) col_sel = selectedCols[col] & 0x3F; + if (bRowSel) col_sel = selectedCols[col] & COLUMN_BITS_ALL; tx_col = row_col; bk_col = row_bkcol; if (col_sel) @@ -932,7 +948,7 @@ bk_col = MODCOLOR_BACKSELECTED; } // Speedup: Empty command which is either not or fully selected - if (m->IsEmpty() && ((!col_sel) || (col_sel == 0x1F))) + if (m->IsEmpty() && ((!col_sel) || (col_sel == COLUMN_BITS_ALLCOLUMNS))) { m_Dib.SetTextColor(tx_col, bk_col); m_Dib.TextBlt(xbmp, 0, nColumnWidth-4, m_szCell.cy, pfnt->nClrX, pfnt->nClrY); @@ -940,7 +956,7 @@ } x = 0; // Note - if (!(dwSpeedUpMask & 0x01)) + if (!(dwSpeedUpMask & COLUMN_BITS_NOTE)) { tx_col = row_col; bk_col = row_bkcol; @@ -962,7 +978,7 @@ } } } - if (col_sel & 0x01) + if (col_sel & COLUMN_BITS_NOTE) { tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; @@ -978,7 +994,7 @@ // Instrument if (m_nDetailLevel >= PatternCursor::instrColumn) { - if (!(dwSpeedUpMask & 0x02)) + if (!(dwSpeedUpMask & COLUMN_BITS_INSTRUMENT)) { tx_col = row_col; bk_col = row_bkcol; @@ -986,7 +1002,7 @@ { tx_col = MODCOLOR_INSTRUMENT; } - if (col_sel & 0x02) + if (col_sel & COLUMN_BITS_INSTRUMENT) { tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; @@ -1000,11 +1016,11 @@ // Volume if (m_nDetailLevel >= PatternCursor::volumeColumn) { - if (!(dwSpeedUpMask & 0x04)) + if (!(dwSpeedUpMask & COLUMN_BITS_VOLUME)) { tx_col = row_col; bk_col = row_bkcol; - if (col_sel & 0x04) + if (col_sel & COLUMN_BITS_VOLUME) { tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; @@ -1036,11 +1052,11 @@ if(effectColors[m->GetEffectType()] != 0) fx_col = effectColors[m->GetEffectType()]; } - if (!(dwSpeedUpMask & 0x08)) + if (!(dwSpeedUpMask & COLUMN_BITS_FXCMD)) { tx_col = fx_col; bk_col = row_bkcol; - if (col_sel & 0x08) + if (col_sel & COLUMN_BITS_FXCMD) { tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; @@ -1067,11 +1083,11 @@ } x += pfnt->nEltWidths[3]; // Param - if (!(dwSpeedUpMask & 0x10)) + if (!(dwSpeedUpMask & COLUMN_BITS_FXPARAM)) { tx_col = fx_col; bk_col = row_bkcol; - if (col_sel & 0x10) + if (col_sel & COLUMN_BITS_FXPARAM) { tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/Globals.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -755,7 +755,7 @@ hInstance, ::FindResource(hInstance, MAKEINTRESOURCE(nId), RT_BITMAP)); tbab.hInst = NULL; - tbab.nID = (UINT)m_hBarBmp; + tbab.nID = (UINT_PTR)m_hBarBmp; ::SendMessage(m_hWnd, TB_ADDBITMAP, 16, (LPARAM)&tbab); UpdateStyle(); return TRUE; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -1352,7 +1352,7 @@ //------------------------------------------------------ { if (nChn >= m_SndFile.m_nChannels) return false; - if (m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) SetModified(); + if (m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_S3M)) SetModified(); m_SndFile.ChnSettings[nChn].dwFlags.set(CHN_SOLO, bSolo); return true; } @@ -1373,11 +1373,8 @@ //---------------------------------------------------------------------- { if (nChn >= m_SndFile.m_nChannels) return false; - if (m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) SetModified(); - m_SndFile.ChnSettings[nChn].dwFlags.set(CHN_NOFX, bNoFx); if(updateMix) m_SndFile.m_PlayState.Chn[nChn].dwFlags.set(CHN_NOFX, bNoFx); - return true; } @@ -1451,8 +1448,7 @@ //------------------------------------------------------- { if ((nSample < 1) || (nSample > m_SndFile.GetNumSamples())) return false; - if (bMute) m_SndFile.GetSample(nSample).uFlags |= CHN_MUTE; - else m_SndFile.GetSample(nSample).uFlags &= ~CHN_MUTE; + m_SndFile.GetSample(nSample).uFlags.set(CHN_MUTE, bMute); return true; } Modified: trunk/OpenMPT/mptrack/PatternClipboard.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternClipboard.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/PatternClipboard.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -528,7 +528,7 @@ { pos++; // Handle pasting large pattern into smaller pattern (e.g. 128-row pattern into MOD, which only allows 64 rows) - static ModCommand dummy; + ModCommand dummy; ModCommand &m = curRow < sndFile.Patterns[pattern].GetNumRows() ? patData[col] : dummy; // Check valid paste condition. Paste will be skipped if Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -122,7 +122,7 @@ BOOL CFindReplaceTab::OnInitDialog() //---------------------------------- { - CHAR s[256]; + TCHAR s[256]; CComboBox *combo; CPropertyPage::OnInitDialog(); @@ -157,16 +157,16 @@ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) { combo->InitStorage(150, 6); - combo->SetItemData(combo->AddString("..."), 0); + combo->SetItemData(combo->AddString(_T("...")), 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); + combo->SetItemData(combo->AddString(_T("note -1")), replaceNoteMinusOne); + combo->SetItemData(combo->AddString(_T("note +1")), replaceNotePlusOne); + combo->SetItemData(combo->AddString(_T("-1 oct")), replaceNoteMinusOctave); + combo->SetItemData(combo->AddString(_T("+1 oct")), replaceNotePlusOctave); } else { - combo->SetItemData(combo->AddString("any"), findAny); + combo->SetItemData(combo->AddString(_T("any")), findAny); } AppendNotesToControlEx(*combo, sndFile); @@ -180,20 +180,20 @@ // Instrument if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL) { - combo->SetItemData(combo->AddString(".."), 0); + combo->SetItemData(combo->AddString(_T("..")), 0); if (m_bReplace) { - combo->SetItemData(combo->AddString("ins -1"), replaceInstrumentMinusOne); - combo->SetItemData(combo->AddString("ins +1"), replaceInstrumentPlusOne); + combo->SetItemData(combo->AddString(_T("ins -1")), replaceInstrumentMinusOne); + combo->SetItemData(combo->AddString(_T("ins +1")), replaceInstrumentPlusOne); } for(INSTRUMENTINDEX n = 1; n < MAX_INSTRUMENTS; n++) { if(sndFile.GetNumInstruments()) { - wsprintf(s, "%03d:%s", n, sndFile.GetInstrumentName(n)); + _stprintf(s, _T("%03d:%s"), n, sndFile.GetInstrumentName(n)); } else { - wsprintf(s, "%03d:%s", n, sndFile.m_szNames[n]); + _stprintf(s, _T("%03d:%s"), n, sndFile.m_szNames[n]); } combo->SetItemData(combo->AddString(s), n); } @@ -234,7 +234,7 @@ combo->InitStorage(64, 4); for (UINT n=0; n<=64; n++) { - wsprintf(s, "%02d", n); + _stprintf(s, _T("%02d"), n); combo->SetItemData(combo->AddString(s), n); } UINT ncount = combo->GetCount(); @@ -288,14 +288,14 @@ UINT newcount = effectInfo.IsExtendedEffect(fxndx) ? 16 : 256; if (oldcount != newcount) { - CHAR s[16]; + TCHAR s[16]; int newpos; if (oldcount) newpos = combo->GetCurSel() % newcount; else newpos = m_Cmd.param % newcount; combo->ResetContent(); combo->InitStorage(newcount, 4); for (UINT i=0; i<newcount; i++) { - wsprintf(s, (newcount == 256) ? "%02X" : "%X", i); + _stprintf(s, (newcount == 256) ? _T("%02X") : _T("%X"), i); combo->SetItemData(combo->AddString(s), i); } combo->SetCurSel(newpos); @@ -326,13 +326,13 @@ UINT newcount = rangeMax - rangeMin + 1; if (oldcount != newcount) { - CHAR s[16]; + TCHAR s[16]; int newpos; if (oldcount) newpos = combo->GetCurSel() % newcount; else newpos = m_Cmd.param % newcount; combo->ResetContent(); for (UINT i = rangeMin; i <= rangeMax; i++) { - wsprintf(s, (rangeMax < 10) ? "%d" : "%02d", i); + _stprintf(s, (rangeMax < 10) ? _T("%d") : _T("%02d"), i); combo->SetItemData(combo->AddString(s), i); } combo->SetCurSel(newpos); @@ -462,31 +462,31 @@ if(m_nPattern < sndFile.Patterns.Size() && combo) { - CHAR s[256]; + TCHAR s[256]; UINT nrows = sndFile.Patterns[m_nPattern].GetNumRows(); const CModSpecifications& specs = sndFile.GetModSpecifications(); for (UINT irow = specs.patternRowsMin; irow <= specs.patternRowsMax; irow++) { - wsprintf(s, "%d", irow); + _stprintf(s, _T("%d"), irow); combo->AddString(s); } combo->SetCurSel(nrows - specs.patternRowsMin); - wsprintf(s, "Pattern #%d: %d row%s (%dK)", + _stprintf(s, _T("Pattern #%d: %d row%s (%dK)"), m_nPattern, sndFile.Patterns[m_nPattern].GetNumRows(), - (sndFile.Patterns[m_nPattern].GetNumRows() == 1) ? "" : "s", + (sndFile.Patterns[m_nPattern].GetNumRows() == 1) ? _T("") : _T("s"), (sndFile.Patterns[m_nPattern].GetNumRows() * sndFile.GetNumChannels() * sizeof(ModCommand)) / 1024); SetDlgItemText(IDC_TEXT1, s); // Window title const CString patternName = sndFile.Patterns[m_nPattern].GetName().c_str(); - wsprintf(s, "Pattern Properties for Pattern #%d", m_nPattern); + _stprintf(s, _T("Pattern Properties for Pattern #%d"), m_nPattern); if(!patternName.IsEmpty()) { - strcat(s, " ("); - strcat(s, patternName); - strcat(s, ")"); + _tcscat(s, _T(" (")); + _tcscat(s, patternName); + _tcscat(s, _T(")")); } SetWindowText(s); @@ -627,8 +627,8 @@ } -CEditCommand::CEditCommand(CSoundFile &sndFile) : sndFile(sndFile), effectInfo(sndFile), m(nullptr), modified(false) -//------------------------------------------------------------------------------------------------------------------ +CEditCommand::CEditCommand(CSoundFile &sndFile) : sndFile(sndFile), oldSpecs(nullptr), effectInfo(sndFile), m(nullptr), modified(false) +//------------------------------------------------------------------------------------------------------------------------------------- { CDialog::Create(IDD_PATTERN_EDITCOMMAND); } @@ -695,8 +695,8 @@ } // Update Window Title - CHAR s[64]; - wsprintf(s, "Note Properties - Row %d, Channel %d", row, chn + 1); + TCHAR s[64]; + _stprintf(s, _T("Note Properties - Row %d, Channel %d"), row, chn + 1); SetWindowText(s); SetParent(CMainFrame::GetMainFrame()); @@ -712,9 +712,13 @@ { // Note cbnNote.SetRedraw(FALSE); - cbnNote.ResetContent(); - cbnNote.SetItemData(cbnNote.AddString("No note"), 0); - AppendNotesToControlEx(cbnNote, sndFile, m->instr); + if(oldSpecs != &sndFile.GetModSpecifications()) + { + cbnNote.ResetContent(); + cbnNote.SetItemData(cbnNote.AddString(_T("No Note")), 0); + AppendNotesToControlEx(cbnNote, sndFile, m->instr); + oldSpecs = &sndFile.GetModSpecifications(); + } if(m->IsNote()) { @@ -745,12 +749,12 @@ if(m->IsPcNote()) { // control plugin param note - cbnInstr.SetItemData(cbnInstr.AddString("No Effect"), 0); + cbnInstr.SetItemData(cbnInstr.AddString(_T("No Effect")), 0); AddPluginNamesToCombobox(cbnInstr, sndFile.m_MixPlugins, false); } else { // instrument / sample - cbnInstr.SetItemData(cbnInstr.AddString("No Instrument"), 0); + cbnInstr.SetItemData(cbnInstr.AddString(_T("No Instrument")), 0); const uint32 nmax = sndFile.GetNumInstruments() ? sndFile.GetNumInstruments() : sndFile.GetNumSamples(); for(uint32 i = 1; i <= nmax; i++) { Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2014-03-24 02:31:54 UTC (rev 3943) @@ -122,6 +122,7 @@ CComboBox cbnNote, cbnInstr, cbnVolCmd, cbnCommand; CSliderCtrl sldVolParam, sldParam; CSoundFile &sndFile; + const CModSpecifications *oldSpecs; EffectInfo effectInfo; ModCommand *m; ModCommandPos editPos; Modified: trunk/OpenMPT/mptrack/Reporting.cpp =================================================================== --- trunk/OpenMPT/mptrack/Reporting.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/Reporting.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -28,7 +28,7 @@ { parent = pMainFrm; } - UINT result = ::MessageBox((parent ? parent->m_hWnd : NULL), text, caption, flags); + UINT result = ::MessageBoxA((parent ? parent->m_hWnd : NULL), text, caption, flags); if(pMainFrm != nullptr && pMainFrm->GetInputHandler() != nullptr) { Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -10,7 +10,11 @@ #include "stdafx.h" -#include "mptrack.h" +#include "resource.h" +#include "Reporting.h" +#include "../common/misc_util.h" +#include "../soundlib/Snd_defs.h" +#include "../soundlib/ModSample.h" #include "SampleEditorDialogs.h" @@ -112,8 +116,8 @@ CSpinButtonCtrl *spin = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_ADDSILENCE); if (spin) { - spin->SetRange(0, int16_max); - spin->SetPos(m_nSamples); + spin->SetRange32(0, int32_max); + spin->SetPos32(m_nSamples); } int iRadioButton = IDC_RADIO_ADDSILENCE_END; @@ -132,7 +136,7 @@ CButton *radioEnd = (CButton *)GetDlgItem(iRadioButton); radioEnd->SetCheck(true); - SetDlgItemInt(IDC_EDIT_ADDSILENCE, (m_nEditOption == addsilence_resize) ? m_nLength : m_nSamples); + SetDlgItemInt(IDC_EDIT_ADDSILENCE, (m_nEditOption == addsilence_resize) ? m_nLength : m_nSamples, FALSE); return TRUE; } @@ -141,14 +145,14 @@ void CAddSilenceDlg::OnOK() //------------------------- { - m_nSamples = GetDlgItemInt(IDC_EDIT_ADDSILENCE); + m_nSamples = GetDlgItemInt(IDC_EDIT_ADDSILENCE, nullptr, FALSE); m_nEditOption = GetEditMode(); CDialog::OnOK(); } void CAddSilenceDlg::OnEditModeChanged() -//------------------------------------------------ +//-------------------------------------- { enmAddSilenceOptions cNewEditOption = GetEditMode(); if(cNewEditOption != addsilence_resize && m_nEditOption == addsilence_resize) @@ -167,6 +171,7 @@ enmAddSilenceOptions CAddSilenceDlg::GetEditMode() +//------------------------------------------------ { if(IsDlgButtonChecked(IDC_RADIO_ADDSILENCE_BEGIN)) return addsilence_at_beginning; else if(IsDlgButtonChecked(IDC_RADIO_ADDSILENCE_END)) return addsilence_at_end; Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -1212,7 +1212,6 @@ m_CbnPlugin.SetCurSel(dlg.GetSlot()); OnPluginChanged(); } - } @@ -1314,14 +1313,13 @@ void CViewGlobals::BuildEmptySlotList(std::vector<PLUGINDEX> &emptySlots) //----------------------------------------------------------------------- { - CModDoc *pModDoc = GetDocument(); - CSoundFile* pSndFile = pModDoc->GetSoundFile(); + const CSoundFile &sndFile = GetDocument()->GetrSoundFile(); emptySlots.clear(); for(PLUGINDEX nSlot = 0; nSlot < MAX_MIXPLUGINS; nSlot++) { - if(pSndFile->m_MixPlugins[nSlot].pMixPlugin == nullptr) + if(sndFile.m_MixPlugins[nSlot].pMixPlugin == nullptr) { emptySlots.push_back(nSlot); } @@ -1334,16 +1332,16 @@ { CString prompt; CModDoc *pModDoc = GetDocument(); - CSoundFile* pSndFile = pModDoc->GetSoundFile(); + CSoundFile &sndFile = pModDoc->GetrSoundFile(); prompt.Format("Insert empty slot before slot FX%d?", m_nCurrentPlugin + 1); // If last plugin slot is occupied, move it so that the plugin is not lost. // This could certainly be improved... bool moveLastPlug = false; - if(pSndFile->m_MixPlugins[MAX_MIXPLUGINS - 1].pMixPlugin) + if(sndFile.m_MixPlugins[MAX_MIXPLUGINS - 1].pMixPlugin) { - if(pSndFile->m_MixPlugins[MAX_MIXPLUGINS - 2].pMixPlugin == nullptr) + if(sndFile.m_MixPlugins[MAX_MIXPLUGINS - 2].pMixPlugin == nullptr) { moveLastPlug = true; } else @@ -1355,26 +1353,26 @@ { // Delete last plug... - if(pSndFile->m_MixPlugins[MAX_MIXPLUGINS - 1].pMixPlugin) + if(sndFile.m_MixPlugins[MAX_MIXPLUGINS - 1].pMixPlugin) { if(moveLastPlug) { MovePlug(MAX_MIXPLUGINS - 1, MAX_MIXPLUGINS - 2, true); } else { - pSndFile->m_MixPlugins[MAX_MIXPLUGINS - 1].Destroy(); - MemsetZero(pSndFile->m_MixPlugins[MAX_MIXPLUGINS - 1].Info); + sndFile.m_MixPlugins[MAX_MIXPLUGINS - 1].Destroy(); + MemsetZero(sndFile.m_MixPlugins[MAX_MIXPLUGINS - 1].Info); } } // Update MODCOMMANDs so that they won't be referring to old indexes (e.g. with NOTE_PC). - if(pSndFile->GetType() == MOD_TYPE_MPT) - pSndFile->Patterns.ForEachModCommand(PlugIndexModifier(m_nCurrentPlugin + 1, MAX_MIXPLUGINS - 1, 1)); + if(sndFile.GetModSpecifications().HasNote(NOTE_PC)) + sndFile.Patterns.ForEachModCommand(PlugIndexModifier(m_nCurrentPlugin + 1, MAX_MIXPLUGINS - 1, 1)); for(PLUGINDEX nSlot = MAX_MIXPLUGINS - 1; nSlot > m_nCurrentPlugin; nSlot--) { - if(pSndFile->m_MixPlugins[nSlot-1].pMixPlugin) + if(sndFile.m_MixPlugins[nSlot-1].pMixPlugin) { MovePlug(nSlot - 1, nSlot, NoPatternAdjust); } @@ -1383,7 +1381,7 @@ m_CbnPlugin.SetCurSel(m_nCurrentPlugin); OnPluginChanged(); - if(pSndFile->GetModSpecifications().supportsPlugins) + if(sndFile.GetModSpecifications().supportsPlugins) pModDoc->SetModified(); } Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -147,7 +147,7 @@ //------------------------------------- { ModifyStyleEx(0, WS_EX_ACCEPTFILES); - CScrollView::OnInitialUpdate(); + CModScrollView::OnInitialUpdate(); UpdateScrollSize(); } @@ -1313,7 +1313,7 @@ void CViewInstrument::OnSize(UINT nType, int cx, int cy) //------------------------------------------------------ { - CScrollView::OnSize(nType, cx, cy); + CModScrollView::OnSize(nType, cx, cy); if (((nType == SIZE_RESTORED) || (nType == SIZE_MAXIMIZED)) && (cx > 0) && (cy > 0)) { UpdateScrollSize(); Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -1739,21 +1739,21 @@ if (pModDoc->IsChannelSolo(chn)) { - bool nChnIsOnlyUnMutedChan=true; + bool nChnIsOnlyUnMutedChan = true; for (CHANNELINDEX i = 0; i < pModDoc->GetNumChannels(); i++) //check status of all other chans { if (i != chn && !pModDoc->IsChannelMuted(i)) { - nChnIsOnlyUnMutedChan=false; //found a channel that isn't muted! - break; + nChnIsOnlyUnMutedChan = false; //found a channel that isn't muted! + break; } } - if (nChnIsOnlyUnMutedChan) // this is the only playable channel and it is already soloed -> uunMute all + if (nChnIsOnlyUnMutedChan) // this is the only playable channel and it is already soloed -> Unmute all { OnUnmuteAll(); return; - } - } + } + } for(CHANNELINDEX i = 0; i < pModDoc->GetNumChannels(); i++) { pModDoc->MuteChannel(i, !(i == chn)); //mute all chans except nChn, unmute nChn @@ -1779,9 +1779,9 @@ } } -// -> CODE#0012 -// -> DESC="midi keyboard split" + void CViewPattern::OnSplitRecordSelect() +//-------------------------------------- { CModDoc *pModDoc = GetDocument(); if (pModDoc) @@ -1794,7 +1794,6 @@ } } } -// -! NEW_FEATURE#0012 void CViewPattern::OnUnmuteAll() Modified: trunk/OpenMPT/soundlib/ITTools.cpp =================================================================== --- trunk/OpenMPT/soundlib/ITTools.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/ITTools.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -238,7 +238,7 @@ // MIDI Setup mbank = mptIns.wMidiBank; mpr = mptIns.nMidiProgram; - if(mptIns.nMidiChannel || mptIns.nMixPlug == 0 || mptIns.nMixPlug > 127 || compatExport) + if(mptIns.nMidiChannel != MidiNoChannel || mptIns.nMixPlug == 0 || mptIns.nMixPlug > 127 || compatExport) { // Default. Prefer MIDI channel over mixplug to keep the semantics intact. mch = mptIns.nMidiChannel; @@ -249,7 +249,7 @@ } // Sample Map - nos = 0; + nos = 0; // Only really relevant for ITI files std::vector<bool> smpCount(sndFile.GetNumSamples(), false); for(int i = 0; i < 120; i++) { @@ -478,22 +478,22 @@ gvl = static_cast<uint8>(mptSmp.nGlobalVol); vol = static_cast<uint8>(mptSmp.nVolume / 4); dfp = static_cast<uint8>(mptSmp.nPan / 4); - if(mptSmp.uFlags & CHN_PANNING) dfp |= ITSample::enablePanning; + if(mptSmp.uFlags[CHN_PANNING]) dfp |= ITSample::enablePanning; // Sample Format / Loop Flags if(mptSmp.nLength && mptSmp.pSample) { flags = ITSample::sampleDataPresent; - if(mptSmp.uFlags & CHN_LOOP) flags |= ITSample::sampleLoop; - if(mptSmp.uFlags & CHN_SUSTAINLOOP) flags |= ITSample::sampleSustain; - if(mptSmp.uFlags & CHN_PINGPONGLOOP) flags |= ITSample::sampleBidiLoop; - if(mptSmp.uFlags & CHN_PINGPONGSUSTAIN) flags |= ITSample::sampleBidiSustain; + if(mptSmp.uFlags[CHN_LOOP]) flags |= ITSample::sampleLoop; + if(mptSmp.uFlags[CHN_SUSTAINLOOP]) flags |= ITSample::sampleSustain; + if(mptSmp.uFlags[CHN_PINGPONGLOOP]) flags |= ITSample::sampleBidiLoop; + if(mptSmp.uFlags[CHN_PINGPONGSUSTAIN]) flags |= ITSample::sampleBidiSustain; - if(mptSmp.uFlags & CHN_STEREO) + if(mptSmp.uFlags[CHN_STEREO]) { flags |= ITSample::sampleStereo; } - if(mptSmp.uFlags & CHN_16BIT) + if(mptSmp.uFlags[CHN_16BIT]) { flags |= ITSample::sample16Bit; } @@ -556,13 +556,13 @@ LimitMax(mptSmp.nGlobalVol, uint16(64)); mptSmp.nPan = (dfp & 0x7F) * 4; LimitMax(mptSmp.nPan, uint16(256)); - if(dfp & ITSample::enablePanning) mptSmp.uFlags |= CHN_PANNING; + if(dfp & ITSample::enablePanning) mptSmp.uFlags.set(CHN_PANNING); // Loop Flags - if(flags & ITSample::sampleLoop) mptSmp.uFlags |= CHN_LOOP; - if(flags & ITSample::sampleSustain) mptSmp.uFlags |= CHN_SUSTAINLOOP; - if(flags & ITSample::sampleBidiLoop) mptSmp.uFlags |= CHN_PINGPONGLOOP; - if(flags & ITSample::sampleBidiSustain) mptSmp.uFlags |= CHN_PINGPONGSUSTAIN; + if(flags & ITSample::sampleLoop) mptSmp.uFlags.set(CHN_LOOP); + if(flags & ITSample::sampleSustain) mptSmp.uFlags.set(CHN_SUSTAINLOOP); + if(flags & ITSample::sampleBidiLoop) mptSmp.uFlags.set(CHN_PINGPONGLOOP); + if(flags & ITSample::sampleBidiSustain) mptSmp.uFlags.set(CHN_PINGPONGSUSTAIN); // Frequency mptSmp.nC5Speed = C5Speed; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -1224,14 +1224,14 @@ // Channel names if(!compatibilityExport) { - for (UINT ich=0; ich<m_nChannels; ich++) + for(CHANNELINDEX i = 0; i < m_nChannels; i++) { - if (ChnSettings[ich].szName[0]) + if(ChnSettings[i].szName[0]) { - dwChnNamLen = (ich + 1) * MAX_CHANNELNAME; + dwChnNamLen = (i + 1) * MAX_CHANNELNAME; } } - if (dwChnNamLen) dwExtra += dwChnNamLen + 8; + if(dwChnNamLen) dwExtra += dwChnNamLen + 8; } if(m_SongFlags[SONG_EMBEDMIDICFG]) @@ -1262,7 +1262,7 @@ if(!songMessage.empty()) { itHeader.special |= ITFileHeader::embedSongMessage; - itHeader.msglength = msglength = (uint16)MIN(songMessage.length() + 1, uint16_max); + itHeader.msglength = msglength = mpt::saturate_cast<uint16>(songMessage.length() + 1u); itHeader.msgoffset = dwHdrPos + dwExtra + (itHeader.insnum + itHeader.smpnum + itHeader.patnum) * 4; } @@ -1333,7 +1333,7 @@ } // Writing instruments - for(UINT nins = 1; nins <= itHeader.insnum; nins++) + for(INSTRUMENTINDEX nins = 1; nins <= itHeader.insnum; nins++) { ITInstrumentEx iti; uint32 instSize; @@ -1365,7 +1365,7 @@ // Writing sample headers ITSample itss; MemsetZero(itss); - for(UINT hsmp=0; hsmp<itHeader.smpnum; hsmp++) + for(SAMPLEINDEX hsmp = 0; hsmp < itHeader.smpnum; hsmp++) { smppos[hsmp] = dwPos; dwPos += sizeof(ITSample); @@ -1392,7 +1392,7 @@ patpos[pat] = dwPos; // Write pattern header - ROWINDEX writeRows = std::min(Patterns[pat].GetNumRows(), ROWINDEX(uint16_max)); + ROWINDEX writeRows = mpt::saturate_cast<uint16>(Patterns[pat].GetNumRows()); uint16 patinfo[4]; patinfo[0] = 0; patinfo[1] = (uint16)writeRows; @@ -1403,7 +1403,7 @@ fwrite(patinfo, 8, 1, f); dwPos += 8; - const CHANNELINDEX maxChannels = MIN(specs.channelsMax, GetNumChannels()); + const CHANNELINDEX maxChannels = std::min(specs.channelsMax, GetNumChannels()); std::vector<uint8> chnmask(maxChannels, 0xFF); std::vector<ModCommand> lastvalue(maxChannels, ModCommand::Empty()); @@ -1559,7 +1559,7 @@ fseek(f, dwPos, SEEK_SET); } // Writing Sample Data - for (UINT nsmp=1; nsmp<=itHeader.smpnum; nsmp++) + for(SAMPLEINDEX nsmp = 1; nsmp <= itHeader.smpnum; nsmp++) { #ifdef MODPLUG_TRACKER int type = GetType() == MOD_TYPE_IT ? 1 : 4; @@ -1569,7 +1569,7 @@ bool compress = false; #endif // MODPLUG_TRACKER // Old MPT, DUMB and probably other libraries will only consider the IT2.15 compression flag if the header version also indicates IT2.15. - // Old MilkyTracker will only assume IT2.15 compression with cmwt == 0x215, ignoring the delta flag completely. + // MilkyTracker <= 0.90.85 will only assume IT2.15 compression with cmwt == 0x215, ignoring the delta flag completely. itss.ConvertToIT(Samples[nsmp], GetType(), compress, itHeader.cmwt >= 0x215); mpt::String::Write<mpt::String::nullTerminated>(itss.name, m_szNames[nsmp]); Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -599,6 +599,7 @@ // have this weird restart position. I think I've read somewhere that NoiseTracker actually writes 0x78 there. // Files that have restart pos == 0x78: action's batman by DJ Uno (M.K.), 3ddance.mod (M15, so handled by ReadM15), // VALLEY.MOD (M.K.), WormsTDC.MOD (M.K.), ZWARTZ.MOD (M.K.) + // Files that have an order list longer than 0x78 with restart pos = 0x78: my_shoe_is_barking.mod, papermix.mod ASSERT(m_nRestartPos != 0x78 || m_nRestartPos + 1u >= realOrders); if(m_nRestartPos >= 128 || m_nRestartPos + 1u >= realOrders || m_nRestartPos == 0x78) { Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -321,7 +321,7 @@ } else { m_nChannels = i + 1; - ChnSettings[i].nPan = (fileHeader.channels[i] & 8) ? 192 : 64; // 200 : 56 + ChnSettings[i].nPan = (fileHeader.channels[i] & 8) ? 0xCC : 0x33; // 200 : 56 if(fileHeader.channels[i] & 0x80) { ChnSettings[i].dwFlags = CHN_MUTE; @@ -448,7 +448,7 @@ } CHANNELINDEX channel = (info & s3mChannelMask); - static ModCommand dummy; + ModCommand dummy; ModCommand &m = (channel < GetNumChannels()) ? rowBase[channel] : dummy; if(info & s3mNotePresent) Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-24 02:31:54 UTC (rev 3943) @@ -58,7 +58,7 @@ #define FREQ_FRACBITS 4 // Number of fractional bits in return value of CSoundFile::GetFreqFromPeriod() // String lengths (including trailing null char) -#define MAX_SAMPLENAME 32 // also affects module name! +#define MAX_SAMPLENAME 32 #define MAX_SAMPLEFILENAME 22 #define MAX_INSTRUMENTNAME 32 #define MAX_INSTRUMENTFILENAME 32 @@ -96,8 +96,7 @@ MOD_TYPE_IMF = 0x2000000, MOD_TYPE_AMS2 = 0x4000000, MOD_TYPE_DIGI = 0x8000000, - MOD_TYPE_UAX = 0x10000000, // sampleset as module - // Container formats (not used at the moment) + MOD_TYPE_UAX = 0x10000000, // sampleset as module }; DECLARE_FLAGSET(MODTYPE) Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2014-03-24 02:31:54 UTC (rev 3943) @@ -232,7 +232,7 @@ volcmd = VOLCMD_VOLUME; if(vol > 64) vol = 64; command = CMD_S3MCMDEX; - param = 0x80 | ((param * 15 + 32) / 64); // XM volcol panning is 4-Bit, so we can use 4-Bit panning here. + param = 0x80 | (param / 4); // XM volcol panning is actually 4-Bit, so we can use 4-Bit panning here. } break; Modified: trunk/OpenMPT/test/TestToolsTracker.h =================================================================== --- trunk/OpenMPT/test/TestToolsTracker.h 2014-03-23 18:48:38 UTC (rev 3942) +++ trunk/OpenMPT/test/TestToolsTracker.h 2014-03-24 02:31:54 UTC (rev 3943) @@ -87,7 +87,7 @@ #if defined(_MSC_VER) && defined(_M_IX86) // on x86, break directly using asm break interrupt instead of calling DebugBreak which breaks one stackframe deeper than we want -#define MyDebugBreak() do { __asm { int 3 }; } while(0) +#define MyDebugBreak() __debugbreak() #else #define MyDebugBreak() DebugBreak() #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-24 02:34:53
|
Revision: 3944 http://sourceforge.net/p/modplug/code/3944 Author: saga-games Date: 2014-03-24 02:34:43 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Imp] Make CTreeCtrlW::GetItemTextW behave like the MFC counterpart regarding string length. [Imp] Plugin selection dialog: Show full path in "scan folder" dialog [Imp] Plugin selection dialog: Widen buttons a bit to avoid wraparound when clicking "scan folder" button [Fix] Plugin bridge: dfx scrubby crashed on init. Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/mptrack/CTreeCtrl.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/pluginBridge/Bridge.cpp Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/common/mptPathString.h 2014-03-24 02:34:43 UTC (rev 3944) @@ -146,6 +146,7 @@ #endif static PathString FromUTF8(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetUTF8, path)); } static PathString FromWide(const std::wstring &path) { return PathString(path); } + static PathString FromWide(const wchar_t *path) { return PathString(path); } RawPathString AsNative() const { return path; } static PathString FromNative(const RawPathString &path) { return PathString(path); } #if defined(_MFC_VER) Modified: trunk/OpenMPT/mptrack/CTreeCtrl.h =================================================================== --- trunk/OpenMPT/mptrack/CTreeCtrl.h 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/CTreeCtrl.h 2014-03-24 02:34:43 UTC (rev 3944) @@ -94,25 +94,27 @@ #endif // UNICODE - std::wstring GetItemTextW(HTREEITEM item) const + CStringW GetItemTextW(HTREEITEM item) const { #ifdef UNICODE return GetItemText(item); #else - WCHAR name[MAX_PATH]; // Maximum displayed text length according to documentation. TVITEMW tvi; - MemsetZero(tvi); tvi.hItem = item; tvi.mask = TVIF_TEXT; - tvi.pszText = name; - tvi.cchTextMax = CountOf(name); - if(GetItem(&tvi)) + CStringW str; + int nLen = 128; + int nRes; + do { - return tvi.pszText; - } else - { - return std::wstring(); - } + nLen *= 2; + tvi.pszText = str.GetBufferSetLength(nLen); + tvi.cchTextMax = nLen; + ::SendMessage(m_hWnd, TVM_GETITEMW, 0, (LPARAM)&tvi); + nRes = wcslen(tvi.pszText); + } while (nRes >= nLen - 1); + str.ReleaseBuffer(); + return str; #endif // UNICODE } Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -619,7 +619,7 @@ } else if(!mpt::PathString::CompareNoCase(fileName.GetFileExt(), MPT_PATHSTRING(".dll"))) { CWnd *text = pluginScanDlg.GetDlgItem(IDC_SCANTEXT); - std::wstring scanStr = std::wstring(L"Scanning Plugin...\n") + wfd.cFileName; + std::wstring scanStr = L"Scanning Plugin...\n" + fileName.ToWide(); SetWindowTextW(text->m_hWnd, scanStr.c_str()); MSG msg; while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) @@ -702,19 +702,19 @@ if (m_treePlugins) { - m_treePlugins.MoveWindow(8, 36, cx - 104, cy - 88, FALSE); + m_treePlugins.MoveWindow(8, 36, cx - 109, cy - 88, FALSE); GetDlgItem(IDC_STATIC_VSTNAMEFILTER)->MoveWindow(8, 11, 40, 21, FALSE); - GetDlgItem(IDC_NAMEFILTER)->MoveWindow(40, 8, cx - 136, 21, FALSE); + GetDlgItem(IDC_NAMEFILTER)->MoveWindow(40, 8, cx - 141, 21, FALSE); GetDlgItem(IDC_TEXT_CURRENT_VSTPLUG)->MoveWindow(8, cy - 45, cx - 22, 20, FALSE); m_chkBridge.MoveWindow(8, cy - 25, 110, 20, FALSE); m_chkShare.MoveWindow(120, cy - 25, cx - 128, 20, FALSE); - const int rightOff = cx - 85; // Offset of right button column - GetDlgItem(IDOK)->MoveWindow( rightOff, 8, 75, 23, FALSE); - GetDlgItem(IDCANCEL)->MoveWindow( rightOff, 39, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - 133, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - 105, 75, 23, FALSE); - GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - 77, 75, 23, FALSE); + const int rightOff = cx - 90; // Offset of right button column + GetDlgItem(IDOK)->MoveWindow( rightOff, 8, 80, 23, FALSE); + GetDlgItem(IDCANCEL)->MoveWindow( rightOff, 39, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON1)->MoveWindow(rightOff, cy - 133, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON3)->MoveWindow(rightOff, cy - 105, 80, 23, FALSE); + GetDlgItem(IDC_BUTTON2)->MoveWindow(rightOff, cy - 77, 80, 23, FALSE); Invalidate(); } } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -735,7 +735,7 @@ info.hSamples = InsertItem(_T("Samples"), IMAGE_FOLDER, IMAGE_FOLDER, info.hSong, TVI_LAST); } else if(hintFlagPart & (HINT_MODGENERAL|HINT_MODTYPE)) { - if(name != GetItemTextW(tvi.hItem)) + if(name.c_str() != GetItemTextW(info.hSong)) { SetItemText(info.hSong, name.c_str()); } Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-03-24 02:31:54 UTC (rev 3943) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-03-24 02:34:43 UTC (rev 3944) @@ -260,8 +260,11 @@ // Copy AEffect to shared memory. void PluginBridge::UpdateEffectStruct() { - if(otherPtrSize == 4) + if(nativeEffect == nullptr) { + return; + } else if(otherPtrSize == 4) + { sharedMem->effect32.FromNative(*nativeEffect); } else if(otherPtrSize == 8) { @@ -861,7 +864,7 @@ MPT_FALLTHROUGH; case audioMasterIOChanged: // We need to be sure that the new values are known to the master. - if(!processing) + if(!processing && nativeEffect != nullptr) { UpdateEffectStruct(); CreateProcessingFile(dispatchData); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-24 02:36:40
|
Revision: 3945 http://sourceforge.net/p/modplug/code/3945 Author: saga-games Date: 2014-03-24 02:36:34 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Fix] PAT Loader: Panning flag was not set and loaded files were not converted to the current format's supported capabilities. [Mod] Pattern creation: Always allow patterns of any size, limitation to format-specific sizes should only be enforced in GUI. [Mod] OpenMPT: Version is now 1.22.07.32 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/patternContainer.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-03-24 02:34:43 UTC (rev 3944) +++ trunk/OpenMPT/common/versionNumber.h 2014-03-24 02:36:34 UTC (rev 3945) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 07 -#define VER_MINORMINOR 31 +#define VER_MINORMINOR 32 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-03-24 02:34:43 UTC (rev 3944) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-03-24 02:36:34 UTC (rev 3945) @@ -664,6 +664,7 @@ sample.nC5Speed = sampleHeader.freq; sample.nPan = (sampleHeader.balance * 256 + 8) / 15; if(sample.nPan > 256) sample.nPan = 128; + else sample.uFlags.set(CHN_PANNING); sample.nVibType = VIB_SINE; sample.nVibSweep = sampleHeader.vibrato_sweep; sample.nVibDepth = sampleHeader.vibrato_depth; @@ -690,6 +691,7 @@ sample.nLoopEnd /= 2; } sampleIO.ReadSample(sample, file); + sample.Convert(MOD_TYPE_IT, that->GetType()); sample.PrecomputeLoops(*that, false); mpt::String::Read<mpt::String::maybeNullTerminated>(that->m_szNames[nSample], sampleHeader.name); @@ -816,6 +818,8 @@ } } } + + pIns->Convert(MOD_TYPE_IT, GetType()); return true; } Modified: trunk/OpenMPT/soundlib/patternContainer.cpp =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.cpp 2014-03-24 02:34:43 UTC (rev 3944) +++ trunk/OpenMPT/soundlib/patternContainer.cpp 2014-03-24 02:36:34 UTC (rev 3945) @@ -50,7 +50,7 @@ //--------------------------------------------------------------------------- { const CModSpecifications& specs = m_rSndFile.GetModSpecifications(); - if(index >= specs.patternsMax || rows > specs.patternRowsMax || rows == 0) + if(index >= specs.patternsMax || rows > MAX_PATTERN_ROWS || rows == 0) return true; if(index < m_Patterns.size() && m_Patterns[index]) return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-24 10:32:20
|
Revision: 3946 http://sourceforge.net/p/modplug/code/3946 Author: manxorist Date: 2014-03-24 10:32:06 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Ref] Add proper string type conversion functions for CStringW. Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptString.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2014-03-24 02:36:34 UTC (rev 3945) +++ trunk/OpenMPT/common/mptPathString.h 2014-03-24 10:32:06 UTC (rev 3946) @@ -146,7 +146,6 @@ #endif static PathString FromUTF8(const std::string &path) { return PathString(mpt::ToWide(mpt::CharsetUTF8, path)); } static PathString FromWide(const std::wstring &path) { return PathString(path); } - static PathString FromWide(const wchar_t *path) { return PathString(path); } RawPathString AsNative() const { return path; } static PathString FromNative(const RawPathString &path) { return PathString(path); } #if defined(_MFC_VER) @@ -159,7 +158,15 @@ // really special purpose, if !UNICODE, encode unicode in CString as UTF8: static mpt::PathString TunnelOutofCString(const CString &path); static CString TunnelIntoCString(const mpt::PathString &path); + // CStringW +#ifdef UNICODE + MPT_DEPRECATED_PATH CString ToCStringW() const { return mpt::ToCString(path); } + MPT_DEPRECATED_PATH static PathString FromCStringW(const CString &path) { return PathString(mpt::ToWide(path)); } +#else + CStringW ToCStringW() const { return mpt::ToCStringW(path); } + static PathString FromCStringW(const CStringW &path) { return PathString(mpt::ToWide(path)); } #endif +#endif #else // !WIN32 @@ -234,7 +241,7 @@ } #if defined(_MFC_VER) -MPT_DEPRECATED_PATH void SanitizeFilename(CString &str); +void SanitizeFilename(CString &str); #endif #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2014-03-24 02:36:34 UTC (rev 3945) +++ trunk/OpenMPT/common/mptString.cpp 2014-03-24 10:32:06 UTC (rev 3946) @@ -1100,9 +1100,46 @@ #endif } +#ifdef UNICODE +// inline +#else +CStringW ToCStringW(const CString &str) +{ + return ToWide(str).c_str(); +} +CStringW ToCStringW(const std::wstring &str) +{ + return str.c_str(); +} +CStringW ToCStringW(Charset from, const std::string &str) +{ + return ToWide(from, str).c_str(); +} +CStringW ToCStringW(const CStringW &str) +{ + return str; +} +std::wstring ToWide(const CStringW &str) +{ + return str.GetString(); +} +std::string ToLocale(const CStringW &str) +{ + return ToLocale(str.GetString()); +} +std::string To(Charset to, const CStringW &str) +{ + return To(to, str.GetString()); +} +CString ToCString(const CStringW &str) +{ + return ToLocale(str).c_str(); +} #endif +#endif + } // namespace mpt Modified: trunk/OpenMPT/common/mptString.h =================================================================== --- trunk/OpenMPT/common/mptString.h 2014-03-24 02:36:34 UTC (rev 3945) +++ trunk/OpenMPT/common/mptString.h 2014-03-24 10:32:06 UTC (rev 3946) @@ -230,9 +230,24 @@ static inline std::string To(Charset to, const wchar_t * str) { return To(to, str ? std::wstring(str) : std::wstring()); } static inline CString ToCString(const wchar_t * str) { return ToCString(str ? std::wstring(str) : std::wstring()); } +#ifdef UNICODE +MPT_DEPRECATED_PATH static inline CString ToCStringW(const CString &str) { return ToCString(str); } +MPT_DEPRECATED_PATH CString ToCStringW(const std::wstring &str) { return ToCString(str); } +MPT_DEPRECATED_PATH CString ToCStringW(Charset from, const std::string &str) { return ToCString(from, str); } +#else +CStringW ToCStringW(const CString &str); +CStringW ToCStringW(const std::wstring &str); +CStringW ToCStringW(Charset from, const std::string &str); +CStringW ToCStringW(const CStringW &str); +std::wstring ToWide(const CStringW &str); +std::string ToLocale(const CStringW &str); +std::string To(Charset to, const CStringW &str); +CString ToCString(const CStringW &str); #endif +#endif + } // namespace mpt Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-24 02:36:34 UTC (rev 3945) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-24 10:32:06 UTC (rev 3946) @@ -1086,11 +1086,12 @@ if(doBatchSave) { CString sSampleNumber; - TCHAR sSampleName[64], sSampleFilename[64]; + CString sSampleName; + CString sSampleFilename; sSampleNumber.Format(sNumberFormat, smp); - strcpy(sSampleName, (m_sndFile.m_szNames[smp]) ? m_sndFile.m_szNames[smp] : "untitled"); - strcpy(sSampleFilename, (m_sndFile.GetSample(smp).filename[0]) ? m_sndFile.GetSample(smp).filename : m_sndFile.m_szNames[smp]); + sSampleName = (m_sndFile.m_szNames[smp][0]) ? m_sndFile.m_szNames[smp] : "untitled"; + sSampleFilename = (m_sndFile.GetSample(smp).filename[0]) ? m_sndFile.GetSample(smp).filename : m_sndFile.m_szNames[smp]; SanitizeFilename(sSampleName); SanitizeFilename(sSampleFilename); Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 02:36:34 UTC (rev 3945) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 10:32:06 UTC (rev 3946) @@ -319,7 +319,7 @@ { mpt::PathString fullPath = m_InstrLibPath; if(!fullPath.HasTrailingSlash()) fullPath += MPT_PATHSTRING("\\"); - return fullPath + mpt::PathString::FromWide(GetItemTextW(hItem)); + return fullPath + mpt::PathString::FromCStringW(GetItemTextW(hItem)); } @@ -1261,7 +1261,7 @@ case MODITEM_INSLIB_SONG: case MODITEM_INSLIB_FOLDER: - InstrumentLibraryChDir(mpt::PathString::FromWide(GetItemTextW(hItem)), modItem.type == MODITEM_INSLIB_SONG); + InstrumentLibraryChDir(mpt::PathString::FromCStringW(GetItemTextW(hItem)), modItem.type == MODITEM_INSLIB_SONG); return TRUE; case MODITEM_HDR_SONG: @@ -3268,7 +3268,7 @@ HTREEITEM hItem = GetChildItem(m_hInsLib); while (hItem != NULL) { - const mpt::PathString str = mpt::PathString::FromWide(GetItemTextW(hItem)); + const mpt::PathString str = mpt::PathString::FromCStringW(GetItemTextW(hItem)); if(!mpt::PathString::CompareNoCase(str, m_InstrLibHighlightPath)) { hActive = hItem; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-24 12:13:59
|
Revision: 3953 http://sourceforge.net/p/modplug/code/3953 Author: manxorist Date: 2014-03-24 12:13:47 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Ref] Move all UUID/GUID/IID/CLSID functions to common/misc_util.h, wrap the full set of Win32 UUID<->string conversion functions in C++ style and document them in misc_util.h . [Ref] Add Util::GetTempDirectory(). [Ref] Add Util::CreateTempFileName() which generates a UUID-based temporary filename and allows specifying a full prefix (not supported by GetTempFileName) and file extension (not supported by GetTempFileName or _wtempnam). [Ref] Test: Add basic sanity checks for UUID functions. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.cpp trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/mptrack/ExceptionHandler.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/UpdateCheck.cpp trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp trunk/OpenMPT/soundlib/plugins/DmoToVst.cpp trunk/OpenMPT/soundlib/plugins/PluginManager.cpp trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/common/misc_util.cpp =================================================================== --- trunk/OpenMPT/common/misc_util.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/common/misc_util.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -339,37 +339,207 @@ namespace Util { - std::wstring CLSIDToString(CLSID clsid) - //------------------------------------- + + +std::wstring CLSIDToString(CLSID clsid) +//------------------------------------- +{ + std::wstring str; + LPOLESTR tmp = nullptr; + ::StringFromCLSID(clsid, &tmp); + if(tmp) { - std::wstring str; - LPOLESTR tmp = nullptr; - StringFromCLSID(clsid, &tmp); - if(tmp) - { - str = tmp; - CoTaskMemFree(tmp); - tmp = nullptr; - } - return str; + str = tmp; + ::CoTaskMemFree(tmp); + tmp = nullptr; } + return str; +} - bool StringToCLSID(const std::wstring &str, CLSID &clsid) - //------------------------------------------------------- +CLSID StringToCLSID(const std::wstring &str) +//------------------------------------------ +{ + CLSID clsid = CLSID(); + std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); + if(::CLSIDFromString(&tmp[0], &clsid) != S_OK) { - std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); - return CLSIDFromString(&tmp[0], &clsid) == S_OK; + return CLSID(); } + return clsid; +} - bool IsCLSID(const std::wstring &str) - //----------------------------------- +bool VerifyStringToCLSID(const std::wstring &str, CLSID &clsid) +//------------------------------------------------------------- +{ + std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); + return (::CLSIDFromString(&tmp[0], &clsid) == S_OK); +} + + +bool IsCLSID(const std::wstring &str) +//----------------------------------- +{ + CLSID clsid = CLSID(); + std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); + return (::CLSIDFromString(&tmp[0], &clsid) == S_OK); +} + + +std::wstring IIDToString(IID iid) +//------------------------------- +{ + std::wstring str; + LPOLESTR tmp = nullptr; + ::StringFromIID(iid, &tmp); + if(tmp) { - CLSID clsid = CLSID(); - std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); - return CLSIDFromString(&tmp[0], &clsid) == S_OK; + str = tmp; + ::CoTaskMemFree(tmp); + tmp = nullptr; } + return str; +} + + +IID StringToIID(const std::wstring &str) +//-------------------------------------- +{ + IID iid = IID(); + std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); + ::IIDFromString(&tmp[0], &iid); + return iid; +} + + +std::wstring GUIDToString(GUID guid) +//---------------------------------- +{ + std::vector<OLECHAR> tmp(256); + ::StringFromGUID2(guid, &tmp[0], tmp.size()); + return &tmp[0]; +} + + +GUID StringToGUID(const std::wstring &str) +//---------------------------------------- +{ + return StringToIID(str); +} + + +UUID StringToUUID(const std::wstring &str) +//---------------------------------------- +{ + UUID uuid = UUID(); + std::vector<wchar_t> tmp(str.c_str(), str.c_str() + str.length() + 1); + if(::UuidFromStringW((RPC_WSTR)(&(tmp[0])), &uuid) != RPC_S_OK) + { + return UUID(); + } + return uuid; +} + + +std::wstring UUIDToString(UUID uuid) +//---------------------------------- +{ + std::wstring str; + RPC_WSTR tmp = nullptr; + if(::UuidToStringW(&uuid, &tmp) != RPC_S_OK) + { + return std::wstring(); + } + str = (wchar_t*)tmp; + ::RpcStringFreeW(&tmp); + return str; +} + + +bool IsValid(UUID uuid) +//--------------------- +{ + return false + || uuid.Data1 != 0 + || uuid.Data2 != 0 + || uuid.Data3 != 0 + || uuid.Data4[0] != 0 + || uuid.Data4[1] != 0 + || uuid.Data4[2] != 0 + || uuid.Data4[3] != 0 + || uuid.Data4[4] != 0 + || uuid.Data4[5] != 0 + || uuid.Data4[6] != 0 + || uuid.Data4[7] != 0 + ; +} + + +GUID CreateGUID() +//--------------- +{ + GUID guid = GUID(); + if(::CoCreateGuid(&guid) != S_OK) + { + return GUID(); + } + return guid; +} + + +UUID CreateUUID() +//--------------- +{ + UUID uuid = UUID(); + RPC_STATUS status = ::UuidCreate(&uuid); + if(status != RPC_S_OK && status != RPC_S_UUID_LOCAL_ONLY) + { + return UUID(); + } + return uuid; +} + + +UUID CreateLocalUUID() +//-------------------- +{ + UUID uuid = UUID(); + RPC_STATUS status = ::UuidCreateSequential(&uuid); + if(status != RPC_S_OK && status != RPC_S_UUID_LOCAL_ONLY) + { + return UUID(); + } + return uuid; +} + + +mpt::PathString GetTempDirectory() +//-------------------------------- +{ + WCHAR tempPath[MAX_PATH+2]; + MemsetZero(tempPath); + DWORD result = GetTempPathW(MAX_PATH+1, tempPath); + if(result == 0 || result > MAX_PATH+1) + { // error + // use app directory as fallback + return mpt::GetAppPath(); + } + return mpt::PathString::FromNative(tempPath); +} + + +mpt::PathString CreateTempFileName(const mpt::PathString &fileNamePrefix, const mpt::PathString &fileNameExtension) +//----------------------------------------------------------------------------------------------------------------- +{ + mpt::PathString filename = Util::GetTempDirectory(); + filename += (!fileNamePrefix.empty() ? fileNamePrefix + MPT_PATHSTRING("_") : mpt::PathString()); + filename += mpt::PathString::FromWide(Util::UUIDToString(Util::CreateLocalUUID())); + filename += (!fileNameExtension.empty() ? MPT_PATHSTRING(".") + fileNameExtension : mpt::PathString()); + return filename; +} + + } // namespace Util #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/common/misc_util.h 2014-03-24 12:13:47 UTC (rev 3953) @@ -626,9 +626,48 @@ namespace Util { - std::wstring CLSIDToString(CLSID clsid); - bool StringToCLSID(const std::wstring &str, CLSID &clsid); - bool IsCLSID(const std::wstring &str); + +// COM CLSID<->string conversion +// A CLSID string is not necessarily a standard UUID string, +// it might also be a symbolic name for the interface. +// (see CLSIDFromString ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms680589%28v=vs.85%29.aspx )) +std::wstring CLSIDToString(CLSID clsid); +CLSID StringToCLSID(const std::wstring &str); +bool VerifyStringToCLSID(const std::wstring &str, CLSID &clsid); +bool IsCLSID(const std::wstring &str); + +// COM IID<->string conversion +IID StringToIID(const std::wstring &str); +std::wstring IIDToString(IID iid); + +// General GUID<->string conversion. +// The string must/will be in standard GUID format: {4F9A455D-E7EF-4367-B2F0-0C83A38A5C72} +GUID StringToGUID(const std::wstring &str); +std::wstring GUIDToString(GUID guid); + +// General UUID<->string conversion. +// The string must/will be in standard UUID format: 4f9a455d-e7ef-4367-b2f0-0c83a38a5c72 +UUID StringToUUID(const std::wstring &str); +std::wstring UUIDToString(UUID uuid); + +// Checks the UUID against the NULL UUID. Returns false if it is NULL, true otherwise. +bool IsValid(UUID uuid); + +// Create a COM GUID +GUID CreateGUID(); + +// Create a UUID +UUID CreateUUID(); + +// Create a UUID that contains local, traceable information. Safe for local use. +UUID CreateLocalUUID(); + +// Returns temporary directory (with trailing backslash added) (e.g. "C:\TEMP\") +mpt::PathString GetTempDirectory(); + +// Returns a new unique absolute path. +mpt::PathString CreateTempFileName(const mpt::PathString &fileNamePrefix = mpt::PathString(), const mpt::PathString &fileNameExtension = MPT_PATHSTRING("tmp")); + } // namespace Util #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/mptrack/ExceptionHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -43,9 +43,7 @@ mpt::PathString baseRescuePath; { // Create a crash directory - WCHAR tempPath[MAX_PATH]; - GetTempPathW(CountOf(tempPath), tempPath); - baseRescuePath = mpt::PathString::FromNative(tempPath) + MPT_PATHSTRING("OpenMPT Crash Files\\"); + baseRescuePath = Util::GetTempDirectory() + MPT_PATHSTRING("OpenMPT Crash Files\\"); if(!PathIsDirectoryW(baseRescuePath.AsNative().c_str())) { CreateDirectoryW(baseRescuePath.AsNative().c_str(), nullptr); Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -942,9 +942,7 @@ } float normalizePeak = 0.0f; - wchar_t *tempPath = _wtempnam(L"", L"OpenMPT_mod2wave"); - const mpt::PathString normalizeFileName = mpt::PathString::FromNative(tempPath); - free(tempPath); + const mpt::PathString normalizeFileName = Util::CreateTempFileName(MPT_PATHSTRING("OpenMPT")); mpt::fstream normalizeFile; if(m_Settings.Normalize) { Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -133,7 +133,7 @@ // Version , IniVersion(conf, "Version", "Version", "") , gcsPreviousVersion(GetStoredVersion(IniVersion)) - , gcsInstallGUID(conf, "Version", "InstallGUID", "") + , gcsInstallGUID(conf, "Version", "InstallGUID", std::wstring()) // Display , m_ShowSplashScreen(conf, "Display", "ShowSplashScreen", true) , gbMdiMaximize(conf, "Display", "MDIMaximize", true) @@ -366,15 +366,10 @@ const MptVersion::VersionNum storedVersion = gcsPreviousVersion; // Version - if(gcsInstallGUID == "") + if(gcsInstallGUID.Get().empty()) { - // No GUID found - generate one. - GUID guid; - CoCreateGuid(&guid); - BYTE* Str; - UuidToString((UUID*)&guid, &Str); - gcsInstallGUID = Str; - RpcStringFree(&Str); + // No UUID found - generate one. + gcsInstallGUID = Util::UUIDToString(Util::CreateUUID()); } // Sound Settings Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-03-24 12:13:47 UTC (rev 3953) @@ -327,7 +327,7 @@ Setting<std::string> IniVersion; const MptVersion::VersionNum gcsPreviousVersion; - Setting<CString> gcsInstallGUID; + Setting<std::wstring> gcsInstallGUID; // Display Modified: trunk/OpenMPT/mptrack/UpdateCheck.cpp =================================================================== --- trunk/OpenMPT/mptrack/UpdateCheck.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/mptrack/UpdateCheck.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -86,7 +86,7 @@ #error "Platform-specific identifier missing" #endif updateURL.Replace("$VERSION", versionStr); - updateURL.Replace("$GUID", GetSendGUID() ? TrackerSettings::Instance().gcsInstallGUID.Get() : "anonymous"); + updateURL.Replace("$GUID", GetSendGUID() ? mpt::ToCString(TrackerSettings::Instance().gcsInstallGUID.Get()) : "anonymous"); // Establish a connection. internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -644,8 +644,7 @@ { return; } - CLSID clsid; - Util::StringToCLSID(GetDeviceInternalID(), clsid); + CLSID clsid = Util::StringToCLSID(GetDeviceInternalID()); try { if(CoCreateInstance(clsid,0,CLSCTX_INPROC_SERVER, clsid, (void **)&m_pAsioDrv) != S_OK) Modified: trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -33,32 +33,6 @@ #ifndef NO_DSOUND -static std::wstring GuidToString(GUID guid) -//----------------------------------------- -{ - std::wstring str; - LPOLESTR tmp = nullptr; - StringFromIID(guid, &tmp); - if(tmp) - { - str = tmp; - CoTaskMemFree(tmp); - tmp = nullptr; - } - return str; -} - - -static GUID StringToGuid(const std::wstring &str) -//----------------------------------------------- -{ - GUID guid = GUID(); - std::vector<OLECHAR> tmp(str.c_str(), str.c_str() + str.length() + 1); - IIDFromString(&tmp[0], &guid); - return guid; -} - - static BOOL WINAPI DSEnumCallbackW(GUID * lpGuid, LPCWSTR lpstrDescription, LPCWSTR, LPVOID lpContext) //---------------------------------------------------------------------------------------------------- { @@ -77,7 +51,7 @@ info.apiName = SoundDeviceTypeToString(SNDDEV_DSOUND); if(lpGuid) { - info.internalID = GuidToString(*lpGuid); + info.internalID = Util::GUIDToString(*lpGuid); } devices.push_back(info); return TRUE; @@ -143,7 +117,7 @@ } else { const std::wstring internalID = GetDeviceInternalID(); - GUID guid = internalID.empty() ? GUID() : StringToGuid(internalID); + GUID guid = internalID.empty() ? GUID() : Util::StringToGUID(internalID); if(DirectSoundCreate(internalID.empty() ? NULL : &guid, &dummy, NULL) != DS_OK) { return caps; @@ -197,7 +171,7 @@ if(m_piDS) return true; const std::wstring internalID = GetDeviceInternalID(); - GUID guid = internalID.empty() ? GUID() : StringToGuid(internalID); + GUID guid = internalID.empty() ? GUID() : Util::StringToGUID(internalID); if(DirectSoundCreate(internalID.empty() ? NULL : &guid, &m_piDS, NULL) != DS_OK) return false; if(!m_piDS) return false; m_piDS->SetCooperativeLevel(m_Settings.hWnd, m_Settings.ExclusiveMode ? DSSCL_WRITEPRIMARY : DSSCL_PRIORITY); Modified: trunk/OpenMPT/soundlib/plugins/DmoToVst.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/DmoToVst.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/soundlib/plugins/DmoToVst.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -519,7 +519,7 @@ //---------------------------------- { CLSID clsid; - if (Util::StringToCLSID(lib.dllPath.ToWide(), clsid)) + if (Util::VerifyStringToCLSID(lib.dllPath.ToWide(), clsid)) { IMediaObject *pMO = nullptr; IMediaObjectInPlace *pMOIP = nullptr; Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -154,7 +154,7 @@ { CLSID clsid; std::wstring formattedKey = std::wstring(L"{") + std::wstring(keyname) + std::wstring(L"}"); - if(Util::StringToCLSID(formattedKey, clsid)) + if(Util::VerifyStringToCLSID(formattedKey, clsid)) { HKEY hksub; formattedKey = std::wstring(L"software\\classes\\DirectShow\\MediaObjects\\") + std::wstring(keyname); @@ -167,9 +167,8 @@ if(ERROR_SUCCESS == RegQueryValueExW(hksub, nullptr, 0, &datatype, (LPBYTE)name, &datasize)) { mpt::String::SetNullTerminator(name); - StringFromGUID2(clsid, keyname, 100); - VSTPluginLib *plug = new (std::nothrow) VSTPluginLib(mpt::PathString::FromNative(keyname), mpt::PathString::FromNative(name)); + VSTPluginLib *plug = new (std::nothrow) VSTPluginLib(mpt::PathString::FromNative(Util::GUIDToString(clsid)), mpt::PathString::FromNative(name)); if(plug != nullptr) { pluginList.push_back(plug); Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2014-03-24 11:16:58 UTC (rev 3952) +++ trunk/OpenMPT/test/test.cpp 2014-03-24 12:13:47 UTC (rev 3953) @@ -266,6 +266,12 @@ } +static bool IsEqualUUID(const UUID &lhs, const UUID &rhs) +{ + return std::memcmp(&lhs, &rhs, sizeof(UUID)) == 0; +} + + static noinline void TestMisc() //----------------------------- { @@ -542,6 +548,18 @@ VERIFY_EQUAL(MPT_PATHSTRING("\\\\server\\path\\file").RelativePathToAbsolute(exePath), MPT_PATHSTRING("\\\\server\\path\\file")); #endif + // UUID +#ifdef MODPLUG_TRACKER + VERIFY_EQUAL(Util::IsValid(Util::CreateGUID()), true); + VERIFY_EQUAL(Util::IsValid(Util::CreateUUID()), true); + VERIFY_EQUAL(Util::IsValid(Util::CreateLocalUUID()), true); + UUID uuid = Util::CreateUUID(); + VERIFY_EQUAL(IsEqualUUID(uuid, Util::StringToUUID(Util::UUIDToString(uuid))), true); + VERIFY_EQUAL(IsEqualUUID(uuid, Util::StringToGUID(Util::GUIDToString(uuid))), true); + VERIFY_EQUAL(IsEqualUUID(uuid, Util::StringToIID(Util::IIDToString(uuid))), true); + VERIFY_EQUAL(IsEqualUUID(uuid, Util::StringToCLSID(Util::CLSIDToString(uuid))), true); +#endif + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-24 12:50:38
|
Revision: 3956 http://sourceforge.net/p/modplug/code/3956 Author: manxorist Date: 2014-03-24 12:50:32 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Imp] settings: Add a SettingFlushMode parameter to SettingsContainer::Write . [Fix] Plugin manager: Immediately write the FailedPlugin ID to the INI file, otherwise it gets forgotten when loadind actually crashes. Modified Paths: -------------- trunk/OpenMPT/mptrack/Settings.cpp trunk/OpenMPT/mptrack/Settings.h trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Modified: trunk/OpenMPT/mptrack/Settings.cpp =================================================================== --- trunk/OpenMPT/mptrack/Settings.cpp 2014-03-24 12:35:07 UTC (rev 3955) +++ trunk/OpenMPT/mptrack/Settings.cpp 2014-03-24 12:50:32 UTC (rev 3956) @@ -151,7 +151,7 @@ return entry->second; } -void SettingsContainer::WriteSetting(const SettingPath &path, const SettingValue &val) +void SettingsContainer::WriteSetting(const SettingPath &path, const SettingValue &val, SettingFlushMode flushMode) { ASSERT(theApp.InGuiThread()); ASSERT(!CMainFrame::GetMainFrame() || (CMainFrame::GetMainFrame() && !CMainFrame::GetMainFrame()->InNotifyHandler())); // This is a slow path, use CachedSetting for stuff that is accessed in notify handler. @@ -165,7 +165,7 @@ entry->second = val; } NotifyListeners(path); - if(immediateFlush) + if(immediateFlush || flushMode == SettingWriteThrough) { BackendsWriteSetting(path, val); entry->second.Clean(); Modified: trunk/OpenMPT/mptrack/Settings.h =================================================================== --- trunk/OpenMPT/mptrack/Settings.h 2014-03-24 12:35:07 UTC (rev 3955) +++ trunk/OpenMPT/mptrack/Settings.h 2014-03-24 12:50:32 UTC (rev 3956) @@ -470,6 +470,12 @@ virtual void SettingChanged(const SettingPath &path) = 0; }; +enum SettingFlushMode +{ + SettingWriteBack = 0, + SettingWriteThrough = 1, +}; + // SettingContainer basically represents a frontend to 1 or 2 backends (e.g. ini files or registry subtrees) for a collection of configuration settings. // SettingContainer provides basic read/write access to individual setting. The values are cached and only flushed on destruction or explicit flushs. class SettingsContainer @@ -498,7 +504,7 @@ void BackendsRemoveSetting(const SettingPath &path); void NotifyListeners(const SettingPath &path); SettingValue ReadSetting(const SettingPath &path, const SettingValue &def, const SettingMetadata &metadata) const; - void WriteSetting(const SettingPath &path, const SettingValue &val); + void WriteSetting(const SettingPath &path, const SettingValue &val, SettingFlushMode flushMode); void ForgetSetting(const SettingPath &path); void RemoveSetting(const SettingPath &path); private: @@ -523,19 +529,19 @@ return FromSettingValue<T>(ReadSetting(SettingPath(section, key), ToSettingValue<T>(def), metadata)); } template <typename T> - void Write(const SettingPath &path, const T &val) + void Write(const SettingPath &path, const T &val, SettingFlushMode flushMode = SettingWriteBack) { - WriteSetting(path, ToSettingValue<T>(val)); + WriteSetting(path, ToSettingValue<T>(val), flushMode); } template <typename T> - void Write(const std::wstring §ion, const std::wstring &key, const T &val) + void Write(const std::wstring §ion, const std::wstring &key, const T &val, SettingFlushMode flushMode = SettingWriteBack) { - WriteSetting(SettingPath(section, key), ToSettingValue<T>(val)); + WriteSetting(SettingPath(section, key), ToSettingValue<T>(val), flushMode); } template <typename T> - void Write(const std::string §ion, const std::string &key, const T &val) + void Write(const std::string §ion, const std::string &key, const T &val, SettingFlushMode flushMode = SettingWriteBack) { - WriteSetting(SettingPath(section, key), ToSettingValue<T>(val)); + WriteSetting(SettingPath(section, key), ToSettingValue<T>(val), flushMode); } void Forget(const SettingPath &path) { Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-24 12:35:07 UTC (rev 3955) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-24 12:50:32 UTC (rev 3956) @@ -376,7 +376,7 @@ } // If this key contains a file name on program launch, a plugin previously crashed OpenMPT. - theApp.GetSettings().Write<mpt::PathString>("VST Plugins", "FailedPlugin", dllPath); + theApp.GetSettings().Write<mpt::PathString>("VST Plugins", "FailedPlugin", dllPath, SettingWriteThrough); AEffect *pEffect; HINSTANCE hLib; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-24 18:03:23
|
Revision: 3959 http://sourceforge.net/p/modplug/code/3959 Author: manxorist Date: 2014-03-24 18:03:15 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Ref] Test: Rewrite and simplify the tracker test framework: Avoid catching any exceptions and do not try to display any fancy message boxes. Instead, totally rely on a present debugger to break at the right spot (when a test fails or exactly at the point it throws an exception, where the debugger break due to the exception being uncaught). If no debugger is present, do not even bother to run the test cases at all. [Ref] Test: Rename namespace MptTest to namespace mpt::Test. Modified Paths: -------------- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/test/TestTools.h trunk/OpenMPT/test/TestToolsLib.cpp trunk/OpenMPT/test/TestToolsLib.h trunk/OpenMPT/test/TestToolsTracker.h trunk/OpenMPT/test/test.cpp trunk/OpenMPT/test/test.h Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2014-03-24 18:03:15 UTC (rev 3959) @@ -33,7 +33,7 @@ #if defined( LIBOPENMPT_BUILD_TEST ) void run_tests() { - MptTest::DoTests(); + mpt::Test::DoTests(); } #endif // LIBOPENMPT_BUILD_TEST Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-24 18:03:15 UTC (rev 3959) @@ -970,9 +970,7 @@ EndWaitCursor(); -#ifdef ENABLE_TESTS - MptTest::DoTests(); -#endif + mpt::Test::DoTests(); if(TrackerSettings::Instance().m_SoundSettingsOpenDeviceAtStartup) { Modified: trunk/OpenMPT/test/TestTools.h =================================================================== --- trunk/OpenMPT/test/TestTools.h 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/TestTools.h 2014-03-24 18:03:15 UTC (rev 3959) @@ -2,7 +2,7 @@ * TestTools.h * ----------- * Purpose: Unit test framework. - * Notes : Currently somewhat unreadable :/ + * Notes : * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ Modified: trunk/OpenMPT/test/TestToolsLib.cpp =================================================================== --- trunk/OpenMPT/test/TestToolsLib.cpp 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/TestToolsLib.cpp 2014-03-24 18:03:15 UTC (rev 3959) @@ -20,8 +20,7 @@ #include <iostream> -namespace MptTest -{ +namespace mpt { namespace Test { int fail_count = 0; @@ -171,7 +170,7 @@ } -} // namespace MptTest +} } // namespace mpt::Test #endif // !MODPLUG_TRACKER Modified: trunk/OpenMPT/test/TestToolsLib.h =================================================================== --- trunk/OpenMPT/test/TestToolsLib.h 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/TestToolsLib.h 2014-03-24 18:03:15 UTC (rev 3959) @@ -2,7 +2,8 @@ * TestToolsLib.h * -------------- * Purpose: Unit test framework for libopenmpt. - * Notes : Currently somewhat unreadable :/ + * Notes : This is more complex than the OpenMPT version because we cannot + * rely on a debugger and have to deal with exceptions ourselves. * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -18,8 +19,7 @@ #include "../common/FlagSet.h" -namespace MptTest -{ +namespace mpt { namespace Test { extern int fail_count; @@ -49,7 +49,7 @@ Context(const Context &c); }; -#define MPT_TEST_CONTEXT_CURRENT() (::MptTest::Context( __FILE__ , __LINE__ )) +#define MPT_TEST_CONTEXT_CURRENT() (::mpt::Test::Context( __FILE__ , __LINE__ )) struct TestFailed @@ -59,7 +59,7 @@ TestFailed() { } }; -} // namespace MptTest +} } // namespace mpt::Test template<typename T> struct ToStringHelper @@ -79,8 +79,7 @@ } }; -namespace MptTest -{ +namespace mpt { namespace Test { class Test { @@ -147,9 +146,9 @@ } } - #define VERIFY_EQUAL(x,y) ::MptTest::Test(::MptTest::FatalityContinue, ::MptTest::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) - #define VERIFY_EQUAL_NONCONT(x,y) ::MptTest::Test(::MptTest::FatalityStop, ::MptTest::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) - #define VERIFY_EQUAL_QUIET_NONCONT(x,y) ::MptTest::Test(::MptTest::FatalityStop, ::MptTest::VerbosityQuiet, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) + #define VERIFY_EQUAL(x,y) ::mpt::Test::Test(::mpt::Test::FatalityContinue, ::mpt::Test::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) + #define VERIFY_EQUAL_NONCONT(x,y) ::mpt::Test::Test(::mpt::Test::FatalityStop, ::mpt::Test::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) + #define VERIFY_EQUAL_QUIET_NONCONT(x,y) ::mpt::Test::Test(::mpt::Test::FatalityStop, ::mpt::Test::VerbosityQuiet, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( [&](){return (x) ;}, [&](){return (y) ;} ) #else @@ -173,9 +172,9 @@ } } - #define VERIFY_EQUAL(x,y) ::MptTest::Test(::MptTest::FatalityContinue, ::MptTest::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) - #define VERIFY_EQUAL_NONCONT(x,y) ::MptTest::Test(::MptTest::FatalityStop, ::MptTest::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) - #define VERIFY_EQUAL_QUIET_NONCONT(x,y) ::MptTest::Test(::MptTest::FatalityStop, ::MptTest::VerbosityQuiet, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) + #define VERIFY_EQUAL(x,y) ::mpt::Test::Test(::mpt::Test::FatalityContinue, ::mpt::Test::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) + #define VERIFY_EQUAL_NONCONT(x,y) ::mpt::Test::Test(::mpt::Test::FatalityStop, ::mpt::Test::VerbosityNormal, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) + #define VERIFY_EQUAL_QUIET_NONCONT(x,y) ::mpt::Test::Test(::mpt::Test::FatalityStop, ::mpt::Test::VerbosityQuiet, #x " == " #y , MPT_TEST_CONTEXT_CURRENT() )( (x) , (y) ) #endif @@ -184,13 +183,13 @@ #define DO_TEST(func) \ do{ \ - ::MptTest::Test test(::MptTest::FatalityStop, ::MptTest::VerbosityNormal, #func , MPT_TEST_CONTEXT_CURRENT() ); \ + ::mpt::Test::Test test(::mpt::Test::FatalityStop, ::mpt::Test::VerbosityNormal, #func , MPT_TEST_CONTEXT_CURRENT() ); \ try { \ test.ShowStart(); \ fail_count = 0; \ func(); \ if(fail_count > 0) { \ - throw ::MptTest::TestFailed(); \ + throw ::mpt::Test::TestFailed(); \ } \ test.ReportPassed(); \ } catch(...) { \ @@ -199,7 +198,7 @@ }while(0) -} // namespace MptTest +} } // namespace mpt::Test #endif // !MODPLUG_TRACKER Modified: trunk/OpenMPT/test/TestToolsTracker.h =================================================================== --- trunk/OpenMPT/test/TestToolsTracker.h 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/TestToolsTracker.h 2014-03-24 18:03:15 UTC (rev 3959) @@ -2,7 +2,8 @@ * TestToolsTracker.h * ------------------ * Purpose: Unit test framework for OpenMPT. - * Notes : Currently somewhat unreadable :/ + * Notes : Really basic functionality that relies on a debugger that catches + * exceptions and breaks right at the spot where it gets thrown. * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -15,76 +16,9 @@ #ifdef MODPLUG_TRACKER -namespace MptTest -{ +namespace mpt { namespace Test { -static noinline void ReportError(const char * file, int line, const char * description, bool abort) -//------------------------------------------------------------------------------------------------- -{ - std::string pos = std::string() + file + "(" + Stringify(line) + "):\n"; - std::string message = pos + "Test failed: '" + description + "'"; - if(IsDebuggerPresent()) - { - message += "\n"; - OutputDebugString(message.c_str()); - } else - { - if(abort) - { - throw std::runtime_error(message); - } else - { - Reporting::Error(message.c_str(), "OpenMPT TestSuite"); - } - } -} - -static noinline void ReportExceptionError(const char * file, int line, const char * description, const char * exception_what) -//--------------------------------------------------------------------------------------------------------------------------- -{ - std::string pos = std::string() + file + "(" + Stringify(line) + "):\n"; - std::string message; - if(exception_what) - { - message = pos + "Test '" + description + "' threw an exception, message:\n" + exception_what; - } else - { - message = pos + "Test '" + description + "' threw an unknown exception."; - } - if(IsDebuggerPresent()) - { - message += "\n"; - OutputDebugString(message.c_str()); - } else - { - Reporting::Error(message.c_str(), "OpenMPT TestSuite"); - } -} - -static noinline void ReportException(const char * const file, const int line, const char * const description, bool rethrow) -//------------------------------------------------------------------------------------------------------------------------- -{ - try - { - throw; // get the exception - } catch(std::exception &e) - { - ReportExceptionError(file, line, description, e.what()); - if(rethrow) - { - throw; - } - } catch(...) - { - ReportExceptionError(file, line, description, nullptr); - if(rethrow) - { - throw; - } - } -} - #if MPT_COMPILER_MSVC // With MSVC, break directly using __debugbreak intrinsic instead of calling DebugBreak which breaks one stackframe deeper than we want #define MyDebugBreak() __debugbreak() @@ -92,83 +26,34 @@ #define MyDebugBreak() DebugBreak() #endif -#define ReportExceptionAndBreak(file, line, description, rethrow) do { ReportException(file, line, description, rethrow); if(IsDebuggerPresent()) MyDebugBreak(); } while(0) -#define ReportErrorAndBreak(file, line, description, progress) do { ReportError(file, line, description, progress); if(IsDebuggerPresent()) MyDebugBreak(); } while(0) -#define MULTI_TEST_TRY try { -#define MULTI_TEST_START -#define MULTI_TEST_END -#define MULTI_TEST_CATCH } catch(...) { ReportExceptionAndBreak(__FILE__, __LINE__, description, false); } -#define TEST_TRY try { -#define TEST_CATCH } catch(...) { ReportExceptionAndBreak(__FILE__, __LINE__, description, true); } -#define TEST_START() do { } while(0) -#define TEST_OK() do { MPT_UNREFERENCED_PARAMETER(description); } while(0) -#define TEST_FAIL() ReportErrorAndBreak(__FILE__, __LINE__, description, false) -#define TEST_FAIL_STOP() ReportErrorAndBreak(__FILE__, __LINE__, description, true) - - - -//Verify that given parameters are 'equal'(show error message if not). -//The exact meaning of equality is not specified; for now using operator!=. -//The macro is active in both 'debug' and 'release' build. +// Verify that given parameters are 'equal'. Break directly into the debugger if not. +// The exact meaning of equality is based on operator!= . #define VERIFY_EQUAL(x,y) \ -do{ \ - const char * const description = #x " == " #y ; \ - TEST_TRY \ - TEST_START(); \ - if((x) != (y)) \ - { \ - TEST_FAIL(); \ - } else \ - { \ - TEST_OK(); \ - } \ - TEST_CATCH \ -}while(0) + do { \ + if((x) != (y)) { \ + MyDebugBreak(); \ + } \ + } while(0) \ +/**/ +// Like VERIFY_EQUAL, only differs for libopenmpt +#define VERIFY_EQUAL_NONCONT VERIFY_EQUAL -// Like VERIFY_EQUAL, but throws exception if comparison fails. -#define VERIFY_EQUAL_NONCONT(x,y) \ -do{ \ - const char * const description = #x " == " #y ; \ - TEST_TRY \ - TEST_START(); \ - if((x) != (y)) \ - { \ - TEST_FAIL_STOP(); \ - } else \ - { \ - TEST_OK(); \ - } \ - TEST_CATCH \ -}while(0) +// Like VERIFY_EQUAL, only differs for libopenmpt +#define VERIFY_EQUAL_QUIET_NONCONT VERIFY_EQUAL -// Like VERIFY_EQUAL_NONCONT, but do not show message if test succeeds -#define VERIFY_EQUAL_QUIET_NONCONT(x,y) \ -do{ \ - const char * const description = #x " == " #y ; \ - TEST_TRY \ - if((x) != (y)) \ - { \ - TEST_FAIL_STOP(); \ - } \ - TEST_CATCH \ -}while(0) - - #define DO_TEST(func) \ -do{ \ - const char * description = #func ; \ - MULTI_TEST_TRY \ - MULTI_TEST_START \ - func(); \ - MULTI_TEST_END \ - MULTI_TEST_CATCH \ -}while(0) + do { \ + if(IsDebuggerPresent()) { \ + func(); \ + } \ + } while(0) \ +/**/ -} // namespace MptTest +} } // namespace mpt::Test #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/test.cpp 2014-03-24 18:03:15 UTC (rev 3959) @@ -50,8 +50,7 @@ -namespace MptTest -{ +namespace mpt { namespace Test { @@ -565,7 +564,6 @@ } - #ifdef MODPLUG_TRACKER struct CustomSettingsTestType @@ -575,30 +573,30 @@ CustomSettingsTestType(float x_ = 0.0f, float y_ = 0.0f) : x(x_), y(y_) { } }; -} // namespace MptTest +} } // namespace mpt::Test template <> -inline MptTest::CustomSettingsTestType FromSettingValue(const SettingValue &val) +inline mpt::Test::CustomSettingsTestType FromSettingValue(const SettingValue &val) { ASSERT(val.GetTypeTag() == "myType"); std::string xy = val.as<std::string>(); if(xy.empty()) { - return MptTest::CustomSettingsTestType(0.0f, 0.0f); + return mpt::Test::CustomSettingsTestType(0.0f, 0.0f); } std::size_t pos = xy.find("|"); std::string x = xy.substr(0, pos); std::string y = xy.substr(pos + 1); - return MptTest::CustomSettingsTestType(ConvertStrTo<float>(x.c_str()), ConvertStrTo<float>(y.c_str())); + return mpt::Test::CustomSettingsTestType(ConvertStrTo<float>(x.c_str()), ConvertStrTo<float>(y.c_str())); } template <> -inline SettingValue ToSettingValue(const MptTest::CustomSettingsTestType &val) +inline SettingValue ToSettingValue(const mpt::Test::CustomSettingsTestType &val) { return SettingValue(Stringify(val.x) + "|" + Stringify(val.y), "myType"); } -namespace MptTest { +namespace mpt { namespace Test { #endif // MODPLUG_TRACKER @@ -2114,14 +2112,19 @@ } -} // namespace MptTest +} } // namespace mpt::Test #else //Case: ENABLE_TESTS is not defined. -namespace MptTest +namespace mpt { namespace Test { + +void DoTests() +//------------ { - void DoTests() {} + return; } +} } // namespace mpt::Test + #endif Modified: trunk/OpenMPT/test/test.h =================================================================== --- trunk/OpenMPT/test/test.h 2014-03-24 17:20:07 UTC (rev 3958) +++ trunk/OpenMPT/test/test.h 2014-03-24 18:03:15 UTC (rev 3959) @@ -11,7 +11,8 @@ #pragma once -namespace MptTest -{ - void DoTests(); -} // namespace MptTest +namespace mpt { namespace Test { + +void DoTests(); + +} } // namespace mpt::Test This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-24 20:03:14
|
Revision: 3962 http://sourceforge.net/p/modplug/code/3962 Author: manxorist Date: 2014-03-24 20:03:07 +0000 (Mon, 24 Mar 2014) Log Message: ----------- [Ref] Kill MOD_CHARSET_CERTAINTY. It's currently unused and will soon be replaced with proper charset handling. Modified Paths: -------------- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Tables.cpp Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2014-03-24 18:20:03 UTC (rev 3961) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2014-03-24 20:03:07 UTC (rev 3962) @@ -277,7 +277,7 @@ } std::string module_impl::mod_string_to_utf8( const std::string & encoded ) const { - return mpt::To( mpt::CharsetUTF8, m_sndFile->GetCharset().second, encoded ); + return mpt::To( mpt::CharsetUTF8, m_sndFile->GetCharset(), encoded ); } void module_impl::apply_mixer_settings( std::int32_t samplerate, int channels ) { if ( Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-24 18:20:03 UTC (rev 3961) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-24 20:03:07 UTC (rev 3962) @@ -113,14 +113,6 @@ }; -enum MOD_CHARSET_CERTAINTY -{ - MOD_CHARSET_UNKNOWN, - MOD_CHARSET_MAYBE, - MOD_CHARSET_IS, -}; - - // For compatibility mode #define TRK_IMPULSETRACKER (MOD_TYPE_IT | MOD_TYPE_MPT) #define TRK_FASTTRACKER2 (MOD_TYPE_XM) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2014-03-24 18:20:03 UTC (rev 3961) +++ trunk/OpenMPT/soundlib/Sndfile.h 2014-03-24 20:03:07 UTC (rev 3962) @@ -560,7 +560,7 @@ MODCONTAINERTYPE GetContainerType() const { return m_ContainerType; } // rough heuristic, could be improved - std::pair<MOD_CHARSET_CERTAINTY, mpt::Charset> GetCharset() const { return GetCharsetFromModType(GetType()); } + mpt::Charset GetCharset() const { return GetCharsetFromModType(GetType()); } void SetPreAmp(UINT vol); UINT GetPreAmp() const { return m_MixerSettings.m_nPreAmp; } @@ -662,7 +662,7 @@ bool ReadMID(const uint8 *lpStream, DWORD dwMemLength, ModLoadingFlags loadFlags = loadCompleteModule); static std::vector<const char *> GetSupportedExtensions(bool otherFormats); - static std::pair<MOD_CHARSET_CERTAINTY, mpt::Charset> GetCharsetFromModType(MODTYPE modtype); + static mpt::Charset GetCharsetFromModType(MODTYPE modtype); static const char * ModTypeToString(MODTYPE modtype); static std::string ModContainerTypeToString(MODCONTAINERTYPE containertype); static std::string ModTypeToTracker(MODTYPE modtype); Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2014-03-24 18:20:03 UTC (rev 3961) +++ trunk/OpenMPT/soundlib/Tables.cpp 2014-03-24 20:03:07 UTC (rev 3962) @@ -125,52 +125,51 @@ struct ModCharsetInfo { MODTYPE type; - MOD_CHARSET_CERTAINTY certainty; mpt::Charset charset; }; static const ModCharsetInfo ModCharsetInfos[] = { // Amiga - { MOD_TYPE_OKT , MOD_CHARSET_IS , mpt::CharsetISO8859_1 }, - { MOD_TYPE_DBM , MOD_CHARSET_IS , mpt::CharsetISO8859_1 }, - { MOD_TYPE_DIGI, MOD_CHARSET_IS , mpt::CharsetISO8859_1 }, + { MOD_TYPE_OKT , mpt::CharsetISO8859_1 }, + { MOD_TYPE_DBM , mpt::CharsetISO8859_1 }, + { MOD_TYPE_DIGI, mpt::CharsetISO8859_1 }, // Amiga // DOS - { MOD_TYPE_MOD , MOD_CHARSET_MAYBE , mpt::CharsetISO8859_1 }, - { MOD_TYPE_MED , MOD_CHARSET_MAYBE , mpt::CharsetISO8859_1 }, + { MOD_TYPE_MOD , mpt::CharsetISO8859_1 }, + { MOD_TYPE_MED , mpt::CharsetISO8859_1 }, // DOS - { MOD_TYPE_S3M , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_XM , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_MTM , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_IT , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_669 , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_STM , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_FAR , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_AMF , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_AMF0, MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_MDL , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_DMF , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_PTM , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_PSM , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_J2B , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_IMF , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_ULT , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_AMS , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_AMS2, MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_DSM , MOD_CHARSET_IS , mpt::CharsetCP437 }, + { MOD_TYPE_S3M , mpt::CharsetCP437 }, + { MOD_TYPE_XM , mpt::CharsetCP437 }, + { MOD_TYPE_MTM , mpt::CharsetCP437 }, + { MOD_TYPE_IT , mpt::CharsetCP437 }, + { MOD_TYPE_669 , mpt::CharsetCP437 }, + { MOD_TYPE_STM , mpt::CharsetCP437 }, + { MOD_TYPE_FAR , mpt::CharsetCP437 }, + { MOD_TYPE_AMF , mpt::CharsetCP437 }, + { MOD_TYPE_AMF0, mpt::CharsetCP437 }, + { MOD_TYPE_MDL , mpt::CharsetCP437 }, + { MOD_TYPE_DMF , mpt::CharsetCP437 }, + { MOD_TYPE_PTM , mpt::CharsetCP437 }, + { MOD_TYPE_PSM , mpt::CharsetCP437 }, + { MOD_TYPE_J2B , mpt::CharsetCP437 }, + { MOD_TYPE_IMF , mpt::CharsetCP437 }, + { MOD_TYPE_ULT , mpt::CharsetCP437 }, + { MOD_TYPE_AMS , mpt::CharsetCP437 }, + { MOD_TYPE_AMS2, mpt::CharsetCP437 }, + { MOD_TYPE_DSM , mpt::CharsetCP437 }, // Windows - { MOD_TYPE_MT2 , MOD_CHARSET_MAYBE , mpt::CharsetWindows1252}, - { MOD_TYPE_MPT , MOD_CHARSET_MAYBE , mpt::CharsetWindows1252}, + { MOD_TYPE_MT2 , mpt::CharsetWindows1252}, + { MOD_TYPE_MPT , mpt::CharsetWindows1252}, // random stuff - { MOD_TYPE_MID , MOD_CHARSET_IS , mpt::CharsetASCII }, - { MOD_TYPE_WAV , MOD_CHARSET_MAYBE , mpt::CharsetASCII }, + { MOD_TYPE_MID , mpt::CharsetASCII }, + { MOD_TYPE_WAV , mpt::CharsetASCII }, // end - { MOD_TYPE_NONE, MOD_CHARSET_UNKNOWN, mpt::CharsetASCII } + { MOD_TYPE_NONE, mpt::CharsetASCII } }; -std::pair<MOD_CHARSET_CERTAINTY, mpt::Charset> CSoundFile::GetCharsetFromModType(MODTYPE modtype) -//----------------------------------------------------------------------------------------------- +mpt::Charset CSoundFile::GetCharsetFromModType(MODTYPE modtype) +//------------------------------------------------------------- { // This is just a rough heuristic. // It could be improved by adjusting the charset according to the tracker that had been used to save the file. @@ -178,11 +177,11 @@ { if(charsetInfoIt->type == modtype) { - return std::make_pair(charsetInfoIt->certainty, charsetInfoIt->charset); + return charsetInfoIt->charset; } } // fallback - return std::make_pair(MOD_CHARSET_UNKNOWN, mpt::CharsetASCII); + return mpt::CharsetASCII; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-25 23:02:16
|
Revision: 3963 http://sourceforge.net/p/modplug/code/3963 Author: saga-games Date: 2014-03-25 23:01:50 +0000 (Tue, 25 Mar 2014) Log Message: ----------- [Imp] Replaced the "slightly" aged Win95-style icon set with a slightly more modern one (VS 200x icons). [Fix] Instrument tab / Effect vis: Grid is now also displayed correctly on Win98. [Mod] OpenMPT: Version is now 1.22.07.33 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/EffectVis.h trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/Globals.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_ins.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_smp.h trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/mptrack/view_com.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/CImageListEx.h trunk/OpenMPT/mptrack/PNG.cpp trunk/OpenMPT/mptrack/res/envelope_toolbar.png trunk/OpenMPT/mptrack/res/icons.png trunk/OpenMPT/mptrack/res/main_toolbar.png trunk/OpenMPT/mptrack/res/originals/ trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi trunk/OpenMPT/mptrack/res/originals/icons.pfi trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi trunk/OpenMPT/mptrack/res/originals/note.pfi trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi trunk/OpenMPT/mptrack/res/originals/readme.txt trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi trunk/OpenMPT/mptrack/res/pattern_toolbar.png trunk/OpenMPT/mptrack/res/sample_toolbar.png trunk/OpenMPT/mptrack/res/splashno.png Removed Paths: ------------- trunk/OpenMPT/mptrack/res/MAINBAR.BMP trunk/OpenMPT/mptrack/res/envbar.bmp trunk/OpenMPT/mptrack/res/img_list.bmp trunk/OpenMPT/mptrack/res/modplthingmorecontrast.bmp trunk/OpenMPT/mptrack/res/patterns.bmp trunk/OpenMPT/mptrack/res/smptoolb.bmp trunk/OpenMPT/mptrack/res/splash.bmp trunk/OpenMPT/mptrack/res/splash0.bmp trunk/OpenMPT/mptrack/res/splash_new.bmp trunk/OpenMPT/mptrack/res/splash_old.bmp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/common/versionNumber.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 07 -#define VER_MINORMINOR 32 +#define VER_MINORMINOR 33 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Added: trunk/OpenMPT/mptrack/CImageListEx.h =================================================================== --- trunk/OpenMPT/mptrack/CImageListEx.h (rev 0) +++ trunk/OpenMPT/mptrack/CImageListEx.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -0,0 +1,88 @@ +/* + * CImageListEx.h + * -------------- + * Purpose: A class that extends MFC's CImageList to handle alpha-blended images properly. Also provided 1-bit transparency fallback for legacy Win9x systems. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#pragma once + +class CImageListEx : public CImageList +{ +public: + BOOL Create(UINT resourceID, int cx, int cy, int nInitial, int nGrow) + { + CBitmap *bitmap = ReadPNG(MAKEINTRESOURCE(resourceID)); + if(bitmap == nullptr) + { + return FALSE; + } + +#ifdef _M_IX86 + // This is only relevant for Win9x (testing for supported SDK version won't work here because we only support Win9x through KernelEx). + // Win9x only supports 1-bit transparency, so we pre-multiply all pixels with the default button face colour and create a transparency mask. + if(!mpt::Windows::IsWinNT()) + { + BITMAP bm; + bitmap->GetBitmap(&bm); + uint32_t bitmapSize = bm.bmWidthBytes * bm.bmHeight; + + std::vector<RGBQUAD> bitmapBytes(bitmapSize / sizeof(RGBQUAD)), maskBytes(bitmapSize / sizeof(RGBQUAD)); + bitmap->GetBitmapBits(bitmapSize, &bitmapBytes[0]); + + CBitmap bitmapMask; + bitmapMask.CreateBitmapIndirect(&bm); + bitmapMask.GetBitmapBits(bitmapSize, &maskBytes[0]); + + const COLORREF buttonColor = GetSysColor(COLOR_BTNFACE); + const uint8_t r = GetRValue(buttonColor), g = GetGValue(buttonColor), b = GetBValue(buttonColor); + + RGBQUAD *pixel = &bitmapBytes[0], *mask = &maskBytes[0]; + for(size_t i = bitmapBytes.size(); i != 0; i--, pixel++, mask++) + { + if(pixel->rgbReserved != 0) + { + // Pixel not fully transparent - multiply with default background colour +#define MIXCOLOR(a, b) (((a) * pixel->rgbReserved + (b) * (255 - pixel->rgbReserved)) >> 8); + pixel->rgbRed = MIXCOLOR(pixel->rgbRed, r); + pixel->rgbGreen = MIXCOLOR(pixel->rgbGreen, g); + pixel->rgbBlue = MIXCOLOR(pixel->rgbBlue, b); + pixel->rgbReserved = 255; +#undef MIXCOLOR + mask->rgbRed = 0; + mask->rgbGreen = 0; + mask->rgbBlue = 0; + mask->rgbReserved = 255; + } else + { + // Transparent pixel + mask->rgbRed = 255; + mask->rgbGreen = 255; + mask->rgbBlue = 255; + mask->rgbReserved = 255; + } + } + bitmap->SetBitmapBits(bitmapSize, &bitmapBytes[0]); + bitmapMask.SetBitmapBits(bitmapSize, &maskBytes[0]); + + if(!CImageList::Create(cx, cy, ILC_COLOR32 | ILC_MASK, nInitial, nGrow)) + { + return FALSE; + } + CImageList::Add(bitmap, &bitmapMask); + } else +#endif + { + if(!CImageList::Create(cx, cy, ILC_COLOR32, nInitial, nGrow)) + { + return FALSE; + } + CImageList::Add(bitmap, RGB(0, 0, 0)); + } + bitmap->Detach(); + delete bitmap; + return TRUE; + } +}; \ No newline at end of file Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -885,7 +885,7 @@ CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; - m_ToolBar.Init(); + m_ToolBar.Init(IDB_PATTERNS); m_ToolBar.AddButton(IDC_INSTRUMENT_NEW, TIMAGE_INSTR_NEW); m_ToolBar.AddButton(IDC_INSTRUMENT_OPEN, TIMAGE_OPEN); m_ToolBar.AddButton(IDC_INSTRUMENT_SAVEAS, TIMAGE_SAVE); Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -133,7 +133,7 @@ rcOrderList.right = rect.right - 4; m_OrderList.Init(rcOrderList, pMainFrm->GetGUIFont()); // Toolbar buttons - m_ToolBar.Init(); + m_ToolBar.Init(IDB_PATTERNS); m_ToolBar.AddButton(IDC_PATTERN_NEW, TIMAGE_PATTERN_NEW); m_ToolBar.AddButton(IDC_PATTERN_PLAY, TIMAGE_PATTERN_PLAY); m_ToolBar.AddButton(IDC_PATTERN_PLAYFROMSTART, TIMAGE_PATTERN_RESTART); Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -218,12 +218,12 @@ m_ComboZoom.SetItemData(m_ComboZoom.AddString("1:128"), 8); m_ComboZoom.SetCurSel(0); // File ToolBar - m_ToolBar1.Init(); + m_ToolBar1.Init(IDB_PATTERNS); m_ToolBar1.AddButton(IDC_SAMPLE_NEW, TIMAGE_SAMPLE_NEW); m_ToolBar1.AddButton(IDC_SAMPLE_OPEN, TIMAGE_OPEN); m_ToolBar1.AddButton(IDC_SAMPLE_SAVEAS, TIMAGE_SAVE); // Edit ToolBar - m_ToolBar2.Init(); + m_ToolBar2.Init(IDB_PATTERNS); m_ToolBar2.AddButton(IDC_SAMPLE_PLAY, TIMAGE_PREVIEW); m_ToolBar2.AddButton(IDC_SAMPLE_NORMALIZE, TIMAGE_SAMPLE_NORMALIZE); m_ToolBar2.AddButton(IDC_SAMPLE_AMPLIFY, TIMAGE_SAMPLE_AMPLIFY); Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -36,7 +36,6 @@ m_pViewPattern = pViewPattern; m_dwStatus = 0x00; m_nDragItem = -1; - m_brushBlack.CreateSolidBrush(RGB(0, 0, 0)); m_boolForceRedraw = TRUE; m_pModDoc = pModDoc; @@ -266,6 +265,7 @@ } void CEffectVis::DrawGrid() +//------------------------- { // Lots of room for optimisation here. // Draw vertical grid lines @@ -275,6 +275,8 @@ nBeat = m_pSndFile->Patterns[m_nPattern].GetRowsPerBeat(); nMeasure = m_pSndFile->Patterns[m_nPattern].GetRowsPerMeasure(); } + + m_dcGrid.FillSolidRect(m_rcDraw, 0); for (ROWINDEX row = m_startRow; row <= m_endRow; row++) { if (row % nMeasure == 0) @@ -310,7 +312,9 @@ } + void CEffectVis::SetPlayCursor(PATTERNINDEX nPat, ROWINDEX nRow) +//-------------------------------------------------------------- { int x1; //erase current playpos: @@ -334,8 +338,9 @@ InvalidateRect(NULL, FALSE); } -//----------------------------------------------------------------------------------------- + void CEffectVis::ShowVis(CDC * pDC, CRect rectBorder) +//--------------------------------------------------- { MPT_UNREFERENCED_PARAMETER(rectBorder); if (m_boolForceRedraw) @@ -388,9 +393,9 @@ void CEffectVis::ShowVisImage(CDC *pDC) //------------------------------------- { - CDC memDC ; - CBitmap memBitmap ; - CBitmap* oldBitmap ; // bitmap originally found in CMemDC + CDC memDC; + CBitmap memBitmap; + CBitmap* oldBitmap; // bitmap originally found in CMemDC // to avoid flicker, establish a memory dc, draw to it // and then BitBlt it to the destination "pDC" @@ -422,7 +427,7 @@ pDC->BitBlt(LEFTBORDER, TOPBORDER, m_rcDraw.Width()+LEFTBORDER, m_rcDraw.Height()+TOPBORDER, &memDC, 0, 0, SRCCOPY) ; } - memDC.SelectObject(oldBitmap) ; + memDC.SelectObject(oldBitmap); } @@ -433,12 +438,12 @@ //erase if ((UINT)m_nRowToErase<m_startRow || m_nParamToErase < 0) { - ::FillRect(m_dcNodes.m_hDC, &m_rcDraw, m_brushBlack); + m_dcNodes.FillSolidRect(m_rcDraw, 0); } else { int x = RowToScreenX(m_nRowToErase); - CRect r( x-NODEHALF-1, m_rcDraw.top, x-NODEHALF+NODESIZE+1, m_rcDraw.bottom); - ::FillRect(m_dcNodes.m_hDC, r, m_brushBlack); + CRect r(x - NODEHALF - 1, m_rcDraw.top, x - NODEHALF + NODESIZE + 1, m_rcDraw.bottom); + m_dcNodes.FillSolidRect(r, 0); } //Draw @@ -446,7 +451,7 @@ { int x = RowToScreenX(row); int y = RowToScreenY(row); - DibBlt(m_dcNodes.m_hDC, x-NODEHALF, y-NODEHALF, NODESIZE, NODESIZE, 0, 0, IsPcNote(row)? CMainFrame::bmpVisPcNode : CMainFrame::bmpVisNode); + DibBlt(m_dcNodes.m_hDC, x-NODEHALF, y-NODEHALF, NODESIZE, NODESIZE, 0, 0, IsPcNote(row) ? CMainFrame::bmpVisPcNode : CMainFrame::bmpVisNode); } } @@ -478,41 +483,40 @@ } -VOID CEffectVis::OnClose() +void CEffectVis::OnClose() //------------------------ { DoClose(); } -VOID CEffectVis::OnOK() +void CEffectVis::OnOK() //--------------------- { OnClose(); } -VOID CEffectVis::OnCancel() +void CEffectVis::OnCancel() //------------------------- { OnClose(); } -VOID CEffectVis::DoClose() +void CEffectVis::DoClose() //------------------------ { m_dcGrid.SelectObject(m_pbOldGrid); m_dcGrid.DeleteDC(); m_dcNodes.SelectObject(m_pbOldNodes); m_dcNodes.DeleteDC(); - m_dcPlayPos.SelectObject(m_pbOldPlayPos) ; - m_dcPlayPos.DeleteDC() ; + m_dcPlayPos.SelectObject(m_pbOldPlayPos); + m_dcPlayPos.DeleteDC(); m_bGrid.DeleteObject(); m_bNodes.DeleteObject(); - m_bPlayPos.DeleteObject() ; - m_brushBlack.DeleteObject(); + m_bPlayPos.DeleteObject(); if (m_hWnd) { Modified: trunk/OpenMPT/mptrack/EffectVis.h =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/EffectVis.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -62,8 +62,6 @@ ROWINDEX m_nOldPlayPos; ModCommand m_templatePCNote; - CBrush m_brushBlack; - protected: ROWINDEX m_startRow; ROWINDEX m_endRow; @@ -101,8 +99,8 @@ CComboBox m_cmbEffectList, m_cmbActionList; CEdit m_edVisStatus; - virtual VOID OnOK(); - virtual VOID OnCancel(); + virtual void OnOK(); + virtual void OnCancel(); afx_msg void OnClose(); Setting<LONG>* GetSplitPosRef() {return NULL;} //rewbs.varWindowSize Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Globals.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -167,8 +167,8 @@ } -UINT CModTabCtrl::GetItemData(int nIndex) -//--------------------------------------- +LPARAM CModTabCtrl::GetItemData(int nIndex) +//----------------------------------------- { TC_ITEM tci; tci.mask = TCIF_PARAM; @@ -450,7 +450,7 @@ if (mask & 2) m_TabCtrl.InsertItem(count++, "Patterns", IDD_CONTROL_PATTERNS, IMAGE_PATTERNS); if (mask & 4) m_TabCtrl.InsertItem(count++, "Samples", IDD_CONTROL_SAMPLES, IMAGE_SAMPLES); if (mask & 8) m_TabCtrl.InsertItem(count++, "Instruments", IDD_CONTROL_INSTRUMENTS, IMAGE_INSTRUMENTS); - if (mask & 32) m_TabCtrl.InsertItem(count++, "Graph", IDD_CONTROL_GRAPH, IMAGE_GRAPH); //rewbs.graph + //if (mask & 32) m_TabCtrl.InsertItem(count++, "Graph", IDD_CONTROL_GRAPH, IMAGE_GRAPH); //rewbs.graph if (mask & 16) m_TabCtrl.InsertItem(count++, "Comments", IDD_CONTROL_COMMENTS, IMAGE_COMMENTS); } } @@ -730,33 +730,17 @@ END_MESSAGE_MAP() -CModControlBar::~CModControlBar() -//------------------------------- -{ - if (m_hBarBmp) - { - DeleteObject(m_hBarBmp); - m_hBarBmp = NULL; - } -} - - BOOL CModControlBar::Init(UINT nId) //--------------------------------- { - HINSTANCE hInstance = AfxGetInstanceHandle(); - TBADDBITMAP tbab; - SetButtonStructSize(sizeof(TBBUTTON)); - SetBitmapSize(CSize(16, 15)); + SetBitmapSize(CSize(16, 16)); SetButtonSize(CSize(27, 24)); + // Add bitmaps - m_hBarBmp = AfxLoadSysColorBitmap( - hInstance, - ::FindResource(hInstance, MAKEINTRESOURCE(nId), RT_BITMAP)); - tbab.hInst = NULL; - tbab.nID = (UINT_PTR)m_hBarBmp; - ::SendMessage(m_hWnd, TB_ADDBITMAP, 16, (LPARAM)&tbab); + m_ImageList.Create(nId, 16, 16, IMGLIST_NUMIMAGES, 1); + + SetImageList(&m_ImageList); UpdateStyle(); return TRUE; } Modified: trunk/OpenMPT/mptrack/Globals.h =================================================================== --- trunk/OpenMPT/mptrack/Globals.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Globals.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -28,14 +28,10 @@ //======================================= { protected: - HBITMAP m_hBarBmp; + CImageListEx m_ImageList; public: - CModControlBar() { m_hBarBmp=NULL; } - ~CModControlBar(); - -public: - BOOL Init(UINT nId=IDB_PATTERNS); + BOOL Init(UINT nId); void UpdateStyle(); BOOL AddButton(UINT nID, int iImage=0, UINT nStyle=TBSTYLE_BUTTON, UINT nState=TBSTATE_ENABLED); afx_msg LRESULT OnHelpHitTest(WPARAM, LPARAM); @@ -113,7 +109,7 @@ public: BOOL InsertItem(int nIndex, LPSTR pszText, LPARAM lParam=0, int iImage=-1); BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); - UINT GetItemData(int nIndex); + LPARAM GetItemData(int nIndex); }; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -290,7 +290,9 @@ if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; // Load resources m_hIcon = theApp.LoadIcon(IDR_MAINFRAME); - m_ImageList.Create(IDB_IMAGELIST, 16, 0, RGB(0,128,128)); + + m_ImageList.Create(IDB_IMAGELIST, 16, 16, IMGLIST_NUMIMAGES, 1); + m_hGUIFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); m_hFixedFont = ::CreateFont(12,5, 0,0, 300, FALSE, FALSE, FALSE, Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -230,9 +230,16 @@ DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY; if (!CToolBar::Create(parent, dwStyle)) return FALSE; - if (!LoadBitmap(IDB_MAINBAR)) return FALSE; + + m_ImageList.Create(IDB_MAINBAR, 16, 16, IMGLIST_NUMIMAGES, 1); + GetToolBarCtrl().SetImageList(&m_ImageList); + if (!SetButtons(MainButtons, CountOf(MainButtons))) return FALSE; + CRect temp; + GetItemRect(0,&temp); + SetSizes(CSize(temp.Width(), temp.Height()), CSize(16, 16)); + nCurrentSpeed = 6; nCurrentTempo = 125; nCurrentRowsPerBeat = 4; Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Mainbar.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -74,6 +74,7 @@ //=================================== { protected: + CImageListEx m_ImageList; CStatic m_EditTempo, m_EditSpeed, m_EditOctave, m_EditRowsPerBeat; CStatic m_StaticTempo, m_StaticSpeed, m_StaticRowsPerBeat; CSpinButtonCtrl m_SpinTempo, m_SpinSpeed, m_SpinOctave, m_SpinRowsPerBeat; Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -138,31 +138,25 @@ IMAGE_PATTERNS, IMAGE_SAMPLES, IMAGE_INSTRUMENTS, + IMAGE_PLUGININSTRUMENT = IMAGE_INSTRUMENTS, IMAGE_GENERAL, IMAGE_FOLDER, IMAGE_OPENFOLDER, IMAGE_PARTITION, IMAGE_NOSAMPLE, - IMAGE_NOINSTRUMENT, - IMAGE_NETWORKDRIVE, - IMAGE_CDROMDRIVE, - IMAGE_RAMDRIVE, - IMAGE_FLOPPYDRIVE, - IMAGE_REMOVABLEDRIVE, - IMAGE_FIXEDDRIVE, IMAGE_FOLDERPARENT, IMAGE_FOLDERSONG, IMAGE_DIRECTX, IMAGE_WAVEOUT, + IMAGE_EFFECTPLUGIN = IMAGE_WAVEOUT, IMAGE_ASIO, - IMAGE_GRAPH, + IMAGE_CHIP, IMAGE_SAMPLEMUTE, IMAGE_INSTRMUTE, IMAGE_SAMPLEACTIVE, IMAGE_INSTRACTIVE, IMAGE_NOPLUGIN, - IMAGE_EFFECTPLUGIN, - IMAGE_PLUGININSTRUMENT, + IMGLIST_NUMIMAGES }; @@ -174,7 +168,7 @@ TIMAGE_PATTERN_PLAY, TIMAGE_PATTERN_RESTART, TIMAGE_PATTERN_RECORD, - TIMAGE_MIDI_RECORD, // unused? + TIMAGE_SAMPLE_FIXLOOP, TIMAGE_SAMPLE_NEW, TIMAGE_INSTR_NEW, TIMAGE_SAMPLE_NORMALIZE, @@ -184,7 +178,7 @@ TIMAGE_OPEN, TIMAGE_SAVE, TIMAGE_PREVIEW, - TIMAGE_PAUSE, // unused? + TIMAGE_SAMPLE_AUTOTUNE, TIMAGE_PATTERN_VUMETERS, TIMAGE_MACROEDITOR, TIMAGE_CHORDEDITOR, @@ -192,9 +186,7 @@ TIMAGE_PATTERN_EXPAND, TIMAGE_PATTERN_SHRINK, TIMAGE_SAMPLE_SILENCE, - TIMAGE_TAB_SAMPLES, - TIMAGE_TAB_INSTRUMENTS, - TIMAGE_TAB_PATTERNS, + TIMAGE_PATTERN_OVERFLOWPASTE, TIMAGE_UNDO, TIMAGE_REDO, TIMAGE_PATTERN_PLAYROW, @@ -207,9 +199,7 @@ TIMAGE_SAMPLE_INVERT, TIMAGE_SAMPLE_UNSIGN, TIMAGE_SAMPLE_DCOFFSET, - TIMAGE_PATTERN_OVERFLOWPASTE, - TIMAGE_SAMPLE_FIXLOOP, - TIMAGE_SAMPLE_AUTOTUNE, + PATTERNIMG_NUMIMAGES }; @@ -219,11 +209,11 @@ SIMAGE_CHECKED = 0, SIMAGE_ZOOMUP, SIMAGE_ZOOMDOWN, - SIMAGE_NODRAW, SIMAGE_DRAW, SIMAGE_RESIZE, SIMAGE_GENERATE, SIMAGE_GRID, + SAMPLEIMG_NUMIMAGES }; @@ -251,6 +241,7 @@ IIMAGE_NOZOOMIN, IIMAGE_ZOOMOUT, IIMAGE_NOZOOMOUT, + ENVIMG_NUMIMAGES }; @@ -263,7 +254,9 @@ #define TIMERID_GUI 1 #define TIMERID_NOTIFY 2 -#include "mainbar.h" +extern CBitmap *ReadPNG(const TCHAR *resource); +#include "CImageListEx.h" +#include "Mainbar.h" #include "TrackerSettings.h" struct MODPLUGDIB; @@ -275,6 +268,7 @@ return DecodeBinarySetting<WINDOWPLACEMENT>(val.as<std::vector<char> >()); } + //====================================================================================== class CMainFrame: public CMDIFrameWnd, public ISoundSource, public ISoundMessageReceiver //====================================================================================== @@ -319,7 +313,7 @@ CModTreeBar m_wndTree; CStatusBar m_wndStatusBar; CMainToolBar m_wndToolBar; - CImageList m_ImageList; + CImageListEx m_ImageList; CSoundFile *m_pSndFile; // != NULL only when currently playing or rendering HWND m_hWndMidi; CSoundFile::samplecount_t m_dwTimeSec; @@ -399,7 +393,7 @@ UINT GetBaseOctave() const; CModDoc *GetActiveDoc(); CView *GetActiveView(); //rewbs.customKeys - CImageList *GetImageList() { return &m_ImageList; } + CImageListEx *GetImageList() { return &m_ImageList; } void OnDocumentCreated(CModDoc *pModDoc); void OnDocumentClosed(CModDoc *pModDoc); void UpdateTree(CModDoc *pModDoc, DWORD lHint=0, CObject *pHint=NULL); @@ -408,7 +402,7 @@ CWnd *m_pNoteMapHasFocus; //rewbs.customKeys CWnd* m_pOrderlistHasFocus; double GetApproxBPM(); - void ThreadSafeSetModified(CModDoc* modified) {m_pJustModifiedDoc=modified;} + void ThreadSafeSetModified(CModDoc* modified) { InterlockedExchangePointer(reinterpret_cast<void **>(&m_pJustModifiedDoc), modified); } void SetElapsedTime(double t) { m_dwTimeSec = static_cast<CSoundFile::samplecount_t>(t); } CModTree *GetUpperTreeview() { return m_wndTree.m_pModTree; } Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -298,7 +298,7 @@ case SNDDEV_PORTAUDIO_WDMKS: // No real image available for now, // prepend API name to name and misuse another icon. - cbi.iImage = IMAGE_RAMDRIVE; + cbi.iImage = IMAGE_CHIP; name = mpt::ToCString(it->apiName) + TEXT(" - ") + name; break; default: Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -1484,7 +1484,6 @@ virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel(); - virtual void DoDataExchange(CDataExchange* pDX); }; static CAboutDlg *gpAboutDlg = NULL; @@ -1496,14 +1495,6 @@ gpAboutDlg = NULL; } -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -//------------------------------------------------------ -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CModTypeDlg) - //}}AFX_DATA_MAP -} - void CAboutDlg::OnOK() //-------------------- { @@ -1560,31 +1551,62 @@ //================================= { protected: - CPaletteBitmap m_Bmp; + CBitmap *m_Bitmap; + BITMAP bm; public: - CSplashScreen() {} + CSplashScreen(CWnd *parent); ~CSplashScreen(); - BOOL Initialize(CWnd *); virtual BOOL OnInitDialog(); virtual void OnOK(); virtual void OnCancel() { OnOK(); } + virtual void OnPaint(); + virtual BOOL OnEraseBkgnd(CDC *) { return TRUE; } + + DECLARE_MESSAGE_MAP() }; +BEGIN_MESSAGE_MAP(CSplashScreen, CDialog) + ON_WM_PAINT() + ON_WM_ERASEBKGND() +END_MESSAGE_MAP() + static CSplashScreen *gpSplashScreen = NULL; +CSplashScreen::CSplashScreen(CWnd *parent) +//---------------------------------------- +{ + m_Bitmap = ReadPNG(MAKEINTRESOURCE(IDB_SPLASHNOFOLDFIN)); + m_Bitmap->GetBitmap(&bm); + + Create(IDD_SPLASHSCREEN, parent); + ASSERT(m_Bitmap); +} + + CSplashScreen::~CSplashScreen() //----------------------------- { gpSplashScreen = NULL; + m_Bitmap->DeleteObject(); } -BOOL CSplashScreen::Initialize(CWnd *parent) -//------------------------------------------ +void CSplashScreen::OnPaint() +//--------------------------- { - Create(IDD_SPLASHSCREEN, parent); - return TRUE; + CRect rect; + GetUpdateRect(&rect); + CPaintDC dc(this); + + CDC hdcMem; + hdcMem.CreateCompatibleDC(&dc); + CBitmap *oldBitmap = hdcMem.SelectObject(m_Bitmap); + dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &hdcMem, 0, 0, SRCCOPY); + hdcMem.SelectObject(oldBitmap); + hdcMem.DeleteDC(); + + CDialog::OnPaint(); } @@ -1595,22 +1617,21 @@ int cx, cy, newcx, newcy; CDialog::OnInitDialog(); - m_Bmp.SubclassDlgItem(IDC_SPLASH, this); - m_Bmp.LoadBitmap(MAKEINTRESOURCE(IDB_SPLASHNOFOLDFIN)); + GetWindowRect(&rect); cx = rect.Width(); cy = rect.Height(); - newcx = m_Bmp.GetWidth(); - newcy = m_Bmp.GetHeight(); - if ((newcx) && (newcy)) + newcx = bm.bmWidth; + newcy = bm.bmHeight; + if(newcx && newcy) { LONG ExStyle = GetWindowLong(m_hWnd, GWL_EXSTYLE); ExStyle |= WS_EX_TOPMOST; SetWindowLong(m_hWnd, GWL_EXSTYLE, ExStyle); rect.left -= (newcx - cx) / 2; rect.top -= (newcy - cy) / 2; - SetWindowPos(&wndTop, rect.left, rect.top, newcx, newcy, 0); - m_Bmp.SetWindowPos(NULL, 0,0, newcx, newcy, SWP_NOZORDER); + SetWindowPos(&wndTop, rect.left, rect.top, newcx, newcy, SWP_NOCOPYBITS); + } return TRUE; } @@ -1634,10 +1655,9 @@ { if (!gpSplashScreen) { - gpSplashScreen = new CSplashScreen(); + gpSplashScreen = new CSplashScreen(m_pMainWnd); if (gpSplashScreen) { - gpSplashScreen->Initialize(m_pMainWnd); gpSplashScreen->ShowWindow(SW_SHOW); gpSplashScreen->UpdateWindow(); gpSplashScreen->BeginWaitCursor(); @@ -2027,7 +2047,7 @@ m_pPluginManager->AddPlugin(plugPath, true, true, &nonFoundPlugs); } - if(!dialogShown && GetTickCount() >= scanStart + 1000) + if(!dialogShown && GetTickCount() >= scanStart + 2000) { // If this is taking too long, show the user what he's waiting for. dialogShown = true; Added: trunk/OpenMPT/mptrack/PNG.cpp =================================================================== --- trunk/OpenMPT/mptrack/PNG.cpp (rev 0) +++ trunk/OpenMPT/mptrack/PNG.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -0,0 +1,210 @@ +/* + * PNG.cpp + * ------- + * Purpose: Extremely minimalistic PNG loader (only for internal data resources) + * Notes : Currenlty implemented: 8-bit, 24-bit and 32-bit images (8 bits per component), no filters, no interlaced pictures. + * Paletted pictures are automatically depalettized. + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" +#include "MPTrackUtil.h" +#include "../soundlib/FileReader.h" +#if !defined(NO_ZLIB) +#include <zlib.h> +#elif !defined(NO_MINIZ) +#define MINIZ_HEADER_FILE_ONLY +#include "miniz/miniz.c" +#endif + + +CBitmap *ReadPNG(FileReader &file) +//-------------------------------- +{ + file.Rewind(); + if(!file.ReadMagic("\211PNG\r\n\032\n")) + { + return nullptr; + } + + uint32_t width = 0; + uint32_t height = 0; + uint8_t bitDepth; + uint8_t colorType; + uint8_t compressionMethod; + uint8_t filterMethod; + uint8_t interlaceMethod; + + std::vector<uint8_t> dataIn; + std::vector<RGBQUAD> palette; + + while(file.AreBytesLeft()) + { + uint32_t chunkLength = file.ReadUint32BE(); + char magic[4]; + file.ReadArray(magic); + FileReader chunk = file.ReadChunk(chunkLength); + file.Skip(4); + if(!memcmp(magic, "IHDR", 4)) + { + // Image header + width = chunk.ReadUint32BE(); + height = chunk.ReadUint32BE(); + bitDepth = chunk.ReadUint8(); + colorType = chunk.ReadUint8(); + compressionMethod = chunk.ReadUint8(); + filterMethod = chunk.ReadUint8(); + interlaceMethod = chunk.ReadUint8(); + ASSERT(!filterMethod && !interlaceMethod); + } else if(!memcmp(magic, "IDAT", 4)) + { + // Data block(s) + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = static_cast<uInt>(chunk.GetLength()); + strm.next_in = (Bytef *)(chunk.GetRawData()); + if(inflateInit2(&strm, 15) != Z_OK) + { + break; + } + int retVal; + do + { + dataIn.resize(dataIn.size() + 4096); + strm.avail_out = 4096; + strm.next_out = (Bytef *)&dataIn[dataIn.size() - 4096]; + retVal = inflate(&strm, Z_NO_FLUSH); + } while(retVal == Z_OK); + inflateEnd(&strm); + } else if(!memcmp(magic, "PLTE", 4)) + { + // Palette for <= 8-bit images + palette.resize(256); + size_t numEntries = std::min<size_t>(256u, chunk.GetLength() / 3u); + for(size_t i = 0; i < numEntries; i++) + { + RGBQUAD col; + col.rgbRed = chunk.ReadUint8(); + col.rgbGreen = chunk.ReadUint8(); + col.rgbBlue = chunk.ReadUint8(); + col.rgbReserved = 255; + palette[i] = col; + } + } + } + + // LUT for translating the color type into a number of color samples + const uint32_t sampleTable[] = + { + 1, // 0: Grayscale + 0, + 3, // 2: RGB + 1, // 3: Palette bitmap + 2, // 4: Grayscale + Alpha + 0, + 4 // 6: RGBA + }; + const uint32_t bitsPerPixel = colorType < CountOf(sampleTable) ? sampleTable[colorType] * bitDepth : 0; + + if(!width || !height || !bitsPerPixel + || (colorType != 2 && colorType != 3 && colorType != 6) || bitDepth != 8 // Only RGB(A) and 8-bit palette PNGs for now. + || compressionMethod || interlaceMethod + || dataIn.size() < (bitsPerPixel * width * height) / 8 + height) // Enough data present? + { + return nullptr; + } + + CBitmap *bitmap = new CBitmap; + if(!bitmap->CreateBitmap(width, height, 1, 32, nullptr)) + { + delete bitmap; + return nullptr; + } + + const uint32_t imageSize = width * height * sizeof(RGBQUAD); + std::vector<RGBQUAD> dataOut(width * height); + bitmap->GetBitmapBits(imageSize, &dataOut[0]); + + FileReader imageData(&dataIn[0], dataIn.size()); + + RGBQUAD *pixelOut = &dataOut[0]; + uint32_t x = 0, y = 0; + size_t offset = 0; + while(y < height) + { + if(x == 0) + { + filterMethod = dataIn[offset++]; + ASSERT(!filterMethod); + } + + if(colorType == 6) + { + // RGBA + struct PNGPixel32 + { + uint8_t r, g, b, a; + }; + + const PNGPixel32 &inPixel = reinterpret_cast<const PNGPixel32 &>(dataIn[offset]); + pixelOut->rgbRed = inPixel.r; + pixelOut->rgbGreen = inPixel.g; + pixelOut->rgbBlue = inPixel.b; + pixelOut->rgbReserved= inPixel.a; + offset += 4; + } else if(colorType == 2) + { + // RGB + struct PNGPixel24 + { + uint8_t r, g, b; + }; + + const PNGPixel24 &inPixel = reinterpret_cast<const PNGPixel24 &>(dataIn[offset]); + pixelOut->rgbRed = inPixel.r; + pixelOut->rgbGreen = inPixel.g; + pixelOut->rgbBlue = inPixel.b; + pixelOut->rgbReserved= 255; + offset += 3; + } else if(colorType == 3) + { + // Palette + *pixelOut = palette[dataIn[offset++]]; + } + pixelOut++; + x++; + + if(x == width) + { + y++; + x = 0; + } + } + + bitmap->SetBitmapBits(imageSize, &dataOut[0]); + return bitmap; +} + + +CBitmap *ReadPNG(const TCHAR *resource) +//------------------------------------- +{ + const char *pData = nullptr; + HGLOBAL hglob = nullptr; + size_t nSize = 0; + if(LoadResource(resource, TEXT("PNG"), pData, nSize, hglob) == nullptr) + { + return nullptr; + } + + FileReader file(pData, nSize); + + CBitmap *bitmap = ReadPNG(file); + + FreeResource(hglob); + return bitmap; +} Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -130,7 +130,9 @@ m_dwNotifyPos[i] = (uint32)Notification::PosInvalid; } MemsetZero(m_NcButtonState); - m_bmpEnvBar.Create(IDB_ENVTOOLBAR, 20, 0, RGB(192,192,192)); + + m_bmpEnvBar.Create(IDB_ENVTOOLBAR, 20, 18, ENVIMG_NUMIMAGES, 1); + m_baPlayingNote.reset(); //rewbs.envRowGrid m_bGrid=true; @@ -808,11 +810,11 @@ // create a memory based dc for drawing the grid m_dcGrid.CreateCompatibleDC(pDC); - m_bmpGrid.CreateCompatibleBitmap(pDC, m_rcClient.right-m_rcClient.left, m_rcClient.bottom-m_rcClient.top); + m_bmpGrid.CreateCompatibleBitmap(pDC, m_rcClient.Width(), m_rcClient.Height()); m_pbmpOldGrid = m_dcGrid.SelectObject(&m_bmpGrid); //do draw - int width = m_rcClient.right - m_rcClient.left; + int width = m_rcClient.Width(); int nPrevTick = -1; int nTick, nRow; int nRowsPerBeat = 1, nRowsPerMeasure = 1; @@ -823,6 +825,9 @@ nRowsPerMeasure = modDoc->GetrSoundFile().m_nDefaultRowsPerMeasure; } + // Paint it black! + m_dcGrid.FillSolidRect(&m_rcClient, 0); + for (int x = 3; x < width; x++) { nTick = ScreenToTick(x); @@ -831,9 +836,9 @@ nPrevTick = nTick; nRow = nTick / speed; - if (nRow % MAX(1, nRowsPerMeasure) == 0) + if (nRow % std::max(1, nRowsPerMeasure) == 0) m_dcGrid.SelectObject(CMainFrame::penGray80); - else if (nRow % MAX(1, nRowsPerBeat) == 0) + else if (nRow % std::max(1, nRowsPerBeat) == 0) m_dcGrid.SelectObject(CMainFrame::penGray55); else m_dcGrid.SelectObject(CMainFrame::penGray33); @@ -883,10 +888,13 @@ if ((!pModDoc) || (!pDC)) return; //hdc = pDC->m_hDC; oldpen = m_dcMemMain.SelectObject(CMainFrame::penDarkGray); - m_dcMemMain.FillRect(&m_rcClient, CBrush::FromHandle(CMainFrame::brushBlack)); if (m_bGrid) { DrawGrid(&m_dcMemMain, pModDoc->GetrSoundFile().m_PlayState.m_nMusicSpeed); + } else + { + // Paint it black! + m_dcMemMain.FillSolidRect(&m_rcClient, 0); } // Middle line (half volume or pitch / panning center) Modified: trunk/OpenMPT/mptrack/View_ins.h =================================================================== --- trunk/OpenMPT/mptrack/View_ins.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/View_ins.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -23,7 +23,7 @@ //========================================== { protected: - CImageList m_bmpEnvBar; + CImageListEx m_bmpEnvBar; POINT m_ptMenu; CRect m_rcClient; Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -128,7 +128,9 @@ m_dwNotifyPos[i] = Notification::PosInvalid; } MemsetZero(m_NcButtonState); - m_bmpEnvBar.Create(IDB_SMPTOOLBAR, 20, 0, RGB(192,192,192)); + + m_bmpEnvBar.Create(IDB_SMPTOOLBAR, 20, 18, SAMPLEIMG_NUMIMAGES, 1); + m_lastDrawPoint.SetPoint(-1, -1); noteChannel.assign(NOTE_MAX - NOTE_MIN + 1, CHANNELINDEX_INVALID); offScreenDC = nullptr; @@ -1305,7 +1307,7 @@ { case ID_SAMPLE_ZOOMUP: nImage = SIMAGE_ZOOMUP; break; case ID_SAMPLE_ZOOMDOWN: nImage = SIMAGE_ZOOMDOWN; break; - case ID_SAMPLE_DRAW: nImage = (dwStyle & NCBTNS_DISABLED) ? SIMAGE_NODRAW : SIMAGE_DRAW; break; + case ID_SAMPLE_DRAW: nImage = SIMAGE_DRAW; break; case ID_SAMPLE_ADDSILENCE: nImage = SIMAGE_RESIZE; break; case ID_SAMPLE_GRID: nImage = SIMAGE_GRID; break; } Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/View_smp.h 2014-03-25 23:01:50 UTC (rev 3963) @@ -29,7 +29,7 @@ }; protected: - CImageList m_bmpEnvBar; + CImageListEx m_bmpEnvBar; CRect m_rcClient; HDC offScreenDC; HGDIOBJ offScreenBitmap; Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -482,7 +482,7 @@ HTREEITEM parent = GetChildItem(m_hMidiLib); for(UINT iMidi = 0; iMidi < 128; iMidi++) { - DWORD dwImage = IMAGE_NOINSTRUMENT; + DWORD dwImage = IMAGE_INSTRMUTE; s = StringifyW(iMidi) + L": " + mpt::ToWide(mpt::CharsetASCII, szMidiProgramNames[iMidi]); const LPARAM param = (MODITEM_MIDIINSTRUMENT << MIDILIB_SHIFT) | iMidi; if(!midiLib.MidiMap[iMidi].empty()) @@ -1661,25 +1661,22 @@ // Enumerating Drives... if(!IsSampleBrowser()) { + CImageListEx &images = *CMainFrame::GetMainFrame()->GetImageList(); + // Avoid adding the same images again and again... + images.SetImageCount(IMGLIST_NUMIMAGES); + WCHAR s[16]; wcscpy(s, L"?:\\"); for(UINT iDrive = 'A'; iDrive <= 'Z'; iDrive++) { s[0] = (WCHAR)iDrive; UINT nDriveType = GetDriveTypeW(s); - int nImage = 0; - switch(nDriveType) + if(nDriveType != DRIVE_UNKNOWN && nDriveType != DRIVE_NO_ROOT_DIR) { - case DRIVE_REMOVABLE: nImage = (iDrive < 'C') ? IMAGE_FLOPPYDRIVE : IMAGE_REMOVABLEDRIVE; break; - case DRIVE_FIXED: nImage = IMAGE_FIXEDDRIVE; break; - case DRIVE_REMOTE: nImage = IMAGE_NETWORKDRIVE; break; - case DRIVE_CDROM: nImage = IMAGE_CDROMDRIVE; break; - case DRIVE_RAMDISK: nImage = IMAGE_RAMDRIVE; break; + SHFILEINFOW fileInfo; + SHGetFileInfoW(s, 0, &fileInfo, sizeof(fileInfo), SHGFI_ICON | SHGFI_SMALLICON); + ModTreeInsert(s, images.Add(fileInfo.hIcon)); } - if(nImage) - { - ModTreeInsert(s, nImage); - } } } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-03-25 23:01:50 UTC (rev 3963) @@ -457,6 +457,18 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MODULETYPE ICON "res\\moddoc.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// PNG +// + +IDB_ENVTOOLBAR PNG "res\\envelope_toolbar.png" +IDB_IMAGELIST PNG "res\\icons.png" +IDB_MAINBAR PNG "res\\main_toolbar.png" +IDB_PATTERNS PNG "res\\pattern_toolbar.png" +IDB_SMPTOOLBAR PNG "res\\sample_toolbar.png" +IDB_SPLASHNOFOLDFIN PNG "res\\splashno.png" #endif // German (Germany) resources ///////////////////////////////////////////////////////////////////////////// @@ -1399,11 +1411,10 @@ LTEXT "In ""Relative"" base note mode, all notes are relative to a previously entered note in the pattern cell where the chord is entered.",IDC_STATIC,6,136,234,20 END -IDD_SPLASHSCREEN DIALOG 0, 0, 188, 95 -STYLE DS_SETFONT | DS_SETFOREGROUND | DS_CENTER | WS_POPUP -FONT 8, "MS Shell Dlg" +IDD_SPLASHSCREEN DIALOGEX 0, 0, 188, 95 +STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP +FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - CONTROL "",IDC_SPLASH,"Static",SS_WHITERECT,0,0,187,94 END IDD_TREEVIEW DIALOG 0, 0, 85, 266 @@ -1812,6 +1823,10 @@ BOTTOMMARGIN, 154 END + IDD_SPLASHSCREEN, DIALOG + BEGIN + END + IDD_MOD2MIDI, DIALOG BEGIN LEFTMARGIN, 4 @@ -1944,13 +1959,9 @@ // IDB_MPTRACK BITMAP "res\\mptrack.bmp" -IDB_IMAGELIST BITMAP "res\\img_list.bmp" -IDB_PATTERNS BITMAP "res\\patterns.bmp" IDB_PATTERNVIEW BITMAP "res\\view_pat.bmp" IDB_COLORSETUP BITMAP "res\\colors.bmp" IDB_VUMETERS BITMAP "res\\vumeters.bmp" -IDB_ENVTOOLBAR BITMAP "res\\envbar.bmp" -IDB_SMPTOOLBAR BITMAP "res\\smptoolb.bmp" IDB_VISNODE BITMAP "res\\bitmap1.bmp" IDB_VISPCNODE BITMAP "res\\vispcnode.bmp" @@ -2739,14 +2750,6 @@ ///////////////////////////////////////////////////////////////////////////// // -// Bitmap -// - -IDB_SPLASHNOFOLDFIN BITMAP "res\\splashno.bmp" -IDB_MAINBAR BITMAP "res\\MAINBAR.BMP" - -///////////////////////////////////////////////////////////////////////////// -// // Menu // Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2014-03-25 23:01:50 UTC (rev 3963) @@ -975,6 +975,10 @@ > </File> <File + RelativePath=".\PNG.cpp" + > + </File> + <File RelativePath=".\PSRatioCalc.cpp" > </File> @@ -1146,6 +1150,10 @@ > </File> <File + RelativePath=".\CImageListEx.h" + > + </File> + <File RelativePath=".\ctrl_com.h" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2014-03-25 23:01:50 UTC (rev 3963) @@ -562,6 +562,7 @@ <ClCompile Include="PatternClipboard.cpp" /> <ClCompile Include="PatternEditorDialogs.cpp" /> <ClCompile Include="PatternGotoDialog.cpp" /> + <ClCompile Include="PNG.cpp" /> <ClCompile Include="PSRatioCalc.cpp" /> <ClCompile Include="Reporting.cpp" /> <ClCompile Include="SampleEditorDialogs.cpp" /> @@ -725,6 +726,7 @@ <ClInclude Include="AutoSaver.h" /> <ClInclude Include="Autotune.h" /> <ClInclude Include="Childfrm.h" /> + <ClInclude Include="CImageListEx.h" /> <ClInclude Include="CleanupSong.h" /> <ClInclude Include="ColourEdit.h" /> <ClInclude Include="CommandSet.h" /> @@ -803,11 +805,15 @@ <ItemGroup> <None Include="..\soundlib\Tunings\built-inTunings.tc" /> <None Include="res\bitmap1.bmp" /> + <None Include="res\bmp00001.bmp" /> <None Include="res\colors.bmp" /> <None Include="res\dragging.cur" /> <None Include="Res\envbar.bmp" /> + <None Include="res\envelope_toolbar.png" /> + <None Include="res\icons.png" /> <None Include="res\img_list.bmp" /> <None Include="res\mainbar.bmp" /> + <None Include="res\main_toolbar.png" /> <None Include="res\moddoc.ico" /> <None Include="res\MPTRACK.bmp" /> <None Include="res\mptrack.ico" /> @@ -815,9 +821,12 @@ <None Include="Res\nodrag.cur" /> <None Include="res\nodrop.cur" /> <None Include="res\patterns.bmp" /> + <None Include="res\pattern_toolbar.png" /> <None Include="res\rt_manif.bin" /> + <None Include="res\sample_toolbar.png" /> <None Include="Res\smptoolb.bmp" /> <None Include="res\splashno.bmp" /> + <None Include="res\splashno.png" /> <None Include="res\view_pat.bmp" /> <None Include="res\visnode1.bmp" /> <None Include="res\vispcnode.bmp" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2014-03-25 23:01:50 UTC (rev 3963) @@ -511,6 +511,9 @@ <ClCompile Include="..\pluginBridge\BridgeWrapper.cpp"> <Filter>Source Files\pluginBridgeWrapper</Filter> </ClCompile> + <ClCompile Include="PNG.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\soundlib\Loaders.h"> @@ -1002,6 +1005,9 @@ <ClInclude Include="..\pluginBridge\BridgeWrapper.h"> <Filter>Header Files\pluginBridgeWrapper</Filter> </ClInclude> + <ClInclude Include="CImageListEx.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> @@ -1076,6 +1082,15 @@ <None Include="..\soundlib\Tunings\built-inTunings.tc"> <Filter>Resource Files</Filter> </None> + <None Include="res\bmp00001.bmp"> + <Filter>Resource Files</Filter> + </None> + <None Include="res\envelope_toolbar.png" /> + <None Include="res\icons.png" /> + <None Include="res\main_toolbar.png" /> + <None Include="res\pattern_toolbar.png" /> + <None Include="res\sample_toolbar.png" /> + <None Include="res\splashno.png" /> </ItemGroup> <ItemGroup> <Filter Include="Header Files"> Deleted: trunk/OpenMPT/mptrack/res/MAINBAR.BMP =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/res/envbar.bmp =================================================================== (Binary files differ) Added: trunk/OpenMPT/mptrack/res/envelope_toolbar.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/envelope_toolbar.png =================================================================== --- trunk/OpenMPT/mptrack/res/envelope_toolbar.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/envelope_toolbar.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/envelope_toolbar.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/icons.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/icons.png =================================================================== --- trunk/OpenMPT/mptrack/res/icons.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/icons.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/icons.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: trunk/OpenMPT/mptrack/res/img_list.bmp =================================================================== (Binary files differ) Added: trunk/OpenMPT/mptrack/res/main_toolbar.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/main_toolbar.png =================================================================== --- trunk/OpenMPT/mptrack/res/main_toolbar.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/main_toolbar.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/main_toolbar.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: trunk/OpenMPT/mptrack/res/modplthingmorecontrast.bmp =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals =================================================================== --- trunk/OpenMPT/mptrack/res/originals 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals ___________________________________________________________________ Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/NewDoc.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/envelope_toolbar.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/icons.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/icons.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/icons.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/icons.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/icons.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/main_toolbar.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/note.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/note.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/note.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/note.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/note.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/pattern_toolbar.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/originals/readme.txt =================================================================== --- trunk/OpenMPT/mptrack/res/originals/readme.txt (rev 0) +++ trunk/OpenMPT/mptrack/res/originals/readme.txt 2014-03-25 23:01:50 UTC (rev 3963) @@ -0,0 +1,3 @@ +These PFI files were made with PhotoFiltre (http://www.photofiltre.com/). +They contain all the icons as separate layers, some icons are also divided into several layers. +Export them to PNG to use them in OpenMPT. \ No newline at end of file Added: trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi =================================================================== --- trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/originals/sample_toolbar.pfi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/OpenMPT/mptrack/res/pattern_toolbar.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/pattern_toolbar.png =================================================================== --- trunk/OpenMPT/mptrack/res/pattern_toolbar.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/pattern_toolbar.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/pattern_toolbar.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: trunk/OpenMPT/mptrack/res/patterns.bmp =================================================================== (Binary files differ) Added: trunk/OpenMPT/mptrack/res/sample_toolbar.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/sample_toolbar.png =================================================================== --- trunk/OpenMPT/mptrack/res/sample_toolbar.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/sample_toolbar.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/sample_toolbar.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: trunk/OpenMPT/mptrack/res/smptoolb.bmp =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/res/splash.bmp =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/res/splash0.bmp =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/res/splash_new.bmp =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/res/splash_old.bmp =================================================================== (Binary files differ) Added: trunk/OpenMPT/mptrack/res/splashno.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/mptrack/res/splashno.png =================================================================== --- trunk/OpenMPT/mptrack/res/splashno.png 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/res/splashno.png 2014-03-25 23:01:50 UTC (rev 3963) Property changes on: trunk/OpenMPT/mptrack/res/splashno.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2014-03-24 20:03:07 UTC (rev 3962) +++ trunk/OpenMPT/mptrack/view_com.cpp 2014-03-25 23:01:50 UTC (rev 3963) @@ -147,12 +147,12 @@ } GetClientRect(&rect); m_ToolBar.Create(WS_CHILD|WS_VISIBLE|CCS_NOPARENTALIGN, rect, this, IDC_TOOLBAR_DETAILS); - m_ToolBar.Init(); + m_ToolBar.Init(IDB_IMAGELIST); m_ItemList.Create(WS_CHILD|WS_VISIBLE|LVS_REPORT|LVS_SINGLESEL|LVS_EDITLABELS|LVS_NOSORTHEADER, rect, this, IDC_LIST_DETAILS); m_ItemList.ModifyStyleEx(0, WS_EX_STATICEDGE); // Add ToolBar Buttons - m_ToolBar.AddButton(IDC_LIST_SAMPLES, TIMAGE_TAB_SAMPLES); - m_ToolBar.AddButton(IDC_LIST_INSTRUMENTS, TIMAGE_TAB_INSTRUMENTS); + m_ToolBar.AddButton(IDC_LIST_SAMPLES, IMAGE_SAMPLES); + m_ToolBar.AddButton(IDC_LIST_INSTRUMENTS, IMAGE_INSTRUMENTS); //m_ToolBar.AddButton(IDC_LIST_PATTERNS, TIMAGE_TAB_PATTERNS); m_ToolBar.SetIndent(4); UpdateButtonState(); @@ -194,7 +194,6 @@ //CHAR s[256], stmp[256]; CHAR s[512], stmp[256]; //rewbs.fix3082 CModDoc *pModDoc = GetDocument(); - CSoundFile *pSndFile; LV_COLUMN lvc; LV_ITEM lvi, lvi2; @@ -209,6 +208,11 @@ |HINT_INSNAMES|HINT_INSTRUMENT /*|HINT_PATNAMES|HINT_PATTERNROW*/); // pattern stuff currently unused if (!lHint) return; + + const CSoundFile &sndFile = pModDoc->GetrSoundFile(); + + m_ToolBar.ChangeBitmap(IDC_LIST_INSTRUMENTS, sndFile.GetNumInstruments() ? IMAGE_INSTRUMENTS : IMAGE_INSTRMUTE); + m_ItemList.SetRedraw(FALSE); // Add sample headers if ((m_nListId != m_nCurrentListId) || (lHint & HINT_MODTYPE)) @@ -253,25 +257,24 @@ } // Add Items UINT nCount = m_ItemList.GetItemCount(); - pSndFile = pModDoc->GetSoundFile(); // Add Samples if ((m_nCurrentListId == IDC_LIST_SAMPLES) && (lHint & (HINT_MODTYPE|HINT_SMPNAMES|HINT_SAMPLEINFO))) { SAMPLEINDEX nMax = static_cast<SAMPLEINDEX>(nCount); - if (nMax < pSndFile->GetNumSamples()) nMax = pSndFile->GetNumSamples(); + if (nMax < sndFile.GetNumSamples()) nMax = sndFile.GetNumSamples(); for (SAMPLEINDEX iSmp = 0; iSmp < nMax; iSmp++) { - if (iSmp < pSndFile->GetNumSamples()) + if (iSmp < sndFile.GetNumSamples()) { UINT nCol = 0; for (UINT iCol=0; iCol<SMPLIST_COLUMNS; iCol++) { - const ModSample &sample = pSndFile->GetSample(iSmp + 1); + const ModSample &sample = sndFile.GetSample(iSmp + 1); s[0] = 0; switch(iCol) { case SMPLIST_SAMPLENAME: - mpt::String::Copy(s, pSndFile->m_szNames[iSmp + 1]); + mpt::String::Copy(s, sndFile.m_szNames[iSmp + 1]); break; case SMPLIST_SAMPLENO: wsprintf(s, "%02d", iSmp + 1); @@ -292,12 +295,12 @@ } break; case SMPLIST_INSTR: - if (pSndFile->GetNumInstruments()) + if (sndFile.GetNumInstruments()) { bool first = true; - for (INSTRUMENTINDEX i = 1; i <= pSndFile->GetNumInstruments(); i++) + for (INSTRUMENTINDEX i = 1; i <= sndFile.GetNumInstruments(); i++) { - if (pSndFile->IsSampleReferencedByInstrument(iSmp + 1, i)) + if (sndFile.IsSampleReferencedByInstrument(iSmp + 1, i)) { if (!first) strcat(s, ","); first = false; @@ -317,7 +320,7 @@ case SMPLIST_MIDDLEC: if (sample.nLength) { - wsprintf(s, "%d Hz", sample.GetSampleRate(pSndFile->GetType())); + wsprintf(s, "%d Hz", sample.GetSampleRate(sndFile.GetType())); } break; case SMPLIST_FILENAME: @@ -358,15 +361,15 @@ if ((m_nCurrentListId == IDC_LIST_INSTRUMENTS) && (lHint & (HINT_MODTYPE|HINT_INSNAMES|HINT_INSTRUMENT))) { INSTRUMENTINDEX nMax = static_cast<INSTRUMENTINDEX>(nCount); - if (nMax < pSndFile->GetNumInstruments()) nMax = pSndFile->GetNumInstruments(); + if (nMax < sndFile.GetNumInstruments()) nMax = sndFile.GetNumInstruments(); for (INSTRUMENTINDEX iIns = 0; iIns < nMax; iIns++) { - if (iIns < pSndFile->GetNumInstruments()) + if (iIns < sndFile.GetNumInstruments()) { UINT nCol = 0; for (UINT iCol=0; iCol<INSLIST_COLUMNS; iCol++) { - ModInstrument *pIns = pSndFile->Instruments[iIns+1]; + ModInstrument *pIns = sndFile.Instruments[iIns+1]; s[0] = 0; switch(iCol) { @@ -414,9 +417,9 @@ } break; case INSLIST_PLUGIN: - if (pIns != nullptr && pIns->nMixPlug > 0 && pSndFile->m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin != nullptr) + if (pIns != nullptr && pIns->nMixPlug > 0 && sndFile.m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin !... [truncated message content] |
From: <sag...@us...> - 2014-03-25 23:26:11
|
Revision: 3964 http://sourceforge.net/p/modplug/code/3964 Author: saga-games Date: 2014-03-25 23:26:04 +0000 (Tue, 25 Mar 2014) Log Message: ----------- [Imp] Write plugin bitness to plugin cache [Fix] Small memory leak was introduced in previous commit. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-25 23:01:50 UTC (rev 3963) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-25 23:26:04 UTC (rev 3964) @@ -1589,6 +1589,7 @@ { gpSplashScreen = NULL; m_Bitmap->DeleteObject(); + delete m_Bitmap; } Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2014-03-25 23:01:50 UTC (rev 3963) +++ trunk/OpenMPT/mptrack/Vstplug.h 2014-03-25 23:26:04 UTC (rev 3964) @@ -65,7 +65,7 @@ bool isInstrument; bool useBridge, shareBridgeInstance; protected: - uint8 dllBits; + mutable uint8 dllBits; public: VSTPluginLib(const mpt::PathString &dllPath, const mpt::PathString &libraryName) @@ -79,15 +79,19 @@ } // Check whether a plugin can be hosted inside OpenMPT or requires bridging - uint8 GetDllBits(); - bool IsNative() { return GetDllBits() == sizeof(void *) * 8; } + uint8 GetDllBits(bool fromCache = true) const; + bool IsNative(bool fromCache = true) const { return GetDllBits(fromCache) == sizeof(void *) * 8; } void WriteToCache() const; uint32 EncodeCacheFlags() const { - // Format: 00000000.00000000.000000SB.CCCCCCCI - return (isInstrument ? 1 : 0) | (category << 1) | (useBridge ? 0x100 : 0) | (shareBridgeInstance ? 0x200 : 0); + // Format: 00000000.00000000.DDDDDDSB.CCCCCCCI + return (isInstrument ? 1 : 0) + | (category << 1) + | (useBridge ? 0x100 : 0) + | (shareBridgeInstance ? 0x200 : 0) + | (dllBits / 8) << 10; } void DecodeCacheFlags(uint32 flags) @@ -110,6 +114,7 @@ { shareBridgeInstance = true; } + dllBits = ((flags >> 10) & 0x3F) * 8; } }; Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-25 23:01:50 UTC (rev 3963) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2014-03-25 23:26:04 UTC (rev 3964) @@ -44,10 +44,10 @@ static const wchar_t *const cacheSectionW = L"PluginCache"; -uint8 VSTPluginLib::GetDllBits() -//------------------------------ +uint8 VSTPluginLib::GetDllBits(bool fromCache) const +//-------------------------------------------------- { - if(!dllBits) + if(!dllBits || !fromCache) { dllBits = static_cast<uint8>(BridgeWrapper::GetPluginBinaryType(dllPath)); } @@ -198,7 +198,7 @@ AEffect *effect = nullptr; library = nullptr; - const bool isNative = BridgeWrapper::IsPluginNative(pluginPath); + const bool isNative = plugin.IsNative(false); if(forceBridge || plugin.useBridge || !isNative) { try @@ -558,16 +558,10 @@ { validPlugin = true; - const bool oldIsInstrument = pFound->isInstrument; - const VSTPluginLib::PluginCategory oldCategory = pFound->category; - GetPluginInformation(pEffect, *pFound); - if(oldIsInstrument != pFound->isInstrument || oldCategory != pFound->category) - { - // Update cached information - pFound->WriteToCache(); - } + // Update cached information + pFound->WriteToCache(); CVstPlugin *pVstPlug = new (std::nothrow) CVstPlugin(hLibrary, *pFound, mixPlugin, *pEffect, sndFile); if(pVstPlug == nullptr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-26 12:06:53
|
Revision: 3966 http://sourceforge.net/p/modplug/code/3966 Author: manxorist Date: 2014-03-26 12:06:33 +0000 (Wed, 26 Mar 2014) Log Message: ----------- [Ref] Add mpt::windows::Version::IsWine() . [Ref] Cache windows version information globally in tracker builds (instead of potentially at every usage site). [Ref] Slightly modify mpt::Windws::Version interface. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.cpp trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/mptrack/CImageListEx.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp trunk/OpenMPT/sounddev/SoundDeviceThread.cpp trunk/OpenMPT/sounddev/SoundDeviceThread.h trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp Modified: trunk/OpenMPT/common/misc_util.cpp =================================================================== --- trunk/OpenMPT/common/misc_util.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/common/misc_util.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -614,6 +614,111 @@ } // namespace Util + + +#if defined(WIN32) + +namespace mpt +{ +namespace Windows +{ +namespace Version +{ + + +#if defined(MODPLUG_TRACKER) + + +static bool SystemIsNT = true; + +// Initialize to used SDK version +static uint32 SystemVersion = +#if NTDDI_VERSION >= 0x06030000 // NTDDI_WINBLUE + mpt::Windows::Version::Win81 +#elif NTDDI_VERSION >= 0x06020000 // NTDDI_WIN8 + mpt::Windows::Version::Win8 +#elif NTDDI_VERSION >= 0x06010000 // NTDDI_WIN7 + mpt::Windows::Version::Win7 +#elif NTDDI_VERSION >= 0x06000000 // NTDDI_VISTA + mpt::Windows::Version::WinVista +#elif NTDDI_VERSION >= NTDDI_WINXP + mpt::Windows::Version::WinXP +#elif NTDDI_VERSION >= NTDDI_WIN2K + mpt::Windows::Version::Win2000 +#else + mpt::Windows::Version::WinNT4 +#endif + ; + +static bool SystemIsWine = false; + + +void Init() +//--------- +{ + OSVERSIONINFOEXW versioninfoex; + MemsetZero(versioninfoex); + versioninfoex.dwOSVersionInfoSize = sizeof(versioninfoex); + GetVersionExW((LPOSVERSIONINFOW)&versioninfoex); + SystemIsNT = (versioninfoex.dwPlatformId == VER_PLATFORM_WIN32_NT); + SystemVersion = ((uint32)mpt::saturate_cast<uint8>(versioninfoex.dwMajorVersion) << 8) | ((uint32)mpt::saturate_cast<uint8>(versioninfoex.dwMinorVersion) << 0); + SystemIsWine = false; + HMODULE hNTDLL = LoadLibraryW(L"ntdll.dll"); + if(hNTDLL) + { + SystemIsWine = (GetProcAddress(hNTDLL, "wine_get_version") != NULL); + FreeLibrary(hNTDLL); + hNTDLL = NULL; + } +} + + +bool IsAtLeast(mpt::Windows::Version::Number version) +//--------------------------------------------------- +{ + return (SystemVersion >= (uint32)version); +} + + +bool IsNT() +//--------- +{ + return SystemIsNT; +} + + +bool IsWine() +//----------- +{ + return SystemIsWine; +} + + +#else // !MODPLUG_TRACKER + + +bool IsAtLeast(mpt::Windows::Version::Number version) +//--------------------------------------------------- +{ + OSVERSIONINFOEXW versioninfoex; + MemsetZero(versioninfoex); + versioninfoex.dwOSVersionInfoSize = sizeof(versioninfoex); + GetVersionExW((LPOSVERSIONINFOW)&versioninfoex); + uint32 SystemVersion = ((uint32)mpt::saturate_cast<uint8>(versioninfoex.dwMajorVersion) << 8) | ((uint32)mpt::saturate_cast<uint8>(versioninfoex.dwMinorVersion) << 0); + return (SystemVersion >= (uint32)version); +} + + +#endif // MODPLUG_TRACKER + + +} // namespace Version +} // namespace Windows +} // namespace mpt + +#endif // WIN32 + + #if defined(MPT_WITH_DYNBIND) @@ -671,10 +776,10 @@ // Check for KB2533623: bool hasKB2533623 = false; - if(mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWin8) + if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::Win8)) { hasKB2533623 = true; - } else if(mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista) + } else if(mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista)) { HMODULE hKernel32DLL = LoadLibraryW(L"kernel32.dll"); if(hKernel32DLL) Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/common/misc_util.h 2014-03-26 12:06:33 UTC (rev 3966) @@ -680,55 +680,61 @@ } // namespace Util -namespace mpt -{ #if defined(WIN32) +namespace mpt +{ namespace Windows { +namespace Version +{ -enum WinNTVersion + +enum Number { - VerWinNT4 = 0x0400, - VerWin98 = 0x040a, - VerWinME = 0x045a, - VerWin2000 = 0x0500, - VerWinXP = 0x0501, - VerWinXPSP2 = 0x0502, - VerWinVista = 0x0600, - VerWin7 = 0x0601, - VerWin8 = 0x0602, + + // Win9x + Win98 = 0x040a, + WinME = 0x045a, + + // WinNT + WinNT4 = 0x0400, + Win2000 = 0x0500, + WinXP = 0x0501, + WinVista = 0x0600, + Win7 = 0x0601, + Win8 = 0x0602, + Win81 = 0x0603, + }; -// returns version in the form of the _WIN32_WINNT_* macros or mpt::Windows::WinNTVersion -static inline uint32 GetWinNTVersion() -//------------------------------------ -{ - OSVERSIONINFO versioninfo; - MemsetZero(versioninfo); - versioninfo.dwOSVersionInfoSize = sizeof(versioninfo); - GetVersionEx(&versioninfo); - return ((uint32)mpt::saturate_cast<uint8>(versioninfo.dwMajorVersion) << 8) | (uint32)mpt::saturate_cast<uint8>(versioninfo.dwMinorVersion); -} -static inline bool IsWinNT() -//-------------------------- -{ - OSVERSIONINFO versioninfo; - MemsetZero(versioninfo); - versioninfo.dwOSVersionInfoSize = sizeof(versioninfo); - GetVersionEx(&versioninfo); - return (versioninfo.dwPlatformId == VER_PLATFORM_WIN32_NT); -} +#if defined(MODPLUG_TRACKER) +// Initializes version information. +// Version information is cached in order to be safely available in audio real-time contexts. +// Checking version information (especially detecting Wine) can be slow. +void Init(); + +bool IsAtLeast(mpt::Windows::Version::Number version); +bool IsNT(); +bool IsWine(); + +#else // !MODPLUG_TRACKER + +bool IsAtLeast(mpt::Windows::Version::Number version); + +#endif // MODPLUG_TRACKER + + +} // namespace Version } // namespace Windows +} // namespace mpt #endif // WIN32 -} // namespace mpt - #if defined(MPT_WITH_DYNBIND) namespace mpt Modified: trunk/OpenMPT/mptrack/CImageListEx.h =================================================================== --- trunk/OpenMPT/mptrack/CImageListEx.h 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/mptrack/CImageListEx.h 2014-03-26 12:06:33 UTC (rev 3966) @@ -23,7 +23,7 @@ #ifdef _M_IX86 // This is only relevant for Win9x (testing for supported SDK version won't work here because we only support Win9x through KernelEx). // Win9x only supports 1-bit transparency, so we pre-multiply all pixels with the default button face colour and create a transparency mask. - if(!mpt::Windows::IsWinNT()) + if(!mpt::Windows::Version::IsNT()) { BITMAP bm; bitmap->GetBitmap(&bm); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -848,6 +848,8 @@ // Start loading BeginWaitCursor(); + mpt::Windows::Version::Init(); + Log("OpenMPT Start"); ASSERT(nullptr == m_pDocManager); Modified: trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -248,7 +248,7 @@ } m_dwWritePos = 0xFFFFFFFF; SetWakeupInterval(std::min(m_Settings.UpdateIntervalMS / 1000.0, m_nDSoundBufferSize / (2.0 * m_Settings.GetBytesPerSecond()))); - m_Flags.NeedsClippedFloat = (mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista); + m_Flags.NeedsClippedFloat = mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista); SoundBufferAttributes bufferAttributes; bufferAttributes.Latency = m_nDSoundBufferSize * 1.0 / m_Settings.GetBytesPerSecond(); bufferAttributes.UpdateInterval = std::min(m_Settings.UpdateIntervalMS / 1000.0, m_nDSoundBufferSize / (2.0 * m_Settings.GetBytesPerSecond())); Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -103,10 +103,10 @@ framesPerBuffer = paFramesPerBufferUnspecified; // let portaudio choose } else if(m_HostApi == Pa_HostApiTypeIdToHostApiIndex(paMME)) { - m_Flags.NeedsClippedFloat = (mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista); + m_Flags.NeedsClippedFloat = mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista); } else if(m_HostApi == Pa_HostApiTypeIdToHostApiIndex(paDirectSound)) { - m_Flags.NeedsClippedFloat = (mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista); + m_Flags.NeedsClippedFloat = mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista); } else { m_Flags.NeedsClippedFloat = false; Modified: trunk/OpenMPT/sounddev/SoundDeviceThread.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceThread.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/sounddev/SoundDeviceThread.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -26,8 +26,6 @@ //------------------------------------------------------------------------------------------ { - m_HasNTKernel = mpt::Windows::IsWinNT(); - m_WakeupInterval = 0.0; m_hPlayThread = NULL; m_dwPlayThreadId = 0; @@ -81,7 +79,7 @@ , hTask(NULL) { - m_HasVista = (mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista); + m_HasVista = mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista); if(m_HasVista) { @@ -175,7 +173,7 @@ sleepEvent = NULL; - if(self.m_HasNTKernel) + if(mpt::Windows::Version::IsNT()) { if(periodic_nt_timer) { @@ -211,7 +209,7 @@ void Retrigger() //-------------- { - if(self.m_HasNTKernel) + if(mpt::Windows::Version::IsNT()) { if(!periodic_nt_timer) { @@ -228,7 +226,7 @@ CPeriodicWaker::~CPeriodicWaker() //------------------------------- { - if(self.m_HasNTKernel) + if(mpt::Windows::Version::IsNT()) { if(periodic_nt_timer) { Modified: trunk/OpenMPT/sounddev/SoundDeviceThread.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceThread.h 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/sounddev/SoundDeviceThread.h 2014-03-26 12:06:33 UTC (rev 3966) @@ -44,8 +44,6 @@ private: CSoundDeviceWithThread & m_SoundDevice; - bool m_HasNTKernel; - double m_WakeupInterval; HANDLE m_hAudioWakeUp; HANDLE m_hPlayThread; Modified: trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp 2014-03-26 01:38:45 UTC (rev 3965) +++ trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp 2014-03-26 12:06:33 UTC (rev 3966) @@ -108,7 +108,7 @@ m_nWriteBuffer = 0; SetWakeupEvent(m_ThreadWakeupEvent); SetWakeupInterval(m_nWaveBufferSize * 1.0 / m_Settings.GetBytesPerSecond()); - m_Flags.NeedsClippedFloat = (mpt::Windows::GetWinNTVersion() >= mpt::Windows::VerWinVista); + m_Flags.NeedsClippedFloat = mpt::Windows::Version::IsAtLeast(mpt::Windows::Version::WinVista); SoundBufferAttributes bufferAttributes; bufferAttributes.Latency = m_nWaveBufferSize * m_nPreparedHeaders * 1.0 / m_Settings.GetBytesPerSecond(); bufferAttributes.UpdateInterval = m_nWaveBufferSize * 1.0 / m_Settings.GetBytesPerSecond(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-28 16:03:47
|
Revision: 3987 http://sourceforge.net/p/modplug/code/3987 Author: manxorist Date: 2014-03-28 16:03:39 +0000 (Fri, 28 Mar 2014) Log Message: ----------- [Fix] Repair logic when to save comrpessed IT samples (broken since r3757 ). Revision Links: -------------- http://sourceforge.net/p/modplug/code/3757 Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-28 14:28:45 UTC (rev 3986) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-28 16:03:39 UTC (rev 3987) @@ -158,8 +158,8 @@ , defaultModType(conf, "Misc", "DefaultModType", MOD_TYPE_IT) , DefaultPlugVolumeHandling(conf, "Misc", "DefaultPlugVolumeHandling", PLUGIN_VOLUMEHANDLING_IGNORE) , autoApplySmoothFT2Ramping(conf, "Misc", "SmoothFT2Ramping", false) - , MiscITCompressionStereo(conf, "Misc", "ITCompressionStereo", false) - , MiscITCompressionMono(conf, "Misc", "ITCompressionMono", false) + , MiscITCompressionStereo(conf, "Misc", "ITCompressionStereo", 0) + , MiscITCompressionMono(conf, "Misc", "ITCompressionMono", 0) // Sound Settings , m_SoundSampleRates(conf, "Sound Settings", "SampleRates", GetDefaultSampleRates()) , m_MorePortaudio(conf, "Sound Settings", "MorePortaudio", false) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-03-28 14:28:45 UTC (rev 3986) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-03-28 16:03:39 UTC (rev 3987) @@ -358,8 +358,8 @@ Setting<MODTYPE> defaultModType; Setting<PLUGVOLUMEHANDLING> DefaultPlugVolumeHandling; Setting<bool> autoApplySmoothFT2Ramping; - Setting<bool> MiscITCompressionStereo; - Setting<bool> MiscITCompressionMono; + Setting<uint32> MiscITCompressionStereo; // Mask: bit0: IT, bit1: Compat IT, bit2: MPTM + Setting<uint32> MiscITCompressionMono; // Mask: bit0: IT, bit1: Compat IT, bit2: MPTM // Sound Settings Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-28 14:28:45 UTC (rev 3986) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-28 16:03:39 UTC (rev 3987) @@ -1564,7 +1564,7 @@ #ifdef MODPLUG_TRACKER int type = GetType() == MOD_TYPE_IT ? 1 : 4; if(compatibilityExport) type = 2; - bool compress = (Samples[nsmp].GetNumChannels() > 1) ? TrackerSettings::Instance().MiscITCompressionStereo : TrackerSettings::Instance().MiscITCompressionMono; + bool compress = ((((Samples[nsmp].GetNumChannels() > 1) ? TrackerSettings::Instance().MiscITCompressionStereo : TrackerSettings::Instance().MiscITCompressionMono) & type) != 0); #else bool compress = false; #endif // MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-03-28 18:09:01
|
Revision: 3989 http://sourceforge.net/p/modplug/code/3989 Author: manxorist Date: 2014-03-28 18:08:52 +0000 (Fri, 28 Mar 2014) Log Message: ----------- [Ref] Move reverb declarations where they belong. [Ref] Replace __int64 with int64. Modified Paths: -------------- trunk/OpenMPT/sounddsp/Reverb.cpp trunk/OpenMPT/sounddsp/Reverb.h trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/sounddsp/Reverb.cpp =================================================================== --- trunk/OpenMPT/sounddsp/Reverb.cpp 2014-03-28 18:07:52 UTC (rev 3988) +++ trunk/OpenMPT/sounddsp/Reverb.cpp 2014-03-28 18:08:52 UTC (rev 3989) @@ -624,8 +624,8 @@ void CReverb::MMX_ReverbProcessPostFiltering1x(const int *pRvb, int *pDry, uint32 nSamples) //----------------------------------------------------------------------------------------- { - __int64 nDCRRvb_X1 = gnDCRRvb_X1; - __int64 nDCRRvb_Y1 = gnDCRRvb_Y1; + int64 nDCRRvb_X1 = gnDCRRvb_X1; + int64 nDCRRvb_Y1 = gnDCRRvb_Y1; _asm { movq mm4, nDCRRvb_Y1 // mm4 = [ y1r | y1l ] movq mm1, nDCRRvb_X1 // mm5 = [ x1r | x1l ] @@ -662,8 +662,8 @@ void CReverb::MMX_ReverbDCRemoval(int *pBuffer, uint32 nSamples) //-------------------------------------------------------------- { - __int64 nDCRRvb_X1 = gnDCRRvb_X1; - __int64 nDCRRvb_Y1 = gnDCRRvb_Y1; + int64 nDCRRvb_X1 = gnDCRRvb_X1; + int64 nDCRRvb_Y1 = gnDCRRvb_Y1; _asm { movq mm4, nDCRRvb_Y1 // mm4 = [ y1r | y1l ] movq mm1, nDCRRvb_X1 // mm5 = [ x1r | x1l ] Modified: trunk/OpenMPT/sounddsp/Reverb.h =================================================================== --- trunk/OpenMPT/sounddsp/Reverb.h 2014-03-28 18:07:52 UTC (rev 3988) +++ trunk/OpenMPT/sounddsp/Reverb.h 2014-03-28 18:08:52 UTC (rev 3989) @@ -13,6 +13,13 @@ #ifndef NO_REVERB #include "../soundlib/Mixer.h" // For MIXBUFFERSIZE +//////////////////////////////////////////////////////////////////////// +// Reverberation + +#define NUM_REVERBTYPES 29 + +const char *GetReverbPresetName(UINT nPreset); + ///////////////////////////////////////////////////////////////////////////// // // SW Reverb structures @@ -148,8 +155,8 @@ int g_nLastRvbIn_yr; int g_nLastRvbOut_xl; int g_nLastRvbOut_xr; - __int64 gnDCRRvb_Y1; - __int64 gnDCRRvb_X1; + int64 gnDCRRvb_Y1; + int64 gnDCRRvb_X1; // Reverb mix buffers SWRVBREFDELAY g_RefDelay; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2014-03-28 18:07:52 UTC (rev 3988) +++ trunk/OpenMPT/soundlib/Sndfile.h 2014-03-28 18:08:52 UTC (rev 3989) @@ -69,17 +69,6 @@ bool UnpackPP20(std::vector<char> &unpackedData, FileReader &file); bool UnpackMMCMP(std::vector<char> &unpackedData, FileReader &file); -//////////////////////////////////////////////////////////////////////// -// Reverberation - -#ifndef NO_REVERB - -#define NUM_REVERBTYPES 29 - -const char *GetReverbPresetName(UINT nPreset); - -#endif - typedef void (* LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); // buffer, samples, channels #include "pattern.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-29 17:09:10
|
Revision: 3995 http://sourceforge.net/p/modplug/code/3995 Author: saga-games Date: 2014-03-29 17:09:01 +0000 (Sat, 29 Mar 2014) Log Message: ----------- [Fix] Sample editor config: Changing undo buffer size didn't mark the page as modified. [Mod] Adjusted the size of the rest of the option tabs, and also fixed the tab order and mnemonics on some of them. [Mod] More small changes. Modified Paths: -------------- trunk/OpenMPT/common/version.cpp trunk/OpenMPT/mptrack/AboutDialog.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Moptions.h trunk/OpenMPT/mptrack/PNG.cpp trunk/OpenMPT/mptrack/PNG.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/common/version.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -323,7 +323,7 @@ "\n" "Additional patch submitters:\n" "coda (http://coda.s3m.us/)\n" - "kode54 (http://kode54.foobar2000.org/)\n" + "kode54 (https://kode54.net/)\n" "xaimus (http://xaimus.com/)\n" "\n" "Thanks to:\n" @@ -389,7 +389,7 @@ "The people at ModPlug forums for crucial contribution\n" "in the form of ideas, testing and support; thanks\n" "particularly to:\n" - "33, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn\n" + "33, 8bitbubsy, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn\n" "christofori, Diamond, Ganja, Georg, Goor00, jmkz,\n" "KrazyKatz, LPChip, Nofold, Rakib, Sam Zen\n" "Skaven, Skilletaudio, Snu, Squirrel Havoc, Waxhead\n" Modified: trunk/OpenMPT/mptrack/AboutDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/AboutDialog.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/AboutDialog.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "Mptrack.h" +#include "resource.h" #include "AboutDialog.h" #include "PNG.h" #include "../common/version.h" Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -724,7 +724,7 @@ CPropertyPage::OnInitDialog(); SetDlgItemInt(IDC_EDIT_FINETUNE, TrackerSettings::Instance().m_nFinetuneStep); SetDlgItemInt(IDC_EDIT_UNDOSIZE, TrackerSettings::Instance().m_SampleUndoBufferSize.Get().GetSizeInPercent()); - OnUndoSizeChanged(); + RecalcUndoSize(); m_cbnDefaultSampleFormat.SetItemData(m_cbnDefaultSampleFormat.AddString("FLAC"), dfFLAC); m_cbnDefaultSampleFormat.SetItemData(m_cbnDefaultSampleFormat.AddString("WAV"), dfWAV); @@ -786,6 +786,14 @@ void COptionsSampleEditor::OnUndoSizeChanged() //-------------------------------------------- { + RecalcUndoSize(); + OnSettingsChanged(); +} + + +void COptionsSampleEditor::RecalcUndoSize() +//----------------------------------------- +{ uint32 sizeMB = mpt::saturate_cast<uint32>(SampleUndoBufferSize(GetDlgItemInt(IDC_EDIT_UNDOSIZE)).GetSizeInBytes() >> 20); CString text; text.Format("%% of physical memory (%u MiB)", sizeMB); Modified: trunk/OpenMPT/mptrack/Moptions.h =================================================================== --- trunk/OpenMPT/mptrack/Moptions.h 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/Moptions.h 2014-03-29 17:09:01 UTC (rev 3995) @@ -147,6 +147,8 @@ virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnSetActive(); + void RecalcUndoSize(); + afx_msg void OnHScroll(UINT /*nSBCode*/, UINT /*nPos*/, CScrollBar* /*pScrollBar*/) { OnSettingsChanged(); } afx_msg void OnSettingsChanged() { SetModified(TRUE); } afx_msg void OnUndoSizeChanged(); Modified: trunk/OpenMPT/mptrack/PNG.cpp =================================================================== --- trunk/OpenMPT/mptrack/PNG.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/PNG.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -88,8 +88,9 @@ size_t numEntries = std::min<size_t>(256u, chunk.GetLength() / 3u); for(size_t i = 0; i < numEntries; i++) { - uint8_t r = chunk.ReadUint8(), g = chunk.ReadUint8(), b = chunk.ReadUint8(); - palette[i] = Pixel(r, g, b, 255); + uint8_t p[3]; + chunk.ReadArray(p); + palette[i] = Pixel(p[0], p[1], p[2], 255); } } } Modified: trunk/OpenMPT/mptrack/PNG.h =================================================================== --- trunk/OpenMPT/mptrack/PNG.h 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/PNG.h 2014-03-29 17:09:01 UTC (rev 3995) @@ -23,12 +23,13 @@ struct Bitmap { const uint32_t width, height; - std::vector<Pixel> pixels; + Pixel *pixels; - Bitmap(uint32_t width, uint32_t height) : width(width), height(height), pixels(width * height) { } + Bitmap(uint32_t width, uint32_t height) : width(width), height(height), pixels(new Pixel[width * height]) { } + ~Bitmap() { delete[] pixels; } - Pixel *GetPixels() { ASSERT(!pixels.empty()); return &pixels[0]; } - const Pixel *GetPixels() const { ASSERT(!pixels.empty()); return &pixels[0]; } + Pixel *GetPixels() { ASSERT(width && height && pixels); return pixels; } + const Pixel *GetPixels() const { ASSERT(width && height && pixels); return pixels; } uint32_t GetNumPixels() const { return width * height; } // Create a DIB for the current device from our PNG. Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-03-29 17:09:01 UTC (rev 3995) @@ -130,10 +130,10 @@ CAPTION "Samples" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - GROUPBOX "Sample Editor",IDC_STATIC,6,6,270,138 + GROUPBOX "Sample Editor",IDC_STATIC,6,6,276,138 LTEXT "Sample Undo Buffer:",IDC_STATIC,12,20,78,8 EDITTEXT IDC_EDIT_UNDOSIZE,114,18,42,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "%",IDC_UNDOSIZE,162,20,108,16 + LTEXT "%",IDC_UNDOSIZE,162,20,114,16 LTEXT "Frequency Finetune Steps:",IDC_STATIC,12,38,114,8 EDITTEXT IDC_EDIT_FINETUNE,114,36,42,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Hz",IDC_STATIC,162,38,30,8 @@ -143,19 +143,19 @@ LTEXT "Faster Encoding",IDC_STATIC,114,74,52,8 CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOOLTIPS | WS_TABSTOP,168,72,48,12 LTEXT "Smaller Files",IDC_STATIC,222,74,40,8 - LTEXT "Note Cuts:",IDC_STATIC,12,90,252,12 - CONTROL "On New Note",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,18,102,246,12 - CONTROL "On Key Release",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,18,114,246,12 - CONTROL "Press Again",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,18,126,246,12 - GROUPBOX "Instrument Editor",IDC_STATIC,6,150,270,48 - CONTROL "Compress ITI Files",IDC_COMPRESS_ITI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,162,258,12 + LTEXT "Note Cuts:",IDC_STATIC,12,90,264,12 + CONTROL "On New Note",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,18,102,258,12 + CONTROL "On Key Release",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,18,114,258,12 + CONTROL "Press Again",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,18,126,258,12 + GROUPBOX "Instrument Editor",IDC_STATIC,6,150,276,48 + CONTROL "Compress ITI Files",IDC_COMPRESS_ITI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,162,264,12 LTEXT "Default Plugin Volume Command Handling:",IDC_STATIC,12,182,150,8 COMBOBOX IDC_VOLUME_HANDLING,162,180,78,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Common",IDC_STATIC,6,204,270,48 + GROUPBOX "Common",IDC_STATIC,6,204,276,48 CONTROL "Preview Samples / Instruments in File Browser",IDC_PREVIEW_SAMPLES, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,217,258,12 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,217,264,12 CONTROL "Normalize 24-/32-bit Samples on Load",IDC_NORMALIZE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,234,258,12 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,234,264,12 END IDD_EDITHISTORY DIALOGEX 0, 0, 316, 185 @@ -195,27 +195,27 @@ LTEXT "Samples used for fading:",IDC_STATIC,6,8,96,8 END -IDD_OPTIONS_UPDATE DIALOGEX 0, 0, 274, 281 +IDD_OPTIONS_UPDATE DIALOGEX 0, 0, 286, 281 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Update" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - GROUPBOX "Check for Updates",IDC_STATIC,6,6,258,66 - CONTROL "Never",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,12,18,240,8 - CONTROL "Daily",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,12,30,240,8 - CONTROL "Weekly (recommended)",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,12,42,240,8 - CONTROL "Monthly",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,12,54,240,8 - GROUPBOX "Privacy Settings",IDC_STATIC,6,78,258,54 - CONTROL "Allow us to collect basic update statistics",IDC_CHECK1, + GROUPBOX "Check for Updates",IDC_STATIC,6,6,276,66 + CONTROL "&Never",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,12,18,240,8 + CONTROL "&Daily",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,12,30,240,8 + CONTROL "&Weekly (recommended)",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,12,42,240,8 + CONTROL "&Monthly",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,12,54,240,8 + GROUPBOX "Privacy Settings",IDC_STATIC,6,78,276,54 + CONTROL "&Allow us to collect basic update statistics",IDC_CHECK1, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,90,246,12 - LTEXT "If enabled, a randomized user ID is created and transmitted with every update check. This ID can not be linked to you or your computer in any way.",IDC_STATIC,12,102,246,24 - GROUPBOX "Advanced Settings",IDC_STATIC,6,138,258,60 - LTEXT "Update server URL:",IDC_STATIC,12,150,186,8 + LTEXT "If enabled, a randomized user ID is created and transmitted with every update check. This ID can not be linked to you or your computer in any way.",IDC_STATIC,12,102,264,24 + GROUPBOX "Advanced Settings",IDC_STATIC,6,138,276,60 + LTEXT "&Update server URL:",IDC_STATIC,12,150,186,8 EDITTEXT IDC_EDIT1,12,162,246,12,ES_AUTOHSCROLL - PUSHBUTTON "Reset",IDC_BUTTON2,204,146,54,12 + PUSHBUTTON "&Reset",IDC_BUTTON2,204,146,54,12 LTEXT "Do not change this unless you are absolutely sure of what you are doing.",IDC_STATIC,12,180,246,12 - PUSHBUTTON "Check for Updates",IDC_BUTTON1,6,204,84,18 - LTEXT "",IDC_LASTUPDATE,6,228,258,24 + PUSHBUTTON "&Check for Updates",IDC_BUTTON1,6,204,84,18 + LTEXT "",IDC_LASTUPDATE,6,228,276,24 END IDD_CLOSEDOCUMENTS DIALOGEX 0, 0, 370, 197 @@ -297,7 +297,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "Warning:\nChanging advanced settings might cause stability problems.\nYou should only continue if you know what you are doing.",IDC_STATIC,6,6,258,24 - LTEXT "Find:",IDC_STATIC,6,38,17,8 + LTEXT "&Find:",IDC_STATIC,6,38,17,8 EDITTEXT IDC_EDIT1,30,36,252,12,ES_AUTOHSCROLL LISTBOX IDC_LIST4,6,54,276,222,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END @@ -387,7 +387,7 @@ IDD_OPTIONS_UPDATE, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 267 + RIGHTMARGIN, 279 TOPMARGIN, 7 BOTTOMMARGIN, 274 END @@ -624,87 +624,87 @@ CTEXT "Writing file...",IDC_TEXT1,4,4,178,9 END -IDD_OPTIONS_KEYBOARD DIALOGEX 0, 0, 274, 281 +IDD_OPTIONS_KEYBOARD DIALOGEX 0, 0, 286, 282 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Keyboard" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "Select category:",IDC_STATIC,7,5,131,11 - COMBOBOX IDC_KEYCATEGORY,5,16,133,204,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LISTBOX IDC_COMMAND_LIST,5,32,133,226,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CHOICECOMBO,150,18,72,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_KEYCATEGORY,5,16,139,204,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_COMMAND_LIST,5,32,139,226,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Key setup for this command ",IDC_STATIC,150,6,132,84 + COMBOBOX IDC_CHOICECOMBO,156,18,78,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Key:",IDC_STATIC,150,38,16,8 - EDITTEXT IDC_CUSTHOTKEY,168,36,54,13,ES_AUTOHSCROLL - CONTROL "On Key Down",IDC_CHECKKEYDOWN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,54,66,8 - CONTROL "On Key Hold",IDC_CHECKKEYHOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,66,66,8 - CONTROL "On Key Up",IDC_CHECKKEYUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,150,78,66,8 - PUSHBUTTON "Restore",IDC_RESTORE,228,36,37,13 - PUSHBUTTON "Set",IDC_SET,228,30,36,13,NOT WS_VISIBLE - PUSHBUTTON "Delete",IDC_DELETE,228,18,37,13 - LTEXT "Repeat notes on hold?",IDC_STATIC,150,108,74,8 - PUSHBUTTON "Yes",IDC_NOTESREPEAT,228,108,18,9 - PUSHBUTTON "No",IDC_NONOTESREPEAT,246,108,18,9 - LTEXT "Chord detect interval (ms):",IDC_STATIC,150,122,88,8 - EDITTEXT IDC_CHORDDETECTWAITTIME,240,120,24,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - PUSHBUTTON "Import Keys...",IDC_LOAD,150,156,54,13 - PUSHBUTTON "Export Keys...",IDC_SAVE,210,156,54,13 - LTEXT "Error Log:",IDC_STATIC,144,198,78,8 - PUSHBUTTON "Clear Log",IDC_CLEARLOG,228,196,42,12 - EDITTEXT IDC_KEYREPORT,144,210,126,66,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL - GROUPBOX "Key setup for this command ",IDC_STATIC,144,6,126,84 - GROUPBOX "Misc",IDC_STATIC,144,96,126,40 - GROUPBOX "Multi Config Handling",IDC_STATIC,144,144,126,48 + EDITTEXT IDC_CUSTHOTKEY,174,36,60,13,ES_AUTOHSCROLL + CONTROL "On Key Down",IDC_CHECKKEYDOWN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,54,66,8 + CONTROL "On Key Hold",IDC_CHECKKEYHOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,66,66,8 + CONTROL "On Key Up",IDC_CHECKKEYUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,78,66,8 + PUSHBUTTON "Restore",IDC_RESTORE,240,36,37,13 + PUSHBUTTON "Set",IDC_SET,240,30,36,13,NOT WS_VISIBLE + PUSHBUTTON "Delete",IDC_DELETE,240,18,37,13 + GROUPBOX "Misc",IDC_STATIC,150,96,132,40 + LTEXT "Repeat notes on hold?",IDC_STATIC,156,108,74,8 + PUSHBUTTON "Yes",IDC_NOTESREPEAT,240,108,18,9 + PUSHBUTTON "No",IDC_NONOTESREPEAT,258,108,18,9 + LTEXT "Chord detect interval (ms):",IDC_STATIC,156,122,88,8 + EDITTEXT IDC_CHORDDETECTWAITTIME,246,120,30,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + GROUPBOX "Multi Config Handling",IDC_STATIC,150,144,132,48 + PUSHBUTTON "Import Keys...",IDC_LOAD,156,156,54,13 + PUSHBUTTON "Export Keys...",IDC_SAVE,222,156,54,13 + PUSHBUTTON "Restore default configuration",IDC_RESTORE_KEYMAP,156,174,120,12 + LTEXT "Error Log:",IDC_STATIC,150,198,78,8 + PUSHBUTTON "Clear Log",IDC_CLEARLOG,239,196,42,12 + EDITTEXT IDC_KEYREPORT,150,210,132,66,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL PUSHBUTTON "it",IDC_EFFECTLETTERSIT,103,223,12,9,NOT WS_VISIBLE PUSHBUTTON "xm",IDC_EFFECTLETTERSXM,119,223,12,9,NOT WS_VISIBLE LTEXT "Effect letters like:",IDC_STATIC,11,225,73,11,NOT WS_VISIBLE - PUSHBUTTON "Restore default configuration",IDC_RESTORE_KEYMAP,150,174,114,12 EDITTEXT IDC_FIND,30,264,54,12,ES_AUTOHSCROLL LTEXT "Find:",IDC_STATIC,6,266,24,8 - EDITTEXT IDC_FINDHOTKEY,108,264,30,12,ES_AUTOHSCROLL + EDITTEXT IDC_FINDHOTKEY,108,264,36,12,ES_AUTOHSCROLL LTEXT "Key:",IDC_STATIC,90,266,18,8 END -IDD_OPTIONS_COLORS DIALOGEX 0, 0, 272, 281 +IDD_OPTIONS_COLORS DIALOGEX 0, 0, 286, 282 STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Colours" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - COMBOBOX IDC_COMBO1,84,114,114,109,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Use small font",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,18,114,10 - CONTROL "Enable effect highlighting",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,36,114,10 - CONTROL "Primary highlight",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,84,10 + GROUPBOX "",IDC_STATIC,6,6,276,217 + CONTROL "Use small &font",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,18,114,10 + CONTROL "&Enable effect highlighting",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,36,114,10 + CONTROL "&Primary highlight",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,84,10 EDITTEXT IDC_PRIMARYHILITE,102,54,24,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Rows per measure (default)",IDC_STATIC,132,56,126,8 - CONTROL "Secondary highlight",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,72,80,10 + CONTROL "&Secondary highlight",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,72,80,10 EDITTEXT IDC_SECONDARYHILITE,102,72,24,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Rows per beat (default)",IDC_STATIC,132,74,126,8 LTEXT "Note: Songs' time signatures will override the default highlight values",IDC_STATIC,18,90,240,24 + LTEXT "Select &colour for:",IDC_STATIC,18,116,63,8 + COMBOBOX IDC_COMBO1,84,114,114,109,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_BUTTON4,"Button",BS_OWNERDRAW | BS_FLAT,76,132,114,43 LTEXT "Background:",IDC_TEXT1,36,185,60,8 - CONTROL "Colour",IDC_BUTTON1,"Button",BS_OWNERDRAW,36,196,51,15 + CONTROL "C&olour",IDC_BUTTON1,"Button",BS_OWNERDRAW,36,196,51,15 LTEXT "Foreground:",IDC_TEXT2,109,185,62,8 - CONTROL "Colour",IDC_BUTTON2,"Button",BS_OWNERDRAW,109,196,51,15 + CONTROL "Colo&ur",IDC_BUTTON2,"Button",BS_OWNERDRAW,109,196,51,15 LTEXT "Highlight:",IDC_TEXT3,180,188,61,8 - CONTROL "Colour",IDC_BUTTON3,"Button",BS_OWNERDRAW,179,196,51,15 - PUSHBUTTON "Load...",IDC_LOAD_COLORSCHEME,18,252,42,15 - PUSHBUTTON "Save...",IDC_SAVE_COLORSCHEME,66,252,42,15 - PUSHBUTTON "MPT",IDC_BUTTON5,126,252,30,15 - PUSHBUTTON "Green",IDC_BUTTON7,162,252,30,15 - PUSHBUTTON "Blue",IDC_BUTTON6,198,252,30,15 - PUSHBUTTON "Buzz",IDC_BUTTON8,234,252,30,15 - GROUPBOX "",IDC_STATIC,5,5,260,217 - LTEXT "Select colour for:",IDC_STATIC,18,116,63,8 - GROUPBOX "Colour Presets",IDC_STATIC,6,234,264,42 + CONTROL "Colou&r",IDC_BUTTON3,"Button",BS_OWNERDRAW,179,196,51,15 + GROUPBOX "Colour Presets",IDC_STATIC,6,234,276,42 + PUSHBUTTON "&Load...",IDC_LOAD_COLORSCHEME,18,252,42,15 + PUSHBUTTON "S&ave...",IDC_SAVE_COLORSCHEME,66,252,42,15 + PUSHBUTTON "&MPT",IDC_BUTTON5,132,252,30,15 + PUSHBUTTON "&Green",IDC_BUTTON7,168,252,30,15 + PUSHBUTTON "&Blue",IDC_BUTTON6,204,252,30,15 + PUSHBUTTON "Bu&zz",IDC_BUTTON8,240,252,30,15 END -IDD_OPTIONS_MIDI DIALOGEX 0, 0, 272, 269 +IDD_OPTIONS_MIDI DIALOGEX 0, 0, 286, 269 STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "MIDI" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "MIDI Recording",IDC_STATIC,6,6,258,108 + GROUPBOX "MIDI Recording",IDC_STATIC,6,6,276,108 LTEXT "MIDI Input Device:",IDC_STATIC,18,18,67,8 - COMBOBOX IDC_COMBO1,18,30,240,74,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO1,18,30,252,74,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "Apply Octave Transpose to incoming MIDI Notes",IDC_CHECK4, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,48,237,12 CONTROL "Record Note Off",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,60,237,12 @@ -714,7 +714,7 @@ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,84,237,12 CONTROL "Pass MIDI to active instrument plugin",IDC_MIDI_TO_PLUGIN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,237,12 - GROUPBOX "MIDI Recording - Volume and Controllers",IDC_STATIC,6,120,258,90 + GROUPBOX "MIDI Recording - Volume and Controllers",IDC_STATIC,6,120,276,90 CONTROL "Record MIDI Note Velocity, amplify by",IDC_CHECK1, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,138,144,10 EDITTEXT IDC_EDIT3,162,137,42,12,ES_AUTOHSCROLL | ES_NUMBER @@ -725,10 +725,10 @@ CONTROL "Record MIDI Controller changes as MIDI Macro changes in pattern",IDC_MIDI_MACRO_CONTROL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,162,237,12 LTEXT "Ignore CCs (e.g. 1,123,127)",IDC_STATIC,30,176,108,8 - EDITTEXT IDC_EDIT4,138,174,120,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT4,138,174,132,12,ES_AUTOHSCROLL LTEXT "Record Aftertouch Messages",IDC_STATIC,30,192,108,12,SS_CENTERIMAGE - COMBOBOX IDC_COMBO2,138,192,120,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "MIDI File Import",IDC_STATIC,6,216,260,36 + COMBOBOX IDC_COMBO2,138,192,132,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "MIDI File Import",IDC_STATIC,6,216,276,36 LTEXT "Speed:",IDC_STATIC,18,234,24,8 EDITTEXT IDC_EDIT1,48,232,39,12,ES_AUTOHSCROLL | ES_NUMBER CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,78,234,11,14 @@ -1147,7 +1147,7 @@ CTEXT "Mix Mode",IDC_STATIC,245,241,37,13,SS_CENTERIMAGE,WS_EX_STATICEDGE COMBOBOX IDC_COMBO9,285,241,62,99,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Gain: x 1.0",IDC_STATIC2,353,241,37,14,SS_CENTERIMAGE - CONTROL "",IDC_SPIN10,"msctls_updown32",UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_TABSTOP,392,242,9,11 + CONTROL "",IDC_SPIN10,"msctls_updown32",WS_TABSTOP,392,242,9,11 CONTROL "Bypass",IDC_CHECK10,"Button",BS_AUTOCHECKBOX | BS_FLAT | WS_TABSTOP,199,256,40,10 CTEXT "Output to",IDC_STATIC,245,261,37,13,SS_CENTERIMAGE,WS_EX_STATICEDGE COMBOBOX IDC_COMBO7,285,261,117,68,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -1351,11 +1351,11 @@ CTEXT "Rear Right",IDC_STATIC_CHANNEL_REARRIGHT,78,162,48,12,SS_CENTERIMAGE,WS_EX_STATICEDGE COMBOBOX IDC_COMBO_CHANNEL_REARRIGHT,132,162,144,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "General",IDC_STATIC,6,186,276,30 + LTEXT "&When playback is stoppped:",IDC_STATIC,12,198,90,12,SS_CENTERIMAGE COMBOBOX IDC_COMBO11,108,198,60,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "&Open device at startup",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,186,198,90,12 GROUPBOX "Stat&istics",IDC_STATIC,6,222,276,55 EDITTEXT IDC_EDIT_STATISTICS,12,233,264,38,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP - LTEXT "&When playback is stoppped:",IDC_STATIC,12,198,90,12,SS_CENTERIMAGE END IDD_MIDIMACRO DIALOGEX 0, 0, 358, 354 @@ -1544,28 +1544,28 @@ GROUPBOX "Length in Rows at C4",IDC_STATIC,6,55,171,45 END -IDD_OPTIONS_AUTOSAVE DIALOGEX 0, 0, 272, 279 +IDD_OPTIONS_AUTOSAVE DIALOGEX 0, 0, 286, 279 STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Auto Save" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN + GROUPBOX "Auto Save",IDC_STATIC,4,3,278,157 CONTROL "&Enable Auto Save",IDC_AUTOSAVE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,15,237,10 + LTEXT "&Save every:",IDC_STATIC,15,29,40,12,SS_CENTERIMAGE EDITTEXT IDC_AUTOSAVE_INTERVAL,59,29,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "minutes",IDC_STATIC,87,29,165,12,SS_CENTERIMAGE + LTEXT "&Keep up to:",IDC_STATIC,15,46,36,12,SS_CENTERIMAGE EDITTEXT IDC_AUTOSAVE_HISTORY,59,46,24,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_AUTOSAVE_PATH,60,96,164,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_AUTOSAVE_BROWSE,226,97,12,11,NOT WS_TABSTOP - LTEXT "[filename].AutoSave.[timestamp].[extension]",IDC_STATIC,60,120,164,12,SS_CENTERIMAGE,WS_EX_CLIENTEDGE - GROUPBOX "Auto Save",IDC_STATIC,4,3,261,157 - LTEXT "Save every:",IDC_STATIC,15,29,40,12,SS_CENTERIMAGE - LTEXT "minutes",IDC_STATIC,87,29,165,12,SS_CENTERIMAGE - LTEXT "Filename:",IDC_STATIC,28,120,30,12,SS_CENTERIMAGE - LTEXT "(example: mySong.AutoSave.20050327.2343.it)",IDC_STATIC,60,135,157,12,SS_CENTERIMAGE - LTEXT "Keep up to:",IDC_STATIC,15,46,36,12,SS_CENTERIMAGE LTEXT "backups of each file name",IDC_STATIC,87,46,165,12,SS_CENTERIMAGE - GROUPBOX "Location:",IDC_STATIC,15,70,240,80 + GROUPBOX "Location:",IDC_STATIC,15,70,255,80 + CONTROL "Use song's &original directory.",IDC_AUTOSAVE_USEORIGDIR, + "Button",BS_AUTORADIOBUTTON,28,83,218,10 CONTROL "&Use:",IDC_AUTOSAVE_USECUSTOMDIR,"Button",BS_AUTORADIOBUTTON,28,97,31,10 - CONTROL "Use song's &original directory.",IDC_AUTOSAVE_USEORIGDIR, - "Button",BS_AUTORADIOBUTTON,28,83,194,10 + EDITTEXT IDC_AUTOSAVE_PATH,60,96,186,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_AUTOSAVE_BROWSE,252,96,12,11,NOT WS_TABSTOP + LTEXT "Filename:",IDC_STATIC,28,120,30,12,SS_CENTERIMAGE + LTEXT "[filename].AutoSave.[timestamp].[extension]",IDC_STATIC,60,120,186,12,SS_CENTERIMAGE,WS_EX_CLIENTEDGE + LTEXT "(example: mySong.AutoSave.20050327.2343.it)",IDC_STATIC,60,135,186,12,SS_CENTERIMAGE END IDD_EDIT_GOTO DIALOGEX 0, 0, 130, 79 @@ -1609,12 +1609,12 @@ BEGIN GROUPBOX "Resampling",IDC_STATIC,6,6,276,48 LTEXT "Filter:",IDC_STATIC,12,18,24,12,SS_CENTERIMAGE - COMBOBOX IDC_COMBO_FILTER,54,18,90,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Bandwidth:",IDC_STATIC,12,36,42,12,SS_CENTERIMAGE - EDITTEXT IDC_WFIRCUTOFF,54,36,18,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - LTEXT "%",IDC_STATIC,78,36,24,12,SS_CENTERIMAGE + COMBOBOX IDC_COMBO_FILTER,54,18,96,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Window:",IDC_STATIC,156,18,30,12,SS_CENTERIMAGE COMBOBOX IDC_COMBO_FILTERWINDOW,192,18,84,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Bandwidth:",IDC_STATIC,12,36,42,12,SS_CENTERIMAGE + EDITTEXT IDC_WFIRCUTOFF,54,36,24,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER + LTEXT "%",IDC_STATIC,84,36,24,12,SS_CENTERIMAGE GROUPBOX "Volume Ramping",IDC_STATIC,6,60,276,48 LTEXT "\xB5s up",IDC_STATIC,42,72,22,12,SS_CENTERIMAGE EDITTEXT IDC_RAMPING_IN,12,72,24,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER @@ -1672,20 +1672,20 @@ IDD_OPTIONS_KEYBOARD, DIALOG BEGIN - RIGHTMARGIN, 268 + RIGHTMARGIN, 280 TOPMARGIN, 5 - BOTTOMMARGIN, 277 + BOTTOMMARGIN, 278 END IDD_OPTIONS_COLORS, DIALOG BEGIN - RIGHTMARGIN, 247 - BOTTOMMARGIN, 201 + RIGHTMARGIN, 261 + BOTTOMMARGIN, 202 END IDD_OPTIONS_MIDI, DIALOG BEGIN - RIGHTMARGIN, 240 + RIGHTMARGIN, 254 BOTTOMMARGIN, 266 END @@ -1882,7 +1882,7 @@ IDD_OPTIONS_AUTOSAVE, DIALOG BEGIN - RIGHTMARGIN, 266 + RIGHTMARGIN, 280 BOTTOMMARGIN, 276 END Modified: trunk/OpenMPT/soundlib/Load_wav.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_wav.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/soundlib/Load_wav.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -171,6 +171,7 @@ CopyWavChannel<SC::ConversionChain<SC::Convert<int16, int32>, SC::DecodeInt32<0, littleEndian32> > >(sample, sampleChunk, channel, wavFile.GetNumChannels()); } } + sample.PrecomputeLoops(*this, false); } Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/soundlib/Tables.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -582,6 +582,7 @@ +// Apart from a few small differences, this table seems to contain elements with a difference of 59. const uint32 FineLinearSlideUpTable[16] = { 65536, 65595, 65654, 65714, 65773, 65832, 65892, 65951, @@ -589,6 +590,7 @@ }; +// Apart from a few small differences, this table seems to contain elements with a difference of 59. const uint32 FineLinearSlideDownTable[16] = { 65535, 65477, 65418, 65359, 65300, 65241, 65182, 65123, @@ -737,7 +739,7 @@ }; -// Reversed sinc coefficients for 4x256 taps polyphase FIR resampling filter +// Reversed sinc coefficients for 4x256 taps polyphase FIR resampling filter (SchismTracker's lutgen.c should generate a very similar table, but it's more precise) const int16 CResampler::FastSincTable[256*4] = { // Cubic Spline 0, 16384, 0, 0, -31, 16383, 32, 0, -63, 16381, 65, 0, -93, 16378, 100, -1, Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2014-03-29 09:02:23 UTC (rev 3994) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2014-03-29 17:09:01 UTC (rev 3995) @@ -42,7 +42,7 @@ SmpLength InsertSilence(ModSample &smp, const SmpLength nSilenceLength, const SmpLength nStartFrom, CSoundFile &sndFile) //---------------------------------------------------------------------------------------------------------------------- { - if(nSilenceLength == 0 || nSilenceLength >= MAX_SAMPLE_LENGTH || smp.nLength > MAX_SAMPLE_LENGTH - nSilenceLength || nStartFrom > smp.nLength) + if(nSilenceLength == 0 || nSilenceLength > MAX_SAMPLE_LENGTH || smp.nLength > MAX_SAMPLE_LENGTH - nSilenceLength || nStartFrom > smp.nLength) return smp.nLength; const bool wasEmpty = smp.nLength == 0 || smp.pSample == nullptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-29 18:28:27
|
Revision: 3996 http://sourceforge.net/p/modplug/code/3996 Author: saga-games Date: 2014-03-29 18:28:18 +0000 (Sat, 29 Mar 2014) Log Message: ----------- [Fix] Default chords were not loaded properly in a new installation. [Fix] Pattern editor: Prevent invalid notes from being entered through the chords feature. [Imp] Handle S9F in GetLength() sample syncing. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-29 17:09:01 UTC (rev 3995) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-03-29 18:28:18 UTC (rev 3996) @@ -938,7 +938,7 @@ for(size_t i = 0; i < CountOf(chords); i++) { uint32 chord; - if((chord = conf.Read<int32>("Chords", CSoundFile::GetNoteName(ModCommand::NOTE(i + NOTE_MIN)), -1)) >= 0) + if((chord = conf.Read<int32>("Chords", CSoundFile::GetNoteName(ModCommand::NOTE(i + NOTE_MIN)), -1)) != uint32(-1)) { if((chord & 0xFFFFFFC0) || (!chords[i].notes[0])) { Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-29 17:09:01 UTC (rev 3995) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-29 18:28:18 UTC (rev 3996) @@ -5333,8 +5333,12 @@ return 0; } - int numNotes = 1; - outNotes[0] = key; + int numNotes = 0; + const CModSpecifications &specs = GetSoundFile()->GetModSpecifications(); + if(specs.HasNote(key)) + { + outNotes[numNotes++] = key; + } for(size_t i = 0; i < CountOf(chord.notes); i++) { @@ -5347,7 +5351,7 @@ note = (note / 12) * 12; } note += chord.notes[i]; - if(ModCommand::IsNote(note)) + if(specs.HasNote(note)) { outNotes[numNotes++] = note; } Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2014-03-29 17:09:01 UTC (rev 3995) +++ trunk/OpenMPT/mptrack/View_pat.h 2014-03-29 18:28:18 UTC (rev 3996) @@ -314,7 +314,7 @@ void EnterAftertouch(int note, int atValue); // Construct a chord from the chord presets. Returns number of notes in chord. - static int ConstructChord(int note, ModCommand::NOTE (&outNotes)[MPTChord::notesPerChord], ModCommand::NOTE baseNote); + int ConstructChord(int note, ModCommand::NOTE (&outNotes)[MPTChord::notesPerChord], ModCommand::NOTE baseNote); void QuantizeRow(PATTERNINDEX &pat, ROWINDEX &row) const; PATTERNINDEX GetNextPattern() const; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-29 17:09:01 UTC (rev 3995) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-29 18:28:18 UTC (rev 3996) @@ -89,7 +89,7 @@ state.Chn[chn].nOldHiOffset = 0; state.Chn[chn].nOldGlobalVolSlide = 0; state.Chn[chn].nOldChnVolSlide = 0; - state.Chn[chn].nNewNote = state.Chn[chn].nLastNote = NOTE_NONE; + state.Chn[chn].nNote = state.Chn[chn].nNewNote = state.Chn[chn].nLastNote = NOTE_NONE; } } }; @@ -142,7 +142,7 @@ } if(seekPat != PATTERNINDEX_INVALID) { - ModCommand &m = *Patterns[seekPat].GetpModCommand(target.pos.row, i); + const ModCommand &m = *Patterns[seekPat].GetpModCommand(target.pos.row, i); if(m.note == NOTE_NOTECUT || m.note == NOTE_KEYOFF || (m.note == NOTE_FADE && GetNumInstruments()) || (m.IsNote() && m.command != CMD_TONEPORTAMENTO && m.command != CMD_TONEPORTAVOL && m.volcmd != VOLCMD_TONEPORTAMENTO)) { @@ -165,7 +165,7 @@ PATTERNINDEX nPattern = Order[nCurrentOrder]; bool positionJumpOnThisRow = false; bool patternBreakOnThisRow = false; - bool patternLoopEndedOnThisRow = false; + bool patternLoopEndedOnThisRow = false, patternLoopStartedOnThisRow = false; if(nPattern == Order.GetIgnoreIndex() && target.mode == GetLengthTarget::SeekPosition && nCurrentOrder == target.pos.order) { @@ -354,12 +354,12 @@ case CMD_TEMPO: if ((adjustMode & eAdjust) && (GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) { - if (param) pChn->nOldTempo = (BYTE)param; else param = pChn->nOldTempo; + if (param) pChn->nOldTempo = param; else param = pChn->nOldTempo; } if (param >= 0x20) memory.state.m_nMusicTempo = param; else { // Tempo Slide - uint32 tempoDiff = (param & 0x0F) * (memory.state.m_nMusicSpeed - 1); + uint32 tempoDiff = (param & 0x0F) * (memory.state.m_nMusicSpeed - 1); if ((param & 0xF0) == 0x10) { memory.state.m_nMusicTempo += tempoDiff; @@ -418,6 +418,7 @@ memory.chnSettings[c].patLoop = memory.elapsedTime; memory.chnSettings[c].patLoopStart = nRow; } + patternLoopStartedOnThisRow = true; } } break; @@ -436,6 +437,7 @@ patternLoopEndedOnThisRow = true; } else { + patternLoopStartedOnThisRow = true; memory.chnSettings[nChn].patLoop = memory.elapsedTime; memory.chnSettings[nChn].patLoopStart = nRow; } @@ -578,7 +580,7 @@ if(adjustSamplePos) { // Super experimental and dirty sample seeking - const ModCommand::COMMAND forbiddenCommands[] = { CMD_PORTAMENTOUP, CMD_PORTAMENTODOWN, CMD_VOLUMESLIDE, CMD_VIBRATOVOL, CMD_TONEPORTAVOL, CMD_XFINEPORTAUPDOWN, CMD_NOTESLIDEUP, CMD_NOTESLIDEUPRETRIG, CMD_NOTESLIDEDOWN, CMD_NOTESLIDEDOWNRETRIG }; + const ModCommand::COMMAND forbiddenCommands[] = { CMD_ARPEGGIO, CMD_PORTAMENTOUP, CMD_PORTAMENTODOWN, CMD_VOLUMESLIDE, CMD_VIBRATOVOL, CMD_TONEPORTAVOL, CMD_XFINEPORTAUPDOWN, CMD_NOTESLIDEUP, CMD_NOTESLIDEUPRETRIG, CMD_NOTESLIDEDOWN, CMD_NOTESLIDEDOWNRETRIG }; const ModCommand::VOLCMD forbiddenVolCommands[] = { VOLCMD_PORTAUP, VOLCMD_PORTADOWN, VOLCMD_TONEPORTAMENTO, VOLCMD_VOLSLIDEUP, VOLCMD_VOLSLIDEDOWN, VOLCMD_FINEVOLUP, VOLCMD_FINEVOLDOWN }; pChn = memory.state.Chn; @@ -591,7 +593,7 @@ uint32 startTick = 0; uint32 paramHi = p->param >> 4, paramLo = p->param & 0x0F; bool porta = p->command == CMD_TONEPORTAMENTO /*|| p->command CMD_TONEPORTAVOL || p->volcmd == VOLCMD_TONEPORTAMENTO*/; // Volume column tone portamento can be crazy, and CMD_TONEPORTAVOL requires volume slides which we don't emulate right now. - bool stopNote = false; + bool stopNote = patternLoopStartedOnThisRow; // It's too much trouble to keep those pattern loops in sync... if(p->IsNote()) { @@ -616,7 +618,7 @@ } else if(p->volcmd == VOLCMD_OFFSET) { if(p->vol != 0) pChn->nOldOffset = p->vol << 3; - if(p->IsNote()) pChn->nPos = (pChn->nOldHiOffset<< 16) + (pChn->nOldOffset << 8); + if(p->IsNote()) pChn->nPos = (pChn->nOldHiOffset << 16) + (pChn->nOldOffset << 8); } if(p->note == NOTE_KEYOFF || p->note == NOTE_NOTECUT || (p->note == NOTE_FADE && GetNumInstruments()) @@ -643,6 +645,23 @@ { pChn->nPan = p->vol * 4; } + if(p->command == CMD_S3MCMDEX) + { + if(p->param == 0x9E) + { + // Play forward + pChn->dwFlags.reset(CHN_PINGPONGFLAG); + } else if(p->param == 0x9F) + { + // Reverse + pChn->dwFlags.set(CHN_PINGPONGFLAG); + if(!pChn->nPos && pChn->nLength && (p->IsNote() || !pChn->dwFlags[CHN_LOOP])) + { + pChn->nPos = pChn->nLength - 1; + pChn->nPosLo = 0xFFFF; + } + } + } if(pChn->nInc != 0 && pChn->pModSample && !stopNote) { @@ -683,7 +702,6 @@ } } - if(pChn->nInc != 0 && pChn->pModSample && !stopNote) { // Increment playback position of sample and envelopes @@ -703,14 +721,16 @@ if(updateInc) pChn->nInc = GetChannelIncrement(pChn, pChn->nPeriod, 0); - pChn->nPosLo += pChn->nInc * tickDuration; - pChn->nPos += (pChn->nPosLo >> 16); + int32 inc = pChn->nInc; + if(pChn->dwFlags[CHN_PINGPONGFLAG]) inc = -inc; + pChn->nPosLo += inc * tickDuration; + pChn->nPos += ((int32)pChn->nPosLo >> 16); pChn->nPosLo &= 0xFFFF; } if(pChn->pModSample->uFlags[CHN_SUSTAINLOOP | CHN_LOOP]) { // Check if we exceeded the sample loop. - if(pChn->dwFlags[CHN_PINGPONGFLAG] && pChn->nPos >= pChn->nLoopEnd) + if(pChn->dwFlags[CHN_PINGPONGLOOP] && pChn->nPos >= pChn->nLoopEnd) { // Ping-pong loops are not supported for now. stopNote = true; @@ -4278,7 +4298,7 @@ { // F0.F0.{80|n}.xx / F0.F1.n.xx: Set VST effect parameter n to xx const PLUGINDEX nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); - const UINT plugParam = isExtended ? (0x80 + macroCode) : (macroCode & 0x7F); + const uint32 plugParam = isExtended ? (0x80 + macroCode) : (macroCode & 0x7F); if((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; @@ -4289,7 +4309,7 @@ pPlugin->SetZxxParameter(plugParam, param & 0x7F); } else { - pPlugin->SetZxxParameter(plugParam, (UINT)CalculateSmoothParamChange((float)pPlugin->GetZxxParameter(plugParam), (float)(param & 0x7F))); + pPlugin->SetZxxParameter(plugParam, (uint32)CalculateSmoothParamChange((float)pPlugin->GetZxxParameter(plugParam), (float)(param & 0x7F))); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-03-29 19:37:03
|
Revision: 3998 http://sourceforge.net/p/modplug/code/3998 Author: saga-games Date: 2014-03-29 19:36:51 +0000 (Sat, 29 Mar 2014) Log Message: ----------- [Doc] Updated release note documents. [Mod] OpenMPT: Version is now 1.23.01.00 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/readme.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/OMPT_1.23_ReleaseNotes.html trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.23/ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.23/noteproperties.png Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-03-29 19:02:30 UTC (rev 3997) +++ trunk/OpenMPT/common/versionNumber.h 2014-03-29 19:36:51 UTC (rev 3998) @@ -15,9 +15,9 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 -#define VER_MAJOR 22 -#define VER_MINOR 07 -#define VER_MINORMINOR 33 +#define VER_MAJOR 23 +#define VER_MINOR 01 +#define VER_MINORMINOR 00 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2014-03-29 19:02:30 UTC (rev 3997) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2014-03-29 19:36:51 UTC (rev 3998) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.22 * +* OpenMPT 1.23 * ****************** @@ -47,17 +47,20 @@ what can be done in OpenMPT with only a few kilobytes. History.txt: Version history. mptrack.exe: Main executable. +PluginBridge32.exe: Plugin bridge server for 32-bit VST plugins. +PluginBridge64.exe: Plugin bridge server for 64-bit VST plugins. OpenMPT_SoundTouch_f32.dll: SoundTouch library used in time stretching feature. -readme.txt: this document +readme.txt: This document unmo3.dll: Used in MO3-file import. -OMPT_1.20_ReleaseNotes.html: Release notes for this version. +OMPT_1.23_ReleaseNotes.html: Release notes for this version. + License ------- OpenMPT is partially under the following license: -> Copyright (c) 2004-2013, OpenMPT contributors +> Copyright (c) 2004-2014, OpenMPT contributors > Copyright (c) 1997-2003, Olivier Lapicque > All rights reserved. > @@ -98,7 +101,7 @@ unmo3.dll --------- -Copyright (c) 2001-2011 Ian Luck. All rights reserved +Copyright (c) 2001-2014 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! @@ -151,4 +154,44 @@ --------- OpenMPT makes use of libmpg123, which is released under the LGPL license. A copy of the LGPL license can be found in SoundTouch\COPYING.TXT -Visit http://mpg123.de/ for more information. \ No newline at end of file +Visit http://mpg123.de/ for more information. + +lhasa +----- +OpenMPT makes use of lhasa, which is released under the ISC license. +Visit https://github.com/fragglet/lhasa for more information. + +UnRAR +----- +OpenMPT makes use of the UnRAR library by Alexander L. Roshal. + + The source code of UnRAR utility is freeware. This means: + + 1. All copyrights to RAR and the utility UnRAR are exclusively + owned by the author - Alexander Roshal. + + 2. UnRAR source code may be used in any software to handle + RAR archives without limitations free of charge, but cannot be + used to develop RAR (WinRAR) compatible archiver and to + re-create RAR compression algorithm, which is proprietary. + Distribution of modified UnRAR source code in separate form + or as a part of other software is permitted, provided that + full text of this paragraph, starting from "UnRAR source code" + words, is included in license, or in documentation if license + is not available, and in source code comments of resulting package. + + 3. The UnRAR utility may be freely distributed. It is allowed + to distribute UnRAR inside of other software packages. + + 4. THE RAR ARCHIVER AND THE UnRAR UTILITY ARE DISTRIBUTED "AS IS". + NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. YOU USE AT + YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, + DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING + OR MISUSING THIS SOFTWARE. + + 5. Installing and using the UnRAR utility signifies acceptance of + these terms and conditions of the license. + + 6. If you don't agree with terms of the license you must remove + UnRAR files from your storage devices and cease to use the + utility. \ No newline at end of file Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2014-03-29 19:02:30 UTC (rev 3997) +++ trunk/OpenMPT/packageTemplate/History.txt 2014-03-29 19:36:51 UTC (rev 3998) @@ -25,6 +25,215 @@ <ks> coda / Ken Snyder +v1.23.01.00 (29 March 2014, revision 3998) +------------------------------------------ +General tab + [New] <js> Added a tempo tap buton. Click several times in a row to tap in the wanted beats per minute. + [New] <js> Can now clone plugins (and entire plugin chains) to another slot (http://bugs.openmpt.org/view.php?id=35). + [Imp] <js> When moving a plugin, the entire plugin chain starting from that plugin can now (optionally) be moved. + [Imp] <js> Show real preset name instead of "current" in the plugin configuration (http://forum.openmpt.org/index.php?topic=3284.0). + [Mod] <js> Allow editing the global volume in legacy XM files that still have it set to a non-default value. + +Pattern tab + [New] <js> Added redo functionality and named undo points. + [New] <js> Experimental feature: Seeking in a module tries to keep sample sync. This only works under some basic conditions, e.g. samples with ping-pong loops or portamento effects are not supported. Can be enabled from the general options. + [New] <js> Alt-clicking a channel header solos / unsolos the channel (tx Rapture). + [Imp] <js> When right-clicking an order list item, playback no longer jumps to this item anymore if "Follow Song" is active. + [Mod] <js> Unified note properties dialog from three tabs into one single dialog. + [Mod] <js> Renamed "row spacing" to "edit step". + [Fix] <js> Effect letter input does now work when a non-latin keyboard layout (e.g. cyrillic) is being used (http://bugs.openmpt.org/view.php?id=478). + [Fix] <js> "Copy Pattern" from the order list context menu didn't copy the last channel properly. + [Fix] <js> Don't apply split note settings when entering special (^^, ==, etc.) notes. + [Fix] <js> OpenMPT could crash when displaying default volumes was enabled and an instrument was deleted through the tree view (http://forum.openmpt.org/index.php?topic=5253.0). + [Fix] <js> Quick Channel Settings: Moving the channel volume slider always disabled the surround settings (http://forum.openmpt.org/index.php?topic=5214.0). + [Fix] <js> Parameter Editor: Initial point spacing was a bit off, so the last point was sometimes not visible. + [Fix] <js> Channel Manager buttons are placed properly when using the WinXP theme (http://forum.openmpt.org/index.php?topic=3460.0). + [Fix] <js> Sometimes, when changing the editor size (e.g. by maximizing a module window), the pattern would stop scrolling. + +Sample tab + [New] <js> Added redo functionality and named undo points. + [New] <js> Added zoom levels greater than 1:1 (http://forum.openmpt.org/index.php?topic=3563.0). + [Imp] <js> The sample grid is now visualised using dashed lines. + [Imp] <js> Sample drawing is now also available for stereo samples. + [Imp] <js> Sample tuner is now multi-threaded and uses SSE2 instructions when available (this speeds up the tool greatly for big samples). + [Imp] <js> Slightly more stable frequency calculation when scrolling through the transpose list in IT / S3M formats. + [Imp] <js> Use MIDI note velocity when previewing samples. + [Imp] <js> When normalizing loaded samples, prevent their volume from being 0. + [Mod] <js> Pitch shifting and time stretching does now also work for 8-bit samples without upsampling them first. + [Fix] <js> Position marks do no longer flicker and disappear when desktop compositing (and thus, Aero) is turned on. The same fix is also applied to the envelope editor, where the problem was less pronounced (http://bugs.openmpt.org/view.php?id=372). + [Fix] <js> When zooming into samples longer than 32767 sampling points, it was possible that the last few points were not visible (http://bugs.openmpt.org/view.php?id=162). + [Fix] <js> Tentative fix for samples not playing completely in sample preview while song is playing - this fixes the problem only partly (http://bugs.openmpt.org/view.php?id=209). + [Fix] <js> The zoomed-out sample display was not always accurate on CPUs with AMD MMX extensions or SSE. + [Fix] <js> With sample selections > 1 second, the fractional part of the selection length was not displayed correctly. + +Instrument tab + [New] <js> Shift-clicking the pitch / tempo lock checkbox enables / disables the lock for all instruments (http://forum.openmpt.org/index.php?topic=5212.0). + [Fix] <js> Sample slots occupied by the last instrument could be overwritten when loading a new instrument into another slot (http://forum.openmpt.org/index.php?topic=5253.0). + [Fix] <js> Note preview always uses lowpass filter if "Channel default" filter type is specified. Previously, this was random and depended on how the playback channel has been used previously. + [Fix] <js> XM panning envelope points should have a range of 0...63 instead of 0...64 (whyyyyy). + [Fix] <js> Envelopes longer than 32767 ticks can now be scrolled correctly. + [Fix] <js> Envelope grid is now also displayed correctly on Windows 98. + +Tree view + [New] <js> Double-clicking the instrument library path opens a folder browser dialog to quickly browse to a new location. + [New] <js> The instrument library is now refreshed automatically when there are changes in the folder (e.g. adding new files). + [New] <js> Backspace can now be used to go up one directory in the instrument library. + [Imp] <js> Reduce flicker when sample / instrument status live update is enabled. + [Imp] <js> Shift + Del in instrument library deletes files permanently (like in Windows Explorer). + [Mod] <js> If "no loud samples" is enabled, the treeview preview is as loud as it would be in the currently active module's sample editor. Otherwise, it's played at 0dB as before (http://forum.openmpt.org/index.php?topic=5234.0). + [Fix] <js> Selecting a pattern from the tree view to edit automatically set the document as modified. + +Mod Conversion + [Imp] <js> When converting to MOD, try to compensate for the lack of sample transpose by transposing pattern notes. + [Imp] <js> When converting to MOD, write default speed and tempo to patterns, if possible. + [Fix] <js> When converting an IT or XM with instruments to S3M or MOD, the last instrument was not deleted properly, which could lead to some strange sounds until the file would be re-opened. + [Fix] <js> When converting from XM to MOD, the sample transpose wasn't reset. + +VST / DMO Plugins + [New] <js> Official plugin bridge that you can use to run 64-bit plugins in 32-bit OpenMPT and vice versa, or even plugins of the same bitness as OpenMPT if necessary. Can be enabled per plugin from the plugin manager, or can be force-enabled by adding BridgeAllPlugins=1 to the [VST Plugins] section of mptrack.ini. + [New] <js> The arpeggio pattern effect is now also sent to instrument plugins (http://bugs.openmpt.org/view.php?id=479). + [New] <js> Added an option in the plugin manager to scan a folder (including subfolders) for plugins (http://forum.openmpt.org/index.php?topic=1692.0). + [Imp] <js> Raised plugin limit from 100 to 250. + [Imp] <jh> Actual output latency is now passed to plugins that query it (instead of user's wanted latency). + [Imp] <js> Plugin Selection Dialog: The up / down keys can be used to select a plugin while the name filter is focussed. + [Imp] <js> Plugin Selection Dialog: Plugin paths are displayed in a scrollable text box now, so that the complete path can be seen in case it's too long. + [Imp] <js> Implemented audioMasterGetChunkFile opcode. + [Imp] <js> Implemented more timing information for plugins that want it. + [Imp] <js> When rescanning plugins on startup is taking too long, show a progress dialog. + [Mod] <js> Optimize VST window redrawing a little bit by not filling the window with the default background colour (removes flicker when resizing plugin windows). + [Fix] <js> OpenMPT should no longer "forget" plugins randomly (http://bugs.openmpt.org/view.php?id=18). + [Fix] <js> Plugins with same internal ID should no longer confuse OpenMPT's plugin cache (http://bugs.openmpt.org/view.php?id=25). + [Fix] <js> Some plugins could produce a crash when using the buffer clearing option in export (tx coda). + [Fix] <js> When recording a plugin's MIDI output, avoid it from being directed back to the same plugin's editor window. + [Fix] <js> Plugin version is no longer checked when loading preset files (old OpenMPT wrote other values there, so some old presets were no longer readable). + [Fix] <js> Plugin editor keyboard focus was lost after loading or saving plugin presets (http://bugs.openmpt.org/view.php?id=456). + [Fix] <js> Don't add no longer existing plugins used in a module file to the list of known plugins after they have been found in the cache (http://forum.openmpt.org/index.php?topic=2304.0). + [Fix] <js> Presets > 1000 can now also be selected in the plugin editor. + [Reg] <js> Removed native jBridge support in favour of our own bridge. you can still use jBrdige using the default method of plugin stubs, of course. + +VST::Specific Plugin Fixes + [Fix] <js> Poise by One Small Clue should no longer crash if the editor is still open when unloading the plugin (tx coda). + [Fix] <js> AAS Strum Acoustic GS-1 and Strum Electric GS-1 no longer crash on startup (http://bugs.openmpt.org/view.php?id=454). + [Fix] <js> ProteusVX no longer breaks OpenMPT's plugin window (http://bugs.openmpt.org/view.php?id=79). + [Fix] <js> Fixed problems with Korg Wavestation (notes not being triggered / ghost notes) when using the panic button or jumping around in the sequence. + +Playback + [Fix] <js> When interpolation is enabled, interpolated values are no longer read from beyond the loop end, which could lead to clicks and other problems (http://bugs.openmpt.org/view.php?id=304). + [Fix] <js> Don't potentially crash if the restart order position is followed by nothing but skip patterns. + [Fix] <js> Glissando should now behave more as one expects in compatible mode (no longer resets after portamentos). + [Fix] <js> Very small ping-pong loops were detuned sometimes, depending on the mixing frequency (http://schismtracker.org/scdev/read/1447/). + [Fix] <js> Envelopy carry was broken on sample-less channels (only relevant when using envelopes to automate plugins). + +MPTM + [Fix] <js> Loading some modules made with older versions of OpenMPT could produce wrong results when fixing pattern delays if there were parameter control events (since OpenMPT 1.22.06.00). + +IT + [Fix] <js> IT / MPTM instruments referencing sample slots >= 256 from versions older than OpenMPT 1.20 were not readable (http://bugs.openmpt.org/view.php?id=448). + [Fix] <js> Legacy MPTM file detection could make OpenMPT assume that some valid IT files were invalid MPTM files in some extremely rare cases (tx stinkbug). + +IT::Compatible Playback Mode + [Fix] <js> Panbrello random waveform takes speed parameter into account now. The speed parameter determines for how many ticks the random value should be held. + [Fix] <js> S5x resets panbrello phase. + [Fix] <js> If there's a note delay, slide commands in the volume column next to it should not start before the delay has finished. + +XM + [Mod] <js> Volume column panning commands are now imported in the same "dumb" way (16 commands ranging from 0 to 60 instead of 0 to 64) as in FT2 and OpenMPT prior to version 1.20. + [Mod] <js> For increased compatibility with FT2, the "compatible" mix mode uses the square root pan law (instead of linear pan law) when playing XMs. + [Fix] <js> Support F00 "stop song" behaviour (it actually just sets the ticks per row to 65536 in FT2, so we can emulate that easily). + [Fix] <js> Some rare files with malformed sample headers were not loading correctly anymore since OpenMPT 1.20.04.00. + +XM::Compatible Playback Mode + [Fix] <js> The E90 command retriggers the note instantly and only once per row. + [Fix] <js> Lxx actually sets the panning envelope position if the volume envelope's sustain flag is set. + [Fix] <js> If there's a note delay, volume column effects are not executed on the first tick and, if there's an instrument number, not on the delayed start tick. + [Fix] <js> Mind-boggling combinations of portamento and note delay should now behave as in FT2. + [Fix] <js> The lowest 3 bits of finetune are ignored (must be multiple of 8). + [Fix] <js> Frequency wraparound behaviour has been refined a bit to work more like in FT2. + [Fix] <js> Output period is clamped to 1...31999 (very theoretical range that should only be exceeded with overflowing portamentos). + +S3M + [Fix] <js> If the sample number next to a portamento effect differs from the previous number, the old sample is now kept, but the new default volume is being applied (http://bugs.openmpt.org/view.php?id=474). + +MOD + [Fix] <js> If the sample number next to a portamento effect differs from the previous number, the old sample is now kept, but the new default volume is being applied (http://bugs.openmpt.org/view.php?id=474). + [Fix] <js> EEx + pattern break handling was always skipping rows whenever an EEx has been found after a Dxx, not only if they were on the same row (fixes Guitar Slinger and Endless by Jogeir). + +Other formats + [New] <js> Added support for 16SVX IFF samples - they are loaded as big-endian samples, while some sources suggest that they should be little-endian. Since I don't have any 16SVX samples, I can only guess which implementation would be correct. + [Imp] <js> UMX: Added support for Unreal 1997/98 beta files (patch by sezero, http://bugs.openmpt.org/view.php?id=472). + [Mod] <js> File format change notice: Plugin library names are stored as UTF-8 (instead of ANSI) in module files (MPTM / IT / XM) now. This won't make a difference in 99% of all plugin names probably - I've never come across a plugin DLL with non-ASCII characters. + [Mod] <js> ITP file format change notice: Instrument paths are now relative to the ITP file if possible and are stored as UTF-8 (instead of ANSI). Embedded samples are now compressed using IT compression. + [Fix] <jh> DMF: A bogus space was inserted in front of song messages. + [Fix] <js> DBM: Some fixes mostly related to volume slides and envelopes. + [Fix] <js> ITP: Song name was not being read. + [Fix] <js> MT2: Fixed possible crash with some MT2 files (http://www.un4seen.com/forum/?topic=15448.msg107346#msg107346). + [Fix] <js> MT2: Channel volume was not imported at all. + [Fix] <js> STM: Imported volume commands were slightly off when there was another command next to them. + [Fix] <js> UAX: Unnecessary empty sample slots were being created. + [Fix] <jh> Loading split stereo samples from a truncated file could crash since OpenMPT 1.22.04.00 (http://bugs.openmpt.org/view.php?id=486). + [Fix] <jh> Made PP20 / MMCMP / XPK unpackers more robust. + +Module Export + [Imp] <jh> Default codec settings (per codec) and file tags are remembered. + [Imp] <jh> Also show lossy codecs in pattern render to wave dialog. + [Imp] <js> Resulting file size is no longer limited to 2 GB. + [Fix] <js> Export no longer fails if song starts with separator (+++) patterns (http://forum.openmpt.org/index.php?topic=5170.0). + [Fix] <jh> When switching focus to a different window and then back to OpenMPT, the window became unresponsive (http://bugs.openmpt.org/view.php?id=487). + +Audio I/O + [New] <jh> Add an alternate (1-bit) dithering algorithm. Default is still the original ModPlug Tracker dither (0.5-bit). + [Mod] <js> Since Windows Vista, there is an unpleasant limiter / compressor in the audio path for floating-point audio APIs with non-exclusive access. OpenMPT clips floating-point samples automatically to prevent this limiter from kicking in when necessary. + [Imp] <jh> Sound device settings are now remembered per device. + [Imp] <jh> Added options to open the sound device right at the program start and keep playing silence when stopping sound (useful for ASIO drivers with long initialization times). + [Imp] <jh> Various improvements to sound device latency handling and ASIO buffer size selection. + [Imp] <jh> Various improvements to DirectSound output. + [Imp] <jh & js> Allow specifying a flexible channel mapping instead just the base channel offset for ASIO drivers. + [Fix] <jh> Insanely high latencies in WASAPI exclusive mode have been reduced. + [Fix] <jh> Implement all driver to host messages that are required to be handled by the ASIO 2.1 specification. + [Fix] <js> Fixed possible freeze during start on Windows XP during Kernel Streaming initialization (patch from http://sourceforge.net/p/audacity/mailman/message/31421748/, tx Tomoya). + +Misc + [New] <js> Added (experimental) feature to add existing modules to a currently open module. This copies over all pattern, samples, instruments, plugins, etc. as far as it's possible. + [New] <js> Added hidden setting for loading a default template (DefaultTemplate in [Paths] section, can be either a full path or just a filename that can be found in the template folder, http://bugs.openmpt.org/view.php?id=476). + [New] <js> MIDI Mapping does now also work with aftertouch messages. + [New] <js> Added a "Samples" tab to the options dialog which exposes all previously hidden sample and instrument editor options. Two new key behaviours for how to stop sample editor note previews have been added. + [New] <js> Added command line switch /noAssembly which disables any SIMD-optimized code. + [Imp] <jh & js> OpenMPT's file handling is now almost fully unicode-aware (http://bugs.openmpt.org/view.php?id=164). + [Imp] <js> OpenMPT is now large address aware. + [Imp] <js> Replaced the "slightly" aged Win95-style icon set with a more modern one. + [Imp] <js> Default key bindings are now automatically added to existing, possibly incomplete keybindings (http://bugs.openmpt.org/view.php?id=4). + [Imp] <jh> Improved OpenMPT close time by only writing values to the settings files that were actually changed in OpenMPT. + [Imp] <js> Reduced OpenMPT's initial memory consumption by about 5 MB. + [Mod] <js> Disabled mix mode RC3 for XM / IT in Song Properties. + [Mod] <js> New high-resolution application icon by Nobuyuki. + [Mod] <jh & js> Restructured Sound Card, Player and Equalizer options tabs into Sound Card, Mixer and DSP. Changed the unit of volume ramping settings from samples to microseconds so that stays consistent accross sample rate changes. + [Mod] <js> After 16 years of rotozooming, it's time for a new toy in the About dialog. + [Mod] <jh & js> Updated libraries: flac (1.3.0), SoundTouch (1.8.0), smbPitchShift (1.2), unmo3 (2.4.0.5). + [Fix] <js> Scroll / Num / Caps Lock keys should now work better with toggle-able shortcuts (http://bugs.openmpt.org/view.php?id=13). + [Fix] <js> Randomly disappearing combo boxes should hopefully be a problem of the past (http://forum.openmpt.org/index.php?topic=3518.0). + [Reg] <js> Removed simple noise reduction DSP. Noone is going to miss this. + [Reg] <jh> Removed support for importing old registry-based settings. If you really need to import your settings from a version older than OpenMPT 1.17.02.40 (including MPT 1.16), install and run OpenMPT 1.22 before installing a newer version. + +Bundled plugins + [Imp] <jh & js> The MIDI Input / Output Plugin can now compensate for OpenMPT's audio output latency by delaying the MIDI output accordingly. + +Installer/release package + [New] <js> Added key maps that are compatible with MPT's classic FT2 / IT keymaps (US_mpt-ft2_classic.mkb, US_mpt-it2_classic.mkb, tx Gargaj). + + +v1.22.07.00 (16 November 2013, revision 3235) +--------------------------------------------- +Tree view + [Fix] <js> Space key couldn't be used when editing labels. + [Fix] <jh> The global VU meter didn't work properly when previewing instruments in OpenMPT 1.22.06.00. + +VST / DMO Plugins + [Fix] <js> When rendering the full module (i.e. not a selection), the song position was not reset properly, so some plugins were not in sync. + +Misc + [Fix] <jh> Module export to a directory or file name with non-ASCII characters could fail in OpenMPT 1.22.06.00 (http://forum.openmpt.org/index.php?topic=5158.0). + + v1.22.06.00 (2 November 2013, revision 3063) -------------------------------------------- Pattern Tab::Note Properties @@ -34,7 +243,7 @@ [Fix] <js> Note-off on key-up was accidentally also applied to the lower part of the tree view. VST / DMO Plugins - [Imp] <js> Audio is longer paused while a plugin is loaded. + [Imp] <js> Audio is no longer paused while a plugin is loaded. [Fix] <js> SysEx messages are sent to plugins in a different way now. This fixes SysEx messages sent through OpenMPT's MIDI Input / Output plugin. MPTM::Loading @@ -59,26 +268,30 @@ [Fix] <js> AMS (Extreme's Tracker): 16-bit sample support was broken. [Fix] <js> DSM: Fixed broken patterns and added support for delta-encoded samples. [Fix] <jh> Loading some malformed files in various format could lead to a crash (introduced in OpenMPT 1.22.03.00). - [Fix] <jh> WAV Loader: Loading 24-/32-bit WAV files as module crashed since (introduced in OpenMPT 1.22.04.00, http://bugs.openmpt.org/view.php?id=436). + [Fix] <jh> WAV Loader: Loading 24-/32-bit WAV files as module crashed since OpenMPT 1.22.04.00 (http://bugs.openmpt.org/view.php?id=436). + [Fix] <jh> When loading modules from a ZIP file, no longer overwrite existing song comments with ZIP file comments (broke in OpenMPT 1.22.02.00). -Misc - [New] <jh> Added support for Kernel Streaming sound output on Windows XP and for WaveRT on Vista or newer. Both drivers are listed as "WDM-KS" in the soundcard options dialog. - [New] <jh> Added a button to re-enumerate sound devices to soundcard options dialog. This allows selecting sound devices that got added / installed while OpenMPT was already running. - [New] <jh> Use a common dialog for WAV and compressed exporting. Support for FLAC (built-in), OGG and Opus added. +Module Export + [New] <jh> Use a common dialog for WAV and compressed exporting. Support for FLAC (built-in), Opus and OGG Vorbis has been added. [New] <jh> WAV export also supports tags now. [New] <jh> Can now also normalize audio during compressed export (via temporary file). [New] <js> Added option to clean output buffers of plugins before exporting (renders up to 20 seconds of silence per plugin, http://bugs.openmpt.org/view.php?id=19). [New] <jh> Added option to disable cue point writing on pattern transitions in WAV export (http://forum.openmpt.org/index.php?topic=5131.0). - [New] <js> Added command-line option /fullMemDump to write a minidump with heap when OpenMPT crashes. + +Audio I/O + [New] <jh> Added support for Kernel Streaming sound output on Windows XP and for WaveRT on Vista or newer. Both drivers are listed as "WDM-KS" in the soundcard options dialog. + [New] <jh> Added a button to re-enumerate sound devices to soundcard options dialog. This allows selecting sound devices that got added / installed while OpenMPT was already running. [Imp] <jh> Removed static limit of 16 DirectSound and 8 ASIO devices. - [Imp] <jh> Limit WFIR cutoff setting to a sensible range. - [Mod] <jh> Calculate mixer channel statistics over the interval as maximum used channels instead of a approximation of average used channels. [Mod] <jh> Remove /wavex command line option (not relevant anymore on any of the supported Windows versions) [Mod] <jh> Always default or fallback to a Wave Out device which is by far the most stable and has the least suprising user experience. [Mod] <jh> Slightly changed audio thread code to avoid sporadic deadlocks in Wine. - [Fix] <jh> All Loaders: When loading modules from a ZIP file, no longer overwrite existing song comments with ZIP file comments (broke in OpenMPT 1.22.02.00). +Misc + [New] <js> Added command-line option /fullMemDump to write a minidump with heap when OpenMPT crashes. + [Imp] <jh> Limit WFIR cutoff setting to a sensible range. + [Mod] <jh> Calculate mixer channel statistics over the interval as maximum used channels instead of a approximation of average used channels. + v1.22.05.00 (31 August 2013, revision 2622) ------------------------------------------- General Tab @@ -103,8 +316,10 @@ Other formats [Fix] <jh> DSM: Support files that start with a slightly different header than usual DSM files (http://forum.openmpt.org/index.php?topic=5091). +Audio I/O + [New] <jh> Added 32-bit floating point output for drivers that support it. + Misc - [New] <jh> Added 32-bit floating point output for drivers that support it. [Mod] <js> Updated zlib (1.2.8). [Reg] <jh> Remove mpt_intl.ini and mpt_intl.dll support code which was solely usable to translate the options list in the general options tab. @@ -114,7 +329,7 @@ Pattern Editor [Imp] <js> If more than one channel is selected, channel record select and channel reset shortcuts are now applied to all selected channels (tx coda). [Imp] <js> Also show name of unsupported commands in status text. Only really useful when importing files that contain effects not compatible with the current edit format. - [Fix] <js> When removing channels or rows from a pattern, a crash could occour when the cursor was previously placed in a now inaccesible part of the pattern. + [Fix] <js> When removing channels or rows from a pattern, a crash could occur when the cursor was previously placed in a now inaccesible part of the pattern. [Fix] <js> After stopping playback, scrolling to previously invisible channels would reveal their last visible VU meter state (broke in OpenMPT 1.22). Sample Editor @@ -178,21 +393,23 @@ [Fix] <js> MT2: Convert effects from XM to IT on loading, this fixes e.g. global volume commands. [Fix] <js> DSMI AMF: Version 8 / 9 files didn't load correctly. +Module Export + [Imp] <jh> Normalizing is now also available for 32-Bit WAV output. + [Mod] <jh> Always enable "Export as MP3" menu entry and display a useful message box when no MP3 codec is found. + [Fix] <jh> Rendered output is not clamped before normalizing anymore. WAV output is now dithered properly. + [Reg] <jh> Remove possibility to export MP3 encapsulated in .wav files. It's not 1999 anymore. + Module cleanup [Mod] <js> "Remove unused patterns" no longer automatically executes "rearrange patterns". Misc [New] <js> Added option in the MIDI configuration to ignore certain MIDI CCs when recording to pattern. - [Imp] <jh> WAV export: Normalizing is now also available for 32-Bit output. - [Mod] <jh> Always enable "Export as MP3" menu entry and display a useful message box when no MP3 codec is found. [Mod] <jh> Removed /nomp3 command line switch as MP3 support is now initialized on demand instead of when launching OpenMPT. [Mod] <jh> 24-/32-bit samples in DLS files are no longer normalized on load. - [Fix] <jh> WAV export: Rendered output is not clamped before normalizing anymore. WAV output is now dithered properly. [Fix] <js> Song Length Estimation handles some pattern loops more correctly now (http://bugs.openmpt.org/view.php?id=416). [Fix] <js> Song Length Estimation doesn't break with some tempo slide down commands anymore (http://bugs.openmpt.org/view.php?id=416). [Reg] <jh> Enable MMX / 3DNow! / SSE acceleration is gone. This option is now always enabled when available. - [Reg] <jh> Remove possibility to export MP3 encapsulated in .wav files. It's not 1999 anymore. - [Reg] <js> Removed hidden setting ITCompressionVerification (algorithmn has been proved to be stable and verification is now part of the internal test suite). + [Reg] <js> Removed hidden setting ITCompressionVerification (algorithm has been proven to be stable and verification is now part of the internal test suite). v1.22.03.00 (18 May 2013, revision 2094) @@ -213,7 +430,7 @@ [Fix] <js> Changing MIDI input focus to a plugin editor only worked right after focussing the editor for the first time. Playback - [Mod] <js> Behaviour change: Allow S9F next to a note to work with looped samples. + [Mod] <js> Behaviour change: Allow S9F next to a note to work with looped samples (http://bugs.openmpt.org/view.php?id=12). [Fix] <js> Extra-smooth ramping is now also applied with no and linear interpolation (http://bugs.openmpt.org/view.php?id=291). [Fix] <js> Per-instrument ramping settings were ignored during wave export in some cases. [Fix] <jh> Fix volume ramping on samples played on the first row / tick of a song. Ramping is no longer disabled completely to fix pops due to global volume changes on the first row. @@ -232,7 +449,7 @@ [Fix] <js> Instrument number resets tremor count (http://bugs.openmpt.org/view.php?id=384). XM::Loading and Saving - [Mod] <js> +++ and --- entries are no longer exported to XM files. +++ are removed when reading old XM files made with ModPlug. + [Mod] <js> +++ and --- entries are no longer exported to XM files. +++ entries are removed when reading old XM files made with ModPlug. MOD::Loading [Imp] <js> Changed 8xx panning scheme detection heuristic to be less strict (fixes LOOKATME.MOD). @@ -250,11 +467,13 @@ Module cleanup [Fix] <js> Rearrange instruments was broken... again. +Audio I/O + [Fix] <jh> Fixed another possible crash with ASIO devices (http://bugs.openmpt.org/view.php?id=379). + [Fix] <jh> Fixed crash in quad channel mode (crash occurred only since OpenMPT 1.22.02, but the source for it was there since probably forever). + Misc [Imp] <js> Added "made with" tracker identification to most module formats. Can be viewed in Song Properties. [Mod] <js> Warning log messages are no longer shown during auto save. - [Fix] <jh> Fixed another possible crash with ASIO devices (http://bugs.openmpt.org/view.php?id=379). - [Fix] <jh> Fixed crash in quad channel mode (crash occoured only since OpenMPT 1.22.02, but the source for it was there since probably forever). v1.22.02.00 (20 April 2013, revision 1917) @@ -286,14 +505,16 @@ Other formats [Fix] <js> PSM16 loader: Master volume was not loaded properly. +Audio I/O + [Imp] <jh> Boosting of audio thread priority can now be disabled in the Sound Card settings. On Windows Vista and later, MMCSS is now used for boosting. + [Imp] <jh> Support for exclusive device access has been added for WASAPI devices. + [Mod] <jh> Renamed "Use secondary buffers" option to the negated form "Use primary buffer". + [Fix] <jh> Fixed a possible crash when stopping a Wave Out device and possible freezes with ASIO / WASAPI devices. + Misc [New] <js> Added global, always active VU meter with clip indicator in the main toolbar (http://bugs.openmpt.org/view.php?id=144). [Imp] <js> MIDI CC shortcuts should now work in pretty much all places. - [Imp] <jh> Boosting of audio thread priority can now be disabled in the Sound Card settings. On Windows Vista and later, MMCSS is now used for boosting. [Imp] <js> When changing MIDI input devices, the change is applied instantly. Previously the old MIDI device was kept open. - [Imp] <jh> Support for exclusive device access has been added for WASAPI devices. - [Mod] <jh> Renamed "Use secondary buffers" option to the negated form "Use primary buffer". - [Fix] <jh> Fixed a possible crash when stopping a Wave Out device and possible freezes with ASIO / WASAPI devices. [Fix] <js> Time display was not updated anymore in OpenMPT 1.22.01.00 when jumping around in the order list without actually playing the module. [Fix] <js> Options dialog: Pre-amp warning was also shown when changing stereo separation. @@ -330,8 +551,8 @@ [Mod] <js> 8-Bit/Mono conversion items are now also shown in the context menu if a selection has been made. [Fix] <js> Memory was leaked when loading a sample into an empty sample slot and undoing that action. [Fix] <js> Inserting samples did not clear previously existing sample names since some time ago. - [Fix] <js> The sample filename wasn't imported properly when loading a FLAC sample with RIFF chunks. - [Fix] <js> Selection length display didn't show the correct in length in seconds for long samples. + [Fix] <js> The sample filename wasn't imported properly when loading a FLAC sample with embedded RIFF chunks. + [Fix] <js> Selection length display didn't show the correct length in seconds for long samples. Instrument tab [Imp] <js> Mouse wheel and middle mouse button can be used in Sample Map (http://bugs.openmpt.org/view.php?id=345). @@ -370,7 +591,7 @@ [Imp] <js> Retrigger note also works with instrument plugins on rows without a note, and also with Cxx volume commands in XM (not that it really matters, anyway...). [Mod] <jh> In quad surround mode, the surround channel settings overwrites the reverb channel setting now (previously, it was the other way around). [Fix] <js> Fixed problem where one had to press the play button twice after stopping playback (http://bugs.openmpt.org/view.php?id=325). - [Fix] <js> A crash could occour when using reverb with a mixing frequency higher than 50 KHz (http://bugs.openmpt.org/view.php?id=329). + [Fix] <js> A crash could occur when using reverb with a mixing frequency higher than 50 KHz (http://bugs.openmpt.org/view.php?id=329). IT / MPTM [New] <js> Experimental support for saving IT-compressed samples. To enable, set the ITCompressionMono=x and/or ITCompressionStereo=x (x is a sum of the following possible values: 1 = normal IT; 2 = Compatibility Export IT; 4 = MPTM) in mptrack.ini's [Misc] section; set ITCompressionVerification=1 to verify if samples are compressed correctly. Compressed stereo samples won't load in older versions of OpenMPT, and compressed samples will cause trouble when reading extended song or instrument properties in old versions, so be careful if you want to be backwards-compatible. @@ -419,8 +640,13 @@ [Mod] <js> "Reset variables" also resets channel settings now. [Fix] <js> After rearranging samples, some bogus sample slots became visible again when adding a new sample afterwards. +Audio I/O + [New] <jh> Added support for WASAPI output devices. + [Mod] <jh> Options Dialog: Changed "Buffer Length" value into "Latency" (real audio latency) and "Update Interval" (for GUI updates). Old buffer length settings are automatically converted to the new quantities. + [Fix] <jh> Reported ASIO latency was slightly off, so that pattern playback syncing might have been a little off (not very noticeable since ASIO has very low latencies anyway). + [Reg] <js> Removed poorly implemented Invert Stereo option. It's not 1995 anymore. + Misc - [New] <jh> Added support for WASAPI output devices. [New] <js> Added keyboard shortcut: Play song from start of pattern (same as play pattern from start, but doesn't loop the pattern). [New] <jh> Add hidden setting "ShowSplashScreen" in [Display]. [Imp] <js> Elapsed time display in the status bar is a lot more accurate now (no more rounding errors that pile up over time). @@ -428,22 +654,19 @@ [Imp] <js> Editing sample / instrument names on the comments page limits the name length during input instead of just trimming long strings afterwards. [Imp] <js> When clicking the "MIDI Record" button and the device is not ready, opening the device is now tried again after the popup settings dialog is closed. [Imp] <js> Reduced memory usage. - [Mod] <jh> Options Dialog: Changed "Buffer Length" value into "Latency" (real audio latency) and "Update Interval" (for GUI updates). Old buffer length settings are automatically converted to the new quantities. [Mod] <js> Improved extension detection when reading files from zip files. When no preferred file extension is found, the biggest file in the archive is now preferred. [Mod] <js> Changed default song name to be empty instead of "untitled". - [Fix] <jh> Reported ASIO latency was slightly off, so that pattern playback syncing might have been a little off (not very noticeable since ASIO has very low latencies anyway). - [Reg] <js> Removed poorly implemented Invert Stereo option. It's not 1995 anymore. Bundled plugins [Imp] <js> The MIDI Input / Output Plugin now stores device names in presets / modules, so that the order of MIDI devices is no longer important (when having e.g. more than one USB to MIDI interface, their device IDs might change depending on which one was plugged in first). - [Fix] <js> The MIDI Input / Output plugin could crash when changing devices while MIDI data was being processed. + [Fix] <js> The MIDI Input / Output Plugin could crash when changing devices while MIDI data was being processed. v1.21.01.00 (22 December 2012, revision 1472) --------------------------------------------- Pattern tab [New] <js> Added option to quantize notes that are recorded live (select from context menu or shortcut). - [New] <js> Added "Data Entry" shortcuts to increase or decrease the value of the currently selected pattern cells (note, instrument, effect parameters), either by +/- 1 or by a coarse value depending on the column. + [New] <js> Added "Data Entry" shortcuts to increase or decrease the value of the currently selected pattern cells (note, instrument, effect parameters), either by +/- 1 or by a coarse value depending on the column (http://forum.openmpt.org/index.php?topic=3907.0). [Imp] <js> If no selection has been made, interpolation shortcuts now interpolate between the nearest notes / instruments / commands above and below the cursor position. [Imp] <js> Added shortcuts for Record Select / Split Record Select (tx DJBouche). [Fix] <js> Resizing a pattern only created an undo point when the pattern was reduced. @@ -537,8 +760,10 @@ Other formats [Fix] <js> ITP Saver: ITP files saved with OpenMPT 1.20.03.00 were corrupted. Files saved with this version can be fixed by writing the byte sequence 10 00 02 (hex) at position $2B (instead of 01 00 00). +Audio I/O + [New] <js> Added hidden INI setting ASIOBaseChannel in [Sound Settings] category to specify the first ASIO channel to use for sound output (as a quick and dirty semi-solution for http://bugs.openmpt.org/view.php?id=128). + Misc - [New] <js> Added hidden INI setting ASIOBaseChannel in [Sound Settings] category to specify the first ASIO channel to use for sound output (as a quick and dirty semi-solution for http://bugs.openmpt.org/view.php?id=128). [Imp] <js> Using the mouse wheel to scroll edit controls with spin buttons works on all such controls now (http://bugs.openmpt.org/view.php?id=99). [Mod] <js> Changed default resampling type to XMMS-ModPlug. [Fix] <js> Wave Export file names were sometimes not sanitized correctly (http://bugs.openmpt.org/view.php?id=300). @@ -548,7 +773,7 @@ v1.20.03.00 (22 September 2012, revision 1359) ---------------------------------------------- Pattern tab - [New] <js> Playback can now be locked to an order range. The range can be specified from the context menu of an order selection. Locked orders are then shown with a different background colour. + [New] <js> Playback can now be locked to an order range. The range can be specified from the context menu of an order selection. Locked orders are then shown with a different background colour (http://forum.openmpt.org/index.php?topic=2620.0). [Imp] <js> For visual guidance during editing, non-existing pattern numbers are now greyed out. [Imp] <js> Added a keyboard shortcut for opening the Quick Channel Settings dialog. [Mod] <js> Entering note-offs via MIDI doesn't put an instrument number next to them anymore. @@ -575,7 +800,7 @@ [Fix] <js> Randomize Parameters reset focus to main window instead of plugin window (http://bugs.openmpt.org/view.php?id=294) [Fix] <js> Randomize Parameters doesn't ask the plugin if a parameter is automatable anymore, as some plugins do not seem to set this property at all. [Fix] <js> OpenMPT didn't write more than 255 plugins to the settings file since version 1.20 (http://bugs.openmpt.org/view.php?id=267) - [Fix] <js> A memory leak that occoured when trying to register invalid or missing plugins (e.g. on startup) has been fixed. + [Fix] <js> A memory leak that occurred when trying to register invalid or missing plugins (e.g. on startup) has been fixed. IT::Compatible Playback Mode [Fix] <js> A channel's key-off status is kept with portamento notes if "Compatible Gxx" is disabled or there is no instrument number next to the new note. @@ -604,10 +829,12 @@ [Fix] <js> AMF (DSMI) Loader: Fixed pattern effects (normal volume slides were always loaded as volume slide + vibrato) and some other bugs; More AMF format revisions (8-14) are supported now. [Fix] <js> AMF (ASYLUM) Loader: Transposed samples will now play correctly, default speed / tempo are not ignored anymore. +Audio I/O + [Mod] <js> Since the DirectSound driver seems to be buggy (see various reports on the issue tracker), OpenMPT defaults to WaveOut now if there's no ASIO driver present. + Misc [New] <js> Wave Export: Added option to loop a song a given number of times during export (http://bugs.openmpt.org/view.php?id=221). [Imp] <js> Keyboard Settings: Searching for shortcuts does now also work with MIDI CCs. - [Mod] <js> Since the DirectSound driver seems to be buggy (see various reports on the issue tracker), OpenMPT defaults to WaveOut now if there's no ASIO driver present. [Fix] <ks> Save All / Save None buttons in the Unsaved Files dialog didn't work if there was only one unsaved file (http://bugs.openmpt.org/view.php?id=206). [Fix] <js> A known file extension shouldn't suggest a wrong file extension in the WAV / MP3 export dialog anymore (http://bugs.openmpt.org/view.php?id=298). @@ -956,7 +1183,7 @@ [Mod] <js> Revamped MIDI Mapping and Tuning dialogs a bit. [Mod] <js> Added some missing shortcuts to the default key bindings (tx Wayfinder). [Mod] <js> Compatibility export hints are now hideable. - [Mod] <js> Updated libraries: unmo3.dll (2.4.0.3), SoundTouch (1.6.0), zlib (1.2.7). + [Mod] <js> Updated libraries: unmo3 (2.4.0.3), SoundTouch (1.6.0), zlib (1.2.7). [Fix] <js> Wave Export: Fixed infinitely looping export (http://forum.openmpt.org/index.php?topic=3874.0). [Fix] <js> BPM approximation also works reliably when a module is not playing now. [Fix] <js> Song length estimation for alternative tempo mode was compltely wrong (tx Bavi H). @@ -1007,7 +1234,7 @@ Pattern tab [Imp] <js> Channel Surround status is now also indicated in the status bar. - [Fix] <js> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall".) + [Fix] <js> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occur while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall".) [Fix] <js> Shift + Channel Dragging killed the last channel (http://bugs.openmpt.org/view.php?id=133). [Fix] <js> When using the pattern play controls (e.g. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore. [Fix] <js> Songs shouldn't stop anymore after playing them one time and if playback was initially started using a pattern play mode with loop enabled (http://bugs.openmpt.org/view.php?id=11) @@ -1172,7 +1399,7 @@ VST::Specific Plugin Fixes [Fix] <js> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). - [Fix] <js> The EnergyXT GUI does now also work after closing and re-opening the VST editor (http://forum.openmpt.org/index.php?topic=2307.0). + [Fix] <js> EnergyXT / ProteusVX GUIs stopped working after closing and re-opening the VST editor (http://forum.openmpt.org/index.php?topic=2307.0). Mod Conversion [Imp] <js> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command. @@ -1264,7 +1491,7 @@ [Mod] <js> When using non-ACM MP3 codecs (e.g. lame_enc.dll), 320kbit/s bitrate is now available. [Mod] <js> "No extra-loud samples" is now enabled by default (as it's more suitable for mixmodes RC3 and Original) [Mod] <js> 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] <js> Updated unmo3.dll to version 2.4.0.1 + [Mod] <js> Updated unmo3 to version 2.4.0.1 [Mod] <js> Updated the internet link list in the Help menu. [Fix] <js> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format (tx Skaven). [Fix] <js> Mod Cleanup: Various sample / instrument rearranging functions broke Parameter Control Events. @@ -1338,7 +1565,7 @@ XM::Compatible Playback Mode [Fix] <js> Various fixes to the pattern loop command (E6x), including a crucial FT2 bug: When E60 is used on a pattern row x, the following pattern also starts from row x instead of the beginning of the pattern, unless there was a Dxx or Cxx effect. - [Fix] <js> Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. This occours for example in the bassline (channel 11) of jt_burn.xm. + [Fix] <js> Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. This occurs for example in the bassline (channel 11) of jt_burn.xm. XM::Saving [Imp] <js> Panbrello is not saved anymore in compatibility mode. @@ -1363,9 +1590,11 @@ [Imp] <js> Added mnemonics to the wave export controls. [Mod] <js> In the mod type dialog, the "misc flags" can now be toggled using check buttons instead of an edit field. [Mod] <js> Various file loaders / savers: A new logging mechanism is used to display only one message box with errors and warnings instead of many message boxes. + [Fix] <js> Colour Setup: Some colours in the MPT default colour scheme were not set up properly when switching between presets. + +Installer/release package [Mod] <js> Updated DE_jojo.mkb to include new shortcuts, remapped a few others (for IT-style). [Mod] <js> Updated FR_mpt_(legovitch).mkb and NO_mpt_classic_(rakib).mkb (tx Paul Legovitch, Rakib). - [Fix] <js> Colour Setup: Some colours in the MPT default colour scheme were not set up properly when switching between presets. v1.18.02.00 (30 May 2010, revision 610) @@ -1448,7 +1677,7 @@ [Imp] <js> Improved order dragging; It is now also possible to drag an order into a non-MPTM module. In that case, the old orderlist will be replaced. [Imp] <js> J2B files were not shown in the tree view. [Fix] <js> Soundfont samples were not playing correctly anymore. Note that soundfont samples in the MIDI library still don't work. - [Fix] <js> A crash could occour if the instrument library path was too long (e.g. because of malicious strings in the [Paths] section of the INI file) + [Fix] <js> A crash could occur if the instrument library path was too long (e.g. because of malicious strings in the [Paths] section of the INI file) [Fix] <js> "Bypass" action for plugins didn't set the document as modified. [Fix] <js> Right-Click on module -> Close didn't ask for confirmation when the document was modified. [Fix] <js> Insert/Duplicate sequence actions didn't set the document modified. Grey out those two actions if no additional sequences can be added. @@ -1539,7 +1768,7 @@ Wave Export [New] <js> It is now also possible to render by instrument (i.e. one wave file per instrument). [Imp] <js> The "render by channel" mode ignores empty channels now. - [Imp] <js> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours. + [Imp] <js> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occurs. Misc [New] <js> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). @@ -1737,8 +1966,6 @@ [Fix] <js> When no INI file was present, channel separators were completely black. Keymaps - [New] <js> Three new keymaps: French Laptop by Paul Legovitch, Norwegian MPT Classic by Rakib, US_mpt_classic_(snu). - [Mod] <js> Updated DE_jojo.mkb. [Imp] <js> When loading a keymap file and unrecognized lines are found, only one message box is shown. [Mod] <js> All keymaps have been updated to version 1 and updated to contain the orderlist shortcuts. [Fix] <js> Keymap files have a version number now (currently version 1). If keymap file doesn't have a version number (that's version 0), the orderlist keys will be added automatically so that orderlist remains usable in new builds. @@ -1774,7 +2001,11 @@ [Fix] <al> Autosave: 'Modified since last autosave'-flag wasn't always updated. [Fix] <al> Fixes to handling of 32 chars long instrument name. +Release package + [New] <js> Three new keymaps: French Laptop by Paul Legovitch, Norwegian MPT Classic by Rakib, US_mpt_classic_(snu). + [Mod] <js> Updated DE_jojo.mkb. + v1.17.03.02 (22 September 2009, revision 371) internal test build ----------------------------------------------------------------- General tab @@ -2134,14 +2365,14 @@ MOD [Fix] <al, js> Fixes to MOD saving: it should now be possible to create ProTracker compatible MOD files with compatibility export. (rev. 256) -Package template - [Mod] <js> Updated DE_jojo.mkb keymap. - Misc [Fix] <from libmodplug> Fix to faulty portamento handling on loading AMF. [Fix] <various> Lots of smaller bug fixes. +Release package + [Mod] <js> Updated DE_jojo.mkb keymap. + v1.17.02.52 (14 Apr 2008, revision 210) --------------------------------------- [Fix] <al> Shouldn't need winhttp anymore (at least now that updatecheck is disabled). Dependency caused problems in Win98. @@ -2302,7 +2533,7 @@ v1.17.02.45 ----------- - [New] <re & Alex> "Pitch to tempo lock" instrument setting: define the tempo at which your instrument loops correctly, and it will be pitched automatically to match the song's current tempo. + [New] <al & Alex> "Pitch to tempo lock" instrument setting: define the tempo at which your instrument loops correctly, and it will be pitched automatically to match the song's current tempo. [New] <al> Notification when attempting to modify pattern but pattern record is off. [New] <al> Orderlist margins: you can define how many slots to keep visible around the active pattern as the orderlist scrolls [Fix] <al> Fixes for various unexpected pattern loop state changes. @@ -2468,7 +2699,7 @@ v1.17.02.29 ----------- [Fix] <rf> Fixed 3 digit instrument numbers when there are less than 100 instruments. (http://www.modplug.com/forum/viewtopic.php?p=42006) - [Fix] <rf> Fixed crash in plugin DNA/NNA check we transitionning between existing and non existing instruments. (http://www.modplug.com/forum/viewtopic.php?p=42006) + [Fix] <rf> Fixed crash in plugin DNA/NNA check we transitioning between existing and non existing instruments. (http://www.modplug.com/forum/viewtopic.php?p=42006) v1.17.02.28 (official RC2 release) Added: trunk/OpenMPT/packageTemplate/OMPT_1.23_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.23_ReleaseNotes.html (rev 0) +++ trunk/OpenMPT/packageTemplate/OMPT_1.23_ReleaseNotes.html 2014-03-29 19:36:51 UTC (rev 3998) @@ -0,0 +1,200 @@ +<?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.23 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: Calibri, sans-serif; } + body + { + color: #222; + background: #eee; + font-size: 13pt; + margin: 0 0 1em 0; + padding: 0; + border: none; + } + + a { color: #b30; text-decoration: none; } + a:visited { color: #910; text-decoration: none; } + a:hover { text-decoration: underline; } + + .screenshots + { + float:right; + text-align:right; + } + + .screenshots img, h1 + { + border: 1px solid #ccc; + padding: 3px; + background: #f0f0f0; + margin: 0 0 3px 3px; + } + + p { margin: 0.5em 1em; padding: 0; } + + h1 + { + margin: 0 0 1em 0; + padding: 10px; + font-size: 24pt; + color: #444; + text-shadow: 1px 1px 1px #999; + background: #ddd; + background-image: linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -o-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -moz-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -ms-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.2, #ddd), color-stop(0.6, #eee)); + border-width: 0 0 1px 0; + } + + h1 img { vertical-align: middle; margin-right: 1em; } + + h2, h3, h4 + { + border: 1px solid #ccc; + border-width: 0 0 0 3em; + margin: 1em 0.5em; + padding: 0px 5px; + font-size: 18pt; + color: #333; + text-shadow: 1px 1px #fff; + } + + h3 { border-left-width: 2em; } + h4 { border-left-width: 1em; } + + li {list-style-type: none; padding: 0 0 0.5em 0; } + li:before { content: "» "; } + + li li { padding: 0; } + + /* use this for pattern data */ + pre + { + font-family: monospace; + display: inline; + color: #006; + } + + tt + { + font-family: monospace; + } + + </style> + </head> + <body> + + <h1> + <img src="ReleaseNotesImages/general/modplug.png" width="81" height="80" alt="OpenMPT Logo" /> + OpenMPT 1.23 - Release Notes + </h1> + + <p> + It's been a while since the last official release (version 1.22.07.00), and we have been working on a bunch of great new features for this new version. + This document should give a rough overview about the greatest ... [truncated message content] |
From: <sag...@us...> - 2014-03-31 23:05:37
|
Revision: 4000 http://sourceforge.net/p/modplug/code/4000 Author: saga-games Date: 2014-03-31 23:05:27 +0000 (Mon, 31 Mar 2014) Log Message: ----------- [Fix] Pattern tab: When "loop pattern" was enabled, jumping between patterns could still trigger synced samples while playback was paused. [Fix] Pattern tab: Modifying a pattern should now always update other pattern views of the same song properly. [Fix] DefaultTemplate option was looking for the template file in the wrong paths. [Mod] OpenMPT: Version is now 1.23.01.01 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/common/versionNumber.h 2014-03-31 23:05:27 UTC (rev 4000) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 01 -#define VER_MINORMINOR 00 +#define VER_MINORMINOR 01 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2014-03-31 23:05:27 UTC (rev 4000) @@ -332,7 +332,7 @@ sndFile.m_PlayState.m_nNextRow = 0; // update channel parameters and play time - m_pModDoc.SetElapsedTime(m_nScrollPos, 0, true); + m_pModDoc.SetElapsedTime(m_nScrollPos, 0, !sndFile.m_SongFlags[SONG_PAUSED | SONG_STEP]); changedPos = true; } else if(m_pParent.GetFollowSong()) Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-03-31 23:05:27 UTC (rev 4000) @@ -220,9 +220,13 @@ } -void CViewPattern::UpdateView(DWORD dwHintMask, CObject *) -//-------------------------------------------------------- +void CViewPattern::UpdateView(DWORD dwHintMask, CObject *hint) +//------------------------------------------------------------ { + if(hint == this) + { + return; + } if(dwHintMask & HINT_MPTOPTIONS) { UpdateColors(); @@ -238,14 +242,17 @@ } const PATTERNINDEX updatePat = (dwHintMask >> HINT_SHIFT_PAT); - if(HintFlagPart(dwHintMask) == HINT_PATTERNDATA && m_nPattern != updatePat && updatePat != 0) + if(HintFlagPart(dwHintMask) == HINT_PATTERNDATA + && m_nPattern != updatePat + && updatePat != 0 + && updatePat != GetNextPattern() + && updatePat != GetPrevPattern()) return; if(dwHintMask & (HINT_MODTYPE|HINT_PATTERNDATA)) { InvalidatePattern(false); - } else - if(dwHintMask & HINT_PATTERNROW) + } else if(dwHintMask & HINT_PATTERNROW) { InvalidateRow(dwHintMask >> HINT_SHIFT_ROW); } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-03-31 23:05:27 UTC (rev 4000) @@ -1033,7 +1033,7 @@ const mpt::PathString templateFile = TrackerSettings::Instance().defaultTemplateFile; if(!templateFile.empty()) { - const mpt::PathString dirs[] = { GetConfigPath(), GetAppDirPath(), mpt::PathString() }; + const mpt::PathString dirs[] = { GetConfigPath() + MPT_PATHSTRING("TemplateModules\\"), GetAppDirPath() + MPT_PATHSTRING("TemplateModules\\"), mpt::PathString() }; for(size_t i = 0; i < CountOf(dirs); i++) { if(Util::sdOs::IsPathFileAvailable(dirs[i] + templateFile, Util::sdOs::FileModeExists)) Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-03-31 23:05:27 UTC (rev 4000) @@ -389,10 +389,7 @@ if(pModDoc != nullptr) { pModDoc->SetModified(); - if(updateAllViews) - { - pModDoc->UpdateAllViews(this, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL); - } + pModDoc->UpdateAllViews(this, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), updateAllViews ? nullptr : this); } } @@ -1332,7 +1329,7 @@ SetCurrentPattern(m_nPattern); } InvalidatePattern(true); - pModDoc->SetModified(); + SetModified(false); } } break; @@ -1688,7 +1685,7 @@ void CViewPattern::OnMuteFromClick() //---------------------------------- { - OnMuteChannel(false); + OnMuteChannel(m_MenuCursor.GetChannel()); } @@ -3129,7 +3126,7 @@ SetCursorPosition(begin); SetCurSel(destination); InvalidatePattern(); - pModDoc->SetModified(); + SetModified(false); EndWaitCursor(); } @@ -3323,7 +3320,6 @@ PATTERNINDEX pat = undo ? pModDoc->GetPatternUndo().Undo() : pModDoc->GetPatternUndo().Redo(); if(pat < pModDoc->GetSoundFile()->Patterns.Size()) { - pModDoc->SetModified(); if(pat != m_nPattern) { // Find pattern in sequence. @@ -3337,6 +3333,7 @@ { InvalidatePattern(true); } + SetModified(false); SanitizeCursor(); } } @@ -4916,7 +4913,7 @@ pTarget->vol = 0; } - pModDoc->SetModified(); + SetModified(false); if(editPos.pattern == m_nPattern) { @@ -5246,7 +5243,7 @@ if(modified) // Has it really changed? { - pModDoc->SetModified(); + SetModified(false); if(editPos.pattern == m_nPattern) InvalidateCell(sel); else @@ -5444,7 +5441,7 @@ { rowBase[n] = newRow[n]; } - pModDoc->SetModified(); + SetModified(false); InvalidateRow(); UpdateIndicator(); } @@ -5647,6 +5644,28 @@ } +// Get previous pattern in order list +PATTERNINDEX CViewPattern::GetPrevPattern() const +//----------------------------------------------- +{ + const CSoundFile *sndFile = GetSoundFile(); + if(sndFile != nullptr) + { + const ORDERINDEX curOrder = GetCurrentOrder(); + if(curOrder > 0 && m_nPattern == sndFile->Order[curOrder]) + { + const ORDERINDEX nextOrder = sndFile->Order.GetPreviousOrderIgnoringSkips(curOrder); + const PATTERNINDEX nextPat = sndFile->Order[nextOrder]; + if(sndFile->Patterns.IsValidPat(nextPat) && sndFile->Patterns[nextPat].GetNumRows()) + { + return nextPat; + } + } + } + return PATTERNINDEX_INVALID; +} + + // Get follow-up pattern in order list PATTERNINDEX CViewPattern::GetNextPattern() const //----------------------------------------------- @@ -6826,7 +6845,7 @@ if(result) { GetDocument()->SetModified(); - GetDocument()->UpdateAllViews(NULL, HINT_MODSEQUENCE | HINT_PATTERNDATA | (pos.pattern << HINT_SHIFT_PAT), NULL); + GetDocument()->UpdateAllViews(NULL, HINT_MODSEQUENCE | HINT_PATTERNDATA | (pos.pattern << HINT_SHIFT_PAT), nullptr); } return result; Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2014-03-29 20:40:09 UTC (rev 3999) +++ trunk/OpenMPT/mptrack/View_pat.h 2014-03-31 23:05:27 UTC (rev 4000) @@ -317,6 +317,7 @@ int ConstructChord(int note, ModCommand::NOTE (&outNotes)[MPTChord::notesPerChord], ModCommand::NOTE baseNote); void QuantizeRow(PATTERNINDEX &pat, ROWINDEX &row) const; + PATTERNINDEX GetPrevPattern() const; PATTERNINDEX GetNextPattern() const; void SetSpacing(int n); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-09 19:13:15
|
Revision: 4006 http://sourceforge.net/p/modplug/code/4006 Author: saga-games Date: 2014-04-09 19:13:07 +0000 (Wed, 09 Apr 2014) Log Message: ----------- [Fix] Message when removing instrument was never shown [Fix] Some sample editor updates were incomplete. [Fix] Song time signature ignoring stopped working for older MPT versions a while ago. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -3024,7 +3024,7 @@ if(nCode == SB_ENDSCROLL) SwitchToView(); if(redraw) { - SetModified(HINT_SAMPLEINFO, false); + SetModified(HINT_SAMPLEINFO | HINT_SAMPLEDATA, false); } UnlockControls(); } Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -863,9 +863,7 @@ { bool instrumentsLeft = false; ConfirmAnswer result = cnfNo; - std::vector<bool> samples; - m_SndFile.Instruments[nIns]->GetSamples(samples); - if(!samples.empty()) result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); + if(!m_SndFile.Instruments[nIns]->GetSamples().empty()) result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); if(result == cnfCancel) { return false; Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -2049,7 +2049,7 @@ sample.PrecomputeLoops(sndFile); } SetCurSel(0, 0); - SetModified(dwUpdateFlags, false); + SetModified(dwUpdateFlags, true); } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -413,25 +413,6 @@ if(GetType() == MOD_TYPE_IT) mptStartPos = file.GetLength(); - // Read row highlights - if((fileHeader.special & ITFileHeader::embedPatternHighlights)) - { - // MPT 1.09, 1.07 and most likely other old MPT versions leave this blank (0/0), but have the "special" flag set. - // Newer versions of MPT and OpenMPT 1.17 *always* write 4/16 here. - // Thus, we will just ignore those old versions. - if(m_dwLastSavedWithVersion == 0 || m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 03, 02)) - { - m_nDefaultRowsPerBeat = fileHeader.highlight_minor; - m_nDefaultRowsPerMeasure = fileHeader.highlight_major; - } -#ifdef _DEBUG - if((fileHeader.highlight_minor | fileHeader.highlight_major) == 0) - { - Log("IT Header: Row highlight is 0"); - } -#endif - } - m_SongFlags.set(SONG_LINEARSLIDES, (fileHeader.flags & ITFileHeader::linearSlides) != 0); m_SongFlags.set(SONG_ITOLDEFFECTS, (fileHeader.flags & ITFileHeader::itOldEffects) != 0); m_SongFlags.set(SONG_ITCOMPATGXX, (fileHeader.flags & ITFileHeader::itCompatGxx) != 0); @@ -1001,6 +982,19 @@ } } + // Read row highlights + if((fileHeader.special & ITFileHeader::embedPatternHighlights)) + { + // MPT 1.09 and older (and maybe also newer) versions leave this blank (0/0), but have the "special" flag set. + // Newer versions of MPT and OpenMPT 1.17 *always* write 4/16 here. + // Thus, we will just ignore those old versions. + if(m_dwLastSavedWithVersion == 0 || m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 03, 02)) + { + m_nDefaultRowsPerBeat = fileHeader.highlight_minor; + m_nDefaultRowsPerMeasure = fileHeader.highlight_major; + } + } + if(GetType() == MOD_TYPE_IT) { // Set appropriate mod flags if the file was not made with MPT. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-09 19:20:35
|
Revision: 4007 http://sourceforge.net/p/modplug/code/4007 Author: saga-games Date: 2014-04-09 19:20:28 +0000 (Wed, 09 Apr 2014) Log Message: ----------- [Fix] Duplicating a sample through the treeview tried to allocate way too much memory, which could result in crashes (http://bugs.openmpt.org/view.php?id=505) [Mod] OpenMPT: Version is now 1.23.01.02. Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Modedit.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-04-09 19:13:07 UTC (rev 4006) +++ trunk/OpenMPT/common/versionNumber.h 2014-04-09 19:20:28 UTC (rev 4007) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 01 -#define VER_MINORMINOR 01 +#define VER_MINORMINOR 02 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 19:13:07 UTC (rev 4006) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 19:20:28 UTC (rev 4007) @@ -335,9 +335,15 @@ if(--sampleCount[origSlot] > 0 && sampleHeaders[origSlot].pSample != nullptr) { // This sample slot is referenced multiple times, so we have to copy the actual sample. - target.pSample = ModSample::AllocateSample(target.nLength, target.GetSampleSizeInBytes()); - memcpy(target.pSample, sampleHeaders[origSlot].pSample, target.GetSampleSizeInBytes()); - target.PrecomputeLoops(m_SndFile, false); + target.pSample = ModSample::AllocateSample(target.nLength, target.GetBytesPerSample()); + if(target.pSample != nullptr) + { + memcpy(target.pSample, sampleHeaders[origSlot].pSample, target.GetBytesPerSample()); + target.PrecomputeLoops(m_SndFile, false); + } else + { + Reporting::Error("Cannot duplicate sample - out of memory!"); + } } strcpy(m_SndFile.m_szNames[i + 1], sampleNames[origSlot].c_str()); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-14 14:15:49
|
Revision: 4012 http://sourceforge.net/p/modplug/code/4012 Author: saga-games Date: 2014-04-14 14:15:39 +0000 (Mon, 14 Apr 2014) Log Message: ----------- [Fix] SF2 import: Fixed potentially off-key sample import [Fix] SF2 import: Sample frequency conversion was broken in 64-bit builds (https://bugs.openmpt.org/view.php?id=508). [Fix] Plugin bridge: Fixed KarmaFX EQ and other plugins that don't set any specific time flags, but still call audioMasterGetTime. [Fix] Pattern tab: Dragging an order selection also works if the first selection point isn't visible. [Fix] Added some tool bar help texts and fixed misplaced label in keyboard config. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/pluginBridge/Bridge.cpp trunk/OpenMPT/soundlib/Dlsbank.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2014-04-13 15:19:18 UTC (rev 4011) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2014-04-14 14:15:39 UTC (rev 4012) @@ -805,9 +805,9 @@ m_nScrollPos2nd = ORDERINDEX_INVALID; SetCurSel(nOrder, true, IsSelectionKeyPressed()); } - m_bDragging = !IsOrderInMargins(m_nScrollPos, oldXScroll); + m_bDragging = !IsOrderInMargins(m_nScrollPos, oldXScroll) || !IsOrderInMargins(m_nScrollPos2nd, oldXScroll); - if(m_bDragging == true) + if(m_bDragging) { m_nDragOrder = GetCurSel(true).firstOrd; m_nDropPos = m_nDragOrder; Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-04-13 15:19:18 UTC (rev 4011) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-04-14 14:15:39 UTC (rev 4012) @@ -211,9 +211,9 @@ LTEXT "If enabled, a randomized user ID is created and transmitted with every update check. This ID can not be linked to you or your computer in any way.",IDC_STATIC,12,102,264,24 GROUPBOX "Advanced Settings",IDC_STATIC,6,138,276,60 LTEXT "&Update server URL:",IDC_STATIC,12,150,186,8 - EDITTEXT IDC_EDIT1,12,162,246,12,ES_AUTOHSCROLL - PUSHBUTTON "&Reset",IDC_BUTTON2,204,146,54,12 - LTEXT "Do not change this unless you are absolutely sure of what you are doing.",IDC_STATIC,12,180,246,12 + EDITTEXT IDC_EDIT1,12,162,264,12,ES_AUTOHSCROLL + PUSHBUTTON "&Reset",IDC_BUTTON2,222,146,54,12 + LTEXT "Do not change this unless you are absolutely sure of what you are doing.",IDC_STATIC,12,180,264,12 PUSHBUTTON "&Check for Updates",IDC_BUTTON1,6,204,84,18 LTEXT "",IDC_LASTUPDATE,6,228,276,24 END @@ -634,7 +634,7 @@ LISTBOX IDC_COMMAND_LIST,5,32,139,226,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP GROUPBOX "Key setup for this command ",IDC_STATIC,150,6,132,84 COMBOBOX IDC_CHOICECOMBO,156,18,78,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Key:",IDC_STATIC,150,38,16,8 + LTEXT "Key:",IDC_STATIC,156,38,16,8 EDITTEXT IDC_CUSTHOTKEY,174,36,60,13,ES_AUTOHSCROLL CONTROL "On Key Down",IDC_CHECKKEYDOWN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,54,66,8 CONTROL "On Key Hold",IDC_CHECKKEYHOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,66,66,8 @@ -2419,6 +2419,8 @@ ID_SAMPLE_TRIM "Delete everything except the current selection\nTrim Sample" ID_FILE_SAVEMIDI "Export the current song to a standard MIDI file" ID_INSTRUMENT_SAMPLEMAP "Edit the sample map" + ID_SAMPLE_ZOOMUP "Zoom In" + ID_SAMPLE_ZOOMDOWN "Zoom Out" 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" @@ -2470,6 +2472,7 @@ BEGIN ID_PANIC "Kill all VSTi and sample voices\nStop all hanging VSTi and sample voices" ID_VIEW_EDITHISTORY "View the edit history of this module" + ID_SAMPLE_GRID "Configure Sample Grid" ID_FILE_SAVEASTEMPLATE "Save the active document as template module\nSave as Template" END Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-04-13 15:19:18 UTC (rev 4011) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2014-04-14 14:15:39 UTC (rev 4012) @@ -13,8 +13,8 @@ // Fix Purity Demo GUI freeze more nicely // Optimize out audioMasterProcessEvents the same way as effProcessEvents? // Find a nice solution for audioMasterIdle that doesn't break TAL-Elek7ro-II -// KaramFX EQ breaks sound // Maybe don't keep opening and closing aux mem files - but they are rarely needed, so would this actually be worth it? +// Kirnu GUI deadlocks // Low priority: // Speed up things like consecutive calls to CVstPlugin::GetFormattedProgramName by a custom opcode (is this necessary?) @@ -33,9 +33,13 @@ #include <algorithm> //#include <cassert> +#ifdef _DEBUG #include <intrin.h> #undef assert #define assert(x) while(!(x)) { ::MessageBoxA(NULL, #x, "Debug Assertion Failed", MB_ICONERROR); __debugbreak(); break; } +#else +#define assert(x) +#endif #include "Bridge.h" #include "../common/thread.h" @@ -50,7 +54,9 @@ WNDCLASSEX PluginBridge::windowClass; #define WINDOWCLASSNAME _T("OpenMPTPluginBridge") +enum { kVstTimeInfoInit = 1 << 31 }; + int _tmain(int argc, TCHAR *argv[]) { if(argc != 2) @@ -348,8 +354,9 @@ msg->result = 0; msg->str[CountOf(msg->str) - 1] = 0; - // TODO DEBUG - //SetConsoleTitleW(msg->str); +#ifdef _CONSOLE + SetConsoleTitleW(msg->str); +#endif nativeEffect = nullptr; library = LoadLibraryW(msg->str); @@ -398,6 +405,9 @@ msg->result = 1; UpdateEffectStruct(); + // Set a custom time info flag that will differ from any other flags on the first audioMasterGetTime call. + // This fixes plugins like KarmaFX EQ that don't send any flags (only query sample frequency). + sharedMem->timeInfo.flags = kVstTimeInfoInit; // Init process buffer DispatchToHost(audioMasterVendorSpecific, kVendorOpenMPT, kUpdateProcessingBuffer, nullptr, 0.0f); @@ -695,6 +705,8 @@ // Audio rendering thread void PluginBridge::RenderThread() { + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); + const HANDLE objects[] = { sigProcess.send, sigThreadExit }; DWORD result = 0; do @@ -811,7 +823,7 @@ offset += msg->sampleFrames; } inPointers = reinterpret_cast<buf_t **>(&samplePointers[0]); - outPointers = reinterpret_cast<buf_t **>(&samplePointers[msg->numInputs]); + outPointers = inPointers + msg->numInputs; } return msg->sampleFrames; @@ -842,7 +854,7 @@ { // During processing, read the cached time info if possible. // Only check validity flags. OpenMPT ignores the other flags anyway, as they are host-to-plugin flags. - value &= (kVstNanosValid | kVstPpqPosValid | kVstTempoValid | kVstBarsValid | kVstCyclePosValid | kVstTimeSigValid | kVstSmpteValid | kVstClockValid); + value &= (kVstNanosValid | kVstPpqPosValid | kVstTempoValid | kVstBarsValid | kVstCyclePosValid | kVstTimeSigValid | kVstSmpteValid | kVstClockValid | kVstTimeInfoInit); if((sharedMem->timeInfo.flags & value) == value) { return ToVstPtr<VstTimeInfo>(&sharedMem->timeInfo); Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2014-04-13 15:19:18 UTC (rev 4011) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2014-04-14 14:15:39 UTC (rev 4012) @@ -1487,17 +1487,17 @@ } -// returns 12*128*(log2(freq/8363)+midiftune/100) +// returns 12*128*log2(freq/8363)+midiftune*(128/100) static int DlsFreqToTranspose(uint32 freq, int nMidiFTune) //-------------------------------------------------------- { + if (!freq) return 0; #ifdef ENABLE_X86 const float _f1_8363 = 1.0f / 8363.0f; const float _factor = 128 * 12; const float _fct_100 = 128.0f / 100.0f; int result; - if (!freq) return 0; _asm { fild nMidiFTune fld _fct_100 @@ -1512,7 +1512,7 @@ } return result; #else - return Util::Round<int>((12 * 128) * log(freq * (1.0f / 8363.0f) + nMidiFTune * (1.0f / 100.0f))); + return Util::Round<int>((12 * 128) * log(freq * (1.0f / 8363.0f)) / log(2.0f) + nMidiFTune * (128.0f / 100.0f)); #endif // ENABLE_X86 } @@ -1631,8 +1631,8 @@ int nBaseTune = DlsFreqToTranspose( sample.nC5Speed, sFineTune+(60 + transpose - usUnityNote)*100); - sample.nFineTune = (int8)(nBaseTune & 0x7F); - sample.RelativeTone = (int8)(nBaseTune >> 7); + sample.nFineTune = static_cast<int8>(nBaseTune & 0x7F); + sample.RelativeTone = mpt::saturate_cast<int8>(nBaseTune >> 7); sample.TransposeToFrequency(); if (lVolume > 256) lVolume = 256; if (lVolume < 16) lVolume = 16; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-22 15:56:58
|
Revision: 4016 http://sourceforge.net/p/modplug/code/4016 Author: saga-games Date: 2014-04-22 15:56:51 +0000 (Tue, 22 Apr 2014) Log Message: ----------- [Fix] Sample tab: Creating a new sample didn't update the sample status in the tree view [Imp] WAV saving: When there's only a sustain loop, write an empty "normal" loop as well so that the sustain loop isn't loaded as a normal loop (like it was done in older versions). [Mod] OpenMPT: Version is now 1.23.01.03. Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/soundlib/WAVTools.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-04-22 15:55:21 UTC (rev 4015) +++ trunk/OpenMPT/common/versionNumber.h 2014-04-22 15:56:51 UTC (rev 4016) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 01 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-22 15:55:21 UTC (rev 4015) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-22 15:56:51 UTC (rev 4016) @@ -2788,7 +2788,7 @@ if(nOldLength != sample.nLength) { SetCurSel(0, 0); - SetModified(HINT_SAMPLEDATA | HINT_SAMPLEINFO, true); + SetModified(HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, true); } } Modified: trunk/OpenMPT/soundlib/WAVTools.cpp =================================================================== --- trunk/OpenMPT/soundlib/WAVTools.cpp 2014-04-22 15:55:21 UTC (rev 4015) +++ trunk/OpenMPT/soundlib/WAVTools.cpp 2014-04-22 15:56:51 UTC (rev 4016) @@ -554,11 +554,17 @@ if(sample.uFlags[CHN_LOOP]) { loops[info.numLoops++].ConvertToWAV(sample.nLoopStart, sample.nLoopEnd, sample.uFlags[CHN_PINGPONGLOOP]); + } else if(sample.uFlags[CHN_SUSTAINLOOP]) + { + // Since there are no "loop types" to distinguish between sustain and normal loops, OpenMPT assumes + // that the first loop is a sustain loop if there are two loops. If we only want a sustain loop, + // we will have to write a second bogus loop. + loops[info.numLoops++].ConvertToWAV(0, 0, false); } info.ConvertEndianness(); Write(info); - for(size_t i = 0; i < info.numLoops; i++) + for(uint32 i = 0; i < info.numLoops; i++) { loops[i].ConvertEndianness(); Write(loops[i]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-27 19:05:09
|
Revision: 4022 http://sourceforge.net/p/modplug/code/4022 Author: saga-games Date: 2014-04-27 19:05:00 +0000 (Sun, 27 Apr 2014) Log Message: ----------- [Imp] Song Properties: Instantly populate tempo mode and mix mode boxes with allowed values when switching between formats. Modified Paths: -------------- trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-04-27 13:44:35 UTC (rev 4021) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-04-27 19:05:00 UTC (rev 4022) @@ -67,6 +67,7 @@ CDialog::OnInitDialog(); m_nType = sndFile.GetType(); m_nChannels = sndFile.GetNumChannels(); + initialized = false; // Mod types @@ -91,47 +92,6 @@ default: m_TypeBox.SetCurSel(0); break; } - // Tempo modes - - // Don't show new tempo modes for XM/IT, unless they are currently used - const bool showNewModes = (sndFile.GetType() == MOD_TYPE_MPT || (sndFile.m_SongFlags[SONG_ITPROJECT] != 0)); - - m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Classic"), tempo_mode_classic); - if(showNewModes || sndFile.m_nTempoMode == tempo_mode_alternative) - m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Alternative"), tempo_mode_alternative); - if(showNewModes || sndFile.m_nTempoMode == tempo_mode_modern) - m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Modern (accurate)"), tempo_mode_modern); - m_TempoModeBox.SetCurSel(0); - for(int i = m_TempoModeBox.GetCount(); i > 0; i--) - { - if(m_TempoModeBox.GetItemData(i) == sndFile.m_nTempoMode) - { - m_TempoModeBox.SetCurSel(i); - break; - } - } - - // Mix levels - - if(showNewModes || sndFile.GetMixLevels() == mixLevels_117RC3) // In XM/IT, this is only shown for backwards compatibility with existing tunes - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3); - if(sndFile.GetMixLevels() == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); - if(sndFile.GetMixLevels() == mixLevels_117RC1) // Dito - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible); - - m_PlugMixBox.SetCurSel(0); - for(int i = m_PlugMixBox.GetCount(); i > 0; i--) - { - if(static_cast<mixLevels>(m_PlugMixBox.GetItemData(i)) == sndFile.GetMixLevels()) - { - m_PlugMixBox.SetCurSel(i); - break; - } - } - // Misc flags CheckDlgButton(IDC_CHK_COMPATPLAY, sndFile.GetModFlag(MSF_COMPATIBLE_PLAY)); @@ -157,6 +117,7 @@ SetDlgItemText(IDC_EDIT_SAVEDWITH, sndFile.madeWithTracker.c_str()); UpdateDialog(); + initialized = true; EnableToolTips(TRUE); return TRUE; } @@ -254,6 +215,49 @@ GetDlgItem(IDC_CHK_OLDRANDOM)->EnableWindow((ITorMPT && sndFile.GetModFlag(MSF_OLDVOLSWING)) ? TRUE : FALSE); GetDlgItem(IDC_CHK_OLDPITCH)->EnableWindow(sndFile.GetModFlag(MSF_OLD_MIDI_PITCHBENDS) ? TRUE : FALSE); + // Tempo modes + const tempoMode oldTempoMode = initialized ? static_cast<tempoMode>(m_TempoModeBox.GetItemData(m_TempoModeBox.GetCurSel())) : sndFile.m_nTempoMode; + m_TempoModeBox.ResetContent(); + // Don't show new tempo modes for XM/IT, unless they are currently used + const bool showNewModes = (type == MOD_TYPE_MPT || (sndFile.m_SongFlags[SONG_ITPROJECT] != 0)); + + m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Classic"), tempo_mode_classic); + if(showNewModes || sndFile.m_nTempoMode == tempo_mode_alternative) + m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Alternative"), tempo_mode_alternative); + if(showNewModes || sndFile.m_nTempoMode == tempo_mode_modern) + m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Modern (accurate)"), tempo_mode_modern); + m_TempoModeBox.SetCurSel(0); + for(int i = m_TempoModeBox.GetCount(); i > 0; i--) + { + if(static_cast<tempoMode>(m_TempoModeBox.GetItemData(i)) == oldTempoMode) + { + m_TempoModeBox.SetCurSel(i); + break; + } + } + + // Mix levels + const mixLevels oldMixLevels = initialized ? static_cast<mixLevels>(m_PlugMixBox.GetItemData(m_PlugMixBox.GetCurSel())) : sndFile.GetMixLevels(); + m_PlugMixBox.ResetContent(); + if(showNewModes || sndFile.GetMixLevels() == mixLevels_117RC3) // In XM/IT, this is only shown for backwards compatibility with existing tunes + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3); + if(sndFile.GetMixLevels() == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); + if(sndFile.GetMixLevels() == mixLevels_117RC1) // Ditto + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible); + + m_PlugMixBox.SetCurSel(0); + for(int i = m_PlugMixBox.GetCount(); i > 0; i--) + { + if(static_cast<mixLevels>(m_PlugMixBox.GetItemData(i)) == oldMixLevels) + { + m_PlugMixBox.SetCurSel(i); + break; + } + } + // Mixmode Box GetDlgItem(IDC_TEXT_MIXMODE)->ShowWindow(XMorITorMPT); m_PlugMixBox.ShowWindow(XMorITorMPT); @@ -294,9 +298,9 @@ int temp_nRPB = GetDlgItemInt(IDC_ROWSPERBEAT); int temp_nRPM = GetDlgItemInt(IDC_ROWSPERMEASURE); - if ((temp_nRPB > temp_nRPM)) + if(temp_nRPB > temp_nRPM) { - Reporting::Warning("Error: Rows per measure must be greater than or equal rows per beat."); + Reporting::Warning("Error: Rows per measure must be greater than or equal to rows per beat."); GetDlgItem(IDC_ROWSPERMEASURE)->SetFocus(); return false; } @@ -306,7 +310,7 @@ CHANNELINDEX maxChans = CSoundFile::GetModSpecifications(type).channelsMax; - if (sel > maxChans) + if(sel > maxChans) { CString error; error.Format("Error: Maximum number of channels for this module type is %d.", maxChans); @@ -361,7 +365,7 @@ sel = m_TempoModeBox.GetCurSel(); if (sel >= 0) { - sndFile.m_nTempoMode = m_TempoModeBox.GetItemData(sel); + sndFile.m_nTempoMode = static_cast<tempoMode>(m_TempoModeBox.GetItemData(sel)); } sel = m_PlugMixBox.GetCurSel(); @@ -452,8 +456,6 @@ if(pNMHDR->code == TTN_NEEDTEXTA) { - //strncpy_s(pTTTA->szText, sizeof(pTTTA->szText), strTipText, - // strTipText.GetLength() + 1); // 80 chars max?! mpt::String::CopyN(pTTTA->szText, strTipText); } else Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2014-04-27 13:44:35 UTC (rev 4021) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2014-04-27 19:05:00 UTC (rev 4022) @@ -24,6 +24,7 @@ CSoundFile &sndFile; CHANNELINDEX m_nChannels; MODTYPE m_nType; + bool initialized; // -> CODE#0023 // -> DESC="IT project files (.itp)" Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-04-27 13:44:35 UTC (rev 4021) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-04-27 19:05:00 UTC (rev 4022) @@ -1011,7 +1011,7 @@ CONTROL "Fast &Volume Slides (S3M)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,84,96,10 CONTROL "Compatible &Gxx (IT)",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,84,84,10 CONTROL "Extended &filter range",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,96,81,10 - CONTROL "&ProTracker 1.x Mode (MOD)",IDC_CHECK_PT1X,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,108,10 + CONTROL "&ProTracker 1/2 Mode (MOD)",IDC_CHECK_PT1X,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,108,10 GROUPBOX "Extended Playback Options (OpenMPT only)",IDC_FRAME_MPTEXT,6,120,246,84 LTEXT "Mix Levels:",IDC_TEXT_MIXMODE,18,134,42,8 COMBOBOX IDC_COMBO_MIXLEVELS,60,132,84,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -2371,6 +2371,8 @@ BEGIN ID_EDIT_GOTO_MENU "Go to row / channel / pattern / order" ID_CLEANUP_COMPO "Reset attributes to defaults (useful for creating sample packs)\nCompo Cleanup" + ID_SAMPLE_DRAW "Toggle Sample Drawing" + ID_SAMPLE_ADDSILENCE "Add Silence / Create Sample" ID_OVERFLOWPASTE "Toggle overflow paste\nToggle overflow paste" END Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-27 13:44:35 UTC (rev 4021) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-27 19:05:00 UTC (rev 4022) @@ -2011,7 +2011,11 @@ } } - WRITEMODULAR('T','M','.','.', m_nTempoMode); + { + WRITEMODULARHEADER('T','M','.','.', 1); + uint8 mode = static_cast<uint8>(m_nTempoMode); + fwrite(&mode, sizeof(mode), 1, f); + } WRITEMODULAR('P','M','M','.', m_nMixLevels); @@ -2158,7 +2162,7 @@ case MAGIC4BE('R','P','B','.'): ReadField(chunk, size, m_nDefaultRowsPerBeat); break; case MAGIC4BE('R','P','M','.'): ReadField(chunk, size, m_nDefaultRowsPerMeasure); break; case MAGIC4BE('C','.','.','.'): if(modtype != MOD_TYPE_XM) ReadField(chunk, size, m_nChannels); break; - case MAGIC4BE('T','M','.','.'): ReadField(chunk, size, m_nTempoMode); break; + case MAGIC4BE('T','M','.','.'): ReadFieldCast(chunk, size, m_nTempoMode); break; case MAGIC4BE('P','M','M','.'): ReadFieldCast(chunk, size, m_nMixLevels); break; case MAGIC4BE('C','W','V','.'): ReadField(chunk, size, m_dwCreatedWithVersion); break; case MAGIC4BE('L','S','W','V'): ReadField(chunk, size, m_dwLastSavedWithVersion); break; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2014-04-27 13:44:35 UTC (rev 4021) +++ trunk/OpenMPT/soundlib/Sndfile.h 2014-04-27 19:05:00 UTC (rev 4022) @@ -380,7 +380,7 @@ CHANNELINDEX m_nMixStat; public: ROWINDEX m_nDefaultRowsPerBeat, m_nDefaultRowsPerMeasure; // default rows per beat and measure for this module // rewbs.betterBPM - BYTE m_nTempoMode; + tempoMode m_nTempoMode; ORDERINDEX m_nRestartPos; #ifdef MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-04-29 17:09:19
|
Revision: 4023 http://sourceforge.net/p/modplug/code/4023 Author: saga-games Date: 2014-04-29 17:09:05 +0000 (Tue, 29 Apr 2014) Log Message: ----------- [Mod] XM: Added a new mix mode "Compatible (FT2 Pan Law)" which is the same as the "compatible" mix mode, but this enforces FT2's pan law, while the "normal" compatible mixmode no longer does so. This should make tunes created with older versions of OpenMPT not break drastically anymore if they make use of a lot of panning stuff. The FT2 Pan Law mode is used for new XMs and XMs made with other programs. [Imp] Made S3M amiga frequency limits option editable from song properties dialog. [Mod] OpenMPT: Version is now 1.23.01.04. Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp trunk/OpenMPT/soundlib/SoundFilePlayConfig.h trunk/OpenMPT/soundlib/mod_specifications.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/common/versionNumber.h 2014-04-29 17:09:05 UTC (rev 4023) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 01 -#define VER_MINORMINOR 03 +#define VER_MINORMINOR 04 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -534,7 +534,7 @@ { m_SndFile.SetMixLevels(mixLevels_compatible); } - if(oldTypeIsMPT && m_SndFile.GetMixLevels() != mixLevels_compatible) + if(oldTypeIsMPT && m_SndFile.GetMixLevels() != mixLevels_compatible && m_SndFile.GetMixLevels() != mixLevels_compatible_FT2) { CHANGEMODTYPE_WARNING(wMixmode); } Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -9,20 +9,18 @@ #include "stdafx.h" -#include "mptrack.h" -#include "moddoc.h" -#include "mainfrm.h" +#include "Mptrack.h" +#include "Moddoc.h" +#include "Mainfrm.h" #include "dlg_misc.h" #include "Dlsbank.h" #include "ChildFrm.h" -#include "vstplug.h" +#include "Vstplug.h" #include "ChannelManagerDlg.h" #include "../common/version.h" #include "../common/StringFixer.h" -#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" - /////////////////////////////////////////////////////////////////////// // CModTypeDlg @@ -56,6 +54,7 @@ DDX_Control(pDX, IDC_CHECK5, m_CheckBox5); DDX_Control(pDX, IDC_CHECK6, m_CheckBox6); DDX_Control(pDX, IDC_CHECK_PT1X, m_CheckBoxPT1x); + DDX_Control(pDX, IDC_CHECK_AMIGALIMITS, m_CheckBoxAmigaLimits); //}}AFX_DATA_MAP } @@ -107,13 +106,7 @@ // Version information - SetDlgItemText(IDC_TEXT_CREATEDWITH, "Created with:"); - SetDlgItemText(IDC_TEXT_SAVEDWITH, "Last saved with:"); - - SetDlgItemText(IDC_EDIT_CREATEDWITH, FormatVersionNumber(sndFile.m_dwCreatedWithVersion)); -// if(sndFile.m_dwLastSavedWithVersion) -// SetDlgItemText(IDC_EDIT_SAVEDWITH, FormatVersionNumber(sndFile.m_dwLastSavedWithVersion)); -// else + if(sndFile.m_dwCreatedWithVersion) SetDlgItemText(IDC_EDIT_CREATEDWITH, "OpenMPT " + FormatVersionNumber(sndFile.m_dwCreatedWithVersion)); SetDlgItemText(IDC_EDIT_SAVEDWITH, sndFile.madeWithTracker.c_str()); UpdateDialog(); @@ -134,7 +127,7 @@ //----------------------------------- { const MODTYPE type = static_cast<MODTYPE>(m_TypeBox.GetItemData(m_TypeBox.GetCurSel())); - CHANNELINDEX currChanSel = m_ChannelsBox.GetItemData(m_ChannelsBox.GetCurSel()); + CHANNELINDEX currChanSel = static_cast<CHANNELINDEX>(m_ChannelsBox.GetItemData(m_ChannelsBox.GetCurSel())); const CHANNELINDEX minChans = CSoundFile::GetModSpecifications(type).channelsMin; const CHANNELINDEX maxChans = CSoundFile::GetModSpecifications(type).channelsMax; @@ -172,6 +165,7 @@ m_CheckBox4.SetCheck(sndFile.m_SongFlags[SONG_ITCOMPATGXX] ? BST_CHECKED : BST_UNCHECKED); m_CheckBox5.SetCheck(sndFile.m_SongFlags[SONG_EXFILTERRANGE] ? BST_CHECKED : BST_UNCHECKED); m_CheckBoxPT1x.SetCheck(sndFile.m_SongFlags[SONG_PT1XMODE] ? BST_CHECKED : BST_UNCHECKED); + m_CheckBoxAmigaLimits.SetCheck(sndFile.m_SongFlags[SONG_AMIGALIMITS] ? BST_CHECKED : BST_UNCHECKED); // -> CODE#0023 // -> DESC="IT project files (.itp)" @@ -185,7 +179,11 @@ m_CheckBox4.EnableWindow(allowedFlags[SONG_ITCOMPATGXX]); m_CheckBox5.EnableWindow(allowedFlags[SONG_EXFILTERRANGE]); m_CheckBoxPT1x.EnableWindow(allowedFlags[SONG_PT1XMODE]); + m_CheckBoxAmigaLimits.EnableWindow(allowedFlags[SONG_AMIGALIMITS]); + m_CheckBoxPT1x.ShowWindow(type != MOD_TYPE_S3M ? SW_SHOW : SW_HIDE); + m_CheckBoxAmigaLimits.ShowWindow(type == MOD_TYPE_S3M ? SW_SHOW : SW_HIDE); + // -> CODE#0023 // -> DESC="IT project files (.itp)" m_CheckBox6.EnableWindow(m_TypeBox.GetCurSel() == 4 ? TRUE : FALSE); @@ -247,6 +245,8 @@ m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible); + if(type == MOD_TYPE_XM) + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible (FT2 Pan Law)"), mixLevels_compatible_FT2); m_PlugMixBox.SetCurSel(0); for(int i = m_PlugMixBox.GetCount(); i > 0; i--) @@ -354,12 +354,12 @@ sndFile.m_SongFlags.set(SONG_EXFILTERRANGE, m_CheckBox5.GetCheck() != BST_UNCHECKED); sndFile.m_SongFlags.set(SONG_ITPEMBEDIH, m_CheckBox6.GetCheck() != BST_UNCHECKED); sndFile.m_SongFlags.set(SONG_PT1XMODE, m_CheckBoxPT1x.GetCheck() != BST_UNCHECKED); + sndFile.m_SongFlags.set(SONG_AMIGALIMITS, m_CheckBoxAmigaLimits.GetCheck() != BST_UNCHECKED); sel = m_ChannelsBox.GetCurSel(); if (sel >= 0) { m_nChannels = static_cast<CHANNELINDEX>(m_ChannelsBox.GetItemData(sel)); - //if (m_nType & MOD_TYPE_XM) m_nChannels = (m_nChannels+1) & 0xFE; } sel = m_TempoModeBox.GetCurSel(); @@ -492,22 +492,16 @@ /////////////////////////////////////////////////////////// // CRemoveChannelsDlg -//rewbs.removeChansDlgCleanup void CRemoveChannelsDlg::DoDataExchange(CDataExchange* pDX) //-------------------------------------------------- { CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CShowLogDlg) DDX_Control(pDX, IDC_REMCHANSLIST, m_RemChansList); - //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRemoveChannelsDlg, CDialog) - //{{AFX_MSG_MAP(CRemoveChannelsDlg) ON_LBN_SELCHANGE(IDC_REMCHANSLIST, OnChannelChanged) - //}}AFX_MSG_MAP -// ON_WM_SIZE() END_MESSAGE_MAP() @@ -571,7 +565,6 @@ nr = m_RemChansList.GetSelCount(); GetDlgItem(IDOK)->EnableWindow(((nr == m_nRemove && nr >0) || (m_nRemove == 0 && (sndFile.GetNumChannels() >= nr + sndFile.GetModSpecifications().channelsMin) && nr > 0)) ? TRUE : FALSE); } -//end rewbs.removeChansDlgCleanup //////////////////////////////////////////////////////////////////////////////// @@ -601,8 +594,8 @@ // Last lines: comments if (bi.szComments[0]) { - strncat(m_szInfo, "\r\nComments:\r\n", strlen(m_szInfo) - sizeof(m_szInfo) - 1); - strncat(m_szInfo, bi.szComments, strlen(m_szInfo) - sizeof(m_szInfo) - 1); + strncat(m_szInfo, "\r\nComments:\r\n", strlen(m_szInfo) - CountOf(m_szInfo) - 1); + strncat(m_szInfo, bi.szComments, strlen(m_szInfo) - CountOf(m_szInfo) - 1); } } @@ -861,7 +854,7 @@ } -VOID CSampleMapDlg::OnHScroll(UINT nCode, UINT nPos, CScrollBar *pBar) +void CSampleMapDlg::OnHScroll(UINT nCode, UINT nPos, CScrollBar *pBar) //-------------------------------------------------------------------- { CDialog::OnHScroll(nCode, nPos, pBar); @@ -870,7 +863,7 @@ } -VOID CSampleMapDlg::OnUpdateSamples() +void CSampleMapDlg::OnUpdateSamples() //----------------------------------- { UINT nOldPos = 0; @@ -919,7 +912,7 @@ } -VOID CSampleMapDlg::OnUpdateOctave() +void CSampleMapDlg::OnUpdateOctave() //---------------------------------- { CHAR s[64]; @@ -931,7 +924,7 @@ -VOID CSampleMapDlg::OnUpdateKeyboard() +void CSampleMapDlg::OnUpdateKeyboard() //------------------------------------ { UINT nSample = m_CbnSample.GetItemData(m_CbnSample.GetCurSel()); @@ -959,7 +952,7 @@ if ((lParam >= 0) && (lParam < 3*12)) { - SAMPLEINDEX nSample = m_CbnSample.GetItemData(m_CbnSample.GetCurSel()); + SAMPLEINDEX nSample = static_cast<SAMPLEINDEX>(m_CbnSample.GetItemData(m_CbnSample.GetCurSel())); UINT nBaseOctave = m_SbOctave.GetPos() & 7; const std::string temp = sndFile.GetNoteName(static_cast<ModCommand::NOTE>(lParam + 1 + 12 * nBaseOctave), m_nInstrument).c_str(); @@ -1024,7 +1017,7 @@ } -VOID CSampleMapDlg::OnOK() +void CSampleMapDlg::OnOK() //------------------------ { ModInstrument *pIns = sndFile.Instruments[m_nInstrument]; @@ -1173,7 +1166,7 @@ if(minValue != maxValue) { // Numeric - spin.SetRange(minValue, maxValue); + spin.SetRange32(minValue, maxValue); spin.SetBuddy(GetDlgItem(IDC_EDIT1)); SetDlgItemInt(IDC_EDIT1, resultNumber); } else @@ -1225,11 +1218,11 @@ const MsgBoxHidableMessage HidableMessages[] = { - {TEXT("Note: First two bytes of oneshot samples is silenced for ProTracker compatibility."), 1, true}, + {TEXT("Note: First two bytes of oneshot samples are silenced for ProTracker compatibility."), 1, true}, {TEXT("Hint: To create IT-files without MPT-specific extensions included, try compatibility export from File-menu."), 1 << 1, true}, {TEXT("Press OK to apply signed/unsigned conversion\n (note: this often significantly increases volume level)"), 1 << 2, false}, {TEXT("Hint: To create XM-files without MPT-specific extensions included, try compatibility export from File-menu."), 1 << 3, true}, - {TEXT("Warning: the exported file will not contain any of MPT's file format hacks."), 1 << 4, true}, + {TEXT("Warning: The exported file will not contain any of MPT's file format hacks."), 1 << 4, true}, }; STATIC_ASSERT(CountOf(HidableMessages) == enMsgBoxHidableMessage_count); Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2014-04-29 17:09:05 UTC (rev 4023) @@ -20,7 +20,7 @@ { public: CComboBox m_TypeBox, m_ChannelsBox, m_TempoModeBox, m_PlugMixBox; - CButton m_CheckBox1, m_CheckBox2, m_CheckBox3, m_CheckBox4, m_CheckBox5, m_CheckBoxPT1x, m_CheckBoxFt2VolRamp; + CButton m_CheckBox1, m_CheckBox2, m_CheckBox3, m_CheckBox4, m_CheckBox5, m_CheckBoxPT1x, m_CheckBoxFt2VolRamp, m_CheckBoxAmigaLimits; CSoundFile &sndFile; CHANNELINDEX m_nChannels; MODTYPE m_nType; @@ -183,12 +183,12 @@ CComboBox m_CbnSample; CSliderCtrl m_SbOctave; CSoundFile &sndFile; - UINT m_nInstrument; + INSTRUMENTINDEX m_nInstrument; SAMPLEINDEX KeyboardMap[NOTE_MAX]; MouseAction mouseAction; public: - CSampleMapDlg(CSoundFile &sf, UINT nInstr, CWnd *parent=NULL) : CDialog(IDD_EDITSAMPLEMAP, parent), mouseAction(mouseUnknown), sndFile(sf) + CSampleMapDlg(CSoundFile &sf, INSTRUMENTINDEX nInstr, CWnd *parent=NULL) : CDialog(IDD_EDITSAMPLEMAP, parent), mouseAction(mouseUnknown), sndFile(sf) { m_nInstrument = nInstr; } protected: Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-04-29 17:09:05 UTC (rev 4023) @@ -1013,8 +1013,8 @@ CONTROL "Extended &filter range",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,96,81,10 CONTROL "&ProTracker 1/2 Mode (MOD)",IDC_CHECK_PT1X,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,108,10 GROUPBOX "Extended Playback Options (OpenMPT only)",IDC_FRAME_MPTEXT,6,120,246,84 - LTEXT "Mix Levels:",IDC_TEXT_MIXMODE,18,134,42,8 - COMBOBOX IDC_COMBO_MIXLEVELS,60,132,84,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "&Mix Levels:",IDC_TEXT_MIXMODE,18,134,42,8 + COMBOBOX IDC_COMBO_MIXLEVELS,60,132,108,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "More &compatible playback",IDC_CHK_COMPATPLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,150,222,12 CONTROL "Use &smooth Fasttracker 2 volume ramping",IDC_CHK_FT2VOLRAMP, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,162,222,12 @@ -1025,17 +1025,19 @@ CONTROL "Plugin volume command &bug emulation",IDC_CHK_MIDICCBUG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,186,222,12 GROUPBOX "Tempo",IDC_FRAME_TEMPOMODE,6,210,246,48 - LTEXT "Mode:",IDC_TEXT_TEMPOMODE,12,222,21,8 + LTEXT "&Tempo Mode:",IDC_TEXT_TEMPOMODE,12,222,44,8 COMBOBOX IDC_COMBO_TEMPOMODE,12,234,108,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Rows per beat",IDC_TEXT_ROWSPERBEAT,162,224,84,8 EDITTEXT IDC_ROWSPERBEAT,132,222,24,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Rows per measure",IDC_TEXT_ROWSPERMEASURE,162,242,84,8 EDITTEXT IDC_ROWSPERMEASURE,132,240,24,12,ES_AUTOHSCROLL | ES_NUMBER - GROUPBOX "OpenMPT Version Info",IDC_FRAME_MPTVERSION,6,263,246,48 - RTEXT "IDC_TEXT_CREATEDWITH",IDC_TEXT_CREATEDWITH,18,279,54,8 + GROUPBOX "Version Info",IDC_FRAME_MPTVERSION,6,263,246,48 + RTEXT "Created with:",IDC_TEXT_CREATEDWITH,12,279,60,8 EDITTEXT IDC_EDIT_CREATEDWITH,78,277,166,13,ES_AUTOHSCROLL | ES_READONLY,WS_EX_STATICEDGE - RTEXT "IDC_TEXT_SAVEDWITH",IDC_TEXT_SAVEDWITH,18,295,54,8 + RTEXT "Last saved with:",IDC_TEXT_SAVEDWITH,12,295,60,8 EDITTEXT IDC_EDIT_SAVEDWITH,78,295,166,13,ES_AUTOHSCROLL | ES_READONLY,WS_EX_STATICEDGE + CONTROL "&Amiga Frequency Limits (S3M)",IDC_CHECK_AMIGALIMITS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,108,10 END IDD_SHOWLOG DIALOGEX 0, 0, 300, 149 Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/mptrack/resource.h 2014-04-29 17:09:05 UTC (rev 4023) @@ -896,6 +896,7 @@ #define IDC_CHK_MERGE_SEQUENCES 2408 #define IDC_CHECK_PT1X 2409 #define IDC_STATIC_CHANNEL_NAME 2410 +#define IDC_CHECK_AMIGALIMITS 2410 #define IDC_FINDHOTKEY 2411 #define IDC_STATIC_PATTERNNAME 2412 #define IDC_EDIT_SAMPLE_LENGTH 2413 Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -277,6 +277,7 @@ InitializeGlobals(); InitializeChannels(); ChangeModTypeTo(MOD_TYPE_XM); + m_nMixLevels = mixLevels_compatible_FT2; FlagSet<TrackerVersions> madeWith(verUnknown); @@ -304,15 +305,15 @@ } else { // Something else! - madeWith = verUnknown |verConfirmed; + madeWith = verUnknown | verConfirmed; mpt::String::Read<mpt::String::spacePadded>(madeWithTracker, fileHeader.trackerName); } mpt::String::Read<mpt::String::spacePadded>(songName, fileHeader.songName); - m_nMinPeriod = 27; - m_nMaxPeriod = 54784; + m_nMinPeriod = 1; + m_nMaxPeriod = 31999; m_nRestartPos = fileHeader.restartPos; m_nChannels = fileHeader.channels; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -1687,7 +1687,6 @@ { std::istringstream iStrm(std::string(pData, nSize)); s_pTuningsSharedBuiltIn->Deserialize(iStrm); - FreeResource(hglob); } if(s_pTuningsSharedBuiltIn->GetNumTunings() == 0) { @@ -1972,7 +1971,7 @@ // When loading into an instrument, ignore non-empty sample names. Else, only use this slot if the sample name is empty or we're in second pass. if((i > GetNumSamples() && passes == 1) || (Samples[i].pSample == nullptr && (!m_szNames[i][0] || passes == 1 || targetInstrument != INSTRUMENTINDEX_INVALID)) - || (targetInstrument != INSTRUMENTINDEX_INVALID && IsSampleReferencedByInstrument(i, targetInstrument))) // Not empty, but already used by this instrument. + || (targetInstrument != INSTRUMENTINDEX_INVALID && IsSampleReferencedByInstrument(i, targetInstrument))) // Not empty, but already used by this instrument. XXX this should only be done when replacing an instrument with a single sample! Otherwise it will use an inconsistent sample map! { // Empty slot, so it's a good candidate already. @@ -2105,10 +2104,10 @@ if(m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 00, 00)) { - // If there are any plugins, enable volume bug emulation. - for(PLUGINDEX i = 0; i < MAX_MIXPLUGINS; i++) + // If there are any plugins that can receive volume commands, enable volume bug emulation. + for(INSTRUMENTINDEX i = 1; i <= GetNumInstruments(); i++) if(Instruments[i]) { - if(m_MixPlugins[i].IsValidPlugin()) + if(Instruments[i]->nMixPlug && Instruments[i]->HasValidMIDIChannel()) { SetModFlag(MSF_MIDICC_BUGEMULATION, true); break; @@ -2380,5 +2379,13 @@ } } + if(m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 22, 07, 19) + && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 23, 01, 04) + && GetType() == MOD_TYPE_XM + && GetMixLevels() == mixLevels_compatible) + { + SetMixLevels(mixLevels_compatible_FT2); + } + Patterns.ForEachModCommand(UpgradePatternData(*this)); } Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -1991,7 +1991,7 @@ } const forcePanningMode panningMode = m_PlayConfig.getForcePanningMode(); - if (panningMode == forceSoftPanning || (panningMode == dontForcePanningMode && (m_MixerSettings.MixerFlags & SNDMIX_SOFTPANNING))) + if(panningMode == forceSoftPanning || (panningMode == dontForcePanningMode && (m_MixerSettings.MixerFlags & SNDMIX_SOFTPANNING))) { if (pan < 128) { @@ -2002,7 +2002,7 @@ pChn->newLeftVol = (realvol * (256 - pan)) >> 8; pChn->newRightVol = (realvol * 128) >> 8; } - } else if(GetType() == MOD_TYPE_XM && m_PlayConfig.getEmulateQuirks()) + } else if(panningMode == forceFT2Panning) { // FT2 uses square root panning. There is a 257-entry LUT for this, // but FT2's internal panning ranges from 0 to 255 only, meaning that Modified: trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp =================================================================== --- trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -43,7 +43,6 @@ setNormalVSTiVol(100.0); setNormalGlobalVol(128.0); setExtraSampleAttenuation(MIXING_ATTENUATION); - setEmulateQuirks(false); break; // Ericus' version gives us floats in [-0.06;0.06] and requires attenuation to @@ -60,7 +59,6 @@ setNormalVSTiVol(100.0); setNormalGlobalVol(128.0); setExtraSampleAttenuation(MIXING_ATTENUATION); - setEmulateQuirks(false); break; // 117RC2 gives us floats in [-1.0; 1.0] and hopefully plays VSTis at @@ -78,7 +76,6 @@ setNormalVSTiVol(100.0); setNormalGlobalVol(128.0); setExtraSampleAttenuation(MIXING_ATTENUATION); - setEmulateQuirks(false); break; // 117RC3 ignores the horrible global, system-specific pre-amp, @@ -97,25 +94,24 @@ setNormalVSTiVol(128.0); setNormalGlobalVol(256.0); setExtraSampleAttenuation(0); - setEmulateQuirks(false); break; // A mixmode that is intended to be compatible to legacy trackers (IT/FT2/etc). // This is basically derived from mixmode 1.17 RC3, with panning mode and volume levels changed. // Sample attenuation is the same as in Schism Tracker (more attenuation than with RC3, thus VSTi attenuation is also higher). case mixLevels_compatible: + case mixLevels_compatible_FT2: setVSTiAttenuation(0.75f); setIntToFloat(1.0f/MIXING_SCALEF); setFloatToInt(MIXING_SCALEF); setGlobalVolumeAppliesToMaster(true); setUseGlobalPreAmp(false); - setForcePanningMode(forceNoSoftPanning); + setForcePanningMode(mixLevelType == mixLevels_compatible ? forceNoSoftPanning : forceFT2Panning); setDisplayDBValues(true); setNormalSamplePreAmp(256.0); setNormalVSTiVol(256.0); setNormalGlobalVol(256.0); setExtraSampleAttenuation(1); - setEmulateQuirks(true); break; } Modified: trunk/OpenMPT/soundlib/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2014-04-29 17:09:05 UTC (rev 4023) @@ -25,11 +25,12 @@ enum mixLevels { - mixLevels_original = 0, - mixLevels_117RC1 = 1, - mixLevels_117RC2 = 2, - mixLevels_117RC3 = 3, - mixLevels_compatible = 4, + mixLevels_original = 0, + mixLevels_117RC1 = 1, + mixLevels_117RC2 = 2, + mixLevels_117RC3 = 3, + mixLevels_compatible = 4, + mixLevels_compatible_FT2 = 5, }; enum forcePanningMode @@ -37,6 +38,7 @@ dontForcePanningMode, forceSoftPanning, forceNoSoftPanning, + forceFT2Panning, }; // Class used to store settings for a song file. @@ -87,10 +89,6 @@ int getExtraSampleAttenuation() const { return m_extraAttenuation; } void setExtraSampleAttenuation(int attn) { m_extraAttenuation = attn; } - // True if format-specific mixing quirks should be emulated. - bool getEmulateQuirks() const { return m_emulateQuirks; } - void setEmulateQuirks(bool emulate) { m_emulateQuirks = emulate; } - protected: float m_IntToFloat; @@ -107,6 +105,5 @@ bool m_globalVolumeAppliesToMaster; bool m_ignorePreAmp; bool m_displayDBValues; - bool m_emulateQuirks; }; Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2014-04-27 19:05:00 UTC (rev 4022) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2014-04-29 17:09:05 UTC (rev 4023) @@ -136,7 +136,7 @@ 0, // Max instrument filename length 128 * 16, // SamplesMax (actually 16 per instrument) 128, // instrumentMax - mixLevels_compatible, // defaultMixLevels + mixLevels_compatible_FT2, // defaultMixLevels 0, // Max MIDI mapping directives 1, // Min Speed 31, // Max Speed @@ -180,7 +180,7 @@ 0, // Max instrument filename length MAX_SAMPLES - 1, // SamplesMax (actually 32 per instrument(256 * 32 = 8192), but limited to MAX_SAMPLES = 4000) 255, // instrumentMax - mixLevels_compatible, // defaultMixLevels + mixLevels_compatible_FT2, // defaultMixLevels 200, // Max MIDI mapping directives 1, // Min Speed 31, // Max Speed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-05-02 19:02:54
|
Revision: 4029 http://sourceforge.net/p/modplug/code/4029 Author: saga-games Date: 2014-05-02 19:02:48 +0000 (Fri, 02 May 2014) Log Message: ----------- [Fix] Adding silence to a sample that's not 8-bit mono broke in OpenMPT 1.23 [Fix] The player settings button on the general tab broke when changing to CHM help code. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2014-05-01 22:59:06 UTC (rev 4028) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2014-05-02 19:02:48 UTC (rev 4029) @@ -535,7 +535,7 @@ void CCtrlGeneral::OnPlayerProperties() //------------------------------------- { - CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_PLAYER; + CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_MIXER; CMainFrame::GetMainFrame()->OnViewOptions(); } Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2014-05-01 22:59:06 UTC (rev 4028) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2014-05-02 19:02:48 UTC (rev 4029) @@ -65,7 +65,7 @@ } if(nStartFrom < smp.nLength) { - memcpy(pNewSmp + silenceOffset + silenceBytes, static_cast<const char *>(smp.pSample) + silenceOffset, smp.nLength - silenceOffset); + memcpy(pNewSmp + silenceOffset + silenceBytes, static_cast<const char *>(smp.pSample) + silenceOffset, smp.GetSampleSizeInBytes() - silenceOffset); } // Update loop points if necessary. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |