comparison plugin/transform/PluginTransformer.h @ 328:21bd032ae791

* Introduce new Transform class which contains data necessary to describe the context for a plugin -- the plugin's name and output, the step/block size etc (formerly spread across ExecutionContext and TransformFactory). Other code hasn't been updated to use this yet. * Rename existing Transform stuff to Transformers (because they run Transforms) I'm still not 100% sure about this change, don't rely on it.
author Chris Cannam
date Mon, 05 Nov 2007 15:31:06 +0000
parents plugin/transform/PluginTransform.h@32e50b620a6c
children f620ce48c950
comparison
equal deleted inserted replaced
327:1d656dcda8ef 328:21bd032ae791
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 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 */
15
16 #ifndef _PLUGIN_TRANSFORMER_H_
17 #define _PLUGIN_TRANSFORMER_H_
18
19 #include "Transformer.h"
20
21 #include "base/Window.h"
22
23 #include "vamp-sdk/Plugin.h"
24
25 //!!! should this just move back up to Transformer? It is after all used
26 //directly in all sorts of generic places, like Document
27
28 class PluginTransformer : public Transformer
29 {
30 public:
31 class ExecutionContext {
32 public:
33 // Time domain:
34 ExecutionContext(int _c = -1, size_t _bs = 0);
35
36 // Frequency domain:
37 ExecutionContext(int _c, size_t _ss, size_t _bs, WindowType _wt);
38
39 // From plugin defaults:
40 ExecutionContext(int _c, const Vamp::PluginBase *_plugin);
41
42 bool operator==(const ExecutionContext &);
43
44 void makeConsistentWithPlugin(const Vamp::PluginBase *_plugin);
45
46 int channel;
47 Vamp::Plugin::InputDomain domain;
48 size_t stepSize;
49 size_t blockSize;
50 WindowType windowType;
51 size_t startFrame;
52 size_t duration; // 0 -> whole thing
53 float sampleRate; // 0 -> model's rate
54 };
55
56 protected:
57 PluginTransformer(Model *inputModel,
58 const ExecutionContext &context);
59
60 ExecutionContext m_context;
61 };
62
63 #endif