TransformDescription.h
Go to the documentation of this file.
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 SV_TRANSFORM_DESCRIPTION_H
17 #define SV_TRANSFORM_DESCRIPTION_H
18 
19 #include "Transform.h"
20 
21 #include "plugin/Provider.h"
22 
23 #include <QString>
24 
25 #include <vector>
26 
49 {
50  enum Type {
51  Analysis, // e.g. vamp plugin output
52  Effects, // e.g. ladspa plugin with audio in and out
53  EffectsData, // e.g. control output of ladspa plugin
54  Generator, // e.g. audio out of ladspa plugin with no audio in
56  };
57 
59  type(UnknownType), configurable(false) { }
60  TransformDescription(Type _type, QString _category,
61  TransformId _identifier, QString _name,
62  QString _friendlyName, QString _description,
63  QString _longDescription,
64  QString _maker, QString _units, bool _configurable) :
65  type(_type), category(_category),
66  identifier(_identifier), name(_name),
67  friendlyName(_friendlyName), description(_description),
68  longDescription(_longDescription),
69  maker(_maker), units(_units), configurable(_configurable) { }
70 
72  QString category; // e.g. time > onsets
73  TransformId identifier; // e.g. vamp:vamp-aubio:aubioonset
74  QString name; // plugin's name if 1 output, else "name: output"
75  QString friendlyName; // short text for layer name
76  QString description; // sentence describing transform
77  QString longDescription; // description "using" plugin name "by" maker
78  QString maker;
80  QString units;
82 
83  // User-visible strings (name, maker etc) should be sorted in a
84  // locale-aware way
85  static bool compareUserStrings(QString s1, QString s2) {
86  return QString::localeAwareCompare(s1, s2) < 0;
87  };
88 
89  bool operator<(const TransformDescription &od) const {
90  if (name == od.name) {
91  return identifier < od.identifier;
92  } else {
93  return compareUserStrings(name, od.name);
94  }
95  };
96 };
97 
98 typedef std::vector<TransformDescription> TransformList;
99 
100 #endif
std::vector< TransformDescription > TransformList
TransformDescription(Type _type, QString _category, TransformId _identifier, QString _name, QString _friendlyName, QString _description, QString _longDescription, QString _maker, QString _units, bool _configurable)
static bool compareUserStrings(QString s1, QString s2)
Metadata associated with a transform.
bool operator<(const TransformDescription &od) const
QString TransformId
Definition: Transform.h:30