Mercurial > hg > easaier-soundaccess
annotate data/fileio/FileFinder.h @ 282:d9319859a4cf tip
(none)
author | benoitrigolleau |
---|---|
date | Fri, 31 Oct 2008 11:00:24 +0000 |
parents | 56885a8ca197 |
children |
rev | line source |
---|---|
lbajardsilogic@0 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
lbajardsilogic@0 | 2 |
lbajardsilogic@0 | 3 /* |
lbajardsilogic@0 | 4 Sonic Visualiser |
lbajardsilogic@0 | 5 An audio file viewer and annotation editor. |
lbajardsilogic@0 | 6 Centre for Digital Music, Queen Mary, University of London. |
lbajardsilogic@0 | 7 This file copyright 2007 QMUL. |
lbajardsilogic@0 | 8 |
lbajardsilogic@0 | 9 This program is free software; you can redistribute it and/or |
lbajardsilogic@0 | 10 modify it under the terms of the GNU General Public License as |
lbajardsilogic@0 | 11 published by the Free Software Foundation; either version 2 of the |
lbajardsilogic@0 | 12 License, or (at your option) any later version. See the file |
lbajardsilogic@0 | 13 COPYING included with this distribution for more information. |
lbajardsilogic@0 | 14 */ |
lbajardsilogic@0 | 15 |
lbajardsilogic@0 | 16 #ifndef _FILE_FINDER_H_ |
lbajardsilogic@0 | 17 #define _FILE_FINDER_H_ |
lbajardsilogic@0 | 18 |
lbajardsilogic@0 | 19 #include <QString> |
lbajardsilogic@0 | 20 #include <QObject> |
ivand_qmul@119 | 21 // Ivan Damnjanovic Sept 2007 added VideoFile into class FileFinder |
lbajardsilogic@0 | 22 class FileFinder : public QObject |
lbajardsilogic@0 | 23 { |
lbajardsilogic@0 | 24 Q_OBJECT |
lbajardsilogic@0 | 25 |
lbajardsilogic@0 | 26 public: |
lbajardsilogic@0 | 27 virtual ~FileFinder(); |
lbajardsilogic@0 | 28 |
lbajardsilogic@0 | 29 enum FileType { |
lbajardsilogic@0 | 30 SessionFile, |
lbajardsilogic@0 | 31 AudioFile, |
ivand_qmul@119 | 32 VideoFile, |
lbajardsilogic@0 | 33 LayerFile, |
lbajardsilogic@0 | 34 SessionOrAudioFile, |
lbajardsilogic@0 | 35 ImageFile, |
lbajardsilogic@0 | 36 AnyFile |
lbajardsilogic@0 | 37 }; |
lbajardsilogic@0 | 38 |
lbajardsilogic@0 | 39 QString getOpenFileName(FileType type, QString fallbackLocation = ""); |
lbajardsilogic@0 | 40 QString getSaveFileName(FileType type, QString fallbackLocation = ""); |
lbajardsilogic@0 | 41 void registerLastOpenedFilePath(FileType type, QString path); |
lbajardsilogic@0 | 42 |
lbajardsilogic@0 | 43 QString find(FileType type, QString location, QString lastKnownLocation = ""); |
lbajardsilogic@0 | 44 |
lbajardsilogic@0 | 45 static FileFinder *getInstance(); |
lbajardsilogic@0 | 46 |
lbajardsilogic@0 | 47 protected: |
lbajardsilogic@0 | 48 FileFinder(); |
lbajardsilogic@0 | 49 static FileFinder *m_instance; |
lbajardsilogic@0 | 50 |
lbajardsilogic@0 | 51 QString findRelative(QString location, QString relativeTo); |
lbajardsilogic@0 | 52 QString locateInteractive(FileType type, QString thing); |
lbajardsilogic@0 | 53 |
lbajardsilogic@0 | 54 QString m_lastLocatedLocation; |
lbajardsilogic@0 | 55 }; |
lbajardsilogic@0 | 56 |
lbajardsilogic@0 | 57 #endif |
lbajardsilogic@0 | 58 |