Re: [Audacity-devel] Compile error in TrackPanel.cpp with midi disabled
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Vaughan J. <va...@au...> - 2012-07-16 23:33:41
|
I confirm that, and neither will soundtoucheffect.cpp compile for me, due to a syntax errors, and then several undeclared identifiers. Any MIDI developers who can help on this? If not I'll try to debug it. - V On 7/16/2012 12:42 PM, Richard Ash wrote: > I can't build current SVN with midi support disabled, because apparently > unrelated code in TrackPanel.cpp won't compile. The error I get is: > > TrackPanel.cpp: In member function ‘virtual void TrackPanel::DoSlide(wxMouseEvent&)’: > TrackPanel.cpp:2953:50: error: invalid conversion from ‘Track*’ to ‘WaveTrack*’ > > The problem seems to be the #ifdef MIDI lines ~ 2841 - the type of local > variable mouseTrack is different in the two cases. > > This was written by Leyland but last touched by Rodger when the #ifdef > MIDI went in. > > I can't see any good reason why it should be conditional - the line of > code delcaring and setting mouseTrack is the same in the two cases, > except for a type cast in the #else case (no MIDI) to make the return > from FindTrack (which is a Track*) fit into mouseTrack (which is > declared as a WaveTrack*). > > As I read it the code in both cases is designed to return immediately if > the track returned is not either a WaveTrack or a NoteTrack (if the > latter are enabled). Given this, I have tried shortening the #ifdef by > one line, taking the declaration and assignment of mouseTrack outside. > > This then breaks the block at line 2881, because we need a (conditional) > cast which we didn't before in order to align the clip to a sample > interval. This should be easy enough to fix up, but it isn't because > there is a block of unrelated code hiding inside #ifdef USE_MIDI - > labelled as > // Adjust desiredSlideAmount using SnapManager > I'm not entirely sure what it does, apart from leave desiredSlideAmount > unset if the track is a NoteTrack (because it only handles the WaveTrack > case). > WaveClip *mCapturedClip; > TrackClipArray mCapturedClipArray; > seem to be being used interchangably here, despite both existing in > builds where midi is enabled and disabled. > > Overall, can someone who understands how this is supposed to work either > fix the build with midi disabled (ideally by coming up with simple code > that works whether it is or not) or at least comment some of the class > members to make it a bit clearer what is going on? > > I'm not going to try and sort this one out until I have significantly > more time to spend on it than now - what I was trying to do was work on > FFmpeg build errors! > > Richard > |