00001 /****************************************************************************** 00002 * This file is part of the Gluon Development Platform 00003 * Copyright (C) 2009 Sacha Schutz <istdasklar@free.fr> 00004 * Copyright (C) 2009 Guillaume Martres <smarter@ubuntu.com> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 #ifndef GLUON_AUDIO_BUFFER_H 00021 #define GLUON_AUDIO_BUFFER_H 00022 00023 #include "gluon_audio_export.h" 00024 00025 #include <al.h> 00026 00027 #include <QtCore/QSharedDataPointer> 00028 00029 namespace GluonAudio 00030 { 00031 class GLUON_AUDIO_EXPORT Buffer 00032 { 00033 public: 00034 Buffer(); 00035 Buffer( const QString& fileName ); 00036 Buffer( ALuint buffer ); 00037 Buffer( const Buffer& other ); 00038 ~Buffer(); 00039 00040 void setBuffer( const QString& fileName ); 00041 void setBuffer( ALuint buffer, bool shared = false ); 00042 bool isEmpty() const; 00046 ALuint buffer() const; 00050 ALfloat duration() const; 00051 00052 protected: 00053 void init(); 00054 00055 private: 00056 class BufferPrivate; 00057 BufferPrivate* const d; 00058 }; 00059 } 00060 00061 #endif // GLUON_AUDIO_BUFFER_H