annotate data/fileio/CoreAudioFileReader.h @ 1184:e5a1d815f331 3.0-integration

Merge from the default branch
author Chris Cannam
date Thu, 21 Apr 2016 15:29:30 +0100
parents abc309f507ae
children ad5f892c0c4d
rev   line source
luisf@665 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
luisf@665 2
luisf@665 3 /*
luisf@665 4 Sonic Visualiser
luisf@665 5 An audio file viewer and annotation editor.
luisf@665 6 Centre for Digital Music, Queen Mary, University of London.
Chris@748 7 This file copyright 2006-2012 Chris Cannam and QMUL.
luisf@665 8
luisf@665 9 This program is free software; you can redistribute it and/or
luisf@665 10 modify it under the terms of the GNU General Public License as
luisf@665 11 published by the Free Software Foundation; either version 2 of the
luisf@665 12 License, or (at your option) any later version. See the file
luisf@665 13 COPYING included with this distribution for more information.
luisf@665 14 */
luisf@665 15
luisf@665 16 #ifndef _COREAUDIO_FILE_READER_H_
luisf@665 17 #define _COREAUDIO_FILE_READER_H_
luisf@665 18
luisf@665 19 #ifdef HAVE_COREAUDIO
luisf@665 20
luisf@665 21 #include "CodedAudioFileReader.h"
luisf@665 22
luisf@665 23 #include "base/Thread.h"
luisf@665 24
luisf@665 25 #include <set>
luisf@665 26
luisf@665 27 class ProgressReporter;
luisf@665 28
luisf@665 29 class CoreAudioFileReader : public CodedAudioFileReader
luisf@665 30 {
luisf@665 31 Q_OBJECT
luisf@665 32
luisf@665 33 public:
luisf@665 34 CoreAudioFileReader(FileSource source,
luisf@665 35 DecodeMode decodeMode,
luisf@665 36 CacheMode cacheMode,
Chris@1040 37 sv_samplerate_t targetRate = 0,
Chris@920 38 bool normalised = false,
Chris@1097 39 ProgressReporter *reporter = nullptr);
luisf@665 40 virtual ~CoreAudioFileReader();
luisf@665 41
luisf@665 42 virtual QString getError() const { return m_error; }
luisf@665 43 virtual QString getLocation() const { return m_source.getLocation(); }
luisf@665 44 virtual QString getTitle() const { return m_title; }
luisf@665 45
luisf@665 46 static void getSupportedExtensions(std::set<QString> &extensions);
luisf@665 47 static bool supportsExtension(QString ext);
luisf@665 48 static bool supportsContentType(QString type);
luisf@665 49 static bool supports(FileSource &source);
luisf@665 50
luisf@665 51 virtual int getDecodeCompletion() const { return m_completion; }
luisf@665 52
luisf@665 53 virtual bool isUpdating() const {
luisf@665 54 return m_decodeThread && m_decodeThread->isRunning();
luisf@665 55 }
luisf@665 56
luisf@665 57 public slots:
luisf@665 58 void cancelled();
luisf@665 59
luisf@665 60 protected:
luisf@665 61 FileSource m_source;
luisf@665 62 QString m_path;
luisf@665 63 QString m_error;
luisf@665 64 QString m_title;
luisf@665 65
luisf@665 66 class D;
luisf@665 67 D *m_d;
luisf@665 68
luisf@665 69 ProgressReporter *m_reporter;
luisf@665 70 bool m_cancelled;
luisf@665 71 int m_completion;
luisf@665 72
luisf@665 73 class DecodeThread : public Thread
luisf@665 74 {
luisf@665 75 public:
luisf@665 76 // DecodeThread(QuickTimeFileReader *reader) : m_reader(reader) { }
luisf@665 77 virtual void run();
luisf@665 78
luisf@665 79 protected:
luisf@665 80 // QuickTimeFileReader *m_reader;
luisf@665 81 };
luisf@665 82
luisf@665 83 DecodeThread *m_decodeThread;
luisf@665 84 };
luisf@665 85
luisf@665 86 #endif
luisf@665 87
luisf@665 88 #endif