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. |