Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Digital Signal Processing Engine Library
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
DSPE
Digital Signal Processing Engine Library
Commits
e41072dc
Commit
e41072dc
authored
3 years ago
by
Damian Karaś
Browse files
Options
Downloads
Patches
Plain Diff
ALSA_support: corrected comments in header file
Signed-off-by:
Damian Karaś
<
s176030@student.pg.edu.pl
>
parent
b1b0acdd
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/include/ALSA_support.h
+22
-14
22 additions, 14 deletions
src/include/ALSA_support.h
with
22 additions
and
14 deletions
src/include/ALSA_support.h
+
22
−
14
View file @
e41072dc
...
@@ -45,7 +45,8 @@ namespace DSP {
...
@@ -45,7 +45,8 @@ namespace DSP {
//! number of bytes in channel
//! number of bytes in channel
unsigned
int
no_of_bytes_in_channel
;
unsigned
int
no_of_bytes_in_channel
;
/*! It is better to use STD containers - they are more convenient,
/*!
It is better to use STD containers - they are more convenient,
and they mean fewer problems with memory leaks.
and they mean fewer problems with memory leaks.
*/
*/
//! outbuffers depending on samples type
//! outbuffers depending on samples type
...
@@ -58,28 +59,33 @@ namespace DSP {
...
@@ -58,28 +59,33 @@ namespace DSP {
//! inbuffer
//! inbuffer
std
::
vector
<
char
>
capture_buffer
;
std
::
vector
<
char
>
capture_buffer
;
//! samples
ar
e integer
s rather than
float
valu
es
//! samples
hav
e integer
values instead of
float
on
es
bool
IsHigherQualityMode
;
bool
IsHigherQualityMode
;
//! CPU architecture
//! CPU architecture
- endianness
bool
IsLittleEndian
;
bool
IsLittleEndian
;
//! Is PCM device openned for recording?
bool
IsDeviceInputOpen
;
bool
IsDeviceInputOpen
;
//! Is PCM device openned for playback?
bool
IsDeviceOutputOpen
;
bool
IsDeviceOutputOpen
;
//! Has playback already started?
//! Has playback already started?
bool
IsPlayingNow
;
bool
IsPlayingNow
;
//! Is playback stopped?
bool
StopPlayback
;
bool
StopPlayback
;
//! Has recording already started?
//! Has recording already started?
bool
StopRecording
;
bool
StopRecording
;
//! Has recording already started?
bool
IsRecordingNow
;
bool
IsRecordingNow
;
//!
just
samples
//!
audio inbuffer size in
samples
snd_pcm_uframes_t
audio_inbuffer_size_in_frames
;
snd_pcm_uframes_t
audio_inbuffer_size_in_frames
;
//! audio outbuffer size in samples
snd_pcm_uframes_t
audio_outbuffer_size_in_frames
;
snd_pcm_uframes_t
audio_outbuffer_size_in_frames
;
//!
T
ype of samples in WaveInBuffers
//!
t
ype of samples in WaveInBuffers
DSP
::
e
::
SampleType
InSampleTypeALSA
;
DSP
::
e
::
SampleType
InSampleTypeALSA
;
//! We always use the non-blocking mode in DSPElib
//! We always use the non-blocking mode in DSPElib
...
@@ -93,15 +99,13 @@ namespace DSP {
...
@@ -93,15 +99,13 @@ namespace DSP {
the rest of the parameters are set in the class
the rest of the parameters are set in the class
*/
*/
int
open_alsa_device
(
snd_pcm_stream_t
stream_type
);
int
open_alsa_device
(
snd_pcm_stream_t
stream_type
);
//! Close opened PCM device
void
close_alsa_device
(
bool
do_drain
=
false
,
bool
use_log
=
false
);
void
close_alsa_device
(
bool
do_drain
=
false
,
bool
use_log
=
false
);
void
get_period_size
(
snd_pcm_uframes_t
&
frames
,
unsigned
int
&
period_time
);
//
void get_period_size(snd_pcm_uframes_t &frames, unsigned int &period_time);
//! playback
//! playback
snd_pcm_sframes_t
pcm_writei
(
const
void
*
buffer
,
const
snd_pcm_uframes_t
&
frames
);
// M.B. this will be more transparent
snd_pcm_sframes_t
pcm_writei
(
const
void
*
buffer
,
const
snd_pcm_uframes_t
&
frames
);
// M.B. this will be more transparent
//! recording
//snd_pcm_sframes_t DSP::ALSA_object_t::pcm_readi(const void *buffer, const snd_pcm_uframes_t &frames)
//! Set SND PCM format depending on no of bytes in channel and CPU endianness
//! Set SND PCM format depending on no of bytes in channel and CPU endianness
int
set_snd_pcm_format
(
snd_pcm_hw_params_t
*
params
);
int
set_snd_pcm_format
(
snd_pcm_hw_params_t
*
params
);
...
@@ -111,16 +115,19 @@ namespace DSP {
...
@@ -111,16 +115,19 @@ namespace DSP {
//! Log basic ALSA information
//! Log basic ALSA information
void
log_driver_data
();
void
log_driver_data
();
//! Select the desired device from the interface
//! Select the desired device from the interface
for recording
unsigned
int
select_input_device_by_number
(
const
unsigned
int
&
device_number
=
UINT_MAX
);
unsigned
int
select_input_device_by_number
(
const
unsigned
int
&
device_number
=
UINT_MAX
);
//! Select the desired device from the interface for playback
unsigned
int
select_output_device_by_number
(
const
unsigned
int
&
device_number
=
UINT_MAX
);
unsigned
int
select_output_device_by_number
(
const
unsigned
int
&
device_number
=
UINT_MAX
);
//!
Deciding wheter
PCM device
is opening
for playback
or capture
//!
Open
PCM device for playback
long
open_PCM_device_4_output
(
const
int
&
no_of_channels
,
int
no_of_bits
,
const
long
&
sampling_rate
,
const
long
&
audio_outbuffer_size
=
-
1
);
long
open_PCM_device_4_output
(
const
int
&
no_of_channels
,
int
no_of_bits
,
const
long
&
sampling_rate
,
const
long
&
audio_outbuffer_size
=
-
1
);
//! Open PCM device for recording
long
open_PCM_device_4_input
(
const
int
&
no_of_channels
,
int
no_of_bits
,
const
long
&
sampling_rate
,
const
long
&
audio_inbuffer_size
=
-
1
);
long
open_PCM_device_4_input
(
const
int
&
no_of_channels
,
int
no_of_bits
,
const
long
&
sampling_rate
,
const
long
&
audio_inbuffer_size
=
-
1
);
//! Closes PCM device
//! Closes PCM device
from recording
bool
close_PCM_device_input
(
void
);
bool
close_PCM_device_input
(
void
);
//! Closes PCM device from playback
bool
close_PCM_device_output
(
const
bool
&
do_drain
);
bool
close_PCM_device_output
(
const
bool
&
do_drain
);
//! Returns true is the playback is on
//! Returns true is the playback is on
...
@@ -150,8 +157,9 @@ namespace DSP {
...
@@ -150,8 +157,9 @@ namespace DSP {
//! Returns false if callbacks are not supported of playback
//! Returns false if callbacks are not supported of playback
bool
is_output_callback_supported
(
void
);
bool
is_output_callback_supported
(
void
);
//! object
constructor and de
structor
//!
ALSA_
ob
c
ject
_t class con
structor
ALSA_object_t
();
ALSA_object_t
();
//! ALSA_obcject_t class destructor
~
ALSA_object_t
();
~
ALSA_object_t
();
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment