1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/*
SPDX-FileCopyrightText: 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef CAPTUREDEVICECONTROLLER_H
#define CAPTUREDEVICECONTROLLER_H
#include "libsound_export.h"
#include <QObject>
#include <memory>
class CaptureDeviceControllerPrivate;
/**
* \class CaptureDeviceController
*
* This singleton class provides a controller for the sound capture device.
*/
class LIBSOUND_EXPORT CaptureDeviceController : public QObject
{
Q_OBJECT
public:
enum State { StoppedState, RecordingState, PausedState };
/**
* Returns self reference to the controller. First call of this method initializes
* capture device controller.
*
* \return self reference
*/
static CaptureDeviceController &self();
void startCapture(const QString &filePath);
CaptureDeviceController::State state() const;
void stopCapture();
void setDevice(const QString &deviceIdentifier);
/**
* \return list of available capture devices
*/
QList<QString> devices() const;
public Q_SLOTS:
Q_SIGNALS:
void captureStarted();
void captureStopped();
private:
Q_DISABLE_COPY(CaptureDeviceController)
/**
* \internal
* Private constructor, \ref self().
*/
CaptureDeviceController();
/**
* Private destructor.
*/
~CaptureDeviceController() override;
const std::unique_ptr<CaptureDeviceControllerPrivate> d;
};
#endif
|