comparison data/fileio/FileFinder.h @ 582:442e2ff876aa

* add forgotten file!
author Chris Cannam
date Fri, 27 Mar 2009 16:27:12 +0000
parents
children 43b0bfd07bd3
comparison
equal deleted inserted replaced
581:2e0c987a12bd 582:442e2ff876aa
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 2009 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 _FILE_FINDER_H_
17 #define _FILE_FINDER_H_
18
19 #include <QString>
20
21 class FileFinder
22 {
23 public:
24 enum FileType {
25 SessionFile,
26 AudioFile,
27 LayerFile,
28 LayerFileNoMidi,
29 SessionOrAudioFile,
30 ImageFile,
31 AnyFile
32 };
33
34 virtual QString getOpenFileName(FileType type, QString fallbackLocation = "") = 0;
35 virtual QString getSaveFileName(FileType type, QString fallbackLocation = "") = 0;
36 virtual void registerLastOpenedFilePath(FileType type, QString path) = 0;
37
38 virtual QString find(FileType type, QString location, QString lastKnownLocation = "") = 0;
39
40 static FileFinder *getInstance() { return m_instance; }
41
42 protected:
43 static void registerFileFinder(FileFinder *ff) { m_instance = ff; }
44 static FileFinder *m_instance;
45 };
46
47 #endif
48
49