mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-06 22:45:29 +01:00
Track factory cleanup (#646)
* Don't need TrackFactory to make LabelTrack * Don't need TrackFactory to make NoteTrack * Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory * Remove some forward declarations * Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "Project.h"
|
||||
#include "ProjectSettings.h"
|
||||
#include "ProjectFileIORegistry.h"
|
||||
#include "ViewInfo.h"
|
||||
|
||||
#include "tracks/ui/TrackView.h"
|
||||
#include "tracks/ui/TrackControls.h"
|
||||
@@ -36,17 +37,12 @@
|
||||
#define TIMETRACK_MIN 0.01
|
||||
#define TIMETRACK_MAX 10.0
|
||||
|
||||
std::shared_ptr<TimeTrack> TrackFactory::NewTimeTrack()
|
||||
{
|
||||
return std::make_shared<TimeTrack>(mZoomInfo);
|
||||
}
|
||||
|
||||
static ProjectFileIORegistry::Entry registerFactory{
|
||||
wxT( "timetrack" ),
|
||||
[]( AudacityProject &project ){
|
||||
auto &trackFactory = TrackFactory::Get( project );
|
||||
auto &tracks = TrackList::Get( project );
|
||||
auto result = tracks.Add(trackFactory.NewTimeTrack());
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
auto result = tracks.Add(std::make_shared<TimeTrack>(&viewInfo));
|
||||
TrackView::Get( *result );
|
||||
TrackControls::Get( *result );
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user