Chris@439
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@439
|
2
|
Chris@439
|
3 /*
|
Chris@439
|
4 Sonic Visualiser
|
Chris@439
|
5 An audio file viewer and annotation editor.
|
Chris@439
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@439
|
7 This file copyright 2008 QMUL.
|
Chris@439
|
8
|
Chris@439
|
9 This program is free software; you can redistribute it and/or
|
Chris@439
|
10 modify it under the terms of the GNU General Public License as
|
Chris@439
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@439
|
12 License, or (at your option) any later version. See the file
|
Chris@439
|
13 COPYING included with this distribution for more information.
|
Chris@439
|
14 */
|
Chris@439
|
15
|
Chris@1581
|
16 #ifndef SV_RDF_IMPORTER_H
|
Chris@1581
|
17 #define SV_RDF_IMPORTER_H
|
Chris@439
|
18
|
Chris@439
|
19 #include <QObject>
|
Chris@439
|
20 #include <QString>
|
Chris@439
|
21
|
Chris@439
|
22 #include <vector>
|
Chris@439
|
23
|
Chris@1040
|
24 #include "base/BaseTypes.h"
|
Chris@1040
|
25
|
Chris@439
|
26 class Model;
|
Chris@439
|
27 class RDFImporterImpl;
|
Chris@439
|
28 class ProgressReporter;
|
Chris@439
|
29
|
Chris@439
|
30 class RDFImporter : public QObject
|
Chris@439
|
31 {
|
Chris@439
|
32 Q_OBJECT
|
Chris@439
|
33
|
Chris@439
|
34 public:
|
Chris@439
|
35 /**
|
Chris@439
|
36 * Return the file extensions that we have data file readers for,
|
Chris@439
|
37 * in a format suitable for use with QFileDialog. For example,
|
Chris@439
|
38 * "*.rdf *.n3".
|
Chris@439
|
39 */
|
Chris@439
|
40 static QString getKnownExtensions();
|
Chris@439
|
41
|
Chris@1040
|
42 RDFImporter(QString url, sv_samplerate_t sampleRate = 0);
|
Chris@439
|
43 virtual ~RDFImporter();
|
Chris@439
|
44
|
Chris@1040
|
45 void setSampleRate(sv_samplerate_t sampleRate);
|
Chris@490
|
46
|
Chris@439
|
47 bool isOK();
|
Chris@439
|
48 QString getErrorString() const;
|
Chris@439
|
49
|
Chris@1739
|
50 /**
|
Chris@1739
|
51 * Return a list of models imported from the RDF source. The
|
Chris@1739
|
52 * models were heap-allocated by this class and are not registered
|
Chris@1739
|
53 * with any other owner; the caller takes ownership and must
|
Chris@1739
|
54 * arrange for them to be deleted manually or managed by a smart
|
Chris@1739
|
55 * pointer.
|
Chris@1739
|
56 */
|
Chris@1739
|
57 //!!! todo: ModelId-ise
|
Chris@439
|
58 std::vector<Model *> getDataModels(ProgressReporter *reporter);
|
Chris@439
|
59
|
Chris@490
|
60 enum RDFDocumentType {
|
Chris@490
|
61 AudioRefAndAnnotations,
|
Chris@490
|
62 Annotations,
|
Chris@490
|
63 AudioRef,
|
Chris@499
|
64 OtherRDFDocument,
|
Chris@499
|
65 NotRDF
|
Chris@490
|
66 };
|
Chris@490
|
67
|
Chris@490
|
68 static RDFDocumentType identifyDocumentType(QString url);
|
Chris@490
|
69
|
Chris@439
|
70 protected:
|
Chris@439
|
71 RDFImporterImpl *m_d;
|
Chris@439
|
72 };
|
Chris@439
|
73
|
Chris@439
|
74 #endif
|