Mixxx

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

Go to the documentation of this file.
00001 /***************************************************************************
00002                           soundsourceproxy.h  -  description
00003                              -------------------
00004     begin                : Wed Oct 13 2004
00005     copyright            : (C) 2004 by Tue Haste Andersen
00006     email                :
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SOUNDSOURCEPROXY_H
00019 #define SOUNDSOURCEPROXY_H
00020 
00021 #include <QMap>
00022 #include <QMutex>
00023 #include <QString>
00024 #include <QLibrary>
00025 #include <QRegExp>
00026 
00027 #include "soundsource.h"
00028 #include "trackinfoobject.h"
00029 
00030 class QLibrary;
00031 
00037 /*
00038   Base class for sound sources.
00039 */
00040 class SoundSourceProxy : public Mixxx::SoundSource
00041 {
00042 public:
00043     SoundSourceProxy(QString qFilename);
00044     SoundSourceProxy(TrackPointer pTrack);
00045     ~SoundSourceProxy();
00046     static void loadPlugins();
00047     int open();
00048     long seek(long);
00049     unsigned read(unsigned long size, const SAMPLE*);
00050     long unsigned length();
00051     int parseHeader();
00052     static int ParseHeader(TrackInfoObject* p);
00053     unsigned int getSampleRate();
00055     QString getFilename();
00056     static QStringList supportedFileExtensions();
00057     static QStringList supportedFileExtensionsByPlugins();
00058     static QString supportedFileExtensionsString();
00059     static QString supportedFileExtensionsRegex();
00060     static bool isFilenameSupported(QString filename);
00061 private:
00062     static SoundSource* initialize(QString qFilename);
00063     //void initPlugin(QString lib_filename, QString track_filename);
00064     static QLibrary* getPlugin(QString lib_filename);
00065 
00066     SoundSource *m_pSoundSource;
00067     TrackPointer m_pTrack;
00068 
00069     static QRegExp m_supportedFileRegex;
00070     static QMap<QString, QLibrary*> m_plugins;
00071     static QMap<QString, getSoundSourceFunc> m_extensionsSupportedByPlugins;
00072     static QMutex m_extensionsMutex;
00073 };
00074 
00075 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines