You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(58) |
Apr
(100) |
May
(92) |
Jun
(12) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(26) |
Dec
(29) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(31) |
Feb
(20) |
Mar
(1) |
Apr
|
May
(5) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(36) |
May
(10) |
Jun
|
Jul
(38) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(56) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(13) |
Dec
(2) |
2013 |
Jan
(30) |
Feb
|
Mar
(43) |
Apr
(28) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(10) |
Nov
(2) |
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pst...@us...> - 2013-04-07 23:54:37
|
Revision: 1018 http://sourceforge.net/p/jazzplusplus/code/1018 Author: pstieber Date: 2013-04-07 23:54:34 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Fixed reading of voice, drum set, and drum names. Modified Paths: -------------- trunk/jazz/src/Configuration.cpp Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2013-04-07 23:43:22 UTC (rev 1017) +++ trunk/jazz/src/Configuration.cpp 2013-04-07 23:54:34 UTC (rev 1018) @@ -863,10 +863,11 @@ mVoiceNames[VoiceIndex + 1].second = Value + 1; - string VoiceName = - TNStringUtilities::TrimLeadingAndTrailingBlanks(Iss.str()); + string VoiceName; + getline(Iss, VoiceName); - mVoiceNames[VoiceIndex + 1].first = VoiceName; + mVoiceNames[VoiceIndex + 1].first = + TNStringUtilities::TrimLeadingAndTrailingBlanks(VoiceName); ++VoiceIndex; } @@ -903,13 +904,11 @@ mDrumSets[DrumsetIndex + 1].second = Value + 1; string SetName; - Iss >> SetName; + getline(Iss, SetName); - string DrumSetName = - TNStringUtilities::TrimLeadingAndTrailingBlanks(Iss.str()); + mDrumSets[DrumsetIndex + 1].first = + TNStringUtilities::TrimLeadingAndTrailingBlanks(SetName); - mDrumSets[DrumsetIndex + 1].first = DrumSetName; - ++DrumsetIndex; } else @@ -941,10 +940,11 @@ Iss >> i; assert(0 <= i && i <= 127); - string DrumName = - TNStringUtilities::TrimLeadingAndTrailingBlanks(Iss.str()); + string DrumName; + getline(Iss, DrumName); - mDrumNames[i + 1].first = DrumName; + mDrumNames[i + 1].first = + TNStringUtilities::TrimLeadingAndTrailingBlanks(DrumName); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 23:43:24
|
Revision: 1017 http://sourceforge.net/p/jazzplusplus/code/1017 Author: pstieber Date: 2013-04-07 23:43:22 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added new source modules. Modified Paths: -------------- trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj.filters Modified: trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj =================================================================== --- trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj 2013-04-07 22:14:21 UTC (rev 1016) +++ trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj 2013-04-07 23:43:22 UTC (rev 1017) @@ -287,6 +287,7 @@ </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\src\AboutDialog.cpp" /> + <ClCompile Include="..\src\ArrayControl.cpp" /> <ClCompile Include="..\src\AsciiMidiFile.cpp" /> <ClCompile Include="..\src\Audio.cpp" /> <ClCompile Include="..\src\ClockDialog.cpp"> @@ -346,6 +347,7 @@ <ClCompile Include="..\src\RecordingInfo.cpp" /> <ClCompile Include="..\src\Rectangle.cpp" /> <ClCompile Include="..\src\Rhythm.cpp" /> + <ClCompile Include="..\src\RhythmArrayControl.cpp" /> <ClCompile Include="..\src\Sample.cpp" /> <ClCompile Include="..\src\SampleCommand.cpp" /> <ClCompile Include="..\src\SampleDialog.cpp" /> @@ -395,6 +397,7 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\src\AboutDialog.h" /> + <ClInclude Include="..\src\ArrayControl.h" /> <ClInclude Include="..\src\AsciiMidiFile.h" /> <ClInclude Include="..\src\Audio.h" /> <CustomBuildStep Include="..\src\ClockDialog.h"> @@ -456,6 +459,7 @@ <ClInclude Include="..\src\Rectangle.h" /> <ClInclude Include="..\src\Resources.h" /> <ClInclude Include="..\src\Rhythm.h" /> + <ClInclude Include="..\src\RhythmArrayControl.h" /> <ClInclude Include="..\src\Sample.h" /> <ClInclude Include="..\src\SampleCommand.h" /> <ClInclude Include="..\src\SampleDialog.h" /> Modified: trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj.filters =================================================================== --- trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj.filters 2013-04-07 22:14:21 UTC (rev 1016) +++ trunk/jazz/vc11/JazzPlusPlus-VC11.vcxproj.filters 2013-04-07 23:43:22 UTC (rev 1017) @@ -156,6 +156,8 @@ <ClCompile Include="..\src\Dialogs\QuantizeDialog.cpp"> <Filter>Dialog Source Files</Filter> </ClCompile> + <ClCompile Include="..\src\ArrayControl.cpp" /> + <ClCompile Include="..\src\RhythmArrayControl.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\src\AsciiMidiFile.h" /> @@ -316,6 +318,8 @@ </ClInclude> <ClInclude Include="..\src\DrumUtilities.h" /> <ClInclude Include="..\src\DrumEnums.h" /> + <ClInclude Include="..\src\ArrayControl.h" /> + <ClInclude Include="..\src\RhythmArrayControl.h" /> </ItemGroup> <ItemGroup> <None Include="..\src\Makefile.am" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 22:14:23
|
Revision: 1016 http://sourceforge.net/p/jazzplusplus/code/1016 Author: pstieber Date: 2013-04-07 22:14:21 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added the new rhythm array control code. Modified Paths: -------------- trunk/jazz/src/Makefile.am trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2013-04-07 22:12:11 UTC (rev 1015) +++ trunk/jazz/src/Makefile.am 2013-04-07 22:14:21 UTC (rev 1016) @@ -89,6 +89,7 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +RhythmArrayControl.cpp \ Sample.cpp \ SampleCommand.cpp \ SampleDialog.cpp \ @@ -191,6 +192,7 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +RhythmArrayControl.cpp \ Sample.cpp \ SampleCommand.cpp \ SampleDialog.cpp \ @@ -297,6 +299,7 @@ Rectangle.h \ Resources.h \ Rhythm.h \ +RhythmArrayControl.h \ Sample.h \ SampleCommand.h \ SampleDialog.h \ Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2013-04-07 22:12:11 UTC (rev 1015) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2013-04-07 22:14:21 UTC (rev 1016) @@ -870,6 +870,14 @@ > </File> <File + RelativePath="..\src\RhythmArrayControl.cpp" + > + </File> + <File + RelativePath="..\src\RhythmArrayControl.h" + > + </File> + <File RelativePath="..\src\Sample.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 22:12:14
|
Revision: 1015 http://sourceforge.net/p/jazzplusplus/code/1015 Author: pstieber Date: 2013-04-07 22:12:11 +0000 (Sun, 07 Apr 2013) Log Message: ----------- 1. Started using the new rhythm array control. 2. Changed long to int in clock code. 3. Removed some c_str calls. 4. Changed ClocksPerStep to GetClocksPerStep. 5. Changed post increment to pre increment. 6. Updated some local variable names. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 22:09:22 UTC (rev 1014) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 22:12:11 UTC (rev 1015) @@ -33,6 +33,7 @@ #include "KeyStringConverters.h" #include "PianoWindow.h" #include "Resources.h" +#include "RhythmArrayControl.h" #include "SelectControllerDialog.h" #include "Song.h" #include "StringReadWrite.h" @@ -114,11 +115,11 @@ } } -// pseudo key nr's for harmony browser and sound effects -static const int MODE_ALL_OF = -1; -static const int MODE_ONE_OF = -2; -static const int MODE_PIANO = -3; -static const int MODE_CONTROL = -4; +// Pseudo key numbers for the harmony browser and sound effects. +static const int MODE_ALL_OF = -1; +static const int MODE_ONE_OF = -2; +static const int MODE_PIANO = -3; +static const int MODE_CONTROL = -4; //***************************************************************************** //***************************************************************************** @@ -218,12 +219,12 @@ Os << mBarCount << ' '; Os << mMode << ' '; Os << mKeyCount << ' '; - for (int i = 0; i < mKeyCount; i++) + for (int i = 0; i < mKeyCount; ++i) { Os << mKeys[i] << ' '; } Os << mParameter << endl; - WriteString(Os, mLabel.c_str()) << endl; + WriteString(Os, mLabel) << endl; Os << mRandomizeFlag << ' '; mRhythmGroups.Write(Os); @@ -259,7 +260,7 @@ string Label; ReadString(Is, Label); - SetLabel(Label.c_str()); + SetLabel(Label); if (Version > 1) { @@ -277,15 +278,16 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZRhythm::Clock2i(long clock, const JZBarInfo& BarInfo) const +int JZRhythm::Clock2i(int Clock, const JZBarInfo& BarInfo) const { - int clocks_per_step = BarInfo.GetTicksPerBar() / (mStepsPerCount * mCountPerBar); - return (int)(((clock - mStartClock) / clocks_per_step) % mRhythmArray.Size()); + return + (int)(((Clock - mStartClock) / + GetClocksPerStep(BarInfo)) % mRhythmArray.Size()); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZRhythm::ClocksPerStep(const JZBarInfo& BarInfo) const +int JZRhythm::GetClocksPerStep(const JZBarInfo& BarInfo) const { return BarInfo.GetTicksPerBar() / (mStepsPerCount * mCountPerBar); } @@ -319,7 +321,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZRhythm::GenerateEvent(JZTrack* pTrack, long clock, short vel, short len) +void JZRhythm::GenerateEvent(JZTrack* pTrack, int Clock, short vel, short len) { int chan = pTrack->mChannel - 1; @@ -328,7 +330,7 @@ { for (int ii = 0; ii < mKeyCount; ii++) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, mKeys[ii], vel, len); + JZKeyOnEvent *k = new JZKeyOnEvent(Clock, chan, mKeys[ii], vel, len); pTrack->Put(k); } } @@ -337,14 +339,14 @@ int ii = (int)(rnd.asDouble() * mKeyCount); if (ii < mKeyCount) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, mKeys[ii], vel, len); + JZKeyOnEvent *k = new JZKeyOnEvent(Clock, chan, mKeys[ii], vel, len); pTrack->Put(k); } } else if (mMode == MODE_CONTROL) { // generate controller - JZControlEvent* c = new JZControlEvent(clock, chan, mParameter - 1, vel); + JZControlEvent* c = new JZControlEvent(Clock, chan, mParameter - 1, vel); pTrack->Put(c); } else @@ -356,17 +358,21 @@ #if 0 //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZRhythm::Generate(JZTrack* pTrack, int FromClock, int ToClock, int TicksPerBar) +void JZRhythm::Generate( + JZTrack* pTrack, + int FromClock, + int ToClock, + int TicksPerBar) { int chan = pTrack->Channel - 1; - long clock = FromClock; + int Clock = FromClock; - long clocks_per_step = TicksPerBar / (mStepsPerCount * mCountPerBar); - long total_steps = (ToClock - FromClock) / clocks_per_step; + int ClocksPerStep = TicksPerBar / (mStepsPerCount * mCountPerBar); + int TotalSteps = (ToClock - FromClock) / ClocksPerStep; - while (clock < ToClock) + while (Clock < ToClock) { - int i = ((clock - FromClock) / clocks_per_step) % mRhythmArray.Size(); + int i = ((Clock - FromClock) / ClocksPerStep) % mRhythmArray.Size(); if (mRhythmArray.Random(i)) { // put event here @@ -381,26 +387,31 @@ rndval = mVelocityArray.Random(); } short vel = rndval * 127 / mVelocityArray.Size() + 1; - short len = (mLengthArray.Random() + 1) * clocks_per_step; + short len = (mLengthArray.Random() + 1) * ClocksPerStep; // generate keys from harmony browser if (key == CHORD_KEY || key == BASS_KEY) { if (gpHarmonyBrowser) { - long step = (clock - FromClock) * total_steps / (ToClock - FromClock); + int Step = (Clock - FromClock) * TotalSteps / (ToClock - FromClock); int Keys[12], KeyCount; if (key == CHORD_KEY) { - KeyCount = gpHarmonyBrowser->GetChordKeys(Keys, (int)step, (int)total_steps); + KeyCount = gpHarmonyBrowser->GetChordKeys(Keys, Step, TotalSteps); } else { - mKeyCount = gpHarmonyBrowser->GetBassKeys(Keys, (int)step, (int)total_steps); + mKeyCount = gpHarmonyBrowser->GetBassKeys(Keys, Step, TotalSteps); } for (int j = 0; j < mKeyCount; j++) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, Keys[j], vel, len - clocks_per_step/2); + JZKeyOnEvent* k = new JZKeyOnEvent( + Clock, + chan, + Keys[j], + vel, + len - ClocksPerStep / 2); pTrack->Put(k); } } @@ -415,7 +426,12 @@ JZKeyOnEvent* pKeyOn = src.Events[ii]->IsKeyOn(); if (pKeyOn) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, pKeyOn->Key, vel, len - clocks_per_step / 2); + JZKeyOnEvent *k = new JZKeyOnEvent( + Clock, + chan, + pKeyOn->Key, + vel, + len - ClocksPerStep / 2); pTrack->Put(k); } } @@ -424,20 +440,24 @@ // generate controller else if (key == CONTROL_KEY) { - JZControlEvent* c = new JZControlEvent(clock, chan, mParameter - 1, vel); + JZControlEvent* c = + new JZControlEvent(Clock, chan, mParameter - 1, vel); pTrack->Put(c); } // generate note on events else { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, key, vel, len - clocks_per_step/2); + JZKeyOnEvent* k = + new JZKeyOnEvent(Clock, chan, key, vel, len - ClocksPerStep / 2); pTrack->Put(k); } - clock += len; + Clock += len; } else - clock += clocks_per_step; + { + Clock += ClocksPerStep; + } } } #endif @@ -453,7 +473,7 @@ { out.Clear(); - int clocks_per_step = ClocksPerStep(BarInfo); + int ClocksPerStep = GetClocksPerStep(BarInfo); for (int RhythmIndex = 0; RhythmIndex < RhythmCount; ++RhythmIndex) { @@ -463,13 +483,13 @@ { JZRndArray tmp(mRhythmArray); tmp.Clear(); - long clock = BarInfo.GetClock(); - while (clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) + int Clock = BarInfo.GetClock(); + while (Clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) { - int i = Clock2i(clock, BarInfo); - int j = pRhythm->Clock2i(clock, BarInfo); + int i = Clock2i(Clock, BarInfo); + int j = pRhythm->Clock2i(Clock, BarInfo); tmp[i] = pRhythm->mHistoryArray[j]; - clock += clocks_per_step; + Clock += ClocksPerStep; } out.SetUnion(tmp, fuzz); } @@ -505,20 +525,20 @@ } // Clear part of the history. - long clock = BarInfo.GetClock(); - int clocks_per_step = ClocksPerStep(BarInfo); - while (clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) + int Clock = BarInfo.GetClock(); + int ClocksPerStep = GetClocksPerStep(BarInfo); + while (Clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) { - int i = Clock2i(clock, BarInfo); + int i = Clock2i(Clock, BarInfo); mHistoryArray[i] = 0; - clock += clocks_per_step; + Clock += ClocksPerStep; } // generate the events - clock = mNextClock; - while (clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) + Clock = mNextClock; + while (Clock < BarInfo.GetClock() + BarInfo.GetTicksPerBar()) { - int i = Clock2i(clock, BarInfo); + int i = Clock2i(Clock, BarInfo); if ((!mRandomizeFlag && rrg[i] > 0) || rrg.Random(i)) { // put event here @@ -533,16 +553,16 @@ { vel = rrg[i] * 126 / rrg.GetMax() + 1; } - short len = (mLengthArray.Random() + 1) * clocks_per_step; - GenerateEvent(pTrack, clock, vel, len - clocks_per_step/2); - clock += len; + short len = (mLengthArray.Random() + 1) * ClocksPerStep; + GenerateEvent(pTrack, Clock, vel, len - ClocksPerStep / 2); + Clock += len; } else { - clock += clocks_per_step; + Clock += ClocksPerStep; } } - mNextClock = clock; + mNextClock = Clock; } //***************************************************************************** @@ -779,7 +799,7 @@ } mActiveGroup = mpGroupListBox->GetSelection(); - mpRandomCheckBox = new wxCheckBox(mpGroupPanel, (wxFunction)ItemCallback, "Randomize") ; + mpRandomCheckBox = new wxCheckBox(mpGroupPanel, (wxFunction)ItemCallback, "Randomize"); Show(TRUE); #endif @@ -976,7 +996,7 @@ { return; } - pRhythm->SetLabel(gpConfig->GetCtrlName(pRhythm->mParameter).first.c_str()); + pRhythm->SetLabel(gpConfig->GetCtrlName(pRhythm->mParameter).first); pRhythm->mMode = MODE_CONTROL; pRhythm->mKeyCount = 0; } @@ -1040,7 +1060,7 @@ { mActiveInstrumentIndex = mInstrumentCount++; mpInstruments[mActiveInstrumentIndex] = pRhythm; - mpInstrumentListBox->Append(pRhythm->GetLabel().c_str()); + mpInstrumentListBox->Append(pRhythm->GetLabel()); mpInstrumentListBox->SetSelection(mActiveInstrumentIndex); Instrument2Win(); @@ -1085,7 +1105,7 @@ mpInstrumentListBox->Clear(); for (int i = 0; i < mInstrumentCount; ++i) { - mpInstrumentListBox->Append(mpInstruments[i]->GetLabel().c_str()); + mpInstrumentListBox->Append(mpInstruments[i]->GetLabel()); } if (mActiveInstrumentIndex >= 0) { @@ -1379,8 +1399,28 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZRhythmGeneratorWindow, wxPanel) + EVT_SLIDER( + IDC_SL_RHYTHM_STEPS_PER_COUNT, + JZRhythmGeneratorWindow::OnSliderUpdate) + + EVT_SLIDER( + IDC_SL_RHYTHM_COUNTS_PER_BAR, + JZRhythmGeneratorWindow::OnSliderUpdate) + + EVT_SLIDER( + IDC_SL_RHYTHM_BAR_COUNT, + JZRhythmGeneratorWindow::OnSliderUpdate) + EVT_LISTBOX(IDC_LB_RHYTHM_INSTRUMENTS, JZRhythmGeneratorWindow::OnListBox) + EVT_SLIDER( + IDC_SL_RHYTHM_GROUP_CONTRIB, + JZRhythmGeneratorWindow::OnSliderUpdate) + + EVT_SLIDER( + IDC_SL_RHYTHM_GROUP_LISTEN, + JZRhythmGeneratorWindow::OnSliderUpdate) + END_EVENT_TABLE() //----------------------------------------------------------------------------- @@ -1504,17 +1544,16 @@ mpVelocityEdit->SetXMinMax(1, 127); mpVelocityEdit->SetLabel("velocity"); - mpRhythmEdit = new JZArrayControl( + mpRhythmEdit = new JZRhythmArrayControl( pPanel, wxID_ANY, mRhythm.mRhythmArray, wxPoint(x, y + Height / 2), wxSize(Width, Height / 2 - 4)); - mpRhythmEdit->SetXMinMax(1, 4); -// mpRhythmEdit->SetMeter( -// mRhythm.mStepsPerCount, -// mRhythm.mCountPerBar, -// mRhythm.mBarCount); + mpRhythmEdit->SetMeter( + mRhythm.mStepsPerCount, + mRhythm.mCountPerBar, + mRhythm.mBarCount); mpRhythmEdit->SetLabel("rhythm"); wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL); @@ -1591,7 +1630,7 @@ pRhythm = new JZRhythm(Keys[i]); } - // drum key? + // Is this a drum key? if (Keys[i] >= 0) { pRhythm->mKeyCount = 1; @@ -1600,7 +1639,7 @@ pRhythm->SetLabel(InstrumentNames[i]); } - // choose controller? + // Was a controller chosen? else if (Keys[i] == MODE_CONTROL) { pRhythm->mParameter = SelectControllerDlg(); @@ -1608,7 +1647,7 @@ { return; } - pRhythm->SetLabel(gpConfig->GetCtrlName(pRhythm->mParameter).first.c_str()); + pRhythm->SetLabel(gpConfig->GetCtrlName(pRhythm->mParameter).first); pRhythm->mMode = MODE_CONTROL; pRhythm->mKeyCount = 0; } @@ -1626,27 +1665,30 @@ } pRhythm->mKeyCount = 0; pRhythm->mMode = Keys[i]; - JZEventArray events; - JZCommandCopyToBuffer cmd(gpTrackFrame->GetPianoWindow()->GetFilter(), &events); - cmd.Execute(0); // no UNDO + if (gpTrackFrame->GetPianoWindow()) + { + JZEventArray Events; + JZCommandCopyToBuffer cmd(gpTrackFrame->GetPianoWindow()->GetFilter(), &Events); + cmd.Execute(0); // no UNDO - for (int ii = 0; ii < events.mEventCount; ii++) - { - JZKeyOnEvent* pKeyOn = events.mppEvents[ii]->IsKeyOn(); - if (pKeyOn) + for (int ii = 0; ii < Events.mEventCount; ii++) { - pRhythm->mKeys[pRhythm->mKeyCount++] = pKeyOn->GetKey(); - if (pRhythm->mKeyCount > 1) + JZKeyOnEvent* pKeyOn = Events.mppEvents[ii]->IsKeyOn(); + if (pKeyOn) { - Oss << ", "; + pRhythm->mKeys[pRhythm->mKeyCount++] = pKeyOn->GetKey(); + if (pRhythm->mKeyCount > 1) + { + Oss << ", "; + } + string KeyString; + KeyToString(pKeyOn->GetKey(), KeyString); + Oss << KeyString; + if (pRhythm->mKeyCount >= MAX_KEYS) + { + break; + } } - string KeyString; - KeyToString(pKeyOn->GetKey(), KeyString); - Oss << KeyString; - if (pRhythm->mKeyCount >= MAX_KEYS) - { - break; - } } } pRhythm->SetLabel(Oss.str()); @@ -1825,6 +1867,10 @@ mRhythm.mStepsPerCount = mpStepsPerCountSlider->GetValue(); mRhythm.mCountPerBar = mpCountsPerBarSlider->GetValue(); mRhythm.mBarCount = mpBarCountSlider->GetValue(); + mpRhythmEdit->SetMeter( + mRhythm.mStepsPerCount, + mRhythm.mCountPerBar, + mRhythm.mBarCount); mRhythm.mRandomizeFlag = mpRandomCheckBox->GetValue(); if (mActiveGroup >= 0) @@ -1849,6 +1895,15 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::OnSliderUpdate(wxCommandEvent&) +{ + Win2Instrument(); + RandomEnable(); + Refresh(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorWindow::OnListBox(wxCommandEvent&) { Win2Instrument(); Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-07 22:09:22 UTC (rev 1014) +++ trunk/jazz/src/Rhythm.h 2013-04-07 22:12:11 UTC (rev 1015) @@ -34,6 +34,7 @@ class JZArrayControl; class JZBarInfo; class JZEventWindow; +class JZRhythmArrayControl; class JZSong; class JZToolBar; class JZTrack; @@ -119,7 +120,7 @@ void GenerateEvent( JZTrack* pTrack, - long clock, + int Clock, short vel, short len); @@ -136,9 +137,9 @@ JZRhythm* rhy[], int RhythmCount); - int Clock2i(long clock, const JZBarInfo& BarInfo) const; + int Clock2i(int Clock, const JZBarInfo& BarInfo) const; - int ClocksPerStep(const JZBarInfo& BarInfo) const; + int GetClocksPerStep(const JZBarInfo& BarInfo) const; private: @@ -285,8 +286,10 @@ void RandomEnable(); - void OnListBox(wxCommandEvent&); + void OnSliderUpdate(wxCommandEvent& Event); + void OnListBox(wxCommandEvent& Event); + private: JZRhythm mRhythm; @@ -304,12 +307,9 @@ int mActiveGroup; wxCheckBox* mpRandomCheckBox; -// JZArrayEdit* mpLengthEdit; JZArrayControl* mpLengthEdit; -// JZArrayEdit* mpVelocityEdit; JZArrayControl* mpVelocityEdit; -// JZRhyArrayEdit* mpRhythmEdit; - JZArrayControl* mpRhythmEdit; + JZRhythmArrayControl* mpRhythmEdit; DECLARE_EVENT_TABLE() }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 22:09:25
|
Revision: 1014 http://sourceforge.net/p/jazzplusplus/code/1014 Author: pstieber Date: 2013-04-07 22:09:22 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Simplified the array control. Modified Paths: -------------- trunk/jazz/src/ArrayControl.cpp trunk/jazz/src/ArrayControl.h Modified: trunk/jazz/src/ArrayControl.cpp =================================================================== --- trunk/jazz/src/ArrayControl.cpp 2013-04-07 22:07:59 UTC (rev 1013) +++ trunk/jazz/src/ArrayControl.cpp 2013-04-07 22:09:22 UTC (rev 1014) @@ -59,10 +59,8 @@ const JZRndArray& RandomArray, const wxPoint& Position, const wxSize& Size, - long WindowStyle, - const wxValidator& Validator, - const wxString& Name) - : wxControl(), + long WindowStyle) + : wxControl(pParent, Id, Position, Size, wxNO_BORDER), mpRandomArray(0), mStyleBits(ARED_GAP | ARED_XTICKS), mEnabled(true), @@ -77,15 +75,7 @@ { mpRandomArray = new JZRndArray(RandomArray); - Create( - pParent, - Id, - RandomArray, - Position, - Size, - WindowStyle, - Validator, - Name); + SetInitialSize(Size); } //----------------------------------------------------------------------------- @@ -97,32 +87,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZArrayControl::Create( - wxWindow* pParent, - wxWindowID Id, - const JZRndArray& RandomArray, - const wxPoint& Position, - const wxSize& Size, - long WindowStyle, - const wxValidator& Validator, - const wxString& Name) -{ - wxControl::Create( - pParent, - Id, - Position, - Size, - WindowStyle | wxNO_BORDER, - Validator, - Name); - - SetInitialSize(Size); - - *mpRandomArray = RandomArray; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZArrayControl::SetLabel(const string& Label) { mLabel = Label; @@ -138,27 +102,21 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZArrayControl::SetMeter(int StepsPerCount, int CountPerBar, int BarCount) +void JZArrayControl::OnSize(wxSizeEvent& SizeEvent) { -// mStepsPerCount = StepsPerCount; -// mCountPerBar = CountPerBar; -// mpRandomArray->Resize(StepsPerCount * CountPerBar * BarCount); -// SetXMinMax(1, StepsPerCount * CountPerBar * BarCount); + Refresh(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZArrayControl::OnSize(wxSizeEvent& SizeEvent) +void JZArrayControl::OnPaint(wxPaintEvent& Event) { - mWidth = SizeEvent.GetSize().GetWidth(); - mHeight = SizeEvent.GetSize().GetHeight(); + wxSize Size = GetClientSize(); + mWidth = Size.GetWidth(); + mHeight = Size.GetHeight(); - SizeEvent.Skip(); + wxPaintDC Dc(this); - wxClientDC Dc(this); - - Dc.SetFont(*wxSMALL_FONT); - int TextWidth, TextHeight; Dc.GetTextExtent("123", &TextWidth, &TextHeight); @@ -179,14 +137,7 @@ mY + mHeight - mHeight * (mpRandomArray->GetNull() - mpRandomArray->GetMin()) / (mpRandomArray->GetMax() - mpRandomArray->GetMin()); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZArrayControl::OnPaint(wxPaintEvent& Event) -{ - wxPaintDC Dc(this); - int i; // surrounding rectangle @@ -201,6 +152,7 @@ } Dc.SetPen(*wxBLACK_PEN); + if (mWidth && mHeight) { Dc.DrawRectangle(0, 0, mWidth, mHeight); Modified: trunk/jazz/src/ArrayControl.h =================================================================== --- trunk/jazz/src/ArrayControl.h 2013-04-07 22:07:59 UTC (rev 1013) +++ trunk/jazz/src/ArrayControl.h 2013-04-07 22:09:22 UTC (rev 1014) @@ -38,28 +38,14 @@ const JZRndArray& RandomArray, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxSize(40, 40), - long WindowStyle = wxNO_BORDER, - const wxValidator& Validator = wxDefaultValidator, - const wxString& Name = wxT("arraycontrol")); + long WindowStyle = wxNO_BORDER); virtual ~JZArrayControl(); - void Create( - wxWindow* pParent, - wxWindowID Id, - const JZRndArray& RandomArray, - const wxPoint& Position = wxDefaultPosition, - const wxSize& Size = wxSize(40, 40), - long WindowStyle = wxNO_BORDER, - const wxValidator& Validator = wxDefaultValidator, - const wxString& Name = wxT("arraycontrol")); - void SetLabel(const std::string& Label); void SetXMinMax(int XMin, int XMax); - void SetMeter(int StepsPerCount, int CountPerBar, int BarCount); - private: void OnSize(wxSizeEvent& Event); @@ -70,13 +56,17 @@ void DrawLabel(wxDC& Dc); - void DrawXTicks(wxDC& Dc); + protected: + virtual void DrawXTicks(wxDC& Dc); + + private: + void DrawYTicks(wxDC& Dc); void DrawNull(wxDC& Dc); - private: + protected: JZRndArray* mpRandomArray; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 22:08:02
|
Revision: 1013 http://sourceforge.net/p/jazzplusplus/code/1013 Author: pstieber Date: 2013-04-07 22:07:59 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Removed trailing white space. Modified Paths: -------------- trunk/jazz/src/ProjectManager.cpp Modified: trunk/jazz/src/ProjectManager.cpp =================================================================== --- trunk/jazz/src/ProjectManager.cpp 2013-04-07 22:07:07 UTC (rev 1012) +++ trunk/jazz/src/ProjectManager.cpp 2013-04-07 22:07:59 UTC (rev 1013) @@ -189,4 +189,3 @@ mpGuitarFrame->Refresh(); } } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 22:07:10
|
Revision: 1012 http://sourceforge.net/p/jazzplusplus/code/1012 Author: pstieber Date: 2013-04-07 22:07:07 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added a new rhythm array control. Added Paths: ----------- trunk/jazz/src/RhythmArrayControl.cpp trunk/jazz/src/RhythmArrayControl.h Added: trunk/jazz/src/RhythmArrayControl.cpp =================================================================== --- trunk/jazz/src/RhythmArrayControl.cpp (rev 0) +++ trunk/jazz/src/RhythmArrayControl.cpp 2013-04-07 22:07:07 UTC (rev 1012) @@ -0,0 +1,92 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2013 Peter J. Stieber +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "RhythmArrayControl.h" + +#include "Random.h" + +#include <wx/dc.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythmArrayControl::JZRhythmArrayControl( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position, + const wxSize& Size, + long WindowStyle) + : JZArrayControl(pParent, Id, RandomArray, Position, Size, WindowStyle), + mStepsPerCount(4), + mCountPerBar(4) +{ + mStyleBits |= ARED_RHYTHM; + + SetXMinMax(1, mStepsPerCount * mCountPerBar); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmArrayControl::SetMeter( + int StepsPerCount, + int CountPerBar, + int BarCount) +{ + mStepsPerCount = StepsPerCount; + mCountPerBar = CountPerBar; + mpRandomArray->Resize(StepsPerCount * CountPerBar * BarCount); + SetXMinMax(1, StepsPerCount * CountPerBar * BarCount); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmArrayControl::DrawXTicks(wxDC& Dc) +{ + if (!(mStyleBits & ARED_RHYTHM)) + { + JZArrayControl::DrawXTicks(Dc); + return; + } + + assert(mStepsPerCount && mCountPerBar); + + Dc.SetFont(*wxSMALL_FONT); + + int TextWidth, TextHeight; + for (int i = 0; i < mpRandomArray->Size(); i += mStepsPerCount) + { + int Mark = (i / mStepsPerCount) % mCountPerBar + 1; + ostringstream Oss; + Oss << Mark; + int YPosition = mY + mHeight; + int XPosition = (int)(mX + (i + 0.5) * mWidth / mpRandomArray->Size()); + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + XPosition -= (int)(TextWidth / 2.0); + Dc.DrawText(Oss.str(), XPosition, YPosition); + } + + Dc.SetFont(*wxNORMAL_FONT); +} Property changes on: trunk/jazz/src/RhythmArrayControl.cpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/jazz/src/RhythmArrayControl.h =================================================================== --- trunk/jazz/src/RhythmArrayControl.h (rev 0) +++ trunk/jazz/src/RhythmArrayControl.h 2013-04-07 22:07:07 UTC (rev 1012) @@ -0,0 +1,49 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2013 Peter J. Stieber +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#pragma once + +#include "ArrayControl.h" + +//***************************************************************************** +//***************************************************************************** +class JZRhythmArrayControl : public JZArrayControl +{ + public: + + JZRhythmArrayControl( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position = wxDefaultPosition, + const wxSize& Size = wxSize(40, 40), + long WindowStyle = wxNO_BORDER); + + void SetMeter(int StepsPerCount, int CountPerBar, int BarCount); + + protected: + + virtual void DrawXTicks(wxDC& Dc); + + private: + + int mStepsPerCount; + int mCountPerBar; +}; Property changes on: trunk/jazz/src/RhythmArrayControl.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 19:30:51
|
Revision: 1011 http://sourceforge.net/p/jazzplusplus/code/1011 Author: pstieber Date: 2013-04-07 19:30:44 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added the ability to save a rhythm generator file. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 16:29:20 UTC (rev 1010) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 19:30:44 UTC (rev 1011) @@ -1693,6 +1693,24 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::Write(ostream& Os) +{ + Win2Instrument(); + + Os << 2 << endl; + Os << mInstruments.size() << endl; + for ( + vector<JZRhythm*>::const_iterator iInstrument = mInstruments.begin(); + iInstrument != mInstruments.end(); + ++iInstrument) + { + const JZRhythm& Instrument = **iInstrument; + Instrument.Write(Os); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorWindow::ClearInstruments() { for ( @@ -1847,6 +1865,8 @@ EVT_MENU(wxID_OPEN, JZRhythmGeneratorFrame::OnOpen) + EVT_MENU(wxID_SAVE, JZRhythmGeneratorFrame::OnSave) + EVT_MENU(ID_INSTRUMENT_ADD, JZRhythmGeneratorFrame::OnAddInstrument) EVT_MENU(ID_INSTRUMENT_DELETE, JZRhythmGeneratorFrame::OnDeleteInstrument) @@ -1965,6 +1985,27 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::OnSave(wxCommandEvent&) +{ + bool HasChanged = false; + wxString FileName = file_selector( + mDefaultFileName, + "Save Rhythm", + true, + HasChanged, + "*.rhy"); + if (!FileName.empty()) + { + ofstream Os(FileName.mb_str()); + if (Os) + { + mpRhythmGeneratorWindow->Write(Os); + } + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorFrame::OnAddInstrument(wxCommandEvent&) { mpRhythmGeneratorWindow->AddInstrument(); Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-07 16:29:20 UTC (rev 1010) +++ trunk/jazz/src/Rhythm.h 2013-04-07 19:30:44 UTC (rev 1011) @@ -267,6 +267,8 @@ void Read(std::istream& Is); + void Write(std::ostream& Os); + void AddInstrument(); void DeleteInstrument(); @@ -328,6 +330,8 @@ void OnOpen(wxCommandEvent& Event); + void OnSave(wxCommandEvent& Event); + void OnAddInstrument(wxCommandEvent& Event); void OnDeleteInstrument(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 16:29:22
|
Revision: 1010 http://sourceforge.net/p/jazzplusplus/code/1010 Author: pstieber Date: 2013-04-07 16:29:20 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added the ability to open a rhythm file. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 16:14:28 UTC (rev 1009) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 16:29:20 UTC (rev 1010) @@ -353,8 +353,9 @@ } } - #if 0 +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythm::Generate(JZTrack* pTrack, int FromClock, int ToClock, int TicksPerBar) { int chan = pTrack->Channel - 1; @@ -545,7 +546,6 @@ } //***************************************************************************** -// JZRhythmWindow //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -789,7 +789,6 @@ //----------------------------------------------------------------------------- void JZRhythmWindow::OnSize(int w, int h) { - // wxFrame::OnSize(w, h); if (mpToolBar) { int cw, ch; @@ -1530,13 +1529,7 @@ //----------------------------------------------------------------------------- JZRhythmGeneratorWindow::~JZRhythmGeneratorWindow() { - for ( - vector<JZRhythm*>::iterator iInstrument = mInstruments.begin(); - iInstrument != mInstruments.end(); - ++iInstrument) - { - delete *iInstrument; - } + ClearInstruments(); } //----------------------------------------------------------------------------- @@ -1675,6 +1668,45 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::Read(istream& Is) +{ + int Version; + Is >> Version; + if (Version > 2) + { + wxMessageBox("Wrong file format!", "Error", wxOK); + } + + ClearInstruments(); + + size_t InstrumentCount; + Is >> InstrumentCount; + for (size_t i = 0; i < InstrumentCount; ++i) + { + JZRhythm* pRhythm = new JZRhythm(0); + pRhythm->Read(Is, Version); + AddInstrument(pRhythm); + } + + Refresh(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::ClearInstruments() +{ + for ( + vector<JZRhythm*>::iterator iInstrument = mInstruments.begin(); + iInstrument != mInstruments.end(); + ++iInstrument) + { + delete *iInstrument; + } + mInstruments.clear(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorWindow::AddInstrument(JZRhythm* pRhythm) { mInstruments.push_back(pRhythm); @@ -1813,6 +1845,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZRhythmGeneratorFrame, wxFrame) + EVT_MENU(wxID_OPEN, JZRhythmGeneratorFrame::OnOpen) + EVT_MENU(ID_INSTRUMENT_ADD, JZRhythmGeneratorFrame::OnAddInstrument) EVT_MENU(ID_INSTRUMENT_DELETE, JZRhythmGeneratorFrame::OnDeleteInstrument) @@ -1825,6 +1859,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +const wxString JZRhythmGeneratorFrame::mDefaultFileName = "noname.rhy"; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythmGeneratorFrame::JZRhythmGeneratorFrame() : wxFrame( 0, @@ -1906,6 +1944,27 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::OnOpen(wxCommandEvent&) +{ + bool HasChanged = false; + wxString FileName = file_selector( + mDefaultFileName, + "Load Rhythm", + false, + HasChanged, + "*.rhy"); + if (!FileName.empty()) + { + ifstream Is(FileName.mb_str()); + if (Is) + { + mpRhythmGeneratorWindow->Read(Is); + } + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorFrame::OnAddInstrument(wxCommandEvent&) { mpRhythmGeneratorWindow->AddInstrument(); Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-07 16:14:28 UTC (rev 1009) +++ trunk/jazz/src/Rhythm.h 2013-04-07 16:29:20 UTC (rev 1010) @@ -265,12 +265,16 @@ virtual ~JZRhythmGeneratorWindow(); + void Read(std::istream& Is); + void AddInstrument(); void DeleteInstrument(); private: + void ClearInstruments(); + void AddInstrument(JZRhythm* pRhythm); void Instrument2Win(); @@ -322,6 +326,8 @@ void CreateToolBar(); + void OnOpen(wxCommandEvent& Event); + void OnAddInstrument(wxCommandEvent& Event); void OnDeleteInstrument(wxCommandEvent& Event); @@ -332,6 +338,8 @@ private: + static const wxString mDefaultFileName; + JZToolBar* mpToolBar; JZRhythmGeneratorWindow* mpRhythmGeneratorWindow; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 16:14:31
|
Revision: 1009 http://sourceforge.net/p/jazzplusplus/code/1009 Author: pstieber Date: 2013-04-07 16:14:28 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Recorded the position of the rhythm generator frame in the configuration file. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 16:08:51 UTC (rev 1008) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 16:14:28 UTC (rev 1009) @@ -1894,6 +1894,11 @@ //----------------------------------------------------------------------------- JZRhythmGeneratorFrame::~JZRhythmGeneratorFrame() { + int XPixel, YPixel; + GetPosition(&XPixel, &YPixel); + gpConfig->Put(C_RhythmXpos, XPixel); + gpConfig->Put(C_RhythmYpos, YPixel); + delete mpRhythmGeneratorWindow; gpRhythmGeneratorFrame = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 16:08:54
|
Revision: 1008 http://sourceforge.net/p/jazzplusplus/code/1008 Author: pstieber Date: 2013-04-07 16:08:51 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Added the ability to delete instruments from the rhythm window. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 08:08:41 UTC (rev 1007) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 16:08:51 UTC (rev 1008) @@ -1380,6 +1380,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZRhythmGeneratorWindow, wxPanel) + EVT_LISTBOX(IDC_LB_RHYTHM_INSTRUMENTS, JZRhythmGeneratorWindow::OnListBox) + END_EVENT_TABLE() //----------------------------------------------------------------------------- @@ -1689,6 +1691,36 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::DeleteInstrument() +{ + if (mActiveInstrumentIndex >= 0) + { + vector<JZRhythm*> InstrumentsCopy(mInstruments); + + int i = mActiveInstrumentIndex; + delete InstrumentsCopy[i]; + + size_t k; + for (k = i; k < InstrumentsCopy.size() - 1; ++k) + { + InstrumentsCopy[k] = InstrumentsCopy[k + 1]; + } + + mInstruments.clear(); + for (k = 0; k < InstrumentsCopy.size() - 1; ++k) + { + mInstruments.push_back(InstrumentsCopy[k]); + } + + mpInstrumentListBox->Delete(i); + mActiveInstrumentIndex = mpInstrumentListBox->GetSelection(); + Instrument2Win(); + Refresh(); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorWindow::Instrument2Win() { if ( @@ -1765,6 +1797,16 @@ mpGroupListenSlider->Enable(mRhythm.mRandomizeFlag); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGeneratorWindow::OnListBox(wxCommandEvent&) +{ + Win2Instrument(); + mActiveInstrumentIndex = mpInstrumentListBox->GetSelection(); + Instrument2Win(); + Refresh(); +} + //***************************************************************************** //***************************************************************************** //----------------------------------------------------------------------------- @@ -1773,6 +1815,8 @@ EVT_MENU(ID_INSTRUMENT_ADD, JZRhythmGeneratorFrame::OnAddInstrument) + EVT_MENU(ID_INSTRUMENT_DELETE, JZRhythmGeneratorFrame::OnDeleteInstrument) + EVT_MENU(wxID_HELP, JZRhythmGeneratorFrame::OnHelp) EVT_MENU(wxID_HELP_CONTENTS, JZRhythmGeneratorFrame::OnHelpContents) @@ -1864,6 +1908,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::OnDeleteInstrument(wxCommandEvent&) +{ + mpRhythmGeneratorWindow->DeleteInstrument(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythmGeneratorFrame::OnHelp(wxCommandEvent&) { JZHelp::Instance().ShowTopic("Random rhythm generator"); Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-07 08:08:41 UTC (rev 1007) +++ trunk/jazz/src/Rhythm.h 2013-04-07 16:08:51 UTC (rev 1008) @@ -267,6 +267,8 @@ void AddInstrument(); + void DeleteInstrument(); + private: void AddInstrument(JZRhythm* pRhythm); @@ -277,6 +279,8 @@ void RandomEnable(); + void OnListBox(wxCommandEvent&); + private: JZRhythm mRhythm; @@ -320,6 +324,8 @@ void OnAddInstrument(wxCommandEvent& Event); + void OnDeleteInstrument(wxCommandEvent& Event); + void OnHelp(wxCommandEvent& Event); void OnHelpContents(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 08:08:44
|
Revision: 1007 http://sourceforge.net/p/jazzplusplus/code/1007 Author: pstieber Date: 2013-04-07 08:08:41 +0000 (Sun, 07 Apr 2013) Log Message: ----------- 1. Added code to the array control class. 2. Changed Min and Max in the JZRndArray class to GetMin and GetMax. Modified Paths: -------------- trunk/jazz/src/ArrayControl.cpp trunk/jazz/src/ArrayControl.h trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/SampleFrame.h trunk/jazz/src/Signal2.cpp trunk/jazz/src/SliderWindow.cpp Modified: trunk/jazz/src/ArrayControl.cpp =================================================================== --- trunk/jazz/src/ArrayControl.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/ArrayControl.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -20,11 +20,27 @@ #include "ArrayControl.h" +#include "Mapper.h" #include "Random.h" #include <wx/dcclient.h> +#include <sstream> + +using namespace std; + +#define TICK_LINE 0 + //***************************************************************************** +//***************************************************************************** +static string GetText(int YValue) +{ + ostringstream Oss; + Oss << YValue; + return Oss.str(); +} + +//***************************************************************************** // Description: // This is the array control class definition. //***************************************************************************** @@ -47,7 +63,17 @@ const wxValidator& Validator, const wxString& Name) : wxControl(), - mpRandomArray(0) + mpRandomArray(0), + mStyleBits(ARED_GAP | ARED_XTICKS), + mEnabled(true), + mLabel(), + mX(0), + mY(0), + mYNull(0), + mWidth(0), + mHeight(0), + mXMin(0), + mXMax(RandomArray.Size()) { mpRandomArray = new JZRndArray(RandomArray); @@ -97,34 +123,353 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZArrayControl::SetLabel(const string& Label) +{ + mLabel = Label; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::SetXMinMax(int XMin, int XMax) +{ + mXMin = XMin; + mXMax = XMax; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::SetMeter(int StepsPerCount, int CountPerBar, int BarCount) +{ +// mStepsPerCount = StepsPerCount; +// mCountPerBar = CountPerBar; +// mpRandomArray->Resize(StepsPerCount * CountPerBar * BarCount); +// SetXMinMax(1, StepsPerCount * CountPerBar * BarCount); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayControl::OnSize(wxSizeEvent& SizeEvent) { - int Width = SizeEvent.GetSize().GetWidth(); - int Height = SizeEvent.GetSize().GetHeight(); + mWidth = SizeEvent.GetSize().GetWidth(); + mHeight = SizeEvent.GetSize().GetHeight(); SizeEvent.Skip(); wxClientDC Dc(this); + Dc.SetFont(*wxSMALL_FONT); + int TextWidth, TextHeight; Dc.GetTextExtent("123", &TextWidth, &TextHeight); -#if 0 if (mStyleBits & ARED_XTICKS) { - Height -= TextHeight; + // Leave space for the bottom line. + mHeight -= TextHeight; } + if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) { - x = (int)(TextWidth + TICK_LINE); - Width -= (int)(TextWidth + TICK_LINE); + // Leave space to display the minimum and maximum + mX = TextWidth + TICK_LINE; + mWidth -= TextWidth + TICK_LINE; } - ynul = y + height - Height * (nul - min) / (max - min); -#endif + + mYNull = + mY + mHeight - + mHeight * (mpRandomArray->GetNull() - mpRandomArray->GetMin()) / + (mpRandomArray->GetMax() - mpRandomArray->GetMin()); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZArrayControl::OnPaint(wxPaintEvent& Event) { + wxPaintDC Dc(this); + + int i; + + // surrounding rectangle + Dc.Clear(); + if (mEnabled) + { + Dc.SetBrush(*wxWHITE_BRUSH); + } + else + { + Dc.SetBrush(*wxGREY_BRUSH); + } + + Dc.SetPen(*wxBLACK_PEN); + if (mWidth && mHeight) + { + Dc.DrawRectangle(0, 0, mWidth, mHeight); + } + + // sliders + Dc.SetBrush(*wxBLACK_BRUSH); + for (i = 0; i < mpRandomArray->Size(); ++i) + { + DrawBar(Dc, i, true); + } + + DrawXTicks(Dc); + DrawLabel(Dc); + DrawYTicks(Dc); + DrawNull(Dc); + +// if (mpDrawBars) + { +// mpDrawBars->DrawBars(Dc); + } } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::DrawBar(wxDC& Dc, int i, bool black) +{ + if (mStyleBits & ARED_LINES) + { + if (!black) + { + Dc.SetPen(*wxWHITE_PEN); + } + + JZMapper XMap(0, mpRandomArray->Size(), 0, mWidth); + JZMapper + YMap(mpRandomArray->GetMin(), mpRandomArray->GetMax(), mHeight, 0); + + int x1 = (int)XMap.XToY(i + 0.5); + int y1 = (int)YMap.XToY((*mpRandomArray)[i]); + if (i > 0) + { + // draw line to prev position + int x0 = (int)XMap.XToY(i - 0.5); + int y0 = (int)YMap.XToY((*mpRandomArray)[i - 1]); + Dc.DrawLine(x0, y0, x1, y1); + } + if (i < mpRandomArray->Size() - 1) + { + // draw line to next position + int x2 = (int)XMap.XToY(i + 1.5); + int y2 = (int)YMap.XToY((*mpRandomArray)[i + 1]); + Dc.DrawLine(x1, y1, x2, y2); + } + + if (!black) + { + Dc.SetPen(*wxBLACK_PEN); + } + return; + } + + int Gap = 0; + if (mStyleBits & ARED_GAP) + { + Gap = mWidth / mpRandomArray->Size() / 6; + if (!Gap && mWidth / mpRandomArray->Size() > 3) + { + Gap = 1; + } + } + + int wbar = mWidth / mpRandomArray->Size() - 2 * Gap; + int xbar = mX + i * mWidth / mpRandomArray->Size() + Gap; + int hbar = mHeight * ((*mpRandomArray)[i] - mpRandomArray->GetNull()) / + (mpRandomArray->GetMax() - mpRandomArray->GetMin()); + int ybar; + + if (mStyleBits & ARED_BLOCKS) + { + /* + ybar = mYNull - hbar; + if (hbar < 0) + hbar = -hbar; + hbar = (hbar < 2) ? hbar : 2; + */ + int hblk = 12; + + ybar = mYNull - hbar - hblk/2; + hbar = hblk; + if (ybar < mY) + { + int d = mY - ybar; + ybar += d; + hbar -= d; + } + if (ybar + hbar > mHeight) + { + int d = (ybar + hbar) - mHeight; + hbar -= d; + } + if (hbar < 2) + hbar = 2; + } + else + + if (hbar < 0) + { + ybar = mYNull; + hbar = -hbar; + } + else + ybar = mYNull - hbar; + + if (ybar == mY) + { + ++ybar, --hbar; + } + + if (!black) + { + Dc.SetBrush(*wxWHITE_BRUSH); + Dc.SetPen(*wxWHITE_PEN); + } + if (wbar && hbar) + { + Dc.DrawRectangle(xbar, ybar, wbar, hbar); + } + if (!black) + { + Dc.SetBrush(*wxBLACK_BRUSH); + Dc.SetPen(*wxBLACK_PEN); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::DrawLabel(wxDC& Dc) +{ + Dc.SetFont(*wxSMALL_FONT); + if (!mLabel.empty()) + { + Dc.DrawText(mLabel, 5, 2); + } + Dc.SetFont(*wxNORMAL_FONT); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::DrawXTicks(wxDC& Dc) +{ + if (!(mStyleBits & ARED_XTICKS)) + { + return; + } + + Dc.SetFont(*wxSMALL_FONT); + + // Compute tickmark x-distance. + int TextWidth, TextHeight; + Dc.GetTextExtent("-123", &TextWidth, &TextHeight); + int MaxLabels = (int)(mWidth / (TextWidth + TextWidth / 2)); + if (MaxLabels > 0) + { + int Step = (mXMax - mXMin + 1) / MaxLabels; + if (Step <= 0) + { + Step = 1; + } + for (int Value = mXMin; Value <= mXMax; Value += Step) + { + string String = GetText(Value); + Dc.GetTextExtent(String, &TextWidth, &TextHeight); + int YPosition = mY + mHeight; + float XPosition = mX + mWidth * (Value - mXMin) / (mXMax - mXMin + 1); + + // Center text. + XPosition -= TextWidth / 2.0f; + + // Middle of bar. + XPosition += 0.5f * mWidth / mpRandomArray->Size(); + + Dc.DrawText(String, (int)XPosition, YPosition); + } + } + + Dc.SetFont(*wxNORMAL_FONT); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::DrawYTicks(wxDC& Dc) +{ + Dc.SetFont(*wxSMALL_FONT); + + if (mStyleBits & ARED_YTICKS) + { + // Compute tickmark y-distance. + int TextWidth, TextHeight; + Dc.GetTextExtent("-123", &TextWidth, &TextHeight); + int MaxLabels = (int)(mHeight / (TextHeight + TextHeight / 2)); + if (MaxLabels > 0) + { + int Step = + (mpRandomArray->GetMax() - mpRandomArray->GetMin()) / MaxLabels; + if (Step <= 0) + { + Step = 1; + } + for ( + int Value = mpRandomArray->GetMin(); + Value < mpRandomArray->GetMax(); + Value += Step) + { + string String = GetText(Value); + Dc.GetTextExtent(String, &TextWidth, &TextHeight); + int YPosition = + mY + mHeight - + mHeight * (Value - mpRandomArray->GetMin()) / + (mpRandomArray->GetMax() - mpRandomArray->GetMin()) - + TextHeight / 2; + Dc.DrawText(String, mX - TextWidth - TICK_LINE, YPosition); + } + } + } + else if (mStyleBits & ARED_MINMAX) + { + // mMin/mMax + int TextWidth, TextHeight; + ostringstream Oss; + + Oss << mpRandomArray->GetMax(); + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + Dc.DrawText(Oss.str(), mX - TextWidth, mY); + + Oss.str(""); + + Oss << mpRandomArray->GetMin(); + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + Dc.DrawText(Oss.str(), mX - TextWidth, mY + mHeight - TextHeight); + } + + Dc.SetFont(*wxNORMAL_FONT); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::DrawNull(wxDC& Dc) +{ + Dc.SetPen(*wxCYAN_PEN); + + // Draw y-null line. + if ( + mpRandomArray->GetMin() < mpRandomArray->GetNull() && + mpRandomArray->GetNull() < mpRandomArray->GetMax()) + { + Dc.DrawLine( + mX, + mpRandomArray->GetNull(), + mX + mWidth, + mpRandomArray->GetNull()); + } + + // Draw x-null line. + if (mXMin < 0 && 0 < mXMax) + { + int x0 = mWidth * (0 - mXMin) / (mXMax - mXMin); + Dc.DrawLine(x0, mY, x0, mY + mHeight); + } + + Dc.SetPen(*wxBLACK_PEN); +} Modified: trunk/jazz/src/ArrayControl.h =================================================================== --- trunk/jazz/src/ArrayControl.h 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/ArrayControl.h 2013-04-07 08:08:41 UTC (rev 1007) @@ -22,6 +22,8 @@ #include <wx/control.h> +#include <string> + class JZRndArray; //***************************************************************************** @@ -52,15 +54,43 @@ const wxValidator& Validator = wxDefaultValidator, const wxString& Name = wxT("arraycontrol")); + void SetLabel(const std::string& Label); + + void SetXMinMax(int XMin, int XMax); + + void SetMeter(int StepsPerCount, int CountPerBar, int BarCount); + private: void OnSize(wxSizeEvent& Event); void OnPaint(wxPaintEvent& Event); + void DrawBar(wxDC& Dc, int i, bool black); + + void DrawLabel(wxDC& Dc); + + void DrawXTicks(wxDC& Dc); + + void DrawYTicks(wxDC& Dc); + + void DrawNull(wxDC& Dc); + private: JZRndArray* mpRandomArray; + long mStyleBits; + + bool mEnabled; + + std::string mLabel; + + int mX, mY, mYNull; + int mWidth, mHeight; + + // Array size is mapped to this range for x-tick marks. + int mXMin, mXMax; + DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/ControlEdit.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -101,7 +101,7 @@ // ctrlmode is used to distinguish between Apply and Edit. edit = new JZArrayEdit( - (wxFrame *)mpPianoWindow, + mpPianoWindow, array, wxPoint(x + dx, y), wxSize(w - dx, h), Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/Random.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -227,7 +227,7 @@ void JZRndArray::SetDifference(JZRndArray& Other, int fuzz) { JZRndArray tmp(Other); - tmp.SetInverse(tmp.Max()); + tmp.SetInverse(tmp.GetMax()); SetIntersection(tmp, fuzz); } @@ -299,7 +299,7 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(JZArrayEdit, wxScrolledWindow) +BEGIN_EVENT_TABLE(JZArrayEdit, wxWindow) EVT_SIZE(JZArrayEdit::OnSize) EVT_MOUSE_EVENTS(JZArrayEdit::OnMouseEvent) END_EVENT_TABLE() @@ -307,12 +307,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZArrayEdit::JZArrayEdit( - wxFrame* pFrame, + wxWindow* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, int StyleBits) - : wxScrolledWindow(pFrame, wxID_ANY, Position, Size), + : wxWindow(pParent, wxID_ANY, Position, Size), mArray(Array), mMin(Array.mMin), mMax(Array.mMax), @@ -861,7 +861,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZRhyArrayEdit::JZRhyArrayEdit( - wxFrame* pParent, + wxWindow* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/Random.h 2013-04-07 08:08:41 UTC (rev 1007) @@ -22,7 +22,7 @@ #pragma once -#include <wx/scrolwin.h> +#include <wx/window.h> #include <iostream> #include <vector> @@ -82,11 +82,11 @@ { return mArray.size(); } - int Min() const + int GetMin() const { return mMin; } - int Max() const + int GetMax() const { return mMax; } @@ -148,12 +148,12 @@ //***************************************************************************** //***************************************************************************** -class JZArrayEdit : public wxScrolledWindow +class JZArrayEdit : public wxWindow { public: JZArrayEdit( - wxFrame* pParent, + wxWindow* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, @@ -243,7 +243,7 @@ public: JZRhyArrayEdit( - wxFrame* pParent, + wxWindow* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -22,6 +22,7 @@ #include "Rhythm.h" +#include "ArrayControl.h" #include "Command.h" #include "EventWindow.h" #include "FileSelector.h" @@ -44,6 +45,7 @@ #include <wx/listbox.h> #include <wx/menu.h> #include <wx/msgdlg.h> +#include <wx/sizer.h> #include <wx/slider.h> #include <wx/stattext.h> #include <wx/toolbar.h> @@ -302,14 +304,14 @@ // Initialize history with random values. for (i = 0; i < Size; ++i) { - mHistoryArray[i] = mHistoryArray.Min(); + mHistoryArray[i] = mHistoryArray.GetMin(); } for (i = 0; i < Size; i++) { if (mRhythmArray.Random(i)) { - mHistoryArray[i] = mHistoryArray.Max(); + mHistoryArray[i] = mHistoryArray.GetMax(); i += mLengthArray.Random(); } } @@ -519,7 +521,7 @@ if ((!mRandomizeFlag && rrg[i] > 0) || rrg.Random(i)) { // put event here - mHistoryArray[i] = mRhythmArray.Max(); + mHistoryArray[i] = mRhythmArray.GetMax(); short vel = 0; if (mRandomizeFlag) @@ -528,7 +530,7 @@ } else { - vel = rrg[i] * 126 / rrg.Max() + 1; + vel = rrg[i] * 126 / rrg.GetMax() + 1; } short len = (mLengthArray.Random() + 1) * clocks_per_step; GenerateEvent(pTrack, clock, vel, len - clocks_per_step/2); @@ -556,7 +558,6 @@ gpConfig->GetValue(C_RhythmXpos), gpConfig->GetValue(C_RhythmYpos)), wxSize(640, 580)), - mpInstrumentPanel(0), mpStepsPerCountSlider(0), mpCountsPerBarSlider(0), mpBarCountSlider(0), @@ -628,10 +629,10 @@ int y = 0; int w, h; GetClientSize(&w, &h); - mpInstrumentPanel = new wxPanel(this, x, y, w/2, h/2, 0, "InstPanel"); + wxPanel* pInstrumentPanel = new wxPanel(this, x, y, w/2, h/2, 0, "InstPanel"); mpStepsPerCountSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, (wxFunction)ItemCallback, "", 4, @@ -641,11 +642,11 @@ 10, 1, wxFIXED_LENGTH); - (void) new wxMessage(mpInstrumentPanel, "steps/count"); - mpInstrumentPanel->NewLine(); + (void) new wxMessage(pInstrumentPanel, "steps/count"); + pInstrumentPanel->NewLine(); mpCountsPerBarSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, (wxFunction)ItemCallback, "", 4, @@ -655,11 +656,11 @@ 10, h / 12, wxFIXED_LENGTH); - (void) new wxMessage(mpInstrumentPanel, "count/bar"); - mpInstrumentPanel->NewLine(); + (void) new wxMessage(pInstrumentPanel, "count/bar"); + pInstrumentPanel->NewLine(); mpBarCountSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, (wxFunction)ItemCallback, "", 4, @@ -669,12 +670,12 @@ 10, 2 * h / 12, wxFIXED_LENGTH); - (void) new wxMessage(mpInstrumentPanel, "# bars"); - mpInstrumentPanel->NewLine(); + (void) new wxMessage(pInstrumentPanel, "# bars"); + pInstrumentPanel->NewLine(); - mpInstrumentPanel->SetLabelPosition(wxVERTICAL); + pInstrumentPanel->SetLabelPosition(wxVERTICAL); mpInstrumentListBox = new wxListBox( - mpInstrumentPanel, + pInstrumentPanel, (wxFunction)SelectInstr, "Instrument", wxLB_SINGLE /* | wxLB_ALWAYS_SB */, @@ -683,7 +684,7 @@ 220, 80); - mpInstrumentPanel->NewLine(); + pInstrumentPanel->NewLine(); // Random array edits. @@ -1377,7 +1378,7 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(JZRhythmGeneratorWindow, wxWindow) +BEGIN_EVENT_TABLE(JZRhythmGeneratorWindow, wxPanel) END_EVENT_TABLE() @@ -1387,10 +1388,9 @@ wxFrame* pParent, const wxPoint& Position, const wxSize& Size) - : wxWindow(pParent, wxID_ANY, Position, Size), + : wxPanel(pParent, wxID_ANY, Position, Size), mRhythm(0), mInstruments(), - mpInstrumentPanel(0), mpStepsPerCountSlider(0), mpCountsPerBarSlider(0), mpBarCountSlider(0), @@ -1410,11 +1410,11 @@ int Width, Height; GetClientSize(&Width, &Height); - mpInstrumentPanel = + wxPanel* pInstrumentPanel = new wxPanel(this, wxID_ANY, wxPoint(x, y), wxSize(Width, Height / 2)); mpStepsPerCountSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, IDC_SL_RHYTHM_STEPS_PER_COUNT, 4, 1, @@ -1424,7 +1424,7 @@ wxSL_LABELS); mpCountsPerBarSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, IDC_SL_RHYTHM_COUNTS_PER_BAR, 4, 1, @@ -1434,7 +1434,7 @@ wxSL_LABELS); mpBarCountSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, IDC_SL_RHYTHM_BAR_COUNT, 1, 1, @@ -1444,13 +1444,13 @@ wxSL_LABELS); wxStaticText* pStaticText = new wxStaticText( - mpInstrumentPanel, + pInstrumentPanel, wxID_ANY, "Instrument", wxPoint(10, 3 * Height / 12)); mpInstrumentListBox = new wxListBox( - mpInstrumentPanel, + pInstrumentPanel, IDC_LB_RHYTHM_INSTRUMENTS, wxPoint(10, 4 * Height / 12), wxSize(220, 80), @@ -1458,7 +1458,7 @@ wxLB_SINGLE); mpGroupContribSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, IDC_SL_RHYTHM_GROUP_CONTRIB, 0, 0, @@ -1468,7 +1468,7 @@ wxSL_LABELS); mpGroupListenSlider = new wxSlider( - mpInstrumentPanel, + pInstrumentPanel, IDC_SL_RHYTHM_GROUP_LISTEN, 0, -100, @@ -1478,37 +1478,50 @@ wxSL_LABELS); mpRandomCheckBox = new wxCheckBox( - mpInstrumentPanel, + pInstrumentPanel, IDC_CB_RHYTHM_RANDOMIZE, "Randomize", wxPoint(Width / 2, 4 * Height / 12)); - mpLengthEdit = new JZArrayEdit( - pParent, + wxPanel* pPanel = new wxPanel(this); + + mpLengthEdit = new JZArrayControl( + pPanel, + wxID_ANY, mRhythm.mLengthArray, - wxPoint(x, y + Height / 2), - wxSize(Width / 2, Height / 4 - 4)); + wxPoint(x, y), + wxSize(Width / 2, Height / 2 - 4)); mpLengthEdit->SetXMinMax(1, 8); mpLengthEdit->SetLabel("length/interval"); - mpVelocityEdit = new JZArrayEdit( - pParent, + mpVelocityEdit = new JZArrayControl( + pPanel, + wxID_ANY, mRhythm.mVelocityArray, - wxPoint(x + Width / 2, y + Height / 2), - wxSize(Width / 2, Height / 4 - 4)); + wxPoint(x + Width / 2, y), + wxSize(Width / 2, Height / 2 - 4)); mpVelocityEdit->SetXMinMax(1, 127); mpVelocityEdit->SetLabel("velocity"); - mpRhythmEdit = new JZRhyArrayEdit( - pParent, + mpRhythmEdit = new JZArrayControl( + pPanel, + wxID_ANY, mRhythm.mRhythmArray, - wxPoint(x, y + 3 * Height / 4), - wxSize(Width, Height/ 4 - 4)); - mpRhythmEdit->SetMeter( - mRhythm.mStepsPerCount, - mRhythm.mCountPerBar, - mRhythm.mBarCount); + wxPoint(x, y + Height / 2), + wxSize(Width, Height / 2 - 4)); + mpRhythmEdit->SetXMinMax(1, 4); +// mpRhythmEdit->SetMeter( +// mRhythm.mStepsPerCount, +// mRhythm.mCountPerBar, +// mRhythm.mBarCount); mpRhythmEdit->SetLabel("rhythm"); + + wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL); + + pSizer->Add(pInstrumentPanel, wxSizerFlags().Border().Expand()); + pSizer->Add(pPanel, wxSizerFlags(1).Border().Expand()); + + SetSizer(pSizer); } //----------------------------------------------------------------------------- @@ -1671,7 +1684,7 @@ Instrument2Win(); - Refresh(); //OnPaint(); + Refresh(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/Rhythm.h 2013-04-07 08:08:41 UTC (rev 1007) @@ -26,10 +26,12 @@ #include "Random.h" #include <wx/frame.h> +#include <wx/panel.h> #include <iosfwd> #include <vector> +class JZArrayControl; class JZBarInfo; class JZEventWindow; class JZSong; @@ -252,7 +254,7 @@ //***************************************************************************** //***************************************************************************** -class JZRhythmGeneratorWindow : public wxWindow +class JZRhythmGeneratorWindow : public wxPanel { public: @@ -281,8 +283,6 @@ std::vector<JZRhythm*> mInstruments; - wxPanel* mpInstrumentPanel; - wxSlider* mpStepsPerCountSlider; wxSlider* mpCountsPerBarSlider; wxSlider* mpBarCountSlider; @@ -294,9 +294,12 @@ int mActiveGroup; wxCheckBox* mpRandomCheckBox; - JZArrayEdit* mpLengthEdit; - JZArrayEdit* mpVelocityEdit; - JZRhyArrayEdit* mpRhythmEdit; +// JZArrayEdit* mpLengthEdit; + JZArrayControl* mpLengthEdit; +// JZArrayEdit* mpVelocityEdit; + JZArrayControl* mpVelocityEdit; +// JZRhyArrayEdit* mpRhythmEdit; + JZArrayControl* mpRhythmEdit; DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/SampleCommand.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -498,7 +498,7 @@ { // add all the outputs double y = x; - JZMapper ymap(array.Min(), array.Max(), -1, 1); + JZMapper ymap(array.GetMin(), array.GetMax(), -1, 1); for (int i = 0; i < nfilters; i++) { double amp = fabs(ymap.XToY(array[i])); Modified: trunk/jazz/src/SampleFrame.h =================================================================== --- trunk/jazz/src/SampleFrame.h 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/SampleFrame.h 2013-04-07 08:08:41 UTC (rev 1007) @@ -14,6 +14,7 @@ class JZSampleWindow; class JZSynthDlg; class wxDialog; +class wxPanel; class wxScrollBar; //***************************************************************************** Modified: trunk/jazz/src/Signal2.cpp =================================================================== --- trunk/jazz/src/Signal2.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/Signal2.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -168,7 +168,7 @@ const int N = wav.Size(); JZLineMap<float>xmap(0, N, 0, arr.Size() - 1); - JZLineMap<float>ymap(arr.Min(), arr.Max(), -1, 1); + JZLineMap<float>ymap(arr.GetMin(), arr.GetMax(), -1, 1); for (i = 0; i < N; i++) /* PAT - Original line: wav[i] = ymap(arr[xmap(i)]); */ wav[i] = ymap(arr[xmap(i)]); Modified: trunk/jazz/src/SliderWindow.cpp =================================================================== --- trunk/jazz/src/SliderWindow.cpp 2013-04-07 06:02:14 UTC (rev 1006) +++ trunk/jazz/src/SliderWindow.cpp 2013-04-07 08:08:41 UTC (rev 1007) @@ -25,8 +25,11 @@ #include "Random.h" #include "ToolBar.h" +#include <wx/panel.h> + // These two lines are here to allow cout usage. #include <iostream> + using namespace std; JZSliderWindow::JZSliderWindow( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 06:02:18
|
Revision: 1006 http://sourceforge.net/p/jazzplusplus/code/1006 Author: pstieber Date: 2013-04-07 06:02:14 +0000 (Sun, 07 Apr 2013) Log Message: ----------- Fixed panel width. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-07 05:59:57 UTC (rev 1005) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 06:02:14 UTC (rev 1006) @@ -1411,7 +1411,7 @@ GetClientSize(&Width, &Height); mpInstrumentPanel = - new wxPanel(this, wxID_ANY, wxPoint(x, y), wxSize(Width / 2, Height / 2)); + new wxPanel(this, wxID_ANY, wxPoint(x, y), wxSize(Width, Height / 2)); mpStepsPerCountSlider = new wxSlider( mpInstrumentPanel, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-07 06:00:01
|
Revision: 1005 http://sourceforge.net/p/jazzplusplus/code/1005 Author: pstieber Date: 2013-04-07 05:59:57 +0000 (Sun, 07 Apr 2013) Log Message: ----------- 1. Simplified array code. 2. Added more code to the rhythm generator. 3. Used ostringstream instead of char buf[]. Modified Paths: -------------- trunk/jazz/src/DynamicArray.cpp trunk/jazz/src/DynamicArray.h trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/Resources.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.h trunk/jazz/src/mswin/WindowsPlayer.cpp trunk/jazz/src/mswin/WindowsPlayer.h Modified: trunk/jazz/src/DynamicArray.cpp =================================================================== --- trunk/jazz/src/DynamicArray.cpp 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/DynamicArray.cpp 2013-04-07 05:59:57 UTC (rev 1005) @@ -21,37 +21,3 @@ //***************************************************************************** #include "DynamicArray.h" - -DEFINE_ARRAY(JZIntArray, int) - -JZUniqIds::JZUniqIds() - : mArray(0) -{ - mArray[0] = 1; // 0 is an invalid id -} - -int JZUniqIds::Get() -{ - int i = 0; - while (mArray[i]) - { - ++i; - } - mArray[i] = 1; - return i; -} - -void JZUniqIds::Get(int id) -{ - ++mArray[id]; -} - -int JZUniqIds::Put(int id) -{ - int i = --mArray[id]; - assert(i >= 0); - return i; -} - - -DEFINE_ARRAY(JZVoidPtrArray, void *) Modified: trunk/jazz/src/DynamicArray.h =================================================================== --- trunk/jazz/src/DynamicArray.h 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/DynamicArray.h 2013-04-07 05:59:57 UTC (rev 1005) @@ -22,7 +22,8 @@ #pragma once -#include <assert.h> +#include <cassert> +#include <vector> #define DECLARE_ARRAY(CLASS, TYPE) \ \ @@ -162,27 +163,6 @@ } -DECLARE_ARRAY(JZIntArray, int) - - - -class JZUniqIds -{ - public: - - JZUniqIds(); - int Get(); - void Get(int id); - - // Returns the no of pending references to id. - int Put(int id); - - private: - - JZIntArray mArray; -}; - - class JZBitset { public: @@ -201,18 +181,10 @@ mArray[index(i)] &= ~mask(i); } } - void operator += (int i) - { - mArray[index(i)] |= mask(i); - } - void operator -= (int i) - { - mArray[index(i)] &= ~mask(i); - } private: - JZIntArray mArray; + std::vector<int> mArray; // this works for sizeof(int) >= 4 int index(int i) @@ -224,5 +196,3 @@ return 1 << (i & 31); } }; - -DECLARE_ARRAY(JZVoidPtrArray, void *) Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/Random.cpp 2013-04-07 05:59:57 UTC (rev 1005) @@ -30,9 +30,12 @@ #include <cassert> #include <cstdlib> +#include <sstream> using namespace std; +//***************************************************************************** +//***************************************************************************** double JZRandomGenerator::asDouble() { return double(rand()) / double(RAND_MAX); @@ -40,307 +43,350 @@ JZRandomGenerator rnd; -// Array of probabilities - -JZRndArray::JZRndArray(int nn, int mmin, int mmax) +//***************************************************************************** +// Description: +// Array of probabilities +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRndArray::JZRndArray(int Size, int Min, int Max) + : mArray(Size), + mNull(0), + mMin(Min), + mMax(Max) { - int i; - n = nn; - for (i = 0; i < n; i++) + for (size_t i = 0; i < mArray.size(); ++i) { - mArray[i] = mmin; + mArray[i] = Min; } - min = mmin; - max = mmax; - nul = min > 0 ? min : 0; + mNull = mMin > 0 ? mMin : 0; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRndArray::JZRndArray(const JZRndArray& Other) : mArray(Other.mArray), - n(Other.n), - nul(Other.nul), - min(Other.min), - max(Other.max) + mNull(Other.mNull), + mMin(Other.mMin), + mMax(Other.mMax) { } -void JZRndArray::SetMinMax(int mi, int ma) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRndArray::~JZRndArray() { - min = mi; - max = ma; - nul = min > 0 ? min : 0; - for (int i = 0; i < mArray.GetSize(); i++) +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRndArray::SetMinMax(int Min, int Max) +{ + mMin = Min; + mMax = Max; + mNull = mMin > 0 ? mMin : 0; + for (size_t i = 0; i < mArray.size(); ++i) { - if (mArray[i] < min) + if (mArray[i] < mMin) { - mArray[i] = min; + mArray[i] = mMin; } - else if (mArray[i] > max) + else if (mArray[i] > mMax) { - mArray[i] = max; + mArray[i] = mMax; } } } -JZRndArray::~JZRndArray() -{ -} - -/* PAT - The following ifdef was removed due to the changes implemented in gcc - 3.x. The new gcc is more compatible with Windows. */ -/*#ifdef FOR_MSW*/ +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- double JZRndArray::operator[](double f) - /*#else -double JZRndArray::operator[](double f) const -#endif*/ { int i = (int)f; if (i < 0) + { i = 0; - else if (i >= n - 2) - i = n - 2; - JZMapper Map(i, i+1, mArray[i], mArray[i+1]); + } + else if (i >= mArray.size() - 2) + { + i = mArray.size() - 2; + } + JZMapper Map(i, i + 1, mArray[i], mArray[i+1]); return Map.XToY(f); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRndArray& JZRndArray::operator = (const JZRndArray& Rhs) { if (this != &Rhs) { mArray = Rhs.mArray; - n = Rhs.n; - min = Rhs.min; - max = Rhs.max; - nul = Rhs.nul; + mMin = Rhs.mMin; + mMax = Rhs.mMax; + mNull = Rhs.mNull; } return *this; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRndArray::Random() { return Random(rnd.asDouble()); } -int JZRndArray::Random(double rndval) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZRndArray::Random(double RandonValue) { - double sum, dec; - int i; + assert(!mArray.empty()); - assert(n > 0); - - sum = 0.0; - for (i = 0; i < n; i++) + double Sum = 0.0; + for (size_t i = 0; i < mArray.size(); ++i) { assert(mArray[i] >= 0); - sum += mArray[i]; + Sum += mArray[i]; } - if (sum <= 0) + if (Sum <= 0) + { return 0; + } - dec = sum * rndval * 0.99999; - assert(dec < sum); + double dec = Sum * RandonValue * 0.99999; + assert(dec < Sum); - i = 0; + int i = 0; while (dec >= 0.0) { - dec -= mArray[i]; - i++; + dec -= mArray[i++]; } i--; - assert(i >= 0 && i < n); + assert(i >= 0 && i < mArray.size()); return i; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRndArray::Interval(int seed) { - if (seed < 0) // initial ? - seed = int(rnd.asDouble() * n); + // Test to see if this is the initial call. + if (seed < 0) + { + seed = int(rnd.asDouble() * mArray.size()); + } int delta = Random(); if (rnd.asDouble() < 0.5) + { delta = -delta; - seed = (seed + n + delta) % n; + } + seed = (seed + mArray.size() + delta) % mArray.size(); return seed; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRndArray::Random(int i) { - return rnd.asDouble() * (max - min) < mArray[i]; + return rnd.asDouble() * (mMax - mMin) < mArray[i]; } - -void JZRndArray::SetUnion(JZRndArray &o, int fuzz) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRndArray::SetUnion(JZRndArray& Other, int fuzz) { - for (int i = 0; i < n; i++) + for (size_t i = 0; i < mArray.size(); ++i) { - int val = mArray[i]; - if (o.mArray[i] > val) + int Value = mArray[i]; + if (Other.mArray[i] > Value) { - val = o.mArray[i]; + Value = Other.mArray[i]; } - mArray[i] = Fuzz(fuzz, mArray[i], val); + mArray[i] = Fuzz(fuzz, mArray[i], Value); } } - -void JZRndArray::SetIntersection(JZRndArray &o, int fuzz) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRndArray::SetIntersection(JZRndArray& Other, int fuzz) { - for (int i = 0; i < n; i++) + for (size_t i = 0; i < mArray.size(); ++i) { - int val = mArray[i]; - if (o.mArray[i] < val) + int Value = mArray[i]; + if (Other.mArray[i] < Value) { - val = o.mArray[i]; + Value = Other.mArray[i]; } - mArray[i] = Fuzz(fuzz, mArray[i], val); + mArray[i] = Fuzz(fuzz, mArray[i], Value); } } - -void JZRndArray::SetDifference(JZRndArray &o, int fuzz) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRndArray::SetDifference(JZRndArray& Other, int fuzz) { - JZRndArray tmp(o); + JZRndArray tmp(Other); tmp.SetInverse(tmp.Max()); SetIntersection(tmp, fuzz); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRndArray::SetInverse(int fuzz) { - for (int i = 0; i < n; i++) + for (size_t i = 0; i < mArray.size(); ++i) { - mArray[i] = Fuzz(fuzz, mArray[i], min + max - mArray[i]); + mArray[i] = Fuzz(fuzz, mArray[i], mMin + mMax - mArray[i]); } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRndArray::Fuzz(int fuz, int v1, int v2) const { // interpolate between v1 and v2 - return (fuz - min) * v2 / (max - min) + (max - fuz) * v1 / (max - min); + return (fuz - mMin) * v2 / (mMax - mMin) + (mMax - fuz) * v1 / (mMax - mMin); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRndArray::Clear() { - for (int i = 0; i < n; i++) + for (size_t i = 0; i < mArray.size(); ++i) { - mArray[i] = min; + mArray[i] = mMin; } } - -ostream & operator << (ostream &os, JZRndArray const &a) +//***************************************************************************** +//***************************************************************************** +ostream& operator << (ostream& Os, const JZRndArray& RndArray) { - int i; - - os << a.n << ' ' << a.min << ' ' << a.max << endl; - for (i = 0; i < a.n; i++) + Os + << RndArray.mArray.size() + << ' ' << RndArray.mMin + << ' ' << RndArray.mMax + << '\n'; + for (size_t i = 0; i < RndArray.mArray.size(); ++i) { - os << a.mArray[i] << ' '; + Os << RndArray.mArray[i] << ' '; } - os << endl; - return os; + Os << endl; + return Os; } - -istream & operator >> (istream &is, JZRndArray &a) +//***************************************************************************** +//***************************************************************************** +istream & operator >> (istream& Is, JZRndArray& RndArray) { - int i; - is >> a.n >> a.min >> a.max; - for (i = 0; i < a.n; i++) - is >> a.mArray[i]; - return is; + unsigned Size; + Is >> Size >> RndArray.mMin >> RndArray.mMax; + RndArray.mArray.resize(Size); + for (size_t i = 0; i < RndArray.mArray.size(); ++i) + { + Is >> RndArray.mArray[i]; + } + return Is; } - -// --------------------------------- JZArrayEdit ------------------------------------- - +//***************************************************************************** // length of tickmark line +//***************************************************************************** #define TICK_LINE 0 +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZArrayEdit, wxScrolledWindow) + EVT_SIZE(JZArrayEdit::OnSize) + EVT_MOUSE_EVENTS(JZArrayEdit::OnMouseEvent) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZArrayEdit::JZArrayEdit( - wxFrame *frame, - JZRndArray &ar, + wxFrame* pFrame, + JZRndArray& Array, const wxPoint& Position, const wxSize& Size, int StyleBits) - : wxScrolledWindow(frame, wxID_ANY, Position, Size), - mArray(ar), - n(ar.n), - min(ar.min), - max(ar.max), - nul(ar.nul) + : wxScrolledWindow(pFrame, wxID_ANY, Position, Size), + mArray(Array), + mMin(Array.mMin), + mMax(Array.mMax), + mNull(Array.mNull), + mLabel(), + mpDrawBars(0), + mX(0), + mY(0), + mWidth(Size.GetWidth()), + mHeight(Size.GetHeight()), + mYNull(0), + mDragging(false), + mIndex(-1), + mXMin(0), + mXMax(mArray.Size()), + mEnabled(true), + mStyleBits(StyleBits) { - draw_bars = 0; - enabled = 1; - dragging = 0; - index = -1; - mStyleBits = StyleBits; + int TextWidth, TextHeight; - xmin = 0; - xmax = n; - - x = 0; // draw to topleft corner of canvas - y = 0; - w = Size.GetWidth(); - h = Size.GetHeight(); - - int tw, th; - wxClientDC Dc(this); Dc.SetFont(*wxSMALL_FONT); - Dc.GetTextExtent("123", &tw, &th); + Dc.GetTextExtent("123", &TextWidth, &TextHeight); if (mStyleBits & ARED_XTICKS) { - // leave space for bottomline - h -= (int)th; + // Leave space for the bottom line. + mHeight -= TextHeight; } if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) { - // leave space to display min / max - x = (int)(tw + TICK_LINE); - w -= (int)(tw + TICK_LINE); + // Leave space to display the minimum and maximum + mX = (int)(TextWidth + TICK_LINE); + mWidth -= (int)(TextWidth + TICK_LINE); } - ynul = y + h - h * (nul - min) / (max - min); + mYNull = mY + mHeight - mHeight * (mNull - mMin) / (mMax - mMin); } -BEGIN_EVENT_TABLE(JZArrayEdit, wxScrolledWindow) - EVT_SIZE(JZArrayEdit::OnSize) - EVT_MOUSE_EVENTS(JZArrayEdit::OnMouseEvent) -END_EVENT_TABLE() - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::OnSize(wxSizeEvent& Event) { - w = Event.GetSize().GetWidth(); - h = Event.GetSize().GetHeight(); + mWidth = Event.GetSize().GetWidth(); + mHeight = Event.GetSize().GetHeight(); Event.Skip(); - int tw, th; + int TextWidth, TextHeight; wxClientDC Dc(this); - Dc.GetTextExtent("123", &tw, &th); + Dc.GetTextExtent("123", &TextWidth, &TextHeight); if (mStyleBits & ARED_XTICKS) - h -= (int)th; + { + mHeight -= TextHeight; + } if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) { - x = (int)(tw + TICK_LINE); - w -= (int)(tw + TICK_LINE); + mX = (int)(TextWidth + TICK_LINE); + mWidth -= (int)(TextWidth + TICK_LINE); } - ynul = y + h - h * (nul - min) / (max - min); + mYNull = mY + mHeight - mHeight * (mNull - mMin) / (mMax - mMin); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZArrayEdit::~JZArrayEdit() { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::DrawBar(wxDC& Dc, int i, int black) { if (mStyleBits & ARED_LINES) @@ -350,8 +396,8 @@ Dc.SetPen(*wxWHITE_PEN); } - JZMapper XMap(0, n, 0, w); - JZMapper YMap(min, max, h, 0); + JZMapper XMap(0, mArray.Size(), 0, mWidth); + JZMapper YMap(mMin, mMax, mHeight, 0); int x1 = (int)XMap.XToY(i + 0.5); int y1 = (int)YMap.XToY(mArray[i]); @@ -362,11 +408,11 @@ int y0 = (int)YMap.XToY(mArray[i-1]); Dc.DrawLine(x0, y0, x1, y1); } - if (i < n-1) + if (i < mArray.Size() - 1) { // draw line to next position int x2 = (int)XMap.XToY(i + 1.5); - int y2 = (int)YMap.XToY(mArray[i+1]); + int y2 = (int)YMap.XToY(mArray[i + 1]); Dc.DrawLine(x1, y1, x2, y2); } @@ -380,37 +426,39 @@ int gap = 0; if (mStyleBits & ARED_GAP) { - gap = w / n / 6; - if (!gap && w / n > 3) + gap = mWidth / mArray.Size() / 6; + if (!gap && mWidth / mArray.Size() > 3) + { gap = 1; + } } int xbar, ybar, wbar, hbar; - wbar = w / n - 2 * gap; - xbar = x + i * w / n + gap; - hbar = h * (mArray[i] - nul) / (max - min); + wbar = mWidth / mArray.Size() - 2 * gap; + xbar = mX + i * mWidth / mArray.Size() + gap; + hbar = mHeight * (mArray[i] - mNull) / (mMax - mMin); if (mStyleBits & ARED_BLOCKS) { /* - ybar = ynul - hbar; + ybar = mYNull - hbar; if (hbar < 0) hbar = -hbar; hbar = (hbar < 2) ? hbar : 2; */ int hblk = 12; - ybar = ynul - hbar - hblk/2; + ybar = mYNull - hbar - hblk/2; hbar = hblk; - if (ybar < y) + if (ybar < mY) { - int d = y - ybar; + int d = mY - ybar; ybar += d; hbar -= d; } - if (ybar + hbar > y + h) + if (ybar + hbar > mY + mHeight) { - int d = (ybar + hbar) - (y + h); + int d = (ybar + hbar) - (mY + mHeight); hbar -= d; } if (hbar < 2) @@ -420,14 +468,16 @@ if (hbar < 0) { - ybar = ynul; + ybar = mYNull; hbar = -hbar; } else - ybar = ynul - hbar; + ybar = mYNull - hbar; - if (ybar == y) + if (ybar == mY) + { ++ybar, --hbar; + } if (!black) { @@ -445,23 +495,29 @@ } } -const char *JZArrayEdit::GetXText(int xval) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +string JZArrayEdit::GetXText(int XValue) { - static char buf[8]; - sprintf(buf, "%d", xval); - return buf; + ostringstream Oss; + Oss << XValue; + return Oss.str(); } -const char *JZArrayEdit::GetYText(int yval) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +string JZArrayEdit::GetYText(int YValue) { - static char buf[8]; - sprintf(buf, "%d", yval); - return buf; + ostringstream Oss; + Oss << YValue; + return Oss.str(); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::DrawXTicks(wxDC& Dc) { - int tw, th; + int TextWidth, TextHeight; if (!(mStyleBits & ARED_XTICKS)) { @@ -471,31 +527,38 @@ Dc.SetFont(*wxSMALL_FONT); // compute tickmark x-distance - Dc.GetTextExtent("-123", &tw, &th); - int max_labels = (int)(w / (tw + tw/2)); - if (max_labels > 0) + Dc.GetTextExtent("-123", &TextWidth, &TextHeight); + int MaxLabels = (int)(mWidth / (TextWidth + TextWidth/2)); + if (MaxLabels > 0) { - int step = (xmax - xmin + 1) / max_labels; - if (step <= 0) - step = 1; - for (int val = xmin; val <= xmax; val += step) + int Step = (mXMax - mXMin + 1) / MaxLabels; + if (Step <= 0) { - const char *buf = GetXText(val); - //sprintf(buf, "%d", val); - Dc.GetTextExtent((char *)buf, &tw, &th); - float yy = y + h; - float xx = x + w * (val - xmin) / (xmax - xmin + 1); - xx -= tw/2; // center text - xx += 0.5 * w / n; // middle of bar - Dc.DrawText(buf, (int)xx, (int)yy); - //Dc.DrawLine(x - TICK_LINE, yy, x, yy); + Step = 1; } + for (int Value = mXMin; Value <= mXMax; Value += Step) + { + string String = GetXText(Value); + Dc.GetTextExtent(String, &TextWidth, &TextHeight); + int YPosition = mY + mHeight; + float XPosition = mX + mWidth * (Value - mXMin) / (mXMax - mXMin + 1); + + // Center text. + XPosition -= TextWidth / 2; + + // Middle of bar. + XPosition += 0.5 * mWidth / mArray.Size(); + + Dc.DrawText(String, (int)XPosition, YPosition); +// Dc.DrawLine(mX - TICK_LINE, YPosition, mX, YPosition); + } } Dc.SetFont(*wxNORMAL_FONT); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::DrawYTicks(wxDC& Dc) { @@ -503,64 +566,70 @@ if (mStyleBits & ARED_YTICKS) { - // compute tickmark y-distance - int tw, th; - Dc.GetTextExtent("-123", &tw, &th); - int max_labels = (int)(h / (th + th/2)); - if (max_labels > 0) + // Compute tickmark y-distance. + int TextWidth, TextHeight; + Dc.GetTextExtent("-123", &TextWidth, &TextHeight); + int MaxLabels = (int)(mHeight / (TextHeight + TextHeight / 2)); + if (MaxLabels > 0) { - int step = (max - min) / max_labels; - if (step <= 0) - step = 1; - for (int val = min; val < max; val += step) + int Step = (mMax - mMin) / MaxLabels; + if (Step <= 0) { - const char *buf = GetYText(val); - //sprintf(buf, "%d", val); - Dc.GetTextExtent((char *)buf, &tw, &th); - float yy = y + h - h * (val - min) / (max - min) - th/2; - Dc.DrawText(buf, x - tw - TICK_LINE, (int)yy); - //Dc.DrawLine(x - TICK_LINE, yy, x, yy); + Step = 1; } + for (int Value = mMin; Value < mMax; Value += Step) + { + string String = GetYText(Value); + Dc.GetTextExtent(String, &TextWidth, &TextHeight); + int YPosition = + mY + mHeight - mHeight * (Value - mMin) / (mMax - mMin) - + TextHeight / 2; + Dc.DrawText(String, mX - TextWidth - TICK_LINE, YPosition); +// Dc.DrawLine(mX - TICK_LINE, YPosition, mX, YPosition); + } } } - else if (mStyleBits & ARED_MINMAX) { - // min/max - int tw, th; - char buf[20]; - sprintf(buf, "%d", max); - Dc.GetTextExtent(buf, &tw, &th); - Dc.DrawText(buf, x - tw, y); - sprintf(buf, "%d", min); - Dc.GetTextExtent(buf, &tw, &th); - Dc.DrawText(buf, x - tw, y + h - th); + // mMin/mMax + int TextWidth, TextHeight; + ostringstream Oss; + Oss << mMax; + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + Dc.DrawText(Oss.str(), mX - TextWidth, mY); + + Oss.str(""); + + Oss << mMin; + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + Dc.DrawText(Oss.str(), mX - TextWidth, mY + mHeight - TextHeight); } Dc.SetFont(*wxNORMAL_FONT); - } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::DrawLabel(wxDC& Dc) { Dc.SetFont(*wxSMALL_FONT); if (!mLabel.empty()) { - Dc.DrawText(mLabel.c_str(), x + 5, y + 2); + Dc.DrawText(mLabel, mX + 5, mY + 2); } Dc.SetFont(*wxNORMAL_FONT); } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::OnDraw(wxDC& Dc) { int i; // surrounding rectangle Dc.Clear(); - if (enabled) + if (mEnabled) { Dc.SetBrush(*wxWHITE_BRUSH); } @@ -570,14 +639,14 @@ } Dc.SetPen(*wxBLACK_PEN); - if (w && h) + if (mWidth && mHeight) { - Dc.DrawRectangle(x, y, w, h); + Dc.DrawRectangle(mX, mY, mWidth, mHeight); } // sliders Dc.SetBrush(*wxBLACK_BRUSH); - for (i = 0; i < n; ++i) + for (i = 0; i < mArray.Size(); ++i) { DrawBar(Dc, i, 1); } @@ -586,154 +655,158 @@ DrawLabel(Dc); DrawYTicks(Dc); DrawNull(Dc); - if (draw_bars) + if (mpDrawBars) { - draw_bars->DrawBars(Dc); + mpDrawBars->DrawBars(Dc); } } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::DrawNull(wxDC& Dc) { + Dc.SetPen(*wxCYAN_PEN); - Dc.SetPen(*wxCYAN_PEN); - // draw y-null line - if (min < nul && nul < max) - Dc.DrawLine(x, ynul, x+w, ynul); - // draw x-null line - if (xmin < 0 && 0 < xmax) + // Draw y-null line. + if (mMin < mNull && mNull < mMax) { - int x0 = w * (0 - xmin) / (xmax - xmin); - Dc.DrawLine(x0, y, x0, y + h); + Dc.DrawLine(mX, mYNull, mX + mWidth, mYNull); } + + // Draw x-null line. + if (mXMin < 0 && 0 < mXMax) + { + int x0 = mWidth * (0 - mXMin) / (mXMax - mXMin); + Dc.DrawLine(x0, mY, x0, mY + mHeight); + } + Dc.SetPen(*wxBLACK_PEN); } - - -void JZArrayEdit::SetXMinMax(int xmi, int xma) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayEdit::SetXMinMax(int XMin, int XMax) { - xmin = xmi; - xmax = xma; + mXMin = XMin; + mXMax = XMax; } -int JZArrayEdit::Index(wxMouseEvent& MouseEvent) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZArrayEdit::GetIndex(wxMouseEvent& MouseEvent) { - int ex, ey; - MouseEvent.GetPosition(&ex, &ey); - int i = (int)( ((short)ex - x) * n / w); - i = i < 0 ? 0 : i; - i = i >= n ? n-1 : i; - return i; + int EventX, EventY; + MouseEvent.GetPosition(&EventX, &EventY); + int Index = (int)((EventX - mX) * mArray.Size() / mWidth); + if (Index < 0) + { + Index = 0; + } + if (Index >= mArray.Size()) + { + Index = mArray.Size() - 1; + } + return Index; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZArrayEdit::Dragging(wxMouseEvent& MouseEvent) { - if (!dragging) + if (!mDragging) { return 0; } - if (index < 0) + if (mIndex < 0) { - index = Index(MouseEvent); + mIndex = GetIndex(MouseEvent); } wxClientDC Dc(this); // PORTING this is evil and shoud go - int val = nul; + int Value = mNull; if (MouseEvent.LeftIsDown()) { - int ex, ey; - MouseEvent.GetPosition(&ex, &ey); + int EventX, EventY; + MouseEvent.GetPosition(&EventX, &EventY); -#if 0 - { - // in msw ex,ey are 65536 for negative values! - char buf[500]; - sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, MouseEvent.ShiftDown()); - Dc.DrawText(buf, 50, 50); - } -#endif - - // $blk$ val = (int)( (y + h - (short)ey) * (max - min) / h + min); - val = (int)( (double)(y + h - ey) * (max - min) / h + min + 0.5); - val = val > max ? max : val; - val = val < min ? min : val; + Value = (int)((double)(mY + mHeight - EventY) * (mMax - mMin) / mHeight + + mMin + 0.5); + Value = Value > mMax ? mMax : Value; + Value = Value < mMin ? mMin : Value; } if (MouseEvent.ShiftDown()) { - int k; - for (k = 0; k < n; k++) + for (int k = 0; k < mArray.Size(); ++k) { - DrawBar(Dc, k, 0); - mArray[k] = val; + mArray[k] = Value; DrawBar(Dc, k, 1); - } } else if (MouseEvent.ControlDown()) { - DrawBar(Dc, index, 0); - mArray[index] = val; - DrawBar(Dc, index, 1); + DrawBar(Dc, mIndex, 0); + mArray[mIndex] = Value; + DrawBar(Dc, mIndex, 1); } else { - int i = Index(MouseEvent); + int i = GetIndex(MouseEvent); int k = i; - if (i < index) - for (; i <= index; i++) + if (i < mIndex) + for (; i <= mIndex; ++i) { DrawBar(Dc, i, 0); - mArray[i] = val; + mArray[i] = Value; DrawBar(Dc, i, 1); } else - for (; i >= index; i--) + for (; i >= mIndex; --i) { DrawBar(Dc, i, 0); - mArray[i] = val; + mArray[i] = Value; DrawBar(Dc, i, 1); } - index = k; + mIndex = k; } return 0; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZArrayEdit::ButtonDown(wxMouseEvent& MouseEvent) { #ifdef __WXMSW__ CaptureMouse(); #endif - dragging = 1; - index = Index(MouseEvent); + mDragging = true; + mIndex = GetIndex(MouseEvent); Dragging(MouseEvent); return 0; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZArrayEdit::ButtonUp(wxMouseEvent& MouseEvent) { #ifdef __WXMSW__ ReleaseMouse(); #endif - dragging = 0; - index = -1; -// wxClientDC Dc(this); // PORTING this is evil and shoud go -// DrawLabel(Dc); -// DrawNull(Dc); + mDragging = false; + mIndex = -1; Refresh(); return 0; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZArrayEdit::OnMouseEvent(wxMouseEvent& MouseEvent) { - if (!enabled) + if (!mEnabled) { return; } @@ -751,58 +824,66 @@ } } -void JZArrayEdit::Enable(int e) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayEdit::SetEnabled(bool Enabled) { - enabled = e; + mEnabled = Enabled; } -void JZArrayEdit::SetLabel(char const* pLabel) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayEdit::SetLabel(const string& Label) { - mLabel = pLabel; + mLabel = Label; } -void JZArrayEdit::SetYMinMax(int mi, int ma) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayEdit::SetYMinMax(int YMin, int YMax) { - mArray.SetMinMax(mi, ma); - ynul = y + h - h * (nul - min) / (max - min); + mArray.SetMinMax(YMin, YMax); + mYNull = mY + mHeight - mHeight * (mNull - mMin) / (mMax - mMin); } -void JZArrayEdit::DrawBarLine(wxDC& Dc, int xx) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayEdit::DrawBarLine(wxDC& Dc, int XPosition) { -// cerr << "x: " << x << " xx: " << xx << endl; - if (xx > x && xx + 1 < x + w) + if (XPosition > mX && XPosition + 1 < mX + mWidth) { Dc.SetPen(*wxLIGHT_GREY_PEN); - Dc.DrawLine(xx, y + 1, xx, y + h - 2); + Dc.DrawLine(XPosition, mY + 1, XPosition, mY + mHeight - 2); Dc.SetPen(*wxBLACK_PEN); } } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhyArrayEdit::JZRhyArrayEdit( - wxFrame *parent, + wxFrame* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, int StyleBits) - : JZArrayEdit(parent, Array, Position, Size, StyleBits) + : JZArrayEdit(pParent, Array, Position, Size, StyleBits), + mStepsPerCount(4), + mCountPerBar(4) { - steps_per_count = 4; - count_per_bar = 4; - n_bars = 4; } -void JZRhyArrayEdit::SetMeter(int s, int c, int b) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhyArrayEdit::SetMeter(int StepsPerCount, int CountPerBar, int BarCount) { - steps_per_count = s; - count_per_bar = c; - n_bars = b; - mArray.Resize(s * c * b); - SetXMinMax(1, s * c * b); + mStepsPerCount = StepsPerCount; + mCountPerBar = CountPerBar; + mArray.Resize(StepsPerCount * CountPerBar * BarCount); + SetXMinMax(1, StepsPerCount * CountPerBar * BarCount); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhyArrayEdit::DrawXTicks(wxDC& Dc) { if (!(mStyleBits & ARED_RHYTHM)) @@ -811,23 +892,22 @@ return; } - char buf[20]; - int tw, th; + assert(mStepsPerCount && mCountPerBar); Dc.SetFont(*wxSMALL_FONT); // tick marks - assert(steps_per_count && count_per_bar && n_bars); - int i; - for (i = 0; i < n; i += steps_per_count) + int TextWidth, TextHeight; + for (int i = 0; i < mArray.Size(); i += mStepsPerCount) { - int mark = (i / steps_per_count) % count_per_bar + 1; - sprintf(buf, "%d", mark); - int yy = y + h; - int xx = (int)(x + (i + 0.5) * w / n); - Dc.GetTextExtent(buf, &tw, &th); - xx -= (int)(tw/2.0); - Dc.DrawText(buf, xx, yy); + int mark = (i / mStepsPerCount) % mCountPerBar + 1; + ostringstream Oss; + Oss << mark; + int YPosition = mY + mHeight; + int XPosition = (int)(mX + (i + 0.5) * mWidth / mArray.Size()); + Dc.GetTextExtent(Oss.str(), &TextWidth, &TextHeight); + XPosition -= (int)(TextWidth / 2.0); + Dc.DrawText(Oss.str(), XPosition, YPosition); } Dc.SetFont(*wxNORMAL_FONT); } Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/Random.h 2013-04-07 05:59:57 UTC (rev 1005) @@ -25,10 +25,12 @@ #include <wx/scrolwin.h> #include <iostream> +#include <vector> #include "DynamicArray.h" - +//***************************************************************************** +//***************************************************************************** class JZRandomGenerator { public: @@ -38,37 +40,31 @@ extern JZRandomGenerator rnd; -#undef min -#undef max - - -// array of probabilities - +//***************************************************************************** +// Description: +// Array of probabilities. +//***************************************************************************** class JZRndArray { friend class JZArrayEdit; - protected: + public: - JZIntArray mArray; - int n; // number of elements in array - int nul, min, max; + JZRndArray(int Size, int Min, int Max); + JZRndArray & operator = (const JZRndArray &); + JZRndArray(JZRndArray const &); - public: + virtual ~JZRndArray(); - int Null() + int GetNull() { - return nul; + return mNull; } - void SetNull(int n) + void SetNull(int Null) { - nul = n; + mNull = Null; } - JZRndArray(int n, int min, int max); - JZRndArray & operator = (const JZRndArray &); - JZRndArray(JZRndArray const &); - virtual ~JZRndArray(); int &operator[] (int i) { return mArray[i]; @@ -77,44 +73,41 @@ { return mArray[i]; } - /* PAT - The following ifdef was removed due to changes in gcc 3.x. If it - needs to be put back for compatibility purposes, it will need to return - in an alternate form. */ - /*#ifdef FOR_MSW*/ double operator[](double f); float operator[](float f) { - /*#else - double operator[](double f) const; - float operator[](float f) const - { - #endif*/ return (float)operator[]((double)f); } int Size() const { - return n; + return mArray.size(); } int Min() const { - return min; + return mMin; } int Max() const { - return max; + return mMax; } - void SetMinMax(int min, int max); + void SetMinMax(int Min, int Max); void Resize(int nn) { - n = nn; + mArray.resize(nn); } friend std::ostream & operator << (std::ostream &, JZRndArray const &); friend std::istream & operator >> (std::istream &, JZRndArray &); - int Random(); // returns index 0..n-1 (arrayvalues -> empiric distribution) - int Random(double rndval); // returns index 0..n-1 (arrayvalues -> empiric distribution) - int Random(int i); // return 0/1 + // Returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(); + + // returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(double rndval); + + // return 0/1 + int Random(int i); + int Interval(int seed); void SetUnion(JZRndArray &o, int fuzz); @@ -123,9 +116,15 @@ void SetInverse(int fuzz); int Fuzz(int fuzz, int v1, int v2) const; void Clear(); + + protected: + + std::vector<int> mArray; + int mNull, mMin, mMax; }; - +//***************************************************************************** +//***************************************************************************** #define ARED_GAP 1 #define ARED_XTICKS 2 #define ARED_YTICKS 4 @@ -134,7 +133,8 @@ #define ARED_BLOCKS 32 #define ARED_LINES 64 - +//***************************************************************************** +//***************************************************************************** class JZArrayEditDrawBars { public: @@ -146,38 +146,10 @@ virtual void DrawBars(wxDC& Dc) = 0; }; - +//***************************************************************************** +//***************************************************************************** class JZArrayEdit : public wxScrolledWindow { - protected: - - // paint position - int x, y, w, h, ynul; - void DrawBar(wxDC& Dc, int i, int black); - - int dragging; // Dragging-Event valid - int index; // ctrl down: drag this one - - JZRndArray& mArray; - int &n, &min, &max, &nul; // shorthand for mArray.n, mArray.min, ... - wxString mLabel; - JZArrayEditDrawBars *draw_bars; - - // array size is mapped to this range for x-tick marks - int xmin, xmax; - - virtual void DrawXTicks(wxDC& Dc); - virtual void DrawYTicks(wxDC& Dc); - virtual void DrawLabel(wxDC& Dc); - virtual void DrawNull(wxDC& Dc); - int Index(wxMouseEvent& MouseEvent); - - int enabled; - int mStyleBits; - - virtual const char *GetXText(int xval); // Text for x-tickmarks - virtual const char *GetYText(int yval); // Text for y-tickmarks - public: JZArrayEdit( @@ -196,42 +168,88 @@ virtual int ButtonDown(wxMouseEvent& MouseEvent); virtual int ButtonUp(wxMouseEvent& MouseEvent); - virtual void SetLabel(char const *llabel); - void Enable(int enable = 1); + virtual void SetLabel(const std::string& Label); + + void SetEnabled(bool Enabled = true); + void SetStyle(int StyleBits) { mStyleBits = StyleBits; } - // min and max value in array (both values inclusive) - void SetYMinMax(int min, int max); - // for display x-axis only, does not resize the array (both values inclusive) - void SetXMinMax(int xmin, int xmax); - void DrawBarLine (wxDC& Dc, int xx); - void SetDrawBars(JZArrayEditDrawBars *x) + + // Minimum and maximum value in array (both values inclusive) + void SetYMinMax(int Min, int Max); + + // For display x-axis only, does not resize the array (both values inclusive) + void SetXMinMax(int XMin, int XMax); + + void DrawBarLine(wxDC& Dc, int xx); + void SetDrawBars(JZArrayEditDrawBars* pDrawBars) { - draw_bars = x; + mpDrawBars = pDrawBars; } + void Init() { } + protected: + + void DrawBar(wxDC& Dc, int i, int black); + + virtual void DrawXTicks(wxDC& Dc); + virtual void DrawYTicks(wxDC& Dc); + virtual void DrawLabel(wxDC& Dc); + virtual void DrawNull(wxDC& Dc); + int GetIndex(wxMouseEvent& MouseEvent); + + virtual std::string GetXText(int XValue); // Text for x-tickmarks + virtual std::string GetYText(int YValue); // Text for y-tickmarks + + protected: + + JZRndArray& mArray; + + // Shorthand for mArray.mMin, mArray.mMax, ... + int& mMin; + int& mMax; + int& mNull; + + std::string mLabel; + JZArrayEditDrawBars* mpDrawBars; + + // paint position + int mX, mY, mWidth, mHeight, mYNull; + + // Dragging flag. + bool mDragging; + + // If ctrl is pushed: drag this one. + int mIndex; + + // Array size is mapped to this range for x-tick marks. + int mXMin, mXMax; + + bool mEnabled; + int mStyleBits; + DECLARE_EVENT_TABLE() }; - - +//***************************************************************************** +//***************************************************************************** class JZRhyArrayEdit : public JZArrayEdit { public: JZRhyArrayEdit( - wxFrame *parent, + wxFrame* pParent, JZRndArray& Array, const wxPoint& Position, const wxSize& Size, - int StyleBits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); + int StyleBits = ARED_GAP | ARED_XTICKS | ARED_RHYTHM); - void SetMeter(int steps_per_count, int count_per_bar, int n_bars); + void SetMeter(int StepsPerCount, int CountPerBar, int BarCount); protected: @@ -239,7 +257,6 @@ private: - int steps_per_count; - int count_per_bar; - int n_bars; + int mStepsPerCount; + int mCountPerBar; }; Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/Resources.h 2013-04-07 05:59:57 UTC (rev 1005) @@ -149,3 +149,12 @@ // JZSamplesDialog resource IDs. #define IDC_BN_SD_FILE_SELECT_BROWSE (wxID_HIGHEST + 1240) + +// Rhythm window resource IDs. +#define IDC_SL_RHYTHM_STEPS_PER_COUNT (wxID_HIGHEST + 1250) +#define IDC_SL_RHYTHM_COUNTS_PER_BAR (wxID_HIGHEST + 1251) +#define IDC_SL_RHYTHM_BAR_COUNT (wxID_HIGHEST + 1252) +#define IDC_LB_RHYTHM_INSTRUMENTS (wxID_HIGHEST + 1253) +#define IDC_SL_RHYTHM_GROUP_CONTRIB (wxID_HIGHEST + 1254) +#define IDC_SL_RHYTHM_GROUP_LISTEN (wxID_HIGHEST + 1255) +#define IDC_CB_RHYTHM_RANDOMIZE (wxID_HIGHEST + 1258) Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-06 17:42:24 UTC (rev 1004) +++ trunk/jazz/src/Rhythm.cpp 2013-04-07 05:59:57 UTC (rev 1005) @@ -45,9 +45,11 @@ #include <wx/menu.h> #include <wx/msgdlg.h> #include <wx/slider.h> +#include <wx/stattext.h> #include <wx/toolbar.h> #include <fstream> +#include <iostream> #include <sstream> using namespace std; @@ -61,247 +63,286 @@ #include "Bitmaps/rrggen.xpm" #include "Bitmaps/help.xpm" -void tRhyGroup::write(ostream& Os) const +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythmGroup::JZRhythmGroup() + : mListen(0), + mContrib(0) { - Os << listen << ' '; - Os << contrib << ' '; } -void tRhyGroup::read(istream& Is, int version) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGroup::Write(ostream& Os) const { - Is >> listen; - Is >> contrib; + Os << mListen << ' '; + Os << mContrib << ' '; } -void JZRhythmGroups::write(ostream& Os) const +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGroup::Read(istream& Is, int Version) { + Is >> mListen; + Is >> mContrib; +} + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGroups::Write(ostream& Os) const +{ for (int i = 0; i < MAX_GROUPS; i++) { - g[i].write(Os); + mRhythmGroups[i].Write(Os); } Os << endl; } -void JZRhythmGroups::read(istream& Is, int version) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGroups::Read(istream& Is, int Version) { for (int i = 0; i < MAX_GROUPS; i++) { - g[i].read(Is, version); + mRhythmGroups[i].Read(Is, Version); } } - - // pseudo key nr's for harmony browser and sound effects static const int MODE_ALL_OF = -1; static const int MODE_ONE_OF = -2; static const int MODE_PIANO = -3; static const int MODE_CONTROL = -4; - -JZRhythm::JZRhythm(int k) +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythm::JZRhythm(int Key) : mLabel("random rhythm"), - rhythm(64, 0, 100), - length( 8, 0, 100), - veloc (32, 0, 100), - history(64, 0, 100) + mRhythmArray(64, 0, 100), + mLengthArray(8, 0, 100), + mVelocityArray(32, 0, 100), + mStepsPerCount(4), + mCountPerBar(4), + mBarCount(1), + mKeyCount(1), + mMode(MODE_ALL_OF), + mParameter(0), + mRandomizeFlag(true), + mRhythmGroups(), + mHistoryArray(64, 0, 100), + mStartClock(0), + mNextClock(0) { - mode = MODE_ALL_OF; - n_keys = 1; - keys[0] = k; - parm = 0; - steps_per_count = 4; - count_per_bar = 4; - n_bars = 1; - randomize = true; + mKeys[0] = Key; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythm::JZRhythm(const JZRhythm& Other) - : rhythm(Other.rhythm), - length(Other.length), - veloc (Other.veloc), - groups(Other.groups), - history(Other.history) + : mLabel(Other.mLabel), + mRhythmArray(Other.mRhythmArray), + mLengthArray(Other.mLengthArray), + mVelocityArray(Other.mVelocityArray), + mStepsPerCount(Other.mStepsPerCount), + mCountPerBar(Other.mCountPerBar), + mBarCount(Other.mBarCount), + mKeyCount(Other.mKeyCount), + mMode(Other.mMode), + mParameter(Other.mParameter), + mRandomizeFlag(Other.mRandomizeFlag), + mRhythmGroups(Other.mRhythmGroups), + mHistoryArray(Other.mHistoryArray), + mStartClock(Other.mStartClock), + mNextClock(Other.mNextClock) { - mode = Other.mode; - n_keys = Other.n_keys; - for (int i = 0; i < n_keys; i++) + for (int i = 0; i < mKeyCount; i++) { - keys[i] = Other.keys[i]; + mKeys[i] = Other.mKeys[i]; } - parm = Other.parm; - n_bars = Other.n_bars; - steps_per_count = Other.steps_per_count; - count_per_bar = Other.count_per_bar; - randomize = Other.randomize; - groups = Other.groups; - - mLabel = Other.mLabel; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythm& JZRhythm::operator = (const JZRhythm& Rhs) { if (this != &Rhs) { - mode = Rhs.mode; - n_keys = Rhs.n_keys; - for (int i = 0; i < n_keys; i++) + mLabel = Rhs.mLabel; + mRhythmArray = Rhs.mRhythmArray; + mLengthArray = Rhs.mLengthArray; + mVelocityArray = Rhs.mVelocityArray; + mStepsPerCount = Rhs.mStepsPerCount; + mCountPerBar = Rhs.mCountPerBar; + mBarCount = Rhs.mBarCount; + mKeyCount = Rhs.mKeyCount; + for (int i = 0; i < mKeyCount; ++i) { - keys[i] = Rhs.keys[i]; + mKeys[i] = Rhs.mKeys[i]; } - rhythm = Rhs.rhythm; - length = Rhs.length; - veloc = Rhs.veloc; - parm = Rhs.parm; - n_bars = Rhs.n_bars; - steps_per_count = Rhs.steps_per_count; - count_per_bar = Rhs.count_per_bar; - randomize = Rhs.randomize; - groups = Rhs.groups; - history = Rhs.history; - - mLabel = Rhs.mLabel; + mMode = Rhs.mMode; + mParameter = Rhs.mParameter; + mRandomizeFlag = Rhs.mRandomizeFlag; + mRhythmGroups = Rhs.mRhythmGroups; + mHistoryArray = Rhs.mHistoryArray; + mStartClock = Rhs.mStartClock; + mNextClock = Rhs.mNextClock; } return *this; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythm::~JZRhythm() { } - -void JZRhythm::write(ostream& Os) const +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythm::Write(ostream& Os) const { - Os << rhythm; - Os << length; - Os << veloc; + Os << mRhythmArray; + Os << mLengthArray; + Os << mVelocityArray; - Os << steps_per_count << ' '; - Os << count_per_bar << ' '; - Os << n_bars << ' '; - Os << mode << ' '; - Os << n_keys << ' '; - for (int i = 0; i < n_keys; i++) + Os << mStepsPerCount << ' '; + Os << mCountPerBar << ' '; + Os << mBarCount << ' '; + Os << mMode << ' '; + Os << mKeyCount << ' '; + for (int i = 0; i < mKeyCount; i++) { - Os << keys[i] << ' '; + Os << mKeys[i] << ' '; } - Os << parm << endl; + Os << mParameter << endl; WriteString(Os, mLabel.c_str()) << endl; - Os << randomize << ' '; - groups.write(Os); + Os << mRandomizeFlag << ' '; + mRhythmGroups.Write(Os); } - -void JZRhythm::read(istream& Is, int version) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythm::Read(istream& Is, int Version) { - Is >> rhythm; - Is >> length; - Is >> veloc; + Is >> mRhythmArray; + Is >> mLengthArray; + Is >> mVelocityArray; - Is >> steps_per_count; - Is >> count_per_bar; - Is >> n_bars; - Is >> mode; - if (mode >= 0) // old format + Is >> mStepsPerCount; + Is >> mCountPerBar; + Is >> mBarCount; + Is >> mMode; + if (mMode >= 0) // old format { - n_keys = 1; - keys[0] = mode; - mode = MODE_ALL_OF; + mKeyCount = 1; + mKeys[0] = mMode; + mMode = MODE_ALL_OF; } else { - Is >> n_keys; - for (int i = 0; i < n_keys; i++) + Is >> mKeyCount; + for (int i = 0; i < mKeyCount; i++) { - Is >> keys[i]; + Is >> mKeys[i]; } } - Is >> parm; + Is >> mParameter; string Label; ReadString(Is, Label); SetLabel(Label.c_str()); - if (version > 1) + if (Version > 1) { - Is >> randomize; - groups.read(Is, version); + Is >> mRandomizeFlag; + mRhythmGroups.Read(Is, Version); } } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythm::SetLabel(const string& Label) { mLabel = Label; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRhythm::Clock2i(long clock, const JZBarInfo& BarInfo) const { - int clocks_per_step = BarInfo.GetTicksPerBar() / (steps_per_count * count_per_bar); - return (int)(((clock - start_clock) / clocks_per_step) % rhythm.Size()); + int clocks_per_step = BarInfo.GetTicksPerBar() / (mStepsPerCount * mCountPerBar); + return (int)(((clock - mStartClock) / clocks_per_step) % mRhythmArray.Size()); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZRhythm::ClocksPerStep(const JZBarInfo& BarInfo) const { - return BarInfo.GetTicksPerBar() / (steps_per_count * count_per_bar); + return BarInfo.GetTicksPerBar() / (mStepsPerCount * mCountPerBar); } - -void JZRhythm::GenInit(long frc) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythm::GenInit(int StartClock) { int i; - start_clock = frc; - next_clock = frc; + mStartClock = StartClock; + mNextClock = StartClock; - int nn = rhythm.Size(); - history.Resize(nn); + int Size = mRhythmArray.Size(); + mHistoryArray.Resize(Size); - // initialize history with random values - for (i = 0; i < nn; i++) + // Initialize history with random values. + for (i = 0; i < Size; ++i) { - history[i] = history.Min(); + mHistoryArray[i] = mHistoryArray.Min(); } - for (i = 0; i < nn; i++) + for (i = 0; i < Size; i++) { - if (rhythm.Random(i)) + if (mRhythmArray.Random(i)) { - history[i] = history.Max(); - i += length.Random(); + mHistoryArray[i] = mHistoryArray.Max(); + i += mLengthArray.Random(); } } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythm::GenerateEvent(JZTrack* pTrack, long clock, short vel, short len) { int chan = pTrack->mChannel - 1; // generate key events - if (mode == MODE_ALL_OF) + if (mMode == MODE_ALL_OF) { - for (int ii = 0; ii < n_keys; ii++) + for (int ii = 0; ii < mKeyCount; ii++) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[ii], vel, len); + JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, mKeys[ii], vel, len); pTrack->Put(k); } } - else if (mode == MODE_ONE_OF) + else if (mMode == MODE_ONE_OF) { - int ii = (int)(rnd.asDouble() * n_keys); - if (ii < n_keys) + int ii = (int)(rnd.asDouble() * mKeyCount); + if (ii < mKeyCount) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[ii], vel, len); + JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, mKeys[ii], vel, len); pTrack->Put(k); } } - else if (mode == MODE_CONTROL) + else if (mMode == MODE_CONTROL) { // generate controller - JZControlEvent* c = new JZControlEvent(clock, chan, parm - 1, vel); + JZControlEvent* c = new JZControlEvent(clock, chan, mParameter - 1, vel); pTrack->Put(c); } else @@ -312,51 +353,51 @@ #if 0 -void JZRhythm::Generate(JZTrack* pTrack, long fr_clock, long to_clock, long ticks_per_bar) +void JZRhythm::Generate(JZTrack* pTrack, int FromClock, int ToClock, int TicksPerBar) { int chan = pTrack->Channel - 1; - long clock = fr_clock; + long clock = FromClock; - long clocks_per_step = ticks_per_bar / (steps_per_count * count_per_bar); - long total_steps = (to_clock - fr_clock) / clocks_per_step; + long clocks_per_step = TicksPerBar / (mStepsPerCount * mCountPerBar); + long total_steps = (ToClock - FromClock) / clocks_per_step; - while (clock < to_clock) + while (clock < ToClock) { - int i = ((clock - fr_clock) / clocks_per_step) % rhythm.Size(); - if (rhythm.Random(i)) + int i = ((clock - FromClock) / clocks_per_step) % mRhythmArray.Size(); + if (mRhythmArray.Random(i)) { // put event here int rndval; - if (randomize) + if (mRandomizeFlag) { // keep seed < 1.0 - rndval = veloc.Random((double)rhythm[i] / ((double)rhythm.Max() + 0.001)); + rndval = mVelocityArray.Random((double)mRhythmArray[i] / ((double)mRhythmArray.Max() + 0.001)); } else { - rndval = veloc.Random(); + rndval = mVelocityArray.Random(); } - short vel = rndval * 127 / veloc.Size() + 1; - short len = (length.Random() + 1) * clocks_per_step; + short vel = rndval * 127 / mVelocityArray.Size() + 1; + short len = (mLengthArray.Random() + 1) * clocks_per_step; // generate keys from harmony browser if (key == CHORD_KEY || key == BASS_KEY) { if (gpHarmonyBrowser) { - long step = (clock - fr_clock) * total_steps / (to_clock - fr_clock); - int keys[12], n_keys; + long step = (clock - FromClock) * total_steps / (ToClock - FromClock); + int Keys[12], KeyCount; if (key == CHORD_KEY) { - n_keys = gpHarmonyBrowser->GetChordKeys(keys, (int)step, (int)total_steps); + KeyCount = gpHarmonyBrowser->GetChordKeys(Keys, (int)step, (int)total_steps); } else { - n_keys = gpHarmonyBrowser->GetBassKeys(keys, (int)step, (int)total_steps); + mKeyCount = gpHarmonyBrowser->GetBassKeys(Keys, (int)step, (int)total_steps); } - for (int j = 0; j < n_keys; j++) + for (int j = 0; j < mKeyCount; j++) { - JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[j], vel, len - clocks_per_step/2); + JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, Keys[j], vel, len - clocks_per_step/2); pTrack->Put(k); } } @@ -380,7 +421,7 @@ // generate controller else if (key == CONTROL_KEY) { - JZControlEvent* c = new JZControlEvent(clock, chan, parm - 1, vel); + JZControlEvent* c = new JZControlEvent(clock, chan, mParameter - 1, vel); pTrack->Put(c); } // generate note on events @@ -398,33 +439,33 @@ } #endif - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZRhythm::GenGroup( JZRndArray& out, int grp, const JZBarInfo& BarInfo, - JZRhythm *rhy[], - int n_rhy) + JZRhythm* rhy[], + int RhythmCount) { out.Clear(); int clocks_per_step = ClocksPerStep(BarInfo); - for (int ri = 0; ri < n_rhy; ri++) + for (int RhythmIndex = 0; RhythmIndex < RhythmCount; ++RhythmIndex) { - JZRhythm* pRhythm = rhy[ri]; - int fuzz = pRhythm->groups[grp].contrib; + JZRhythm* pRhythm = rhy[RhythmIndex]; + int fuzz = pRhythm->mRhythmGroups[grp].mContrib; if (fuzz && pRhythm != this) { - JZRndArray tmp(rhythm); + JZRndArray tmp(mRhythmArray); tmp.Clear(); long clock = BarInfo.GetClock(); ... [truncated message content] |
From: <pst...@us...> - 2013-04-06 17:42:27
|
Revision: 1004 http://sourceforge.net/p/jazzplusplus/code/1004 Author: pstieber Date: 2013-04-06 17:42:24 +0000 (Sat, 06 Apr 2013) Log Message: ----------- Updated data member names. Modified Paths: -------------- trunk/jazz/src/Events.h trunk/jazz/src/Player.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/mswin/WindowsPlayer.cpp Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2013-04-06 17:41:36 UTC (rev 1003) +++ trunk/jazz/src/Events.h 2013-04-06 17:42:24 UTC (rev 1004) @@ -1348,18 +1348,6 @@ JZTrackNameEvent(int Clock, unsigned char* pData, unsigned short Length) : JZMetaEvent(Clock, StatTrackName, pData, Length) { -// SN++ Diese Restriktion ist viel zu hart. Es genuegt, den Namen im Mixerdialog -// zu begrenzen!!! -/* -#ifdef wx_motif - // clip to 16 chars - if (Length > 16) - { - mpData[16] = 0; - Length = 16; - } -#endif -*/ } virtual JZTrackNameEvent* IsTrackName() Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2013-04-06 17:41:36 UTC (rev 1003) +++ trunk/jazz/src/Player.cpp 2013-04-06 17:42:24 UTC (rev 1004) @@ -290,13 +290,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::OutNow(JZTrack *t, JZParam *r) +void JZPlayer::OutNow(JZTrack* pTrack, JZParam *r) { - OutNow(t, &r->mMsb); - OutNow(t, &r->mLsb); - OutNow(t, &r->mDataMsb); - OutNow(t, &r->mResetMsb); - OutNow(t, &r->mResetLsb); + OutNow(pTrack, &r->mMsb); + OutNow(pTrack, &r->mLsb); + OutNow(pTrack, &r->mDataMsb); + OutNow(pTrack, &r->mResetMsb); + OutNow(pTrack, &r->mResetLsb); } //----------------------------------------------------------------------------- @@ -326,230 +326,230 @@ mpAudioBuffer->Clear(); } - JZTrack *t; + JZTrack* pTrack; - if ( !Continue ) + if (!Continue) { if ( gpConfig->GetValue(C_SendSynthReset) == 2 || ((Clock == 0) && (gpConfig->GetValue(C_SendSynthReset) == 1))) { // fixme: we should have different synths for each device - t = mpSong->GetTrack(0); + pTrack = mpSong->GetTrack(0); JZEvent* mpResetEvent = gpSynth->CreateResetEvent(); - OutNow(t, mpResetEvent); + OutNow(pTrack, mpResetEvent); delete mpResetEvent; } // Send Volume, Pan, Chorus, etc for (i = 0; i < mpSong->GetTrackCount(); ++i) { - t = mpSong->GetTrack(i); - if (t->mpBank) + pTrack = mpSong->GetTrack(i); + if (pTrack->mpBank) { - OutNow(t, t->mpBank); + OutNow(pTrack, pTrack->mpBank); } - if (t->mpBank2) + if (pTrack->mpBank2) { - OutNow(t, t->mpBank2); + OutNow(pTrack, pTrack->mpBank2); } - if (t->mpPatch) + if (pTrack->mpPatch) { - OutNow(t, t->mpPatch); + OutNow(pTrack, pTrack->mpPatch); } - if (t->mpVolume) + if (pTrack->mpVolume) { - OutNow(t, t->mpVolume); + OutNow(pTrack, pTrack->mpVolume); } - if (t->mpPan) + if (pTrack->mpPan) { - OutNow(t, t->mpPan); + OutNow(pTrack, pTrack->mpPan); } - if (t->mpReverb) + if (pTrack->mpReverb) { - OutNow(t, t->mpReverb); + OutNow(pTrack, pTrack->mpReverb); } - if (t->mpChorus) + if (pTrack->mpChorus) { - OutNow(t, t->mpChorus); + OutNow(pTrack, pTrack->mpChorus); } - if (t->VibRate) + if (pTrack->mpVibRate) { - OutNow(t, t->VibRate); + OutNow(pTrack, pTrack->mpVibRate); } - if (t->VibDepth) + if (pTrack->mpVibDepth) { - OutNow(t, t->VibDepth); + OutNow(pTrack, pTrack->mpVibDepth); } - if (t->VibDelay) + if (pTrack->mpVibDelay) { - OutNow(t, t->VibDelay); + OutNow(pTrack, pTrack->mpVibDelay); } - if (t->Cutoff) + if (pTrack->mpCutoff) { - OutNow(t, t->Cutoff); + OutNow(pTrack, pTrack->mpCutoff); } - if (t->Resonance) + if (pTrack->mpResonance) { - OutNow(t, t->Resonance); + OutNow(pTrack, pTrack->mpResonance); } - if (t->EnvAttack) + if (pTrack->mpEnvAttack) { - OutNow(t, t->EnvAttack); + OutNow(pTrack, pTrack->mpEnvAttack); } - if (t->EnvDecay) + if (pTrack->mpEnvDecay) { - OutNow(t, t->EnvDecay); + OutNow(pTrack, pTrack->mpEnvDecay); } - if (t->EnvRelease) + if (pTrack->mpEnvRelease) { - OutNow(t, t->EnvRelease); + OutNow(pTrack, pTrack->mpEnvRelease); } int j; - if (!t->DrumParams.IsEmpty()) + if (!pTrack->mDrumParams.IsEmpty()) { - JZDrumInstrumentParameter *dpar = t->DrumParams.FirstElem(); + JZDrumInstrumentParameter *dpar = pTrack->mDrumParams.FirstElem(); while (dpar) { - for (j = drumPitchIndex; j < numDrumParameters; j++) + for (j = drumPitchIndex; j < numDrumParameters; ++j) { if (dpar->Get(j)) { - OutNow(t, dpar->Get(j)); + OutNow(pTrack, dpar->Get(j)); } } - dpar = t->DrumParams.NextElem( dpar ); + dpar = pTrack->mDrumParams.NextElem( dpar ); } } - if (t->BendPitchSens) + if (pTrack->mpBendPitchSens) { - OutNow(t, t->BendPitchSens); + OutNow(pTrack, pTrack->mpBendPitchSens); } - for (j = mspModPitchControl; j < mspModulationSysexParameters; j++) + for (j = mspModPitchControl; j < mspModulationSysexParameters; ++j) { - if (t->mpModulationSettings[j]) + if (pTrack->mpModulationSettings[j]) { - OutNow(t, t->mpModulationSettings[j]); + OutNow(pTrack, pTrack->mpModulationSettings[j]); } } - for (j = bspBendPitchControl; j < bspBenderSysexParameters; j++) + for (j = bspBendPitchControl; j < bspBenderSysexParameters; ++j) { - if (t->BenderSettings[j]) + if (pTrack->mpBenderSettings[j]) { - OutNow(t, t->BenderSettings[j]); + OutNow(pTrack, pTrack->mpBenderSettings[j]); } } - for (j = cspCAfPitchControl; j < cspCAfSysexParameters; j++) + for (j = cspCAfPitchControl; j < cspCAfSysexParameters; ++j) { - if (t->CAfSettings[j]) + if (pTrack->mpCAfSettings[j]) { - OutNow(t, t->CAfSettings[j]); + OutNow(pTrack, pTrack->mpCAfSettings[j]); } } - for (j = pspPAfPitchControl; j < pspPAfSysexParameters; j++) + for (j = pspPAfPitchControl; j < pspPAfSysexParameters; ++j) { - if (t->PAfSettings[j]) + if (pTrack->mpPAfSettings[j]) { - OutNow(t, t->PAfSettings[j]); + OutNow(pTrack, pTrack->mpPAfSettings[j]); } } - for (j = cspCC1PitchControl; j < cspCC1SysexParameters; j++) + for (j = cspCC1PitchControl; j < cspCC1SysexParameters; ++j) { - if (t->CC1Settings[j]) + if (pTrack->mpCC1Settings[j]) { - OutNow(t, t->CC1Settings[j]); + OutNow(pTrack, pTrack->mpCC1Settings[j]); } } - for (j = cspCC2PitchControl; j < cspCC2SysexParameters; j++) + for (j = cspCC2PitchControl; j < cspCC2SysexParameters; ++j) { - if (t->CC2Settings[j]) + if (pTrack->mpCC2Settings[j]) { - OutNow(t, t->CC2Settings[j]); + OutNow(pTrack, pTrack->mpCC2Settings[j]); } } - if (t->mpCC1ControllerNr) + if (pTrack->mpCC1ControllerNr) { - OutNow(t, t->mpCC1ControllerNr); + OutNow(pTrack, pTrack->mpCC1ControllerNr); } - if (t->CC2ControllerNr) + if (pTrack->mpCC2ControllerNr) { - OutNow(t, t->CC2ControllerNr); + OutNow(pTrack, pTrack->mpCC2ControllerNr); } if (gpConfig->GetValue(C_UseReverbMacro)) { - if (t->ReverbType) + if (pTrack->mpReverbType) { - OutNow(t, t->ReverbType); + OutNow(pTrack, pTrack->mpReverbType); } } else { - for (j = 0; j < rspReverbSysexParameters; j++) + for (j = 0; j < rspReverbSysexParameters; ++j) { - if (t->ReverbSettings[j]) + if (pTrack->mpReverbSettings[j]) { - OutNow(t, t->ReverbSettings[j]); + OutNow(pTrack, pTrack->mpReverbSettings[j]); } } } if (gpConfig->GetValue(C_UseChorusMacro)) { - if (t->ChorusType) + if (pTrack->mpChorusType) { - OutNow(t, t->ChorusType); + OutNow(pTrack, pTrack->mpChorusType); } } else { - for (j = 0; j < cspChorusSysexParameters; j++) + for (j = 0; j < cspChorusSysexParameters; ++j) { - if (t->ChorusSettings[j]) + if (pTrack->mpChorusSettings[j]) { - OutNow(t, t->ChorusSettings[j]); + OutNow(pTrack, pTrack->mpChorusSettings[j]); } } } - if (t->EqualizerType) + if (pTrack->mpEqualizerType) { - OutNow(t, t->EqualizerType); + OutNow(pTrack, pTrack->mpEqualizerType); } - if (t->PartialReserve) + if (pTrack->mpPartialReserve) { - OutNow(t, t->PartialReserve); + OutNow(pTrack, pTrack->mpPartialReserve); } - if (t->MasterVol) + if (pTrack->mpMasterVol) { - OutNow(t, t->MasterVol); + OutNow(pTrack, pTrack->mpMasterVol); } - if (t->MasterPan) + if (pTrack->mpMasterPan) { - OutNow(t, t->MasterPan); + OutNow(pTrack, pTrack->mpMasterPan); } - if (t->RxChannel) + if (pTrack->mpRxChannel) { - OutNow(t, t->RxChannel); + OutNow(pTrack, pTrack->mpRxChannel); } - if (t->UseForRhythm && *gpSynth->GetSysexValPtr(t->UseForRhythm)) + if (pTrack->mpUseForRhythm && *gpSynth->GetSysexValPtr(pTrack->mpUseForRhythm )) { - OutNow(t, t->UseForRhythm); + OutNow(pTrack, pTrack->mpUseForRhythm ); } } // for } // if !Continue - t = mpSong->GetTrack(0); - JZEvent* pEvent = t->GetCurrentTempo(Clock); + pTrack = mpSong->GetTrack(0); + JZEvent* pEvent = pTrack->GetCurrentTempo(Clock); if (pEvent) { OutNow(pEvent); @@ -614,7 +614,7 @@ int ii; JZKeyOffEvent pKeyOff(0, 0, 0); - for (ii = 0; ii < mpSong->GetTrackCount(); ii++) + for (ii = 0; ii < mpSong->GetTrackCount(); ++ii) { JZTrack *Track = mpSong->GetTrack(ii); if (Track) @@ -650,9 +650,9 @@ JZControlEvent CtrlRes(0, 0, 0x79, 0); JZDeviceList &devs = gpMidiPlayer->GetOutputDevices(); - for (unsigned dev = 0; dev < devs.GetCount(); dev++) + for (unsigned dev = 0; dev < devs.GetCount(); ++dev) { - for (int c = 0; c < 16; c++) + for (int c = 0; c < 16; ++c) { NoteOff.SetChannel(c); NoteOff.SetDevice(dev); @@ -777,7 +777,7 @@ return written; } printf("W: "); - for (i = 0; i < written; i++) + for (i = 0; i < written; ++i) { printf("%02x ", (unsigned char)buf[i]); } @@ -785,7 +785,7 @@ if (written != size) { printf("L: "); - for (i = written; i < size; i++) + for (i = written; i < size; ++i) { printf("%02x ", (unsigned char)buf[i]); } @@ -808,7 +808,7 @@ { CMD+1, 0x34, /* timing byte always */ CMD+1, 0x8e, /* conductor off */ - CMD+1, 0x8c, /* don't send measures while recording */ + CMD+1, 0x8c, /* don'pTrack send measures while recording */ CMD+1, 0xe7, DAT+1, 60, /* clock-to-host every 15'th tick (60/4) */ CMD+1, 0x95, /* send clock to host instead */ CMD+1, 0x87, /* pitch+controller enabled */ @@ -827,7 +827,7 @@ CMD+1, 0x39, /* real time to host */ CMD+1, 0x34, /* timing byte always */ CMD+1, 0x8e, /* conductor off */ - CMD+1, 0x8c, /* don't send measures while recording */ + CMD+1, 0x8c, /* don'pTrack send measures while recording */ CMD+1, 0xe7, DAT+1, 60, /* clock-to-host every 15'th tick (60/4) */ CMD+1, 0x95, /* send clock to host instead */ CMD+1, 0x87, /* pitch+controller enabled */ @@ -849,7 +849,7 @@ clock_to_host_counter = 0; ActiveTrack = 0; - for (int i = 0; i < ACTIVE_TRACKS; i++) + for (int i = 0; i < ACTIVE_TRACKS; ++i) { TrackClock[i] = ExtClock; TrackRunningStatus[i] = 0; @@ -1042,7 +1042,7 @@ PlyBytes.Put(ActiveTrack); PlyBytes.Put(Time); } - for (i = 1; i < midi.mByteCount; i++) + for (i = 1; i < midi.mByteCount; ++i) PlyBytes.Put(midi.mBuffer[i]); TrackClock[ActiveTrack] = pEvent->GetClock(); @@ -1088,7 +1088,7 @@ while (OverFlow) { OverFlow = 0; - for (int i = 0; i < ACTIVE_TRACKS; i++) + for (int i = 0; i < ACTIVE_TRACKS; ++i) { if ((BreakOver - TrackClock[i]) >= 240) { @@ -1117,7 +1117,7 @@ buf[n++] = CMD+1; buf[n++] = 0xd7; buf[n++] = DAT + midi.mByteCount; - for (i = 0; i < midi.mByteCount; i++) + for (i = 0; i < midi.mByteCount; ++i) { buf[n++] = midi.mBuffer[i]; } @@ -1149,7 +1149,7 @@ sysex[n++] = 0xdf; sysex[n++] = DAT + s->Length + 1; sysex[n++] = StatSysEx; - for (i = 0; i < s->Length; i++) + for (i = 0; i < s->Length; ++i) { sysex[n++] = s->Data[i]; } @@ -1165,7 +1165,7 @@ common[n++] = 0xdf; common[n++] = DAT + s->Length + 1; common[n++] = StatSongPtr; - for (i = 0; i < s->Length; i++) + for (i = 0; i < s->Length; ++i) { common[n++] = s->Data[i]; } @@ -1212,8 +1212,10 @@ sysex[n++] = 0xdf; sysex[n++] = DAT + s->Length + 1; sysex[n++] = StatSysEx; - for (int i = 0; i < s->Length; i++) + for (int i = 0; i < s->Length; ++i) + { sysex[n++] = s->Data[i]; + } write_noack_mpu(sysex, n); delete[] sysex; } @@ -1241,7 +1243,7 @@ { // CLOCK_TO_HOST received playclock += CLOCK_TO_HOST_TICKS; - clock_to_host_counter++; + ++clock_to_host_counter; #ifdef SLOW_MACHINE // Update screen every 4 beats (120 ticks/beat). if ((clock_to_host_counter % 32) == 0) @@ -1276,7 +1278,7 @@ else if (c == 0xf2 || receiving_song_ptr) { // Song pointer received - receiving_song_ptr++; + ++receiving_song_ptr; int ExtClock; @@ -1325,7 +1327,9 @@ { c = recbuf[i++]; if (c == 0xf8) + { RecBytes.Clock += 240; + } else if (c < 0xf0) { // timing byte @@ -1614,7 +1618,7 @@ wxString *devs = new wxString[nrsynths]; ninp = 0; - for (i = 0; i < nrsynths; i++) + for (i = 0; i < nrsynths; ++i) { si.device = i; if (ioctl(seqfd, SNDCTL_SYNTH_INFO, &si) == -1) @@ -1625,7 +1629,7 @@ // if (si.synth_type == SYNTH_TYPE_MIDI || si.synth_type == SYNTH_TYPE_SAMPLE) { devs[ninp] = si.name; - ninp++; + ++ninp; } } @@ -1836,7 +1840,7 @@ char buf[N]; buf[0] = (char)0xf0; i = 1; - for (j = 0; j < sx->GetDataLength(); j++) + for (j = 0; j < sx->GetDataLength(); ++j) { if (i == N) { Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2013-04-06 17:41:36 UTC (rev 1003) +++ trunk/jazz/src/Track.cpp 2013-04-06 17:42:24 UTC (rev 1004) @@ -103,94 +103,94 @@ JZMtcTime::JZMtcTime(JZMtcOffsetEvent* pMtcOffset) { const unsigned char* pData = pMtcOffset->GetData(); - type = (tMtcType) ((pData[0] & 0x60) >> 5); - if (type < Mtc24) + mType = (tMtcType) ((pData[0] & 0x60) >> 5); + if (mType < Mtc24) { - type = Mtc24; + mType = Mtc24; } - if (type > Mtc30Ndf) + if (mType > Mtc30Ndf) { - type = Mtc30Ndf; + mType = Mtc30Ndf; } - hour = pData[0] & 0x1f; - min = pData[1]; - sec = pData[2]; + mHours = pData[0] & 0x1f; + mMinutes = pData[1]; + mSeconds = pData[2]; fm = pData[3]; } -JZMtcTime::JZMtcTime(int millisec, tMtcType t) +JZMtcTime::JZMtcTime(int millisec, tMtcType Type) { - type = t; - if (type < Mtc24) + mType = Type; + if (mType < Mtc24) { - type = Mtc24; + mType = Mtc24; } - if (type > Mtc30Ndf) + if (mType > Mtc30Ndf) { - type = Mtc30Ndf; + mType = Mtc30Ndf; } - sec = millisec / 1000; + mSeconds = millisec / 1000; int msec = millisec % 1000; - min = sec / 60; - sec = sec % 60; - hour = min / 60; - min = min % 60; - double frametime = 1000.0 / gFramesPerSecond[type]; + mMinutes = mSeconds / 60; + mSeconds = mSeconds % 60; + mHours = mMinutes / 60; + mMinutes = mMinutes % 60; + double frametime = 1000.0 / gFramesPerSecond[mType]; fm = (int) ((double) msec / frametime); } -JZMtcTime::JZMtcTime(char* str, tMtcType t) - : hour(0), - min(0), - sec(0), +JZMtcTime::JZMtcTime(char* str, tMtcType Type) + : mHours(0), + mMinutes(0), + mSeconds(0), fm(0) { - type = t; - if (type < Mtc24) + mType = Type; + if (mType < Mtc24) { - type = Mtc24; + mType = Mtc24; } - if (type > Mtc30Ndf) + if (mType > Mtc30Ndf) { - type = Mtc30Ndf; + mType = Mtc30Ndf; } - sscanf(str, "%d:%d:%d.%d", &hour, &min, &sec, &fm); - if (fm >= gFramesPerSecond[type]) + sscanf(str, "%d:%d:%d.%d", &mHours, &mMinutes, &mSeconds, &fm); + if (fm >= gFramesPerSecond[mType]) { - fm = (int) gFramesPerSecond[type] - 1; + fm = (int) gFramesPerSecond[mType] - 1; } } -JZMtcTime::JZMtcTime(unsigned h, unsigned m, unsigned s, unsigned f, unsigned t) +JZMtcTime::JZMtcTime(unsigned Hours, unsigned Minutes, unsigned Seconds, unsigned f, unsigned Type) { - hour = h; - min = m; - sec = s; + mHours = Hours; + mMinutes = Minutes; + mSeconds = Seconds; fm = f; - type = (tMtcType) t; - if (type < Mtc24) + mType = (tMtcType) Type; + if (mType < Mtc24) { - type = Mtc24; + mType = Mtc24; } - if (type > Mtc30Ndf) + if (mType > Mtc30Ndf) { - type = Mtc30Ndf; + mType = Mtc30Ndf; } } void JZMtcTime::ToString(string& String) { ostringstream Oss; - Oss << hour << ':' << min << ':' << sec << '.' << fm; + Oss << mHours << ':' << mMinutes << ':' << mSeconds << '.' << fm; String = Oss.str(); } JZMtcOffsetEvent* JZMtcTime::ToOffset() { unsigned char* mess = new unsigned char[5]; - mess[0] = (unsigned char) hour | ((unsigned char) type << 5); - mess[1] = (unsigned char) min; - mess[2] = (unsigned char) sec; + mess[0] = (unsigned char) mHours | ((unsigned char) mType << 5); + mess[1] = (unsigned char) mMinutes; + mess[2] = (unsigned char) mSeconds; mess[3] = (unsigned char) fm; mess[4] = 0x00; JZMtcOffsetEvent* s = new JZMtcOffsetEvent(0, mess, 5); @@ -200,8 +200,8 @@ int JZMtcTime::ToMillisec() { - int msec = (((((hour * 60L) + min) * 60L) + sec) * 1000L) + - ((fm * 1000L) / (int) gFramesPerSecond[type]); + int msec = (((((mHours * 60) + mMinutes) * 60) + mSeconds) * 1000) + + ((fm * 1000) / (int) gFramesPerSecond[mType]); return msec; } @@ -575,64 +575,64 @@ for (i = 0; i < bspBenderSysexParameters; i++) { - BenderSettings[i] = 0; + mpBenderSettings[i] = 0; } for (i = 0; i < cspCAfSysexParameters; i++) { - CAfSettings[i] = 0; + mpCAfSettings[i] = 0; } for (i = 0; i < pspPAfSysexParameters; i++) { - PAfSettings[i] = 0; + mpPAfSettings[i] = 0; } for (i = 0; i < cspCC1SysexParameters; i++) { - CC1Settings[i] = 0; + mpCC1Settings[i] = 0; } for (i = 0; i < cspCC2SysexParameters; i++) { - CC2Settings[i] = 0; + mpCC2Settings[i] = 0; } mpCC1ControllerNr = 0; - CC2ControllerNr = 0; + mpCC2ControllerNr = 0; - ReverbType = 0; - ChorusType = 0; - EqualizerType = 0; + mpReverbType = 0; + mpChorusType = 0; + mpEqualizerType = 0; for (i = 0; i < rspReverbSysexParameters; i++) { - ReverbSettings[i] = 0; + mpReverbSettings[i] = 0; } for (i = 0; i < cspChorusSysexParameters; i++) { - ChorusSettings[i] = 0; + mpChorusSettings[i] = 0; } - PartialReserve = 0; - MasterVol = 0; - MasterPan = 0; - RxChannel = 0; - UseForRhythm = 0; - MtcOffset = 0; + mpPartialReserve = 0; + mpMasterVol = 0; + mpMasterPan = 0; + mpRxChannel = 0; + mpUseForRhythm = 0; + mpMtcOffset = 0; - VibRate = 0; - VibDepth = 0; - VibDelay = 0; - Cutoff = 0; - Resonance = 0; - EnvAttack = 0; - EnvDecay = 0; - EnvRelease = 0; - BendPitchSens = 0; + mpVibRate = 0; + mpVibDepth = 0; + mpVibDelay = 0; + mpCutoff = 0; + mpResonance = 0; + mpEnvAttack = 0; + mpEnvDecay = 0; + mpEnvRelease = 0; + mpBendPitchSens = 0; - DrumParams.Clear(); + mDrumParams.Clear(); if (mppEvents) { @@ -702,52 +702,52 @@ for (i = bspBendPitchControl; i < bspBenderSysexParameters; i++) { - BenderSettings[i] = 0; + mpBenderSettings[i] = 0; } for (i = 0; i < cspCAfSysexParameters; i++) { - CAfSettings[i] = 0; + mpCAfSettings[i] = 0; } for (i = 0; i < pspPAfSysexParameters; i++) { - PAfSettings[i] = 0; + mpPAfSettings[i] = 0; } for (i = 0; i < cspCC1SysexParameters; i++) { - CC1Settings[i] = 0; + mpCC1Settings[i] = 0; } for (i = 0; i < cspCC2SysexParameters; i++) { - CC2Settings[i] = 0; + mpCC2Settings[i] = 0; } mpCC1ControllerNr = 0; - CC2ControllerNr = 0; + mpCC2ControllerNr = 0; - ReverbType = 0; - ChorusType = 0; - EqualizerType = 0; + mpReverbType = 0; + mpChorusType = 0; + mpEqualizerType = 0; for (i = 0; i < rspReverbSysexParameters; i++) { - ReverbSettings[i] = 0; + mpReverbSettings[i] = 0; } for (i = 0; i < cspChorusSysexParameters; i++) { - ChorusSettings[i] = 0; + mpChorusSettings[i] = 0; } - PartialReserve = 0; - MasterVol = 0; - MasterPan = 0; - RxChannel = 0; - UseForRhythm = 0; - MtcOffset = 0; + mpPartialReserve = 0; + mpMasterVol = 0; + mpMasterPan = 0; + mpRxChannel = 0; + mpUseForRhythm = 0; + mpMtcOffset = 0; for (i = 0; i < mEventCount; i++) { @@ -783,9 +783,9 @@ { mpSpeed = pEvent->IsSetTempo(); } - if (!MtcOffset) + if (!mpMtcOffset) { - MtcOffset = pEvent->IsMtcOffset(); + mpMtcOffset = pEvent->IsMtcOffset(); } if ((pControl = pEvent->IsControl()) != 0) { @@ -827,7 +827,7 @@ { case SX_GM_MasterVol: // GS has its own; SC-55 doesn't recognize GM Mastervol - MasterVol = s; + mpMasterVol = s; break; default: break; @@ -839,10 +839,10 @@ switch (SysExId) { case SX_GS_MasterVol: - MasterVol = s; + mpMasterVol = s; break; case SX_GS_MasterPan: - MasterPan = s; + mpMasterPan = s; break; case SX_GS_BendPitch: case SX_GS_BendTvf: @@ -855,7 +855,7 @@ case SX_GS_BendLfo2Pitch: case SX_GS_BendLfo2Tvf: case SX_GS_BendLfo2Tva: - BenderSettings[SysExId - SX_GS_BendPitch] = s; + mpBenderSettings[SysExId - SX_GS_BendPitch] = s; break; case SX_GS_ModPitch: @@ -883,7 +883,7 @@ case SX_GS_CafLfo2Pitch: case SX_GS_CafLfo2Tvf: case SX_GS_CafLfo2Tva: - CAfSettings[SysExId - SX_GS_CafPitch] = s; + mpCAfSettings[SysExId - SX_GS_CafPitch] = s; break; case SX_GS_PafPitch: @@ -897,7 +897,7 @@ case SX_GS_PafLfo2Pitch: case SX_GS_PafLfo2Tvf: case SX_GS_PafLfo2Tva: - PAfSettings[SysExId - SX_GS_PafPitch] = s; + mpPAfSettings[SysExId - SX_GS_PafPitch] = s; break; case SX_GS_CC1Pitch: @@ -911,7 +911,7 @@ case SX_GS_CC1Lfo2Pitch: case SX_GS_CC1Lfo2Tvf: case SX_GS_CC1Lfo2Tva: - CC1Settings[SysExId - SX_GS_CC1Pitch] = s; + mpCC1Settings[SysExId - SX_GS_CC1Pitch] = s; break; case SX_GS_CC2Pitch: @@ -925,11 +925,11 @@ case SX_GS_CC2Lfo2Pitch: case SX_GS_CC2Lfo2Tvf: case SX_GS_CC2Lfo2Tva: - CC2Settings[SysExId - SX_GS_CC2Pitch] = s; + mpCC2Settings[SysExId - SX_GS_CC2Pitch] = s; break; case SX_GS_ReverbMacro: - ReverbType = s; + mpReverbType = s; break; case SX_GS_RevCharacter: @@ -938,11 +938,11 @@ case SX_GS_RevTime: case SX_GS_RevDelayFeedback: case SX_GS_RevSendChorus: - ReverbSettings[SysExId - SX_GS_RevCharacter] = s; + mpReverbSettings[SysExId - SX_GS_RevCharacter] = s; break; case SX_GS_ChorusMacro: - ChorusType = s; + mpChorusType = s; break; case SX_GS_ChoPreLpf: @@ -952,7 +952,7 @@ case SX_GS_ChoRate: case SX_GS_ChoDepth: case SX_GS_ChoSendReverb: - ChorusSettings[SysExId - SX_GS_ChoPreLpf] = s; + mpChorusSettings[SysExId - SX_GS_ChoPreLpf] = s; break; case SX_GS_CC1CtrlNo: @@ -960,19 +960,19 @@ break; case SX_GS_CC2CtrlNo: - CC2ControllerNr = s; + mpCC2ControllerNr = s; break; case SX_GS_PartialReserve: - PartialReserve = s; + mpPartialReserve = s; break; case SX_GS_RxChannel: - RxChannel = s; + mpRxChannel = s; break; case SX_GS_UseForRhythm: - UseForRhythm = s; + mpUseForRhythm = s; break; default: @@ -986,13 +986,13 @@ case SX_XG_BendPitch: case SX_XG_BendTvf: case SX_XG_BendAmpl: - BenderSettings[SysExId - SX_XG_BendPitch] = s; + mpBenderSettings[SysExId - SX_XG_BendPitch] = s; break; case SX_XG_BendLfoPitch: case SX_XG_BendLfoTvf: case SX_XG_BendLfoTva: - BenderSettings[SysExId + 1 - SX_XG_BendPitch] = s; + mpBenderSettings[SysExId + 1 - SX_XG_BendPitch] = s; break; case SX_XG_ModPitch: @@ -1010,61 +1010,61 @@ case SX_XG_CafPitch: case SX_XG_CafTvf: case SX_XG_CafAmpl: - CAfSettings[SysExId - SX_XG_CafPitch] = s; + mpCAfSettings[SysExId - SX_XG_CafPitch] = s; break; case SX_XG_CafLfoPitch: case SX_XG_CafLfoTvf: case SX_XG_CafLfoTva: - CAfSettings[SysExId + 1 - SX_XG_CafPitch] = s; + mpCAfSettings[SysExId + 1 - SX_XG_CafPitch] = s; break; case SX_XG_PafPitch: case SX_XG_PafTvf: case SX_XG_PafAmpl: - PAfSettings[SysExId - SX_XG_PafPitch] = s; + mpPAfSettings[SysExId - SX_XG_PafPitch] = s; break; case SX_XG_PafLfoPitch: case SX_XG_PafLfoTvf: case SX_XG_PafLfoTva: - PAfSettings[SysExId + 1 - SX_XG_PafPitch] = s; + mpPAfSettings[SysExId + 1 - SX_XG_PafPitch] = s; break; case SX_XG_CC1Pitch: case SX_XG_CC1Tvf: case SX_XG_CC1Ampl: - CC1Settings[SysExId - SX_XG_CC1Pitch] = s; + mpCC1Settings[SysExId - SX_XG_CC1Pitch] = s; break; case SX_XG_CC1LfoPitch: case SX_XG_CC1LfoTvf: case SX_XG_CC1LfoTva: - CC1Settings[SysExId + 1 - SX_XG_CC1Pitch] = s; + mpCC1Settings[SysExId + 1 - SX_XG_CC1Pitch] = s; break; case SX_XG_CC2Pitch: case SX_XG_CC2Tvf: case SX_XG_CC2Ampl: - CC2Settings[SysExId - SX_XG_CC2Pitch] = s; + mpCC2Settings[SysExId - SX_XG_CC2Pitch] = s; break; case SX_XG_CC2LfoPitch: case SX_XG_CC2LfoTvf: case SX_XG_CC2LfoTva: - CC2Settings[SysExId + 1 - SX_XG_CC2Pitch] = s; + mpCC2Settings[SysExId + 1 - SX_XG_CC2Pitch] = s; break; case SX_XG_ReverbMacro: - ReverbType = s; + mpReverbType = s; break; case SX_XG_ChorusMacro: - ChorusType = s; + mpChorusType = s; break; case SX_XG_EqualizerMacro: - EqualizerType = s; + mpEqualizerType = s; break; case SX_XG_CC1CtrlNo: @@ -1072,15 +1072,15 @@ break; case SX_XG_CC2CtrlNo: - CC2ControllerNr = s; + mpCC2ControllerNr = s; break; case SX_XG_RxChannel: - RxChannel = s; + mpRxChannel = s; break; case SX_XG_UseForRhythm: - UseForRhythm = s; + mpUseForRhythm = s; break; default: @@ -1236,9 +1236,9 @@ } // Write MTC offset before any transmittable events (spec) - if (MtcOffset) + if (mpMtcOffset) { - MtcOffset->Write(Io); + mpMtcOffset->Write(Io); } // Synth reset @@ -1249,44 +1249,44 @@ // Rpn / Nrpn: // All these must be written in order (three JZControlEvent's in a row) - if (VibRate) + if (mpVibRate) { - VibRate->Write(Io); + mpVibRate->Write(Io); } - if (VibDepth) + if (mpVibDepth) { - VibDepth->Write(Io); + mpVibDepth->Write(Io); } - if (VibDelay) + if (mpVibDelay) { - VibDelay->Write(Io); + mpVibDelay->Write(Io); } - if (Cutoff) + if (mpCutoff) { - Cutoff->Write(Io); + mpCutoff->Write(Io); } - if (Resonance) + if (mpResonance) { - Resonance->Write(Io); + mpResonance->Write(Io); } - if (EnvAttack) + if (mpEnvAttack) { - EnvAttack->Write(Io); + mpEnvAttack->Write(Io); } - if (EnvDecay) + if (mpEnvDecay) { - EnvDecay->Write(Io); + mpEnvDecay->Write(Io); } - if (EnvRelease) + if (mpEnvRelease) { - EnvRelease->Write(Io); + mpEnvRelease->Write(Io); } - if (BendPitchSens) + if (mpBendPitchSens) { - BendPitchSens->Write(Io); + mpBendPitchSens->Write(Io); } - JZDrumInstrumentParameter* dpar = DrumParams.FirstElem(); + JZDrumInstrumentParameter* dpar = mDrumParams.FirstElem(); while (dpar) { int index; @@ -1297,7 +1297,7 @@ dpar->Get(index)->Write(Io); } } - dpar = DrumParams.NextElem(dpar); + dpar = mDrumParams.NextElem(dpar); } // mpBank: Must be sure bank is written before program: @@ -1424,51 +1424,51 @@ switch (Lsb) { case 0x08: - if (!VibRate) + if (!mpVibRate) { - VibRate = new JZNrpn(0, cha, Msb, Lsb, Data); + mpVibRate = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x09: - if (!VibDepth) + if (!mpVibDepth) { - VibDepth = new JZNrpn(0, cha, Msb, Lsb, Data); + mpVibDepth = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x0a: - if (!VibDelay) + if (!mpVibDelay) { - VibDelay = new JZNrpn(0, cha, Msb, Lsb, Data); + mpVibDelay = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x20: - if (!Cutoff) + if (!mpCutoff) { - Cutoff = new JZNrpn(0, cha, Msb, Lsb, Data); + mpCutoff = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x21: - if (!Resonance) + if (!mpResonance) { - Resonance = new JZNrpn(0, cha, Msb, Lsb, Data); + mpResonance = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x63: - if (!EnvAttack) + if (!mpEnvAttack) { - EnvAttack = new JZNrpn(0, cha, Msb, Lsb, Data); + mpEnvAttack = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x64: - if (!EnvDecay) + if (!mpEnvDecay) { - EnvDecay = new JZNrpn(0, cha, Msb, Lsb, Data); + mpEnvDecay = new JZNrpn(0, cha, Msb, Lsb, Data); } break; case 0x66: - if (!EnvRelease) + if (!mpEnvRelease) { - EnvRelease = new JZNrpn(0, cha, Msb, Lsb, Data); + mpEnvRelease = new JZNrpn(0, cha, Msb, Lsb, Data); } break; default: @@ -1480,15 +1480,15 @@ case drumPan: case drumReverb: case drumChorus: - DrumParams.PutParam(new JZNrpn(0, cha, Msb, Lsb, Data)); + mDrumParams.PutParam(new JZNrpn(0, cha, Msb, Lsb, Data)); break; case 0x00: // Rpn if (Lsb == 0x00) { // Pitch Bend Sensivity - if (!BendPitchSens) + if (!mpBendPitchSens) { - BendPitchSens = new JZRpn(0, cha, Msb, Lsb, Data); + mpBendPitchSens = new JZRpn(0, cha, Msb, Lsb, Data); } } break; @@ -1736,41 +1736,41 @@ pEvent = Iterator.Next(); } // while pEvent - if (trk->VibRate) + if (trk->mpVibRate) { - trk->VibRate->SetChannel(trk->mChannel - 1); + trk->mpVibRate->SetChannel(trk->mChannel - 1); } - if (trk->VibDepth) + if (trk->mpVibDepth) { - trk->VibDepth->SetChannel(trk->mChannel - 1); + trk->mpVibDepth->SetChannel(trk->mChannel - 1); } - if (trk->VibDelay) + if (trk->mpVibDelay) { - trk->VibDelay->SetChannel(trk->mChannel - 1); + trk->mpVibDelay->SetChannel(trk->mChannel - 1); } - if (trk->Cutoff) + if (trk->mpCutoff) { - trk->Cutoff->SetChannel(trk->mChannel - 1); + trk->mpCutoff->SetChannel(trk->mChannel - 1); } - if (trk->Resonance) + if (trk->mpResonance) { - trk->Resonance->SetChannel(trk->mChannel - 1); + trk->mpResonance->SetChannel(trk->mChannel - 1); } - if (trk->EnvAttack) + if (trk->mpEnvAttack) { - trk->EnvAttack->SetChannel(trk->mChannel - 1); + trk->mpEnvAttack->SetChannel(trk->mChannel - 1); } - if (trk->EnvDecay) + if (trk->mpEnvDecay) { - trk->EnvDecay->SetChannel(trk->mChannel - 1); + trk->mpEnvDecay->SetChannel(trk->mChannel - 1); } - if (trk->EnvRelease) + if (trk->mpEnvRelease) { - trk->EnvRelease->SetChannel(trk->mChannel - 1); + trk->mpEnvRelease->SetChannel(trk->mChannel - 1); } - if (trk->BendPitchSens) + if (trk->mpBendPitchSens) { - trk->BendPitchSens->SetChannel(trk->mChannel - 1); + trk->mpBendPitchSens->SetChannel(trk->mChannel - 1); } if (trk->mpBank) { @@ -1780,9 +1780,9 @@ { trk->mpPatch->mChannel = trk->mChannel - 1; } - if (!trk->DrumParams.IsEmpty()) + if (!trk->mDrumParams.IsEmpty()) { - JZDrumInstrumentParameter* dpar = trk->DrumParams.FirstElem(); + JZDrumInstrumentParameter* dpar = trk->mDrumParams.FirstElem(); while (dpar) { for (int index = drumPitchIndex; index < numDrumParameters; ++index) @@ -1792,7 +1792,7 @@ dpar->Get(index)->SetChannel(trk->mChannel - 1); } } - dpar = trk->DrumParams.NextElem(dpar); + dpar = trk->mDrumParams.NextElem(dpar); } } trk->Cleanup(); @@ -2391,25 +2391,25 @@ int JZTrack::GetVibRate() { - if (VibRate) + if (mpVibRate) { - return VibRate->GetVal() + 1; + return mpVibRate->GetVal() + 1; } return 0; } void JZTrack::SetVibRate(int Value) { - if (VibRate) + if (mpVibRate) { - delete VibRate; - VibRate = 0; + delete mpVibRate; + mpVibRate = 0; } if (Value > 0) { - VibRate = new JZNrpn(0, mChannel - 1, 0x01, 0x08, Value - 1); - gpMidiPlayer->OutNow(this, VibRate); + mpVibRate = new JZNrpn(0, mChannel - 1, 0x01, 0x08, Value - 1); + gpMidiPlayer->OutNow(this, mpVibRate); mChanged = true; } } @@ -2418,24 +2418,24 @@ int JZTrack::GetVibDepth() { - if (VibDepth) + if (mpVibDepth) { - return VibDepth->GetVal() + 1; + return mpVibDepth->GetVal() + 1; } return 0; } void JZTrack::SetVibDepth(int Value) { - if (VibDepth) + if (mpVibDepth) { - delete VibDepth; - VibDepth = 0; + delete mpVibDepth; + mpVibDepth = 0; } if (Value > 0) { - VibDepth = new JZNrpn(0, mChannel - 1, 0x01, 0x09, Value - 1); - gpMidiPlayer->OutNow(this, VibDepth); + mpVibDepth = new JZNrpn(0, mChannel - 1, 0x01, 0x09, Value - 1); + gpMidiPlayer->OutNow(this, mpVibDepth); mChanged = true; } } @@ -2444,25 +2444,25 @@ int JZTrack::GetVibDelay() { - if (VibDelay) + if (mpVibDelay) { - return VibDelay->GetVal() + 1; + return mpVibDelay->GetVal() + 1; } return 0; } void JZTrack::SetVibDelay(int Value) { - if (VibDelay) + if (mpVibDelay) { - delete VibDelay; - VibDelay = 0; + delete mpVibDelay; + mpVibDelay = 0; } if (Value > 0) { - VibDelay = new JZNrpn(0, mChannel - 1, 0x01, 0x0a, Value - 1); - gpMidiPlayer->OutNow(this, VibDelay); + mpVibDelay = new JZNrpn(0, mChannel - 1, 0x01, 0x0a, Value - 1); + gpMidiPlayer->OutNow(this, mpVibDelay); mChanged = true; } } @@ -2471,25 +2471,25 @@ int JZTrack::GetCutoff() { - if (Cutoff) + if (mpCutoff) { - return Cutoff->GetVal() + 1; + return mpCutoff->GetVal() + 1; } return 0; } void JZTrack::SetCutoff(int Value) { - if (Cutoff) + if (mpCutoff) { - delete Cutoff; - Cutoff = 0; + delete mpCutoff; + mpCutoff = 0; } if (Value > 0) { - Cutoff = new JZNrpn(0, mChannel - 1, 0x01, 0x20, Value - 1); - gpMidiPlayer->OutNow(this, Cutoff); + mpCutoff = new JZNrpn(0, mChannel - 1, 0x01, 0x20, Value - 1); + gpMidiPlayer->OutNow(this, mpCutoff); mChanged = true; } } @@ -2498,25 +2498,25 @@ int JZTrack::GetResonance() { - if (Resonance) + if (mpResonance) { - return Resonance->GetVal() + 1; + return mpResonance->GetVal() + 1; } return 0; } void JZTrack::SetResonance(int Value) { - if (Resonance) + if (mpResonance) { - delete Resonance; - Resonance = 0; + delete mpResonance; + mpResonance = 0; } if (Value > 0) { - Resonance = new JZNrpn(0, mChannel - 1, 0x01, 0x21, Value - 1); - gpMidiPlayer->OutNow(this, Resonance); + mpResonance = new JZNrpn(0, mChannel - 1, 0x01, 0x21, Value - 1); + gpMidiPlayer->OutNow(this, mpResonance); mChanged = true; } } @@ -2525,25 +2525,25 @@ int JZTrack::GetEnvAttack() { - if (EnvAttack) + if (mpEnvAttack) { - return EnvAttack->GetVal() + 1; + return mpEnvAttack->GetVal() + 1; } return 0; } void JZTrack::SetEnvAttack(int Value) { - if (EnvAttack) + if (mpEnvAttack) { - delete EnvAttack; - EnvAttack = 0; + delete mpEnvAttack; + mpEnvAttack = 0; } if (Value > 0) { - EnvAttack = new JZNrpn(0, mChannel - 1, 0x01, 0x63, Value - 1); - gpMidiPlayer->OutNow(this, EnvAttack); + mpEnvAttack = new JZNrpn(0, mChannel - 1, 0x01, 0x63, Value - 1); + gpMidiPlayer->OutNow(this, mpEnvAttack); mChanged = true; } } @@ -2552,25 +2552,25 @@ int JZTrack::GetEnvDecay() { - if (EnvDecay) + if (mpEnvDecay) { - return EnvDecay->GetVal() + 1; + return mpEnvDecay->GetVal() + 1; } return 0; } void JZTrack::SetEnvDecay(int Value) { - if (EnvDecay) + if (mpEnvDecay) { - delete EnvDecay; - EnvDecay = 0; + delete mpEnvDecay; + mpEnvDecay = 0; } if (Value > 0) { - EnvDecay = new JZNrpn(0, mChannel - 1, 0x01, 0x64, Value - 1); - gpMidiPlayer->OutNow(this, EnvDecay); + mpEnvDecay = new JZNrpn(0, mChannel - 1, 0x01, 0x64, Value - 1); + gpMidiPlayer->OutNow(this, mpEnvDecay); mChanged = true; } } @@ -2579,25 +2579,25 @@ int JZTrack::GetEnvRelease() { - if (EnvRelease) + if (mpEnvRelease) { - return EnvRelease->GetVal() + 1; + return mpEnvRelease->GetVal() + 1; } return 0; } void JZTrack::SetEnvRelease(int Value) { - if (EnvRelease) + if (mpEnvRelease) { - delete EnvRelease; - EnvRelease = 0; + delete mpEnvRelease; + mpEnvRelease = 0; } if (Value > 0) { - EnvRelease = new JZNrpn(0, mChannel - 1, 0x01, 0x66, Value - 1); - gpMidiPlayer->OutNow(this, EnvRelease); + mpEnvRelease = new JZNrpn(0, mChannel - 1, 0x01, 0x66, Value - 1); + gpMidiPlayer->OutNow(this, mpEnvRelease); mChanged = true; } } @@ -2606,9 +2606,9 @@ int JZTrack::GetDrumParam(int pitch, int index) { - if (!DrumParams.IsEmpty()) + if (!mDrumParams.IsEmpty()) { - JZNrpn* par = DrumParams.GetParam(pitch, index); + JZNrpn* par = mDrumParams.GetParam(pitch, index); if (par) { return(par->GetVal() + 1); @@ -2619,12 +2619,12 @@ void JZTrack::SetDrumParam(int pitch, int index, int Value) { - DrumParams.DelParam(pitch, index); + mDrumParams.DelParam(pitch, index); if (Value > 0) { - DrumParams.PutParam( + mDrumParams.PutParam( new JZNrpn(0, mChannel - 1, drumIndex2Param(index), pitch, Value - 1)); - gpMidiPlayer->OutNow(this, DrumParams.GetParam(pitch, index)); + gpMidiPlayer->OutNow(this, mDrumParams.GetParam(pitch, index)); mChanged = true; } } @@ -2633,25 +2633,25 @@ int JZTrack::GetBendPitchSens() { - if (BendPitchSens) + if (mpBendPitchSens) { - return BendPitchSens->GetVal() + 1; + return mpBendPitchSens->GetVal() + 1; } return 0; } void JZTrack::SetBendPitchSens(int Value) { - if (BendPitchSens) + if (mpBendPitchSens) { - delete BendPitchSens; - BendPitchSens = 0; + delete mpBendPitchSens; + mpBendPitchSens = 0; } if (Value > 0) { - BendPitchSens = new JZRpn(0, mChannel - 1, 0x00, 0x00, Value - 1); - gpMidiPlayer->OutNow(this, BendPitchSens); + mpBendPitchSens = new JZRpn(0, mChannel - 1, 0x00, 0x00, Value - 1); + gpMidiPlayer->OutNow(this, mpBendPitchSens); mChanged = true; } } @@ -2693,7 +2693,7 @@ int JZTrack::GetBenderSysex(int bsp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(BenderSettings[bsp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpBenderSettings[bsp]); if (pValue) { @@ -2705,9 +2705,9 @@ void JZTrack::SetBenderSysex(int bsp, int Value) { - if (BenderSettings[bsp]) + if (mpBenderSettings[bsp]) { - Kill(BenderSettings[bsp]); + Kill(mpBenderSettings[bsp]); } if (Value > 0) { @@ -2725,7 +2725,7 @@ int JZTrack::GetCAfSysex(int csp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(CAfSettings[csp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpCAfSettings[csp]); if (pValue) { @@ -2737,9 +2737,9 @@ void JZTrack::SetCAfSysex(int csp, int Value) { - if (CAfSettings[csp]) + if (mpCAfSettings[csp]) { - Kill(CAfSettings[csp]); + Kill(mpCAfSettings[csp]); } if (Value > 0) { @@ -2757,7 +2757,7 @@ int JZTrack::GetPAfSysex(int psp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(PAfSettings[psp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpPAfSettings[psp]); if (pValue) { @@ -2769,9 +2769,9 @@ void JZTrack::SetPAfSysex(int psp, int Value) { - if (PAfSettings[psp]) + if (mpPAfSettings[psp]) { - Kill(PAfSettings[psp]); + Kill(mpPAfSettings[psp]); } if (Value > 0) { @@ -2789,7 +2789,7 @@ int JZTrack::GetCC1Sysex(int csp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(CC1Settings[csp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpCC1Settings[csp]); if (pValue) { @@ -2801,9 +2801,9 @@ void JZTrack::SetCC1Sysex(int csp, int Value) { - if (CC1Settings[csp]) + if (mpCC1Settings[csp]) { - Kill(CC1Settings[csp]); + Kill(mpCC1Settings[csp]); } if (Value > 0) { @@ -2821,7 +2821,7 @@ int JZTrack::GetCC2Sysex(int csp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(CC2Settings[csp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpCC2Settings[csp]); if (pValue) { @@ -2833,8 +2833,10 @@ void JZTrack::SetCC2Sysex(int csp, int Value) { - if (CC2Settings[csp]) - Kill(CC2Settings[csp]); + if (mpCC2Settings[csp]) + { + Kill(mpCC2Settings[csp]); + } if (Value > 0) { JZEvent* pEvent = gpSynth->CC2SX(csp, 0, mChannel, Value - 1); @@ -2883,7 +2885,7 @@ int JZTrack::GetCC2ControllerNr() { - const unsigned char* pValue = gpSynth->GetSysexValPtr(CC2ControllerNr); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpCC2ControllerNr); if (pValue) { @@ -2895,9 +2897,9 @@ void JZTrack::SetCC2ControllerNr(int Value) { - if (CC2ControllerNr) + if (mpCC2ControllerNr) { - Kill(CC2ControllerNr); + Kill(mpCC2ControllerNr); } if (Value > 0) { @@ -2915,7 +2917,7 @@ int JZTrack::GetReverbType(int lsb) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(ReverbType); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpReverbType); if (pValue) { @@ -2931,9 +2933,9 @@ void JZTrack::SetReverbType(int Value, int lsb) { - if (ReverbType) + if (mpReverbType) { - Kill(ReverbType); + Kill(mpReverbType); } if (Value > 0) @@ -2955,7 +2957,7 @@ int JZTrack::GetChorusType(int lsb) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(ChorusType); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpChorusType); if (pValue) { @@ -2972,9 +2974,9 @@ void JZTrack::SetChorusType(int Value, int lsb) { - if (ChorusType) + if (mpChorusType) { - Kill(ChorusType); + Kill(mpChorusType); } if (Value > 0) @@ -2996,7 +2998,7 @@ int JZTrack::GetEqualizerType() { - const unsigned char* pValue = gpSynth->GetSysexValPtr(EqualizerType); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpEqualizerType); if (pValue) { @@ -3008,9 +3010,9 @@ void JZTrack::SetEqualizerType(int Value) { - if (EqualizerType) + if (mpEqualizerType) { - Kill(EqualizerType); + Kill(mpEqualizerType); } if (Value > 0) @@ -3029,7 +3031,7 @@ int JZTrack::GetRevSysex(int rsp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(ReverbSettings[rsp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpReverbSettings[rsp]); if (pValue) { @@ -3041,9 +3043,9 @@ void JZTrack::SetRevSysex(int rsp, int Value) { - if (ReverbSettings[rsp]) + if (mpReverbSettings[rsp]) { - Kill(ReverbSettings[rsp]); + Kill(mpReverbSettings[rsp]); } if (Value > 0) @@ -3065,7 +3067,7 @@ int JZTrack::GetChoSysex(int csp) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(ChorusSettings[csp]); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpChorusSettings[csp]); if (pValue) { @@ -3077,9 +3079,9 @@ void JZTrack::SetChoSysex(int csp, int Value) { - if (ChorusSettings[csp]) + if (mpChorusSettings[csp]) { - Kill(ChorusSettings[csp]); + Kill(mpChorusSettings[csp]); } if (Value > 0) @@ -3102,7 +3104,7 @@ int JZTrack::GetPartRsrv(int chan) { - const unsigned char* pValue = gpSynth->GetSysexValPtr(PartialReserve); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpPartialReserve); if (pValue) { @@ -3114,9 +3116,9 @@ void JZTrack::SetPartRsrv(unsigned char* rsrv) { - if (PartialReserve) + if (mpPartialReserve) { - Kill(PartialReserve); + Kill(mpPartialReserve); } if (rsrv) @@ -3135,11 +3137,11 @@ int JZTrack::GetMasterVol() { - const unsigned char* pValue = gpSynth->GetSysexValPtr(MasterVol); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpMasterVol); if (pValue) { - if (gpSynth->GetSysexId(MasterVol) == SX_GM_MasterVol) + if (gpSynth->GetSysexId(mpMasterVol) == SX_GM_MasterVol) { // first data byte is lsb; get msb instead! ++pValue; @@ -3153,9 +3155,9 @@ void JZTrack::SetMasterVol(int Value) { - if (MasterVol) + if (mpMasterVol) { - Kill(MasterVol); + Kill(mpMasterVol); } if (Value > 0) { @@ -3174,7 +3176,7 @@ int JZTrack::GetMasterPan() { - const unsigned char* pValue = gpSynth->GetSysexValPtr(MasterPan); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpMasterPan); if (pValue) { @@ -3186,9 +3188,9 @@ void JZTrack::SetMasterPan(int Value) { - if (MasterPan) + if (mpMasterPan) { - Kill(MasterPan); + Kill(mpMasterPan); } if (Value > 0) { @@ -3211,11 +3213,11 @@ switch (param) { case mspRxChannel: - pValue = gpSynth->GetSysexValPtr(RxChannel); + pValue = gpSynth->GetSysexValPtr(mpRxChannel); break; case mspUseForRhythm: - pValue = gpSynth->GetSysexValPtr(UseForRhythm); + pValue = gpSynth->GetSysexValPtr(mpUseForRhythm ); break; } @@ -3232,16 +3234,16 @@ switch (param) { case mspRxChannel: - if (RxChannel) + if (mpRxChannel) { - Kill(RxChannel); + Kill(mpRxChannel); } break; case mspUseForRhythm: - if (UseForRhythm) + if (mpUseForRhythm ) { - Kill(UseForRhythm); + Kill(mpUseForRhythm ); } break; } @@ -3273,18 +3275,18 @@ JZMtcTime* JZTrack::GetMtcOffset() { - if (MtcOffset) + if (mpMtcOffset) { - return new JZMtcTime(MtcOffset); + return new JZMtcTime(mpMtcOffset); } return(new JZMtcTime(0, Mtc30Ndf)); } void JZTrack::SetMtcOffset(JZMtcTime* mtc) { - if (MtcOffset) + if (mpMtcOffset) { - Kill(MtcOffset); + Kill(mpMtcOffset); } if (mtc) { Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2013-04-06 17:41:36 UTC (rev 1003) +++ trunk/jazz/src/Track.h 2013-04-06 17:42:24 UTC (rev 1004) @@ -320,8 +320,8 @@ void PutParam(JZNrpn* par); void DelParam(int pit, int index); JZDrumInstrumentParameter *FirstElem(); - JZDrumInstrumentParameter *NextElem(JZDrumInstrumentParameter *cur ); - void DelElem( int pit ); + JZDrumInstrumentParameter *NextElem(JZDrumInstrumentParameter *cur); + void DelElem(int pit); void Clear(); bool IsEmpty() const { @@ -347,19 +347,25 @@ { public: - tMtcType type; - int hour; - int min; - int sec; - int fm; - JZMtcTime(JZMtcOffsetEvent* s); // an mtc offset or mtc full message JZMtcTime(int millisek, tMtcType t); JZMtcTime(char* str, tMtcType t); + tMtcType GetType() const + { + return mType; + } JZMtcTime(unsigned h, unsigned m, unsigned s, unsigned f, unsigned t); void ToString(std::string& String); JZMtcOffsetEvent* ToOffset(); int ToMillisec(); + + private: + + tMtcType mType; + int mHours; + int mMinutes; + int mSeconds; + int fm; }; @@ -446,45 +452,45 @@ JZSysExEvent* mpReset; JZSysExEvent* mpModulationSettings[mspModulationSysexParameters]; - JZSysExEvent* BenderSettings[bspBenderSysexParameters]; - JZSysExEvent* CAfSettings[cspCAfSysexParameters]; - JZSysExEvent* PAfSettings[pspPAfSysexParameters]; - JZSysExEvent* CC1Settings[cspCC1SysexParameters]; - JZSysExEvent* CC2Settings[cspCC2SysexParameters]; + JZSysExEvent* mpBenderSettings[bspBenderSysexParameters]; + JZSysExEvent* mpCAfSettings[cspCAfSysexParameters]; + JZSysExEvent* mpPAfSettings[pspPAfSysexParameters]; + JZSysExEvent* mpCC1Settings[cspCC1SysexParameters]; + JZSysExEvent* mpCC2Settings[cspCC2SysexParameters]; JZSysExEvent* mpCC1ControllerNr; - JZSysExEvent* CC2ControllerNr; + JZSysExEvent* mpCC2ControllerNr; - JZSysExEvent* ReverbType; - JZSysExEvent* ChorusType; - JZSysExEvent* EqualizerType; + JZSysExEvent* mpReverbType; + JZSysExEvent* mpChorusType; + JZSysExEvent* mpEqualizerType; - JZSysExEvent* ReverbSettings[rspReverbSysexParameters]; - JZSysExEvent* ChorusSettings[cspChorusSysexParameters]; + JZSysExEvent* mpReverbSettings[rspReverbSysexParameters]; + JZSysExEvent* mpChorusSettings[cspChorusSysexParameters]; - JZSysExEvent* PartialReserve; - JZSysExEvent* MasterVol; - JZSysExEvent* MasterPan; + JZSysExEvent* mpPartialReserve; + JZSysExEvent* mpMasterVol; + JZSysExEvent* mpMasterPan; - JZSysExEvent* RxChannel; - JZSysExEvent* UseForRhythm; + JZSysExEvent* mpRxChannel; + JZSysExEvent* mpUseForRhythm ; - JZMtcOffsetEvent* MtcOffset; + JZMtcOffsetEvent* mpMtcOffset; - JZNrpn* VibRate; - JZNrpn* VibDepth; - JZNrpn* VibDelay; - JZNrpn* Cutoff; - JZNrpn* Resonance; - JZNrpn* EnvAttack; - JZNrpn* EnvDecay; - JZNrpn* EnvRelease; - JZRpn* BendPitchSens; + JZNrpn* mpVibRate; + JZNrpn* mpVibDepth; + JZNrpn* mpVibDelay; + JZNrpn* mpCutoff; + JZNrpn* mpResonance; + JZNrpn* mpEnvAttack; + JZNrpn* mpEnvDecay; + JZNrpn* mpEnvRelease; + JZRpn* mpBendPitchSens; - JZDrumInstrumentParameterList DrumParams; + JZDrumInstrumentParameterList mDrumParams; int mChannel; // 1..16, set from first ChannelEvent, 0 = multichannel/nochannel - int mDevice; // 0 for tSeq2/Mpu401 + int mDevice; // 0 for JZSeq2Player/JZMpuPlayer int mForceChannel; virtual void Clear(); @@ -576,7 +582,7 @@ void Cleanup(); const char* GetName(); - void SetName(const char *Name); + void SetName(const char* Name); const char* GetCopyright(); void SetCopyright(char *Copyright); @@ -647,23 +653,23 @@ int GetBendPitchSens(); void SetBendPitchSens(int BendPitchSens); - int GetModulationSysex( int msp ); - void SetModulationSysex( int msp, int value); + int GetModulationSysex(int msp); + void SetModulationSysex(int msp, int value); - int GetBenderSysex( int bsp ); - void SetBenderSysex( int bsp, int value); + int GetBenderSysex(int bsp); + void SetBenderSysex(int bsp, int value); - int GetCAfSysex( int csp ); - void SetCAfSysex( int csp, int value); + int GetCAfSysex(int csp); + void SetCAfSysex(int csp, int value); - int GetPAfSysex( int psp ); - void SetPAfSysex( int psp, int value); + int GetPAfSysex(int psp); + void SetPAfSysex(int psp, int value); - int GetCC1Sysex( int csp ); - void SetCC1Sysex( int csp, int value); + int GetCC1Sysex(int csp); + void SetCC1Sysex(int csp, int value); - int GetCC2Sysex( int csp ); - void SetCC2Sysex( int csp, int value); + int GetCC2Sysex(int csp); + void SetCC2Sysex(int csp, int value); int GetCC1ControllerNr(); void SetCC1ControllerNr(int ctrlno); @@ -680,11 +686,11 @@ int GetEqualizerType(); void SetEqualizerType(int EqualizerType); - int GetRevSysex( int rsp ); - void SetRevSysex( int rsp, int value); + int GetRevSysex(int rsp); + void SetRevSysex(int rsp, int value); - int GetChoSysex( int csp ); - void SetChoSysex( int csp, int value); + int GetChoSysex(int csp); + void SetChoSysex(int csp, int value); int GetBank(); void SetBank(int Bank); @@ -702,14 +708,14 @@ int GetMasterPan(); void SetMasterPan(int MasterPan); - int GetPartRsrv( int chan ); - void SetPartRsrv( unsigned char *rsrv ); + int GetPartRsrv(int chan); + void SetPartRsrv(unsigned char* rsrv); - int GetModeSysex( int param ); - void SetModeSysex( int param, int value); + int GetModeSysex(int param); + void SetModeSysex(int param, int value); JZMtcTime* GetMtcOffset(); - void SetMtcOffset( JZMtcTime* mtc ); + void SetMtcOffset(JZMtcTime* mtc); private: Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.cpp 2013-04-06 17:41:36 UTC (rev 1003) +++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2013-04-06 17:42:24 UTC (rev 1004) @@ -627,11 +627,11 @@ } if (!Continue) { - JZMtcTime *offs = mpSong->GetTrack(0)->GetMtcOffset(); - mpState->start_time = offs->ToMillisec(); + JZMtcTime* pMtcOffset = mpSong->GetTrack(0)->GetMtcOffset(); + mpState->start_time = pMtcOffset->ToMillisec(); real_start_time = mpState->start_time; - mpState->mtc_start.type = offs->type; - delete offs; + mpState->mtc_start.type = pMtcOffset->GetType(); + delete pMtcOffset; mpState->start_clock = 0; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-06 17:41:38
|
Revision: 1003 http://sourceforge.net/p/jazzplusplus/code/1003 Author: pstieber Date: 2013-04-06 17:41:36 +0000 (Sat, 06 Apr 2013) Log Message: ----------- Added code to create a toolbar in the rhythm frame. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-04-02 20:27:58 UTC (rev 1002) +++ trunk/jazz/src/Rhythm.cpp 2013-04-06 17:41:36 UTC (rev 1003) @@ -52,6 +52,15 @@ using namespace std; +#include "Bitmaps/open.xpm" +#include "Bitmaps/save.xpm" +#include "Bitmaps/rrgadd.xpm" +#include "Bitmaps/rrgdel.xpm" +#include "Bitmaps/rrgup.xpm" +#include "Bitmaps/rrgdown.xpm" +#include "Bitmaps/rrggen.xpm" +#include "Bitmaps/help.xpm" + void tRhyGroup::write(ostream& Os) const { Os << listen << ' '; @@ -1351,8 +1360,11 @@ gpConfig->GetValue(C_RhythmXpos), gpConfig->GetValue(C_RhythmYpos)), wxSize(640, 580)), + mpToolBar(0), mpRhythmGeneratorWindow(0) { + CreateToolBar(); + wxMenu* pFileMenu = new wxMenu; pFileMenu->Append(wxID_OPEN, "&Load..."); pFileMenu->Append(wxID_SAVEAS, "Save &As..."); @@ -1384,6 +1396,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::CreateToolBar() +{ + JZToolDef ToolBarDefinitions[] = + { + { wxID_OPEN, false, open_xpm, "open rhythm file" }, + { wxID_SAVE, false, save_xpm, "save into rhythm file" }, + { JZToolBar::eToolBarSeparator }, + { ID_INSTRUMENT_ADD, false, rrgadd_xpm, "add instrument" }, + { ID_INSTRUMENT_DELETE, false, rrgdel_xpm, "remove instrument" }, + { ID_INSTRUMENT_UP, false, rrgup_xpm, "move instrument up" }, + { ID_INSTRUMENT_DOWN, false, rrgdown_xpm, "move instrument down" }, + { ID_INSTRUMENT_GENERATE, false, rrggen_xpm, "generate events into trackwin selection" }, + { JZToolBar::eToolBarSeparator }, + { wxID_HELP_CONTENTS, false, help_xpm, "help" }, + { JZToolBar::eToolBarEnd } + }; + + mpToolBar = new JZToolBar(this, ToolBarDefinitions); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythmGeneratorFrame::~JZRhythmGeneratorFrame() { delete mpRhythmGeneratorWindow; Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-04-02 20:27:58 UTC (rev 1002) +++ trunk/jazz/src/Rhythm.h 2013-04-06 17:41:36 UTC (rev 1003) @@ -25,8 +25,6 @@ #include "Globals.h" #include "Random.h" -#include "ToolBar.h" - #include <wx/frame.h> #include <iostream> @@ -34,6 +32,7 @@ class JZBarInfo; class JZEventWindow; class JZSong; +class JZToolBar; class JZTrack; class wxButton; class wxCheckBox; @@ -275,12 +274,16 @@ private: + void CreateToolBar(); + void OnHelp(wxCommandEvent& Event); void OnHelpContents(wxCommandEvent& Event); private: + JZToolBar* mpToolBar; + JZRhythmGeneratorWindow* mpRhythmGeneratorWindow; DECLARE_EVENT_TABLE() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-02 20:28:01
|
Revision: 1002 http://sourceforge.net/p/jazzplusplus/code/1002 Author: pstieber Date: 2013-04-02 20:27:58 +0000 (Tue, 02 Apr 2013) Log Message: ----------- 1. Updated some data member names. 2. Updated pointer * location. 3. Removed some white space inside of parentheses. 4. Updated a default argument to Boolean. Modified Paths: -------------- trunk/jazz/src/Player.cpp trunk/jazz/src/Song.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2013-04-02 20:22:45 UTC (rev 1001) +++ trunk/jazz/src/Player.cpp 2013-04-02 20:27:58 UTC (rev 1002) @@ -430,9 +430,9 @@ for (j = mspModPitchControl; j < mspModulationSysexParameters; j++) { - if (t->ModulationSettings[j]) + if (t->mpModulationSettings[j]) { - OutNow(t, t->ModulationSettings[j]); + OutNow(t, t->mpModulationSettings[j]); } } @@ -476,9 +476,9 @@ } } - if (t->CC1ControllerNr) + if (t->mpCC1ControllerNr) { - OutNow(t, t->CC1ControllerNr); + OutNow(t, t->mpCC1ControllerNr); } if (t->CC2ControllerNr) Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2013-04-02 20:22:45 UTC (rev 1001) +++ trunk/jazz/src/Song.cpp 2013-04-02 20:27:58 UTC (rev 1002) @@ -357,7 +357,7 @@ bool DoSoloTracksExist = false; for (i = 0; i < mTrackCount; i++) { - if (mTracks[i].State == tsSolo) + if (mTracks[i].mState == tsSolo) { DoSoloTracksExist = true; break; @@ -368,8 +368,8 @@ { JZTrack* pTrack = &mTracks[i]; if ( - pTrack->State == tsSolo || - (!DoSoloTracksExist && pTrack->State == tsPlay)) + pTrack->mState == tsSolo || + (!DoSoloTracksExist && pTrack->mState == tsPlay)) { if (pTrack->GetAudioMode() != AudioMode) { Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2013-04-02 20:22:45 UTC (rev 1001) +++ trunk/jazz/src/Track.cpp 2013-04-02 20:27:58 UTC (rev 1002) @@ -520,7 +520,7 @@ mChannel = 0; mDevice = 0; mForceChannel = 0; - State = tsPlay; + mState = tsPlay; Clear(); } @@ -570,7 +570,7 @@ for (i = 0; i < mspModulationSysexParameters; i++) { - ModulationSettings[i] = 0; + mpModulationSettings[i] = 0; } for (i = 0; i < bspBenderSysexParameters; i++) @@ -598,7 +598,7 @@ CC2Settings[i] = 0; } - CC1ControllerNr = 0; + mpCC1ControllerNr = 0; CC2ControllerNr = 0; ReverbType = 0; @@ -641,7 +641,7 @@ mppEvents = 0; mMaxEvents = 0; - State = tsPlay; + mState = tsPlay; mAudioMode = false; } @@ -697,7 +697,7 @@ for (i = 0; i < mspModulationSysexParameters; i++) { - ModulationSettings[i] = 0; + mpModulationSettings[i] = 0; } for (i = bspBendPitchControl; i < bspBenderSysexParameters; i++) @@ -725,7 +725,7 @@ CC2Settings[i] = 0; } - CC1ControllerNr = 0; + mpCC1ControllerNr = 0; CC2ControllerNr = 0; ReverbType = 0; @@ -869,7 +869,7 @@ case SX_GS_ModLfo2Pitch: case SX_GS_ModLfo2Tvf: case SX_GS_ModLfo2Tva: - ModulationSettings[SysExId - SX_GS_ModPitch] = s; + mpModulationSettings[SysExId - SX_GS_ModPitch] = s; break; case SX_GS_CafPitch: @@ -956,7 +956,7 @@ break; case SX_GS_CC1CtrlNo: - CC1ControllerNr = s; + mpCC1ControllerNr = s; break; case SX_GS_CC2CtrlNo: @@ -998,13 +998,13 @@ case SX_XG_ModPitch: case SX_XG_ModTvf: case SX_XG_ModAmpl: - ModulationSettings[SysExId - SX_XG_ModPitch] = s; + mpModulationSettings[SysExId - SX_XG_ModPitch] = s; break; case SX_XG_ModLfoPitch: case SX_XG_ModLfoTvf: case SX_XG_ModLfoTva: - ModulationSettings[SysExId + 1 - SX_XG_ModPitch] = s; + mpModulationSettings[SysExId + 1 - SX_XG_ModPitch] = s; break; case SX_XG_CafPitch: @@ -1068,7 +1068,7 @@ break; case SX_XG_CC1CtrlNo: - CC1ControllerNr = s; + mpCC1ControllerNr = s; break; case SX_XG_CC2CtrlNo: @@ -1318,7 +1318,7 @@ JZJazzMetaEvent JazzMeta; JazzMeta.SetAudioMode(mAudioMode); - JazzMeta.SetTrackState(State); + JazzMeta.SetTrackState(mState); JazzMeta.SetTrackDevice(mDevice); JazzMeta.SetIntroLength(gpSong->GetIntroLength()); JazzMeta.Write(Io); @@ -1392,7 +1392,7 @@ { JZJazzMetaEvent* pJazzMetaEvent = pEvent->IsJazzMeta(); mAudioMode = pJazzMetaEvent->GetAudioMode(); - State = (int)pJazzMetaEvent->GetTrackState(); + mState = (int)pJazzMetaEvent->GetTrackState(); mDevice = (int)pJazzMetaEvent->GetTrackDevice(); gpSong->SetIntroLength((int)pJazzMetaEvent->GetIntroLength()); delete pJazzMetaEvent; @@ -2050,7 +2050,7 @@ { mUndoBuffers[i].Clear(); } - State = tsPlay; + mState = tsPlay; JZEventArray::Clear(); } @@ -2661,7 +2661,7 @@ int JZTrack::GetModulationSysex(int msp) { const unsigned char* pValue = - gpSynth->GetSysexValPtr(ModulationSettings[msp]); + gpSynth->GetSysexValPtr(mpModulationSettings[msp]); if (pValue) { @@ -2673,9 +2673,9 @@ void JZTrack::SetModulationSysex(int msp, int Value) { - if (ModulationSettings[msp]) + if (mpModulationSettings[msp]) { - Kill(ModulationSettings[msp]); + Kill(mpModulationSettings[msp]); } if (Value > 0) { @@ -2851,7 +2851,7 @@ int JZTrack::GetCC1ControllerNr() { - const unsigned char* pValue = gpSynth->GetSysexValPtr(CC1ControllerNr); + const unsigned char* pValue = gpSynth->GetSysexValPtr(mpCC1ControllerNr); if (pValue) { @@ -2863,9 +2863,9 @@ void JZTrack::SetCC1ControllerNr(int Value) { - if (CC1ControllerNr) + if (mpCC1ControllerNr) { - Kill(CC1ControllerNr); + Kill(mpCC1ControllerNr); } if (Value > 0) { @@ -3353,7 +3353,7 @@ const char* JZTrack::GetStateChar() { - switch (State) + switch (mState) { case tsPlay: return "P"; @@ -3367,12 +3367,12 @@ void JZTrack::SetState(int NewState) { - State = NewState % 3; + mState = NewState % 3; } void JZTrack::ToggleState(int Direction) { - State = (State + Direction + 3) % 3; + mState = (mState + Direction + 3) % 3; } // ------------------------- Channel --------------------------- Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2013-04-02 20:22:45 UTC (rev 1001) +++ trunk/jazz/src/Track.h 2013-04-02 20:27:58 UTC (rev 1002) @@ -148,7 +148,7 @@ } }; -unsigned char *SysExDT1( +unsigned char* SysExDT1( unsigned char aa, unsigned char bb, unsigned char cc, @@ -294,7 +294,7 @@ JZDrumInstrumentParameter(JZNrpn* par); JZNrpn* Get(int index); - void Put( JZNrpn* par); + void Put(JZNrpn* par); JZDrumInstrumentParameter* Next(); int Pitch(); @@ -355,7 +355,7 @@ JZMtcTime(JZMtcOffsetEvent* s); // an mtc offset or mtc full message JZMtcTime(int millisek, tMtcType t); - JZMtcTime(char *str, tMtcType t); + JZMtcTime(char* str, tMtcType t); JZMtcTime(unsigned h, unsigned m, unsigned s, unsigned f, unsigned t); void ToString(std::string& String); JZMtcOffsetEvent* ToOffset(); @@ -445,14 +445,14 @@ JZSysExEvent* mpReset; - JZSysExEvent* ModulationSettings[mspModulationSysexParameters]; + JZSysExEvent* mpModulationSettings[mspModulationSysexParameters]; JZSysExEvent* BenderSettings[bspBenderSysexParameters]; JZSysExEvent* CAfSettings[cspCAfSysexParameters]; JZSysExEvent* PAfSettings[pspPAfSysexParameters]; JZSysExEvent* CC1Settings[cspCC1SysexParameters]; JZSysExEvent* CC2Settings[cspCC2SysexParameters]; - JZSysExEvent* CC1ControllerNr; + JZSysExEvent* mpCC1ControllerNr; JZSysExEvent* CC2ControllerNr; JZSysExEvent* ReverbType; @@ -488,7 +488,7 @@ int mForceChannel; virtual void Clear(); - void Cleanup(bool dont_delete_killed_events = 0); + void Cleanup(bool dont_delete_killed_events = false); void Keyoff2Length(); void Length2Keyoff(); @@ -503,7 +503,7 @@ bool IsEmpty() const; int GetFirstClock(); - int State; // tsXXX + int mState; // tsXXX public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-02 20:22:48
|
Revision: 1001 http://sourceforge.net/p/jazzplusplus/code/1001 Author: pstieber Date: 2013-04-02 20:22:45 +0000 (Tue, 02 Apr 2013) Log Message: ----------- Updated a data member name. Modified Paths: -------------- trunk/jazz/src/AlsaPlayer.cpp Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2013-04-02 20:21:34 UTC (rev 1000) +++ trunk/jazz/src/AlsaPlayer.cpp 2013-04-02 20:22:45 UTC (rev 1001) @@ -649,7 +649,9 @@ } play_clock = Now; - if (mPlayBuffer.nEvents && mPlayBuffer.mppEvents[0]->GetClock() < mOutClock) + if ( + mPlayBuffer.mEventCount && + mPlayBuffer.mppEvents[0]->GetClock() < mOutClock) { FlushToDevice(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-04-02 20:21:37
|
Revision: 1000 http://sourceforge.net/p/jazzplusplus/code/1000 Author: pstieber Date: 2013-04-02 20:21:34 +0000 (Tue, 02 Apr 2013) Log Message: ----------- Fixed a menu name and updated local variable names. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-29 19:48:24 UTC (rev 999) +++ trunk/jazz/src/Rhythm.cpp 2013-04-02 20:21:34 UTC (rev 1000) @@ -551,26 +551,26 @@ n_bars = 0; instrument_list = 0; - wxMenuBar *menu_bar = new wxMenuBar; - wxMenu *menu = new wxMenu; - menu->Append(wxID_OPEN, "&Load"); - menu->Append(wxID_SAVE, "&Save"); - menu->Append(wxID_CLOSE, "&Close"); - menu_bar->Append(menu, "&File"); + wxMenuBar* pMenuBar = new wxMenuBar; + wxMenu* pMenu = new wxMenu; + pMenu->Append(wxID_OPEN, "&Load"); + pMenu->Append(wxID_SAVE, "&Save"); + pMenu->Append(wxID_CLOSE, "&Close"); + pMenuBar->Append(pMenu, "&File"); - menu = new wxMenu; - menu->Append(ID_INSTRUMENT_ADD, "&Add"); - menu->Append(ID_INSTRUMENT_DELETE, "&Delete"); - menu->Append(ID_INSTRUMENT_UP, "&Up"); - menu->Append(ID_INSTRUMENT_DOWN, "&Down"); - menu->Append(ID_INSTRUMENT_GENERATE, "&Generate"); - menu_bar->Append(menu, &Instrument"); + pMenu = new wxMenu; + pMenu->Append(ID_INSTRUMENT_ADD, "&Add"); + pMenu->Append(ID_INSTRUMENT_DELETE, "&Delete"); + pMenu->Append(ID_INSTRUMENT_UP, "&Up"); + pMenu->Append(ID_INSTRUMENT_DOWN, "&Down"); + pMenu->Append(ID_INSTRUMENT_GENERATE, "&Generate"); + pMenuBar->Append(pMenu, "&Instrument"); - menu = new wxMenu; - menu->Append(wxID_HELP, "&Help"); - menu_bar->Append(menu, "Help"); + pMenu = new wxMenu; + pMenu->Append(wxID_HELP, "&Help"); + pMenuBar->Append(pMenu, "Help"); - SetMenuBar(menu_bar); + SetMenuBar(pMenuBar); int x = 0; int y = (int)tb_height; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-29 19:48:27
|
Revision: 999 http://sourceforge.net/p/jazzplusplus/code/999 Author: pstieber Date: 2013-03-29 19:48:24 +0000 (Fri, 29 Mar 2013) Log Message: ----------- 1. Prefixed data members with m. 2. Removed extra white space inside of parentheses. 3. Changed pointer spacing convention. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Dialogs/TrackDialog.cpp trunk/jazz/src/Harmony.cpp trunk/jazz/src/HarmonyP.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SliderWindow.cpp trunk/jazz/src/Song.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackWindow.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Audio.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -475,7 +475,7 @@ } // iterate the events and add sounding voices - while (event_index < events->nEvents) + while (event_index < events->mEventCount) { JZEvent* pEvent = events->mppEvents[event_index]; if (pEvent->GetClock() >= last_clock) @@ -1012,7 +1012,7 @@ // add a noteon JZKeyOnEvent* pKeyOn = new JZKeyOnEvent( frc, - track->Channel - 1, + track->mChannel - 1, key, 64, (unsigned short)(toc - frc)); Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/ControlEdit.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -445,7 +445,7 @@ JZEvent * JZPitchEdit::NewEvent(long clock, int val) { - return new JZPitchEvent(clock, track->Channel - 1, val); + return new JZPitchEvent(clock, track->mChannel - 1, val); } // ------------------------------------------------------------------ @@ -490,7 +490,7 @@ JZEvent * JZControlEdit::NewEvent(long clock, int val) { - return new JZControlEvent(clock, track->Channel - 1, ctrl_num, val); + return new JZControlEvent(clock, track->mChannel - 1, ctrl_num, val); } // ------------------------------------------------------------------ @@ -813,7 +813,7 @@ JZEvent *JZChannelAftertouchEdit::NewEvent(long clock, int val) { - return new JZChnPressureEvent(clock, track->Channel - 1, val); + return new JZChnPressureEvent(clock, track->mChannel - 1, val); } void JZChannelAftertouchEdit::UpDate() Modified: trunk/jazz/src/Dialogs/TrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -177,10 +177,10 @@ ostringstream Oss; - Oss << (int)mTrack.Channel; + Oss << (int)mTrack.mChannel; mpChannelValue->SetLabel(Oss.str().c_str()); - mpChannelKnob->SetValue(mTrack.Channel); + mpChannelKnob->SetValue(mTrack.mChannel); mpAudioModeCheckBox->SetValue(mTrack.GetAudioMode()); @@ -201,7 +201,7 @@ int Bank = (Selection & 0x0000ff00) >> 8; mTrack.SetPatch(Patch); mTrack.SetBank(Bank); - mTrack.Channel = mpChannelKnob->GetValue(); + mTrack.mChannel = mpChannelKnob->GetValue(); mTrack.SetAudioMode(mpAudioModeCheckBox->GetValue()); } @@ -216,7 +216,7 @@ ostringstream Oss; Oss << Value; mpChannelValue->SetLabel(Oss.str().c_str()); - mTrack.Channel = Value; + mTrack.mChannel = Value; // Test to determine if the track channel toggled in our out of drum mode. if (mLastTrackChannelWasDrums != mTrack.IsDrumTrack()) Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Harmony.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -725,7 +725,7 @@ if (mpHbWindow->mMarkPiano && gpTrackFrame->GetPianoWindow()) { JZEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer; - for (int i = 0; i < buf.nEvents; i++) + for (int i = 0; i < buf.mEventCount; i++) { JZKeyOnEvent* pKeyOn = buf.mppEvents[i]->IsKeyOn(); if (pKeyOn) @@ -1734,8 +1734,8 @@ for (i = 0; i < 12; i++) { int x = w * i + 10; - chord_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+1*h));//(wxFunction)ChordCheck, - scale_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+2*h));//(wxFunction)ScaleCheck, + chord_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+1*h));//(wxFunction)ChordCheck, + scale_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+2*h));//(wxFunction)ScaleCheck, if (notename[i]) { new wxStaticText(this, wxID_ANY, notename[i], wxPoint(x, y + 3 * h)); Modified: trunk/jazz/src/HarmonyP.cpp =================================================================== --- trunk/jazz/src/HarmonyP.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/HarmonyP.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -447,11 +447,11 @@ ostream & operator << (ostream &os, JZHarmonyBrowserContext const &a) { - os << (int) a.scale_type << " "; - os << a.scale_nr << " "; - os << a.chord_nr << " "; - os << a.seq_nr << " "; - os << a.chord_key << " "; + os << (int) a.scale_type << ' '; + os << a.scale_nr << ' '; + os << a.chord_nr << ' '; + os << a.seq_nr << ' '; + os << a.chord_key << ' '; os << a.chord << a.scale; return os; } @@ -556,7 +556,7 @@ { for (int i = 0; i < 12; i++) if (c.Contains(i)) - cout << i << " "; + cout << i << ' '; cout << endl; } Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/PianoWindow.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -146,8 +146,8 @@ mChannel(-1), mpPianoWindow(pPianoWindow) { - mChannel = mpPianoWindow->GetTrack()->Channel ? - mpPianoWindow->GetTrack()->Channel - 1 : 0; + mChannel = mpPianoWindow->GetTrack()->mChannel ? + mpPianoWindow->GetTrack()->mChannel - 1 : 0; } //----------------------------------------------------------------------------- @@ -2319,7 +2319,7 @@ case MA_DIALOG: - EventDialog(pEvent, this, mpTrack, Clock, mpTrack->Channel - 1, Pitch); + EventDialog(pEvent, this, mpTrack, Clock, mpTrack->mChannel - 1, Pitch); Refresh(); break; @@ -2422,8 +2422,8 @@ } return - (mpTrack->Channel == gpConfig->GetValue(C_DrumChannel)) == - (pTrack->Channel == gpConfig->GetValue(C_DrumChannel)); + (mpTrack->mChannel == gpConfig->GetValue(C_DrumChannel)) == + (pTrack->mChannel == gpConfig->GetValue(C_DrumChannel)); } //============================================================================= @@ -3143,7 +3143,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::Paste(JZTrack* pTrack, int Clock, int Pitch) { - if (mPasteBuffer.nEvents == 0) + if (mPasteBuffer.mEventCount == 0) { int len = SnapClocks() - 4; if (len < 2) @@ -3190,9 +3190,9 @@ JZEvent *c = pEvent->Copy(); c->SetPitch(c->GetPitch() + DeltaPitch); c->SetClock(c->GetClock() + DeltaClock); - if (pTrack->ForceChannel && c->IsChannelEvent()) + if (pTrack->mForceChannel && c->IsChannelEvent()) { - c->IsChannelEvent()->SetChannel(pTrack->Channel - 1); + c->IsChannelEvent()->SetChannel(pTrack->mChannel - 1); } JZKeyOnEvent* pKeyOn = c->IsKeyOn(); if (pKeyOn) @@ -3250,7 +3250,7 @@ //----------------------------------------------------------------------------- int JZPianoWindow::Channel() { - return mpTrack->Channel ? mpTrack->Channel - 1 : 0; + return mpTrack->mChannel ? mpTrack->mChannel - 1 : 0; } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Player.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -251,7 +251,7 @@ // send them to driver // else // tell the driver that there is nothing to do at the moment - if (mPlayBuffer.nEvents && mPlayBuffer.mppEvents[0]->GetClock() < mOutClock) + if (mPlayBuffer.mEventCount && mPlayBuffer.mppEvents[0]->GetClock() < mOutClock) { FlushToDevice(); } Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Random.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -235,10 +235,10 @@ { int i; - os << a.n << " " << a.min << " " << a.max << endl; + os << a.n << ' ' << a.min << ' ' << a.max << endl; for (i = 0; i < a.n; i++) { - os << a.mArray[i] << " "; + os << a.mArray[i] << ' '; } os << endl; return os; Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Rhythm.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -54,8 +54,8 @@ void tRhyGroup::write(ostream& Os) const { - Os << listen << " "; - Os << contrib << " "; + Os << listen << ' '; + Os << contrib << ' '; } void tRhyGroup::read(istream& Is, int version) @@ -169,19 +169,19 @@ Os << length; Os << veloc; - Os << steps_per_count << " "; - Os << count_per_bar << " "; - Os << n_bars << " "; - Os << mode << " "; - Os << n_keys << " "; + Os << steps_per_count << ' '; + Os << count_per_bar << ' '; + Os << n_bars << ' '; + Os << mode << ' '; + Os << n_keys << ' '; for (int i = 0; i < n_keys; i++) { - Os << keys[i] << " "; + Os << keys[i] << ' '; } Os << parm << endl; WriteString(Os, mLabel.c_str()) << endl; - Os << randomize << " "; + Os << randomize << ' '; groups.write(Os); } @@ -267,9 +267,9 @@ } -void JZRhythm::GenerateEvent(JZTrack *track, long clock, short vel, short len) +void JZRhythm::GenerateEvent(JZTrack* pTrack, long clock, short vel, short len) { - int chan = track->Channel - 1; + int chan = pTrack->mChannel - 1; // generate key events if (mode == MODE_ALL_OF) @@ -277,7 +277,7 @@ for (int ii = 0; ii < n_keys; ii++) { JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[ii], vel, len); - track->Put(k); + pTrack->Put(k); } } else if (mode == MODE_ONE_OF) @@ -286,14 +286,14 @@ if (ii < n_keys) { JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[ii], vel, len); - track->Put(k); + pTrack->Put(k); } } else if (mode == MODE_CONTROL) { // generate controller JZControlEvent* c = new JZControlEvent(clock, chan, parm - 1, vel); - track->Put(c); + pTrack->Put(c); } else { @@ -303,9 +303,9 @@ #if 0 -void JZRhythm::Generate(JZTrack *track, long fr_clock, long to_clock, long ticks_per_bar) +void JZRhythm::Generate(JZTrack* pTrack, long fr_clock, long to_clock, long ticks_per_bar) { - int chan = track->Channel - 1; + int chan = pTrack->Channel - 1; long clock = fr_clock; long clocks_per_step = ticks_per_bar / (steps_per_count * count_per_bar); @@ -348,7 +348,7 @@ for (int j = 0; j < n_keys; j++) { JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, keys[j], vel, len - clocks_per_step/2); - track->Put(k); + pTrack->Put(k); } } } @@ -357,13 +357,13 @@ else if (key == PASTE_KEY) { JZEventArray &src = gpTrackWindow->GetPianoWindow()->PasteBuffer; - for (int ii = 0; ii < src.nEvents; ii++) + for (int ii = 0; ii < src.mEventCount; ii++) { JZKeyOnEvent* pKeyOn = src.Events[ii]->IsKeyOn(); if (pKeyOn) { JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, pKeyOn->Key, vel, len - clocks_per_step / 2); - track->Put(k); + pTrack->Put(k); } } } @@ -372,13 +372,13 @@ else if (key == CONTROL_KEY) { JZControlEvent* c = new JZControlEvent(clock, chan, parm - 1, vel); - track->Put(c); + pTrack->Put(c); } // generate note on events else { JZKeyOnEvent *k = new JZKeyOnEvent(clock, chan, key, vel, len - clocks_per_step/2); - track->Put(k); + pTrack->Put(k); } clock += len; @@ -425,7 +425,7 @@ void JZRhythm::Generate( - JZTrack* track, + JZTrack* pTrack, const JZBarInfo& BarInfo, JZRhythm* rhy[], int n_rhy) @@ -480,7 +480,7 @@ vel = rrg[i] * 126 / rrg.Max() + 1; } short len = (length.Random() + 1) * clocks_per_step; - GenerateEvent(track, clock, vel, len - clocks_per_step/2); + GenerateEvent(pTrack, clock, vel, len - clocks_per_step/2); clock += len; } else @@ -930,7 +930,7 @@ JZCommandCopyToBuffer cmd(gpTrackFrame->GetPianoWindow()->GetFilter(), &events); cmd.Execute(0); // no UNDO - for (int ii = 0; ii < events.nEvents; ii++) + for (int ii = 0; ii < events.mEventCount; ii++) { JZKeyOnEvent* pKeyOn = events.mppEvents[ii]->IsKeyOn(); if (pKeyOn) @@ -1072,7 +1072,7 @@ long fr_clock = pFilter->GetFromClock(); long to_clock = pFilter->GetToClock(); - JZTrack *track = mpSong->GetTrack(pFilter->GetFromTrack()); + JZTrack* pTrack = mpSong->GetTrack(pFilter->GetFromTrack()); mpSong->NewUndoBuffer(); // remove selection @@ -1096,19 +1096,19 @@ // for (int i = 0; i < n_instruments; i++) // { -// instruments[i]->Generate(track, fr_clock, to_clock, BarInfo.GetTicksPerBar()); +// instruments[i]->Generate(pTrack, fr_clock, to_clock, BarInfo.GetTicksPerBar()); // } while (BarInfo.GetClock() < to_clock) { for (int i = 0; i < n_instruments; i++) { - instruments[i]->Generate(track, BarInfo, instruments, n_instruments); + instruments[i]->Generate(pTrack, BarInfo, instruments, n_instruments); } BarInfo.Next(); } - track->Cleanup(); + pTrack->Cleanup(); mpEventWindow->Refresh(); } Modified: trunk/jazz/src/SliderWindow.cpp =================================================================== --- trunk/jazz/src/SliderWindow.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/SliderWindow.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -135,8 +135,8 @@ sliders[k]->SetSize((int)x0, (int)y0, (int)(x1 - x0), (int)(y1 - y0)); // sliders[k]->SetSize((int)x0, 0, (int)(x1 - x0), (int)(y0-y1)); cout - << "slider " << k << " size:" << (int)x0 << " " << (int)y0 - << " " << (int)(x1 - x0) << " " << (int)(y1 - y0) + << "slider " << k << " size:" << (int)x0 << ' ' << (int)y0 + << ' ' << (int)(x1 - x0) << ' ' << (int)(y1 - y0) << endl; } } Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Song.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -566,7 +566,7 @@ for (int TrackIndex = 0; TrackIndex < mTrackCount; ++TrackIndex) { JZTrack* pTrack = &mTracks[TrackIndex]; - for (int EventIndex = 0; EventIndex < pTrack->nEvents; ++EventIndex) + for (int EventIndex = 0; EventIndex < pTrack->mEventCount; ++EventIndex) { JZEvent* pEvent = pTrack->mppEvents[EventIndex]; pEvent->SetClock((int)(f * pEvent->GetClock() + 0.5)); Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Track.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -211,20 +211,20 @@ { for (int i = drumPitchIndex; i < numDrumParameters; i++) { - param[i] = 0; + mParam[i] = 0; } - param[drumParam2Index(par->mMsb.GetControlValue())] = par; + mParam[drumParam2Index(par->mMsb.GetControlValue())] = par; } JZNrpn* JZDrumInstrumentParameter::Get(int index) { assert((index >= drumPitchIndex) && (index < numDrumParameters)); - return(param[index]); + return(mParam[index]); } void JZDrumInstrumentParameter::Put(JZNrpn* par) { - param[par->mLsb.GetControlValue()] = par; + mParam[par->mLsb.GetControlValue()] = par; } JZDrumInstrumentParameter* JZDrumInstrumentParameter::Next() @@ -240,7 +240,7 @@ JZDrumInstrumentParameter* JZDrumInstrumentParameterList::GetElem(int pit) { - JZDrumInstrumentParameter* ptr = list; + JZDrumInstrumentParameter* ptr = mpList; while (ptr) { if (ptr->mPitch == pit) @@ -268,27 +268,27 @@ if (!ptr) { ptr = new JZDrumInstrumentParameter(par); - ptr->mpNext = list; - list = ptr; + ptr->mpNext = mpList; + mpList = ptr; } else { - ptr->param[drumParam2Index(par->mMsb.GetControlValue())] = par; + ptr->mParam[drumParam2Index(par->mMsb.GetControlValue())] = par; } } void JZDrumInstrumentParameterList::DelParam(int pit, int index) { - if (list) + if (mpList) { JZDrumInstrumentParameter* elem = GetElem(pit); if (elem) { if (elem->Get(index)) { - delete elem->param[index]; + delete elem->mParam[index]; } - elem->param[index] = 0; + elem->mParam[index] = 0; } } } @@ -300,7 +300,7 @@ DelParam(pit, i); } - JZDrumInstrumentParameter* ptr = list; + JZDrumInstrumentParameter* ptr = mpList; JZDrumInstrumentParameter* prev = 0; while (ptr) { @@ -312,7 +312,7 @@ } else { - list = ptr->mpNext; + mpList = ptr->mpNext; } delete ptr; break; @@ -324,7 +324,7 @@ JZDrumInstrumentParameter* JZDrumInstrumentParameterList::FirstElem() { - return list; + return mpList; } JZDrumInstrumentParameter* JZDrumInstrumentParameterList::NextElem( @@ -350,20 +350,20 @@ void JZDrumInstrumentParameterList::Clear() { - JZDrumInstrumentParameter* ptr = list; + JZDrumInstrumentParameter* ptr = mpList; while (ptr) { - list = ptr->mpNext; + mpList = ptr->mpNext; delete ptr; - ptr = list; + ptr = mpList; } } JZSimpleEventArray::JZSimpleEventArray() : wxObject(), - nEvents(0), - MaxEvents(0), + mEventCount(0), + mMaxEvents(0), mppEvents(0) { } @@ -378,42 +378,42 @@ void JZSimpleEventArray::Clear() { int i; - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { delete mppEvents[i]; } - nEvents = 0; + mEventCount = 0; } void JZUndoBuffer::Clear() { int i; - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { if (bits(i)) { delete mppEvents[i]; } } - nEvents = 0; + mEventCount = 0; } void JZSimpleEventArray::Resize() { int i; - MaxEvents += 50; - JZEvent** ppEvents = new JZEvent* [MaxEvents]; + mMaxEvents += 50; + JZEvent** ppEvents = new JZEvent* [mMaxEvents]; // Copy the previuosly existing event pointers. - for (i = 0; i < nEvents; ++i) + for (i = 0; i < mEventCount; ++i) { ppEvents[i] = mppEvents[i]; } // Initialize the new event pointers to 0. - for (; i < MaxEvents; ++i) + for (; i < mMaxEvents; ++i) { ppEvents[i] = 0; } @@ -430,8 +430,8 @@ void JZSimpleEventArray::RemoveEOT() { int j = 0; - int newnEvents = nEvents; - for (int i = 0; i < nEvents; ++i) + int newnEvents = mEventCount; + for (int i = 0; i < mEventCount; ++i) { if (mppEvents[i] != 0 && mppEvents[i]->IsEndOfTrack()) { @@ -441,7 +441,7 @@ } JZEvent* item; - if (j <= MaxEvents) + if (j <= mMaxEvents) { item = mppEvents[j++]; } @@ -451,7 +451,7 @@ } mppEvents[i] = item; } - nEvents = newnEvents; + mEventCount = newnEvents; } void JZSimpleEventArray::Put(JZEvent* pEvent) @@ -461,11 +461,11 @@ // Remove the old EOT if we are adding a new one. RemoveEOT(); } - if (nEvents >= MaxEvents) + if (mEventCount >= mMaxEvents) { Resize(); } - mppEvents[nEvents++] = pEvent; + mppEvents[mEventCount++] = pEvent; } // Description: @@ -477,12 +477,12 @@ delete [] mppEvents; mppEvents = src.mppEvents; - nEvents = src.nEvents; - MaxEvents = src.MaxEvents; + mEventCount = src.mEventCount; + mMaxEvents = src.mMaxEvents; src.mppEvents = 0; - src.nEvents = 0; - src.MaxEvents = 0; + src.mEventCount = 0; + src.mMaxEvents = 0; } @@ -513,13 +513,13 @@ mpReset(0), mAudioMode(false) { - nEvents = 0; + mEventCount = 0; - MaxEvents = 0; + mMaxEvents = 0; mppEvents = 0; - Channel = 0; - Device = 0; - ForceChannel = 0; + mChannel = 0; + mDevice = 0; + mForceChannel = 0; State = tsPlay; Clear(); @@ -565,8 +565,8 @@ // delete mpSpeed; mpSpeed = 0; - Channel = 1; - Device = 0; + mChannel = 1; + mDevice = 0; for (i = 0; i < mspModulationSysexParameters; i++) { @@ -639,7 +639,7 @@ delete [] mppEvents; } mppEvents = 0; - MaxEvents = 0; + mMaxEvents = 0; State = tsPlay; mAudioMode = false; @@ -665,7 +665,7 @@ void JZSimpleEventArray::Sort() { - qsort(mppEvents, nEvents, sizeof(JZEvent*), compare); + qsort(mppEvents, mEventCount, sizeof(JZEvent*), compare); } @@ -749,18 +749,18 @@ UseForRhythm = 0; MtcOffset = 0; - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { if ((pEvent = mppEvents[i])->IsKilled()) { if (!dont_delete_killed_events) { - for (int j = i; j < nEvents; j++) + for (int j = i; j < mEventCount; j++) { delete mppEvents[j]; } } - nEvents = i; + mEventCount = i; break; } @@ -1094,7 +1094,7 @@ void JZEventArray::Length2Keyoff() { - int n = nEvents; + int n = mEventCount; for (int i = 0; i < n; i++) { JZKeyOnEvent* pKeyOn; @@ -1126,7 +1126,7 @@ void JZEventArray::Keyoff2Length() { int i; - for (i = 1; i < nEvents; i++) + for (i = 1; i < mEventCount; i++) { JZKeyOffEvent* pKeyOff; if ((pKeyOff = mppEvents[i]->IsKeyOff()) != 0) @@ -1155,7 +1155,7 @@ } // kill all KeyOn's with non matching KeyOff's - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { JZKeyOnEvent* k = mppEvents[i]->IsKeyOn(); if (k && k->Length <= 0) @@ -1173,13 +1173,13 @@ // Searches forward from a KeyOn to find the matching KeyOff. // This is compatible with Cubase. int i; - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { JZKeyOnEvent* pKeyOn; if ((pKeyOn = mppEvents[i]->IsKeyOn()) != 0 && pKeyOn->GetEventLength() == 0) { int j; - for (j = i + 1; j < nEvents; j++) + for (j = i + 1; j < mEventCount; j++) { JZKeyOffEvent* pKeyOff = mppEvents[j]->IsKeyOff(); if ( @@ -1202,7 +1202,7 @@ // kill all KeyOn's with non matching KeyOff's // and kill all remaining KeyOff's - for (i = 0; i < nEvents; i++) + for (i = 0; i < mEventCount; i++) { JZKeyOnEvent* pKeyOn = mppEvents[i]->IsKeyOn(); if (pKeyOn && pKeyOn->GetEventLength() <= 0) @@ -1319,11 +1319,11 @@ JZJazzMetaEvent JazzMeta; JazzMeta.SetAudioMode(mAudioMode); JazzMeta.SetTrackState(State); - JazzMeta.SetTrackDevice(Device); + JazzMeta.SetTrackDevice(mDevice); JazzMeta.SetIntroLength(gpSong->GetIntroLength()); JazzMeta.Write(Io); - for (int i = 0; i < nEvents; i++) + for (int i = 0; i < mEventCount; i++) { pEvent = mppEvents[i]; WrittenBefore = 0; @@ -1374,7 +1374,7 @@ void JZEventArray::Read(JZReadBase& Io) { JZEvent* pEvent; - Channel = 0; + mChannel = 0; unsigned char Msb, Lsb, Data; bool SpecialEvent; @@ -1393,7 +1393,7 @@ JZJazzMetaEvent* pJazzMetaEvent = pEvent->IsJazzMeta(); mAudioMode = pJazzMetaEvent->GetAudioMode(); State = (int)pJazzMetaEvent->GetTrackState(); - Device = (int)pJazzMetaEvent->GetTrackDevice(); + mDevice = (int)pJazzMetaEvent->GetTrackDevice(); gpSong->SetIntroLength((int)pJazzMetaEvent->GetIntroLength()); delete pJazzMetaEvent; continue; @@ -1569,9 +1569,9 @@ { Put(pEvent); NeedToDelete = false; - if (!Channel && pEvent->IsChannelEvent()) + if (!mChannel && pEvent->IsChannelEvent()) { - Channel = pEvent->IsChannelEvent()->GetChannel() + 1; + mChannel = pEvent->IsChannelEvent()->GetChannel() + 1; } } if (pEvent->IsEndOfTrack()) @@ -1590,9 +1590,9 @@ } // while read - if (!Channel) + if (!mChannel) { - Channel = 1; + mChannel = 1; } Keyoff2Length(); @@ -1601,21 +1601,21 @@ int JZEventArray::GetLastClock() const { - if (!nEvents) + if (!mEventCount) { return 0; } - return mppEvents[nEvents - 1]->GetClock(); + return mppEvents[mEventCount - 1]->GetClock(); } bool JZEventArray::IsEmpty() const { - return nEvents == 0; + return mEventCount == 0; } int JZEventArray::GetFirstClock() { - if (nEvents) + if (mEventCount) { return mppEvents[0]->GetClock(); } @@ -1635,7 +1635,7 @@ JZNamedChoice PatchChoice; JZNamedChoice DeviceChoice; int PatchNr; - int Device; + int mDevice; int BankNr; int ClearTrack; int AudioMode; @@ -1655,7 +1655,7 @@ "Patch", t->IsDrumTrack() ? &gpConfig->GetDrumSet(0) : &gpConfig->GetVoiceName(0), &PatchNr), - DeviceChoice("Device", gpMidiPlayer->GetOutputDevices().AsNamedValue(), &Device) + DeviceChoice("Device", gpMidiPlayer->GetOutputDevices().AsNamedValue(), &mDevice) { TrackWin = w; trk = t; @@ -1695,8 +1695,8 @@ PatchNr = PatchNr & 0x000000ff; trk->SetBank(BankNr); trk->SetPatch(PatchNr); - trk->SetDevice(Device); - if (trk->ForceChannel) + trk->SetDevice(mDevice); + if (trk->mForceChannel) { JZChannelEvent* c; JZSysExEvent* s; @@ -1708,7 +1708,7 @@ if ((c = pEvent->IsChannelEvent()) != 0) { c = (JZChannelEvent*)pEvent->Copy(); - c->SetChannel(trk->Channel - 1); + c->SetChannel(trk->mChannel - 1); trk->Kill(pEvent); trk->Put(c); } @@ -1720,12 +1720,12 @@ { if (gpSynth->IsXG()) { - *pChannel = trk->Channel - 1; + *pChannel = trk->mChannel - 1; } else { *pChannel &= 0xf0; - *pChannel |= sysex_channel(trk->Channel); + *pChannel |= sysex_channel(trk->mChannel); } s = (JZSysExEvent*) pEvent->Copy(); @@ -1738,47 +1738,47 @@ if (trk->VibRate) { - trk->VibRate->SetChannel(trk->Channel - 1); + trk->VibRate->SetChannel(trk->mChannel - 1); } if (trk->VibDepth) { - trk->VibDepth->SetChannel(trk->Channel - 1); + trk->VibDepth->SetChannel(trk->mChannel - 1); } if (trk->VibDelay) { - trk->VibDelay->SetChannel(trk->Channel - 1); + trk->VibDelay->SetChannel(trk->mChannel - 1); } if (trk->Cutoff) { - trk->Cutoff->SetChannel(trk->Channel - 1); + trk->Cutoff->SetChannel(trk->mChannel - 1); } if (trk->Resonance) { - trk->Resonance->SetChannel(trk->Channel - 1); + trk->Resonance->SetChannel(trk->mChannel - 1); } if (trk->EnvAttack) { - trk->EnvAttack->SetChannel(trk->Channel - 1); + trk->EnvAttack->SetChannel(trk->mChannel - 1); } if (trk->EnvDecay) { - trk->EnvDecay->SetChannel(trk->Channel - 1); + trk->EnvDecay->SetChannel(trk->mChannel - 1); } if (trk->EnvRelease) { - trk->EnvRelease->SetChannel(trk->Channel - 1); + trk->EnvRelease->SetChannel(trk->mChannel - 1); } if (trk->BendPitchSens) { - trk->BendPitchSens->SetChannel(trk->Channel - 1); + trk->BendPitchSens->SetChannel(trk->mChannel - 1); } if (trk->mpBank) { - trk->mpBank->Channel = trk->Channel - 1; + trk->mpBank->mChannel = trk->mChannel - 1; } if (trk->mpPatch) { - trk->mpPatch->Channel = trk->Channel - 1; + trk->mpPatch->mChannel = trk->mChannel - 1; } if (!trk->DrumParams.IsEmpty()) { @@ -1789,7 +1789,7 @@ { if (dpar->Get(index)) { - dpar->Get(index)->SetChannel(trk->Channel - 1); + dpar->Get(index)->SetChannel(trk->mChannel - 1); } } dpar = trk->DrumParams.NextElem(dpar); @@ -1804,7 +1804,7 @@ void JZTrackDlg::EditForm(wxPanel* panel) { PatchNr = trk->GetPatch() + (trk->GetBank() << 8); - Device = trk->GetDevice(); + mDevice = trk->GetDevice(); TrackName = copystring(trk->GetName()); Add(wxMakeFormString( "Trackname:", @@ -1829,14 +1829,14 @@ } Add(wxMakeFormShort( "Channel", - &trk->Channel, + &trk->mChannel, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(1.0, 16.0), 0))); AudioMode = trk->GetAudioMode(); Add(wxMakeFormNewLine()); Add(wxMakeFormBool("Audio Track", &AudioMode)); Add(wxMakeFormNewLine()); - Add(wxMakeFormBool("Force channel number onto all events on track", &trk->ForceChannel)); + Add(wxMakeFormBool("Force channel number onto all events on track", &trk->mForceChannel)); ClearTrack = 0; Add(wxMakeFormNewLine()); Add(wxMakeFormBool("Clear track (NB! erase all events, name etc...)", &ClearTrack)); @@ -1894,7 +1894,7 @@ mUndoCount(0), mpDialog(0) { - ForceChannel = 1; + mForceChannel = 1; } //----------------------------------------------------------------------------- @@ -1908,16 +1908,16 @@ //----------------------------------------------------------------------------- bool JZTrack::IsDrumTrack() { - return Channel == gpConfig->GetValue(C_DrumChannel); + return mChannel == gpConfig->GetValue(C_DrumChannel); } void JZTrack::Merge(JZEventArray* t) { - for (int i = 0; i < t->nEvents; i++) + for (int i = 0; i < t->mEventCount; i++) { Put(t->mppEvents[i]); } - t->nEvents = 0; + t->mEventCount = 0; } //----------------------------------------------------------------------------- @@ -1946,12 +1946,12 @@ while (pEvent) { JZEvent* c = pEvent->Copy(); - if (ForceChannel) + if (mForceChannel) { JZChannelEvent* pChannelEvent = c->IsChannelEvent(); if (pChannelEvent) { - pChannelEvent->SetChannel(Channel - 1); + pChannelEvent->SetChannel(mChannel - 1); } } Put(c); @@ -1977,7 +1977,7 @@ if (mUndoCount > 0) { JZUndoBuffer* undo = &mUndoBuffers[mUndoIndex]; - for (int i = undo->nEvents - 1; i >= 0; i--) + for (int i = undo->mEventCount - 1; i >= 0; i--) { JZEvent* pEvent = undo->mppEvents[i]; if (undo->bits(i)) @@ -2007,7 +2007,7 @@ mUndoIndex = (mUndoIndex + 1) % MaxUndo; JZUndoBuffer* undo = &mUndoBuffers[mUndoIndex]; - for (int i = 0; i < undo->nEvents; i++) + for (int i = 0; i < undo->mEventCount; i++) { JZEvent* pEvent = undo->mppEvents[i]; if (undo->bits(i)) @@ -2131,7 +2131,7 @@ } if (Value > 0) { - JZEvent* pEvent = new JZControlEvent(0, Channel - 1, 0x07, Value - 1); + JZEvent* pEvent = new JZControlEvent(0, mChannel - 1, 0x07, Value - 1); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); } @@ -2148,7 +2148,7 @@ JZEvent* pEvent = new JZControlEvent( 0, - Channel - 1, + mChannel - 1, 0x07, mpVolume->GetControlValue()); Put(pEvent); @@ -2171,7 +2171,7 @@ JZEvent* pEvent = new JZControlEvent( 0, - Channel - 1, + mChannel - 1, 0x07, mpVolume->GetControlValue()); @@ -2204,7 +2204,7 @@ } if (Value > 0) { - JZEvent* pEvent = new JZControlEvent(0, Channel - 1, 0x0a, Value - 1); + JZEvent* pEvent = new JZControlEvent(0, mChannel - 1, 0x0a, Value - 1); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); } @@ -2230,7 +2230,7 @@ } if (Value > 0) { - JZEvent* pEvent = new JZControlEvent(0, Channel - 1, 0x5B, Value - 1); + JZEvent* pEvent = new JZControlEvent(0, mChannel - 1, 0x5B, Value - 1); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); } @@ -2256,7 +2256,7 @@ } if (Value > 0) { - JZEvent* pEvent = new JZControlEvent(0, Channel - 1, 0x5D, Value - 1); + JZEvent* pEvent = new JZControlEvent(0, mChannel - 1, 0x5D, Value - 1); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); } @@ -2319,7 +2319,7 @@ Value);) mpBank = new JZControlEvent( 0, - Channel - 1, + mChannel - 1, gpConfig->GetValue(C_BankControlNumber), Value); gpMidiPlayer->OutNow(this, mpBank); @@ -2333,7 +2333,7 @@ DEBUG(fprintf(stderr, "Double command bank select (Bank %d).\n",Value);) mpBank = new JZControlEvent( 0, - Channel - 1, + mChannel - 1, gpConfig->GetValue(C_BankControlNumber), gpConfig->BankEntry(Value).Command[0]); gpMidiPlayer->OutNow(this, mpBank); @@ -2345,7 +2345,7 @@ mpBank->Value);) mpBank2 = new JZControlEvent( 0, - Channel - 1, + mChannel - 1, gpConfig->GetValue(C_BankControlNumber2), gpConfig->BankEntry(Value).Command[1]); @@ -2381,7 +2381,7 @@ } if (PatchNr > 0) { - mpPatch = new JZProgramEvent(0, Channel - 1, PatchNr - 1); + mpPatch = new JZProgramEvent(0, mChannel - 1, PatchNr - 1); gpMidiPlayer->OutNow(this, mpPatch); mChanged = true; } @@ -2408,7 +2408,7 @@ if (Value > 0) { - VibRate = new JZNrpn(0, Channel - 1, 0x01, 0x08, Value - 1); + VibRate = new JZNrpn(0, mChannel - 1, 0x01, 0x08, Value - 1); gpMidiPlayer->OutNow(this, VibRate); mChanged = true; } @@ -2434,7 +2434,7 @@ } if (Value > 0) { - VibDepth = new JZNrpn(0, Channel - 1, 0x01, 0x09, Value - 1); + VibDepth = new JZNrpn(0, mChannel - 1, 0x01, 0x09, Value - 1); gpMidiPlayer->OutNow(this, VibDepth); mChanged = true; } @@ -2461,7 +2461,7 @@ if (Value > 0) { - VibDelay = new JZNrpn(0, Channel - 1, 0x01, 0x0a, Value - 1); + VibDelay = new JZNrpn(0, mChannel - 1, 0x01, 0x0a, Value - 1); gpMidiPlayer->OutNow(this, VibDelay); mChanged = true; } @@ -2488,7 +2488,7 @@ if (Value > 0) { - Cutoff = new JZNrpn(0, Channel - 1, 0x01, 0x20, Value - 1); + Cutoff = new JZNrpn(0, mChannel - 1, 0x01, 0x20, Value - 1); gpMidiPlayer->OutNow(this, Cutoff); mChanged = true; } @@ -2515,7 +2515,7 @@ if (Value > 0) { - Resonance = new JZNrpn(0, Channel - 1, 0x01, 0x21, Value - 1); + Resonance = new JZNrpn(0, mChannel - 1, 0x01, 0x21, Value - 1); gpMidiPlayer->OutNow(this, Resonance); mChanged = true; } @@ -2542,7 +2542,7 @@ if (Value > 0) { - EnvAttack = new JZNrpn(0, Channel - 1, 0x01, 0x63, Value - 1); + EnvAttack = new JZNrpn(0, mChannel - 1, 0x01, 0x63, Value - 1); gpMidiPlayer->OutNow(this, EnvAttack); mChanged = true; } @@ -2569,7 +2569,7 @@ if (Value > 0) { - EnvDecay = new JZNrpn(0, Channel - 1, 0x01, 0x64, Value - 1); + EnvDecay = new JZNrpn(0, mChannel - 1, 0x01, 0x64, Value - 1); gpMidiPlayer->OutNow(this, EnvDecay); mChanged = true; } @@ -2596,7 +2596,7 @@ if (Value > 0) { - EnvRelease = new JZNrpn(0, Channel - 1, 0x01, 0x66, Value - 1); + EnvRelease = new JZNrpn(0, mChannel - 1, 0x01, 0x66, Value - 1); gpMidiPlayer->OutNow(this, EnvRelease); mChanged = true; } @@ -2623,7 +2623,7 @@ if (Value > 0) { DrumParams.PutParam( - new JZNrpn(0, Channel - 1, drumIndex2Param(index), pitch, Value - 1)); + new JZNrpn(0, mChannel - 1, drumIndex2Param(index), pitch, Value - 1)); gpMidiPlayer->OutNow(this, DrumParams.GetParam(pitch, index)); mChanged = true; } @@ -2650,7 +2650,7 @@ if (Value > 0) { - BendPitchSens = new JZRpn(0, Channel - 1, 0x00, 0x00, Value - 1); + BendPitchSens = new JZRpn(0, mChannel - 1, 0x00, 0x00, Value - 1); gpMidiPlayer->OutNow(this, BendPitchSens); mChanged = true; } @@ -2679,7 +2679,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->ModSX(msp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->ModSX(msp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2711,7 +2711,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->BendSX(bsp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->BendSX(bsp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2743,7 +2743,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->CafSX(csp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->CafSX(csp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2775,7 +2775,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->PafSX(psp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->PafSX(psp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2807,7 +2807,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->CC1SX(csp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->CC1SX(csp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2837,7 +2837,7 @@ Kill(CC2Settings[csp]); if (Value > 0) { - JZEvent* pEvent = gpSynth->CC2SX(csp, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->CC2SX(csp, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2869,7 +2869,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->ControllerNumberSX(1, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->ControllerNumberSX(1, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -2901,7 +2901,7 @@ } if (Value > 0) { - JZEvent* pEvent = gpSynth->ControllerNumberSX(2, 0, Channel, Value - 1); + JZEvent* pEvent = gpSynth->ControllerNumberSX(2, 0, mChannel, Value - 1); if (pEvent) { Put(pEvent); @@ -3121,7 +3121,7 @@ if (rsrv) { - JZEvent* pEvent = gpSynth->PartialReserveSX(0, Channel, rsrv); + JZEvent* pEvent = gpSynth->PartialReserveSX(0, mChannel, rsrv); if (pEvent) { Put(pEvent); @@ -3253,10 +3253,10 @@ switch (param) { case mspRxChannel: - pEvent = gpSynth->RxChannelSX(0, Channel, Value - 1); + pEvent = gpSynth->RxChannelSX(0, mChannel, Value - 1); break; case mspUseForRhythm: - pEvent = gpSynth->UseForRhythmSX(0, Channel, Value - 1); + pEvent = gpSynth->UseForRhythmSX(0, mChannel, Value - 1); break; } @@ -3377,7 +3377,7 @@ // ------------------------- Channel --------------------------- -void JZTrack::SetChannel(int NewChannel) +void JZTrack::SetChannel(int Channel) { - Channel = NewChannel; + mChannel = Channel; } Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/Track.h 2013-03-29 19:48:24 UTC (rev 999) @@ -292,16 +292,16 @@ public: - JZDrumInstrumentParameter( JZNrpn *par ); - JZNrpn *Get( int index ); - void Put( JZNrpn *par ); - JZDrumInstrumentParameter *Next(); + JZDrumInstrumentParameter(JZNrpn* par); + JZNrpn* Get(int index); + void Put( JZNrpn* par); + JZDrumInstrumentParameter* Next(); int Pitch(); private: int mPitch; - JZNrpn* param[numDrumParameters]; + JZNrpn* mParam[numDrumParameters]; JZDrumInstrumentParameter* mpNext; }; @@ -312,25 +312,25 @@ public: JZDrumInstrumentParameterList() - : list(0) + : mpList(0) { } - JZDrumInstrumentParameter *GetElem( int pit ); - JZNrpn *GetParam( int pit, int index ); - void PutParam( JZNrpn *par ); - void DelParam( int pit, int index ); + JZDrumInstrumentParameter* GetElem(int pit); + JZNrpn* GetParam(int pit, int index); + void PutParam(JZNrpn* par); + void DelParam(int pit, int index); JZDrumInstrumentParameter *FirstElem(); - JZDrumInstrumentParameter *NextElem( JZDrumInstrumentParameter *cur ); + JZDrumInstrumentParameter *NextElem(JZDrumInstrumentParameter *cur ); void DelElem( int pit ); void Clear(); bool IsEmpty() const { - return list == 0; + return mpList == 0; } private: - JZDrumInstrumentParameter* list; + JZDrumInstrumentParameter* mpList; }; enum tMtcType @@ -370,10 +370,10 @@ public: // Actual number of events in **mppEvents. - int nEvents; + int mEventCount; // Memory allocated in **mppEvents - int MaxEvents; + int mMaxEvents; JZEvent** mppEvents; @@ -410,7 +410,7 @@ void Put(JZEvent* pEvent, int killed) { - bits.set(nEvents, killed); + bits.set(mEventCount, killed); JZSimpleEventArray::Put(pEvent); } @@ -483,9 +483,9 @@ JZDrumInstrumentParameterList DrumParams; - int Channel; // 1..16, set from first ChannelEvent, 0 = multichannel/nochannel - int Device; // 0 for tSeq2/Mpu401 - int ForceChannel; + int mChannel; // 1..16, set from first ChannelEvent, 0 = multichannel/nochannel + int mDevice; // 0 for tSeq2/Mpu401 + int mForceChannel; virtual void Clear(); void Cleanup(bool dont_delete_killed_events = 0); @@ -585,19 +585,19 @@ void SetState(int NewState); void ToggleState(int Direction); // +1 = next, -1 = prev - int GetChannel() + int GetChannel() { - return Channel; + return mChannel; } void SetChannel(int NewChannel); int GetDevice() const { - return Device; + return mDevice; } - void SetDevice(int d) + void SetDevice(int Device) { - Device = d; + mDevice = Device; } int GetPatch(); @@ -740,7 +740,7 @@ { mpTrack = pTrack; mStart = 0; - mStop = mpTrack->nEvents; + mStop = mpTrack->mEventCount; mActual = mStart; } @@ -782,7 +782,7 @@ JZEvent* Range(int FromClock, unsigned ToClock) { mStart = mActual = 0; - mStop = mpTrack->nEvents; + mStop = mpTrack->mEventCount; if (!GreaterEqual(FromClock)) { Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2013-03-29 19:45:22 UTC (rev 998) +++ trunk/jazz/src/TrackWindow.cpp 2013-03-29 19:48:24 UTC (rev 999) @@ -832,7 +832,7 @@ Value = i + 1; break; case eNmMidiChannel: - Value = pTrack->Channel; + Value = pTrack->mChannel; break; default: Value = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-29 19:45:25
|
Revision: 998 http://sourceforge.net/p/jazzplusplus/code/998 Author: pstieber Date: 2013-03-29 19:45:22 +0000 (Fri, 29 Mar 2013) Log Message: ----------- Updated to include all of the TDW-20 drum kits. Modified Paths: -------------- trunk/jazz/conf/Roland-TD-20-DrumSets.jzi Modified: trunk/jazz/conf/Roland-TD-20-DrumSets.jzi =================================================================== --- trunk/jazz/conf/Roland-TD-20-DrumSets.jzi 2013-03-24 19:32:28 UTC (rev 997) +++ trunk/jazz/conf/Roland-TD-20-DrumSets.jzi 2013-03-29 19:45:22 UTC (rev 998) @@ -4,12 +4,103 @@ # a drum track. .drumsets -0 1 Standard Drums -8 9 Room Set -16 17 Power Set -24 25 Electronic Set -25 26 TR-808 Set -32 33 Jazz Set -40 41 Brush Set -48 49 Orchestra Set +0 1 TDW-20 +1 2 50s King +2 3 ControlRoom +3 4 MetalCore +4 5 FunkGroove +5 6 40s BeBop +6 7 >processed> +7 8 Cajon +8 9 Melodious +9 10 Premium +10 11 SwingJazz +11 12 BluesRock +12 13 Dry Studio +13 14 2HH House +14 15 TechFusion +15 16 LetItBeat +16 17 neotype +17 18 JazzBop +18 19 RawBeat +19 20 VintageRock +20 21 DNB +21 22 GarageRock +22 23 80s Funk +23 24 Cashmirror +24 25 BREAKs +25 26 90s Rock +26 27 JazzClub +27 28 Jive +28 29 AmbientRock +29 30 Cosmic +30 31 Crossover +31 32 VintageJazz +32 33 Coolth +33 34 BulletBlue +34 35 FunkyJungle +35 36 Natural +36 37 LA BeBop +37 38 MBs House +38 39 Bronze Dry +39 40 DarkComposer +40 41 DRUMS vs DJ +41 42 Gated +42 43 RotoFxCity +43 44 PopDelay +44 45 1985 +45 46 Spaced Out +46 47 BrazilPrec +47 48 LatinDrums +48 49 InVasian +49 50 FLA<n<GER +50 51 VPro +51 52 Slamin' +52 53 METAL +53 54 JazzCombo +54 55 OverDrive +55 56 Titanium +56 57 RotoKit +57 58 UNIVERSE +58 59 Skanky +59 60 Brushes +60 61 Spark! +61 62 >>GT>> +62 63 Antique +63 64 =BreakBeats 64 65 Studio Kit +65 66 Groover +66 67 Mallet +67 68 Drumline +68 69 JazzGig +69 70 Airtime +70 71 Sploink! +71 72 Boogaloo +72 73 Zeppy +73 74 Arena +74 75 Maple +75 76 Shallow +76 77 Ballad +77 78 Raspy +78 79 PopReggae +79 80 BrassBiggie +80 81 WetBooth +81 82 70s Record +82 83 Lite +83 84 Mellow +84 85 Stadium +85 86 TiteOctas +86 87 90s Power +87 88 FxJungle +88 89 Tekno +89 90 TR-808 Set +90 91 TR-909 Set +91 92 Hex<>Drum +92 93 Cosmosis +93 94 Technology +94 95 Orchestra Percussion +95 96 Survivor +96 97 Latin Toys +97 98 African Percussion +98 99 Tabla/Sitar +99 100 Rock Band This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-24 19:32:31
|
Revision: 997 http://sourceforge.net/p/jazzplusplus/code/997 Author: pstieber Date: 2013-03-24 19:32:28 +0000 (Sun, 24 Mar 2013) Log Message: ----------- Changed JZArrayEdit and JZRhyArrayEdit constructor arguments from int xx, int yy, int ww, and int hh to const wxPoint& and const wxSize. Modified Paths: -------------- trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleFrame.cpp trunk/jazz/src/SliderWindow.cpp Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/ControlEdit.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -100,7 +100,12 @@ ctrlmode = 0; // ctrlmode is used to distinguish between Apply and Edit. - edit = new JZArrayEdit((wxFrame *)mpPianoWindow, array, x+dx, y, w - dx, h, 0); + edit = new JZArrayEdit( + (wxFrame *)mpPianoWindow, + array, + wxPoint(x + dx, y), + wxSize(w - dx, h), + 0); edit->SetLabel(label); edit->SetDrawBars(this); Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Random.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -263,12 +263,10 @@ JZArrayEdit::JZArrayEdit( wxFrame *frame, JZRndArray &ar, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits) - : wxScrolledWindow(frame, wxID_ANY, wxPoint(xx, yy), wxSize(ww, hh)), + : wxScrolledWindow(frame, wxID_ANY, Position, Size), mArray(ar), n(ar.n), min(ar.min), @@ -286,8 +284,8 @@ x = 0; // draw to topleft corner of canvas y = 0; - w = ww; - h = hh; + w = Size.GetWidth(); + h = Size.GetHeight(); int tw, th; @@ -785,12 +783,10 @@ JZRhyArrayEdit::JZRhyArrayEdit( wxFrame *parent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits) - : JZArrayEdit(parent, Array, xx, yy, ww, hh, StyleBits) + : JZArrayEdit(parent, Array, Position, Size, StyleBits) { steps_per_count = 4; count_per_bar = 4; Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Random.h 2013-03-24 19:32:28 UTC (rev 997) @@ -183,10 +183,8 @@ JZArrayEdit( wxFrame* pParent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits = (ARED_GAP | ARED_XTICKS)); virtual ~JZArrayEdit(); @@ -229,10 +227,8 @@ JZRhyArrayEdit( wxFrame *parent, JZRndArray& Array, - int xx, - int yy, - int ww, - int hh, + const wxPoint& Position, + const wxSize& Size, int StyleBits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); void SetMeter(int steps_per_count, int count_per_bar, int n_bars); Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/Rhythm.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -1303,30 +1303,24 @@ mpLengthEdit = new JZArrayEdit( pParent, mRhythm.length, - x, - y + Height / 2, - Width / 2, - Height / 4 - 4); + wxPoint(x, y + Height / 2), + wxSize(Width / 2, Height / 4 - 4)); mpLengthEdit->SetXMinMax(1, 8); mpLengthEdit->SetLabel("length/interval"); mpVelocityEdit = new JZArrayEdit( pParent, mRhythm.veloc, - x + Width / 2, - y + Height / 2, - Width / 2, - Height / 4 - 4); + wxPoint(x + Width / 2, y + Height / 2), + wxSize(Width / 2, Height / 4 - 4)); mpVelocityEdit->SetXMinMax(1, 127); mpVelocityEdit->SetLabel("velocity"); mpRhythmEdit = new JZRhyArrayEdit( pParent, mRhythm.rhythm, - x, - y + 3 * Height / 4, - Width, - Height/ 4 - 4); + wxPoint(x, y + 3 * Height / 4), + wxSize(Width, Height/ 4 - 4)); mpRhythmEdit->SetMeter( mRhythm.steps_per_count, mRhythm.count_per_bar, Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SampleDialog.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -78,7 +78,7 @@ public: JZEquArrayEdit(JZEqualizer *parent, JZRndArray &arr, int style) - : JZRhyArrayEdit(parent, arr, 10, 10, 10, 10, style), + : JZRhyArrayEdit(parent, arr, wxPoint(10, 10), wxSize(10, 10), style), equ(*parent) { } @@ -245,7 +245,8 @@ void JZDistortion::AddEdits() { n_sliders = 1; - sliders[0] = new JZRhyArrayEdit(this, arr, 10,10,10,10, ARED_LINES); + sliders[0] = + new JZRhyArrayEdit(this, arr, wxPoint(10, 10), wxSize(10, 10), ARED_LINES); } #ifdef OBSOLETE @@ -374,9 +375,16 @@ { int i; arr.SetNull(ynul); - for (i = 0; i < n; i++) + for (i = 0; i < n; ++i) + { arr[i] = ynul; - edit = new JZRhyArrayEdit(parent, arr, 10,10,10,10, style); + } + edit = new JZRhyArrayEdit( + parent, + arr, + wxPoint(10, 10), + wxSize(10, 10), + style); edit->SetLabel(label); } void Show(bool x) Modified: trunk/jazz/src/SampleFrame.cpp =================================================================== --- trunk/jazz/src/SampleFrame.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SampleFrame.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -333,7 +333,8 @@ //----------------------------------------------------------------------------- void JZSampleFrame::AddParam(JZRndArray *array, const char *label) { - params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); + params[num_params] = + new JZArrayEdit(this, *array, wxPoint(0, 0), wxSize(10, 10), 0); params[num_params]->SetLabel(label); num_params++; int cw, ch; Modified: trunk/jazz/src/SliderWindow.cpp =================================================================== --- trunk/jazz/src/SliderWindow.cpp 2013-03-24 19:29:11 UTC (rev 996) +++ trunk/jazz/src/SliderWindow.cpp 2013-03-24 19:32:28 UTC (rev 997) @@ -160,8 +160,15 @@ { n_sliders = 2; sliders_per_row = 2; - for (int i = 0; i < n_sliders; i++) - sliders[i] = new JZRhyArrayEdit(this, *new JZRndArray(20, 0, 100), 10, 10, 10, 10, (ARED_GAP | ARED_XTICKS)); + for (int i = 0; i < n_sliders; ++i) + { + sliders[i] = new JZRhyArrayEdit( + this, + *new JZRndArray(20, 0, 100), + wxPoint(10, 10), + wxSize(10, 10), + ARED_GAP | ARED_XTICKS); + } } #ifdef OBSOLETE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-24 19:29:14
|
Revision: 996 http://sourceforge.net/p/jazzplusplus/code/996 Author: pstieber Date: 2013-03-24 19:29:11 +0000 (Sun, 24 Mar 2013) Log Message: ----------- Added comment headers to the array control source files. Modified Paths: -------------- trunk/jazz/src/ArrayControl.cpp trunk/jazz/src/ArrayControl.h Modified: trunk/jazz/src/ArrayControl.cpp =================================================================== --- trunk/jazz/src/ArrayControl.cpp 2013-03-20 16:08:57 UTC (rev 995) +++ trunk/jazz/src/ArrayControl.cpp 2013-03-24 19:29:11 UTC (rev 996) @@ -1,3 +1,23 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2013 Peter J. Stieber +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #include "ArrayControl.h" #include "Random.h" Modified: trunk/jazz/src/ArrayControl.h =================================================================== --- trunk/jazz/src/ArrayControl.h 2013-03-20 16:08:57 UTC (rev 995) +++ trunk/jazz/src/ArrayControl.h 2013-03-24 19:29:11 UTC (rev 996) @@ -1,3 +1,23 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2013 Peter J. Stieber +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #pragma once #include <wx/control.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-20 16:09:04
|
Revision: 995 http://sourceforge.net/p/jazzplusplus/code/995 Author: pstieber Date: 2013-03-20 16:08:57 +0000 (Wed, 20 Mar 2013) Log Message: ----------- 1. Updated resource IDs for menu entries. 2. Added a wxWidgets event table to the rhythm frame and handled Help | Contents and Help | Help. As I add menu implementations I remove the old versions. Modified Paths: -------------- trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-20 16:02:46 UTC (rev 994) +++ trunk/jazz/src/Rhythm.cpp 2013-03-20 16:08:57 UTC (rev 995) @@ -31,6 +31,7 @@ #include "Help.h" #include "KeyStringConverters.h" #include "PianoWindow.h" +#include "Resources.h" #include "SelectControllerDialog.h" #include "Song.h" #include "StringReadWrite.h" @@ -495,11 +496,6 @@ #define MEN_HELP 4 -#define MEN_ADD 5 -#define MEN_DEL 6 -#define MEN_GEN 7 -#define MEN_UP 8 -#define MEN_DOWN 9 //#include "Bitmaps/open.xpm" @@ -536,13 +532,13 @@ { wxID_OPEN, FALSE, open_xpm, "open rhythm file" }, { wxID_SAVE, FALSE, save_xpm, "save into rhythm file" }, { JZToolBar::eToolBarSeparator }, - { MEN_ADD, FALSE, rrgadd_xpm, "add instrument" }, - { MEN_DEL, FALSE, rrgdel_xpm, "remove instrument" }, - { MEN_UP, FALSE, rrgup_xpm, "move instrument up" }, - { MEN_DOWN, FALSE, rrgdown_xpm, "move instrument down" }, - { MEN_GEN, FALSE, rrggen_xpm, "generate events into trackwin selection" }, + { ID_INSTRUMENT_ADD, FALSE, rrgadd_xpm, "add instrument" }, + { ID_INSTRUMENT_DELETE, FALSE, rrgdel_xpm, "remove instrument" }, + { ID_INSTRUMENT_UP, FALSE, rrgup_xpm, "move instrument up" }, + { ID_INSTRUMENT_DOWN, FALSE, rrgdown_xpm, "move instrument down" }, + { ID_INSTRUMENT_GENERATE, FALSE, rrggen_xpm, "generate events into trackwin selection" }, { JZToolBar::eToolBarSeparator }, - { MEN_HELP, FALSE, help_xpm, "help" }, + { wxID_HELP_CONTENTS, FALSE, help_xpm, "help" }, { JZToolBar::eToolBarEnd } }; @@ -563,16 +559,16 @@ menu_bar->Append(menu, "&File"); menu = new wxMenu; - menu->Append(MEN_ADD, "&Add"); - menu->Append(MEN_DEL, "&Delete"); - menu->Append(MEN_UP, "&Up"); - menu->Append(MEN_DOWN, "&Down"); - menu->Append(MEN_GEN, "&Generate"); - menu_bar->Append(menu, "&Instrument"); + menu->Append(ID_INSTRUMENT_ADD, "&Add"); + menu->Append(ID_INSTRUMENT_DELETE, "&Delete"); + menu->Append(ID_INSTRUMENT_UP, "&Up"); + menu->Append(ID_INSTRUMENT_DOWN, "&Down"); + menu->Append(ID_INSTRUMENT_GENERATE, "&Generate"); + menu_bar->Append(menu, &Instrument"); menu = new wxMenu; - menu->Append(MEN_HELP, "&Help"); - menu_bar->Append(menu, "Help"); + menu->Append(wxID_HELP, "&Help"); + menu_bar->Append(menu, "Help"); SetMenuBar(menu_bar); @@ -747,10 +743,6 @@ { switch (id) { - case MEN_HELP: - Help(); - break; - case wxID_CLOSE: // motif crashes, when Show(FALSE) is called before destructor! // Show(FALSE); @@ -792,25 +784,24 @@ } break; - case MEN_ADD: + case ID_INSTRUMENT_ADD: AddInstrumentDlg(); break; - case MEN_DEL: + case ID_INSTRUMENT_DELETE: DelInstrument(); break; - case MEN_GEN: + case ID_INSTRUMENT_GENERATE: wxBeginBusyCursor(); Win2Instrument(); GenRhythm(); wxEndBusyCursor(); break; - case MEN_UP: + case ID_INSTRUMENT_UP: UpInstrument(); break; - case MEN_DOWN: + case ID_INSTRUMENT_DOWN: DownInstrument(); break; - } } @@ -1122,12 +1113,6 @@ mpEventWindow->Refresh(); } - -void JZRhythmWindow::Help() -{ - gpHelpInstance->ShowTopic("Random rhythm generator"); -} - #ifdef OBSOLETE void JZRhythmWindow::ItemCallback(wxItem& item, wxCommandEvent& event) @@ -1353,6 +1338,16 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZRhythmGeneratorFrame, wxFrame) + + EVT_MENU(wxID_HELP, JZRhythmGeneratorFrame::OnHelp) + + EVT_MENU(wxID_HELP_CONTENTS, JZRhythmGeneratorFrame::OnHelpContents) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZRhythmGeneratorFrame::JZRhythmGeneratorFrame() : wxFrame( 0, @@ -1369,8 +1364,21 @@ pFileMenu->Append(wxID_SAVEAS, "Save &As..."); pFileMenu->Append(wxID_CLOSE, "&Close"); + wxMenu* pInstrumentMenu = new wxMenu; + pInstrumentMenu->Append(ID_INSTRUMENT_ADD, "&Add"); + pInstrumentMenu->Append(ID_INSTRUMENT_DELETE, "&Delete"); + pInstrumentMenu->Append(ID_INSTRUMENT_UP, "&Up"); + pInstrumentMenu->Append(ID_INSTRUMENT_DOWN, "&Down"); + pInstrumentMenu->Append(ID_INSTRUMENT_GENERATE, "&Generate"); + + wxMenu* mpHelpMenu = new wxMenu; + mpHelpMenu->Append(wxID_HELP_CONTENTS, "&Contents"); + mpHelpMenu->Append(wxID_HELP, "&Help"); + wxMenuBar* pMenuBar = new wxMenuBar; pMenuBar->Append(pFileMenu, "&File"); + pMenuBar->Append(pInstrumentMenu, "&Instrument"); + pMenuBar->Append(mpHelpMenu, "&Help"); SetMenuBar(pMenuBar); @@ -1389,6 +1397,20 @@ gpRhythmGeneratorFrame = 0; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::OnHelp(wxCommandEvent&) +{ + JZHelp::Instance().ShowTopic("Random rhythm generator"); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZRhythmGeneratorFrame::OnHelpContents(wxCommandEvent&) +{ + JZHelp::Instance().DisplayHelpContents(); +} + //***************************************************************************** //***************************************************************************** void CreateRhythmGenerator() Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-03-20 16:02:46 UTC (rev 994) +++ trunk/jazz/src/Rhythm.h 2013-03-20 16:08:57 UTC (rev 995) @@ -221,7 +221,6 @@ static void Add(wxButton &but, wxCommandEvent& event); static void Del(wxButton &but, wxCommandEvent& event); static void Generate(wxButton &but, wxCommandEvent& event); - static void Help(); void Instrument2Win(int i = -1); // instrument[act_instrument] -> win void Win2Instrument(int i = -1); // win -> instrument[act_instrument] @@ -276,7 +275,15 @@ private: + void OnHelp(wxCommandEvent& Event); + + void OnHelpContents(wxCommandEvent& Event); + + private: + JZRhythmGeneratorWindow* mpRhythmGeneratorWindow; + + DECLARE_EVENT_TABLE() }; extern void CreateRhythmGenerator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-20 16:02:50
|
Revision: 994 http://sourceforge.net/p/jazzplusplus/code/994 Author: pstieber Date: 2013-03-20 16:02:46 +0000 (Wed, 20 Mar 2013) Log Message: ----------- Made a cosmetic change. Modified Paths: -------------- trunk/jazz/src/Random.h Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-03-20 16:01:48 UTC (rev 993) +++ trunk/jazz/src/Random.h 2013-03-20 16:02:46 UTC (rev 994) @@ -126,13 +126,13 @@ }; -#define ARED_GAP 1 +#define ARED_GAP 1 #define ARED_XTICKS 2 -#define ARED_YTICKS 4 -#define ARED_MINMAX 8 +#define ARED_YTICKS 4 +#define ARED_MINMAX 8 #define ARED_RHYTHM 16 -#define ARED_BLOCKS 32 -#define ARED_LINES 64 +#define ARED_BLOCKS 32 +#define ARED_LINES 64 class JZArrayEditDrawBars This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |