From: <sag...@us...> - 2010-10-12 20:17:46
|
Revision: 737 http://modplug.svn.sourceforge.net/modplug/?rev=737&view=rev Author: saga-games Date: 2010-10-12 20:17:40 +0000 (Tue, 12 Oct 2010) Log Message: ----------- [New] Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. [Mod] OpenMPT: Version is now 1.19.00.07 Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/version.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:17:40 UTC (rev 737) @@ -462,8 +462,10 @@ m_dwPatternSetup |= PATTERN_NOTEFADE; if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,03,01)) m_dwPatternSetup |= PATTERN_RESETCHANNELS; - if(vIniVersion < MAKE_VERSION_NUMERIC(1,19,00,00)) - m_dwPatternSetup &= ~(0x800|0x200000|0x400000); // various deprecated old options + if(vIniVersion < MAKE_VERSION_NUMERIC(1,19,00,07)) + m_dwPatternSetup &= ~0x800; // this was previously deprecated and is now used for something else + if(vIniVersion < MPT_VERSION_NUMERIC) + m_dwPatternSetup &= ~(0x200000|0x400000); // various deprecated old options m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile); m_nRowSpacing2 = GetPrivateProfileDWord("Pattern Editor", "RowSpacing2", 4, iniFile); @@ -600,9 +602,9 @@ RegQueryValueEx(key, "MidiSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwMidiSetup, &dwDWORDSize); RegQueryValueEx(key, "MidiDevice", NULL, &dwREG_DWORD, (LPBYTE)&m_nMidiDevice, &dwDWORDSize); RegQueryValueEx(key, "PatternSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwPatternSetup, &dwDWORDSize); + m_dwPatternSetup &= ~(0x800|0x200000|0x400000); // various deprecated old options m_dwPatternSetup |= PATTERN_NOTEFADE; // Set flag to maintain old behaviour (was changed in 1.17.02.50). m_dwPatternSetup |= PATTERN_RESETCHANNELS; // Set flag to reset channels on loop was changed in 1.17.03.01). - m_dwPatternSetup &= ~0x800; // quick paste autorepeat is now a keymap option RegQueryValueEx(key, "RowSpacing", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing, &dwDWORDSize); RegQueryValueEx(key, "RowSpacing2", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing2, &dwDWORDSize); RegQueryValueEx(key, "LoopSong", NULL, &dwREG_DWORD, (LPBYTE)&gbLoopSong, &dwDWORDSize); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:17:40 UTC (rev 737) @@ -173,7 +173,7 @@ #define PATTERN_FLATBUTTONS 0x100 // flat toolbar buttons #define PATTERN_CREATEBACKUP 0x200 // create .bak files when saving #define PATTERN_SINGLEEXPAND 0x400 // single click to expand tree -//#define PATTERN_AUTOSPACEBAR 0x800 // space bar repeats previous action - DOES NOT EXIST ANYMORE, use "on key hold" instead +#define PATTERN_PLAYEDITROW 0x800 // play all notes on the current row while entering notes #define PATTERN_NOEXTRALOUD 0x1000 // no loud samples in sample editor #define PATTERN_DRAGNDROPEDIT 0x2000 // enable drag and drop editing #define PATTERN_2NDHIGHLIGHT 0x4000 // activate secondary highlight Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-12 20:17:40 UTC (rev 737) @@ -556,6 +556,7 @@ enum { OPTGEN_PLAYNEWNOTES=0, + OPTGEN_PLAYEDITROW, OPTGEN_CENTERROW, OPTGEN_LARGECOMMENTSFONT, OPTGEN_HEXROWDISP, @@ -586,6 +587,7 @@ static OPTGENDESC gOptGenDesc[OPTGEN_MAXOPTIONS] = { {PATTERN_PLAYNEWNOTE, "Play new notes while recording", "When this option is enabled, notes entered in the pattern editor will always be played (If not checked, notes won't be played in record mode)."}, + {PATTERN_PLAYEDITROW, "Play whole row while recording", "When this option is enabled, all notes on the current row are played when entering notes in the pattern editor."}, {PATTERN_CENTERROW, "Always center active row", "Turn on this option to have the active row always centered in the pattern editor (requires \"Always center active row\")."}, {PATTERN_LARGECOMMENTS, "Use large font for comments", "With this option enabled, the song message editor will use a larger font."}, {PATTERN_HEXDISPLAY, "Display rows in hex", "With this option enabled, row numbers and sequence numbers will be displayed in hexadecimal."}, Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-12 20:17:40 UTC (rev 737) @@ -2002,6 +2002,13 @@ void CViewPattern::OnPatternStep() //-------------------------------- { + PatternStep(true); +} + + +void CViewPattern::PatternStep(bool autoStep) +//--------------------------------------------- +{ CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -2025,10 +2032,13 @@ pMainFrm->PlayMod(pModDoc, m_hWnd, MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); } CMainFrame::EnableLowLatencyMode(); - if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) - SetCurrentRow(GetCurrentRow()+1, TRUE); - else - SetCurrentRow((GetCurrentRow()+1) % pSndFile->Patterns[m_nPattern].GetNumRows(), FALSE); + if(autoStep) + { + if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) + SetCurrentRow(GetCurrentRow() + 1, TRUE); + else + SetCurrentRow((GetCurrentRow() + 1) % pSndFile->Patterns[m_nPattern].GetNumRows(), FALSE); + } SetFocus(); } } @@ -4109,7 +4119,7 @@ } void CViewPattern::TempEnterIns(int val) -//--------------------------------------------- +//-------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -4205,7 +4215,7 @@ BYTE recordGroup = pModDoc->IsChannelRecord(nChn); UINT nPlayIns = 0; const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile); - const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY)); + const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY) && !(pSndFile->m_dwSongFlags & SONG_STEP)); //Param control 'note' if(MODCOMMAND::IsPcNote(note) && bRecordEnabled) { @@ -4370,38 +4380,48 @@ } // -- play note - if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYNEWNOTE) || (bRecordEnabled == false)) + if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (bRecordEnabled == false)) { - if (p->instr) nPlayIns = p->instr; - - else if ((!p->instr) && (p->note < 128)) + if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord) { - MODCOMMAND *search = p; - UINT srow = nRow; - while (srow > 0) + // play the whole row + PatternStep(false); + } else + { + // just play the newly inserted note... + if (p->instr) { - srow--; - search -= pSndFile->m_nChannels; - if (search->instr) + // ...using the already specified instrument + nPlayIns = p->instr; + } else if ((!p->instr) && (p->note <= NOTE_MAX)) + { + // ...or one that can be found on a previous row of this pattern. + MODCOMMAND *search = p; + UINT srow = nRow; + while (srow-- > 0) { - nPlayIns = search->instr; - m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release. - break; + search -= pSndFile->m_nChannels; + if (search->instr) + { + nPlayIns = search->instr; + m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release. + break; + } } } - } - BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE; - //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args - pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args -/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++) - { - if (chordplaylist[kplchrd]) + BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE; + //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args + pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args +/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++) { - pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args - m_dwStatus |= PATSTATUS_CHORDPLAYING; + if (chordplaylist[kplchrd]) + { + pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args + m_dwStatus |= PATSTATUS_CHORDPLAYING; + } } +*/ } -*/ } //-- if not recording, restore old command. @@ -4433,6 +4453,7 @@ MODCOMMAND* p = &prowbase[nChn]; const MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite + const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile); // -- establish note data //const bool isSplit = HandleSplit(p, note); @@ -4517,34 +4538,45 @@ } // -- play note - if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYNEWNOTE) || (!(IsEditingEnabled()))) + if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!(IsEditingEnabled()))) { - if (p->instr) nPlayIns = p->instr; - - else if ((!p->instr) && (p->note < 128)) + if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord) { - MODCOMMAND *search = p; - UINT srow = m_nRow; - while (srow > 0) + // play the whole row + PatternStep(false); + } else + { + // just play the newly inserted notes... + if (p->instr) { - srow--; - search -= pSndFile->m_nChannels; - if (search->instr) + // ...using the already specified instrument + nPlayIns = p->instr; + } else if ((!p->instr) && (p->note < 128)) + { + // ...or one that can be found on a previous row of this pattern. + MODCOMMAND *search = p; + UINT srow = m_nRow; + while (srow > 0) { - nPlayIns = search->instr; - m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release. - break; + srow--; + search -= pSndFile->m_nChannels; + if (search->instr) + { + nPlayIns = search->instr; + m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release. + break; + } } } - } - BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE; - pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args - for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++) - { - if (chordplaylist[kplchrd]) + BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE; + pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args + for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++) { - pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args - m_dwStatus |= PATSTATUS_CHORDPLAYING; + if (chordplaylist[kplchrd]) + { + pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args + m_dwStatus |= PATSTATUS_CHORDPLAYING; + } } } } // end play note Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/View_pat.h 2010-10-12 20:17:40 UTC (rev 737) @@ -375,8 +375,10 @@ //Like IsEditingEnabled(), but shows some notification when editing is not enabled. bool IsEditingEnabled_bmsg(); - + // Play one pattern row and stop ("step mode") + void PatternStep(bool autoStep); + public: afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); private: Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2010-10-12 20:13:10 UTC (rev 736) +++ trunk/OpenMPT/mptrack/version.h 2010-10-12 20:17:40 UTC (rev 737) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 06 +#define VER_MINORMINOR 07 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |