WIP: Fix namespace issues and build with GCC8

The build was broken for me with both GCC 8 and clang 11 due to the lookup of
operator<<().  However, since the previous pattern of using a namespace then
defining things in that namespace in... the global namespace... sort of... is
very strange, and likely to cause further problems with ADL especially as we
move to newer language versions and libraries, I opted to go all-out here and
define things inside the appropriate namespace.

This will probably resolve some earlier issues with clang and MSVC as well,
since they each use different lookup rules that all have their own quirks
around this stuff.
This commit is contained in:
David Robillard 2021-05-25 16:41:19 -04:00
parent 6ae9dcc650
commit 1324c25282
240 changed files with 1191 additions and 638 deletions

View file

@ -37,11 +37,12 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
#define GAIN_COEFF_DELTA (1e-5) #define GAIN_COEFF_DELTA (1e-5)
namespace ARDOUR {
Amp::Amp (Session& s, const std::string& name, boost::shared_ptr<GainControl> gc, bool control_midi_also) Amp::Amp (Session& s, const std::string& name, boost::shared_ptr<GainControl> gc, bool control_midi_also)
: Processor(s, "Amp") : Processor(s, "Amp")
, _apply_gain_automation(false) , _apply_gain_automation(false)
@ -412,3 +413,5 @@ Amp::set_gain_automation_buffer (gain_t* g)
{ {
_gain_automation_buffer = g; _gain_automation_buffer = g;
} }
} // namespace ARDOUR

View file

@ -33,9 +33,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
Analyser* Analyser::the_analyser = 0; Analyser* Analyser::the_analyser = 0;
Glib::Threads::Mutex Analyser::analysis_active_lock; Glib::Threads::Mutex Analyser::analysis_active_lock;
Glib::Threads::Mutex Analyser::analysis_queue_lock; Glib::Threads::Mutex Analyser::analysis_queue_lock;
@ -137,3 +138,5 @@ Analyser::flush ()
Glib::Threads::Mutex::Lock la (analysis_active_lock); Glib::Threads::Mutex::Lock la (analysis_active_lock);
analysis_queue.clear(); analysis_queue.clear();
} }
} // namespace ARDOUR

View file

@ -31,9 +31,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace AudioGrapher; using namespace AudioGrapher;
namespace ARDOUR {
AnalysisGraph::AnalysisGraph (Session *s) AnalysisGraph::AnalysisGraph (Session *s)
: _session (s) : _session (s)
, _max_chunksize (8192) , _max_chunksize (8192)
@ -159,3 +160,5 @@ AnalysisGraph::analyze_range (boost::shared_ptr<Route> route, boost::shared_ptr<
_results.insert (std::make_pair (name, analyser->result ())); _results.insert (std::make_pair (name, analyser->result ()));
} }
} }
} // namespace ARDOUR

View file

@ -178,8 +178,8 @@ public:
int channel; ///< channel index, or -1 for "all" 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__ */ #endif /* __ardour_bundle_h__ */

View file

@ -212,9 +212,9 @@ private:
uint32_t _counts[DataType::num_types]; 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__ #endif // __ardour_chan_count_h__

View file

@ -136,9 +136,9 @@ private:
Mappings _mappings; 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__ #endif // __ardour_chan_mapping_h__

View file

@ -447,8 +447,8 @@ private:
GATOMIC_QUAL gint _flush; GATOMIC_QUAL gint _flush;
}; };
std::ostream& operator<<(std::ostream& o, const PluginInsert::Match& m);
} // namespace ARDOUR } // namespace ARDOUR
std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m);
#endif /* __ardour_plugin_insert_h__ */ #endif /* __ardour_plugin_insert_h__ */

View file

@ -280,8 +280,8 @@ class LIBARDOUR_API PresentationInfo : public PBD::Stateful
static int selection_counter; 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__ */ #endif /* __libardour_presentation_info_h__ */

View file

@ -627,11 +627,11 @@ private:
MeterSection* copy_metrics_and_point (const Metrics& metrics, Metrics& copy, MeterSection* section) const; 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&); }; /* namespace ARDOUR */
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const ARDOUR::Tempo&);
LIBARDOUR_API std::ostream& operator<< (std::ostream&, const ARDOUR::MetricSection&);
namespace PBD { namespace PBD {
DEFINE_ENUM_CONVERT (ARDOUR::TempoSection::Type) DEFINE_ENUM_CONVERT (ARDOUR::TempoSection::Type)

View file

@ -34,10 +34,11 @@
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
using namespace MIDI; using namespace MIDI;
using namespace ARDOUR;
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
pthread_t AsyncMIDIPort::_process_thread; pthread_t AsyncMIDIPort::_process_thread;
#define port_engine AudioEngine::instance()->port_engine() #define port_engine AudioEngine::instance()->port_engine()
@ -119,7 +120,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
* buffer * buffer
*/ */
if (ARDOUR::Port::sends_output()) { if (Port::sends_output()) {
flush_output_fifo (nframes); flush_output_fifo (nframes);
if (_flush_at_cycle_start) { if (_flush_at_cycle_start) {
flush_buffers (nframes); flush_buffers (nframes);
@ -130,7 +131,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
and if necessary wakeup the reader and if necessary wakeup the reader
*/ */
if (ARDOUR::Port::receives_input()) { if (Port::receives_input()) {
void* buffer = port_engine.get_buffer (_port_handle, nframes); void* buffer = port_engine.get_buffer (_port_handle, nframes);
const pframes_t event_count = port_engine.get_midi_event_count (buffer); const pframes_t event_count = port_engine.get_midi_event_count (buffer);
@ -169,7 +170,7 @@ AsyncMIDIPort::cycle_start (MIDI::pframes_t nframes)
void void
AsyncMIDIPort::cycle_end (MIDI::pframes_t nframes) 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 /* move any additional data from output FIFO into the port
buffer. buffer.
*/ */
@ -219,7 +220,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
{ {
int ret = 0; int ret = 0;
if (!ARDOUR::Port::sends_output()) { if (!Port::sends_output()) {
return ret; return ret;
} }
@ -304,7 +305,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
_last_write_timestamp = timestamp; _last_write_timestamp = timestamp;
} else { } 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); PBD::stacktrace (cerr, 20);
ret = 0; ret = 0;
} }
@ -321,7 +322,7 @@ AsyncMIDIPort::write (const MIDI::byte * msg, size_t msglen, MIDI::timestamp_t t
int int
AsyncMIDIPort::read (MIDI::byte *, size_t) AsyncMIDIPort::read (MIDI::byte *, size_t)
{ {
if (!ARDOUR::Port::receives_input()) { if (!Port::receives_input()) {
return 0; return 0;
} }
@ -360,3 +361,5 @@ AsyncMIDIPort::is_process_thread()
{ {
return pthread_equal (pthread_self(), _process_thread); return pthread_equal (pthread_self(), _process_thread);
} }
} // namespace ARDOUR

View file

@ -27,7 +27,8 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
AudioBuffer::AudioBuffer(size_t capacity) AudioBuffer::AudioBuffer(size_t capacity)
: Buffer (DataType::AUDIO) : Buffer (DataType::AUDIO)
@ -94,3 +95,5 @@ AudioBuffer::silence (samplecnt_t len, samplecnt_t offset) {
} }
_written = true; _written = true;
} }
} // namespace ARDOUR

View file

@ -47,7 +47,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
namespace { namespace {
const char* const sfdb_file_name = "sfdb"; const char* const sfdb_file_name = "sfdb";
@ -180,3 +181,5 @@ AudioLibrary::search_members_and (vector<string>& members, const vector<string>&
} }
#endif #endif
} }
} // namespace ARDOUR

View file

@ -34,10 +34,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AudioPlaylist::AudioPlaylist (Session& session, const XMLNode& node, bool hidden) AudioPlaylist::AudioPlaylist (Session& session, const XMLNode& node, bool hidden)
: Playlist (session, node, DataType::AUDIO, hidden) : Playlist (session, node, DataType::AUDIO, hidden)
{ {
@ -584,3 +585,5 @@ AudioPlaylist::load_legacy_crossfades (const XMLNode& node, int version)
} }
} }
} }
} // namespace ARDOUR

View file

@ -37,7 +37,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
/**** Handler ***/ /**** Handler ***/
AudioPlaylistImportHandler::AudioPlaylistImportHandler (XMLTree const & source, Session & session, AudioRegionImportHandler & region_handler, const char * nodename) : 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)"); return _("Audio Playlists (unused)");
} }
} // namespace ARDOUR

View file

@ -41,9 +41,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AudioPlaylistSource::AudioPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr<AudioPlaylist> p, AudioPlaylistSource::AudioPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr<AudioPlaylist> p,
uint32_t chn, sampleoffset_t begin, samplecnt_t len, Source::Flag flags) uint32_t chn, sampleoffset_t begin, samplecnt_t len, Source::Flag flags)
: Source (s, DataType::AUDIO, name) : Source (s, DataType::AUDIO, name)
@ -197,7 +198,7 @@ AudioPlaylistSource::sample_rate () const
int int
AudioPlaylistSource::setup_peakfile () 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()); return initialize_peakfile (string());
} }
@ -207,4 +208,4 @@ AudioPlaylistSource::construct_peak_filepath (const string& /*audio_path_*/, con
return _peak_path; return _peak_path;
} }
} // namespace ARDOUR

View file

@ -30,12 +30,13 @@
#include "ardour/port_engine.h" #include "ardour/port_engine.h"
#include "ardour/rc_configuration.h" #include "ardour/rc_configuration.h"
using namespace ARDOUR;
using namespace std; using namespace std;
#define ENGINE AudioEngine::instance() #define ENGINE AudioEngine::instance()
#define port_engine AudioEngine::instance()->port_engine() #define port_engine AudioEngine::instance()->port_engine()
namespace ARDOUR {
AudioPort::AudioPort (const std::string& name, PortFlags flags) AudioPort::AudioPort (const std::string& name, PortFlags flags)
: Port (name, DataType::AUDIO, flags) : Port (name, DataType::AUDIO, flags)
, _buffer (new AudioBuffer (0)) , _buffer (new AudioBuffer (0))
@ -154,3 +155,5 @@ AudioPort::engine_get_whole_audio_buffer ()
assert (_port_handle); assert (_port_handle);
return (Sample *) port_engine.get_buffer (_port_handle, ENGINE->samples_per_cycle()); return (Sample *) port_engine.get_buffer (_port_handle, ENGINE->samples_per_cycle());
} }
} // namespace ARDOUR

View file

@ -39,7 +39,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
/**** Handler ***/ /**** Handler ***/
AudioRegionImportHandler::AudioRegionImportHandler (XMLTree const & source, Session & session) : AudioRegionImportHandler::AudioRegionImportHandler (XMLTree const & source, Session & session) :
@ -396,3 +397,5 @@ AudioRegionImporter::get_xml ()
return xml_region; return xml_region;
} }
} // namespace ARDOUR

View file

@ -55,9 +55,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AudioTrack::AudioTrack (Session& sess, string name, TrackMode mode) AudioTrack::AudioTrack (Session& sess, string name, TrackMode mode)
: Track (sess, name, PresentationInfo::AudioTrack, mode) : Track (sess, name, PresentationInfo::AudioTrack, mode)
{ {
@ -463,3 +464,5 @@ AudioTrack::write_source (uint32_t n)
assert (_disk_writer); assert (_disk_writer);
return _disk_writer->audio_write_source (n); return _disk_writer->audio_write_source (n);
} }
} // namespace ARDOUR

View file

@ -37,7 +37,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
/*** AudioTrackImportHandler ***/ /*** AudioTrackImportHandler ***/
@ -406,3 +407,5 @@ AudioTrackImporter::rate_convert_events (XMLNode & node)
return true; return true;
} }
} // namespace ARDOUR

View file

@ -79,7 +79,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
AUPluginInfo::CachedInfoMap AUPluginInfo::cached_info; AUPluginInfo::CachedInfoMap AUPluginInfo::cached_info;
@ -3510,3 +3511,5 @@ AUPlugin::parameter_change_listener (void* /*arg*/, void* src, const AudioUnitEv
break; break;
} }
} }
} // namespace ARDOUR

View file

@ -40,7 +40,8 @@
using namespace std; using namespace std;
using namespace Vamp; using namespace Vamp;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
AudioAnalyser::AudioAnalyser (float sr, AnalysisPluginKey key) AudioAnalyser::AudioAnalyser (float sr, AnalysisPluginKey key)
: sample_rate (sr) : sample_rate (sr)
@ -167,3 +168,4 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
return ret; return ret;
} }
} // namespace ARDOUR

View file

@ -67,9 +67,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AudioEngine* AudioEngine::_instance = 0; AudioEngine* AudioEngine::_instance = 0;
static GATOMIC_QUAL gint audioengine_thread_cnt = 1; static GATOMIC_QUAL gint audioengine_thread_cnt = 1;
@ -1697,3 +1698,5 @@ AudioEngine::add_pending_port_deletion (Port* p)
delete p; delete p;
} }
} }
} // namespace ARDOUR

View file

@ -67,10 +67,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
namespace ARDOUR {
PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged; PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged;
samplecnt_t AudioFileSource::header_position_offset = 0; samplecnt_t AudioFileSource::header_position_offset = 0;
@ -374,3 +375,4 @@ AudioFileSource::get_interleave_buffer (samplecnt_t size)
return ssb->buf; return ssb->buf;
} }
} // namespace ARDOUR

View file

@ -60,23 +60,22 @@
#include <locale.h> #include <locale.h>
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR { namespace ARDOUR {
namespace Properties {
PBD::PropertyDescriptor<bool> envelope_active; namespace Properties {
PBD::PropertyDescriptor<bool> default_fade_in; PBD::PropertyDescriptor<bool> envelope_active;
PBD::PropertyDescriptor<bool> default_fade_out; PBD::PropertyDescriptor<bool> default_fade_in;
PBD::PropertyDescriptor<bool> fade_in_active; PBD::PropertyDescriptor<bool> default_fade_out;
PBD::PropertyDescriptor<bool> fade_out_active; PBD::PropertyDescriptor<bool> fade_in_active;
PBD::PropertyDescriptor<float> scale_amplitude; PBD::PropertyDescriptor<bool> fade_out_active;
PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > fade_in; PBD::PropertyDescriptor<float> scale_amplitude;
PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > inverse_fade_in; PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > fade_in;
PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > fade_out; PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > inverse_fade_in;
PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > inverse_fade_out; PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > fade_out;
PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > envelope; PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > inverse_fade_out;
} PBD::PropertyDescriptor<boost::shared_ptr<AutomationList> > envelope;
} }
/* Curve manipulations */ /* Curve manipulations */
@ -1991,3 +1990,4 @@ AudioRegion::verify_xfade_bounds (samplecnt_t len, bool start)
} }
} // namespace ARDOUR

View file

@ -22,7 +22,7 @@
#include "ardour/audiorom.h" #include "ardour/audiorom.h"
#include "ardour/runtime_functions.h" #include "ardour/runtime_functions.h"
using namespace ARDOUR; namespace ARDOUR {
AudioRom::AudioRom (Sample* rom, size_t size) AudioRom::AudioRom (Sample* rom, size_t size)
: _size (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); copy_vector (dst, &_rom[pos], to_copy);
return to_copy; return to_copy;
} }
} // namespace ARDOUR

View file

@ -69,9 +69,10 @@
#include "ardour/debug.h" #include "ardour/debug.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
bool AudioSource::_build_missing_peakfiles = false; bool AudioSource::_build_missing_peakfiles = false;
/** true if we want peakfiles (e.g. if we are displaying a GUI) */ /** 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 */ PeaksReady (); /* EMIT SIGNAL */
} }
} }
} // namespace ARDOUR

View file

@ -43,11 +43,12 @@
#include "ardour/session.h" #include "ardour/session.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
#include "pbd/i18n.h" #include "pbd/i18n.h"
namespace ARDOUR {
Auditioner::Auditioner (Session& s) Auditioner::Auditioner (Session& s)
: Track (s, "auditioner", PresentationInfo::Auditioner) : Track (s, "auditioner", PresentationInfo::Auditioner)
, current_sample (0) , current_sample (0)
@ -608,3 +609,4 @@ Auditioner::monitoring_state () const
return MonitoringDisk; return MonitoringDisk;
} }
} // namespace ARDOUR

View file

@ -47,9 +47,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
/* used for templates (previously: !full_state) */ /* used for templates (previously: !full_state) */
bool Automatable::skip_saving_automation = false; bool Automatable::skip_saving_automation = false;
@ -716,3 +717,5 @@ Automatable::find_prev_ac_event (boost::shared_ptr<AutomationControl> c, double
++i; ++i;
} }
} }
} // namespace ARDOUR

View file

@ -44,9 +44,10 @@
#endif #endif
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AutomationControl::AutomationControl(ARDOUR::Session& session, AutomationControl::AutomationControl(ARDOUR::Session& session,
const Evoral::Parameter& parameter, const Evoral::Parameter& parameter,
const ParameterDescriptor& desc, const ParameterDescriptor& desc,
@ -386,3 +387,5 @@ AutomationControl::check_rt (double val, Controllable::GroupControlDisposition g
return false; return false;
} }
} // namespace ARDOUR

View file

@ -45,9 +45,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
PBD::Signal1<void,AutomationList *> AutomationList::AutomationListCreated; PBD::Signal1<void,AutomationList *> AutomationList::AutomationListCreated;
#if 0 #if 0
@ -583,3 +584,5 @@ AutomationListProperty::clone () const
boost::shared_ptr<AutomationList> (new AutomationList (*this->_current.get())) boost::shared_ptr<AutomationList> (new AutomationList (*this->_current.get()))
); );
} }
} // namespace ARDOUR

View file

@ -32,9 +32,10 @@
#include "ardour/debug.h" #include "ardour/debug.h"
#include "ardour/session.h" #include "ardour/session.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
AutomationWatch* AutomationWatch::_instance = 0; AutomationWatch* AutomationWatch::_instance = 0;
AutomationWatch& AutomationWatch&
@ -244,3 +245,5 @@ AutomationWatch::transport_state_change ()
} }
} }
} }
} // namespace ARDOUR

View file

@ -25,9 +25,10 @@
#include "ardour/buffer_manager.h" #include "ardour/buffer_manager.h"
#include "ardour/thread_buffers.h" #include "ardour/thread_buffers.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0; RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0;
std::list<ThreadBuffers*>* BufferManager::thread_buffers_list = 0; std::list<ThreadBuffers*>* BufferManager::thread_buffers_list = 0;
Glib::Threads::Mutex BufferManager::rb_mutex; Glib::Threads::Mutex BufferManager::rb_mutex;
@ -84,3 +85,5 @@ BufferManager::ensure_buffers (ChanCount howmany, size_t custom)
(*i)->ensure_buffers (howmany, custom); (*i)->ensure_buffers (howmany, custom);
} }
} }
} // namespace ARDOUR

View file

@ -29,9 +29,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
/** Construct an audio bundle. /** Construct an audio bundle.
* @param i true if ports are inputs, otherwise false. * @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; return s;
} }
}

View file

@ -23,10 +23,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
CAImportableSource::CAImportableSource (const string& path) CAImportableSource::CAImportableSource (const string& path)
{ {
try { try {
@ -142,3 +143,5 @@ CAImportableSource::natural_position () const
// TODO: extract timecode, if any // TODO: extract timecode, if any
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -64,10 +64,11 @@ ChanCount::state(const std::string& name) const
} }
// Statics // 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 } // namespace ARDOUR
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c) {
return o << "AUDIO=" << c.n_audio() << ":MIDI=" << c.n_midi();
}

View file

@ -257,16 +257,12 @@ ChanMapping::count () const
return rv; return rv;
} }
std::ostream& operator<<(std::ostream& o, const ChanMapping& cm)
} // namespace ARDOUR
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
{ {
const ARDOUR::ChanMapping::Mappings& mp (cm.mappings()); const ChanMapping::Mappings& mp (cm.mappings());
for (ARDOUR::ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) { for (ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
o << tm->first.to_string() << endl; 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) { i != tm->second.end(); ++i) {
o << "\t" << i->first << " => " << i->second << endl; o << "\t" << i->first << " => " << i->second << endl;
} }
@ -274,3 +270,5 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
return o; return o;
} }
} // namespace ARDOUR

View file

@ -19,7 +19,7 @@
#include "ardour/circular_buffer.h" #include "ardour/circular_buffer.h"
#include "ardour/runtime_functions.h" #include "ardour/runtime_functions.h"
using namespace ARDOUR; namespace ARDOUR {
CircularSampleBuffer::CircularSampleBuffer (samplecnt_t size) CircularSampleBuffer::CircularSampleBuffer (samplecnt_t size)
: _rb (size) : _rb (size)
@ -169,3 +169,5 @@ CircularEventBuffer::read (EventList& l)
} }
return true; return true;
} }
} // namespace ARDOUR

View file

@ -23,9 +23,10 @@
#include "ardour/control_group.h" #include "ardour/control_group.h"
#include "ardour/gain_control.h" #include "ardour/gain_control.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
ControlGroup::ControlGroup (Evoral::Parameter p) ControlGroup::ControlGroup (Evoral::Parameter p)
: _parameter (p) : _parameter (p)
, _active (true) , _active (true)
@ -323,3 +324,5 @@ GainControlGroup::set_group_value (boost::shared_ptr<AutomationControl> control,
} }
} }
} }
} // namespace ARDOUR

View file

@ -39,12 +39,13 @@
#include "ardour/selection.h" #include "ardour/selection.h"
#include "ardour/session.h" #include "ardour/session.h"
using namespace ARDOUR;
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
#include "pbd/i18n.h" #include "pbd/i18n.h"
namespace ARDOUR {
ControlProtocolManager* ControlProtocolManager::_instance = 0; ControlProtocolManager* ControlProtocolManager::_instance = 0;
const string ControlProtocolManager::state_node_name = X_("ControlProtocols"); const string ControlProtocolManager::state_node_name = X_("ControlProtocols");
PBD::Signal1<void,StripableNotificationListPtr> ControlProtocolManager::StripableSelectionChanged; PBD::Signal1<void,StripableNotificationListPtr> ControlProtocolManager::StripableSelectionChanged;
@ -617,3 +618,5 @@ ControlProtocolManager::stripable_selection_changed (StripableNotificationListPt
} }
} }
} }
} // namespace ARDOUR

View file

@ -35,10 +35,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace ARDOUR::DSP; using namespace ARDOUR::DSP;
using namespace ArdourZita; using namespace ArdourZita;
namespace ARDOUR {
Convolution::Convolution (Session& session, uint32_t n_in, uint32_t n_out) Convolution::Convolution (Session& session, uint32_t n_in, uint32_t n_out)
: SessionHandleRef (session) : SessionHandleRef (session)
, _n_samples (0) , _n_samples (0)
@ -440,3 +441,5 @@ Convolver::run_stereo_no_latency (float* left, float* right, uint32_t n_samples)
remain -= ns; remain -= ns;
} }
} }
} // namespace ARDOUR

View file

@ -41,9 +41,10 @@
#include <AudioToolbox/AudioFormat.h> #include <AudioToolbox/AudioFormat.h>
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
/** Create a new CoreAudioSource using session state, which implies that the /** Create a new CoreAudioSource using session state, which implies that the
* file must already exist. * file must already exist.
*/ */
@ -405,3 +406,5 @@ CoreAudioSource::set_path (const string& p)
{ {
FileSource::set_path (p); FileSource::set_path (p);
} }
} // namespace ARDOUR

View file

@ -24,7 +24,7 @@
#pragma warning(disable:4305) #pragma warning(disable:4305)
#endif #endif
using namespace ARDOUR; namespace ARDOUR {
const Sample Session::default_click_emphasis[] = { 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]); const samplecnt_t Session::default_click_length = sizeof (default_click) / sizeof (default_click[0]);
} // namespace ARDOUR

View file

@ -32,7 +32,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
DelayLine::DelayLine (Session& s, const std::string& name) DelayLine::DelayLine (Session& s, const std::string& name)
: Processor (s, string_compose ("latcomp-%1-%2", name, this)) : 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); copy_vector (&dst[s0], rb, s1);
} }
} }
} // namespace ARDOUR

View file

@ -44,11 +44,12 @@ namespace PBD {
DEFINE_ENUM_CONVERT(ARDOUR::Delivery::Role); DEFINE_ENUM_CONVERT(ARDOUR::Delivery::Role);
} }
namespace ARDOUR { class Panner; }
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
class Panner;
PBD::Signal0<void> Delivery::PannersLegal; PBD::Signal0<void> Delivery::PannersLegal;
bool Delivery::panners_legal = false; bool Delivery::panners_legal = false;
@ -628,3 +629,4 @@ Delivery::panner () const
} }
} }
} // namespace ARDOUR

View file

@ -39,10 +39,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
namespace ARDOUR {
const string DiskIOProcessor::state_node_name = X_("DiskIOProcessor"); const string DiskIOProcessor::state_node_name = X_("DiskIOProcessor");
// PBD::Signal0<void> DiskIOProcessor::DiskOverrun; // PBD::Signal0<void> DiskIOProcessor::DiskOverrun;
@ -362,3 +363,4 @@ DiskIOProcessor::get_location_times(const Location* location,
} }
} }
} // namespace ARDOUR

View file

@ -43,11 +43,12 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
ARDOUR::samplecnt_t DiskReader::_chunk_samples = default_chunk_samples (); namespace ARDOUR {
samplecnt_t DiskReader::_chunk_samples = default_chunk_samples ();
PBD::Signal0<void> DiskReader::Underrun; PBD::Signal0<void> DiskReader::Underrun;
Sample* DiskReader::_sum_buffer = 0; Sample* DiskReader::_sum_buffer = 0;
Sample* DiskReader::_mixdown_buffer = 0; Sample* DiskReader::_mixdown_buffer = 0;
@ -1961,3 +1962,5 @@ DiskReader::setup_preloop_buffer ()
} }
} }
} }
} // namespace ARDOUR

View file

@ -39,10 +39,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
namespace ARDOUR {
ARDOUR::samplecnt_t DiskWriter::_chunk_samples = DiskWriter::default_chunk_samples (); ARDOUR::samplecnt_t DiskWriter::_chunk_samples = DiskWriter::default_chunk_samples ();
PBD::Signal0<void> DiskWriter::Overrun; PBD::Signal0<void> DiskWriter::Overrun;
@ -1395,3 +1396,5 @@ DiskWriter::use_playlist (DataType dt, boost::shared_ptr<Playlist> playlist)
} }
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -38,24 +38,25 @@
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
using namespace ARDOUR::DSP; namespace ARDOUR {
namespace DSP {
void 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) { for (uint32_t i = 0; i < n_samples; ++i) {
data[i] = val; data[i] = val;
} }
} }
void 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) { for (uint32_t i = 0; i < n_samples; ++i) {
data[i] *= mult[i]; data[i] *= mult[i];
} }
} }
float float
ARDOUR::DSP::log_meter (float power) { log_meter (float power) {
// compare to libs/ardour/log_meter.h // compare to libs/ardour/log_meter.h
static const float lower_db = -192.f; static const float lower_db = -192.f;
static const float upper_db = 0.f; static const float upper_db = 0.f;
@ -64,18 +65,18 @@ ARDOUR::DSP::log_meter (float power) {
} }
float float
ARDOUR::DSP::log_meter_coeff (float coeff) { log_meter_coeff (float coeff) {
if (coeff <= 0) return 0; if (coeff <= 0) return 0;
return log_meter (fast_coefficient_to_dB (coeff)); return log_meter (fast_coefficient_to_dB (coeff));
} }
void 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); ARDOUR::find_peaks (data, n_samples, &min, &max);
} }
void 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 /* PluginInsert already handles most, in particular `no-inplace` buffers in case
* or x-over connections, and through connections. * or x-over connections, and through connections.
@ -509,3 +510,6 @@ Generator::grandf ()
_rn = r * x2; _rn = r * x2;
return r * x1; return r * x1;
} }
} // namespace DSP
} // namespace ARDOUR

View file

@ -25,9 +25,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace Vamp; using namespace Vamp;
using namespace ARDOUR;
using namespace std; using namespace std;
namespace ARDOUR {
/* need a static initializer function for this */ /* need a static initializer function for this */
EBUr128Analysis::EBUr128Analysis (float sr) EBUr128Analysis::EBUr128Analysis (float sr)
@ -112,3 +113,5 @@ EBUr128Analysis::use_features (Plugin::FeatureSet& features, ostream* out)
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -22,7 +22,8 @@
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
bool ElementImportHandler::_dirty = false; bool ElementImportHandler::_dirty = false;
bool ElementImportHandler::_errors = false; bool ElementImportHandler::_errors = false;
@ -50,3 +51,5 @@ ElementImportHandler::remove_name (const string & name)
{ {
names.erase (name); names.erase (name);
} }
} // namespace ARDOUR

View file

@ -32,7 +32,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
Signal2<std::pair<bool, string>,string, string> ElementImporter::Rename; Signal2<std::pair<bool, string>,string, string> ElementImporter::Rename;
Signal1 <bool,string> ElementImporter::Prompt; Signal1 <bool,string> ElementImporter::Prompt;
@ -107,3 +108,5 @@ ElementImporter::rate_convert_samples (string const & samples) const
{ {
return to_string (rate_convert_samples (string_to<uint32_t>(samples))); return to_string (rate_convert_samples (string_to<uint32_t>(samples)));
} }
} // namespace ARDOUR

View file

@ -28,7 +28,8 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
Engine_TransportMaster::Engine_TransportMaster (AudioEngine& e) Engine_TransportMaster::Engine_TransportMaster (AudioEngine& e)
: TransportMaster (Engine, X_("JACK")) : TransportMaster (Engine, X_("JACK"))
@ -146,3 +147,4 @@ Engine_TransportMaster::update_interval () const
return AudioEngine::instance()->samples_per_cycle(); return AudioEngine::instance()->samples_per_cycle();
} }
} // namespace ARDOUR

View file

@ -53,7 +53,6 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
using namespace MIDI; using namespace MIDI;
using namespace Timecode; using namespace Timecode;

View file

@ -34,7 +34,7 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR; namespace ARDOUR {
PortExportChannel::PortExportChannel () PortExportChannel::PortExportChannel ()
: _buffer_size (0) : _buffer_size (0)
@ -327,3 +327,5 @@ RouteExportChannel::ProcessorRemover::~ProcessorRemover()
{ {
route->remove_processor (processor); route->remove_processor (processor);
} }
} // namespace ARDOUR

View file

@ -24,10 +24,13 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
ExportFailed::ExportFailed (string const & reason) ExportFailed::ExportFailed (string const & reason)
: reason (reason.c_str()) : reason (reason.c_str())
{ {
PBD::error << string_compose (_("Export failed: %1"), reason) << endmsg; PBD::error << string_compose (_("Export failed: %1"), reason) << endmsg;
} }
} // namespace ARDOUR

View file

@ -24,7 +24,8 @@
#include "ardour/session.h" #include "ardour/session.h"
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
ExportPreset::ExportPreset (string filename, Session & s) : ExportPreset::ExportPreset (string filename, Session & s) :
session (s), global (filename), local (0) 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()); instant_xml->remove_nodes_and_delete ("id", _id.to_s());
} }
} }
} // namespace ARDOUR

View file

@ -52,10 +52,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
namespace ARDOUR {
PBD::Signal2<int,std::string,std::vector<std::string> > FileSource::AmbiguousFileName; PBD::Signal2<int,std::string,std::vector<std::string> > FileSource::AmbiguousFileName;
FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag) 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; return 0;
} }
} // namespace ARDOUR

View file

@ -36,9 +36,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
int int
Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, std::string suffix, bool use_session_sample_rate) Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, std::string suffix, bool use_session_sample_rate)
{ {
@ -161,4 +162,4 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -21,7 +21,7 @@
#include "ardour/fixed_delay.h" #include "ardour/fixed_delay.h"
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
using namespace ARDOUR; namespace ARDOUR {
FixedDelay::FixedDelay () FixedDelay::FixedDelay ()
: _max_delay (0) : _max_delay (0)
@ -153,3 +153,5 @@ FixedDelay::delay (
db->pos = (db->pos + n_samples) % _buf_size; db->pos = (db->pos + n_samples) % _buf_size;
} }
} // namespace ARDOUR

View file

@ -19,7 +19,7 @@
#include "pbd/failed_constructor.h" #include "pbd/failed_constructor.h"
#include "ardour/fluid_synth.h" #include "ardour/fluid_synth.h"
using namespace ARDOUR; namespace ARDOUR {
FluidSynth::FluidSynth (float samplerate, int polyphony) FluidSynth::FluidSynth (float samplerate, int polyphony)
: _settings (0) : _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); return FLUID_OK == fluid_synth_handle_midi_event (_synth, _f_midi_event);
} }
} // namespace ARDOUR

View file

@ -32,9 +32,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace std; using namespace std;
namespace ARDOUR {
static std::string gain_control_name (Evoral::Parameter const& param) static std::string gain_control_name (Evoral::Parameter const& param)
{ {
switch (param.type()) { 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); return SlavableAutomationControl::masters_curve_multiply (start, end, vec, veclen);
} }
} // namespace ARDOUR

View file

@ -138,42 +138,41 @@
#include "pbd/i18n.h" #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 std;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
RCConfiguration* Config = 0;
RuntimeProfile* Profile = 0;
AudioLibrary* Library = 0;
bool libardour_initialized = false; bool libardour_initialized = false;
compute_peak_t ARDOUR::compute_peak = 0; compute_peak_t compute_peak = 0;
find_peaks_t ARDOUR::find_peaks = 0; find_peaks_t find_peaks = 0;
apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0; apply_gain_to_buffer_t apply_gain_to_buffer = 0;
mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0; mix_buffers_with_gain_t mix_buffers_with_gain = 0;
mix_buffers_no_gain_t ARDOUR::mix_buffers_no_gain = 0; mix_buffers_no_gain_t mix_buffers_no_gain = 0;
copy_vector_t ARDOUR::copy_vector = 0; copy_vector_t copy_vector = 0;
PBD::Signal1<void, std::string> ARDOUR::BootMessage; PBD::Signal1<void, std::string> BootMessage;
PBD::Signal3<void, std::string, std::string, bool> ARDOUR::PluginScanMessage; PBD::Signal3<void, std::string, std::string, bool> PluginScanMessage;
PBD::Signal1<void, int> ARDOUR::PluginScanTimeout; PBD::Signal1<void, int> PluginScanTimeout;
PBD::Signal0<void> ARDOUR::GUIIdle; PBD::Signal0<void> GUIIdle;
PBD::Signal3<bool, std::string, std::string, int> ARDOUR::CopyConfigurationFiles; PBD::Signal3<bool, std::string, std::string, int> CopyConfigurationFiles;
std::map<std::string, bool> ARDOUR::reserved_io_names; std::map<std::string, bool> reserved_io_names;
static bool have_old_configuration_files = false; static bool have_old_configuration_files = false;
static bool running_from_gui = false; static bool running_from_gui = false;
namespace ARDOUR {
extern void setup_enum_writer (); extern void setup_enum_writer ();
}
/* this is useful for quite a few things that want to check /* this is useful for quite a few things that want to check
if any bounds-related property has changed if any bounds-related property has changed
*/ */
PBD::PropertyChange ARDOUR::bounds_change; PBD::PropertyChange bounds_change;
static PBD::ScopedConnection engine_startup_connection; static PBD::ScopedConnection engine_startup_connection;
@ -424,7 +423,7 @@ copy_configuration_files (string const& old_dir, string const& new_dir, int old_
} }
void void
ARDOUR::check_for_old_configuration_files () check_for_old_configuration_files ()
{ {
int current_version = atoi (X_(PROGRAM_VERSION)); int current_version = atoi (X_(PROGRAM_VERSION));
@ -446,7 +445,7 @@ ARDOUR::check_for_old_configuration_files ()
} }
int int
ARDOUR::handle_old_configuration_files (boost::function<bool(std::string const&, std::string const&, int)> ui_handler) handle_old_configuration_files (boost::function<bool(std::string const&, std::string const&, int)> ui_handler)
{ {
if (have_old_configuration_files) { if (have_old_configuration_files) {
int current_version = atoi (X_(PROGRAM_VERSION)); int current_version = atoi (X_(PROGRAM_VERSION));
@ -464,7 +463,7 @@ ARDOUR::handle_old_configuration_files (boost::function<bool(std::string const&,
} }
bool bool
ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir, bool with_gui) init (bool use_windows_vst, bool try_optimization, const char* localedir, bool with_gui)
{ {
if (libardour_initialized) { if (libardour_initialized) {
return true; return true;
@ -510,9 +509,9 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
property changes. property changes.
*/ */
bounds_change.add (ARDOUR::Properties::start); bounds_change.add (Properties::start);
bounds_change.add (ARDOUR::Properties::position); bounds_change.add (Properties::position);
bounds_change.add (ARDOUR::Properties::length); bounds_change.add (Properties::length);
/* provide a state version for the few cases that need it and are not /* provide a state version for the few cases that need it and are not
driven by reading state from disk (e.g. undo/redo) driven by reading state from disk (e.g. undo/redo)
@ -520,7 +519,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
Stateful::current_state_version = CURRENT_SESSION_FILE_VERSION; Stateful::current_state_version = CURRENT_SESSION_FILE_VERSION;
ARDOUR::setup_enum_writer (); setup_enum_writer ();
// allow ardour the absolute maximum number of open files // allow ardour the absolute maximum number of open files
lotsa_files_please (); lotsa_files_please ();
@ -595,7 +594,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
PannerManager::instance ().discover_panners (); PannerManager::instance ().discover_panners ();
ARDOUR::AudioEngine::create (); AudioEngine::create ();
TransportMasterManager::create (); TransportMasterManager::create ();
/* it is unfortunate that we need to include reserved names here that /* it is unfortunate that we need to include reserved names here that
@ -636,7 +635,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
} }
void void
ARDOUR::init_post_engine (uint32_t start_cnt) init_post_engine (uint32_t start_cnt)
{ {
XMLNode* node; XMLNode* node;
@ -648,7 +647,7 @@ ARDOUR::init_post_engine (uint32_t start_cnt)
* started, with whatever options they want. * started, with whatever options they want.
*/ */
ARDOUR::PluginManager::instance ().refresh (true); PluginManager::instance ().refresh (true);
} }
if ((node = Config->control_protocol_state ()) != 0) { if ((node = Config->control_protocol_state ()) != 0) {
@ -660,7 +659,7 @@ ARDOUR::init_post_engine (uint32_t start_cnt)
} }
void void
ARDOUR::cleanup () cleanup ()
{ {
if (!libardour_initialized) { if (!libardour_initialized) {
return; return;
@ -669,8 +668,8 @@ ARDOUR::cleanup ()
engine_startup_connection.disconnect (); engine_startup_connection.disconnect ();
delete &ControlProtocolManager::instance (); delete &ControlProtocolManager::instance ();
ARDOUR::AudioEngine::destroy (); AudioEngine::destroy ();
ARDOUR::TransportMasterManager::destroy (); TransportMasterManager::destroy ();
delete Library; delete Library;
#ifdef HAVE_LRDF #ifdef HAVE_LRDF
@ -691,13 +690,13 @@ ARDOUR::cleanup ()
} }
bool bool
ARDOUR::no_auto_connect () no_auto_connect ()
{ {
return getenv ("ARDOUR_NO_AUTOCONNECT") != 0; return getenv ("ARDOUR_NO_AUTOCONNECT") != 0;
} }
void void
ARDOUR::setup_fpu () setup_fpu ()
{ {
FPU* fpu = FPU::instance (); FPU* fpu = FPU::instance ();
@ -788,15 +787,15 @@ ARDOUR::setup_fpu ()
static const bool translate_by_default = true; static const bool translate_by_default = true;
string string
ARDOUR::translation_enable_path () translation_enable_path ()
{ {
return Glib::build_filename (user_config_directory (), ".translate"); return Glib::build_filename (user_config_directory (), ".translate");
} }
bool 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) { if (fd < 0) {
return translate_by_default; return translate_by_default;
@ -815,9 +814,9 @@ ARDOUR::translations_are_enabled ()
} }
bool 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); int fd = g_open (i18n_enabler.c_str (), O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd < 0) { if (fd < 0) {
@ -840,7 +839,7 @@ ARDOUR::set_translations_enabled (bool yn)
} }
vector<SyncSource> vector<SyncSource>
ARDOUR::get_available_sync_options () get_available_sync_options ()
{ {
vector<SyncSource> ret; vector<SyncSource> ret;
@ -886,7 +885,7 @@ clock_gettime (int /*clk_id*/, struct timespec* t)
#endif #endif
microseconds_t microseconds_t
ARDOUR::get_microseconds () get_microseconds ()
{ {
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
microseconds_t ret = 0; microseconds_t ret = 0;
@ -915,14 +914,16 @@ ARDOUR::get_microseconds ()
*/ */
int int
ARDOUR::format_data_width (ARDOUR::SampleFormat format) format_data_width (SampleFormat format)
{ {
switch (format) { switch (format) {
case ARDOUR::FormatInt16: case FormatInt16:
return 16; return 16;
case ARDOUR::FormatInt24: case FormatInt24:
return 24; return 24;
default: default:
return 32; return 32;
} }
} }
} // namespace ARDOUR

View file

@ -37,10 +37,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
namespace ARDOUR {
#ifdef DEBUG_RT_ALLOC #ifdef DEBUG_RT_ALLOC
static Graph* graph = 0; static Graph* graph = 0;
@ -78,9 +79,9 @@ Graph::Graph (Session& session)
/* pre-allocate memory */ /* pre-allocate memory */
_trigger_queue.reserve (1024); _trigger_queue.reserve (1024);
ARDOUR::AudioEngine::instance ()->Running.connect_same_thread (engine_connections, boost::bind (&Graph::reset_thread_list, this)); 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)); 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 ()->Halted.connect_same_thread (engine_connections, boost::bind (&Graph::engine_stopped, this));
reset_thread_list (); reset_thread_list ();
@ -450,7 +451,7 @@ Graph::helper_thread ()
g_atomic_int_inc (&_n_workers); g_atomic_int_inc (&_n_workers);
guint id = g_atomic_uint_get (&_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 */ * in particular Lua scripts may do cross-thread calls */
if (!SessionEvent::has_per_thread_pool ()) { if (!SessionEvent::has_per_thread_pool ()) {
char name[64]; char name[64];
@ -483,7 +484,7 @@ Graph::main_thread ()
suspend_rt_malloc_checks (); suspend_rt_malloc_checks ();
ProcessThread* pt = new ProcessThread (); 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 */ * in particular Lua scripts may do cross-thread calls */
if (!SessionEvent::has_per_thread_pool ()) { if (!SessionEvent::has_per_thread_pool ()) {
char name[64]; char name[64];
@ -686,3 +687,5 @@ Graph::in_process_thread () const
{ {
return AudioEngine::instance ()->in_process_thread (); return AudioEngine::instance ()->in_process_thread ();
} }
} // namespace ARDOUR

View file

@ -22,7 +22,7 @@
#include "ardour/graphnode.h" #include "ardour/graphnode.h"
#include "ardour/route.h" #include "ardour/route.h"
using namespace ARDOUR; namespace ARDOUR {
GraphNode::GraphNode (boost::shared_ptr<Graph> graph) GraphNode::GraphNode (boost::shared_ptr<Graph> graph)
: _graph (graph) : _graph (graph)
@ -80,3 +80,5 @@ GraphNode::process ()
{ {
_graph->process_one_route (dynamic_cast<Route*> (this)); _graph->process_one_route (dynamic_cast<Route*> (this));
} }
} // namespace ARDOUR

View file

@ -74,9 +74,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
static boost::shared_ptr<ImportableSource> static boost::shared_ptr<ImportableSource>
open_importable_source (const string& path, samplecnt_t samplerate, ARDOUR::SrcQuality quality) open_importable_source (const string& path, samplecnt_t samplerate, ARDOUR::SrcQuality quality)
{ {
@ -653,3 +654,5 @@ Session::import_files (ImportStatus& status)
status.done = true; status.done = true;
} }
} // namespace ARDOUR

View file

@ -51,11 +51,12 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
using std::string; using std::string;
namespace ARDOUR {
/* Functions supporting the incorporation of PT sessions into ardour */ /* Functions supporting the incorporation of PT sessions into ardour */
struct midipair { struct midipair {
@ -456,3 +457,5 @@ Session::import_pt_rest (PTFFormat& ptf)
playlist->add_region (copy, f); playlist->add_region (copy, f);
} }
} }
} // namespace ARDOUR

View file

@ -33,10 +33,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace MIDI::Name; using namespace MIDI::Name;
using std::string; using std::string;
namespace ARDOUR {
InstrumentInfo::InstrumentInfo () InstrumentInfo::InstrumentInfo ()
: _external_instrument_model (_("Unknown")) : _external_instrument_model (_("Unknown"))
{ {
@ -312,3 +313,5 @@ InstrumentInfo::get_patches (uint8_t channel)
{ {
return MidiPatchManager::instance ().find_channel_name_set (model (), mode (), channel); return MidiPatchManager::instance ().find_channel_name_set (model (), mode (), channel);
} }
} // namespace ARDOUR

View file

@ -26,7 +26,8 @@
#include "ardour/route.h" #include "ardour/route.h"
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
InternalReturn::InternalReturn (Session& s, std::string const& name) InternalReturn::InternalReturn (Session& s, std::string const& name)
: Processor (s, name) : Processor (s, name)
@ -102,3 +103,5 @@ InternalReturn::configure_io (ChanCount in, ChanCount out)
Processor::configure_io (in, out); Processor::configure_io (in, out);
return true; return true;
} }
} // namespace ARDOUR

View file

@ -38,15 +38,14 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
namespace ARDOUR {
class MuteMaster;
class Pannable;
}
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
using namespace std; using namespace std;
namespace ARDOUR {
class MuteMaster;
class Pannable;
PBD::Signal1<void, pframes_t> InternalSend::CycleStart; PBD::Signal1<void, pframes_t> InternalSend::CycleStart;
InternalSend::InternalSend (Session& s, InternalSend::InternalSend (Session& s,
@ -532,3 +531,5 @@ InternalSend::cycle_start (pframes_t /*nframes*/)
b->prepare (); b->prepare ();
} }
} }
} // namespace ARDOUR

View file

@ -28,10 +28,11 @@
#include "ardour/interpolation.h" #include "ardour/interpolation.h"
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
using namespace ARDOUR;
using std::cerr; using std::cerr;
using std::endl; using std::endl;
namespace ARDOUR {
CubicInterpolation::CubicInterpolation () CubicInterpolation::CubicInterpolation ()
: valid_z_bits (0) : valid_z_bits (0)
{ {
@ -228,3 +229,5 @@ CubicInterpolation::distance (samplecnt_t nsamples)
assert (phase.size () > 0); assert (phase.size () > 0);
return floor (floor (phase[0]) + (_speed * nsamples)); return floor (floor (phase[0]) + (_speed * nsamples));
} }
} // namespace ARDOUR

View file

@ -59,9 +59,10 @@
#define BLOCK_PROCESS_CALLBACK() Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock()) #define BLOCK_PROCESS_CALLBACK() Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock())
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
const string IO::state_node_name = "IO"; const string IO::state_node_name = "IO";
bool IO::connecting_legal = false; bool IO::connecting_legal = false;
PBD::Signal0<int> IO::ConnectingLegal; PBD::Signal0<int> IO::ConnectingLegal;
@ -1791,3 +1792,5 @@ IO::has_port (boost::shared_ptr<Port> p) const
Glib::Threads::Mutex::Lock lm (io_lock); Glib::Threads::Mutex::Lock lm (io_lock);
return _ports.contains (p); return _ports.contains (p);
} }
} // namespace ARDOUR

View file

@ -38,10 +38,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR { class Session; } namespace ARDOUR {
class Session;
/* create an IOProcessor that proxies to a new IO object */ /* 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

View file

@ -61,9 +61,10 @@
#include <locale.h> #include <locale.h>
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
LadspaPlugin::LadspaPlugin (string module_path, AudioEngine& e, Session& session, uint32_t index, samplecnt_t rate) LadspaPlugin::LadspaPlugin (string module_path, AudioEngine& e, Session& session, uint32_t index, samplecnt_t rate)
: Plugin (e, session) : Plugin (e, session)
{ {
@ -959,5 +960,4 @@ LadspaPlugin::port_descriptor (uint32_t i) const
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -20,9 +20,9 @@
#include "ardour/latent.h" #include "ardour/latent.h"
using namespace ARDOUR; namespace ARDOUR {
bool ARDOUR::Latent::_zero_latency = false; bool Latent::_zero_latency = false;
PBD::Signal0<void> Latent::DisableSwitchChanged; PBD::Signal0<void> Latent::DisableSwitchChanged;
Latent::Latent () Latent::Latent ()
@ -54,3 +54,5 @@ Latent::add_state (XMLNode* node) const
node->set_property ("user-latency", _user_latency); node->set_property ("user-latency", _user_latency);
node->set_property ("use-user-latency", _use_user_latency); node->set_property ("use-user-latency", _use_user_latency);
} }
} // namespace ARDOUR

View file

@ -51,9 +51,10 @@ namespace PBD {
} }
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
PBD::Signal0<void> Location::scene_changed; PBD::Signal0<void> Location::scene_changed;
PBD::Signal1<void,Location*> Location::name_changed; PBD::Signal1<void,Location*> Location::name_changed;
PBD::Signal1<void,Location*> Location::end_changed; PBD::Signal1<void,Location*> Location::end_changed;
@ -1612,3 +1613,5 @@ Locations::range_starts_at(samplepos_t pos, samplecnt_t slop, bool incl) const
return closest; return closest;
} }
} // namespace ARDOUR

View file

@ -32,7 +32,8 @@
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
/**** Handler ***/ /**** Handler ***/
LocationImportHandler::LocationImportHandler (XMLTree const & source, Session & session) : LocationImportHandler::LocationImportHandler (XMLTree const & source, Session & session) :
@ -189,3 +190,5 @@ LocationImporter::_move ()
{ {
session.locations()->add (location); session.locations()->add (location);
} }
} // namespace ARDOUR

View file

@ -37,12 +37,13 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using std::string; using std::string;
#define BUFFER_SIZE 1024 // audio chunk size #define BUFFER_SIZE 1024 // audio chunk size
namespace ARDOUR {
LTCReader::LTCReader (int expected_apv, LTC_TV_STANDARD tv_standard) LTCReader::LTCReader (int expected_apv, LTC_TV_STANDARD tv_standard)
: _position (0) : _position (0)
{ {
@ -238,3 +239,5 @@ LTCFileReader::read_ltc (uint32_t channel, uint32_t max_frames)
return rv; return rv;
} }
} // namespace ARDOUR

View file

@ -36,7 +36,6 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace MIDI; using namespace MIDI;
using namespace PBD; using namespace PBD;
using namespace Timecode; using namespace Timecode;
@ -44,6 +43,8 @@ using namespace Timecode;
#define ENGINE AudioEngine::instance() #define ENGINE AudioEngine::instance()
#define FLYWHEEL_TIMEOUT ( 1 * ENGINE->sample_rate() ) #define FLYWHEEL_TIMEOUT ( 1 * ENGINE->sample_rate() )
namespace ARDOUR {
/* XXX USE Config->get_ltc_input */ /* XXX USE Config->get_ltc_input */
LTC_TransportMaster::LTC_TransportMaster (std::string const & name) LTC_TransportMaster::LTC_TransportMaster (std::string const & name)
@ -264,6 +265,7 @@ LTC_TransportMaster::equal_ltc_sample_time(LTCFrame *a, LTCFrame *b) {
} }
return true; return true;
} }
static ostream& operator<< (ostream& ostr, LTCFrame& a) static ostream& operator<< (ostream& ostr, LTCFrame& a)
{ {
ostr ostr
@ -653,3 +655,5 @@ LTC_TransportMaster::delta_string() const
return format_delta_time (_current_delta); return format_delta_time (_current_delta);
} }
} }
} // namespace ARDOUR

View file

@ -354,7 +354,7 @@ CLASSKEYS(LuaDialog::ProgressWindow);
* as LuaBridge's "WSPtrClass". * as LuaBridge's "WSPtrClass".
*/ */
using namespace ARDOUR; namespace ARDOUR {
/** Access libardour global configuration */ /** Access libardour global configuration */
static RCConfiguration* _libardour_config () { 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 if (cb_ses.type() == LUA_TFUNCTION) { cb_ses(s->name()); } // TODO args
} }
} }
} // namespace ARDOUR

View file

@ -40,9 +40,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
LuaProc::LuaProc (AudioEngine& engine, LuaProc::LuaProc (AudioEngine& engine,
Session& session, Session& session,
const std::string &script) const std::string &script)
@ -1118,7 +1119,7 @@ XMLTree*
LuaProc::presets_tree () const LuaProc::presets_tree () const
{ {
XMLTree* t = new XMLTree; 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 (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
if (g_mkdir_with_parents (p.c_str(), 0755) != 0) { 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); 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 ()); f = Glib::build_filename (f, presets_file ());
t->write (f); t->write (f);
@ -1219,7 +1220,7 @@ LuaProc::do_remove_preset (std::string name)
return; return;
} }
t->root()->remove_nodes_and_delete (X_("label"), 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 ()); f = Glib::build_filename (f, presets_file ());
t->write (f); t->write (f);
} }
@ -1299,7 +1300,7 @@ LuaPluginInfo::get_presets (bool /*user_only*/) const
{ {
std::vector<Plugin::PresetRecord> p; std::vector<Plugin::PresetRecord> p;
XMLTree* t = new XMLTree; 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)) { if (Glib::file_test (pf, Glib::FILE_TEST_EXISTS)) {
t->set_filename (pf); t->set_filename (pf);
if (t->read ()) { if (t->read ()) {
@ -1314,3 +1315,5 @@ LuaPluginInfo::get_presets (bool /*user_only*/) const
delete t; delete t;
return p; return p;
} }
} // namespace ARDOUR

View file

@ -35,10 +35,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
#include "sha1.c" #include "sha1.c"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
namespace ARDOUR {
LuaScripting* LuaScripting::_instance = 0; LuaScripting* LuaScripting::_instance = 0;
LuaScripting& LuaScripting&
@ -554,3 +555,5 @@ LuaScripting::user_script_dir ()
g_mkdir_with_parents (dir.c_str(), 0744); g_mkdir_with_parents (dir.c_str(), 0744);
return dir; return dir;
} }
} // namespace ARDOUR

View file

@ -125,9 +125,10 @@
static const size_t NBUFS = 4; static const size_t NBUFS = 4;
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
bool LV2Plugin::force_state_save = false; bool LV2Plugin::force_state_save = false;
int32_t LV2Plugin::_ui_style_flat = 0; int32_t LV2Plugin::_ui_style_flat = 0;
int32_t LV2Plugin::_ui_style_boxy = 0; int32_t LV2Plugin::_ui_style_boxy = 0;
@ -1593,10 +1594,10 @@ LV2Plugin::load_preset(PresetRecord r)
} }
const void* const void*
ARDOUR::lv2plugin_get_port_value(const char* port_symbol, lv2plugin_get_port_value(const char* port_symbol,
void* user_data, void* user_data,
uint32_t* size, uint32_t* size,
uint32_t* type) uint32_t* type)
{ {
LV2Plugin *plugin = (LV2Plugin *) user_data; LV2Plugin *plugin = (LV2Plugin *) user_data;
@ -2330,7 +2331,7 @@ LV2Plugin::get_parameter_descriptor(uint32_t which, ParameterDescriptor& desc) c
} }
Plugin::IOPortDescription 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; PortFlags match = 0;
switch (dt) { switch (dt) {
@ -3475,11 +3476,11 @@ LV2World::load_bundled_plugins(bool verbose)
{ {
if (!_bundle_checked) { if (!_bundle_checked) {
if (verbose) { 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<string> plugin_objects; vector<string> 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<string>::iterator x = plugin_objects.begin(); x != plugin_objects.end (); ++x) { for ( vector<string>::iterator x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
string uri = "file:///" + *x + "/"; string uri = "file:///" + *x + "/";
@ -3498,7 +3499,7 @@ LV2World::load_bundled_plugins(bool verbose)
LV2PluginInfo::LV2PluginInfo (const char* plugin_uri) LV2PluginInfo::LV2PluginInfo (const char* plugin_uri)
{ {
type = ARDOUR::LV2; type = LV2;
_plugin_uri = strdup(plugin_uri); _plugin_uri = strdup(plugin_uri);
} }
@ -3677,7 +3678,7 @@ LV2PluginInfo::discover()
info->name = string(lilv_node_as_string(name)); info->name = string(lilv_node_as_string(name));
lilv_node_free(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 LilvPluginClass* pclass = lilv_plugin_get_class(p);
const LilvNode* label = lilv_plugin_class_get_label(pclass); const LilvNode* label = lilv_plugin_class_get_label(pclass);
@ -3787,3 +3788,5 @@ LV2PluginInfo::is_analyzer () const
} }
return PluginInfo::is_analyzer (); return PluginInfo::is_analyzer ();
} }
} // namespace ARDOUR

View file

@ -29,9 +29,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id) LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id)
: VSTPlugin (e, session, h) : VSTPlugin (e, session, h)
{ {
@ -169,6 +170,7 @@ LXVSTPluginInfo::get_presets (bool user_only) const
LXVSTPluginInfo::LXVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo) LXVSTPluginInfo::LXVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo)
{ {
type = ARDOUR::LXVST; type = LXVST;
} }
} // namespace ARDOUR

View file

@ -27,9 +27,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
MacVSTPlugin::MacVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id) MacVSTPlugin::MacVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h, int unique_id)
: VSTPlugin (e, session, h) : VSTPlugin (e, session, h)
{ {
@ -175,3 +176,5 @@ MacVSTPluginInfo::MacVSTPluginInfo (_VSTInfo* nfo) : VSTPluginInfo (nfo)
{ {
type = ARDOUR::MacVST; type = ARDOUR::MacVST;
} }
} // namespace ARDOUR

View file

@ -39,7 +39,7 @@
using namespace std; using namespace std;
using namespace ARDOUR; namespace ARDOUR {
PeakMeter::PeakMeter (Session& s, const std::string& name) PeakMeter::PeakMeter (Session& s, const std::string& name)
: Processor (s, string_compose ("meter-%1", name)) : Processor (s, string_compose ("meter-%1", name))
@ -470,3 +470,5 @@ PeakMeter::state ()
node.set_property ("type", "meter"); node.set_property ("type", "meter");
return node; return node;
} }
} // namespace ARDOUR

View file

@ -23,7 +23,7 @@
#include "ardour/midi_source.h" #include "ardour/midi_source.h"
#include "ardour/midi_model.h" #include "ardour/midi_model.h"
using namespace ARDOUR; namespace ARDOUR {
MidiAutomationListBinder::MidiAutomationListBinder (boost::shared_ptr<MidiSource> s, Evoral::Parameter p) MidiAutomationListBinder::MidiAutomationListBinder (boost::shared_ptr<MidiSource> s, Evoral::Parameter p)
: _source (s) : _source (s)
@ -67,3 +67,5 @@ MidiAutomationListBinder::add_state (XMLNode* node)
node->set_property ("source-id", _source->id().to_s()); node->set_property ("source-id", _source->id().to_s());
node->set_property ("parameter", EventTypeMap::instance().to_symbol (_parameter)); node->set_property ("parameter", EventTypeMap::instance().to_symbol (_parameter));
} }
} // namespace ARDOUR

View file

@ -32,9 +32,10 @@
#include "ardour/port.h" #include "ardour/port.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
// FIXME: mirroring for MIDI buffers? // FIXME: mirroring for MIDI buffers?
MidiBuffer::MidiBuffer(size_t capacity) MidiBuffer::MidiBuffer(size_t capacity)
: Buffer (DataType::MIDI) : Buffer (DataType::MIDI)
@ -597,3 +598,5 @@ MidiBuffer::merge_in_place (const MidiBuffer &other)
return true; return true;
} }
} // namespace ARDOUR

View file

@ -45,12 +45,13 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace MIDI; using namespace MIDI;
using namespace PBD; using namespace PBD;
#define ENGINE AudioEngine::instance() #define ENGINE AudioEngine::instance()
namespace ARDOUR {
MIDIClock_TransportMaster::MIDIClock_TransportMaster (std::string const & name, int ppqn) MIDIClock_TransportMaster::MIDIClock_TransportMaster (std::string const & name, int ppqn)
: TransportMaster (MIDIClock, name) : TransportMaster (MIDIClock, name)
, ppqn (ppqn) , ppqn (ppqn)
@ -439,3 +440,4 @@ MIDIClock_TransportMaster::unregister_port ()
TransportMaster::unregister_port (); TransportMaster::unregister_port ();
} }
} // namespace ARDOUR

View file

@ -55,9 +55,10 @@ namespace PBD {
} }
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
MidiModel::MidiModel (boost::shared_ptr<MidiSource> s) MidiModel::MidiModel (boost::shared_ptr<MidiSource> s)
: AutomatableSequence<TimeType>(s->session()) : AutomatableSequence<TimeType>(s->session())
{ {
@ -1825,3 +1826,5 @@ MidiModel::control_list_marked_dirty ()
ContentsChanged (); /* EMIT SIGNAL */ ContentsChanged (); /* EMIT SIGNAL */
} }
} // namespace ARDOUR

View file

@ -37,10 +37,11 @@
using namespace std; using namespace std;
using namespace ARDOUR; using namespace ARDOUR;
using namespace MIDI;
using namespace MIDI::Name;
using namespace PBD; using namespace PBD;
namespace MIDI {
namespace Name {
MidiPatchManager* MidiPatchManager::_manager = 0; MidiPatchManager* MidiPatchManager::_manager = 0;
MidiPatchManager::MidiPatchManager () MidiPatchManager::MidiPatchManager ()
@ -313,3 +314,6 @@ MidiPatchManager::maybe_use (PBD::ScopedConnectionList& cl,
PatchesChanged.connect (cl, ir, midnam_info_method, event_loop); PatchesChanged.connect (cl, ir, midnam_info_method, event_loop);
} }
} }
} // namespace Name
} // namespace MIDI

View file

@ -43,10 +43,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace std; using namespace std;
namespace ARDOUR {
MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden) MidiPlaylist::MidiPlaylist (Session& session, const XMLNode& node, bool hidden)
: Playlist (session, node, DataType::MIDI, hidden) : Playlist (session, node, DataType::MIDI, hidden)
, _note_mode(Sustained) , _note_mode(Sustained)
@ -384,3 +385,5 @@ MidiPlaylist::rendered ()
{ {
return &_rendered; return &_rendered;
} }
} // namespace ARDOUR

View file

@ -30,20 +30,15 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
class MidiStateTracker;
class Session;
template <typename T> class MidiRingBuffer;
}
namespace Evoral { namespace Evoral {
template <typename T> class EventSink; template <typename T> class EventSink;
template <typename Time> class Event; template <typename Time> class Event;
} }
namespace ARDOUR {
/******************************************************************************* /*******************************************************************************
As of May 2011, it appears too complex to support compound regions for MIDI 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 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(); return !_playlist || _playlist->empty();
} }
} // namespace ARDOUR

View file

@ -34,9 +34,10 @@
#include "ardour/session.h" #include "ardour/session.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
#define port_engine AudioEngine::instance()->port_engine() #define port_engine AudioEngine::instance()->port_engine()
MidiPort::MidiPort (const std::string& name, PortFlags flags) MidiPort::MidiPort (const std::string& name, PortFlags flags)
@ -431,3 +432,5 @@ MidiPort::add_shadow_port (string const & name, MidiFilter mf)
return 0; return 0;
} }
} // namespace ARDOUR

View file

@ -57,14 +57,13 @@
#include <locale.h> #include <locale.h>
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR { namespace ARDOUR {
namespace Properties {
PBD::PropertyDescriptor<double> start_beats; namespace Properties {
PBD::PropertyDescriptor<double> length_beats; PBD::PropertyDescriptor<double> start_beats;
} PBD::PropertyDescriptor<double> length_beats;
} }
void void
@ -835,3 +834,5 @@ MidiRegion::set_name (const std::string& str)
return Region::set_name (str); return Region::set_name (str);
} }
} // namespace ARDOUR

View file

@ -26,7 +26,8 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace PBD; using namespace PBD;
using namespace ARDOUR;
namespace ARDOUR {
MIDISceneChange::MIDISceneChange (int c, int b, int p) MIDISceneChange::MIDISceneChange (int c, int b, int p)
: _bank (b) : _bank (b)
@ -155,4 +156,4 @@ MIDISceneChange::set_bank (int bank)
_bank = bank; _bank = bank;
} }
} // namespace ARDOUR

View file

@ -32,7 +32,7 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace ARDOUR; namespace ARDOUR {
MIDISceneChanger::MIDISceneChanger (Session& s) MIDISceneChanger::MIDISceneChanger (Session& s)
: SceneChanger (s) : SceneChanger (s)
@ -374,3 +374,5 @@ MIDISceneChanger::jump_to (int bank, int program)
_session.request_locate (where); _session.request_locate (where);
} }
} }
} // namespace ARDOUR

View file

@ -57,12 +57,13 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
namespace ARDOUR { template <typename T> class MidiRingBuffer; }
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
template <typename T> class MidiRingBuffer;
MidiSource::MidiSource (Session& s, string name, Source::Flag flags) MidiSource::MidiSource (Session& s, string name, Source::Flag flags)
: Source(s, DataType::MIDI, name, flags) : Source(s, DataType::MIDI, name, flags)
, _writing(false) , _writing(false)
@ -600,3 +601,5 @@ MidiSource::copy_automation_state_from (MidiSource* s)
/* XXX: should probably emit signals here */ /* XXX: should probably emit signals here */
} }
} // namespace ARDOUR

View file

@ -30,8 +30,8 @@
#include "ardour/parameter_types.h" #include "ardour/parameter_types.h"
using namespace std; using namespace std;
using namespace ARDOUR;
namespace ARDOUR {
MidiStateTracker::MidiStateTracker () MidiStateTracker::MidiStateTracker ()
{ {
@ -212,3 +212,5 @@ MidiStateTracker::dump (ostream& o)
} }
o << "+++++\n"; o << "+++++\n";
} }
} // namespace ARDOUR

View file

@ -31,9 +31,10 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
MidiStretch::MidiStretch (Session& s, const TimeFXRequest& req) MidiStretch::MidiStretch (Session& s, const TimeFXRequest& req)
: Filter (s) : Filter (s)
, _request (req) , _request (req)
@ -161,3 +162,4 @@ MidiStretch::run (boost::shared_ptr<Region> r, Progress*)
return ret; return ret;
} }
} // namespace ARDOUR

View file

@ -65,17 +65,11 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
namespace ARDOUR {
class InterThreadInfo;
class MidiSource;
class Region;
class SMFSource;
}
using namespace std; using namespace std;
using namespace ARDOUR;
using namespace PBD; using namespace PBD;
namespace ARDOUR {
MidiTrack::MidiTrack (Session& sess, string name, TrackMode mode) MidiTrack::MidiTrack (Session& sess, string name, TrackMode mode)
: Track (sess, name, PresentationInfo::MidiTrack, mode, DataType::MIDI) : Track (sess, name, PresentationInfo::MidiTrack, mode, DataType::MIDI)
, _immediate_events(6096) // FIXME: size? , _immediate_events(6096) // FIXME: size?
@ -896,3 +890,5 @@ MidiTrack::playlist_contents_changed ()
{ {
} }
} // namespace ARDOUR

Some files were not shown because too many files have changed in this diff Show more