File: capturedevicecontroller.h

package info (click to toggle)
artikulate 4%3A25.04.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,936 kB
  • sloc: cpp: 11,286; xml: 3,163; makefile: 5; sh: 5
file content (68 lines) | stat: -rw-r--r-- 1,475 bytes parent folder | download | duplicates (2)
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