From: <pst...@us...> - 2010-07-17 18:19:01
|
Revision: 804 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=804&view=rev Author: pstieber Date: 2010-07-17 18:18:55 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Renamed the audio_mode data member of JZEventArray class to mAudioMode and made it a Boolean instead of an integer. 2. Made corresponding changes to other code that utilized this flag. Modified Paths: -------------- trunk/jazz/src/Events.h trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/Song.cpp trunk/jazz/src/Song.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Events.h 2010-07-17 18:18:55 UTC (rev 804) @@ -1068,14 +1068,14 @@ mpData[4] = 1; // version or so } - char GetAudioMode() const + bool GetAudioMode() const { - return mpData[5]; + return mpData[5] != 0; } - void SetAudioMode(char c) + void SetAudioMode(bool AudioMode) { - mpData[5] = c; + mpData[5] = AudioMode; } char GetTrackState() const Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Player.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -140,7 +140,7 @@ JZSong* pSong, long ExtFr, long ExtTo, - int Mode) + bool AudioMode) { if (pEventArray == 0) { @@ -158,7 +158,7 @@ pEventArray, gpProject->GetMetronomeInfo(), Delta, - Mode); + AudioMode); Size -= mStopClock - From; From = mStartClock; @@ -173,7 +173,7 @@ pEventArray, gpProject->GetMetronomeInfo(), Delta, - Mode); + AudioMode); } } @@ -231,7 +231,7 @@ mpSong, mOutClock, Now + DELTACLOCK, - 0); + false); if (mpAudioBuffer) { mpPlayLoop->PrepareOutput( @@ -239,7 +239,7 @@ mpSong, mOutClock, Now + DELTACLOCK, - 1); + true); } mOutClock = Now + DELTACLOCK; mPlayBuffer.Length2Keyoff(); @@ -580,7 +580,7 @@ mpSong, Clock, Clock + FIRST_DELTACLOCK, - 0); + false); if (mpAudioBuffer) { @@ -589,7 +589,7 @@ mpSong, Clock, Clock + FIRST_DELTACLOCK, - 1); + true); } mPlayBuffer.Length2Keyoff(); Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Player.h 2010-07-17 18:18:55 UTC (rev 804) @@ -120,7 +120,7 @@ JZSong* pSong, long ExtFr, long ExtTo, - int mode = 0); + bool AudioMode = false); private: Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Song.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -344,7 +344,7 @@ JZEventArray* pDestin, const JZMetronomeInfo& MetronomeInfo, int delta, - int mode) + bool AudioMode) { // Make metronome if (MetronomeInfo.IsOn()) @@ -371,7 +371,7 @@ pTrack->State == tsSolo || (!DoSoloTracksExist && pTrack->State == tsPlay)) { - if (pTrack->GetAudioMode() != mode) + if (pTrack->GetAudioMode() != AudioMode) { continue; } Modified: trunk/jazz/src/Song.h =================================================================== --- trunk/jazz/src/Song.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Song.h 2010-07-17 18:18:55 UTC (rev 804) @@ -122,7 +122,7 @@ JZEventArray *Destin, const JZMetronomeInfo& MetronomeInfo, int DeltaClock = 0, - int mode = 0); + bool AudioMode = false); void MergePlayTrackEvent( JZPlayTrackEvent* c, Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Track.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -561,7 +561,8 @@ mpChorus(0), mpBank(0), mpBank2(0), - mpReset(0) + mpReset(0), + mAudioMode(false) { nEvents = 0; @@ -571,7 +572,6 @@ Device = 0; ForceChannel = 0; State = tsPlay; - audio_mode = 0; Clear(); } @@ -693,7 +693,7 @@ MaxEvents = 0; State = tsPlay; - audio_mode = 0; + mAudioMode = false; } @@ -1368,7 +1368,7 @@ } JZJazzMetaEvent JazzMeta; - JazzMeta.SetAudioMode(audio_mode); + JazzMeta.SetAudioMode(mAudioMode); JazzMeta.SetTrackState(State); JazzMeta.SetTrackDevice(Device); JazzMeta.SetIntroLength(gpSong->GetIntroLength()); @@ -1441,12 +1441,12 @@ SpecialEvent = false; if (pEvent->IsJazzMeta()) { - JZJazzMetaEvent* j = pEvent->IsJazzMeta(); - audio_mode = (int)j->GetAudioMode(); - State = (int)j->GetTrackState(); - Device = (int)j->GetTrackDevice(); - gpSong->SetIntroLength((int)j->GetIntroLength()); - delete j; + JZJazzMetaEvent* pJazzMetaEvent = pEvent->IsJazzMeta(); + mAudioMode = pJazzMetaEvent->GetAudioMode(); + State = (int)pJazzMetaEvent->GetTrackState(); + Device = (int)pJazzMetaEvent->GetTrackDevice(); + gpSong->SetIntroLength((int)pJazzMetaEvent->GetIntroLength()); + delete pJazzMetaEvent; continue; } if (pEvent->IsControl()) Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Track.h 2010-07-17 18:18:55 UTC (rev 804) @@ -531,19 +531,19 @@ public: - int GetAudioMode() const + bool GetAudioMode() const { - return audio_mode; + return mAudioMode; } - void SetAudioMode(int x) + void SetAudioMode(bool AudioMode) { - audio_mode = x; + mAudioMode = AudioMode; } protected: - int audio_mode; + bool mAudioMode; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |