kwave  18.07.70
Kwave::RecordParams Class Reference

#include <RecordParams.h>

Collaboration diagram for Kwave::RecordParams:
Collaboration graph

Public Member Functions

 RecordParams ()
 
virtual ~RecordParams ()
 
virtual int fromList (const QStringList &list)
 
virtual QStringList toList () const
 

Public Attributes

Kwave::record_method_t method
 
bool pre_record_enabled
 
unsigned int pre_record_time
 
bool record_time_limited
 
unsigned int record_time
 
bool start_time_enabled
 
QDateTime start_time
 
bool record_trigger_enabled
 
unsigned int record_trigger
 
bool amplification_enabled
 
int amplification
 
bool agc_enabled
 
unsigned int agc_decay
 
bool fade_in_enabled
 
unsigned int fade_in_time
 
bool fade_out_enabled
 
unsigned int fade_out_time
 
QString device_name
 
unsigned int tracks
 
double sample_rate
 
Kwave::Compression::Type compression
 
unsigned int bits_per_sample
 
Kwave::SampleFormat::Format sample_format
 
unsigned int buffer_count
 
unsigned int buffer_size
 

Detailed Description

Definition at line 54 of file RecordParams.h.

Constructor & Destructor Documentation

◆ RecordParams()

Kwave::RecordParams::RecordParams ( )

Constructor, initializes everything with defaults

Definition at line 26 of file RecordParams.cpp.

29  record_time_limited(false), record_time(5*60),
30  start_time_enabled(false), start_time(QDateTime::currentDateTime()),
33  agc_enabled(false), agc_decay(50),
34  fade_in_enabled(false), fade_in_time(5),
36  device_name(_("plug:dsnoop")),
37  tracks(2),
38  sample_rate(44100.0),
40  bits_per_sample(16),
42  buffer_count(32),
43  buffer_size(13) /* (1 << 13) == 8192 bytes */
44 {
45 }
unsigned int bits_per_sample
Definition: RecordParams.h:105
unsigned int fade_in_time
Definition: RecordParams.h:96
unsigned int pre_record_time
Definition: RecordParams.h:78
unsigned int fade_out_time
Definition: RecordParams.h:99
unsigned int record_time
Definition: RecordParams.h:81
unsigned int record_trigger
Definition: RecordParams.h:87
unsigned int tracks
Definition: RecordParams.h:102
unsigned int agc_decay
Definition: RecordParams.h:93
Kwave::SampleFormat::Format sample_format
Definition: RecordParams.h:106
#define _(m)
Definition: memcpy.c:66
QDateTime start_time
Definition: RecordParams.h:84
Kwave::record_method_t method
Definition: RecordParams.h:75
Kwave::Compression::Type compression
Definition: RecordParams.h:104
unsigned int buffer_count
Definition: RecordParams.h:108
unsigned int buffer_size
Definition: RecordParams.h:109

◆ ~RecordParams()

Kwave::RecordParams::~RecordParams ( )
virtual

Destructor

Definition at line 48 of file RecordParams.cpp.

49 {
50 }

Member Function Documentation

◆ fromList()

int Kwave::RecordParams::fromList ( const QStringList &  list)
virtual

Parse from a QStringList

Parameters
listthe QStringList to parse
Returns
zero or -EINVAL if failed

Definition at line 58 of file RecordParams.cpp.

References bits_per_sample, buffer_count, buffer_size, compression, device_name, Kwave::SampleFormat::fromInt(), Kwave::Compression::fromInt(), GET, method, pre_record_enabled, pre_record_time, Kwave::RECORD_INVALID, record_time, record_time_limited, record_trigger, record_trigger_enabled, sample_format, sample_rate, start_time, start_time_enabled, Kwave::toInt(), and tracks.

Referenced by Kwave::RecordDialog::RecordDialog().

59 {
60  bool ok;
61  int index = 0;
62 
63  // check number of elements
64  if (list.count() != 17) return -EINVAL;
65 
66  // recording method
67  unsigned int method_index;
68  GET(method_index, toUInt);
69  method = (method_index < Kwave::RECORD_INVALID) ?
70  static_cast<Kwave::record_method_t>(method_index) :
72 
73  // pre-record
74  GET(pre_record_enabled, toUInt);
75  GET(pre_record_time, toUInt);
76 
77  // record time
78  GET(record_time_limited, toUInt);
79  GET(record_time, toUInt);
80 
81  // record start time
82  GET(start_time_enabled, toUInt);
83  start_time = QDateTime::fromString(list[index++], Qt::ISODate);
84 
85  // auto-adjust to same hour as last time but not in past
86  if (start_time.date() < QDate::currentDate())
87  start_time.setDate(QDate::currentDate());
88  if (start_time < QDateTime::currentDateTime())
89  start_time = start_time.addDays(1);
90  // set seconds to zero
91  QTime t = start_time.time();
92  t.setHMS(t.hour(), t.minute(), 0, 0);
93  start_time.setTime(t);
94 
95  // record trigger
96  GET(record_trigger_enabled, toUInt);
97  GET(record_trigger, toUInt);
98 
99 // // amplification
100 // GET(amplification_enabled, toUInt);
101 // GET(amplification, toInt);
102 //
103 // // AGC
104 // GET(agc_enabled, toUInt);
105 // GET(agc_decay, toUInt);
106 //
107 // // fade in
108 // GET(fade_in_enabled, toUInt);
109 // GET(fade_in_time, toUInt);
110 //
111 // // fade out
112 // GET(fade_out_enabled, toUInt);
113 // GET(fade_out_time, toUInt);
114 
115  // device name
116  device_name = list[index++];
117 
118  // tracks, sample rate, compression, sample format, bits per sample
119  GET(tracks, toUInt);
120  GET(sample_rate, toDouble);
121  int ct;
122  GET(ct, toInt);
124  GET(bits_per_sample, toUInt);
125 
126  int sf;
127  GET(sf, toInt);
129 
130  // buffer count and power of buffer size
131  GET(buffer_count, toUInt);
132  GET(buffer_size, toUInt);
133 
134  return 0;
135 }
unsigned int bits_per_sample
Definition: RecordParams.h:105
#define GET(value, func)
static Kwave::Compression::Type fromInt(int i)
Definition: Compression.cpp:78
unsigned int pre_record_time
Definition: RecordParams.h:78
unsigned int record_time
Definition: RecordParams.h:81
unsigned int record_trigger
Definition: RecordParams.h:87
int toInt(T x)
Definition: Utils.h:127
unsigned int tracks
Definition: RecordParams.h:102
Kwave::SampleFormat::Format sample_format
Definition: RecordParams.h:106
QDateTime start_time
Definition: RecordParams.h:84
Kwave::record_method_t method
Definition: RecordParams.h:75
Kwave::Compression::Type compression
Definition: RecordParams.h:104
unsigned int buffer_count
Definition: RecordParams.h:108
unsigned int buffer_size
Definition: RecordParams.h:109
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toList()

QStringList Kwave::RecordParams::toList ( ) const
virtual

Parse into a QStringList

Definition at line 140 of file RecordParams.cpp.

References bits_per_sample, buffer_count, buffer_size, compression, device_name, method, pre_record_enabled, pre_record_time, PUT, record_time, record_time_limited, record_trigger, record_trigger_enabled, sample_format, sample_rate, start_time, start_time_enabled, Kwave::toInt(), and tracks.

141 {
142  QStringList list;
143  QString param;
144 
145  // record method
146  PUT(static_cast<unsigned int>(method));
147 
148  // pre-record
151 
152  // record time
154  PUT(record_time);
155 
156  // start time
158  list += start_time.toString(Qt::ISODate);
159 
160  // record trigger
163 
164 // // amplification
165 // PUT(amplification_enabled);
166 // PUT(amplification);
167 //
168 // // AGC
169 // PUT(agc_enabled);
170 // PUT(agc_decay);
171 //
172 // // fade in
173 // PUT(fade_in_enabled);
174 // PUT(fade_in_time);
175 //
176 // // fade out
177 // PUT(fade_out_enabled);
178 // PUT(fade_out_time);
179 
180  // device name
181  list += device_name;
182 
183  // tracks, sample rate, compression, sample format, bits per sample
184  PUT(tracks);
185  PUT(sample_rate);
186  PUT(compression);
189 
190  // buffer count and power of buffer size
191  PUT(buffer_count);
192  PUT(buffer_size);
193 
194  return list;
195 }
unsigned int bits_per_sample
Definition: RecordParams.h:105
unsigned int pre_record_time
Definition: RecordParams.h:78
unsigned int record_time
Definition: RecordParams.h:81
unsigned int record_trigger
Definition: RecordParams.h:87
int toInt(T x)
Definition: Utils.h:127
unsigned int tracks
Definition: RecordParams.h:102
Kwave::SampleFormat::Format sample_format
Definition: RecordParams.h:106
#define PUT(value)
QDateTime start_time
Definition: RecordParams.h:84
Kwave::record_method_t method
Definition: RecordParams.h:75
Kwave::Compression::Type compression
Definition: RecordParams.h:104
unsigned int buffer_count
Definition: RecordParams.h:108
unsigned int buffer_size
Definition: RecordParams.h:109
Here is the call graph for this function:

Member Data Documentation

◆ agc_decay

unsigned int Kwave::RecordParams::agc_decay

agc: decay in milliseconds

Definition at line 93 of file RecordParams.h.

◆ agc_enabled

bool Kwave::RecordParams::agc_enabled

agc: feature enabled

Definition at line 92 of file RecordParams.h.

◆ amplification

int Kwave::RecordParams::amplification

amplification: value in decibel

Definition at line 90 of file RecordParams.h.

◆ amplification_enabled

bool Kwave::RecordParams::amplification_enabled

amplification: feature enabled

Definition at line 89 of file RecordParams.h.

◆ bits_per_sample

unsigned int Kwave::RecordParams::bits_per_sample

◆ buffer_count

◆ buffer_size

unsigned int Kwave::RecordParams::buffer_size

◆ compression

◆ device_name

◆ fade_in_enabled

bool Kwave::RecordParams::fade_in_enabled

fade in: feature enabled

Definition at line 95 of file RecordParams.h.

◆ fade_in_time

unsigned int Kwave::RecordParams::fade_in_time

fade in: time in milliseconds

Definition at line 96 of file RecordParams.h.

◆ fade_out_enabled

bool Kwave::RecordParams::fade_out_enabled

fade out: feature enabled

Definition at line 98 of file RecordParams.h.

◆ fade_out_time

unsigned int Kwave::RecordParams::fade_out_time

fade out: time in milliseconds

Definition at line 99 of file RecordParams.h.

◆ method

Kwave::record_method_t Kwave::RecordParams::method

◆ pre_record_enabled

bool Kwave::RecordParams::pre_record_enabled

method/class for recording pre-record: feature enabled

Definition at line 77 of file RecordParams.h.

Referenced by fromList(), Kwave::RecordDialog::preRecordingChecked(), Kwave::RecordPlugin::setupRecordThread(), and toList().

◆ pre_record_time

unsigned int Kwave::RecordParams::pre_record_time

pre-record: time in seconds

Definition at line 78 of file RecordParams.h.

Referenced by fromList(), Kwave::RecordDialog::preRecordingTimeChanged(), Kwave::RecordPlugin::setupRecordThread(), and toList().

◆ record_time

unsigned int Kwave::RecordParams::record_time

◆ record_time_limited

bool Kwave::RecordParams::record_time_limited

◆ record_trigger

unsigned int Kwave::RecordParams::record_trigger

record trigger level in percent

Definition at line 87 of file RecordParams.h.

Referenced by Kwave::RecordPlugin::checkTrigger(), fromList(), toList(), and Kwave::RecordDialog::triggerChanged().

◆ record_trigger_enabled

bool Kwave::RecordParams::record_trigger_enabled

◆ sample_format

◆ sample_rate

◆ start_time

QDateTime Kwave::RecordParams::start_time

◆ start_time_enabled

◆ tracks


The documentation for this class was generated from the following files: