vumonitor/vumonitor.cc
/// Called when we know the name and description of the stream.
/// Invoke pa_stream_new, setup state and read callbacks, and
/// connect record.
///
Called when we know the name and description of the stream.
Invoke pa_stream_new, setup state and read callbacks, and
connect record.
Called when we know the name and description of the stream . Invoke pa_stream_new setup state and read callbacks and connect record .
void
VU_monitor::newstream( const pa_sink_info *psink )
{
    if (not psink) return;
    const pa_sample_spec &ss = psink->sample_spec;
    const pa_channel_map &cmap = psink->channel_map;
    m_device_name = psink->monitor_source_name;
    m_device_description = psink->description;
    LOG_INFO(Lgr) << "Source name: " << m_device_name;
    LOG_INFO(Lgr) << "Device description: " << m_device_description;
    pa_sample_spec spec { PA_SAMPLE_FLOAT32, ss.rate, ss.channels };
    m_stream = pa_stream_new( m_context, AppName, &spec, &cmap);
    pa_stream_set_read_callback( m_stream, strr_cb, this);
    pa_stream_set_state_callback( m_stream, strs_cb, this);
    pa_stream_connect_record( m_stream, m_device_name.c_str(),
                               NULL, (enum pa_stream_flags) 0);
}
void VU_monitor :: newstream ( const pa_sink_info * psink ) { if ( not psink ) return ; const pa_sample_spec & ss = psink -> sample_spec ; const pa_channel_map & cmap = psink -> channel_map ; m_device_name = psink -> monitor_source_name ; m_device_description = psink -> description ; LOG_INFO ( Lgr ) << " " << m_device_name ; LOG_INFO ( Lgr ) << " " << m_device_description ; pa_sample_spec spec { PA_SAMPLE_FLOAT32 , ss . rate , ss . channels } ; m_stream = pa_stream_new ( m_context , AppName , & spec , & cmap ) ; pa_stream_set_read_callback ( m_stream , strr_cb , this ) ; pa_stream_set_state_callback ( m_stream , strs_cb , this ) ; pa_stream_connect_record ( m_stream , m_device_name . c_str ( ) , NULL , ( enum pa_stream_flags ) 0 ) ; }
Called when we know the name and description of the stream.
Called when we know the name and description of the stream .
/*attr*/