From b58dfc7f0f2d8e7760e7c97490d86213a6af4733 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 27 Jun 2021 17:32:12 +0200 Subject: [PATCH] Resolve microseconds_t ambiguity 1/2 This resolves a PBD vs ARDOUR namespace error for some compilers: ``` error: reference to 'microseconds_t' is ambiguous libs/pbd/pbd/microseconds.h:29:19: error: candidates are: typedef uint64_t PBD::microseconds_t libs/ardour/ardour/types.h:81:29: error: typedef PBD::microseconds_t ARDOUR::microseconds_t ``` --- libs/ardour/ardour/types.h | 1 - libs/surfaces/cc121/cc121.h | 2 +- libs/surfaces/faderport/faderport.h | 2 +- libs/surfaces/generic_midi/generic_midi_control_protocol.h | 6 +++--- libs/surfaces/mackie/button.cc | 2 +- libs/surfaces/mackie/button.h | 2 +- libs/surfaces/mackie/mackie_control_protocol.cc | 4 ++-- libs/surfaces/mackie/strip.cc | 4 ++-- libs/surfaces/mackie/strip.h | 4 ++-- libs/surfaces/mackie/surface.cc | 2 +- libs/surfaces/mackie/surface.h | 4 ++-- libs/surfaces/push2/push2.h | 2 +- libs/surfaces/us2400/button.cc | 2 +- libs/surfaces/us2400/button.h | 2 +- libs/surfaces/us2400/strip.cc | 4 ++-- libs/surfaces/us2400/strip.h | 4 ++-- libs/surfaces/us2400/surface.cc | 2 +- libs/surfaces/us2400/surface.h | 4 ++-- libs/surfaces/us2400/us2400_control_protocol.cc | 2 +- 19 files changed, 27 insertions(+), 28 deletions(-) diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 9938f3e999..d85bcd9251 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -78,7 +78,6 @@ typedef float Sample; typedef float pan_t; typedef float gain_t; typedef uint32_t layer_t; -typedef PBD::microseconds_t microseconds_t; typedef uint32_t pframes_t; /* rebind Temporal position types into ARDOUR namespace */ diff --git a/libs/surfaces/cc121/cc121.h b/libs/surfaces/cc121/cc121.h index 8d31a79042..15036f7f8f 100644 --- a/libs/surfaces/cc121/cc121.h +++ b/libs/surfaces/cc121/cc121.h @@ -199,7 +199,7 @@ class CC121 : public ARDOUR::ControlProtocol, public AbstractUI { enum JogMode { scroll=1, zoom=2 }; JogMode _jogmode; - ARDOUR::microseconds_t last_encoder_time; + PBD::microseconds_t last_encoder_time; int last_good_encoder_delta; int last_encoder_delta, last_last_encoder_delta; diff --git a/libs/surfaces/faderport/faderport.h b/libs/surfaces/faderport/faderport.h index e6ef738a4f..07dceca2bc 100644 --- a/libs/surfaces/faderport/faderport.h +++ b/libs/surfaces/faderport/faderport.h @@ -197,7 +197,7 @@ class FaderPort : public ARDOUR::ControlProtocol, public AbstractUI input_port () const; boost::shared_ptr output_port () const; - void set_feedback_interval (ARDOUR::microseconds_t); + void set_feedback_interval (PBD::microseconds_t); int set_feedback (bool yn); bool get_feedback () const; @@ -133,8 +133,8 @@ private: boost::shared_ptr _input_port; boost::shared_ptr _output_port; - ARDOUR::microseconds_t _feedback_interval; - ARDOUR::microseconds_t last_feedback_time; + PBD::microseconds_t _feedback_interval; + PBD::microseconds_t last_feedback_time; bool do_feedback; void _send_feedback (); diff --git a/libs/surfaces/mackie/button.cc b/libs/surfaces/mackie/button.cc index 8185d8b9fc..d07caac7f8 100644 --- a/libs/surfaces/mackie/button.cc +++ b/libs/surfaces/mackie/button.cc @@ -58,7 +58,7 @@ Button::long_press_count () return -1; /* button is not pressed */ } - const ARDOUR::microseconds_t delta = PBD::get_microseconds () - press_time; + const PBD::microseconds_t delta = PBD::get_microseconds () - press_time; if (delta < 500000) { return 0; diff --git a/libs/surfaces/mackie/button.h b/libs/surfaces/mackie/button.h index 67ae0e85cd..ca6d1b6d85 100644 --- a/libs/surfaces/mackie/button.h +++ b/libs/surfaces/mackie/button.h @@ -155,7 +155,7 @@ private: Surface& _surface; ID _bid; /* device independent button ID */ Led _led; - ARDOUR::microseconds_t press_time; + PBD::microseconds_t press_time; }; } // Mackie namespace diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index d3abee573e..b37d0bdfc8 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -536,7 +536,7 @@ MackieControlProtocol::periodic () update_timecode_display (); - ARDOUR::microseconds_t now_usecs = PBD::get_microseconds (); + PBD::microseconds_t now_usecs = PBD::get_microseconds (); { Glib::Threads::Mutex::Lock lm (surfaces_lock); @@ -565,7 +565,7 @@ MackieControlProtocol::redisplay () initialize(); } - ARDOUR::microseconds_t now = PBD::get_microseconds (); + PBD::microseconds_t now = PBD::get_microseconds (); { Glib::Threads::Mutex::Lock lm (surfaces_lock); diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index e7889948ee..8cc52e6339 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -828,14 +828,14 @@ Strip::handle_pot (Pot& pot, float delta) } void -Strip::periodic (ARDOUR::microseconds_t now) +Strip::periodic (PBD::microseconds_t now) { update_meter (); update_automation (); } void -Strip::redisplay (ARDOUR::microseconds_t now, bool force) +Strip::redisplay (PBD::microseconds_t now, bool force) { if (_block_screen_redisplay_until >= now) { /* no drawing allowed */ diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h index 377999ba0f..6797465175 100644 --- a/libs/surfaces/mackie/strip.h +++ b/libs/surfaces/mackie/strip.h @@ -88,8 +88,8 @@ public: void handle_fader_touch (Fader&, bool touch_on); void handle_pot (Pot&, float delta); - void periodic (ARDOUR::microseconds_t now_usecs); - void redisplay (ARDOUR::microseconds_t now_usecs, bool force = true); + void periodic (PBD::microseconds_t now_usecs); + void redisplay (PBD::microseconds_t now_usecs, bool force = true); MidiByteArray display (uint32_t line_number, const std::string&); MidiByteArray blank_display (uint32_t line_number); diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index ca4aeded00..65f9f23d53 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -960,7 +960,7 @@ Surface::periodic (uint64_t now_usecs) } void -Surface::redisplay (ARDOUR::microseconds_t now, bool force) +Surface::redisplay (PBD::microseconds_t now, bool force) { for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) { (*s)->redisplay (now, force); diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h index c5382e49b7..412b05b8d6 100644 --- a/libs/surfaces/mackie/surface.h +++ b/libs/surfaces/mackie/surface.h @@ -113,8 +113,8 @@ public: const MidiByteArray& sysex_hdr() const; - void periodic (ARDOUR::microseconds_t now_usecs); - void redisplay (ARDOUR::microseconds_t now_usecs, bool force); + void periodic (PBD::microseconds_t now_usecs); + void redisplay (PBD::microseconds_t now_usecs, bool force); void hui_heartbeat (); void handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t, uint32_t channel_id); diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index 860b89eac2..72406b909e 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -522,7 +522,7 @@ class Push2 : public ARDOUR::ControlProtocol bool vblank (); void splash (); - ARDOUR::microseconds_t splash_start; + PBD::microseconds_t splash_start; /* the canvas */ diff --git a/libs/surfaces/us2400/button.cc b/libs/surfaces/us2400/button.cc index 5b3933ccee..598f0d413b 100644 --- a/libs/surfaces/us2400/button.cc +++ b/libs/surfaces/us2400/button.cc @@ -57,7 +57,7 @@ Button::long_press_count () return -1; /* button is not pressed */ } - const ARDOUR::microseconds_t delta = PBD::get_microseconds () - press_time; + const PBD::microseconds_t delta = PBD::get_microseconds () - press_time; if (delta < 500000) { return 0; diff --git a/libs/surfaces/us2400/button.h b/libs/surfaces/us2400/button.h index 40bcfa2c48..b788ff6691 100644 --- a/libs/surfaces/us2400/button.h +++ b/libs/surfaces/us2400/button.h @@ -114,7 +114,7 @@ private: Surface& _surface; ID _bid; /* device independent button ID */ Led _led; - ARDOUR::microseconds_t press_time; + PBD::microseconds_t press_time; }; } // US2400 namespace diff --git a/libs/surfaces/us2400/strip.cc b/libs/surfaces/us2400/strip.cc index 89925a2222..2cb08a56f3 100644 --- a/libs/surfaces/us2400/strip.cc +++ b/libs/surfaces/us2400/strip.cc @@ -597,7 +597,7 @@ Strip::handle_pot (Pot& pot, float delta) } void -Strip::periodic (ARDOUR::microseconds_t now) +Strip::periodic (PBD::microseconds_t now) { update_meter (); @@ -637,7 +637,7 @@ Strip::periodic (ARDOUR::microseconds_t now) } void -Strip::redisplay (ARDOUR::microseconds_t now, bool force) +Strip::redisplay (PBD::microseconds_t now, bool force) { } diff --git a/libs/surfaces/us2400/strip.h b/libs/surfaces/us2400/strip.h index ac983e1738..4a78a44863 100644 --- a/libs/surfaces/us2400/strip.h +++ b/libs/surfaces/us2400/strip.h @@ -88,8 +88,8 @@ public: void handle_fader_touch (Fader&, bool touch_on); void handle_pot (Pot&, float delta); - void periodic (ARDOUR::microseconds_t now_usecs); - void redisplay (ARDOUR::microseconds_t now_usecs, bool force = true); + void periodic (PBD::microseconds_t now_usecs); + void redisplay (PBD::microseconds_t now_usecs, bool force = true); void zero (); diff --git a/libs/surfaces/us2400/surface.cc b/libs/surfaces/us2400/surface.cc index 39caeb2090..f22bca5dbf 100644 --- a/libs/surfaces/us2400/surface.cc +++ b/libs/surfaces/us2400/surface.cc @@ -920,7 +920,7 @@ Surface::periodic (uint64_t now_usecs) } void -Surface::redisplay (ARDOUR::microseconds_t now, bool force) +Surface::redisplay (PBD::microseconds_t now, bool force) { for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) { (*s)->redisplay (now, force); diff --git a/libs/surfaces/us2400/surface.h b/libs/surfaces/us2400/surface.h index 7ee3d7e0de..f8f48685f6 100644 --- a/libs/surfaces/us2400/surface.h +++ b/libs/surfaces/us2400/surface.h @@ -112,8 +112,8 @@ public: const MidiByteArray& sysex_hdr() const; - void periodic (ARDOUR::microseconds_t now_usecs); - void redisplay (ARDOUR::microseconds_t now_usecs, bool force); + void periodic (PBD::microseconds_t now_usecs); + void redisplay (PBD::microseconds_t now_usecs, bool force); void hui_heartbeat (); void handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t, uint32_t channel_id); diff --git a/libs/surfaces/us2400/us2400_control_protocol.cc b/libs/surfaces/us2400/us2400_control_protocol.cc index bf8604c62e..cd5698ff2a 100644 --- a/libs/surfaces/us2400/us2400_control_protocol.cc +++ b/libs/surfaces/us2400/us2400_control_protocol.cc @@ -457,7 +457,7 @@ US2400Protocol::periodic () initialize(); } - ARDOUR::microseconds_t now_usecs = PBD::get_microseconds (); + PBD::microseconds_t now_usecs = PBD::get_microseconds (); { Glib::Threads::Mutex::Lock lm (surfaces_lock);