Skip to content
Snippets Groups Projects
Commit b1a9caed authored by Adrien Béraud's avatar Adrien Béraud
Browse files

code cleanup

parent 9512177e
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ AudioStream::stream_state_callback(pa_stream* s, void* /*user_data*/) ...@@ -136,7 +136,7 @@ AudioStream::stream_state_callback(pa_stream* s, void* /*user_data*/)
case PA_STREAM_FAILED: case PA_STREAM_FAILED:
default: default:
ERROR("Sink/Source doesn't exists: %s %s" , pa_strerror(pa_context_errno(pa_stream_get_context(s))), pa_stream_get_device_name(s)); ERROR("Sink/Source doesn't exists: %s" , pa_strerror(pa_context_errno(pa_stream_get_context(s))));
break; break;
} }
} }
......
...@@ -55,9 +55,6 @@ class AudioStream { ...@@ -55,9 +55,6 @@ class AudioStream {
* @param types * @param types
* @param audio sampling rate * @param audio sampling rate
* @param pointer to pa_source_info or pa_sink_info (depending on type). * @param pointer to pa_source_info or pa_sink_info (depending on type).
*
* //@param channel number
* //@param device name
*/ */
AudioStream(pa_context *, pa_threaded_mainloop *, const char *, int, unsigned, const PaDeviceInfos*); AudioStream(pa_context *, pa_threaded_mainloop *, const char *, int, unsigned, const PaDeviceInfos*);
......
...@@ -242,20 +242,6 @@ const PaDeviceInfos* PulseLayer::getDeviceInfos(const std::vector<PaDeviceInfos> ...@@ -242,20 +242,6 @@ const PaDeviceInfos* PulseLayer::getDeviceInfos(const std::vector<PaDeviceInfos>
if(dev_info == list.end()) return NULL; if(dev_info == list.end()) return NULL;
return &(*dev_info); return &(*dev_info);
} }
/*
const PaDeviceInfos* PulseLayer::getCaptureDevice(const std::string& name) const
{
std::vector<PaEndpointInfos>::const_iterator dev_info = std::find_if(sourceList_.begin(), sourceList_.end(), PaEndpointInfos::nameComparator(name));
if(dev_info == sourceList_.end()) return NULL;
return &(*dev_info);
}
const PaDeviceInfos* PulseLayer::getPlaybackDevice(const std::string& name) const
{
std::vector<PaEndpointInfos>::const_iterator dev_info = std::find_if(sinkList_.begin(), sinkList_.end(), PaEndpointInfos::nameComparator(name));
if(dev_info == sinkList_.end()) return NULL;
return &(*dev_info);
}*/
std::string PulseLayer::getAudioDeviceName(int index, PCMType type) const std::string PulseLayer::getAudioDeviceName(int index, PCMType type) const
{ {
...@@ -474,9 +460,8 @@ void PulseLayer::readFromMic() ...@@ -474,9 +460,8 @@ void PulseLayer::readFromMic()
const char *data = NULL; const char *data = NULL;
size_t bytes; size_t bytes;
//const pa_sample_spec * sample_spec = record_->sampleSpec(); size_t sample_size = record_->sampleSize();
size_t sample_size = record_->sampleSize(); //pa_sample_size(sample_spec); uint8_t channels = record_->channels();
uint8_t channels = record_->channels(); //sample_spec->channels;
if (pa_stream_peek(record_->pulseStream() , (const void**) &data , &bytes) < 0 or !data) if (pa_stream_peek(record_->pulseStream() , (const void**) &data , &bytes) < 0 or !data)
return; return;
...@@ -515,7 +500,6 @@ void PulseLayer::readFromMic() ...@@ -515,7 +500,6 @@ void PulseLayer::readFromMic()
dcblocker_.process(*out); dcblocker_.process(*out);
out->applyGain(getCaptureGain()); out->applyGain(getCaptureGain());
//applyGain(mic_buffer_, bytes / sizeof(SFLAudioSample), getCaptureGain());
Manager::instance().getMainBuffer().putData(*out, MainBuffer::DEFAULT_ID); Manager::instance().getMainBuffer().putData(*out, MainBuffer::DEFAULT_ID);
#ifdef RECTODISK #ifdef RECTODISK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment