1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-03 00:59:43 +02:00

Remove unused and unneeded MIDI methods and variables

The fields in AudioIO are simply unneeded (commented out, declared but never implemented, or otherwise unused).

mLastMidiPosition (in NoteTrack) looks like the vestiges of a far older attempt at MIDI playback; the field itself is completely unused though so it is safe to remove it.
This commit is contained in:
Pokechu22 2017-06-01 10:37:53 -07:00 committed by Paul Licameli
parent 437de15098
commit 62ebb2f95d
4 changed files with 3 additions and 28 deletions

View File

@ -851,10 +851,6 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
const PaStreamCallbackTimeInfo *timeInfo,
PaStreamCallbackFlags statusFlags, void *userData );
#ifdef EXPERIMENTAL_MIDI_OUT
int compareTime( const void* a, const void* b );
#endif
//////////////////////////////////////////////////////////////////////
//
// class AudioThread - declaration and glue code
@ -4892,10 +4888,3 @@ int audacityAudioCallback(const void *inputBuffer, void *outputBuffer,
return callbackReturn;
}
#ifdef EXPERIMENTAL_MIDI_OUT
int compareTime( const void* a, const void* b )
{
return( (int)((*(PmEvent*)a).timestamp - (*(PmEvent*)b).timestamp ) );
}
#endif

View File

@ -440,11 +440,8 @@ private:
void OutputEvent();
void FillMidiBuffers();
void GetNextEvent();
void AudacityMidiCallback();
double AudioTime() { return mT0 + mNumFrames / mRate; }
double PauseTime();
// double getCurrentTrackTime();
// long CalculateMidiTimeStamp(double time);
void AllNotesOff();
#endif
@ -565,7 +562,6 @@ private:
bool mMidiOutputComplete;
/// Is the next event a note-on?
bool mNextIsNoteOn;
// int mCnt;
/// mMidiStreamActive tells when mMidiStream is open for output
bool mMidiStreamActive;
/// when true, mSendMidiState means send only updates, not note-on's,

View File

@ -124,7 +124,6 @@ NoteTrack::NoteTrack(const std::shared_ptr<DirManager> &projDirManager)
mPitchHeight = 5;
mVisibleChannels = ALL_CHANNELS;
mLastMidiPosition = 0;
}
NoteTrack::~NoteTrack()
@ -185,7 +184,6 @@ Track::Holder NoteTrack::Duplicate() const
// copy some other fields here
duplicate->SetBottomNote(mBottomNote);
duplicate->SetPitchHeight(mPitchHeight);
duplicate->mLastMidiPosition = mLastMidiPosition;
duplicate->mVisibleChannels = mVisibleChannels;
duplicate->SetOffset(GetOffset());
#ifdef EXPERIMENTAL_MIDI_OUT
@ -461,7 +459,7 @@ Track::Holder NoteTrack::Cut(double t0, double t1)
//AddToDuration( delta );
// What should be done with the rest of newTrack's members?
//(mBottomNote, mDirManager, mLastMidiPosition,
//(mBottomNote, mDirManager,
// mSerializationBuffer, mSerializationLength, mVisibleChannels)
// This std::move is needed to "upcast" the pointer type
@ -485,8 +483,8 @@ Track::Holder NoteTrack::Copy(double t0, double t1, bool) const
newTrack->SetOffset(GetOffset());
// What should be done with the rest of newTrack's members?
//(mBottomNote, mDirManager, mLastMidiPosition,
// mSerializationBuffer, mSerializationLength, mVisibleChannels)
// (mBottomNote, mDirManager, mSerializationBuffer,
// mSerializationLength, mVisibleChannels)
// This std::move is needed to "upcast" the pointer type
return std::move(newTrack);

View File

@ -102,13 +102,6 @@ class AUDACITY_DLL_API NoteTrack final
bool ExportMIDI(const wxString &f) const;
bool ExportAllegro(const wxString &f) const;
/* REQUIRES PORTMIDI */
// int GetLastMidiPosition() const { return mLastMidiPosition; }
// void SetLastMidiPosition( int position )
// {
// mLastMidiPosition = position;
// }
// High-level editing
Track::Holder Cut (double t0, double t1) override;
Track::Holder Copy (double t0, double t1, bool forClipboard = true) const override;
@ -244,7 +237,6 @@ class AUDACITY_DLL_API NoteTrack final
int mStartBottomNote;
int mPitchHeight;
int mVisibleChannels; // bit set of visible channels
int mLastMidiPosition;
std::weak_ptr<StretchHandle> mStretchHandle;