mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Define operator<< in the corresponding namespace
This fixes the build for me with clang 11.1.0 (from LLVM repositories) on Debian buster as C++11. As far as I know this is the general best practice because of ADL voodoo, but Ardour's approach to namespaces is pretty anarchic, and I'm not really sure exactly why this wasn't building for some types. Also tested to build find with the default buster GCC 8.3.0.
This commit is contained in:
parent
c2687d156e
commit
40ad977046
28 changed files with 66 additions and 78 deletions
|
|
@ -178,8 +178,8 @@ public:
|
|||
int channel; ///< channel index, or -1 for "all"
|
||||
};
|
||||
|
||||
std::ostream & operator<< (std::ostream & o, Bundle const &);
|
||||
|
||||
}
|
||||
|
||||
std::ostream & operator<< (std::ostream & o, ARDOUR::Bundle const &);
|
||||
|
||||
#endif /* __ardour_bundle_h__ */
|
||||
|
|
|
|||
|
|
@ -212,9 +212,9 @@ private:
|
|||
uint32_t _counts[DataType::num_types];
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ChanCount& c);
|
||||
|
||||
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c);
|
||||
} // namespace ARDOUR
|
||||
|
||||
#endif // __ardour_chan_count_h__
|
||||
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ private:
|
|||
Mappings _mappings;
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
std::ostream& operator<<(std::ostream& o, const ChanMapping& m);
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& m);
|
||||
} // namespace ARDOUR
|
||||
|
||||
#endif // __ardour_chan_mapping_h__
|
||||
|
||||
|
|
|
|||
|
|
@ -447,8 +447,8 @@ private:
|
|||
GATOMIC_QUAL gint _flush;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const PluginInsert::Match& m);
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m);
|
||||
|
||||
#endif /* __ardour_plugin_insert_h__ */
|
||||
|
|
|
|||
|
|
@ -280,8 +280,8 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
|
|||
static int selection_counter;
|
||||
};
|
||||
|
||||
LIBARDOUR_API std::ostream& operator<<(std::ostream& o, PresentationInfo const& rid);
|
||||
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, ARDOUR::PresentationInfo const& rid);
|
||||
|
||||
#endif /* __libardour_presentation_info_h__ */
|
||||
|
|
|
|||
|
|
@ -627,11 +627,11 @@ private:
|
|||
MeterSection* copy_metrics_and_point (const Metrics& metrics, Metrics& copy, MeterSection* section) const;
|
||||
};
|
||||
|
||||
}; /* namespace ARDOUR */
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const Meter&);
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const Tempo&);
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const MetricSection&);
|
||||
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const ARDOUR::Meter&);
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const ARDOUR::Tempo&);
|
||||
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const ARDOUR::MetricSection&);
|
||||
}; /* namespace ARDOUR */
|
||||
|
||||
namespace PBD {
|
||||
DEFINE_ENUM_CONVERT (ARDOUR::TempoSection::Type)
|
||||
|
|
|
|||
|
|
@ -66,8 +66,9 @@ ChanCount::state(const std::string& name) const
|
|||
// Statics
|
||||
const ChanCount ChanCount::ZERO = ChanCount();
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c) {
|
||||
std::ostream& operator<<(std::ostream& o, const ChanCount& c) {
|
||||
return o << "AUDIO=" << c.n_audio() << ":MIDI=" << c.n_midi();
|
||||
}
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
|
|
|
|||
|
|
@ -257,16 +257,12 @@ ChanMapping::count () const
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
|
||||
std::ostream& operator<<(std::ostream& o, const ChanMapping& cm)
|
||||
{
|
||||
const ARDOUR::ChanMapping::Mappings& mp (cm.mappings());
|
||||
for (ARDOUR::ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
|
||||
const ChanMapping::Mappings& mp (cm.mappings());
|
||||
for (ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
|
||||
o << tm->first.to_string() << endl;
|
||||
for (ARDOUR::ChanMapping::TypeMapping::const_iterator i = tm->second.begin();
|
||||
for (ChanMapping::TypeMapping::const_iterator i = tm->second.begin();
|
||||
i != tm->second.end(); ++i) {
|
||||
o << "\t" << i->first << " => " << i->second << endl;
|
||||
}
|
||||
|
|
@ -274,3 +270,5 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
|
|||
|
||||
return o;
|
||||
}
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
|
|
|||
|
|
@ -264,6 +264,7 @@ LTC_TransportMaster::equal_ltc_sample_time(LTCFrame *a, LTCFrame *b) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static ostream& operator<< (ostream& ostr, LTCFrame& a)
|
||||
{
|
||||
ostr
|
||||
|
|
|
|||
|
|
@ -3382,7 +3382,7 @@ PluginInsert::clear_stats ()
|
|||
g_atomic_int_set (&_stat_reset, 1);
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m)
|
||||
std::ostream& ARDOUR::operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m)
|
||||
{
|
||||
switch (m.method) {
|
||||
case PluginInsert::Impossible: o << "Impossible"; break;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ PresentationInfo::operator= (PresentationInfo const& other)
|
|||
}
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& o, ARDOUR::PresentationInfo const& pi)
|
||||
ARDOUR::operator<<(std::ostream& o, ARDOUR::PresentationInfo const& pi)
|
||||
{
|
||||
return o << pi.order() << '/' << enum_2_string (pi.flags()) << '/' << pi.color();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3230,17 +3230,11 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
|
|||
}
|
||||
}
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
/* clang complains: 'operator<<' should be declared prior to the call site or in an associated namespace of one of its
|
||||
* arguments std::ostream& operator<<(std::ostream& o, ARDOUR::PresentationInfo const& rid)"
|
||||
*/
|
||||
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("added route %1, group order %2 type %3 (summary: %4)\n",
|
||||
r->name(),
|
||||
r->presentation_info().order(),
|
||||
enum_2_string (r->presentation_info().flags()),
|
||||
r->presentation_info()));
|
||||
#endif
|
||||
|
||||
|
||||
if (input_auto_connect || output_auto_connect) {
|
||||
auto_connect_route (r, input_auto_connect, output_auto_connect, ChanCount (), ChanCount (), existing_inputs, existing_outputs);
|
||||
|
|
|
|||
|
|
@ -4943,17 +4943,17 @@ struct bbtcmp {
|
|||
};
|
||||
|
||||
std::ostream&
|
||||
operator<< (std::ostream& o, const Meter& m) {
|
||||
ARDOUR::operator<< (std::ostream& o, const ARDOUR::Meter& m) {
|
||||
return o << m.divisions_per_bar() << '/' << m.note_divisor();
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<< (std::ostream& o, const Tempo& t) {
|
||||
ARDOUR::operator<< (std::ostream& o, const ARDOUR::Tempo& t) {
|
||||
return o << t.note_types_per_minute() << " 1/" << t.note_type() << "'s per minute";
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
operator<< (std::ostream& o, const MetricSection& section) {
|
||||
ARDOUR::operator<< (std::ostream& o, const ARDOUR::MetricSection& section) {
|
||||
|
||||
o << "MetricSection @ " << section.sample() << ' ';
|
||||
|
||||
|
|
|
|||
|
|
@ -323,8 +323,8 @@ private:
|
|||
void scrolled ();
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream&, const Canvas&);
|
||||
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream&, const ArdourCanvas::Canvas&);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ private:
|
|||
void propagate_show_hide ();
|
||||
};
|
||||
|
||||
extern LIBCANVAS_API std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
|
||||
extern LIBCANVAS_API std::ostream& operator<< (std::ostream&, const Item&);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,12 +104,11 @@ ControlSet::clear_controls ()
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
/* No good place for this so just put it here */
|
||||
|
||||
std::ostream&
|
||||
std::operator<< (std::ostream & str, Evoral::Parameter const & p)
|
||||
operator<< (std::ostream & str, Parameter const & p)
|
||||
{
|
||||
return str << p.type() << '-' << p.id() << '-' << (int) p.channel();
|
||||
}
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
|
|
|
|||
|
|
@ -87,11 +87,9 @@ private:
|
|||
uint8_t _channel;
|
||||
};
|
||||
|
||||
} // namespace Evoral
|
||||
std::ostream& operator<< (std::ostream &str, Parameter const &);
|
||||
|
||||
namespace std {
|
||||
std::ostream& operator<< (std::ostream &str, Evoral::Parameter const &);
|
||||
}
|
||||
} // namespace Evoral
|
||||
|
||||
#endif // EVORAL_PARAMETER_HPP
|
||||
|
||||
|
|
|
|||
|
|
@ -371,11 +371,9 @@ private:
|
|||
uint8_t _highest_note;
|
||||
};
|
||||
|
||||
template<typename Time> /*LIBEVORAL_API*/ std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
template<typename Time> /*LIBEVORAL_API*/ std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
|
||||
|
||||
|
||||
#endif // EVORAL_SEQUENCE_HPP
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ ID::operator= (const ID& other)
|
|||
}
|
||||
|
||||
ostream&
|
||||
operator<< (ostream& ostr, const ID& id)
|
||||
PBD::operator<< (ostream& ostr, const ID& id)
|
||||
{
|
||||
ostr << id.to_s();
|
||||
return ostr;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ class LIBPBD_API ID {
|
|||
static uint64_t _counter;
|
||||
};
|
||||
|
||||
LIBPBD_API std::ostream& operator<< (std::ostream& ostr, const ID&);
|
||||
|
||||
}
|
||||
|
||||
LIBPBD_API std::ostream& operator<< (std::ostream& ostr, const PBD::ID&);
|
||||
|
||||
#endif /* __pbd_id_h__ */
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ public:
|
|||
bool _in_use;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream & operator<< (std::ostream & os, const ArdourSurface::Mackie::Control & control);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __mackie_controls_h__ */
|
||||
|
|
|
|||
|
|
@ -127,10 +127,9 @@ class DeviceInfo
|
|||
void shared_buttons ();
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const ArdourSurface::Mackie::DeviceInfo& di);
|
||||
|
||||
} // Mackie namespace
|
||||
} // ArdourSurface namespace
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const ArdourSurface::Mackie::DeviceInfo& di);
|
||||
|
||||
#endif /* __ardour_mackie_control_protocol_device_info_h__ */
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ public:
|
|||
bool _in_use;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream & operator<< (std::ostream & os, const ArdourSurface::US2400::Control & control);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __us2400_controls_h__ */
|
||||
|
|
|
|||
|
|
@ -122,10 +122,9 @@ class DeviceInfo
|
|||
void shared_buttons ();
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const ArdourSurface::US2400::DeviceInfo& di);
|
||||
|
||||
} // US2400 namespace
|
||||
} // ArdourSurface namespace
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const ArdourSurface::US2400::DeviceInfo& di);
|
||||
|
||||
#endif /* __ardour_us2400_control_protocol_device_info_h__ */
|
||||
|
|
|
|||
|
|
@ -112,24 +112,22 @@ struct LIBTEMPORAL_API BBT_Offset
|
|||
BBT_Offset (double beats);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
inline std::ostream&
|
||||
operator<< (std::ostream& o, const Timecode::BBT_Time& bbt)
|
||||
operator<< (std::ostream& o, const BBT_Time& bbt)
|
||||
{
|
||||
o << bbt.bars << '|' << bbt.beats << '|' << bbt.ticks;
|
||||
return o;
|
||||
}
|
||||
|
||||
inline std::ostream&
|
||||
operator<< (std::ostream& o, const Timecode::BBT_Offset& bbt)
|
||||
operator<< (std::ostream& o, const BBT_Offset& bbt)
|
||||
{
|
||||
o << bbt.bars << '|' << bbt.beats << '|' << bbt.ticks;
|
||||
return o;
|
||||
}
|
||||
|
||||
inline std::ostream&
|
||||
print_padded (std::ostream& o, const Timecode::BBT_Time& bbt)
|
||||
print_padded (std::ostream& o, const BBT_Time& bbt)
|
||||
{
|
||||
o << std::setfill ('0') << std::right
|
||||
<< std::setw (3) << bbt.bars << "|"
|
||||
|
|
@ -139,4 +137,6 @@ print_padded (std::ostream& o, const Timecode::BBT_Time& bbt)
|
|||
return o;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif /* __timecode_bbt_time_h__ */
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ sample_to_timecode (
|
|||
uint32_t subframes_per_frame,
|
||||
bool offset_is_negative, int64_t offset_samples);
|
||||
|
||||
extern LIBTEMPORAL_API std::ostream& operator<< (std::ostream& ostr, const Time& t);
|
||||
|
||||
} // namespace Timecode
|
||||
|
||||
extern LIBTEMPORAL_API std::ostream& operator<< (std::ostream& ostr, const Timecode::Time& t);
|
||||
|
||||
#endif // __timecode_time_h__
|
||||
|
|
|
|||
|
|
@ -844,10 +844,11 @@ sample_to_timecode (
|
|||
timecode.drop = timecode_drop_frames;
|
||||
}
|
||||
|
||||
} // namespace Timecode
|
||||
|
||||
std::ostream&
|
||||
operator<<(std::ostream& ostr, const Timecode::Time& t)
|
||||
operator<<(std::ostream& ostr, const Time& t)
|
||||
{
|
||||
return t.print (ostr);
|
||||
}
|
||||
|
||||
} // namespace Timecode
|
||||
|
||||
|
|
|
|||
|
|
@ -420,10 +420,10 @@ class LIBARDOUR_API TempoMap
|
|||
void dump_locked (std::ostream&);
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream&, TempoMapPoint const &);
|
||||
std::ostream& operator<<(std::ostream&, Tempo const &);
|
||||
std::ostream& operator<<(std::ostream&, Meter const &);
|
||||
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream&, ARDOUR::TempoMapPoint const &);
|
||||
std::ostream& operator<<(std::ostream&, ARDOUR::Tempo const &);
|
||||
std::ostream& operator<<(std::ostream&, ARDOUR::Meter const &);
|
||||
|
||||
#endif /* __ardour_tempo_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue