mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-05 19:21:59 +01:00
Bug2265: Should save and restore track heights...
... Regression happened at 3f1fd8ced0
The heights were written to file, but not read back again.
This fix was done carefully to avoid making dependency cycles. We don't want
Track to depend on TrackView or TrackControls.
It's not great that LabelTrack, NoteTrack, TimeTrack, and WaveTrack now have
those dependencies, but at least they don't make cycles.
It would be better to figure out how to attach the view and controls to the
track with ClientData, then just invoke BuildAll to repopulate the view and
controls, so that they are non-null when you reach
Track::HandleCommonXMLAttribute.
This commit is contained in:
@@ -61,6 +61,9 @@ Track classes.
|
||||
|
||||
#include "InconsistencyException.h"
|
||||
|
||||
#include "tracks/ui/TrackView.h"
|
||||
#include "tracks/ui/TrackControls.h"
|
||||
|
||||
using std::max;
|
||||
|
||||
static ProjectFileIORegistry::Entry registerFactory{
|
||||
@@ -68,7 +71,10 @@ static ProjectFileIORegistry::Entry registerFactory{
|
||||
[]( AudacityProject &project ){
|
||||
auto &trackFactory = TrackFactory::Get( project );
|
||||
auto &tracks = TrackList::Get( project );
|
||||
return tracks.Add(trackFactory.NewWaveTrack());
|
||||
auto result = tracks.Add(trackFactory.NewWaveTrack());
|
||||
TrackView::Get( *result );
|
||||
TrackControls::Get( *result );
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user