File: RecordParams.h

package info (click to toggle)
kwave 25.04.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 23,272 kB
  • sloc: cpp: 56,173; xml: 817; perl: 688; sh: 57; makefile: 11
file content (116 lines) | stat: -rw-r--r-- 4,681 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*************************************************************************
         RecordParams.h  -  holds parameters of the record plugin
                             -------------------
    begin                : Thu Sep 04 2003
    copyright            : (C) 2003 by Thomas Eschenbacher
    email                : Thomas.Eschenbacher@gmx.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef RECORD_PARAMS_H
#define RECORD_PARAMS_H

#include "config.h"

#include <QDateTime>
#include <QString>
#include <QStringList>

#include "libkwave/Compression.h"
#include "libkwave/SampleFormat.h"

namespace Kwave
{

    /**
     * enum for the known recording methods
     * (sorted, preferred first)
     */
    typedef enum {
        RECORD_NONE = 0,   /**< none selected */
        RECORD_JACK,       /**< Jack sound daemon */
        RECORD_QT,         /**< Qt Multimedia Audio */
        RECORD_PULSEAUDIO, /**< PulseAudio sound daemon */
        RECORD_ALSA,       /**< ALSA native */
        RECORD_OSS,        /**< OSS native or ALSA OSS emulation */
        RECORD_INVALID     /**< (keep this the last entry, EOL delimiter) */
    } record_method_t;

    /** post-increment operator for the record method */
    inline Kwave::record_method_t &operator ++(Kwave::record_method_t &m) {
        return (m = (m < Kwave::RECORD_INVALID) ?
                    static_cast<Kwave::record_method_t>(
                    static_cast<int>(m) + 1) : m);
    }

    class RecordParams
    {

    public:

        /** Constructor, initializes everything with defaults */
        RecordParams();

        /** Destructor */
        virtual ~RecordParams();

        /**
         * Parse from a QStringList
         * @param list the QStringList to parse
         * @return zero or -EINVAL if failed
         */
        virtual int fromList(const QStringList &list);

        /** Parse into a QStringList */
        virtual QStringList toList() const;

        Kwave::record_method_t method;  /** method/class for recording */

        bool pre_record_enabled;        /**< pre-record: feature enabled */
        unsigned int pre_record_time;   /**< pre-record: time in seconds */

        bool record_time_limited;       /**< record time: limited */
        unsigned int record_time;       /**< record time: limit in seconds */

        bool start_time_enabled;        /**< start time: feature enabled */
        QDateTime start_time;           /**< start time: date & time */

        bool record_trigger_enabled;    /**< record trigger: feature enabled */
        unsigned int record_trigger;    /**< record trigger level in percent */

        bool amplification_enabled;     /**< amplification: feature enabled */
        int amplification;              /**< amplification: value in decibel */

        bool agc_enabled;               /**< agc: feature enabled */
        unsigned int agc_decay;         /**< agc: decay in milliseconds */

        bool fade_in_enabled;           /**< fade in: feature enabled */
        unsigned int fade_in_time;      /**< fade in: time in milliseconds */

        bool fade_out_enabled;          /**< fade out: feature enabled */
        unsigned int fade_out_time;     /**< fade out: time in milliseconds */

        QString device_name;            /**< name of the input device */
        unsigned int tracks;            /**< number of tracks */
        double sample_rate;             /**< sample rate in samples/second */
        Kwave::Compression::Type compression; /**< compression type        */
        unsigned int bits_per_sample;   /**< resolution in bits per sample */
        Kwave::SampleFormat::Format sample_format;  /**< sample format */

        unsigned int buffer_count;      /**< number of buffers */
        unsigned int buffer_size;       /**< power of the record buffer size */
    };
}

#endif /* RECORD_PARAMS_H */

//***************************************************************************
//***************************************************************************