comparison plugin/transform/PluginTransform.h @ 320:32e50b620a6c

* Move some things around to facilitate plundering libraries for other applications without needing to duplicate so much code. sv/osc -> data/osc sv/audioio -> audioio sv/transform -> plugin/transform sv/document -> document (will rename to framework in next commit)
author Chris Cannam
date Wed, 24 Oct 2007 16:34:31 +0000
parents
children
comparison
equal deleted inserted replaced
319:3ff8f571da09 320:32e50b620a6c
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_TRANSFORM_H_
17 #define _PLUGIN_TRANSFORM_H_
18
19 #include "Transform.h"
20
21 #include "base/Window.h"
22
23 #include "vamp-sdk/Plugin.h"
24
25 //!!! should this just move back up to Transform? It is after all used
26 //directly in all sorts of generic places, like Document
27
28 class PluginTransform : public Transform
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 PluginTransform(Model *inputModel,
58 const ExecutionContext &context);
59
60 ExecutionContext m_context;
61 };
62
63 #endif