From: <sag...@us...> - 2013-04-08 17:17:27
|
Revision: 1779 http://sourceforge.net/p/modplug/code/1779 Author: saga-games Date: 2013-04-08 17:17:19 +0000 (Mon, 08 Apr 2013) Log Message: ----------- [Fix] Options dialog: Preamp warning was also shown when changing stereo separation [Ref] Changed some notification generating code to not query the same static information again and again. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/View_smp.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-08 16:35:10 UTC (rev 1778) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-08 17:17:19 UTC (rev 1779) @@ -986,63 +986,74 @@ // Add an entry to the notification history Notification notification(notifyType, notifyItem, notificationtimestamp, m_pSndFile->m_nRow, m_pSndFile->m_nTickCount, m_pSndFile->m_nCurrentOrder, m_pSndFile->m_nPattern); - Notification *p = ¬ification; - if(endOfStream) p->type.set(Notification::EOS); + if(endOfStream) notification.type.set(Notification::EOS); if(notifyType[Notification::Sample]) { // Sample positions - SAMPLEINDEX smp = notifyItem; - for(CHANNELINDEX k = 0; k < MAX_CHANNELS; k++) + const SAMPLEINDEX smp = notifyItem; + if(smp > 0 && smp <= m_pSndFile->GetNumSamples() && m_pSndFile->GetSample(smp).pSample != nullptr) { - const ModChannel &chn = m_pSndFile->Chn[k]; - if(smp && smp <= m_pSndFile->GetNumSamples() && chn.nLength && chn.pSample // There is a sample and it's playing - && chn.pSample == m_pSndFile->GetSample(smp).pSample // And it's the correct sample - && (!chn.dwFlags[CHN_NOTEFADE] || chn.nFadeOutVol)) // And it hasn't completely faded out yet, so it's still playing + for(CHANNELINDEX k = 0; k < MAX_CHANNELS; k++) { - p->pos[k] = chn.nPos; - } else - { - p->pos[k] = Notification::PosInvalid; + const ModChannel &chn = m_pSndFile->Chn[k]; + if(chn.pSample == m_pSndFile->GetSample(smp).pSample && chn.nLength != 0 // Corrent sample is set up on this channel + && (!chn.dwFlags[CHN_NOTEFADE] || chn.nFadeOutVol)) // And it hasn't completely faded out yet, so it's still playing + { + notification.pos[k] = chn.nPos; + } else + { + notification.pos[k] = Notification::PosInvalid; + } } + } else + { + // Can't generate a valid notification. + notification.type.reset(Notification::Sample); } } else if(notifyType[Notification::VolEnv | Notification::PanEnv | Notification::PitchEnv]) { // Instrument envelopes - INSTRUMENTINDEX ins = notifyItem; - for(CHANNELINDEX k = 0; k < MAX_CHANNELS; k++) + const INSTRUMENTINDEX ins = notifyItem; + + enmEnvelopeTypes notifyEnv = ENV_VOLUME; + if(notifyType[Notification::PitchEnv]) + notifyEnv = ENV_PITCH; + else if(notifyType[Notification::PanEnv]) + notifyEnv = ENV_PANNING; + + if(ins > 0 && ins <= m_pSndFile->GetNumInstruments() && m_pSndFile->Instruments[ins] != nullptr) { - const ModChannel &chn = m_pSndFile->Chn[k]; - if(ins != 0 && ins <= m_pSndFile->GetNumInstruments() // There is an instrument - && chn.pModInstrument && chn.pModInstrument == m_pSndFile->Instruments[ins] // And it's the correct instrument - && (chn.nLength || chn.pModInstrument->HasValidMIDIChannel()) // And it's playing something (sample or instrument) - && (!chn.dwFlags[CHN_NOTEFADE] || chn.nFadeOutVol)) // And it hasn't completely faded out yet, so it's still playing + for(CHANNELINDEX k = 0; k < MAX_CHANNELS; k++) { - enmEnvelopeTypes notifyEnv = ENV_VOLUME; - if(notifyType[Notification::PitchEnv]) - notifyEnv = ENV_PITCH; - else if(notifyType[Notification::PanEnv]) - notifyEnv = ENV_PANNING; + const ModChannel &chn = m_pSndFile->Chn[k]; + uint32 pos = Notification::PosInvalid; - const ModChannel::EnvInfo &chnEnv = chn.GetEnvelope(notifyEnv); - if(chnEnv.flags[ENV_ENABLED]) + if(chn.pModInstrument == m_pSndFile->Instruments[ins] // Correct instrument is set up on this channel + && (chn.nLength || chn.pModInstrument->HasValidMIDIChannel()) // And it's playing something (sample or instrument plugin) + && (!chn.dwFlags[CHN_NOTEFADE] || chn.nFadeOutVol)) // And it hasn't completely faded out yet, so it's still playing { - uint32 pos = chnEnv.nEnvPosition; - if(m_pSndFile->IsCompatibleMode(TRK_IMPULSETRACKER)) + const ModChannel::EnvInfo &chnEnv = chn.GetEnvelope(notifyEnv); + if(chnEnv.flags[ENV_ENABLED]) { - // Impulse Tracker envelope handling (see e.g. CSoundFile::IncrementEnvelopePosition in SndMix.cpp for details) - if(pos > 0) - pos--; - else - continue; + pos = chnEnv.nEnvPosition; + if(m_pSndFile->IsCompatibleMode(TRK_IMPULSETRACKER)) + { + // Impulse Tracker envelope handling (see e.g. CSoundFile::IncrementEnvelopePosition in SndMix.cpp for details) + if(pos > 0) + pos--; + else + pos = Notification::PosInvalid; // Envelope isn't playing yet (e.g. when disabling it right when triggering a note) + } } - p->pos[k] = pos; } - } else - { - p->pos[k] = Notification::PosInvalid; + notification.pos[k] = pos; } + } else + { + // Can't generate a valid notification. + notification.type.reset(Notification::VolEnv | Notification::PanEnv | Notification::PitchEnv); } } else if(notifyType[Notification::VUMeters]) { @@ -1051,7 +1062,7 @@ { uint32 vul = m_pSndFile->Chn[k].nLeftVU; uint32 vur = m_pSndFile->Chn[k].nRightVU; - p->pos[k] = (vul << 8) | (vur); + notification.pos[k] = (vul << 8) | (vur); } } @@ -1061,10 +1072,10 @@ uint32 rVu = (gnRVuMeter >> 11); if(lVu > 0x10000) lVu = 0x10000; if(rVu > 0x10000) rVu = 0x10000; - p->masterVU[0] = lVu; - p->masterVU[1] = rVu; - if(gnClipLeft) p->masterVU[0] |= Notification::ClipVU; - if(gnClipRight) p->masterVU[1] |= Notification::ClipVU; + notification.masterVU[0] = lVu; + notification.masterVU[1] = rVu; + if(gnClipLeft) notification.masterVU[0] |= Notification::ClipVU; + if(gnClipRight) notification.masterVU[1] |= Notification::ClipVU; uint32 dwVuDecay = Util::muldiv(dwSamplesRead, 120000, TrackerSettings::Instance().m_dwRate) + 1; if (lVu >= dwVuDecay) gnLVuMeter = (lVu - dwVuDecay) << 11; else gnLVuMeter = 0; Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-08 16:35:10 UTC (rev 1778) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-08 17:17:19 UTC (rev 1779) @@ -36,7 +36,7 @@ }; -UINT nCPUMix[8] = +UINT nCPUMix[] = { 16, 24, @@ -141,7 +141,7 @@ // Max Mixing Channels { - for (UINT n=0; n<8; n++) + for (UINT n = 0; n < CountOf(nCPUMix); n++) { wsprintf(s, "%d (%s)", nCPUMix[n], szCPUNames[n]); m_CbnPolyphony.AddString(s); @@ -279,6 +279,7 @@ UpdateStereoSep(); } // PreAmp + if(p == (CScrollBar *)(&m_SliderPreAmp)) { if(m_PreAmpNoteShowed == true) { @@ -288,8 +289,7 @@ CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (pMainFrm) pMainFrm->SetPreAmp(64 + (n * 8)); } - } - else + } else { m_PreAmpNoteShowed = true; Reporting::Information(str_preampChangeNote); Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2013-04-08 16:35:10 UTC (rev 1778) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2013-04-08 17:17:19 UTC (rev 1779) @@ -925,6 +925,10 @@ //------------------------------------------ { CRect rect; + if(GetDocument()->GetrSoundFile().GetSample(m_nSample).pSample == nullptr) + { + return; + } for (UINT i=0; i<MAX_CHANNELS; i++) if (m_dwNotifyPos[i] != Notification::PosInvalid) { rect.top = -2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-09 00:01:33
|
Revision: 1785 http://sourceforge.net/p/modplug/code/1785 Author: manxorist Date: 2013-04-09 00:01:27 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Ref] Remove CMainFrame::m_hFollowSong. CModDoc knows the HWND just as well. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_pat.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 00:01:27 UTC (rev 1785) @@ -147,7 +147,6 @@ CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (m_pModDoc) m_pModDoc->SetNotifications(Notification::Default); if (m_pModDoc) m_pModDoc->SetFollowWnd(m_hWnd); - if (pMainFrm) pMainFrm->SetFollowSong(m_pModDoc, m_hWnd, TRUE); PostViewMessage(VIEWMSG_SETACTIVE, NULL); SetFocus(); Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/Globals.cpp 2013-04-09 00:01:27 UTC (rev 1785) @@ -642,7 +642,6 @@ if (pMainFrm->GetFollowSong(pModDoc) == m_hWnd) { pModDoc->SetNotifications(Notification::None); - pMainFrm->SetFollowSong(pModDoc, NULL, FALSE); pModDoc->SetFollowWnd(NULL); } if (pMainFrm->GetMidiRecordWnd() == m_hWnd) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 00:01:27 UTC (rev 1785) @@ -194,7 +194,6 @@ m_SoundCardOptionsDialog = nullptr; m_pJustModifiedDoc = nullptr; - m_hFollowSong = NULL; m_hWndMidi = NULL; m_pSndFile = nullptr; m_dwTimeSec = 0; @@ -1265,6 +1264,7 @@ ///////////////////////////////////////////////////////////////////////////// // CMainFrame operations + UINT CMainFrame::GetBaseOctave() const //------------------------------------ { @@ -1381,7 +1381,6 @@ } } m_pSndFile = nullptr; - m_hFollowSong = NULL; m_wndToolBar.SetCurrentSong(nullptr); { Util::lock_guard<Util::mutex> lock(m_NotificationBufferMutex); @@ -1390,16 +1389,15 @@ } -void CMainFrame::SetPlaybackSoundFile(CSoundFile *pSndFile, HWND hPat) -//-------------------------------------------------------------------- +void CMainFrame::SetPlaybackSoundFile(CSoundFile *pSndFile) +//--------------------------------------------------------- { m_pSndFile = pSndFile; - m_hFollowSong = hPat; } -bool CMainFrame::PlayMod(CModDoc *pModDoc, HWND hPat) -//--------------------------------------------------- +bool CMainFrame::PlayMod(CModDoc *pModDoc) +//---------------------------------------- { CriticalSection::AssertUnlocked(); if(!pModDoc) return false; @@ -1418,7 +1416,7 @@ // set mixing parameters in CSoundFile ApplyTrackerSettings(pSndFile); - SetPlaybackSoundFile(pSndFile, hPat); + SetPlaybackSoundFile(pSndFile); const bool bPaused = m_pSndFile->IsPaused(); const bool bPatLoop = m_pSndFile->m_SongFlags[SONG_PATTERNLOOP]; @@ -1719,18 +1717,10 @@ } -BOOL CMainFrame::SetFollowSong(CModDoc *pDoc, HWND hwnd, BOOL bFollowSong) -//------------------------------------------------------------------------ +HWND CMainFrame::GetFollowSong() const +//------------------------------------ { - if((!pDoc) || (pDoc != GetModPlaying())) return FALSE; - if(bFollowSong) - { - m_hFollowSong = hwnd; - } else - { - if(hwnd == m_hFollowSong) m_hFollowSong = NULL; - } - return TRUE; + return GetModPlaying() ? GetModPlaying()->GetFollowWnd() : NULL; } @@ -1743,7 +1733,6 @@ || (TrackerSettings::Instance().m_nChannels != nChns)) { CModDoc *pActiveMod = NULL; - HWND hFollow = m_hFollowSong; if (isPlaying) { if ((m_pSndFile) && (!m_pSndFile->IsPaused())) pActiveMod = GetModPlaying(); @@ -1760,7 +1749,7 @@ CriticalSection cs; UpdateAudioParameters(FALSE); } - if (pActiveMod) PlayMod(pActiveMod, hFollow); + if (pActiveMod) PlayMod(pActiveMod); UpdateWindow(); } else { @@ -2314,8 +2303,8 @@ if (GetModPlaying()) { m_wndTree.UpdatePlayPos(GetModPlaying(), pnotify); - if (m_hFollowSong) - ::SendMessage(m_hFollowSong, WM_MOD_UPDATEPOSITION, 0, lParam); + if (GetFollowSong()) + ::SendMessage(GetFollowSong(), WM_MOD_UPDATEPOSITION, 0, lParam); } m_wndToolBar.m_VuMeter.SetVuMeter(pnotify->masterVU[0], pnotify->masterVU[1]); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-09 00:01:27 UTC (rev 1785) @@ -308,7 +308,7 @@ CMainToolBar m_wndToolBar; CImageList m_ImageList; CSoundFile *m_pSndFile; // != NULL only when currently playing or rendering - HWND m_hFollowSong, m_hWndMidi; + HWND m_hWndMidi; CSoundFile::samplecount_t m_dwTimeSec; UINT_PTR m_nTimer; UINT m_nAvgMixChn, m_nMixChn; @@ -434,11 +434,11 @@ bool PausePlayback(); bool IsPlaybackRunning() const { return m_IsPlaybackRunning; } static bool IsValidSoundFile(CSoundFile *pSndFile) { return pSndFile && pSndFile->GetType(); } - void SetPlaybackSoundFile(CSoundFile *pSndFile, HWND hPat=NULL); + void SetPlaybackSoundFile(CSoundFile *pSndFile); void UnsetPlaybackSoundFile(); void GenerateStopNotification(); - bool PlayMod(CModDoc *, HWND hPat=NULL); + bool PlayMod(CModDoc *); bool StopMod(CModDoc *pDoc=NULL); bool PauseMod(CModDoc *pDoc=NULL); @@ -465,8 +465,8 @@ BOOL SetupPlayer(DWORD, DWORD, BOOL bForceUpdate=FALSE); BOOL SetupMidi(DWORD d, LONG n); void SetPreAmp(UINT n); - HWND GetFollowSong(const CModDoc *pDoc) const { return (pDoc == GetModPlaying()) ? m_hFollowSong : NULL; } - BOOL SetFollowSong(CModDoc *, HWND hwnd, BOOL bFollowSong=TRUE); + HWND GetFollowSong() const; + HWND GetFollowSong(const CModDoc *pDoc) const { return (pDoc == GetModPlaying()) ? GetFollowSong() : NULL; } void ResetNotificationBuffer(); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 00:01:27 UTC (rev 1785) @@ -1011,7 +1011,7 @@ if (pMainFrm->GetModPlaying() != this) { m_SndFile.m_SongFlags.set(SONG_PAUSED); - pMainFrm->PlayMod(this, m_hWndFollow); + pMainFrm->PlayMod(this); } CriticalSection cs; @@ -1497,9 +1497,7 @@ void CModDoc::SetFollowWnd(HWND hwnd) //----------------------------------- { - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); m_hWndFollow = hwnd; - if(pMainFrm) pMainFrm->SetFollowSong(this, m_hWndFollow, TRUE); } @@ -1999,7 +1997,7 @@ cs.Leave(); m_SndFile.m_SongFlags.reset(SONG_STEP | SONG_PAUSED | SONG_PATTERNLOOP); - pMainFrm->PlayMod(this, m_hWndFollow); + pMainFrm->PlayMod(this); } } @@ -2084,7 +2082,7 @@ cs.Leave(); - pMainFrm->PlayMod(this, m_hWndFollow); + pMainFrm->PlayMod(this); } } @@ -2399,7 +2397,8 @@ if(pModPlaying != this) { SetNotifications(m_notifyType|Notification::Position|Notification::VUMeters, m_notifyItem); - pMainFrm->PlayMod(this, followSonghWnd); //rewbs.fix2977 + SetFollowWnd(followSonghWnd); + pMainFrm->PlayMod(this); //rewbs.fix2977 } } //SwitchToView(); @@ -2456,7 +2455,8 @@ if(pModPlaying != this) { SetNotifications(m_notifyType|Notification::Position|Notification::VUMeters, m_notifyItem); - pMainFrm->PlayMod(this, followSonghWnd); //rewbs.fix2977 + SetFollowWnd(followSonghWnd); + pMainFrm->PlayMod(this); //rewbs.fix2977 } } //SwitchToView(); @@ -2516,7 +2516,8 @@ if(pModPlaying != this) { SetNotifications(m_notifyType|Notification::Position|Notification::VUMeters, m_notifyItem); - pMainFrm->PlayMod(this, followSonghWnd); //rewbs.fix2977 + SetFollowWnd(followSonghWnd); + pMainFrm->PlayMod(this); //rewbs.fix2977 } } //SwitchToView(); Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-08 23:44:36 UTC (rev 1784) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-09 00:01:27 UTC (rev 1785) @@ -2469,7 +2469,8 @@ if (pMainFrm->GetModPlaying() != pModDoc) { pModDoc->SetNotifications(Notification::Position | Notification::VUMeters); - pMainFrm->PlayMod(pModDoc, m_hWnd); + pModDoc->SetFollowWnd(m_hWnd); + pMainFrm->PlayMod(pModDoc); } if(row == ROWINDEX_INVALID) { @@ -3932,7 +3933,6 @@ m_Status.set(psFollowSong); if(pModDoc) pModDoc->SetNotifications(Notification::Position | Notification::VUMeters); if(pModDoc) pModDoc->SetFollowWnd(m_hWnd); - if(pMainFrm) pMainFrm->SetFollowSong(pModDoc, m_hWnd, TRUE); SetFocus(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-09 00:22:46
|
Revision: 1787 http://sourceforge.net/p/modplug/code/1787 Author: saga-games Date: 2013-04-09 00:22:38 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Fix] Global VU also works with previewed instruments in treeview. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Notification.h trunk/OpenMPT/mptrack/View_pat.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -56,7 +56,7 @@ if(modDoc) { // Don't stop generating VU meter messages - modDoc->SetNotifications(Notification::Position); + modDoc->SetNotifications(Notification::Default); modDoc->SetFollowWnd(m_hWnd); } } Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -158,7 +158,6 @@ void CCtrlGeneral::OnDeactivatePage() //----------------------------------- { - if (m_pModDoc) m_pModDoc->SetNotifications(Notification::None); if (m_pModDoc) m_pModDoc->SetFollowWnd(NULL); m_VuMeterLeft.SetVuMeter(0); m_VuMeterRight.SetVuMeter(0); Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/Globals.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -641,7 +641,7 @@ { if (pMainFrm->GetFollowSong(pModDoc) == m_hWnd) { - pModDoc->SetNotifications(Notification::None); + pModDoc->SetNotifications(Notification::Default); pModDoc->SetFollowWnd(NULL); } if (pMainFrm->GetMidiRecordWnd() == m_hWnd) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -965,8 +965,8 @@ } } if(!m_pSndFile) return FALSE; - FlagSet<Notification::Type> notifyType; - notifyType = Notification::None; + + FlagSet<Notification::Type> notifyType(Notification::Default); Notification::Item notifyItem = 0; if(m_pSndFile->m_pModDoc) @@ -976,7 +976,6 @@ } if(m_nMixChn < m_pSndFile->m_nMixStat) m_nMixChn++; if(m_nMixChn > m_pSndFile->m_nMixStat) m_nMixChn--; - if(notifyType == Notification::None) return FALSE; // Notify Client //if(m_NotifyBuffer.read_size() > 0) { Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -125,7 +125,7 @@ m_lpszLog = NULL; m_hWndFollow = NULL; - m_notifyType = Notification::None; + m_notifyType = Notification::Default; m_notifyItem = 0; // Set the creation date of this file (or the load time if we're loading an existing file) Modified: trunk/OpenMPT/mptrack/Notification.h =================================================================== --- trunk/OpenMPT/mptrack/Notification.h 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/Notification.h 2013-04-09 00:22:38 UTC (rev 1787) @@ -15,15 +15,14 @@ { enum Type { - None = 0x00, - Position = 0x01, // Pattern playback position - Sample = 0x02, // pos[i] contains sample position on this channel - VolEnv = 0x04, // pos[i] contains volume envelope position - PanEnv = 0x08, // pos[i] contains panning envelope position - PitchEnv = 0x10, // pos[i] contains pitch envelope position - VUMeters = 0x20, // pos[i] contains VU meter for this channel - EOS = 0x40, // End of stream reached, the GUI should stop the audio device - Stop = 0x80, // Audio device has been stopped -> reset GUI + Position = 0x00, // Pattern playback position and global VU meters (always valid) + Sample = 0x01, // pos[i] contains sample position on this channel + VolEnv = 0x02, // pos[i] contains volume envelope position + PanEnv = 0x04, // pos[i] contains panning envelope position + PitchEnv = 0x08, // pos[i] contains pitch envelope position + VUMeters = 0x10, // pos[i] contains pattern VU meter for this channel + EOS = 0x20, // End of stream reached, the GUI should stop the audio device + Stop = 0x40, // Audio device has been stopped -> reset GUI Default = Position, }; @@ -50,7 +49,7 @@ uint32 masterVU[2]; // dito SmpLength pos[MAX_CHANNELS]; // Sample / envelope pos for each channel if != PosInvalid, or pattern channel VUs - Notification(Type t = None, Item i = 0, int64 s = 0, ROWINDEX r = 0, uint32 ti = 0, ORDERINDEX o = 0, PATTERNINDEX p = 0) : timestampSamples(s), type(t), item(i), row(r), tick(ti), order(o), pattern(p) + Notification(Type t = Default, Item i = 0, int64 s = 0, ROWINDEX r = 0, uint32 ti = 0, ORDERINDEX o = 0, PATTERNINDEX p = 0) : timestampSamples(s), type(t), item(i), row(r), tick(ti), order(o), pattern(p) { MemsetZero(masterVU); } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-09 00:02:27 UTC (rev 1786) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-09 00:22:38 UTC (rev 1787) @@ -3504,68 +3504,64 @@ return 0; } - if(pnotify->type[Notification::Position]) + ORDERINDEX nOrd = pnotify->order; + ROWINDEX nRow = pnotify->row; + PATTERNINDEX nPat = pnotify->pattern; //get player pattern + bool updateOrderList = false; + + if(m_nLastPlayedOrder != nOrd) { - ORDERINDEX nOrd = pnotify->order; - ROWINDEX nRow = pnotify->row; - PATTERNINDEX nPat = pnotify->pattern; //get player pattern - bool updateOrderList = false; + updateOrderList = true; + m_nLastPlayedOrder = nOrd; + } - if(m_nLastPlayedOrder != nOrd) - { - updateOrderList = true; - m_nLastPlayedOrder = nOrd; - } + if (nRow < m_nLastPlayedRow) + { + InvalidateChannelsHeaders(); + } + m_nLastPlayedRow = nRow; - if (nRow < m_nLastPlayedRow) - { - InvalidateChannelsHeaders(); - } - m_nLastPlayedRow = nRow; + if(pSndFile->m_SongFlags[SONG_PAUSED | SONG_STEP]) return 0; - if(pSndFile->m_SongFlags[SONG_PAUSED | SONG_STEP]) return 0; + if (nOrd >= pSndFile->Order.GetLength() || pSndFile->Order[nOrd] != nPat) + { + //order doesn't correlate with pattern, so mark it as invalid + nOrd = ORDERINDEX_INVALID; + } - if (nOrd >= pSndFile->Order.GetLength() || pSndFile->Order[nOrd] != nPat) - { - //order doesn't correlate with pattern, so mark it as invalid - nOrd = ORDERINDEX_INVALID; - } + if (m_pEffectVis && m_pEffectVis->m_hWnd) + { + m_pEffectVis->SetPlayCursor(nPat, nRow); + } - if (m_pEffectVis && m_pEffectVis->m_hWnd) + // Don't follow song if user drags selections or scrollbars. + if((m_Status & (psFollowSong | psDragActive)) == psFollowSong) + { + if (nPat < pSndFile->Patterns.Size()) { - m_pEffectVis->SetPlayCursor(nPat, nRow); - } - - // Don't follow song if user drags selections or scrollbars. - if((m_Status & (psFollowSong | psDragActive)) == psFollowSong) - { - if (nPat < pSndFile->Patterns.Size()) + if (nPat != m_nPattern || updateOrderList) { - if (nPat != m_nPattern || updateOrderList) - { - if(nPat != m_nPattern) SetCurrentPattern(nPat, nRow); - if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); - updateOrderList = false; - } - if (nRow != GetCurrentRow()) - { - SetCurrentRow((nRow < pSndFile->Patterns[nPat].GetNumRows()) ? nRow : 0, FALSE, FALSE); - } + if(nPat != m_nPattern) SetCurrentPattern(nPat, nRow); + if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); + updateOrderList = false; } - } else - { - if(updateOrderList) + if (nRow != GetCurrentRow()) { - SendCtrlMessage(CTRLMSG_FORCEREFRESH); //force orderlist refresh - updateOrderList = false; + SetCurrentRow((nRow < pSndFile->Patterns[nPat].GetNumRows()) ? nRow : 0, FALSE, FALSE); } } - SetPlayCursor(nPat, nRow); - m_nPlayTick = pnotify->tick; + } else + { + if(updateOrderList) + { + SendCtrlMessage(CTRLMSG_FORCEREFRESH); //force orderlist refresh + updateOrderList = false; + } + } + SetPlayCursor(nPat, nRow); + m_nPlayTick = pnotify->tick; - } //Ends condition "if(pnotify->dwType & MPTNotification::_POSITION)" - if(pnotify->type[Notification::VUMeters | Notification::Stop] && m_Status[psShowVUMeters]) { UpdateAllVUMeters(pnotify); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-09 00:27:47
|
Revision: 1788 http://sourceforge.net/p/modplug/code/1788 Author: manxorist Date: 2013-04-09 00:27:40 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Ref] Remove all calls to SetPriorityClass(). They did nothing anyway. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 00:22:38 UTC (rev 1787) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 00:27:40 UTC (rev 1788) @@ -263,10 +263,6 @@ OnUpdateUser(NULL); m_nTimer = SetTimer(1, MPTTIMER_PERIOD, NULL); -//rewbs: reduce to normal priority during debug for easier hang debugging - //SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); - // Setup Keyboard Hook ghKbdHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, AfxGetInstanceHandle(), GetCurrentThreadId()); // Initialize Audio Mixer @@ -379,7 +375,6 @@ { CSoundFile::gpSndMixHook = nullptr; - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); // Uninstall Keyboard Hook if (ghKbdHook) { Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-04-09 00:22:38 UTC (rev 1787) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-04-09 00:27:40 UTC (rev 1788) @@ -692,7 +692,6 @@ } } - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); int oldVol = m_pSndFile->GetMasterVolume(); CSoundFile::gdwSoundSetup |= SNDMIX_DIRECTTODISK; CSoundFile::gdwMixingFreq = m_pWaveFormat->nSamplesPerSec; @@ -973,9 +972,6 @@ } } CMainFrame::UpdateAudioParameters(TRUE); -//rewbs: reduce to normal priority during debug for easier hang debugging - //SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); EndDialog(ok); } @@ -1040,7 +1036,6 @@ progress = ::GetDlgItem(m_hWnd, IDC_PROGRESS1); if ((!m_pSndFile) || (!m_lpszFileName) || (!m_pwfx) || (!m_hadid)) goto OnError; - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); _splitpath(m_lpszFileName, NULL, NULL, NULL, fext); if (((m_bSaveInfoField) && (m_pwfx->wFormatTag != WAVE_FORMAT_MPEGLAYER3)) || (!lstrcmpi(fext, ".wav"))) bSaveWave = true; @@ -1249,8 +1244,5 @@ if (hADriver != NULL) theApp.GetACMConvert().AcmDriverClose(hADriver, 0L); if (pcmBuffer) delete[] pcmBuffer; if (dstBuffer) delete[] dstBuffer; -//rewbs: reduce to normal priority during debug for easier hang debugging - //SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); - SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); EndDialog(retval); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-09 17:45:15
|
Revision: 1796 http://sourceforge.net/p/modplug/code/1796 Author: manxorist Date: 2013-04-09 17:45:07 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Ref] CModDoc::InitPlayer() is completely unused. Remove it. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 17:37:46 UTC (rev 1795) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 17:45:07 UTC (rev 1796) @@ -671,13 +671,6 @@ } -void CModDoc::InitPlayer() -//------------------------ -{ - m_SndFile.ResetChannels(); -} - - BOOL CModDoc::InitializeMod() //--------------------------- { Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2013-04-09 17:37:46 UTC (rev 1795) +++ trunk/OpenMPT/mptrack/Moddoc.h 2013-04-09 17:45:07 UTC (rev 1796) @@ -186,7 +186,6 @@ CSoundFile &GetrSoundFile() { return m_SndFile; } const CSoundFile &GetrSoundFile() const { return m_SndFile; } - void InitPlayer(); void SetModified(BOOL bModified=TRUE) { SetModifiedFlag(bModified); bModifiedAutosave = (bModified != FALSE); } bool ModifiedSinceLastAutosave() { bool bRetval = bModifiedAutosave; bModifiedAutosave = false; return bRetval; } // return "IsModified" value and reset it until the next SetModified() (as this is only used for polling) void SetShowSaveDialog(bool b) {m_ShowSavedialog = b;} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-09 19:56:46
|
Revision: 1802 http://sourceforge.net/p/modplug/code/1802 Author: manxorist Date: 2013-04-09 19:56:40 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Imp] The VU meters consume too much CPU time with small update intervals and now that 2 vu meters are drawn. Rate-limit update interval of vu meters to hidden setting [Display]VuMeterUpdateInterval (defaulting to 15ms). Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 19:56:40 UTC (rev 1802) @@ -159,8 +159,8 @@ //----------------------------------- { if (m_pModDoc) m_pModDoc->SetFollowWnd(NULL); - m_VuMeterLeft.SetVuMeter(0); - m_VuMeterRight.SetVuMeter(0); + m_VuMeterLeft.SetVuMeter(0, true); + m_VuMeterRight.SetVuMeter(0, true); } @@ -612,15 +612,20 @@ } -VOID CVuMeter::SetVuMeter(LONG lVuMeter) -//-------------------------------------- +VOID CVuMeter::SetVuMeter(LONG lVuMeter, bool force) +//-------------------------------------------------- { lVuMeter >>= 8; if (lVuMeter != m_nVuMeter) { m_nVuMeter = lVuMeter; - CClientDC dc(this); - DrawVuMeter(dc.m_hDC); + DWORD curTime = timeGetTime(); + if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) + { + CClientDC dc(this); + DrawVuMeter(dc.m_hDC); + lastVuUpdateTime = curTime; + } } } Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-09 19:56:40 UTC (rev 1802) @@ -17,10 +17,11 @@ { protected: LONG m_nDisplayedVu, m_nVuMeter; + DWORD lastVuUpdateTime; public: - CVuMeter() { m_nDisplayedVu = -1; m_nVuMeter = 0; } - VOID SetVuMeter(LONG lVuMeter); + CVuMeter() { m_nDisplayedVu = -1; lastVuUpdateTime = timeGetTime(); m_nVuMeter = 0; } + VOID SetVuMeter(LONG lVuMeter, bool force=false); protected: VOID DrawVuMeter(HDC hdc); Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-09 19:56:40 UTC (rev 1802) @@ -1109,8 +1109,13 @@ { vuMeter[0] = left; vuMeter[1] = right; - CClientDC dc(this); - DrawVuMeters(dc.m_hDC); + DWORD curTime = timeGetTime(); + if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval) + { + CClientDC dc(this); + DrawVuMeters(dc.m_hDC); + lastVuUpdateTime = curTime; + } } } Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/Mainbar.h 2013-04-09 19:56:40 UTC (rev 1802) @@ -16,10 +16,11 @@ { protected: uint32 vuMeter[2]; + DWORD lastVuUpdateTime; bool horizontal; public: - CStereoVU() { vuMeter[0] = vuMeter[1] = 0; horizontal = true; } + CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; } void SetVuMeter(uint32 left, uint32 right); void SetOrientation(bool h) { horizontal = h; } Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-04-09 19:56:40 UTC (rev 1802) @@ -53,6 +53,7 @@ //end rewbs.varWindowSize glTreeWindowWidth = 160; glTreeSplitRatio = 128; + VuMeterUpdateInterval = 15; gcsPreviousVersion = 0; gcsInstallGUID = ""; @@ -275,6 +276,7 @@ gnPlugWindowHeight = GetPrivateProfileInt("Display", "PlugSelectWindowHeight", gnPlugWindowHeight, iniFile); gnPlugWindowLast = CMainFrame::GetPrivateProfileDWord("Display", "PlugSelectWindowLast", gnPlugWindowLast, iniFile); gnMsgBoxVisiblityFlags = CMainFrame::GetPrivateProfileDWord("Display", "MsgBoxVisibilityFlags", gnMsgBoxVisiblityFlags, iniFile); + VuMeterUpdateInterval = CMainFrame::GetPrivateProfileDWord("Display", "VuMeterUpdateInterval", VuMeterUpdateInterval, iniFile); // Internet Update { @@ -763,7 +765,8 @@ CMainFrame::WritePrivateProfileLong("Display", "PlugSelectWindowHeight", gnPlugWindowHeight, iniFile); CMainFrame::WritePrivateProfileLong("Display", "PlugSelectWindowLast", gnPlugWindowLast, iniFile); CMainFrame::WritePrivateProfileDWord("Display", "MsgBoxVisibilityFlags", gnMsgBoxVisiblityFlags, iniFile); - + CMainFrame::WritePrivateProfileDWord("Display", "VuMeterUpdateInterval", VuMeterUpdateInterval, iniFile); + // Internet Update { CString outDate; Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2013-04-09 18:36:35 UTC (rev 1801) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2013-04-09 19:56:40 UTC (rev 1802) @@ -163,6 +163,7 @@ /*MptVersion::VersionNum*/ uint32 gcsPreviousVersion; CString gcsInstallGUID; MODTYPE defaultModType; + DWORD VuMeterUpdateInterval; // Audio Setup DWORD m_dwSoundSetup, m_dwRate, m_dwQuality, m_nSrcMode, m_nBitsPerSample, m_nPreAmp, gbLoopSong, m_nChannels; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-09 23:28:10
|
Revision: 1804 http://sourceforge.net/p/modplug/code/1804 Author: saga-games Date: 2013-04-09 23:28:03 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Fix] Pattern display returned to first pattern when stopping song since r1787 Revision Links: -------------- http://sourceforge.net/p/modplug/code/1787 Modified Paths: -------------- trunk/OpenMPT/mptrack/Notification.h trunk/OpenMPT/mptrack/View_pat.cpp Modified: trunk/OpenMPT/mptrack/Notification.h =================================================================== --- trunk/OpenMPT/mptrack/Notification.h 2013-04-09 19:57:45 UTC (rev 1803) +++ trunk/OpenMPT/mptrack/Notification.h 2013-04-09 23:28:03 UTC (rev 1804) @@ -15,16 +15,17 @@ { enum Type { - Position = 0x00, // Pattern playback position and global VU meters (always valid) - Sample = 0x01, // pos[i] contains sample position on this channel - VolEnv = 0x02, // pos[i] contains volume envelope position - PanEnv = 0x04, // pos[i] contains panning envelope position - PitchEnv = 0x08, // pos[i] contains pitch envelope position - VUMeters = 0x10, // pos[i] contains pattern VU meter for this channel - EOS = 0x20, // End of stream reached, the GUI should stop the audio device - Stop = 0x40, // Audio device has been stopped -> reset GUI + GlobalVU = 0x00, // Global VU meters (always enabled) + Position = 0x01, // Pattern playback position + Sample = 0x02, // pos[i] contains sample position on this channel + VolEnv = 0x04, // pos[i] contains volume envelope position + PanEnv = 0x08, // pos[i] contains panning envelope position + PitchEnv = 0x10, // pos[i] contains pitch envelope position + VUMeters = 0x20, // pos[i] contains pattern VU meter for this channel + EOS = 0x40, // End of stream reached, the GUI should stop the audio device + Stop = 0x80, // Audio device has been stopped -> reset GUI - Default = Position, + Default = GlobalVU, }; typedef uint16 Item; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-09 19:57:45 UTC (rev 1803) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2013-04-09 23:28:03 UTC (rev 1804) @@ -3504,63 +3504,66 @@ return 0; } - ORDERINDEX nOrd = pnotify->order; - ROWINDEX nRow = pnotify->row; - PATTERNINDEX nPat = pnotify->pattern; //get player pattern - bool updateOrderList = false; - - if(m_nLastPlayedOrder != nOrd) + if(pnotify->type[Notification::Position]) { - updateOrderList = true; - m_nLastPlayedOrder = nOrd; - } + ORDERINDEX nOrd = pnotify->order; + ROWINDEX nRow = pnotify->row; + PATTERNINDEX nPat = pnotify->pattern; //get player pattern + bool updateOrderList = false; - if (nRow < m_nLastPlayedRow) - { - InvalidateChannelsHeaders(); - } - m_nLastPlayedRow = nRow; + if(m_nLastPlayedOrder != nOrd) + { + updateOrderList = true; + m_nLastPlayedOrder = nOrd; + } - if(pSndFile->m_SongFlags[SONG_PAUSED | SONG_STEP]) return 0; + if (nRow < m_nLastPlayedRow) + { + InvalidateChannelsHeaders(); + } + m_nLastPlayedRow = nRow; + if(pSndFile->m_SongFlags[SONG_PAUSED | SONG_STEP]) return 0; - if (nOrd >= pSndFile->Order.GetLength() || pSndFile->Order[nOrd] != nPat) - { - //order doesn't correlate with pattern, so mark it as invalid - nOrd = ORDERINDEX_INVALID; - } - if (m_pEffectVis && m_pEffectVis->m_hWnd) - { - m_pEffectVis->SetPlayCursor(nPat, nRow); - } + if (nOrd >= pSndFile->Order.GetLength() || pSndFile->Order[nOrd] != nPat) + { + //order doesn't correlate with pattern, so mark it as invalid + nOrd = ORDERINDEX_INVALID; + } - // Don't follow song if user drags selections or scrollbars. - if((m_Status & (psFollowSong | psDragActive)) == psFollowSong) - { - if (nPat < pSndFile->Patterns.Size()) + if (m_pEffectVis && m_pEffectVis->m_hWnd) { - if (nPat != m_nPattern || updateOrderList) + m_pEffectVis->SetPlayCursor(nPat, nRow); + } + + // Don't follow song if user drags selections or scrollbars. + if((m_Status & (psFollowSong | psDragActive)) == psFollowSong) + { + if (nPat < pSndFile->Patterns.Size()) { - if(nPat != m_nPattern) SetCurrentPattern(nPat, nRow); - if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); - updateOrderList = false; + if (nPat != m_nPattern || updateOrderList) + { + if(nPat != m_nPattern) SetCurrentPattern(nPat, nRow); + if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); + updateOrderList = false; + } + if (nRow != GetCurrentRow()) + { + SetCurrentRow((nRow < pSndFile->Patterns[nPat].GetNumRows()) ? nRow : 0, FALSE, FALSE); + } } - if (nRow != GetCurrentRow()) + } else + { + if(updateOrderList) { - SetCurrentRow((nRow < pSndFile->Patterns[nPat].GetNumRows()) ? nRow : 0, FALSE, FALSE); + SendCtrlMessage(CTRLMSG_FORCEREFRESH); //force orderlist refresh + updateOrderList = false; } } - } else - { - if(updateOrderList) - { - SendCtrlMessage(CTRLMSG_FORCEREFRESH); //force orderlist refresh - updateOrderList = false; - } + SetPlayCursor(nPat, nRow); + m_nPlayTick = pnotify->tick; } - SetPlayCursor(nPat, nRow); - m_nPlayTick = pnotify->tick; if(pnotify->type[Notification::VUMeters | Notification::Stop] && m_Status[psShowVUMeters]) { @@ -3753,7 +3756,7 @@ const uint8 nNote = nByte1 + NOTE_MIN; int nVol = nByte2; // At this stage nVol is a non linear value in [0;127] // Need to convert to linear in [0;64] - see below - uint8 event = MIDIEvents::GetTypeFromEvent(dwMidiData); + MIDIEvents::EventType event = MIDIEvents::GetTypeFromEvent(dwMidiData); uint8 channel = MIDIEvents::GetChannelFromEvent(dwMidiData); if ((event == MIDIEvents::evNoteOn) && !nVol) event = MIDIEvents::evNoteOff; //Convert event to note-off if req'd @@ -3924,7 +3927,6 @@ m_Status.reset(psFollowSong); if (lParam) { - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); m_Status.set(psFollowSong); if(pModDoc) pModDoc->SetNotifications(Notification::Position | Notification::VUMeters); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-09 23:58:56
|
Revision: 1806 http://sourceforge.net/p/modplug/code/1806 Author: manxorist Date: 2013-04-09 23:58:50 +0000 (Tue, 09 Apr 2013) Log Message: ----------- [Fix] Force updating of vu meters when receiving a stop notification. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 23:29:27 UTC (rev 1805) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-09 23:58:50 UTC (rev 1806) @@ -524,8 +524,8 @@ Notification *pnotify = (Notification *)lParam; if (pnotify) { - m_VuMeterLeft.SetVuMeter(pnotify->masterVU[0] & (~Notification::ClipVU)); - m_VuMeterRight.SetVuMeter(pnotify->masterVU[1] & (~Notification::ClipVU)); + m_VuMeterLeft.SetVuMeter(pnotify->masterVU[0] & (~Notification::ClipVU), pnotify->type[Notification::Stop]); + m_VuMeterRight.SetVuMeter(pnotify->masterVU[1] & (~Notification::ClipVU), pnotify->type[Notification::Stop]); } return 0; } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 23:29:27 UTC (rev 1805) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 23:58:50 UTC (rev 1806) @@ -2304,8 +2304,7 @@ if (GetFollowSong()) ::SendMessage(GetFollowSong(), WM_MOD_UPDATEPOSITION, 0, lParam); } - m_wndToolBar.m_VuMeter.SetVuMeter(pnotify->masterVU[0], pnotify->masterVU[1]); - + m_wndToolBar.m_VuMeter.SetVuMeter(pnotify->masterVU[0], pnotify->masterVU[1], pnotify->type[Notification::Stop]); } return 0; } Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-09 23:29:27 UTC (rev 1805) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-09 23:58:50 UTC (rev 1806) @@ -1102,15 +1102,15 @@ } -void CStereoVU::SetVuMeter(uint32 left, uint32 right) -//--------------------------------------------------- +void CStereoVU::SetVuMeter(uint32 left, uint32 right, bool force) +//--------------------------------------------------------------- { if(left != vuMeter[0] || right != vuMeter[1]) { vuMeter[0] = left; vuMeter[1] = right; DWORD curTime = timeGetTime(); - if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval) + if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) { CClientDC dc(this); DrawVuMeters(dc.m_hDC); Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2013-04-09 23:29:27 UTC (rev 1805) +++ trunk/OpenMPT/mptrack/Mainbar.h 2013-04-09 23:58:50 UTC (rev 1806) @@ -21,7 +21,7 @@ public: CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; } - void SetVuMeter(uint32 left, uint32 right); + void SetVuMeter(uint32 left, uint32 right, bool force=false); void SetOrientation(bool h) { horizontal = h; } protected: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-10 00:28:32
|
Revision: 1808 http://sourceforge.net/p/modplug/code/1808 Author: saga-games Date: 2013-04-10 00:28:25 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Fix] Time display was not updated anymore since rev 1509 (OpenMPT 1.21) when jumping around in the order list without actually playing the module. [Mod] VST: Send effBeginSetProgram and effEndSetProgram opcodes. [Ref] Removed CMainFrame::IsRendering, as we should query this information from a CSoundFile object directly. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1509 Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Vstplug.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-09 23:59:47 UTC (rev 1807) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 00:28:25 UTC (rev 1808) @@ -2058,14 +2058,14 @@ if(m_pSndFile != nullptr && m_pSndFile->GetSampleRate() != 0) { time = m_pSndFile->GetTotalSampleCount() / m_pSndFile->GetSampleRate(); + if(time != m_dwTimeSec) + { + m_dwTimeSec = time; + m_nAvgMixChn = m_nMixChn; + OnUpdateTime(NULL); + } } - if (time != m_dwTimeSec) - { - m_dwTimeSec = time; - m_nAvgMixChn = m_nMixChn; - OnUpdateTime(NULL); - } // Idle Time Check DWORD curTime = timeGetTime(); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-09 23:59:47 UTC (rev 1807) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-10 00:28:25 UTC (rev 1808) @@ -404,9 +404,10 @@ bool m_bModTreeHasFocus; //rewbs.customKeys CWnd *m_pNoteMapHasFocus; //rewbs.customKeys CWnd* m_pOrderlistHasFocus; - long GetSampleRate(); //rewbs.VSTTimeInfo - double GetApproxBPM(); //rewbs.VSTTimeInfo + long GetSampleRate(); + double GetApproxBPM(); void ThreadSafeSetModified(CModDoc* modified) {m_pJustModifiedDoc=modified;} + void SetElapsedTime(double t) { m_dwTimeSec = static_cast<CSoundFile::samplecount_t>(t); } CModTree *GetUpperTreeview() { return m_wndTree.m_pModTree; } CModTree *GetLowerTreeview() { return m_wndTree.m_pModTreeData; } @@ -453,8 +454,7 @@ void PreparePreview(ModCommand::NOTE note); void StopPreview() { StopSoundFile(&m_WaveFile); } - inline bool IsPlaying() const { return m_pSndFile ? true : false; } - inline bool IsRendering() const { return m_pSndFile ? m_pSndFile->m_bIsRendering : false; } + inline bool IsPlaying() const { return m_pSndFile != nullptr; } inline CModDoc *GetModPlaying() const { return m_pSndFile ? m_pSndFile->GetpModDoc() : nullptr; } inline CSoundFile *GetSoundFilePlaying() const { return m_pSndFile; } // may be nullptr BOOL InitRenderer(CSoundFile*); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-09 23:59:47 UTC (rev 1807) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-10 00:28:25 UTC (rev 1808) @@ -2755,7 +2755,12 @@ void CModDoc::SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow) //---------------------------------------------------------- { - m_SndFile.GetPlaybackTimeAt(nOrd, nRow, true); + double t = m_SndFile.GetPlaybackTimeAt(nOrd, nRow, true); + CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); + if(pMainFrm != nullptr) + { + pMainFrm->SetElapsedTime(Util::Max(0.0, t)); + } } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-09 23:59:47 UTC (rev 1807) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-10 00:28:25 UTC (rev 1808) @@ -683,7 +683,7 @@ CVstPlugin *pVstPlugin = nullptr; if(effect != nullptr) { - pVstPlugin = reinterpret_cast<CVstPlugin *>(effect->resvd1); + pVstPlugin = FromVstPtr<CVstPlugin>(effect->resvd1); } switch(opcode) @@ -823,7 +823,7 @@ // numInputs and/or numOutputs has changed case audioMasterIOChanged: - if (pVstPlugin != nullptr) + if(pVstPlugin != nullptr) { CriticalSection cs; return pVstPlugin->InitializeIOBuffers() ? 1 : 0; @@ -832,7 +832,7 @@ // plug needs idle calls (outside its editor window) - DEPRECATED in VST 2.4 case audioMasterNeedIdle: - if (pVstPlugin != nullptr) + if(pVstPlugin != nullptr) { pVstPlugin->m_bNeedIdle = true; } @@ -841,7 +841,7 @@ // index: width, value: height case audioMasterSizeWindow: - if (pVstPlugin != nullptr) + if(pVstPlugin != nullptr) { CAbstractVstEditor *pVstEditor = pVstPlugin->GetEditor(); if (pVstEditor && pVstEditor->IsResizable()) @@ -895,7 +895,7 @@ return 1; //we replace. case audioMasterGetCurrentProcessLevel: - if(CMainFrame::GetMainFrame()->IsRendering()) + if(pVstPlugin != nullptr && pVstPlugin->GetSoundFile().m_bIsRendering) return kVstProcessLevelOffline; else return kVstProcessLevelRealtime; @@ -940,19 +940,14 @@ case audioMasterGetVendorString: strcpy((char *) ptr, s_szHostVendorString); - //strcpy((char*)ptr,"Steinberg"); - //return 0; return 1; case audioMasterGetProductString: strcpy((char *) ptr, s_szHostProductString); - //strcpy((char*)ptr,"Cubase VST"); - //return 0; return 1; case audioMasterGetVendorVersion: return s_nHostVendorVersion; - //return 7000; case audioMasterVendorSpecific: return 0; @@ -1012,11 +1007,11 @@ // something has changed, update 'multi-fx' display case audioMasterUpdateDisplay: - if (pVstPlugin != nullptr) + if(pVstPlugin != nullptr) { // Note to self for testing: Electri-Q sends opcode. Korg M1 sends this when switching between Combi and Multi mode to update the preset names. CAbstractVstEditor *pVstEditor = pVstPlugin->GetEditor(); - if (pVstEditor && ::IsWindow(pVstEditor->m_hWnd)) + if(pVstEditor && ::IsWindow(pVstEditor->m_hWnd)) { pVstEditor->SetupMenu(true); } @@ -1177,8 +1172,7 @@ { // Plugin wants a directory - char szInitPath[_MAX_PATH]; - MemsetZero(szInitPath); + char szInitPath[_MAX_PATH] = { '\0' }; if(fileSel->initialPath) { StringFixer::CopyN(szInitPath, fileSel->initialPath); @@ -1304,7 +1298,7 @@ m_MixState.dwFlags = 0; m_MixState.nVolDecayL = 0; m_MixState.nVolDecayR = 0; - m_MixState.pMixBuffer = (int *)((((DWORD)m_MixBuffer)+7)&~7); + m_MixState.pMixBuffer = (int *)((((intptr_t)m_MixBuffer) + 7) & ~7); m_MixState.pOutBufferL = mixBuffer.GetInputBuffer(0); m_MixState.pOutBufferR = mixBuffer.GetInputBuffer(1); @@ -1391,9 +1385,11 @@ m_nSampleRate = CSoundFile::gdwMixingFreq; Dispatch(effSetSampleRate, 0, 0, nullptr, static_cast<float>(CSoundFile::gdwMixingFreq)); Dispatch(effSetBlockSize, 0, MIXBUFFERSIZE, nullptr, 0.0f); - if (m_Effect.numPrograms > 0) + if(m_Effect.numPrograms > 0) { + Dispatch(effBeginSetProgram, 0, 0, nullptr, 0); Dispatch(effSetProgram, 0, 0, nullptr, 0); + Dispatch(effEndSetProgram, 0, 0, nullptr, 0); } InitializeIOBuffers(); @@ -1787,7 +1783,9 @@ { if(nIndex < m_Effect.numPrograms) { + Dispatch(effBeginSetProgram, 0, 0, nullptr, 0); Dispatch(effSetProgram, 0, nIndex, nullptr, 0); + Dispatch(effEndSetProgram, 0, 0, nullptr, 0); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-10 20:55:22
|
Revision: 1821 http://sourceforge.net/p/modplug/code/1821 Author: manxorist Date: 2013-04-10 20:55:15 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Imp] Speed up vu-meter drawing by using FillSolidRect instead of LineTo. In global vu-meter, only redraw the segments that actually changed since last update. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h trunk/OpenMPT/mptrack/Mainfrm.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-10 20:55:15 UTC (rev 1821) @@ -604,11 +604,10 @@ { CRect rect; CPaintDC dc(this); - HDC hdc = dc.m_hDC; GetClientRect(&rect); - FillRect(hdc, &rect, CMainFrame::brushBlack); + dc.FillSolidRect(rect.left, rect.top, rect.Width(), rect.Height(), RGB(0,0,0)); m_nDisplayedVu = -1; - DrawVuMeter(hdc); + DrawVuMeter(dc, true); } @@ -623,22 +622,23 @@ if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) { CClientDC dc(this); - DrawVuMeter(dc.m_hDC); + DrawVuMeter(dc); lastVuUpdateTime = curTime; } } } -VOID CVuMeter::DrawVuMeter(HDC hdc) -//--------------------------------- +VOID CVuMeter::DrawVuMeter(CDC &dc, bool redraw) +//---------------------------------------------- { LONG vu; + LONG lastvu; CRect rect; GetClientRect(&rect); - HGDIOBJ oldpen = SelectObject(hdc, CMainFrame::penBlack); vu = (m_nVuMeter * (rect.bottom-rect.top)) >> 8; + lastvu = (m_nDisplayedVu * (rect.bottom-rect.top)) >> 8; int cy = rect.bottom - rect.top; if (cy < 1) cy = 1; for (int ry=rect.bottom-1; ry>rect.top; ry-=2) @@ -647,11 +647,8 @@ int n = Clamp((y0 * NUM_VUMETER_PENS) / cy, 0, NUM_VUMETER_PENS - 1); if (vu < y0) n += NUM_VUMETER_PENS; - - SelectObject(hdc, CMainFrame::gpenVuMeter[n]); - MoveToEx(hdc, rect.left, ry, NULL); - LineTo(hdc, rect.right, ry); + dc.FillSolidRect(rect.left, ry, rect.Width(), 1, CMainFrame::gcolrefVuMeter[n]); } - SelectObject(hdc, oldpen); m_nDisplayedVu = m_nVuMeter; } + Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-10 20:55:15 UTC (rev 1821) @@ -24,7 +24,7 @@ VOID SetVuMeter(LONG lVuMeter, bool force=false); protected: - VOID DrawVuMeter(HDC hdc); + VOID DrawVuMeter(CDC &dc, bool redraw=false); protected: afx_msg void OnPaint(); Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 20:55:15 UTC (rev 1821) @@ -157,7 +157,7 @@ LPMODPLUGDIB CMainFrame::bmpVUMeters = NULL; LPMODPLUGDIB CMainFrame::bmpVisNode = NULL; LPMODPLUGDIB CMainFrame::bmpVisPcNode = NULL; -HPEN CMainFrame::gpenVuMeter[NUM_VUMETER_PENS*2]; +COLORREF CMainFrame::gcolrefVuMeter[NUM_VUMETER_PENS*2]; CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave @@ -207,7 +207,7 @@ m_TotalSamplesRendered = 0; m_PendingNotificationSempahore = NULL; - MemsetZero(gpenVuMeter); + MemsetZero(gcolrefVuMeter); // Create Audio Critical Section MemsetZero(g_csAudio); @@ -453,10 +453,6 @@ DeleteGDIObject(penGraycc); DeleteGDIObject(penGrayff); - for (UINT i=0; i<NUM_VUMETER_PENS*2; i++) - { - DeleteGDIObject(gpenVuMeter[i]); - } #undef DeleteGDIObject return CMDIFrameWnd::DestroyWindow(); @@ -1209,11 +1205,6 @@ int r, g, b; int y; - if (gpenVuMeter[i]) - { - DeleteObject(gpenVuMeter[i]); - gpenVuMeter[i] = NULL; - } y = (i >= NUM_VUMETER_PENS) ? (i-NUM_VUMETER_PENS) : i; if (y < (NUM_VUMETER_PENS/2)) { @@ -1242,7 +1233,7 @@ g = (g*2)/5; b = (b*2)/5; } - gpenVuMeter[i] = CreatePen(PS_SOLID, 0, RGB(r, g, b)); + gcolrefVuMeter[i] = RGB(r, g, b); } // Sequence window { Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 20:55:15 UTC (rev 1821) @@ -1095,10 +1095,9 @@ { CRect rect; CPaintDC dc(this); - HDC hdc = dc.m_hDC; GetClientRect(&rect); - FillRect(hdc, &rect, CMainFrame::brushBlack); - DrawVuMeters(hdc); + dc.FillSolidRect(rect.left, rect.top, rect.Width(), rect.Height(), RGB(0,0,0)); + DrawVuMeters(dc, true); } @@ -1113,7 +1112,7 @@ if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) { CClientDC dc(this); - DrawVuMeters(dc.m_hDC); + DrawVuMeters(dc); lastVuUpdateTime = curTime; } } @@ -1121,8 +1120,8 @@ // Draw stereo VU -void CStereoVU::DrawVuMeters(HDC hdc) -//----------------------------------- +void CStereoVU::DrawVuMeters(CDC &dc, bool redraw) +//------------------------------------------------ { CRect rect; GetClientRect(&rect); @@ -1142,17 +1141,17 @@ rectR.left = mid + 1; } - HGDIOBJ oldPen = SelectObject(hdc, CMainFrame::penBlack); - DrawVuMeter(hdc, rectL, vuMeter[0]); - DrawVuMeter(hdc, rectR, vuMeter[1]); - SelectObject(hdc, oldPen); + DrawVuMeter(dc, rectL, 0, redraw); + DrawVuMeter(dc, rectR, 1, redraw); } // Draw a single VU Meter -void CStereoVU::DrawVuMeter(HDC hdc, const CRect &rect, uint32 vu) -//---------------------------------------------------------------- +void CStereoVU::DrawVuMeter(CDC &dc, const CRect &rect, int index, bool redraw) +//----------------------------------------------------------------------------- { + uint32 vu = vuMeter[index]; + if(CMainFrame::GetMainFrame()->GetSoundFilePlaying() == nullptr) { vu = 0; @@ -1175,10 +1174,10 @@ if(v <= rx && (!last || !clip)) pen += NUM_VUMETER_PENS; - SelectObject(hdc, CMainFrame::gpenVuMeter[pen]); - MoveToEx(hdc, rx, rect.top, NULL); - LineTo(hdc, rx, rect.bottom); + bool draw = redraw || (v < lastV[index] && v<=rx && rx<=lastV[index]) || (lastV[index] < v && lastV[index]<=rx && rx<=v); + if(draw) dc.FillSolidRect(rx, rect. top, 1, rect.Height(), CMainFrame::gcolrefVuMeter[pen]); } + lastV[index] = v; } else { const int cy = Util::Max(1, rect.Height()); @@ -1194,10 +1193,10 @@ if(v <= y0 && (!last || !clip)) pen += NUM_VUMETER_PENS; - SelectObject(hdc, CMainFrame::gpenVuMeter[pen]); - MoveToEx(hdc, rect.left, ry, NULL); - LineTo(hdc, rect.right, ry); + bool draw = redraw || (v < lastV[index] && v<=ry && ry<=lastV[index]) || (lastV[index] < v && lastV[index]<=ry && ry<=v); + if(draw) dc.FillSolidRect(rect.left, ry, rect.Width(), 1, CMainFrame::gcolrefVuMeter[pen]); } + lastV[index] = v; } } Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 20:55:15 UTC (rev 1821) @@ -17,16 +17,17 @@ protected: uint32 vuMeter[2]; DWORD lastVuUpdateTime; + int lastV[2]; bool horizontal; public: - CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; } + CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; lastV[0] = lastV[1] = 0; } void SetVuMeter(uint32 left, uint32 right, bool force=false); void SetOrientation(bool h) { horizontal = h; } protected: - void DrawVuMeters(HDC hdc); - void DrawVuMeter(HDC hdc, const CRect &rect, uint32 vu); + void DrawVuMeters(CDC &dc, bool redraw=false); + void DrawVuMeter(CDC &dc, const CRect &rect, int index, bool redraw=false); protected: afx_msg void OnPaint(); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-10 20:51:55 UTC (rev 1820) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-10 20:55:15 UTC (rev 1821) @@ -285,7 +285,7 @@ static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penEnvelopeHighlight, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; static HCURSOR curDragging, curNoDrop, curArrow, curNoDrop2, curVSplit; static MODPLUGDIB *bmpPatterns, *bmpNotes, *bmpVUMeters, *bmpVisNode, *bmpVisPcNode; - static HPEN gpenVuMeter[NUM_VUMETER_PENS * 2]; // General tab VU meters + static COLORREF gcolrefVuMeter[NUM_VUMETER_PENS * 2]; // General tab VU meters public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-10 21:22:58
|
Revision: 1823 http://sourceforge.net/p/modplug/code/1823 Author: manxorist Date: 2013-04-10 21:22:51 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Fix] Resetting clipping indicator in global vu-meter was broken in r1821. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1821 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 20:58:48 UTC (rev 1822) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 21:22:51 UTC (rev 1823) @@ -1175,7 +1175,9 @@ pen += NUM_VUMETER_PENS; bool draw = redraw || (v < lastV[index] && v<=rx && rx<=lastV[index]) || (lastV[index] < v && lastV[index]<=rx && rx<=v); + draw = draw || (last && clip != lastClip[index]); if(draw) dc.FillSolidRect(rx, rect. top, 1, rect.Height(), CMainFrame::gcolrefVuMeter[pen]); + if(last) lastClip[index] = clip; } lastV[index] = v; } else @@ -1194,7 +1196,9 @@ pen += NUM_VUMETER_PENS; bool draw = redraw || (v < lastV[index] && v<=ry && ry<=lastV[index]) || (lastV[index] < v && lastV[index]<=ry && ry<=v); + draw = draw || (last && clip != lastClip[index]); if(draw) dc.FillSolidRect(rect.left, ry, rect.Width(), 1, CMainFrame::gcolrefVuMeter[pen]); + if(last) lastClip[index] = clip; } lastV[index] = v; } Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 20:58:48 UTC (rev 1822) +++ trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 21:22:51 UTC (rev 1823) @@ -18,10 +18,11 @@ uint32 vuMeter[2]; DWORD lastVuUpdateTime; int lastV[2]; + bool lastClip[2]; bool horizontal; public: - CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; lastV[0] = lastV[1] = 0; } + CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; lastV[0] = lastV[1] = 0; lastClip[0] = lastClip[1] = false; } void SetVuMeter(uint32 left, uint32 right, bool force=false); void SetOrientation(bool h) { horizontal = h; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-10 22:43:05
|
Revision: 1828 http://sourceforge.net/p/modplug/code/1828 Author: manxorist Date: 2013-04-10 22:42:58 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Var] Remove commented-out m_pPerfCounter. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 22:29:15 UTC (rev 1827) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-10 22:42:58 UTC (rev 1828) @@ -161,7 +161,6 @@ CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave -//CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr; static UINT indicators[] = { @@ -216,7 +215,6 @@ TrackerSettings::Instance().LoadSettings(); m_InputHandler = new CInputHandler(this); //rewbs.customKeys - //m_pPerfCounter= new CPerformanceCounter(); //Loading static tunings here - probably not the best place to do that but anyway. CSoundFile::LoadStaticTunings(); @@ -282,7 +280,6 @@ DeleteCriticalSection(&g_csAudio); delete m_InputHandler; //rewbs.customKeys delete m_pAutoSaver; //rewbs.autosaver - //delete m_pPerfCounter; CChannelManagerDlg::DestroySharedInstance(); CSoundFile::DeleteStaticdata(); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-10 22:29:15 UTC (rev 1827) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-10 22:42:58 UTC (rev 1828) @@ -377,7 +377,6 @@ static LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam); static CInputHandler *m_InputHandler; //rewbs.customKeys static CAutoSaver *m_pAutoSaver; //rewbs.customKeys - //static CPerformanceCounter *m_pPerfCounter; static bool WritePrivateProfileLong(const CString section, const CString key, const long value, const CString iniFile); static long GetPrivateProfileLong(const CString section, const CString key, const long defaultValue, const CString iniFile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-11 18:35:16
|
Revision: 1846 http://sourceforge.net/p/modplug/code/1846 Author: saga-games Date: 2013-04-11 18:35:08 +0000 (Thu, 11 Apr 2013) Log Message: ----------- [Ref] Make CVstPlugin use its own m_nSampleRate information instead of querying CMainFrame. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-11 18:19:18 UTC (rev 1845) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-11 18:35:08 UTC (rev 1846) @@ -2480,21 +2480,6 @@ } -//end rewbs.VSTTimeInfo -long CMainFrame::GetSampleRate() -//------------------------------ -{ - CriticalSection cs; - if(GetSoundFilePlaying()) - { - return GetSoundFilePlaying()->GetSampleRate(); - } else - { - return TrackerSettings::Instance().m_MixerSettings.gdwMixingFreq; - } -} - - double CMainFrame::GetApproxBPM() //------------------------------- { Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-11 18:19:18 UTC (rev 1845) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-04-11 18:35:08 UTC (rev 1846) @@ -383,7 +383,6 @@ bool m_bModTreeHasFocus; //rewbs.customKeys CWnd *m_pNoteMapHasFocus; //rewbs.customKeys CWnd* m_pOrderlistHasFocus; - __declspec(deprecated) long GetSampleRate(); double GetApproxBPM(); void ThreadSafeSetModified(CModDoc* modified) {m_pJustModifiedDoc=modified;} void SetElapsedTime(double t) { m_dwTimeSec = static_cast<CSoundFile::samplecount_t>(t); } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-11 18:19:18 UTC (rev 1845) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-04-11 18:35:08 UTC (rev 1846) @@ -730,10 +730,10 @@ // <value> should contain a mask indicating which fields are required case audioMasterGetTime: MemsetZero(timeInfo); - timeInfo.sampleRate = CMainFrame::GetMainFrame()->GetSampleRate(); if(pVstPlugin) { + timeInfo.sampleRate = pVstPlugin->m_nSampleRate; CSoundFile &sndFile = pVstPlugin->GetSoundFile(); if(pVstPlugin->IsSongPlaying()) { @@ -853,7 +853,10 @@ return 1; case audioMasterGetSampleRate: - return CMainFrame::GetMainFrame()->GetSampleRate(); + if(pVstPlugin) + { + return pVstPlugin->m_nSampleRate; + } case audioMasterGetBlockSize: return MIXBUFFERSIZE; @@ -863,8 +866,9 @@ break; case audioMasterGetOutputLatency: + if(pVstPlugin) { - return Util::muldiv(TrackerSettings::Instance().m_LatencyMS, CMainFrame::GetMainFrame()->GetSampleRate(), 1000); + return Util::muldiv(TrackerSettings::Instance().m_LatencyMS, pVstPlugin->m_nSampleRate, 1000); } // input pin in <value> (-1: first to come), returns cEffect* - DEPRECATED in VST 2.4 @@ -1304,7 +1308,7 @@ m_bSongPlaying = false; //rewbs.VSTCompliance m_bPlugResumed = false; - m_nSampleRate = nInvalidSampleRate; //rewbs.VSTCompliance: gets set on Resume() + m_nSampleRate = uint32_max; MemsetZero(m_MidiCh); for(int ch = 0; ch < 16; ch++) @@ -1908,7 +1912,7 @@ void CVstPlugin::Resume() //----------------------- { - const DWORD sampleRate = m_SndFile.GetSampleRate(); + const uint32 sampleRate = m_SndFile.GetSampleRate(); try { Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2013-04-11 18:19:18 UTC (rev 1845) +++ trunk/OpenMPT/mptrack/Vstplug.h 2013-04-11 18:35:08 UTC (rev 1846) @@ -145,7 +145,6 @@ CSoundFile &m_SndFile; size_t m_nRefCount; - static const uint32 nInvalidSampleRate = UINT_MAX; uint32 m_nSampleRate; SNDMIXPLUGINSTATE m_MixState; uint32 m_nInputs, m_nOutputs; @@ -362,4 +361,4 @@ VSTPluginLib *GetFirstPlugin() const { return 0; } void OnIdle() {} #endif // NO_VST -}; \ No newline at end of file +}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-11 22:59:39
|
Revision: 1851 http://sourceforge.net/p/modplug/code/1851 Author: saga-games Date: 2013-04-11 22:59:30 +0000 (Thu, 11 Apr 2013) Log Message: ----------- [Fix] Moved plugin resume call so that OpenMPT doesn't freeze anymore when starting WASAPI playback with an instance of the Sytrus plugin being loaded. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-11 21:32:52 UTC (rev 1850) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-11 22:59:30 UTC (rev 1851) @@ -1344,8 +1344,8 @@ { CriticalSection::AssertUnlocked(); if(!pModDoc) return false; - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if(!IsValidSoundFile(pSndFile)) return false; + CSoundFile &sndFile = pModDoc->GetrSoundFile(); + if(!IsValidSoundFile(sndFile)) return false; // if something is playing, pause it PausePlayback(); @@ -1357,19 +1357,20 @@ if (!PreparePlayback()) return false; // set mixing parameters in CSoundFile - UpdateAudioParameters(*pSndFile); + UpdateAudioParameters(sndFile); - SetPlaybackSoundFile(pSndFile); + SetPlaybackSoundFile(&sndFile); const bool bPaused = m_pSndFile->IsPaused(); const bool bPatLoop = m_pSndFile->m_SongFlags[SONG_PATTERNLOOP]; m_pSndFile->ResetChannels(); - if(!bPatLoop && bPaused) pSndFile->m_SongFlags.set(SONG_PAUSED); - pSndFile->SetRepeatCount((TrackerSettings::Instance().gbLoopSong) ? -1 : 0); + if(!bPatLoop && bPaused) sndFile.m_SongFlags.set(SONG_PAUSED); + sndFile.SetRepeatCount((TrackerSettings::Instance().gbLoopSong) ? -1 : 0); - m_pSndFile->InitPlayer(TRUE); + sndFile.InitPlayer(TRUE); + sndFile.ResumePlugins(); m_wndToolBar.SetCurrentSong(m_pSndFile); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-11 21:32:52 UTC (rev 1850) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-11 22:59:30 UTC (rev 1851) @@ -1033,7 +1033,7 @@ pChn->nPosLo = 0; pChn->nLoopStart = loopStart; pChn->nLoopEnd = loopEnd; - pChn->nLength = min(UINT(loopEnd), pChn->pModSample->nLength); + pChn->nLength = Util::Min(loopEnd, pChn->pModSample->nLength); } // Handle extra-loud flag @@ -1945,12 +1945,9 @@ m_SndFile.m_bPositionChanged = true; - if (isPlaying) + if(isPlaying) { m_SndFile.StopAllVsti(); - } else - { - m_SndFile.ResumePlugins(); } cs.Leave(); @@ -2037,7 +2034,6 @@ m_SndFile.m_lTotalSampleCount = 0; m_SndFile.m_bPositionChanged = true; - m_SndFile.ResumePlugins(); cs.Leave(); @@ -2346,9 +2342,6 @@ if(pModPlaying == this) { m_SndFile.StopAllVsti(); - } else - { - m_SndFile.ResumePlugins(); } cs.Leave(); @@ -2404,9 +2397,6 @@ if(pModPlaying == this) { m_SndFile.StopAllVsti(); - } else - { - m_SndFile.ResumePlugins(); } cs.Leave(); @@ -2465,9 +2455,6 @@ if(pModPlaying == this) { m_SndFile.StopAllVsti(); - } else - { - m_SndFile.ResumePlugins(); } cs.Leave(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-13 14:08:16
|
Revision: 1871 http://sourceforge.net/p/modplug/code/1871 Author: manxorist Date: 2013-04-13 14:08:10 +0000 (Sat, 13 Apr 2013) Log Message: ----------- [Fix] In r1802, the ratelimiting of vu meter updates updated the internal state even when no redraw was actually done. Especially when falling comletely silent, this caused the lowest segments to not be cleared properly. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1802 Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Mainbar.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-13 13:43:27 UTC (rev 1870) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-13 14:08:10 UTC (rev 1871) @@ -617,10 +617,10 @@ lVuMeter >>= 8; if (lVuMeter != m_nVuMeter) { - m_nVuMeter = lVuMeter; DWORD curTime = timeGetTime(); if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) { + m_nVuMeter = lVuMeter; CClientDC dc(this); DrawVuMeter(dc); lastVuUpdateTime = curTime; Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-13 13:43:27 UTC (rev 1870) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-13 14:08:10 UTC (rev 1871) @@ -1106,11 +1106,11 @@ { if(left != vuMeter[0] || right != vuMeter[1]) { - vuMeter[0] = left; - vuMeter[1] = right; DWORD curTime = timeGetTime(); if(curTime - lastVuUpdateTime >= TrackerSettings::Instance().VuMeterUpdateInterval || force) { + vuMeter[0] = left; + vuMeter[1] = right; CClientDC dc(this); DrawVuMeters(dc); lastVuUpdateTime = curTime; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-14 11:18:21
|
Revision: 1874 http://sourceforge.net/p/modplug/code/1874 Author: manxorist Date: 2013-04-14 11:18:13 +0000 (Sun, 14 Apr 2013) Log Message: ----------- [Fix] Changing the MMX/SSE acceleration setting was broken since r1842. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1842 Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-14 00:32:41 UTC (rev 1873) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-04-14 11:18:13 UTC (rev 1874) @@ -1705,6 +1705,7 @@ UpdateWindow(); } else { + TrackerSettings::Instance().m_MixerSettings.MixerFlags = q; // No need to restart playback CriticalSection cs; if(GetSoundFilePlaying()) UpdateAudioParameters(*GetSoundFilePlaying(), FALSE); Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-14 00:32:41 UTC (rev 1873) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-04-14 11:18:13 UTC (rev 1874) @@ -467,14 +467,6 @@ wsprintf(s, "%d ms", m_UpdateIntervalMS); m_CbnUpdateIntervalMS.SetWindowText(s); } - // Soft Panning - if (m_dwSoundSetup & SNDMIX_SOFTPANNING) - { - TrackerSettings::Instance().m_MixerSettings.MixerFlags |= SNDMIX_SOFTPANNING; - } else - { - TrackerSettings::Instance().m_MixerSettings.MixerFlags &= ~SNDMIX_SOFTPANNING; - } CMainFrame::GetMainFrame()->SetupSoundCard(m_dwSoundSetup, m_dwRate, m_SampleFormat, m_nChannels, m_LatencyMS, m_UpdateIntervalMS, m_nSoundDevice); UpdateStatistics(); CPropertyPage::OnOK(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-14 17:31:00
|
Revision: 1878 http://sourceforge.net/p/modplug/code/1878 Author: saga-games Date: 2013-04-14 17:30:46 +0000 (Sun, 14 Apr 2013) Log Message: ----------- [Ref] Turned m_pModDoc, m_pSndFile and m_pParent in CModControlDlg into references. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_com.h trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Ctrl_smp.h trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/EffectVis.h trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/Globals.h Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-14 15:27:39 UTC (rev 1877) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2013-04-14 17:30:46 UTC (rev 1878) @@ -34,8 +34,8 @@ } -CCtrlComments::CCtrlComments() -//---------------------------- +CCtrlComments::CCtrlComments(CModControlView &parent, CModDoc &document) : CModControlDlg(parent, document) +//--------------------------------------------------------------------------------------------------------- { m_nLockCount = 0; m_hFont = NULL; @@ -52,13 +52,9 @@ void CCtrlComments::OnActivatePage(LPARAM) //---------------------------------------- { - CModDoc *modDoc = GetDocument(); - if(modDoc) - { - // Don't stop generating VU meter messages - modDoc->SetNotifications(Notification::Default); - modDoc->SetFollowWnd(m_hWnd); - } + // Don't stop generating VU meter messages + m_modDoc.SetNotifications(Notification::Default); + m_modDoc.SetFollowWnd(m_hWnd); } @@ -110,7 +106,7 @@ void CCtrlComments::UpdateView(DWORD dwHint, CObject *pHint) //---------------------------------------------------------- { - if ((pHint == this) || (!m_pSndFile) || (!(dwHint & (HINT_MODCOMMENTS|HINT_MPTOPTIONS|HINT_MODTYPE)))) return; + if ((pHint == this) || (!(dwHint & (HINT_MODCOMMENTS|HINT_MPTOPTIONS|HINT_MODTYPE)))) return; if (m_nLockCount) return; m_nLockCount++; HFONT newfont; @@ -127,10 +123,10 @@ m_EditComments.SetRedraw(FALSE); m_EditComments.SetSel(0, -1, TRUE); m_EditComments.ReplaceSel(""); - if(!m_pSndFile->songMessage.empty()) + if(!m_sndFile.songMessage.empty()) { CHAR s[256], c; - const char *p = m_pSndFile->songMessage.c_str(); + const char *p = m_sndFile.songMessage.c_str(); UINT ln = 0; while ((c = *p++) != NULL) { @@ -158,7 +154,7 @@ } if (dwHint & HINT_MODTYPE) { - m_EditComments.SetReadOnly(!m_pSndFile->GetModSpecifications().hasComments); + m_EditComments.SetReadOnly(!m_sndFile.GetModSpecifications().hasComments); } m_EditComments.SetRedraw(TRUE); @@ -168,8 +164,8 @@ void CCtrlComments::OnCommentsChanged() //------------------------------------- { - if ((m_nLockCount) || (!m_pSndFile) - || !m_pSndFile->GetModSpecifications().hasComments) return; + if ((m_nLockCount) + || !m_sndFile.GetModSpecifications().hasComments) return; if ((!m_bInitialized) || (!m_EditComments.m_hWnd) || (!m_EditComments.GetModify())) return; CHAR s[LINE_LENGTH + 2]; @@ -207,15 +203,11 @@ } m_EditComments.SetModify(FALSE); - if(p != m_pSndFile->songMessage) + if(p != m_sndFile.songMessage) { - m_pSndFile->songMessage.assign(p); - - if(m_pModDoc) - { - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODCOMMENTS, this); - } + m_sndFile.songMessage.assign(p); + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODCOMMENTS, this); } delete[] p; Modified: trunk/OpenMPT/mptrack/Ctrl_com.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.h 2013-04-14 15:27:39 UTC (rev 1877) +++ trunk/OpenMPT/mptrack/Ctrl_com.h 2013-04-14 17:30:46 UTC (rev 1878) @@ -20,7 +20,7 @@ UINT m_nLockCount; public: - CCtrlComments(); + CCtrlComments(CModControlView &parent, CModDoc &document); LONG* GetSplitPosRef() {return &TrackerSettings::Instance().glCommentsWindowHeight;} //rewbs.varWindowSize public: Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-14 15:27:39 UTC (rev 1877) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2013-04-14 17:30:46 UTC (rev 1878) @@ -76,8 +76,8 @@ } -CCtrlGeneral::CCtrlGeneral() -//-------------------------- +CCtrlGeneral::CCtrlGeneral(CModControlView &parent, CModDoc &document) : CModControlDlg(parent, document) +//------------------------------------------------------------------------------------------------------- { } @@ -85,19 +85,16 @@ BOOL CCtrlGeneral::OnInitDialog() //------------------------------- { - const CModSpecifications specs = m_pSndFile->GetModSpecifications(); + const CModSpecifications specs = m_sndFile.GetModSpecifications(); CModControlDlg::OnInitDialog(); // Song Title - if(m_pSndFile) - m_EditTitle.SetLimitText(specs.modNameLengthMax); - else - m_EditTitle.SetLimitText(25); + m_EditTitle.SetLimitText(specs.modNameLengthMax); // -> CODE#0016 // -> DESC="default tempo update" // m_SpinTempo.SetRange(32, 255); // 255 bpm max - if(m_pSndFile->GetType() & MOD_TYPE_S3M) + if(m_sndFile.GetType() & MOD_TYPE_S3M) { // S3M HACK: ST3 will ignore speed 255, even though it can be used with Axx. m_SpinSpeed.SetRange(1, 254); @@ -144,8 +141,8 @@ void CCtrlGeneral::OnActivatePage(LPARAM) //--------------------------------------- { - if (m_pModDoc) m_pModDoc->SetNotifications(Notification::Default); - if (m_pModDoc) m_pModDoc->SetFollowWnd(m_hWnd); + m_modDoc.SetNotifications(Notification::Default); + m_modDoc.SetFollowWnd(m_hWnd); PostViewMessage(VIEWMSG_SETACTIVE, NULL); SetFocus(); @@ -157,7 +154,7 @@ void CCtrlGeneral::OnDeactivatePage() //----------------------------------- { - if (m_pModDoc) m_pModDoc->SetFollowWnd(NULL); + m_modDoc.SetFollowWnd(NULL); m_VuMeterLeft.SetVuMeter(0, true); m_VuMeterRight.SetVuMeter(0, true); } @@ -167,48 +164,48 @@ //--------------------------------------------------------- { CHAR s[256]; - if ((pHint == this) || (!m_pSndFile)) return; + if (pHint == this) return; if (dwHint & HINT_MODSEQUENCE) { // Set max valid restart position - m_SpinRestartPos.SetRange32(0, m_pSndFile->Order.GetLengthTailTrimmed() - 1); + m_SpinRestartPos.SetRange32(0, m_sndFile.Order.GetLengthTailTrimmed() - 1); } if (dwHint & HINT_MODGENERAL) { if (!m_bEditsLocked) { - m_EditTitle.SetWindowText(m_pSndFile->m_szNames[0]); - wsprintf(s, "%d", m_pSndFile->m_nDefaultTempo); + m_EditTitle.SetWindowText(m_sndFile.m_szNames[0]); + wsprintf(s, "%d", m_sndFile.m_nDefaultTempo); m_EditTempo.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nDefaultSpeed); + wsprintf(s, "%d", m_sndFile.m_nDefaultSpeed); m_EditSpeed.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nDefaultGlobalVolume / GetGlobalVolumeFactor()); + wsprintf(s, "%d", m_sndFile.m_nDefaultGlobalVolume / GetGlobalVolumeFactor()); m_EditGlobalVol.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nRestartPos); + wsprintf(s, "%d", m_sndFile.m_nRestartPos); m_EditRestartPos.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nVSTiVolume); + wsprintf(s, "%d", m_sndFile.m_nVSTiVolume); m_EditVSTiVol.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nSamplePreAmp); + wsprintf(s, "%d", m_sndFile.m_nSamplePreAmp); m_EditSamplePA.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nRestartPos); + wsprintf(s, "%d", m_sndFile.m_nRestartPos); m_EditRestartPos.SetWindowText(s); } - m_SliderGlobalVol.SetPos(MAX_SLIDER_GLOBAL_VOL-m_pSndFile->m_nDefaultGlobalVolume); - m_SliderVSTiVol.SetPos(MAX_SLIDER_VSTI_VOL-m_pSndFile->m_nVSTiVolume); - m_SliderSamplePreAmp.SetPos(MAX_SLIDER_SAMPLE_VOL-m_pSndFile->m_nSamplePreAmp); - m_SliderTempo.SetPos(m_pSndFile->GetModSpecifications().tempoMax - m_pSndFile->m_nDefaultTempo); + m_SliderGlobalVol.SetPos(MAX_SLIDER_GLOBAL_VOL-m_sndFile.m_nDefaultGlobalVolume); + m_SliderVSTiVol.SetPos(MAX_SLIDER_VSTI_VOL-m_sndFile.m_nVSTiVolume); + m_SliderSamplePreAmp.SetPos(MAX_SLIDER_SAMPLE_VOL-m_sndFile.m_nSamplePreAmp); + m_SliderTempo.SetPos(m_sndFile.GetModSpecifications().tempoMax - m_sndFile.m_nDefaultTempo); } if (dwHint & HINT_MODTYPE) { - CModSpecifications specs = m_pSndFile->GetModSpecifications(); + CModSpecifications specs = m_sndFile.GetModSpecifications(); m_SpinTempo.SetRange(specs.tempoMin, specs.tempoMax); m_SliderTempo.SetRange(0, specs.tempoMax - specs.tempoMin); - const BOOL bIsNotMOD = (m_pSndFile->GetType() != MOD_TYPE_MOD); - const BOOL bIsNotMOD_S3M = ((bIsNotMOD) && (m_pSndFile->GetType() != MOD_TYPE_S3M)); - const BOOL bIsNotMOD_XM = ((bIsNotMOD) && (m_pSndFile->GetType() != MOD_TYPE_XM)); + const BOOL bIsNotMOD = (m_sndFile.GetType() != MOD_TYPE_MOD); + const BOOL bIsNotMOD_S3M = ((bIsNotMOD) && (m_sndFile.GetType() != MOD_TYPE_S3M)); + const BOOL bIsNotMOD_XM = ((bIsNotMOD) && (m_sndFile.GetType() != MOD_TYPE_XM)); m_EditTempo.EnableWindow(bIsNotMOD); m_SpinTempo.EnableWindow(bIsNotMOD); m_SliderTempo.EnableWindow(bIsNotMOD); @@ -223,7 +220,7 @@ m_SliderVSTiVol.EnableWindow(bIsNotMOD_S3M); m_EditVSTiVol.EnableWindow(bIsNotMOD_S3M); m_SpinVSTiVol.EnableWindow(bIsNotMOD_S3M); - m_EditRestartPos.EnableWindow((specs.hasRestartPos || m_pSndFile->m_nRestartPos != 0)); + m_EditRestartPos.EnableWindow((specs.hasRestartPos || m_sndFile.m_nRestartPos != 0)); m_SpinRestartPos.EnableWindow(m_EditRestartPos.IsWindowEnabled()); //Note: Sample volume slider is not disabled for MOD @@ -231,19 +228,19 @@ // MOD Type LPCSTR pszModType = "MOD (ProTracker)"; - switch(m_pSndFile->GetType()) + switch(m_sndFile.GetType()) { case MOD_TYPE_S3M: pszModType = "S3M (ScreamTracker)"; break; case MOD_TYPE_XM: pszModType = "XM (FastTracker 2)"; break; // -> CODE#0023 // -> DESC="IT project files (.itp)" // case MOD_TYPE_IT: pszModType = "IT (Impulse Tracker)"; break; - case MOD_TYPE_IT: pszModType = m_pSndFile->m_SongFlags[SONG_ITPROJECT] ? "ITP (IT Project)" : "IT (Impulse Tracker)"; break; + case MOD_TYPE_IT: pszModType = m_sndFile.m_SongFlags[SONG_ITPROJECT] ? "ITP (IT Project)" : "IT (Impulse Tracker)"; break; case MOD_TYPE_MPT: pszModType = "MPTM (OpenMPT)"; break; // -! NEW_FEATURE#0023 } - wsprintf(s, "%s, %d channel%s", pszModType, m_pSndFile->GetNumChannels(), (m_pSndFile->GetNumChannels() != 1) ? "s" : ""); + wsprintf(s, "%s, %d channel%s", pszModType, m_sndFile.GetNumChannels(), (m_sndFile.GetNumChannels() != 1) ? "s" : ""); m_EditModType.SetWindowText(s); } CheckDlgButton(IDC_CHECK_LOOPSONG, (TrackerSettings::Instance().gbLoopSong) ? TRUE : FALSE); @@ -260,7 +257,7 @@ { CDialog::OnVScroll(code, pos, pscroll); - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if (m_bInitialized) { CSliderCtrl* pSlider = (CSliderCtrl*) pscroll; @@ -269,49 +266,49 @@ int min, max; m_SpinTempo.GetRange(min, max); const UINT tempo = max - m_SliderTempo.GetPos(); - if ((tempo >= m_pSndFile->GetModSpecifications().tempoMin) && (tempo <= m_pSndFile->GetModSpecifications().tempoMax) && (tempo != m_pSndFile->m_nDefaultTempo)) + if ((tempo >= m_sndFile.GetModSpecifications().tempoMin) && (tempo <= m_sndFile.GetModSpecifications().tempoMax) && (tempo != m_sndFile.m_nDefaultTempo)) { - m_pSndFile->m_nDefaultTempo = tempo; - m_pSndFile->m_nMusicTempo = tempo; - m_pModDoc->SetModified(); + m_sndFile.m_nDefaultTempo = tempo; + m_sndFile.m_nMusicTempo = tempo; + m_modDoc.SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } else if (pSlider==&m_SliderGlobalVol) { const UINT gv = MAX_SLIDER_GLOBAL_VOL - m_SliderGlobalVol.GetPos(); - if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_pSndFile->m_nDefaultGlobalVolume)) + if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_sndFile.m_nDefaultGlobalVolume)) { - m_pSndFile->m_nGlobalVolume = gv; - m_pSndFile->m_nDefaultGlobalVolume = gv; - m_pModDoc->SetModified(); + m_sndFile.m_nGlobalVolume = gv; + m_sndFile.m_nDefaultGlobalVolume = gv; + m_modDoc.SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } else if (pSlider==&m_SliderSamplePreAmp) { const UINT spa = MAX_SLIDER_SAMPLE_VOL - m_SliderSamplePreAmp.GetPos(); - if ((spa >= 0) && (spa <= MAX_SLIDER_SAMPLE_VOL) && (spa != m_pSndFile->m_nSamplePreAmp)) + if ((spa >= 0) && (spa <= MAX_SLIDER_SAMPLE_VOL) && (spa != m_sndFile.m_nSamplePreAmp)) { - m_pSndFile->m_nSamplePreAmp = spa; - if(m_pSndFile->GetType() != MOD_TYPE_MOD) - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nSamplePreAmp = spa; + if(m_sndFile.GetType() != MOD_TYPE_MOD) + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } else if (pSlider==&m_SliderVSTiVol) { const UINT vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); - if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_pSndFile->m_nVSTiVolume)) + if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_sndFile.m_nVSTiVolume)) { - m_pSndFile->m_nVSTiVolume = vv; - m_pSndFile->RecalculateGainForAllPlugs(); - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nVSTiVolume = vv; + m_sndFile.RecalculateGainForAllPlugs(); + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } @@ -323,15 +320,15 @@ void CCtrlGeneral::OnTitleChanged() //--------------------------------- { - if ((!m_pSndFile) || (!m_EditTitle.m_hWnd) || (!m_EditTitle.GetModify())) return; + if (!m_EditTitle.m_hWnd || !m_EditTitle.GetModify()) return; CString title; m_EditTitle.GetWindowText(title); - if(m_pSndFile->SetTitle(title, title.GetLength()) && m_pModDoc) + if(m_sndFile.SetTitle(title, title.GetLength())) { m_EditTitle.SetModify(FALSE); - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } @@ -340,21 +337,21 @@ //--------------------------------- { CHAR s[16]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if (m_bInitialized) { m_EditTempo.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = atoi(s); - n = CLAMP(n, m_pSndFile->GetModSpecifications().tempoMin, m_pSndFile->GetModSpecifications().tempoMax); - if (n != m_pSndFile->m_nDefaultTempo) + n = CLAMP(n, m_sndFile.GetModSpecifications().tempoMin, m_sndFile.GetModSpecifications().tempoMax); + if (n != m_sndFile.m_nDefaultTempo) { m_bEditsLocked=true; m_EditTempo.SetModify(FALSE); - m_pSndFile->m_nDefaultTempo = n; - m_pSndFile->m_nMusicTempo = n; - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nDefaultTempo = n; + m_sndFile.m_nMusicTempo = n; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); m_bEditsLocked=false; } @@ -367,21 +364,21 @@ //--------------------------------- { CHAR s[16]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if(m_bInitialized) { m_EditSpeed.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = atoi(s); - n = CLAMP(n, m_pSndFile->GetModSpecifications().speedMin, m_pSndFile->GetModSpecifications().speedMax); - if (n != m_pSndFile->m_nDefaultSpeed) + n = CLAMP(n, m_sndFile.GetModSpecifications().speedMin, m_sndFile.GetModSpecifications().speedMax); + if (n != m_sndFile.m_nDefaultSpeed) { m_bEditsLocked=true; m_EditSpeed.SetModify(FALSE); - m_pSndFile->m_nDefaultSpeed = n; - m_pSndFile->m_nMusicSpeed = n; - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nDefaultSpeed = n; + m_sndFile.m_nMusicSpeed = n; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); m_bEditsLocked=false; } } @@ -393,20 +390,20 @@ //----------------------------------- { CHAR s[16]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if (m_bInitialized) { m_EditVSTiVol.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = ConvertStrTo<UINT>(s); Limit(n, 0u, 2000u); - if (n != m_pSndFile->m_nVSTiVolume) + if (n != m_sndFile.m_nVSTiVolume) { m_bEditsLocked=true; - m_pSndFile->m_nVSTiVolume = n; - m_pSndFile->RecalculateGainForAllPlugs(); - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nVSTiVolume = n; + m_sndFile.RecalculateGainForAllPlugs(); + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); m_bEditsLocked=false; } @@ -418,19 +415,19 @@ //------------------------------------ { CHAR s[16]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if(m_bInitialized) { m_EditSamplePA.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = ConvertStrTo<UINT>(s); Limit(n, 0u, 2000u); - if (n != m_pSndFile->m_nSamplePreAmp) + if (n != m_sndFile.m_nSamplePreAmp) { m_bEditsLocked=true; - m_pSndFile->m_nSamplePreAmp = n; - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nSamplePreAmp = n; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); m_bEditsLocked=false; } @@ -442,21 +439,21 @@ //------------------------------------- { CHAR s[16]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if(m_bInitialized) { m_EditGlobalVol.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = atoi(s) * GetGlobalVolumeFactor(); Limit(n, 0u, 256u); - if (n != m_pSndFile->m_nDefaultGlobalVolume) + if (n != m_sndFile.m_nDefaultGlobalVolume) { m_bEditsLocked = true; m_EditGlobalVol.SetModify(FALSE); - m_pSndFile->m_nDefaultGlobalVolume = n; - m_pSndFile->m_nGlobalVolume = n; - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nDefaultGlobalVolume = n; + m_sndFile.m_nGlobalVolume = n; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); m_bEditsLocked = false; } @@ -469,22 +466,22 @@ //-------------------------------------- { CHAR s[32]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + if(m_bInitialized) { m_EditRestartPos.GetWindowText(s, sizeof(s)); if (s[0]) { ORDERINDEX n = (ORDERINDEX)atoi(s); - Limit(n, (ORDERINDEX)0, m_pSndFile->Order.size()); + Limit(n, (ORDERINDEX)0, m_sndFile.Order.size()); for (ORDERINDEX i = 0; i <= n; i++) - if (m_pSndFile->Order[i] == m_pSndFile->Order.GetInvalidPatIndex()) return; + if (m_sndFile.Order[i] == m_sndFile.Order.GetInvalidPatIndex()) return; - if (n != m_pSndFile->m_nRestartPos) + if (n != m_sndFile.m_nRestartPos) { m_EditRestartPos.SetModify(FALSE); - m_pSndFile->m_nRestartPos = n; - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); + m_sndFile.m_nRestartPos = n; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, HINT_MODGENERAL, this); } } } @@ -500,7 +497,7 @@ void CCtrlGeneral::OnSongProperties() //---------------------------------- { - m_pModDoc->SongProperties(); + m_modDoc.SongProperties(); } @@ -508,12 +505,7 @@ //------------------------------------ { TrackerSettings::Instance().gbLoopSong = IsDlgButtonChecked(IDC_CHECK_LOOPSONG); - CModDoc *pModDoc = GetDocument(); - if (pModDoc) - { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if (pSndFile) pSndFile->SetRepeatCount((TrackerSettings::Instance().gbLoopSong) ? -1 : 0); - } + m_sndFile.SetRepeatCount((TrackerSettings::Instance().gbLoopSong) ? -1 : 0); } @@ -536,20 +528,20 @@ const char moreRecentMixModeNote[] = "Use a more recent mixmode to see dB offsets."; if ((pszText) && (uId)) { - const bool displayDBValues = m_pSndFile->m_PlayConfig.getDisplayDBValues(); + const bool displayDBValues = m_sndFile.m_PlayConfig.getDisplayDBValues(); switch(uId) { case IDC_SLIDER_SAMPLEPREAMP: - (displayDBValues) ? setAsDecibels(pszText, m_pSndFile->m_nSamplePreAmp, m_pSndFile->m_PlayConfig.getNormalSamplePreAmp()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nSamplePreAmp, m_sndFile.m_PlayConfig.getNormalSamplePreAmp()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; case IDC_SLIDER_VSTIVOL: - (displayDBValues) ? setAsDecibels(pszText, m_pSndFile->m_nVSTiVolume, m_pSndFile->m_PlayConfig.getNormalVSTiVol()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nVSTiVolume, m_sndFile.m_PlayConfig.getNormalVSTiVol()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; case IDC_SLIDER_GLOBALVOL: - (displayDBValues) ? setAsDecibels(pszText, m_pSndFile->m_nGlobalVolume, m_pSndFile->m_PlayConfig.getNormalGlobalVol()) : wsprintf(pszText, moreRecentMixModeNote); + (displayDBValues) ? setAsDecibels(pszText, m_sndFile.m_nGlobalVolume, m_sndFile.m_PlayConfig.getNormalGlobalVol()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; break; } @@ -580,10 +572,7 @@ void CCtrlGeneral::OnEnSetfocusEditSongtitle() //-------------------------------------------- { - if(m_pSndFile) - { - m_EditTitle.SetLimitText(m_pSndFile->GetModSpecifications().modNameLengthMax); - } + m_EditTitle.SetLimitText(m_sndFile.GetModSpecifications().modNameLengthMax); } Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-14 15:27:39 UTC (rev 1877) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2013-04-14 17:30:46 UTC (rev 1878) @@ -31,7 +31,8 @@ DECLARE_MESSAGE_MAP(); }; -enum { +enum +{ MAX_SLIDER_GLOBAL_VOL=256, MAX_SLIDER_VSTI_VOL=255, MAX_SLIDER_SAMPLE_VOL=255 @@ -43,7 +44,7 @@ //======================================= { public: - CCtrlGeneral(); + CCtrlGeneral(CModControlView &parent, CModDoc &document); LONG* GetSplitPosRef() {return &TrackerSettings::Instance().glGeneralWindowHeight;} //rewbs.varWindowSize private: @@ -53,7 +54,7 @@ // Display range for XM / S3M should be 0...64, for other formats it's 0...256. UINT GetGlobalVolumeFactor() { - return (m_pSndFile->GetType() & (MOD_TYPE_XM | MOD_TYPE_S3M)) ? UINT(MAX_SLIDER_GLOBAL_VOL / 64) : UINT(MAX_SLIDER_GLOBAL_VOL / 128); + return (m_sndFile.GetType() & (MOD_TYPE_XM | MOD_TYPE_S3M)) ? UINT(MAX_SLIDER_GLOBAL_VOL / 64) : UINT(MAX_SLIDER_GLOBAL_VOL / 128); } public: Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-04-14 15:27:39 UTC (rev 1877) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-04-14 17:30:46 UTC (rev 1878) @@ -84,7 +84,7 @@ } //The key was not handled by a command, but it might still be useful - if ((pMsg->message == WM_CHAR) && (m_pModDoc)) //key is a character + if (pMsg->message == WM_CHAR) //key is a character { UINT nFlags = HIWORD(pMsg->lParam); KeyEventType kT = (CMainFrame::GetMainFrame())->GetInputHandler()->GetKeyEventType(nFlags); @@ -112,24 +112,23 @@ } -BOOL CNoteMapWnd::SetCurrentInstrument(CModDoc *pModDoc, UINT nIns) -//----------------------------------------------------------------- +BOOL CNoteMapWnd::SetCurrentInstrument(INSTRUMENTINDEX nIns) +//---------------------------------------------------------- { - if ((pModDoc != m_pModDoc) || (nIns != m_nInstrument)) + if (nIns != m_nInstrument) { - m_pModDoc = pModDoc; if (nIns < MAX_INSTRUMENTS) m_nInstrument = nIns; // create missing instrument if needed - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if(m_nInstrument > 0 && pSndFile && m_nInstrument <= pSndFile->GetNumInstruments() && pSndFile->Instruments[m_nInstrument] == nullptr) + CSoundFile &sndFile = m_modDoc.GetrSoundFile(); + if(m_nInstrument > 0 && m_nInstrument <= sndFile.GetNumInstruments() && sndFile.Instruments[m_nInstrument] == nullptr) { - ModInstrument *instrument = pSndFile->AllocateInstrument(m_nInstrument); + ModInstrument *instrument = sndFile.AllocateInstrument(m_nInstrument); if(instrument == nullptr) { return FALSE; } - m_pModDoc->InitializeInstrument(instrument); + m_modDoc.InitializeInstrument(instrument); } InvalidateRect(NULL, FALSE); @@ -156,6 +155,7 @@ CRect rcClient; CPaintDC dc(this); HDC hdc; + CSoundFile &sndFile = m_modDoc.GetrSoundFile(); GetClientRect(&rcClient); if (!m_hFont) @@ -175,11 +175,10 @@ m_cxFont = rcClient.right / 3; } dc.IntersectClipRect(&rcClient); - if ((m_pModDoc) && (m_cxFont > 0) && (m_cyFont > 0)) + if (m_cxFont > 0 && m_cyFont > 0) { bool bFocus = (::GetFocus() == m_hWnd); - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - ModInstrument *pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = sndFile.Instruments[m_nInstrument]; CHAR s[64]; CRect rect; @@ -193,7 +192,7 @@ // Note s[0] = 0; - string temp = pSndFile->GetNoteName(nPos+1, m_nInstrument); + string temp = sndFile.GetNoteName(nPos+1, m_nInstrument); temp.resize(4); if ((nPos >= 0) && (nPos < NOTE_MAX)) wsprintf(s, "%s", temp.c_str()); rect.SetRect(0, ypaint, m_cxFont, ypaint+m_cyFont); @@ -208,7 +207,7 @@ UINT n = pIns->NoteMap[nPos]; if(ModCommand::IsNote(n)) { - string temp = pSndFile->GetNoteName(n, m_nInstrument); + string temp = sndFile.GetNoteName(n, m_nInstrument); temp.resize(4); wsprintf(s, "%s", temp.c_str()); } else @@ -313,65 +312,59 @@ void CNoteMapWnd::OnRButtonDown(UINT, CPoint pt) //---------------------------------------------- { - if (m_pModDoc) + CHAR s[64]; + CInputHandler* ih = CMainFrame::GetInputHandler(); + + CSoundFile &sndFile = m_modDoc.GetrSoundFile(); + ModInstrument *pIns = sndFile.Instruments[m_nInstrument]; + if (pIns) { - CHAR s[64]; - CSoundFile *pSndFile; - ModInstrument *pIns; - CInputHandler* ih = CMainFrame::GetInputHandler(); - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; + HMENU hMenu = ::CreatePopupMenu(); + HMENU hSubMenu = ::CreatePopupMenu(); - if (pIns) + if (hMenu) { - HMENU hMenu = ::CreatePopupMenu(); - HMENU hSubMenu = ::CreatePopupMenu(); + AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample &Map\t" + ih->GetKeyTextFromCommand(kcInsNoteMapEditSampleMap)); + if (hSubMenu) + { + // Create sub menu with a list of all samples that are referenced by this instrument. + const std::set<SAMPLEINDEX> referencedSamples = pIns->GetSamples(); - if (hMenu) - { - AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_SAMPLEMAP, "Edit Sample &Map\t" + ih->GetKeyTextFromCommand(kcInsNoteMapEditSampleMap)); - if (hSubMenu) + for(std::set<SAMPLEINDEX>::const_iterator sample = referencedSamples.begin(); sample != referencedSamples.end(); sample++) { - // Create sub menu with a list of all samples that are referenced by this instrument. - const std::set<SAMPLEINDEX> referencedSamples = pIns->GetSamples(); - - for(std::set<SAMPLEINDEX>::const_iterator sample = referencedSamples.begin(); sample != referencedSamples.end(); sample++) + if(*sample <= sndFile.GetNumSamples()) { - if(*sample <= pSndFile->GetNumSamples()) - { - wsprintf(s, "%d: ", *sample); - size_t l = strlen(s); - memcpy(s + l, pSndFile->m_szNames[*sample], MAX_SAMPLENAME); - s[l + MAX_SAMPLENAME] = '\0'; - AppendMenu(hSubMenu, MF_STRING, ID_NOTEMAP_EDITSAMPLE + *sample, s); - } + wsprintf(s, "%d: ", *sample); + size_t l = strlen(s); + memcpy(s + l, sndFile.m_szNames[*sample], MAX_SAMPLENAME); + s[l + MAX_SAMPLENAME] = '\0'; + AppendMenu(hSubMenu, MF_STRING, ID_NOTEMAP_EDITSAMPLE + *sample, s); } - - AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "&Edit Sample\t" + ih->GetKeyTextFromCommand(kcInsNoteMapEditSample)); - AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); } - wsprintf(s, "Map all notes to &sample %d\t" + ih->GetKeyTextFromCommand(kcInsNoteMapCopyCurrentSample), pIns->Keyboard[m_nNote]); - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_SMP, s); - if(pSndFile->GetType() != MOD_TYPE_XM) + AppendMenu(hMenu, MF_POPUP, (UINT)hSubMenu, "&Edit Sample\t" + ih->GetKeyTextFromCommand(kcInsNoteMapEditSample)); + AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); + } + wsprintf(s, "Map all notes to &sample %d\t" + ih->GetKeyTextFromCommand(kcInsNoteMapCopyCurrentSample), pIns->Keyboard[m_nNote]); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_SMP, s); + + if(sndFile.GetType() != MOD_TYPE_XM) + { + if(ModCommand::IsNote(pIns->NoteMap[m_nNote])) { - if(ModCommand::IsNote(pIns->NoteMap[m_nNote])) - { - wsprintf(s, "Map all ¬es to %s\t" + ih->GetKeyTextFromCommand(kcInsNoteMapCopyCurrentNote), pSndFile->GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str()); - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s); - } - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_UP, "Transpose map &up\t" + ih->GetKeyTextFromCommand(kcInsNoteMapTransposeUp)); - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_DOWN, "Transpose map &down\t" + ih->GetKeyTextFromCommand(kcInsNoteMapTransposeDown)); + wsprintf(s, "Map all ¬es to %s\t" + ih->GetKeyTextFromCommand(kcInsNoteMapCopyCurrentNote), sndFile.GetNoteName(pIns->NoteMap[m_nNote], m_nInstrument).c_str()); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_COPY_NOTE, s); } - AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "&Reset note mapping\t" + ih->GetKeyTextFromCommand(kcInsNoteMapReset)); - AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate &Instrument\t" + ih->GetKeyTextFromCommand(kcInstrumentCtrlDuplicate)); - SetMenuDefaultItem(hMenu, ID_INSTRUMENT_SAMPLEMAP, FALSE); - ClientToScreen(&pt); - ::TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); - ::DestroyMenu(hMenu); - if (hSubMenu) ::DestroyMenu(hSubMenu); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_UP, "Transpose map &up\t" + ih->GetKeyTextFromCommand(kcInsNoteMapTransposeUp)); + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_TRANS_DOWN, "Transpose map &down\t" + ih->GetKeyTextFromCommand(kcInsNoteMapTransposeDown)); } + AppendMenu(hMenu, MF_STRING, ID_NOTEMAP_RESET, "&Reset note mapping\t" + ih->GetKeyTextFromCommand(kcInsNoteMapReset)); + AppendMenu(hMenu, MF_STRING, ID_INSTRUMENT_DUPLICATE, "Duplicate &Instrument\t" + ih->GetKeyTextFromCommand(kcInstrumentCtrlDuplicate)); + SetMenuDefaultItem(hMenu, ID_INSTRUMENT_SAMPLEMAP, FALSE); + ClientToScreen(&pt); + ::TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); + ::DestroyMenu(hMenu); + if (hSubMenu) ::DestroyMenu(hSubMenu); } } } @@ -388,12 +381,7 @@ void CNoteMapWnd::OnMapCopyNote() //------------------------------- { - if(m_pModDoc == nullptr) return; - CSoundFile *pSndFile; - ModInstrument *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; if (pIns) { bool bModified = false; @@ -405,7 +393,7 @@ } if (bModified) { - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } } @@ -414,12 +402,7 @@ void CNoteMapWnd::OnMapCopySample() //--------------------------------- { - if(m_pModDoc == nullptr) return; - CSoundFile *pSndFile; - ModInstrument *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; if (pIns) { bool bModified = false; @@ -431,7 +414,7 @@ } if (bModified) { - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } } @@ -441,13 +424,7 @@ void CNoteMapWnd::OnMapReset() //---------------------------- { - if(m_pModDoc == nullptr) return; - CSoundFile *pSndFile; - ModInstrument *pIns; - - pSndFile = m_pModDoc->GetSoundFile(); - if(pSndFile == nullptr) return; - pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; if (pIns) { bool bModified = false; @@ -458,7 +435,7 @@ } if (bModified) { - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } } @@ -482,12 +459,9 @@ void CNoteMapWnd::MapTranspose(int nAmount) //----------------------------------------- { - if(m_pModDoc == nullptr || nAmount == 0) return; - CSoundFile *pSndFile; - ModInstrument *pIns; + if(nAmount == 0) return; - pSndFile = m_pModDoc->GetSoundFile(); - pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; if (pIns) { bool bModified = false; @@ -503,7 +477,7 @@ } if (bModified) { - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } } @@ -514,21 +488,21 @@ //-------------------------------------- { UINT nSample = nID - ID_NOTEMAP_EDITSAMPLE; - if (m_pParent) m_pParent->EditSample(nSample); + m_pParent.EditSample(nSample); } void CNoteMapWnd::OnEditSampleMap() //--------------------------------- { - if (m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_INSTRUMENT_SAMPLEMAP); + m_pParent.PostMessage(WM_COMMAND, ID_INSTRUMENT_SAMPLEMAP); } void CNoteMapWnd::OnInstrumentDuplicate() //--------------------------------------- { - if (m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_INSTRUMENT_DUPLICATE); + m_pParent.PostMessage(WM_COMMAND, ID_INSTRUMENT_DUPLICATE); } @@ -539,12 +513,7 @@ return NULL; CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - ModInstrument *pIns = nullptr; - if(pSndFile) - { - pIns = pSndFile->Instruments[m_nInstrument]; - } + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; // Handle notes @@ -583,8 +552,8 @@ // Parent shortcuts (also displayed in context menu of this control) case kcInstrumentCtrlDuplicate: OnInstrumentDuplicate(); return wParam; - case kcNextInstrument: if(m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_NEXTINSTRUMENT); return wParam; - case kcPrevInstrument: if(m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_PREVINSTRUMENT); return wParam; + case kcNextInstrument: m_pParent.PostMessage(WM_COMMAND, ID_NEXTINSTRUMENT); return wParam; + case kcPrevInstrument: m_pParent.PostMessage(WM_COMMAND, ID_PREVINSTRUMENT); return wParam; } return NULL; @@ -593,15 +562,15 @@ void CNoteMapWnd::EnterNote(UINT note) //------------------------------------ { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - ModInstrument *pIns = pSndFile->Instruments[m_nInstrument]; + CSoundFile &sndFile = m_modDoc.GetrSoundFile(); + ModInstrument *pIns = sndFile.Instruments[m_nInstrument]; if ((pIns) && (m_nNote < NOTE_MAX)) { - if (!m_bIns && (pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) + if (!m_bIns && (sndFile.GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) { UINT n = pIns->NoteMap[m_nNote]; bool bOk = false; - if ((note >= pSndFile->GetModSpecifications().noteMin) && (note <= pSndFile->GetModSpecifications().noteMax)) + if ((note >= sndFile.GetModSpecifications().noteMin) && (note <= sndFile.GetModSpecifications().noteMax)) { n = note; bOk = true; @@ -609,7 +578,7 @@ if (n != pIns->NoteMap[m_nNote]) { pIns->NoteMap[m_nNote] = n; - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } if (bOk) @@ -625,8 +594,8 @@ bool CNoteMapWnd::HandleChar(WPARAM c) //------------------------------------ { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - ModInstrument *pIns = pSndFile->Instruments[m_nInstrument]; + CSoundFile &sndFile = m_modDoc.GetrSoundFile(); + ModInstrument *pIns = sndFile.Instruments[m_nInstrument]; if ((pIns) && (m_nNote < NOTE_MAX)) { @@ -636,15 +605,15 @@ if (c != ' ') { n = (10 * pIns->Keyboard[m_nNote] + (c - '0')) % 10000; - if ((n >= MAX_SAMPLES) || ((pSndFile->m_nSamples < 1000) && (n >= 1000))) n = (n % 1000); - if ((n >= MAX_SAMPLES) || ((pSndFile->m_nSamples < 100) && (n >= 100))) n = (n % 100); else - if ((n > 31) && (pSndFile->m_nSamples < 32) && (n % 10)) n = (n % 10); + if ((n >= MAX_SAMPLES) || ((sndFile.m_nSamples < 1000) && (n >= 1000))) n = (n % 1000); + if ((n >= MAX_SAMPLES) || ((sndFile.m_nSamples < 100) && (n >= 100))) n = (n % 100); else + if ((n > 31) && (sndFile.m_nSamples < 32) && (n % 10)) n = (n % 10); } if (n != pIns->Keyboard[m_nNote]) { pIns->Keyboard[m_nNote] = n; - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); PlayNote(m_nNote+1); } @@ -658,7 +627,7 @@ return true; } - else if ((!m_bIns) && (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) //in note column + else if ((!m_bIns) && (sndFile.m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) //in note column { UINT n = pIns->NoteMap[m_nNote]; @@ -676,7 +645,7 @@ if (n != pIns->NoteMap[m_nNote]) { pIns->NoteMap[m_nNote] = n; - m_pParent->SetInstrumentModified(); + m_pParent.SetInstrumentModified(); InvalidateRect(NULL, FALSE); } @@ -728,9 +697,8 @@ // case VK_TAB: // return true; case VK_RETURN: - if (m_pModDoc && m_pModDoc->GetSoundFile()) { - ModInstrument *pIns = m_pModDoc->GetSoundFile()->Instruments[m_nInstrument]; + ModInstrument *pIns = m_modDoc.GetrSoundFile().Instruments[m_nInstrument]; if(pIns) { if (m_bIns) @@ -739,6 +707,7 @@ m_nOldNote = pIns->NoteMap[m_nNote]; } } + return true; default: return false; @@ -756,7 +725,7 @@ //---------------------------------- { if(m_nPlayingNote >= 0) return; //no polyphony in notemap window - m_pModDoc->PlayNote(note, m_nInstrument, 0, false); + m_modDoc.PlayNote(note, m_nInstrument, 0, false); m_nPlayingNote = note; } @@ -767,7 +736,7 @@ if(note < 0) note = m_nPlayingNote; if(note < 0) return; - m_pModDoc->NoteOff(note, true, m_nInstrument); + m_modDoc.NoteOff(note, true, m_nInstrument); m_nPlayingNote = -1; } @@ -884,8 +853,8 @@ } -CCtrlInstruments::CCtrlInstruments() -//---------------------------------- +CCtrlInstruments::CCtrlInstruments(CModControlView &parent, CModDoc &document) : CModControlDlg(parent, document), m_NoteMap(*this, document) +//------------------------------------------------------------------------------------------------------------------------------------------- { m_nInstrument = 1; m_nLockCount = 1; @@ -910,9 +879,7 @@ { CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; - if ((!m_pModDoc) || (!m_pSndFile)) return TRUE; - m_NoteMap.Init(this); m_ToolBar.Init(); m_ToolBar.AddButton(IDC_INSTRUMENT_NEW, TIMAGE_INSTR_NEW); m_ToolBar.AddButton(IDC_INSTRUMENT_OPEN, TIMAGE_OPEN); @@ -940,7 +907,7 @@ // Global Volume m_SpinGlobalVol.SetRange(0, 64); // Panning - m_SpinPanning.SetRange(0, (m_pModDoc->GetModType() & MOD_TYPE_IT) ? 64 : 256); + m_SpinPanning.SetRange(0, (m_modDoc.GetModType() & MOD_TYPE_IT) ? 64 : 256); // Midi Program m_SpinMidiPR.SetRange(0, 128); // rewbs.MidiBank @@ -1006,15 +973,14 @@ void CCtrlInstruments::SetInstrumentModified(const bool modified) //--------------------------------------------------------------- { - if(m_pModDoc == nullptr) return; // -> CODE#0023 // -> DESC="IT project files (.itp)" - m_pModDoc->m_bsInstrumentModified.set(m_nInstrument - 1, modified); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this); + m_modDoc.m_bsInstrumentModified.set(m_nInstrument - 1, modified); + m_modDoc.UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this); // -! NEW_FEATURE#0023 if(modified) { - m_pModDoc->SetModified(); + m_modDoc.SetModified(); } } @@ -1022,25 +988,24 @@ BOOL CCtrlInstruments::SetCurrentInstrument(UINT nIns, BOOL bUpdNum) //------------------------------------------------------------------ { - if ((!m_pModDoc) || (!m_pSndFile)) return FALSE; - if (m_pSndFile->m_nInstruments < 1) return FALSE; - if ((nIns < 1) || (nIns > m_pSndFile->m_nInstruments)) return FALSE; + if (m_sndFile.m_nInstruments < 1) return FALSE; + if ((nIns < 1) || (nIns > m_sndFile.m_nInstruments)) return FALSE; LockControls(); if ((m_nInstrument != nIns) || (!m_bInitialized)) { m_nInstrument = nIns; - m_NoteMap.SetCurrentInstrument(m_pModDoc, m_nInstrument); + m_NoteMap.SetCurrentInstrument(m_nInstrument); UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE, NULL); } else { // Just in case - m_NoteMap.SetCurrentInstrument(m_pModDoc, m_nInstrument); + m_NoteMap.SetCurrentInstrument(m_nInstrument); } if (bUpdNum) { SetDlgItemInt(IDC_EDIT_INSTRUMENT, m_nInstrument); - m_SpinInstrument.SetRange(1, m_pSndFile->GetNumInstruments()); - m_SpinInstrument.EnableWindow((m_pSndFile->GetNumInstruments()) ? TRUE : FALSE); + m_SpinInstrument.SetRange(1, m_sndFile.GetNumInstruments()); + m_SpinInstrument.EnableWindow((m_sndFile.GetNumInstruments()) ? TRUE : FALSE); // Is this a bug ? m_SliderCutOff.InvalidateRect(NULL, FALSE); m_SliderResonance.InvalidateRect(NULL, FALSE); @@ -1060,19 +1025,15 @@ void CCtrlInstruments::OnActivatePage(LPARAM lParam) //-------------------------------------------------- { - CModDoc *pModDoc = GetDocument(); - if ((pModDoc) && (m_pParent)) + if (lParam < 0) { - if (lParam < 0) - { - int nIns = m_pParent->GetInstrumentChange(); - if (nIns > 0) lParam = nIns; - m_pParent->InstrumentChanged(-1); - } else - if (lParam > 0) - { - m_pParent->InstrumentChanged(lParam); - } + int nIns = m_parent.GetInstrumentChange(); + if (nIns > 0) lParam = nIns; + m_parent.InstrumentChanged(-1); + } else + if (lParam > 0) + { + m_parent.InstrumentChanged(lParam); } UpdatePluginList(); @@ -1094,7 +1055,7 @@ void CCtrlInstruments::OnDeactivatePage() //--------------------------------------- { - if (m_pModDoc) m_pModDoc->NoteOff(0, true); + m_modDoc.NoteOff(0, true); CChildFrame *pFrame = (CChildFrame *)GetParentFrame(); if ((pFrame) && (m_hWndView)) SendViewMessage(VIEWMSG_SAVESTATE, (LPARAM)pFrame->GetInstrumentViewState()); } @@ -1161,7 +1122,7 @@ void CCtrlInstruments::UpdateView(DWORD dwHintMask, CObject *pObj) //---------------------------------------------------------------- { - if ((pObj == this) || (!m_pModDoc) || (!m_pSndFile)) return; + if(pObj == this) return; if (dwHintMask & HINT_MPTOPTIONS) { m_ToolBar.UpdateStyle(); @@ -1177,20 +1138,20 @@ LockControls(); if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; - ModInstrument *pIns = m_pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if (dwHintMask & HINT_MODTYPE) { - const CModSpecifications *specs = &m_pSndFile->GetModSpecifications(); + const CModSpecifications *specs = &m_sndFile.GetModSpecifications(); // Limit text fields m_EditName.SetLimitText(specs->instrNameLengthMax); m_EditFileName.SetLimitText(specs->instrFilenameLengthMax); - const BOOL bITandMPT = ((m_pSndFile->GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->GetNumInstruments())) ? TRUE : FALSE; + const BOOL bITandMPT = ((m_sndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_sndFile.GetNumInstruments())) ? TRUE : FALSE; //rewbs.instroVSTi - const BOOL bITandXM = ((m_pSndFile->GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_XM)) && (m_pSndFile->GetNumInstruments())) ? TRUE : FALSE; - const BOOL bMPTOnly = ((m_pSndFile->GetType() == MOD_TYPE_MPT) && (m_pSndFile->GetNumInstruments())) ? TRUE : FALSE; + const BOOL bITandXM = ((m_sndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_XM)) && (m_sndFile.GetNumInstruments())) ? TRUE : FALSE; + const BOOL bMPTOnly = ((m_sndFile.GetType() == MOD_TYPE_MPT) && (m_sndFile.GetNumInstruments())) ? TRUE : FALSE; ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT10), bITandXM); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT11), bITandXM); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT7), bITandXM); @@ -1204,16 +1165,16 @@ m_SpinMidiBK.EnableWindow(bITandXM); //rewbs.MidiBank //end rewbs.instroVSTi - const bool extendedFadeoutRange = (m_pSndFile->GetType() & MOD_TYPE_XM) != 0; + const bool extendedFadeoutRange = (m_sndFile.GetType() & MOD_TYPE_XM) != 0; m_SpinFadeOut.EnableWindow(bITandXM); m_SpinFadeOut.SetRange(0, extendedFadeoutRange ? 32767 : 8192); m_EditFadeOut.SetLimitText(extendedFadeoutRange ? 5 : 4); // Panning ranges (0...64 for IT, 0...256 for MPTM) - m_SpinPanning.SetRange(0, (m_pSndFile->GetType() & MOD_TYPE_IT) ? 64 : 256); + m_SpinPanning.SetRange(0, (m_sndFile.GetType() & MOD_TYPE_IT) ? 64 : 256); // Pitch Wheel Depth - if(m_pSndFile->GetType() == MOD_TYPE_XM) + if(m_sndFile.GetType() == MOD_TYPE_XM) pwdSpin.SetRange(0, 36); else pwdSpin.SetRange(-128, 127); @@ -1240,8 +1201,8 @@ m_CheckResonance.EnableWindow(bITandMPT); m_SliderCutOff.EnableWindow(bITandMPT); m_SliderResonance.EnableWindow(bITandMPT); - m_SpinInstrument.SetRange(1, m_pSndFile->m_nInstruments); - m_SpinInstrument.EnableWindow((m_pSndFile->m_nInstruments) ? TRUE : FALSE); + m_SpinInstrument.SetRange(1, m_sndFile.m_nInstruments); + m_SpinInstrument.EnableWindow((m_sndFile.m_nInstruments) ? TRUE : FALSE); m_ComboTuning.EnableWindow(bMPTOnly); m_EditPitchTempoLock.EnableWindow(bMPTOnly); m_CheckPitchTempoLock.EnableWindow(bMPTOnly); @@ -1265,9 +1226,9 @@ if (dwHintMask & (HINT_INSTRUMENT|HINT_MODTYPE)) { // Backwards compatibility with IT modules that use now deprecated hack features. - m_SliderCutSwing.EnableWindow((pIns != nullptr && (m_pSndFile->GetType() == MOD_TYPE_MPT || pIns->nCutSwing != 0)) ? TRUE : FALSE); - m_SliderResSwing.EnableWindow((pIns != nullptr && (m_pSndFile->GetType() == MOD_TYPE_MPT || pIns->nResSwing != 0)) ? TRUE : FALSE); - m_CbnFilterMode.EnableWindow((pIns != nullptr && (m_pSndFile->GetType() == MOD_TYPE_MPT || pIns->nFilterMode != FLTMODE_UNCHANGED)) ? TRUE : FALSE); + m_SliderCutSwing.EnableWindow((pIns != nullptr && (m_sndFile.GetType() == MOD_TYPE_MPT || pIns->nCutSwing != 0)) ? TRUE : FALSE); + m_SliderResSwing.EnableWindow((pIns != nullptr && (m_sndFile.GetType() == MOD_TYPE_MPT || pIns->nResSwing != 0)) ? TRUE : FALSE); + m_CbnFilterMode.EnableWindow((pIns != nullptr && (m_sndFile.GetType() == MOD_TYPE_MPT || pIns->nFilterMode != FLTMODE_UNCHANGED)) ? TRUE : FALSE); if (pIns) { @@ -1278,7 +1239,7 @@ // Global Volume SetDlgItemInt(IDC_EDIT8, pIns->nGlobalVol); // Panning - SetDlgItemInt(IDC_EDIT9, (m_pModDoc->GetModType() & MOD_TYPE_IT) ? (pIns->nPan / 4) : pIns->nPan); + SetDlgItemInt(IDC_EDIT9, (m_modDoc.GetModType() & MOD_TYPE_IT) ? (pIns->nPan / 4) : pIns->nPan); m_CheckPanning.SetCheck(pIns->dwFlags[INS_SETPANNING] ? TRUE : FALSE); // Midi if (pIns->nMidiProgram>0 && pIns->nMidiProgram<=128) @@ -1333,7 +1294,7 @@ m_ComboPPC.SetCurSel(pIns->nPPC); SetDlgItemInt(IDC_EDIT15, pIns->nPPS); // Filter - if (m_pSndFile->GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) + if (m_sndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) { m_CheckCutOff.SetCheck((pIns->IsCutoffEnabled()) ? TRUE : FALSE); m_CheckResonance.SetCheck((pIns->IsResonanceEnabled()) ? TRUE : FALSE); @@ -1357,7 +1318,7 @@ UpdateTuningComboBox(); // Only enable Pitch/Tempo Lock for MPTM files or legacy files that have this property enabled. - m_EditPitchTempoLock.EnableWindow((m_pSndFile->GetType() == MOD_TYPE_MPT || pIns->wPitchToTempoLock > 0) ? TRUE : FALSE); + m_EditPitchTempoLock.EnableWindow((m_sndFile.GetType() == MOD_TYPE_MPT || pIns->wPitchToTempoLock > 0) ? TRUE : FALSE); m_CheckPitchTempoLock.EnableWindow(m_EditPitchTempoLock.IsWindowEnabled()); CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, (pIns->wPitchToTempoLock > 0 ? MF_CHECKED : MF_UNCHECKED)); @@ -1366,9 +1327,9 @@ OnBnClickedCheckPitchtempolock(); - if(m_pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) + if(m_sndFile.GetType() & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) { - BOOL enableVol = (m_CbnMixPlug.GetCurSel() > 0 && !m_pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION)) ? TRUE : FALSE; + BOOL enableVol = (m_CbnMixPlug.GetCurSel() > 0 && !m_sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION)) ? TRUE : FALSE; velocityStyle.EnableWindow(enableVol); m_CbnPluginVolumeHandling.EnableWindow(enableVol); } @@ -1378,8 +1339,8 @@ m_EditFileName.SetWindowText(""); velocityStyle.EnableWindow(FALSE); m_CbnPluginVolumeHandling.EnableWindow(FALSE); - if(m_nInstrument > m_pSndFile->GetNumInstruments()) - SetCurrentInstrument(m_pSndFile->GetNumInstruments()); + if(m_nInstrument > m_sndFile.GetNumInstruments()) + SetCurrentInstrument(m_sndFile.GetNumInstruments()); } m_NoteMap.InvalidateRect(NULL, FALSE); @@ -1402,20 +1363,19 @@ void CCtrlInstruments::UpdateFilterText() //--------------------------------------- { - if((m_nInstrument) && (m_pModDoc)) + if(m_nInstrument) { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - ModInstrument *pIns = pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if(pIns) { CHAR s[32]; // In IT Compatible mode, it is enough to just have resonance enabled to turn on the filter. - const bool resEnabled = (pIns->IsResonanceEnabled() && pIns->GetResonance() > 0 && pSndFile->IsCompatibleMode(TRK_IMPULSETRACKER)); + const bool resEnabled = (pIns->IsResonanceEnabled() && pIns->GetResonance() > 0 && m_sndFile.IsCompatibleMode(TRK_IMPULSETRACKER)); if((pIns->IsCutoffEnabled() && pIns->GetCutoff() < 0x7F) || resEnabled) { const BYTE cutoff = (resEnabled && !pIns->IsCutoffEnabled()) ? 0x7F : pIns->GetCutoff(); - wsprintf(s, "Z%02X (%d Hz)", cutoff, pSndFile->CutOffToFrequency(cutoff)); + wsprintf(s, "Z%02X (%d Hz)", cutoff, m_sndFile.CutOffToFrequency(cutoff)); } else if(pIns->IsCutoffEnabled()) { strcpy(s, "Z7F (Off)"); @@ -1451,20 +1411,20 @@ bOk = FALSE; if (lpFile) { - if (!m_pSndFile->GetNumInstruments()) + if (!m_sndFile.GetNumInstruments()) { bFirst = TRUE; - m_pSndFile->m_nInstruments = 1; - m_NoteMap.SetCurrentInstrument(m_pModDoc, 1); - m_pModDoc->SetModified(); + m_sndFile.m_nInstruments = 1; + m_NoteMap.SetCurrentInstrument(1); + m_modDoc.SetModified(); } if (!m_nInstrument) m_nInstrument = 1; - if (m_pSndFile->ReadInstrumentFromFile(m_nInstrument, lpFile, len)) + if (m_sndFile.ReadInstrumentFromFile(m_nInstrument, lpFile, len)) { - m_pModDoc->UpdateAllViews(NULL, HINT_SAMPLEINFO | HINT_MODTYPE, NULL); + m_modDoc.UpdateAllViews(NULL, HINT_SAMPLEINFO | HINT_MODTYPE, NULL); // -> CODE#0023 // -> DESC="IT project files (.itp)" - m_pSndFile->m_szInstrumentPath[m_nInstrument - 1] = lpszFileName; + m_sndFile.m_szInstrumentPath[m_nInstrument - 1] = lpszFileName; SetInstrumentModified(false); // -! NEW_FEATURE#0023 bOk = TRUE; @@ -1477,32 +1437,29 @@ EndWaitCursor(); if (bOk) { - ModInstrument *pIns = m_pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if (pIns) { TCHAR szName[_MAX_FNAME], szExt[_MAX_EXT]; _tsplitpath(lpszFileName, nullptr, nullptr, szName, szExt); TrackerSettings::Instance().SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true); - if (!pIns->name[0] && m_pSndFile->GetModSpecifications().instrNameLengthMax > 0) + if (!pIns->name[0] && m_sndFile.GetModSpecifications().instrNameLengthMax > 0) { - StringFixer::CopyN(pIns->name, szName, m_pSndFile->GetModSpecifications().instrNameLengthMax); + StringFixer::CopyN(pIns->name, szName, m_sndFile.GetModSpecifications().instrNameLengthMax); } - if (!pIns->filename[0] && m_pSndFile->GetModSpecifications().instrFilenameLengthMax > 0) + if (!pIns->filename[0] && m_sndFile.GetModSpecifications().instrFilenameLengthMax > 0) { strcat(szName, szExt); - StringFixer::CopyN(pIns->filename, szName, m_pSndFile->GetModSpecifications().instrFilenameLengthMax); + StringFixer::CopyN(pIns->filename, szName, m_sndFile.GetModSpecifications().instrFilenameLengthMax); } SetCurrentInstrument(m_nInstrument); - if (m_pModDoc) - { - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); - } + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); } else bOk = FALSE; } - if (bFirst) m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES); + if (bFirst) m_modDoc.UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES); if (!bOk) ErrorBox(IDS_ERR_FILETYPE, this); return TRUE; } @@ -1517,12 +1474,12 @@ CriticalSection cs; bool bFirst = false; - if (!m_pSndFile->GetNumInstruments()) + if (!m_sndFile.GetNumInstruments()) { bFirst = true; - m_pSndFile->m_nInstruments = 1; - m_NoteMap.SetCurrentInstrument(m_pModDoc, 1); - m_pModDoc->SetModified(); + m_sndFile.m_nInstruments = 1; + m_NoteMap.SetCurrentInstrument(1); + m_modDoc.SetModified(); bFirst = true; } if (!m_nInstrument) @@ -1530,14 +1487,14 @@ m_nInstrument = 1; bFirst = true; } - m_pSndFile->ReadInstrumentFromSong(m_nInstrument, sndFile, nInstr); + m_sndFile.ReadInstrumentFromSong(m_nInstrument, sndFile, nInstr); cs.Leave(); - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); - if (bFirst) m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES); - m_pModDoc->SetModified(); + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); + if (bFirst) m_modDoc.UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES); + m_modDoc.SetModified(); EndWaitCursor(); return TRUE; } @@ -1548,11 +1505,8 @@ { if ((nSample > 0) && (nSample < MAX_SAMPLES)) { - if (m_pParent) - { - m_pParent->PostMessage(WM_MOD_ACTIVATEVIEW, IDD_CONTROL_SAMPLES, nSample); - return TRUE; - } + m_parent.PostMessage(WM_MOD_ACTIVATEVIEW, IDD_CONTROL_SAMPLES, nSample); + return TRUE; } return FALSE; } @@ -1564,10 +1518,9 @@ //Note: pszText seems to point to char array of length 256 (Noverber 2006). //Note2: If there's problems in getting tooltips showing for certain tools, // setting the tab order may have effect. - const bool hasInstrument = (m_pSndFile) && (m_pSndFile->Instruments[m_nInstrument]); - ModInstrument *pIns = m_pSndFile->Instruments[m_nInstrument]; + ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; - if(!hasInstrument) return FALSE; + if(pIns == nullptr) return FALSE; if ((pszText) && (uId)) { switch(uId) @@ -1576,7 +1529,7 @@ case IDC_CHECK_PITCHTEMPOLOCK: // Pitch/Tempo lock { - const CModSpecifications& specs = m_pSndFile->GetModSpecifications(); + const CModSpecifications& specs = m_sndFile.GetModSpecifications(); string str = string("Tempo range: ") + Stringify(specs.tempoMin) + string(" - ") + Stringify(specs.tempoMax); if(str.size() >= 250) str.resize(250); strcpy(pszText, str.c_str()); @@ -1592,7 +1545,7 @@ case IDC_PLUGIN_VOLUMESTYLE: // Plugin volume handling if(pIns->nMixPlug < 1) return FALSE; - if(m_pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION)) + if(m_sndFile.GetModFlag(MSF_MIDICC_BUGEMULATION)) { velocityStyle.EnableWindow(FALSE); m_CbnPluginVolumeHandling.EnableWindow(FALSE); @@ -1653,13 +1606,13 @@ void CCtrlInstruments::OnInstrumentChanged() //------------------------------------------ { - if ((!IsLocked()) && (m_pSndFile)) + if(!IsLocked()) { UINT n = GetDlgItemInt(IDC_EDIT_INSTRUMENT); - if ((n > 0) && (n <= m_pSndFile->m_nInstruments) && (n != m_nInstrument)) + if ((n > 0) && (n <= m_sndFile.GetNumInstruments()) && (n != m_nInstrument)) { SetCurrentInstrument(n, FALSE); - if (m_pParent) m_pParent->InstrumentChanged(n); + m_parent.InstrumentChanged(n); } } } @@ -1668,53 +1621,43 @@ void CCtrlInstruments::OnPrevInstrument() //--------------------------------------- { - if (m_pSndFile) - { - if (m_nInstrument > 1) - SetCurrentInstrument(m_nInstrument-1); - else - SetCurrentInstrument(m_pSndFile->m_nInstruments); - if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); - } + if(m_nInstrument > 1) + SetCurrentInstrument(m_nInstrument - 1); + else + SetCurrentInstrument(m_sndFile.GetNumInstruments()); + m_parent.InstrumentChanged(m_nInstrument); } void CCtrlInstruments::OnNextInstrument() //--------------------------------------- { - if (m_pSndFile) - { - if (m_nInstrument < m_pSndFile->m_nInstruments) - SetCurrentInstrument(m_nInstrument+1); - else - SetCurrentInstrument(1); - if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); - } + if(m_nInstrument < m_sndFile.GetNumInstruments()) + SetCurrentInstrument(m_nInstrument + 1); + else + SetCurrentInstrument(1); + m_parent.InstrumentChanged(m_nInstrument); } void CCtrlInstruments::OnInstrumentNew() //-------------------------------------- { - if (m_pModDoc) + if(m_sndFile.GetNumInstruments() > 0 + && CMainFrame::GetInputHandler()->ShiftPressed()) //rewbs.customKeys { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if (pSndFile->m_nInstruments > 0 - && CMainFrame::GetInputHandler()->ShiftPressed()) //rewbs.customKeys - { - OnInstrumentDuplicate(); - return; - } - bool bFirst = (pSndFile->GetNumInstruments() == 0); - INSTRUMENTINDEX ins = m_pModDoc->InsertInstrument(); - if (ins != INSTRUMENTINDEX_INVALID) - { - SetCurrentInstrument(ins); - m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); - } - if (bFirst) m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); - if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); + OnInstrumentDuplicate(); + return; } + bool bFirst = (m_sndFile.GetNumInstruments() == 0); + INSTRUMENTINDEX ins = m_modDoc.InsertInstrument(); + if (ins != INSTRUMENTINDEX_INVALID) + { + SetCurrentInstrument(ins); + m_modDoc.UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); + } + if (bFirst) m_modDoc.UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); + m_parent.InstrumentChanged(m_nInstrument); SwitchToView(); } @@ -1722,22 +1665,15 @@ void CCtrlInstruments::OnInstrumentDuplicate() //-------------------------------------------- { - if(m_pModDoc) + if(m_sndFile.GetNumInstruments() > 0) { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if(pSndFile->GetNumInstruments() > 0) + INSTRUMENTINDEX ins = m_modDoc.Insert... [truncated message content] |
From: <man...@us...> - 2013-04-17 21:04:01
|
Revision: 1900 http://sourceforge.net/p/modplug/code/1900 Author: manxorist Date: 2013-04-17 21:03:51 +0000 (Wed, 17 Apr 2013) Log Message: ----------- [Ref] Remove mix graph files which were unused since a long time. Removed Paths: ------------- trunk/OpenMPT/mptrack/ChannelNode.cpp trunk/OpenMPT/mptrack/ChannelNode.h trunk/OpenMPT/mptrack/EffectNode.cpp trunk/OpenMPT/mptrack/EffectNode.h trunk/OpenMPT/mptrack/FinalNode.cpp trunk/OpenMPT/mptrack/FinalNode.h trunk/OpenMPT/mptrack/Graph.cpp trunk/OpenMPT/mptrack/Graph.h trunk/OpenMPT/mptrack/InstrumentNode.cpp trunk/OpenMPT/mptrack/InstrumentNode.h trunk/OpenMPT/mptrack/Node.cpp trunk/OpenMPT/mptrack/Node.h trunk/OpenMPT/mptrack/Vertex.cpp trunk/OpenMPT/mptrack/Vertex.h trunk/OpenMPT/mptrack/ctrl_graph.cpp trunk/OpenMPT/mptrack/ctrl_graph.h trunk/OpenMPT/mptrack/view_graph.cpp trunk/OpenMPT/mptrack/view_graph.h Deleted: trunk/OpenMPT/mptrack/ChannelNode.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelNode.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/ChannelNode.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,21 +0,0 @@ -#include "stdafx.h" -#include ".\channelnode.h" - -CChannelNode::CChannelNode(void) -{ - m_hBorderPen = ::CreatePen(PS_SOLID,0, RGB(0xFF, 0x00, 0x00)); -} - -CChannelNode::~CChannelNode(void) -{ -} - -HPEN CChannelNode::GetBorderPen() -{ - return m_hBorderPen; -} - -CString CChannelNode::GetLabel() -{ - return ""; -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/ChannelNode.h =================================================================== --- trunk/OpenMPT/mptrack/ChannelNode.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/ChannelNode.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,16 +0,0 @@ -#pragma once -#include "node.h" - -class CChannelNode : - public CNode -{ -public: - CChannelNode(void); - ~CChannelNode(void); - - virtual CString GetLabel(); - virtual HPEN GetBorderPen(); - -private: - HPEN m_hBorderPen; -}; Deleted: trunk/OpenMPT/mptrack/EffectNode.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectNode.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/EffectNode.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,21 +0,0 @@ -#include "stdafx.h" -#include ".\effectnode.h" - -CPluginNode::CPluginNode(void) -{ - m_hBorderPen = ::CreatePen(PS_SOLID,0, RGB(0x00, 0xFF, 0x00)); -} - -CPluginNode::~CPluginNode(void) -{ -} - -HPEN CPluginNode::GetBorderPen() -{ - return m_hBorderPen; -} - -CString CPluginNode::GetLabel() -{ - return ""; -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/EffectNode.h =================================================================== --- trunk/OpenMPT/mptrack/EffectNode.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/EffectNode.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,16 +0,0 @@ -#pragma once -#include "node.h" - -class CPluginNode : - public CNode -{ -public: - CPluginNode(void); - ~CPluginNode(void); - - virtual CString GetLabel(); - virtual HPEN GetBorderPen(); - -private: - HPEN m_hBorderPen; -}; Deleted: trunk/OpenMPT/mptrack/FinalNode.cpp =================================================================== --- trunk/OpenMPT/mptrack/FinalNode.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/FinalNode.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,21 +0,0 @@ -#include "stdafx.h" -#include ".\finalnode.h" - -CFinalNode::CFinalNode(void) -{ - m_hBorderPen = ::CreatePen(PS_SOLID,0, RGB(0x00, 0x00, 0x00)); -} - -CFinalNode::~CFinalNode(void) -{ -} - -HPEN CFinalNode::GetBorderPen() -{ - return m_hBorderPen; -} - -CString CFinalNode::GetLabel() -{ - return ""; -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/FinalNode.h =================================================================== --- trunk/OpenMPT/mptrack/FinalNode.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/FinalNode.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,16 +0,0 @@ -#pragma once -#include "node.h" - -class CFinalNode : - public CNode -{ -public: - CFinalNode(void); - ~CFinalNode(void); - - virtual CString GetLabel(); - virtual HPEN GetBorderPen(); - -private: - HPEN m_hBorderPen; -}; Deleted: trunk/OpenMPT/mptrack/Graph.cpp =================================================================== --- trunk/OpenMPT/mptrack/Graph.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Graph.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,96 +0,0 @@ -#include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" -#include "node.h" -#include "channelnode.h" -#include "instrumentnode.h" -#include "effectnode.h" -#include "finalnode.h" -#include "sndfile.h" -#include ".\graph.h" - -CGraph::CGraph() -{ -} - -CGraph::~CGraph(void) -{ - EmptyNodePool(); -} - - -int CGraph::GetMapKeyFromChannel(int chan) -{ - return chan; -} - -int CGraph::GetMapKeyFromInstrument(int instr) -{ - return MAX_CHANNELS + instr; -} - -int CGraph::GetMapKeyFromPlugSlot(int slot) -{ - return MAX_CHANNELS + MAX_INSTRUMENTS + slot; -} - -int CGraph::GetMapKeyForFinalNode() { - return MAX_CHANNELS + MAX_INSTRUMENTS + MAX_MIXPLUGINS; -} - -void CGraph::BuildNodePool(CSoundFile* pSndFile) -//---------------------------------------------- -{ - EmptyNodePool(); - - CNode* newNode; - - //Add final (master out) node - newNode = new CFinalNode(); - m_nodePool.SetAt(GetMapKeyForFinalNode(), newNode); - - //Add nodes for all channels - for (int chan=0; chan<pSndFile->m_nChannels; chan++) { - newNode = new CChannelNode(); - m_nodePool.SetAt(GetMapKeyFromChannel(chan), newNode); - } - - //Add nodes for all instruments - for (int inst=0; inst<pSndFile->m_nInstruments; inst++) { - newNode = new CInstrumentNode(); - m_nodePool.SetAt(GetMapKeyFromInstrument(inst), newNode); - } - - //Add nodes for all plugins - for (int plug=0; plug<MAX_MIXPLUGINS; plug++) { - if (pSndFile->m_MixPlugins[plug].pMixPlugin != NULL) { - newNode = new CPluginNode(); - m_nodePool.SetAt(GetMapKeyFromPlugSlot(plug), newNode); - } - } -} - -void CGraph::EmptyNodePool() -{ - POSITION pos = m_nodePool.GetStartPosition(); - while( pos != NULL ) { - CNode* pNode; - int key; - m_nodePool.GetNextAssoc(pos, key, pNode); - delete pNode; - } - - m_nodePool.RemoveAll(); -} - - -void CGraph::Render(CDC *cdc) -{ - POSITION pos = m_nodePool.GetStartPosition(); - while( pos != NULL ) { - CNode* pNode; - int key; - m_nodePool.GetNextAssoc(pos, key, pNode); - pNode->Render(cdc); - } -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/Graph.h =================================================================== --- trunk/OpenMPT/mptrack/Graph.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Graph.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,21 +0,0 @@ -#pragma once -class CSoundFile; -class CNode; -class CGraph -{ -public: - CGraph(void); - ~CGraph(void); - void BuildNodePool(CSoundFile* pSndFile); - void EmptyNodePool(); - - int GetMapKeyFromChannel(int chan); - int GetMapKeyFromInstrument(int instr); - int GetMapKeyFromPlugSlot(int slot); - int GetMapKeyForFinalNode(); - void Render(CDC *cdc); - -protected: - CMap<int, int, CNode*, CNode*> m_nodePool; - -}; Deleted: trunk/OpenMPT/mptrack/InstrumentNode.cpp =================================================================== --- trunk/OpenMPT/mptrack/InstrumentNode.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/InstrumentNode.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,21 +0,0 @@ -#include "stdafx.h" -#include ".\instrumentnode.h" - -CInstrumentNode::CInstrumentNode(void) -{ - m_hBorderPen = ::CreatePen(PS_SOLID,0, RGB(0x00, 0x00, 0xFF)); -} - -CInstrumentNode::~CInstrumentNode(void) -{ -} - -HPEN CInstrumentNode::GetBorderPen() -{ - return m_hBorderPen; -} - -CString CInstrumentNode::GetLabel() -{ - return ""; -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/InstrumentNode.h =================================================================== --- trunk/OpenMPT/mptrack/InstrumentNode.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/InstrumentNode.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,16 +0,0 @@ -#pragma once -#include "node.h" - -class CInstrumentNode : - public CNode -{ -public: - CInstrumentNode(void); - ~CInstrumentNode(void); - - virtual CString GetLabel(); - virtual HPEN GetBorderPen(); - -private: - HPEN m_hBorderPen; -}; Deleted: trunk/OpenMPT/mptrack/Node.cpp =================================================================== --- trunk/OpenMPT/mptrack/Node.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Node.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,18 +0,0 @@ -#include "stdafx.h" -#include ".\node.h" - -CNode::CNode(void) -{ - x = rand()%500; - y = rand()%500; -} - -CNode::~CNode(void) -{ -} - -void CNode::Render(CDC* cdc) -{ - cdc->SelectObject(GetBorderPen()); - cdc->Rectangle(x-nodeWidth/2, y-nodeHeight/2, x+nodeWidth/2, y+nodeHeight/2); -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/Node.h =================================================================== --- trunk/OpenMPT/mptrack/Node.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Node.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,31 +0,0 @@ -#pragma once -#include ".\vertex.h" -class CVertex; - -typedef CArray<CVertex, CVertex> VertexArray; - -enum { - nodeWidth = 50, - nodeHeight = 20, -}; - - -class CNode -{ -public: - CNode(void); - ~CNode(void); - - void Render(CDC* cdc); - virtual CString GetLabel() = 0; - virtual HPEN GetBorderPen() = 0; - - int ConnectInput(int input, CNode sourceNode, int sourceNodeOutput); - -protected: - int x,y; - int m_nOutputs; - int m_nInputs; - VertexArray m_inputs; -// VertexArray m_outputs; -}; Deleted: trunk/OpenMPT/mptrack/Vertex.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vertex.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Vertex.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,10 +0,0 @@ -#include "stdafx.h" -#include ".\vertex.h" - -CVertex::CVertex(void) -{ -} - -CVertex::~CVertex(void) -{ -} Deleted: trunk/OpenMPT/mptrack/Vertex.h =================================================================== --- trunk/OpenMPT/mptrack/Vertex.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/Vertex.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,26 +0,0 @@ -#pragma once -#include "afxtempl.h" - -class CNode; - -struct Link -{ - CNode* node; - int vertexID; -}; - -enum { //vertex types - INPUT_VERTEX = 0, - OUTPUT_VERTEX = 1 -}; - -class CVertex -{ -public: - CVertex(void); - ~CVertex(void); - -protected: - int m_nType; - CArray<Link, Link> m_linkArray; -}; Deleted: trunk/OpenMPT/mptrack/ctrl_graph.cpp =================================================================== --- trunk/OpenMPT/mptrack/ctrl_graph.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/ctrl_graph.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,22 +0,0 @@ -#include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" -#include "childfrm.h" -#include "moddoc.h" -#include "globals.h" -#include "ctrl_graph.h" -#include "view_graph.h" - -CCtrlGraph::CCtrlGraph(void) -{ -} - -CCtrlGraph::~CCtrlGraph(void) -{ -} - -CRuntimeClass *CCtrlGraph::GetAssociatedViewClass() -//---------------------------------------------------- -{ - return RUNTIME_CLASS(CViewGraph); -} Deleted: trunk/OpenMPT/mptrack/ctrl_graph.h =================================================================== --- trunk/OpenMPT/mptrack/ctrl_graph.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/ctrl_graph.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,11 +0,0 @@ -#pragma once -class CCtrlGraph : - public CModControlDlg -{ -public: - CCtrlGraph(void); - ~CCtrlGraph(void); - - LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glGraphWindowHeight;} //rewbs.varWindowSize - virtual CRuntimeClass *GetAssociatedViewClass(); -}; Deleted: trunk/OpenMPT/mptrack/view_graph.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_graph.cpp 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/view_graph.cpp 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,73 +0,0 @@ -#include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" -#include "childfrm.h" -#include "moddoc.h" -#include "globals.h" -#include "view_graph.h" -#include "graph.h" -#include ".\view_graph.h" - -IMPLEMENT_SERIAL(CViewGraph, CModScrollView, 0) - -CViewGraph::CViewGraph(void) -//-------------------------- -{ - m_pGraph = new CGraph(); -} - -CViewGraph::~CViewGraph(void) -//--------------------------- -{ - delete m_pGraph; -} -BEGIN_MESSAGE_MAP(CViewGraph, CModScrollView) - ON_WM_ACTIVATE() - ON_WM_DESTROY() -END_MESSAGE_MAP() - -void CViewGraph::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) -//------------------------------------------------------------------------ -{ - CModScrollView::OnActivate(nState, pWndOther, bMinimized); -} - -void CViewGraph::OnDestroy() -//-------------------------- -{ - CModScrollView::OnDestroy(); - m_pGraph->EmptyNodePool(); -} - - -void CViewGraph::OnDraw(CDC *cdc) -//---------------------------- -{ - m_pGraph->Render(cdc); -} - - -void CViewGraph::OnInitialUpdate() -//-------------------------------- -{ - CModDoc *pModDoc = GetDocument(); - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - m_pGraph->BuildNodePool(pSndFile); -} - - -void CViewGraph::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/) -//--------------------------------------------------------------------- -{ -} - - -LRESULT CViewGraph::OnModViewMsg(WPARAM wParam, LPARAM lParam) -//------------------------------------------------------------ -{ -// switch(wParam) -// { -// default: - return CModScrollView::OnModViewMsg(wParam, lParam); -// } -} \ No newline at end of file Deleted: trunk/OpenMPT/mptrack/view_graph.h =================================================================== --- trunk/OpenMPT/mptrack/view_graph.h 2013-04-17 04:44:37 UTC (rev 1899) +++ trunk/OpenMPT/mptrack/view_graph.h 2013-04-17 21:03:51 UTC (rev 1900) @@ -1,24 +0,0 @@ -#pragma once -class CGraph; - -class CViewGraph : - public CModScrollView -{ -public: - CViewGraph(void); - DECLARE_SERIAL(CViewGraph) - - virtual void OnDraw(CDC *); - virtual void OnInitialUpdate(); - virtual void OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint); - virtual LRESULT OnModViewMsg(WPARAM, LPARAM); - - ~CViewGraph(void); - DECLARE_MESSAGE_MAP() - afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); - afx_msg void OnDestroy(); - -protected: - CGraph* m_pGraph; - -}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-17 21:08:22
|
Revision: 1901 http://sourceforge.net/p/modplug/code/1901 Author: manxorist Date: 2013-04-17 21:08:11 +0000 (Wed, 17 Apr 2013) Log Message: ----------- [Ref] Restructure VS2010 project file to reflect actual direcotry structure a bit better. Modified Paths: -------------- trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-17 21:03:51 UTC (rev 1900) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2013-04-17 21:08:11 UTC (rev 1901) @@ -248,94 +248,96 @@ <ClCompile Include="..\common\misc_util.cpp" /> <ClCompile Include="..\common\Profiler.cpp" /> <ClCompile Include="..\common\Reporting.cpp" /> + <ClCompile Include="..\common\serialization_utils.cpp" /> <ClCompile Include="..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\sounddsp\AGC.cpp" /> <ClCompile Include="..\sounddsp\DSP.cpp" /> <ClCompile Include="..\sounddsp\EQ.cpp" /> <ClCompile Include="..\sounddsp\Reverb.cpp" /> + <ClCompile Include="..\soundlib\Dlsbank.cpp" /> + <ClCompile Include="..\soundlib\Fastmix.cpp" /> <ClCompile Include="..\soundlib\ITCompression.cpp" /> <ClCompile Include="..\soundlib\ITTools.cpp" /> + <ClCompile Include="..\soundlib\Message.cpp" /> <ClCompile Include="..\soundlib\MIDIEvents.cpp" /> <ClCompile Include="..\soundlib\MIDIMacros.cpp" /> <ClCompile Include="..\soundlib\MixerSettings.cpp" /> + <ClCompile Include="..\soundlib\Mmcmp.cpp" /> + <ClCompile Include="..\soundlib\Mmx_mix.cpp" /> <ClCompile Include="..\soundlib\ModChannel.cpp" /> + <ClCompile Include="..\soundlib\modcommand.cpp" /> <ClCompile Include="..\soundlib\ModInstrument.cpp" /> <ClCompile Include="..\soundlib\ModSample.cpp" /> + <ClCompile Include="..\soundlib\ModSequence.cpp" /> + <ClCompile Include="..\soundlib\modsmp_ctrl.cpp" /> + <ClCompile Include="..\soundlib\mod_specifications.cpp" /> + <ClCompile Include="..\soundlib\pattern.cpp" /> + <ClCompile Include="..\soundlib\patternContainer.cpp" /> <ClCompile Include="..\soundlib\plugins\JBridge.cpp" /> <ClCompile Include="..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\soundlib\SampleFormats.cpp" /> <ClCompile Include="..\soundlib\SampleIO.cpp" /> + <ClCompile Include="..\soundlib\Sndfile.cpp" /> + <ClCompile Include="..\soundlib\Sndmix.cpp" /> + <ClCompile Include="..\soundlib\Snd_flt.cpp" /> + <ClCompile Include="..\soundlib\Snd_fx.cpp" /> + <ClCompile Include="..\soundlib\SoundFilePlayConfig.cpp" /> + <ClCompile Include="..\soundlib\Tables.cpp" /> + <ClCompile Include="..\soundlib\Waveform.cpp" /> <ClCompile Include="..\soundlib\WAVTools.cpp" /> + <ClCompile Include="..\soundlib\WindowedFIR.cpp" /> <ClCompile Include="..\soundlib\XMTools.cpp" /> <ClCompile Include="AbstractVstEditor.cpp" /> <ClCompile Include="ACMConvert.cpp" /> <ClCompile Include="AutoSaver.cpp" /> <ClCompile Include="Autotune.cpp" /> <ClCompile Include="ChannelManagerDlg.cpp" /> - <ClCompile Include="ChildFrm.cpp" /> + <ClCompile Include="Childfrm.cpp" /> <ClCompile Include="CleanupSong.cpp" /> <ClCompile Include="CloseMainDialog.cpp" /> <ClCompile Include="ColourEdit.cpp" /> <ClCompile Include="CommandSet.cpp" /> <ClCompile Include="CreditStatic.cpp" /> - <ClCompile Include="ctrl_com.cpp" /> - <ClCompile Include="ctrl_gen.cpp" /> - <ClCompile Include="ctrl_ins.cpp" /> - <ClCompile Include="ctrl_pat.cpp" /> - <ClCompile Include="ctrl_seq.cpp" /> - <ClCompile Include="ctrl_smp.cpp" /> + <ClCompile Include="Ctrl_com.cpp" /> + <ClCompile Include="Ctrl_gen.cpp" /> + <ClCompile Include="Ctrl_ins.cpp" /> + <ClCompile Include="Ctrl_pat.cpp" /> + <ClCompile Include="Ctrl_seq.cpp" /> + <ClCompile Include="Ctrl_smp.cpp" /> <ClCompile Include="DefaultVstEditor.cpp" /> <ClCompile Include="dlg_misc.cpp" /> - <ClCompile Include="..\soundlib\dlsbank.cpp" /> - <ClCompile Include="draw_pat.cpp" /> + <ClCompile Include="Draw_pat.cpp" /> <ClCompile Include="EffectInfo.cpp" /> <ClCompile Include="EffectVis.cpp" /> - <ClCompile Include="..\soundlib\Fastmix.cpp" /> <ClCompile Include="ExceptionHandler.cpp" /> - <ClCompile Include="globals.cpp" /> + <ClCompile Include="Globals.cpp" /> <ClCompile Include="HyperEdit.cpp" /> <ClCompile Include="HyperEdit2.cpp" /> <ClCompile Include="HyperEdit3.cpp" /> <ClCompile Include="InputHandler.cpp" /> <ClCompile Include="KeyConfigDlg.cpp" /> - <ClCompile Include="mainbar.cpp" /> + <ClCompile Include="Mainbar.cpp" /> <ClCompile Include="MainFrm.cpp" /> - <ClCompile Include="..\soundlib\Message.cpp" /> <ClCompile Include="MIDIMacroDialog.cpp" /> <ClCompile Include="MIDIMapping.cpp" /> <ClCompile Include="MIDIMappingDialog.cpp" /> - <ClCompile Include="..\soundlib\mmcmp.cpp" /> - <ClCompile Include="..\soundlib\Mmx_mix.cpp" /> <ClCompile Include="mod2midi.cpp" /> <ClCompile Include="Mod2wave.cpp" /> - <ClCompile Include="..\soundlib\mod_specifications.cpp" /> - <ClCompile Include="..\soundlib\modcommand.cpp" /> <ClCompile Include="ModConvert.cpp" /> <ClCompile Include="Moddoc.cpp" /> <ClCompile Include="Modedit.cpp" /> - <ClCompile Include="..\soundlib\ModSequence.cpp" /> - <ClCompile Include="..\soundlib\modsmp_ctrl.cpp" /> <ClCompile Include="Moptions.cpp" /> <ClCompile Include="MoveFXSlotDialog.cpp" /> <ClCompile Include="Mpdlgs.cpp" /> - <ClCompile Include="mpt_midi.cpp" /> <ClCompile Include="MPTHacks.cpp" /> - <ClCompile Include="mptrack.cpp" /> - <ClCompile Include="..\soundlib\pattern.cpp" /> - <ClCompile Include="..\soundlib\patternContainer.cpp" /> + <ClCompile Include="Mptrack.cpp" /> + <ClCompile Include="Mpt_midi.cpp" /> <ClCompile Include="PatternClipboard.cpp" /> <ClCompile Include="PatternEditorDialogs.cpp" /> <ClCompile Include="PatternGotoDialog.cpp" /> <ClCompile Include="PSRatioCalc.cpp" /> <ClCompile Include="SampleEditorDialogs.cpp" /> <ClCompile Include="ScaleEnvPointsDlg.cpp" /> - <ClCompile Include="SelectPluginDialog.cpp" /> - <ClCompile Include="..\common\serialization_utils.cpp" /> - <ClCompile Include="..\soundlib\snd_flt.cpp" /> - <ClCompile Include="..\soundlib\Snd_fx.cpp" /> - <ClCompile Include="..\soundlib\Sndfile.cpp" /> - <ClCompile Include="..\soundlib\Sndmix.cpp" /> - <ClCompile Include="..\soundlib\SoundFilePlayConfig.cpp" /> <ClCompile Include="..\common\stdafx.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> @@ -343,24 +345,12 @@ <MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</MultiProcessorCompilation> <MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">false</MultiProcessorCompilation> </ClCompile> - <ClCompile Include="..\soundlib\Tables.cpp" /> - <ClCompile Include="tagging.cpp" /> - <ClCompile Include="TrackerSettings.cpp" /> - <ClCompile Include="Undo.cpp" /> - <ClCompile Include="UpdateCheck.cpp" /> - <ClCompile Include="view_com.cpp" /> - <ClCompile Include="view_gen.cpp" /> - <ClCompile Include="view_ins.cpp" /> - <ClCompile Include="view_pat.cpp" /> - <ClCompile Include="view_smp.cpp" /> - <ClCompile Include="view_tre.cpp" /> - <ClCompile Include="VSTEditor.cpp" /> - <ClCompile Include="vstplug.cpp" /> - <ClCompile Include="..\soundlib\Waveform.cpp" /> - <ClCompile Include="..\soundlib\WindowedFIR.cpp" /> <ClCompile Include="..\soundlib\tuning.cpp" /> <ClCompile Include="..\soundlib\tuningbase.cpp" /> <ClCompile Include="..\soundlib\tuningCollection.cpp" /> + <ClCompile Include="SelectPluginDialog.cpp" /> + <ClCompile Include="tagging.cpp" /> + <ClCompile Include="TrackerSettings.cpp" /> <ClCompile Include="TuningDialog.cpp" /> <ClCompile Include="tuningRatioMapWnd.cpp" /> <ClCompile Include="test\test.cpp" /> @@ -392,6 +382,16 @@ <ClCompile Include="..\Soundlib\Load_umx.cpp" /> <ClCompile Include="..\soundlib\Load_wav.cpp" /> <ClCompile Include="..\soundlib\Load_xm.cpp" /> + <ClCompile Include="Undo.cpp" /> + <ClCompile Include="UpdateCheck.cpp" /> + <ClCompile Include="view_com.cpp" /> + <ClCompile Include="View_gen.cpp" /> + <ClCompile Include="View_ins.cpp" /> + <ClCompile Include="View_pat.cpp" /> + <ClCompile Include="View_smp.cpp" /> + <ClCompile Include="View_tre.cpp" /> + <ClCompile Include="VSTEditor.cpp" /> + <ClCompile Include="Vstplug.cpp" /> <ClCompile Include="VstPresets.cpp" /> </ItemGroup> <ItemGroup> @@ -405,8 +405,10 @@ <ClInclude Include="..\common\mutex.h" /> <ClInclude Include="..\common\Profiler.h" /> <ClInclude Include="..\common\Reporting.h" /> + <ClInclude Include="..\common\serialization_utils.h" /> <ClInclude Include="..\common\StringFixer.h" /> <ClInclude Include="..\common\typedefs.h" /> + <ClInclude Include="..\common\version.h" /> <ClInclude Include="..\sounddev\SoundDevice.h" /> <ClInclude Include="..\sounddev\SoundDevices.h" /> <ClInclude Include="..\sounddsp\AGC.h" /> @@ -414,6 +416,8 @@ <ClInclude Include="..\sounddsp\EQ.h" /> <ClInclude Include="..\sounddsp\Reverb.h" /> <ClInclude Include="..\soundlib\ChunkReader.h" /> + <ClInclude Include="..\soundlib\Dlsbank.h" /> + <ClInclude Include="..\soundlib\Endianness.h" /> <ClInclude Include="..\soundlib\FileReader.h" /> <ClInclude Include="..\soundlib\ITCompression.h" /> <ClInclude Include="..\soundlib\ITTools.h" /> @@ -422,8 +426,14 @@ <ClInclude Include="..\soundlib\MIDIMacros.h" /> <ClInclude Include="..\soundlib\MixerSettings.h" /> <ClInclude Include="..\soundlib\ModChannel.h" /> + <ClInclude Include="..\soundlib\modcommand.h" /> <ClInclude Include="..\soundlib\ModInstrument.h" /> <ClInclude Include="..\soundlib\ModSample.h" /> + <ClInclude Include="..\soundlib\ModSequence.h" /> + <ClInclude Include="..\soundlib\modsmp_ctrl.h" /> + <ClInclude Include="..\soundlib\mod_specifications.h" /> + <ClInclude Include="..\soundlib\pattern.h" /> + <ClInclude Include="..\soundlib\patternContainer.h" /> <ClInclude Include="..\soundlib\plugins\JBridge.h" /> <ClInclude Include="..\soundlib\plugins\PluginEventQueue.h" /> <ClInclude Include="..\soundlib\plugins\PluginMixBuffer.h" /> @@ -432,91 +442,81 @@ <ClInclude Include="..\soundlib\RowVisitor.h" /> <ClInclude Include="..\soundlib\SampleFormatConverters.h" /> <ClInclude Include="..\soundlib\SampleIO.h" /> + <ClInclude Include="..\soundlib\Sndfile.h" /> + <ClInclude Include="..\soundlib\Snd_defs.h" /> + <ClInclude Include="..\soundlib\SoundFilePlayConfig.h" /> <ClInclude Include="..\soundlib\Tables.h" /> + <ClInclude Include="..\soundlib\Wav.h" /> <ClInclude Include="..\soundlib\WAVTools.h" /> + <ClInclude Include="..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\soundlib\XMTools.h" /> + <ClInclude Include="AbstractVstEditor.h" /> <ClInclude Include="ACMConvert.h" /> + <ClInclude Include="AutoSaver.h" /> <ClInclude Include="Autotune.h" /> + <ClInclude Include="Childfrm.h" /> + <ClInclude Include="CleanupSong.h" /> + <ClInclude Include="ColourEdit.h" /> + <ClInclude Include="CommandSet.h" /> + <ClInclude Include="CreditStatic.h" /> + <ClInclude Include="Ctrl_com.h" /> + <ClInclude Include="Ctrl_gen.h" /> + <ClInclude Include="Ctrl_ins.h" /> + <ClInclude Include="Ctrl_pat.h" /> + <ClInclude Include="Ctrl_smp.h" /> + <ClInclude Include="DefaultVstEditor.h" /> <ClInclude Include="EffectInfo.h" /> <ClInclude Include="ExceptionHandler.h" /> + <ClInclude Include="Globals.h" /> + <ClInclude Include="HyperEdit.h" /> + <ClInclude Include="InputHandler.h" /> + <ClInclude Include="Mainbar.h" /> + <ClInclude Include="Mainfrm.h" /> <ClInclude Include="MIDIMacroDialog.h" /> <ClInclude Include="MIDIMapping.h" /> + <ClInclude Include="mod2midi.h" /> + <ClInclude Include="mod2wave.h" /> + <ClInclude Include="ModConvert.h" /> + <ClInclude Include="Moddoc.h" /> + <ClInclude Include="Mptrack.h" /> <ClInclude Include="Notification.h" /> <ClInclude Include="PatternClipboard.h" /> <ClInclude Include="PatternCursor.h" /> <ClInclude Include="SelectPluginDialog.h" /> - <ClInclude Include="AbstractVstEditor.h" /> - <ClInclude Include="AutoSaver.h" /> <ClInclude Include="ChannelManagerDlg.h" /> - <ClInclude Include="ChildFrm.h" /> - <ClInclude Include="CleanupSong.h" /> <ClInclude Include="CloseMainDialog.h" /> - <ClInclude Include="ColourEdit.h" /> - <ClInclude Include="CommandSet.h" /> - <ClInclude Include="CreditStatic.h" /> - <ClInclude Include="ctrl_com.h" /> - <ClInclude Include="ctrl_gen.h" /> - <ClInclude Include="ctrl_ins.h" /> - <ClInclude Include="ctrl_pat.h" /> - <ClInclude Include="ctrl_smp.h" /> - <ClInclude Include="DefaultVstEditor.h" /> <ClInclude Include="dlg_misc.h" /> - <ClInclude Include="..\Soundlib\Dlsbank.h" /> <ClInclude Include="EffectVis.h" /> - <ClInclude Include="..\soundlib\Endianness.h" /> - <ClInclude Include="globals.h" /> - <ClInclude Include="InputHandler.h" /> <ClInclude Include="KeyConfigDlg.h" /> - <ClInclude Include="mainbar.h" /> - <ClInclude Include="MainFrm.h" /> <ClInclude Include="MIDIMappingDialog.h" /> - <ClInclude Include="mod2midi.h" /> - <ClInclude Include="mod2wave.h" /> - <ClInclude Include="..\soundlib\mod_specifications.h" /> - <ClInclude Include="..\soundlib\modcommand.h" /> - <ClInclude Include="ModConvert.h" /> - <ClInclude Include="moddoc.h" /> - <ClInclude Include="..\soundlib\ModSequence.h" /> - <ClInclude Include="..\soundlib\modsmp_ctrl.h" /> <ClInclude Include="Moptions.h" /> <ClInclude Include="MoveFXSlotDialog.h" /> <ClInclude Include="Mpdlgs.h" /> - <ClInclude Include="mptrack.h" /> - <ClInclude Include="..\soundlib\pattern.h" /> - <ClInclude Include="..\soundlib\patternContainer.h" /> <ClInclude Include="PatternEditorDialogs.h" /> <ClInclude Include="PatternGotoDialog.h" /> <ClInclude Include="PSRatioCalc.h" /> - <ClInclude Include="Resource.h" /> <ClInclude Include="SampleEditorDialogs.h" /> <ClInclude Include="ScaleEnvPointsDlg.h" /> - <ClInclude Include="..\common\serialization_utils.h" /> - <ClInclude Include="..\soundlib\Snd_defs.h" /> - <ClInclude Include="..\Soundlib\Sndfile.h" /> - <ClInclude Include="..\soundlib\SoundFilePlayConfig.h" /> <ClInclude Include="..\common\stdafx.h" /> - <ClInclude Include="tagging.h" /> - <ClInclude Include="TrackerSettings.h" /> - <ClInclude Include="Undo.h" /> - <ClInclude Include="UpdateCheck.h" /> - <ClInclude Include="..\common\version.h" /> - <ClInclude Include="view_com.h" /> - <ClInclude Include="view_gen.h" /> - <ClInclude Include="view_ins.h" /> - <ClInclude Include="view_pat.h" /> - <ClInclude Include="view_smp.h" /> - <ClInclude Include="view_tre.h" /> - <ClInclude Include="VSTEditor.h" /> - <ClInclude Include="vstplug.h" /> - <ClInclude Include="..\soundlib\Wav.h" /> - <ClInclude Include="..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\soundlib\tuning.h" /> <ClInclude Include="..\soundlib\tuningbase.h" /> <ClInclude Include="..\soundlib\tuningcollection.h" /> + <ClInclude Include="tagging.h" /> + <ClInclude Include="TrackerSettings.h" /> <ClInclude Include="TuningDialog.h" /> <ClInclude Include="tuningRatioMapWnd.h" /> <ClInclude Include="test\test.h" /> <ClInclude Include="..\soundlib\Loaders.h" /> + <ClInclude Include="Undo.h" /> + <ClInclude Include="UpdateCheck.h" /> + <ClInclude Include="view_com.h" /> + <ClInclude Include="View_gen.h" /> + <ClInclude Include="View_ins.h" /> + <ClInclude Include="View_pat.h" /> + <ClInclude Include="View_smp.h" /> + <ClInclude Include="View_tre.h" /> + <ClInclude Include="VSTEditor.h" /> + <ClInclude Include="Vstplug.h" /> <ClInclude Include="VstPresets.h" /> </ItemGroup> <ItemGroup> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-17 21:03:51 UTC (rev 1900) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2013-04-17 21:08:11 UTC (rev 1901) @@ -1,797 +1,797 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> - <ClCompile Include="AutoSaver.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ChildFrm.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="CleanupSong.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="CommandSet.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="CreditStatic.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_com.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_gen.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_ins.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_pat.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_seq.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctrl_smp.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="DefaultVstEditor.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\soundlib\Load_669.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_xm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_wav.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_s3m.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_stm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_ult.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\Soundlib\Load_umx.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\load_ptm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\Soundlib\load_psm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_okt.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_mtm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\Soundlib\load_mt2.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_mod.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_mo3.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_med.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\load_mid.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_mdl.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_itp.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\load_j2b.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_it.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_imf.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_gdm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_far.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_ams.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\Soundlib\load_amf.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\load_dmf.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\Load_dsm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\load_dbm.cpp"> - <Filter>Module Loaders</Filter> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> - <ClCompile Include="..\soundlib\dlsbank.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="test\test.cpp"> + <Filter>test</Filter> </ClCompile> - <ClCompile Include="draw_pat.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="ChannelManagerDlg.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Fastmix.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="CloseMainDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="globals.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="dlg_misc.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="HyperEdit.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Mpdlgs.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="HyperEdit3.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="PatternEditorDialogs.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="HyperEdit2.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="PatternGotoDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="InputHandler.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="SampleEditorDialogs.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Message.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Moptions.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="mainbar.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="ScaleEnvPointsDlg.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\mod_specifications.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="MoveFXSlotDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\modcommand.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\tuning.cpp"> + <Filter>Source Files\soundlib\Tuning</Filter> </ClCompile> - <ClCompile Include="ModConvert.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\tuningbase.cpp"> + <Filter>Source Files\soundlib\Tuning</Filter> </ClCompile> - <ClCompile Include="Moddoc.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\tuningCollection.cpp"> + <Filter>Source Files\soundlib\Tuning</Filter> </ClCompile> - <ClCompile Include="Modedit.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="KeyConfigDlg.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ModSequence.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="MIDIMappingDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\modsmp_ctrl.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="MIDIMacroDialog.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="Mod2wave.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="EffectVis.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="MainFrm.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="PSRatioCalc.cpp"> + <Filter>Source Files\mptrack\Dialogs</Filter> </ClCompile> - <ClCompile Include="..\soundlib\mmcmp.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ITTools.cpp"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Mmx_mix.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\XMTools.cpp"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> - <ClCompile Include="mod2midi.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\SampleFormats.cpp"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> - <ClCompile Include="..\soundlib\pattern.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\WAVTools.cpp"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> - <ClCompile Include="view_com.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\sounddsp\DSP.cpp"> + <Filter>Source Files\sounddsp</Filter> </ClCompile> - <ClCompile Include="view_gen.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\sounddsp\EQ.cpp"> + <Filter>Source Files\sounddsp</Filter> </ClCompile> - <ClCompile Include="view_ins.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\sounddsp\AGC.cpp"> + <Filter>Source Files\sounddsp</Filter> </ClCompile> - <ClCompile Include="view_pat.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\sounddsp\Reverb.cpp"> + <Filter>Source Files\sounddsp</Filter> </ClCompile> - <ClCompile Include="view_smp.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\sounddev\SoundDevice.cpp"> + <Filter>Source Files\sounddev</Filter> </ClCompile> - <ClCompile Include="view_tre.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\common\stdafx.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="test\test.cpp"> - <Filter>test</Filter> + <ClCompile Include="..\soundlib\plugins\JBridge.cpp"> + <Filter>Source Files\soundlib\plugins</Filter> </ClCompile> + <ClCompile Include="..\soundlib\Dlsbank.cpp"> + <Filter>Source Files\soundlib</Filter> + </ClCompile> <ClCompile Include="..\soundlib\WindowedFIR.cpp"> - <Filter>Source Files</Filter> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Waveform.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\Fastmix.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="vstplug.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ITCompression.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="VSTEditor.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\Message.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="UpdateCheck.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\MIDIEvents.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="TrackerSettings.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\MIDIMacros.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="tagging.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\MixerSettings.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Tables.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\Mmcmp.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\common\stdafx.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\Mmx_mix.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\SoundFilePlayConfig.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\mod_specifications.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Sndmix.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ModChannel.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Sndfile.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\modcommand.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\Snd_fx.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ModInstrument.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\snd_flt.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ModSample.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\common\serialization_utils.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\ModSequence.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="ChannelManagerDlg.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\modsmp_ctrl.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="CloseMainDialog.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\pattern.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="AbstractVstEditor.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\patternContainer.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="dlg_misc.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\RowVisitor.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="Mpdlgs.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\SampleIO.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="PatternEditorDialogs.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\Snd_flt.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="PatternGotoDialog.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\Snd_fx.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="..\soundlib\patternContainer.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\Sndfile.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="SampleEditorDialogs.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\Sndmix.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="ColourEdit.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\soundlib\SoundFilePlayConfig.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="Moptions.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\Tables.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="ScaleEnvPointsDlg.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="..\soundlib\Waveform.cpp"> + <Filter>Source Files\soundlib</Filter> </ClCompile> - <ClCompile Include="mptrack.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="TuningDialog.cpp"> + <Filter>Source Files\mptrack\Tuning</Filter> </ClCompile> - <ClCompile Include="MoveFXSlotDialog.cpp"> - <Filter>Source Files\Dialogs</Filter> - </ClCompile> <ClCompile Include="tuningRatioMapWnd.cpp"> - <Filter>Source Files\Tuning</Filter> + <Filter>Source Files\mptrack\Tuning</Filter> </ClCompile> - <ClCompile Include="..\soundlib\tuning.cpp"> - <Filter>Source Files\Tuning</Filter> + <ClCompile Include="..\common\AudioCriticalSection.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="..\soundlib\tuningbase.cpp"> - <Filter>Source Files\Tuning</Filter> + <ClCompile Include="..\common\serialization_utils.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="..\soundlib\tuningCollection.cpp"> - <Filter>Source Files\Tuning</Filter> + <ClCompile Include="..\common\misc_util.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="TuningDialog.cpp"> - <Filter>Source Files\Tuning</Filter> + <ClCompile Include="..\common\Profiler.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="mpt_midi.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="..\common\Reporting.cpp"> + <Filter>Source Files\common</Filter> </ClCompile> - <ClCompile Include="MPTHacks.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="AbstractVstEditor.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="Undo.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="VstPresets.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="SelectPluginDialog.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="ACMConvert.cpp"> - <Filter>Source Files</Filter> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="ExceptionHandler.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="AutoSaver.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\common\Reporting.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Autotune.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\common\misc_util.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Childfrm.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="KeyConfigDlg.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="CleanupSong.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="MIDIMappingDialog.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="ColourEdit.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="Autotune.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="CommandSet.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="MIDIMacroDialog.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="CreditStatic.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\MIDIMacros.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Ctrl_com.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="EffectInfo.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Ctrl_gen.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ModInstrument.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Ctrl_ins.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="EffectVis.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="Ctrl_pat.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="PSRatioCalc.cpp"> - <Filter>Source Files\Dialogs</Filter> + <ClCompile Include="Ctrl_seq.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ModSample.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Ctrl_smp.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ITTools.cpp"> - <Filter>Module Loaders</Filter> + <ClCompile Include="DefaultVstEditor.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="PatternClipboard.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Draw_pat.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\RowVisitor.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="EffectInfo.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ModChannel.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="ExceptionHandler.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\XMTools.cpp"> - <Filter>Module Loaders</Filter> + <ClCompile Include="Globals.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\plugins\JBridge.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="HyperEdit.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> + <ClCompile Include="HyperEdit2.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="HyperEdit3.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="InputHandler.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="Mainbar.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="MainFrm.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> <ClCompile Include="MIDIMapping.cpp"> - <Filter>Source Files</Filter> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\MIDIEvents.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="mod2midi.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\SampleIO.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Mod2wave.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\SampleFormats.cpp"> - <Filter>Module Loaders</Filter> + <ClCompile Include="ModConvert.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\WAVTools.cpp"> - <Filter>Module Loaders</Filter> + <ClCompile Include="Moddoc.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\common\AudioCriticalSection.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Modedit.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\MixerSettings.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Mpt_midi.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="VstPresets.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="MPTHacks.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\soundlib\ITCompression.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="Mptrack.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\sounddsp\DSP.cpp"> - <Filter>Source Files\sounddsp</Filter> + <ClCompile Include="PatternClipboard.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\sounddsp\EQ.cpp"> - <Filter>Source Files\sounddsp</Filter> + <ClCompile Include="SelectPluginDialog.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\sounddsp\AGC.cpp"> - <Filter>Source Files\sounddsp</Filter> + <ClCompile Include="tagging.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\common\Profiler.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="TrackerSettings.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\sounddsp\Reverb.cpp"> - <Filter>Source Files\sounddsp</Filter> + <ClCompile Include="Undo.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> - <ClCompile Include="..\sounddev\SoundDevice.cpp"> - <Filter>Source Files\sounddev</Filter> + <ClCompile Include="UpdateCheck.cpp"> + <Filter>Source Files\mptrack</Filter> </ClCompile> + <ClCompile Include="view_com.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="View_gen.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="View_ins.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="View_pat.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="View_smp.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="View_tre.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="VSTEditor.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> + <ClCompile Include="Vstplug.cpp"> + <Filter>Source Files\mptrack</Filter> + </ClCompile> </ItemGroup> <ItemGroup> - <ClInclude Include="AbstractVstEditor.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Loaders.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="AutoSaver.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\tuningbase.h"> + <Filter>Header Files\soundlib\Tuning</Filter> </ClInclude> - <ClInclude Include="ChildFrm.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\tuning.h"> + <Filter>Header Files\soundlib\Tuning</Filter> </ClInclude> - <ClInclude Include="CleanupSong.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\tuningcollection.h"> + <Filter>Header Files\soundlib\Tuning</Filter> </ClInclude> - <ClInclude Include="CommandSet.h"> - <Filter>Header Files</Filter> + <ClInclude Include="test\test.h"> + <Filter>test</Filter> </ClInclude> - <ClInclude Include="CreditStatic.h"> - <Filter>Header Files</Filter> + <ClInclude Include="ChannelManagerDlg.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="ctrl_com.h"> - <Filter>Header Files</Filter> + <ClInclude Include="CloseMainDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="ctrl_gen.h"> - <Filter>Header Files</Filter> + <ClInclude Include="dlg_misc.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="ctrl_ins.h"> - <Filter>Header Files</Filter> + <ClInclude Include="Mpdlgs.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="ctrl_pat.h"> - <Filter>Header Files</Filter> + <ClInclude Include="PatternGotoDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="ctrl_smp.h"> - <Filter>Header Files</Filter> + <ClInclude Include="PatternEditorDialogs.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="DefaultVstEditor.h"> - <Filter>Header Files</Filter> + <ClInclude Include="Moptions.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="..\soundlib\Loaders.h"> - <Filter>Module Loaders</Filter> + <ClInclude Include="ScaleEnvPointsDlg.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="..\Soundlib\Dlsbank.h"> - <Filter>Header Files</Filter> + <ClInclude Include="MoveFXSlotDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="..\soundlib\Endianness.h"> - <Filter>Header Files</Filter> + <ClInclude Include="SampleEditorDialogs.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="globals.h"> - <Filter>Header Files</Filter> + <ClInclude Include="SelectPluginDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="InputHandler.h"> - <Filter>Header Files</Filter> + <ClInclude Include="KeyConfigDlg.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="mainbar.h"> - <Filter>Header Files</Filter> + <ClInclude Include="MIDIMappingDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="MainFrm.h"> - <Filter>Header Files</Filter> + <ClInclude Include="MIDIMacroDialog.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="mod2midi.h"> - <Filter>Header Files</Filter> + <ClInclude Include="EffectVis.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="mod2wave.h"> - <Filter>Header Files</Filter> + <ClInclude Include="PSRatioCalc.h"> + <Filter>Header Files\mptrack\Dialogs</Filter> </ClInclude> - <ClInclude Include="..\soundlib\mod_specifications.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\ITTools.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="..\soundlib\modcommand.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\XMTools.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="ModConvert.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\ChunkReader.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="..\soundlib\modsmp_ctrl.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\FileReader.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="mptrack.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\WAVTools.h"> + <Filter>Source Files\soundlib\Module Loaders</Filter> </ClInclude> - <ClInclude Include="..\soundlib\ModSequence.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddsp\DSP.h"> + <Filter>Header Files\sounddsp</Filter> </ClInclude> - <ClInclude Include="..\soundlib\WindowedFIR.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddsp\AGC.h"> + <Filter>Header Files\sounddsp</Filter> </ClInclude> - <ClInclude Include="..\soundlib\Wav.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddsp\EQ.h"> + <Filter>Header Files\sounddsp</Filter> </ClInclude> - <ClInclude Include="vstplug.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddsp\Reverb.h"> + <Filter>Header Files\sounddsp</Filter> </ClInclude> - <ClInclude Include="VSTEditor.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddev\SoundDevices.h"> + <Filter>Header Files\sounddev</Filter> </ClInclude> - <ClInclude Include="view_tre.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\sounddev\SoundDevice.h"> + <Filter>Header Files\sounddev</Filter> </ClInclude> - <ClInclude Include="view_smp.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\common\stdafx.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="view_pat.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\plugins\JBridge.h"> + <Filter>Header Files\soundlib\plugins</Filter> </ClInclude> - <ClInclude Include="view_ins.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\plugins\PlugInterface.h"> + <Filter>Header Files\soundlib\plugins</Filter> </ClInclude> - <ClInclude Include="view_gen.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\plugins\PluginEventQueue.h"> + <Filter>Header Files\soundlib\plugins</Filter> </ClInclude> - <ClInclude Include="view_com.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\plugins\PluginMixBuffer.h"> + <Filter>Header Files\soundlib\plugins</Filter> </ClInclude> - <ClInclude Include="..\common\version.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Dlsbank.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="Undo.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\WindowedFIR.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\soundlib\tuningbase.h"> - <Filter>Header Files\Tuning</Filter> + <ClInclude Include="..\soundlib\Endianness.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\soundlib\tuning.h"> - <Filter>Header Files\Tuning</Filter> + <ClInclude Include="..\soundlib\ITCompression.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\soundlib\tuningcollection.h"> - <Filter>Header Files\Tuning</Filter> + <ClInclude Include="..\soundlib\Message.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="TuningDialog.h"> - <Filter>Header Files\Tuning</Filter> + <ClInclude Include="..\soundlib\MIDIEvents.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="tuningRatioMapWnd.h"> - <Filter>Header Files\Tuning</Filter> + <ClInclude Include="..\soundlib\MIDIMacros.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="test\test.h"> - <Filter>test</Filter> + <ClInclude Include="..\soundlib\MixerSettings.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="ChannelManagerDlg.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\mod_specifications.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="CloseMainDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\ModChannel.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="dlg_misc.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\modcommand.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="Mpdlgs.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\ModInstrument.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="PatternGotoDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\ModSample.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="PatternEditorDialogs.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\ModSequence.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="ColourEdit.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\modsmp_ctrl.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="Moptions.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\soundlib\pattern.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="moddoc.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\soundlib\patternContainer.h"> - <Filter>Header Files</Filter> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\soundlib\pattern.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Resampler.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="Resource.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\RowVisitor.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\common\serialization_utils.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\SampleFormatConverters.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> + <ClInclude Include="..\soundlib\SampleIO.h"> + <Filter>Header Files\soundlib</Filter> + </ClInclude> <ClInclude Include="..\soundlib\Snd_defs.h"> - <Filter>Header Files</Filter> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\Soundlib\Sndfile.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Sndfile.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> <ClInclude Include="..\soundlib\SoundFilePlayConfig.h"> - <Filter>Header Files</Filter> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\common\stdafx.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Tables.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="tagging.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\soundlib\Wav.h"> + <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="TrackerSettings.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\common\AudioCriticalSection.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="ScaleEnvPointsDlg.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\common\version.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="MoveFXSlotDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\common\FlagSet.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="SampleEditorDialogs.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\common\misc_util.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="UpdateCheck.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\common\mptString.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="SelectPluginDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="..\common\mutex.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="ACMConvert.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\common\Profiler.h"> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="ExceptionHandler.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\common\Reporting.h"> - <Filter>Header Files</Filter> + <Filter>Header Files\common</Filter> </ClInclude> + <ClInclude Include="..\common\serialization_utils.h"> + <Filter>Header Files\common</Filter> + </ClInclude> + <ClInclude Include="..\common\StringFixer.h"> + <Filter>Header Files\common</Filter> + </ClInclude> <ClInclude Include="..\common\typedefs.h"> - <Filter>Header Files</Filter> + <Filter>Header Files\common</Filter> </ClInclude> - <ClInclude Include="..\common\misc_util.h"> - <Filter>Header Files</Filter> + <ClInclude Include="TuningDialog.h"> + <Filter>Header Files\mptrack\Tuning</Filter> </ClInclude> - <ClInclude Include="..\common\StringFixer.h"> - <Filter>Header Files</Filter> + <ClInclude Include="tuningRatioMapWnd.h"> + <Filter>Header Files\mptrack\Tuning</Filter> </ClInclude> - <ClInclude Include="KeyConfigDlg.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="AbstractVstEditor.h"> + <Filter>Header Files\mptrack</Filter> </ClInclude> - <ClInclude Include="MIDIMappingDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="VstPresets.h"> + <Filter>Header Files\mptrack</Filter> </ClInclude> - <ClInclude Include="Autotune.h"> - <Filter>Header Files</Filter> + <ClInclude Include="ACMConvert.h"> + <Filter>Header Files\mptrack</Filter> </ClInclude> - <ClInclude Include="MIDIMacroDialog.h"> - <Filter>Header Files\Dialogs</Filter> + <ClInclude Include="AutoSaver.h"> + <Filter>Header Files\mptrack</Filter> </ClInclude> - <ClInclude Include="..\soundlib\MIDIMacros.h"> - <Filter>Header Files</Filter> + <ClInclude Include="Autotune.h"> + <Filter>Header Files\mptrack</Filter> </ClInclude> - <Cl... [truncated message content] |
From: <sag...@us...> - 2013-04-22 15:31:04
|
Revision: 1930 http://sourceforge.net/p/modplug/code/1930 Author: saga-games Date: 2013-04-22 15:30:53 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Mod] Dont's show message log during autosave. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/AutoSaver.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2013-04-21 20:57:27 UTC (rev 1929) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2013-04-22 15:30:53 UTC (rev 1930) @@ -59,48 +59,34 @@ //------------------------------------ { bool success = true; - + //If time to save and not already having save in progress. if (CheckTimer(curTime) && !m_bSaveInProgress) { m_bSaveInProgress = true; - CDocTemplate *pDocTemplate; - CModDoc *pModDoc; - POSITION posTemplate,posDocument; - CTrackApp *pTrackApp=(CTrackApp*)::AfxGetApp(); - if (!pTrackApp) - { - m_bSaveInProgress = false; - return false; - } - pTrackApp->BeginWaitCursor(); //display hour glass + theApp.BeginWaitCursor(); //display hour glass - posTemplate = pTrackApp->GetFirstDocTemplatePosition(); - while (posTemplate) { //for all "templates" (we should have just 1) - pDocTemplate = pTrackApp->GetNextDocTemplate(posTemplate); - posDocument = pDocTemplate->GetFirstDocPosition(); - - while (posDocument) //for all open documents + std::vector<CModDoc *> docs = theApp.GetOpenDocuments(); + for(std::vector<CModDoc *>::iterator doc = docs.begin(); doc != docs.end(); doc++) + { + CModDoc &modDoc = **doc; + if(modDoc.ModifiedSinceLastAutosave()) { - pModDoc = (CModDoc*)(pDocTemplate->GetNextDoc(posDocument)); - if(pModDoc && pModDoc->ModifiedSinceLastAutosave()) + if(SaveSingleFile(modDoc)) { - if (SaveSingleFile(pModDoc)) - { - CleanUpBackups(pModDoc); - } else - { - m_bEnabled = false; - Reporting::Warning("Warning: Autosave failed and has been disabled. Please:\n- Review your autosave paths\n- Check available diskspace & filesystem access rights\n- If you are using the ITP format, ensure all instruments exist as independant .iti files"); - success = false; - } + CleanUpBackups(modDoc); + } else + { + m_bEnabled = false; + Reporting::Warning("Warning: Autosave failed and has been disabled. Please:\n- Review your autosave paths\n- Check available diskspace & filesystem access rights\n- If you are using the ITP format, ensure all instruments exist as independant .iti files"); + success = false; } - } //end all open documents + } + } - } //end pointless template loop (we have just 1 template) m_nLastSave = timeGetTime(); - pTrackApp->EndWaitCursor(); //end display hour glass + theApp.EndWaitCursor(); //end display hour glass m_bSaveInProgress = false; } @@ -220,56 +206,57 @@ } -CString CAutoSaver::BuildFileName(CModDoc* pModDoc) -//------------------------------------------------- +CString CAutoSaver::BuildFileName(CModDoc &modDoc) +//------------------------------------------------ { CString timeStamp = (CTime::GetCurrentTime()).Format("%Y%m%d.%H%M%S"); CString name; - if (m_bUseOriginalPath) + if(m_bUseOriginalPath) { - if (pModDoc->m_bHasValidPath) + if(modDoc.m_bHasValidPath) { // Check that the file has a user-chosen path - name = pModDoc->GetPathName(); + name = modDoc.GetPathName(); } else { // if it doesnt, put it in settings dir - name = theApp.GetConfigPath() + pModDoc->GetTitle(); + name = theApp.GetConfigPath() + modDoc.GetTitle(); } - } else { - name = m_csPath+pModDoc->GetTitle(); + name = m_csPath+modDoc.GetTitle(); } - name.Append(".AutoSave."); //append backup tag name.Append(timeStamp); //append timestamp name.Append("."); //append extension - if(pModDoc->GetrSoundFile().m_SongFlags[SONG_ITPROJECT]) + if(modDoc.GetrSoundFile().m_SongFlags[SONG_ITPROJECT]) { name.Append("itp"); } else { - name.Append(pModDoc->GetrSoundFile().GetModSpecifications().fileExtension); + name.Append(modDoc.GetrSoundFile().GetModSpecifications().fileExtension); } return name; } -bool CAutoSaver::SaveSingleFile(CModDoc *pModDoc) -//----------------------------------------------- +bool CAutoSaver::SaveSingleFile(CModDoc &modDoc) +//---------------------------------------------- { // We do not call CModDoc::DoSave as this populates the Recent Files // list with backups... hence we have duplicated code.. :( - bool success = false; - CSoundFile &sndFile = pModDoc->GetrSoundFile(); + CSoundFile &sndFile = modDoc.GetrSoundFile(); - CString fileName = BuildFileName(pModDoc); + CString fileName = BuildFileName(modDoc); - switch (pModDoc->GetModType()) + // We are acutally not going to show the log for autosaved files. + ScopedLogCapturer logcapturer(modDoc, "", nullptr, false); + + bool success = false; + switch(modDoc.GetModType()) { case MOD_TYPE_MOD: success = sndFile.SaveMod(fileName); @@ -293,24 +280,23 @@ //Using IT save function also for MPT. success = sndFile.SaveIT(fileName); break; - //default: - //Do nothing } + return success; } -void CAutoSaver::CleanUpBackups(CModDoc *pModDoc) -//----------------------------------------------- +void CAutoSaver::CleanUpBackups(CModDoc &modDoc) +//---------------------------------------------- { CString path; if (m_bUseOriginalPath) { - if (pModDoc->m_bHasValidPath) // Check that the file has a user-chosen path + if (modDoc.m_bHasValidPath) // Check that the file has a user-chosen path { - CString fullPath = pModDoc->GetPathName(); - path = fullPath.Left(fullPath.GetLength() - pModDoc->GetTitle().GetLength()); //remove file name if necessary + CString fullPath = modDoc.GetPathName(); + path = fullPath.Left(fullPath.GetLength() - modDoc.GetTitle().GetLength()); //remove file name if necessary } else { path = theApp.GetConfigPath(); @@ -320,7 +306,7 @@ path = m_csPath; } - CString searchPattern = path + pModDoc->GetTitle() + ".AutoSave.*"; + CString searchPattern = path + modDoc.GetTitle() + ".AutoSave.*"; CFileFind finder; BOOL bResult = finder.FindFile(searchPattern); Modified: trunk/OpenMPT/mptrack/AutoSaver.h =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.h 2013-04-21 20:57:27 UTC (rev 1929) +++ trunk/OpenMPT/mptrack/AutoSaver.h 2013-04-22 15:30:53 UTC (rev 1930) @@ -42,9 +42,9 @@ //internal implementation private: - bool SaveSingleFile(CModDoc *pModDoc); - CString BuildFileName(CModDoc *pModDoc); - void CleanUpBackups(CModDoc *pModDoc); + bool SaveSingleFile(CModDoc &modDoc); + CString BuildFileName(CModDoc &modDoc); + void CleanUpBackups(CModDoc &modDoc); bool CheckTimer(DWORD curTime); //internal implementation members Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-21 20:57:27 UTC (rev 1929) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-04-22 15:30:53 UTC (rev 1930) @@ -808,9 +808,9 @@ } -ScopedLogCapturer::ScopedLogCapturer(CModDoc &modDoc, const std::string &title, CWnd *parent) : -m_modDoc(modDoc), m_oldLogMode(m_modDoc.GetLogMode()), m_title(title), m_pParent(parent) -//--------------------------------------------------------------------------------------------- +ScopedLogCapturer::ScopedLogCapturer(CModDoc &modDoc, const std::string &title, CWnd *parent, bool showLog) : +m_modDoc(modDoc), m_oldLogMode(m_modDoc.GetLogMode()), m_title(title), m_pParent(parent), m_showLog(showLog) +//----------------------------------------------------------------------------------------------------------- { m_modDoc.SetLogMode(LogModeGather); } @@ -841,7 +841,10 @@ ScopedLogCapturer::~ScopedLogCapturer() //------------------------------------- { - ShowLog(); + if(m_showLog) + ShowLog(); + else + m_modDoc.ClearLog(); m_modDoc.SetLogMode(m_oldLogMode); } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2013-04-21 20:57:27 UTC (rev 1929) +++ trunk/OpenMPT/mptrack/Moddoc.h 2013-04-22 15:30:53 UTC (rev 1930) @@ -164,8 +164,9 @@ LogMode m_oldLogMode; std::string m_title; CWnd *m_pParent; + bool m_showLog; public: - ScopedLogCapturer(CModDoc &modDoc, const std::string &title = "", CWnd *parent = nullptr); + ScopedLogCapturer(CModDoc &modDoc, const std::string &title = "", CWnd *parent = nullptr, bool showLog = true); ~ScopedLogCapturer(); void ShowLog(bool force = false); void ShowLog(const std::string &preamble, bool force = false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-22 20:31:02
|
Revision: 1934 http://sourceforge.net/p/modplug/code/1934 Author: saga-games Date: 2013-04-22 20:30:56 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Fix] That was a bit too much refactoring... Unbreak CMIDIMappingDirective::ToString Modified Paths: -------------- trunk/OpenMPT/mptrack/MIDIMapping.cpp trunk/OpenMPT/mptrack/MIDIMapping.h trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp Modified: trunk/OpenMPT/mptrack/MIDIMapping.cpp =================================================================== --- trunk/OpenMPT/mptrack/MIDIMapping.cpp 2013-04-22 20:21:59 UTC (rev 1933) +++ trunk/OpenMPT/mptrack/MIDIMapping.cpp 2013-04-22 20:30:56 UTC (rev 1934) @@ -14,7 +14,7 @@ #include "Mainfrm.h" -const char *CMIDIMappingDirective::ToString() const +std::string CMIDIMappingDirective::ToString() const //------------------------------------------------- { mpt::String str; @@ -23,7 +23,7 @@ if(m_CaptureMIDI) flags[1] = '1'; if(m_AllowPatternEdit) flags[2] = '1'; str.Format("%s:%d:%x:%d:%d:%d", flags, (int)GetChannel(), (int)GetEvent(), (int)GetController(), (int)m_PluginIndex, m_Parameter); - return str.c_str(); + return str; } Modified: trunk/OpenMPT/mptrack/MIDIMapping.h =================================================================== --- trunk/OpenMPT/mptrack/MIDIMapping.h 2013-04-22 20:21:59 UTC (rev 1933) +++ trunk/OpenMPT/mptrack/MIDIMapping.h 2013-04-22 20:30:56 UTC (rev 1934) @@ -57,7 +57,7 @@ bool operator==(const CMIDIMappingDirective& d) const {return memcmp(this, &d, sizeof(CMIDIMappingDirective)) == 0;} - const char *ToString() const; + std::string ToString() const; BYTE GetChnEvent() const {return m_ChnEvent;} Modified: trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp 2013-04-22 20:21:59 UTC (rev 1933) +++ trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp 2013-04-22 20:30:56 UTC (rev 1934) @@ -159,7 +159,7 @@ m_ControllerCBox.SetCurSel(activeSetting.GetController()); m_PluginCBox.SetCurSel(activeSetting.GetPlugIndex()-1); m_PlugParamCBox.SetCurSel(activeSetting.GetParamIndex()); - SetDlgItemText(IDC_EDIT1, activeSetting.ToString()); + SetDlgItemText(IDC_EDIT1, activeSetting.ToString().c_str()); OnCbnSelchangeComboPlugin(); OnCbnSelchangeComboEvent(); @@ -196,7 +196,7 @@ void CMIDIMappingDialog::UpdateString() //------------------------------------- { - SetDlgItemText(IDC_EDIT1, m_Setting.ToString()); + SetDlgItemText(IDC_EDIT1, m_Setting.ToString().c_str()); } @@ -323,7 +323,7 @@ { CString str; str.Preallocate(100); - str = s.ToString(); + str = s.ToString().c_str(); const BYTE plugindex = s.GetPlugIndex(); //Short ID name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-24 20:58:18
|
Revision: 1968 http://sourceforge.net/p/modplug/code/1968 Author: saga-games Date: 2013-04-24 20:58:10 +0000 (Wed, 24 Apr 2013) Log Message: ----------- [Fix] VST: Changing MIDI focus to a plugin editor only worked right after focussing the editor for the first time. Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/AbstractVstEditor.h Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2013-04-24 17:46:45 UTC (rev 1967) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2013-04-24 20:58:10 UTC (rev 1968) @@ -29,7 +29,7 @@ ON_WM_CLOSE() ON_WM_INITMENU() ON_WM_MENUSELECT() - ON_WM_SETFOCUS() + ON_WM_ACTIVATE() ON_COMMAND(ID_EDIT_COPY, OnCopyParameters) ON_COMMAND(ID_EDIT_PASTE, OnPasteParameters) ON_COMMAND(ID_PRESET_LOAD, OnLoadPreset) @@ -88,10 +88,10 @@ } -void CAbstractVstEditor::OnSetFocus(CWnd *oldWnd) -//----------------------------------------------- +void CAbstractVstEditor::OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized) +//-------------------------------------------------------------------------------- { - CDialog::OnSetFocus(oldWnd); + CDialog::OnActivate(nState, pWndOther, bMinimized); CMainFrame::GetMainFrame()->SetMidiRecordWnd(GetSafeHwnd()); } Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.h =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.h 2013-04-24 17:46:45 UTC (rev 1967) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.h 2013-04-24 20:58:10 UTC (rev 1968) @@ -65,7 +65,7 @@ virtual void DoClose() = 0; virtual void UpdateParamDisplays() = 0; virtual afx_msg void OnClose() = 0; - void OnSetFocus(CWnd *oldWnd); + virtual void OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized); virtual bool IsResizable() const = 0; virtual bool SetSize(int contentWidth, int contentHeight) = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-26 17:13:53
|
Revision: 1974 http://sourceforge.net/p/modplug/code/1974 Author: saga-games Date: 2013-04-26 17:13:44 +0000 (Fri, 26 Apr 2013) Log Message: ----------- [Fix] Rearrange instruments was broken... again (broke in OpenMPT 1.22 although I have no idea why it was still working in OpenMPT 1.21). Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Modedit.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-25 22:35:51 UTC (rev 1973) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-04-26 17:13:44 UTC (rev 1974) @@ -345,17 +345,18 @@ struct OrigPatSettings { - bool isPatUsed; // Is pattern used in sequence? - PATTERNINDEX newIndex; // map old pattern index <-> new pattern index // This stuff is needed for copying the old pattern properties to the new pattern number + CString name; // original pattern name ModCommand *data; // original pattern data ROWINDEX numRows; // original pattern sizes ROWINDEX rowsPerBeat; // original pattern highlight ROWINDEX rowsPerMeasure; // original pattern highlight - CString name; // original pattern name + + PATTERNINDEX newIndex; // map old pattern index <-> new pattern index + bool isPatUsed; // Is pattern used in sequence? }; -const OrigPatSettings defaultSettings = { false, 0, nullptr, 0, 0, 0, "" }; +const OrigPatSettings defaultSettings = { "", nullptr, 0, 0, 0, 0, false }; // Remove unused patterns / rearrange patterns // If argument bRemove is true, unused patterns are removed. Else, patterns are only rearranged. Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2013-04-25 22:35:51 UTC (rev 1973) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2013-04-26 17:13:44 UTC (rev 1974) @@ -394,7 +394,6 @@ CriticalSection cs; const INSTRUMENTINDEX oldNumInstruments = m_SndFile.GetNumInstruments(), newNumInstruments = static_cast<INSTRUMENTINDEX>(newOrder.size()); - m_SndFile.m_nInstruments = static_cast<INSTRUMENTINDEX>(newOrder.size()); vector<ModInstrument> instrumentHeaders(oldNumInstruments + 1); vector<INSTRUMENTINDEX> newIndex(oldNumInstruments + 1, 0); // One of the new indexes for the old instrument @@ -418,6 +417,8 @@ } } + m_SndFile.m_nInstruments = newNumInstruments; + // Now, create new instrument list. for(INSTRUMENTINDEX i = 0; i < newNumInstruments; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-06-02 11:35:21
|
Revision: 2281 http://sourceforge.net/p/modplug/code/2281 Author: manxorist Date: 2013-06-02 11:35:16 +0000 (Sun, 02 Jun 2013) Log Message: ----------- [Fix] There were files missing in r2280. Revision Links: -------------- http://sourceforge.net/p/modplug/code/2280 Added Paths: ----------- trunk/OpenMPT/mptrack/MPTrackUtil.cpp trunk/OpenMPT/mptrack/MPTrackUtil.h Copied: trunk/OpenMPT/mptrack/MPTrackUtil.cpp (from rev 2277, trunk/OpenMPT/common/misc_util.cpp) =================================================================== --- trunk/OpenMPT/mptrack/MPTrackUtil.cpp (rev 0) +++ trunk/OpenMPT/mptrack/MPTrackUtil.cpp 2013-06-02 11:35:16 UTC (rev 2281) @@ -0,0 +1,77 @@ +/* + * MPTrackUtil.cpp + * --------------- + * Purpose: Various useful utility functions. + * Notes : (currently none) + * 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 <io.h> // for _taccess +#include <time.h> + + +/* + * Loads resource. + * [in] lpName and lpType: parameters passed to FindResource(). + * [out] pData: Pointer to loaded resource data, nullptr if load not successful. + * [out] nSize: Size of the data in bytes, zero if load not succesfull. + * [out] hglob: HGLOBAL returned by LoadResource-function. + * Return: pData. + */ +LPCCH LoadResource(LPCTSTR lpName, LPCTSTR lpType, LPCCH& pData, size_t& nSize, HGLOBAL& hglob) +//--------------------------------------------------------------------------------------------- +{ + pData = nullptr; + nSize = 0; + hglob = nullptr; + HINSTANCE hInstance = AfxGetInstanceHandle(); + HRSRC hrsrc = FindResource(hInstance, lpName, lpType); + if (hrsrc != NULL) + { + hglob = LoadResource(hInstance, hrsrc); + if (hglob != NULL) + { + pData = reinterpret_cast<const char*>(LockResource(hglob)); + nSize = SizeofResource(hInstance, hrsrc); + } + } + return pData; +} + + +// Returns WinAPI error message corresponding to error code returned by GetLastError(). +std::string GetErrorMessage(DWORD nErrorCode) +//------------------------------------------- +{ + LPVOID lpMsgBuf; + + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + nErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&lpMsgBuf, + 0, + NULL ); + + std::string msg = (LPTSTR)lpMsgBuf; + LocalFree(lpMsgBuf); + + return msg; +} + + +time_t Util::sdTime::MakeGmTime(tm& timeUtc) +{ + return _mkgmtime(&timeUtc); +} + + +bool Util::sdOs::IsPathFileAvailable(LPCTSTR pszFilePath, FileMode fm) +{ + return (_taccess(pszFilePath, fm) == 0); +} Copied: trunk/OpenMPT/mptrack/MPTrackUtil.h (from rev 2277, trunk/OpenMPT/common/misc_util.h) =================================================================== --- trunk/OpenMPT/mptrack/MPTrackUtil.h (rev 0) +++ trunk/OpenMPT/mptrack/MPTrackUtil.h 2013-06-02 11:35:16 UTC (rev 2281) @@ -0,0 +1,36 @@ +/* + * MPTrackUtil.h + * ------------- + * Purpose: Various useful utility functions. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + + +#include <string> +#include <time.h> + + +LPCCH LoadResource(LPCTSTR lpName, LPCTSTR lpType, LPCCH& pData, size_t& nSize, HGLOBAL& hglob); + +std::string GetErrorMessage(DWORD nErrorCode); + +namespace Util { namespace sdTime +{ + + time_t MakeGmTime(tm& timeUtc); + +}} // namespace Util::sdTime + +namespace Util { namespace sdOs +{ + /// Checks whether file or folder exists and whether it has the given mode. + enum FileMode {FileModeExists = 0, FileModeRead = 4, FileModeWrite = 2, FileModeReadWrite = 6}; + bool IsPathFileAvailable(LPCTSTR pszFilePath, FileMode fm); + +}} // namespace Util::sdOs + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-06-03 21:32:53
|
Revision: 2302 http://sourceforge.net/p/modplug/code/2302 Author: manxorist Date: 2013-06-03 21:32:46 +0000 (Mon, 03 Jun 2013) Log Message: ----------- [Ref] Silence type truncation warning in mod2midi.cpp. It's safe there. [Ref] TrackerSettings::gnPlugWindowLast should be signed. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/mod2midi.cpp Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-06-03 21:09:39 UTC (rev 2301) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-06-03 21:32:46 UTC (rev 2302) @@ -292,7 +292,7 @@ gnPlugWindowY = GetPrivateProfileInt("Display", "PlugSelectWindowY", gnPlugWindowY, iniFile); gnPlugWindowWidth = GetPrivateProfileInt("Display", "PlugSelectWindowWidth", gnPlugWindowWidth, iniFile); gnPlugWindowHeight = GetPrivateProfileInt("Display", "PlugSelectWindowHeight", gnPlugWindowHeight, iniFile); - gnPlugWindowLast = CMainFrame::GetPrivateProfileDWord("Display", "PlugSelectWindowLast", gnPlugWindowLast, iniFile); + gnPlugWindowLast = CMainFrame::GetPrivateProfileLong("Display", "PlugSelectWindowLast", gnPlugWindowLast, iniFile); gnMsgBoxVisiblityFlags = CMainFrame::GetPrivateProfileDWord("Display", "MsgBoxVisibilityFlags", gnMsgBoxVisiblityFlags, iniFile); VuMeterUpdateInterval = CMainFrame::GetPrivateProfileDWord("Display", "VuMeterUpdateInterval", VuMeterUpdateInterval, iniFile); Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2013-06-03 21:09:39 UTC (rev 2301) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2013-06-03 21:32:46 UTC (rev 2302) @@ -244,7 +244,7 @@ int gnPlugWindowY; int gnPlugWindowWidth; int gnPlugWindowHeight; - DWORD gnPlugWindowLast; // Last selected plugin ID + int32 gnPlugWindowLast; // Last selected plugin ID public: Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2013-06-03 21:09:39 UTC (rev 2301) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2013-06-03 21:32:46 UTC (rev 2302) @@ -501,7 +501,7 @@ tmp[len] = static_cast<BYTE>(0x90|pTrk->nMidiChannel); tmp[len+1] = (pTrk->nMidiChannel==9) ? static_cast<BYTE>(pTrk->nMidiProgram) : static_cast<BYTE>(note); UINT vol = 0x7f; - UINT nsmp = pTrk->nInstrument; + SAMPLEINDEX nsmp = static_cast<SAMPLEINDEX>(pTrk->nInstrument); if (m_pSndFile->GetNumInstruments()) { if ((nsmp <= m_pSndFile->GetNumInstruments()) && (m_pSndFile->Instruments[nsmp])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |