Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AudioRecorderForQt Class Reference

#include <audiorecorderforqt.h>

+ Inheritance diagram for AudioRecorderForQt:
+ Collaboration diagram for AudioRecorderForQt:

Public Slots

void onReadPacket ()
 

Public Member Functions

 AudioRecorderForQt (QObject *parent)
 
virtual ~AudioRecorderForQt ()
 
void init () override
 Inizialize the audio device. More...
 
void exit () override
 Destroy the audio device. More...
 
void start () override
 Start/restart the audio device. More...
 
void stop () override
 Stop the audio device. More...
 
virtual void setDeviceInputGain (double volume) overridefinal
 
virtual double getDeviceInputGain () const overridefinal
 
- Public Member Functions inherited from AudioRecorderAdapter
 AudioRecorderAdapter ()
 Constructor. More...
 
virtual ~AudioRecorderAdapter ()
 Empty destructor. More...
 
void resetInputLevelControl ()
 Reset input level control. More...
 
void setMuted (bool muted)
 Set and reset the muting flag. More...
 
void readAll (PacketType &packet)
 Read all data from the internal buffer. More...
 
void cutSilence (PacketType &packet)
 Cut trailing silence. More...
 
double getStopLevel () const
 
void setStandby (bool flag)
 
void setWaitingFlag (bool flag)
 
StroboscopegetStroboscope ()
 
- Public Member Functions inherited from AudioBase
 AudioBase ()
 Constructor. More...
 
virtual ~AudioBase ()
 Destructor (no functionality). More...
 
const std::string & getDeviceName () const
 Get a readable string of the name of the audio device. More...
 
void setDeviceName (const std::string &n)
 Set the device name. More...
 
int getSamplingRate () const
 Get the actual sampling rate. More...
 
int getChannelCount () const
 Get the actual number of channels (1=mono, 2=stereo). More...
 
virtual void setChannelCount (int cnt)
 Set the number of channels (1=mono, 2=stereo). More...
 

Private Types

typedef int16_t DataFormat
 Data format of the input/output stream. More...
 

Private Attributes

QAudioInput * mAudioInput
 
QIODevice * mIODevice
 
QTimer mReadTimer
 

Static Private Attributes

static const DataFormat SIGNAL_SCALING = std::numeric_limits<AudioRecorderForQt::DataFormat>::max()
 maximal alloed value of the stream More...
 

Additional Inherited Members

- Public Types inherited from AudioBase
typedef double PCMDataType
 
typedef std::vector< PCMDataTypePacketType
 Type definition of a PCM packet (vector of PCM values). More...
 
- Static Public Attributes inherited from AudioRecorderAdapter
static const int BUFFER_SIZE_IN_SECONDS = 2
 Capacity of the local circular audio buffer in seconds. More...
 
static const int UPDATE_IN_MILLISECONDS = 50
 Update interval in milliseconds, defining the packet size. More...
 
static const double ATTACKRATE = 0.97
 Attack rate at which the sliding level goes up (1=instantly). More...
 
static const double DECAYRATE = 0.7
 Decay rate at which the sliding level goes down. More...
 
static const double LEVEL_RETRIGGER = 0.3
 Level below which retriggering (restart) is allowed. More...
 
static const double LEVEL_TRIGGER = 0.48
 Level above which the recorder starts to operate. More...
 
static const double LEVEL_CUTOFF = 0.9
 Level above which the input mGain is automatically reduced. More...
 
static const double DB_OFF = 2
 dB shift for off mark (high value = shorter recording) More...
 
- Protected Member Functions inherited from AudioRecorderAdapter
void pushRawData (const PacketType &data)
 The implementation calls this function when new data is available. More...
 
void setSamplingRate (int rate) override
 

Detailed Description

Definition at line 28 of file audiorecorderforqt.h.

Member Typedef Documentation

typedef int16_t AudioRecorderForQt::DataFormat
private

Data format of the input/output stream.

Definition at line 40 of file audiorecorderforqt.h.

Constructor & Destructor Documentation

AudioRecorderForQt::AudioRecorderForQt ( QObject *  parent)

Definition at line 31 of file audiorecorderforqt.cpp.

+ Here is the call graph for this function:

AudioRecorderForQt::~AudioRecorderForQt ( )
virtual

Definition at line 40 of file audiorecorderforqt.cpp.

Member Function Documentation

void AudioRecorderForQt::exit ( )
overridevirtual

Destroy the audio device.

Implements AudioBase.

Definition at line 107 of file audiorecorderforqt.cpp.

double AudioRecorderForQt::getDeviceInputGain ( ) const
finaloverridevirtual

Implements AudioRecorderAdapter.

Definition at line 152 of file audiorecorderforqt.cpp.

void AudioRecorderForQt::init ( )
overridevirtual

Inizialize the audio device.

Implements AudioBase.

Definition at line 45 of file audiorecorderforqt.cpp.

+ Here is the call graph for this function:

void AudioRecorderForQt::onReadPacket ( )
slot

Definition at line 159 of file audiorecorderforqt.cpp.

+ Here is the call graph for this function:

void AudioRecorderForQt::setDeviceInputGain ( double  volume)
finaloverridevirtual

Implements AudioRecorderAdapter.

Definition at line 146 of file audiorecorderforqt.cpp.

void AudioRecorderForQt::start ( )
overridevirtual

Start/restart the audio device.

Implements AudioBase.

Definition at line 122 of file audiorecorderforqt.cpp.

void AudioRecorderForQt::stop ( )
overridevirtual

Stop the audio device.

Implements AudioBase.

Definition at line 135 of file audiorecorderforqt.cpp.

Member Data Documentation

QAudioInput* AudioRecorderForQt::mAudioInput
private

Definition at line 60 of file audiorecorderforqt.h.

QIODevice* AudioRecorderForQt::mIODevice
private

Definition at line 61 of file audiorecorderforqt.h.

QTimer AudioRecorderForQt::mReadTimer
private

Definition at line 62 of file audiorecorderforqt.h.

const AudioRecorderForQt::DataFormat AudioRecorderForQt::SIGNAL_SCALING = std::numeric_limits<AudioRecorderForQt::DataFormat>::max()
staticprivate

maximal alloed value of the stream

Definition at line 42 of file audiorecorderforqt.h.


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