// Diffs between r10679 and r10680 // USE_MIDI is NOT DEFINED // Sources are preprocessed and tweaked to eliminate differences due to the // fact that they are in different directories (i.e. the preprocessor sometimes // inserts path names, so I "normalized" them to make them match.) // // Since preprocessor strips out comments, anything like this is a manually // added comment. // // These differences have mostly been removed by inserting #ifdef's. // Changing an include file may affect many preprocessed files, so my // method was to identify and document differences incrementally by copying // text here from diff output. // // The final diff with no USE_MIDI is in diffs-no-USE_MIDI-final.txt // diff -wrcB e79/src/AudacityApp.cpp.E e80/src/AudacityApp.cpp.E *** e79/src/AudacityApp.cpp.E 2010-11-23 09:15:33.000000000 -0500 --- e80/src/AudacityApp.cpp.E 2010-11-23 09:15:58.000000000 -0500 *************** *** 36066,36071 **** --- 36069,36075 ---- AudioIOListener* mListener; friend class AudioThread; + friend class MidiThread; friend void InitAudioIO(); friend void DeinitAudioIO(); // although this should be harmless, I wrapped "friend class MidiThread;" // in "#ifdef EXPERIMENTAL_MIDI_OUT ... #endif *** e79/src/AudioIO.cpp.E 2010-11-23 11:48:00.000000000 -0500 --- e80/src/AudioIO.cpp.E 2010-11-23 11:48:22.000000000 -0500 *************** *** 55186,55192 **** public: typedef int ExitCode; AudioThread() { mDestroy = false; mThread = __null; } ! ExitCode Entry(); void Create() {} void Delete() { mDestroy = true; --- 55192,55198 ---- public: typedef int ExitCode; AudioThread() { mDestroy = false; mThread = __null; } ! virtual ExitCode Entry(); void Create() {} void Delete() { mDestroy = true; *************** // This change should be harmless, but I eliminated it with // EXPERIMENTAL_MIDI_OUT *** 55863,55873 **** successAudio = StartPortAudioStream(sampleRate, playbackChannels, captureChannels, captureFormat); ! if (!successAudio ! ! ! ! ) { if (mListener && captureChannels > 0) mListener->OnAudioIOStopRecording(); mStreamToken = 0; --- 55872,55878 ---- successAudio = StartPortAudioStream(sampleRate, playbackChannels, captureChannels, captureFormat); ! if (!successAudio) { if (mListener && captureChannels > 0) mListener->OnAudioIOStopRecording(); mStreamToken = 0; *************** // These are identical modulo spaces *** 55922,55939 **** while( mAudioThreadShouldCallFillBuffersOnce == true ) wxMilliSleep( 50 ); ! ! ! ! ! ! ! ! if(mNumPlaybackChannels > 0 || mNumCaptureChannels > 0 ! ! ! ! ) { PaError err; --- 55928,55934 ---- while( mAudioThreadShouldCallFillBuffersOnce == true ) wxMilliSleep( 50 ); ! if(mNumPlaybackChannels > 0 || mNumCaptureChannels > 0) { PaError err; *************** // These are identical modulo spaces *** 57184,57200 **** linkFlag = vt->GetLinked(); } if (cut) { gAudioIO->mPlaybackBuffers[t]->Discard(framesPerBuffer); ! continue; ! } ! ! unsigned int len = (unsigned int) gAudioIO->mPlaybackBuffers[t]->Get((samplePtr)tempFloats, floatSample, (int)framesPerBuffer); ! --- 57176,57196 ---- linkFlag = vt->GetLinked(); } + + + + unsigned int len; if (cut) { + len = (unsigned int) gAudioIO->mPlaybackBuffers[t]->Discard(framesPerBuffer); ! } else ! { ! len = (unsigned int) gAudioIO->mPlaybackBuffers[t]->Get((samplePtr)tempFloats, floatSample, (int)framesPerBuffer); ! } *************** // This change was intended as a bug fix. I restored the original code, // which does not play to the end of a selection if all audio tracks are // muted. I think this causes a problem when muting audio and playing MIDI. // The compile switch is ORIGINAL_DO_NOT_PLAY_ALL_MUTED_TRACKS_TO_END // This code was reorganized so that if all audio tracks // are muted, we still return paComplete when the end of // a selection is reached. *** 57205,57210 **** --- 57201,57209 ---- callbackReturn = paComplete; } + if (cut) + continue; + if (vt->GetChannel() == Track::LeftChannel || vt->GetChannel() == Track::MonoChannel) { // this is additional code to play muted audio to the end of selection. // now this code is hidden by ORIGINAL_DO_NOT_PLAY_ALL_MUTED_TRACKS_TO_END diff -wrcB e79/src/Menus.cpp.E e80/src/Menus.cpp.E *** e79/src/Menus.cpp.E 2010-11-23 11:48:06.000000000 -0500 --- e80/src/Menus.cpp.E 2010-11-23 11:48:28.000000000 -0500 *************** *** 70043,70049 **** float Get(bool convert = true); void Set(float value); ! void Increase(float steps); void Decrease(float steps); --- 70043,70049 ---- float Get(bool convert = true); void Set(float value); ! void SetStyle(int style); void Increase(float steps); void Decrease(float steps); // This should be harmless, but I hid the change (in ASlider.h) with // EXPERIMENTAL_MIDI_OUT *************** *** 70485,70492 **** --- 70488,70499 ---- class AudacityProject; class MixerBoard; + class Track; class WaveTrack; + + + class MixerTrackCluster : public wxPanel { public: // This should be harmless, but I hid the change (in ASlider.h) with // EXPERIMENTAL_MIDI_OUT *************** *** 70531,70536 **** --- 70538,70546 ---- public: + + + Track* mTrack; WaveTrack* mLeftTrack; WaveTrack* mRightTrack; // This should be harmless, but I hid the change (in ASlider.h) with // EXPERIMENTAL_MIDI_OUT *************** *** 70611,70635 **** void UpdateTrackClusters(); int GetTrackClustersWidth(); ! void MoveTrackCluster(const WaveTrack* pLeftTrack, bool bUp); ! void RemoveTrackCluster(const WaveTrack* pLeftTrack); ! wxBitmap* GetMusicalInstrumentBitmap(const WaveTrack* pLeftTrack); bool HasSolo(); ! void RefreshTrackCluster(const WaveTrack* pLeftTrack, bool bEraseBackground = true); void RefreshTrackClusters(bool bEraseBackground = true); void ResizeTrackClusters(); void ResetMeters(); ! void UpdateName(const WaveTrack* pLeftTrack); ! void UpdateMute(const WaveTrack* pLeftTrack = __null); ! void UpdateSolo(const WaveTrack* pLeftTrack = __null); ! void UpdatePan(const WaveTrack* pLeftTrack); ! void UpdateGain(const WaveTrack* pLeftTrack); void UpdateMeters(const double t1, const bool bLoopedPlay); --- 70624,70648 ---- void UpdateTrackClusters(); int GetTrackClustersWidth(); ! void MoveTrackCluster(const Track* pTrack, bool bUp); ! void RemoveTrackCluster(const Track* pTrack); ! wxBitmap* GetMusicalInstrumentBitmap(const wxString name); bool HasSolo(); ! void RefreshTrackCluster(const Track* pTrack, bool bEraseBackground = true); void RefreshTrackClusters(bool bEraseBackground = true); void ResizeTrackClusters(); void ResetMeters(); ! void UpdateName(const Track* pTrack); ! void UpdateMute(const Track* pTrack = __null); ! void UpdateSolo(const Track* pTrack = __null); ! void UpdatePan(const Track* pTrack); ! void UpdateGain(const Track* pTrack); void UpdateMeters(const double t1, const bool bLoopedPlay); // These changes were an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 70637,70643 **** private: void CreateMuteSoloImages(); ! int FindMixerTrackCluster(const WaveTrack* pLeftTrack, MixerTrackCluster** hMixerTrackCluster) const; void LoadMusicalInstruments(); --- 70650,70656 ---- private: void CreateMuteSoloImages(); ! int FindMixerTrackCluster(const Track* pTrack, MixerTrackCluster** hMixerTrackCluster) const; void LoadMusicalInstruments(); // These changes were an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 129097,129105 **** Track *n = iter.First(); while (n) { ! if ((n->GetKind() == Track::Wave) && n->GetSelected()) { ((WaveTrack*)n)->Trim(mViewInfo.sel0, mViewInfo.sel1); } n = iter.Next(); } --- 129103,129125 ---- Track *n = iter.First(); while (n) { ! if (n->GetSelected()) { ! switch (n->GetKind()) ! { ! ! ! ! ! ! ! case Track::Wave: ((WaveTrack*)n)->Trim(mViewInfo.sel0, mViewInfo.sel1); + break; + + default: + break; + } } n = iter.Next(); } // These changes were an intentional effort to simplify Menus.cpp code // (AudacityProject::OnTrim()) to make it easier to support MIDI tracks. // I reverted to the original code and enabled the changes under // USE_MIDI ***************** // MixerBoard.cpp in r10679 did not #include "Audacity.h". // I added this include; otherwise, USE_MIDI will not be defined diff -wrcB e79/src/MixerBoard.cpp.E e80/src/MixerBoard.cpp.E *** e79/src/MixerBoard.cpp.E 2010-11-23 13:09:16.000000000 -0500 --- e80/src/MixerBoard.cpp.E 2010-11-23 13:09:38.000000000 -0500 *************** *** 24702,24707 **** --- 24707,24713 ---- static bool IsGoodInt(const wxString strInt); static bool IsValidChannel(const int nValue); + static bool IsValidVisibleChannels(const int nValue); static bool IsValidSampleFormat(const int nValue); }; // XMLTagHandler.h -- should be harmless, but hid this with USE_MIDI. // This is part of an extension to save the note track channel selection // state in XML. *************** *** 67317,67323 **** { mMixerBoard = grandParent; mProject = project; ! mLeftTrack = pLeftTrack; mRightTrack = pRightTrack; this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); --- 67357,67364 ---- { mMixerBoard = grandParent; mProject = project; ! mTrack = mLeftTrack = pLeftTrack; ! mRightTrack = pRightTrack; this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT // Note: There was additional code here under USE_MIDI that should have // been under EXPERIMENTAL_MIDI_OUT. I fixed this too. *************** *** 67330,67337 **** wxPoint ctrlPos((2 * 4), (2 * 4)); wxSize ctrlSize(size.GetWidth() - (4 * 4), 18); mStaticText_TrackName = ! new wxStaticText(this, -1, mLeftTrack->GetName(), ctrlPos, ctrlSize, wxALIGN_CENTRE | 0x0001 | wxBORDER_SUNKEN); --- 67371,67379 ---- wxPoint ctrlPos((2 * 4), (2 * 4)); wxSize ctrlSize(size.GetWidth() - (4 * 4), 18); + wxString name = mTrack->GetName(); mStaticText_TrackName = ! new wxStaticText(this, -1, name, ctrlPos, ctrlSize, wxALIGN_CENTRE | 0x0001 | wxBORDER_SUNKEN); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67358,67364 **** ctrlPos.x += 48 - (2 * 4) + 4; ctrlSize.Set(48, 48); ! wxBitmap* bitmap = mMixerBoard->GetMusicalInstrumentBitmap(mLeftTrack); if ( bitmap ) ; else wxOnAssert(L"/Users/rbd/audacity/wNN/src/MixerBoard.cpp", NNNN, __FUNCTION__, L"bitmap", __null); mBitmapButton_MusicalInstrument = new wxBitmapButton(this, ID_BITMAPBUTTON_MUSICAL_INSTRUMENT, *bitmap, --- 67400,67406 ---- ctrlPos.x += 48 - (2 * 4) + 4; ctrlSize.Set(48, 48); ! wxBitmap* bitmap = mMixerBoard->GetMusicalInstrumentBitmap(name); if ( bitmap ) ; else wxOnAssert(L"/Users/rbd/audacity/wNN/src/MixerBoard.cpp", NNNN, __FUNCTION__, L"bitmap", __null); mBitmapButton_MusicalInstrument = new wxBitmapButton(this, ID_BITMAPBUTTON_MUSICAL_INSTRUMENT, *bitmap, // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67427,67433 **** Meter::MixerTrackCluster); ! mStaticText_TrackName->SetToolTip(mLeftTrack->GetName()); mToggleButton_Mute->SetToolTip(wxGetTranslation(L"Mute")); mToggleButton_Solo->SetToolTip(wxGetTranslation(L"Solo")); mMeter->SetToolTip(wxGetTranslation(L"Signal Level Meter")); --- 67468,67474 ---- Meter::MixerTrackCluster); ! mStaticText_TrackName->SetToolTip(name); mToggleButton_Mute->SetToolTip(wxGetTranslation(L"Mute")); mToggleButton_Solo->SetToolTip(wxGetTranslation(L"Solo")); mMeter->SetToolTip(wxGetTranslation(L"Signal Level Meter")); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67478,67484 **** --- 67519,67530 ---- void MixerTrackCluster::HandleSliderGain(const bool bWantPushState ) { float fValue = mSlider_Gain->Get(); + if (mLeftTrack) mLeftTrack->SetGain(fValue); + + + + if (mRightTrack) mRightTrack->SetGain(fValue); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. mLeftTrack should never // be null unless this is for a NoteTrack. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67483,67489 **** mRightTrack->SetGain(fValue); ! mProject->RefreshTPTrack(mLeftTrack); if (bWantPushState) mProject->TP_PushState(wxGetTranslation(L"Moved gain slider"), wxGetTranslation(L"Gain"), true ); --- 67529,67535 ---- mRightTrack->SetGain(fValue); ! mProject->RefreshTPTrack(mTrack); if (bWantPushState) mProject->TP_PushState(wxGetTranslation(L"Moved gain slider"), wxGetTranslation(L"Gain"), true ); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67492,67503 **** void MixerTrackCluster::HandleSliderPan(const bool bWantPushState ) { float fValue = mSlider_Pan->Get(); mLeftTrack->SetPan(fValue); if (mRightTrack) mRightTrack->SetPan(fValue); ! mProject->RefreshTPTrack(mLeftTrack); if (bWantPushState) mProject->TP_PushState(wxGetTranslation(L"Moved pan slider"), wxGetTranslation(L"Pan"), true ); --- 67538,67550 ---- void MixerTrackCluster::HandleSliderPan(const bool bWantPushState ) { float fValue = mSlider_Pan->Get(); + if (mLeftTrack) mLeftTrack->SetPan(fValue); if (mRightTrack) mRightTrack->SetPan(fValue); ! mProject->RefreshTPTrack(mTrack); if (bWantPushState) mProject->TP_PushState(wxGetTranslation(L"Moved pan slider"), wxGetTranslation(L"Pan"), true ); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. mLeftTrack should never // be null unless this is for a NoteTrack. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67505,67510 **** --- 67552,67558 ---- void MixerTrackCluster::ResetMeter() { + if (mLeftTrack) mMeter->Reset(mLeftTrack->GetRate(), true); } // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. mLeftTrack should never // be null unless this is for a NoteTrack. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67521,67539 **** void MixerTrackCluster::UpdateName() { ! const wxString newName = mLeftTrack->GetName(); mStaticText_TrackName->SetLabel(newName); mStaticText_TrackName->SetToolTip(newName); mBitmapButton_MusicalInstrument->SetBitmapLabel( ! *(mMixerBoard->GetMusicalInstrumentBitmap(mLeftTrack))); } void MixerTrackCluster::UpdateMute() { ! mToggleButton_Mute->SetAlternate(mLeftTrack->GetSolo()); ! if (mLeftTrack->GetMute()) mToggleButton_Mute->PushDown(); else mToggleButton_Mute->PopUp(); --- 67569,67587 ---- void MixerTrackCluster::UpdateName() { ! wxString newName = mTrack->GetName(); mStaticText_TrackName->SetLabel(newName); mStaticText_TrackName->SetToolTip(newName); mBitmapButton_MusicalInstrument->SetBitmapLabel( ! *(mMixerBoard->GetMusicalInstrumentBitmap(newName))); } void MixerTrackCluster::UpdateMute() { ! mToggleButton_Mute->SetAlternate(mTrack->GetSolo()); ! if (mTrack->GetMute()) mToggleButton_Mute->PushDown(); else mToggleButton_Mute->PopUp(); // It looks like the "const wxString" is correct, so I restored it, // but also put change under EXPERIMENTAL_MIDI_OUT because old code // had mLeftTrack->GetName() and new code has mTrack->GetName() // Maybe GetMusicalInstrumentBitmap() needs a const parameter to // compile. // This code should work with or without EXPERIMENTAL_MIDI_OUT, but // I put the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67541,67547 **** void MixerTrackCluster::UpdateSolo() { ! bool bIsSolo = mLeftTrack->GetSolo(); if (bIsSolo) mToggleButton_Solo->PushDown(); else --- 67589,67595 ---- void MixerTrackCluster::UpdateSolo() { ! bool bIsSolo = mTrack->GetSolo(); if (bIsSolo) mToggleButton_Solo->PushDown(); else // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67562,67568 **** void MixerTrackCluster::UpdateMeter(const double t0, const double t1) { if ((t0 < 0.0) || (t1 < 0.0) || (t0 >= t1) || ! ((mMixerBoard->HasSolo() || mLeftTrack->GetMute()) && !mLeftTrack->GetSolo())) { this->ResetMeter(); return; --- 67616,67622 ---- void MixerTrackCluster::UpdateMeter(const double t0, const double t1) { if ((t0 < 0.0) || (t1 < 0.0) || (t0 >= t1) || ! ((mMixerBoard->HasSolo() || mTrack->GetMute()) && !mTrack->GetSolo())) { this->ResetMeter(); return; // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67575,67581 **** float* maxRight = new float[nFramesPerBuffer]; float* rmsRight = new float[nFramesPerBuffer]; ! bool bSuccess = true; const double dFrameInterval = (t1 - t0) / (double)nFramesPerBuffer; double dFrameT0 = t0; double dFrameT1 = t0 + dFrameInterval; --- 67629,67635 ---- float* maxRight = new float[nFramesPerBuffer]; float* rmsRight = new float[nFramesPerBuffer]; ! bool bSuccess = (mLeftTrack != __null); const double dFrameInterval = (t1 - t0) / (double)nFramesPerBuffer; double dFrameT0 = t0; double dFrameT1 = t0 + dFrameInterval; // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67653,67680 **** if (bShiftDown) { ! bool bSelect = !mLeftTrack->GetSelected(); ! mLeftTrack->SetSelected(bSelect); if (mRightTrack) mRightTrack->SetSelected(bSelect); this->Refresh(true); ! mProject->RefreshTPTrack(mLeftTrack); } else { mProject->SelectNone(); ! mLeftTrack->SetSelected(true); if (mRightTrack) mRightTrack->SetSelected(true); if (mProject->GetSel0() >= mProject->GetSel1()) { ! mProject->mViewInfo.sel0 = mLeftTrack->GetOffset(); ! mProject->mViewInfo.sel1 = mLeftTrack->GetEndTime(); } --- 67707,67734 ---- if (bShiftDown) { ! bool bSelect = !mTrack->GetSelected(); ! mTrack->SetSelected(bSelect); if (mRightTrack) mRightTrack->SetSelected(bSelect); this->Refresh(true); ! mProject->RefreshTPTrack(mTrack); } else { mProject->SelectNone(); ! mTrack->SetSelected(true); if (mRightTrack) mRightTrack->SetSelected(true); if (mProject->GetSel0() >= mProject->GetSel1()) { ! mProject->mViewInfo.sel0 = mTrack->GetOffset(); ! mProject->mViewInfo.sel1 = mTrack->GetEndTime(); } // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67710,67716 **** wxSize clusterSize = this->GetSize(); wxRect bev(0, 0, clusterSize.GetWidth() - 1, clusterSize.GetHeight() - 1); ! if (mLeftTrack->GetSelected()) { for (unsigned int i = 0; i < 4; i++) { --- 67764,67771 ---- wxSize clusterSize = this->GetSize(); wxRect bev(0, 0, clusterSize.GetWidth() - 1, clusterSize.GetHeight() - 1); ! ! if (mTrack->GetSelected()) { for (unsigned int i = 0; i < 4; i++) { // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67740,67747 **** void MixerTrackCluster::OnButton_Mute(wxCommandEvent& event) { ! mProject->HandleTrackMute(mLeftTrack, mToggleButton_Mute->WasShiftDown()); ! mToggleButton_Mute->SetAlternate(mLeftTrack->GetSolo()); if (mProject->IsSoloSimple()) --- 67795,67802 ---- void MixerTrackCluster::OnButton_Mute(wxCommandEvent& event) { ! mProject->HandleTrackMute(mTrack, mToggleButton_Mute->WasShiftDown()); ! mToggleButton_Mute->SetAlternate(mTrack->GetSolo()); if (mProject->IsSoloSimple()) // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67752,67765 **** } else ! mProject->RefreshTPTrack(mLeftTrack); } void MixerTrackCluster::OnButton_Solo(wxCommandEvent& event) { ! mProject->HandleTrackSolo(mLeftTrack, mToggleButton_Solo->WasShiftDown()); ! bool bIsSolo = mLeftTrack->GetSolo(); mToggleButton_Mute->SetAlternate(bIsSolo); --- 67807,67820 ---- } else ! mProject->RefreshTPTrack(mTrack); } void MixerTrackCluster::OnButton_Solo(wxCommandEvent& event) { ! mProject->HandleTrackSolo(mTrack, mToggleButton_Solo->WasShiftDown()); ! bool bIsSolo = mTrack->GetSolo(); mToggleButton_Mute->SetAlternate(bIsSolo); // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67772,67778 **** } else ! mProject->RefreshTPTrack(mLeftTrack); } --- 67827,67833 ---- } else ! mProject->RefreshTPTrack(mTrack); } // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67919,67933 **** while (pLeftTrack) { pRightTrack = pLeftTrack->GetLinked() ? iterTracks.Next() : __null; ! if (pLeftTrack->GetKind() == Track::Wave) ! { ! if (nClusterIndex < nClusterCount) ! { ! mMixerTrackClusters[nClusterIndex]->mLeftTrack = (WaveTrack*)pLeftTrack; mMixerTrackClusters[nClusterIndex]->mRightTrack = (WaveTrack*)pRightTrack; mMixerTrackClusters[nClusterIndex]->UpdateForStateChange(); } --- 67980,67995 ---- while (pLeftTrack) { pRightTrack = pLeftTrack->GetLinked() ? iterTracks.Next() : __null; ! if (pLeftTrack->GetKind() == Track::Wave + ) + { + if (nClusterIndex < nClusterCount) + { mMixerTrackClusters[nClusterIndex]->mLeftTrack = (WaveTrack*)pLeftTrack; + mMixerTrackClusters[nClusterIndex]->mRightTrack = (WaveTrack*)pRightTrack; mMixerTrackClusters[nClusterIndex]->UpdateForStateChange(); } // Note: I found 2 places in this area where USE_MIDI had been used rather than // EXPERIMENTAL_MIDI_OUT. Fixed them (maybe also fixed in later revisions.) // Otherwise, these are identical modulo white space *************** *** 67966,67972 **** for (; nClusterIndex < nClusterCount; nClusterIndex++) ! this->RemoveTrackCluster(mMixerTrackClusters[nClusterIndex]->mLeftTrack); } } --- 68028,68034 ---- for (; nClusterIndex < nClusterCount; nClusterIndex++) ! this->RemoveTrackCluster(mMixerTrackClusters[nClusterIndex]->mTrack); } } // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 67979,67989 **** (2 * 4); } ! void MixerBoard::MoveTrackCluster(const WaveTrack* pLeftTrack, bool bUp) { MixerTrackCluster* pMixerTrackCluster; ! int nIndex = this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster == __null) return; --- 68041,68051 ---- (2 * 4); } ! void MixerBoard::MoveTrackCluster(const Track* pTrack, bool bUp) { MixerTrackCluster* pMixerTrackCluster; ! int nIndex = FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster == __null) return; // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68014,68024 **** } } ! void MixerBoard::RemoveTrackCluster(const WaveTrack* pLeftTrack) { MixerTrackCluster* pMixerTrackCluster; ! int nIndex = this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster == __null) return; --- 68076,68086 ---- } } ! void MixerBoard::RemoveTrackCluster(const Track* pTrack) { MixerTrackCluster* pMixerTrackCluster; ! int nIndex = FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster == __null) return; // This change was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68039,68055 **** } this->UpdateWidth(); } ! wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(const WaveTrack* pLeftTrack) { if (mMusicalInstruments.IsEmpty()) return __null; ! const wxString strTrackName(pLeftTrack->GetName().MakeLower()); size_t nBestItemIndex = 0; unsigned int nBestScore = 0; unsigned int nInstrIndex = 0; --- 68101,68122 ---- } this->UpdateWidth(); + + + + FindMixerTrackCluster(pTrack, &pMixerTrackCluster); + (__builtin_expect(!(pMixerTrackCluster == __null), 0) ? __assert_rtn(__func__, "/Users/rbd/audacity/wNN/src/MixerBoard.cpp", 955, "pMixerTrackCluster == NULL") : (void)0); } ! wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(wxString name) { if (mMusicalInstruments.IsEmpty()) return __null; ! const wxString strTrackName(name.MakeLower()); size_t nBestItemIndex = 0; unsigned int nBestScore = 0; unsigned int nInstrIndex = 0; // The addition of FindMixerTrackCluster() etc. is a sanity check -- // see comments in source. I enable this under EXPERIMENTAL_MIDI_OUT. // The rest was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68096,68105 **** return false; } ! void MixerBoard::RefreshTrackCluster(const WaveTrack* pLeftTrack, bool bEraseBackground ) { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->Refresh(bEraseBackground); } --- 68163,68172 ---- return false; } ! void MixerBoard::RefreshTrackCluster(const Track* pTrack, bool bEraseBackground ) { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->Refresh(bEraseBackground); } // This was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68127,68143 **** mMixerTrackClusters[i]->ResetMeter(); } ! void MixerBoard::UpdateName(const WaveTrack* pLeftTrack) { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateName(); } ! void MixerBoard::UpdateMute(const WaveTrack* pLeftTrack ) { ! if (pLeftTrack == __null) { for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) mMixerTrackClusters[i]->UpdateMute(); --- 68194,68210 ---- mMixerTrackClusters[i]->ResetMeter(); } ! void MixerBoard::UpdateName(const Track* pTrack) { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateName(); } ! void MixerBoard::UpdateMute(const Track* pTrack ) { ! if (pTrack == __null) { for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) mMixerTrackClusters[i]->UpdateMute(); // This was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68145,68159 **** else { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateMute(); } } ! void MixerBoard::UpdateSolo(const WaveTrack* pLeftTrack ) { ! if (pLeftTrack == __null) { for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) mMixerTrackClusters[i]->UpdateSolo(); --- 68212,68226 ---- else { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateMute(); } } ! void MixerBoard::UpdateSolo(const Track* pTrack ) { ! if (pTrack == __null) { for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) mMixerTrackClusters[i]->UpdateSolo(); // This was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68161,68184 **** else { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateSolo(); } } ! void MixerBoard::UpdatePan(const WaveTrack* pLeftTrack) { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdatePan(); } ! void MixerBoard::UpdateGain(const WaveTrack* pLeftTrack) { MixerTrackCluster* pMixerTrackCluster; ! this->FindMixerTrackCluster(pLeftTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateGain(); } --- 68228,68251 ---- else { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateSolo(); } } ! void MixerBoard::UpdatePan(const Track* pTrack) { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdatePan(); } ! void MixerBoard::UpdateGain(const Track* pTrack) { MixerTrackCluster* pMixerTrackCluster; ! FindMixerTrackCluster(pTrack, &pMixerTrackCluster); if (pMixerTrackCluster) pMixerTrackCluster->UpdateGain(); } // This was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT *************** *** 68295,68307 **** mImageSoloDisabled = new wxImage(mMuteSoloWidth, 16); } ! int MixerBoard::FindMixerTrackCluster(const WaveTrack* pLeftTrack, MixerTrackCluster** hMixerTrackCluster) const { *hMixerTrackCluster = __null; for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) { ! if (mMixerTrackClusters[i]->mLeftTrack == pLeftTrack) { *hMixerTrackCluster = mMixerTrackClusters[i]; return i; --- 68362,68374 ---- mImageSoloDisabled = new wxImage(mMuteSoloWidth, 16); } ! int MixerBoard::FindMixerTrackCluster(const Track* pTrack, MixerTrackCluster** hMixerTrackCluster) const { *hMixerTrackCluster = __null; for (unsigned int i = 0; i < mMixerTrackClusters.GetCount(); i++) { ! if (mMixerTrackClusters[i]->mTrack == pTrack) { *hMixerTrackCluster = mMixerTrackClusters[i]; return i; // This was an intentional effort to generalize the Mixer code // to make it easier to support MIDI tracks. I reverted to the original // code and enabled the changes under EXPERIMENTAL_MIDI_OUT ***************** // Note: there was an #include inserted in NoteTrack.cpp before // #if defined(USE_MIDI) that I moved after #if defined(USE_MIDI) -- this // include should have been harmless ***************** diff -wrcB e79/src/Project.cpp.E e80/src/Project.cpp.E *** e79/src/Project.cpp.E 2010-11-24 20:47:12.000000000 -0500 --- e80/src/Project.cpp.E 2010-11-24 20:47:40.000000000 -0500 *************** *** 189443,189448 **** --- 189502,189508 ---- { + ; wxString projName; if (mFileName.IsEmpty()) // Note: I added some macros that "sonify" redisplay -- playing different // MIDI tones during different redisplay phases to understand performance. // I left the macros in but disabled -- redisplay is obviously a target // for future work, esp. for NoteTracks, which are slower than WaveTracks, // so I thought this might help later on. The semicolon is a remnant that // could be removed, but it's harmless. *************** *** 189498,189503 **** --- 189558,189564 ---- mAutoSaveFileName += fn + L".autosave"; mLastAutoSaveTime = wxGetLocalTime(); + ; } void AudacityProject::DeleteCurrentAutoSaveFile() // Another redisplay sonification remnant. diff -wrcB e79/src/Snap.cpp.E e80/src/Snap.cpp.E *** e79/src/Snap.cpp.E 2010-11-24 20:47:13.000000000 -0500 --- e80/src/Snap.cpp.E 2010-11-24 20:47:42.000000000 -0500 *************** *** 48874,48880 **** } } } ! if (track->GetKind() == Track::Wave) { WaveTrack *waveTrack = (WaveTrack *)track; WaveClipList::compatibility_iterator it; for (it=waveTrack->GetClipIterator(); it; it=it->GetNext()) { --- 48897,48903 ---- } } } ! else if (track->GetKind() == Track::Wave) { WaveTrack *waveTrack = (WaveTrack *)track; WaveClipList::compatibility_iterator it; for (it=waveTrack->GetClipIterator(); it; it=it->GetNext()) { // The "else" avoids the test if the previous test for Track::Label // succeeds -- there's a following test for Track::Note if USE_MIDI is on. diff -wrcB e79/src/Track.cpp.E e80/src/Track.cpp.E *** e79/src/Track.cpp.E 2010-11-24 20:47:16.000000000 -0500 --- e80/src/Track.cpp.E 2010-11-24 20:47:45.000000000 -0500 *************** *** 48761,48767 **** member = l->GetPrev(member); } ! while (member && member->GetKind() == Track::Wave) { t = member; member = l->GetPrev(member); } --- 48784,48794 ---- member = l->GetPrev(member); } ! while (member && (member->GetKind() == Track::Wave ! ! ! ! )) { t = member; member = l->GetPrev(member); } // semantically identical *************** *** 48848,48854 **** int nextKind = l->GetNext(t)->GetKind(); if (mInLabelSection && nextKind != Track::Label) break; ! if (nextKind != Track::Label && nextKind != Track::Wave) break; t = Next(skiplinked); --- 48876,48886 ---- int nextKind = l->GetNext(t)->GetKind(); if (mInLabelSection && nextKind != Track::Label) break; ! if (nextKind != Track::Label && nextKind != Track::Wave ! ! ! ! ) break; t = Next(skiplinked); // semantically identical diff -wrcB e79/src/TrackPanel.cpp.E e80/src/TrackPanel.cpp.E *** e79/src/TrackPanel.cpp.E 2010-11-24 20:47:19.000000000 -0500 --- e80/src/TrackPanel.cpp.E 2010-11-24 20:47:48.000000000 -0500 *************** *** 75699,75709 **** if (p->GetAudioIOToken()>0 && ! !gAudioIO->IsStreamActive(p->GetAudioIOToken()) ! ! ! ! ) { --- 75752,75758 ---- if (p->GetAudioIOToken()>0 && ! !gAudioIO->IsStreamActive(p->GetAudioIOToken())) { // semantically identical *************** *** 75727,75737 **** if (p->GetAudioIOToken()>0 && ! !gAudioIO->IsAudioTokenActive(p->GetAudioIOToken()) ! ! ! ! ) { if (gAudioIO->GetNumCaptureChannels() > 0) { --- 75776,75782 ---- if (p->GetAudioIOToken()>0 && ! !gAudioIO->IsAudioTokenActive(p->GetAudioIOToken())) { if (gAudioIO->GetNumCaptureChannels() > 0) { // semantically identical *************** *** 76584,76590 **** mSnapLeft = -1; mSnapRight = -1; ! if (event.ShiftDown()) { bool isAtLeastOneTrackSelected = false; --- 76661,76676 ---- mSnapLeft = -1; mSnapRight = -1; ! ! ! ! ! ! if (event.ShiftDown() ! ! ! ! ) { bool isAtLeastOneTrackSelected = false; // semantically identical *************** *** 76615,76622 **** ! else if(event.CmdDown()) ! { AudacityProject *p = GetActiveProject(); if (p) { --- 76701,76711 ---- ! else if(event.CmdDown() ! ! ! ! ) { AudacityProject *p = GetActiveProject(); if (p) { // semantically identical *************** *** 76733,76740 **** mViewInfo->sel0 = s; mViewInfo->sel1 = s; ! MakeParentModifyState(); } --- 76821,76829 ---- mViewInfo->sel0 = s; mViewInfo->sel1 = s; ! ; MakeParentModifyState(); + ; } // semantically identical -- more redisplay sonification artifacts *************** *** 76844,76850 **** const int minimumSizedSelection = 5; wxInt64 SelStart=TimeToPosition( mSelStart, r.x); ! if (wxLongLong(SelStart-x).Abs() < minimumSizedSelection) return; --- 76929,76939 ---- const int minimumSizedSelection = 5; wxInt64 SelStart=TimeToPosition( mSelStart, r.x); ! if (wxLongLong(SelStart-x).Abs() < minimumSizedSelection ! ! ! ! ) return; // semantically identical *************** *** 77093,77100 **** ToolsToolBar * ttb = mListener->TP_GetToolsToolBar(); bool multiToolModeActive = (ttb && ttb->IsDown(multiTool)); ! if (vt->GetKind() == Track::Wave && !event.ShiftDown()) { WaveTrack* wt = (WaveTrack*)vt; mCapturedClip = wt->GetClipAtX(event.m_x); if (mCapturedClip == __null) --- 77181,77195 ---- ToolsToolBar * ttb = mListener->TP_GetToolsToolBar(); bool multiToolModeActive = (ttb && ttb->IsDown(multiTool)); ! if ((vt->GetKind() == Track::Wave ! ! ! ! ) && !event.ShiftDown()) { + + + WaveTrack* wt = (WaveTrack*)vt; mCapturedClip = wt->GetClipAtX(event.m_x); if (mCapturedClip == __null) // semantically identical *************** *** 77108,77114 **** double clickTime = PositionToTime(event.m_x, GetLeftOffset()); bool clickedInSelection = ! (wt->GetSelected() && clickTime > mViewInfo->sel0 && clickTime < mViewInfo->sel1); --- 77199,77205 ---- double clickTime = PositionToTime(event.m_x, GetLeftOffset()); bool clickedInSelection = ! (vt->GetSelected() && clickTime > mViewInfo->sel0 && clickTime < mViewInfo->sel1); // This should be equivalent unless GetSelected() is overridden in // WaveTrack (wt is (WaveTrack *)vt). Just to be safe, I put this // change under USE_MIDI *************** *** 77126,77135 **** } else { mCapturedClipIsSelection = false; ! mCapturedClipArray.Add(TrackClip(wt, mCapturedClip)); ! Track *partner = mTracks->GetLink(wt); if (partner && partner->GetKind() == Track::Wave) { WaveClip *clip = ((WaveTrack *)partner)->GetClipAtX(event.m_x); if (clip) { --- 77217,77226 ---- } else { mCapturedClipIsSelection = false; ! mCapturedClipArray.Add(TrackClip(vt, mCapturedClip)); ! Track *partner = mTracks->GetLink(vt); if (partner && partner->GetKind() == Track::Wave) { WaveClip *clip = ((WaveTrack *)partner)->GetClipAtX(event.m_x); if (clip) { // This should be equivalent unless GetSelected() is overridden in // WaveTrack (wt is (WaveTrack *)vt). Just to be safe, I put this // change under USE_MIDI *************** *** 77249,77258 **** } } ! if (newClip) mCapturedClipArray.Add(TrackClip(t, __null)); } } --- 77340,77357 ---- } } ! if (newClip) { ! ! ! ! ! ! ! mCapturedClipArray.Add(TrackClip(t, __null)); } } + } // semantically identical *************** *** 77297,77305 **** mHSlideAmount = 0.0; double desiredSlideAmount = (event.m_x - mMouseClickX) / mViewInfo->zoom; ! desiredSlideAmount = rint(mouseTrack->GetRate() * desiredSlideAmount) / mouseTrack->GetRate(); ! ! if (mSnapManager && mCapturedClip) { double clipLeft = mCapturedClip->GetStartTime() + desiredSlideAmount; double clipRight = mCapturedClip->GetEndTime() + desiredSlideAmount; --- 77398,77405 ---- mHSlideAmount = 0.0; double desiredSlideAmount = (event.m_x - mMouseClickX) / mViewInfo->zoom; ! desiredSlideAmount = rint(mouseTrack->GetRate() * desiredSlideAmount) / ! mouseTrack->GetRate(); if (mSnapManager && mCapturedClip) { double clipLeft = mCapturedClip->GetStartTime() + desiredSlideAmount; double clipRight = mCapturedClip->GetEndTime() + desiredSlideAmount; // semantically identical, but just code beautification, so I took the change out *************** *** 77348,77354 **** { if (!mouseTrack->GetLinked() && mTracks->GetLink(mouseTrack)) ! mouseTrack = (WaveTrack*)mTracks->GetLink(mouseTrack); --- 77449,77459 ---- { if (!mouseTrack->GetLinked() && mTracks->GetLink(mouseTrack)) ! mouseTrack = ! ! (WaveTrack*) ! ! mTracks->GetLink(mouseTrack); //semantically identical *************** *** 77357,77363 **** mCapturedClipArray[i].clip->Offset(desiredSlideAmount); if (MoveClipToTrack(mCapturedClip, ! (WaveTrack*)mCapturedTrack, mouseTrack)) { mCapturedTrack = mouseTrack; mDidSlideVertically = true; --- 77462,77469 ---- mCapturedClipArray[i].clip->Offset(desiredSlideAmount); if (MoveClipToTrack(mCapturedClip, ! (WaveTrack*)mCapturedTrack, ! (WaveTrack*)mouseTrack)) { mCapturedTrack = mouseTrack; mDidSlideVertically = true; // Without USE_MIDI, this is a redundant cast. I changed so the cast only // happens with USE_MIDI *************** *** 77603,77614 **** return; ! if (mCapturedTrack->GetKind() != Track::Wave ! || ((WaveTrack *) mCapturedTrack)->GetDisplay() > WaveTrack::SpectrumLogDisplay) ! return; mMouseCapture = IsVZooming; mZoomStart = event.m_y; mZoomEnd = event.m_y; } --- 77713,77734 ---- return; ! if ((mCapturedTrack->GetKind() == Track::Wave ! && ((WaveTrack *) mCapturedTrack)->GetDisplay() <= WaveTrack::SpectrumLogDisplay) ! ! ! ! ) { mMouseCapture = IsVZooming; mZoomStart = event.m_y; mZoomEnd = event.m_y; + + + + + + + } } // I think this was semantically equivalent, but in the spirit of // simplified mechanical checking, I reinstalled the original code // unless USE_MIDI is on *************** *** 77656,77662 **** double rate = ((WaveTrack *)track)->GetRate(); ! ((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumDisplay ? spectrum = true : spectrum = false; spectrumLog=(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumLogDisplay); if(spectrum) { min = mTrackArtist->GetSpectrumMinFreq(0); --- 77779,77785 ---- double rate = ((WaveTrack *)track)->GetRate(); ! spectrum = ((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumDisplay; spectrumLog=(((WaveTrack *) track)->GetDisplay() == WaveTrack::SpectrumLogDisplay); if(spectrum) { min = mTrackArtist->GetSpectrumMinFreq(0); // simple code beautification -- I removed it for now but left a comment with // the prettier code *************** *** 78348,78356 **** mMouseCapture = IsUncaptured; float newValue = slider->Get(); - WaveTrack *link = (WaveTrack *)mTracks->GetLink(mCapturedTrack); MixerBoard* pMixerBoard = this->GetMixerBoard(); if (pan) { ((WaveTrack *)mCapturedTrack)->SetPan(newValue); if (link) --- 78471,78482 ---- mMouseCapture = IsUncaptured; float newValue = slider->Get(); MixerBoard* pMixerBoard = this->GetMixerBoard(); + + + WaveTrack *link = (WaveTrack *)mTracks->GetLink(mCapturedTrack); + if (pan) { ((WaveTrack *)mCapturedTrack)->SetPan(newValue); if (link) // semantically identical *************** *** 79762,79768 **** } if ((mMouseCapture == IsZooming || mMouseCapture == IsVZooming) && ! IsDragZooming()) { DrawZooming(dc, clip); } --- 79884,79895 ---- } if ((mMouseCapture == IsZooming || mMouseCapture == IsVZooming) && ! IsDragZooming() ! ! ! ! ! ) { DrawZooming(dc, clip); } // semantically identical diff -wrcB e79/src/UndoManager.cpp.E e80/src/UndoManager.cpp.E **************** // I discovered Audacity.h does not protect from being included // multiple times (and it is included by many .h files and hence // gets included multiple times. // I added #ifndef _AUDACITY_AUDACITY_ protection. *** e79/src/UndoManager.cpp.E 2010-11-24 20:47:20.000000000 -0500 --- e80/src/UndoManager.cpp.E 2010-11-24 20:47:48.000000000 -0500 *************** *** 29955,29960 **** --- 29958,29964 ---- void UndoManager::ModifyState(TrackList * l, double sel0, double sel1) { + ; stack[current]->tracks->Clear(true); delete stack[current]->tracks; *************** *** 29972,29977 **** --- 29976,29982 ---- stack[current]->tracks = tracksCopy; stack[current]->sel0 = sel0; stack[current]->sel1 = sel1; + ; } void UndoManager::PushState(TrackList * l, double sel0, double sel1, diff -wrcB e79/src/effects/Effect.cpp.E e80/src/effects/Effect.cpp.E *** e79/src/effects/Effect.cpp.E 2010-11-25 16:26:08.000000000 -0500 --- e80/src/effects/Effect.cpp.E 2010-11-25 16:26:31.000000000 -0500 *************** *** 54872,54883 **** playbackTracks.Add(mixRight); int token = ! gAudioIO->StartStream(playbackTracks, recordingTracks, __null, ! rate, t0, t1, __null); if (token) { int previewing = eProgressSuccess; --- 54895,54909 ---- playbackTracks.Add(mixRight); + + + int token = ! gAudioIO->StartStream(playbackTracks, recordingTracks, ! __null, rate, t0, t1, __null); if (token) { int previewing = eProgressSuccess; // semantically identical diff -wrcB e79/src/effects/nyquist/Nyquist.cpp.E e80/src/effects/nyquist/Nyquist.cpp.E *** e79/src/effects/nyquist/Nyquist.cpp.E 2010-11-25 16:33:00.000000000 -0500 --- e80/src/effects/nyquist/Nyquist.cpp.E 2010-11-25 16:33:24.000000000 -0500 *************** *** 59158,59163 **** --- 59161,59168 ---- void EffectNyquist::ParseFile() { + wxLogDebug(L"EffectNyquist::ParseFile called"); + wxTextFile f(mFileName.GetFullPath()); if (!f.Open()) return; // seems harmless *************** *** 59167,59172 **** --- 59172,59178 ---- mOK = false; mIsSal = false; mControls.Clear(); + mDebug = false; int i; int len = f.GetLineCount(); // I can't remember the details of mDebug and debug flags in Nyquist // effects, but there was some more recent work, but fixing, and testing, // e.g. cases where debug flags were "stuck" on when you clicked "Debug". // Since behavior seems to be correct now, I say we should not mess with // Nyquist.cpp. Certainly independent of USE_MIDI, and EXPERIMENTAL_*, but // let's give these changes a sanity check since they're here. *************** *** 59262,59270 **** return false; } ! if (result == eDebugID) { ! mDebug = true; ! } mCmd = dlog.GetCommand(); --- 59268,59277 ---- return false; } ! ! ! ! mDebug = (result == eDebugID); mCmd = dlog.GetCommand(); *************** *** 59437,59443 **** this->ReplaceProcessedTracks(success); ! mDebug = false; return success; } --- 59444,59450 ---- this->ReplaceProcessedTracks(success); ! return success; } diff -wrcB e79/src/widgets/ASlider.cpp.E e80/src/widgets/ASlider.cpp.E *** e79/src/widgets/ASlider.cpp.E 2010-11-25 16:33:18.000000000 -0500 --- e80/src/widgets/ASlider.cpp.E 2010-11-25 16:33:43.000000000 -0500 // This is the last file, but has a lot of changes. The goal here was to // generalize sliders for use as MIDI volume control. The sliders have to // change from audio gain to MIDI volume because tracks and sliders get // reassigned. This required some static values to become changeable // member variables. These changes SHOULD be harmless code generalizations, // but only if consistent with compile-time flags. In the spirit of the // changes above, my plan is to make all these changes depend on // EXPERIMENTAL_MIDI_OUT, not USE_MIDI, and to remove any changes // unless EXPERIMENTAL_MIDI_OUT is defined. *************** *** 49010,49065 **** } ! LWSlider::LWSlider(wxWindow *parent, ! wxString name, ! const wxPoint &pos, ! const wxSize &size, ! int style, ! bool heavyweight , ! bool popup , ! int orientation ) { ! wxString leftLabel, rightLabel; ! float minValue, maxValue, stepValue; ! float speed = 1.0; ! switch(style) { case 3: ! minValue = -1.0f; ! maxValue = +1.0f; ! stepValue = 0.1f; ! orientation = wxHORIZONTAL; break; case 2: ! minValue = -36.0f; ! if (orientation == wxHORIZONTAL) ! maxValue = 36.0f; else ! maxValue = 36.0f; ! stepValue = 1.0f; ! speed = 0.5; break; case 1: ! minValue = 0.0f; ! maxValue = 1.0f; ! stepValue = 0.0f; break; case 4: ! minValue = 0.01f; ! maxValue = 3.0f; ! stepValue = 0.0f; break; - default: ! minValue = 0.0f; ! maxValue = 1.0f; ! stepValue = 0.0f; if ( false ) ; else wxOnAssert(L"/Users/rbd/audacity/wNN/src/widgets/ASlider.cpp", NNNN, __FUNCTION__, L"false", __null); } ! Init(parent, name, pos, size, minValue, maxValue, stepValue, ! true, style, heavyweight, popup, speed, orientation); } void LWSlider::Init(wxWindow * parent, --- 49038,49103 ---- } ! void LWSlider::SetStyle(int style) { ! mStyle = style; ! mSpeed = 1.0; switch(style) { case 3: ! mMinValue = -1.0f; ! mMaxValue = +1.0f; ! mStepValue = 0.1f; ! mOrientation = wxHORIZONTAL; ! mName = wxGetTranslation(L"Pan"); break; case 2: ! mMinValue = -36.0f; ! if (mOrientation == wxHORIZONTAL) ! mMaxValue = 36.0f; else ! mMaxValue = 36.0f; ! mStepValue = 1.0f; ! mSpeed = 0.5; ! mName = wxGetTranslation(L"Gain"); break; case 1: ! mMinValue = 0.0f; ! mMaxValue = 1.0f; ! mStepValue = 0.0f; break; case 4: ! mMinValue = 0.01f; ! mMaxValue = 3.0f; ! mStepValue = 0.0f; break; default: ! mMinValue = 0.0f; ! mMaxValue = 1.0f; ! mStepValue = 0.0f; if ( false ) ; else wxOnAssert(L"/Users/rbd/audacity/wNN/src/widgets/ASlider.cpp", NNNN, __FUNCTION__, L"false", __null); } + } + + + + LWSlider::LWSlider(wxWindow *parent, + wxString name, + const wxPoint &pos, + const wxSize &size, + int style, + bool heavyweight , + bool popup , + int orientation ) + { + wxString leftLabel, rightLabel; + mOrientation = orientation; + mName = name; ! SetStyle(style); ! ! Init(parent, mName, pos, size, mMinValue, mMaxValue, mStepValue, ! true, style, heavyweight, popup, mSpeed, mOrientation); } void LWSlider::Init(wxWindow * parent, // I put these changes under EXPERIMENTAL_MIDI_OUT *************** *** 49169,49175 **** wxString maxStr = mName + L": 000000"; ! if (mStyle == 3 || mStyle == 2 || mStyle == 4) maxStr += L"000"; mPopWin = new TipPanel(GetToolTipParent(), -1, maxStr, wxDefaultPosition); --- 49207,49217 ---- wxString maxStr = mName + L": 000000"; ! if (mStyle == 3 || mStyle == 2 || mStyle == 4 ! ! ! ! ) maxStr += L"000"; mPopWin = new TipPanel(GetToolTipParent(), -1, maxStr, wxDefaultPosition); // versions are semantically identical **************** // Note: I found other uses of #ifdef USE_MIDI and changed them to // #ifdef EXPERIMENTAL_MIDI_OUT -- I think most if not all of these changes // are already in later revisions.