#include <boost/shared_ptr.hpp>
#include "ardour/audio_backend.h"
+#include "ardour/dsp_load_calculator.h"
#include "ardour/types.h"
#include "portaudio_io.h"
#include "winmmemidi_io.h"
#include "cycle_timer.h"
-#include "dsp_load_calculator.h"
namespace ARDOUR {
void* main_blocking_process_thread ();
+ void* freewheel_process_thread ();
+
private: // Methods
bool start_blocking_process_thread ();
bool stop_blocking_process_thread ();
bool blocking_process_freewheel ();
- bool blocking_process_main ();
+ bool blocking_process_main (const float* interleaved_input_data,
+ float* interleaved_output_data);
void process_port_connection_changes ();
+ void process_incoming_midi ();
+ void process_outgoing_midi ();
+
+ bool engine_halted ();
+ bool running ();
+
+ static int portaudio_callback(const void* input,
+ void* output,
+ unsigned long frameCount,
+ const PaStreamCallbackTimeInfo* timeInfo,
+ PaStreamCallbackFlags statusFlags,
+ void* userData);
+
+ bool process_callback(const float* input,
+ float* output,
+ uint32_t frame_count,
+ const PaStreamCallbackTimeInfo* timeInfo,
+ PaStreamCallbackFlags statusFlags);
+
+ bool start_freewheel_process_thread ();
+ bool stop_freewheel_process_thread ();
+
+ static bool set_mmcss_pro_audio (HANDLE* task_handle);
+ static bool reset_mmcss (HANDLE task_handle);
private:
std::string _instance_name;
bool _active; /* is running, process thread */
bool _freewheel;
bool _freewheeling;
+ bool _freewheel_ack;
+ bool _reinit_thread_callback;
bool _measure_latency;
- DSPLoadCalculator m_dsp_calc;
+ ARDOUR::DSPLoadCalculator m_dsp_calc;
+
+ bool m_freewheel_thread_active;
+
+ pthread_mutex_t m_freewheel_mutex;
+ pthread_cond_t m_freewheel_signal;
uint64_t m_cycle_count;
uint64_t m_total_deviation_us;
/* blocking thread */
pthread_t _main_blocking_thread;
+ /* main thread in callback mode(or fw thread when running) */
+ pthread_t m_main_thread;
+
+ /* freewheel thread in callback mode */
+ pthread_t m_pthread_freewheel;
+
/* process threads */
static void* portaudio_process_thread (void *);
std::vector<pthread_t> _threads;