Skip to content
Snippets Groups Projects
Commit 10dadd02 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Change to static variables

parent 35a4aa42
No related branches found
No related tags found
No related merge requests found
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
#include "pulselayer.h" #include "pulselayer.h"
static pa_context *context = NULL; static pa_context *context = NULL;
static pa_stream* playback = NULL;
static pa_stream* record = NULL;
static pa_mainloop_api *mainloop_api = NULL; static pa_mainloop_api *mainloop_api = NULL;
static pa_sample_spec sample_spec; static pa_sample_spec sample_spec;
static pa_channel_map channel_map; static pa_channel_map channel_map;
PulseLayer::PulseLayer(ManagerImpl* manager) PulseLayer::PulseLayer(ManagerImpl* manager)
: AudioLayer( manager , PULSEAUDIO ) : AudioLayer( manager , PULSEAUDIO )
, playback( NULL )
, record( NULL )
{ {
_debug("Pulse audio constructor: Create context\n"); _debug("Pulse audio constructor: Create context\n");
create_context(); create_context();
...@@ -79,6 +79,10 @@ void ...@@ -79,6 +79,10 @@ void
PulseLayer::context_state_callback( pa_context* c, void* user_data ) PulseLayer::context_state_callback( pa_context* c, void* user_data )
{ {
_debug("The state of the context changed\n"); _debug("The state of the context changed\n");
sample_spec.format = PA_SAMPLE_S16LE;
sample_spec.channels = 1;
channel_map.channels = 1;
pa_stream_flags_t flag = PA_STREAM_START_CORKED ;
assert(c); assert(c);
switch(pa_context_get_state(c)){ switch(pa_context_get_state(c)){
case PA_CONTEXT_CONNECTING: case PA_CONTEXT_CONNECTING:
...@@ -121,11 +125,11 @@ PulseLayer::openDevice(int indexIn, int indexOut, int sampleRate, int frameSize ...@@ -121,11 +125,11 @@ PulseLayer::openDevice(int indexIn, int indexOut, int sampleRate, int frameSize
_sampleRate = sampleRate; _sampleRate = sampleRate;
_frameSize = frameSize; _frameSize = frameSize;
sample_spec.rate = sampleRate; //sample_spec.rate = sampleRate;
sample_spec.format = PA_SAMPLE_S16LE; //sample_spec.format = PA_SAMPLE_S16LE;
sample_spec.channels = 1; //sample_spec.channels = 1;
channel_map.channels = 1; //channel_map.channels = 1;
pa_stream_flags_t flag = PA_STREAM_START_CORKED ; //pa_stream_flags_t flag = PA_STREAM_START_CORKED ;
_debug(" Setting PulseLayer: device in=%2d, out=%2d\n", indexIn, indexOut); _debug(" Setting PulseLayer: device in=%2d, out=%2d\n", indexIn, indexOut);
_debug(" : nb channel in=%2d, out=%2d\n", _inChannel, _outChannel); _debug(" : nb channel in=%2d, out=%2d\n", _inChannel, _outChannel);
......
...@@ -130,8 +130,8 @@ class PulseLayer : public AudioLayer { ...@@ -130,8 +130,8 @@ class PulseLayer : public AudioLayer {
void create_context( void ); void create_context( void );
pa_stream* playback; //pa_stream* playback;
pa_stream* record; //pa_stream* record;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment