From: <pst...@us...> - 2009-01-01 03:22:52
|
Revision: 673 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=673&view=rev Author: pstieber Date: 2009-01-01 03:22:49 +0000 (Thu, 01 Jan 2009) Log Message: ----------- Updated to use the new filter accessor and mutator function. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/PianoWindow.cpp Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-01-01 03:20:32 UTC (rev 672) +++ trunk/jazz/src/Command.cpp 2009-01-01 03:22:49 UTC (rev 673) @@ -40,7 +40,7 @@ //----------------------------------------------------------------------------- tCommand::tCommand(JZFilter* pFilter) : mpFilter(pFilter), - mpSong(pFilter->mpSong), + mpSong(pFilter->GetSong()), mReverse(false) { } @@ -75,7 +75,8 @@ void tCommand::ExecuteTrack(JZTrack* pTrack) { tEventIterator Iterator(pTrack); - JZEvent* pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + JZEvent* pEvent = + Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); while (pEvent) { if (mpFilter->IsSelected(pEvent)) @@ -97,8 +98,8 @@ //----------------------------------------------------------------------------- int tCommand::Interpolate(int Clock, int vmin, int vmax) { - int ClockMin = mpFilter->FromClock; - int ClockMax = mpFilter->ToClock; + int ClockMin = mpFilter->GetFromClock(); + int ClockMax = mpFilter->GetToClock(); return (Clock - ClockMin) * (vmax - vmin) / (ClockMax - ClockMin) + vmin; } @@ -319,10 +320,10 @@ tCommand::Execute(NewUndo); if (!LeaveSpace) { - JZFilter Filter(mpFilter); - Filter.FromClock = mpFilter->ToClock; - Filter.ToClock = mpSong->GetLastClock() + 1; - long DeltaClock = mpFilter->FromClock - mpFilter->ToClock; + JZFilter Filter(*mpFilter); + Filter.SetFromClock(mpFilter->GetToClock()); + Filter.SetToClock(mpSong->GetLastClock() + 1); + long DeltaClock = mpFilter->GetFromClock() - mpFilter->GetToClock(); tCmdShift shift(&Filter, DeltaClock); shift.Execute(0); } @@ -584,11 +585,14 @@ void tCmdConvertToModulation::ExecuteTrack(JZTrack* pTrack) { - //JAVE:iterate over all events, make a long event from start until stop of the sequence, - //convert all note-on messages to a pitch bend/volume controller pair, velocity -> volume - //make a volume off controller at the end of the current event + // JAVE: + // Iterate over all events, make a long event from start until stop of the + // sequence, convert all note-on messages to a pitch bend/volume controller + // pair, velocity -> volume make a volume off controller at the end of the + // current event. tEventIterator Iterator(pTrack); - JZEvent* pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + JZEvent* pEvent = + Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); long startclock=-1; long endclock=-1; unsigned char channel=0; @@ -810,10 +814,11 @@ InsertSpace = 0; // no RepeatClock = -1; // -1L - mReverse = DestTrack > mpFilter->FromTrack; + mReverse = DestTrack > mpFilter->GetFromTrack(); if (mReverse) { - DestTrack += mpFilter->ToTrack - mpFilter->FromTrack; // ToTrack inclusive + // ToTrack inclusive. + DestTrack += mpFilter->GetToTrack() - mpFilter->GetFromTrack(); } } @@ -827,7 +832,7 @@ StartClock = DestClock; if (RepeatClock < 0) - StopClock = StartClock + mpFilter->ToClock - mpFilter->FromClock; + StopClock = StartClock + mpFilter->GetToClock() - mpFilter->GetFromClock(); else StopClock = RepeatClock; @@ -852,8 +857,9 @@ tEventArray tmp; { tEventIterator Iterator(s); - long DeltaClock = StartClock - mpFilter->FromClock; - JZEvent* pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + long DeltaClock = StartClock - mpFilter->GetFromClock(); + JZEvent* pEvent = + Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); while (pEvent) { long NewClock = pEvent->GetClock() + DeltaClock; @@ -871,7 +877,7 @@ if (!pEvent) { pEvent = Iterator.First(); - DeltaClock += mpFilter->ToClock - mpFilter->FromClock; + DeltaClock += mpFilter->GetToClock() - mpFilter->GetFromClock(); } } } @@ -902,7 +908,7 @@ if (EraseSource) { tEventIterator Iterator(s); - JZEvent* pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + JZEvent* pEvent = Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); while (pEvent) { if (mpFilter->IsSelected(pEvent)) @@ -953,7 +959,7 @@ { tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy(); pKeyOn->SetClock( - mpFilter->FromClock + mpFilter->ToClock - pKeyOn->GetClock()); + mpFilter->GetFromClock() + mpFilter->GetToClock() - pKeyOn->GetClock()); pTrack->Kill(pEvent); pTrack->Put(pKeyOn); } @@ -983,7 +989,8 @@ } tEventIterator Iterator(pTrack); - pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + pEvent = + Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); while (pEvent) { if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn()) @@ -996,7 +1003,8 @@ // reverse Key's - pEvent = Iterator.Range(mpFilter->FromClock, mpFilter->ToClock); + pEvent = + Iterator.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); while (pEvent) { if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn()) @@ -1047,7 +1055,7 @@ mRandomArray(RandomArray) { mpBarInfo = new JZBarInfo(*mpSong); - mpBarInfo->SetClock(mpFilter->FromClock); + mpBarInfo->SetClock(mpFilter->GetFromClock()); mStartBar = mpBarInfo->GetBarIndex(); } Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2009-01-01 03:20:32 UTC (rev 672) +++ trunk/jazz/src/ControlEdit.cpp 2009-01-01 03:22:49 UTC (rev 673) @@ -523,8 +523,8 @@ { return ( mpPianoWindow->GetFilter()->IsSelected(pEvent) && - (pEvent->GetClock() >= mpPianoWindow->GetFilter()->FromClock && - pEvent->GetClock() <= mpPianoWindow->GetFilter()->ToClock)); + (pEvent->GetClock() >= mpPianoWindow->GetFilter()->GetFromClock() && + pEvent->GetClock() <= mpPianoWindow->GetFilter()->GetToClock())); } } return 0; @@ -546,8 +546,8 @@ if (mpPianoWindow->mpSnapSel->IsSelected()) { - from_clk = mpPianoWindow->GetFilter()->FromClock; - to_clk = mpPianoWindow->GetFilter()->ToClock; + from_clk = mpPianoWindow->GetFilter()->GetFromClock(); + to_clk = mpPianoWindow->GetFilter()->GetToClock(); } else { @@ -624,8 +624,8 @@ { return ( mpPianoWindow->GetFilter()->IsSelected(pEvent) && - (pEvent->GetClock() >= mpPianoWindow->GetFilter()->FromClock && - pEvent->GetClock() <= mpPianoWindow->GetFilter()->ToClock)); + (pEvent->GetClock() >= mpPianoWindow->GetFilter()->GetFromClock() && + pEvent->GetClock() <= mpPianoWindow->GetFilter()->GetToClock())); } } return 0; @@ -661,8 +661,8 @@ if (mpPianoWindow->mpSnapSel->IsSelected()) { - from_clk = mpPianoWindow->GetFilter()->FromClock; - to_clk = mpPianoWindow->GetFilter()->ToClock; + from_clk = mpPianoWindow->GetFilter()->GetFromClock(); + to_clk = mpPianoWindow->GetFilter()->GetToClock(); } else { Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-01-01 03:20:32 UTC (rev 672) +++ trunk/jazz/src/Dialogs.cpp 2009-01-01 03:22:49 UTC (rev 673) @@ -58,7 +58,7 @@ mSteps(0), mUnit(unit), mpFilter(pFilter), - mpSong(pFilter->mpSong) + mpSong(pFilter->GetSong()) { } @@ -108,7 +108,7 @@ : tPropertyListDlg( "Clean up events" ) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -188,7 +188,7 @@ : tPropertyListDlg("Search and replace controller types" ) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } bool tSearchReplaceDlg::OnClose() @@ -236,7 +236,7 @@ : tPropertyListDlg("Transpose") { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -285,7 +285,7 @@ : tPropertyListDlg("Set MIDI Channel") { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -336,7 +336,7 @@ : tPropertyListDlg( "Velocity" ) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -387,7 +387,7 @@ : tPropertyListDlg("Length") { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -447,7 +447,7 @@ : tPropertyListDlg("stretch/contract by scale from start of selected sequence" ) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -490,7 +490,7 @@ : tPropertyListDlg("MIDI delay line" ) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } @@ -640,7 +640,7 @@ //, Steps("steps", gQntSteps, &gQntStep) { Filter = f; - Song = f->mpSong; + Song = f->GetSong(); } Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp =================================================================== --- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2009-01-01 03:20:32 UTC (rev 672) +++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2009-01-01 03:22:49 UTC (rev 673) @@ -55,8 +55,8 @@ Exit(); // cleanup from previous run mpFilter = pFilter; - start_clock = pFilter->FromClock; - stop_clock = pFilter->ToClock; + start_clock = pFilter->GetFromClock(); + stop_clock = pFilter->GetToClock(); eighths_per_chord = epc; if (eighths_per_chord == 0) @@ -65,7 +65,7 @@ } else { - JZBarInfo BarInfo(*mpFilter->mpSong); + JZBarInfo BarInfo(*mpFilter->GetSong()); BarInfo.SetClock(start_clock); int start_bar = BarInfo.GetBarIndex(); BarInfo.SetClock(stop_clock); @@ -117,7 +117,7 @@ int HBAnalyzer::Transpose(JZFilter* pFilter, int qbc) { - pFilter->mpSong->NewUndoBuffer(); + pFilter->GetSong()->NewUndoBuffer(); Init(pFilter, qbc); IterateEvents(&HBAnalyzer::CountEvent); GenerateMapping(); @@ -135,15 +135,16 @@ if (!t->IsDrumTrack()) { tEventIterator Events(t); - JZEvent *e = Events.Range(mpFilter->FromClock, mpFilter->ToClock); - while (e) + JZEvent* pEvent = + Events.Range(mpFilter->GetFromClock(), mpFilter->GetToClock()); + while (pEvent) { - tKeyOn* pKeyOn = e->IsKeyOn(); + tKeyOn* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) { (this->*Action)(pKeyOn, t); } - e = Events.Next(); + pEvent = Events.Next(); } t->Cleanup(); } @@ -154,8 +155,8 @@ int HBAnalyzer::Step2Clock(int step) { - int fr = mpFilter->FromClock; - int to = mpFilter->ToClock; + int fr = mpFilter->GetFromClock(); + int to = mpFilter->GetToClock(); return (step * (to - fr)) / mSteps + fr; } Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-01-01 03:20:32 UTC (rev 672) +++ trunk/jazz/src/PianoWindow.cpp 2009-01-01 03:22:49 UTC (rev 673) @@ -1658,8 +1658,8 @@ { if (mpSnapSel->IsSelected()) { - Clock = mpFilter->FromClock; - LoopClock = mpFilter->ToClock; + Clock = mpFilter->GetFromClock(); + LoopClock = mpFilter->GetToClock(); } else { @@ -1828,46 +1828,32 @@ mpSnapSel->GetRectangle().y + mpSnapSel->GetRectangle().height - 1); int to = y2Pitch(mpSnapSel->GetRectangle().y + 1); - mpFilter->FltEvents[FltKeyOn].Selected = mVisibleKeyOn; - mpFilter->FltEvents[FltKeyOn].FromValue = fr; - mpFilter->FltEvents[FltKeyOn].ToValue = to; + mpFilter->SetFilterEvent(eFilterKeyOn, mVisibleKeyOn, fr, to); - mpFilter->FltEvents[FltPitch].Selected = mVisiblePitch; - mpFilter->FltEvents[FltPitch].FromValue = (fr << 7) - 8192; - mpFilter->FltEvents[FltPitch].ToValue = ((to + 1) << 7) - 8192; + mpFilter->SetFilterEvent( + eFilterPitch, + mVisiblePitch, + (fr << 7) - 8192, + ((to + 1) << 7) - 8192); - mpFilter->FltEvents[FltControl].Selected = mVisibleController; - mpFilter->FltEvents[FltControl].FromValue = fr; - mpFilter->FltEvents[FltControl].ToValue = to; + mpFilter->SetFilterEvent(eFilterControl, mVisibleController, fr, to); - mpFilter->FltEvents[FltProgram].Selected = mVisibleProgram; - mpFilter->FltEvents[FltProgram].FromValue = fr; - mpFilter->FltEvents[FltProgram].ToValue = to; + mpFilter->SetFilterEvent(eFilterProgram, mVisibleProgram, fr, to); - mpFilter->FltEvents[FltTempo].Selected = mVisibleTempo; - mpFilter->FltEvents[FltTempo].FromValue = fr; - mpFilter->FltEvents[FltTempo].ToValue = to; + mpFilter->SetFilterEvent(eFilterKeyPressure, mVisibleKeyOn, fr, to); - mpFilter->FltEvents[FltSysEx].Selected = mVisibleSysex; - mpFilter->FltEvents[FltSysEx].FromValue = fr; - mpFilter->FltEvents[FltSysEx].ToValue = to; + mpFilter->SetFilterMeter(mVisibleTempo); - // SN++ Aftertouch (gehoeren to KeyOn Events). - mpFilter->FltEvents[FltKeyPressure].Selected = mVisibleKeyOn; - mpFilter->FltEvents[FltKeyPressure].FromValue = fr; - mpFilter->FltEvents[FltKeyPressure].ToValue = to; + mpFilter->SetFilterChannelAftertouch(mVisibleMono); - // SN++ Channel Aftertouch - mpFilter->FltEvents[FltChnPressure].Selected = mVisibleMono; - mpFilter->FltEvents[FltChnPressure].FromValue = fr; - mpFilter->FltEvents[FltChnPressure].ToValue = to; + mpFilter->SetFilterSysEx(mVisibleSysex); - - mpFilter->FromTrack = mTrackIndex; - mpFilter->ToTrack = mTrackIndex; - mpFilter->FromClock = SnapClock(x2Clock(mpSnapSel->GetRectangle().x + 1)); - mpFilter->ToClock = SnapClock(x2Clock( - mpSnapSel->GetRectangle().x + mpSnapSel->GetRectangle().width + 1)); + mpFilter->SetFromTrack(mTrackIndex); + mpFilter->SetToTrack(mTrackIndex); + mpFilter->SetFromClock( + SnapClock(x2Clock(mpSnapSel->GetRectangle().x + 1))); + mpFilter->SetToClock(SnapClock(x2Clock( + mpSnapSel->GetRectangle().x + mpSnapSel->GetRectangle().width + 1))); } // SN++ Veloc- oder Aftertouch-Editor updaten @@ -2836,7 +2822,7 @@ { mPasteBuffer.Clear(); tCmdCopyToBuffer cmd(mpFilter, &mPasteBuffer); - mpFilter->OtherSelected = mVisibleTempo; + mpFilter->SetOtherSelected(mVisibleTempo); cmd.Execute(0); // no UNDO if (Id == wxID_CUT) { @@ -2844,7 +2830,7 @@ cmd.Execute(1); // with UNDO Refresh(); } - mpFilter->OtherSelected = 0; + mpFilter->SetOtherSelected(false); //OLD if (mpGuitarFrame) //OLD { //OLD mpGuitarFrame->Update(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |