diff layer/LayerFactory.cpp @ 44:ad214997dddb

* Refactor Layer classes so as no longer to store a single View pointer; instead they need to be able to draw themselves on any View on demand. Layers with caches (e.g. spectrogram) will need to be further refactored so as to maintain a per-View cache * Begin refactoring MainWindow by pulling out the document stuff (set of layers, models etc) into a Document class. Not yet in use. This revision is fairly unstable.
author Chris Cannam
date Thu, 02 Mar 2006 16:58:49 +0000
parents 21d061e66177
children f2fe98a7c57e
line wrap: on
line diff
--- a/layer/LayerFactory.cpp	Wed Mar 01 18:13:01 2006 +0000
+++ b/layer/LayerFactory.cpp	Thu Mar 02 16:58:49 2006 +0000
@@ -231,54 +231,53 @@
 }
 
 Layer *
-LayerFactory::createLayer(LayerType type, View *view,
-			  Model *model, int channel)
+LayerFactory::createLayer(LayerType type, Model *model, int channel)
 {
     Layer *layer = 0;
 
     switch (type) {
 
     case Waveform:
-	layer = new WaveformLayer(view);
+	layer = new WaveformLayer;
 	static_cast<WaveformLayer *>(layer)->setChannel(channel);
 	break;
 
     case Spectrogram:
-	layer = new SpectrogramLayer(view);
+	layer = new SpectrogramLayer;
 	static_cast<SpectrogramLayer *>(layer)->setChannel(channel);
 	break;
 
     case TimeRuler:
-	layer = new TimeRulerLayer(view);
+	layer = new TimeRulerLayer;
 	break;
 
     case TimeInstants:
-	layer = new TimeInstantLayer(view);
+	layer = new TimeInstantLayer;
 	break;
 
     case TimeValues:
-	layer = new TimeValueLayer(view);
+	layer = new TimeValueLayer;
 	break;
 
     case Notes:
-	layer = new NoteLayer(view);
+	layer = new NoteLayer;
 	break;
 
     case Text:
-	layer = new TextLayer(view);
+	layer = new TextLayer;
 	break;
 
     case Colour3DPlot:
-	layer = new Colour3DPlotLayer(view);
+	layer = new Colour3DPlotLayer;
 	break;
 
     case MelodicRangeSpectrogram: 
-	layer = new SpectrogramLayer(view, SpectrogramLayer::MelodicRange);
+	layer = new SpectrogramLayer(SpectrogramLayer::MelodicRange);
 	static_cast<SpectrogramLayer *>(layer)->setChannel(channel);
 	break;
 
     case PeakFrequencySpectrogram: 
-	layer = new SpectrogramLayer(view, SpectrogramLayer::MelodicPeaks);
+	layer = new SpectrogramLayer(SpectrogramLayer::MelodicPeaks);
 	static_cast<SpectrogramLayer *>(layer)->setChannel(channel);
 	break;