diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 478fe2cddd..88a76aa51d 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -37,11 +37,12 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; #define GAIN_COEFF_DELTA (1e-5) +namespace ARDOUR { + Amp::Amp (Session& s, const std::string& name, boost::shared_ptr gc, bool control_midi_also) : Processor(s, "Amp") , _apply_gain_automation(false) @@ -412,3 +413,5 @@ Amp::set_gain_automation_buffer (gain_t* g) { _gain_automation_buffer = g; } + +} // namespace ARDOUR diff --git a/libs/ardour/analyser.cc b/libs/ardour/analyser.cc index b5a9d08e81..7fcba66f58 100644 --- a/libs/ardour/analyser.cc +++ b/libs/ardour/analyser.cc @@ -33,9 +33,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + Analyser* Analyser::the_analyser = 0; Glib::Threads::Mutex Analyser::analysis_active_lock; Glib::Threads::Mutex Analyser::analysis_queue_lock; @@ -137,3 +138,5 @@ Analyser::flush () Glib::Threads::Mutex::Lock la (analysis_active_lock); analysis_queue.clear(); } + +} // namespace ARDOUR diff --git a/libs/ardour/analysis_graph.cc b/libs/ardour/analysis_graph.cc index df204a46e3..882f2cfedc 100644 --- a/libs/ardour/analysis_graph.cc +++ b/libs/ardour/analysis_graph.cc @@ -31,9 +31,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace AudioGrapher; +namespace ARDOUR { + AnalysisGraph::AnalysisGraph (Session *s) : _session (s) , _max_chunksize (8192) @@ -159,3 +160,5 @@ AnalysisGraph::analyze_range (boost::shared_ptr route, boost::shared_ptr< _results.insert (std::make_pair (name, analyser->result ())); } } + +} // namespace ARDOUR diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h index cf035133ea..00a661999d 100644 --- a/libs/ardour/ardour/bundle.h +++ b/libs/ardour/ardour/bundle.h @@ -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__ */ diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h index a62d5dc70f..438d5abaa1 100644 --- a/libs/ardour/ardour/chan_count.h +++ b/libs/ardour/ardour/chan_count.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__ diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h index 21838a1221..ef7344c9ed 100644 --- a/libs/ardour/ardour/chan_mapping.h +++ b/libs/ardour/ardour/chan_mapping.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__ diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 8b4b55f6e4..22a0ac98c1 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.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__ */ diff --git a/libs/ardour/ardour/presentation_info.h b/libs/ardour/ardour/presentation_info.h index 023b947730..05da7bb0a3 100644 --- a/libs/ardour/ardour/presentation_info.h +++ b/libs/ardour/ardour/presentation_info.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__ */ diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 69e1af1473..726f4a94e0 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.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) diff --git a/libs/ardour/async_midi_port.cc b/libs/ardour/async_midi_port.cc index 8c227c50dc..a00f7b9c19 100644 --- a/libs/ardour/async_midi_port.cc +++ b/libs/ardour/async_midi_port.cc @@ -34,10 +34,11 @@ #include "ardour/midi_buffer.h" using namespace MIDI; -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + pthread_t AsyncMIDIPort::_process_thread; #define port_engine AudioEngine::instance()->port_engine() @@ -119,7 +120,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes) * buffer */ - if (ARDOUR::Port::sends_output()) { + if (Port::sends_output()) { flush_output_fifo (nframes); if (_flush_at_cycle_start) { flush_buffers (nframes); @@ -130,7 +131,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes) and if necessary wakeup the reader */ - if (ARDOUR::Port::receives_input()) { + if (Port::receives_input()) { void* buffer = port_engine.get_buffer (_port_handle, nframes); const pframes_t event_count = port_engine.get_midi_event_count (buffer); @@ -169,7 +170,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes) void AsyncMIDIPort::cycle_end (MIDI::pframes_t nframes) { - if (ARDOUR::Port::sends_output() && !_flush_at_cycle_start) { + if (Port::sends_output() && !_flush_at_cycle_start) { /* move any additional data from output FIFO into the port buffer. */ @@ -219,7 +220,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t { int ret = 0; - if (!ARDOUR::Port::sends_output()) { + if (!Port::sends_output()) { return ret; } @@ -304,7 +305,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t _last_write_timestamp = timestamp; } else { - cerr << "AsyncMIDIPort (" << ARDOUR::Port::name() << "): write of " << msglen << " @ " << timestamp << " failed\n" << endl; + cerr << "AsyncMIDIPort (" << Port::name() << "): write of " << msglen << " @ " << timestamp << " failed\n" << endl; PBD::stacktrace (cerr, 20); ret = 0; } @@ -321,7 +322,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t int AsyncMIDIPort::read (MIDI::byte *, size_t) { - if (!ARDOUR::Port::receives_input()) { + if (!Port::receives_input()) { return 0; } @@ -360,3 +361,5 @@ AsyncMIDIPort::is_process_thread() { return pthread_equal (pthread_self(), _process_thread); } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_buffer.cc b/libs/ardour/audio_buffer.cc index afc1e14cca..dd01032419 100644 --- a/libs/ardour/audio_buffer.cc +++ b/libs/ardour/audio_buffer.cc @@ -27,7 +27,8 @@ #include "pbd/i18n.h" using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { AudioBuffer::AudioBuffer(size_t capacity) : Buffer (DataType::AUDIO) @@ -94,3 +95,5 @@ AudioBuffer::silence (samplecnt_t len, samplecnt_t offset) { } _written = true; } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc index c9ada69fa0..6b70fe73d1 100644 --- a/libs/ardour/audio_library.cc +++ b/libs/ardour/audio_library.cc @@ -47,7 +47,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { namespace { const char* const sfdb_file_name = "sfdb"; @@ -180,3 +181,5 @@ AudioLibrary::search_members_and (vector& members, const vector& } #endif } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index ee0f3d1c07..aac4ca1426 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -34,10 +34,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + AudioPlaylist::AudioPlaylist (Session& session, const XMLNode& node, bool hidden) : Playlist (session, node, DataType::AUDIO, hidden) { @@ -584,3 +585,5 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version) } } } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc index 974a6f272a..ef71485849 100644 --- a/libs/ardour/audio_playlist_importer.cc +++ b/libs/ardour/audio_playlist_importer.cc @@ -37,7 +37,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /**** Handler ***/ AudioPlaylistImportHandler::AudioPlaylistImportHandler (XMLTree const & source, Session & session, AudioRegionImportHandler & region_handler, const char * nodename) : @@ -268,3 +269,5 @@ UnusedAudioPlaylistImportHandler::get_info () const { return _("Audio Playlists (unused)"); } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc index 0796f77e80..b013aa322b 100644 --- a/libs/ardour/audio_playlist_source.cc +++ b/libs/ardour/audio_playlist_source.cc @@ -41,9 +41,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + AudioPlaylistSource::AudioPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr p, uint32_t chn, sampleoffset_t begin, samplecnt_t len, Source::Flag flags) : Source (s, DataType::AUDIO, name) @@ -197,7 +198,7 @@ AudioPlaylistSource::sample_rate () const int AudioPlaylistSource::setup_peakfile () { - _peak_path = Glib::build_filename (_session.session_directory().peak_path(), name() + ARDOUR::peakfile_suffix); + _peak_path = Glib::build_filename (_session.session_directory().peak_path(), name() + peakfile_suffix); return initialize_peakfile (string()); } @@ -207,4 +208,4 @@ AudioPlaylistSource::construct_peak_filepath (const string& /*audio_path_*/, con return _peak_path; } - +} // namespace ARDOUR diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc index 313eeadf29..6fc5c6ca7a 100644 --- a/libs/ardour/audio_port.cc +++ b/libs/ardour/audio_port.cc @@ -30,12 +30,13 @@ #include "ardour/port_engine.h" #include "ardour/rc_configuration.h" -using namespace ARDOUR; using namespace std; #define ENGINE AudioEngine::instance() #define port_engine AudioEngine::instance()->port_engine() +namespace ARDOUR { + AudioPort::AudioPort (const std::string& name, PortFlags flags) : Port (name, DataType::AUDIO, flags) , _buffer (new AudioBuffer (0)) @@ -154,3 +155,5 @@ AudioPort::engine_get_whole_audio_buffer () assert (_port_handle); return (Sample *) port_engine.get_buffer (_port_handle, ENGINE->samples_per_cycle()); } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_region_importer.cc b/libs/ardour/audio_region_importer.cc index 94a30527e8..7b4a70edb8 100644 --- a/libs/ardour/audio_region_importer.cc +++ b/libs/ardour/audio_region_importer.cc @@ -39,7 +39,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /**** Handler ***/ AudioRegionImportHandler::AudioRegionImportHandler (XMLTree const & source, Session & session) : @@ -396,3 +397,5 @@ AudioRegionImporter::get_xml () return xml_region; } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index efa87562c8..a6a340ca34 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -55,9 +55,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + AudioTrack::AudioTrack (Session& sess, string name, TrackMode mode) : Track (sess, name, PresentationInfo::AudioTrack, mode) { @@ -463,3 +464,5 @@ AudioTrack::write_source (uint32_t n) assert (_disk_writer); return _disk_writer->audio_write_source (n); } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc index 2e15cb3cb8..a195fce219 100644 --- a/libs/ardour/audio_track_importer.cc +++ b/libs/ardour/audio_track_importer.cc @@ -37,7 +37,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /*** AudioTrackImportHandler ***/ @@ -406,3 +407,5 @@ AudioTrackImporter::rate_convert_events (XMLNode & node) return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index c5d70ffe7f..de40a4f3a9 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -79,7 +79,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { AUPluginInfo::CachedInfoMap AUPluginInfo::cached_info; @@ -3510,3 +3511,5 @@ AUPlugin::parameter_change_listener (void* /*arg*/, void* src, const AudioUnitEv break; } } + +} // namespace ARDOUR diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc index bccd6c3e06..58dbff45ad 100644 --- a/libs/ardour/audioanalyser.cc +++ b/libs/ardour/audioanalyser.cc @@ -40,7 +40,8 @@ using namespace std; using namespace Vamp; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { AudioAnalyser::AudioAnalyser (float sr, AnalysisPluginKey key) : sample_rate (sr) @@ -167,3 +168,4 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel) return ret; } +} // namespace ARDOUR diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 6ed04adae6..8f073cbd36 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -67,9 +67,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + AudioEngine* AudioEngine::_instance = 0; static GATOMIC_QUAL gint audioengine_thread_cnt = 1; @@ -1697,3 +1698,5 @@ AudioEngine::add_pending_port_deletion (Port* p) delete p; } } + +} // namespace ARDOUR diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 29e02ff197..3f698a7227 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -67,10 +67,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace Glib; +namespace ARDOUR { + PBD::Signal0 AudioFileSource::HeaderPositionOffsetChanged; samplecnt_t AudioFileSource::header_position_offset = 0; @@ -374,3 +375,4 @@ AudioFileSource::get_interleave_buffer (samplecnt_t size) return ssb->buf; } +} // namespace ARDOUR diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index a4afb2abd2..cd96348c98 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -60,23 +60,22 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; namespace ARDOUR { - namespace Properties { - PBD::PropertyDescriptor envelope_active; - PBD::PropertyDescriptor default_fade_in; - PBD::PropertyDescriptor default_fade_out; - PBD::PropertyDescriptor fade_in_active; - PBD::PropertyDescriptor fade_out_active; - PBD::PropertyDescriptor scale_amplitude; - PBD::PropertyDescriptor > fade_in; - PBD::PropertyDescriptor > inverse_fade_in; - PBD::PropertyDescriptor > fade_out; - PBD::PropertyDescriptor > inverse_fade_out; - PBD::PropertyDescriptor > envelope; - } + +namespace Properties { +PBD::PropertyDescriptor envelope_active; +PBD::PropertyDescriptor default_fade_in; +PBD::PropertyDescriptor default_fade_out; +PBD::PropertyDescriptor fade_in_active; +PBD::PropertyDescriptor fade_out_active; +PBD::PropertyDescriptor scale_amplitude; +PBD::PropertyDescriptor > fade_in; +PBD::PropertyDescriptor > inverse_fade_in; +PBD::PropertyDescriptor > fade_out; +PBD::PropertyDescriptor > inverse_fade_out; +PBD::PropertyDescriptor > envelope; } /* Curve manipulations */ @@ -1991,3 +1990,4 @@ AudioRegion::verify_xfade_bounds (samplecnt_t len, bool start) } +} // namespace ARDOUR diff --git a/libs/ardour/audiorom.cc b/libs/ardour/audiorom.cc index a4f54ea195..2e0d375648 100644 --- a/libs/ardour/audiorom.cc +++ b/libs/ardour/audiorom.cc @@ -22,7 +22,7 @@ #include "ardour/audiorom.h" #include "ardour/runtime_functions.h" -using namespace ARDOUR; +namespace ARDOUR { AudioRom::AudioRom (Sample* rom, size_t size) : _size (size) @@ -55,3 +55,5 @@ AudioRom::read (Sample* dst, samplepos_t pos, samplecnt_t cnt, int channel) cons copy_vector (dst, &_rom[pos], to_copy); return to_copy; } + +} // namespace ARDOUR diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index b5bd48c12c..e97e03aeda 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -69,9 +69,10 @@ #include "ardour/debug.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + bool AudioSource::_build_missing_peakfiles = false; /** true if we want peakfiles (e.g. if we are displaying a GUI) */ @@ -1135,3 +1136,5 @@ AudioSource::mark_streaming_write_completed (const Lock& lock) PeaksReady (); /* EMIT SIGNAL */ } } + +} // namespace ARDOUR diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index cd908bc9e9..f4464649e8 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -43,11 +43,12 @@ #include "ardour/session.h" using namespace std; -using namespace ARDOUR; using namespace PBD; #include "pbd/i18n.h" +namespace ARDOUR { + Auditioner::Auditioner (Session& s) : Track (s, "auditioner", PresentationInfo::Auditioner) , current_sample (0) @@ -608,3 +609,4 @@ Auditioner::monitoring_state () const return MonitoringDisk; } +} // namespace ARDOUR diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc index 263b35f35d..4d277161b8 100644 --- a/libs/ardour/automatable.cc +++ b/libs/ardour/automatable.cc @@ -47,9 +47,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /* used for templates (previously: !full_state) */ bool Automatable::skip_saving_automation = false; @@ -716,3 +717,5 @@ Automatable::find_prev_ac_event (boost::shared_ptr c, double ++i; } } + +} // namespace ARDOUR diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 56f7b1be3a..3287f822ad 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -44,9 +44,10 @@ #endif using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + AutomationControl::AutomationControl(ARDOUR::Session& session, const Evoral::Parameter& parameter, const ParameterDescriptor& desc, @@ -386,3 +387,5 @@ AutomationControl::check_rt (double val, Controllable::GroupControlDisposition g return false; } + +} // namespace ARDOUR diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index 4d03de9686..828bdf819a 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -45,9 +45,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PBD::Signal1 AutomationList::AutomationListCreated; #if 0 @@ -583,3 +584,5 @@ AutomationListProperty::clone () const boost::shared_ptr (new AutomationList (*this->_current.get())) ); } + +} // namespace ARDOUR diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc index ea602a29c5..1ee11825e2 100644 --- a/libs/ardour/automation_watch.cc +++ b/libs/ardour/automation_watch.cc @@ -32,9 +32,10 @@ #include "ardour/debug.h" #include "ardour/session.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + AutomationWatch* AutomationWatch::_instance = 0; AutomationWatch& @@ -244,3 +245,5 @@ AutomationWatch::transport_state_change () } } } + +} // namespace ARDOUR diff --git a/libs/ardour/buffer_manager.cc b/libs/ardour/buffer_manager.cc index 59cf874aea..e7a561ba2a 100644 --- a/libs/ardour/buffer_manager.cc +++ b/libs/ardour/buffer_manager.cc @@ -25,9 +25,10 @@ #include "ardour/buffer_manager.h" #include "ardour/thread_buffers.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + RingBufferNPT* BufferManager::thread_buffers = 0; std::list* BufferManager::thread_buffers_list = 0; Glib::Threads::Mutex BufferManager::rb_mutex; @@ -84,3 +85,5 @@ BufferManager::ensure_buffers (ChanCount howmany, size_t custom) (*i)->ensure_buffers (howmany, custom); } } + +} // namespace ARDOUR diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc index b165155e90..4740e84542 100644 --- a/libs/ardour/bundle.cc +++ b/libs/ardour/bundle.cc @@ -29,9 +29,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /** Construct an audio bundle. * @param i true if ports are inputs, otherwise false. */ @@ -688,3 +689,5 @@ Bundle::overall_channel_to_type (DataType t, uint32_t c) const return s; } + +} diff --git a/libs/ardour/caimportable.cc b/libs/ardour/caimportable.cc index f9137f4f38..c957ba78de 100644 --- a/libs/ardour/caimportable.cc +++ b/libs/ardour/caimportable.cc @@ -23,10 +23,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + CAImportableSource::CAImportableSource (const string& path) { try { @@ -142,3 +143,5 @@ CAImportableSource::natural_position () const // TODO: extract timecode, if any return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/chan_count.cc b/libs/ardour/chan_count.cc index 6324f8c0fb..709c62150f 100644 --- a/libs/ardour/chan_count.cc +++ b/libs/ardour/chan_count.cc @@ -64,10 +64,11 @@ ChanCount::state(const std::string& name) const } // Statics -const ChanCount ChanCount::ZERO = ChanCount(); +const ChanCount ChanCount::ZERO = ChanCount(); + +std::ostream& operator<<(std::ostream& o, const ChanCount& c) { + return o << "AUDIO=" << c.n_audio() << ":MIDI=" << c.n_midi(); +} } // namespace ARDOUR -std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c) { - return o << "AUDIO=" << c.n_audio() << ":MIDI=" << c.n_midi(); -} diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc index d907efe732..02817fcb62 100644 --- a/libs/ardour/chan_mapping.cc +++ b/libs/ardour/chan_mapping.cc @@ -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 diff --git a/libs/ardour/circular_buffer.cc b/libs/ardour/circular_buffer.cc index 1e4896e9ae..9358ea24e3 100644 --- a/libs/ardour/circular_buffer.cc +++ b/libs/ardour/circular_buffer.cc @@ -19,7 +19,7 @@ #include "ardour/circular_buffer.h" #include "ardour/runtime_functions.h" -using namespace ARDOUR; +namespace ARDOUR { CircularSampleBuffer::CircularSampleBuffer (samplecnt_t size) : _rb (size) @@ -169,3 +169,5 @@ CircularEventBuffer::read (EventList& l) } return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/control_group.cc b/libs/ardour/control_group.cc index f3677c1af5..beada607ec 100644 --- a/libs/ardour/control_group.cc +++ b/libs/ardour/control_group.cc @@ -23,9 +23,10 @@ #include "ardour/control_group.h" #include "ardour/gain_control.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + ControlGroup::ControlGroup (Evoral::Parameter p) : _parameter (p) , _active (true) @@ -323,3 +324,5 @@ GainControlGroup::set_group_value (boost::shared_ptr control, } } } + +} // namespace ARDOUR diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 221e5632a5..900bdcbc47 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -39,12 +39,13 @@ #include "ardour/selection.h" #include "ardour/session.h" -using namespace ARDOUR; using namespace std; using namespace PBD; #include "pbd/i18n.h" +namespace ARDOUR { + ControlProtocolManager* ControlProtocolManager::_instance = 0; const string ControlProtocolManager::state_node_name = X_("ControlProtocols"); PBD::Signal1 ControlProtocolManager::StripableSelectionChanged; @@ -617,3 +618,5 @@ ControlProtocolManager::stripable_selection_changed (StripableNotificationListPt } } } + +} // namespace ARDOUR diff --git a/libs/ardour/convolver.cc b/libs/ardour/convolver.cc index 2f94950836..2b474b6f7a 100644 --- a/libs/ardour/convolver.cc +++ b/libs/ardour/convolver.cc @@ -35,10 +35,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace ARDOUR::DSP; using namespace ArdourZita; +namespace ARDOUR { + Convolution::Convolution (Session& session, uint32_t n_in, uint32_t n_out) : SessionHandleRef (session) , _n_samples (0) @@ -440,3 +441,5 @@ Convolver::run_stereo_no_latency (float* left, float* right, uint32_t n_samples) remain -= ns; } } + +} // namespace ARDOUR diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc index e2ad118151..8553edcb23 100644 --- a/libs/ardour/coreaudiosource.cc +++ b/libs/ardour/coreaudiosource.cc @@ -41,9 +41,10 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /** Create a new CoreAudioSource using session state, which implies that the * file must already exist. */ @@ -405,3 +406,5 @@ CoreAudioSource::set_path (const string& p) { FileSource::set_path (p); } + +} // namespace ARDOUR diff --git a/libs/ardour/default_click.cc b/libs/ardour/default_click.cc index 924100ee1f..b9dccfe7cb 100644 --- a/libs/ardour/default_click.cc +++ b/libs/ardour/default_click.cc @@ -24,7 +24,7 @@ #pragma warning(disable:4305) #endif -using namespace ARDOUR; +namespace ARDOUR { const Sample Session::default_click_emphasis[] = { @@ -4595,3 +4595,5 @@ const Sample Session::default_click[] = { }; const samplecnt_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]); + +} // namespace ARDOUR diff --git a/libs/ardour/delayline.cc b/libs/ardour/delayline.cc index 135b3795d4..83055ccefa 100644 --- a/libs/ardour/delayline.cc +++ b/libs/ardour/delayline.cc @@ -32,7 +32,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { DelayLine::DelayLine (Session& s, const std::string& name) : Processor (s, string_compose ("latcomp-%1-%2", name, this)) @@ -467,3 +468,5 @@ DelayLine::read_from_rb (Sample* rb, Sample* dst, samplecnt_t n_samples) copy_vector (&dst[s0], rb, s1); } } + +} // namespace ARDOUR diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index b0a6479c62..136b0d5a5b 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -44,11 +44,12 @@ namespace PBD { DEFINE_ENUM_CONVERT(ARDOUR::Delivery::Role); } -namespace ARDOUR { class Panner; } - using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { + +class Panner; PBD::Signal0 Delivery::PannersLegal; bool Delivery::panners_legal = false; @@ -628,3 +629,4 @@ Delivery::panner () const } } +} // namespace ARDOUR diff --git a/libs/ardour/disk_io.cc b/libs/ardour/disk_io.cc index 389fa58dcd..cb13a81a0d 100644 --- a/libs/ardour/disk_io.cc +++ b/libs/ardour/disk_io.cc @@ -39,10 +39,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + const string DiskIOProcessor::state_node_name = X_("DiskIOProcessor"); // PBD::Signal0 DiskIOProcessor::DiskOverrun; @@ -362,3 +363,4 @@ DiskIOProcessor::get_location_times(const Location* location, } } +} // namespace ARDOUR diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 03d34118a1..07da9efbd8 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -43,11 +43,12 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; -ARDOUR::samplecnt_t DiskReader::_chunk_samples = default_chunk_samples (); +namespace ARDOUR { + +samplecnt_t DiskReader::_chunk_samples = default_chunk_samples (); PBD::Signal0 DiskReader::Underrun; Sample* DiskReader::_sum_buffer = 0; Sample* DiskReader::_mixdown_buffer = 0; @@ -1961,3 +1962,5 @@ DiskReader::setup_preloop_buffer () } } } + +} // namespace ARDOUR diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index 8583431cc2..1deb25a1b7 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -39,10 +39,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + ARDOUR::samplecnt_t DiskWriter::_chunk_samples = DiskWriter::default_chunk_samples (); PBD::Signal0 DiskWriter::Overrun; @@ -1395,3 +1396,5 @@ DiskWriter::use_playlist (DataType dt, boost::shared_ptr playlist) } return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/dsp_filter.cc b/libs/ardour/dsp_filter.cc index 8ff5a35033..8f10db5da9 100644 --- a/libs/ardour/dsp_filter.cc +++ b/libs/ardour/dsp_filter.cc @@ -38,24 +38,25 @@ #define M_PI 3.14159265358979323846 #endif -using namespace ARDOUR::DSP; +namespace ARDOUR { +namespace DSP { void -ARDOUR::DSP::memset (float *data, const float val, const uint32_t n_samples) { +memset (float *data, const float val, const uint32_t n_samples) { for (uint32_t i = 0; i < n_samples; ++i) { data[i] = val; } } void -ARDOUR::DSP::mmult (float *data, float *mult, const uint32_t n_samples) { +mmult (float *data, float *mult, const uint32_t n_samples) { for (uint32_t i = 0; i < n_samples; ++i) { data[i] *= mult[i]; } } float -ARDOUR::DSP::log_meter (float power) { +log_meter (float power) { // compare to libs/ardour/log_meter.h static const float lower_db = -192.f; static const float upper_db = 0.f; @@ -64,18 +65,18 @@ ARDOUR::DSP::log_meter (float power) { } float -ARDOUR::DSP::log_meter_coeff (float coeff) { +log_meter_coeff (float coeff) { if (coeff <= 0) return 0; return log_meter (fast_coefficient_to_dB (coeff)); } void -ARDOUR::DSP::peaks (const float *data, float &min, float &max, uint32_t n_samples) { +peaks (const float *data, float &min, float &max, uint32_t n_samples) { ARDOUR::find_peaks (data, n_samples, &min, &max); } void -ARDOUR::DSP::process_map (BufferSet* bufs, const ChanCount& n_out, const ChanMapping& in_map, const ChanMapping& out_map, pframes_t nframes, samplecnt_t offset) +process_map (BufferSet* bufs, const ChanCount& n_out, const ChanMapping& in_map, const ChanMapping& out_map, pframes_t nframes, samplecnt_t offset) { /* PluginInsert already handles most, in particular `no-inplace` buffers in case * or x-over connections, and through connections. @@ -509,3 +510,6 @@ Generator::grandf () _rn = r * x2; return r * x1; } + +} // namespace DSP +} // namespace ARDOUR diff --git a/libs/ardour/ebur128_analysis.cc b/libs/ardour/ebur128_analysis.cc index 35b53882be..6d327d22bc 100644 --- a/libs/ardour/ebur128_analysis.cc +++ b/libs/ardour/ebur128_analysis.cc @@ -25,9 +25,10 @@ #include "pbd/i18n.h" using namespace Vamp; -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + /* need a static initializer function for this */ EBUr128Analysis::EBUr128Analysis (float sr) @@ -112,3 +113,5 @@ EBUr128Analysis::use_features (Plugin::FeatureSet& features, ostream* out) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/element_import_handler.cc b/libs/ardour/element_import_handler.cc index fcffdd0ff6..e870cbdd88 100644 --- a/libs/ardour/element_import_handler.cc +++ b/libs/ardour/element_import_handler.cc @@ -22,7 +22,8 @@ #include using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { bool ElementImportHandler::_dirty = false; bool ElementImportHandler::_errors = false; @@ -50,3 +51,5 @@ ElementImportHandler::remove_name (const string & name) { names.erase (name); } + +} // namespace ARDOUR diff --git a/libs/ardour/element_importer.cc b/libs/ardour/element_importer.cc index a2ba8aa22f..745e82b854 100644 --- a/libs/ardour/element_importer.cc +++ b/libs/ardour/element_importer.cc @@ -32,7 +32,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { Signal2,string, string> ElementImporter::Rename; Signal1 ElementImporter::Prompt; @@ -107,3 +108,5 @@ ElementImporter::rate_convert_samples (string const & samples) const { return to_string (rate_convert_samples (string_to(samples))); } + +} // namespace ARDOUR diff --git a/libs/ardour/engine_slave.cc b/libs/ardour/engine_slave.cc index 37f128ef03..24525d2d85 100644 --- a/libs/ardour/engine_slave.cc +++ b/libs/ardour/engine_slave.cc @@ -28,7 +28,8 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { Engine_TransportMaster::Engine_TransportMaster (AudioEngine& e) : TransportMaster (Engine, X_("JACK")) @@ -146,3 +147,4 @@ Engine_TransportMaster::update_interval () const return AudioEngine::instance()->samples_per_cycle(); } +} // namespace ARDOUR diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index a8b248b7de..bfb2934bb7 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -53,7 +53,6 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; using namespace MIDI; using namespace Timecode; diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index a6fb193324..d13263be53 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -34,7 +34,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { PortExportChannel::PortExportChannel () : _buffer_size (0) @@ -327,3 +327,5 @@ RouteExportChannel::ProcessorRemover::~ProcessorRemover() { route->remove_processor (processor); } + +} // namespace ARDOUR diff --git a/libs/ardour/export_failed.cc b/libs/ardour/export_failed.cc index 78ad4c67f5..4474d33519 100644 --- a/libs/ardour/export_failed.cc +++ b/libs/ardour/export_failed.cc @@ -24,10 +24,13 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { ExportFailed::ExportFailed (string const & reason) : reason (reason.c_str()) { PBD::error << string_compose (_("Export failed: %1"), reason) << endmsg; } + +} // namespace ARDOUR diff --git a/libs/ardour/export_preset.cc b/libs/ardour/export_preset.cc index ebc2b0004d..4ce4066520 100644 --- a/libs/ardour/export_preset.cc +++ b/libs/ardour/export_preset.cc @@ -24,7 +24,8 @@ #include "ardour/session.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { ExportPreset::ExportPreset (string filename, Session & s) : session (s), global (filename), local (0) @@ -162,3 +163,5 @@ ExportPreset::remove_instant_xml () const instant_xml->remove_nodes_and_delete ("id", _id.to_s()); } } + +} // namespace ARDOUR diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index 4deece2f49..b0a3c80ef5 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -52,10 +52,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace Glib; +namespace ARDOUR { + PBD::Signal2 > FileSource::AmbiguousFileName; FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag) @@ -607,4 +608,4 @@ FileSource::rename (const string& newpath) return 0; } - +} // namespace ARDOUR diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc index 040a1cab83..c569dc6a8b 100644 --- a/libs/ardour/filter.cc +++ b/libs/ardour/filter.cc @@ -36,9 +36,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + int Filter::make_new_sources (boost::shared_ptr region, SourceList& nsrcs, std::string suffix, bool use_session_sample_rate) { @@ -161,4 +162,4 @@ Filter::finish (boost::shared_ptr region, SourceList& nsrcs, string regi return 0; } - +} // namespace ARDOUR diff --git a/libs/ardour/fixed_delay.cc b/libs/ardour/fixed_delay.cc index b55e4f6f56..0a90b06e40 100644 --- a/libs/ardour/fixed_delay.cc +++ b/libs/ardour/fixed_delay.cc @@ -21,7 +21,7 @@ #include "ardour/fixed_delay.h" #include "ardour/midi_buffer.h" -using namespace ARDOUR; +namespace ARDOUR { FixedDelay::FixedDelay () : _max_delay (0) @@ -153,3 +153,5 @@ FixedDelay::delay ( db->pos = (db->pos + n_samples) % _buf_size; } + +} // namespace ARDOUR diff --git a/libs/ardour/fluid_synth.cc b/libs/ardour/fluid_synth.cc index ae29529194..ddc543c10d 100644 --- a/libs/ardour/fluid_synth.cc +++ b/libs/ardour/fluid_synth.cc @@ -19,7 +19,7 @@ #include "pbd/failed_constructor.h" #include "ardour/fluid_synth.h" -using namespace ARDOUR; +namespace ARDOUR { FluidSynth::FluidSynth (float samplerate, int polyphony) : _settings (0) @@ -141,3 +141,5 @@ FluidSynth::midi_event (uint8_t const* const data, size_t len) } return FLUID_OK == fluid_synth_handle_midi_event (_synth, _f_midi_event); } + +} // namespace ARDOUR diff --git a/libs/ardour/gain_control.cc b/libs/ardour/gain_control.cc index ab8ecf82ee..7b0a2f4744 100644 --- a/libs/ardour/gain_control.cc +++ b/libs/ardour/gain_control.cc @@ -32,9 +32,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + static std::string gain_control_name (Evoral::Parameter const& param) { switch (param.type()) { @@ -119,3 +120,5 @@ GainControl::get_masters_curve_locked (samplepos_t start, samplepos_t end, float } return SlavableAutomationControl::masters_curve_multiply (start, end, vec, veclen); } + +} // namespace ARDOUR diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 5d189b97fe..c021e32f0b 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -138,42 +138,41 @@ #include "pbd/i18n.h" -ARDOUR::RCConfiguration* ARDOUR::Config = 0; -ARDOUR::RuntimeProfile* ARDOUR::Profile = 0; -ARDOUR::AudioLibrary* ARDOUR::Library = 0; - -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + +RCConfiguration* Config = 0; +RuntimeProfile* Profile = 0; +AudioLibrary* Library = 0; + bool libardour_initialized = false; -compute_peak_t ARDOUR::compute_peak = 0; -find_peaks_t ARDOUR::find_peaks = 0; -apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0; -mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0; -mix_buffers_no_gain_t ARDOUR::mix_buffers_no_gain = 0; -copy_vector_t ARDOUR::copy_vector = 0; +compute_peak_t compute_peak = 0; +find_peaks_t find_peaks = 0; +apply_gain_to_buffer_t apply_gain_to_buffer = 0; +mix_buffers_with_gain_t mix_buffers_with_gain = 0; +mix_buffers_no_gain_t mix_buffers_no_gain = 0; +copy_vector_t copy_vector = 0; -PBD::Signal1 ARDOUR::BootMessage; -PBD::Signal3 ARDOUR::PluginScanMessage; -PBD::Signal1 ARDOUR::PluginScanTimeout; -PBD::Signal0 ARDOUR::GUIIdle; -PBD::Signal3 ARDOUR::CopyConfigurationFiles; +PBD::Signal1 BootMessage; +PBD::Signal3 PluginScanMessage; +PBD::Signal1 PluginScanTimeout; +PBD::Signal0 GUIIdle; +PBD::Signal3 CopyConfigurationFiles; -std::map ARDOUR::reserved_io_names; +std::map reserved_io_names; static bool have_old_configuration_files = false; static bool running_from_gui = false; -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 */ -PBD::PropertyChange ARDOUR::bounds_change; +PBD::PropertyChange bounds_change; static PBD::ScopedConnection engine_startup_connection; @@ -424,7 +423,7 @@ copy_configuration_files (string const& old_dir, string const& new_dir, int old_ } void -ARDOUR::check_for_old_configuration_files () +check_for_old_configuration_files () { int current_version = atoi (X_(PROGRAM_VERSION)); @@ -446,7 +445,7 @@ ARDOUR::check_for_old_configuration_files () } int -ARDOUR::handle_old_configuration_files (boost::function ui_handler) +handle_old_configuration_files (boost::function ui_handler) { if (have_old_configuration_files) { int current_version = atoi (X_(PROGRAM_VERSION)); @@ -464,7 +463,7 @@ ARDOUR::handle_old_configuration_files (boost::functioncontrol_protocol_state ()) != 0) { @@ -660,7 +659,7 @@ ARDOUR::init_post_engine (uint32_t start_cnt) } void -ARDOUR::cleanup () +cleanup () { if (!libardour_initialized) { return; @@ -669,8 +668,8 @@ ARDOUR::cleanup () engine_startup_connection.disconnect (); delete &ControlProtocolManager::instance (); - ARDOUR::AudioEngine::destroy (); - ARDOUR::TransportMasterManager::destroy (); + AudioEngine::destroy (); + TransportMasterManager::destroy (); delete Library; #ifdef HAVE_LRDF @@ -691,13 +690,13 @@ ARDOUR::cleanup () } bool -ARDOUR::no_auto_connect () +no_auto_connect () { return getenv ("ARDOUR_NO_AUTOCONNECT") != 0; } void -ARDOUR::setup_fpu () +setup_fpu () { FPU* fpu = FPU::instance (); @@ -788,15 +787,15 @@ ARDOUR::setup_fpu () static const bool translate_by_default = true; string -ARDOUR::translation_enable_path () +translation_enable_path () { return Glib::build_filename (user_config_directory (), ".translate"); } bool -ARDOUR::translations_are_enabled () +translations_are_enabled () { - int fd = g_open (ARDOUR::translation_enable_path ().c_str (), O_RDONLY, 0444); + int fd = g_open (translation_enable_path ().c_str (), O_RDONLY, 0444); if (fd < 0) { return translate_by_default; @@ -815,9 +814,9 @@ ARDOUR::translations_are_enabled () } bool -ARDOUR::set_translations_enabled (bool yn) +set_translations_enabled (bool yn) { - string i18n_enabler = ARDOUR::translation_enable_path (); + string i18n_enabler = translation_enable_path (); int fd = g_open (i18n_enabler.c_str (), O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd < 0) { @@ -840,7 +839,7 @@ ARDOUR::set_translations_enabled (bool yn) } vector -ARDOUR::get_available_sync_options () +get_available_sync_options () { vector ret; @@ -886,7 +885,7 @@ clock_gettime (int /*clk_id*/, struct timespec* t) #endif microseconds_t -ARDOUR::get_microseconds () +get_microseconds () { #ifdef PLATFORM_WINDOWS microseconds_t ret = 0; @@ -915,14 +914,16 @@ ARDOUR::get_microseconds () */ int -ARDOUR::format_data_width (ARDOUR::SampleFormat format) +format_data_width (SampleFormat format) { switch (format) { - case ARDOUR::FormatInt16: + case FormatInt16: return 16; - case ARDOUR::FormatInt24: + case FormatInt24: return 24; default: return 32; } } + +} // namespace ARDOUR diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index c815dd53e6..63263135f5 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -37,10 +37,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + #ifdef DEBUG_RT_ALLOC static Graph* graph = 0; @@ -78,9 +79,9 @@ Graph::Graph (Session& session) /* pre-allocate memory */ _trigger_queue.reserve (1024); - ARDOUR::AudioEngine::instance ()->Running.connect_same_thread (engine_connections, boost::bind (&Graph::reset_thread_list, this)); - ARDOUR::AudioEngine::instance ()->Stopped.connect_same_thread (engine_connections, boost::bind (&Graph::engine_stopped, this)); - ARDOUR::AudioEngine::instance ()->Halted.connect_same_thread (engine_connections, boost::bind (&Graph::engine_stopped, this)); + AudioEngine::instance ()->Running.connect_same_thread (engine_connections, boost::bind (&Graph::reset_thread_list, this)); + AudioEngine::instance ()->Stopped.connect_same_thread (engine_connections, boost::bind (&Graph::engine_stopped, this)); + AudioEngine::instance ()->Halted.connect_same_thread (engine_connections, boost::bind (&Graph::engine_stopped, this)); reset_thread_list (); @@ -450,7 +451,7 @@ Graph::helper_thread () g_atomic_int_inc (&_n_workers); guint id = g_atomic_uint_get (&_n_workers); - /* This is needed for ARDOUR::Session requests called from rt-processors + /* This is needed for Session requests called from rt-processors * in particular Lua scripts may do cross-thread calls */ if (!SessionEvent::has_per_thread_pool ()) { char name[64]; @@ -483,7 +484,7 @@ Graph::main_thread () suspend_rt_malloc_checks (); ProcessThread* pt = new ProcessThread (); - /* This is needed for ARDOUR::Session requests called from rt-processors + /* This is needed for Session requests called from rt-processors * in particular Lua scripts may do cross-thread calls */ if (!SessionEvent::has_per_thread_pool ()) { char name[64]; @@ -686,3 +687,5 @@ Graph::in_process_thread () const { return AudioEngine::instance ()->in_process_thread (); } + +} // namespace ARDOUR diff --git a/libs/ardour/graphnode.cc b/libs/ardour/graphnode.cc index a310f0a14f..17e25e7027 100644 --- a/libs/ardour/graphnode.cc +++ b/libs/ardour/graphnode.cc @@ -22,7 +22,7 @@ #include "ardour/graphnode.h" #include "ardour/route.h" -using namespace ARDOUR; +namespace ARDOUR { GraphNode::GraphNode (boost::shared_ptr graph) : _graph (graph) @@ -80,3 +80,5 @@ GraphNode::process () { _graph->process_one_route (dynamic_cast (this)); } + +} // namespace ARDOUR diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 74f17c17e5..75935cd7ca 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -74,9 +74,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + static boost::shared_ptr open_importable_source (const string& path, samplecnt_t samplerate, ARDOUR::SrcQuality quality) { @@ -653,3 +654,5 @@ Session::import_files (ImportStatus& status) status.done = true; } + +} // namespace ARDOUR diff --git a/libs/ardour/import_pt.cc b/libs/ardour/import_pt.cc index 2744d678ab..80dee710d6 100644 --- a/libs/ardour/import_pt.cc +++ b/libs/ardour/import_pt.cc @@ -51,11 +51,12 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace Glib; using std::string; +namespace ARDOUR { + /* Functions supporting the incorporation of PT sessions into ardour */ struct midipair { @@ -456,3 +457,5 @@ Session::import_pt_rest (PTFFormat& ptf) playlist->add_region (copy, f); } } + +} // namespace ARDOUR diff --git a/libs/ardour/instrument_info.cc b/libs/ardour/instrument_info.cc index 2d5a156d4a..5fb5ababf4 100644 --- a/libs/ardour/instrument_info.cc +++ b/libs/ardour/instrument_info.cc @@ -33,10 +33,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace MIDI::Name; using std::string; +namespace ARDOUR { + InstrumentInfo::InstrumentInfo () : _external_instrument_model (_("Unknown")) { @@ -312,3 +313,5 @@ InstrumentInfo::get_patches (uint8_t channel) { return MidiPatchManager::instance ().find_channel_name_set (model (), mode (), channel); } + +} // namespace ARDOUR diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc index 54d107f1dc..de1818247f 100644 --- a/libs/ardour/internal_return.cc +++ b/libs/ardour/internal_return.cc @@ -26,7 +26,8 @@ #include "ardour/route.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { InternalReturn::InternalReturn (Session& s, std::string const& name) : Processor (s, name) @@ -102,3 +103,5 @@ InternalReturn::configure_io (ChanCount in, ChanCount out) Processor::configure_io (in, out); return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 56970eca14..71a49006af 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -38,15 +38,14 @@ #include "pbd/i18n.h" -namespace ARDOUR { - class MuteMaster; - class Pannable; -} - using namespace PBD; -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + +class MuteMaster; +class Pannable; + PBD::Signal1 InternalSend::CycleStart; InternalSend::InternalSend (Session& s, @@ -532,3 +531,5 @@ InternalSend::cycle_start (pframes_t /*nframes*/) b->prepare (); } } + +} // namespace ARDOUR diff --git a/libs/ardour/interpolation.cc b/libs/ardour/interpolation.cc index f0400a951d..965cd993ef 100644 --- a/libs/ardour/interpolation.cc +++ b/libs/ardour/interpolation.cc @@ -28,10 +28,11 @@ #include "ardour/interpolation.h" #include "ardour/midi_buffer.h" -using namespace ARDOUR; using std::cerr; using std::endl; +namespace ARDOUR { + CubicInterpolation::CubicInterpolation () : valid_z_bits (0) { @@ -228,3 +229,5 @@ CubicInterpolation::distance (samplecnt_t nsamples) assert (phase.size () > 0); return floor (floor (phase[0]) + (_speed * nsamples)); } + +} // namespace ARDOUR diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 9b567e841d..25d5632c32 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -59,9 +59,10 @@ #define BLOCK_PROCESS_CALLBACK() Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock()) using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + const string IO::state_node_name = "IO"; bool IO::connecting_legal = false; PBD::Signal0 IO::ConnectingLegal; @@ -1791,3 +1792,5 @@ IO::has_port (boost::shared_ptr p) const Glib::Threads::Mutex::Lock lm (io_lock); return _ports.contains (p); } + +} // namespace ARDOUR diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc index 3dc6cf0c8d..d51f041da2 100644 --- a/libs/ardour/io_processor.cc +++ b/libs/ardour/io_processor.cc @@ -38,10 +38,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; -namespace ARDOUR { class Session; } +namespace ARDOUR { + +class Session; /* create an IOProcessor that proxies to a new IO object */ @@ -372,3 +373,5 @@ IOProcessor::prepare_for_reset (XMLNode &state, const std::string& name) } } } + +} // namespace ARDOUR diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 5c19f0cfff..a8bfacad65 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -61,9 +61,10 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + LadspaPlugin::LadspaPlugin (string module_path, AudioEngine& e, Session& session, uint32_t index, samplecnt_t rate) : Plugin (e, session) { @@ -959,5 +960,4 @@ LadspaPlugin::port_descriptor (uint32_t i) const return 0; } - - +} // namespace ARDOUR diff --git a/libs/ardour/latent.cc b/libs/ardour/latent.cc index c31b1ec545..ed8348c183 100644 --- a/libs/ardour/latent.cc +++ b/libs/ardour/latent.cc @@ -20,9 +20,9 @@ #include "ardour/latent.h" -using namespace ARDOUR; +namespace ARDOUR { -bool ARDOUR::Latent::_zero_latency = false; +bool Latent::_zero_latency = false; PBD::Signal0 Latent::DisableSwitchChanged; Latent::Latent () @@ -54,3 +54,5 @@ Latent::add_state (XMLNode* node) const node->set_property ("user-latency", _user_latency); node->set_property ("use-user-latency", _use_user_latency); } + +} // namespace ARDOUR diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 636f7d9154..1ba48be1d3 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -51,9 +51,10 @@ namespace PBD { } using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PBD::Signal0 Location::scene_changed; PBD::Signal1 Location::name_changed; PBD::Signal1 Location::end_changed; @@ -1612,3 +1613,5 @@ Locations::range_starts_at(samplepos_t pos, samplecnt_t slop, bool incl) const return closest; } + +} // namespace ARDOUR diff --git a/libs/ardour/location_importer.cc b/libs/ardour/location_importer.cc index 54aa568ef0..e8947890b5 100644 --- a/libs/ardour/location_importer.cc +++ b/libs/ardour/location_importer.cc @@ -32,7 +32,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /**** Handler ***/ LocationImportHandler::LocationImportHandler (XMLTree const & source, Session & session) : @@ -189,3 +190,5 @@ LocationImporter::_move () { session.locations()->add (location); } + +} // namespace ARDOUR diff --git a/libs/ardour/ltc_file_reader.cc b/libs/ardour/ltc_file_reader.cc index f64ba55609..723456e025 100644 --- a/libs/ardour/ltc_file_reader.cc +++ b/libs/ardour/ltc_file_reader.cc @@ -37,12 +37,13 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using std::string; #define BUFFER_SIZE 1024 // audio chunk size +namespace ARDOUR { + LTCReader::LTCReader (int expected_apv, LTC_TV_STANDARD tv_standard) : _position (0) { @@ -238,3 +239,5 @@ LTCFileReader::read_ltc (uint32_t channel, uint32_t max_frames) return rv; } + +} // namespace ARDOUR diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc index 6a2f71dacb..f15ebc0471 100644 --- a/libs/ardour/ltc_slave.cc +++ b/libs/ardour/ltc_slave.cc @@ -36,7 +36,6 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace MIDI; using namespace PBD; using namespace Timecode; @@ -44,6 +43,8 @@ using namespace Timecode; #define ENGINE AudioEngine::instance() #define FLYWHEEL_TIMEOUT ( 1 * ENGINE->sample_rate() ) +namespace ARDOUR { + /* XXX USE Config->get_ltc_input */ LTC_TransportMaster::LTC_TransportMaster (std::string const & name) @@ -264,6 +265,7 @@ LTC_TransportMaster::equal_ltc_sample_time(LTCFrame *a, LTCFrame *b) { } return true; } + static ostream& operator<< (ostream& ostr, LTCFrame& a) { ostr @@ -653,3 +655,5 @@ LTC_TransportMaster::delta_string() const return format_delta_time (_current_delta); } } + +} // namespace ARDOUR diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index aac281997c..5a2c22dc9b 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -354,7 +354,7 @@ CLASSKEYS(LuaDialog::ProgressWindow); * as LuaBridge's "WSPtrClass". */ -using namespace ARDOUR; +namespace ARDOUR { /** Access libardour global configuration */ static RCConfiguration* _libardour_config () { @@ -2968,3 +2968,5 @@ LuaBindings::set_session (lua_State* L, Session *s) if (cb_ses.type() == LUA_TFUNCTION) { cb_ses(s->name()); } // TODO args } } + +} // namespace ARDOUR diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 27df22e729..06f9b0c414 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -40,9 +40,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + LuaProc::LuaProc (AudioEngine& engine, Session& session, const std::string &script) @@ -1118,7 +1119,7 @@ XMLTree* LuaProc::presets_tree () const { XMLTree* t = new XMLTree; - std::string p = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string p = Glib::build_filename (user_config_directory (), "presets"); if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { if (g_mkdir_with_parents (p.c_str(), 0755) != 0) { @@ -1204,7 +1205,7 @@ LuaProc::do_save_preset (std::string name) { } t->root()->add_child_nocopy (*p); - std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string f = Glib::build_filename (user_config_directory (), "presets"); f = Glib::build_filename (f, presets_file ()); t->write (f); @@ -1219,7 +1220,7 @@ LuaProc::do_remove_preset (std::string name) return; } t->root()->remove_nodes_and_delete (X_("label"), name); - std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string f = Glib::build_filename (user_config_directory (), "presets"); f = Glib::build_filename (f, presets_file ()); t->write (f); } @@ -1299,7 +1300,7 @@ LuaPluginInfo::get_presets (bool /*user_only*/) const { std::vector p; XMLTree* t = new XMLTree; - std::string pf = Glib::build_filename (ARDOUR::user_config_directory (), "presets", string_compose ("lua-%1", unique_id)); + std::string pf = Glib::build_filename (user_config_directory (), "presets", string_compose ("lua-%1", unique_id)); if (Glib::file_test (pf, Glib::FILE_TEST_EXISTS)) { t->set_filename (pf); if (t->read ()) { @@ -1314,3 +1315,5 @@ LuaPluginInfo::get_presets (bool /*user_only*/) const delete t; return p; } + +} // namespace ARDOUR diff --git a/libs/ardour/luascripting.cc b/libs/ardour/luascripting.cc index bf26074011..5d3ecb78df 100644 --- a/libs/ardour/luascripting.cc +++ b/libs/ardour/luascripting.cc @@ -35,10 +35,11 @@ #include "pbd/i18n.h" #include "sha1.c" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + LuaScripting* LuaScripting::_instance = 0; LuaScripting& @@ -554,3 +555,5 @@ LuaScripting::user_script_dir () g_mkdir_with_parents (dir.c_str(), 0744); return dir; } + +} // namespace ARDOUR diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 43826c8f3f..21a2752f41 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -125,9 +125,10 @@ static const size_t NBUFS = 4; using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + bool LV2Plugin::force_state_save = false; int32_t LV2Plugin::_ui_style_flat = 0; int32_t LV2Plugin::_ui_style_boxy = 0; @@ -1593,10 +1594,10 @@ LV2Plugin::load_preset(PresetRecord r) } const void* -ARDOUR::lv2plugin_get_port_value(const char* port_symbol, - void* user_data, - uint32_t* size, - uint32_t* type) +lv2plugin_get_port_value(const char* port_symbol, + void* user_data, + uint32_t* size, + uint32_t* type) { LV2Plugin *plugin = (LV2Plugin *) user_data; @@ -2330,7 +2331,7 @@ LV2Plugin::get_parameter_descriptor(uint32_t which, ParameterDescriptor& desc) c } Plugin::IOPortDescription -LV2Plugin::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id) const +LV2Plugin::describe_io_port (DataType dt, bool input, uint32_t id) const { PortFlags match = 0; switch (dt) { @@ -3475,11 +3476,11 @@ LV2World::load_bundled_plugins(bool verbose) { if (!_bundle_checked) { if (verbose) { - cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl; + cout << "Scanning folders for bundled LV2s: " << lv2_bundled_search_path().to_string() << endl; } vector plugin_objects; - find_paths_matching_filter (plugin_objects, ARDOUR::lv2_bundled_search_path(), lv2_filter, 0, true, true, true); + find_paths_matching_filter (plugin_objects, lv2_bundled_search_path(), lv2_filter, 0, true, true, true); for ( vector::iterator x = plugin_objects.begin(); x != plugin_objects.end (); ++x) { #ifdef PLATFORM_WINDOWS string uri = "file:///" + *x + "/"; @@ -3498,7 +3499,7 @@ LV2World::load_bundled_plugins(bool verbose) LV2PluginInfo::LV2PluginInfo (const char* plugin_uri) { - type = ARDOUR::LV2; + type = LV2; _plugin_uri = strdup(plugin_uri); } @@ -3677,7 +3678,7 @@ LV2PluginInfo::discover() info->name = string(lilv_node_as_string(name)); lilv_node_free(name); - ARDOUR::PluginScanMessage(_("LV2"), info->name, false); + PluginScanMessage(_("LV2"), info->name, false); const LilvPluginClass* pclass = lilv_plugin_get_class(p); const LilvNode* label = lilv_plugin_class_get_label(pclass); @@ -3787,3 +3788,5 @@ LV2PluginInfo::is_analyzer () const } return PluginInfo::is_analyzer (); } + +} // namespace ARDOUR diff --git a/libs/ardour/lxvst_plugin.cc b/libs/ardour/lxvst_plugin.cc index 297f33be6b..fbf3e95fd1 100644 --- a/libs/ardour/lxvst_plugin.cc +++ b/libs/ardour/lxvst_plugin.cc @@ -29,9 +29,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id) : VSTPlugin (e, session, h) { @@ -169,6 +170,7 @@ LXVSTPluginInfo::get_presets (bool user_only) const LXVSTPluginInfo::LXVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo) { - type = ARDOUR::LXVST; + type = LXVST; } +} // namespace ARDOUR diff --git a/libs/ardour/mac_vst_plugin.cc b/libs/ardour/mac_vst_plugin.cc index fdaa77b391..cec1c3c175 100644 --- a/libs/ardour/mac_vst_plugin.cc +++ b/libs/ardour/mac_vst_plugin.cc @@ -27,9 +27,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MacVSTPlugin::MacVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id) : VSTPlugin (e, session, h) { @@ -175,3 +176,5 @@ MacVSTPluginInfo::MacVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo) { type = ARDOUR::MacVST; } + +} // namespace ARDOUR diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc index 0329365569..231045b76e 100644 --- a/libs/ardour/meter.cc +++ b/libs/ardour/meter.cc @@ -39,7 +39,7 @@ using namespace std; -using namespace ARDOUR; +namespace ARDOUR { PeakMeter::PeakMeter (Session& s, const std::string& name) : Processor (s, string_compose ("meter-%1", name)) @@ -470,3 +470,5 @@ PeakMeter::state () node.set_property ("type", "meter"); return node; } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_automation_list_binder.cc b/libs/ardour/midi_automation_list_binder.cc index 54487b97f9..123837fc84 100644 --- a/libs/ardour/midi_automation_list_binder.cc +++ b/libs/ardour/midi_automation_list_binder.cc @@ -23,7 +23,7 @@ #include "ardour/midi_source.h" #include "ardour/midi_model.h" -using namespace ARDOUR; +namespace ARDOUR { MidiAutomationListBinder::MidiAutomationListBinder (boost::shared_ptr s, Evoral::Parameter p) : _source (s) @@ -67,3 +67,5 @@ MidiAutomationListBinder::add_state (XMLNode* node) node->set_property ("source-id", _source->id().to_s()); node->set_property ("parameter", EventTypeMap::instance().to_symbol (_parameter)); } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc index 26616bc045..276fc99851 100644 --- a/libs/ardour/midi_buffer.cc +++ b/libs/ardour/midi_buffer.cc @@ -32,9 +32,10 @@ #include "ardour/port.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + // FIXME: mirroring for MIDI buffers? MidiBuffer::MidiBuffer(size_t capacity) : Buffer (DataType::MIDI) @@ -597,3 +598,5 @@ MidiBuffer::merge_in_place (const MidiBuffer &other) return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc index c650b993ed..3637643815 100644 --- a/libs/ardour/midi_clock_slave.cc +++ b/libs/ardour/midi_clock_slave.cc @@ -45,12 +45,13 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace MIDI; using namespace PBD; #define ENGINE AudioEngine::instance() +namespace ARDOUR { + MIDIClock_TransportMaster::MIDIClock_TransportMaster (std::string const & name, int ppqn) : TransportMaster (MIDIClock, name) , ppqn (ppqn) @@ -439,3 +440,4 @@ MIDIClock_TransportMaster::unregister_port () TransportMaster::unregister_port (); } +} // namespace ARDOUR diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index d26eabc2f3..8d32dbe2c0 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -55,9 +55,10 @@ namespace PBD { } using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MidiModel::MidiModel (boost::shared_ptr s) : AutomatableSequence(s->session()) { @@ -1825,3 +1826,5 @@ MidiModel::control_list_marked_dirty () ContentsChanged (); /* EMIT SIGNAL */ } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc index d1b3fcc15d..70a73910be 100644 --- a/libs/ardour/midi_patch_manager.cc +++ b/libs/ardour/midi_patch_manager.cc @@ -37,10 +37,11 @@ using namespace std; using namespace ARDOUR; -using namespace MIDI; -using namespace MIDI::Name; using namespace PBD; +namespace MIDI { +namespace Name { + MidiPatchManager* MidiPatchManager::_manager = 0; MidiPatchManager::MidiPatchManager () @@ -313,3 +314,6 @@ MidiPatchManager::maybe_use (PBD::ScopedConnectionList& cl, PatchesChanged.connect (cl, ir, midnam_info_method, event_loop); } } + +} // namespace Name +} // namespace MIDI diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc index 1724af59f2..fe9903dd6c 100644 --- a/libs/ardour/midi_playlist.cc +++ b/libs/ardour/midi_playlist.cc @@ -43,10 +43,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden) : Playlist (session, node, DataType::MIDI, hidden) , _note_mode(Sustained) @@ -384,3 +385,5 @@ MidiPlaylist::rendered () { return &_rendered; } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_playlist_source.cc b/libs/ardour/midi_playlist_source.cc index d9242bcf34..928cc263dd 100644 --- a/libs/ardour/midi_playlist_source.cc +++ b/libs/ardour/midi_playlist_source.cc @@ -30,20 +30,15 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; -namespace ARDOUR { -class MidiStateTracker; -class Session; -template class MidiRingBuffer; -} - namespace Evoral { template class EventSink; template class Event; } +namespace ARDOUR { + /******************************************************************************* As of May 2011, it appears too complex to support compound regions for MIDI because of the need to be able to edit the data represented by the region. It @@ -202,3 +197,5 @@ MidiPlaylistSource::empty () const { return !_playlist || _playlist->empty(); } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index e29a2e1735..72d267cd63 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -34,9 +34,10 @@ #include "ardour/session.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + #define port_engine AudioEngine::instance()->port_engine() MidiPort::MidiPort (const std::string& name, PortFlags flags) @@ -431,3 +432,5 @@ MidiPort::add_shadow_port (string const & name, MidiFilter mf) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 8e3444b1e5..4b2d21bbbd 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -57,14 +57,13 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; namespace ARDOUR { - namespace Properties { - PBD::PropertyDescriptor start_beats; - PBD::PropertyDescriptor length_beats; - } + +namespace Properties { +PBD::PropertyDescriptor start_beats; +PBD::PropertyDescriptor length_beats; } void @@ -835,3 +834,5 @@ MidiRegion::set_name (const std::string& str) return Region::set_name (str); } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_scene_change.cc b/libs/ardour/midi_scene_change.cc index 8d7b354a64..2489c8d820 100644 --- a/libs/ardour/midi_scene_change.cc +++ b/libs/ardour/midi_scene_change.cc @@ -26,7 +26,8 @@ #include "pbd/i18n.h" using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { MIDISceneChange::MIDISceneChange (int c, int b, int p) : _bank (b) @@ -155,4 +156,4 @@ MIDISceneChange::set_bank (int bank) _bank = bank; } - +} // namespace ARDOUR diff --git a/libs/ardour/midi_scene_changer.cc b/libs/ardour/midi_scene_changer.cc index ceed80f3b4..c058bf5e79 100644 --- a/libs/ardour/midi_scene_changer.cc +++ b/libs/ardour/midi_scene_changer.cc @@ -32,7 +32,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { MIDISceneChanger::MIDISceneChanger (Session& s) : SceneChanger (s) @@ -374,3 +374,5 @@ MIDISceneChanger::jump_to (int bank, int program) _session.request_locate (where); } } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc index 3dacd09bcd..af94f35260 100644 --- a/libs/ardour/midi_source.cc +++ b/libs/ardour/midi_source.cc @@ -57,12 +57,13 @@ #include "pbd/i18n.h" -namespace ARDOUR { template class MidiRingBuffer; } - using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + +template class MidiRingBuffer; + MidiSource::MidiSource (Session& s, string name, Source::Flag flags) : Source(s, DataType::MIDI, name, flags) , _writing(false) @@ -600,3 +601,5 @@ MidiSource::copy_automation_state_from (MidiSource* s) /* XXX: should probably emit signals here */ } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc index 04955c7354..2a80a3ca19 100644 --- a/libs/ardour/midi_state_tracker.cc +++ b/libs/ardour/midi_state_tracker.cc @@ -30,8 +30,8 @@ #include "ardour/parameter_types.h" using namespace std; -using namespace ARDOUR; +namespace ARDOUR { MidiStateTracker::MidiStateTracker () { @@ -212,3 +212,5 @@ MidiStateTracker::dump (ostream& o) } o << "+++++\n"; } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc index a250e9b869..e0b73b7858 100644 --- a/libs/ardour/midi_stretch.cc +++ b/libs/ardour/midi_stretch.cc @@ -31,9 +31,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MidiStretch::MidiStretch (Session& s, const TimeFXRequest& req) : Filter (s) , _request (req) @@ -161,3 +162,4 @@ MidiStretch::run (boost::shared_ptr r, Progress*) return ret; } +} // namespace ARDOUR diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 8e20c1453f..213f19c62b 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -65,17 +65,11 @@ #include "pbd/i18n.h" -namespace ARDOUR { -class InterThreadInfo; -class MidiSource; -class Region; -class SMFSource; -} - using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MidiTrack::MidiTrack (Session& sess, string name, TrackMode mode) : Track (sess, name, PresentationInfo::MidiTrack, mode, DataType::MIDI) , _immediate_events(6096) // FIXME: size? @@ -896,3 +890,5 @@ MidiTrack::playlist_contents_changed () { } + +} // namespace ARDOUR diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc index 83a2a91946..3cad874405 100644 --- a/libs/ardour/midi_ui.cc +++ b/libs/ardour/midi_ui.cc @@ -35,16 +35,19 @@ #include "ardour/types.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace Glib; #include "pbd/i18n.h" +namespace ARDOUR { MidiControlUI* MidiControlUI::_instance = 0; +} #include "pbd/abstract_ui.cc" /* instantiate the template */ +namespace ARDOUR { + MidiControlUI::MidiControlUI (Session& s) : AbstractUI (X_("midiUI")) , _session (s) @@ -151,3 +154,4 @@ MidiControlUI::thread_init () reset_ports (); } +} // namespace ARDOUR diff --git a/libs/ardour/mididm.cc b/libs/ardour/mididm.cc index 4c0108658d..c2f8aec618 100644 --- a/libs/ardour/mididm.cc +++ b/libs/ardour/mididm.cc @@ -19,7 +19,7 @@ #include "ardour/mididm.h" #include "ardour/port_engine.h" -using namespace ARDOUR; +namespace ARDOUR { MIDIDM::MIDIDM (samplecnt_t sample_rate) : _sample_rate (sample_rate) @@ -138,3 +138,5 @@ int MIDIDM::process (pframes_t nframes, PortEngine &pe, void *midi_in, void *mid _monotonic_cnt += nframes; return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/midiport_manager.cc b/libs/ardour/midiport_manager.cc index d9050b44b0..f8fd775c30 100644 --- a/libs/ardour/midiport_manager.cc +++ b/libs/ardour/midiport_manager.cc @@ -24,11 +24,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace MIDI; using namespace PBD; +namespace ARDOUR { MidiPortManager::MidiPortManager () { @@ -73,7 +73,7 @@ MidiPortManager::create_ports () /* Now register ports used to send positional sync data (MTC and MIDI Clock) */ - boost::shared_ptr p; + boost::shared_ptr p; p = AudioEngine::instance()->register_output_port (DataType::MIDI, X_("MTC out")); _mtc_output_port= boost::dynamic_pointer_cast (p); @@ -139,3 +139,5 @@ MidiPortManager::vkbd_output_port () const { return boost::dynamic_pointer_cast (_vkbd_out); } + +} // namespace ARDOUR diff --git a/libs/ardour/mix.cc b/libs/ardour/mix.cc index 72e926fd0f..2574d75599 100644 --- a/libs/ardour/mix.cc +++ b/libs/ardour/mix.cc @@ -29,6 +29,7 @@ using std::min; using std::max; + using namespace ARDOUR; #if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS) @@ -184,5 +185,3 @@ veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, pf } #endif - - diff --git a/libs/ardour/monitor_control.cc b/libs/ardour/monitor_control.cc index 0d0a98ca87..19e7d21a90 100644 --- a/libs/ardour/monitor_control.cc +++ b/libs/ardour/monitor_control.cc @@ -21,9 +21,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MonitorControl::MonitorControl (Session& session, std::string const & name, Monitorable& m) : SlavableAutomationControl (session, MonitoringAutomation, ParameterDescriptor (MonitoringAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(MonitoringAutomation))), @@ -63,3 +64,5 @@ MonitorControl::set_state (XMLNode const & node, int version) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/monitor_port.cc b/libs/ardour/monitor_port.cc index b59cd536ee..cec11413d2 100644 --- a/libs/ardour/monitor_port.cc +++ b/libs/ardour/monitor_port.cc @@ -30,9 +30,10 @@ #define GAIN_COEFF_DELTA (1e-5) -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + MonitorPort::MonitorPort () : _monitor_ports (new MonitorPorts) , _buffer (new AudioBuffer (0)) @@ -338,3 +339,5 @@ MonitorPort::clear_ports (bool instantly) s->SoloChanged (); /* EMIT SIGNAL */ } } + +} // namespace ARDOUR diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc index 931a53b2e5..b41456c9ab 100644 --- a/libs/ardour/monitor_processor.cc +++ b/libs/ardour/monitor_processor.cc @@ -31,20 +31,23 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + /* specialize for bool because of set_value() semantics */ -namespace ARDOUR { - template<> void MPControl::set_value (double v, PBD::Controllable::GroupControlDisposition gcd) { - bool newval = fabs (v) >= 0.5; - if (newval != _value) { - _value = newval; - Changed (true, gcd); /* EMIT SIGNAL */ - } - } +template<> +void +MPControl::set_value (double v, + PBD::Controllable::GroupControlDisposition gcd) +{ + bool newval = fabs (v) >= 0.5; + if (newval != _value) { + _value = newval; + Changed (true, gcd); /* EMIT SIGNAL */ + } } MonitorProcessor::MonitorProcessor (Session& s) @@ -560,3 +563,5 @@ MonitorProcessor::ChannelRecord::~ChannelRecord () polarity_control->DropReferences(); /* EMIT SIGNAL */ soloed_control->DropReferences(); /* EMIT SIGNAL */ } + +} // namespace ARDOUR diff --git a/libs/ardour/monitor_return.cc b/libs/ardour/monitor_return.cc index fe883a3fc8..2815742848 100644 --- a/libs/ardour/monitor_return.cc +++ b/libs/ardour/monitor_return.cc @@ -24,7 +24,7 @@ #include "ardour/monitor_return.h" #include "ardour/session.h" -using namespace ARDOUR; +namespace ARDOUR { MonitorReturn::MonitorReturn (Session& s) : InternalReturn (s, "Monitor Return") @@ -74,3 +74,5 @@ MonitorReturn::state () node.set_property ("type", "monreturn"); return node; } + +} // namespace ARDOUR diff --git a/libs/ardour/mp3filesource.cc b/libs/ardour/mp3filesource.cc index 7b90e93f3d..67945c1570 100644 --- a/libs/ardour/mp3filesource.cc +++ b/libs/ardour/mp3filesource.cc @@ -22,9 +22,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /** Constructor to be called for existing external-to-session files * Sources created with this method are never writable or removable. */ @@ -75,3 +76,5 @@ Mp3FileSource::get_soundfile_info (string path, SoundFileInfo& _info, string& er } catch (...) {} return -1; } + +} // namespace ARDOUR diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 5a620c74b0..8fdae5bc6d 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -38,11 +38,12 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace MIDI; using namespace PBD; using namespace Timecode; +namespace ARDOUR { + /* length (in timecode frames) of the "window" that we consider legal given receipt of a given timecode position. Ardour will try to chase within this window, and will stop+locate+wait+chase if timecode arrives outside of it. The window extends entirely @@ -554,3 +555,5 @@ MTC_TransportMaster::unregister_port () _midi_port.reset (); TransportMaster::unregister_port (); } + +} // namespace ARDOUR diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index aa1de9e8bc..4cb0dcfa46 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -25,9 +25,9 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; +namespace ARDOUR { MuteControl::MuteControl (Session& session, std::string const & name, Muteable& m) : SlavableAutomationControl (session, MuteAutomation, ParameterDescriptor (MuteAutomation), @@ -215,3 +215,5 @@ MuteControl::automation_run (samplepos_t start, pframes_t len) Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ } } + +} // namespace ARDOUR diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc index 25e6f863e2..d5272b68f8 100644 --- a/libs/ardour/mute_master.cc +++ b/libs/ardour/mute_master.cc @@ -33,9 +33,10 @@ namespace PBD { DEFINE_ENUM_CONVERT(ARDOUR::MuteMaster::MutePoint); } -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + const string MuteMaster::xml_node_name (X_("MuteMaster")); const MuteMaster::MutePoint MuteMaster::AllPoints = MuteMaster::MutePoint( @@ -173,3 +174,5 @@ MuteMaster::set_muted_by_masters (bool yn) { _muted_by_masters = yn; } + +} // namespace ARDOUR diff --git a/libs/ardour/muteable.cc b/libs/ardour/muteable.cc index 4d56fbeea3..74edad7349 100644 --- a/libs/ardour/muteable.cc +++ b/libs/ardour/muteable.cc @@ -19,9 +19,11 @@ #include "ardour/muteable.h" #include "ardour/mute_master.h" -using namespace ARDOUR; +namespace ARDOUR { Muteable::Muteable (Session& s, std::string const & name) : _mute_master (new MuteMaster (s, *this, name)) { } + +} // namespace ARDOUR diff --git a/libs/ardour/onset_detector.cc b/libs/ardour/onset_detector.cc index c7a90ac35b..ca97dbacc0 100644 --- a/libs/ardour/onset_detector.cc +++ b/libs/ardour/onset_detector.cc @@ -24,9 +24,10 @@ #include "pbd/i18n.h" using namespace Vamp; -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + /* need a static initializer function for this */ string OnsetDetector::_op_id = X_("aubio-onset"); @@ -149,3 +150,5 @@ OnsetDetector::cleanup_onsets (AnalysisFeatureList& t, float sr, float gap_msecs } } } + +} // namespace ARDOUR diff --git a/libs/ardour/pan_controllable.cc b/libs/ardour/pan_controllable.cc index 3037ccf706..8496d1f74e 100644 --- a/libs/ardour/pan_controllable.cc +++ b/libs/ardour/pan_controllable.cc @@ -21,7 +21,7 @@ #include "ardour/panner.h" #include "ardour/pan_controllable.h" -using namespace ARDOUR; +namespace ARDOUR { void PanControllable::actually_set_value (double v, Controllable::GroupControlDisposition group_override) @@ -69,3 +69,5 @@ PanControllable::get_user_string () const } return owner->panner()->value_as_string (boost::dynamic_pointer_cast(shared_from_this())); } + +} // namespace ARDOUR diff --git a/libs/ardour/pannable.cc b/libs/ardour/pannable.cc index debdbba2d1..e8f40d068e 100644 --- a/libs/ardour/pannable.cc +++ b/libs/ardour/pannable.cc @@ -37,7 +37,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { Pannable::Pannable (Session& s) : Automatable (s) @@ -266,3 +267,5 @@ Pannable::set_state (const XMLNode& root, int version) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 39ca1f03de..625e7520ba 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -27,7 +27,8 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { Panner::Panner (boost::shared_ptr p) : _frozen (0) @@ -87,3 +88,5 @@ Panner::thaw () _frozen--; } } + +} // namespace ARDOUR diff --git a/libs/ardour/panner_manager.cc b/libs/ardour/panner_manager.cc index 17b4c50f85..fdd2e1651c 100644 --- a/libs/ardour/panner_manager.cc +++ b/libs/ardour/panner_manager.cc @@ -40,9 +40,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PannerManager* PannerManager::_instance = 0; PannerManager::PannerManager () @@ -288,3 +289,5 @@ PannerManager::get_available_panners(uint32_t const a_in, uint32_t const a_out) } return panner_list; } + +} // namespace ARDOUR diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc index 54040459d1..0d83546ba8 100644 --- a/libs/ardour/panner_shell.cc +++ b/libs/ardour/panner_shell.cc @@ -63,9 +63,10 @@ #include "pbd/mathfix.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PannerShell::PannerShell (string name, Session& s, boost::shared_ptr p, bool is_send) : SessionObject (s, name) , _pannable_route (p) @@ -491,3 +492,5 @@ PannerShell::set_linked_to_route (bool onoff) } PannableChanged(); } + +} // namespace ARDOUR diff --git a/libs/ardour/phase_control.cc b/libs/ardour/phase_control.cc index bc0a11130c..f73e842516 100644 --- a/libs/ardour/phase_control.cc +++ b/libs/ardour/phase_control.cc @@ -23,7 +23,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { PhaseControl::PhaseControl (Session& session, std::string const & name) : AutomationControl (session, PhaseAutomation, ParameterDescriptor (PhaseAutomation), @@ -91,3 +92,5 @@ PhaseControl::set_state (XMLNode const & node, int version) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 7863b0df68..c2eefc565d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -54,13 +54,12 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; namespace ARDOUR { - namespace Properties { - PBD::PropertyDescriptor regions; - } + +namespace Properties { +PBD::PropertyDescriptor regions; } struct ShowMeTheList { @@ -3473,3 +3472,5 @@ Playlist::set_capture_insertion_in_progress (bool yn) { _capture_insertion_underway = yn; } + +} // namespace ARDOUR diff --git a/libs/ardour/playlist_factory.cc b/libs/ardour/playlist_factory.cc index b535f84506..2338748650 100644 --- a/libs/ardour/playlist_factory.cc +++ b/libs/ardour/playlist_factory.cc @@ -29,9 +29,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PBD::Signal2, bool> PlaylistFactory::PlaylistCreated; boost::shared_ptr @@ -132,3 +133,5 @@ PlaylistFactory::create (boost::shared_ptr old, samplepos_t star return boost::shared_ptr (); } } + +} // namespace ARDOUR diff --git a/libs/ardour/playlist_source.cc b/libs/ardour/playlist_source.cc index dbc74b41a6..a3243efc10 100644 --- a/libs/ardour/playlist_source.cc +++ b/libs/ardour/playlist_source.cc @@ -39,9 +39,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PlaylistSource::PlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr p, DataType type, sampleoffset_t begin, samplecnt_t len, Source::Flag /*flags*/) : Source (s, type, name) @@ -162,3 +163,5 @@ PlaylistSource::set_state (const XMLNode& node, int /*version*/) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index f075674ad6..183f58836e 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -72,10 +72,11 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; -namespace ARDOUR { class AudioEngine; } +namespace ARDOUR { + +class AudioEngine; PBD::Signal3 Plugin::PresetsChanged; @@ -198,7 +199,7 @@ Plugin::invalidate_preset_cache (std::string const& id, Plugin* plugin, bool add } PluginPtr -ARDOUR::find_plugin(Session& session, string identifier, PluginType type) +find_plugin(Session& session, string identifier, PluginType type) { PluginManager& mgr (PluginManager::instance()); PluginInfoList plugs; @@ -588,3 +589,5 @@ PluginInfo::is_analyzer () const { return (category == "Analyser" || category == "Anaylsis" || category == "Analyzer"); } + +} // namespace ARDOUR diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index b0048bbd01..014b31bd20 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -70,9 +70,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + const string PluginInsert::port_automation_node_name = "PortAutomation"; PluginInsert::PluginInsert (Session& s, boost::shared_ptr plug) @@ -3382,7 +3383,7 @@ PluginInsert::clear_stats () g_atomic_int_set (&_stat_reset, 1); } -std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m) +std::ostream& operator<<(std::ostream& o, const PluginInsert::Match& m) { switch (m.method) { case PluginInsert::Impossible: o << "Impossible"; break; @@ -3402,3 +3403,5 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m) o << "\n"; return o; } + +} diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index bcbd92161f..5016b12173 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -127,10 +127,11 @@ #include "ardour/debug.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + PluginManager* PluginManager::_instance = 0; std::string PluginManager::scanner_bin_path = ""; std::string PluginManager::vst3_scanner_bin_path = ""; @@ -2498,3 +2499,5 @@ PluginManager::lua_plugin_info () assert(_lua_plugin_info); return *_lua_plugin_info; } + +} // namespace ARDOUR diff --git a/libs/ardour/polarity_processor.cc b/libs/ardour/polarity_processor.cc index 737180e472..79d0b21557 100644 --- a/libs/ardour/polarity_processor.cc +++ b/libs/ardour/polarity_processor.cc @@ -24,9 +24,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PolarityProcessor::PolarityProcessor (Session& s, boost::shared_ptr control) : Processor(s, "Polarity") , _control (control) @@ -79,3 +80,5 @@ PolarityProcessor::state () node.set_property("type", "polarity"); return node; } + +} // namespace ARDOUR diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 69b49d117e..317e17c9f2 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -36,9 +36,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PBD::Signal2, boost::shared_ptr > Port::PostDisconnect; PBD::Signal0 Port::PortDrop; PBD::Signal0 Port::PortSignalDrop; @@ -680,3 +681,5 @@ Port::set_cycle_samplecnt (pframes_t n) { _cycle_nframes = floor (n * _speed_ratio); } + +} // namespace ARDOUR diff --git a/libs/ardour/port_engine_shared.cc b/libs/ardour/port_engine_shared.cc index cd9c4b3da5..daf175a9ef 100644 --- a/libs/ardour/port_engine_shared.cc +++ b/libs/ardour/port_engine_shared.cc @@ -26,7 +26,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { BackendPort::BackendPort (PortEngineSharedImpl &b, const std::string& name, PortFlags flags) : _backend (b) @@ -735,3 +735,5 @@ PortEngineSharedImpl::list_ports () const } } #endif + +} // namespace ARDOUR diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc index 46f9f686ab..7a97fca3d2 100644 --- a/libs/ardour/port_insert.cc +++ b/libs/ardour/port_insert.cc @@ -35,9 +35,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + string PortInsert::name_and_id_new_insert (Session& s, uint32_t& bitslot) { @@ -298,3 +299,5 @@ PortInsert::deactivate () _out->deactivate (); } + +} // namespace ARDOUR diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 32b170d84b..af028ee9df 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -51,11 +51,12 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using std::string; using std::vector; +namespace ARDOUR { + PortManager::AudioInputPort::AudioInputPort (samplecnt_t sz) : scope (AudioPortScope (new CircularSampleBuffer (sz))) , meter (AudioPortMeter (new DPM)) @@ -1889,3 +1890,5 @@ PortManager::list_cycle_ports () const } } #endif + +} // namespace ARDOUR diff --git a/libs/ardour/presentation_info.cc b/libs/ardour/presentation_info.cc index 52cbaa39df..db66e7b68d 100644 --- a/libs/ardour/presentation_info.cc +++ b/libs/ardour/presentation_info.cc @@ -35,13 +35,14 @@ #include "pbd/i18n.h" +using namespace PBD; +using std::string; + namespace PBD { DEFINE_ENUM_CONVERT(ARDOUR::PresentationInfo::Flag); } -using namespace ARDOUR; -using namespace PBD; -using std::string; +namespace ARDOUR { string PresentationInfo::state_node_name = X_("PresentationInfo"); @@ -51,12 +52,10 @@ GATOMIC_QUAL gint PresentationInfo::_change_signal_suspended = 0; PBD::PropertyChange PresentationInfo::_pending_static_changes; int PresentationInfo::selection_counter= 0; -namespace ARDOUR { - namespace Properties { - PBD::PropertyDescriptor selected; - PBD::PropertyDescriptor order; - PBD::PropertyDescriptor color; - } +namespace Properties { +PBD::PropertyDescriptor selected; +PBD::PropertyDescriptor order; +PBD::PropertyDescriptor color; } void @@ -297,7 +296,9 @@ PresentationInfo::operator= (PresentationInfo const& other) } std::ostream& -operator<<(std::ostream& o, ARDOUR::PresentationInfo const& pi) +operator<<(std::ostream& o, PresentationInfo const& pi) { return o << pi.order() << '/' << enum_2_string (pi.flags()) << '/' << pi.color(); } + +} diff --git a/libs/ardour/process_thread.cc b/libs/ardour/process_thread.cc index 7f31013687..f492b7439b 100644 --- a/libs/ardour/process_thread.cc +++ b/libs/ardour/process_thread.cc @@ -27,10 +27,11 @@ #include "ardour/process_thread.h" #include "ardour/thread_buffers.h" -using namespace ARDOUR; using namespace Glib; using namespace std; +namespace ARDOUR { + static void release_thread_buffer (void* arg) { @@ -235,3 +236,5 @@ ProcessThread::pan_automation_buffer() assert (p); return p; } + +} // namespace ARDOUR diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc index a99d09049a..29423dd189 100644 --- a/libs/ardour/processor.cc +++ b/libs/ardour/processor.cc @@ -50,10 +50,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; -namespace ARDOUR { class Session; } +namespace ARDOUR { + +class Session; // Always saved as Processor, but may be IOProcessor or Send in legacy sessions const string Processor::state_node_name = "Processor"; @@ -332,3 +333,5 @@ Processor::owner() const { return _owner; } + +} // namespace ARDOUR diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc index 28a86a65e7..a1e201cc7e 100644 --- a/libs/ardour/quantize.cc +++ b/libs/ardour/quantize.cc @@ -29,7 +29,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /** Quantize notes * @@ -183,3 +184,5 @@ Quantize::operator () (boost::shared_ptr model, return cmd; } + +} // namespace ARDOUR diff --git a/libs/ardour/raw_midi_parser.cc b/libs/ardour/raw_midi_parser.cc index 9c451dfb0f..85007665b3 100644 --- a/libs/ardour/raw_midi_parser.cc +++ b/libs/ardour/raw_midi_parser.cc @@ -18,7 +18,7 @@ #include "ardour/raw_midi_parser.h" -using namespace ARDOUR; +namespace ARDOUR { RawMidiParser::RawMidiParser () { @@ -115,3 +115,5 @@ RawMidiParser::process_byte (const uint8_t byte) record_byte (byte); return (_total_bytes == _expected_bytes) ? prepare_buffered_event () : false; } + +} // namespace ARDOUR diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc index f1c0223c29..6ee9d1a418 100644 --- a/libs/ardour/rb_effect.cc +++ b/libs/ardour/rb_effect.cc @@ -39,10 +39,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace RubberBand; +namespace ARDOUR { + Pitch::Pitch (Session& s, TimeFXRequest& req) : RBEffect (s, req) { @@ -392,3 +393,5 @@ out: return ret; } + +} // namespace ARDOUR diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc index 87ddbdfa61..8e11693d94 100644 --- a/libs/ardour/rc_configuration.cc +++ b/libs/ardour/rc_configuration.cc @@ -45,7 +45,6 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; @@ -54,8 +53,8 @@ using namespace PBD; */ namespace ARDOUR { - float speed_quietning = 0.251189; // -12dB reduction for ffwd or rewind -} + +float speed_quietning = 0.251189; // -12dB reduction for ffwd or rewind static const char* user_config_file_name = "config"; static const char* system_config_file_name = "system_config"; @@ -296,3 +295,4 @@ RCConfiguration::map_parameters (boost::function& functor) #undef CONFIG_VARIABLE_SPECIAL } +} // namespace ARDOUR diff --git a/libs/ardour/readable.cc b/libs/ardour/readable.cc index 0390a0169d..0e66196c2d 100644 --- a/libs/ardour/readable.cc +++ b/libs/ardour/readable.cc @@ -28,7 +28,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { std::vector > Readable::load (Session& session, std::string const& path) @@ -64,3 +64,5 @@ Readable::load (Session& session, std::string const& path) } return readables; } + +} // namespace ARDOUR diff --git a/libs/ardour/readonly_control.cc b/libs/ardour/readonly_control.cc index 93d6603e45..30071c867e 100644 --- a/libs/ardour/readonly_control.cc +++ b/libs/ardour/readonly_control.cc @@ -21,7 +21,7 @@ #include "ardour/plugin.h" #include "ardour/readonly_control.h" -using namespace ARDOUR; +namespace ARDOUR { ReadOnlyControl::ReadOnlyControl (boost::shared_ptr p, const ParameterDescriptor& desc, uint32_t pnum) : _plugin (boost::weak_ptr (p)) @@ -48,3 +48,5 @@ ReadOnlyControl::describe_parameter () } return ""; } + +} // namespace ARDOUR diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc index c2c8d1a19a..9c0c59856b 100644 --- a/libs/ardour/recent_sessions.cc +++ b/libs/ardour/recent_sessions.cc @@ -38,9 +38,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + namespace { const char * const recent_file_name = "recent"; @@ -49,7 +50,7 @@ namespace { } // anonymous int -ARDOUR::read_recent_sessions (RecentSessions& rs) +read_recent_sessions (RecentSessions& rs) { std::string path = Glib::build_filename (user_config_directory(), recent_file_name); FILE* fin = g_fopen (path.c_str(), "rb"); @@ -107,7 +108,7 @@ ARDOUR::read_recent_sessions (RecentSessions& rs) } int -ARDOUR::read_recent_templates (std::deque& rt) +read_recent_templates (std::deque& rt) { std::string path = Glib::build_filename (user_config_directory(), recent_templates_file_name); FILE* fin = g_fopen (path.c_str(), "rb"); @@ -155,7 +156,7 @@ ARDOUR::read_recent_templates (std::deque& rt) } int -ARDOUR::write_recent_sessions (RecentSessions& rs) +write_recent_sessions (RecentSessions& rs) { FILE* fout = g_fopen (Glib::build_filename (user_config_directory(), recent_file_name).c_str(), "wb"); @@ -191,7 +192,7 @@ ARDOUR::write_recent_sessions (RecentSessions& rs) } int -ARDOUR::write_recent_templates (std::deque& rt) +write_recent_templates (std::deque& rt) { FILE* fout = g_fopen (Glib::build_filename (user_config_directory(), recent_templates_file_name).c_str(), "wb"); @@ -223,11 +224,11 @@ ARDOUR::write_recent_templates (std::deque& rt) } int -ARDOUR::store_recent_sessions (string name, string path) +store_recent_sessions (string name, string path) { RecentSessions rs; - if (ARDOUR::read_recent_sessions (rs) < 0) { + if (read_recent_sessions (rs) < 0) { return -1; } @@ -246,15 +247,15 @@ ARDOUR::store_recent_sessions (string name, string path) rs.erase(rs.begin()+max_recent_sessions, rs.end()); } - return ARDOUR::write_recent_sessions (rs); + return write_recent_sessions (rs); } int -ARDOUR::store_recent_templates (const std::string& session_template_full_name) +store_recent_templates (const std::string& session_template_full_name) { std::deque rt; - if (ARDOUR::read_recent_templates (rt) < 0) { + if (read_recent_templates (rt) < 0) { return -1; } @@ -268,16 +269,16 @@ ARDOUR::store_recent_templates (const std::string& session_template_full_name) rt.erase( rt.begin() + max_recent_templates, rt.end ()); } - return ARDOUR::write_recent_templates (rt); + return write_recent_templates (rt); } int -ARDOUR::remove_recent_sessions (const string& path) +remove_recent_sessions (const string& path) { RecentSessions rs; bool write = false; - if (ARDOUR::read_recent_sessions (rs) < 0) { + if (read_recent_sessions (rs) < 0) { return -1; } @@ -290,8 +291,10 @@ ARDOUR::remove_recent_sessions (const string& path) } if (write) { - return ARDOUR::write_recent_sessions (rs); + return write_recent_sessions (rs); } else { return 1; } } + +} // namespace ARDOUR diff --git a/libs/ardour/record_enable_control.cc b/libs/ardour/record_enable_control.cc index a789b39e11..951d639bfa 100644 --- a/libs/ardour/record_enable_control.cc +++ b/libs/ardour/record_enable_control.cc @@ -21,9 +21,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + RecordEnableControl::RecordEnableControl (Session& session, std::string const & name, Recordable& r) : SlavableAutomationControl (session, RecEnableAutomation, ParameterDescriptor (RecEnableAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(RecEnableAutomation))), @@ -73,3 +74,5 @@ RecordEnableControl::do_pre_realtime_queue_stuff (double newval) std::cerr << "Prep rec-enable failed\n"; } } + +} // namespace ARDOUR diff --git a/libs/ardour/record_safe_control.cc b/libs/ardour/record_safe_control.cc index 6fce4f028e..2cf73cc659 100644 --- a/libs/ardour/record_safe_control.cc +++ b/libs/ardour/record_safe_control.cc @@ -21,9 +21,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + RecordSafeControl::RecordSafeControl (Session& session, std::string const & name, Recordable& r) : SlavableAutomationControl (session, RecSafeAutomation, ParameterDescriptor (RecSafeAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(RecSafeAutomation))), @@ -47,3 +48,4 @@ RecordSafeControl::actually_set_value (double val, Controllable::GroupControlDis SlavableAutomationControl::actually_set_value (val, gcd); } +} // namespace ARDOUR diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index bf09ea14f8..924ecef30d 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -49,41 +49,41 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; namespace ARDOUR { - class Progress; - namespace Properties { - PBD::PropertyDescriptor muted; - PBD::PropertyDescriptor opaque; - PBD::PropertyDescriptor locked; - PBD::PropertyDescriptor video_locked; - PBD::PropertyDescriptor automatic; - PBD::PropertyDescriptor whole_file; - PBD::PropertyDescriptor import; - PBD::PropertyDescriptor external; - PBD::PropertyDescriptor sync_marked; - PBD::PropertyDescriptor left_of_split; - PBD::PropertyDescriptor right_of_split; - PBD::PropertyDescriptor hidden; - PBD::PropertyDescriptor position_locked; - PBD::PropertyDescriptor valid_transients; - PBD::PropertyDescriptor start; - PBD::PropertyDescriptor length; - PBD::PropertyDescriptor position; - PBD::PropertyDescriptor beat; - PBD::PropertyDescriptor sync_position; - PBD::PropertyDescriptor layer; - PBD::PropertyDescriptor ancestral_start; - PBD::PropertyDescriptor ancestral_length; - PBD::PropertyDescriptor stretch; - PBD::PropertyDescriptor shift; - PBD::PropertyDescriptor position_lock_style; - PBD::PropertyDescriptor layering_index; - PBD::PropertyDescriptor tags; - PBD::PropertyDescriptor contents; - } + +class Progress; + +namespace Properties { +PBD::PropertyDescriptor muted; +PBD::PropertyDescriptor opaque; +PBD::PropertyDescriptor locked; +PBD::PropertyDescriptor video_locked; +PBD::PropertyDescriptor automatic; +PBD::PropertyDescriptor whole_file; +PBD::PropertyDescriptor import; +PBD::PropertyDescriptor external; +PBD::PropertyDescriptor sync_marked; +PBD::PropertyDescriptor left_of_split; +PBD::PropertyDescriptor right_of_split; +PBD::PropertyDescriptor hidden; +PBD::PropertyDescriptor position_locked; +PBD::PropertyDescriptor valid_transients; +PBD::PropertyDescriptor start; +PBD::PropertyDescriptor length; +PBD::PropertyDescriptor position; +PBD::PropertyDescriptor beat; +PBD::PropertyDescriptor sync_position; +PBD::PropertyDescriptor layer; +PBD::PropertyDescriptor ancestral_start; +PBD::PropertyDescriptor ancestral_length; +PBD::PropertyDescriptor stretch; +PBD::PropertyDescriptor shift; +PBD::PropertyDescriptor position_lock_style; +PBD::PropertyDescriptor layering_index; +PBD::PropertyDescriptor tags; +PBD::PropertyDescriptor contents; } PBD::Signal2,const PropertyChange&> Region::RegionsPropertyChanged; @@ -2075,3 +2075,5 @@ Region::latest_possible_sample () const return _position + (minlen - _start) - 1; } + +} // namespace ARDOUR diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index ed0ce6cf49..e64d28a756 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -38,10 +38,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + PBD::Signal1 > RegionFactory::CheckNewRegion; Glib::Threads::Mutex RegionFactory::region_map_lock; RegionFactory::RegionMap RegionFactory::region_map; @@ -671,3 +672,5 @@ RegionFactory::add_compound_association (boost::shared_ptr orig, boost:: Glib::Threads::Mutex::Lock lm (region_map_lock); _compound_associations[copy] = orig; } + +} // namespace ARDOUR diff --git a/libs/ardour/resampled_source.cc b/libs/ardour/resampled_source.cc index f9fb649f93..48d2d10081 100644 --- a/libs/ardour/resampled_source.cc +++ b/libs/ardour/resampled_source.cc @@ -26,9 +26,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + #ifdef PLATFORM_WINDOWS const uint32_t ResampledImportableSource::blocksize = 524288U; #else @@ -151,3 +152,5 @@ ResampledImportableSource::natural_position () const { return source->natural_position() * ratio (); } + +} // namespace ARDOUR diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc index e22e479116..e37ae21b6c 100644 --- a/libs/ardour/return.cc +++ b/libs/ardour/return.cc @@ -34,9 +34,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + std::string Return::name_and_id_new_return (Session& s, uint32_t& bitslot) { @@ -158,3 +159,5 @@ Return::configure_io (ChanCount in, ChanCount out) return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc index 676480b8d8..1d2b798967 100644 --- a/libs/ardour/reverse.cc +++ b/libs/ardour/reverse.cc @@ -26,9 +26,11 @@ #include "ardour/types.h" using namespace std; -using namespace ARDOUR; -namespace ARDOUR { class Progress; class Session; } +namespace ARDOUR { + +class Progress; +class Session; Reverse::Reverse (Session& s) : Filter (s) @@ -125,3 +127,5 @@ Reverse::run (boost::shared_ptr r, Progress*) return ret; } + +} // namespace ARDOUR diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index ec672d9c9b..9f965001b7 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -99,9 +99,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PBD::Signal3, boost::shared_ptr, Route::PluginSetupOptions > Route::PluginSetup; PBD::Signal1 > Route::FanOut; @@ -6307,3 +6308,4 @@ Route::monitoring_state () const return MonitoringSilence; } +} // namespace ARDOUR diff --git a/libs/ardour/route_graph.cc b/libs/ardour/route_graph.cc index 4bca02b382..63aa1433ee 100644 --- a/libs/ardour/route_graph.cc +++ b/libs/ardour/route_graph.cc @@ -24,7 +24,8 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { void GraphEdges::add (GraphVertex from, GraphVertex to, bool via_sends_only) @@ -239,7 +240,7 @@ struct RouteRecEnabledComparator * @return Sorted list of routes, or 0 if the graph contains cycles (feedback loops). */ boost::shared_ptr -ARDOUR::topological_sort ( +topological_sort ( boost::shared_ptr routes, GraphEdges edges ) @@ -287,3 +288,5 @@ ARDOUR::topological_sort ( return sorted_routes; } + +} // namespace ARDOUR diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index 105dcf926a..09d854a89f 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -42,24 +42,23 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; namespace ARDOUR { - namespace Properties { - PropertyDescriptor active; - PropertyDescriptor group_relative; - PropertyDescriptor group_gain; - PropertyDescriptor group_mute; - PropertyDescriptor group_solo; - PropertyDescriptor group_recenable; - PropertyDescriptor group_select; - PropertyDescriptor group_route_active; - PropertyDescriptor group_color; - PropertyDescriptor group_monitoring; - PropertyDescriptor group_master_number; - } + +namespace Properties { +PropertyDescriptor active; +PropertyDescriptor group_relative; +PropertyDescriptor group_gain; +PropertyDescriptor group_mute; +PropertyDescriptor group_solo; +PropertyDescriptor group_recenable; +PropertyDescriptor group_select; +PropertyDescriptor group_route_active; +PropertyDescriptor group_color; +PropertyDescriptor group_monitoring; +PropertyDescriptor group_master_number; } void @@ -707,3 +706,5 @@ RouteGroup::has_control_master() const { return group_master.lock() != 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/route_group_member.cc b/libs/ardour/route_group_member.cc index 8a80659995..f9f055de08 100644 --- a/libs/ardour/route_group_member.cc +++ b/libs/ardour/route_group_member.cc @@ -21,9 +21,9 @@ #include "ardour/route_group_member.h" #include "ardour/route_group.h" -using namespace ARDOUR; +namespace ARDOUR { -namespace ARDOUR { class RouteGroup; } +class RouteGroup; /** Set the route group; it can be set to 0 for `none' */ void @@ -36,3 +36,5 @@ RouteGroupMember::set_route_group (RouteGroup *rg) _route_group = rg; route_group_changed (); /* EMIT SIGNAL */ } + +} // namespace ARDOUR diff --git a/libs/ardour/rt_midibuffer.cc b/libs/ardour/rt_midibuffer.cc index 2e92c44647..e014553632 100644 --- a/libs/ardour/rt_midibuffer.cc +++ b/libs/ardour/rt_midibuffer.cc @@ -32,9 +32,10 @@ #include "ardour/rt_midibuffer.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + RTMidiBuffer::RTMidiBuffer () : _size (0) , _capacity (0) @@ -412,3 +413,5 @@ RTMidiBuffer::clear () /* rendering new data .. it will not be reversed */ _reversed = false; } + +} // namespace ARDOUR diff --git a/libs/ardour/rt_tasklist.cc b/libs/ardour/rt_tasklist.cc index 18fcad8e3f..ec33fe8d14 100644 --- a/libs/ardour/rt_tasklist.cc +++ b/libs/ardour/rt_tasklist.cc @@ -27,7 +27,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { RTTaskList::RTTaskList () : _task_run_sem ("rt_task_run", 0) @@ -177,3 +177,5 @@ RTTaskList::process_tasklist () _task_end_sem.wait (); } } + +} // namespace ARDOUR diff --git a/libs/ardour/scene_change.cc b/libs/ardour/scene_change.cc index f82af62c42..4cee059542 100644 --- a/libs/ardour/scene_change.cc +++ b/libs/ardour/scene_change.cc @@ -21,7 +21,8 @@ #include "pbd/i18n.h" using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { std::string SceneChange::xml_node_name = X_("SceneChange"); const uint32_t SceneChange::out_of_bound_color = 0x00000000; /* note: zero alpha means invisible, which acts as out-of-bound signal */ @@ -65,3 +66,5 @@ SceneChange::set_active (bool yn) ActiveChanged (); /* EMIT SIGNAL */ } } + +} // namespace ARDOUR diff --git a/libs/ardour/selection.cc b/libs/ardour/selection.cc index 3c4475872b..a33b74d504 100644 --- a/libs/ardour/selection.cc +++ b/libs/ardour/selection.cc @@ -32,9 +32,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + void CoreSelection::send_selection_change () { @@ -611,3 +612,5 @@ CoreSelection::selected () const Glib::Threads::RWLock::ReaderLock lm (_lock); return _stripables.size(); } + +} // namespace ARDOUR diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 1572e799b5..2573a0dc6a 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -40,15 +40,14 @@ #include "pbd/i18n.h" +using namespace PBD; +using namespace std; + namespace ARDOUR { + class AutomationControl; class MuteMaster; class Pannable; -} - -using namespace ARDOUR; -using namespace PBD; -using namespace std; PBD::Signal0 LatentSend::ChangedLatency; @@ -544,3 +543,5 @@ Send::snd_output_changed (IOChange change, void* /*src*/) } } } + +} // namespace ARDOUR diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 9000f2a715..2a66aa514b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -135,15 +135,14 @@ #include "pbd/i18n.h" +using namespace std; +using namespace PBD; + namespace ARDOUR { + class MidiSource; class Processor; class Speakers; -} - -using namespace std; -using namespace ARDOUR; -using namespace PBD; bool Session::_disable_all_loaded_plugins = false; bool Session::_bypass_all_loaded_plugins = false; @@ -3231,6 +3230,7 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool } #if !defined(__APPLE__) && !defined(__FreeBSD__) + // FIXME (drobilla) /* 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)" */ @@ -7245,3 +7245,5 @@ Session::had_destructive_tracks() const { return _had_destructive_tracks; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_bundles.cc b/libs/ardour/session_bundles.cc index efbc26b1f4..4b3cc17c5b 100644 --- a/libs/ardour/session_bundles.cc +++ b/libs/ardour/session_bundles.cc @@ -39,9 +39,10 @@ #include "ardour/session.h" #include "ardour/user_bundle.h" -using namespace ARDOUR; using std::string; +namespace ARDOUR { + void Session::add_bundle (boost::shared_ptr bundle, bool emit_signal) { @@ -248,3 +249,5 @@ Session::setup_bundles () // we trust the backend to only calls us if there's a change BundleAddedOrRemoved (); /* EMIT SIGNAL */ } + +} // namespace ARDOUR diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index e0538aaaa6..89ff742e10 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -35,9 +35,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + /*--------------------------------------------------------------------------- BUTLER THREAD ---------------------------------------------------------------------------*/ @@ -130,3 +131,5 @@ Session::capture_load () { return (uint32_t) g_atomic_int_get (&_capture_load); } + +} // namespace ARDOUR diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc index 4b890979a0..9e283258c7 100644 --- a/libs/ardour/session_click.cc +++ b/libs/ardour/session_click.cc @@ -36,9 +36,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + Pool Click::pool ("click", sizeof (Click), 1024); /* pre-allocated vector for grid-point-lookup. @@ -359,3 +360,5 @@ Session::click_io_resync_latency (bool playback) _click_io_latency = _click_io->connected_latency (true); } + +} // namespace ARDOUR diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc index 44bacd2409..86f1e8dbd0 100644 --- a/libs/ardour/session_command.cc +++ b/libs/ardour/session_command.cc @@ -44,10 +44,11 @@ class Command; using namespace PBD; -using namespace ARDOUR; #include "pbd/i18n.h" +namespace ARDOUR { + void Session::register_with_memento_command_factory(PBD::ID id, PBD::StatefulDestructible *ptr) { registry[id] = ptr; @@ -183,3 +184,5 @@ Session::stateful_diff_command_factory (XMLNode* n) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_configuration.cc b/libs/ardour/session_configuration.cc index 8cbfa5a668..4478128afb 100644 --- a/libs/ardour/session_configuration.cc +++ b/libs/ardour/session_configuration.cc @@ -35,9 +35,10 @@ #include "ardour/utils.h" #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + SessionConfiguration::SessionConfiguration () : /* construct variables */ @@ -196,3 +197,5 @@ SessionConfiguration::save_state () return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc index 5f4a3f42df..70590fcb9f 100644 --- a/libs/ardour/session_events.cc +++ b/libs/ardour/session_events.cc @@ -32,9 +32,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + PerThreadPool* SessionEvent::pool; void @@ -355,3 +356,5 @@ SessionEventManager::_clear_event_type (SessionEvent::Type type) set_next_event (); } + +} // namespace ARDOUR diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index c61255a189..52334b14a3 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -39,12 +39,13 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; #define TFSM_ROLL() { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StartTransport)); } #define TFSM_SPEED(speed,as_default) { _transport_fsm->enqueue (new TransportFSM::Event (speed,as_default)); } +namespace ARDOUR { + boost::shared_ptr Session::get_export_handler () { @@ -440,3 +441,5 @@ Session::finalize_audio_export (TransportRequestSource trs) request_locate (post_export_position, MustStop, trs); } } + +} // namespace ARDOUR diff --git a/libs/ardour/session_handle.cc b/libs/ardour/session_handle.cc index 777267365a..0589f761ee 100644 --- a/libs/ardour/session_handle.cc +++ b/libs/ardour/session_handle.cc @@ -26,9 +26,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + SessionHandlePtr::SessionHandlePtr (Session* s) : _session (s) { @@ -90,3 +91,5 @@ SessionHandleRef::insanity_check () << endl; #endif } + +} // namespace ARDOUR diff --git a/libs/ardour/session_ltc.cc b/libs/ardour/session_ltc.cc index 79f1264303..aac30a9787 100644 --- a/libs/ardour/session_ltc.cc +++ b/libs/ardour/session_ltc.cc @@ -30,7 +30,6 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace Timecode; @@ -61,6 +60,8 @@ using namespace Timecode; (timecode_to_frames_per_second(tcf)==25.0 ? LTC_TV_625_50 : \ timecode_has_drop_frames(tcf)? LTC_TV_525_60 : LTC_TV_FILM_24) +namespace ARDOUR { + void Session::ltc_tx_initialize() { @@ -675,3 +676,5 @@ Session::send_ltc_for_cycle (samplepos_t start_sample, samplepos_t end_sample, p #endif } } + +} // namespace ARDOUR diff --git a/libs/ardour/session_metadata.cc b/libs/ardour/session_metadata.cc index 10763201b5..88d7fc8947 100644 --- a/libs/ardour/session_metadata.cc +++ b/libs/ardour/session_metadata.cc @@ -27,7 +27,8 @@ using namespace std; using namespace Glib; -using namespace ARDOUR; + +namespace ARDOUR { SessionMetadata *SessionMetadata::_metadata = NULL; //singleton instance @@ -682,3 +683,5 @@ SessionMetadata::av_export_tag (MetaDataMap& meta) const if (!copyright().empty()) { meta["copyright"] = copyright(); } if (!subtitle().empty()) { meta["description"] = subtitle(); } } + +} // namespace ARDOUR diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index 072d76f8a5..6abcfd9f41 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -57,11 +57,12 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace MIDI; using namespace Glib; +namespace ARDOUR { + void Session::midi_panic() { @@ -481,7 +482,7 @@ Session::send_full_time_code (samplepos_t const t, MIDI::pframes_t nframes) * earlier already this cycle by send_full_time_code) */ int -Session::send_midi_time_code_for_cycle (samplepos_t start_sample, samplepos_t end_sample, ARDOUR::pframes_t nframes) +Session::send_midi_time_code_for_cycle (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes) { // start_sample == start_sample for normal cycles // start_sample > _transport_sample for split cycles @@ -565,7 +566,7 @@ Session::send_midi_time_code_for_cycle (samplepos_t start_sample, samplepos_t en assert (msg_time < end_sample); /* convert from session samples back to JACK samples using the transport speed */ - ARDOUR::pframes_t const out_stamp = (msg_time - start_sample) / _transport_fsm->transport_speed(); + pframes_t const out_stamp = (msg_time - start_sample) / _transport_fsm->transport_speed(); assert (out_stamp < nframes); MidiBuffer& mb (_midi_ports->mtc_output_port()->get_midi_buffer(nframes)); @@ -662,25 +663,25 @@ Session::start_midi_thread () return 0; } -boost::shared_ptr +boost::shared_ptr Session::mmc_output_port () const { return _midi_ports->mmc_output_port (); } -boost::shared_ptr +boost::shared_ptr Session::mmc_input_port () const { return _midi_ports->mmc_input_port (); } -boost::shared_ptr +boost::shared_ptr Session::scene_output_port () const { return _midi_ports->scene_output_port (); } -boost::shared_ptr +boost::shared_ptr Session::scene_input_port () const { return _midi_ports->scene_input_port (); @@ -799,3 +800,5 @@ Session::rewire_midi_selection_ports () target->input()->connect (target->input()->nth (0), (*p), this); } } + +} // namespace ARDOUR diff --git a/libs/ardour/session_object.cc b/libs/ardour/session_object.cc index 14f765fb1c..924b7dc5e3 100644 --- a/libs/ardour/session_object.cc +++ b/libs/ardour/session_object.cc @@ -25,14 +25,13 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; namespace ARDOUR { - namespace Properties { - PropertyDescriptor name; - } + +namespace Properties { +PropertyDescriptor name; } void @@ -42,3 +41,4 @@ SessionObject::make_property_quarks () DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for name = %1\n", Properties::name.property_id)); } +} // namespace ARDOUR diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index d8e014a7e1..889f1d9280 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -33,7 +33,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { SessionPlaylists::~SessionPlaylists () { @@ -635,3 +636,5 @@ SessionPlaylists::foreach (boost::functionenqueue (new TransportFSM::Event (speed,as_default)); } #define TFSM_LOCATE(target,ltd,loop,force) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::Locate,target,ltd,loop,force)); } +namespace ARDOUR { /** Called by the audio engine when there is work to be done with JACK. * @param nframes Number of samples to process. @@ -1532,3 +1532,5 @@ Session::implement_master_strategy () return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index 65dad92182..df0ad8959a 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -35,9 +35,10 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; using namespace Glib; +namespace ARDOUR { + void Session::set_controls (boost::shared_ptr cl, double val, Controllable::GroupControlDisposition gcd) { @@ -166,3 +167,5 @@ Session::process_rtop (SessionEvent* ev) ev->rt_return (ev); } } + +} // namespace ARDOUR diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 4eb16fd307..cb0e459675 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -151,9 +151,10 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + #define DEBUG_UNDO_HISTORY(msg) DEBUG_TRACE (PBD::DEBUG::UndoHistory, string_compose ("%1: %2\n", __LINE__, msg)); void @@ -5709,3 +5710,5 @@ Session::end_unnamed_status () const { ::g_remove (unnamed_file_name().c_str()); } + +} // namespace ARDOUR diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index 011acdd32f..18673ee002 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -39,11 +39,12 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; #define TFSM_EVENT(evtype) { _transport_fsm->enqueue (new TransportFSM::Event (evtype)); } +namespace ARDOUR { + /* BBT TIME*/ void @@ -303,3 +304,5 @@ Session::any_duration_to_samples (samplepos_t position, AnyTime const & duration return duration.samples; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 2cc248b92a..973cc0950c 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -67,10 +67,8 @@ #include "ardour/vca_manager.h" using namespace std; -using namespace ARDOUR; using namespace PBD; - #ifdef NDEBUG # define ENSURE_PROCESS_THREAD do {} while (0) #else @@ -88,6 +86,8 @@ using namespace PBD; #define TFSM_LOCATE(target,ltd,loop,force) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::Locate,target,ltd,loop,force)); } #define TFSM_SPEED(speed,as_default) { _transport_fsm->enqueue (new TransportFSM::Event (speed,as_default)); } +namespace ARDOUR { + /* ***************************************************************************** * REALTIME ACTIONS (to be called on state transitions) * ****************************************************************************/ @@ -989,7 +989,7 @@ Session::solo_selection (StripableList &list, bool new_state) boost::shared_ptr rl = get_routes(); - for (ARDOUR::RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { if ( !(*i)->is_track() ) { continue; @@ -1082,7 +1082,7 @@ Session::butler_transport_work (bool have_process_lock) } if (ptw & PostTransportAdjustPlaybackBuffering) { - /* need to prevent concurrency with ARDOUR::Reader::run(), + /* need to prevent concurrency with Reader::run(), * DiskWriter::adjust_buffering() re-allocates the ringbuffer */ Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK); if (!have_process_lock) { @@ -1103,7 +1103,7 @@ Session::butler_transport_work (bool have_process_lock) } if (ptw & PostTransportAdjustCaptureBuffering) { - /* need to prevent concurrency with ARDOUR::DiskWriter::run(), + /* need to prevent concurrency with DiskWriter::run(), * DiskWriter::adjust_buffering() re-allocates the ringbuffer */ Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock (), Glib::Threads::NOT_LOCK); if (!have_process_lock) { @@ -2034,3 +2034,5 @@ Session::actual_speed() const if (_transport_fsm->transport_speed() < 0) return - _engine_speed; return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 5bed2024c9..02393690f3 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -41,10 +41,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; - #define SHOW_CALLBACK(MSG) DEBUG_TRACE (PBD::DEBUG::VSTCallbacks, string_compose (MSG " val = %1 idx = %2\n", index, value)) +namespace ARDOUR { + int Session::vst_current_loading_id = 0; const char* Session::vst_can_do_strings[] = { X_("supplyIdle"), @@ -547,3 +547,5 @@ intptr_t Session::vst_callback ( return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/sidechain.cc b/libs/ardour/sidechain.cc index 9fa6a6014a..b0232a2833 100644 --- a/libs/ardour/sidechain.cc +++ b/libs/ardour/sidechain.cc @@ -30,9 +30,9 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { SideChain::SideChain (Session& s, const std::string& name) : IOProcessor (s, true, false, name) @@ -100,3 +100,5 @@ SideChain::configure_io (ChanCount in, ChanCount out) } return Processor::configure_io (in, out); } + +} // namespace ARDOUR diff --git a/libs/ardour/slavable.cc b/libs/ardour/slavable.cc index 5756df9693..b73cc24108 100644 --- a/libs/ardour/slavable.cc +++ b/libs/ardour/slavable.cc @@ -33,7 +33,8 @@ #include "pbd/i18n.h" using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { std::string Slavable::xml_node_name = X_("Slavable"); PBD::Signal1 Slavable::Assign; /* signal sent once @@ -239,3 +240,5 @@ Slavable::unassign_control (boost::shared_ptr vca, boost::shared_ptr -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + /* FIXME: this was copied from sndfilesource.cc, at some point these should be merged */ int64_t SndFileImportableSource::get_timecode_info (SNDFILE* sf, SF_BROADCAST_INFO* binfo, bool& exists) @@ -145,3 +146,5 @@ SndFileImportableSource::clamped_at_unity () const /* XXX: this may not be the full list of formats that are unclamped */ return (sub != SF_FORMAT_FLOAT && sub != SF_FORMAT_DOUBLE && type != SF_FORMAT_OGG); } + +} // namespace ARDOUR diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index f68f656e57..52274f714e 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -50,10 +50,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using std::string; +namespace ARDOUR { + const Source::Flag SndFileSource::default_writable_flags = Source::Flag ( Source::Writable | Source::Removable | @@ -828,3 +829,5 @@ SndFileSource::set_path (const string& p) { FileSource::set_path (p); } + +} // namespace ARDOUR diff --git a/libs/ardour/solo_control.cc b/libs/ardour/solo_control.cc index 6497ac319e..f6055ee56b 100644 --- a/libs/ardour/solo_control.cc +++ b/libs/ardour/solo_control.cc @@ -24,10 +24,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + SoloControl::SoloControl (Session& session, std::string const & name, Soloable& s, Muteable& m) : SlavableAutomationControl (session, SoloAutomation, ParameterDescriptor (SoloAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(SoloAutomation))), @@ -357,3 +358,5 @@ SoloControl::can_solo () const return _soloable.can_solo (); } } + +} // namespace ARDOUR diff --git a/libs/ardour/solo_isolate_control.cc b/libs/ardour/solo_isolate_control.cc index 16f764cd86..f5ebef5901 100644 --- a/libs/ardour/solo_isolate_control.cc +++ b/libs/ardour/solo_isolate_control.cc @@ -24,10 +24,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + SoloIsolateControl::SoloIsolateControl (Session& session, std::string const & name, Soloable& s) : SlavableAutomationControl (session, SoloIsolateAutomation, ParameterDescriptor (SoloIsolateAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(SoloIsolateAutomation))), @@ -170,3 +171,5 @@ SoloIsolateControl::get_state () node.set_property (X_("solo-isolated"), _solo_isolated); return node; } + +} // namespace ARDOUR diff --git a/libs/ardour/solo_mute_release.cc b/libs/ardour/solo_mute_release.cc index 3eab207a78..797e864620 100644 --- a/libs/ardour/solo_mute_release.cc +++ b/libs/ardour/solo_mute_release.cc @@ -25,7 +25,8 @@ #include "ardour/utils.h" using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { SoloMuteRelease::SoloMuteRelease (bool was_active) : active (was_active) @@ -89,3 +90,5 @@ SoloMuteRelease::release (Session* s, bool mute) const } } } + +} // namespace ARDOUR diff --git a/libs/ardour/solo_safe_control.cc b/libs/ardour/solo_safe_control.cc index 33d64c65bb..b74f2447d3 100644 --- a/libs/ardour/solo_safe_control.cc +++ b/libs/ardour/solo_safe_control.cc @@ -24,10 +24,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + SoloSafeControl::SoloSafeControl (Session& session, std::string const & name) : SlavableAutomationControl (session, SoloSafeAutomation, ParameterDescriptor (SoloSafeAutomation), boost::shared_ptr(new AutomationList(Evoral::Parameter(SoloSafeAutomation))), @@ -83,3 +84,5 @@ SoloSafeControl::get_state () node.set_property (X_("solo-safe"), _solo_safe); return node; } + +} // namespace ARDOUR diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index f4518a379f..dd8b0f4a84 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -55,9 +55,9 @@ namespace PBD { } using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { Source::Source (Session& s, DataType type, const string& name, Flag flags) : SessionObject(s, name) @@ -465,3 +465,5 @@ Source::clear_cue_markers () CueMarkersChanged(); /* EMIT SIGNAL */ return true; } + +} // namespace ARDOUR diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 2ceea55988..713ed3cd41 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -47,10 +47,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + PBD::Signal1 > SourceFactory::SourceCreated; Glib::Threads::Cond SourceFactory::PeaksToBuild; Glib::Threads::Mutex SourceFactory::peak_building_lock; @@ -105,7 +106,7 @@ void SourceFactory::init () { for (int n = 0; n < 2; ++n) { - Glib::Threads::Thread::create (sigc::ptr_fun (::peak_thread_work)); + Glib::Threads::Thread::create (sigc::ptr_fun (peak_thread_work)); } } @@ -440,3 +441,5 @@ SourceFactory::createFromPlaylist (DataType type, Session& s, boost::shared_ptr< return boost::shared_ptr(); } + +} // namespace ARDOUR diff --git a/libs/ardour/speakers.cc b/libs/ardour/speakers.cc index 082156c08b..f2e57d2ca9 100644 --- a/libs/ardour/speakers.cc +++ b/libs/ardour/speakers.cc @@ -26,10 +26,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using namespace std; +namespace ARDOUR { + Speaker::Speaker (int i, const AngularVector& position) : id (i) { @@ -284,3 +285,5 @@ Speakers::set_state (const XMLNode& node, int /*version*/) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/srcfilesource.cc b/libs/ardour/srcfilesource.cc index ab7d3376d4..a0ac04566b 100644 --- a/libs/ardour/srcfilesource.cc +++ b/libs/ardour/srcfilesource.cc @@ -26,9 +26,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + const uint32_t SrcFileSource::max_blocksize = 2097152U; /* see AudioDiskstream::do_refill_with_alloc, max */ SrcFileSource::SrcFileSource (Session& s, boost::shared_ptr src, SrcQuality srcq) @@ -164,3 +165,5 @@ SrcFileSource::read_unlocked (Sample *dst, samplepos_t start, samplecnt_t cnt) c return generated; } + +} // namespace ARDOUR diff --git a/libs/ardour/st_pitch.cc b/libs/ardour/st_pitch.cc index 0a2a2a810f..1e5dd43d9c 100644 --- a/libs/ardour/st_pitch.cc +++ b/libs/ardour/st_pitch.cc @@ -31,9 +31,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + Pitch::Pitch (Session& s, TimeFXRequest& req) : Filter (s) , tsr (req) @@ -49,3 +50,5 @@ Pitch::run (boost::shared_ptr region) return 1; } + +} // namespace ARDOUR diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc index 09c11bc80d..40db34585e 100644 --- a/libs/ardour/st_stretch.cc +++ b/libs/ardour/st_stretch.cc @@ -33,10 +33,11 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; using namespace soundtouch; +namespace ARDOUR { + STStretch::STStretch (Session& s, TimeFXRequest& req) : Filter (s) , tsr (req) @@ -335,3 +336,5 @@ out: return ret; } + +} // namespace ARDOUR diff --git a/libs/ardour/strip_silence.cc b/libs/ardour/strip_silence.cc index f1bb741d92..7ad1685ce3 100644 --- a/libs/ardour/strip_silence.cc +++ b/libs/ardour/strip_silence.cc @@ -26,7 +26,7 @@ #include "ardour/region_factory.h" #include "ardour/progress.h" -using namespace ARDOUR; +namespace ARDOUR { /** Construct a StripSilence filter. * @param s Session. @@ -143,3 +143,5 @@ StripSilence::run (boost::shared_ptr r, Progress* progress) return 0; } + +} // namespace ARDOUR diff --git a/libs/ardour/stripable.cc b/libs/ardour/stripable.cc index 6ab83c8922..9950a77e33 100644 --- a/libs/ardour/stripable.cc +++ b/libs/ardour/stripable.cc @@ -30,10 +30,11 @@ #include "ardour/selection.h" #include "ardour/stripable.h" -using namespace ARDOUR; using namespace PBD; using std::string; +namespace ARDOUR { + Stripable::Stripable (Session& s, string const & name, PresentationInfo const & pi) : SessionObject (s, name) , Automatable (s) @@ -187,3 +188,5 @@ Stripable::Sorter::operator() (boost::shared_ptr a, boost::sh } return cmp_a < cmp_b; } + +} // namespace ARDOUR diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 38e3ecc9b5..b3ce36a8e7 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -46,9 +46,10 @@ #include using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + using Timecode::BBT_Time; /* _default tempo is 4/4 qtr=120 */ @@ -71,7 +72,7 @@ MetricSection::minute_at_sample (const samplepos_t sample) const /***********************************************************************/ bool -ARDOUR::bbt_time_to_string (const BBT_Time& bbt, std::string& str) +bbt_time_to_string (const BBT_Time& bbt, std::string& str) { char buf[256]; int retval = snprintf (buf, sizeof(buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, bbt.bars, bbt.beats, @@ -86,7 +87,7 @@ ARDOUR::bbt_time_to_string (const BBT_Time& bbt, std::string& str) } bool -ARDOUR::string_to_bbt_time (const std::string& str, BBT_Time& bbt) +string_to_bbt_time (const std::string& str, BBT_Time& bbt) { if (sscanf (str.c_str (), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, &bbt.bars, &bbt.beats, &bbt.ticks) == 3) { @@ -4968,3 +4969,5 @@ operator<< (std::ostream& o, const MetricSection& section) { return o; } + +} diff --git a/libs/ardour/tempo_map_importer.cc b/libs/ardour/tempo_map_importer.cc index cbb0662aaa..2daa60464d 100644 --- a/libs/ardour/tempo_map_importer.cc +++ b/libs/ardour/tempo_map_importer.cc @@ -30,7 +30,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { /**** Handler ***/ TempoMapImportHandler::TempoMapImportHandler (XMLTree const & source, Session & session) : @@ -100,3 +101,5 @@ TempoMapImporter::_move () { session.tempo_map().set_state (xml_tempo_map, Stateful::current_state_version); } + +} // namespace ARDOUR diff --git a/libs/ardour/thawlist.cc b/libs/ardour/thawlist.cc index 5e94477e9a..2c0892a493 100644 --- a/libs/ardour/thawlist.cc +++ b/libs/ardour/thawlist.cc @@ -21,7 +21,7 @@ #include "ardour/region.h" #include "ardour/thawlist.h" -using namespace ARDOUR; +namespace ARDOUR { ThawList::~ThawList () { @@ -55,3 +55,5 @@ ThawList::release () } clear (); } + +} // namespace ARDOUR diff --git a/libs/ardour/thread_buffers.cc b/libs/ardour/thread_buffers.cc index 6e801ffd9c..616713c881 100644 --- a/libs/ardour/thread_buffers.cc +++ b/libs/ardour/thread_buffers.cc @@ -25,9 +25,10 @@ #include "ardour/buffer_set.h" #include "ardour/thread_buffers.h" -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + ThreadBuffers::ThreadBuffers () : silent_buffers (new BufferSet) , scratch_buffers (new BufferSet) @@ -122,3 +123,5 @@ ThreadBuffers::allocate_pan_automation_buffers (samplecnt_t nframes, uint32_t ho npan_buffers = howmany; } + +} // namespace ARDOUR diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc index 76458039c6..77496ff36e 100644 --- a/libs/ardour/ticker.cc +++ b/libs/ardour/ticker.cc @@ -36,9 +36,10 @@ #include "ardour/tempo.h" #include "ardour/ticker.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + MidiClockTicker::MidiClockTicker (Session* s) { _session = s; @@ -288,3 +289,5 @@ MidiClockTicker::send_position_event (uint32_t midi_beats, pframes_t offset, pfr DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position Sent: %1 to %2 (events now %3, buf = %4)\n", midi_beats, _midi_port->name (), mb.size (), &mb)); } + +} // namespace ARDOUR diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 181f8b6eba..140a933bff 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -56,9 +56,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + Track::Track (Session& sess, string name, PresentationInfo::Flag flag, TrackMode mode, DataType default_type) : Route (sess, name, flag, default_type) , _saved_meter_point (_meter_point) @@ -1095,3 +1096,5 @@ Track::use_captured_audio_sources (SourceList& srcs, CaptureInfos const & captur pl->set_capture_insertion_in_progress (false); _session.add_command (new StatefulDiffCommand (pl)); } + +} // namespace ARDOUR diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc index bbf61ed795..47798beffd 100644 --- a/libs/ardour/transient_detector.cc +++ b/libs/ardour/transient_detector.cc @@ -27,9 +27,10 @@ #include "pbd/i18n.h" using namespace Vamp; -using namespace ARDOUR; using namespace std; +namespace ARDOUR { + /* need a static initializer function for this */ string TransientDetector::_op_id = X_("qm-onset"); @@ -179,3 +180,5 @@ TransientDetector::update_positions (Readable* src, uint32_t channel, AnalysisFe delete [] data; } + +} // namespace ARDOUR diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index c381fbb310..bf04d5fd33 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -32,9 +32,10 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + Pool* TransportFSM::Event::pool = 0; /* @@ -838,3 +839,5 @@ TransportFSM::will_roll_fowards () const } return (_direction_state == Forwards); } + +} // namespace ARDOUR diff --git a/libs/ardour/transport_master.cc b/libs/ardour/transport_master.cc index a9debe974e..147c82d8d9 100644 --- a/libs/ardour/transport_master.cc +++ b/libs/ardour/transport_master.cc @@ -33,19 +33,18 @@ #include "pbd/i18n.h" -namespace ARDOUR { - namespace Properties { - PBD::PropertyDescriptor fr2997; - PBD::PropertyDescriptor sclock_synced; - PBD::PropertyDescriptor collect; - PBD::PropertyDescriptor connected; - PBD::PropertyDescriptor allowed_transport_requests; - } -} - -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + +namespace Properties { +PBD::PropertyDescriptor fr2997; +PBD::PropertyDescriptor sclock_synced; +PBD::PropertyDescriptor collect; +PBD::PropertyDescriptor connected; +PBD::PropertyDescriptor allowed_transport_requests; +} + void TransportMaster::make_property_quarks () { @@ -593,3 +592,5 @@ TransportMasterViaMIDI::resync_latency (bool playback) _midi_port->get_connected_latency_range (midi_port_latency, false); } } + +} // namespace ARDOUR diff --git a/libs/ardour/transport_master_manager.cc b/libs/ardour/transport_master_manager.cc index ef096fe5ab..9de2262bf9 100644 --- a/libs/ardour/transport_master_manager.cc +++ b/libs/ardour/transport_master_manager.cc @@ -29,9 +29,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + const std::string TransportMasterManager::state_node_name = X_("TransportMasters"); TransportMasterManager* TransportMasterManager::_instance = 0; @@ -761,3 +762,5 @@ TransportMasterManager::reinit (double speed, samplepos_t pos) { init_transport_master_dll (speed, pos); } + +} // namespace ARDOUR diff --git a/libs/ardour/unknown_processor.cc b/libs/ardour/unknown_processor.cc index c403e7695b..99022823eb 100644 --- a/libs/ardour/unknown_processor.cc +++ b/libs/ardour/unknown_processor.cc @@ -24,7 +24,8 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; + +namespace ARDOUR { UnknownProcessor::UnknownProcessor (Session& s, XMLNode const & state) : Processor (s, "") @@ -122,3 +123,5 @@ UnknownProcessor::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_ bufs.get_audio (i).silence (nframes); } } + +} // namespace ARDOUR diff --git a/libs/ardour/user_bundle.cc b/libs/ardour/user_bundle.cc index 0e456107de..48f280a3b8 100644 --- a/libs/ardour/user_bundle.cc +++ b/libs/ardour/user_bundle.cc @@ -26,13 +26,15 @@ #include "pbd/failed_constructor.h" #include "pbd/xml++.h" -ARDOUR::UserBundle::UserBundle (std::string const & n) +namespace ARDOUR { + +UserBundle::UserBundle (std::string const & n) : Bundle (n) { } -ARDOUR::UserBundle::UserBundle (XMLNode const & node, bool i) +UserBundle::UserBundle (XMLNode const & node, bool i) : Bundle (i) { if (set_state (node, Stateful::loading_state_version)) { @@ -41,7 +43,7 @@ ARDOUR::UserBundle::UserBundle (XMLNode const & node, bool i) } int -ARDOUR::UserBundle::set_state (XMLNode const & node, int /*version*/) +UserBundle::set_state (XMLNode const & node, int /*version*/) { std::string str; if (!node.get_property ("name", str)) { @@ -97,7 +99,7 @@ ARDOUR::UserBundle::set_state (XMLNode const & node, int /*version*/) } XMLNode& -ARDOUR::UserBundle::get_state () +UserBundle::get_state () { XMLNode *node; @@ -129,3 +131,5 @@ ARDOUR::UserBundle::get_state () return *node; } + +} // namespace ARDOUR diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 39a1833e04..b7b443acac 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -65,10 +65,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace std; using namespace PBD; +namespace ARDOUR { + static string replace_chars (const string& str, const string& illegal_chars) { @@ -100,7 +101,7 @@ replace_chars (const string& str, const string& illegal_chars) * the goal there is to be legal across filesystems. */ string -ARDOUR::legalize_for_path (const string& str) +legalize_for_path (const string& str) { return replace_chars (str, "/\\"); } @@ -115,7 +116,7 @@ ARDOUR::legalize_for_path (const string& str) * ANY filesystem. */ string -ARDOUR::legalize_for_universal_path (const string& str) +legalize_for_universal_path (const string& str) { return replace_chars (str, "<>:\"/\\|?*"); } @@ -126,7 +127,7 @@ ARDOUR::legalize_for_universal_path (const string& str) * correct. */ string -ARDOUR::legalize_for_uri (const string& str) +legalize_for_uri (const string& str) { return replace_chars (str, "<>:\"/\\|?* #"); } @@ -140,7 +141,7 @@ ARDOUR::legalize_for_uri (const string& str) */ string -ARDOUR::legalize_for_path_2X (const string& str) +legalize_for_path_2X (const string& str) { string::size_type pos; string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: "; @@ -162,7 +163,7 @@ ARDOUR::legalize_for_path_2X (const string& str) } string -ARDOUR::bump_name_once (const std::string& name, char delimiter) +bump_name_once (const std::string& name, char delimiter) { string::size_type delim; string newname; @@ -204,7 +205,7 @@ ARDOUR::bump_name_once (const std::string& name, char delimiter) } string -ARDOUR::bump_name_number (const std::string& name) +bump_name_number (const std::string& name) { size_t pos = name.length(); size_t num = 0; @@ -230,7 +231,7 @@ ARDOUR::bump_name_number (const std::string& name) } XMLNode * -ARDOUR::find_named_node (const XMLNode& node, string name) +find_named_node (const XMLNode& node, string name) { XMLNodeList nlist; XMLNodeConstIterator niter; @@ -251,7 +252,7 @@ ARDOUR::find_named_node (const XMLNode& node, string name) } int -ARDOUR::cmp_nocase (const string& s, const string& s2) +cmp_nocase (const string& s, const string& s2) { string::const_iterator p = s.begin(); string::const_iterator p2 = s2.begin(); @@ -268,7 +269,7 @@ ARDOUR::cmp_nocase (const string& s, const string& s2) } int -ARDOUR::cmp_nocase_utf8 (const string& s1, const string& s2) +cmp_nocase_utf8 (const string& s1, const string& s2) { const char *cstr1 = s1.c_str(); const char *cstr2 = s2.c_str(); @@ -304,7 +305,7 @@ ARDOUR::cmp_nocase_utf8 (const string& s1, const string& s2) } string -ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one) +region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one) { path = PBD::basename_nosuffix (path); @@ -336,7 +337,7 @@ ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channe } bool -ARDOUR::path_is_paired (string path, string& pair_base) +path_is_paired (string path, string& pair_base) { string::size_type pos; @@ -369,7 +370,7 @@ ARDOUR::path_is_paired (string path, string& pair_base) #if __APPLE__ string -ARDOUR::CFStringRefToStdString(CFStringRef stringRef) +CFStringRefToStdString(CFStringRef stringRef) { CFIndex size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef) , @@ -387,7 +388,7 @@ ARDOUR::CFStringRefToStdString(CFStringRef stringRef) #endif // __APPLE__ void -ARDOUR::compute_equal_power_fades (samplecnt_t nframes, float* in, float* out) +compute_equal_power_fades (samplecnt_t nframes, float* in, float* out) { double step; @@ -413,7 +414,7 @@ ARDOUR::compute_equal_power_fades (samplecnt_t nframes, float* in, float* out) } EditMode -ARDOUR::string_to_edit_mode (string str) +string_to_edit_mode (string str) { if (str == _("Splice")) { return Splice; @@ -430,7 +431,7 @@ ARDOUR::string_to_edit_mode (string str) } const char* -ARDOUR::edit_mode_to_string (EditMode mode) +edit_mode_to_string (EditMode mode) { switch (mode) { case Slide: @@ -449,7 +450,7 @@ ARDOUR::edit_mode_to_string (EditMode mode) } float -ARDOUR::meter_falloff_to_float (MeterFalloff falloff) +meter_falloff_to_float (MeterFalloff falloff) { switch (falloff) { case MeterFalloffOff: @@ -473,7 +474,7 @@ ARDOUR::meter_falloff_to_float (MeterFalloff falloff) } MeterFalloff -ARDOUR::meter_falloff_from_float (float val) +meter_falloff_from_float (float val) { if (val == METER_FALLOFF_OFF) { return MeterFalloffOff; @@ -499,7 +500,7 @@ ARDOUR::meter_falloff_from_float (float val) } AutoState -ARDOUR::string_to_auto_state (std::string str) +string_to_auto_state (std::string str) { if (str == X_("Off")) { return Off; @@ -519,7 +520,7 @@ ARDOUR::string_to_auto_state (std::string str) } string -ARDOUR::auto_state_to_string (AutoState as) +auto_state_to_string (AutoState as) { /* to be used only for XML serialization, no i18n done */ @@ -553,7 +554,7 @@ bool_as_string (bool yn) } const char* -ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type) +native_header_format_extension (HeaderFormat hf, const DataType& type) { if (type == DataType::MIDI) { return ".mid"; @@ -586,7 +587,7 @@ ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type) } bool -ARDOUR::matching_unsuffixed_filename_exists_in (const string& dir, const string& path) +matching_unsuffixed_filename_exists_in (const string& dir, const string& path) { string bws = basename_nosuffix (path); struct dirent* dentry; @@ -631,7 +632,7 @@ ARDOUR::matching_unsuffixed_filename_exists_in (const string& dir, const string& } uint32_t -ARDOUR::how_many_dsp_threads () +how_many_dsp_threads () { /* CALLER MUST HOLD PROCESS LOCK */ @@ -665,13 +666,13 @@ ARDOUR::how_many_dsp_threads () } double -ARDOUR::gain_to_slider_position_with_max (double g, double max_gain) +gain_to_slider_position_with_max (double g, double max_gain) { return gain_to_position (g * 2.0 / max_gain); } double -ARDOUR::slider_position_to_gain_with_max (double g, double max_gain) +slider_position_to_gain_with_max (double g, double max_gain) { return position_to_gain (g) * max_gain / 2.0; } @@ -679,7 +680,7 @@ ARDOUR::slider_position_to_gain_with_max (double g, double max_gain) #include "sha1.c" std::string -ARDOUR::compute_sha1_of_file (std::string path) +compute_sha1_of_file (std::string path) { PBD::ScopedFileDescriptor fd (g_open (path.c_str(), O_RDONLY, 0444)); if (fd < 0) { @@ -698,3 +699,5 @@ ARDOUR::compute_sha1_of_file (std::string path) sha1_result_hash (&s, hash); return std::string (hash); } + +} // namespace ARDOUR diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc index c2e943bc58..c726bc778a 100644 --- a/libs/ardour/vca.cc +++ b/libs/ardour/vca.cc @@ -30,10 +30,11 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace PBD; using std::string; +namespace ARDOUR { + Glib::Threads::Mutex VCA::number_lock; int32_t VCA::next_number = 1; string VCA::xml_node_name (X_("VCA")); @@ -229,3 +230,5 @@ VCA::slavables () const rv.push_back (_solo_control); return rv; } + +} // namespace ARDOUR diff --git a/libs/ardour/vca_manager.cc b/libs/ardour/vca_manager.cc index ca50ea576e..887f7a7f94 100644 --- a/libs/ardour/vca_manager.cc +++ b/libs/ardour/vca_manager.cc @@ -30,11 +30,12 @@ #include "pbd/i18n.h" -using namespace ARDOUR; using namespace Glib::Threads; using namespace PBD; using std::string; +namespace ARDOUR { + string VCAManager::xml_node_name (X_("VCAManager")); VCAManager::VCAManager (Session& s) @@ -237,3 +238,5 @@ VCAManager::clear_all_solo_state () (*i)->clear_all_solo_state (); } } + +} // namespace ARDOUR diff --git a/libs/ardour/vst3_module.cc b/libs/ardour/vst3_module.cc index f954d28910..1e8cd1a829 100644 --- a/libs/ardour/vst3_module.cc +++ b/libs/ardour/vst3_module.cc @@ -41,7 +41,7 @@ #include "pbd/i18n.h" -using namespace ARDOUR; +namespace ARDOUR { #ifdef __APPLE__ @@ -256,3 +256,5 @@ VST3PluginModule::load (std::string const& path) return boost::shared_ptr (new VST3LinuxModule (path)); #endif } + +} // namespace ARDOUR diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 73fe843b97..6bdf5e5dd7 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -48,10 +48,11 @@ #include "pbd/i18n.h" using namespace PBD; -using namespace ARDOUR; using namespace Steinberg; using namespace Presonus; +namespace ARDOUR { + VST3Plugin::VST3Plugin (AudioEngine& engine, Session& session, VST3PI* plug) : Plugin (engine, session) , _plug (plug) @@ -292,10 +293,14 @@ VST3Plugin::update_contoller_param () _plug->update_contoller_param (); } +} // namespace ARDOUR + /* **************************************************************************** * MIDI converters */ +namespace Steinberg { + bool VST3PI::evoral_to_vst3 (Vst::Event& e, Evoral::Event const& ev, int32_t bus) { @@ -382,7 +387,7 @@ VST3PI::evoral_to_vst3 (Vst::Event& e, Evoral::Event const& ev, int #define vst_to_midi(x) (static_cast ((x)*127.f) & 0x7f) void -VST3PI::vst3_to_midi_buffers (BufferSet& bufs, ChanMapping const& out_map) +VST3PI::vst3_to_midi_buffers (ARDOUR::BufferSet& bufs, ARDOUR::ChanMapping const& out_map) { for (int32 i = 0; i < _output_events.getEventCount (); ++i) { Vst::Event e; @@ -391,14 +396,14 @@ VST3PI::vst3_to_midi_buffers (BufferSet& bufs, ChanMapping const& out_map) } bool valid = false; - uint32_t index = out_map.get (DataType::MIDI, e.busIndex, &valid); + uint32_t index = out_map.get (ARDOUR::DataType::MIDI, e.busIndex, &valid); if (!valid || bufs.count ().n_midi () <= index) { DEBUG_TRACE (DEBUG::VST3Process, string_compose ("VST3PI::vst3_to_midi_buffers - Invalid MIDI Bus %1\n", e.busIndex)); continue; } - MidiBuffer& mb = bufs.get_midi (index); - uint8_t data[3]; + ARDOUR::MidiBuffer& mb = bufs.get_midi (index); + uint8_t data[3]; switch (e.type) { case Vst::Event::kDataEvent: @@ -465,8 +470,12 @@ VST3PI::vst3_to_midi_buffers (BufferSet& bufs, ChanMapping const& out_map) } } +} // namespace Steinberg + /* ****************************************************************************/ +namespace ARDOUR { + void VST3Plugin::add_state (XMLNode* root) const { @@ -998,6 +1007,10 @@ VST3PluginInfo::is_instrument () const /* ****************************************************************************/ +} // namespace ARDOUR + +namespace Steinberg { + VST3PI::VST3PI (boost::shared_ptr m, std::string unique_id) : _module (m) , _component (0) @@ -1486,7 +1499,7 @@ VST3PI::update_processor () } Vst::ProcessSetup setup; - setup.processMode = AudioEngine::instance ()->freewheeling () ? Vst::kOffline : Vst::kRealtime; + setup.processMode = ARDOUR::AudioEngine::instance ()->freewheeling () ? Vst::kOffline : Vst::kRealtime; setup.symbolicSampleSize = Vst::kSample32; setup.maxSamplesPerBlock = _block_size; setup.sampleRate = _context.sampleRate; @@ -1511,7 +1524,7 @@ VST3PI::plugin_latency () } void -VST3PI::set_owner (SessionObject* o) +VST3PI::set_owner (ARDOUR::SessionObject* o) { _owner = o; if (!o) { @@ -1556,7 +1569,7 @@ VST3PI::count_channels (Vst::MediaType media, Vst::BusDirection dir, Vst::BusTyp return std::min (1, bus.channelCount); #else /* Some plugin leave it at zero, even though they accept events */ - _io_name[media][dir].push_back (Plugin::IOPortDescription (bus_name, is_sidechain)); + _io_name[media][dir].push_back (ARDOUR::Plugin::IOPortDescription (bus_name, is_sidechain)); return 1; #endif } else { @@ -1567,7 +1580,7 @@ VST3PI::count_channels (Vst::MediaType media, Vst::BusDirection dir, Vst::BusTyp } else { channel_name = bus_name; } - _io_name[media][dir].push_back (Plugin::IOPortDescription (channel_name, is_sidechain, bus_name, j)); + _io_name[media][dir].push_back (ARDOUR::Plugin::IOPortDescription (channel_name, is_sidechain, bus_name, j)); } n_channels += bus.channelCount; } @@ -1601,7 +1614,7 @@ VST3PI::default_value (uint32_t port) const } void -VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) const +VST3PI::get_parameter_descriptor (uint32_t port, ARDOUR::ParameterDescriptor& desc) const { Param const& p (_ctrl_params[port]); Vst::ParamID id (index_to_id (port)); @@ -1624,7 +1637,7 @@ VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) cons FUnknownPtr extra_ctrl (_controller); if (extra_ctrl && port != designated_bypass_port ()) { int32 flags = extra_ctrl->getParamExtraFlags (id); - if (Config->get_show_vst3_micro_edit_inline ()) { + if (ARDOUR::Config->get_show_vst3_micro_edit_inline ()) { desc.inline_ctrl = (flags & kParamFlagMicroEdit) ? true : false; } } @@ -1671,18 +1684,18 @@ VST3PI::n_midi_outputs () const return _n_midi_outputs; } -Plugin::IOPortDescription +ARDOUR::Plugin::IOPortDescription VST3PI::describe_io_port (ARDOUR::DataType dt, bool input, uint32_t id) const { switch (dt) { - case DataType::AUDIO: + case ARDOUR::DataType::AUDIO: return _io_name[Vst::kAudio][input ? 0 : 1][id]; break; - case DataType::MIDI: + case ARDOUR::DataType::MIDI: return _io_name[Vst::kEvent][input ? 0 : 1][id]; break; default: - return Plugin::IOPortDescription ("?"); + return ARDOUR::Plugin::IOPortDescription ("?"); break; } } @@ -2039,7 +2052,7 @@ VST3PI::process (float** ins, float** outs, uint32_t n_samples) Vst::ProcessData data; data.numSamples = n_samples; - data.processMode = AudioEngine::instance ()->freewheeling () ? Vst::kOffline : Vst::kRealtime; + data.processMode = ARDOUR::AudioEngine::instance ()->freewheeling () ? Vst::kOffline : Vst::kRealtime; data.symbolicSampleSize = Vst::kSample32; data.numInputs = used_bus_count (_n_aux_inputs, _n_inputs); // _n_bus_in; data.numOutputs = used_bus_count (_n_aux_outputs, _n_outputs); // _n_bus_out; @@ -2144,7 +2157,6 @@ VST3PI::process (float** ins, float** outs, uint32_t n_samples) * compare to public.sdk/source/vst/vstpresetfile.cpp */ -namespace Steinberg { namespace Vst { enum ChunkType { @@ -2197,8 +2209,6 @@ struct ChunkEntry { typedef std::vector ChunkEntryVector; -} // namespace Steinberg - static bool is_equal_ID (const Vst::ChunkID id1, const Vst::ChunkID id2) { @@ -2376,7 +2386,7 @@ void VST3PI::stripable_property_changed (PBD::PropertyChange const&) { FUnknownPtr il (_controller); - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); assert (il && s); DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::stripable_property_changed\n"); @@ -2429,7 +2439,7 @@ VST3PI::setup_info_listener () return false; } DEBUG_TRACE (DEBUG::VST3Config, "VST3PI::setup_info_listener\n"); - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); s->PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::stripable_property_changed, this, _1)); s->presentation_info ().PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::stripable_property_changed, this, _1)); @@ -2471,11 +2481,11 @@ VST3PI::subscribe_to_automation_changes () const } void -VST3PI::automation_state_changed (uint32_t port, AutoState s, boost::weak_ptr wal) +VST3PI::automation_state_changed (uint32_t port, ARDOUR::AutoState s, boost::weak_ptr wal) { - Vst::ParamID id (index_to_id (port)); - boost::shared_ptr al = wal.lock (); - FUnknownPtr extra_ctrl (_controller); + Vst::ParamID id (index_to_id (port)); + boost::shared_ptr al = wal.lock(); + FUnknownPtr extra_ctrl (_controller); assert (extra_ctrl); AutomationMode am; @@ -2487,16 +2497,16 @@ VST3PI::automation_state_changed (uint32_t port, AutoState s, boost::weak_ptr -lookup_ac (SessionObject* o, FIDString id) +static boost::shared_ptr +lookup_ac (ARDOUR::SessionObject* o, FIDString id) { - Stripable* s = dynamic_cast (o); + ARDOUR::Stripable* s = dynamic_cast (o); if (!s) { - return boost::shared_ptr (); + return boost::shared_ptr (); } if (0 == strcmp (id, ContextInfo::kMute)) { @@ -2546,13 +2556,13 @@ lookup_ac (SessionObject* o, FIDString id) } #endif } - return boost::shared_ptr (); + return boost::shared_ptr (); } tresult VST3PI::getContextInfoValue (int32& value, FIDString id) { - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); if (!s) { DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::getContextInfoValue: not initialized"); return kNotInitialized; @@ -2562,9 +2572,9 @@ VST3PI::getContextInfoValue (int32& value, FIDString id) } else if (0 == strcmp (id, ContextInfo::kType)) { if (s->is_master ()) { value = ContextInfo::kOut; - } else if (s->presentation_info ().flags () & PresentationInfo::AudioTrack) { + } else if (s->presentation_info ().flags () & ARDOUR::PresentationInfo::AudioTrack) { value = ContextInfo::kTrack; - } else if (s->presentation_info ().flags () & PresentationInfo::MidiTrack) { + } else if (s->presentation_info ().flags () & ARDOUR::PresentationInfo::MidiTrack) { value = ContextInfo::kSynth; } else { value = ContextInfo::kBus; @@ -2583,15 +2593,16 @@ VST3PI::getContextInfoValue (int32& value, FIDString id) } else if (0 == strcmp (id, ContextInfo::kSelected)) { value = s->is_selected () ? 1 : 0; } else if (0 == strcmp (id, ContextInfo::kFocused)) { - boost::shared_ptr stripable = s->session ().selection ().first_selected_stripable (); - value = stripable && stripable.get () == s ? 1 : 0; + boost::shared_ptr stripable = s->session ().selection ().first_selected_stripable (); + + value = stripable && stripable.get() == s ? 1 : 0; } else if (0 == strcmp (id, ContextInfo::kSendCount)) { value = 0; while (s->send_enable_controllable (value)) { ++value; } } else if (0 == strcmp (id, ContextInfo::kMute)) { - boost::shared_ptr ac = s->mute_control (); + boost::shared_ptr ac = s->mute_control (); if (ac) { psl_subscribe_to (ac, id); value = ac->muted_by_self (); @@ -2599,7 +2610,7 @@ VST3PI::getContextInfoValue (int32& value, FIDString id) value = 0; } } else if (0 == strcmp (id, ContextInfo::kSolo)) { - boost::shared_ptr ac = s->solo_control (); + boost::shared_ptr ac = s->solo_control (); if (ac) { psl_subscribe_to (ac, id); value = ac->self_soloed (); @@ -2641,7 +2652,7 @@ VST3PI::getContextInfoString (Vst::TChar* string, int32 max_len, FIDString id) DEBUG_TRACE (DEBUG::VST3Callbacks, string_compose ("VST3PI::setContextInfoString: NOT IMPLEMENTED (%1)\n", id)); return kNotImplemented; // XXX TODO } else { - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (!ac) { DEBUG_TRACE (DEBUG::VST3Callbacks, string_compose ("VST3PI::getContextInfoString unsupported ID %1\n", id)); return kInvalidArgument; @@ -2655,7 +2666,7 @@ VST3PI::getContextInfoString (Vst::TChar* string, int32 max_len, FIDString id) tresult VST3PI::getContextInfoValue (double& value, FIDString id) { - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); if (!s) { DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::getContextInfoValue: not initialized"); return kNotInitialized; @@ -2670,11 +2681,11 @@ VST3PI::getContextInfoValue (double& value, FIDString id) #endif value = 2.0; // Config->get_max_gain(); } else if (0 == strcmp (id, ContextInfo::kVolume)) { - boost::shared_ptr ac = s->gain_control (); + boost::shared_ptr ac = s->gain_control (); value = ac->get_value (); // gain coefficient 0..2 (1.0 = 0dB) psl_subscribe_to (ac, id); } else if (0 == strcmp (id, ContextInfo::kPan)) { - boost::shared_ptr ac = s->pan_azimuth_control (); + boost::shared_ptr ac = s->pan_azimuth_control (); if (ac) { value = ac->internal_to_interface (ac->get_value (), true); psl_subscribe_to (ac, id); @@ -2682,7 +2693,7 @@ VST3PI::getContextInfoValue (double& value, FIDString id) value = 0.5; // center } } else if (0 == strncmp (id, ContextInfo::kSendLevel, strlen (ContextInfo::kSendLevel))) { - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (ac) { value = ac->get_value (); // gain cofficient psl_subscribe_to (ac, id); @@ -2707,15 +2718,15 @@ VST3PI::setContextInfoValue (FIDString id, double value) } DEBUG_TRACE (DEBUG::VST3Callbacks, string_compose ("VST3PI::setContextInfoValue %1 to %2\n", id, value)); if (0 == strcmp (id, ContextInfo::kVolume)) { - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); ac->set_value (value, Controllable::NoGroup); } else if (0 == strcmp (id, ContextInfo::kPan)) { - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (ac) { ac->set_value (ac->interface_to_internal (value, true), PBD::Controllable::NoGroup); } } else if (0 == strncmp (id, ContextInfo::kSendLevel, strlen (ContextInfo::kSendLevel))) { - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (ac) { ac->set_value (value, Controllable::NoGroup); } else { @@ -2731,7 +2742,7 @@ VST3PI::setContextInfoValue (FIDString id, double value) tresult VST3PI::setContextInfoValue (FIDString id, int32 value) { - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); if (!s) { DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::setContextInfoValue: not initialized"); return kNotInitialized; @@ -2743,14 +2754,14 @@ VST3PI::setContextInfoValue (FIDString id, int32 value) #endif s->presentation_info ().set_color (value); } else if (0 == strcmp (id, ContextInfo::kSelected)) { - boost::shared_ptr stripable = s->session ().stripable_by_id (s->id ()); + boost::shared_ptr stripable = s->session ().stripable_by_id (s->id ()); assert (stripable); if (value == 0) { - s->session ().selection ().remove (stripable, boost::shared_ptr ()); + s->session ().selection ().remove (stripable, boost::shared_ptr ()); } else if (_add_to_selection) { - s->session ().selection ().add (stripable, boost::shared_ptr ()); + s->session ().selection ().add (stripable, boost::shared_ptr ()); } else { - s->session ().selection ().set (stripable, boost::shared_ptr ()); + s->session ().selection ().set (stripable, boost::shared_ptr ()); } } else if (0 == strcmp (id, ContextInfo::kMultiSelect)) { _add_to_selection = value != 0; @@ -2787,7 +2798,7 @@ VST3PI::beginEditContextInfoValue (FIDString id) DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::beginEditContextInfoValue: not initialized"); return kNotInitialized; } - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (!ac) { return kInvalidArgument; } @@ -2803,7 +2814,7 @@ VST3PI::endEditContextInfoValue (FIDString id) DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::endEditContextInfoValue: not initialized"); return kNotInitialized; } - boost::shared_ptr ac = lookup_ac (_owner, id); + boost::shared_ptr ac = lookup_ac (_owner, id); if (!ac) { return kInvalidArgument; } @@ -2853,17 +2864,17 @@ VST3PI::psl_stripable_property_changed (PBD::PropertyChange const& what_changed) DEBUG_TRACE (DEBUG::VST3Callbacks, "VST3PI::psl_stripable_property_changed v2\n"); - if (what_changed.contains (Properties::selected)) { + if (what_changed.contains (ARDOUR::Properties::selected)) { nfo2->notifyContextInfoChange (ContextInfo::kSelected); nfo2->notifyContextInfoChange (ContextInfo::kFocused); // XXX } - if (what_changed.contains (Properties::hidden)) { + if (what_changed.contains (ARDOUR::Properties::hidden)) { nfo2->notifyContextInfoChange (ContextInfo::kVisibility); } - if (what_changed.contains (Properties::name)) { + if (what_changed.contains (ARDOUR::Properties::name)) { nfo2->notifyContextInfoChange (ContextInfo::kName); } - if (what_changed.contains (Properties::color)) { + if (what_changed.contains (ARDOUR::Properties::color)) { nfo2->notifyContextInfoChange (ContextInfo::kColor); } } @@ -2886,7 +2897,7 @@ VST3PI::setup_psl_info_handler () return false; } - Stripable* s = dynamic_cast (_owner); + ARDOUR::Stripable* s = dynamic_cast (_owner); s->PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::psl_stripable_property_changed, this, _1)); s->presentation_info ().PropertyChanged.connect_same_thread (_strip_connections, boost::bind (&VST3PI::psl_stripable_property_changed, this, _1)); @@ -2975,3 +2986,5 @@ VST3PI::resizeView (IPlugView* view, ViewRect* new_size) OnResizeView (new_size->getWidth (), new_size->getHeight ()); /* EMIT SIGNAL */ return view->onSize (new_size); } + +} // namespace Steinberg diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index af41523138..43a7ce2ef7 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -44,7 +44,8 @@ using namespace std; using namespace PBD; -using namespace ARDOUR; + +namespace ARDOUR { VSTPlugin::VSTPlugin (AudioEngine& engine, Session& session, VSTHandle* handle) : Plugin (engine, session) @@ -599,7 +600,7 @@ VSTPlugin::do_save_preset (string name) t->root()->add_child_nocopy (*p); - std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string f = Glib::build_filename (user_config_directory (), "presets"); f = Glib::build_filename (f, presets_file ()); t->write (f); @@ -616,7 +617,7 @@ VSTPlugin::do_remove_preset (string name) t->root()->remove_nodes_and_delete (X_("label"), name); - std::string f = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string f = Glib::build_filename (user_config_directory (), "presets"); f = Glib::build_filename (f, presets_file ()); t->write (f); @@ -905,7 +906,7 @@ VSTPlugin::presets_tree () const { XMLTree* t = new XMLTree; - std::string p = Glib::build_filename (ARDOUR::user_config_directory (), "presets"); + std::string p = Glib::build_filename (user_config_directory (), "presets"); if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { if (g_mkdir_with_parents (p.c_str(), 0755) != 0) { @@ -970,3 +971,5 @@ VSTPluginInfo::is_instrument () const } return PluginInfo::is_instrument (); } + +} // namespace ARDOUR diff --git a/libs/ardour/windows_vst_plugin.cc b/libs/ardour/windows_vst_plugin.cc index 4244ce87be..383a82b27e 100644 --- a/libs/ardour/windows_vst_plugin.cc +++ b/libs/ardour/windows_vst_plugin.cc @@ -30,9 +30,10 @@ #include "pbd/i18n.h" using namespace std; -using namespace ARDOUR; using namespace PBD; +namespace ARDOUR { + WindowsVSTPlugin::WindowsVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id) : VSTPlugin (e, session, h) { @@ -139,3 +140,4 @@ WindowsVSTPluginInfo::WindowsVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo) type = ARDOUR::Windows_VST; } +} // namespace ARDOUR diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h index 90b6db4192..ba87c262f6 100644 --- a/libs/canvas/canvas/canvas.h +++ b/libs/canvas/canvas/canvas.h @@ -323,8 +323,8 @@ private: void scrolled (); }; +std::ostream& operator<< (std::ostream&, const Canvas&); + } -std::ostream& operator<< (std::ostream&, const ArdourCanvas::Canvas&); - #endif diff --git a/libs/canvas/canvas/item.h b/libs/canvas/canvas/item.h index 9d9ee62219..0b03dc294e 100644 --- a/libs/canvas/canvas/item.h +++ b/libs/canvas/canvas/item.h @@ -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&); } diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc index 9c7555c149..a695286c42 100644 --- a/libs/canvas/item.cc +++ b/libs/canvas/item.cc @@ -30,7 +30,8 @@ using namespace std; using namespace PBD; -using namespace ArdourCanvas; + +namespace ArdourCanvas { int Item::default_items_per_cell = 64; @@ -1178,10 +1179,11 @@ Item::dump (ostream& o) const } } -ostream& -ArdourCanvas::operator<< (ostream& o, const Item& i) +std::ostream& +operator<< (std::ostream& o, const Item& i) { i.dump (o); return o; } +} diff --git a/libs/canvas/types.cc b/libs/canvas/types.cc index 6d6d4e08c1..9b8bdfe165 100644 --- a/libs/canvas/types.cc +++ b/libs/canvas/types.cc @@ -25,21 +25,23 @@ #include "canvas/types.h" using namespace std; -using namespace ArdourCanvas; -Coord const ArdourCanvas::COORD_MAX = 1.7e307; +namespace ArdourCanvas { + +Coord const COORD_MAX = 1.7e307; ostream & -ArdourCanvas::operator<< (ostream & s, Duple const & r) +operator<< (ostream & s, Duple const & r) { s << "(" << r.x << ", " << r.y << ")"; return s; } ostream & -ArdourCanvas::operator<< (ostream & s, Rect const & r) +operator<< (ostream & s, Rect const & r) { s << "[(" << r.x0 << ", " << r.y0 << "), (" << r.x1 << ", " << r.y1 << ") " << r.width() << " x " << r.height() << "]"; return s; } +} diff --git a/libs/evoral/ControlSet.cc b/libs/evoral/ControlSet.cc index c9096187db..18b1f3dce7 100644 --- a/libs/evoral/ControlSet.cc +++ b/libs/evoral/ControlSet.cc @@ -29,6 +29,7 @@ using namespace std; namespace Evoral { +class Parameter; ControlSet::ControlSet() { @@ -104,12 +105,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 + diff --git a/libs/evoral/evoral/Event.h b/libs/evoral/evoral/Event.h index 43a60c3a02..65e5f6c946 100644 --- a/libs/evoral/evoral/Event.h +++ b/libs/evoral/evoral/Event.h @@ -208,7 +208,7 @@ protected: }; template -/*LIBEVORAL_API*/ std::ostream& operator<<(std::ostream& o, const Evoral::Event