- /* START BACKEND PROXY API
- *
- * See audio_backend.h for full documentation and semantics. These wrappers
- * just forward to a backend implementation.
- */
-
- int start (bool for_latency_measurement=false);
- int stop (bool for_latency_measurement=false);
- int freewheel (bool start_stop);
- float get_dsp_load() const ;
- void transport_start ();
- void transport_stop ();
- TransportState transport_state ();
- void transport_locate (framepos_t pos);
- framepos_t transport_frame();
- framecnt_t sample_rate () const;
- pframes_t samples_per_cycle () const;
- int usecs_per_cycle () const;
- size_t raw_buffer_size (DataType t);
- pframes_t sample_time ();
- pframes_t sample_time_at_cycle_start ();
- pframes_t samples_since_cycle_start ();
- bool get_sync_offset (pframes_t& offset) const;
-
- int create_process_thread (boost::function<void()> func);
- int join_process_threads ();
- bool in_process_thread ();
- uint32_t process_thread_count ();
-
- bool is_realtime() const;
- bool connected() const;
-
- int set_device_name (const std::string&);
- int set_sample_rate (float);
- int set_buffer_size (uint32_t);
- int set_sample_format (SampleFormat);
- int set_interleaved (bool yn);
- int set_input_channels (uint32_t);
- int set_output_channels (uint32_t);
- int set_systemic_input_latency (uint32_t);
- int set_systemic_output_latency (uint32_t);
-
- /* END BACKEND PROXY API */
-
- bool freewheeling() const { return _freewheeling; }
- bool running() const { return _running; }
-
- Glib::Threads::Mutex& process_lock() { return _process_lock; }
-
- int request_buffer_size (pframes_t samples) {
- return set_buffer_size (samples);
- }
-
- framecnt_t processed_frames() const { return _processed_frames; }
+ /* START BACKEND PROXY API
+ *
+ * See audio_backend.h for full documentation and semantics. These wrappers
+ * just forward to a backend implementation.
+ */
+
+ int start (bool for_latency_measurement=false);
+ int stop (bool for_latency_measurement=false);
+ int freewheel (bool start_stop);
+ float get_dsp_load() const ;
+ void transport_start ();
+ void transport_stop ();
+ TransportState transport_state ();
+ void transport_locate (framepos_t pos);
+ framepos_t transport_frame();
+ framecnt_t sample_rate () const;
+ pframes_t samples_per_cycle () const;
+ int usecs_per_cycle () const;
+ size_t raw_buffer_size (DataType t);
+ pframes_t sample_time ();
+ pframes_t sample_time_at_cycle_start ();
+ pframes_t samples_since_cycle_start ();
+ bool get_sync_offset (pframes_t& offset) const;
+
+ int create_process_thread (boost::function<void()> func);
+ int join_process_threads ();
+ bool in_process_thread ();
+ uint32_t process_thread_count ();
+
+ void request_backend_reset();
+ void request_device_list_update();
+
+ bool is_realtime() const;
+ bool connected() const;
+
+ // for the user which hold state_lock to check if reset operation is pending
+ bool is_reset_requested() const { return g_atomic_int_get(const_cast<gint*>(&_hw_reset_request_count)); }
+
+ int set_device_name (const std::string&);
+ int set_sample_rate (float);
+ int set_buffer_size (uint32_t);
+ int set_interleaved (bool yn);
+ int set_input_channels (uint32_t);
+ int set_output_channels (uint32_t);
+ int set_systemic_input_latency (uint32_t);
+ int set_systemic_output_latency (uint32_t);
+
+ /* END BACKEND PROXY API */
+
+ bool freewheeling() const { return _freewheeling; }
+ bool running() const { return _running; }
+
+ Glib::Threads::Mutex& process_lock() { return _process_lock; }
+ Glib::Threads::RecMutex& state_lock() { return _state_lock; }
+
+ int request_buffer_size (pframes_t samples) {
+ return set_buffer_size (samples);
+ }
+
+ framecnt_t processed_frames() const { return _processed_frames; }