Chris@378: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@378: Chris@378: /* Chris@378: Sonic Visualiser Chris@378: An audio file viewer and annotation editor. Chris@378: Centre for Digital Music, Queen Mary, University of London. Chris@378: This file copyright 2007 QMUL. Chris@378: Chris@378: This program is free software; you can redistribute it and/or Chris@378: modify it under the terms of the GNU General Public License as Chris@378: published by the Free Software Foundation; either version 2 of the Chris@378: License, or (at your option) any later version. See the file Chris@378: COPYING included with this distribution for more information. Chris@378: */ Chris@378: Chris@378: #ifndef _FILE_FINDER_H_ Chris@378: #define _FILE_FINDER_H_ Chris@378: Chris@378: #include Chris@378: #include Chris@378: Chris@378: class FileFinder : public QObject Chris@378: { Chris@378: Q_OBJECT Chris@378: Chris@378: public: Chris@378: virtual ~FileFinder(); Chris@378: Chris@378: enum FileType { Chris@378: SessionFile, Chris@378: AudioFile, Chris@378: LayerFile, Chris@378: LayerFileNoMidi, Chris@378: SessionOrAudioFile, Chris@378: ImageFile, Chris@378: AnyFile Chris@378: }; Chris@378: Chris@378: QString getOpenFileName(FileType type, QString fallbackLocation = ""); Chris@378: QString getSaveFileName(FileType type, QString fallbackLocation = ""); Chris@378: void registerLastOpenedFilePath(FileType type, QString path); Chris@378: Chris@378: QString find(FileType type, QString location, QString lastKnownLocation = ""); Chris@378: Chris@378: static FileFinder *getInstance(); Chris@378: Chris@378: protected: Chris@378: FileFinder(); Chris@378: static FileFinder *m_instance; Chris@378: Chris@378: QString findRelative(QString location, QString relativeTo); Chris@378: QString locateInteractive(FileType type, QString thing); Chris@378: Chris@378: QString m_lastLocatedLocation; Chris@378: }; Chris@378: Chris@378: #endif Chris@378: