comparison transform/TransformDescription.h @ 388:370aa9714ef5

* Move plugin/transform to plain transform. This way transform can depend on model and GUI classes, but plugin doesn't have to.
author Chris Cannam
date Wed, 12 Mar 2008 18:02:17 +0000
parents plugin/transform/TransformDescription.h@9203b82a8c53
children 381ec750eeee
comparison
equal deleted inserted replaced
387:7aa1de571880 388:370aa9714ef5
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 */
15
16 #ifndef _TRANSFORM_DESCRIPTION_H_
17 #define _TRANSFORM_DESCRIPTION_H_
18
19 #include "Transform.h"
20
21 #include <QString>
22
23 #include <vector>
24
25 /**
26 * Metadata associated with a transform.
27 *
28 * The transform ID is the same as that used in the Transform class.
29 * It is intended to be computer-referenceable and unique within the
30 * application.
31 *
32 * The name is intended to be human readable. In principle it doesn't
33 * have to be unique, but the factory that creates these objects
34 * should add suffixes to ensure that it is, all the same (just to
35 * avoid user confusion).
36 *
37 * The friendly name is a shorter version of the name.
38 *
39 * The type is also intended to be user-readable, for use in menus.
40 *
41 * To obtain these objects, use
42 * TransformFactory::getAllTransformDescriptions and
43 * TransformFactory::getTransformDescription.
44 */
45
46 struct TransformDescription
47 {
48 TransformDescription() { }
49 TransformDescription(QString _type, QString _category,
50 TransformId _identifier, QString _name,
51 QString _friendlyName, QString _description,
52 QString _maker, QString _units, bool _configurable) :
53 type(_type), category(_category),
54 identifier(_identifier), name(_name),
55 friendlyName(_friendlyName), description(_description),
56 maker(_maker), units(_units), configurable(_configurable) { }
57
58 QString type; // e.g. feature extraction plugin
59 QString category; // e.g. time > onsets
60 TransformId identifier; // e.g. vamp:vamp-aubio:aubioonset
61 QString name; // plugin's name if 1 output, else "name: output"
62 QString friendlyName; // short text for layer name
63 QString description; // sentence describing transform
64 QString maker;
65 QString units;
66 bool configurable;
67
68 bool operator<(const TransformDescription &od) const {
69 return
70 (name < od.name) ||
71 (name == od.name && identifier < od.identifier);
72 };
73 };
74
75 typedef std::vector<TransformDescription> TransformList;
76
77 #endif