ModelTransformerFactory.h

Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Chris Cannam and QMUL.
00008    
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _MODEL_TRANSFORMER_FACTORY_H_
00017 #define _MODEL_TRANSFORMER_FACTORY_H_
00018 
00019 #include "Transform.h"
00020 #include "TransformDescription.h"
00021 
00022 #include "ModelTransformer.h"
00023 
00024 #include <map>
00025 #include <set>
00026 
00027 namespace Vamp { class PluginBase; }
00028 
00029 class AudioCallbackPlaySource;
00030 
00031 class ModelTransformerFactory : public QObject
00032 {
00033     Q_OBJECT
00034 
00035 public:
00036     virtual ~ModelTransformerFactory();
00037 
00038     static ModelTransformerFactory *getInstance();
00039 
00048     ModelTransformer::Input
00049     getConfigurationForTransform(Transform &transform,
00050                                  const std::vector<Model *> &candidateInputModels,
00051                                  Model *defaultInputModel,
00052                                  AudioCallbackPlaySource *source = 0,
00053                                  size_t startFrame = 0,
00054                                  size_t duration = 0);
00055     
00070     Model *transform(const Transform &transform,
00071                      const ModelTransformer::Input &input,
00072                      QString &message);
00073 
00074 protected slots:
00075     void transformerFinished();
00076 
00077     void modelAboutToBeDeleted(Model *);
00078 
00079 protected:
00080     ModelTransformer *createTransformer(const Transform &transform,
00081                                         const ModelTransformer::Input &input);
00082 
00083     typedef std::map<TransformId, QString> TransformerConfigurationMap;
00084     TransformerConfigurationMap m_lastConfigurations;
00085 
00086     typedef std::set<ModelTransformer *> TransformerSet;
00087     TransformerSet m_runningTransformers;
00088 
00089     bool getChannelRange(TransformId identifier,
00090                          Vamp::PluginBase *plugin, int &min, int &max);
00091 
00092     static ModelTransformerFactory *m_instance;
00093 };
00094 
00095 
00096 #endif

Generated on Wed Feb 20 15:45:26 2008 for SonicVisualiser by  doxygen 1.5.1