Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/soundsourcecoreaudio.h

Go to the documentation of this file.
00001 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef SOUNDSOURCECOREAUDIO_H
00020 #define SOUNDSOURCECOREAUDIO_H
00021 
00022 #include <QFile>
00023 #include <QString>
00024 #include <AudioToolbox/AudioToolbox.h>
00025 //In our tree at lib/apple/
00026 #include "CAStreamBasicDescription.h" 
00027 
00028 #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
00029 #include <CoreServices/CoreServices.h>
00030 #include <CoreAudio/CoreAudioTypes.h>
00031 #include <AudioToolbox/AudioFile.h>
00032 #include <AudioToolbox/AudioFormat.h>
00033 #else
00034 #include "CoreAudioTypes.h"
00035 #include "AudioFile.h"
00036 #include "AudioFormat.h"
00037 #endif
00038 
00039 #include <vector>
00040 #include <fcntl.h>
00041 
00042 #include "defs.h"
00043 #include "soundsource.h"
00044 
00045 class SoundSourceCoreAudio : public Mixxx::SoundSource {
00046 public:
00047     SoundSourceCoreAudio(QString filename);
00048     ~SoundSourceCoreAudio();
00049     int open();
00050     long seek(long filepos);
00051     unsigned read(unsigned long size, const SAMPLE *buffer);
00052     inline long unsigned length();
00053     int parseHeader();
00054     static QList<QString> supportedFileExtensions();
00055 private:
00056     QFile m_file;
00057     unsigned int m_samples; // total number of samples
00058     SInt64 m_headerFrames;
00059     ExtAudioFileRef m_audioFile;
00060     CAStreamBasicDescription m_clientFormat;
00061     CAStreamBasicDescription m_inputFormat;
00062 };
00063 
00064 
00065 #endif // ifndef SOUNDSOURCECOREAUDIO_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines