comparison main/OSCHandler.cpp @ 224:b5a2428f647b

* Merge from transforms branch -- switch over to using Transform object properly
author Chris Cannam
date Fri, 07 Dec 2007 16:47:31 +0000
parents 1fa0d271fd2c
children 99e0dfd3ea75
comparison
equal deleted inserted replaced
222:a3011df6ddad 224:b5a2428f647b
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sonic Visualiser
5 An audio file viewer and annotation editor.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006-2007 Chris Cannam and QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14 */
1 15
2 #include "MainWindow.h" 16 #include "MainWindow.h"
3 #include "data/osc/OSCQueue.h" 17 #include "data/osc/OSCQueue.h"
4 18
5 #include "layer/WaveformLayer.h" 19 #include "layer/WaveformLayer.h"
10 #include "base/CommandHistory.h" 24 #include "base/CommandHistory.h"
11 #include "audioio/AudioCallbackPlaySource.h" 25 #include "audioio/AudioCallbackPlaySource.h"
12 #include "audioio/AudioCallbackPlayTarget.h" 26 #include "audioio/AudioCallbackPlayTarget.h"
13 #include "framework/Document.h" 27 #include "framework/Document.h"
14 #include "data/fileio/WavFileWriter.h" 28 #include "data/fileio/WavFileWriter.h"
15 #include "plugin/transform/ModelTransformerFactory.h" 29 #include "plugin/transform/TransformFactory.h"
16 #include "widgets/Fader.h" 30 #include "widgets/Fader.h"
17 #include "widgets/AudioDial.h" 31 #include "widgets/AudioDial.h"
18 32
19 #include <QFileInfo> 33 #include <QFileInfo>
20 34
480 if (getMainModel() && 494 if (getMainModel() &&
481 pane && 495 pane &&
482 message.getArgCount() == 1 && 496 message.getArgCount() == 1 &&
483 message.getArg(0).canConvert(QVariant::String)) { 497 message.getArg(0).canConvert(QVariant::String)) {
484 498
485 TransformId transform = message.getArg(0).toString(); 499 TransformId transformId = message.getArg(0).toString();
486 500
501 Transform transform = TransformFactory::getInstance()->
502 getDefaultTransformFor(transformId);
503
487 Layer *newLayer = m_document->createDerivedLayer 504 Layer *newLayer = m_document->createDerivedLayer
488 (transform, 505 (transform, getMainModel());
489 getMainModel(),
490 ModelTransformerFactory::getInstance()->getDefaultContextForTransformer
491 (transform, getMainModel()),
492 "");
493 506
494 if (newLayer) { 507 if (newLayer) {
495 m_document->addLayerToView(pane, newLayer); 508 m_document->addLayerToView(pane, newLayer);
496 m_recentTransforms.add(transform); 509 m_recentTransforms.add(transformId);
497 m_paneStack->setCurrentLayer(pane, newLayer); 510 m_paneStack->setCurrentLayer(pane, newLayer);
498 } 511 }
499 } 512 }
500 513
501 } else { 514 } else {