diff options
Diffstat (limited to 'libs')
26 files changed, 55 insertions, 41 deletions
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h index 2bf614e75f..e84349c647 100644 --- a/libs/ardour/ardour/bundle.h +++ b/libs/ardour/ardour/bundle.h @@ -149,8 +149,9 @@ class Bundle : public PBD::ScopedConnectionList Change _pending_change; }; -struct BundleChannel +class BundleChannel { +public: BundleChannel () : channel (-1) {} BundleChannel (boost::shared_ptr<Bundle> 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<typename BufferType, typename EventType> - struct iterator_base { + class iterator_base { + public: iterator_base<BufferType, EventType>(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<boost::shared_ptr<Playlist> >&); 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<HasSampleFormat> hsf; - if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (ptr)) { + if ((hsf = boost::dynamic_pointer_cast<HasSampleFormat> (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<HasSampleFormat> hsf; - if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast<HasSampleFormat> (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<HasSampleFormat> hsf; - if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast<HasSampleFormat> (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<void,std::string> 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 <algorithm> #include <iostream> +#include <utility> #include <stdlib.h> @@ -257,10 +258,7 @@ MidiPlaylist::read (Evoral::EventSink<framepos_t>& dst, framepos_t start, framec } else { if (new_tracker) { - pair<Region*,MidiStateTracker*> 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<T>::reset_tracker () template class MidiRingBuffer<framepos_t>; +} // 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 <typename T = DefaultSampleType> -struct AllocatingProcessContext : public ProcessContext<T> +class AllocatingProcessContext : public ProcessContext<T> { +public: /// Allocates uninitialized memory AllocatingProcessContext (framecnt_t frames, ChannelCount channels) : ProcessContext<T> (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<typename Time> -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<uint8_t>(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---^ * </pre> */ - 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<typename Time> 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<typename Time> -struct MIDIEvent : public Event<Time> { +class MIDIEvent : public Event<Time> { +public: MIDIEvent(EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false) : Event<Time>(type, time, size, buf, alloc) {} diff --git a/libs/evoral/src/libsmf/smf_save.c b/libs/evoral/src/libsmf/smf_save.c index 0540232707..b99af75461 100644 --- a/libs/evoral/src/libsmf/smf_save.c +++ b/libs/evoral/src/libsmf/smf_save.c @@ -180,7 +180,6 @@ smf_format_vlq(unsigned char *buf, int length, unsigned long value) } assert(i <= length); - length = length; // get rid of stupid gcc warnings about unused params if assert() is null /* + 1, because "i" is an offset, not a count. */ return (i + 1); diff --git a/libs/gtkmm2ext/gtkmm2ext/gui_thread.h b/libs/gtkmm2ext/gtkmm2ext/gui_thread.h index 16dc0600a1..1e98a32b7b 100644 --- a/libs/gtkmm2ext/gtkmm2ext/gui_thread.h +++ b/libs/gtkmm2ext/gtkmm2ext/gui_thread.h @@ -26,7 +26,7 @@ #include <boost/bind/protect.hpp> namespace sigc { - class trackable; + struct trackable; } #define ENSURE_GUI_THREAD(obj,method, ...) if (!Gtkmm2ext::UI::instance()->caller_is_self()) { abort (); } diff --git a/libs/midi++2/jack_midi_port.cc b/libs/midi++2/jack_midi_port.cc index 05eebc5aa1..9d7fb8c70e 100644 --- a/libs/midi++2/jack_midi_port.cc +++ b/libs/midi++2/jack_midi_port.cc @@ -40,6 +40,10 @@ using namespace MIDI; using namespace std; using namespace PBD; +namespace Evoral { +template class EventRingBuffer<timestamp_t>; +} + pthread_t JackMIDIPort::_process_thread; Signal0<void> JackMIDIPort::JackHalted; Signal0<void> JackMIDIPort::MakeConnections; diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h index 0441626565..32cf1163e6 100644 --- a/libs/midi++2/midi++/ipmidi_port.h +++ b/libs/midi++2/midi++/ipmidi_port.h @@ -37,9 +37,6 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" -#include "evoral/Event.hpp" -#include "evoral/EventRingBuffer.hpp" - #include "midi++/types.h" #include "midi++/parser.h" #include "midi++/port.h" diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index 03abd1a41c..89b0e283dc 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -29,9 +29,6 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" -#include "evoral/Event.hpp" -#include "evoral/EventRingBuffer.hpp" - #include "midi++/types.h" #include "midi++/parser.h" diff --git a/libs/midi++2/mtc.cc b/libs/midi++2/mtc.cc index d1bb7c9bad..affe65ec68 100644 --- a/libs/midi++2/mtc.cc +++ b/libs/midi++2/mtc.cc @@ -300,7 +300,7 @@ Parser::process_mtc_quarter_frame (byte *msg) switch (_mtc_running) { case MTC_Forward: - if ((which_quarter_frame == 7)) { + if (which_quarter_frame == 7) { /* we've reached the final of 8 quarter frame messages. store the time, reset the pending time holder, diff --git a/libs/surfaces/control_protocol/control_protocol/control_protocol.h b/libs/surfaces/control_protocol/control_protocol/control_protocol.h index 155c9236da..0c849064bb 100644 --- a/libs/surfaces/control_protocol/control_protocol/control_protocol.h +++ b/libs/surfaces/control_protocol/control_protocol/control_protocol.h @@ -146,7 +146,8 @@ class ControlProtocol : public PBD::Stateful, public PBD::ScopedConnectionList, }; extern "C" { - struct ControlProtocolDescriptor { + class ControlProtocolDescriptor { + public: const char* name; /* descriptive */ const char* id; /* unique and version-specific */ void* ptr; /* protocol can store a value here */ |