From 27a1cf2cf73703267cac5bda2acca386afb374b3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 24 May 2012 02:54:10 +0000 Subject: Compile cleanly with clang. To compile Ardour with LLVM/clang, do the usual thing but set the CXX and CC environment variables, e.g.: CC=/usr/bin/clang CXX=/usr/bin/clang++ ./waf configure build git-svn-id: svn://localhost/ardour2/branches/3.0@12418 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_view.h | 2 +- gtk2_ardour/audio_streamview.h | 4 +-- gtk2_ardour/automation_selection.h | 2 +- gtk2_ardour/axis_view.h | 2 +- gtk2_ardour/editor_cursors.h | 13 ++++---- gtk2_ardour/editor_drag.h | 3 +- gtk2_ardour/editor_regions.cc | 3 +- gtk2_ardour/export_format_dialog.cc | 10 +++--- gtk2_ardour/group_tabs.cc | 2 +- gtk2_ardour/gui_object.h | 2 +- gtk2_ardour/midi_list_editor.cc | 7 ++--- gtk2_ardour/midi_streamview.h | 6 ++-- gtk2_ardour/mixer_strip.cc | 2 +- gtk2_ardour/point_selection.h | 2 +- gtk2_ardour/port_matrix_types.h | 3 +- gtk2_ardour/public_editor.h | 36 +++++++++++----------- gtk2_ardour/route_ui.cc | 2 +- gtk2_ardour/streamview.h | 4 +-- gtk2_ardour/volume_controller.cc | 2 +- libs/ardour/ardour/bundle.h | 3 +- libs/ardour/ardour/control_protocol_manager.h | 3 +- libs/ardour/ardour/export_status.h | 4 +-- libs/ardour/ardour/import_status.h | 3 +- libs/ardour/ardour/interthread_info.h | 5 +-- libs/ardour/ardour/midi_buffer.h | 3 +- libs/ardour/ardour/named_selection.h | 3 +- libs/ardour/ardour/playlist.h | 6 ++-- libs/ardour/ardour/session_event.h | 3 +- libs/ardour/ardour/types.h | 3 +- libs/ardour/export_format_manager.cc | 6 ++-- libs/ardour/globals.cc | 6 ++-- libs/ardour/midi_playlist.cc | 6 ++-- libs/ardour/midi_ring_buffer.cc | 4 ++- libs/audiographer/audiographer/process_context.h | 3 +- libs/evoral/evoral/ControlList.hpp | 3 +- libs/evoral/evoral/Event.hpp | 3 +- libs/evoral/evoral/EventRingBuffer.hpp | 8 ++--- libs/evoral/evoral/MIDIEvent.hpp | 3 +- libs/evoral/src/libsmf/smf_save.c | 1 - libs/gtkmm2ext/gtkmm2ext/gui_thread.h | 2 +- libs/midi++2/jack_midi_port.cc | 4 +++ libs/midi++2/midi++/ipmidi_port.h | 3 -- libs/midi++2/midi++/port.h | 3 -- libs/midi++2/mtc.cc | 2 +- .../control_protocol/control_protocol.h | 3 +- wscript | 5 +-- 46 files changed, 112 insertions(+), 96 deletions(-) diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 233b53475b..5e41c382bb 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -35,7 +35,7 @@ namespace ARDOUR { class AudioRegion; - class PeakData; + struct PeakData; }; class AudioTimeAxisView; diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h index cb3175798e..5ef83b7adc 100644 --- a/gtk2_ardour/audio_streamview.h +++ b/gtk2_ardour/audio_streamview.h @@ -35,10 +35,10 @@ namespace Gdk { } namespace ARDOUR { - class Route; - class PeakData; class AudioRegion; + class Route; class Source; + struct PeakData; } class PublicEditor; diff --git a/gtk2_ardour/automation_selection.h b/gtk2_ardour/automation_selection.h index f22d4831e2..6f30c588e2 100644 --- a/gtk2_ardour/automation_selection.h +++ b/gtk2_ardour/automation_selection.h @@ -26,6 +26,6 @@ namespace ARDOUR { class AutomationList; } -struct AutomationSelection : std::list > {}; +class AutomationSelection : public std::list > {}; #endif /* __ardour_gtk_automation_selection_h__ */ diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 2c891524b8..17f8c09a7b 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -63,7 +63,7 @@ class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, pu std::string gui_property (const std::string& property_name) const; template void set_gui_property (const std::string& property_name, const T& value) { - gui_object_state().set (state_id(), property_name, value); + gui_object_state().set_property (state_id(), property_name, value); } bool marked_for_display () const; diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index b5c228a54a..2e2c654bd1 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -21,12 +21,13 @@ class Editor; -struct EditorCursor { - Editor& editor; - ArdourCanvas::Points points; - ArdourCanvas::Line canvas_item; +class EditorCursor { +public: + Editor& editor; + ArdourCanvas::Points points; + ArdourCanvas::Line canvas_item; framepos_t current_frame; - double length; + double length; EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); ~EditorCursor (); @@ -35,5 +36,5 @@ struct EditorCursor { void set_length (double units); void set_y_axis (double position); - PBD::Signal1 PositionChanged; + PBD::Signal1 PositionChanged; }; diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 2f81e06efc..1579a178a8 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -242,8 +242,9 @@ private: class RegionDrag; /** Container for details about a region being dragged */ -struct DraggingView +class DraggingView { +public: DraggingView (RegionView *, RegionDrag *); RegionView* view; ///< the view diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 5a06c69648..ab4f7afe3c 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -303,7 +303,6 @@ EditorRegions::add_region (boost::shared_ptr region) TreeModel::iterator iter = _model->get_iter ("0"); TreeModel::Row parent; - TreeModel::Row child; if (!iter) { parent = *(_model->append()); @@ -550,7 +549,7 @@ EditorRegions::selection_changed () for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { - if (iter = _model->get_iter (*i)) { + if ((iter = _model->get_iter (*i))) { boost::shared_ptr region = (*iter)[_columns.region]; // they could have clicked on a row that is just a placeholder, like "Hidden" diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 814e0388be..e0f6d51216 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -393,7 +393,7 @@ ExportFormatDialog::init_format_table () boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (*it)) { + if ((hsf = boost::dynamic_pointer_cast (*it))) { hsf->SampleFormatSelectChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_format_selection, this, _1, _2), gui_context()); hsf->SampleFormatCompatibleChanged.connect (*this, invalidator (*this), boost::bind (&ExportFormatDialog::change_sample_format_compatibility, this, _1, _2), gui_context()); @@ -832,13 +832,13 @@ ExportFormatDialog::change_encoding_options (ExportFormatPtr ptr) boost::shared_ptr flac_ptr; boost::shared_ptr bwf_ptr; - if (linear_ptr = boost::dynamic_pointer_cast (ptr)) { + if ((linear_ptr = boost::dynamic_pointer_cast (ptr))) { show_linear_enconding_options (linear_ptr); - } else if (ogg_ptr = boost::dynamic_pointer_cast (ptr)) { + } else if ((ogg_ptr = boost::dynamic_pointer_cast (ptr))) { show_ogg_enconding_options (ogg_ptr); - } else if (flac_ptr = boost::dynamic_pointer_cast (ptr)) { + } else if ((flac_ptr = boost::dynamic_pointer_cast (ptr))) { show_flac_enconding_options (flac_ptr); - } else if (bwf_ptr = boost::dynamic_pointer_cast (ptr)) { + } else if ((bwf_ptr = boost::dynamic_pointer_cast (ptr))) { show_bwf_enconding_options (bwf_ptr); } else { std::cout << "Unrecognized format!" << std::endl; diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index 5dbeeffd09..9ce3b15046 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -545,7 +545,7 @@ GroupTabs::set_group_color (RouteGroup* group, Gdk::Color color) char buf[64]; snprintf (buf, sizeof (buf), "%d:%d:%d", color.get_red(), color.get_green(), color.get_blue()); - gui_state.set (group_gui_id (group), "color", buf); + gui_state.set_property (group_gui_id (group), "color", buf); /* the group color change notification */ diff --git a/gtk2_ardour/gui_object.h b/gtk2_ardour/gui_object.h index dd56f4b34c..469d311485 100644 --- a/gtk2_ardour/gui_object.h +++ b/gtk2_ardour/gui_object.h @@ -43,7 +43,7 @@ public: std::string get_string (const std::string& id, const std::string& prop_name, bool* empty = 0); - template void set (const std::string& id, const std::string& prop_name, const T& val) { + template void set_property (const std::string& id, const std::string& prop_name, const T& val) { XMLNode* child = get_or_add_node (id); std::stringstream s; s << val; diff --git a/gtk2_ardour/midi_list_editor.cc b/gtk2_ardour/midi_list_editor.cc index 66a8e8b6df..20fc0ed433 100644 --- a/gtk2_ardour/midi_list_editor.cc +++ b/gtk2_ardour/midi_list_editor.cc @@ -282,7 +282,7 @@ MidiListEditor::scroll_event (GdkEventScroll* ev) previous_selection.push_back (*i); - if (iter = model->get_iter (*i)) { + if ((iter = model->get_iter (*i))) { note = (*iter)[columns._note]; @@ -445,7 +445,6 @@ MidiListEditor::key_release (GdkEventKey* ev) TreeModel::Path path; TreeViewColumn* col; TreeModel::iterator iter; - TreeModel::Row row; MidiModel::NoteDiffCommand* cmd; boost::shared_ptr m (region->midi_source(0)->model()); boost::shared_ptr note; @@ -702,7 +701,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text) TreeView::Selection::ListHandle_Path rows = view.get_selection()->get_selected_rows (); for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { - if (iter = model->get_iter (*i)) { + if ((iter = model->get_iter (*i))) { note = (*iter)[columns._note]; @@ -809,7 +808,7 @@ MidiListEditor::selection_changed () NotePlayer* player = new NotePlayer (track); for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) { - if (iter = model->get_iter (*i)) { + if ((iter = model->get_iter (*i))) { note = (*iter)[columns._note]; player->add (note); } diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h index aceb59e69f..d216752eda 100644 --- a/gtk2_ardour/midi_streamview.h +++ b/gtk2_ardour/midi_streamview.h @@ -34,12 +34,12 @@ namespace Gdk { } namespace ARDOUR { - class Route; class Crossfade; - class PeakData; + class MidiModel; class MidiRegion; + class Route; class Source; - class MidiModel; + struct PeakData; } class PublicEditor; diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 16ac8780b8..542ab7b21f 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1171,7 +1171,7 @@ MixerStrip::update_io_button (boost::shared_ptr route, Width widt } if (each_io_has_one_connection) { - if ((total_connection_count == ardour_connection_count)) { + if (total_connection_count == ardour_connection_count) { // all connections are to the same track in ardour // "ardour:Master/" -> "Master" string::size_type slash = ardour_track_name.find("/"); diff --git a/gtk2_ardour/point_selection.h b/gtk2_ardour/point_selection.h index 5ed5ae1573..608a499229 100644 --- a/gtk2_ardour/point_selection.h +++ b/gtk2_ardour/point_selection.h @@ -24,7 +24,7 @@ class ControlPoint; -struct PointSelection : public std::list +class PointSelection : public std::list { }; diff --git a/gtk2_ardour/port_matrix_types.h b/gtk2_ardour/port_matrix_types.h index 15c40713b0..dafbc858b6 100644 --- a/gtk2_ardour/port_matrix_types.h +++ b/gtk2_ardour/port_matrix_types.h @@ -22,8 +22,9 @@ #include "ardour/bundle.h" -struct PortMatrixNode +class PortMatrixNode { +public: PortMatrixNode () {} PortMatrixNode (ARDOUR::BundleChannel r, ARDOUR::BundleChannel c) : row (r), column (c) {} diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index ce625e1889..57e3c8dede 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -62,31 +62,31 @@ namespace Gtkmm2ext { class TearOff; } -class Editor; -class TimeAxisViewItem; -class TimeAxisView; -class PluginUIWindow; -class PluginSelector; -class PlaylistSelector; -class XMLNode; -class Selection; +class AudioRegionView; class AutomationLine; +class AutomationTimeAxisView; class ControlPoint; -class SelectionRect; -class RouteTimeAxisView; -class RegionView; -class AudioRegionView; -class TempoMarker; -class MeterMarker; +class DragManager; +class Editor; +class ImageFrameTimeAxis; +class ImageFrameView; class Marker; -class AutomationTimeAxisView; class MarkerTimeAxis; -class ImageFrameView; -class ImageFrameTimeAxis; class MarkerView; -class DragManager; +class MeterMarker; class MouseCursors; +class PlaylistSelector; +class PluginSelector; +class PluginUIWindow; +class RegionView; +class RouteTimeAxisView; +class Selection; +class TempoMarker; +class TimeAxisView; +class TimeAxisViewItem; class VerboseCursor; +class XMLNode; +struct SelectionRect; using ARDOUR::framepos_t; using ARDOUR::framecnt_t; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index bd8d390962..6fdd10d9cc 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1347,7 +1347,7 @@ RouteUI::set_color (const Gdk::Color & c) the time axis view and the mixer strip */ - gui_object_state().set (route_state_id(), X_("color"), buf); + gui_object_state().set_property (route_state_id(), X_("color"), buf); _route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */ } diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index f49bc87259..0d15a5d7d7 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -34,12 +34,12 @@ namespace Gdk { } namespace ARDOUR { - class Route; class Crossfade; - class PeakData; class Region; + class Route; class Source; class Track; + struct PeakData; } struct RecBoxInfo { diff --git a/gtk2_ardour/volume_controller.cc b/gtk2_ardour/volume_controller.cc index c72a31036a..27fd705978 100644 --- a/gtk2_ardour/volume_controller.cc +++ b/gtk2_ardour/volume_controller.cc @@ -101,7 +101,7 @@ VolumeController::dB_printer (char buf[32], const boost::shared_ptr b, int c) diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h index 19abbaf6be..20358025f1 100644 --- a/libs/ardour/ardour/control_protocol_manager.h +++ b/libs/ardour/ardour/control_protocol_manager.h @@ -35,7 +35,8 @@ class ControlProtocol; class ControlProtocolDescriptor; class Session; -struct ControlProtocolInfo { +class ControlProtocolInfo { +public: ControlProtocolDescriptor* descriptor; ControlProtocol* protocol; std::string name; diff --git a/libs/ardour/ardour/export_status.h b/libs/ardour/ardour/export_status.h index 56b15eada1..164b348c37 100644 --- a/libs/ardour/ardour/export_status.h +++ b/libs/ardour/ardour/export_status.h @@ -31,8 +31,8 @@ namespace ARDOUR { -struct ExportStatus { - +class ExportStatus { + public: ExportStatus (); void init (); diff --git a/libs/ardour/ardour/import_status.h b/libs/ardour/ardour/import_status.h index 1753abe655..c261b7a960 100644 --- a/libs/ardour/ardour/import_status.h +++ b/libs/ardour/ardour/import_status.h @@ -30,7 +30,8 @@ namespace ARDOUR { -struct ImportStatus : public InterThreadInfo { +class ImportStatus : public InterThreadInfo { +public: std::string doing_what; /* control info */ diff --git a/libs/ardour/ardour/interthread_info.h b/libs/ardour/ardour/interthread_info.h index 908276067a..01cacf437c 100644 --- a/libs/ardour/ardour/interthread_info.h +++ b/libs/ardour/ardour/interthread_info.h @@ -27,14 +27,15 @@ namespace ARDOUR { - struct InterThreadInfo { + class InterThreadInfo { + public: InterThreadInfo () : done (false), cancel (false), progress (0), thread (0) {} volatile bool done; volatile bool cancel; volatile float progress; pthread_t thread; - ProcessThread process_thread; + ProcessThread process_thread; }; } // namespace diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index db02344249..183ca7eea9 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -53,7 +53,8 @@ public: bool merge_in_place(const MidiBuffer &other); template - struct iterator_base { + class iterator_base { + public: iterator_base(BufferType& b, framecnt_t o) : buffer(b), offset(o) {} inline EventType operator*() const { uint8_t* ev_start = buffer._data + offset + sizeof(TimeType); diff --git a/libs/ardour/ardour/named_selection.h b/libs/ardour/ardour/named_selection.h index f03db20574..c120848328 100644 --- a/libs/ardour/ardour/named_selection.h +++ b/libs/ardour/ardour/named_selection.h @@ -34,8 +34,9 @@ namespace ARDOUR class Session; class Playlist; -struct NamedSelection : public PBD::Stateful +class NamedSelection : public PBD::Stateful { +public: NamedSelection (std::string, std::list >&); NamedSelection (Session&, const XMLNode&); virtual ~NamedSelection (); diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index ff2ac35954..59b7ae406c 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -230,12 +230,14 @@ public: friend class Session; protected: - struct RegionReadLock : public Glib::RWLock::ReaderLock { + class RegionReadLock : public Glib::RWLock::ReaderLock { + public: RegionReadLock (Playlist *pl) : Glib::RWLock::ReaderLock (pl->region_lock) {} ~RegionReadLock() {} }; - struct RegionWriteLock : public Glib::RWLock::WriterLock { + class RegionWriteLock : public Glib::RWLock::WriterLock { + public: RegionWriteLock (Playlist *pl, bool do_block_notify = true) : Glib::RWLock::WriterLock (pl->region_lock) , playlist (pl) diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index 27f778b8ac..932ddc9176 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -16,7 +16,8 @@ namespace ARDOUR { class Slave; class Region; -struct SessionEvent { +class SessionEvent { +public: enum Type { SetTransportSpeed, SetTrackSpeed, diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 6ac9ebfe70..6d05bdbbd8 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -213,7 +213,8 @@ namespace ARDOUR { timecode_60 }; - struct AnyTime { + class AnyTime { + public: enum Type { Timecode, BBT, diff --git a/libs/ardour/export_format_manager.cc b/libs/ardour/export_format_manager.cc index f995bc1b0e..23a77925fe 100644 --- a/libs/ardour/export_format_manager.cc +++ b/libs/ardour/export_format_manager.cc @@ -239,7 +239,7 @@ ExportFormatManager::add_format (ExportFormatPtr ptr) boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (ptr)) { + if ((hsf = boost::dynamic_pointer_cast (ptr))) { hsf->SampleFormatSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_sample_format_selection, this, _1, _2)); hsf->DitherTypeSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_dither_type_selection, this, _1, _2)); } @@ -682,7 +682,7 @@ ExportFormatManager::selection_changed () } boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast (get_selected_format()))) { SampleFormatList sf_list = hsf->get_sample_formats(); for (SampleFormatList::iterator it = sf_list.begin(); it != sf_list.end(); ++it) { @@ -747,7 +747,7 @@ ExportFormatManager::get_selected_sample_format () { boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast (get_selected_format()))) { return hsf->get_selected_sample_format (); } else { return SampleFormatPtr (); diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 1560e96a97..0e0c508a58 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -112,7 +112,9 @@ mix_buffers_no_gain_t ARDOUR::mix_buffers_no_gain = 0; PBD::Signal1 ARDOUR::BootMessage; -void ARDOUR::setup_enum_writer (); +namespace ARDOUR { +extern void setup_enum_writer (); +} /* this is useful for quite a few things that want to check if any bounds-related property has changed @@ -277,7 +279,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization) Stateful::current_state_version = CURRENT_SESSION_FILE_VERSION; - setup_enum_writer (); + ARDOUR::setup_enum_writer (); // allow ardour the absolute maximum number of open files lotsa_files_please (); diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc index 4bbedcecd8..9aa36304a6 100644 --- a/libs/ardour/midi_playlist.cc +++ b/libs/ardour/midi_playlist.cc @@ -21,6 +21,7 @@ #include #include +#include #include @@ -257,10 +258,7 @@ MidiPlaylist::read (Evoral::EventSink& dst, framepos_t start, framec } else { if (new_tracker) { - pair newpair; - newpair.first = mr.get(); - newpair.second = tracker; - _note_trackers.insert (newpair).first; + _note_trackers.insert (make_pair (mr.get(), tracker)); DEBUG_TRACE (DEBUG::MidiPlaylistIO, "\tadded tracker to trackers\n"); } } diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc index 4ad563eec9..30f42aba19 100644 --- a/libs/ardour/midi_ring_buffer.cc +++ b/libs/ardour/midi_ring_buffer.cc @@ -25,9 +25,10 @@ #include "ardour/event_type_map.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /** Read a block of MIDI events from this buffer into a MidiBuffer. * * Timestamps of events returned are relative to start (i.e. event with stamp 0 @@ -279,3 +280,4 @@ MidiRingBuffer::reset_tracker () template class MidiRingBuffer; +} // namespace ARDOUR diff --git a/libs/audiographer/audiographer/process_context.h b/libs/audiographer/audiographer/process_context.h index b73f5d69d5..df00812c01 100644 --- a/libs/audiographer/audiographer/process_context.h +++ b/libs/audiographer/audiographer/process_context.h @@ -121,8 +121,9 @@ protected: /// A process context that allocates and owns it's data buffer template -struct AllocatingProcessContext : public ProcessContext +class AllocatingProcessContext : public ProcessContext { +public: /// Allocates uninitialized memory AllocatingProcessContext (framecnt_t frames, ChannelCount channels) : ProcessContext (new T[frames], frames, channels) {} diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index c54c231ca7..f7eba87ba6 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -35,7 +35,8 @@ class Curve; /** A single event (time-stamped value) for a control */ -struct ControlEvent { +class ControlEvent { +public: ControlEvent (double w, double v) : when (w), value (v), coeff (0) {} diff --git a/libs/evoral/evoral/Event.hpp b/libs/evoral/evoral/Event.hpp index 5c287fd714..747b795480 100644 --- a/libs/evoral/evoral/Event.hpp +++ b/libs/evoral/evoral/Event.hpp @@ -44,7 +44,8 @@ void init_event_id_counter(event_id_t n); * Template parameter Time is the type of the time stamp used for this event. */ template -struct Event { +class Event { +public: #ifdef EVORAL_EVENT_ALLOC Event (EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false); diff --git a/libs/evoral/evoral/EventRingBuffer.hpp b/libs/evoral/evoral/EventRingBuffer.hpp index 11d487f778..8fec622243 100644 --- a/libs/evoral/evoral/EventRingBuffer.hpp +++ b/libs/evoral/evoral/EventRingBuffer.hpp @@ -47,7 +47,7 @@ public: EventRingBuffer(size_t capacity) : PBD::RingBufferNPT(capacity) {} - size_t capacity() const { return bufsize(); } + inline size_t capacity() const { return bufsize(); } /** Peek at the ringbuffer (read w/o advancing read pointer). * @return how much has been peeked (wraps around if read exceeds @@ -57,10 +57,10 @@ public: * read-pointer---^ * */ - bool peek (uint8_t*, size_t size); + inline bool peek (uint8_t*, size_t size); - uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf); - bool read (Time* time, EventType* type, uint32_t* size, uint8_t* buf); + inline uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf); + inline bool read (Time* time, EventType* type, uint32_t* size, uint8_t* buf); }; template diff --git a/libs/evoral/evoral/MIDIEvent.hpp b/libs/evoral/evoral/MIDIEvent.hpp index c695e7d7a9..e38f4f55db 100644 --- a/libs/evoral/evoral/MIDIEvent.hpp +++ b/libs/evoral/evoral/MIDIEvent.hpp @@ -36,7 +36,8 @@ namespace Evoral { * valid MIDI data for these functions to make sense. */ template -struct MIDIEvent : public Event