[Audacity-devel] just refactored TrackArtist
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Andreas M. <and...@gm...> - 2011-11-22 02:47:05
|
Hallo Audacity Team, I was very unsatisfied with TrackArtist and I am still very unsatisfied with TrackPanel. So I just took a chance and refactored TrackArtist, just in case someone cares. It looks like this at the moment (and it still works as usual, without new defects): ___________________________________________________________________ class AUDACITY_DLL_API TrackArtist : virtual public LabelTrackV, virtual public TimeTrackV, virtual public NoteTrackV, virtual public WaveTrackV, virtual public SpecTrackV { public: TrackArtist(); ~TrackArtist(); void UpdatePrefs(); void DrawTracks(wxEvtHandler *win, TrackList *tracks, Track *start, wxDC & dc, wxRegion & reg, wxRect & r, wxRect & clip, ViewInfo *viewInfo, bool drawEnvelope, bool drawSamples, bool drawSliders); void DrawTrack(wxEvtHandler *win, const Track *t, wxDC & dc, const wxRect & r, const ViewInfo *viewInfo, bool drawEnvelope, bool drawSamples, bool drawSliders, bool hasSolo); void SetInset(int left, int top, int right, int bottom); void SetColours(); void SetBackgroundBrushes(wxBrush unselectedBrush, wxBrush selectedBrush, wxPen unselectedPen, wxPen selectedPen); private: int mInsetLeft; int mInsetTop; int mInsetRight; int mInsetBottom; #ifdef EXPERIMENTAL_DRAW_THREAD public: int OnUpdateAfterThreadRunID; #endif //EXPERIMENTAL_DRAW_THREAD }; ___________________________________________________________________ No magic until now, because I just divided the module into several new files, but I will try to do some wxPanel magic soon to have each widget draw itself. The new files are in src/view: BaseV.cpp & .h LabelTrackV.cpp & .h NoteTrackV.cpp & .h SpecTrackV.cpp & .h TimeTrackV.cpp & .h TrackV.cpp & .h VRulerV.cpp & .h WaveTrackV.cpp & .h I've made another patch and uploaded it to my homepage. I just cant wait for the 2.0 Release, because this would take another two years. More patches from me will come soon. Cheers, Andreas |