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_CAPTURE_H 00021 #define GLUON_AUDIO_CAPTURE_H 00022 00023 #include "gluon_audio_export.h" 00024 00025 #include <QtCore/QObject> 00026 #include <QtCore/QStringList> 00027 00028 namespace GluonAudio 00029 { 00030 class GLUON_AUDIO_EXPORT Capture : public QObject 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 explicit Capture( QString deviceName = QString(), QObject* parent = 0 ); 00036 ~Capture(); 00037 00038 bool isAvailable() const; 00039 00040 static QStringList deviceList(); 00041 00042 void record( int duration = 1000 ); 00043 void save( const QString& fileName ); 00044 00045 private: 00046 Q_DISABLE_COPY( Capture ) 00047 00048 class CapturePrivate; 00049 CapturePrivate* const d; 00050 }; 00051 } 00052 00053 #endif // GLUON_AUDIO_CAPTURE_H