21 #include "audio_capture_manager.h"
22 #include "audio_converter.h"
23 #include "socket_adaptor.h"
36 typedef void (*request_complete_callback_t)(
void *data, std::string &file,
int result);
44 } preferred_delivery_method_t;
47 typedef int request_id_t;
53 unsigned int time_remaining;
54 request_complete_callback_t callback;
58 std::list <audio_buffer *> m_queue;
59 std::list <request_t*> m_requests;
60 std::list <audio_converter_memory_sink *> m_outbox;
61 std::thread m_worker_thread;
62 bool m_worker_thread_alive;
63 unsigned int m_total_size;
64 unsigned int m_precapture_duration_seconds;
65 unsigned int m_precapture_size_bytes;
66 unsigned int m_queue_upper_limit_bytes;
67 unsigned int m_request_counter;
68 bool m_enable_wav_header_output;
70 bool m_convert_output;
71 preferred_delivery_method_t m_delivery_method;
73 const std::string m_sock_path;
76 int write_default_file_header(std::ofstream &file);
77 int update_file_header_size(std::ofstream &file,
unsigned int data_size);
78 int grab_last_n_seconds(
const std::string &filename,
unsigned int seconds);
79 int grab_last_n_seconds(
unsigned int seconds);
80 void compute_queue_size();
107 request_id_t
grab_fresh_sample(
unsigned int seconds,
const std::string &filename =
nullptr, request_complete_callback_t cb =
nullptr,
void * cb_data =
nullptr);
170 const std::string & get_sock_path() {
return m_sock_path; }
173 #endif //_MUSIC_ID_H_