Set 'downloadable' property on Soundcloud uploads
[ardour.git] / libs / ardour / ltc_slave.cc
index fecab5b6061e89cfceb595a1948ec0fa4628cd4f..ced0226d00ea3c001267a66ac0be6280bd07b447 100644 (file)
 */
 #include <iostream>
 #include <errno.h>
-#include <poll.h>
 #include <sys/types.h>
 #include <unistd.h>
 
 #include "pbd/error.h"
+#include "pbd/pthread_utils.h"
 
 #include "ardour/debug.h"
 #include "ardour/slave.h"
@@ -134,7 +134,7 @@ LTC_Slave::resync_latency()
 
        if (!session.deletion_in_progress() && session.ltc_output_io()) { /* check if Port exits */
                boost::shared_ptr<Port> ltcport = session.ltc_input_port();
-               ltcport->get_connected_latency_range(ltc_slave_latency, false);
+               ltcport->get_connected_latency_range (ltc_slave_latency, false);
        }
 }
 
@@ -150,9 +150,9 @@ LTC_Slave::reset()
 }
 
 void
-LTC_Slave::parse_ltc(const jack_nframes_t nframes, const jack_default_audio_sample_t * const in, const framecnt_t posinfo)
+LTC_Slave::parse_ltc(const ARDOUR::pframes_t nframes, const Sample* const in, const ARDOUR::framecnt_t posinfo)
 {
-       jack_nframes_t i;
+       pframes_t i;
        unsigned char sound[8192];
        if (nframes > 8192) {
                /* TODO warn once or wrap, loop conversion below
@@ -413,8 +413,8 @@ LTC_Slave::init_engine_dll (framepos_t pos, int32_t inc)
 }
 
 /* main entry point from session_process.cc
- * called from jack_process callback context
- * so it is OK to use jack_port_get_buffer()
+ * called from process callback context
+ * so it is OK to use get_buffer()
  */
 bool
 LTC_Slave::speed_and_position (double& speed, framepos_t& pos)
@@ -432,7 +432,7 @@ LTC_Slave::speed_and_position (double& speed, framepos_t& pos)
 
        frameoffset_t skip = now - (monotonic_cnt + nframes);
        monotonic_cnt = now;
-       DEBUG_TRACE (DEBUG::LTC, string_compose ("speed_and_position - TID:%1 | latency: %2 | skip %3\n", ::pthread_self(), ltc_slave_latency.max, skip));
+       DEBUG_TRACE (DEBUG::LTC, string_compose ("speed_and_position - TID:%1 | latency: %2 | skip %3\n", pthread_name(), ltc_slave_latency.max, skip));
 
        if (last_timestamp == 0) {
                engine_dll_initstate = 0;
@@ -588,10 +588,10 @@ LTC_Slave::approximate_current_delta() const
        if (last_timestamp == 0 || engine_dll_initstate == 0) {
                snprintf(delta, sizeof(delta), "\u2012\u2012\u2012\u2012");
        } else if ((monotonic_cnt - last_timestamp) > 2 * frames_per_ltc_frame) {
-               snprintf(delta, sizeof(delta), _("flywheel"));
+               snprintf(delta, sizeof(delta), "%s", _("flywheel"));
        } else {
                snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%" PRIi64 "</span>sm",
-                               LEADINGZERO(abs(current_delta)), PLUSMINUS(-current_delta), abs(current_delta));
+                               LEADINGZERO(llabs(current_delta)), PLUSMINUS(-current_delta), llabs(current_delta));
        }
        return std::string(delta);
 }