From aaa91db6d9592684258267981e619b44cc2b7c40 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 30 Jan 2009 20:18:31 +0000 Subject: Trim include dependency graph, especially for io.h and session.h. Clean up some stuff and other such gruntwork in the process. git-svn-id: svn://localhost/ardour2/branches/3.0@4468 d708f5d6-7413-0410-9779-e7cbd77b26cf --- SConstruct | 4 +- gtk2_ardour/automation_region_view.cc | 2 + gtk2_ardour/editor.cc | 11 +- gtk2_ardour/export_channel_selector.cc | 3 +- gtk2_ardour/gain_meter.cc | 7 + gtk2_ardour/gain_meter.h | 2 +- gtk2_ardour/level_meter.h | 3 +- gtk2_ardour/mixer_strip.cc | 1 + gtk2_ardour/mixer_strip.h | 2 - gtk2_ardour/mixer_ui.cc | 7 +- gtk2_ardour/mixer_ui.h | 1 - gtk2_ardour/panner2d.cc | 2 +- gtk2_ardour/panner_ui.h | 4 +- gtk2_ardour/port_group.cc | 20 +- gtk2_ardour/processor_box.h | 2 +- gtk2_ardour/route_params_ui.h | 2 - gtk2_ardour/route_time_axis.cc | 7 +- gtk2_ardour/route_time_axis.h | 6 +- gtk2_ardour/send_ui.cc | 4 +- libs/ardour/ardour/audio_diskstream.h | 5 +- libs/ardour/ardour/automatable.h | 3 - libs/ardour/ardour/automation_control.h | 1 - libs/ardour/ardour/diskstream.h | 24 +- libs/ardour/ardour/export_channel.h | 3 +- libs/ardour/ardour/export_filename.h | 3 +- libs/ardour/ardour/export_handler.h | 2 +- libs/ardour/ardour/gain.h | 1 - libs/ardour/ardour/internal_send.h | 1 - libs/ardour/ardour/io.h | 1 + libs/ardour/ardour/io_processor.h | 22 +- libs/ardour/ardour/midi_diskstream.h | 14 +- libs/ardour/ardour/mix.h | 19 +- libs/ardour/ardour/panner.h | 1 - libs/ardour/ardour/plugin_insert.h | 2 +- libs/ardour/ardour/port.h | 10 +- libs/ardour/ardour/processor.h | 1 + libs/ardour/ardour/region.h | 1 + libs/ardour/ardour/region_factory.h | 1 + libs/ardour/ardour/route.h | 8 +- libs/ardour/ardour/route_group_specialized.h | 2 +- libs/ardour/ardour/send.h | 1 - libs/ardour/ardour/session.h | 413 ++++++++++----------- libs/ardour/ardour/track.h | 1 + libs/ardour/ardour/types.h | 6 + libs/ardour/audio_diskstream.cc | 6 +- libs/ardour/diskstream.cc | 3 + libs/ardour/export_channel.cc | 9 +- libs/ardour/internal_send.cc | 1 + libs/ardour/io_processor.cc | 32 ++ libs/ardour/midi_diskstream.cc | 22 +- libs/ardour/route_group.cc | 1 + libs/ardour/send.cc | 1 + libs/ardour/session.cc | 59 +-- libs/ardour/session_butler.cc | 11 +- libs/ardour/session_export.cc | 13 +- libs/ardour/session_state.cc | 1 + libs/ardour/smf_source.cc | 1 + libs/surfaces/control_protocol/control_protocol.cc | 8 +- 58 files changed, 421 insertions(+), 383 deletions(-) diff --git a/SConstruct b/SConstruct index 1744090bd4..6d41bb0e4c 100644 --- a/SConstruct +++ b/SConstruct @@ -677,9 +677,9 @@ env = conf.Finish() opt_flags = [] if env['GPROFILE'] == 1: - debug_flags = [ '-g', '-pg' ] + debug_flags = [ '-O0', '-g', '-pg' ] else: - debug_flags = [ '-g' ] + debug_flags = [ '-O0', '-g' ] # guess at the platform, used to define compiler flags diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index 5eae11463f..200a1e2fb2 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -18,6 +18,8 @@ */ #include +#include +#include #include "automation_region_view.h" #include "public_editor.h" diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 8f1c1917c1..0932a046e0 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -46,19 +46,20 @@ #include #include -#include #include -#include -#include +#include #include #include +#include #include -#include +#include +#include +#include #include +#include #include #include #include -#include #include diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index 62380c1604..1f1472d830 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -24,12 +24,13 @@ #include +#include +#include #include #include #include #include #include -#include #include #include diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 8438147746..f90e28a9ac 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -924,3 +924,10 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev) return true; } +boost::shared_ptr +GainMeterBase::get_controllable() +{ + return _io->gain_control(); +} + + diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h index 820e9ef0e7..0c4e52b7c5 100644 --- a/gtk2_ardour/gain_meter.h +++ b/gtk2_ardour/gain_meter.h @@ -74,7 +74,7 @@ class GainMeterBase : virtual public sigc::trackable virtual void setup_meters (int len=0); - boost::shared_ptr get_controllable() { return _io->gain_control(); } + boost::shared_ptr get_controllable(); LevelMeter& get_level_meter() const { return *level_meter; } Gtkmm2ext::SliderController& get_gain_slider() const { return *gain_slider; } diff --git a/gtk2_ardour/level_meter.h b/gtk2_ardour/level_meter.h index 521b9d1d8f..0273a075c8 100644 --- a/gtk2_ardour/level_meter.h +++ b/gtk2_ardour/level_meter.h @@ -21,7 +21,6 @@ #define __ardour_gtk_track_meter_h__ #include -#include #include #include @@ -93,7 +92,7 @@ class LevelMeter : public Gtk::HBox guint16 regular_meter_width; static const guint16 thin_meter_width = 2; - vector meters; + std::vector meters; float max_peak; void hide_all_meters (); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 365a26f948..1bee8268ae 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 45b650172b..e859e52026 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -42,9 +42,7 @@ #include #include -#include #include -#include #include diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 2c223f5bda..8da14e2f46 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -30,11 +30,12 @@ #include #include -#include -#include -#include #include +#include #include +#include +#include +#include #include "keyboard.h" #include "mixer_ui.h" diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index f5e1ae211d..2dbddc9dd0 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -35,7 +35,6 @@ #include #include -#include #include "route_processor_selection.h" #include "enums.h" diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc index 91ca15b7b7..97f7fcd123 100644 --- a/gtk2_ardour/panner2d.cc +++ b/gtk2_ardour/panner2d.cc @@ -633,7 +633,7 @@ Panner2d::on_button_release_event (GdkEventButton *ev) for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) { - Target* puck = i->second; + //Target* puck = i->second; /* XXX DO SOMETHING TO SET PUCK BACK TO "normal" */ } diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h index 6be92f9c5a..b6c439fd6a 100644 --- a/gtk2_ardour/panner_ui.h +++ b/gtk2_ardour/panner_ui.h @@ -114,8 +114,8 @@ class PannerUI : public Gtk::HBox void panning_link_direction_clicked (); - vector pan_adjustments; - vector pan_bars; + std::vector pan_adjustments; + std::vector pan_bars; void pan_adjustment_changed (uint32_t which); void pan_value_changed (uint32_t which); diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index 4bf565a3e9..405d503016 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -17,17 +17,21 @@ */ -#include "port_group.h" -#include "port_matrix.h" -#include "i18n.h" -#include "ardour/session.h" +#include +#include + #include "ardour/audio_track.h" -#include "ardour/midi_track.h" #include "ardour/audioengine.h" -#include "ardour/port.h" #include "ardour/bundle.h" -#include -#include +#include "ardour/io_processor.h" +#include "ardour/midi_track.h" +#include "ardour/port.h" +#include "ardour/session.h" + +#include "port_group.h" +#include "port_matrix.h" + +#include "i18n.h" using namespace std; using namespace Gtk; diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index e47c28ec10..0a6399caad 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -56,6 +55,7 @@ class RouteRedirectSelection; namespace ARDOUR { class Connection; + class IO; class Insert; class Plugin; class PluginInsert; diff --git a/gtk2_ardour/route_params_ui.h b/gtk2_ardour/route_params_ui.h index a41a092440..484c4f28a8 100644 --- a/gtk2_ardour/route_params_ui.h +++ b/gtk2_ardour/route_params_ui.h @@ -35,8 +35,6 @@ #include #include -#include -#include #include "io_selector.h" #include "ardour_dialog.h" diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index e544122ccd..f8b34bd459 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -40,19 +40,20 @@ #include #include -#include #include #include -#include #include #include #include #include +#include +#include +#include +#include #include #include #include #include -#include #include "ardour_ui.h" #include "route_time_axis.h" diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 9e40c511a6..da1ee711d6 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -20,6 +20,9 @@ #ifndef __ardour_route_time_axis_h__ #define __ardour_route_time_axis_h__ +#include +#include + #include #include #include @@ -31,7 +34,6 @@ #include #include -#include #include #include @@ -305,7 +307,7 @@ protected: ProcessorAutomationCurves processor_automation_curves; // Set from XML so context menu automation buttons can be correctly initialized - set _show_automation; + std::set _show_automation; AutomationTracks _automation_tracks; diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc index fc05c08c2a..3fb6e8af47 100644 --- a/gtk2_ardour/send_ui.cc +++ b/gtk2_ardour/send_ui.cc @@ -17,9 +17,11 @@ */ -#include #include +#include +#include + #include "utils.h" #include "send_ui.h" #include "io_selector.h" diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index 92c8e82df8..8f081ab58d 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -36,9 +36,6 @@ #include #include -#include -#include -#include #include #include #include @@ -261,7 +258,7 @@ class AudioDiskstream : public Diskstream void process_varispeed_playback(nframes_t nframes, boost::shared_ptr c); /* The two central butler operations */ - int do_flush (Session::RunContext context, bool force = false); + int do_flush (RunContext context, bool force = false); int do_refill () { return _do_refill(_mixdown_buffer, _gain_buffer); } int do_refill_with_alloc (); diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h index d99960334d..ca4624f281 100644 --- a/libs/ardour/ardour/automatable.h +++ b/libs/ardour/ardour/automatable.h @@ -23,9 +23,6 @@ #include #include #include -#include -#include -#include #include #include #include diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h index 4cb6d1a79a..3f22e6d57f 100644 --- a/libs/ardour/ardour/automation_control.h +++ b/libs/ardour/ardour/automation_control.h @@ -28,7 +28,6 @@ namespace ARDOUR { -class AutomationList; class Session; class Automatable; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index b0ac26342f..211933c778 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -20,16 +20,17 @@ #ifndef __ardour_diskstream_h__ #define __ardour_diskstream_h__ -#include - -#include #include #include #include #include - +#include #include +#include + +#include + #include #include #include @@ -37,20 +38,23 @@ #include #include -#include -#include -#include +#include +#include +#include #include +#include struct tm; namespace ARDOUR { class AudioEngine; +class IO; +class Playlist; +class Processor; +class Region; class Send; class Session; -class Playlist; -class IO; class Diskstream : public SessionObject { @@ -195,7 +199,7 @@ class Diskstream : public SessionObject }; /* The two central butler operations */ - virtual int do_flush (Session::RunContext context, bool force = false) = 0; + virtual int do_flush (RunContext context, bool force = false) = 0; virtual int do_refill () = 0; /** For non-butler contexts (allocates temporary working buffers) */ diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index 213bd2d9fa..d7c363860c 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -22,7 +22,6 @@ #define __ardour_export_channel_h__ #include -#include #include #include @@ -33,6 +32,8 @@ namespace ARDOUR { class Session; +class AudioTrack; +class AudioPort; /// Export channel base class interface for different source types class ExportChannel diff --git a/libs/ardour/ardour/export_filename.h b/libs/ardour/ardour/export_filename.h index e44c50f394..fb9f5dcbbc 100644 --- a/libs/ardour/ardour/export_filename.h +++ b/libs/ardour/ardour/export_filename.h @@ -21,11 +21,10 @@ #ifndef __ardour_export_filename_h__ #define __ardour_export_filename_h__ +#include #include #include -#include - using Glib::ustring; namespace ARDOUR diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h index 6142869fe0..b918963ae8 100644 --- a/libs/ardour/ardour/export_handler.h +++ b/libs/ardour/ardour/export_handler.h @@ -28,8 +28,8 @@ #include #include -#include #include +#include namespace ARDOUR { diff --git a/libs/ardour/ardour/gain.h b/libs/ardour/ardour/gain.h index 0c7d9f957d..207f794910 100644 --- a/libs/ardour/ardour/gain.h +++ b/libs/ardour/ardour/gain.h @@ -22,7 +22,6 @@ #include "ardour.h" #include "automation_list.h" -#include namespace ARDOUR { diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 0215ea9b9a..8d2ea7b1c3 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace ARDOUR { diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index a3c0468930..5a3c5c2b12 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -42,6 +42,7 @@ #include #include #include +#include using std::string; using std::vector; diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h index 3739c496c5..1c9da68767 100644 --- a/libs/ardour/ardour/io_processor.h +++ b/libs/ardour/ardour/io_processor.h @@ -21,9 +21,6 @@ #define __ardour_redirect_h__ #include -#include -#include -#include #include #include @@ -33,19 +30,15 @@ #include #include -#include -#include -using std::map; -using std::set; using std::string; -using std::vector; class XMLNode; namespace ARDOUR { class Session; +class IO; /** A mixer strip element (Processor) with Jack ports (IO). */ @@ -59,17 +52,18 @@ class IOProcessor : public Processor IOProcessor (const IOProcessor&); virtual ~IOProcessor (); - virtual ChanCount output_streams() const { return _io->n_outputs(); } - virtual ChanCount input_streams () const { return _io->n_inputs(); } - virtual ChanCount natural_output_streams() const { return _io->n_outputs(); } - virtual ChanCount natural_input_streams () const { return _io->n_inputs(); } + virtual ChanCount output_streams() const; + virtual ChanCount input_streams () const; + virtual ChanCount natural_output_streams() const; + virtual ChanCount natural_input_streams () const; boost::shared_ptr io() { return _io; } boost::shared_ptr io() const { return _io; } - virtual void automation_snapshot (nframes_t now, bool force) { _io->automation_snapshot(now, force); } + virtual void automation_snapshot (nframes_t now, bool force); - virtual void run_in_place (BufferSet& in, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0; + virtual void run_in_place (BufferSet& in, nframes_t start, nframes_t end, + nframes_t nframes, nframes_t offset) = 0; void silence (nframes_t nframes, nframes_t offset); diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index 02b0132f7a..852a329544 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -37,25 +37,23 @@ #include #include -#include -#include -#include -#include #include #include #include #include +#include struct tm; namespace ARDOUR { +class IO; class MidiEngine; +class MidiPort; +class MidiRingbuffer; +class SMFSource; class Send; class Session; -class MidiPlaylist; -class SMFSource; -class IO; class MidiDiskstream : public Diskstream { @@ -145,7 +143,7 @@ class MidiDiskstream : public Diskstream private: /* The two central butler operations */ - int do_flush (Session::RunContext context, bool force = false); + int do_flush (RunContext context, bool force = false); int do_refill (); int do_refill_with_alloc(); diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h index 67779f0e07..c9bf9a605a 100644 --- a/libs/ardour/ardour/mix.h +++ b/libs/ardour/ardour/mix.h @@ -21,26 +21,25 @@ #include #include -#include #if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS) extern "C" { /* SSE functions */ - float x86_sse_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current); - void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain); - void x86_sse_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain); - void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes); + float x86_sse_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current); + void x86_sse_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain); + void x86_sse_mix_buffers_with_gain(ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain); + void x86_sse_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes); } -void x86_sse_find_peaks (const ARDOUR::Sample * buf, nframes_t nsamples, float *min, float *max); +void x86_sse_find_peaks (const ARDOUR::Sample * buf, nframes_t nsamples, float *min, float *max); /* debug wrappers for SSE functions */ -float debug_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current); -void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain); -void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain); -void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes); +float debug_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current); +void debug_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain); +void debug_mix_buffers_with_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes, float gain); +void debug_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nframes_t nframes); #endif diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h index f523f431c4..34b99e63bf 100644 --- a/libs/ardour/ardour/panner.h +++ b/libs/ardour/ardour/panner.h @@ -33,7 +33,6 @@ #include #include #include -#include using std::istream; using std::ostream; diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 5cf4b4cbe0..2583728ef3 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include class XMLNode; diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 759d532e82..896b35e734 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -20,13 +20,13 @@ #ifndef __ardour_port_h__ #define __ardour_port_h__ -#include "ardour/data_type.h" -#include "ardour/types.h" -#include -#include -#include #include +#include #include +#include +#include +#include "ardour/data_type.h" +#include "ardour/types.h" namespace ARDOUR { diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h index da00c77dab..5a1011966c 100644 --- a/libs/ardour/ardour/processor.h +++ b/libs/ardour/ardour/processor.h @@ -33,6 +33,7 @@ #include #include #include +#include class XMLNode; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 66f5d2be35..a84057a909 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -30,6 +30,7 @@ #include #include #include +#include class XMLNode; diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index b88f3b225a..ed16477310 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -28,6 +28,7 @@ class XMLNode; namespace ARDOUR { class Session; +class AudioRegion; class RegionFactory { diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 1d3fc25164..cbf4910899 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -38,13 +39,12 @@ #include #include -#include -#include #include namespace ARDOUR { class Processor; +class IOProcessor; class Send; class RouteGroup; @@ -154,7 +154,7 @@ class Route : public IO ProcessorList::iterator i; for (i = _processors.begin(); i != _processors.end() && n; ++i, --n); if (i == _processors.end()) { - return boost::shared_ptr (); + return boost::shared_ptr (); } else { return *i; } @@ -227,7 +227,7 @@ class Route : public IO IO* control_outs() { return _control_outs; } bool feeds (boost::shared_ptr); - set > fed_by; + std::set > fed_by; struct ToggleControllable : public PBD::Controllable { enum ToggleType { diff --git a/libs/ardour/ardour/route_group_specialized.h b/libs/ardour/ardour/route_group_specialized.h index 9e04c46d0e..d2ad734b9d 100644 --- a/libs/ardour/ardour/route_group_specialized.h +++ b/libs/ardour/ardour/route_group_specialized.h @@ -21,7 +21,7 @@ #define __ardour_route_group_specialized_h__ #include -#include +#include namespace ARDOUR { diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index d5078bd7df..497027866b 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace ARDOUR { diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 7cdc11a054..60e6aa724e 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -20,41 +20,38 @@ #ifndef __ardour_session_h__ #define __ardour_session_h__ -#include #include #include -#include #include #include +#include +#include +#include +#include #include #include -#include - -#include #include #include #include -#include #include #include #include +#include -#include #include +#include -#include #include +#include #include +#include #include #include -#include -#include - #include class XMLTree; @@ -69,51 +66,50 @@ namespace PBD { class Controllable; } +namespace Evoral { + class Curve; +} + namespace ARDOUR { -class Port; +class AudioDiskstream; class AudioEngine; -class Slave; -class Diskstream; -class Route; -class AuxInput; -class Source; +class AudioFileSource; +class AudioRegion; class AudioSource; +class AudioTrack; +class Auditioner; +class AutomationList; +class AuxInput; class BufferSet; -class IO; - +class Bundle; +class ControlProtocolInfo; class Diskstream; -class AudioDiskstream; +class ExportHandler; +class ExportStatus; +class IO; +class IOProcessor; class MidiDiskstream; -class AudioFileSource; +class MidiRegion; class MidiSource; -class Auditioner; -class Processor; -class Send; -class IOProcessor; -class PortInsert; -class PluginInsert; -class Bundle; -class TempoMap; -class AudioTrack; +class MidiTrack; class NamedSelection; -class AudioRegion; - -class Region; class Playlist; -class VSTPlugin; -class ControlProtocolInfo; - -class MidiTrack; -class MidiRegion; +class PluginInsert; +class Port; +class PortInsert; +class Processor; +class Region; +class Route; +class RouteGroup; class SMFSource; - +class Send; class SessionDirectory; class SessionMetadata; -class ExportHandler; -class ExportStatus; - -struct RouteGroup; +class Slave; +class Source; +class TempoMap; +class VSTPlugin; using std::vector; using std::string; @@ -136,115 +132,115 @@ class Session : public PBD::StatefulDestructible }; struct Event { - enum Type { - SetTransportSpeed, - SetDiskstreamSpeed, - Locate, - LocateRoll, - LocateRollLocate, - SetLoop, - PunchIn, - PunchOut, - RangeStop, - RangeLocate, - Overwrite, - SetSlaveSource, - Audition, - InputConfigurationChange, - SetAudioRange, - SetPlayRange, - - /* only one of each of these events - can be queued at any one time - */ - - StopOnce, - AutoLoop - }; - - enum Action { - Add, - Remove, - Replace, - Clear - }; + enum Type { + SetTransportSpeed, + SetDiskstreamSpeed, + Locate, + LocateRoll, + LocateRollLocate, + SetLoop, + PunchIn, + PunchOut, + RangeStop, + RangeLocate, + Overwrite, + SetSlaveSource, + Audition, + InputConfigurationChange, + SetAudioRange, + SetPlayRange, + + /* only one of each of these events + can be queued at any one time + */ + + StopOnce, + AutoLoop + }; + + enum Action { + Add, + Remove, + Replace, + Clear + }; Type type; - Action action; - nframes_t action_frame; - nframes_t target_frame; - double speed; + Action action; + nframes_t action_frame; + nframes_t target_frame; + double speed; - union { + union { void* ptr; bool yes_or_no; - nframes_t target2_frame; + nframes_t target2_frame; SlaveSource slave; Route* route; - }; + }; - boost::shared_ptr region; + boost::shared_ptr region; - list audio_range; - list music_range; + list audio_range; + list music_range; - Event(Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false) - : type (t), - action (a), - action_frame (when), - target_frame (where), - speed (spd), - yes_or_no (yn) {} + Event(Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false) + : type (t), + action (a), + action_frame (when), + target_frame (where), + speed (spd), + yes_or_no (yn) {} - void set_ptr (void* p) { - ptr = p; - } + void set_ptr (void* p) { + ptr = p; + } - bool before (const Event& other) const { - return action_frame < other.action_frame; - } + bool before (const Event& other) const { + return action_frame < other.action_frame; + } - bool after (const Event& other) const { - return action_frame > other.action_frame; - } + bool after (const Event& other) const { + return action_frame > other.action_frame; + } - static bool compare (const Event *e1, const Event *e2) { - return e1->before (*e2); - } + static bool compare (const Event *e1, const Event *e2) { + return e1->before (*e2); + } - void *operator new (size_t ignored) { - return pool.alloc (); - } + void *operator new (size_t ignored) { + return pool.alloc (); + } - void operator delete(void *ptr, size_t size) { - pool.release (ptr); - } + void operator delete(void *ptr, size_t size) { + pool.release (ptr); + } - static const nframes_t Immediate = 0; + static const nframes_t Immediate = 0; - private: - static MultiAllocSingleReleasePool pool; + private: + static MultiAllocSingleReleasePool pool; }; /* creating from an XML file */ Session (AudioEngine&, - const string& fullpath, - const string& snapshot_name, - string mix_template = ""); + const string& fullpath, + const string& snapshot_name, + string mix_template = ""); /* creating a new Session */ Session (AudioEngine&, - string fullpath, - string snapshot_name, - AutoConnectOption input_auto_connect, - AutoConnectOption output_auto_connect, - uint32_t control_out_channels, - uint32_t master_out_channels, - uint32_t n_physical_in, - uint32_t n_physical_out, - nframes_t initial_length); + string fullpath, + string snapshot_name, + AutoConnectOption input_auto_connect, + AutoConnectOption output_auto_connect, + uint32_t control_out_channels, + uint32_t master_out_channels, + uint32_t n_physical_in, + uint32_t n_physical_out, + nframes_t initial_length); virtual ~Session (); @@ -573,12 +569,12 @@ class Session : public PBD::StatefulDestructible static sigc::signal EndTimeChanged; static sigc::signal SMPTEOffsetChanged; - void request_slave_source (SlaveSource); - bool synced_to_jack() const { return Config->get_slave_source() == JACK; } + void request_slave_source (SlaveSource); + bool synced_to_jack() const { return Config->get_slave_source() == JACK; } - double transport_speed() const { return _transport_speed; } - bool transport_stopped() const { return _transport_speed == 0.0f; } - bool transport_rolling() const { return _transport_speed != 0.0f; } + double transport_speed() const { return _transport_speed; } + bool transport_stopped() const { return _transport_speed == 0.0f; } + bool transport_rolling() const { return _transport_speed != 0.0f; } void set_silent (bool yn); bool silent () { return _silent; } @@ -615,17 +611,17 @@ class Session : public PBD::StatefulDestructible /* source management */ struct import_status : public InterThreadInfo { - string doing_what; + string doing_what; - /* control info */ - uint32_t total; - SrcQuality quality; - volatile bool freeze; - std::vector paths; - bool replace_existing_source; + /* control info */ + uint32_t total; + SrcQuality quality; + volatile bool freeze; + std::vector paths; + bool replace_existing_source; - /* result */ - SourceList sources; + /* result */ + SourceList sources; }; void import_audiofiles (import_status&); @@ -728,8 +724,8 @@ class Session : public PBD::StatefulDestructible /* flattening stuff */ - boost::shared_ptr write_one_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector >&, - InterThreadInfo& wot); + boost::shared_ptr write_one_track (AudioTrack&, nframes_t start, nframes_t end, + bool overwrite, vector >&, InterThreadInfo& wot); int freeze (InterThreadInfo&); /* session-wide solo/mute/rec-enable */ @@ -946,21 +942,14 @@ class Session : public PBD::StatefulDestructible gain_t* gain_automation_buffer () const { return _gain_automation_buffer; } pan_t** pan_automation_buffer () const { return _pan_automation_buffer; } - /* buffers for conversion */ - enum RunContext { - ButlerContext = 0, - TransportContext, - ExportContext - }; - /* VST support */ static long vst_callback (AEffect* effect, - long opcode, - long index, - long value, - void* ptr, - float opt); + long opcode, + long index, + long value, + void* ptr, + float opt); static sigc::signal SendFeedback; @@ -971,8 +960,6 @@ class Session : public PBD::StatefulDestructible void add_controllable (boost::shared_ptr); void remove_controllable (PBD::Controllable*); - /* metadata */ - SessionMetadata & metadata () { return *_metadata; } protected: @@ -1208,12 +1195,12 @@ class Session : public PBD::StatefulDestructible inline bool transport_work_requested() const { return g_atomic_int_get(&butler_should_do_transport_work); } struct ButlerRequest { - enum Type { - Wake, - Run, - Pause, - Quit - }; + enum Type { + Wake, + Run, + Pause, + Quit + }; }; enum PostTransportWork { @@ -1235,14 +1222,15 @@ class Session : public PBD::StatefulDestructible }; static const PostTransportWork ProcessCannotProceedMask = - PostTransportWork (PostTransportInputChange| - PostTransportSpeed| - PostTransportReverse| - PostTransportCurveRealloc| - PostTransportScrub| - PostTransportAudition| - PostTransportLocate| - PostTransportStop); + PostTransportWork ( + PostTransportInputChange| + PostTransportSpeed| + PostTransportReverse| + PostTransportCurveRealloc| + PostTransportScrub| + PostTransportAudition| + PostTransportLocate| + PostTransportStop); PostTransportWork post_transport_work; @@ -1397,15 +1385,11 @@ class Session : public PBD::StatefulDestructible bool process_can_proceed() const { return !(post_transport_work & ProcessCannotProceedMask); } struct MIDIRequest { - - enum Type { - PortChange, - Quit - }; - - Type type; - - MIDIRequest () {} + enum Type { + PortChange, + Quit + }; + Type type; }; Glib::Mutex midi_lock; @@ -1587,18 +1571,18 @@ class Session : public PBD::StatefulDestructible /* S/W RAID */ struct space_and_path { - uint32_t blocks; /* 4kB blocks */ - string path; + uint32_t blocks; /* 4kB blocks */ + string path; - space_and_path() { - blocks = 0; - } + space_and_path() { + blocks = 0; + } }; struct space_and_path_ascending_cmp { - bool operator() (space_and_path a, space_and_path b) { - return a.blocks > b.blocks; - } + bool operator() (space_and_path a, space_and_path b) { + return a.blocks > b.blocks; + } }; void setup_raid_path (string path); @@ -1647,36 +1631,36 @@ class Session : public PBD::StatefulDestructible /* click track */ struct Click { - nframes_t start; - nframes_t duration; - nframes_t offset; - const Sample *data; + nframes_t start; + nframes_t duration; + nframes_t offset; + const Sample *data; - Click (nframes_t s, nframes_t d, const Sample *b) - : start (s), duration (d), data (b) { offset = 0; } + Click (nframes_t s, nframes_t d, const Sample *b) + : start (s), duration (d), data (b) { offset = 0; } - void *operator new(size_t ignored) { - return pool.alloc (); - }; + void *operator new(size_t ignored) { + return pool.alloc (); + }; - void operator delete(void *ptr, size_t size) { - pool.release (ptr); - } + void operator delete(void *ptr, size_t size) { + pool.release (ptr); + } private: - static Pool pool; + static Pool pool; }; typedef list Clicks; - Clicks clicks; - bool _clicking; + Clicks clicks; + bool _clicking; boost::shared_ptr _click_io; - Sample* click_data; - Sample* click_emphasis_data; - nframes_t click_length; - nframes_t click_emphasis_length; - mutable Glib::RWLock click_lock; + Sample* click_data; + Sample* click_emphasis_data; + nframes_t click_length; + nframes_t click_emphasis_length; + mutable Glib::RWLock click_lock; static const Sample default_click[]; static const nframes_t default_click_length; @@ -1711,11 +1695,11 @@ class Session : public PBD::StatefulDestructible /* VST support */ long _vst_callback (VSTPlugin*, - long opcode, - long index, - long value, - void* ptr, - float opt); + long opcode, + long index, + long value, + void* ptr, + float opt); /* number of hardware ports we're using, based on max (requested,available) @@ -1730,7 +1714,6 @@ class Session : public PBD::StatefulDestructible uint32_t n_physical_midi_outputs; uint32_t n_physical_midi_inputs; - int find_all_sources (std::string path, std::set& result); int find_all_sources_across_snapshots (std::set& result, bool exclude_this_snapshot); @@ -1754,13 +1737,9 @@ class Session : public PBD::StatefulDestructible static bool _disable_all_loaded_plugins; - /* Metadata */ - SessionMetadata * _metadata; - /* used in ::audible_frame() */ - - mutable bool have_looped; + mutable bool have_looped; ///< Used in ::audible_frame(*) }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index b524c5d587..566153d02f 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -29,6 +29,7 @@ class Session; class Diskstream; class Playlist; class RouteGroup; +class Region; class Track : public Route { diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 125c8569a8..f98b3d993a 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -378,6 +378,12 @@ namespace ARDOUR { LV2, VST }; + + enum RunContext { + ButlerContext = 0, + TransportContext, + ExportContext + }; enum SlaveSource { None = 0, diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 0661cb27a9..2982b0f2f8 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -53,6 +53,8 @@ #include #include #include +#include +#include #include "i18n.h" #include @@ -1403,7 +1405,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer) * written at all unless @a force_flush is true. */ int -AudioDiskstream::do_flush (Session::RunContext context, bool force_flush) +AudioDiskstream::do_flush (RunContext context, bool force_flush) { uint32_t to_write; int32_t ret = 0; @@ -1555,7 +1557,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca */ while (more_work && !err) { - switch (do_flush (Session::TransportContext, true)) { + switch (do_flush (TransportContext, true)) { case 0: more_work = false; break; diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index afd5d21470..54d5360aa3 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -50,6 +50,9 @@ #include #include #include +#include +#include +#include #include "i18n.h" #include diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index ccb481dc8f..42138453e6 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -18,12 +18,13 @@ */ +#include +#include +#include +#include #include - #include -#include -#include -#include +#include using namespace ARDOUR; diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 60c0cde6af..56667baf4d 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include "i18n.h" diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc index fb27ba6f54..efa319a85b 100644 --- a/libs/ardour/io_processor.cc +++ b/libs/ardour/io_processor.cc @@ -35,6 +35,7 @@ #include #include #include +#include #include "i18n.h" @@ -121,3 +122,34 @@ IOProcessor::silence (nframes_t nframes, nframes_t offset) { _io->silence(nframes, offset); } + +ChanCount +IOProcessor::output_streams() const +{ + return _io->n_outputs(); +} + +ChanCount +IOProcessor::input_streams () const +{ + return _io->n_inputs(); +} + +ChanCount +IOProcessor::natural_output_streams() const +{ + return _io->n_outputs(); +} + +ChanCount +IOProcessor::natural_input_streams () const +{ + return _io->n_inputs(); +} + +void +IOProcessor::automation_snapshot (nframes_t now, bool force) +{ + _io->automation_snapshot(now, force); +} + diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 5b81401c41..959e687882 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -38,17 +38,19 @@ #include #include -#include -#include #include -#include -#include -#include -#include -#include #include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include "i18n.h" #include @@ -870,7 +872,7 @@ MidiDiskstream::do_refill () * written at all unless @a force_flush is true. */ int -MidiDiskstream::do_flush (Session::RunContext context, bool force_flush) +MidiDiskstream::do_flush (RunContext context, bool force_flush) { uint32_t to_write; int32_t ret = 0; @@ -941,7 +943,7 @@ MidiDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_cap */ while (more_work && !err) { - switch (do_flush (Session::TransportContext, true)) { + switch (do_flush (TransportContext, true)) { case 0: more_work = false; break; diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index f22deb5dbf..b1852c3607 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -31,6 +31,7 @@ #include #include #include +#include using namespace ARDOUR; using namespace sigc; diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index d562ddff3f..bb5a424575 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -28,6 +28,7 @@ #include #include #include +#include #include "i18n.h" diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 6e7fe3a0f6..862a8fb7e6 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -43,47 +43,48 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include +#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include #include "i18n.h" diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 5fe7a92d3d..37d0bbd4e7 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -31,12 +31,13 @@ #include #include -#include -#include -#include #include -#include +#include +#include #include +#include +#include +#include #include #include "i18n.h" @@ -315,7 +316,7 @@ Session::butler_thread_work () /* note that we still try to flush diskstreams attached to inactive routes */ - switch ((*i)->do_flush (Session::ButlerContext)) { + switch ((*i)->do_flush (ButlerContext)) { case 0: bytes += (*i)->write_data_count(); break; diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 90ad257d3b..c330a4f7ce 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -22,17 +22,18 @@ #include #include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include -#include -#include +#include #include +#include +#include +#include #include "i18n.h" diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 42dae522df..0f1d972035 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -103,6 +103,7 @@ #include #include #include +#include #include diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index dadd7a8e0a..d379d52a3d 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index 1c9ee83833..f95aadb2b8 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -117,12 +117,12 @@ ControlProtocol::prev_track (uint32_t initial_id) } if (id < 0) { - id = limit; - while (id > initial_id) { - if ((cr = session->route_by_remote_id (id)) != 0) { + uint32_t i = limit; + while (i > initial_id) { + if ((cr = session->route_by_remote_id (i)) != 0) { break; } - id--; + i--; } } -- cgit v1.2.3