summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-14 16:10:01 +0000
committerDavid Robillard <d@drobilla.net>2009-10-14 16:10:01 +0000
commitbb9cc45cd22af67ac275a5e73accbe14fee664d8 (patch)
treee52977d3eae6ff07b856088041a080a2fa3e5b79 /libs/ardour
parent8c4ce1e2ce35571aed5a686671431fdfffae7f8c (diff)
Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only.
Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/amp.cc58
-rw-r--r--libs/ardour/analyser.cc4
-rw-r--r--libs/ardour/ardour/amp.h26
-rw-r--r--libs/ardour/ardour/analyser.h4
-rw-r--r--libs/ardour/ardour/ardour.h10
-rw-r--r--libs/ardour/ardour/audio_buffer.h34
-rw-r--r--libs/ardour/ardour/audio_diskstream.h103
-rw-r--r--libs/ardour/ardour/audio_library.h2
-rw-r--r--libs/ardour/ardour/audio_playlist_importer.h6
-rw-r--r--libs/ardour/ardour/audio_port.h16
-rw-r--r--libs/ardour/ardour/audio_region_importer.h10
-rw-r--r--libs/ardour/ardour/audio_track.h12
-rw-r--r--libs/ardour/ardour/audio_track_importer.h8
-rw-r--r--libs/ardour/ardour/audio_unit.h60
-rw-r--r--libs/ardour/ardour/audioanalyser.h6
-rw-r--r--libs/ardour/ardour/audioengine.h22
-rw-r--r--libs/ardour/ardour/audiofile_tagger.h2
-rw-r--r--libs/ardour/ardour/audiofilesource.h22
-rw-r--r--libs/ardour/ardour/audioplaylist.h8
-rw-r--r--libs/ardour/ardour/audioregion.h34
-rw-r--r--libs/ardour/ardour/audiosource.h24
-rw-r--r--libs/ardour/ardour/auditioner.h6
-rw-r--r--libs/ardour/ardour/auto_bundle.h6
-rw-r--r--libs/ardour/ardour/automatable.h24
-rw-r--r--libs/ardour/ardour/automatable_controls.h2
-rw-r--r--libs/ardour/ardour/automatable_sequence.h2
-rw-r--r--libs/ardour/ardour/automation_control.h18
-rw-r--r--libs/ardour/ardour/automation_list.h16
-rw-r--r--libs/ardour/ardour/beats_frames_converter.h4
-rw-r--r--libs/ardour/ardour/broadcast_info.h26
-rw-r--r--libs/ardour/ardour/buffer.h18
-rw-r--r--libs/ardour/ardour/buffer_set.h22
-rw-r--r--libs/ardour/ardour/bundle.h22
-rw-r--r--libs/ardour/ardour/caimportable.h2
-rw-r--r--libs/ardour/ardour/chan_count.h24
-rw-r--r--libs/ardour/ardour/chan_mapping.h8
-rw-r--r--libs/ardour/ardour/click.h2
-rw-r--r--libs/ardour/ardour/configuration.h2
-rw-r--r--libs/ardour/ardour/configuration_variable.h10
-rw-r--r--libs/ardour/ardour/control_outputs.h10
-rw-r--r--libs/ardour/ardour/control_protocol_manager.h4
-rw-r--r--libs/ardour/ardour/control_protocol_search_path.h4
-rw-r--r--libs/ardour/ardour/coreaudiosource.h4
-rw-r--r--libs/ardour/ardour/crossfade.h46
-rw-r--r--libs/ardour/ardour/crossfade_compare.h2
-rw-r--r--libs/ardour/ardour/cycle_timer.h4
-rw-r--r--libs/ardour/ardour/cycles.h6
-rw-r--r--libs/ardour/ardour/dB.h2
-rw-r--r--libs/ardour/ardour/data_type.h16
-rw-r--r--libs/ardour/ardour/delivery.h8
-rw-r--r--libs/ardour/ardour/diskstream.h38
-rw-r--r--libs/ardour/ardour/element_import_handler.h36
-rw-r--r--libs/ardour/ardour/element_importer.h44
-rw-r--r--libs/ardour/ardour/event_type_map.h2
-rw-r--r--libs/ardour/ardour/export.h84
-rw-r--r--libs/ardour/ardour/export_channel.h26
-rw-r--r--libs/ardour/ardour/export_channel_configuration.h40
-rw-r--r--libs/ardour/ardour/export_failed.h10
-rw-r--r--libs/ardour/ardour/export_file_io.h42
-rw-r--r--libs/ardour/ardour/export_filename.h40
-rw-r--r--libs/ardour/ardour/export_format_base.h46
-rw-r--r--libs/ardour/ardour/export_format_compatibility.h10
-rw-r--r--libs/ardour/ardour/export_format_manager.h54
-rw-r--r--libs/ardour/ardour/export_format_specification.h62
-rw-r--r--libs/ardour/ardour/export_formats.h68
-rw-r--r--libs/ardour/ardour/export_handler.h46
-rw-r--r--libs/ardour/ardour/export_multiplication.h74
-rw-r--r--libs/ardour/ardour/export_preset.h6
-rw-r--r--libs/ardour/ardour/export_processor.h40
-rw-r--r--libs/ardour/ardour/export_profile_manager.h70
-rw-r--r--libs/ardour/ardour/export_status.h22
-rw-r--r--libs/ardour/ardour/export_timespan.h20
-rw-r--r--libs/ardour/ardour/export_utilities.h34
-rw-r--r--libs/ardour/ardour/file_source.h20
-rw-r--r--libs/ardour/ardour/filesystem_paths.h2
-rw-r--r--libs/ardour/ardour/filter.h4
-rw-r--r--libs/ardour/ardour/gain.h2
-rw-r--r--libs/ardour/ardour/gdither_types_internal.h2
-rw-r--r--libs/ardour/ardour/graph.h18
-rw-r--r--libs/ardour/ardour/importable_source.h2
-rw-r--r--libs/ardour/ardour/internal_return.h4
-rw-r--r--libs/ardour/ardour/internal_send.h6
-rw-r--r--libs/ardour/ardour/interpolation.h16
-rw-r--r--libs/ardour/ardour/io.h22
-rw-r--r--libs/ardour/ardour/io_processor.h16
-rw-r--r--libs/ardour/ardour/jack_port.h20
-rw-r--r--libs/ardour/ardour/ladspa.h38
-rw-r--r--libs/ardour/ardour/ladspa_plugin.h18
-rw-r--r--libs/ardour/ardour/latent.h4
-rw-r--r--libs/ardour/ardour/location.h22
-rw-r--r--libs/ardour/ardour/location_importer.h2
-rw-r--r--libs/ardour/ardour/logcurve.h38
-rw-r--r--libs/ardour/ardour/lv2_event_buffer.h12
-rw-r--r--libs/ardour/ardour/lv2_plugin.h12
-rw-r--r--libs/ardour/ardour/meter.h20
-rw-r--r--libs/ardour/ardour/midi_buffer.h18
-rw-r--r--libs/ardour/ardour/midi_diskstream.h28
-rw-r--r--libs/ardour/ardour/midi_model.h64
-rw-r--r--libs/ardour/ardour/midi_operator.h4
-rw-r--r--libs/ardour/ardour/midi_patch_manager.h89
-rw-r--r--libs/ardour/ardour/midi_playlist.h16
-rw-r--r--libs/ardour/ardour/midi_port.h8
-rw-r--r--libs/ardour/ardour/midi_region.h22
-rw-r--r--libs/ardour/ardour/midi_ring_buffer.h10
-rw-r--r--libs/ardour/ardour/midi_source.h26
-rw-r--r--libs/ardour/ardour/midi_state_tracker.h10
-rw-r--r--libs/ardour/ardour/midi_stretch.h2
-rw-r--r--libs/ardour/ardour/midi_track.h48
-rw-r--r--libs/ardour/ardour/mtdm.h58
-rw-r--r--libs/ardour/ardour/mute_master.h6
-rw-r--r--libs/ardour/ardour/named_selection.h4
-rw-r--r--libs/ardour/ardour/noise.h2
-rw-r--r--libs/ardour/ardour/onset_detector.h4
-rw-r--r--libs/ardour/ardour/panner.h66
-rw-r--r--libs/ardour/ardour/peak.h6
-rw-r--r--libs/ardour/ardour/pitch.h4
-rw-r--r--libs/ardour/ardour/playlist.h56
-rw-r--r--libs/ardour/ardour/playlist_factory.h2
-rw-r--r--libs/ardour/ardour/plugin.h54
-rw-r--r--libs/ardour/ardour/plugin_insert.h32
-rw-r--r--libs/ardour/ardour/plugin_manager.h34
-rw-r--r--libs/ardour/ardour/port.h12
-rw-r--r--libs/ardour/ardour/port_insert.h6
-rw-r--r--libs/ardour/ardour/port_set.h24
-rw-r--r--libs/ardour/ardour/processor.h18
-rw-r--r--libs/ardour/ardour/profile.h22
-rw-r--r--libs/ardour/ardour/quantize.h32
-rw-r--r--libs/ardour/ardour/rb_effect.h2
-rw-r--r--libs/ardour/ardour/rc_configuration.h8
-rw-r--r--libs/ardour/ardour/recent_sessions.h2
-rw-r--r--libs/ardour/ardour/region.h42
-rw-r--r--libs/ardour/ardour/region_factory.h16
-rw-r--r--libs/ardour/ardour/resampled_source.h10
-rw-r--r--libs/ardour/ardour/return.h16
-rw-r--r--libs/ardour/ardour/reverse.h2
-rw-r--r--libs/ardour/ardour/route.h56
-rw-r--r--libs/ardour/ardour/route_group.h52
-rw-r--r--libs/ardour/ardour/route_group_specialized.h8
-rw-r--r--libs/ardour/ardour/runtime_functions.h2
-rw-r--r--libs/ardour/ardour/send.h10
-rw-r--r--libs/ardour/ardour/session.h71
-rw-r--r--libs/ardour/ardour/session_configuration.h8
-rw-r--r--libs/ardour/ardour/session_directory.h16
-rw-r--r--libs/ardour/ardour/session_metadata.h28
-rw-r--r--libs/ardour/ardour/session_object.h10
-rw-r--r--libs/ardour/ardour/session_playlist.h6
-rw-r--r--libs/ardour/ardour/session_region.h2
-rw-r--r--libs/ardour/ardour/session_route.h8
-rw-r--r--libs/ardour/ardour/session_selection.h6
-rw-r--r--libs/ardour/ardour/session_state_utils.h10
-rw-r--r--libs/ardour/ardour/silentfilesource.h14
-rw-r--r--libs/ardour/ardour/slave.h100
-rw-r--r--libs/ardour/ardour/smf_source.h8
-rw-r--r--libs/ardour/ardour/smpte.h2
-rw-r--r--libs/ardour/ardour/sndfile_helpers.h2
-rw-r--r--libs/ardour/ardour/sndfileimportable.h2
-rw-r--r--libs/ardour/ardour/sndfilesource.h8
-rw-r--r--libs/ardour/ardour/soundseq.h2
-rw-r--r--libs/ardour/ardour/source.h34
-rw-r--r--libs/ardour/ardour/source_factory.h2
-rw-r--r--libs/ardour/ardour/spline.h56
-rw-r--r--libs/ardour/ardour/stretch.h4
-rw-r--r--libs/ardour/ardour/strip_silence.h6
-rw-r--r--libs/ardour/ardour/tape_file_matcher.h2
-rw-r--r--libs/ardour/ardour/template_utils.h4
-rw-r--r--libs/ardour/ardour/tempo.h46
-rw-r--r--libs/ardour/ardour/ticker.h32
-rw-r--r--libs/ardour/ardour/timestamps.h2
-rw-r--r--libs/ardour/ardour/track.h74
-rw-r--r--libs/ardour/ardour/transient_detector.h6
-rw-r--r--libs/ardour/ardour/types.h161
-rw-r--r--libs/ardour/ardour/uri_map.h8
-rw-r--r--libs/ardour/ardour/user_bundle.h6
-rw-r--r--libs/ardour/ardour/utils.h4
-rw-r--r--libs/ardour/ardour/vst_plugin.h8
-rw-r--r--libs/ardour/audio_buffer.cc8
-rw-r--r--libs/ardour/audio_diskstream.cc444
-rw-r--r--libs/ardour/audio_library.cc22
-rw-r--r--libs/ardour/audio_playlist.cc116
-rw-r--r--libs/ardour/audio_playlist_importer.cc38
-rw-r--r--libs/ardour/audio_port.cc10
-rw-r--r--libs/ardour/audio_region_importer.cc72
-rw-r--r--libs/ardour/audio_track.cc140
-rw-r--r--libs/ardour/audio_track_importer.cc66
-rw-r--r--libs/ardour/audio_unit.cc184
-rw-r--r--libs/ardour/audioanalyser.cc16
-rw-r--r--libs/ardour/audioengine.cc140
-rw-r--r--libs/ardour/audiofile_tagger.cc16
-rw-r--r--libs/ardour/audiofilesource.cc36
-rw-r--r--libs/ardour/audioregion.cc266
-rw-r--r--libs/ardour/audiosource.cc154
-rw-r--r--libs/ardour/auditioner.cc10
-rw-r--r--libs/ardour/auto_bundle.cc2
-rw-r--r--libs/ardour/automatable.cc44
-rw-r--r--libs/ardour/automation.cc4
-rw-r--r--libs/ardour/automation_control.cc4
-rw-r--r--libs/ardour/automation_list.cc54
-rw-r--r--libs/ardour/beats_frames_converter.cc2
-rw-r--r--libs/ardour/broadcast_info.cc60
-rw-r--r--libs/ardour/buffer.cc8
-rw-r--r--libs/ardour/buffer_set.cc30
-rw-r--r--libs/ardour/bundle.cc16
-rw-r--r--libs/ardour/caimportable.cc16
-rw-r--r--libs/ardour/chan_count.cc2
-rw-r--r--libs/ardour/chan_mapping.cc4
-rw-r--r--libs/ardour/configuration.cc28
-rw-r--r--libs/ardour/control_outputs.cc8
-rw-r--r--libs/ardour/control_protocol_manager.cc20
-rw-r--r--libs/ardour/control_protocol_search_path.cc4
-rw-r--r--libs/ardour/coreaudiosource.cc58
-rw-r--r--libs/ardour/crossfade.cc156
-rw-r--r--libs/ardour/cycle_timer.cc4
-rw-r--r--libs/ardour/default_click.cc2
-rw-r--r--libs/ardour/delivery.cc48
-rw-r--r--libs/ardour/diskstream.cc42
-rw-r--r--libs/ardour/element_importer.cc6
-rw-r--r--libs/ardour/enums.cc2
-rw-r--r--libs/ardour/event_type_map.cc22
-rw-r--r--libs/ardour/export_channel.cc16
-rw-r--r--libs/ardour/export_channel_configuration.cc58
-rw-r--r--libs/ardour/export_file_io.cc92
-rw-r--r--libs/ardour/export_filename.cc100
-rw-r--r--libs/ardour/export_format_base.cc30
-rw-r--r--libs/ardour/export_format_manager.cc164
-rw-r--r--libs/ardour/export_format_specification.cc186
-rw-r--r--libs/ardour/export_formats.cc60
-rw-r--r--libs/ardour/export_handler.cc128
-rw-r--r--libs/ardour/export_multiplication.cc224
-rw-r--r--libs/ardour/export_preset.cc16
-rw-r--r--libs/ardour/export_processor.cc98
-rw-r--r--libs/ardour/export_profile_manager.cc174
-rw-r--r--libs/ardour/export_status.cc8
-rw-r--r--libs/ardour/export_timespan.cc10
-rw-r--r--libs/ardour/export_utilities.cc58
-rw-r--r--libs/ardour/file_source.cc62
-rw-r--r--libs/ardour/filename_extensions.cc2
-rw-r--r--libs/ardour/filesystem_paths.cc2
-rw-r--r--libs/ardour/filter.cc16
-rw-r--r--libs/ardour/find_session.cc32
-rw-r--r--libs/ardour/gain.cc2
-rw-r--r--libs/ardour/gdither.cc26
-rw-r--r--libs/ardour/globals.cc10
-rw-r--r--libs/ardour/import.cc52
-rw-r--r--libs/ardour/internal_return.cc8
-rw-r--r--libs/ardour/internal_send.cc28
-rw-r--r--libs/ardour/interpolation.cc26
-rw-r--r--libs/ardour/io.cc152
-rw-r--r--libs/ardour/io_processor.cc22
-rw-r--r--libs/ardour/jack_slave.cc6
-rw-r--r--libs/ardour/ladspa_plugin.cc68
-rw-r--r--libs/ardour/location.cc124
-rw-r--r--libs/ardour/location_importer.cc36
-rw-r--r--libs/ardour/lv2_event_buffer.cc16
-rw-r--r--libs/ardour/lv2_plugin.cc58
-rw-r--r--libs/ardour/meter.cc32
-rw-r--r--libs/ardour/midi_buffer.cc34
-rw-r--r--libs/ardour/midi_clock_slave.cc128
-rw-r--r--libs/ardour/midi_diskstream.cc208
-rw-r--r--libs/ardour/midi_model.cc24
-rw-r--r--libs/ardour/midi_patch_manager.cc22
-rw-r--r--libs/ardour/midi_playlist.cc16
-rw-r--r--libs/ardour/midi_port.cc22
-rw-r--r--libs/ardour/midi_region.cc28
-rw-r--r--libs/ardour/midi_ring_buffer.cc28
-rw-r--r--libs/ardour/midi_source.cc6
-rw-r--r--libs/ardour/midi_state_tracker.cc12
-rw-r--r--libs/ardour/midi_stretch.cc20
-rw-r--r--libs/ardour/midi_track.cc94
-rw-r--r--libs/ardour/mix.cc12
-rw-r--r--libs/ardour/mtc_slave.cc58
-rw-r--r--libs/ardour/mtdm.cc32
-rw-r--r--libs/ardour/mute_master.cc2
-rw-r--r--libs/ardour/named_selection.cc8
-rw-r--r--libs/ardour/onset_detector.cc20
-rw-r--r--libs/ardour/panner.cc236
-rw-r--r--libs/ardour/pcm_utils.cc8
-rw-r--r--libs/ardour/playlist.cc324
-rw-r--r--libs/ardour/playlist_factory.cc18
-rw-r--r--libs/ardour/plugin.cc18
-rw-r--r--libs/ardour/plugin_insert.cc166
-rw-r--r--libs/ardour/plugin_manager.cc114
-rw-r--r--libs/ardour/port.cc24
-rw-r--r--libs/ardour/port_insert.cc8
-rw-r--r--libs/ardour/port_set.cc12
-rw-r--r--libs/ardour/processor.cc28
-rw-r--r--libs/ardour/quantize.cc42
-rw-r--r--libs/ardour/rb_effect.cc62
-rw-r--r--libs/ardour/rc_configuration.cc48
-rw-r--r--libs/ardour/recent_sessions.cc16
-rw-r--r--libs/ardour/region.cc186
-rw-r--r--libs/ardour/region_factory.cc24
-rw-r--r--libs/ardour/resampled_source.cc44
-rw-r--r--libs/ardour/return.cc12
-rw-r--r--libs/ardour/reverse.cc8
-rw-r--r--libs/ardour/route.cc350
-rw-r--r--libs/ardour/route_group.cc34
-rw-r--r--libs/ardour/send.cc16
-rw-r--r--libs/ardour/session.cc126
-rw-r--r--libs/ardour/session_butler.cc50
-rw-r--r--libs/ardour/session_click.cc38
-rw-r--r--libs/ardour/session_command.cc78
-rw-r--r--libs/ardour/session_configuration.cc18
-rw-r--r--libs/ardour/session_directory.cc4
-rw-r--r--libs/ardour/session_events.cc26
-rw-r--r--libs/ardour/session_export.cc30
-rw-r--r--libs/ardour/session_feedback.cc4
-rw-r--r--libs/ardour/session_metadata.cc24
-rw-r--r--libs/ardour/session_midi.cc10
-rw-r--r--libs/ardour/session_process.cc168
-rw-r--r--libs/ardour/session_state.cc488
-rw-r--r--libs/ardour/session_state_utils.cc4
-rw-r--r--libs/ardour/session_time.cc84
-rw-r--r--libs/ardour/session_transport.cc26
-rw-r--r--libs/ardour/session_utils.cc2
-rw-r--r--libs/ardour/session_vst.cc48
-rw-r--r--libs/ardour/smf_source.cc66
-rw-r--r--libs/ardour/sndfile_helpers.cc14
-rw-r--r--libs/ardour/sndfileimportable.cc14
-rw-r--r--libs/ardour/sndfilesource.cc106
-rw-r--r--libs/ardour/source.cc24
-rw-r--r--libs/ardour/source_factory.cc56
-rw-r--r--libs/ardour/sse_functions_xmm.cc8
-rw-r--r--libs/ardour/st_pitch.cc2
-rw-r--r--libs/ardour/st_stretch.cc36
-rw-r--r--libs/ardour/strip_silence.cc10
-rw-r--r--libs/ardour/tape_file_matcher.cc6
-rw-r--r--libs/ardour/template_utils.cc10
-rw-r--r--libs/ardour/tempo.cc224
-rw-r--r--libs/ardour/tempo_map_importer.cc12
-rw-r--r--libs/ardour/ticker.cc72
-rw-r--r--libs/ardour/track.cc40
-rw-r--r--libs/ardour/transient_detector.cc20
-rw-r--r--libs/ardour/uri_map.cc14
-rw-r--r--libs/ardour/user_bundle.cc14
-rw-r--r--libs/ardour/utils.cc4
-rw-r--r--libs/ardour/vst_plugin.cc54
336 files changed, 6483 insertions, 6485 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc
index b8e0ad700f..99a6587dcf 100644
--- a/libs/ardour/amp.cc
+++ b/libs/ardour/amp.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -67,7 +67,7 @@ Amp::configure_io (ChanCount in, ChanCount out)
if (out != in) { // always 1:1
return false;
}
-
+
return Processor::configure_io (in, out);
}
@@ -87,30 +87,30 @@ Amp::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_frame*/, n
}
if (_apply_gain) {
-
+
if (_apply_gain_automation) {
-
+
gain_t* gab = _session.gain_automation_buffer ();
if (mute_gain == 0.0) {
-
+
/* absolute mute */
if (_current_gain == 0.0) {
-
+
/* already silent */
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
i->clear ();
}
} else {
-
+
/* cut to silence */
Amp::apply_gain (bufs, nframes, _current_gain, 0.0);
_current_gain = 0.0;
}
-
+
} else if (mute_gain != 1.0) {
@@ -138,26 +138,26 @@ Amp::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_frame*/, n
_current_gain = gab[nframes-1];
}
-
-
+
+
} else { /* manual (scalar) gain */
gain_t dg = _gain_control->user_float() * mute_gain;
-
+
if (_current_gain != dg) {
-
+
Amp::apply_gain (bufs, nframes, _current_gain, dg);
_current_gain = dg;
-
+
} else if (_current_gain != 1.0f) {
-
+
/* gain has not changed, but its non-unity
*/
for (BufferSet::midi_iterator i = bufs.midi_begin(); i != bufs.midi_end(); ++i) {
MidiBuffer& mb (*i);
-
+
for (MidiBuffer::iterator m = mb.begin(); m != mb.end(); ++m) {
Evoral::MIDIEvent<MidiBuffer::TimeType> ev = *m;
if (ev.is_note_on()) {
@@ -169,7 +169,7 @@ Amp::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_frame*/, n
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
apply_gain_to_buffer (i->data(), nframes, _current_gain);
}
- }
+ }
}
}
@@ -179,9 +179,9 @@ Amp::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_frame*/, n
void
Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target)
{
- /** Apply a (potentially) declicked gain to the audio buffers of @a bufs
+ /** Apply a (potentially) declicked gain to the audio buffers of @a bufs
*/
-
+
if (nframes == 0 || bufs.count().n_audio() == 0) {
return;
}
@@ -212,7 +212,7 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
MidiBuffer& mb (*i);
-
+
for (MidiBuffer::iterator m = mb.begin(); m != mb.end(); ++m) {
Evoral::MIDIEvent<MidiBuffer::TimeType> ev = *m;
@@ -228,16 +228,16 @@ Amp::apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t targ
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
Sample* const buffer = i->data();
-
+
fractional_pos = 1.0;
for (nframes_t nx = 0; nx < declick; ++nx) {
buffer[nx] *= polscale * (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos))));
fractional_pos += fractional_shift;
}
-
+
/* now ensure the rest of the buffer has the target value applied, if necessary. */
-
+
if (declick != nframes) {
if (target == 0.0) {
@@ -256,7 +256,7 @@ Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
for (BufferSet::midi_iterator i = bufs.midi_begin(); i != bufs.midi_end(); ++i) {
MidiBuffer& mb (*i);
-
+
for (MidiBuffer::iterator m = mb.begin(); m != mb.end(); ++m) {
Evoral::MIDIEvent<MidiBuffer::TimeType> ev = *m;
if (ev.is_note_on()) {
@@ -273,7 +273,7 @@ Amp::apply_simple_gain (BufferSet& bufs, nframes_t nframes, gain_t target)
for (BufferSet::midi_iterator i = bufs.midi_begin(); i != bufs.midi_end(); ++i) {
MidiBuffer& mb (*i);
-
+
for (MidiBuffer::iterator m = mb.begin(); m != mb.end(); ++m) {
Evoral::MIDIEvent<MidiBuffer::TimeType> ev = *m;
if (ev.is_note_on()) {
@@ -292,7 +292,7 @@ void
Amp::inc_gain (gain_t factor, void *src)
{
float desired_gain = _gain_control->user_float();
-
+
if (desired_gain == 0.0f) {
set_gain (0.000001f + (0.000001f * factor), src);
} else {
@@ -361,7 +361,7 @@ Amp::GainControl::set_value (float val)
val = 1.99526231f;
_amp->set_gain (val, this);
-
+
AutomationControl::set_value(val);
}
diff --git a/libs/ardour/analyser.cc b/libs/ardour/analyser.cc
index 9309b4d03b..2e68cfed83 100644
--- a/libs/ardour/analyser.cc
+++ b/libs/ardour/analyser.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ list<boost::weak_ptr<Source> > Analyser::analysis_queue;
Analyser::Analyser ()
{
-
+
}
Analyser::~Analyser ()
diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h
index 7be324dba1..f0a65c4ef5 100644
--- a/libs/ardour/ardour/amp.h
+++ b/libs/ardour/ardour/amp.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -43,7 +43,7 @@ public:
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
-
+
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
bool apply_gain() const { return _apply_gain; }
@@ -71,15 +71,15 @@ public:
struct GainControl : public AutomationControl {
GainControl (std::string name, Session& session, Amp* a, const Evoral::Parameter &param,
- boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>() )
- : AutomationControl (session, param, al, name )
+ boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>() )
+ : AutomationControl (session, param, al, name)
, _amp (a)
{}
-
- void set_value (float val);
- float get_value (void) const;
-
- Amp* _amp;
+
+ void set_value (float val);
+ float get_value (void) const;
+
+ Amp* _amp;
};
boost::shared_ptr<GainControl> gain_control() {
@@ -96,7 +96,7 @@ private:
bool _apply_gain_automation;
float _current_gain;
- boost::shared_ptr<GainControl> _gain_control;
+ boost::shared_ptr<GainControl> _gain_control;
boost::shared_ptr<MuteMaster> _mute_master;
};
diff --git a/libs/ardour/ardour/analyser.h b/libs/ardour/ardour/analyser.h
index 8771cab6b0..15e4220ad6 100644
--- a/libs/ardour/ardour/analyser.h
+++ b/libs/ardour/ardour/analyser.h
@@ -19,13 +19,13 @@ class Analyser {
static void init ();
static void queue_source_for_analysis (boost::shared_ptr<Source>, bool force);
static void work ();
-
+
private:
static Analyser* the_analyser;
static Glib::StaticMutex analysis_queue_lock;
static Glib::Cond* SourcesToAnalyse;
static std::list<boost::weak_ptr<Source> > analysis_queue;
-
+
static void analyse_audio_file_source (boost::shared_ptr<AudioFileSource>);
};
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h
index 4ea020403c..d7c67998c7 100644
--- a/libs/ardour/ardour/ardour.h
+++ b/libs/ardour/ardour/ardour.h
@@ -58,7 +58,7 @@ namespace ARDOUR {
microseconds_t get_microseconds ();
/* {
- JACK has exported this functionality for a long time now
+ JACK has exported this functionality for a long time now
but inlining this causes problems
return (microseconds_t) jack_get_time();
}
@@ -72,9 +72,9 @@ namespace ARDOUR {
extern Change BoundsChanged;
struct LocaleGuard {
- LocaleGuard (const char*);
- ~LocaleGuard ();
- const char* old;
+ LocaleGuard (const char*);
+ ~LocaleGuard ();
+ const char* old;
};
static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */
@@ -85,7 +85,7 @@ namespace ARDOUR {
extern MIDI::Port* default_mtc_port;
extern MIDI::Port* default_midi_port;
extern MIDI::Port *default_midi_clock_port;
-
+
int setup_midi ();
}
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h
index be1af03061..65eb38d6db 100644
--- a/libs/ardour/ardour/audio_buffer.h
+++ b/libs/ardour/ardour/audio_buffer.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -41,7 +41,7 @@ public:
}
_written = true;
}
-
+
/** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
assert(&src != this);
@@ -63,7 +63,7 @@ public:
assert (ab);
accumulate_from (*ab, len, dst_offset, src_offset);
}
-
+
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void accumulate_from (const AudioBuffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
assert(_capacity > 0);
@@ -77,7 +77,7 @@ public:
_silent = (src.silent() && _silent);
_written = true;
}
-
+
/** Acumulate (add) @a len frames @a src starting at @a src_offset into self starting at @ dst_offset
* scaling by @a gain_coeff */
void accumulate_with_gain_from (const AudioBuffer& src, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0, nframes_t src_offset = 0) {
@@ -112,13 +112,13 @@ public:
_silent = (_silent && gain_coeff == 0);
_written = true;
}
-
+
void apply_gain (gain_t gain, nframes_t len) {
apply_gain_to_buffer (_data, len, gain);
}
/** Set the data contained by this buffer manually (for setting directly to jack buffer).
- *
+ *
* Constructor MUST have been passed capacity=0 or this will die (to prevent mem leaks).
*/
void set_data (Sample* data, size_t size) {
@@ -131,20 +131,20 @@ public:
}
/** Reallocate the buffer used internally to handle at least @nframes of data
- *
+ *
* Constructor MUST have been passed capacity!=0 or this will die (to prevent mem leaks).
*/
void resize (size_t nframes);
- const Sample* data (nframes_t offset = 0) const {
- assert(offset <= _capacity);
- return _data + offset;
+ const Sample* data (nframes_t offset = 0) const {
+ assert(offset <= _capacity);
+ return _data + offset;
}
- Sample* data (nframes_t offset = 0) {
- assert(offset <= _capacity);
- return _data + offset;
+ Sample* data (nframes_t offset = 0) {
+ assert(offset <= _capacity);
+ return _data + offset;
}
void prepare () { _written = false; }
@@ -154,7 +154,7 @@ public:
bool _owns_data;
bool _written;
Sample* _data; ///< Actual buffer contents
-
+
};
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h
index 23744dfc57..a8072695ff 100644
--- a/libs/ardour/ardour/audio_diskstream.h
+++ b/libs/ardour/ardour/audio_diskstream.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,8 +31,8 @@
#include "pbd/fastlog.h"
#include "pbd/ringbufferNPT.h"
-#include "pbd/stateful.h"
-#include "pbd/rcu.h"
+#include "pbd/stateful.h"
+#include "pbd/rcu.h"
#include "ardour/ardour.h"
#include "ardour/utils.h"
@@ -53,7 +53,7 @@ class AudioFileSource;
class IO;
class AudioDiskstream : public Diskstream
-{
+{
public:
AudioDiskstream (Session &, const std::string& name, Diskstream::Flag f = Recordable);
AudioDiskstream (Session &, const XMLNode&);
@@ -67,13 +67,13 @@ class AudioDiskstream : public Diskstream
if (n < c->size()) {
return (*c)[n]->source ? (*c)[n]->source->name() : "";
} else {
- return "";
+ return "";
}
}
- Port *input_source_port (uint32_t n=0) const {
+ Port *input_source_port (uint32_t n=0) const {
boost::shared_ptr<ChannelList> c = channels.reader();
- if (n < c->size()) return (*c)[n]->source; return 0;
+ if (n < c->size()) return (*c)[n]->source; return 0;
}
void set_record_enabled (bool yn);
@@ -81,7 +81,7 @@ class AudioDiskstream : public Diskstream
int set_non_layered (bool yn);
bool can_become_destructive (bool& requires_bounce) const;
- float peak_power(uint32_t n = 0) {
+ float peak_power(uint32_t n = 0) {
boost::shared_ptr<ChannelList> c = channels.reader();
ChannelInfo* chaninfo = (*c)[n];
float x = chaninfo->peak_power;
@@ -92,7 +92,7 @@ class AudioDiskstream : public Diskstream
return minus_infinity();
}
}
-
+
boost::shared_ptr<AudioPlaylist> audio_playlist () { return boost::dynamic_pointer_cast<AudioPlaylist>(_playlist); }
int use_playlist (boost::shared_ptr<Playlist>);
@@ -105,7 +105,7 @@ class AudioDiskstream : public Diskstream
return (*c)[n]->current_playback_buffer;
return 0;
}
-
+
Sample *capture_buffer (uint32_t n = 0) {
boost::shared_ptr<ChannelList> c = channels.reader();
if (n < c->size())
@@ -122,7 +122,7 @@ class AudioDiskstream : public Diskstream
int add_channel (uint32_t how_many);
int remove_channel (uint32_t how_many);
-
+
/* stateful */
XMLNode& get_state(void);
@@ -145,11 +145,11 @@ class AudioDiskstream : public Diskstream
*last-- = tmp;
}
}
-
+
CubicInterpolation interpolation;
XMLNode* deprecated_io_node;
-
+
protected:
friend class Session;
@@ -181,53 +181,52 @@ class AudioDiskstream : public Diskstream
private:
struct ChannelInfo {
-
- ChannelInfo (nframes_t buffer_size, nframes_t speed_buffer_size, nframes_t wrap_buffer_size);
- ~ChannelInfo ();
-
- Sample *playback_wrap_buffer;
- Sample *capture_wrap_buffer;
- Sample *speed_buffer;
-
- float peak_power;
-
- boost::shared_ptr<AudioFileSource> fades_source;
- boost::shared_ptr<AudioFileSource> write_source;
-
- /// the Port that our audio data comes from
- Port *source;
- Sample *current_capture_buffer;
- Sample *current_playback_buffer;
-
- RingBufferNPT<Sample> *playback_buf;
- RingBufferNPT<Sample> *capture_buf;
-
- Sample* scrub_buffer;
- Sample* scrub_forward_buffer;
- Sample* scrub_reverse_buffer;
-
- RingBufferNPT<Sample>::rw_vector playback_vector;
- RingBufferNPT<Sample>::rw_vector capture_vector;
-
- RingBufferNPT<CaptureTransition> * capture_transition_buf;
- // the following are used in the butler thread only
- nframes_t curr_capture_cnt;
+
+ ChannelInfo (nframes_t buffer_size, nframes_t speed_buffer_size, nframes_t wrap_buffer_size);
+ ~ChannelInfo ();
+
+ Sample *playback_wrap_buffer;
+ Sample *capture_wrap_buffer;
+ Sample *speed_buffer;
+
+ float peak_power;
+
+ boost::shared_ptr<AudioFileSource> fades_source;
+ boost::shared_ptr<AudioFileSource> write_source;
+
+ /// the Port that our audio data comes from
+ Port *source;
+ Sample *current_capture_buffer;
+ Sample *current_playback_buffer;
+
+ RingBufferNPT<Sample> *playback_buf;
+ RingBufferNPT<Sample> *capture_buf;
+
+ Sample* scrub_buffer;
+ Sample* scrub_forward_buffer;
+ Sample* scrub_reverse_buffer;
+
+ RingBufferNPT<Sample>::rw_vector playback_vector;
+ RingBufferNPT<Sample>::rw_vector capture_vector;
+
+ RingBufferNPT<CaptureTransition> * capture_transition_buf;
+ // the following are used in the butler thread only
+ nframes_t curr_capture_cnt;
};
typedef std::vector<ChannelInfo*> ChannelList;
void process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c);
-
+
/* The two central butler operations */
int do_flush (RunContext context, bool force = false);
int do_refill () { return _do_refill(_mixdown_buffer, _gain_buffer); }
-
+
int do_refill_with_alloc ();
int read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
- nframes_t& start, nframes_t cnt,
- ChannelInfo* channel_info, int channel, bool reversed);
-
+ nframes_t& start, nframes_t cnt,
+ ChannelInfo* channel_info, int channel, bool reversed);
void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>);
void transport_stopped (struct tm&, time_t, bool abort);
@@ -237,7 +236,7 @@ class AudioDiskstream : public Diskstream
void init_channel (ChannelInfo &chan);
void destroy_channel (ChannelInfo &chan);
-
+
int use_new_write_source (uint32_t n=0);
int find_and_use_playlist (const std::string &);
@@ -264,9 +263,9 @@ class AudioDiskstream : public Diskstream
static gain_t* _gain_buffer;
std::vector<boost::shared_ptr<AudioFileSource> > capturing_sources;
-
+
SerializedRCUManager<ChannelList> channels;
-
+
/* really */
private:
int _do_refill (Sample *mixdown_buffer, float *gain_buffer);
diff --git a/libs/ardour/ardour/audio_library.h b/libs/ardour/ardour/audio_library.h
index ed18ae9cbf..aada317dbd 100644
--- a/libs/ardour/ardour/audio_library.h
+++ b/libs/ardour/ardour/audio_library.h
@@ -38,7 +38,7 @@ class AudioLibrary
void search_members_and (std::vector<std::string>& results, const std::vector<std::string> tags);
void save_changes();
-
+
private:
std::string src;
};
diff --git a/libs/ardour/ardour/audio_playlist_importer.h b/libs/ardour/ardour/audio_playlist_importer.h
index 5ae87cea01..5ab8ae9b26 100644
--- a/libs/ardour/ardour/audio_playlist_importer.h
+++ b/libs/ardour/ardour/audio_playlist_importer.h
@@ -49,12 +49,12 @@ class AudioPlaylistImportHandler : public ElementImportHandler
AudioPlaylistImportHandler (XMLTree const & source, Session & session, AudioRegionImportHandler & region_handler, const char * nodename = "Playlists");
virtual ~AudioPlaylistImportHandler () {}
virtual std::string get_info () const;
-
+
void get_regions (XMLNode const & node, ElementList & list) const;
void update_region_id (XMLProperty* id_prop);
void playlists_by_diskstream (PBD::ID const & id, PlaylistList & list) const;
-
+
protected:
AudioRegionImportHandler & region_handler;
};
@@ -75,7 +75,7 @@ class AudioPlaylistImporter : public ElementImporter
~AudioPlaylistImporter ();
std::string get_info () const;
-
+
void set_diskstream (PBD::ID const & id);
PBD::ID const & orig_diskstream () const { return orig_diskstream_id; }
diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h
index 09bd8bdd1e..0c08795819 100644
--- a/libs/ardour/ardour/audio_port.h
+++ b/libs/ardour/ardour/audio_port.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2009 Paul Davis
+ Copyright (C) 2002-2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,37 +26,37 @@
namespace ARDOUR {
-class AudioPort : public Port
+class AudioPort : public Port
{
public:
~AudioPort ();
-
+
DataType type () const {
return DataType::AUDIO;
}
-
+
void cycle_start (nframes_t);
void cycle_end (nframes_t);
void cycle_split ();
-
+
size_t raw_buffer_size(jack_nframes_t nframes) const;
Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) {
return get_audio_buffer (nframes, offset);
}
-
+
AudioBuffer& get_audio_buffer (nframes_t nframes, nframes_t offset = 0);
protected:
friend class AudioEngine;
AudioPort (std::string const &, Flags);
-
+
private:
AudioBuffer* _buffer;
};
-
+
} // namespace ARDOUR
#endif /* __ardour_audio_port_h__ */
diff --git a/libs/ardour/ardour/audio_region_importer.h b/libs/ardour/ardour/audio_region_importer.h
index 71e8718ce8..d6d5c192d9 100644
--- a/libs/ardour/ardour/audio_region_importer.h
+++ b/libs/ardour/ardour/audio_region_importer.h
@@ -44,9 +44,9 @@ class AudioRegionImportHandler : public ElementImportHandler
// Inerface implementation
AudioRegionImportHandler (XMLTree const & source, Session & session);
std::string get_info () const;
-
+
void create_regions_from_children (XMLNode const & node, ElementList & list);
-
+
// Source management
bool check_source (std::string const & filename) const;
void add_source (std::string const & filename, boost::shared_ptr<Source> const & source);
@@ -77,7 +77,7 @@ class AudioRegionImporter : public ElementImporter
// Interface implementation
std::string get_info () const;
Session::ImportStatus * get_import_status () { return &status; }
-
+
// other stuff
void add_sources_to_session ();
XMLNode const & get_xml ();
@@ -95,11 +95,11 @@ class AudioRegionImporter : public ElementImporter
PBD::ID id;
std::list<std::string> filenames;
Session::ImportStatus status;
-
+
bool parse_xml_region ();
bool parse_source_xml ();
PBD::sys::path get_sound_dir (XMLTree const & tree);
-
+
void prepare_region ();
void prepare_sources ();
std::vector<boost::shared_ptr<Region> > region;
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h
index 5813c2d697..bdbc4b8165 100644
--- a/libs/ardour/ardour/audio_track.h
+++ b/libs/ardour/ardour/audio_track.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2006 Paul Davis
+ Copyright (C) 2002-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,17 +36,17 @@ class AudioTrack : public Track
AudioTrack (Session&, const XMLNode&);
~AudioTrack ();
- int set_mode (TrackMode m);
+ int set_mode (TrackMode m);
bool can_use_mode (TrackMode m, bool& bounce_required);
- int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- int declick, bool can_record, bool rec_monitors_input);
+ int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ int declick, bool can_record, bool rec_monitors_input);
boost::shared_ptr<AudioDiskstream> audio_diskstream() const;
int use_diskstream (std::string name);
int use_diskstream (const PBD::ID& id);
-
+
int export_stuff (BufferSet& bufs, sframes_t start_frame, nframes_t nframes, bool enable_processing = true);
void freeze (InterThreadInfo&);
@@ -59,7 +59,7 @@ class AudioTrack : public Track
protected:
XMLNode& state (bool full);
-
+
int _set_state (const XMLNode&, bool call_base);
private:
diff --git a/libs/ardour/ardour/audio_track_importer.h b/libs/ardour/ardour/audio_track_importer.h
index 59b5b520ac..683417de24 100644
--- a/libs/ardour/ardour/audio_track_importer.h
+++ b/libs/ardour/ardour/audio_track_importer.h
@@ -70,18 +70,18 @@ class AudioTrackImporter : public ElementImporter
bool parse_route_xml ();
bool parse_io ();
-
+
bool parse_processor (XMLNode & node);
bool parse_controllable (XMLNode & node);
bool parse_automation (XMLNode & node);
bool rate_convert_events (XMLNode & node);
-
+
AudioTrackImportHandler & track_handler;
XMLNode xml_track;
-
+
PBD::ID old_ds_id;
PBD::ID new_ds_id;
-
+
PlaylistList playlists;
AudioPlaylistImportHandler & pl_handler;
};
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h
index 83d85ec5d0..a1f22a88df 100644
--- a/libs/ardour/ardour/audio_unit.h
+++ b/libs/ardour/ardour/audio_unit.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Written by Taybin Rutkin
This program is free software; you can redistribute it and/or modify
@@ -64,7 +64,7 @@ class AUPlugin : public ARDOUR::Plugin
AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> comp);
AUPlugin (const AUPlugin& other);
virtual ~AUPlugin ();
-
+
std::string unique_id () const;
const char * label () const;
const char * name () const { return _info->name.c_str(); }
@@ -74,34 +74,34 @@ class AUPlugin : public ARDOUR::Plugin
nframes_t latency () const;
void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const;
-
+
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
uint32_t nth_parameter (uint32_t which, bool& ok) const;
void activate ();
void deactivate ();
void set_block_size (nframes_t nframes);
-
+
int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
std::set<uint32_t> automatable() const;
string describe_parameter (uint32_t);
string state_node_name () const { return "audiounit"; }
void print_parameter (uint32_t, char*, uint32_t len) const;
-
+
bool parameter_is_audio (uint32_t) const;
bool parameter_is_control (uint32_t) const;
bool parameter_is_input (uint32_t) const;
bool parameter_is_output (uint32_t) const;
-
+
XMLNode& get_state();
int set_state(const XMLNode& node);
-
+
bool save_preset (string name);
bool load_preset (const string preset_label);
std::vector<std::string> get_presets ();
std::string current_preset() const;
bool has_editor () const;
-
+
int32_t can_do (int32_t in, int32_t& out);
uint32_t output_streams() const;
uint32_t input_streams() const;
@@ -109,17 +109,17 @@ class AUPlugin : public ARDOUR::Plugin
boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
boost::shared_ptr<CAComponent> get_comp () const { return comp; }
-
- OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- UInt32 inNumberFrames,
- AudioBufferList* ioData);
+
+ OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList* ioData);
private:
- boost::shared_ptr<CAComponent> comp;
- boost::shared_ptr<CAAudioUnit> unit;
-
- bool initialized;
+ boost::shared_ptr<CAComponent> comp;
+ boost::shared_ptr<CAAudioUnit> unit;
+
+ bool initialized;
int32_t input_channels;
int32_t output_channels;
std::vector<std::pair<int,int> > io_configs;
@@ -133,7 +133,7 @@ class AUPlugin : public ARDOUR::Plugin
UInt32 global_elements;
UInt32 output_elements;
UInt32 input_elements;
-
+
int set_output_format (AudioStreamBasicDescription&);
int set_input_format (AudioStreamBasicDescription&);
int set_stream_format (int scope, uint32_t cnt, AudioStreamBasicDescription&);
@@ -142,24 +142,24 @@ class AUPlugin : public ARDOUR::Plugin
std::vector<std::pair<uint32_t, uint32_t> > parameter_map;
uint32_t current_maxbuf;
- nframes_t current_offset;
- nframes_t cb_offset;
- vector<Sample*>* current_buffers;
- nframes_t frames_processed;
-
+ nframes_t current_offset;
+ nframes_t cb_offset;
+ vector<Sample*>* current_buffers;
+ nframes_t frames_processed;
+
std::vector<AUParameterDescriptor> descriptors;
void init ();
};
-
+
typedef boost::shared_ptr<AUPlugin> AUPluginPtr;
-struct AUPluginCachedInfo {
+struct AUPluginCachedInfo {
std::vector<std::pair<int,int> > io_configs;
};
class AUPluginInfo : public PluginInfo {
- public:
- AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
+ public:
+ AUPluginInfo (boost::shared_ptr<CAComponentDescription>);
~AUPluginInfo ();
PluginPtr load (Session& session);
@@ -175,7 +175,7 @@ class AUPluginInfo : public PluginInfo {
private:
boost::shared_ptr<CAComponentDescription> descriptor;
UInt32 version;
-
+
static void discover_music (PluginInfoList&);
static void discover_fx (PluginInfoList&);
static void discover_generators (PluginInfoList&);
@@ -184,7 +184,7 @@ class AUPluginInfo : public PluginInfo {
typedef std::map<std::string,AUPluginCachedInfo> CachedInfoMap;
static CachedInfoMap cached_info;
-
+
static bool cached_io_configuration (const std::string&, UInt32, CAComponent&, AUPluginCachedInfo&, const std::string& name);
static void add_cached_info (const std::string&, AUPluginCachedInfo&);
static void save_cached_info ();
diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h
index 824e63d312..627dc3f137 100644
--- a/libs/ardour/ardour/audioanalyser.h
+++ b/libs/ardour/ardour/audioanalyser.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ class AudioAnalyser : public boost::noncopyable {
AudioAnalyser (float sample_rate, AnalysisPluginKey key);
virtual ~AudioAnalyser();
-
+
/* analysis object should provide a run method
that accepts a path to write the results to (optionally empty)
a Readable* to read data from
@@ -58,7 +58,7 @@ class AudioAnalyser : public boost::noncopyable {
nframes64_t bufsize;
nframes64_t stepsize;
-
+
int initialize_plugin (AnalysisPluginKey name, float sample_rate);
int analyse (const std::string& path, Readable*, uint32_t channel);
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index f0bd7cdb3d..9d3bfdb719 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2004 Paul Davis
+ Copyright (C) 2002-2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ class AudioEngine : public sigc::trackable
AudioEngine (std::string client_name);
virtual ~AudioEngine ();
-
+
jack_client_t* jack() const;
bool connected() const { return _jack != 0; }
@@ -94,12 +94,12 @@ class AudioEngine : public sigc::trackable
if (!_running || !_jack) return 0;
return jack_get_current_transport_frame (_jack);
}
-
+
int request_buffer_size (nframes_t);
-
+
nframes_t set_monitor_check_interval (nframes_t);
- float get_cpu_load() {
+ float get_cpu_load() {
if (!_running || !_jack) return 0;
return jack_cpu_load (_jack);
}
@@ -108,18 +108,18 @@ class AudioEngine : public sigc::trackable
void remove_session ();
class PortRegistrationFailure : public std::exception {
- public:
+ public:
PortRegistrationFailure (const char* why = "") {
reason = why;
}
virtual const char *what() const throw() { return reason; }
- private:
+ private:
const char* reason;
};
class NoBackendAvailable : public std::exception {
- public:
+ public:
virtual const char *what() const throw() { return "could not connect to engine backend"; }
};
@@ -128,11 +128,11 @@ class AudioEngine : public sigc::trackable
int unregister_port (Port &);
void split_cycle (nframes_t offset);
-
+
int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination);
int disconnect (Port &);
-
+
const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);
bool can_request_hardware_monitoring ();
@@ -204,7 +204,7 @@ class AudioEngine : public sigc::trackable
sigc::signal<void> Stopped;
/* this signal is emitted if a JACK port is registered or unregistered */
-
+
sigc::signal<void> PortRegisteredOrUnregistered;
std::string make_port_name_relative (std::string);
diff --git a/libs/ardour/ardour/audiofile_tagger.h b/libs/ardour/ardour/audiofile_tagger.h
index 9da84df561..0519e2233c 100644
--- a/libs/ardour/ardour/audiofile_tagger.h
+++ b/libs/ardour/ardour/audiofile_tagger.h
@@ -38,7 +38,7 @@ class AudiofileTagger
public:
/* Tags file with metadata, return true on success */
-
+
static bool tag_file (std::string const & filename, SessionMetadata const & metadata);
private:
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h
index b161bcada1..4da7943a2d 100644
--- a/libs/ardour/ardour/audiofilesource.h
+++ b/libs/ardour/ardour/audiofilesource.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
-#ifndef __ardour_audiofilesource_h__
+#ifndef __ardour_audiofilesource_h__
#define __ardour_audiofilesource_h__
#include <exception>
@@ -42,10 +42,10 @@ public:
bool set_name (const std::string& newname) {
return (set_source_name(newname, destructive()) == 0);
}
-
+
Glib::ustring peak_path (Glib::ustring audio_path);
Glib::ustring find_broken_peakfile (Glib::ustring missing_peak_path,
- Glib::ustring audio_path);
+ Glib::ustring audio_path);
static void set_peak_dir (Glib::ustring dir) { peak_dir = dir; }
@@ -75,12 +75,12 @@ public:
int set_state (const XMLNode&);
bool can_truncate_peaks() const { return !destructive(); }
- bool can_be_analysed() const { return _length > 0; }
-
+ bool can_be_analysed() const { return _length > 0; }
+
static bool safe_audio_file_extension (const Glib::ustring& path);
-
+
static bool is_empty (Session&, Glib::ustring path);
-
+
static void set_bwf_serial_number (int);
static void set_header_position_offset (nframes_t offset );
@@ -92,16 +92,16 @@ protected:
/** Constructor to be called for new in-session files */
AudioFileSource (Session&, const Glib::ustring& path, bool embedded, Source::Flag flags,
- SampleFormat samp_format, HeaderFormat hdr_format);
+ SampleFormat samp_format, HeaderFormat hdr_format);
/** Constructor to be called for existing in-session files */
AudioFileSource (Session&, const XMLNode&, bool must_exist = true);
int init (const Glib::ustring& idstr, bool must_exist);
-
+
virtual void set_header_timeline_position () = 0;
virtual void handle_header_position_change () {}
-
+
int move_dependents_to_trash();
static Sample* get_interleave_buffer (nframes_t size);
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 1d4118cf83..32fc77f2d6 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
+ Copyright (C) 2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ class AudioPlaylist : public ARDOUR::Playlist
{
public:
typedef std::list<boost::shared_ptr<Crossfade> > Crossfades;
-
+
public:
AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
AudioPlaylist (Session&, std::string name, bool hidden = false);
@@ -52,7 +52,7 @@ class AudioPlaylist : public ARDOUR::Playlist
int set_state (const XMLNode&);
- sigc::signal<void,boost::shared_ptr<Crossfade> > NewCrossfade;
+ sigc::signal<void,boost::shared_ptr<Crossfade> > NewCrossfade;
void foreach_crossfade (sigc::slot<void, boost::shared_ptr<Crossfade> >);
void crossfades_at (nframes_t frame, Crossfades&);
@@ -66,7 +66,7 @@ class AudioPlaylist : public ARDOUR::Playlist
void flush_notifications ();
void finalize_split_region (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
-
+
void refresh_dependents (boost::shared_ptr<Region> region);
void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
void remove_dependents (boost::shared_ptr<Region> region);
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index cda9cab878..ff718bb4b0 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -65,7 +65,7 @@ class AudioRegion : public Region
void set_scale_amplitude (gain_t);
gain_t scale_amplitude() const { return _scale_amplitude; }
-
+
void normalize_to (float target_in_dB = 0.0f);
bool envelope_active () const { return _flags & Region::EnvelopeActive; }
@@ -77,9 +77,9 @@ class AudioRegion : public Region
boost::shared_ptr<AutomationList> envelope() { return _envelope; }
virtual nframes_t read_peaks (PeakData *buf, nframes_t npeaks,
- nframes_t offset, nframes_t cnt,
- uint32_t chan_n=0, double samples_per_unit= 1.0) const;
-
+ nframes_t offset, nframes_t cnt,
+ uint32_t chan_n=0, double samples_per_unit= 1.0) const;
+
/* Readable interface */
enum ReadOps {
@@ -89,7 +89,7 @@ class AudioRegion : public Region
ReadOpsCount = 0x4,
ReadOpsFades = 0x8
};
-
+
virtual nframes_t read (Sample*, sframes_t pos, nframes_t cnt, int channel) const;
virtual nframes_t read_with_ops (Sample*, sframes_t pos, nframes_t cnt, int channel, ReadOps rops) const;
virtual nframes64_t readable_length() const { return length(); }
@@ -100,10 +100,10 @@ class AudioRegion : public Region
uint32_t chan_n = 0,
nframes_t read_frames = 0,
nframes_t skip_frames = 0) const;
-
+
virtual nframes_t master_read_at (Sample *buf, Sample *mixdown_buf, float *gain_buf,
sframes_t position, nframes_t cnt, uint32_t chan_n=0) const;
-
+
virtual nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int channel) const;
XMLNode& state (bool);
@@ -135,9 +135,9 @@ class AudioRegion : public Region
void set_default_envelope ();
int separate_by_channel (ARDOUR::Session&, std::vector<boost::shared_ptr<Region> >&) const;
-
+
/* automation */
-
+
boost::shared_ptr<Evoral::Control>
control(const Evoral::Parameter& id, bool create=false) {
return _automatable.data().control(id, create);
@@ -185,12 +185,12 @@ class AudioRegion : public Region
void recompute_gain_at_start ();
nframes_t _read_at (const SourceList&, nframes_t limit,
- Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
- sframes_t position, nframes_t cnt,
- uint32_t chan_n = 0,
- nframes_t read_frames = 0,
- nframes_t skip_frames = 0,
- ReadOps readops = ReadOps (~0)) const;
+ Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
+ sframes_t position, nframes_t cnt,
+ uint32_t chan_n = 0,
+ nframes_t read_frames = 0,
+ nframes_t skip_frames = 0,
+ ReadOps readops = ReadOps (~0)) const;
void recompute_at_start ();
void recompute_at_end ();
@@ -217,7 +217,7 @@ class AudioRegion : public Region
protected:
/* default constructor for derived (compound) types */
- AudioRegion (Session& s, nframes_t, nframes_t, std::string name);
+ AudioRegion (Session& s, nframes_t, nframes_t, std::string name);
int set_live_state (const XMLNode&, Change&, bool send);
};
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index d097025e52..bc06642c33 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
#include "ardour/source.h"
#include "ardour/ardour.h"
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "pbd/xml++.h"
namespace ARDOUR {
@@ -48,7 +48,7 @@ class AudioSource : virtual public Source,
nframes64_t readable_length() const { return _length; }
uint32_t n_channels() const { return 1; }
-
+
sframes_t length (sframes_t pos) const;
void update_length (sframes_t pos, sframes_t cnt);
@@ -69,15 +69,15 @@ class AudioSource : virtual public Source,
uint32_t read_data_count() const { return _read_data_count; }
uint32_t write_data_count() const { return _write_data_count; }
- int read_peaks (PeakData *peaks, nframes_t npeaks,
+ int read_peaks (PeakData *peaks, nframes_t npeaks,
sframes_t start, nframes_t cnt, double samples_per_visual_peak) const;
- int build_peaks ();
+ int build_peaks ();
bool peaks_ready (sigc::slot<void>, sigc::connection&) const;
mutable sigc::signal<void> PeaksReady;
mutable sigc::signal<void,nframes_t,nframes_t> PeakRangeReady;
-
+
XMLNode& get_state ();
int set_state (const XMLNode&);
@@ -117,7 +117,7 @@ class AudioSource : virtual public Source,
int initialize_peakfile (bool newfile, Glib::ustring path);
int build_peaks_from_scratch ();
int compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframes_t cnt,
- bool force, bool intermediate_peaks_ready_signal);
+ bool force, bool intermediate_peaks_ready_signal);
void truncate_peakfile();
mutable off_t _peak_byte_max; // modified in compute_and_write_peak()
@@ -127,13 +127,13 @@ class AudioSource : virtual public Source,
virtual Glib::ustring peak_path(Glib::ustring audio_path) = 0;
virtual Glib::ustring find_broken_peakfile (Glib::ustring missing_peak_path,
Glib::ustring audio_path) = 0;
-
- virtual int read_peaks_with_fpp (PeakData *peaks,
- nframes_t npeaks, sframes_t start, nframes_t cnt,
- double samples_per_visual_peak, nframes_t fpp) const;
+
+ virtual int read_peaks_with_fpp (PeakData *peaks,
+ nframes_t npeaks, sframes_t start, nframes_t cnt,
+ double samples_per_visual_peak, nframes_t fpp) const;
int compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframes_t cnt,
- bool force, bool intermediate_peaks_ready_signal, nframes_t frames_per_peak);
+ bool force, bool intermediate_peaks_ready_signal, nframes_t frames_per_peak);
private:
int peakfile;
diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h
index 6114da0552..aa525b68c9 100644
--- a/libs/ardour/ardour/auditioner.h
+++ b/libs/ardour/ardour/auditioner.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ class Auditioner : public AudioTrack
int play_audition (nframes_t nframes);
- void cancel_audition () {
+ void cancel_audition () {
g_atomic_int_set (&_active, 0);
}
@@ -63,7 +63,7 @@ class Auditioner : public AudioTrack
static void *_drop_ports (void *);
void actually_drop_ports ();
void output_changed (IOChange, void*);
-};
+};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/auto_bundle.h b/libs/ardour/ardour/auto_bundle.h
index e3899069de..b41a5d344f 100644
--- a/libs/ardour/ardour/auto_bundle.h
+++ b/libs/ardour/ardour/auto_bundle.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,6 +41,6 @@ class AutoBundle : public Bundle {
private:
};
-}
-
+}
+
#endif /* __ardour_auto_bundle_h__ */
diff --git a/libs/ardour/ardour/automatable.h b/libs/ardour/ardour/automatable.h
index 7fac339f77..90250abf52 100644
--- a/libs/ardour/ardour/automatable.h
+++ b/libs/ardour/ardour/automatable.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,20 +51,20 @@ public:
boost::shared_ptr<AutomationControl>
automation_control (const Evoral::Parameter& id, bool create_if_missing=false);
-
+
boost::shared_ptr<const AutomationControl>
automation_control (const Evoral::Parameter& id) const;
virtual void add_control(boost::shared_ptr<Evoral::Control>);
-
+
virtual void automation_snapshot(nframes_t now, bool force);
virtual void transport_stopped (sframes_t now);
virtual std::string describe_parameter(Evoral::Parameter param);
-
+
AutoState get_parameter_automation_state (Evoral::Parameter param, bool lock = true);
virtual void set_parameter_automation_state (Evoral::Parameter param, AutoState);
-
+
AutoStyle get_parameter_automation_style (Evoral::Parameter param);
void set_parameter_automation_style (Evoral::Parameter param, AutoStyle);
@@ -74,22 +74,22 @@ public:
const std::set<Evoral::Parameter>& what_can_be_automated() const { return _can_automate_list; }
void mark_automation_visible(Evoral::Parameter, bool);
-
+
inline bool should_snapshot (nframes_t now) {
return (_last_automation_snapshot > now
|| (now - _last_automation_snapshot) > _automation_interval);
}
-
+
static void set_automation_interval (jack_nframes_t frames) {
_automation_interval = frames;
}
- static jack_nframes_t automation_interval() {
+ static jack_nframes_t automation_interval() {
return _automation_interval;
}
-
+
typedef Evoral::ControlSet::Controls Controls;
-
+
Evoral::ControlSet& data() { return *this; }
const Evoral::ControlSet& data() const { return *this; }
@@ -102,13 +102,13 @@ public:
void can_automate(Evoral::Parameter);
virtual void auto_state_changed (Evoral::Parameter /*which*/) {}
-
+
int load_automation (const std::string& path);
int old_set_automation_state(const XMLNode&);
std::set<Evoral::Parameter> _visible_controls;
std::set<Evoral::Parameter> _can_automate_list;
-
+
nframes_t _last_automation_snapshot;
static nframes_t _automation_interval;
};
diff --git a/libs/ardour/ardour/automatable_controls.h b/libs/ardour/ardour/automatable_controls.h
index 38df144694..9dd0988cf7 100644
--- a/libs/ardour/ardour/automatable_controls.h
+++ b/libs/ardour/ardour/automatable_controls.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/automatable_sequence.h b/libs/ardour/ardour/automatable_sequence.h
index 23ebb161c8..88e1733c1b 100644
--- a/libs/ardour/ardour/automatable_sequence.h
+++ b/libs/ardour/ardour/automatable_sequence.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h
index f9b21b932c..15bac5fef8 100644
--- a/libs/ardour/ardour/automation_control.h
+++ b/libs/ardour/ardour/automation_control.h
@@ -38,10 +38,10 @@ class AutomationControl : public PBD::Controllable, public Evoral::Control
{
public:
AutomationControl(ARDOUR::Session&,
- const Evoral::Parameter& parameter,
- boost::shared_ptr<ARDOUR::AutomationList> l=boost::shared_ptr<ARDOUR::AutomationList>(),
- const std::string& name="");
-
+ const Evoral::Parameter& parameter,
+ boost::shared_ptr<ARDOUR::AutomationList> l=boost::shared_ptr<ARDOUR::AutomationList>(),
+ const std::string& name="");
+
boost::shared_ptr<AutomationList> alist() const {
return boost::dynamic_pointer_cast<AutomationList>(_list);
}
@@ -51,24 +51,24 @@ public:
inline bool automation_playback() const {
return ((ARDOUR::AutomationList*)_list.get())->automation_playback();
}
-
+
inline bool automation_write() const {
return ((ARDOUR::AutomationList*)_list.get())->automation_write();
}
-
+
inline AutoState automation_state() const {
return ((ARDOUR::AutomationList*)_list.get())->automation_state();
}
-
+
inline void set_automation_state(AutoState as) {
return ((ARDOUR::AutomationList*)_list.get())->set_automation_state(as);
}
-
+
inline void start_touch() {
set_touching (true);
return ((ARDOUR::AutomationList*)_list.get())->start_touch();
}
-
+
inline void stop_touch() {
set_touching (false);
return ((ARDOUR::AutomationList*)_list.get())->stop_touch();
diff --git a/libs/ardour/ardour/automation_list.h b/libs/ardour/ardour/automation_list.h
index 7d34fe72b9..9b899e8cd1 100644
--- a/libs/ardour/ardour/automation_list.h
+++ b/libs/ardour/ardour/automation_list.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
#include "pbd/undo.h"
#include "pbd/xml++.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "ardour/ardour.h"
@@ -50,7 +50,7 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
AutomationList& operator= (const AutomationList&);
bool operator== (const AutomationList&);
-
+
void freeze();
void thaw ();
void mark_dirty () const;
@@ -69,9 +69,9 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
bool automation_write () const {
return (_state & Write) || ((_state & Touch) && _touching);
}
-
+
sigc::signal<void> StateChanged;
-
+
static sigc::signal<void, AutomationList*> AutomationListCreated;
mutable sigc::signal<void> Dirty;
@@ -79,7 +79,7 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
void stop_touch ();
bool touching() const { return _touching; }
- XMLNode& get_state(void);
+ XMLNode& get_state(void);
int set_state (const XMLNode &s);
XMLNode& state (bool full);
XMLNode& serialize_events ();
@@ -87,9 +87,9 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
private:
void create_curve_if_necessary ();
int deserialize_events (const XMLNode&);
-
+
void maybe_signal_changed ();
-
+
AutoState _state;
AutoStyle _style;
bool _touching;
diff --git a/libs/ardour/ardour/beats_frames_converter.h b/libs/ardour/ardour/beats_frames_converter.h
index 381ea6c3d8..7134ea2fe9 100644
--- a/libs/ardour/ardour/beats_frames_converter.h
+++ b/libs/ardour/ardour/beats_frames_converter.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@ public:
: _session(session)
, _origin(origin)
{}
-
+
sframes_t to(double beats) const;
double from(sframes_t frames) const;
diff --git a/libs/ardour/ardour/broadcast_info.h b/libs/ardour/ardour/broadcast_info.h
index 39ea96c590..522d7e7361 100644
--- a/libs/ardour/ardour/broadcast_info.h
+++ b/libs/ardour/ardour/broadcast_info.h
@@ -40,38 +40,38 @@ class BroadcastInfo
/// Construct empty broadcast info
BroadcastInfo ();
~BroadcastInfo ();
-
+
/// Returns last error sring from libsndfile
std::string get_error () const { return error; }
-
+
/* Convenience functions */
-
+
void set_from_session (Session const & session, int64_t time_ref);
-
+
/* Reading */
-
+
bool load_from_file (std::string const & filename);
bool load_from_file (SNDFILE* sf);
-
+
std::string get_description () const;
int64_t get_time_reference () const;
struct tm get_origination_time () const;
std::string get_originator () const;
std::string get_originator_ref () const;
-
+
/* Writing */
-
+
bool write_to_file (std::string const & filename);
bool write_to_file (SNDFILE* sf);
-
+
void set_description (std::string const & desc);
void set_time_reference (int64_t when);
void set_origination_time (struct tm * now = 0); // if 0, use time generated at construction
void set_originator (std::string const & str = "");
void set_originator_ref (Session const &, std::string const & str = "");
-
+
/* State info */
-
+
/// Returns true if a info has been succesfully loaded or anything has been manually set
bool has_info () const { return _has_info; }
@@ -79,10 +79,10 @@ class BroadcastInfo
SF_BROADCAST_INFO * info;
struct tm _time;
-
+
void update_error ();
std::string error;
-
+
bool _has_info;
};
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h
index 8ed054923b..46a6d62667 100644
--- a/libs/ardour/ardour/buffer.h
+++ b/libs/ardour/ardour/buffer.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -38,7 +38,7 @@ namespace ARDOUR {
* methods to actually access the data). This provides a way for code that
* doesn't care about the data type to still deal with buffers (which is
* why the base class can't be a template).
- *
+ *
* To actually read/write buffer contents, use the appropriate derived class.
*/
class Buffer : public boost::noncopyable
@@ -61,20 +61,20 @@ public:
DataType type() const { return _type; }
bool silent() const { return _silent; }
-
+
/** Reallocate the buffer used internally to handle at least @a size_t units of data.
*
* The buffer is not silent after this operation. the @a capacity argument
* passed to the constructor must have been non-zero.
*/
virtual void resize (size_t) = 0;
-
+
/** Clear (eg zero, or empty) buffer */
virtual void silence (nframes_t len, nframes_t offset = 0) = 0;
-
+
/** Clear the entire buffer */
virtual void clear() { silence(_capacity, 0); }
-
+
virtual void read_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0;
virtual void merge_from (const Buffer& src, nframes_t len, nframes_t dst_offset = 0, nframes_t src_offset = 0) = 0;
diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h
index 49c392ce6a..df842613cb 100644
--- a/libs/ardour/ardour/buffer_set.h
+++ b/libs/ardour/ardour/buffer_set.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -59,7 +59,7 @@ public:
~BufferSet();
void clear();
-
+
void attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset = 0);
/* the capacity here is a size_t and has a different interpretation depending
@@ -79,10 +79,10 @@ public:
void is_silent(bool yn) { _is_silent = yn; }
bool is_silent() const { return _is_silent; }
void silence (nframes_t nframes, nframes_t offset);
- bool is_mirror() const { return _is_mirror; }
+ bool is_mirror() const { return _is_mirror; }
void set_count(const ChanCount& count) { assert(count <= _available); _count = count; }
-
+
size_t buffer_capacity(DataType type) const;
Buffer& get(DataType type, size_t i);
@@ -90,7 +90,7 @@ public:
AudioBuffer& get_audio(size_t i) {
return (AudioBuffer&)get(DataType::AUDIO, i);
}
-
+
MidiBuffer& get_midi(size_t i) {
return (MidiBuffer&)get(DataType::MIDI, i);
}
@@ -110,7 +110,7 @@ public:
// ITERATORS
// FIXME: possible to combine these? templates?
-
+
class audio_iterator {
public:
AudioBuffer& operator*() { return _set.get_audio(_index); }
@@ -175,13 +175,13 @@ public:
iterator begin(DataType type) { return iterator(*this, type, 0); }
iterator end(DataType type) { return iterator(*this, type, _count.get(type)); }
-
+
private:
typedef std::vector<Buffer*> BufferVec;
/// Vector of vectors, indexed by DataType
std::vector<BufferVec> _buffers;
-
+
#ifdef HAVE_SLV2
/// LV2 MIDI buffers (for conversion to/from MIDI buffers)
typedef std::vector< std::pair<bool, LV2EventBuffer*> > LV2Buffers;
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h
index 98344e8406..0e80c5433d 100644
--- a/libs/ardour/ardour/bundle.h
+++ b/libs/ardour/ardour/bundle.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2007 Paul Davis
+ Copyright (C) 2002-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,8 +29,8 @@
namespace ARDOUR {
-class AudioEngine;
-
+class AudioEngine;
+
/** A set of `channels', each of which is associated with 0 or more ports.
* Each channel has a name which can be anything useful.
* Intended for grouping things like, for example, a buss' outputs.
@@ -52,7 +52,7 @@ class Bundle : public sigc::trackable
bool operator== (Channel const &o) const {
return name == o.name && ports == o.ports;
}
-
+
std::string name;
PortList ports;
};
@@ -61,7 +61,7 @@ class Bundle : public sigc::trackable
Bundle (std::string const &, bool i = true);
Bundle (std::string const &, DataType, bool i = true);
Bundle (boost::shared_ptr<Bundle>);
-
+
virtual ~Bundle() {}
/** @return Number of channels that this Bundle has */
@@ -127,7 +127,7 @@ class Bundle : public sigc::trackable
sigc::signal<void, Change> Changed;
protected:
-
+
/// mutex for _channel_ports and _channel_names
/// XXX: is this necessary?
mutable Glib::Mutex _channel_mutex;
@@ -137,7 +137,7 @@ class Bundle : public sigc::trackable
int set_channels (std::string const &);
int parse_io_string (std::string const &, std::vector<std::string> &);
void emit_changed (Change);
-
+
std::string _name;
DataType _type;
bool _ports_are_inputs;
@@ -151,14 +151,14 @@ class Bundle : public sigc::trackable
struct BundleChannel
{
BundleChannel () : channel (0) {}
-
+
BundleChannel (boost::shared_ptr<Bundle> b, uint32_t c)
: bundle (b), channel (c) {}
-
+
bool operator== (BundleChannel const& other) const {
return bundle == other.bundle && channel == other.channel;
}
-
+
bool operator!= (BundleChannel const& other) const {
return bundle != other.bundle || channel != other.channel;
}
@@ -166,7 +166,7 @@ struct BundleChannel
boost::shared_ptr<Bundle> bundle;
uint32_t channel;
};
-
+
}
#endif /* __ardour_bundle_h__ */
diff --git a/libs/ardour/ardour/caimportable.h b/libs/ardour/ardour/caimportable.h
index 2cc20d21b7..dbf93dbb73 100644
--- a/libs/ardour/ardour/caimportable.h
+++ b/libs/ardour/ardour/caimportable.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h
index ccae3920f6..3dc6423607 100644
--- a/libs/ardour/ardour/chan_count.h
+++ b/libs/ardour/ardour/chan_count.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@ class ChanCount {
public:
ChanCount(const XMLNode& node);
ChanCount() { reset(); }
-
+
// Convenience constructor for making single-typed streams (stereo, mono, etc)
ChanCount(DataType type, uint32_t channels) {
reset();
@@ -50,16 +50,16 @@ public:
_counts[*t] = 0;
}
}
-
+
void set(DataType t, uint32_t count) { assert(t != DataType::NIL); _counts[t] = count; }
uint32_t get(DataType t) const { assert(t != DataType::NIL); return _counts[t]; }
-
+
inline uint32_t n_audio() const { return _counts[DataType::AUDIO]; }
inline void set_audio(uint32_t a) { _counts[DataType::AUDIO] = a; }
-
+
inline uint32_t n_midi() const { return _counts[DataType::MIDI]; }
inline void set_midi(uint32_t m) { _counts[DataType::MIDI] = m; }
-
+
uint32_t n_total() const {
uint32_t ret = 0;
for (uint32_t i=0; i < DataType::num_types; ++i)
@@ -75,7 +75,7 @@ public:
return true;
}
-
+
bool operator!=(const ChanCount& other) const {
return ! (*this == other);
}
@@ -92,7 +92,7 @@ public:
bool operator<=(const ChanCount& other) const {
return ( (*this < other) || (*this == other) );
}
-
+
bool operator>(const ChanCount& other) const {
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
if (_counts[*t] < other._counts[*t]) {
@@ -105,7 +105,7 @@ public:
bool operator>=(const ChanCount& other) const {
return ( (*this > other) || (*this == other) );
}
-
+
ChanCount operator+(const ChanCount& other) const {
ChanCount ret;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
@@ -113,7 +113,7 @@ public:
}
return ret;
}
-
+
static ChanCount min(const ChanCount& a, const ChanCount& b) {
ChanCount ret;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
@@ -121,7 +121,7 @@ public:
}
return ret;
}
-
+
static ChanCount max(const ChanCount& a, const ChanCount& b) {
ChanCount ret;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
@@ -129,7 +129,7 @@ public:
}
return ret;
}
-
+
XMLNode* state(const std::string& name) const;
static const ChanCount INFINITE;
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h
index 5f948a77b0..a08ff011af 100644
--- a/libs/ardour/ardour/chan_mapping.h
+++ b/libs/ardour/ardour/chan_mapping.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -38,15 +38,15 @@ class ChanMapping {
public:
ChanMapping() {}
ChanMapping(ARDOUR::ChanCount identity);
-
+
uint32_t get(DataType t, uint32_t from);
void set(DataType t, uint32_t from, uint32_t to);
void offset_from(DataType t, int32_t delta);
void offset_to(DataType t, int32_t delta);
-
+
typedef std::map<uint32_t, uint32_t> TypeMapping;
typedef std::map<DataType, TypeMapping> Mappings;
-
+
Mappings mappings() { return _mappings; }
const Mappings mappings() const { return _mappings; }
diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h
index 2f174ab472..50efe7ce46 100644
--- a/libs/ardour/ardour/click.h
+++ b/libs/ardour/ardour/click.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index e655cfde0e..d00cadb179 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/configuration_variable.h b/libs/ardour/ardour/configuration_variable.h
index 6282da2c54..90859b72b1 100644
--- a/libs/ardour/ardour/configuration_variable.h
+++ b/libs/ardour/ardour/configuration_variable.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,12 +37,12 @@ class ConfigVariableBase {
std::string name () const { return _name; }
void add_to_node (XMLNode&);
bool set_from_node (XMLNode const &);
-
+
virtual std::string get_as_string () const = 0;
virtual void set_from_string (std::string const &) = 0;
void show_stored_value (const std::string&);
-
+
static void set_show_stored_values (bool);
protected:
@@ -96,14 +96,14 @@ template<class T>
class ConfigVariableWithMutation : public ConfigVariable<T>
{
public:
- ConfigVariableWithMutation (std::string name, T val, T (*m)(T))
+ ConfigVariableWithMutation (std::string name, T val, T (*m)(T))
: ConfigVariable<T> (name, val), mutator (m) {}
bool set (T val) {
if (unmutated_value != val) {
unmutated_value = val;
return ConfigVariable<T>::set (mutator (val));
- }
+ }
return false;
}
diff --git a/libs/ardour/ardour/control_outputs.h b/libs/ardour/ardour/control_outputs.h
index 0a09ab10f4..069a000139 100644
--- a/libs/ardour/ardour/control_outputs.h
+++ b/libs/ardour/ardour/control_outputs.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -26,7 +26,7 @@
namespace ARDOUR {
-/* this exists for one reason only: so that it can override the "type"
+/* this exists for one reason only: so that it can override the "type"
property in the state of the Delivery processor. we need this
because ControlOutputs are "unique" because they deliver to
an IO object that is private to a Route and so cannot be looked
diff --git a/libs/ardour/ardour/control_protocol_manager.h b/libs/ardour/ardour/control_protocol_manager.h
index f315744e50..bceece9adf 100644
--- a/libs/ardour/ardour/control_protocol_manager.h
+++ b/libs/ardour/ardour/control_protocol_manager.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include <glibmm/thread.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
namespace ARDOUR {
diff --git a/libs/ardour/ardour/control_protocol_search_path.h b/libs/ardour/ardour/control_protocol_search_path.h
index 69b13c493e..8795f4501a 100644
--- a/libs/ardour/ardour/control_protocol_search_path.h
+++ b/libs/ardour/ardour/control_protocol_search_path.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
namespace ARDOUR {
/**
- * return a SearchPath containing directories in which to look for
+ * return a SearchPath containing directories in which to look for
* control surface plugins.
*
* If ARDOUR_SURFACES_PATH is defined then the SearchPath returned
diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h
index e8b22e5524..7720ca7395 100644
--- a/libs/ardour/ardour/coreaudiosource.h
+++ b/libs/ardour/ardour/coreaudiosource.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
-#ifndef __coreaudio_source_h__
+#ifndef __coreaudio_source_h__
#define __coreaudio_source_h__
#include <appleutility/CAAudioFile.h>
diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h
index 9e1e39bb14..577bee8257 100644
--- a/libs/ardour/ardour/crossfade.h
+++ b/libs/ardour/ardour/crossfade.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include <sigc++/signal.h>
#include "pbd/undo.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "ardour/ardour.h"
#include "ardour/audioregion.h"
@@ -44,29 +44,29 @@ class Crossfade : public ARDOUR::AudioRegion
public:
class NoCrossfadeHere: std::exception {
- public:
+ public:
virtual const char *what() const throw() { return "no crossfade should be constructed here"; }
};
-
+
/* constructor for "fixed" xfades at each end of an internal overlap */
Crossfade (boost::shared_ptr<ARDOUR::AudioRegion> in, boost::shared_ptr<ARDOUR::AudioRegion> out,
- nframes_t position,
- nframes_t initial_length,
- AnchorPoint);
+ nframes_t position,
+ nframes_t initial_length,
+ AnchorPoint);
/* constructor for xfade between two regions that are overlapped in any way
except the "internal" case.
*/
-
+
Crossfade (boost::shared_ptr<ARDOUR::AudioRegion> in, boost::shared_ptr<ARDOUR::AudioRegion> out, CrossfadeModel, bool active);
/* copy constructor to copy a crossfade with new regions. used (for example)
- when a playlist copy is made
+ when a playlist copy is made
*/
Crossfade (boost::shared_ptr<Crossfade>, boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>);
-
+
/* the usual XML constructor */
Crossfade (const Playlist&, XMLNode&);
@@ -79,13 +79,13 @@ class Crossfade : public ARDOUR::AudioRegion
boost::shared_ptr<ARDOUR::AudioRegion> in() const { return _in; }
boost::shared_ptr<ARDOUR::AudioRegion> out() const { return _out; }
-
- nframes_t read_at (Sample *buf, Sample *mixdown_buffer,
- float *gain_buffer, sframes_t position, nframes_t cnt,
- uint32_t chan_n,
- nframes_t read_frames = 0,
- nframes_t skip_frames = 0) const;
-
+
+ nframes_t read_at (Sample *buf, Sample *mixdown_buffer,
+ float *gain_buffer, sframes_t position, nframes_t cnt,
+ uint32_t chan_n,
+ nframes_t read_frames = 0,
+ nframes_t skip_frames = 0) const;
+
bool refresh ();
uint32_t upper_layer () const {
@@ -124,16 +124,16 @@ class Crossfade : public ARDOUR::AudioRegion
bool can_follow_overlap() const;
void set_follow_overlap (bool yn);
- AutomationList& fade_in() { return _fade_in; }
+ AutomationList& fade_in() { return _fade_in; }
AutomationList& fade_out() { return _fade_out; }
nframes_t set_xfade_length (nframes_t);
bool is_dependent() const { return true; }
- bool depends_on (boost::shared_ptr<Region> other) const {
- return other == _in || other == _out;
+ bool depends_on (boost::shared_ptr<Region> other) const {
+ return other == _in || other == _out;
}
-
+
static nframes_t short_xfade_length() { return _short_xfade_length; }
static void set_short_xfade_length (nframes_t n);
@@ -168,10 +168,10 @@ class Crossfade : public ARDOUR::AudioRegion
bool update ();
protected:
- nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int) const;
+ nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int) const;
};
} // namespace ARDOUR
-#endif /* __ardour_overlap_h__ */
+#endif /* __ardour_overlap_h__ */
diff --git a/libs/ardour/ardour/crossfade_compare.h b/libs/ardour/ardour/crossfade_compare.h
index b92806a6bb..ee934a2220 100644
--- a/libs/ardour/ardour/crossfade_compare.h
+++ b/libs/ardour/ardour/crossfade_compare.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
+ Copyright (C) 2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/cycle_timer.h b/libs/ardour/ardour/cycle_timer.h
index 2861533025..146b393a63 100644
--- a/libs/ardour/ardour/cycle_timer.h
+++ b/libs/ardour/ardour/cycle_timer.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ class CycleTimer {
cycles_t _entry;
cycles_t _exit;
std::string _name;
-
+
public:
CycleTimer(std::string name) : _name (name){
if (cycles_per_usec == 0) {
diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h
index 2199a2eb9c..9f6d9b4b5c 100644
--- a/libs/ardour/ardour/cycles.h
+++ b/libs/ardour/ardour/cycles.h
@@ -1,7 +1,7 @@
/*
Copyright (C) 2001 Paul Davis
Code derived from various headers from the Linux kernel
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -37,7 +37,7 @@
* We only use the low 32 bits, and we'd simply better make sure
* that we reschedule before that wraps. Scheduling at least every
* four billion cycles just basically sounds like a good idea,
- * regardless of how fast the machine is.
+ * regardless of how fast the machine is.
*/
typedef uint64_t cycles_t;
@@ -103,7 +103,7 @@ get_cycles (void)
* Standard way to access the cycle counter.
* Currently only used on SMP for scheduling.
*
- * Only the low 32 bits are available as a continuously counting entity.
+ * Only the low 32 bits are available as a continuously counting entity.
* But this only means we'll force a reschedule every 8 seconds or so,
* which isn't an evil thing.
*/
diff --git a/libs/ardour/ardour/dB.h b/libs/ardour/ardour/dB.h
index 1b5bb03d1f..209ab11edc 100644
--- a/libs/ardour/ardour/dB.h
+++ b/libs/ardour/ardour/dB.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/data_type.h b/libs/ardour/ardour/data_type.h
index 854f52acba..36114b29a9 100644
--- a/libs/ardour/ardour/data_type.h
+++ b/libs/ardour/ardour/data_type.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Author: Dave Robillard
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -49,7 +49,7 @@ public:
MIDI = 1,
NIL = 2,
};
-
+
/** Number of types (not including NIL).
* WARNING: make sure this matches Symbol!
*/
@@ -78,7 +78,7 @@ public:
default: return "";
}
}
-
+
/** Inverse of the from-string constructor */
const char* to_string() const {
switch (_symbol) {
@@ -111,10 +111,10 @@ public:
static iterator begin() { return iterator(0); }
static iterator end() { return iterator(num_types); }
-
+
bool operator==(const Symbol symbol) { return (_symbol == symbol); }
bool operator!=(const Symbol symbol) { return (_symbol != symbol); }
-
+
bool operator==(const DataType other) { return (_symbol == other._symbol); }
bool operator!=(const DataType other) { return (_symbol != other._symbol); }
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h
index 5cb11a9348..d2991a2d04 100644
--- a/libs/ardour/ardour/delivery.h
+++ b/libs/ardour/ardour/delivery.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h
index 9eb5bae3de..6932913958 100644
--- a/libs/ardour/ardour/diskstream.h
+++ b/libs/ardour/ardour/diskstream.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
#include "pbd/fastlog.h"
#include "pbd/ringbufferNPT.h"
#include "pbd/stateful.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "ardour/ardour.h"
#include "ardour/location.h"
@@ -59,7 +59,7 @@ class Send;
class Session;
class Diskstream : public SessionObject, public boost::noncopyable
-{
+{
public:
enum Flag {
Recordable = 0x1,
@@ -71,7 +71,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
Diskstream (Session &, const std::string& name, Flag f = Recordable);
Diskstream (Session &, const XMLNode&);
virtual ~Diskstream();
-
+
bool set_name (const std::string& str);
boost::shared_ptr<ARDOUR::IO> io() const { return _io; }
@@ -86,7 +86,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
AlignStyle alignment_style() const { return _alignment_style; }
void set_align_style (AlignStyle);
void set_persistent_align_style (AlignStyle a) { _persistent_alignment_style = a; }
-
+
nframes_t roll_delay() const { return _roll_delay; }
void set_roll_delay (nframes_t);
@@ -103,7 +103,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
bool non_layered() const { return _flags & NonLayered; }
bool reversed() const { return _actual_speed < 0.0f; }
double speed() const { return _visible_speed; }
-
+
virtual void punch_in() {}
virtual void punch_out() {}
@@ -122,7 +122,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
nframes_t current_capture_end() const { return capture_start_frame + capture_captured; }
nframes_t get_capture_start_frame (uint32_t n=0);
nframes_t get_captured_frames (uint32_t n=0);
-
+
ChanCount n_channels() { return _n_channels; }
static nframes_t disk_io_frames() { return disk_io_chunk_frames; }
@@ -131,7 +131,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
/* Stateful */
virtual XMLNode& get_state(void) = 0;
virtual int set_state(const XMLNode& node) = 0;
-
+
virtual void monitor_input (bool) {}
nframes_t capture_offset() const { return _capture_offset; }
@@ -193,12 +193,12 @@ class Diskstream : public SessionObject, public boost::noncopyable
virtual void recover (); /* called if commit will not be called, but process was */
//private:
-
+
enum TransitionType {
CaptureStart = 0,
CaptureEnd
};
-
+
struct CaptureTransition {
TransitionType type;
nframes_t capture_val; ///< The start or end file frame position
@@ -207,10 +207,10 @@ class Diskstream : public SessionObject, public boost::noncopyable
/* The two central butler operations */
virtual int do_flush (RunContext context, bool force = false) = 0;
virtual int do_refill () = 0;
-
+
/** For non-butler contexts (allocates temporary working buffers) */
virtual int do_refill_with_alloc() = 0;
-
+
/* XXX fix this redundancy ... */
virtual void playlist_changed (Change);
@@ -221,8 +221,8 @@ class Diskstream : public SessionObject, public boost::noncopyable
virtual void transport_looped (nframes_t transport_frame) = 0;
struct CaptureInfo {
- uint32_t start;
- uint32_t frames;
+ uint32_t start;
+ uint32_t frames;
};
virtual void init (Flag);
@@ -263,7 +263,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
/* items needed for speed change logic */
bool _buffer_reallocation_required;
bool _seek_required;
-
+
bool force_refill;
nframes_t capture_start_frame;
nframes_t capture_captured;
@@ -287,10 +287,10 @@ class Diskstream : public SessionObject, public boost::noncopyable
nframes_t wrap_buffer_size;
nframes_t speed_buffer_size;
- double _speed;
+ double _speed;
double _target_speed;
-
- nframes_t file_frame;
+
+ nframes_t file_frame;
nframes_t playback_sample;
nframes_t playback_distance;
bool commit_should_unlock;
@@ -312,7 +312,7 @@ class Diskstream : public SessionObject, public boost::noncopyable
sigc::connection plmod_connection;
sigc::connection plgone_connection;
sigc::connection plregion_connection;
-
+
Flag _flags;
void route_going_away ();
diff --git a/libs/ardour/ardour/element_import_handler.h b/libs/ardour/ardour/element_import_handler.h
index 2401cf7a06..be2e3fafb0 100644
--- a/libs/ardour/ardour/element_import_handler.h
+++ b/libs/ardour/ardour/element_import_handler.h
@@ -34,7 +34,7 @@ namespace ARDOUR {
class Session;
class ElementImporter;
-/// Virtual interface class for element import handlers
+/// Virtual interface class for element import handlers
class ElementImportHandler
{
public:
@@ -48,58 +48,58 @@ class ElementImportHandler
* @param source XML tree to be parsed
* @see elements
*/
- ElementImportHandler (XMLTree const & source, ARDOUR::Session & session) :
- source (source), session (session) { }
-
+ ElementImportHandler (XMLTree const & source, ARDOUR::Session & session)
+ : source (source), session (session) { }
+
virtual ~ElementImportHandler ();
-
+
/** Gets a textual representation of the element type
* @return textual representation of element type
*/
virtual std::string get_info () const = 0;
-
+
/// Elements this handler handles
ElementList elements;
-
+
/* For checking duplicates names against queued elements */
-
+
/** Checks whether or not an element with some name is queued or not
* @param name name to check
* @return true if name is not used
*/
bool check_name (const std::string & name) const;
-
+
/// Adds name to the list of used names
void add_name (std::string name);
-
+
/// Removes name from the list of used names
void remove_name (const std::string & name);
-
+
/// Checks wheter or not all elements can be imported cleanly
static bool dirty () { return _dirty; }
-
+
/// Sets handler dirty
static void set_dirty () { _dirty = true; }
-
+
/// Checks wheter or not all elements were imported cleanly
static bool errors () { return _errors; }
-
+
/// Sets handler dirty
static void set_errors () { _errors = true; }
protected:
/// Source session XML tree
XMLTree const & source;
-
+
/// Destination session
ARDOUR::Session & session;
-
+
/// Session XML readability
static bool _dirty;
-
+
/// Errors post initialization
static bool _errors;
-
+
private:
/// Set of names for duplicate checking
std::set<std::string> names;
diff --git a/libs/ardour/ardour/element_importer.h b/libs/ardour/ardour/element_importer.h
index 4a69565838..9d2d9cc0de 100644
--- a/libs/ardour/ardour/element_importer.h
+++ b/libs/ardour/ardour/element_importer.h
@@ -39,43 +39,43 @@ class ElementImporter
ElementImporter (XMLTree const & source, ARDOUR::Session & session);
virtual ~ElementImporter ();
-
+
/** Returns the element name
* @return the name of the element
*/
virtual std::string get_name () const { return name; };
-
+
/** Gets a textual representation of the element
* @return a textual representation on this specific element
*/
virtual std::string get_info () const = 0;
-
+
/** Gets import status, if applicable. */
virtual Session::ImportStatus * get_import_status () { return 0; }
-
+
/** Prepares to move element
*
* @return whther or not the element could be prepared for moving
*/
bool prepare_move ();
-
+
/** Cancels moving of element
* If the element has been set to be moved, this cancels the move.
*/
void cancel_move ();
-
+
/// Moves the element to the taget session
void move ();
-
+
/// Check if element is broken. Cannot be moved if broken.
bool broken () { return _broken; }
-
+
/// Signal that requests for anew name
static sigc::signal <std::pair<bool, std::string>, std::string, std::string> Rename;
-
+
/// Signal for ok/cancel prompting
static sigc::signal <bool, std::string> Prompt;
-
+
protected:
/** Moves the element to the taget session
@@ -84,44 +84,44 @@ class ElementImporter
*/
virtual void _move () = 0;
- /** Should take care of all tasks that need to be done
+ /** Should take care of all tasks that need to be done
* before moving the element. This includes prompting
* the user for more information if necessary.
*
* @return whether or not the element can be moved
*/
virtual bool _prepare_move () = 0;
-
- /// Cancel move
+
+ /// Cancel move
virtual void _cancel_move () = 0;
/// Source XML-tree
XMLTree const & source;
-
+
/// Target session
ARDOUR::Session & session;
-
+
/// Ture if the element has been prepared and queued for importing
bool queued () { return _queued; }
-
+
/// Name of element
std::string name;
-
+
/// The sample rate of the session from which we are importing
nframes_t sample_rate;
-
+
/// Converts smpte time to a string
std::string smpte_to_string (SMPTE::Time & time) const;
-
+
/// Converts samples so that times match the sessions sample rate
nframes_t rate_convert_samples (nframes_t samples) const;
-
+
/// Converts samples so that times match the sessions sample rate (for straight use in XML)
std::string rate_convert_samples (std::string const & samples) const;
-
+
/// Set element broken
void set_broken () { _broken = true; }
-
+
private:
bool _queued;
bool _broken;
diff --git a/libs/ardour/ardour/event_type_map.h b/libs/ardour/ardour/event_type_map.h
index 371adfc0ee..b3c6b89b3f 100644
--- a/libs/ardour/ardour/event_type_map.h
+++ b/libs/ardour/ardour/event_type_map.h
@@ -41,7 +41,7 @@ public:
Evoral::Parameter new_parameter(uint32_t type, uint8_t channel=0, uint32_t id=0) const;
Evoral::Parameter new_parameter(const std::string& str) const;
std::string to_symbol(const Evoral::Parameter& param) const;
-
+
bool is_midi_parameter(const Evoral::Parameter& param);
static EventTypeMap& instance() { return event_type_map; }
diff --git a/libs/ardour/ardour/export.h b/libs/ardour/ardour/export.h
index ffc6ae5854..78a0e9abb0 100644
--- a/libs/ardour/ardour/export.h
+++ b/libs/ardour/ardour/export.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
#include "ardour/ardour.h"
#include "ardour/gdither.h"
-namespace ARDOUR
+namespace ARDOUR
{
class Port;
@@ -41,59 +41,59 @@ namespace ARDOUR
struct ExportSpecification : public SF_INFO, public sigc::trackable {
- ExportSpecification();
- ~ExportSpecification ();
+ ExportSpecification();
+ ~ExportSpecification ();
- void init ();
- void clear ();
+ void init ();
+ void clear ();
- int prepare (nframes_t blocksize, nframes_t frame_rate);
+ int prepare (nframes_t blocksize, nframes_t frame_rate);
- int process (nframes_t nframes);
+ int process (nframes_t nframes);
- /* set by the user */
+ /* set by the user */
- std::string path;
- nframes_t sample_rate;
+ std::string path;
+ nframes_t sample_rate;
- int src_quality;
- SNDFILE* out;
- uint32_t channels;
- ExportPortMap port_map;
- nframes_t start_frame;
- nframes_t end_frame;
- GDitherType dither_type;
- bool do_freewheel;
+ int src_quality;
+ SNDFILE* out;
+ uint32_t channels;
+ ExportPortMap port_map;
+ nframes_t start_frame;
+ nframes_t end_frame;
+ GDitherType dither_type;
+ bool do_freewheel;
- /* used exclusively during export */
+ /* used exclusively during export */
- nframes_t frame_rate;
- GDither dither;
- float* dataF;
- float* dataF2;
- float* leftoverF;
- nframes_t leftover_frames;
- nframes_t max_leftover_frames;
- void* output_data;
- nframes_t out_samples_max;
- uint32_t sample_bytes;
- uint32_t data_width;
+ nframes_t frame_rate;
+ GDither dither;
+ float* dataF;
+ float* dataF2;
+ float* leftoverF;
+ nframes_t leftover_frames;
+ nframes_t max_leftover_frames;
+ void* output_data;
+ nframes_t out_samples_max;
+ uint32_t sample_bytes;
+ uint32_t data_width;
- nframes_t total_frames;
- SF_INFO sfinfo;
- SRC_DATA src_data;
- SRC_STATE* src_state;
- nframes_t pos;
+ nframes_t total_frames;
+ SF_INFO sfinfo;
+ SRC_DATA src_data;
+ SRC_STATE* src_state;
+ nframes_t pos;
- sigc::connection freewheel_connection;
+ sigc::connection freewheel_connection;
- /* shared between UI thread and audio thread */
+ /* shared between UI thread and audio thread */
- volatile float progress; /* audio thread sets this */
- volatile bool stop; /* UI sets this */
- volatile bool running; /* audio thread sets to false when export is done */
+ volatile float progress; /* audio thread sets this */
+ volatile bool stop; /* UI sets this */
+ volatile bool running; /* audio thread sets to false when export is done */
- int status;
+ int status;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h
index 4fe1efa294..fdb466a06e 100644
--- a/libs/ardour/ardour/export_channel.h
+++ b/libs/ardour/ardour/export_channel.h
@@ -44,13 +44,13 @@ class ExportChannel
virtual void read (Sample * data, nframes_t frames) const = 0;
virtual bool empty () const = 0;
-
+
/// Adds state to node passed
virtual void get_state (XMLNode * node) const = 0;
-
+
/// Sets state from node passed
virtual void set_state (XMLNode * node, Session & session) = 0;
-
+
// Operator< must be defined for usage in e.g. std::map or std::set to disallow duplicates when necessary
virtual bool operator< (ExportChannel const & other) const = 0;
};
@@ -72,13 +72,13 @@ class PortExportChannel : public ExportChannel
typedef std::set<AudioPort *> PortSet;
PortExportChannel () {}
-
+
void read (Sample * data, nframes_t frames) const;
bool empty () const { return ports.empty(); }
-
+
void get_state (XMLNode * node) const;
void set_state (XMLNode * node, Session & session);
-
+
bool operator< (ExportChannel const & other) const;
void add_port (AudioPort * port) { ports.insert (port); }
@@ -97,13 +97,13 @@ class RegionExportChannelFactory : public sigc::trackable
Fades,
Processed
};
-
+
RegionExportChannelFactory (Session * session, AudioRegion const & region, AudioTrack & track, Type type);
~RegionExportChannelFactory ();
ExportChannelPtr create (uint32_t channel);
void read (uint32_t channel, Sample * data, nframes_t frames_to_read);
-
+
private:
int new_cycle_started () { buffers_up_to_date = false; return 0; }
@@ -119,7 +119,7 @@ class RegionExportChannelFactory : public sigc::trackable
bool buffers_up_to_date;
nframes_t region_start;
nframes_t position;
-
+
Sample * mixdown_buffer;
Sample * gain_buffer;
};
@@ -139,11 +139,11 @@ class RegionExportChannel : public ExportChannel
private:
- RegionExportChannel (RegionExportChannelFactory & factory, uint32_t channel) :
- factory (factory),
- channel (channel)
+ RegionExportChannel (RegionExportChannelFactory & factory, uint32_t channel)
+ : factory (factory)
+ , channel (channel)
{}
-
+
RegionExportChannelFactory & factory;
uint32_t channel;
};
diff --git a/libs/ardour/ardour/export_channel_configuration.h b/libs/ardour/ardour/export_channel_configuration.h
index 70b2bb00d9..8ef9bba6dc 100644
--- a/libs/ardour/ardour/export_channel_configuration.h
+++ b/libs/ardour/ardour/export_channel_configuration.h
@@ -51,20 +51,20 @@ class ExportChannelConfiguration
typedef boost::shared_ptr<ExportTimespan> TimespanPtr;
typedef boost::shared_ptr<ExportFormatSpecification const> FormatPtr;
typedef boost::shared_ptr<ExportFilename> FilenamePtr;
-
+
typedef std::pair<FormatPtr, FilenamePtr> FileConfig;
typedef std::list<FileConfig> FileConfigList;
-
+
/// Struct for threading, acts like a pointer to a ExportChannelConfiguration
struct WriterThread {
WriterThread (ExportChannelConfiguration & channel_config) :
- channel_config (channel_config), running (false) {}
-
+ channel_config (channel_config), running (false) {}
+
ExportChannelConfiguration * operator-> () { return &channel_config; }
ExportChannelConfiguration & operator* () { return channel_config; }
-
+
ExportChannelConfiguration & channel_config;
-
+
pthread_t thread;
bool running;
};
@@ -72,46 +72,46 @@ class ExportChannelConfiguration
private:
friend class ExportElementFactory;
ExportChannelConfiguration (Session & session);
-
+
public:
XMLNode & get_state ();
int set_state (const XMLNode &);
-
+
typedef std::list<ExportChannelPtr> ChannelList;
-
+
ChannelList const & get_channels () const { return channels; }
bool all_channels_have_ports () const;
-
+
Glib::ustring name () const { return _name; }
void set_name (Glib::ustring name) { _name = name; }
void set_split (bool value) { split = value; }
-
+
bool get_split () const { return split; }
uint32_t get_n_chans () const { return channels.size(); }
-
+
void register_channel (ExportChannelPtr channel) { channels.push_back (channel); }
void register_file_config (FormatPtr format, FilenamePtr filename) { file_configs.push_back (FileConfig (format, filename)); }
-
+
void clear_channels () { channels.clear (); }
-
+
/// Writes all files for this channel config @return true if a new thread was spawned
bool write_files (boost::shared_ptr<ExportProcessor> new_processor);
sigc::signal<void> FilesWritten;
-
+
// Tells the handler the necessary information for it to handle tempfiles
void register_with_timespan (TimespanPtr timespan);
-
+
void unregister_all ();
-
+
private:
typedef boost::shared_ptr<ExportStatus> ExportStatusPtr;
- Session & session;
+ Session & session;
// processor has to be prepared before doing this.
void write_file ();
-
+
/// The actual write files, needed for threading
static void * _write_files (void *arg);
WriterThread writer_thread;
@@ -123,7 +123,7 @@ class ExportChannelConfiguration
TimespanPtr timespan;
ChannelList channels;
FileConfigList file_configs;
-
+
bool split; // Split to mono files
Glib::ustring _name;
};
diff --git a/libs/ardour/ardour/export_failed.h b/libs/ardour/ardour/export_failed.h
index 63256b458e..37f572f345 100644
--- a/libs/ardour/ardour/export_failed.h
+++ b/libs/ardour/ardour/export_failed.h
@@ -33,19 +33,19 @@ namespace ARDOUR
class ExportFailed : public std::exception
{
public:
- ExportFailed (std::string const & reason) :
- reason (reason.c_str())
+ ExportFailed (std::string const & reason)
+ : reason (reason.c_str())
{
PBD::error << string_compose (_("Export failed: %1"), reason) << endmsg;
}
-
+
~ExportFailed () throw() { }
-
+
const char* what() const throw()
{
return reason;
}
-
+
private:
const char * reason;
diff --git a/libs/ardour/ardour/export_file_io.h b/libs/ardour/ardour/export_file_io.h
index 0df2f99e29..48d5984f78 100644
--- a/libs/ardour/ardour/export_file_io.h
+++ b/libs/ardour/ardour/export_file_io.h
@@ -45,9 +45,9 @@ class ExportFileWriter
std::string filename () const { return _filename; }
nframes_t position () const { return _position; }
-
+
void set_position (nframes_t position) { _position = position; }
-
+
protected:
ExportFileWriter (std::string filename) : _filename (filename) {}
@@ -99,58 +99,58 @@ class ExportTempFile : public SndfileWriter<float>, public GraphSource<float>
public:
ExportTempFile (uint32_t channels, nframes_t samplerate);
~ExportTempFile () {}
-
+
/// Causes the file to be read from the beginning again
void reset_read () { reading = false; }
nframes_t read (float * data, nframes_t frames);
-
+
/* Silence management */
-
+
nframes_t trim_beginning (bool yn = true);
nframes_t trim_end (bool yn = true);
-
+
void set_silence_beginning (nframes_t frames);
void set_silence_end (nframes_t frames);
private:
/* File access */
-
+
sf_count_t get_length ();
sf_count_t get_position ();
sf_count_t get_read_position (); // get position seems to default to the write pointer
sf_count_t locate_to (nframes_t frames);
sf_count_t _read (float * data, nframes_t frames);
-
+
uint32_t channels;
bool reading;
-
+
/* Silence related */
-
+
/* start and end are used by read() */
-
+
nframes_t start;
nframes_t end;
-
+
/* these are the silence processing results and state */
-
+
void process_beginning ();
void process_end ();
-
+
bool beginning_processed;
bool end_processed;
-
+
nframes_t silent_frames_beginning;
nframes_t silent_frames_end;
-
+
/* Silence to add to start and end */
-
+
nframes_t silence_beginning;
nframes_t silence_end;
-
+
/* Takes care that the end postion gets set at some stage */
-
+
bool end_set;
-
+
};
class ExportFileFactory
@@ -160,7 +160,7 @@ class ExportFileFactory
typedef GraphSink<float> FloatSink;
typedef boost::shared_ptr<FloatSink> FloatSinkPtr;
typedef boost::shared_ptr<ExportFileWriter> FileWriterPtr;
-
+
typedef std::pair<FloatSinkPtr, FileWriterPtr> FilePair;
static FilePair create (FormatPtr format, uint32_t channels, Glib::ustring const & filename);
diff --git a/libs/ardour/ardour/export_filename.h b/libs/ardour/ardour/export_filename.h
index 3dccda728f..2847291a13 100644
--- a/libs/ardour/ardour/export_filename.h
+++ b/libs/ardour/ardour/export_filename.h
@@ -49,7 +49,7 @@ class ExportFilename {
D_BE, // big endian (no deliminator)
D_BEShortY // big endian short year representation
};
-
+
enum TimeFormat {
T_None,
T_NoDelim,
@@ -60,39 +60,39 @@ class ExportFilename {
friend class ExportElementFactory;
ExportFilename (Session & session);
- public:
+ public:
/* Serialization */
-
+
XMLNode & get_state ();
int set_state (const XMLNode &);
-
+
/* data access */
-
+
Glib::ustring get_path (FormatPtr format) const;
Glib::ustring get_folder () const { return folder; }
-
+
TimeFormat get_time_format () const { return time_format; }
DateFormat get_date_format () const { return date_format; }
Glib::ustring get_time_format_str (TimeFormat format) const;
Glib::ustring get_date_format_str (DateFormat format) const;
-
+
Glib::ustring get_label () const { return label; }
uint32_t get_revision () const { return revision; }
-
+
/* data modification */
-
+
void set_time_format (TimeFormat format);
void set_date_format (DateFormat format);
void set_label (Glib::ustring value);
void set_revision (uint32_t value) { revision = value; }
void set_channel (uint32_t value) { channel = value; }
bool set_folder (Glib::ustring path);
-
+
void set_timespan (TimespanPtr ts) { timespan = ts; }
void set_channel_config (ChannelConfigPtr cc) { channel_config = cc; }
-
+
/* public members */
-
+
bool include_label;
bool include_session;
bool include_revision;
@@ -101,7 +101,7 @@ class ExportFilename {
bool include_timespan;
bool include_time;
bool include_date;
-
+
private:
Session & session;
@@ -109,22 +109,22 @@ class ExportFilename {
Glib::ustring label;
uint32_t revision;
uint32_t channel;
-
+
Glib::ustring folder;
-
+
DateFormat date_format;
TimeFormat time_format;
-
+
Glib::ustring get_formatted_time (Glib::ustring const & format) const;
struct tm * time_struct; // Due to static allocation no destructor or copy-ctor is needed because of this
-
+
TimespanPtr timespan;
ChannelConfigPtr channel_config;
-
+
/* Serialization helpers */
-
+
typedef std::pair<bool, Glib::ustring> FieldPair;
-
+
void add_field (XMLNode * node, Glib::ustring const & name, bool enabled, Glib::ustring const & value = "");
FieldPair get_field (XMLNode const & node, Glib::ustring const & name);
FieldPair analyse_folder ();
diff --git a/libs/ardour/ardour/export_format_base.h b/libs/ardour/ardour/export_format_base.h
index 7d5757a77d..7bc0125004 100644
--- a/libs/ardour/ardour/export_format_base.h
+++ b/libs/ardour/ardour/export_format_base.h
@@ -43,7 +43,7 @@ class ExportFormatBase {
T_None = 0,
T_Sndfile
};
-
+
enum FormatId {
F_None = 0,
F_WAV = SF_FORMAT_WAV,
@@ -55,7 +55,7 @@ class ExportFormatBase {
F_FLAC = SF_FORMAT_FLAC,
F_Ogg = SF_FORMAT_OGG
};
-
+
enum Endianness {
E_FileDefault = SF_ENDIAN_FILE, /* Default file endian-ness. */
E_Little = SF_ENDIAN_LITTLE, /* Force little endian-ness. */
@@ -74,14 +74,14 @@ class ExportFormatBase {
SF_Double = SF_FORMAT_DOUBLE,
SF_Vorbis = SF_FORMAT_VORBIS
};
-
+
enum DitherType {
D_None = GDitherNone,
D_Rect = GDitherRect,
D_Tri = GDitherTri,
D_Shaped = GDitherShaped
};
-
+
enum Quality {
Q_None = 0,
Q_Any,
@@ -89,7 +89,7 @@ class ExportFormatBase {
Q_LosslessCompression,
Q_LossyCompression
};
-
+
enum SampleRate {
SR_None = 0,
SR_22_05 = 220500,
@@ -99,7 +99,7 @@ class ExportFormatBase {
SR_96 = 96000,
SR_192 = 192000
};
-
+
enum SRCQuality {
SRC_SincBest = SRC_SINC_BEST_QUALITY,
SRC_SincMedium = SRC_SINC_MEDIUM_QUALITY,
@@ -107,31 +107,31 @@ class ExportFormatBase {
SRC_ZeroOrderHold = SRC_ZERO_ORDER_HOLD,
SRC_Linear = SRC_LINEAR
};
-
+
/// Class for managing selection and compatibility states
class SelectableCompatible {
public:
- SelectableCompatible () :
- _selected (false), _compatible (true) { }
+ SelectableCompatible ()
+ : _selected (false), _compatible (true) { }
~SelectableCompatible () {}
-
+
sigc::signal<void, bool> SelectChanged;
sigc::signal<void, bool> CompatibleChanged;
-
+
bool selected () const { return _selected; }
bool compatible () const { return _compatible; }
Glib::ustring name () const { return _name; }
-
+
void set_selected (bool value);
void set_compatible (bool value);
-
+
protected:
void set_name (Glib::ustring name) { _name = name; }
-
+
private:
bool _selected;
bool _compatible;
-
+
Glib::ustring _name;
};
@@ -139,9 +139,9 @@ class ExportFormatBase {
ExportFormatBase ();
ExportFormatBase (ExportFormatBase const & other);
-
+
virtual ~ExportFormatBase ();
-
+
boost::shared_ptr<ExportFormatBase> get_intersection (ExportFormatBase const & other) const;
boost::shared_ptr<ExportFormatBase> get_difference (ExportFormatBase const & other) const;
boost::shared_ptr<ExportFormatBase> get_union (ExportFormatBase const & other) const;
@@ -151,13 +151,13 @@ class ExportFormatBase {
bool sample_rates_empty () const { return sample_rates.empty (); }
bool formats_empty () const { return format_ids.empty (); }
bool qualities_empty () const { return qualities.empty (); }
-
+
bool has_endianness (Endianness endianness) const { return endiannesses.find (endianness) != endiannesses.end() ; }
bool has_sample_format (SampleFormat format) const { return sample_formats.find (format) != sample_formats.end(); }
bool has_sample_rate (SampleRate rate) const { return sample_rates.find (rate) != sample_rates.end(); }
bool has_format (FormatId format) const { return format_ids.find (format) != format_ids.end(); }
bool has_quality (Quality quality) const { return qualities.find (quality) != qualities.end(); }
-
+
void set_extension (Glib::ustring const & extension) { _extension = extension; }
Glib::ustring const & extension () const { return _extension; }
@@ -172,22 +172,22 @@ class ExportFormatBase {
typedef std::set<SampleRate> SampleRateSet;
typedef std::set<FormatId> FormatSet;
typedef std::set<Quality> QualitySet;
-
+
EndianSet endiannesses;
SampleRateSet sample_rates;
FormatSet format_ids;
QualitySet qualities;
-
+
private:
Glib::ustring _extension;
-
+
enum SetOperation {
SetUnion,
SetDifference,
SetIntersection
};
-
+
boost::shared_ptr<ExportFormatBase> do_set_operation (ExportFormatBase const & other, SetOperation operation) const;
};
diff --git a/libs/ardour/ardour/export_format_compatibility.h b/libs/ardour/ardour/export_format_compatibility.h
index 895937dc98..cd2dae5e20 100644
--- a/libs/ardour/ardour/export_format_compatibility.h
+++ b/libs/ardour/ardour/export_format_compatibility.h
@@ -39,12 +39,12 @@ class ExportFormatCompatibility : public ExportFormatBase, public ExportFormatBa
format_ids.insert (F_None);
qualities.insert (Q_None);
}
-
+
~ExportFormatCompatibility () {};
-
- ExportFormatCompatibility (ExportFormatBase const & other) :
- ExportFormatBase (other) {}
-
+
+ ExportFormatCompatibility (ExportFormatBase const & other)
+ : ExportFormatBase (other) {}
+
void add_endianness (Endianness endianness) { endiannesses.insert (endianness); }
void add_sample_format (SampleFormat format) { sample_formats.insert (format); }
void add_sample_rate (SampleRate rate) { sample_rates.insert (rate); }
diff --git a/libs/ardour/ardour/export_format_manager.h b/libs/ardour/ardour/export_format_manager.h
index f69cfca986..705b9dcf17 100644
--- a/libs/ardour/ardour/export_format_manager.h
+++ b/libs/ardour/ardour/export_format_manager.h
@@ -46,39 +46,39 @@ class ExportFormatManager : public sigc::trackable
typedef boost::shared_ptr<ExportFormatCompatibility> CompatPtr;
typedef boost::weak_ptr<ExportFormatCompatibility> WeakCompatPtr;
typedef std::list<CompatPtr> CompatList;
-
+
typedef boost::shared_ptr<ExportFormat> FormatPtr;
typedef boost::weak_ptr<ExportFormat> WeakFormatPtr;
typedef std::list<FormatPtr> FormatList;
-
+
typedef HasSampleFormat::SampleFormatPtr SampleFormatPtr;
typedef HasSampleFormat::SampleFormatList SampleFormatList;
typedef HasSampleFormat::WeakSampleFormatPtr WeakSampleFormatPtr;
-
+
typedef HasSampleFormat::DitherTypePtr DitherTypePtr;
typedef HasSampleFormat::WeakDitherTypePtr WeakDitherTypePtr;
-
+
typedef boost::shared_ptr<ExportFormatSpecification> SpecPtr;
typedef boost::shared_ptr<ExportFormatBase> FormatBasePtr;
-
+
/* Quality states */
-
+
class QualityState : public ExportFormatBase::SelectableCompatible {
- public:
+ public:
QualityState (ExportFormatBase::Quality quality, Glib::ustring name) :
- quality (quality) { set_name (name); }
+ quality (quality) { set_name (name); }
ExportFormatBase::Quality quality;
};
typedef boost::shared_ptr<QualityState> QualityPtr;
typedef boost::weak_ptr<QualityState> WeakQualityPtr;
typedef std::list<QualityPtr> QualityList;
-
+
/* Sample rate states */
-
+
class SampleRateState : public ExportFormatBase::SelectableCompatible {
public:
- SampleRateState (ExportFormatBase::SampleRate rate, Glib::ustring name) :
- rate (rate) { set_name (name); }
+ SampleRateState (ExportFormatBase::SampleRate rate, Glib::ustring name)
+ : rate (rate) { set_name (name); }
ExportFormatBase::SampleRate rate;
};
typedef boost::shared_ptr<SampleRateState> SampleRatePtr;
@@ -100,11 +100,11 @@ class ExportFormatManager : public sigc::trackable
QualityList const & get_qualities () { return qualities; }
FormatList const & get_formats () { return formats; }
SampleRateList const & get_sample_rates () { return sample_rates; }
-
+
/* Non interactive selections */
-
+
void set_name (Glib::ustring name);
-
+
void select_src_quality (ExportFormatBase::SRCQuality value);
void select_trim_beginning (bool value);
void select_silence_beginning (AnyTime const & time);
@@ -127,41 +127,41 @@ class ExportFormatManager : public sigc::trackable
void add_sample_rate (SampleRatePtr ptr);
/* Connected to signals */
-
+
void change_compatibility_selection (bool select, WeakCompatPtr const & compat);
void change_quality_selection (bool select, WeakQualityPtr const & quality);
void change_format_selection (bool select, WeakFormatPtr const & format);
void change_sample_rate_selection (bool select, WeakSampleRatePtr const & rate);
-
+
void change_sample_format_selection (bool select, WeakSampleFormatPtr const & format);
void change_dither_type_selection (bool select, WeakDitherTypePtr const & type);
-
+
/* Do actual selection */
-
+
void select_compatibility (WeakCompatPtr const & compat);
void select_quality (QualityPtr const & quality);
void select_format (FormatPtr const & format);
void select_sample_rate (SampleRatePtr const & rate);
-
+
void select_sample_format (SampleFormatPtr const & format);
void select_dither_type (DitherTypePtr const & type);
-
+
bool pending_selection_change;
void selection_changed ();
-
+
/* Formats and compatibilities */
-
+
QualityPtr get_selected_quality ();
FormatPtr get_selected_format ();
SampleRatePtr get_selected_sample_rate ();
-
+
SampleFormatPtr get_selected_sample_format ();
-
+
FormatBasePtr get_compatibility_intersection ();
-
+
FormatBasePtr universal_set;
SpecPtr current_selection;
-
+
CompatList compatibilities;
QualityList qualities;
FormatList formats;
diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h
index a3f4d4fe19..628c70d25a 100644
--- a/libs/ardour/ardour/export_format_specification.h
+++ b/libs/ardour/ardour/export_format_specification.h
@@ -46,14 +46,14 @@ class ExportFormatSpecification : public ExportFormatBase {
struct Time : public AnyTime {
Time (Session & session) : AnyTime (), session (session) {}
Time & operator= (AnyTime const & other);
-
+
nframes_t get_frames (nframes_t target_rate) const;
-
+
/* Serialization */
-
+
XMLNode & get_state ();
int set_state (const XMLNode & node);
-
+
private:
Session & session;
};
@@ -62,18 +62,18 @@ class ExportFormatSpecification : public ExportFormatBase {
friend class ExportElementFactory;
explicit ExportFormatSpecification (Session & s);
ExportFormatSpecification (Session & s, XMLNode const & state);
-
+
public:
ExportFormatSpecification (ExportFormatSpecification const & other);
~ExportFormatSpecification ();
/* compatibility */
-
+
bool is_compatible_with (ExportFormatCompatibility const & compatibility) const;
bool is_complete () const;
/* Modifying functions */
-
+
void set_format (boost::shared_ptr<ExportFormat> format);
void set_name (Glib::ustring const & name) { _name = name; }
@@ -84,29 +84,29 @@ class ExportFormatSpecification : public ExportFormatBase {
void set_sample_format (SampleFormat value) { sample_formats.clear(); sample_formats.insert (value); }
void set_sample_rate (SampleRate value) { sample_rates.clear(); sample_rates.insert (value); }
void set_quality (Quality value) { qualities.clear(); qualities.insert (value); }
-
+
void set_dither_type (DitherType value) { _dither_type = value; }
void set_src_quality (SRCQuality value) { _src_quality = value; }
void set_trim_beginning (bool value) { _trim_beginning = value; }
void set_trim_end (bool value) { _trim_end = value; }
void set_normalize (bool value) { _normalize = value; }
void set_normalize_target (float value) { _normalize_target = value; }
-
+
void set_tag (bool tag_it) { _tag = tag_it; }
-
+
void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; }
void set_silence_end (AnyTime const & value) { _silence_end = value; }
-
+
/* Accessing functions */
-
+
PBD::UUID const & id () { return _id; }
Glib::ustring const & name () const { return _name; }
Glib::ustring description ();
-
+
bool has_broadcast_info () const { return _has_broadcast_info; }
uint32_t channel_limit () const { return _channel_limit; }
Glib::ustring format_name () const { return _format_name; }
-
+
Type type () const { return _type; }
FormatId format_id () const { return *format_ids.begin(); }
Endianness endianness () const { return *endiannesses.begin(); }
@@ -120,54 +120,54 @@ class ExportFormatSpecification : public ExportFormatBase {
bool trim_end () const { return _trim_end; }
bool normalize () const { return _normalize; }
float normalize_target () const { return _normalize_target; }
-
+
bool tag () const { return _tag && supports_tagging; }
-
+
nframes_t silence_beginning () const { return _silence_beginning.get_frames (sample_rate()); }
nframes_t silence_end () const { return _silence_end.get_frames (sample_rate()); }
-
+
AnyTime silence_beginning_time () const { return _silence_beginning; }
AnyTime silence_end_time () const { return _silence_end; }
-
+
/* Serialization */
-
+
XMLNode & get_state ();
int set_state (const XMLNode & root);
-
+
private:
-
+
Session & session;
-
+
/* The variables below do not have setters (usually set via set_format) */
-
+
Glib::ustring _format_name;
bool has_sample_format;
bool supports_tagging;
bool _has_broadcast_info;
uint32_t _channel_limit;
-
+
/* The variables below have getters and setters */
-
+
Glib::ustring _name;
PBD::UUID _id;
-
+
Type _type;
DitherType _dither_type;
SRCQuality _src_quality;
-
+
bool _tag;
-
+
bool _trim_beginning;
Time _silence_beginning;
bool _trim_end;
Time _silence_end;
-
+
bool _normalize;
float _normalize_target;
-
+
/* serialization helpers */
-
+
void add_option (XMLNode * node, std::string const & name, std::string const & value);
std::string get_option (XMLNode const * node, std::string const & name);
diff --git a/libs/ardour/ardour/export_formats.h b/libs/ardour/ardour/export_formats.h
index b7a7916767..3312e9abd6 100644
--- a/libs/ardour/ardour/export_formats.h
+++ b/libs/ardour/ardour/export_formats.h
@@ -42,43 +42,43 @@ class ExportFormat : public ExportFormatBase, public ExportFormatBase::Selectabl
public:
ExportFormat () {};
~ExportFormat () {};
-
+
virtual bool set_compatibility_state (ExportFormatCompatibility const & compatibility) = 0;
virtual Type get_type () const = 0;
-
+
FormatId get_format_id () const { return *format_ids.begin(); }
Quality get_quality () const { return *qualities.begin(); }
-
+
bool has_sample_format ();
bool sample_format_is_compatible (SampleFormat format) const;
-
+
/* If the format has a specific sample format, this function should be overriden
* if the format has a selectable sample format, do not override this!
*/
-
+
virtual SampleFormat get_explicit_sample_format () const { return SF_None; }
/* If the above is not overriden, this one should be */
virtual ExportFormat::SampleFormat default_sample_format () const { return SF_None; }
-
+
/* If the format has a channel count limit, override this */
-
+
virtual uint32_t get_channel_limit () const { return 256; }
-
+
/* If the format can be tagged with metadata override this */
-
+
virtual bool supports_tagging () const { return false; }
-
+
/* If the format contains broadcast info override this */
-
+
virtual bool has_broadcast_info () const { return false; }
protected:
-
+
void add_sample_rate (SampleRate rate) { sample_rates.insert (rate); }
void add_endianness (Endianness endianness) { endiannesses.insert (endianness); }
-
+
void set_format_id (FormatId id) { format_ids.clear (); format_ids.insert (id); }
void set_quality (Quality value) { qualities.clear(); qualities.insert (value); }
};
@@ -91,7 +91,7 @@ class HasSampleFormat {
public:
SampleFormatState (ExportFormatBase::SampleFormat format, Glib::ustring name) :
format (format) { set_name (name); }
-
+
ExportFormatBase::SampleFormat format;
};
@@ -99,14 +99,14 @@ class HasSampleFormat {
public:
DitherTypeState (ExportFormatBase::DitherType type, Glib::ustring name) :
type (type) { set_name (name); }
-
+
ExportFormatBase::DitherType type;
};
-
+
typedef boost::shared_ptr<SampleFormatState> SampleFormatPtr;
typedef boost::weak_ptr<SampleFormatState> WeakSampleFormatPtr;
typedef std::list<SampleFormatPtr> SampleFormatList;
-
+
typedef boost::shared_ptr<DitherTypeState> DitherTypePtr;
typedef boost::weak_ptr<DitherTypeState> WeakDitherTypePtr;
typedef std::list<DitherTypePtr> DitherTypeList;
@@ -117,21 +117,21 @@ class HasSampleFormat {
virtual ~HasSampleFormat () {};
void add_sample_format (ExportFormatBase::SampleFormat format);
-
+
SampleFormatList const & get_sample_formats () const { return sample_format_states; }
DitherTypeList const & get_dither_types () const { return dither_type_states; }
-
+
SampleFormatPtr get_selected_sample_format ();
DitherTypePtr get_selected_dither_type ();
-
+
/* Proxies for signals from sample formats and dither types */
-
+
sigc::signal<void, bool, WeakSampleFormatPtr> SampleFormatSelectChanged;
sigc::signal<void, bool, WeakSampleFormatPtr> SampleFormatCompatibleChanged;
-
+
sigc::signal<void, bool, WeakDitherTypePtr> DitherTypeSelectChanged;
sigc::signal<void, bool, WeakDitherTypePtr> DitherTypeCompatibleChanged;
-
+
static std::string get_sample_format_name (ExportFormatBase::SampleFormat format);
protected:
@@ -142,11 +142,11 @@ class HasSampleFormat {
private:
/* Connected to signals */
-
+
void add_dither_type (ExportFormatBase::DitherType type, Glib::ustring name);
void update_sample_format_selection (bool);
void update_dither_type_selection (bool);
-
+
/* Reference to ExportFormatBase::sample_formats */
ExportFormatBase::SampleFormatSet & _sample_formats;
};
@@ -156,15 +156,15 @@ class ExportFormatLinear : public ExportFormat, public HasSampleFormat {
ExportFormatLinear (Glib::ustring name, FormatId format_id);
~ExportFormatLinear () {};
-
+
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
Type get_type () const { return T_Sndfile; }
-
+
void add_endianness (Endianness endianness) { endiannesses.insert (endianness); }
-
+
void set_default_sample_format (SampleFormat sf) { _default_sample_format = sf; }
SampleFormat default_sample_format () const { return _default_sample_format; }
-
+
protected:
SampleFormat _default_sample_format;
};
@@ -173,7 +173,7 @@ class ExportFormatOggVorbis : public ExportFormat {
public:
ExportFormatOggVorbis ();
~ExportFormatOggVorbis () {};
-
+
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
Type get_type () const { return T_Sndfile; }
SampleFormat get_explicit_sample_format () const { return SF_Vorbis; }
@@ -184,10 +184,10 @@ class ExportFormatFLAC : public ExportFormat, public HasSampleFormat {
public:
ExportFormatFLAC ();
~ExportFormatFLAC () {};
-
+
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
Type get_type () const { return T_Sndfile; }
-
+
uint32_t get_channel_limit () const { return 8; }
SampleFormat default_sample_format () const { return SF_16; }
virtual bool supports_tagging () const { return true; }
@@ -197,10 +197,10 @@ class ExportFormatBWF : public ExportFormat, public HasSampleFormat {
public:
ExportFormatBWF ();
~ExportFormatBWF () {};
-
+
bool set_compatibility_state (ExportFormatCompatibility const & compatibility);
Type get_type () const { return T_Sndfile; }
-
+
SampleFormat default_sample_format () const { return SF_16; }
virtual bool has_broadcast_info () const { return true; }
};
diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h
index c945070408..b222c04eb4 100644
--- a/libs/ardour/ardour/export_handler.h
+++ b/libs/ardour/ardour/export_handler.h
@@ -71,27 +71,27 @@ class ExportElementFactory
class ExportHandler : public ExportElementFactory, public sigc::trackable
{
private:
-
+
/* Stuff for export configs
* The multimap maps timespans to file specifications
*/
-
+
struct FileSpec {
-
+
FileSpec (ChannelConfigPtr channel_config, FormatPtr format, FilenamePtr filename) :
channel_config (channel_config),
format (format),
filename (filename)
{}
-
+
ChannelConfigPtr channel_config;
FormatPtr format;
FilenamePtr filename;
};
-
+
typedef std::pair<TimespanPtr, FileSpec> ConfigPair;
typedef std::multimap<TimespanPtr, FileSpec> ConfigMap;
-
+
typedef boost::shared_ptr<ExportProcessor> ProcessorPtr;
typedef boost::shared_ptr<ExportStatus> StatusPtr;
@@ -102,7 +102,7 @@ class ExportHandler : public ExportElementFactory, public sigc::trackable
friend boost::shared_ptr<ExportHandler> Session::get_export_handler();
ExportHandler (Session & session);
-
+
public:
~ExportHandler ();
@@ -115,62 +115,62 @@ class ExportHandler : public ExportElementFactory, public sigc::trackable
ProcessorPtr processor;
StatusPtr export_status;
ConfigMap config_map;
-
+
bool realtime;
-
+
sigc::connection files_written_connection;
std::list<Glib::ustring> files_written;
-
+
/* CD Marker stuff */
-
+
struct CDMarkerStatus {
CDMarkerStatus (std::string out_file, TimespanPtr timespan, FormatPtr format, std::string filename) :
out (out_file.c_str()), timespan (timespan), format (format), filename (filename),
track_number (1), track_position (0), track_duration (0), track_start_frame (0),
index_number (1), index_position (0)
{}
-
+
/* General info */
std::ofstream out;
TimespanPtr timespan;
FormatPtr format;
std::string filename;
Location * marker;
-
+
/* Track info */
uint32_t track_number;
nframes_t track_position;
nframes_t track_duration;
nframes_t track_start_frame;
-
+
/* Index info */
uint32_t index_number;
nframes_t index_position;
};
-
-
+
+
void export_cd_marker_file (TimespanPtr timespan, FormatPtr file_format, std::string filename, CDMarkerFormat format);
-
+
void write_cue_header (CDMarkerStatus & status);
void write_toc_header (CDMarkerStatus & status);
-
+
void write_track_info_cue (CDMarkerStatus & status);
void write_track_info_toc (CDMarkerStatus & status);
void write_index_info_cue (CDMarkerStatus & status);
void write_index_info_toc (CDMarkerStatus & status);
-
+
void frames_to_cd_frames_string (char* buf, nframes_t when);
-
+
int cue_tracknum;
int cue_indexnum;
-
+
/* Timespan management */
-
+
void start_timespan ();
void finish_timespan ();
void timespan_thread_finished ();
-
+
typedef std::pair<ConfigMap::iterator, ConfigMap::iterator> TimespanBounds;
TimespanPtr current_timespan;
ConfigMap::iterator current_map_it;
diff --git a/libs/ardour/ardour/export_multiplication.h b/libs/ardour/ardour/export_multiplication.h
index c8fd20c60e..4826a35668 100644
--- a/libs/ardour/ardour/export_multiplication.h
+++ b/libs/ardour/ardour/export_multiplication.h
@@ -12,42 +12,42 @@
public:
GraphNode ();
virtual ~GraphNode ();
-
+
uint32_t id() const { return _id; }
-
+
/* Children and parents. Note: only children are kept in order! */
-
+
list<GraphNode *> const & get_parents () const { return parents; }
-
+
void add_child (GraphNode * child, GraphNode * left_sibling);
void remove_child (GraphNode * child);
GraphNode * first_child () const { return children.front(); }
GraphNode * last_child () const { return children.back(); }
list<GraphNode *> const & get_children () const { return children; }
-
+
/* Relation functions */
-
+
bool is_ancestor_of (GraphNode const * node) const;
bool is_descendant_of (GraphNode const * node) const;
bool equals (GraphNode const * node) const { return node == this; }
-
+
/* Selection functions */
-
+
bool selected () const { return _selected; }
void select (bool value);
-
+
sigc::signal<void, bool> SelectChanged;
-
+
protected:
-
+
/* Parent manipulation functions should be used only from child manipulation functions! */
-
+
void add_parent (GraphNode * parent);
void remove_parent (GraphNode * parent);
-
+
list<GraphNode *> parents;
list<GraphNode *> children;
-
+
bool _selected;
uint32_t _id;
static uint32_t id_counter;
@@ -60,10 +60,10 @@
typedef boost::shared_ptr<T> DataPtr;
typedef boost::shared_ptr<DataNode<T> > SelfPtr;
typedef boost::weak_ptr<DataNode<T> > WeakSelfPtr;
-
+
DataNode (DataPtr data) : _data (data) {}
void set_self_ptr (boost::shared_ptr<DataNode<T> > ptr) { _self_ptr = ptr; }
-
+
public:
static SelfPtr create (T * data)
{
@@ -71,14 +71,14 @@
ptr->set_self_ptr (ptr);
return ptr;
}
-
+
static SelfPtr create (DataPtr data)
{
SelfPtr ptr = SelfPtr (new DataNode<T> (data));
ptr->set_self_ptr (ptr);
return ptr;
}
-
+
DataPtr data() { return _data; }
SelfPtr self_ptr () { return _self_ptr.lock(); }
@@ -87,7 +87,7 @@
{
parents.sort (NodeSorter<P> (sort_list));
}
-
+
private:
DataPtr _data;
WeakSelfPtr _self_ptr;
@@ -95,14 +95,14 @@
private:
/* Sorts GraphNodes according to a list of DataNodes */
-
+
template<typename T>
class NodeSorter {
public:
typedef list<boost::shared_ptr<DataNode<T> > > ListType;
-
+
NodeSorter (ListType const & list) : list (list) {}
-
+
bool operator() (GraphNode * one, GraphNode * other) // '<' operator
{
if (one == other) { return false; } // Strict weak ordering
@@ -114,12 +114,12 @@
return false;
}
}
-
+
std::cerr << "Invalid comparison list given to NodeSorter" << std::endl;
-
+
abort();
}
-
+
private:
ListType const & list;
};
@@ -129,16 +129,16 @@
typedef DataNode<TimespanState> TimespanNode;
typedef boost::shared_ptr<TimespanNode> TimespanNodePtr;
-
+
typedef DataNode<ChannelConfigState> ChannelConfigNode;
typedef boost::shared_ptr<ChannelConfigNode> ChannelConfigNodePtr;
-
+
typedef DataNode<FormatState> FormatNode;
typedef boost::shared_ptr<FormatNode> FormatNodePtr;
-
+
typedef DataNode<FilenameState> FilenameNode;
typedef boost::shared_ptr<FilenameNode> FilenameNodePtr;
-
+
struct MultiplicationGraph {
list<TimespanNodePtr> timespans;
list<ChannelConfigNodePtr> channel_configs;
@@ -147,35 +147,35 @@
};
MultiplicationGraph const & get_graph () { return graph; }
-
+
void split_node (GraphNode * node, float position);
void remove_node (GraphNode * node);
-
+
sigc::signal<void> GraphChanged;
private:
void purge_graph ();
-
+
template<typename T>
static void insert_after (list<T> & the_list, T const & position, T const & element);
-
+
template<typename T>
static void remove_by_element (list<T> & the_list, T const & element);
-
+
bool nodes_have_one_common_child (list<GraphNode *> const & the_list);
list<GraphNode *>::const_iterator end_of_common_child_range (list<GraphNode *> const & the_list, list<GraphNode *>::const_iterator beginning);
void split_node_at_position (GraphNode * old_node, GraphNode * new_node, float position);
-
+
void split_timespan (TimespanNodePtr node, float position = 0.5);
void split_channel_config (ChannelConfigNodePtr node, float position = 0.5);
void split_format (FormatNodePtr node, float position = 0.5);
void split_filename (FilenameNodePtr node, float position = 0.5);
-
+
void duplicate_timespan_children (TimespanNodePtr source, TimespanNodePtr target, GraphNode * insertion_point = 0);
void duplicate_channel_config_children (ChannelConfigNodePtr source, ChannelConfigNodePtr target, GraphNode * insertion_point = 0);
void duplicate_format_children (FormatNodePtr source, FormatNodePtr target, GraphNode * insertion_point = 0);
-
+
TimespanNodePtr duplicate_timespan_node (TimespanNodePtr node);
ChannelConfigNodePtr duplicate_channel_config_node (ChannelConfigNodePtr node);
FormatNodePtr duplicate_format_node (FormatNodePtr node);
diff --git a/libs/ardour/ardour/export_preset.h b/libs/ardour/ardour/export_preset.h
index c518a208ea..b24cc70dcf 100644
--- a/libs/ardour/ardour/export_preset.h
+++ b/libs/ardour/ardour/export_preset.h
@@ -44,10 +44,10 @@ class ExportPreset {
// Note: The set_..._state functions take ownership of the XMLNode
void set_global_state (XMLNode & state);
void set_local_state (XMLNode & state);
-
+
XMLNode const * get_global_state () const { return global.root(); }
XMLNode const * get_local_state () const { return local; }
-
+
void save (std::string const & filename);
void remove_local () const;
@@ -65,7 +65,7 @@ class ExportPreset {
Session & session;
XMLTree global;
XMLNode * local;
-
+
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/export_processor.h b/libs/ardour/ardour/export_processor.h
index 832b200848..c2cb5034c7 100644
--- a/libs/ardour/ardour/export_processor.h
+++ b/libs/ardour/ardour/export_processor.h
@@ -43,22 +43,22 @@ class ExportProcessor
{
private:
/* Typedefs for utility processors */
-
+
typedef boost::shared_ptr<SampleRateConverter> SRConverterPtr;
typedef boost::shared_ptr<PeakReader> PReaderPtr;
typedef boost::shared_ptr<Normalizer> NormalizerPtr;
typedef boost::shared_ptr<ExportTempFile> TempFilePtr;
-
+
typedef GraphSink<float> FloatSink;
typedef boost::shared_ptr<FloatSink> FloatSinkPtr;
typedef std::vector<FloatSinkPtr> FloatSinkVect;
-
+
typedef boost::shared_ptr<ExportFilename> FilenamePtr;
typedef boost::shared_ptr<ExportFormatSpecification const> FormatPtr;
-
+
typedef boost::shared_ptr<ExportFileWriter> FileWriterPtr;
typedef std::list<FileWriterPtr> FileWriterList;
-
+
public:
ExportProcessor (Session & session);
@@ -70,27 +70,27 @@ class ExportProcessor
* @return 0 on success
*/
int prepare (FormatPtr format, FilenamePtr fname, uint32_t chans, bool split = false, nframes_t start = 0);
-
+
/// Process data
/** @param frames frames to process @return frames written **/
nframes_t process (float * data, nframes_t frames);
-
+
/** should be called after all data is given to process **/
void prepare_post_processors ();
-
+
void write_files ();
-
+
static sigc::signal<void, Glib::ustring> WritingFile;
-
+
private:
-
+
void reset ();
-
+
Session & session;
boost::shared_ptr<ExportStatus> status;
-
+
/* these are initalized in prepare() */
-
+
FilenamePtr filename;
NormalizerPtr normalizer;
SRConverterPtr src;
@@ -98,15 +98,15 @@ class ExportProcessor
TempFilePtr temp_file;
FloatSinkVect file_sinks;
FileWriterList writer_list;
-
+
/* general info */
-
+
uint32_t channels;
nframes_t blocksize;
nframes_t frame_rate;
-
+
/* Processing */
-
+
bool tag;
bool broadcast_info;
bool split_files;
@@ -115,9 +115,9 @@ class ExportProcessor
bool trim_end;
nframes_t silence_beginning;
nframes_t silence_end;
-
+
/* Progress info */
-
+
nframes_t temp_file_position;
nframes_t temp_file_length;
};
diff --git a/libs/ardour/ardour/export_profile_manager.h b/libs/ardour/ardour/export_profile_manager.h
index bf261cad46..b402550a64 100644
--- a/libs/ardour/ardour/export_profile_manager.h
+++ b/libs/ardour/ardour/export_profile_manager.h
@@ -61,10 +61,10 @@ class ExportProfileManager
void load_profile ();
void prepare_for_export ();
-
+
typedef boost::shared_ptr<ExportPreset> PresetPtr;
typedef std::list<PresetPtr> PresetList;
-
+
PresetList const & get_presets () { return preset_list; }
bool load_preset (PresetPtr preset);
PresetPtr save_preset (std::string const & name);
@@ -75,27 +75,27 @@ class ExportProfileManager
typedef std::pair<PBD::UUID, PBD::sys::path> FilePair;
typedef std::map<PBD::UUID, PBD::sys::path> FileMap;
-
+
HandlerPtr handler;
Session & session;
-
+
void load_presets ();
void load_preset_from_disk (PBD::sys::path const & path);
-
+
bool set_state (XMLNode const & root);
bool set_global_state (XMLNode const & root);
bool set_local_state (XMLNode const & root);
-
+
void serialize_profile (XMLNode & root);
void serialize_global_profile (XMLNode & root);
void serialize_local_profile (XMLNode & root);
-
+
PresetList preset_list;
PresetPtr current_preset;
FileMap preset_file_map;
-
+
std::vector<PBD::sys::path> find_file (std::string const & pattern);
-
+
PBD::sys::path export_config_dir;
PBD::SearchPath search_path;
@@ -118,47 +118,47 @@ class ExportProfileManager
struct TimespanState {
TimespanListPtr timespans;
TimeFormat time_format;
-
+
boost::shared_ptr<Location> session_range;
boost::shared_ptr<Location> selection_range;
boost::shared_ptr<LocationList> ranges;
-
+
TimespanState (boost::shared_ptr<Location> session_range,
boost::shared_ptr<Location> selection_range,
boost::shared_ptr<LocationList> ranges) :
timespans (new TimespanList ()),
time_format (SMPTE),
-
+
session_range (session_range),
selection_range (selection_range),
ranges (ranges)
{}
};
-
+
typedef boost::shared_ptr<TimespanState> TimespanStatePtr;
typedef std::list<TimespanStatePtr> TimespanStateList;
-
+
void set_selection_range (nframes_t start = 0, nframes_t end = 0);
std::string set_single_range (nframes_t start, nframes_t end, Glib::ustring name);
TimespanStateList const & get_timespans () { return check_list (timespans); }
-
+
private:
TimespanStateList timespans;
bool init_timespans (XMLNodeList nodes);
-
+
TimespanStatePtr deserialize_timespan (XMLNode & root);
XMLNode & serialize_timespan (TimespanStatePtr state);
-
+
/* Locations */
-
+
void update_ranges ();
-
+
boost::shared_ptr<Location> session_range;
boost::shared_ptr<Location> selection_range;
boost::shared_ptr<LocationList> ranges;
-
+
bool single_range_mode;
boost::shared_ptr<Location> single_range;
@@ -169,12 +169,12 @@ class ExportProfileManager
struct ChannelConfigState {
ChannelConfigPtr config;
-
+
ChannelConfigState (ChannelConfigPtr ptr) : config (ptr) {}
};
typedef boost::shared_ptr<ChannelConfigState> ChannelConfigStatePtr;
typedef std::list<ChannelConfigStatePtr> ChannelConfigStateList;
-
+
ChannelConfigStateList const & get_channel_configs () { return check_list (channel_configs); }
private:
@@ -192,21 +192,21 @@ class ExportProfileManager
struct FormatState {
boost::shared_ptr<FormatList const> list;
FormatPtr format;
-
+
FormatState (boost::shared_ptr<FormatList const> list, FormatPtr format) :
list (list), format (format) {}
};
typedef boost::shared_ptr<FormatState> FormatStatePtr;
typedef std::list<FormatStatePtr> FormatStateList;
-
+
FormatStateList const & get_formats () { return check_list (formats); }
FormatStatePtr duplicate_format_state (FormatStatePtr state);
void remove_format_state (FormatStatePtr state);
-
+
PBD::sys::path save_format_to_disk (FormatPtr format);
void remove_format_profile (FormatPtr format);
FormatPtr get_new_format (FormatPtr original);
-
+
sigc::signal<void> FormatListChanged;
private:
@@ -218,26 +218,26 @@ class ExportProfileManager
XMLNode & serialize_format (FormatStatePtr state);
void load_formats ();
-
+
FormatPtr load_format (XMLNode & node);
void load_format_from_disk (PBD::sys::path const & path);
boost::shared_ptr<FormatList> format_list;
FileMap format_file_map;
-
+
/* Filenames */
public:
-
+
typedef boost::shared_ptr<ExportFilename> FilenamePtr;
-
+
struct FilenameState {
FilenamePtr filename;
-
+
FilenameState (FilenamePtr ptr) : filename (ptr) {}
};
typedef boost::shared_ptr<FilenameState> FilenameStatePtr;
typedef std::list<FilenameStatePtr> FilenameStateList;
-
+
FilenameStateList const & get_filenames () { return check_list (filenames); }
FilenameStatePtr duplicate_filename_state (FilenameStatePtr state);
void remove_filename_state (FilenameStatePtr state);
@@ -245,7 +245,7 @@ class ExportProfileManager
private:
FilenameStateList filenames;
-
+
bool init_filenames (XMLNodeList nodes);
FilenamePtr load_filename (XMLNode & node);
@@ -256,9 +256,9 @@ class ExportProfileManager
std::list<Glib::ustring> warnings;
std::list<Glib::ustring> conflicting_filenames;
};
-
+
boost::shared_ptr<Warnings> get_warnings ();
-
+
private:
void check_config (boost::shared_ptr<Warnings> warnings,
TimespanStatePtr timespan_state,
diff --git a/libs/ardour/ardour/export_status.h b/libs/ardour/ardour/export_status.h
index 42b0b061f0..3322ca639c 100644
--- a/libs/ardour/ardour/export_status.h
+++ b/libs/ardour/ardour/export_status.h
@@ -40,40 +40,40 @@ struct ExportStatus : public sigc::trackable {
ExportStatus ();
void init ();
-
+
/* Status info */
-
+
volatile bool stop;
volatile bool running;
-
+
sigc::signal<void> Aborting;
void abort (bool error_occurred = false);
bool aborted () const { return _aborted; }
bool errors () const { return _errors; }
-
+
sigc::signal<void> Finished;
void finish ();
bool finished () const { return _finished; }
-
+
/* Progress info */
-
+
volatile ExportStage stage;
volatile float progress;
-
+
volatile uint32_t total_timespans;
volatile uint32_t timespan;
-
+
volatile uint32_t total_channel_configs;
volatile uint32_t channel_config;
-
+
volatile uint32_t total_formats;
volatile uint32_t format;
-
+
private:
volatile bool _aborted;
volatile bool _errors;
volatile bool _finished;
-
+
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/export_timespan.h b/libs/ardour/ardour/export_timespan.h
index 8c1ce10730..255d1e377d 100644
--- a/libs/ardour/ardour/export_timespan.h
+++ b/libs/ardour/ardour/export_timespan.h
@@ -47,30 +47,30 @@ class ExportTimespan : public sigc::trackable
private:
friend class ExportElementFactory;
ExportTimespan (ExportStatusPtr status, nframes_t frame_rate);
-
+
public:
~ExportTimespan ();
-
+
Glib::ustring name () const { return _name; }
void set_name (Glib::ustring name) { _name = name; }
-
+
Glib::ustring range_id () const { return _range_id; }
void set_range_id (Glib::ustring range_id) { _range_id = range_id; }
-
+
/// Registers a channel to be read when export starts rolling
void register_channel (ExportChannelPtr channel);
-
+
/// "Rewinds" the tempfiles to start reading the beginnings again
void rewind ();
-
+
/// Reads data from the tempfile belonging to channel into data
nframes_t get_data (float * data, nframes_t frames, ExportChannelPtr channel);
-
+
/// Reads data from each channel and writes to tempfile
int process (nframes_t frames);
-
+
sigc::connection process_connection;
-
+
void set_range (nframes_t start, nframes_t end);
nframes_t get_length () const { return end_frame - start_frame; }
nframes_t get_start () const { return start_frame; }
@@ -86,7 +86,7 @@ class ExportTimespan : public sigc::trackable
nframes_t frame_rate;
TempFileMap filemap;
-
+
Glib::ustring _name;
Glib::ustring _range_id;
diff --git a/libs/ardour/ardour/export_utilities.h b/libs/ardour/ardour/export_utilities.h
index a9044345a6..5733ebb403 100644
--- a/libs/ardour/ardour/export_utilities.h
+++ b/libs/ardour/ardour/export_utilities.h
@@ -44,22 +44,22 @@ class SampleRateConverter : public GraphSinkVertex<float, float>
protected:
nframes_t process (float * data, nframes_t frames);
-
+
private:
bool active;
uint32_t channels;
-
+
nframes_t leftover_frames;
nframes_t max_leftover_frames;
nframes_t frames_in;
nframes_t frames_out;
-
+
float * data_in;
float * leftover_data;
-
+
float * data_out;
nframes_t data_out_size;
-
+
SRC_DATA src_data;
SRC_STATE* src_state;
};
@@ -72,21 +72,21 @@ class SampleFormatConverter : public GraphSinkVertex<float, TOut>
public:
SampleFormatConverter (uint32_t channels, ExportFormatBase::DitherType type = ExportFormatBase::D_None, int data_width_ = 0);
~SampleFormatConverter ();
-
+
void set_clip_floats (bool yn) { clip_floats = yn; }
-
+
protected:
nframes_t process (float * data, nframes_t frames);
-
+
private:
uint32_t channels;
int data_width;
GDither dither;
nframes_t data_out_size;
TOut * data_out;
-
+
bool clip_floats;
-
+
};
/* Peak reader */
@@ -96,16 +96,16 @@ class PeakReader : public GraphSinkVertex<float, float>
public:
PeakReader (uint32_t channels) : channels (channels), peak (0) {}
~PeakReader () {}
-
+
float get_peak () { return peak; }
-
+
protected:
nframes_t process (float * data, nframes_t frames)
{
peak = compute_peak (data, channels * frames, peak);
return piped_to->write (data, frames);
}
-
+
private:
uint32_t channels;
float peak;
@@ -118,15 +118,15 @@ class Normalizer : public GraphSinkVertex<float, float>
public:
Normalizer (uint32_t channels, float target_dB);
~Normalizer ();
-
+
void set_peak (float peak);
-
+
protected:
nframes_t process (float * data, nframes_t frames);
-
+
private:
uint32_t channels;
-
+
bool enabled;
gain_t target;
gain_t gain;
diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h
index 82a54094ef..7844bb513a 100644
--- a/libs/ardour/ardour/file_source.h
+++ b/libs/ardour/ardour/file_source.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006-2009 Paul Davis
+ Copyright (C) 2006-2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
-#ifndef __ardour_filesource_h__
+#ifndef __ardour_filesource_h__
#define __ardour_filesource_h__
#include <exception>
@@ -37,11 +37,11 @@ public:
const Glib::ustring& path() const { return _path; }
virtual bool safe_file_extension (const Glib::ustring& path) const = 0;
-
+
int move_to_trash (const Glib::ustring& trash_dir_name);
void mark_take (const Glib::ustring& id);
void mark_immutable ();
-
+
const Glib::ustring& take_id () const { return _take_id; }
bool is_embedded () const { return _is_embedded; }
uint16_t channel() const { return _channel; }
@@ -49,24 +49,24 @@ public:
int set_state (const XMLNode&);
int set_source_name (const Glib::ustring& newname, bool destructive);
-
+
static void set_search_path (DataType type, const Glib::ustring& path);
static bool find (DataType type, const Glib::ustring& path,
- bool must_exist, bool& is_new, uint16_t& chan,
- Glib::ustring& found_path);
+ bool must_exist, bool& is_new, uint16_t& chan,
+ Glib::ustring& found_path);
protected:
FileSource (Session& session, DataType type,
const Glib::ustring& path, bool embedded,
Source::Flag flags = Source::Flag(0));
-
+
FileSource (Session& session, const XMLNode& node, bool must_exist);
virtual int init (const Glib::ustring& idstr, bool must_exist);
-
+
virtual int move_dependents_to_trash() { return 0; }
-
+
bool removable () const;
Glib::ustring _path;
diff --git a/libs/ardour/ardour/filesystem_paths.h b/libs/ardour/ardour/filesystem_paths.h
index 7e14c9a4fa..e183193cb0 100644
--- a/libs/ardour/ardour/filesystem_paths.h
+++ b/libs/ardour/ardour/filesystem_paths.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/filter.h b/libs/ardour/ardour/filter.h
index ad0c7d268c..697e19539e 100644
--- a/libs/ardour/ardour/filter.h
+++ b/libs/ardour/ardour/filter.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -42,7 +42,7 @@ class Filter {
int make_new_sources (boost::shared_ptr<ARDOUR::Region>, ARDOUR::SourceList&, std::string suffix = "");
int finish (boost::shared_ptr<ARDOUR::Region>, ARDOUR::SourceList&, std::string region_name = "");
-
+
ARDOUR::Session& session;
};
diff --git a/libs/ardour/ardour/gain.h b/libs/ardour/ardour/gain.h
index 207f794910..785475444a 100644
--- a/libs/ardour/ardour/gain.h
+++ b/libs/ardour/ardour/gain.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/gdither_types_internal.h b/libs/ardour/ardour/gdither_types_internal.h
index e73a256310..6cb0c48af9 100644
--- a/libs/ardour/ardour/gdither_types_internal.h
+++ b/libs/ardour/ardour/gdither_types_internal.h
@@ -25,7 +25,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
#define GDITHER_SH_BUF_SIZE 8
#define GDITHER_SH_BUF_MASK 7
diff --git a/libs/ardour/ardour/graph.h b/libs/ardour/ardour/graph.h
index c0e29b6735..5d6919f56e 100644
--- a/libs/ardour/ardour/graph.h
+++ b/libs/ardour/ardour/graph.h
@@ -34,10 +34,10 @@ class GraphSink {
public:
GraphSink () : end_of_input (false) {}
virtual ~GraphSink () { end_of_input = false; }
-
+
// writes data and return number of frames written
virtual nframes_t write (T * data, nframes_t frames) = 0;
-
+
// Notifies end of input. All left over data must be written at this stage
virtual void set_end_of_input (bool state = true)
{
@@ -54,7 +54,7 @@ class GraphSource {
public:
GraphSource () {}
virtual ~GraphSource () {}
-
+
virtual nframes_t read (T * data, nframes_t frames) = 0;
};
@@ -64,19 +64,19 @@ class GraphSinkVertex : public GraphSink<TIn> {
public:
GraphSinkVertex () {}
virtual ~GraphSinkVertex () {}
-
+
void pipe_to (boost::shared_ptr<GraphSink<TOut> > dest) {
piped_to = dest;
}
-
+
nframes_t write (TIn * data, nframes_t frames)
{
if (!piped_to) {
return -1;
}
return process (data, frames);
- }
-
+ }
+
virtual void set_end_of_input (bool state = true)
{
if (!piped_to) {
@@ -85,10 +85,10 @@ class GraphSinkVertex : public GraphSink<TIn> {
piped_to->set_end_of_input (state);
GraphSink<TIn>::end_of_input = state;
}
-
+
protected:
boost::shared_ptr<GraphSink<TOut> > piped_to;
-
+
/* process must process data,
use piped_to->write to write the data
and return number of frames written */
diff --git a/libs/ardour/ardour/importable_source.h b/libs/ardour/ardour/importable_source.h
index 26c840b60f..801e7888a9 100644
--- a/libs/ardour/ardour/importable_source.h
+++ b/libs/ardour/ardour/importable_source.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/internal_return.h b/libs/ardour/ardour/internal_return.h
index 384f2900d8..4d2839cb12 100644
--- a/libs/ardour/ardour/internal_return.h
+++ b/libs/ardour/ardour/internal_return.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ namespace ARDOUR {
class InternalReturn : public Return
{
- public:
+ public:
InternalReturn (Session&);
InternalReturn (Session&, const XMLNode&);
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h
index 4cca8e2c89..ef7d3d3d54 100644
--- a/libs/ardour/ardour/internal_send.h
+++ b/libs/ardour/ardour/internal_send.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ namespace ARDOUR {
class InternalSend : public Send
{
- public:
+ public:
InternalSend (Session&, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to, Delivery::Role role);
InternalSend (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&);
virtual ~InternalSend ();
@@ -39,7 +39,7 @@ class InternalSend : public Send
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
-
+
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
bool feeds (boost::shared_ptr<Route> other) const;
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
diff --git a/libs/ardour/ardour/interpolation.h b/libs/ardour/ardour/interpolation.h
index cdd3bfc1b5..2b777ac840 100644
--- a/libs/ardour/ardour/interpolation.h
+++ b/libs/ardour/ardour/interpolation.h
@@ -12,22 +12,22 @@ class Interpolation {
protected:
double _speed, _target_speed;
- // the idea is that when the speed is not 1.0, we have to
- // interpolate between samples and then we have to store where we thought we were.
+ // the idea is that when the speed is not 1.0, we have to
+ // interpolate between samples and then we have to store where we thought we were.
// rather than being at sample N or N+1, we were at N+0.8792922
std::vector<double> phase;
-
+
public:
Interpolation () { _speed = 1.0; _target_speed = 1.0; }
~Interpolation () { phase.clear(); }
-
+
void set_speed (double new_speed) { _speed = new_speed; _target_speed = new_speed; }
void set_target_speed (double new_speed) { _target_speed = new_speed; }
double target_speed() const { return _target_speed; }
double speed() const { return _speed; }
-
+
void add_channel_to (int /*input_buffer_size*/, int /*output_buffer_size*/) { phase.push_back (0.0); }
void remove_channel_from () { phase.pop_back (); }
@@ -40,7 +40,7 @@ class Interpolation {
class LinearInterpolation : public Interpolation {
protected:
-
+
public:
nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
};
@@ -55,11 +55,11 @@ class CubicInterpolation : public Interpolation {
fr * (4.0f * inp1 + 2.0f * inm1 - 5.0f * in - inp2 +
fr * (3.0f * (in - inp1) - inm1 + inp2)));
}
-
+
public:
nframes_t interpolate (int channel, nframes_t nframes, Sample* input, Sample* output);
};
-
+
} // namespace ARDOUR
#endif
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index 858302442e..0be1493dbb 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
#include "pbd/fastlog.h"
#include "pbd/undo.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "pbd/controllable.h"
#include "ardour/ardour.h"
@@ -78,7 +78,7 @@ class IO : public SessionObject, public Latent
IO (Session&, const std::string& name, Direction, DataType default_type = DataType::AUDIO);
IO (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
-
+
virtual ~IO();
Direction direction() const { return _direction; }
@@ -88,7 +88,7 @@ class IO : public SessionObject, public Latent
bool active() const { return _active; }
void set_active(bool yn) { _active = yn; }
-
+
bool set_name (const std::string& str);
virtual void silence (nframes_t);
@@ -101,7 +101,7 @@ class IO : public SessionObject, public Latent
BundleList bundles_connected ();
boost::shared_ptr<Bundle> bundle () { return _bundle; }
-
+
int add_port (std::string connection, void *src, DataType type = DataType::NIL);
int remove_port (Port *, void *src);
int connect (Port *our_port, std::string other_port, void *src);
@@ -143,7 +143,7 @@ class IO : public SessionObject, public Latent
static int enable_connecting (void);
static int disable_ports (void);
static int enable_ports (void);
-
+
static sigc::signal<void,ChanCount> PortCountChanged; // emitted when the number of ports changes
static std::string name_from_state (const XMLNode&);
@@ -156,7 +156,7 @@ class IO : public SessionObject, public Latent
static bool connecting_legal;
XMLNode *pending_state_node;
-
+
/* three utility functions - this just seems to be simplest place to put them */
void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset);
@@ -175,7 +175,7 @@ class IO : public SessionObject, public Latent
Direction _direction;
DataType _default_type;
bool _active;
-
+
private:
int connecting_became_legal ();
@@ -185,16 +185,16 @@ class IO : public SessionObject, public Latent
struct UserBundleInfo {
UserBundleInfo (IO*, boost::shared_ptr<UserBundle> b);
-
+
boost::shared_ptr<UserBundle> bundle;
sigc::connection changed;
};
-
+
std::vector<UserBundleInfo> _bundles_connected; ///< user bundles connected to our ports
static int parse_io_string (const std::string&, std::vector<std::string>& chns);
static int parse_gain_string (const std::string&, std::vector<std::string>& chns);
-
+
int ensure_ports (ChanCount, bool clear, bool lockit, void *src);
void check_bundles_connected ();
diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h
index d591962733..dc376b9a42 100644
--- a/libs/ardour/ardour/io_processor.h
+++ b/libs/ardour/ardour/io_processor.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,12 +45,12 @@ class IOProcessor : public Processor
{
public:
IOProcessor (Session&, bool with_input, bool with_output,
- const std::string& proc_name, const std::string io_name="",
- ARDOUR::DataType default_type = DataType::AUDIO);
+ const std::string& proc_name, const std::string io_name="",
+ ARDOUR::DataType default_type = DataType::AUDIO);
IOProcessor (Session&, boost::shared_ptr<IO> input, boost::shared_ptr<IO> output,
- const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO);
+ const std::string& proc_name, ARDOUR::DataType default_type = DataType::AUDIO);
virtual ~IOProcessor ();
-
+
bool set_name (const std::string& str);
virtual ChanCount natural_output_streams() const;
@@ -62,7 +62,7 @@ class IOProcessor : public Processor
boost::shared_ptr<const IO> output() const { return _output; }
void set_input (boost::shared_ptr<IO>);
void set_output (boost::shared_ptr<IO>);
-
+
void silence (nframes_t nframes);
void disconnect ();
@@ -70,10 +70,10 @@ class IOProcessor : public Processor
sigc::signal<void,IOProcessor*,bool> AutomationPlaybackChanged;
sigc::signal<void,IOProcessor*,uint32_t> AutomationChanged;
-
+
XMLNode& state (bool full_state);
int set_state (const XMLNode&);
-
+
protected:
boost::shared_ptr<IO> _input;
boost::shared_ptr<IO> _output;
diff --git a/libs/ardour/ardour/jack_port.h b/libs/ardour/ardour/jack_port.h
index 30ffdd9d76..3101ce9523 100644
--- a/libs/ardour/ardour/jack_port.h
+++ b/libs/ardour/ardour/jack_port.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,22 +37,22 @@ class JackPort : public virtual Port, public PortConnectableByName {
~JackPort();
- std::string short_name() const {
+ std::string short_name() const {
return jack_port_short_name (_port);
}
-
+
int set_name (const std::string& str);
-
+
bool connected () const {
return jack_port_connected (_port);
}
-
+
int reestablish ();
int reconnect ();
int connect (Port& other) {
- if( _flags & IsOutput ) {
- return 0;
+ if (_flags & IsOutput) {
+ return 0;
}
return connect (other.name());
}
@@ -73,7 +73,7 @@ class JackPort : public virtual Port, public PortConnectableByName {
}
int get_connections (std::vector<std::string>& names) const;
-
+
bool monitoring_input () const {
return jack_port_monitoring_input (_port);
}
@@ -104,12 +104,12 @@ class JackPort : public virtual Port, public PortConnectableByName {
JackPort (const std::string&, DataType type, Flags flags);
jack_port_t* _port;
- int disconnect ();
+ int disconnect ();
void recompute_total_latency() const;
std::set<std::string> _named_connections;
};
-
+
} // namespace ARDOUR
#endif /* __ardour_jack_port_h__ */
diff --git a/libs/ardour/ardour/ladspa.h b/libs/ardour/ardour/ladspa.h
index e552f35bb5..c6d7ddd0ff 100644
--- a/libs/ardour/ardour/ladspa.h
+++ b/libs/ardour/ardour/ladspa.h
@@ -3,17 +3,17 @@
Linux Audio Developer's Simple Plugin API Version 1.1[LGPL].
Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis,
Stefan Westerfeld.
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -32,7 +32,7 @@ extern "C" {
/*****************************************************************************/
-/* Overview:
+/* Overview:
There is a large number of synthesis packages in use or development
on the Linux platform at this time. This API (`The Linux Audio
@@ -76,7 +76,7 @@ extern "C" {
/* Fundamental data type passed in and out of plugin. This data type
is used to communicate audio samples and control values. It is
assumed that the plugin will work sensibly given any numeric input
- value although it may have a preferred range (see hints below).
+ value although it may have a preferred range (see hints below).
For audio it is generally assumed that 1.0f is the `0dB' reference
amplitude and is a `normal' signal level. */
@@ -85,8 +85,8 @@ typedef float LADSPA_Data;
/*****************************************************************************/
-/* Special Plugin Properties:
-
+/* Special Plugin Properties:
+
Optional features of the plugin type are encapsulated in the
LADSPA_Properties type. This is assembled by ORing individual
properties together. */
@@ -123,7 +123,7 @@ typedef int LADSPA_Properties;
(3) The plugin will not access files, devices, pipes, sockets, IPC
or any other mechanism that might result in process or thread
blocking.
-
+
(4) The plugin will take an amount of time to execute a run() or
run_adding() call approximately of form (A+B*SampleCount) where A
and B depend on the machine and host in use. This amount of time
@@ -138,7 +138,7 @@ typedef int LADSPA_Properties;
/*****************************************************************************/
-/* Plugin Ports:
+/* Plugin Ports:
Plugins have `ports' that are inputs or outputs for audio or
data. Ports can communicate arrays of LADSPA_Data (for audio
@@ -174,23 +174,23 @@ typedef int LADSPA_PortDescriptor;
/*****************************************************************************/
-/* Plugin Port Range Hints:
+/* Plugin Port Range Hints:
The host may wish to provide a representation of data entering or
leaving a plugin (e.g. to generate a GUI automatically). To make
this more meaningful, the plugin should provide `hints' to the host
describing the usual values taken by the data.
-
+
Note that these are only hints. The host may ignore them and the
plugin must not assume that data supplied to it is meaningful. If
the plugin receives invalid input data it is expected to continue
to run without failure and, where possible, produce a sensible
output (e.g. a high-pass filter given a negative cutoff frequency
might switch to an all-pass mode).
-
+
Hints are meaningful for all input and output ports but hints for
input control ports are expected to be particularly useful.
-
+
More hint information is encapsulated in the
LADSPA_PortRangeHintDescriptor type which is assembled by ORing
individual hint types together. Hints may require further
@@ -356,7 +356,7 @@ typedef struct _LADSPA_PortRangeHint {
/*****************************************************************************/
-/* Plugin Handles:
+/* Plugin Handles:
This plugin handle indicates a particular instance of the plugin
concerned. It is valid to compare this to NULL (0 for C++) but
@@ -367,13 +367,13 @@ typedef void * LADSPA_Handle;
/*****************************************************************************/
-/* Descriptor for a Type of Plugin:
+/* Descriptor for a Type of Plugin:
This structure is used to describe a plugin type. It provides a
number of functions to examine the type, instantiate it, link it to
buffers and workspaces and to run it. */
-typedef struct _LADSPA_Descriptor {
+typedef struct _LADSPA_Descriptor {
/* This numeric identifier indicates the plugin type
uniquely. Plugin programmers may reserve ranges of IDs from a
@@ -433,7 +433,7 @@ typedef struct _LADSPA_Descriptor {
instantiation function accepts a sample rate as a parameter. The
plugin descriptor from which this instantiate function was found
must also be passed. This function must return NULL if
- instantiation fails.
+ instantiation fails.
Note that instance initialisation should generally occur in
activate() rather than here. */
@@ -554,7 +554,7 @@ typedef struct _LADSPA_Descriptor {
/* Once an instance of a plugin has been finished with it can be
deleted using the following function. The instance handle passed
ceases to be valid after this call.
-
+
If activate() was called for a plugin instance then a
corresponding call to deactivate() must be made before cleanup()
is called. */
@@ -592,7 +592,7 @@ typedef struct _LADSPA_Descriptor {
const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index);
/* Datatype corresponding to the ladspa_descriptor() function. */
-typedef const LADSPA_Descriptor *
+typedef const LADSPA_Descriptor *
(*LADSPA_Descriptor_Function)(unsigned long Index);
/**********************************************************************/
diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h
index b610a87567..8128fccf94 100644
--- a/libs/ardour/ardour/ladspa_plugin.h
+++ b/libs/ardour/ardour/ladspa_plugin.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include <sigc++/signal.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include <jack/types.h>
#include "ardour/ladspa.h"
@@ -45,7 +45,7 @@ class LadspaPlugin : public ARDOUR::Plugin
~LadspaPlugin ();
/* Plugin interface */
-
+
std::string unique_id() const;
const char* label() const { return _descriptor->Label; }
const char* name() const { return _descriptor->Name; }
@@ -57,10 +57,10 @@ class LadspaPlugin : public ARDOUR::Plugin
float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
uint32_t nth_parameter (uint32_t port, bool& ok) const;
-
+
std::set<Evoral::Parameter> automatable() const;
- void activate () {
+ void activate () {
if (!_was_activated && _descriptor->activate)
_descriptor->activate (_handle);
@@ -83,7 +83,7 @@ class LadspaPlugin : public ARDOUR::Plugin
}
void set_block_size (nframes_t /*nframes*/) {}
-
+
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset);
@@ -105,7 +105,7 @@ class LadspaPlugin : public ARDOUR::Plugin
bool has_editor() const { return false; }
int require_output_streams (uint32_t);
-
+
/* LADSPA extras */
LADSPA_Properties properties() const { return _descriptor->Properties; }
@@ -114,7 +114,7 @@ class LadspaPlugin : public ARDOUR::Plugin
LADSPA_PortDescriptor port_descriptor(uint32_t i) const { return _descriptor->PortDescriptors[i]; }
const LADSPA_PortRangeHint* port_range_hints() const { return _descriptor->PortRangeHints; }
const char * const * port_names() const { return _descriptor->PortNames; }
-
+
void set_gain (float gain) { _descriptor->set_run_adding_gain (_handle, gain); }
void run_adding (uint32_t nsamples) { _descriptor->run_adding (_handle, nsamples); }
void connect_port (uint32_t port, float *ptr) { _descriptor->connect_port (_handle, port, ptr); }
@@ -136,7 +136,7 @@ class LadspaPlugin : public ARDOUR::Plugin
};
class LadspaPluginInfo : public PluginInfo {
- public:
+ public:
LadspaPluginInfo () { };
~LadspaPluginInfo () { };
diff --git a/libs/ardour/ardour/latent.h b/libs/ardour/ardour/latent.h
index c5dc792f06..d1e62aaf45 100644
--- a/libs/ardour/ardour/latent.h
+++ b/libs/ardour/ardour/latent.h
@@ -13,8 +13,8 @@ class Latent {
virtual nframes_t signal_latency() const = 0;
nframes_t user_latency () const { return _user_latency; }
- nframes_t effective_latency() const {
- if (_user_latency) {
+ nframes_t effective_latency() const {
+ if (_user_latency) {
return _user_latency;
} else {
return signal_latency ();
diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h
index b008a62f18..2a583719cc 100644
--- a/libs/ardour/ardour/location.h
+++ b/libs/ardour/ardour/location.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,8 +31,8 @@
#include <glibmm/thread.h>
#include "pbd/undo.h"
-#include "pbd/stateful.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/stateful.h"
+#include "pbd/statefuldestructible.h"
#include "ardour/ardour.h"
@@ -53,16 +53,16 @@ class Location : public PBD::StatefulDestructible
};
Location (nframes64_t sample_start,
- nframes64_t sample_end,
- const std::string &name,
- Flags bits = Flags(0))
-
+ nframes64_t sample_end,
+ const std::string &name,
+ Flags bits = Flags(0))
+
: _name (name),
_start (sample_start),
_end (sample_end),
_flags (bits),
_locked (false) { }
-
+
Location () {
_start = 0;
_end = 0;
@@ -77,7 +77,7 @@ class Location : public PBD::StatefulDestructible
bool locked() const { return _locked; }
void lock() { _locked = true; changed (this); }
void unlock() { _locked = false; changed (this); }
-
+
nframes64_t start() const { return _start; }
nframes64_t end() const { return _end; }
nframes64_t length() const { return _end - _start; }
@@ -118,7 +118,7 @@ class Location : public PBD::StatefulDestructible
/* this is sent only when both start&end change at the same time */
sigc::signal<void,Location*> changed;
-
+
/* CD Track / CD-Text info */
std::map<std::string, std::string> cd_info;
@@ -145,7 +145,7 @@ class Locations : public PBD::StatefulDestructible
Locations ();
~Locations ();
-
+
const LocationList& list() { return locations; }
void add (Location *, bool make_current = false);
diff --git a/libs/ardour/ardour/location_importer.h b/libs/ardour/ardour/location_importer.h
index 37895dbc97..2b6f1ec1c2 100644
--- a/libs/ardour/ardour/location_importer.h
+++ b/libs/ardour/ardour/location_importer.h
@@ -56,7 +56,7 @@ class LocationImporter : public ElementImporter
LocationImportHandler & handler;
XMLNode xml_location;
Location * location;
-
+
void parse_xml ();
};
diff --git a/libs/ardour/ardour/logcurve.h b/libs/ardour/ardour/logcurve.h
index b3f3b2a90a..a5f0ce4734 100644
--- a/libs/ardour/ardour/logcurve.h
+++ b/libs/ardour/ardour/logcurve.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Steve Harris & Paul Davis
+ Copyright (C) 2001 Steve Harris & Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,22 +41,22 @@ class LogCurve {
bool operator!= (const LogCurve& other) const {
return S != other.S || l != other.l;
}
-
+
float value (float frac) const {
return (fast_log(frac + S) - a) * b;
- }
-
+ }
+
float value (uint32_t pos) const {
return (fast_log(((float) pos/l) + S) - a) * b;
- }
+ }
float invert_value (float frac) const {
return (a - fast_log(frac + S)) * b;
- }
-
+ }
+
float invert_value (uint32_t pos) const {
return (a - fast_log(((float) pos/l) + S)) * b;
- }
+ }
void fill (float *vec, uint32_t veclen, bool invert) const {
float dx = 1.0f/veclen;
@@ -85,10 +85,10 @@ class LogCurve {
float steepness() const { return S; }
uint32_t length() const { return l; }
-
- void set_steepness (float steepness) {
- S = steepness;
- a = log(S);
+
+ void set_steepness (float steepness) {
+ S = steepness;
+ a = log(S);
b = 1.0f / log(1.0f + (1.0f / S));
}
void set_length (uint32_t len) { l = len; }
@@ -102,25 +102,25 @@ class LogCurve {
uint32_t l;
};
-class LogCurveIn : public LogCurve
+class LogCurveIn : public LogCurve
{
public:
- LogCurveIn (float steepness = 0.2, uint32_t len = 0)
+ LogCurveIn (float steepness = 0.2, uint32_t len = 0)
: LogCurve (steepness, len) {}
float value (float frac) const {
return (fast_log(frac + S) - a) * b;
- }
-
+ }
+
float value (uint32_t pos) const {
return (fast_log(((float) pos/l) + S) - a) * b;
- }
+ }
};
-class LogCurveOut : public LogCurve
+class LogCurveOut : public LogCurve
{
public:
- LogCurveOut (float steepness = 0.2, uint32_t len = 0)
+ LogCurveOut (float steepness = 0.2, uint32_t len = 0)
: LogCurve (steepness, len) {}
};
diff --git a/libs/ardour/ardour/lv2_event_buffer.h b/libs/ardour/ardour/lv2_event_buffer.h
index 9d35d36d55..076ccc1dd4 100644
--- a/libs/ardour/ardour/lv2_event_buffer.h
+++ b/libs/ardour/ardour/lv2_event_buffer.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -33,9 +33,9 @@ public:
inline LV2_Event_Buffer* data() { return _data; }
inline const LV2_Event_Buffer* data() const { return _data; }
-
+
inline void rewind() const { lv2_event_begin(&_iter, _data); }
-
+
inline void reset() {
_latest_frames = 0;
_latest_subframes = 0;
@@ -43,7 +43,7 @@ public:
_data->size = 0;
rewind();
}
-
+
inline size_t event_count() const { return _data->event_count; }
inline uint32_t capacity() const { return _data->capacity; }
inline uint32_t size() const { return _data->size; }
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index e354599485..de42512cfe 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -28,7 +28,7 @@
#include <sigc++/signal.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include <jack/types.h>
#include <slv2/slv2.h>
@@ -48,7 +48,7 @@ class LV2Plugin : public ARDOUR::Plugin
~LV2Plugin ();
/* Plugin interface */
-
+
std::string unique_id() const;
const char* label() const { return slv2_value_as_string(_name); }
const char* name() const { return slv2_value_as_string(_name); }
@@ -69,12 +69,12 @@ class LV2Plugin : public ARDOUR::Plugin
SLV2Port slv2_port(uint32_t i) { return slv2_plugin_get_port_by_index(_plugin, i); }
const char* port_symbol(uint32_t port);
-
+
const LV2_Feature* const* features() { return _features; }
std::set<Evoral::Parameter> automatable() const;
- void activate () {
+ void activate () {
if (!_was_activated) {
slv2_instance_activate(_instance);
_was_activated = true;
@@ -96,7 +96,7 @@ class LV2Plugin : public ARDOUR::Plugin
}
void set_block_size (nframes_t /*nframes*/) {}
-
+
int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset);
@@ -181,7 +181,7 @@ struct LV2World {
class LV2PluginInfo : public PluginInfo {
-public:
+public:
LV2PluginInfo (void* slv2_world, void* slv2_plugin);;
~LV2PluginInfo ();;
static PluginInfoList discover (void* slv2_world);
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index e1fd97f107..be8472b170 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -59,21 +59,21 @@ public:
void reset ();
void reset_max ();
-
+
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
-
+
/** Compute peaks */
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
-
- float peak_power (uint32_t n) {
+
+ float peak_power (uint32_t n) {
if (n < _visible_peak_power.size()) {
return _visible_peak_power[n];
} else {
return minus_infinity();
}
}
-
+
float max_peak_power (uint32_t n) {
if (n < _max_peak_power.size()) {
return _max_peak_power[n];
@@ -81,7 +81,7 @@ public:
return minus_infinity();
}
}
-
+
XMLNode& state (bool full);
private:
diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h
index d5f15fb621..b3ed093df7 100644
--- a/libs/ardour/ardour/midi_buffer.h
+++ b/libs/ardour/ardour/midi_buffer.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006-2009 Paul Davis
+ Copyright (C) 2006-2009 Paul Davis
Author: Dave Robillard
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -40,7 +40,7 @@ public:
void silence (nframes_t nframes, nframes_t offset = 0);
void read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
void merge_from (const Buffer& src, nframes_t nframes, nframes_t dst_offset = 0, nframes_t src_offset = 0);
-
+
void copy(const MidiBuffer& copy);
bool push_back(const Evoral::MIDIEvent<TimeType>& event);
@@ -52,10 +52,10 @@ public:
bool merge(const MidiBuffer& a, const MidiBuffer& b);
bool merge_in_place(const MidiBuffer &other);
-
+
template<typename BufferType, typename EventType>
struct iterator_base {
- iterator_base<BufferType, EventType>(BufferType& b, nframes_t o) : buffer(b), offset(o) {}
+ iterator_base<BufferType, EventType>(BufferType& b, nframes_t o) : buffer(b), offset(o) {}
inline EventType operator*() const {
uint8_t* ev_start = buffer._data + offset + sizeof(TimeType);
int event_size = Evoral::midi_event_size(ev_start);
@@ -86,7 +86,7 @@ public:
BufferType& buffer;
size_t offset;
};
-
+
typedef iterator_base< MidiBuffer, Evoral::MIDIEvent<TimeType> > iterator;
typedef iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> > const_iterator;
@@ -99,7 +99,7 @@ public:
private:
friend class iterator_base< MidiBuffer, Evoral::MIDIEvent<TimeType> >;
friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >;
-
+
uint8_t* _data; ///< timestamp, event, timestamp, event, ...
};
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index 730d6c0276..7035cdfd02 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,7 +54,7 @@ class Send;
class Session;
class MidiDiskstream : public Diskstream
-{
+{
public:
MidiDiskstream (Session &, const string& name, Diskstream::Flag f = Recordable);
MidiDiskstream (Session &, const XMLNode&);
@@ -62,7 +62,7 @@ class MidiDiskstream : public Diskstream
float playback_buffer_load() const;
float capture_buffer_load() const;
-
+
void get_playback(MidiBuffer& dst, nframes_t start, nframes_t end);
void set_record_enabled (bool yn);
@@ -78,16 +78,16 @@ class MidiDiskstream : public Diskstream
int set_state(const XMLNode& node);
void monitor_input (bool);
-
+
MidiRingBuffer<nframes_t>* playback_buffer () { return _playback_buf; }
MidiRingBuffer<nframes_t>* capture_buffer () { return _capture_buf; }
boost::shared_ptr<SMFSource> write_source () { return _write_source; }
-
+
int set_destructive (bool yn); // doom!
-
+
void set_note_mode (NoteMode m);
-
- uint16_t get_channel_mask() {
+
+ uint16_t get_channel_mask() {
uint16_t playback_mask = _playback_buf->get_channel_mask();
#ifndef NDEBUG
uint16_t capture_mask = _capture_buf->get_channel_mask();
@@ -97,10 +97,10 @@ class MidiDiskstream : public Diskstream
}
void set_channel_mode(ChannelMode mode, uint16_t mask) {
- _playback_buf->set_channel_mode(mode, mask);
- _capture_buf->set_channel_mode(mode, mask);
+ _playback_buf->set_channel_mode(mode, mask);
+ _capture_buf->set_channel_mode(mode, mask);
}
-
+
ChannelMode get_channel_mode() {
ChannelMode playback_mode = _playback_buf->get_channel_mode();
#ifndef NDEBUG
@@ -145,7 +145,7 @@ class MidiDiskstream : public Diskstream
/* The two central butler operations */
int do_flush (RunContext context, bool force = false);
int do_refill ();
-
+
int do_refill_with_alloc();
int read (nframes_t& start, nframes_t cnt, bool reversed);
@@ -167,7 +167,7 @@ class MidiDiskstream : public Diskstream
void get_input_sources ();
void check_record_status (nframes_t transport_frame, nframes_t nframes, bool can_record);
void set_align_style_from_io();
-
+
void engage_record_enable ();
void disengage_record_enable ();
@@ -176,7 +176,7 @@ class MidiDiskstream : public Diskstream
MidiPort* _source_port;
boost::shared_ptr<SMFSource> _write_source;
nframes_t _last_flush_frame;
- NoteMode _note_mode;
+ NoteMode _note_mode;
volatile gint _frames_written_to_ringbuffer;
volatile gint _frames_read_from_ringbuffer;
};
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h
index 460e790323..6ea4a4cd30 100644
--- a/libs/ardour/ardour/midi_model.h
+++ b/libs/ardour/ardour/midi_model.h
@@ -18,7 +18,7 @@
*/
-#ifndef __ardour_midi_model_h__
+#ifndef __ardour_midi_model_h__
#define __ardour_midi_model_h__
#include <queue>
@@ -52,7 +52,7 @@ public:
typedef double TimeType;
MidiModel(MidiSource* s, size_t size=0);
-
+
NoteMode note_mode() const { return (percussive() ? Percussive : Sustained); }
void set_note_mode(NoteMode mode) { set_percussive(mode == Percussive); };
@@ -66,10 +66,10 @@ public:
DeltaCommand (boost::shared_ptr<MidiModel> m, const XMLNode& node);
const std::string& name() const { return _name; }
-
+
void operator()();
void undo();
-
+
int set_state (const XMLNode&);
XMLNode& get_state ();
@@ -79,12 +79,12 @@ public:
private:
XMLNode &marshal_note(const boost::shared_ptr< Evoral::Note<TimeType> > note);
boost::shared_ptr< Evoral::Note<TimeType> > unmarshal_note(XMLNode *xml_note);
-
+
boost::shared_ptr<MidiModel> _model;
const std::string _name;
-
+
typedef std::list< boost::shared_ptr< Evoral::Note<TimeType> > > NoteList;
-
+
NoteList _added_notes;
NoteList _removed_notes;
};
@@ -110,35 +110,35 @@ public:
DiffCommand (boost::shared_ptr<MidiModel> m, const XMLNode& node);
const std::string& name() const { return _name; }
-
+
void operator()();
void undo();
-
+
int set_state (const XMLNode&);
XMLNode& get_state ();
-
- void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,
- Property prop, uint8_t new_value);
- void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,
- Property prop, TimeType new_time);
-
+
+ void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,
+ Property prop, uint8_t new_value);
+ void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,
+ Property prop, TimeType new_time);
+
private:
boost::shared_ptr<MidiModel> _model;
const std::string _name;
struct NotePropertyChange {
- DiffCommand::Property property;
- boost::shared_ptr<Evoral::Note<TimeType> > note;
- union {
- uint8_t old_value;
- TimeType old_time;
- };
- union {
- uint8_t new_value;
- TimeType new_time;
- };
- };
-
+ DiffCommand::Property property;
+ boost::shared_ptr<Evoral::Note<TimeType> > note;
+ union {
+ uint8_t old_value;
+ TimeType old_time;
+ };
+ union {
+ uint8_t new_value;
+ TimeType new_time;
+ };
+ };
+
typedef std::list<NotePropertyChange> ChangeList;
ChangeList _changes;
@@ -154,22 +154,22 @@ public:
bool write_to(boost::shared_ptr<MidiSource> source);
-
+
// MidiModel doesn't use the normal AutomationList serialisation code
// since controller data is stored in the .mid
XMLNode& get_state();
int set_state(const XMLNode&) { return 0; }
sigc::signal<void> ContentsChanged;
-
+
const MidiSource* midi_source() const { return _midi_source; }
- void set_midi_source(MidiSource* source) { _midi_source = source; }
+ void set_midi_source(MidiSource* source) { _midi_source = source; }
boost::shared_ptr<Evoral::Note<TimeType> > find_note (boost::shared_ptr<Evoral::Note<TimeType> >);
-
+
private:
friend class DeltaCommand;
-
+
// We cannot use a boost::shared_ptr here to avoid a retain cycle
MidiSource* _midi_source;
};
diff --git a/libs/ardour/ardour/midi_operator.h b/libs/ardour/ardour/midi_operator.h
index 64ceaad841..31e412bafe 100644
--- a/libs/ardour/ardour/midi_operator.h
+++ b/libs/ardour/ardour/midi_operator.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ class MidiOperator {
public:
MidiOperator () {}
virtual ~MidiOperator() {}
-
+
virtual Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>, std::vector<Evoral::Sequence<Evoral::MusicalTime>::Notes>&) = 0;
virtual std::string name() const = 0;
};
diff --git a/libs/ardour/ardour/midi_patch_manager.h b/libs/ardour/ardour/midi_patch_manager.h
index 057d4f7b1d..a48c9ddfe7 100644
--- a/libs/ardour/ardour/midi_patch_manager.h
+++ b/libs/ardour/ardour/midi_patch_manager.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Hans Baier
+ Copyright (C) 2008 Hans Baier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,89 +40,88 @@ private:
MidiPatchManager() {};
MidiPatchManager( const MidiPatchManager& );
MidiPatchManager& operator= (const MidiPatchManager&);
-
- static MidiPatchManager* _manager;
-
+
+ static MidiPatchManager* _manager;
+
public:
typedef std::map<std::string, boost::shared_ptr<MIDINameDocument> > MidiNameDocuments;
-
+
virtual ~MidiPatchManager() { _manager = 0; }
-
- static MidiPatchManager& instance() {
+
+ static MidiPatchManager& instance() {
if (_manager == 0) {
_manager = new MidiPatchManager();
}
- return *_manager;
+ return *_manager;
}
-
+
void set_session (ARDOUR::Session&);
-
- boost::shared_ptr<MIDINameDocument> document_by_model(std::string model_name)
+
+ boost::shared_ptr<MIDINameDocument> document_by_model(std::string model_name)
{ return _documents[model_name]; }
-
- boost::shared_ptr<MasterDeviceNames> master_device_by_model(std::string model_name)
+
+ boost::shared_ptr<MasterDeviceNames> master_device_by_model(std::string model_name)
{ return _master_devices_by_model[model_name]; }
-
+
boost::shared_ptr<ChannelNameSet> find_channel_name_set(
- std::string model,
- std::string custom_device_mode,
+ std::string model,
+ std::string custom_device_mode,
uint8_t channel) {
boost::shared_ptr<MIDI::Name::MasterDeviceNames> master_device = master_device_by_model(model);
-
+
if (master_device != 0 && custom_device_mode != "") {
- return master_device->
- channel_name_set_by_device_mode_and_channel(custom_device_mode, channel);
+ return master_device->channel_name_set_by_device_mode_and_channel(custom_device_mode, channel);
} else {
return boost::shared_ptr<ChannelNameSet>();
- }
+ }
}
-
+
boost::shared_ptr<Patch> find_patch(
- std::string model,
- std::string custom_device_mode,
- uint8_t channel,
+ std::string model,
+ std::string custom_device_mode,
+ uint8_t channel,
PatchPrimaryKey patch_key) {
-
+
boost::shared_ptr<ChannelNameSet> channel_name_set = find_channel_name_set(model, custom_device_mode, channel);
-
+
if (channel_name_set) {
- return channel_name_set->find_patch(patch_key);
+ return channel_name_set->find_patch(patch_key);
} else {
return boost::shared_ptr<Patch>();
}
}
-
+
boost::shared_ptr<Patch> previous_patch(
- std::string model,
- std::string custom_device_mode,
- uint8_t channel,
+ std::string model,
+ std::string custom_device_mode,
+ uint8_t channel,
PatchPrimaryKey patch_key) {
-
+
boost::shared_ptr<ChannelNameSet> channel_name_set = find_channel_name_set(model, custom_device_mode, channel);
-
+
if (channel_name_set) {
- return channel_name_set->previous_patch(patch_key);
+ return channel_name_set->previous_patch(patch_key);
} else {
return boost::shared_ptr<Patch>();
}
}
-
+
boost::shared_ptr<Patch> next_patch(
- std::string model,
- std::string custom_device_mode,
- uint8_t channel,
+ std::string model,
+ std::string custom_device_mode,
+ uint8_t channel,
PatchPrimaryKey patch_key) {
-
+
boost::shared_ptr<ChannelNameSet> channel_name_set = find_channel_name_set(model, custom_device_mode, channel);
-
+
if (channel_name_set) {
- return channel_name_set->next_patch(patch_key);
+ return channel_name_set->next_patch(patch_key);
} else {
return boost::shared_ptr<Patch>();
}
}
-
+
std::list<std::string> custom_device_mode_names_by_model(std::string model_name) {
if (model_name != "") {
return master_device_by_model(model_name)->custom_device_mode_names();
@@ -130,13 +129,13 @@ public:
return std::list<std::string>();
}
}
-
+
const MasterDeviceNames::Models& all_models() const { return _all_models; }
-
+
private:
void drop_session();
void refresh();
-
+
ARDOUR::Session* _session;
MidiNameDocuments _documents;
MIDINameDocument::MasterDeviceNamesList _master_devices_by_model;
diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h
index da8391a16b..11c1288e92 100644
--- a/libs/ardour/ardour/midi_playlist.h
+++ b/libs/ardour/ardour/midi_playlist.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Written by Dave Robillard, 2006
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -53,7 +53,7 @@ public:
int set_state (const XMLNode&);
bool destroy_region (boost::shared_ptr<Region>);
-
+
void set_note_mode (NoteMode m) { _note_mode = m; }
std::set<Evoral::Parameter> contained_automation();
@@ -63,7 +63,7 @@ protected:
/* playlist "callbacks" */
void finalize_split_region (boost::shared_ptr<Region> original, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
-
+
void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
void refresh_dependents (boost::shared_ptr<Region> region);
void remove_dependents (boost::shared_ptr<Region> region);
@@ -72,8 +72,8 @@ private:
void dump () const;
bool region_changed (Change, boost::shared_ptr<Region>);
-
- NoteMode _note_mode;
+
+ NoteMode _note_mode;
};
} /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/midi_port.h b/libs/ardour/ardour/midi_port.h
index e4d6a41d05..749829b7ea 100644
--- a/libs/ardour/ardour/midi_port.h
+++ b/libs/ardour/ardour/midi_port.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ class MidiPort : public Port {
void cycle_end (nframes_t nframes);
void cycle_split ();
void flush_buffers (nframes_t nframes, nframes_t offset = 0);
-
+
size_t raw_buffer_size(jack_nframes_t nframes) const;
Buffer& get_buffer (nframes_t nframes, nframes_t offset = 0) {
@@ -53,13 +53,13 @@ class MidiPort : public Port {
friend class AudioEngine;
MidiPort (const std::string& name, Flags);
-
+
private:
MidiBuffer* _buffer;
bool _has_been_mixed_down;
};
-
+
} // namespace ARDOUR
#endif /* __ardour_midi_port_h__ */
diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h
index 93a9f76f31..50fc1516df 100644
--- a/libs/ardour/ardour/midi_region.h
+++ b/libs/ardour/ardour/midi_region.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,14 +50,14 @@ class MidiRegion : public Region
~MidiRegion();
boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const;
-
+
/* Stub Readable interface */
virtual nframes_t read (Sample*, sframes_t /*pos*/, nframes_t /*cnt*/, int /*channel*/) const { return 0; }
virtual sframes_t readable_length() const { return length(); }
nframes_t read_at (MidiRingBuffer<nframes_t>& dst,
sframes_t position,
- nframes_t dur,
+ nframes_t dur,
uint32_t chan_n = 0,
NoteMode mode = Sustained) const;
@@ -71,9 +71,9 @@ class MidiRegion : public Region
int set_state (const XMLNode&);
int separate_by_channel (ARDOUR::Session&, std::vector< boost::shared_ptr<Region> >&) const;
-
+
/* automation */
-
+
boost::shared_ptr<Evoral::Control>
control(const Evoral::Parameter& id, bool create=false) {
return model()->data().control(id, create);
@@ -85,7 +85,7 @@ class MidiRegion : public Region
}
/* export */
-
+
int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&);
boost::shared_ptr<MidiModel> model() { return midi_source()->model(); }
@@ -104,14 +104,14 @@ class MidiRegion : public Region
private:
nframes_t _read_at (const SourceList&, MidiRingBuffer<nframes_t>& dst,
- nframes_t position,
- nframes_t dur,
- uint32_t chan_n = 0,
- NoteMode mode = Sustained) const;
+ nframes_t position,
+ nframes_t dur,
+ uint32_t chan_n = 0,
+ NoteMode mode = Sustained) const;
void recompute_at_start ();
void recompute_at_end ();
-
+
void set_position_internal (nframes_t pos, bool allow_bbt_recompute);
void switch_source(boost::shared_ptr<Source> source);
diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h
index f879aa7534..2de611f4d6 100644
--- a/libs/ardour/ardour/midi_ring_buffer.h
+++ b/libs/ardour/ardour/midi_ring_buffer.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ public:
size_t read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes_t offset=0);
void dump(std::ostream& dst);
-
+
/** Set the channel filtering mode.
* @param mask If mode is FilterChannels, each bit represents a midi channel:
* bit 0 = channel 0, bit 1 = channel 1 etc. the read and write methods will only
@@ -67,11 +67,11 @@ public:
ChannelMode get_channel_mode() const {
return static_cast<ChannelMode>((g_atomic_int_get(&_channel_mask) & 0xFFFF0000) >> 16);
}
-
+
uint16_t get_channel_mask() const {
return g_atomic_int_get(&_channel_mask) & 0x0000FFFF;
}
-
+
protected:
inline bool is_channel_event(uint8_t event_type_byte) {
// mask out channel information
@@ -79,7 +79,7 @@ protected:
// midi channel events range from 0x80 to 0xE0
return (0x80 <= event_type_byte) && (event_type_byte <= 0xE0);
}
-
+
private:
volatile uint32_t _channel_mask; // 16 bits mode, 16 bits mask
};
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index a479b4a8a8..7056748786 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Written by Dave Robillard, 2006
This program is free software; you can redistribute it and/or modify
@@ -46,7 +46,7 @@ class MidiSource : virtual public Source
MidiSource (Session& session, std::string name, Source::Flag flags = Source::Flag(0));
MidiSource (Session& session, const XMLNode&);
virtual ~MidiSource ();
-
+
/** Read the data in a given time range from the MIDI source.
* All time stamps in parameters are in audio frames (even if the source has tempo time).
* \param dst Ring buffer where read events are written
@@ -69,14 +69,14 @@ class MidiSource : virtual public Source
virtual void append_event_unlocked_frames(const Evoral::Event<nframes_t>& ev,
sframes_t source_start) = 0;
-
+
virtual sframes_t length (sframes_t pos) const;
virtual void update_length (sframes_t pos, sframes_t cnt);
virtual void mark_streaming_midi_write_started (NoteMode mode, sframes_t start_time);
virtual void mark_streaming_write_started ();
virtual void mark_streaming_write_completed ();
-
+
virtual void session_saved();
std::string captured_for() const { return _captured_for; }
@@ -86,13 +86,13 @@ class MidiSource : virtual public Source
uint32_t write_data_count() const { return _write_data_count; }
static sigc::signal<void,MidiSource*> MidiSourceCreated;
-
+
// Signal a range of recorded data is available for reading from model()
mutable sigc::signal<void,sframes_t,nframes_t> ViewDataRangeReady;
-
+
XMLNode& get_state ();
int set_state (const XMLNode&);
-
+
bool length_mutable() const { return true; }
virtual void load_model(bool lock=true, bool force_reload=false) = 0;
@@ -104,14 +104,14 @@ class MidiSource : virtual public Source
void invalidate();
void set_note_mode(NoteMode mode);
-
+
boost::shared_ptr<MidiModel> model() { return _model; }
void set_model(boost::shared_ptr<MidiModel> m) { _model = m; }
void drop_model() { _model.reset(); }
protected:
virtual void flush_midi() = 0;
-
+
virtual nframes_t read_unlocked (MidiRingBuffer<nframes_t>& dst,
sframes_t position,
sframes_t start, nframes_t cnt,
@@ -120,16 +120,16 @@ class MidiSource : virtual public Source
virtual nframes_t write_unlocked (MidiRingBuffer<nframes_t>& dst,
sframes_t position,
nframes_t cnt) = 0;
-
+
std::string _captured_for;
mutable uint32_t _read_data_count; ///< modified in read()
mutable uint32_t _write_data_count; ///< modified in write()
-
+
boost::shared_ptr<MidiModel> _model;
bool _writing;
-
+
mutable Evoral::Sequence<Evoral::MusicalTime>::const_iterator _model_iter;
-
+
mutable double _length_beats;
mutable sframes_t _last_read_end;
sframes_t _last_write_end;
diff --git a/libs/ardour/ardour/midi_state_tracker.h b/libs/ardour/ardour/midi_state_tracker.h
index f9b39f9295..f5a44788db 100644
--- a/libs/ardour/ardour/midi_state_tracker.h
+++ b/libs/ardour/ardour/midi_state_tracker.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Torben Hohn
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -49,4 +49,4 @@ private:
} // namespace ARDOUR
-#endif // __ardour_midi_state_tracker_h__
+#endif // __ardour_midi_state_tracker_h__
diff --git a/libs/ardour/ardour/midi_stretch.h b/libs/ardour/ardour/midi_stretch.h
index 53f73578eb..9dbfbca2bd 100644
--- a/libs/ardour/ardour/midi_stretch.h
+++ b/libs/ardour/ardour/midi_stretch.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h
index f8bca2304c..85941cd0ef 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006 Paul Davis
- Written by Dave Robillard
-
+ Copyright (C) 2006 Paul Davis
+ Written by Dave Robillard
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -38,10 +38,10 @@ public:
MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
MidiTrack (Session&, const XMLNode&);
~MidiTrack ();
-
- int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- int declick, bool can_record, bool rec_monitors_input);
-
+
+ int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ int declick, bool can_record, bool rec_monitors_input);
+
void handle_transport_stopped (bool abort, bool did_locate, bool flush_processors);
boost::shared_ptr<MidiDiskstream> midi_diskstream() const;
@@ -57,27 +57,27 @@ public:
void unfreeze ();
boost::shared_ptr<Region> bounce (InterThreadInfo&);
- boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&,
- bool enable_processing);
+ boost::shared_ptr<Region> bounce_range (
+ nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing);
int set_state(const XMLNode& node);
void midi_panic(void);
bool write_immediate_event(size_t size, const uint8_t* buf);
-
+
/** A control that will send "immediate" events to a MIDI track when twiddled */
struct MidiControl : public AutomationControl {
- MidiControl(MidiTrack* route, const Evoral::Parameter& param,
+ MidiControl(MidiTrack* route, const Evoral::Parameter& param,
boost::shared_ptr<AutomationList> al = boost::shared_ptr<AutomationList>())
: AutomationControl (route->session(), param, al)
, _route (route)
{}
-
- void set_value (float val);
-
+
+ void set_value (float val);
+
MidiTrack* _route;
};
-
+
NoteMode note_mode() const { return _note_mode; }
void set_note_mode (NoteMode m);
@@ -90,15 +90,15 @@ public:
bool midi_thru() const { return _midi_thru; }
void set_midi_thru (bool yn);
-
+
protected:
XMLNode& state (bool full);
-
+
int _set_state (const XMLNode&, bool call_base);
private:
- void write_out_of_band_data (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
- nframes_t nframes);
+ void write_out_of_band_data (
+ BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
int set_diskstream (boost::shared_ptr<MidiDiskstream> ds);
void use_new_diskstream ();
@@ -114,9 +114,9 @@ private:
uint8_t _default_channel;
bool _midi_thru;
-
- int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input);
+
+ int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ bool state_changing, bool can_record, bool rec_monitors_input);
void push_midi_input_to_step_edit_ringbuffer (nframes_t nframes);
};
diff --git a/libs/ardour/ardour/mtdm.h b/libs/ardour/ardour/mtdm.h
index 7fa9707554..4948d844f4 100644
--- a/libs/ardour/ardour/mtdm.h
+++ b/libs/ardour/ardour/mtdm.h
@@ -1,6 +1,6 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -25,34 +25,34 @@
#include <unistd.h>
class MTDM {
- public:
-
- MTDM ();
-
- int process (size_t len, float *inp, float *out);
- int resolve (void);
- void invert (void) { _inv ^= 1; }
- int inv (void) { return _inv; }
- double del (void) { return _del; }
- double err (void) { return _err; }
-
- private:
- class Freq {
- public:
- int p;
- int f;
- float a;
- float xa;
- float ya;
- float xf;
- float yf;
- };
-
- double _del;
- double _err;
- int _cnt;
- int _inv;
- Freq _freq [5];
+public:
+
+ MTDM ();
+
+ int process (size_t len, float *inp, float *out);
+ int resolve (void);
+ void invert (void) { _inv ^= 1; }
+ int inv (void) { return _inv; }
+ double del (void) { return _del; }
+ double err (void) { return _err; }
+
+private:
+ class Freq {
+ public:
+ int p;
+ int f;
+ float a;
+ float xa;
+ float ya;
+ float xf;
+ float yf;
+ };
+
+ double _del;
+ double _err;
+ int _cnt;
+ int _inv;
+ Freq _freq [5];
};
#endif /* __libardour_mtdm_h__ */
diff --git a/libs/ardour/ardour/mute_master.h b/libs/ardour/ardour/mute_master.h
index eb64181d89..1b06b4bf7c 100644
--- a/libs/ardour/ardour/mute_master.h
+++ b/libs/ardour/ardour/mute_master.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ class MuteMaster : public AutomationControl
Listen = 0x4,
Main = 0x8
};
-
+
MuteMaster (Session& s, const std::string& name);
~MuteMaster() {}
@@ -48,7 +48,7 @@ class MuteMaster : public AutomationControl
bool muted_at (MutePoint mp) const { return _mute_point & mp; }
bool muted() const { return _mute_point != MutePoint (0); }
-
+
gain_t mute_gain_at (MutePoint) const;
void clear_mute ();
diff --git a/libs/ardour/ardour/named_selection.h b/libs/ardour/ardour/named_selection.h
index 0c13bcedc1..2dcfbd131c 100644
--- a/libs/ardour/ardour/named_selection.h
+++ b/libs/ardour/ardour/named_selection.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
+ Copyright (C) 2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include <list>
#include <boost/shared_ptr.hpp>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
class XMLNode;
diff --git a/libs/ardour/ardour/noise.h b/libs/ardour/ardour/noise.h
index f775fcce36..96a582ef9b 100644
--- a/libs/ardour/ardour/noise.h
+++ b/libs/ardour/ardour/noise.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/onset_detector.h b/libs/ardour/ardour/onset_detector.h
index 1724f216b6..dea4efe1ab 100644
--- a/libs/ardour/ardour/onset_detector.h
+++ b/libs/ardour/ardour/onset_detector.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,7 +43,7 @@ class OnsetDetector : public AudioAnalyser
int run (const std::string& path, Readable*, uint32_t channel, AnalysisFeatureList& results);
static void cleanup_onsets (AnalysisFeatureList&, float sr, float gap_msecs);
-
+
protected:
AnalysisFeatureList* current_results;
int use_features (Vamp::Plugin::FeatureSet&, std::ostream*);
diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h
index 474b3193c7..c211aafc8c 100644
--- a/libs/ardour/ardour/panner.h
+++ b/libs/ardour/ardour/panner.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include <iostream>
#include <sigc++/signal.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "pbd/controllable.h"
#include "ardour/types.h"
@@ -67,16 +67,16 @@ class StreamPanner : public sigc::trackable, public PBD::Stateful
virtual void distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes) = 0;
virtual void distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers) = 0;
+ nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers) = 0;
boost::shared_ptr<AutomationControl> pan_control() { return _control; }
-
+
sigc::signal<void> Changed; /* for position */
sigc::signal<void> StateChanged; /* for mute */
int set_state (const XMLNode&);
virtual XMLNode& state (bool full_state) = 0;
-
+
Panner & get_parent() { return parent; }
/* old school automation loading */
@@ -90,7 +90,7 @@ class StreamPanner : public sigc::trackable, public PBD::Stateful
float x;
float y;
float z;
-
+
/* these are for automation. they store the last value
used by the most recent process() cycle.
*/
@@ -114,7 +114,7 @@ class BaseStereoPanner : public StreamPanner
~BaseStereoPanner ();
/* this class just leaves the pan law itself to be defined
- by the update(), distribute_automated()
+ by the update(), distribute_automated()
methods. derived classes also need a factory method
and a type name. See EqualPowerStereoPanner as an example.
*/
@@ -140,8 +140,8 @@ class EqualPowerStereoPanner : public BaseStereoPanner
EqualPowerStereoPanner (Panner&, Evoral::Parameter param);
~EqualPowerStereoPanner ();
- void distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
+ void distribute_automated (AudioBuffer& src, BufferSet& obufs,
+ nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
void get_current_coefficients (pan_t*) const;
void get_desired_coefficients (pan_t*) const;
@@ -149,8 +149,8 @@ class EqualPowerStereoPanner : public BaseStereoPanner
static StreamPanner* factory (Panner&, Evoral::Parameter param);
static std::string name;
- XMLNode& state (bool full_state);
- XMLNode& get_state (void);
+ XMLNode& state (bool full_state);
+ XMLNode& get_state (void);
int set_state (const XMLNode&);
private:
@@ -165,12 +165,12 @@ class Multi2dPanner : public StreamPanner
void distribute (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes);
void distribute_automated (AudioBuffer& src, BufferSet& obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
+ nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
static StreamPanner* factory (Panner&, Evoral::Parameter);
static std::string name;
- XMLNode& state (bool full_state);
+ XMLNode& state (bool full_state);
XMLNode& get_state (void);
int set_state (const XMLNode&);
@@ -185,16 +185,16 @@ class Multi2dPanner : public StreamPanner
class Panner : public SessionObject, public AutomatableControls
{
- public:
+public:
struct Output {
- float x;
- float y;
- pan_t current_pan;
- pan_t desired_pan;
-
- Output (float xp, float yp)
- : x (xp), y (yp), current_pan (0.0f), desired_pan (0.f) {}
-
+ float x;
+ float y;
+ pan_t current_pan;
+ pan_t desired_pan;
+
+ Output (float xp, float yp)
+ : x (xp), y (yp), current_pan (0.0f), desired_pan (0.f) {}
+
};
//Panner (std::string name, Session&, int _num_bufs);
@@ -248,7 +248,7 @@ class Panner : public SessionObject, public AutomatableControls
LinkDirection link_direction() const { return _link_direction; }
void set_link_direction (LinkDirection);
-
+
bool linked() const { return _linked; }
void set_linked (bool yn);
@@ -260,7 +260,7 @@ class Panner : public SessionObject, public AutomatableControls
sigc::signal<void> StateChanged; /* for bypass */
/* only StreamPanner should call these */
-
+
void set_position (float x, StreamPanner& orig);
void set_position (float x, float y, StreamPanner& orig);
void set_position (float x, float y, float z, StreamPanner& orig);
@@ -270,31 +270,31 @@ class Panner : public SessionObject, public AutomatableControls
int load ();
struct PanControllable : public AutomationControl {
- PanControllable (Session& s, std::string name, Panner& p, Evoral::Parameter param)
+ PanControllable (Session& s, std::string name, Panner& p, Evoral::Parameter param)
: AutomationControl (s, param,
boost::shared_ptr<AutomationList>(new AutomationList(param)), name)
, panner (p)
{ assert(param.type() != NullAutomation); }
-
+
AutomationList* alist() { return (AutomationList*)_list.get(); }
- Panner& panner;
-
- void set_value (float);
- float get_value (void) const;
+ Panner& panner;
+
+ void set_value (float);
+ float get_value (void) const;
};
boost::shared_ptr<AutomationControl> pan_control (int id, int chan=0) {
- return automation_control(Evoral::Parameter (PanAutomation, chan, id));
+ return automation_control(Evoral::Parameter (PanAutomation, chan, id));
}
boost::shared_ptr<const AutomationControl> pan_control (int id, int chan=0) const {
- return automation_control(Evoral::Parameter (PanAutomation, chan, id));
+ return automation_control(Evoral::Parameter (PanAutomation, chan, id));
}
private:
/* disallow copy construction */
Panner (Panner const &);
-
+
void distribute_no_automation(BufferSet& src, BufferSet& dest, nframes_t nframes, gain_t gain_coeff);
std::vector<StreamPanner*> _streampanners;
uint32_t current_outs;
diff --git a/libs/ardour/ardour/peak.h b/libs/ardour/ardour/peak.h
index 3d380b2b03..5be2c08f41 100644
--- a/libs/ardour/ardour/peak.h
+++ b/libs/ardour/ardour/peak.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,12 +25,12 @@
#include "ardour/utils.h"
static inline float
-default_compute_peak (const ARDOUR::Sample * const buf, nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * const buf, nframes_t nsamples, float current)
{
for (nframes_t i = 0; i < nsamples; ++i) {
current = f_max (current, fabsf (buf[i]));
}
return current;
-}
+}
#endif /* __ardour_peak_h__ */
diff --git a/libs/ardour/ardour/pitch.h b/libs/ardour/ardour/pitch.h
index 589c370409..8c7718f685 100644
--- a/libs/ardour/ardour/pitch.h
+++ b/libs/ardour/ardour/pitch.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
#ifdef WAF_BUILD
#include "libardour-config.h"
-#endif
+#endif
#include "ardour/filter.h"
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 6778a70f53..56c755bebb 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
#include <sigc++/signal.h>
#include "pbd/undo.h"
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "pbd/statefuldestructible.h"
#include "evoral/types.hpp"
@@ -62,7 +62,7 @@ class Playlist : public SessionObject,
Playlist (boost::shared_ptr<const Playlist>, std::string name, bool hidden = false);
Playlist (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, std::string name, bool hidden = false);
- virtual ~Playlist ();
+ virtual ~Playlist ();
void set_region_ownership ();
@@ -148,10 +148,10 @@ class Playlist : public SessionObject,
uint32_t read_data_count() const { return _read_data_count; }
const PBD::ID& get_orig_diskstream_id () const { return _orig_diskstream_id; }
- void set_orig_diskstream_id (const PBD::ID& did) { _orig_diskstream_id = did; }
+ void set_orig_diskstream_id (const PBD::ID& did) { _orig_diskstream_id = did; }
/* destructive editing */
-
+
virtual bool destroy_region (boost::shared_ptr<Region>) = 0;
/* special case function used by UI selection objects, which have playlists that actually own the regions
@@ -163,7 +163,7 @@ class Playlist : public SessionObject,
bool explicit_relayering () const {
return _explicit_relayering;
}
-
+
void set_explicit_relayering (bool e);
protected:
@@ -171,20 +171,20 @@ class Playlist : public SessionObject,
protected:
struct RegionLock {
- RegionLock (Playlist *pl, bool do_block_notify = true) : playlist (pl), block_notify (do_block_notify) {
- playlist->region_lock.lock();
- if (block_notify) {
- playlist->delay_notifications();
- }
- }
- ~RegionLock() {
- playlist->region_lock.unlock();
- if (block_notify) {
- playlist->release_notifications ();
- }
- }
- Playlist *playlist;
- bool block_notify;
+ RegionLock (Playlist *pl, bool do_block_notify = true) : playlist (pl), block_notify (do_block_notify) {
+ playlist->region_lock.lock();
+ if (block_notify) {
+ playlist->delay_notifications();
+ }
+ }
+ ~RegionLock() {
+ playlist->region_lock.unlock();
+ if (block_notify) {
+ playlist->release_notifications ();
+ }
+ }
+ Playlist *playlist;
+ bool block_notify;
};
friend class RegionLock;
@@ -219,8 +219,8 @@ class Playlist : public SessionObject,
uint32_t _read_data_count;
PBD::ID _orig_diskstream_id;
uint64_t layer_op_counter;
- nframes_t freeze_length;
- bool auto_partition;
+ nframes_t freeze_length;
+ bool auto_partition;
/** true if relayering should be done using region's current layers and their `pending explicit relayer'
* flags; otherwise false if relayering should be done using the layer-model (most recently moved etc.)
@@ -230,7 +230,7 @@ class Playlist : public SessionObject,
void init (bool hide);
- bool holding_state () const {
+ bool holding_state () const {
return g_atomic_int_get (&block_notifications) != 0 ||
g_atomic_int_get (&ignore_state_changes) != 0;
}
@@ -265,7 +265,7 @@ class Playlist : public SessionObject,
void splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude);
virtual void finalize_split_region (boost::shared_ptr<Region> /*original*/, boost::shared_ptr<Region> /*left*/, boost::shared_ptr<Region> /*right*/) {}
-
+
virtual void check_dependents (boost::shared_ptr<Region> /*region*/, bool /*norefresh*/) {}
virtual void refresh_dependents (boost::shared_ptr<Region> /*region*/) {}
virtual void remove_dependents (boost::shared_ptr<Region> /*region*/) {}
@@ -275,7 +275,7 @@ class Playlist : public SessionObject,
boost::shared_ptr<Region> region_by_id (PBD::ID);
bool add_region_internal (boost::shared_ptr<Region>, nframes_t position);
-
+
int remove_region_internal (boost::shared_ptr<Region>);
RegionList *find_regions_at (nframes_t frame);
void copy_regions (RegionList&) const;
@@ -283,14 +283,14 @@ class Playlist : public SessionObject,
nframes_t _get_maximum_extent() const;
- boost::shared_ptr<Playlist> cut_copy (boost::shared_ptr<Playlist> (Playlist::*pmf)(nframes_t, nframes_t, bool),
- std::list<AudioRange>& ranges, bool result_is_hidden);
+ boost::shared_ptr<Playlist> cut_copy (boost::shared_ptr<Playlist> (Playlist::*pmf)(nframes_t, nframes_t, bool),
+ std::list<AudioRange>& ranges, bool result_is_hidden);
boost::shared_ptr<Playlist> cut (nframes_t start, nframes_t cnt, bool result_is_hidden);
boost::shared_ptr<Playlist> copy (nframes_t start, nframes_t cnt, bool result_is_hidden);
int move_region_to_layer (layer_t, boost::shared_ptr<Region> r, int dir);
void relayer ();
-
+
void unset_freeze_parent (Playlist*);
void unset_freeze_child (Playlist*);
diff --git a/libs/ardour/ardour/playlist_factory.h b/libs/ardour/ardour/playlist_factory.h
index 46e27d9b87..02bd68ae7a 100644
--- a/libs/ardour/ardour/playlist_factory.h
+++ b/libs/ardour/ardour/playlist_factory.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h
index a1fe25d31d..d80f299385 100644
--- a/libs/ardour/ardour/plugin.h
+++ b/libs/ardour/ardour/plugin.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include <sigc++/signal.h>
#include <glibmm/ustring.h>
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "pbd/controllable.h"
#include <jack/types.h>
@@ -53,13 +53,13 @@ class PluginInfo {
public:
PluginInfo () { }
PluginInfo (const PluginInfo &o)
- : name(o.name),
- category (o.category),
+ : name(o.name),
+ category (o.category),
creator (o.creator),
- path (o.path),
- n_inputs(o.n_inputs),
+ path (o.path),
+ n_inputs(o.n_inputs),
n_outputs(o.n_outputs),
- unique_id(o.unique_id),
+ unique_id(o.unique_id),
index(o.index) {}
virtual ~PluginInfo () { }
@@ -70,7 +70,7 @@ class PluginInfo {
ChanCount n_inputs;
ChanCount n_outputs;
ARDOUR::PluginType type;
-
+
std::string unique_id;
virtual PluginPtr load (Session& session) = 0;
@@ -89,23 +89,23 @@ class Plugin : public PBD::StatefulDestructible, public Latent
Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&);
Plugin (const Plugin&);
virtual ~Plugin ();
-
+
struct ParameterDescriptor {
- /* essentially a union of LADSPA and VST info */
-
- bool integer_step;
- bool toggled;
- bool logarithmic;
- bool sr_dependent;
- std::string label;
- float lower;
- float upper;
- float step;
- float smallstep;
- float largestep;
- bool min_unbound;
- bool max_unbound;
+ /* essentially a union of LADSPA and VST info */
+
+ bool integer_step;
+ bool toggled;
+ bool logarithmic;
+ bool sr_dependent;
+ std::string label;
+ float lower;
+ float upper;
+ float step;
+ float smallstep;
+ float largestep;
+ bool min_unbound;
+ bool max_unbound;
};
virtual std::string unique_id() const = 0;
@@ -125,7 +125,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual int connect_and_run (BufferSet& bufs,
ChanMapping in, ChanMapping out,
nframes_t nframes, nframes_t offset) = 0;
-
+
virtual std::set<Evoral::Parameter> automatable() const = 0;
virtual std::string describe_parameter (Evoral::Parameter) = 0;
virtual std::string state_node_name() const = 0;
@@ -191,9 +191,9 @@ class Plugin : public PBD::StatefulDestructible, public Latent
protected:
friend class PluginInsert;
friend struct PluginInsert::PluginControl;
-
+
virtual void set_parameter (uint32_t which, float val) = 0;
-
+
bool save_preset (std::string uri, std::string domain /* vst, ladspa etc. */);
ARDOUR::AudioEngine& _engine;
@@ -206,5 +206,5 @@ class Plugin : public PBD::StatefulDestructible, public Latent
PluginPtr find_plugin(ARDOUR::Session&, std::string unique_id, ARDOUR::PluginType);
} // namespace ARDOUR
-
+
#endif /* __ardour_plugin_h__ */
diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h
index 2908803aab..69b4ab1f8f 100644
--- a/libs/ardour/ardour/plugin_insert.h
+++ b/libs/ardour/ardour/plugin_insert.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000,2007 Paul Davis
+ Copyright (C) 2000,2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,14 +49,14 @@ class PluginInsert : public Processor
~PluginInsert ();
static const std::string port_automation_node_name;
-
+
XMLNode& state(bool);
XMLNode& get_state(void);
int set_state(const XMLNode&);
void run (BufferSet& in, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
void silence (nframes_t nframes);
-
+
void activate ();
void deactivate ();
@@ -75,22 +75,22 @@ class PluginInsert : public Processor
bool is_generator() const;
- struct PluginControl : public AutomationControl
+ struct PluginControl : public AutomationControl
{
- PluginControl (PluginInsert* p, const Evoral::Parameter &param,
- boost::shared_ptr<AutomationList> list = boost::shared_ptr<AutomationList>());
-
+ PluginControl (PluginInsert* p, const Evoral::Parameter &param,
+ boost::shared_ptr<AutomationList> list = boost::shared_ptr<AutomationList>());
+
void set_value (float val);
- float get_value (void) const;
-
- private:
- PluginInsert* _plugin;
+ float get_value (void) const;
+
+ private:
+ PluginInsert* _plugin;
bool _logarithmic;
bool _toggled;
};
boost::shared_ptr<Plugin> plugin(uint32_t num=0) const {
- if (num < _plugins.size()) {
+ if (num < _plugins.size()) {
return _plugins[num];
} else {
return _plugins[0]; // we always have one
@@ -104,7 +104,7 @@ class PluginInsert : public Processor
nframes_t signal_latency() const;
boost::shared_ptr<Plugin> get_impulse_analysis_plugin();
-
+
void collect_signal_for_analysis(nframes_t nframes);
sigc::signal<void, BufferSet*, BufferSet*> AnalysisDataGathered;
@@ -114,12 +114,12 @@ class PluginInsert : public Processor
PluginInsert (const PluginInsert&);
void parameter_changed (Evoral::Parameter, float);
-
+
void set_parameter (Evoral::Parameter param, float val);
float get_parameter (Evoral::Parameter param);
float default_parameter_value (const Evoral::Parameter& param);
-
+
typedef std::vector<boost::shared_ptr<Plugin> > Plugins;
Plugins _plugins;
@@ -130,7 +130,7 @@ class PluginInsert : public Processor
BufferSet _signal_analysis_inputs;
BufferSet _signal_analysis_outputs;
-
+
void automation_run (BufferSet& bufs, nframes_t nframes);
void connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t offset, bool with_auto, nframes_t now = 0);
diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h
index 90f00be8b1..c792b539a7 100644
--- a/libs/ardour/ardour/plugin_manager.h
+++ b/libs/ardour/ardour/plugin_manager.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -65,22 +65,22 @@ class PluginManager : public boost::noncopyable {
void add_favorite (ARDOUR::PluginType type, std::string unique_id);
void remove_favorite (ARDOUR::PluginType type, std::string unique_id);
bool is_a_favorite_plugin (const PluginInfoPtr&);
-
+
private:
struct FavoritePlugin {
- ARDOUR::PluginType type;
- std::string unique_id;
-
- FavoritePlugin (ARDOUR::PluginType t, std::string id)
- : type (t), unique_id (id) {}
-
- bool operator==(const FavoritePlugin& other) const {
- return other.type == type && other.unique_id == unique_id;
- }
-
- bool operator<(const FavoritePlugin& other) const {
- return other.type < type || other.unique_id < unique_id;
- }
+ ARDOUR::PluginType type;
+ std::string unique_id;
+
+ FavoritePlugin (ARDOUR::PluginType t, std::string id)
+ : type (t), unique_id (id) {}
+
+ bool operator==(const FavoritePlugin& other) const {
+ return other.type == type && other.unique_id == unique_id;
+ }
+
+ bool operator<(const FavoritePlugin& other) const {
+ return other.type < type || other.unique_id < unique_id;
+ }
};
typedef std::set<FavoritePlugin> FavoritePluginList;
FavoritePluginList favorites;
@@ -93,7 +93,7 @@ class PluginManager : public boost::noncopyable {
#ifdef HAVE_SLV2
LV2World* _lv2_world;
#endif
-
+
std::map<uint32_t, std::string> rdf_type;
std::string ladspa_path;
@@ -109,7 +109,7 @@ class PluginManager : public boost::noncopyable {
int au_discover ();
void au_refresh ();
-
+
int lv2_discover ();
void lv2_refresh ();
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 5ac7cb90ca..75215e148d 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@
namespace ARDOUR {
class AudioEngine;
-class Buffer;
+class Buffer;
class Port : public sigc::trackable, public boost::noncopyable
{
@@ -101,7 +101,7 @@ public:
void set_latency (nframes_t);
virtual void reset ();
-
+
/** @return the size of the raw buffer (bytes) for duration @a nframes (audio frames) */
virtual size_t raw_buffer_size(jack_nframes_t nframes) const = 0;
@@ -113,13 +113,13 @@ public:
virtual void flush_buffers (nframes_t, nframes_t offset = 0) {
(void) offset;
}
-
+
static void set_engine (AudioEngine *);
sigc::signal<void, bool> MonitorInputChanged;
protected:
-
+
Port (std::string const &, DataType, Flags);
jack_port_t* _jack_port; ///< JACK port
@@ -133,7 +133,7 @@ private:
friend class AudioEngine;
void recompute_total_latency () const;
-
+
/* XXX */
bool _last_monitor;
diff --git a/libs/ardour/ardour/port_insert.h b/libs/ardour/ardour/port_insert.h
index 7447c5b3e8..18f54b0216 100644
--- a/libs/ardour/ardour/port_insert.h
+++ b/libs/ardour/ardour/port_insert.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000,2007 Paul Davis
+ Copyright (C) 2000,2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@ class PortInsert : public IOProcessor
nframes_t signal_latency() const;
bool set_name (const std::string& name);
-
+
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
bool configure_io (ChanCount in, ChanCount out);
@@ -67,7 +67,7 @@ class PortInsert : public IOProcessor
PortInsert (const PortInsert&);
boost::shared_ptr<Delivery> _out;
-
+
uint32_t bitslot;
};
diff --git a/libs/ardour/ardour/port_set.h b/libs/ardour/ardour/port_set.h
index 86da79df72..106f2872d1 100644
--- a/libs/ardour/ardour/port_set.h
+++ b/libs/ardour/ardour/port_set.h
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -47,16 +47,16 @@ public:
/** nth port */
Port* port(size_t index) const;
-
+
/** nth port of type @a t, or nth port if t = NIL */
Port* port(DataType t, size_t index) const;
AudioPort* nth_audio_port(size_t n) const;
-
+
MidiPort* nth_midi_port(size_t n) const;
bool contains(const Port* port) const;
-
+
/** Remove all ports from the PortSet. Ports are not deregistered with
* the engine, it's the caller's responsibility to not leak here!
*/
@@ -68,7 +68,7 @@ public:
// ITERATORS
// FIXME: possible to combine these? templates?
-
+
class iterator {
public:
Port& operator*() { return *_set.port(_type, _index); }
@@ -91,12 +91,12 @@ public:
iterator begin(DataType type = DataType::NIL) {
return iterator(*this, type, 0);
}
-
+
iterator end(DataType type = DataType::NIL) {
return iterator(*this, type,
(type == DataType::NIL) ? _count.n_total() : _count.get(type));
}
-
+
class const_iterator {
public:
@@ -139,9 +139,9 @@ public:
audio_iterator audio_begin() { return audio_iterator(*this, 0); }
audio_iterator audio_end() { return audio_iterator(*this, _count.n_audio()); }
-private:
+private:
typedef std::vector<Port*> PortVec;
-
+
// Vector of vectors, indexed by DataType::to_index()
std::vector<PortVec> _ports;
diff --git a/libs/ardour/ardour/processor.h b/libs/ardour/ardour/processor.h
index 90a4ab96b4..21b7966fba 100644
--- a/libs/ardour/ardour/processor.h
+++ b/libs/ardour/ardour/processor.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
#include <string>
#include <exception>
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include <sigc++/signal.h>
@@ -55,7 +55,7 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
virtual ~Processor() { }
virtual std::string display_name() const { return SessionObject::name(); }
-
+
virtual bool visible() const { return true; }
virtual void set_visible (bool) {}
@@ -63,19 +63,19 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
bool get_next_ab_is_active () const { return _next_ab_is_active; }
void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
-
+
virtual nframes_t signal_latency() const { return 0; }
-
+
virtual void transport_stopped (sframes_t /*frame*/) {}
-
+
virtual void set_block_size (nframes_t /*nframes*/) {}
virtual void run (BufferSet& /*bufs*/, sframes_t /*start_frame*/, sframes_t /*end_frame*/, nframes_t /*nframes*/) {}
virtual void silence (nframes_t /*nframes*/) {}
-
+
virtual void activate () { _pending_active = true; ActiveChanged(); }
virtual void deactivate () { _pending_active = false; ActiveChanged(); }
-
+
virtual bool configure_io (ChanCount in, ChanCount out);
/* Derived classes should override these, or processor appears as an in-place pass-through */
@@ -92,7 +92,7 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
virtual XMLNode& state (bool full);
XMLNode& get_state (void);
int set_state (const XMLNode&);
-
+
void *get_gui () const { return _gui; }
void set_gui (void *p) { _gui = p; }
diff --git a/libs/ardour/ardour/profile.h b/libs/ardour/ardour/profile.h
index b016063c4d..5d4e611833 100644
--- a/libs/ardour/ardour/profile.h
+++ b/libs/ardour/ardour/profile.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,14 +26,14 @@
namespace ARDOUR {
class RuntimeProfile {
- public:
- enum Element {
- SmallScreen,
- SAE,
- SinglePackage,
- LastElement
- };
-
+public:
+ enum Element {
+ SmallScreen,
+ SAE,
+ SinglePackage,
+ LastElement
+ };
+
RuntimeProfile() { bits.resize (LastElement); }
~RuntimeProfile() {}
@@ -46,9 +46,9 @@ class RuntimeProfile {
void set_single_package () { bits[SinglePackage] = true; }
bool get_single_package () const { return bits[SinglePackage]; }
- private:
+private:
boost::dynamic_bitset<uint64_t> bits;
-
+
};
extern RuntimeProfile* Profile;
diff --git a/libs/ardour/ardour/quantize.h b/libs/ardour/ardour/quantize.h
index 8db7e4185f..b02335811c 100644
--- a/libs/ardour/ardour/quantize.h
+++ b/libs/ardour/ardour/quantize.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007-2009 Paul Davis
+ Copyright (C) 2007-2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -30,24 +30,24 @@ class Session;
class Quantize : public MidiOperator {
public:
- Quantize (ARDOUR::Session&, QuantizeType type,
- bool snap_start, bool snap_end,
- double start_grid, double end_grid,
- float strength, float swing, float threshold);
- ~Quantize ();
+ Quantize (ARDOUR::Session&, QuantizeType type,
+ bool snap_start, bool snap_end,
+ double start_grid, double end_grid,
+ float strength, float swing, float threshold);
+ ~Quantize ();
- Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>, std::vector<Evoral::Sequence<Evoral::MusicalTime>::Notes>&);
- std::string name() const { return std::string ("quantize"); }
+ Command* operator() (boost::shared_ptr<ARDOUR::MidiModel>, std::vector<Evoral::Sequence<Evoral::MusicalTime>::Notes>&);
+ std::string name() const { return std::string ("quantize"); }
private:
- ARDOUR::Session& session;
- bool _snap_start;
- bool _snap_end;
- double _start_grid;
- double _end_grid;
- float _strength;
- float _swing;
- float _threshold;
+ ARDOUR::Session& session;
+ bool _snap_start;
+ bool _snap_end;
+ double _start_grid;
+ double _end_grid;
+ float _strength;
+ float _swing;
+ float _threshold;
};
} /* namespace */
diff --git a/libs/ardour/ardour/rb_effect.h b/libs/ardour/ardour/rb_effect.h
index f7ad6af9a5..e4b1c00034 100644
--- a/libs/ardour/ardour/rb_effect.h
+++ b/libs/ardour/ardour/rb_effect.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/rc_configuration.h b/libs/ardour/ardour/rc_configuration.h
index a599b94e9e..d12a9c63e7 100644
--- a/libs/ardour/ardour/rc_configuration.h
+++ b/libs/ardour/ardour/rc_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999 Paul Davis
+ Copyright (C) 1999 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ class RCConfiguration : public Configuration
int load_state ();
int save_state ();
- /// calls Stateful::*instant_xml methods using
+ /// calls Stateful::*instant_xml methods using
/// ARDOUR::user_config_directory for the directory argument
void add_instant_xml (XMLNode&);
XMLNode * instant_xml (const std::string& str);
@@ -73,12 +73,12 @@ class RCConfiguration : public Configuration
/* declare variables */
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) ConfigVariable<Type> var;
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) ConfigVariableWithMutation<Type> var;
#include "ardour/rc_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
XMLNode* _control_protocol_state;
};
diff --git a/libs/ardour/ardour/recent_sessions.h b/libs/ardour/ardour/recent_sessions.h
index d713c4f3f1..e6d2f83bcc 100644
--- a/libs/ardour/ardour/recent_sessions.h
+++ b/libs/ardour/ardour/recent_sessions.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index c28e70bb5f..dab4f5df6f 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2001 Paul Davis
+ Copyright (C) 2000-2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -85,7 +85,7 @@ class Region
MusicTime
};
- static const Flag DefaultFlags = Flag (Opaque|DefaultFadeIn|DefaultFadeOut|FadeIn|FadeOut);
+ static const Flag DefaultFlags = Flag (Opaque|DefaultFadeIn|DefaultFadeOut|FadeIn|FadeOut);
static Change FadeChanged;
static Change SyncOffsetChanged;
@@ -141,7 +141,7 @@ class Region
nframes_t sync_point () const;
nframes_t adjust_to_sync (nframes_t) const;
-
+
/* first_frame() is an alias; last_frame() just hides some math */
nframes_t first_frame() const { return _position; }
@@ -172,13 +172,13 @@ class Region
OverlapType coverage (nframes_t start, nframes_t end) const {
return ARDOUR::coverage (first_frame(), last_frame(), start, end);
}
-
+
bool equivalent (boost::shared_ptr<const Region>) const;
bool size_equivalent (boost::shared_ptr<const Region>) const;
bool overlap_equivalent (boost::shared_ptr<const Region>) const;
bool region_list_equivalent (boost::shared_ptr<const Region>) const;
bool source_equivalent (boost::shared_ptr<const Region>) const;
-
+
/* EDITING OPERATIONS */
void set_length (nframes_t, void *src);
@@ -196,7 +196,7 @@ class Region
void trim_front (nframes_t new_position, void *src);
void trim_end (nframes_t new_position, void *src);
void trim_to (nframes_t position, nframes_t length, void *src);
-
+
void set_layer (layer_t l); /* ONLY Playlist can call this */
void raise ();
void lower ();
@@ -210,7 +210,7 @@ class Region
void set_opaque (bool yn);
void set_locked (bool yn);
void set_position_locked (bool yn);
-
+
int apply (Filter&);
virtual uint32_t read_data_count() const { return _read_data_count; }
@@ -219,7 +219,7 @@ class Region
virtual void set_playlist (boost::weak_ptr<ARDOUR::Playlist>);
void source_deleted (boost::shared_ptr<Source>);
-
+
boost::shared_ptr<Source> source (uint32_t n=0) const { return _sources[ (n < _sources.size()) ? n : 0 ]; }
uint32_t n_channels() const { return _sources.size(); }
@@ -228,24 +228,24 @@ class Region
std::vector<std::string> master_source_names();
void set_master_sources (const SourceList&);
-
+
/* automation */
-
+
virtual boost::shared_ptr<Evoral::Control>
control(const Evoral::Parameter& id, bool create=false) = 0;
virtual boost::shared_ptr<const Evoral::Control>
control(const Evoral::Parameter& id) const = 0;
-
+
/* serialization */
-
+
XMLNode& get_state ();
virtual XMLNode& state (bool);
virtual int set_state (const XMLNode&);
virtual int set_live_state (const XMLNode&, Change&, bool send);
virtual boost::shared_ptr<Region> get_parent() const;
-
+
uint64_t last_layer_op() const { return _last_layer_op; }
void set_last_layer_op (uint64_t when);
@@ -259,7 +259,7 @@ class Region
// no transients, but its OK
return 0;
}
-
+
virtual int separate_by_channel (ARDOUR::Session&,
std::vector< boost::shared_ptr<Region> >&) const {
return 0;
@@ -270,7 +270,7 @@ class Region
void set_pending_explicit_relayer (bool p) {
_pending_explicit_relayer = p;
}
-
+
bool pending_explicit_relayer () const {
return _pending_explicit_relayer;
}
@@ -278,11 +278,11 @@ class Region
protected:
friend class RegionFactory;
- Region (boost::shared_ptr<Source> src, nframes_t start, nframes_t length,
+ Region (boost::shared_ptr<Source> src, nframes_t start, nframes_t length,
const std::string& name, DataType type, layer_t = 0, Flag flags = DefaultFlags);
- Region (const SourceList& srcs, nframes_t start, nframes_t length,
+ Region (const SourceList& srcs, nframes_t start, nframes_t length,
const std::string& name, DataType type, layer_t = 0, Flag flags = DefaultFlags);
-
+
Region (boost::shared_ptr<const Region>, nframes_t start, nframes_t length, const std::string& name, layer_t = 0, Flag flags = DefaultFlags);
Region (boost::shared_ptr<const Region>, nframes_t length, const std::string& name, layer_t = 0, Flag flags = DefaultFlags);
Region (boost::shared_ptr<const Region>);
@@ -304,12 +304,12 @@ class Region
bool copied() const { return _flags & Copied; }
void maybe_uncopy ();
void first_edit ();
-
+
bool verify_start (nframes_t);
bool verify_start_and_length (nframes_t, nframes_t&);
bool verify_start_mutable (nframes_t&_start);
bool verify_length (nframes_t);
-
+
virtual void recompute_at_start () = 0;
virtual void recompute_at_end () = 0;
@@ -342,7 +342,7 @@ class Region
/** true if this region has had its layer explicitly set since the playlist last relayered */
bool _pending_explicit_relayer;
-
+
boost::weak_ptr<ARDOUR::Playlist> _playlist;
private:
diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h
index 8da6dde25f..e702a2433f 100644
--- a/libs/ardour/ardour/region_factory.h
+++ b/libs/ardour/ardour/region_factory.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ class RegionFactory {
in a pure Region copy, it will not be emitted.
It must be emitted by derived classes, not Region
- itself, to permit dynamic_cast<> to be used to
+ itself, to permit dynamic_cast<> to be used to
infer the type of Region.
*/
static sigc::signal<void,boost::shared_ptr<Region> > CheckNewRegion;
@@ -48,12 +48,12 @@ class RegionFactory {
gcc 4.1 doesn't seem to be able to disambiguate them if they do.
*/
- static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, nframes_t start,
- nframes_t length, const std::string& name,
- layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
- static boost::shared_ptr<Region> create (boost::shared_ptr<AudioRegion>, nframes_t start,
- nframes_t length, const std::string& name,
- layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
+ static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, nframes_t start,
+ nframes_t length, const std::string& name,
+ layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
+ static boost::shared_ptr<Region> create (boost::shared_ptr<AudioRegion>, nframes_t start,
+ nframes_t length, const std::string& name,
+ layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (boost::shared_ptr<Region>, const SourceList&, const std::string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (boost::shared_ptr<Source>, nframes_t start, nframes_t length, const std::string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
static boost::shared_ptr<Region> create (const SourceList &, nframes_t start, nframes_t length, const std::string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags, bool announce = true);
diff --git a/libs/ardour/ardour/resampled_source.h b/libs/ardour/ardour/resampled_source.h
index 1f6947aeac..efa1458152 100644
--- a/libs/ardour/ardour/resampled_source.h
+++ b/libs/ardour/ardour/resampled_source.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,13 +27,13 @@
namespace ARDOUR {
-class ResampledImportableSource : public ImportableSource
+class ResampledImportableSource : public ImportableSource
{
public:
ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
~ResampledImportableSource ();
-
+
nframes_t read (Sample* buffer, nframes_t nframes);
float ratio() const { return src_data.src_ratio; }
uint32_t channels() const { return source->channels(); }
@@ -41,9 +41,9 @@ class ResampledImportableSource : public ImportableSource
nframes_t samplerate() const { return source->samplerate(); }
void seek (nframes_t pos) { source->seek (pos); }
nframes64_t natural_position() const { return source->natural_position(); }
-
+
static const uint32_t blocksize;
-
+
private:
boost::shared_ptr<ImportableSource> source;
float* input;
diff --git a/libs/ardour/ardour/return.h b/libs/ardour/ardour/return.h
index 8f8a84f321..1a33795a37 100644
--- a/libs/ardour/ardour/return.h
+++ b/libs/ardour/ardour/return.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
#include <string>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
#include "ardour/io_processor.h"
@@ -35,23 +35,23 @@ namespace ARDOUR {
class Amp;
class PeakMeter;
-class Return : public IOProcessor
+class Return : public IOProcessor
{
-public:
+public:
Return (Session&, bool internal = false);
Return (Session&, const XMLNode&, bool internal = false);
virtual ~Return ();
-
+
uint32_t bit_slot() const { return _bitslot; }
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
-
+
boost::shared_ptr<Amp> amp() const { return _amp; }
boost::shared_ptr<PeakMeter> meter() const { return _meter; }
bool metering() const { return _metering; }
void set_metering (bool yn) { _metering = yn; }
-
+
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
@@ -72,7 +72,7 @@ public:
private:
/* disallow copy construction */
Return (const Return&);
-
+
uint32_t _bitslot;
void collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset=ChanCount::ZERO);
diff --git a/libs/ardour/ardour/reverse.h b/libs/ardour/ardour/reverse.h
index 79f8880e56..0831e8184b 100644
--- a/libs/ardour/ardour/reverse.h
+++ b/libs/ardour/ardour/reverse.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 34bf9e8d9f..1ecdb51488 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2002 Paul Davis
+ Copyright (C) 2000-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
#include "pbd/fastlog.h"
#include "pbd/xml++.h"
#include "pbd/undo.h"
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "pbd/controllable.h"
#include "pbd/destructible.h"
@@ -97,14 +97,14 @@ class Route : public SessionObject, public AutomatableControls
/* these are the core of the API of a Route. see the protected sections as well */
- virtual int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- int declick, bool can_record, bool rec_monitors_input);
+ virtual int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ int declick, bool can_record, bool rec_monitors_input);
- virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input);
+ virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ bool state_changing, bool can_record, bool rec_monitors_input);
- virtual int silent_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- bool can_record, bool rec_monitors_input);
+ virtual int silent_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ bool can_record, bool rec_monitors_input);
virtual void toggle_monitor_input ();
virtual bool can_record() { return false; }
@@ -117,7 +117,7 @@ class Route : public SessionObject, public AutomatableControls
/* end of vfunc-based API */
void shift (nframes64_t, nframes64_t);
-
+
void set_gain (gain_t val, void *src);
void inc_gain (gain_t delta, void *src);
@@ -136,7 +136,7 @@ class Route : public SessionObject, public AutomatableControls
void set_listen (bool yn, void* src);
bool listening () const;
-
+
void set_phase_invert (bool yn);
bool phase_invert() const;
@@ -166,7 +166,7 @@ class Route : public SessionObject, public AutomatableControls
method (boost::weak_ptr<Processor> (*i));
}
}
-
+
boost::shared_ptr<Processor> nth_processor (uint32_t n) {
Glib::RWLock::ReaderLock lm (_processor_lock);
ProcessorList::iterator i;
@@ -256,11 +256,11 @@ class Route : public SessionObject, public AutomatableControls
XMLNode& get_processor_state ();
virtual void set_processor_state (const XMLNode&);
-
+
int save_as_template (const std::string& path, const std::string& name);
sigc::signal<void,void*> SelectedChanged;
-
+
int listen_via (boost::shared_ptr<Route>, Placement p, bool active, bool aux);
void drop_listen (boost::shared_ptr<Route>);
@@ -275,7 +275,7 @@ class Route : public SessionObject, public AutomatableControls
SoloControllable (std::string name, Route&);
void set_value (float);
float get_value (void) const;
-
+
Route& route;
};
@@ -287,8 +287,8 @@ class Route : public SessionObject, public AutomatableControls
return _mute_master;
}
- boost::shared_ptr<MuteMaster> mute_master() const {
- return _mute_master;
+ boost::shared_ptr<MuteMaster> mute_master() const {
+ return _mute_master;
}
/* Route doesn't own these items, but sub-objects that it does own have them
@@ -301,7 +301,7 @@ class Route : public SessionObject, public AutomatableControls
void automation_snapshot (nframes_t now, bool force=false);
void protect_automation ();
-
+
void set_remote_control_id (uint32_t id);
uint32_t remote_control_id () const;
sigc::signal<void> RemoteControlIDChanged;
@@ -322,17 +322,17 @@ class Route : public SessionObject, public AutomatableControls
protected:
nframes_t check_initial_delay (nframes_t, nframes_t&);
-
+
void passthru (sframes_t start_frame, sframes_t end_frame,
- nframes_t nframes, int declick);
+ nframes_t nframes, int declick);
virtual void write_out_of_band_data (BufferSet& /* bufs */, sframes_t /* start_frame */, sframes_t /* end_frame */,
- nframes_t /* nframes */) {}
+ nframes_t /* nframes */) {}
virtual void process_output_buffers (BufferSet& bufs,
- sframes_t start_frame, sframes_t end_frame,
- nframes_t nframes, bool with_processors, int declick);
-
+ sframes_t start_frame, sframes_t end_frame,
+ nframes_t nframes, bool with_processors, int declick);
+
boost::shared_ptr<IO> _input;
boost::shared_ptr<IO> _output;
@@ -354,7 +354,7 @@ class Route : public SessionObject, public AutomatableControls
bool _solo_isolated;
bool _denormal_protection;
-
+
bool _recordable : 1;
bool _silent : 1;
bool _declickable : 1;
@@ -374,9 +374,9 @@ class Route : public SessionObject, public AutomatableControls
void passthru_silence (sframes_t start_frame, sframes_t end_frame,
nframes_t nframes, int declick);
-
+
void silence (nframes_t nframes);
-
+
sigc::connection input_signal_connection;
ChanCount processor_max_streams;
@@ -384,7 +384,7 @@ class Route : public SessionObject, public AutomatableControls
uint32_t pans_required() const;
ChanCount n_process_buffers ();
-
+
virtual int _set_state (const XMLNode&, bool call_base);
boost::shared_ptr<Amp> _amp;
@@ -407,7 +407,7 @@ class Route : public SessionObject, public AutomatableControls
int configure_processors (ProcessorStreams*);
int configure_processors_unlocked (ProcessorStreams*);
- bool add_processor_from_xml (const XMLNode&, ProcessorList::iterator iter);
+ bool add_processor_from_xml (const XMLNode&, ProcessorList::iterator iter);
void placement_range (Placement p, ProcessorList::iterator& start, ProcessorList::iterator& end);
};
diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h
index 75f5af790e..194aa84582 100644
--- a/libs/ardour/ardour/route_group.h
+++ b/libs/ardour/ardour/route_group.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include <string>
#include <stdint.h>
#include <sigc++/signal.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "ardour/types.h"
namespace ARDOUR {
@@ -51,22 +51,22 @@ public:
Select = 0x10,
Edit = 0x20
};
-
+
RouteGroup (Session& s, const std::string &n, Flag f = Flag(0), Property p = Property(0));
-
+
const std::string& name() { return _name; }
void set_name (std::string str);
-
+
bool is_active () const { return _flags & Active; }
bool is_relative () const { return _flags & Relative; }
bool is_hidden () const { return _flags & Hidden; }
bool empty() const {return routes.empty();}
-
+
gain_t get_max_factor(gain_t factor);
gain_t get_min_factor(gain_t factor);
-
+
int size() { return routes.size();}
-
+
void set_active (bool yn, void *src);
void set_relative (bool yn, void *src);
void set_hidden (bool yn, void *src);
@@ -74,7 +74,7 @@ public:
bool property (Property p) const {
return ((_properties & p) == p);
}
-
+
bool active_property (Property p) const {
return is_active() && property (p);
}
@@ -85,37 +85,37 @@ public:
_properties = (Property) (_properties | p);
}
}
-
+
int add (Route *);
-
+
int remove (Route *);
-
+
void apply (void (Route::*func)(void *), void *src) {
for (std::list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
((*i)->*func)(src);
}
}
-
+
template<class T> void apply (void (Route::*func)(T, void *), T val, void *src) {
for (std::list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
((*i)->*func)(val, src);
}
}
-
+
template<class T> void foreach_route (T *obj, void (T::*func)(Route&)) {
for (std::list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
(obj->*func)(**i);
}
}
-
+
/* to use these, #include "ardour/route_group_specialized.h" */
-
+
template<class T> void apply (void (Track::*func)(T, void *), T val, void *src);
-
+
/* fills at_set with all members of the group that are AudioTracks */
-
+
void audio_track_group (std::set<AudioTrack*>& at_set);
-
+
void clear () {
routes.clear ();
changed();
@@ -123,16 +123,16 @@ public:
void make_subgroup ();
void destroy_subgroup ();
-
+
const std::list<Route*>& route_list() { return routes; }
-
+
sigc::signal<void> changed;
sigc::signal<void,void*> FlagsChanged;
-
+
XMLNode& get_state ();
-
+
int set_state (const XMLNode&);
-
+
private:
Session& _session;
std::list<Route *> routes;
@@ -140,10 +140,10 @@ private:
std::string _name;
Flag _flags;
Property _properties;
-
+
void remove_when_going_away (Route*);
};
-
+
} /* namespace */
#endif /* __ardour_route_group_h__ */
diff --git a/libs/ardour/ardour/route_group_specialized.h b/libs/ardour/ardour/route_group_specialized.h
index adf4dfc429..c9d06a93c9 100644
--- a/libs/ardour/ardour/route_group_specialized.h
+++ b/libs/ardour/ardour/route_group_specialized.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@
namespace ARDOUR {
-template<class T> void
-RouteGroup::apply (void (Track::*func)(T, void *), T val, void */*src*/)
+template<class T> void
+RouteGroup::apply (void (Track::*func)(T, void *), T val, void */*src*/)
{
for (std::list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
Track *at;
@@ -35,7 +35,7 @@ RouteGroup::apply (void (Track::*func)(T, void *), T val, void */*src*/)
}
}
}
-
+
} /* namespace ARDOUR */
#endif /* __ardour_route_group_specialized_h__ */
diff --git a/libs/ardour/ardour/runtime_functions.h b/libs/ardour/ardour/runtime_functions.h
index be39702a2f..147d697fca 100644
--- a/libs/ardour/ardour/runtime_functions.h
+++ b/libs/ardour/ardour/runtime_functions.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index dc57a72519..6b872df9fe 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
#include <sigc++/signal.h>
#include <string>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
@@ -36,7 +36,7 @@ class Amp;
class Send : public Delivery
{
- public:
+ public:
Send (Session&, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send);
Send (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&, Delivery::Role r = Delivery::Send);
virtual ~Send ();
@@ -50,7 +50,7 @@ class Send : public Delivery
bool metering() const { return _metering; }
void set_metering (bool yn) { _metering = yn; }
-
+
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
@@ -78,7 +78,7 @@ class Send : public Delivery
private:
/* disallow copy construction */
Send (const Send&);
-
+
uint32_t _bitslot;
};
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index cdf6547674..5055ebc709 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -178,7 +178,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
std::list<AudioRange> audio_range;
std::list<MusicRange> music_range;
-
+
boost::shared_ptr<Region> region;
Event(Type t, Action a, nframes_t when, nframes_t where, double spd, bool yn = false)
@@ -223,15 +223,15 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
/* creating from an XML file */
Session (AudioEngine&,
- const std::string& fullpath,
- const std::string& snapshot_name,
- std::string mix_template = "");
+ const std::string& fullpath,
+ const std::string& snapshot_name,
+ std::string mix_template = "");
/* creating a new Session */
Session (AudioEngine&,
- std::string fullpath,
- std::string snapshot_name,
+ std::string fullpath,
+ std::string snapshot_name,
AutoConnectOption input_auto_connect,
AutoConnectOption output_auto_connect,
uint32_t control_out_channels,
@@ -248,7 +248,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
std::string raid_path () const;
void set_snap_name ();
-
+
bool writable() const { return _writable; }
void set_dirty ();
void set_clean ();
@@ -319,9 +319,9 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
}
struct RoutePublicOrderSorter {
- bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b);
+ bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b);
};
-
+
void sync_order_keys (std::string const &);
template<class T> void foreach_route (T *obj, void (T::*func)(Route&));
@@ -419,7 +419,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
- MIDI::byte get_mtc_smpte_bits() const {
+ MIDI::byte get_mtc_smpte_bits() const {
return mtc_smpte_bits; /* encoding of SMTPE type for MTC */
}
@@ -506,7 +506,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
std::list<boost::shared_ptr<AudioTrack> > new_audio_track (
int input_channels, int output_channels, TrackMode mode = Normal, RouteGroup* route_group = 0, uint32_t how_many = 1
);
-
+
RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many);
std::list<boost::shared_ptr<MidiTrack> > new_midi_track (
@@ -582,7 +582,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
/// signals the current transport position in frames, bbt and smpte time (in that order)
sigc::signal<void, const nframes_t&, const BBT_Time&, const SMPTE::Time&> tick;
-
+
/* region info */
void add_regions (std::vector<boost::shared_ptr<Region> >&);
@@ -628,7 +628,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
boost::shared_ptr<ExportHandler> get_export_handler ();
boost::shared_ptr<ExportStatus> get_export_status ();
- int start_audio_export (nframes_t position, bool realtime);
+ int start_audio_export (nframes_t position, bool realtime);
sigc::signal<int, nframes_t> ProcessExport;
sigc::signal<void> ExportReadFinished;
@@ -717,8 +717,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
/* flattening stuff */
boost::shared_ptr<Region> write_one_track (AudioTrack&, nframes_t start, nframes_t end,
- bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot,
- bool enable_processing = true);
+ bool overwrite, std::vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot,
+ bool enable_processing = true);
int freeze (InterThreadInfo&);
/* session-wide solo/mute/rec-enable */
@@ -846,22 +846,21 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
class GlobalRouteStateCommand : public Command
{
- public:
+ public:
GlobalRouteStateCommand (Session&, void*);
GlobalRouteStateCommand (Session&, const XMLNode& node);
int set_state (const XMLNode&);
XMLNode& get_state ();
- protected:
+ protected:
GlobalRouteBooleanState before, after;
Session& sess;
void* src;
-
};
class GlobalSoloStateCommand : public GlobalRouteStateCommand
{
- public:
+ public:
GlobalSoloStateCommand (Session &, void *src);
GlobalSoloStateCommand (Session&, const XMLNode&);
void operator()(); //redo
@@ -872,7 +871,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
class GlobalMuteStateCommand : public GlobalRouteStateCommand
{
- public:
+ public:
GlobalMuteStateCommand(Session &, void *src);
GlobalMuteStateCommand (Session&, const XMLNode&);
void operator()(); // redo
@@ -883,7 +882,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
{
- public:
+ public:
GlobalRecordEnableStateCommand(Session &, void *src);
GlobalRecordEnableStateCommand (Session&, const XMLNode&);
void operator()(); // redo
@@ -894,7 +893,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
class GlobalMeteringStateCommand : public Command
{
- public:
+ public:
GlobalMeteringStateCommand(Session &, void *src);
GlobalMeteringStateCommand (Session&, const XMLNode&);
void operator()();
@@ -903,7 +902,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
int set_state (const XMLNode&);
void mark();
- protected:
+ protected:
Session& sess;
void* src;
GlobalRouteMeterState before;
@@ -939,7 +938,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
gain_t* gain_automation_buffer () const { return _gain_automation_buffer; }
pan_t** pan_automation_buffer () const { return _pan_automation_buffer; }
-
+
void ensure_buffer_set (BufferSet& buffers, const ChanCount& howmany);
/* VST support */
@@ -967,7 +966,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
bool exporting () const {
return _exporting;
}
-
+
protected:
friend class AudioEngine;
void set_block_size (nframes_t nframes);
@@ -1019,13 +1018,13 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
Location* start_location;
Slave* _slave;
bool _silent;
-
+
// varispeed playback
volatile double _transport_speed;
double _last_transport_speed;
double _target_transport_speed;
CubicInterpolation interpolation;
-
+
bool auto_play_legal;
nframes_t _last_slave_transport_frame;
nframes_t maximum_output_latency;
@@ -1085,10 +1084,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void reset_slave_state ();
bool follow_slave (nframes_t);
void calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta);
- void track_slave_state(float slave_speed, nframes_t slave_transport_frame,
- nframes_t this_delta, bool starting);
+ void track_slave_state(float slave_speed, nframes_t slave_transport_frame,
+ nframes_t this_delta, bool starting);
void follow_slave_silently(nframes_t nframes, float slave_speed);
-
+
void set_slave_source (SlaveSource);
SlaveSource post_export_slave;
@@ -1096,14 +1095,14 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
bool _exporting;
bool _exporting_realtime;
-
+
boost::shared_ptr<ExportHandler> export_handler;
boost::shared_ptr<ExportStatus> export_status;
int pre_export ();
int stop_audio_export ();
void finalize_audio_export ();
-
+
sigc::connection export_freewheel_connection;
void prepare_diskstreams ();
@@ -1135,8 +1134,8 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
}
bool maybe_stop (nframes_t limit) {
- if ( (_transport_speed > 0.0f && _transport_frame >= limit)
- || (_transport_speed < 0.0f && _transport_frame == 0) ) {
+ if ( (_transport_speed > 0.0f && _transport_frame >= limit)
+ || (_transport_speed < 0.0f && _transport_frame == 0) ) {
stop_transport ();
return true;
}
@@ -1644,7 +1643,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
pool.release (ptr);
}
- private:
+ private:
static Pool pool;
};
@@ -1730,7 +1729,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void sync_order_keys ();
static bool _disable_all_loaded_plugins;
-
+
SessionMetadata * _metadata;
mutable bool have_looped; ///< Used in ::audible_frame(*)
diff --git a/libs/ardour/ardour/session_configuration.h b/libs/ardour/ardour/session_configuration.h
index 57e78d2af0..fc7af8c450 100644
--- a/libs/ardour/ardour/session_configuration.h
+++ b/libs/ardour/ardour/session_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,16 +54,16 @@ public:
/* declare variables */
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) ConfigVariable<Type> var;
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) ConfigVariableWithMutation<Type> var;
#include "ardour/session_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
int foo;
};
}
-
+
#endif
diff --git a/libs/ardour/ardour/session_directory.h b/libs/ardour/ardour/session_directory.h
index 9a3f4d4d77..ae6aa256cb 100644
--- a/libs/ardour/ardour/session_directory.h
+++ b/libs/ardour/ardour/session_directory.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ public:
const PBD::sys::path root_path() const { return m_root_path; }
/**
- * @return the absolute path to the directory in which
+ * @return the absolute path to the directory in which
* the session stores audio files.
*
* If the session is an older session with an existing
@@ -50,16 +50,16 @@ public:
* of root_path()/interchange/session_name/audiofiles
*/
const PBD::sys::path sound_path () const;
-
+
/**
- * @return the absolute path to the directory in which
+ * @return the absolute path to the directory in which
* the session stores MIDI files, ie
* root_path()/interchange/session_name/midifiles
*/
const PBD::sys::path midi_path () const;
-
+
/**
- * @return the absolute path to the directory in which
+ * @return the absolute path to the directory in which
* the session stores MIDNAM patch files, ie
* root_path()/interchange/session_name/patchfiles
*/
@@ -77,7 +77,7 @@ public:
* session.
*/
const PBD::sys::path dead_sound_path () const;
-
+
/**
* @return The absolute path to the directory that midi
* files are moved to when they are no longer part of the
@@ -92,7 +92,7 @@ public:
const PBD::sys::path export_path () const;
/**
- * @return true if session directory and all the required
+ * @return true if session directory and all the required
* subdirectories exist.
*/
bool is_valid () const;
diff --git a/libs/ardour/ardour/session_metadata.h b/libs/ardour/ardour/session_metadata.h
index 71dd59904c..cfa1fb6f29 100644
--- a/libs/ardour/ardour/session_metadata.h
+++ b/libs/ardour/ardour/session_metadata.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@ class SessionMetadata : public PBD::StatefulDestructible
public:
SessionMetadata ();
~SessionMetadata ();
-
+
/*** Accessing ***/
Glib::ustring comment () const;
Glib::ustring copyright () const;
@@ -50,7 +50,7 @@ class SessionMetadata : public PBD::StatefulDestructible
Glib::ustring grouping () const;
Glib::ustring title () const;
Glib::ustring subtitle () const;
-
+
Glib::ustring artist () const;
Glib::ustring album_artist () const;
Glib::ustring lyricist () const;
@@ -62,7 +62,7 @@ class SessionMetadata : public PBD::StatefulDestructible
Glib::ustring producer () const;
Glib::ustring dj_mixer () const;
Glib::ustring mixer () const;
-
+
Glib::ustring album () const;
Glib::ustring compilation () const;
Glib::ustring disc_subtitle () const;
@@ -70,19 +70,19 @@ class SessionMetadata : public PBD::StatefulDestructible
uint32_t total_discs () const;
uint32_t track_number () const;
uint32_t total_tracks () const;
-
+
Glib::ustring genre () const;
-
+
/*** Editing ***/
void set_comment (const Glib::ustring &);
void set_copyright (const Glib::ustring &);
void set_isrc (const Glib::ustring &);
void set_year (uint32_t);
-
+
void set_grouping (const Glib::ustring &);
void set_title (const Glib::ustring &);
void set_subtitle (const Glib::ustring &);
-
+
void set_artist (const Glib::ustring &);
void set_album_artist (const Glib::ustring &);
void set_lyricist (const Glib::ustring &);
@@ -94,7 +94,7 @@ class SessionMetadata : public PBD::StatefulDestructible
void set_producer (const Glib::ustring &);
void set_dj_mixer (const Glib::ustring &);
void set_mixer (const Glib::ustring &);
-
+
void set_album (const Glib::ustring &);
void set_compilation (const Glib::ustring &);
void set_disc_subtitle (const Glib::ustring &);
@@ -102,24 +102,24 @@ class SessionMetadata : public PBD::StatefulDestructible
void set_total_discs (uint32_t);
void set_track_number (uint32_t);
void set_total_tracks (uint32_t);
-
+
void set_genre (const Glib::ustring &);
-
+
/*** Serialization ***/
XMLNode & get_state ();
int set_state (const XMLNode &);
private:
-
+
typedef std::pair<Glib::ustring, Glib::ustring> Property;
typedef std::map<Glib::ustring, Glib::ustring> PropertyMap;
PropertyMap map;
XMLNode * get_xml (const Glib::ustring & name);
-
+
Glib::ustring get_value (const Glib::ustring & name) const;
uint32_t get_uint_value (const Glib::ustring & name) const;
-
+
void set_value (const Glib::ustring & name, const Glib::ustring & value);
void set_value (const Glib::ustring & name, uint32_t value);
};
diff --git a/libs/ardour/ardour/session_object.h b/libs/ardour/ardour/session_object.h
index 7a05ab16b0..07c33c9701 100644
--- a/libs/ardour/ardour/session_object.h
+++ b/libs/ardour/ardour/session_object.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
#define __ardour_session_object_h__
#include <string>
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
namespace ARDOUR {
@@ -40,10 +40,10 @@ public:
: _session(session)
, _name(name)
{}
-
+
Session& session() const { return _session; }
const std::string& name() const { return _name; }
-
+
virtual bool set_name (const std::string& str) {
if (_name != str) {
_name = str;
@@ -51,7 +51,7 @@ public:
}
return true;
}
-
+
sigc::signal<void> NameChanged;
protected:
diff --git a/libs/ardour/ardour/session_playlist.h b/libs/ardour/ardour/session_playlist.h
index 0641d442a8..f924fe4bbc 100644
--- a/libs/ardour/ardour/session_playlist.h
+++ b/libs/ardour/ardour/session_playlist.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@
namespace ARDOUR {
-template<class T> void
-Session::foreach_playlist (T *obj, void (T::*func)(boost::shared_ptr<Playlist>))
+template<class T> void
+Session::foreach_playlist (T *obj, void (T::*func)(boost::shared_ptr<Playlist>))
{
Glib::Mutex::Lock lm (playlist_lock);
for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); i++) {
diff --git a/libs/ardour/ardour/session_region.h b/libs/ardour/ardour/session_region.h
index c4a6f64889..a9c9713035 100644
--- a/libs/ardour/ardour/session_region.h
+++ b/libs/ardour/ardour/session_region.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h
index c7e911abb5..cfaa13cdc8 100644
--- a/libs/ardour/ardour/session_route.h
+++ b/libs/ardour/ardour/session_route.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
namespace ARDOUR {
-template<class T> void
+template<class T> void
Session::foreach_route (T *obj, void (T::*func)(Route&))
{
boost::shared_ptr<RouteList> r = routes.reader();
@@ -43,7 +43,7 @@ Session::foreach_route (T *obj, void (T::*func)(Route&))
}
}
-template<class T> void
+template<class T> void
Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>))
{
boost::shared_ptr<RouteList> r = routes.reader();
@@ -57,7 +57,7 @@ Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>))
}
}
-template<class T, class A> void
+template<class T, class A> void
Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1)
{
boost::shared_ptr<RouteList> r = routes.reader();
diff --git a/libs/ardour/ardour/session_selection.h b/libs/ardour/ardour/session_selection.h
index b92cb475a0..52c7ab0e0e 100644
--- a/libs/ardour/ardour/session_selection.h
+++ b/libs/ardour/ardour/session_selection.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,8 +25,8 @@
namespace ARDOUR {
-template<class T> void
-Session::foreach_named_selection (T& obj, void (T::*func)(NamedSelection&))
+template<class T> void
+Session::foreach_named_selection (T& obj, void (T::*func)(NamedSelection&))
{
Glib::Mutex::Lock lm (named_selection_lock);
for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); i++) {
diff --git a/libs/ardour/ardour/session_state_utils.h b/libs/ardour/ardour/session_state_utils.h
index a41456b8f7..de58d3eff0 100644
--- a/libs/ardour/ardour/session_state_utils.h
+++ b/libs/ardour/ardour/session_state_utils.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ namespace ARDOUR {
/**
* Attempt to create a backup copy of a file.
*
- * A copy of the file is created in the same directory using
+ * A copy of the file is created in the same directory using
* the same filename with the backup suffix appended.
*
* @return true if successful, false otherwise.
@@ -37,21 +37,21 @@ namespace ARDOUR {
bool create_backup_file (const PBD::sys::path & file_path);
/**
- * Get the absolute paths to all state files in the directory
+ * Get the absolute paths to all state files in the directory
* at path directory_path.
*
* @param directory_path The absolute path to a directory.
* @param result vector to contain resulting state files.
*/
void get_state_files_in_directory (const PBD::sys::path & directory_path,
- std::vector<PBD::sys::path>& result);
+ std::vector<PBD::sys::path>& result);
/**
* Given a vector of paths to files, return a vector containing
* the filenames without any extension.
*
* @param file_paths a vector containing the file paths
- * @return a vector containing a list of file names without any
+ * @return a vector containing a list of file names without any
* filename extension.
*/
std::vector<std::string> get_file_names_no_extension (const std::vector<PBD::sys::path> & file_paths);
diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h
index dcf7964ac6..ec7f1c4d0b 100644
--- a/libs/ardour/ardour/silentfilesource.h
+++ b/libs/ardour/ardour/silentfilesource.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
-#ifndef __ardour_silentfilesource_h__
+#ifndef __ardour_silentfilesource_h__
#define __ardour_silentfilesource_h__
#include <cstring>
@@ -32,9 +32,9 @@ public:
float sample_rate () const { return _sample_rate; }
void set_length (nframes_t len) { _length = len; }
-
+
bool destructive() const { return false; }
- bool can_be_analysed() const { return false; }
+ bool can_be_analysed() const { return false; }
protected:
friend class SourceFactory;
@@ -56,12 +56,12 @@ protected:
void set_header_timeline_position () {}
- int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t /*start*/, nframes_t /*cnt*/,
- double /*samples_per_unit*/, nframes_t /*fpp*/) const {
+ int read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t /*start*/, nframes_t /*cnt*/,
+ double /*samples_per_unit*/, nframes_t /*fpp*/) const {
memset (peaks, 0, sizeof (PeakData) * npeaks);
return 0;
}
-
+
float _sample_rate;
};
diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h
index 5987151307..64e350ae9c 100644
--- a/libs/ardour/ardour/slave.h
+++ b/libs/ardour/ardour/slave.h
@@ -38,10 +38,10 @@ namespace MIDI {
namespace ARDOUR {
/**
* @class Slave
- *
+ *
* @brief The Slave interface can be used to sync ARDOURs tempo to an external source
* like MTC, MIDI Clock, etc.
- *
+ *
* The name of the interface may be a bit misleading: A subclass of Slave actually
* acts as a time master for ARDOUR, that means ARDOUR will try to follow the
* speed and transport position of the implementation of Slave.
@@ -57,7 +57,7 @@ class Slave {
* This is the most important function to implement:
* Each process cycle, Session::follow_slave will call this method.
* and after the method call they should
- *
+ *
* Session::follow_slave will then try to follow the given
* <emph>position</emph> using a delay locked loop (DLL),
* starting with the first given transport speed.
@@ -65,92 +65,92 @@ class Slave {
* ARDOUR will always follow the position and disregard the speed.
* Although, a correct speed is important so that ARDOUR
* can sync to the master time source quickly.
- *
- * For background information on delay locked loops,
+ *
+ * For background information on delay locked loops,
* see http://www.kokkinizita.net/papers/usingdll.pdf
- *
+ *
* The method has the following precondition:
* <ul>
- * <li>
- * Slave::ok() should return true, otherwise playback will stop
+ * <li>
+ * Slave::ok() should return true, otherwise playback will stop
* immediately and the method will not be called
- * </li>
+ * </li>
* <li>
* when the references speed and position are passed into the Slave
* they are uninitialized
* </li>
* </ul>
- *
+ *
* After the method call the following postconditions should be met:
* <ul>
- * <li>
+ * <li>
* The first position value on transport start should be 0,
- * otherwise ARDOUR will try to locate to the new position
+ * otherwise ARDOUR will try to locate to the new position
* rather than move to it
* </li>
- * <li>
- * the references speed and position should be assigned
+ * <li>
+ * the references speed and position should be assigned
* to the Slaves current requested transport speed
* and transport position.
* </li>
* <li>
- * Slave::resolution() should be greater than the maximum distance of
+ * Slave::resolution() should be greater than the maximum distance of
* ARDOURs transport position to the slaves requested transport position.
* </li>
- * <li>Slave::locked() should return true, otherwise Session::no_roll will be called</li>
- * <li>Slave::starting() should be false, otherwise the transport will not move until it becomes true</li> *
+ * <li>Slave::locked() should return true, otherwise Session::no_roll will be called</li>
+ * <li>Slave::starting() should be false, otherwise the transport will not move until it becomes true</li> *
* </ul>
- *
+ *
* @param speed - The transport speed requested
* @param position - The transport position requested
* @return - The return value is currently ignored (see Session::follow_slave)
*/
virtual bool speed_and_position (double& speed, nframes_t& position) = 0;
-
+
/**
- * reports to ARDOUR whether the Slave is currently synced to its external
+ * reports to ARDOUR whether the Slave is currently synced to its external
* time source.
- *
+ *
* @return - when returning false, the transport will stop rolling
*/
virtual bool locked() const = 0;
-
+
/**
* reports to ARDOUR whether the slave is in a sane state
- *
- * @return - when returning false, the transport will be stopped and the slave
+ *
+ * @return - when returning false, the transport will be stopped and the slave
* disconnected from ARDOUR.
*/
virtual bool ok() const = 0;
-
+
/**
* reports to ARDOUR whether the slave is in the process of starting
* to roll
- *
+ *
* @return - when returning false, transport will not move until this method returns true
*/
virtual bool starting() const { return false; }
-
+
/**
* @return - the timing resolution of the Slave - If the distance of ARDOURs transport
* to the slave becomes greater than the resolution, sound will stop
*/
virtual nframes_t resolution() const = 0;
-
+
/**
* @return - when returning true, ARDOUR will wait for one second before transport
* starts rolling
*/
virtual bool requires_seekahead () const = 0;
-
+
/**
- * @return - when returning true, ARDOUR will use transport speed 1.0 no matter what
+ * @return - when returning true, ARDOUR will use transport speed 1.0 no matter what
* the slave returns
*/
virtual bool is_always_synced() const { return false; }
-
+
/**
- * @return - whether ARDOUR should use the slave speed without any adjustments
+ * @return - whether ARDOUR should use the slave speed without any adjustments
*/
virtual bool give_slave_full_control_over_transport_speed() const { return false; }
};
@@ -195,11 +195,11 @@ struct SafeTime {
nframes_t timestamp;
int guard2;
- SafeTime() {
- guard1 = 0;
- guard2 = 0;
- timestamp = 0;
- }
+ SafeTime() {
+ guard1 = 0;
+ guard2 = 0;
+ timestamp = 0;
+ }
};
class MTC_Slave : public Slave, public sigc::trackable {
@@ -264,7 +264,7 @@ class MIDIClock_Slave : public Slave, public sigc::trackable {
bool give_slave_full_control_over_transport_speed() const { return true; }
void set_bandwidth (double a_bandwith) { bandwidth = a_bandwith; }
-
+
private:
ISlaveSessionProxy* session;
MIDI::Port* port;
@@ -272,41 +272,41 @@ class MIDIClock_Slave : public Slave, public sigc::trackable {
/// pulses per quarter note for one MIDI clock frame (default 24)
int ppqn;
-
+
/// the duration of one ppqn in frame time
double one_ppqn_in_frames;
/// the timestamp of the first MIDI clock message
nframes_t first_timestamp;
-
+
/// the time stamp and should-be transport position of the last inbound MIDI clock message
nframes_t last_timestamp;
double should_be_position;
-
+
/// the number of midi clock messages received (zero-based)
/// since start
long midi_clock_count;
-
+
//the delay locked loop (DLL), see www.kokkinizita.net/papers/usingdll.pdf
-
+
/// time at the beginning of the MIDI clock frame
double t0;
-
+
/// calculated end of the MIDI clock frame
double t1;
-
+
/// loop error = real value - expected value
double e;
-
+
/// second order loop error
double e2;
-
+
/// DLL filter bandwidth
double bandwidth;
-
+
/// DLL filter coefficients
double b, c, omega;
-
+
void reset ();
void start (MIDI::Parser& parser, nframes_t timestamp);
void contineu (MIDI::Parser& parser, nframes_t timestamp);
@@ -322,7 +322,7 @@ class MIDIClock_Slave : public Slave, public sigc::trackable {
/// whether transport should be rolling
bool _started;
-
+
/// is true if the MIDI Start message has just been received until
/// the first MIDI Clock Event
bool _starting;
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 025f770fc3..993a340a70 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -18,7 +18,7 @@
*/
-#ifndef __ardour_smf_source_h__
+#ifndef __ardour_smf_source_h__
#define __ardour_smf_source_h__
#include <cstdio>
@@ -44,13 +44,13 @@ public:
SMFSource (Session& session, const XMLNode&, bool must_exist = false);
virtual ~SMFSource ();
-
+
bool safe_file_extension (const Glib::ustring& path) const {
return safe_midi_file_extension(path);
}
bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); }
-
+
void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev);
void append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sframes_t source_start);
@@ -64,7 +64,7 @@ public:
void destroy_model ();
void flush_midi ();
-
+
static void set_header_position_offset (nframes_t offset, bool negative);
static bool safe_midi_file_extension (const Glib::ustring& path);
diff --git a/libs/ardour/ardour/smpte.h b/libs/ardour/ardour/smpte.h
index d0901c372e..fa18a1eec4 100644
--- a/libs/ardour/ardour/smpte.h
+++ b/libs/ardour/ardour/smpte.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Paul Davis
+/* Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
diff --git a/libs/ardour/ardour/sndfile_helpers.h b/libs/ardour/ardour/sndfile_helpers.h
index 54190dcae3..ed84820b8d 100644
--- a/libs/ardour/ardour/sndfile_helpers.h
+++ b/libs/ardour/ardour/sndfile_helpers.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/sndfileimportable.h b/libs/ardour/ardour/sndfileimportable.h
index 42ce83c0ee..95c6d80ebb 100644
--- a/libs/ardour/ardour/sndfileimportable.h
+++ b/libs/ardour/ardour/sndfileimportable.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index d3c6cdb85a..7983b2e340 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*/
-#ifndef __sndfile_source_h__
+#ifndef __sndfile_source_h__
#define __sndfile_source_h__
#include <sndfile.h>
@@ -34,9 +34,9 @@ class SndFileSource : public AudioFileSource {
/* Constructor to be called for new in-session files */
SndFileSource (Session&, const Glib::ustring& path, bool embedded,
- SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
+ SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
Flag flags = SndFileSource::default_writable_flags);
-
+
/** Constructor to be called for existing in-session files */
SndFileSource (Session&, const XMLNode&);
diff --git a/libs/ardour/ardour/soundseq.h b/libs/ardour/ardour/soundseq.h
index c7157428ee..ff8e96ad8f 100644
--- a/libs/ardour/ardour/soundseq.h
+++ b/libs/ardour/ardour/soundseq.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h
index a61af84ac8..ae581f760d 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#include <boost/utility.hpp>
#include <sigc++/signal.h>
-#include "pbd/statefuldestructible.h"
+#include "pbd/statefuldestructible.h"
#include "ardour/ardour.h"
#include "ardour/session_object.h"
@@ -53,39 +53,39 @@ class Source : public SessionObject, public boost::noncopyable
Source (Session&, DataType type, const std::string& name, Flag flags=Flag(0));
Source (Session&, const XMLNode&);
-
+
virtual ~Source ();
-
+
DataType type() { return _type; }
time_t timestamp() const { return _timestamp; }
void stamp (time_t when) { _timestamp = when; }
-
+
virtual sframes_t length (sframes_t pos) const = 0;
virtual void update_length (sframes_t pos, sframes_t cnt) = 0;
-
+
virtual const Glib::ustring& path() const = 0;
virtual nframes64_t natural_position() const { return 0; }
void mark_for_remove();
-
+
virtual void mark_streaming_write_started () {}
virtual void mark_streaming_write_completed () = 0;
virtual void session_saved() {}
-
+
XMLNode& get_state ();
int set_state (const XMLNode&);
-
+
bool destructive() const { return (_flags & Destructive); }
bool writable () const { return (_flags & Writable); }
virtual bool set_destructive (bool /*yn*/) { return false; }
virtual bool length_mutable() const { return false; }
-
+
void use () { _in_use++; }
void disuse () { if (_in_use) { _in_use--; } }
-
+
void add_playlist (boost::shared_ptr<ARDOUR::Playlist>);
void remove_playlist (boost::weak_ptr<ARDOUR::Playlist>);
@@ -95,21 +95,21 @@ class Source : public SessionObject, public boost::noncopyable
sigc::signal<void,boost::shared_ptr<Source> > Switched;
bool has_been_analysed() const;
- virtual bool can_be_analysed() const { return false; }
+ virtual bool can_be_analysed() const { return false; }
virtual void set_been_analysed (bool yn);
virtual bool check_for_analysis_data_on_disk();
sigc::signal<void> AnalysisChanged;
-
+
AnalysisFeatureList transients;
std::string get_transients_path() const;
int load_transients (const std::string&);
-
+
sframes_t timeline_position() const { return _timeline_position; }
virtual void set_timeline_position (sframes_t pos);
-
+
void set_allow_remove_if_empty (bool yn);
-
+
Glib::Mutex& mutex() { return _lock; }
Flag flags() const { return _flags; }
@@ -122,7 +122,7 @@ class Source : public SessionObject, public boost::noncopyable
mutable Glib::Mutex _lock;
mutable Glib::Mutex _analysis_lock;
Glib::Mutex _playlist_lock;
-
+
typedef std::map<boost::shared_ptr<ARDOUR::Playlist>, uint32_t > PlaylistMap;
PlaylistMap _playlists;
diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h
index c5d5a410e9..8d53a3c865 100644
--- a/libs/ardour/ardour/source_factory.h
+++ b/libs/ardour/ardour/source_factory.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/spline.h b/libs/ardour/ardour/spline.h
index de1ece6edb..28af6d4c92 100644
--- a/libs/ardour/ardour/spline.h
+++ b/libs/ardour/ardour/spline.h
@@ -45,38 +45,38 @@ void spline_fill (Spline *, float x0, float x1, float *vec, uint32_t veclen);
float spline_get_max_x (Spline *);
float spline_get_min_x (Spline *);
-struct _spline
+struct _spline
{
- float *deriv2;
- float *x;
- float *y;
- float max_x;
- float min_x;
- SplinePoint *points;
- uint32_t npoints;
- uint32_t space;
+ float *deriv2;
+ float *x;
+ float *y;
+ float max_x;
+ float min_x;
+ SplinePoint *points;
+ uint32_t npoints;
+ uint32_t space;
#ifdef __cplusplus
- void set (uint32_t n, SplinePoint *points) {
- spline_set (this, n, points);
- }
-
- void add (uint32_t n, SplinePoint *points) {
- spline_add (this, n, points);
- }
-
- void solve () {
- spline_solve (this);
- }
-
- float eval (float val) {
- return spline_eval (this, val);
- }
-
- void fill (float x0, float x1, float *vec, uint32_t veclen) {
- spline_fill (this, x0, x1, vec, veclen);
- }
+ void set (uint32_t n, SplinePoint *points) {
+ spline_set (this, n, points);
+ }
+
+ void add (uint32_t n, SplinePoint *points) {
+ spline_add (this, n, points);
+ }
+
+ void solve () {
+ spline_solve (this);
+ }
+
+ float eval (float val) {
+ return spline_eval (this, val);
+ }
+
+ void fill (float x0, float x1, float *vec, uint32_t veclen) {
+ spline_fill (this, x0, x1, vec, veclen);
+ }
#endif /* __cplusplus */
diff --git a/libs/ardour/ardour/stretch.h b/libs/ardour/ardour/stretch.h
index b878d4794e..56a2555531 100644
--- a/libs/ardour/ardour/stretch.h
+++ b/libs/ardour/ardour/stretch.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
#ifdef WAF_BUILD
#include "libardour-config.h"
-#endif
+#endif
#include "ardour/filter.h"
diff --git a/libs/ardour/ardour/strip_silence.h b/libs/ardour/ardour/strip_silence.h
index dab3ddd3d5..217f6b3d8a 100644
--- a/libs/ardour/ardour/strip_silence.h
+++ b/libs/ardour/ardour/strip_silence.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,12 +21,12 @@
namespace ARDOUR {
-/// A filter to strip silence from regions
+/// A filter to strip silence from regions
class StripSilence : public Filter {
public:
StripSilence (Session &, double, nframes_t, nframes_t);
-
+
int run (boost::shared_ptr<ARDOUR::Region>);
private:
diff --git a/libs/ardour/ardour/tape_file_matcher.h b/libs/ardour/ardour/tape_file_matcher.h
index ff6e23dc79..6c8392f46f 100644
--- a/libs/ardour/ardour/tape_file_matcher.h
+++ b/libs/ardour/ardour/tape_file_matcher.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/template_utils.h b/libs/ardour/ardour/template_utils.h
index f40ed1c552..fefb4a7c47 100644
--- a/libs/ardour/ardour/template_utils.h
+++ b/libs/ardour/ardour/template_utils.h
@@ -15,8 +15,8 @@ namespace ARDOUR {
PBD::sys::path user_route_template_directory ();
struct TemplateInfo {
- std::string name;
- std::string path;
+ std::string name;
+ std::string path;
};
void find_route_templates (std::vector<TemplateInfo>& template_names);
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 49e370c7b4..69b7198408 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,8 +27,8 @@
#include <glibmm/thread.h>
#include "pbd/undo.h"
-#include "pbd/stateful.h"
-#include "pbd/statefuldestructible.h"
+#include "pbd/stateful.h"
+#include "pbd/statefuldestructible.h"
#include <sigc++/signal.h>
@@ -41,7 +41,7 @@ class Meter;
class Tempo {
public:
Tempo (double bpm, double type=4.0) // defaulting to quarter note
- : _beats_per_minute (bpm), _note_type(type) {}
+ : _beats_per_minute (bpm), _note_type(type) {}
double beats_per_minute () const { return _beats_per_minute;}
double note_type () const { return _note_type;}
@@ -56,12 +56,12 @@ class Meter {
public:
static const double ticks_per_beat;
- Meter (double bpb, double bt)
+ Meter (double bpb, double bt)
: _beats_per_bar (bpb), _note_type (bt) {}
double beats_per_bar () const { return _beats_per_bar; }
double note_divisor() const { return _note_type; }
-
+
double frames_per_bar (const Tempo&, nframes_t sr) const;
protected:
@@ -154,22 +154,22 @@ class TempoMap : public PBD::StatefulDestructible
};
struct BBTPoint {
- BBTPointType type;
- nframes_t frame;
- const Meter* meter;
- const Tempo* tempo;
- uint32_t bar;
- uint32_t beat;
-
- BBTPoint (const Meter& m, const Tempo& t, nframes_t f,
- BBTPointType ty, uint32_t b, uint32_t e)
- : type (ty), frame (f), meter (&m), tempo (&t), bar (b), beat (e) {}
+ BBTPointType type;
+ nframes_t frame;
+ const Meter* meter;
+ const Tempo* tempo;
+ uint32_t bar;
+ uint32_t beat;
+
+ BBTPoint (const Meter& m, const Tempo& t, nframes_t f,
+ BBTPointType ty, uint32_t b, uint32_t e)
+ : type (ty), frame (f), meter (&m), tempo (&t), bar (b), beat (e) {}
};
typedef std::vector<BBTPoint> BBTPointList;
-
+
template<class T> void apply_with_metrics (T& obj, void (T::*method)(const Metrics&)) {
- Glib::RWLock::ReaderLock lm (lock);
+ Glib::RWLock::ReaderLock lm (lock);
(obj.*method)(*metrics);
}
@@ -197,7 +197,7 @@ class TempoMap : public PBD::StatefulDestructible
void move_tempo (TempoSection&, const BBT_Time& to);
void move_meter (MeterSection&, const BBT_Time& to);
-
+
void remove_tempo(const TempoSection&);
void remove_meter(const MeterSection&);
@@ -223,17 +223,17 @@ class TempoMap : public PBD::StatefulDestructible
class Metric {
public:
Metric (const Meter& m, const Tempo& t) : _meter (&m), _tempo (&t), _frame (0) {}
-
+
void set_tempo (const Tempo& t) { _tempo = &t; }
void set_meter (const Meter& m) { _meter = &m; }
void set_frame (nframes_t f) { _frame = f; }
void set_start (const BBT_Time& t) { _start = t; }
-
+
const Meter& meter() const { return *_meter; }
const Tempo& tempo() const { return *_tempo; }
nframes_t frame() const { return _frame; }
const BBT_Time& start() const { return _start; }
-
+
private:
const Meter* _meter;
const Tempo* _tempo;
@@ -265,7 +265,7 @@ class TempoMap : public PBD::StatefulDestructible
bool last_bbt_valid;
BBT_Time last_bbt;
mutable Glib::RWLock lock;
-
+
void timestamp_metrics (bool use_bbt);
nframes_t round_to_type (nframes_t fr, int dir, BBTPointType);
diff --git a/libs/ardour/ardour/ticker.h b/libs/ardour/ardour/ticker.h
index 8e3ddd5547..f87bca665d 100644
--- a/libs/ardour/ardour/ticker.h
+++ b/libs/ardour/ardour/ticker.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Hans Baier
+ Copyright (C) 2008 Hans Baier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,12 +36,12 @@ class Ticker : public sigc::trackable
public:
Ticker() : _session(0) {};
virtual ~Ticker() {};
-
+
virtual void tick(
- const nframes_t& transport_frames,
- const BBT_Time& transport_bbt,
+ const nframes_t& transport_frames,
+ const BBT_Time& transport_bbt,
const SMPTE::Time& transport_smpte) = 0;
-
+
virtual void set_session(Session& s);
virtual void going_away() { _session = 0; }
@@ -56,45 +56,45 @@ private:
MidiClockTicker() : _midi_port(0), _ppqn(24), _last_tick(0.0) {};
MidiClockTicker( const MidiClockTicker& );
MidiClockTicker& operator= (const MidiClockTicker&);
-
+
public:
virtual ~MidiClockTicker() {};
-
+
static MidiClockTicker& instance() {
static MidiClockTicker _instance;
return _instance;
}
-
+
void tick(
- const nframes_t& transport_frames,
- const BBT_Time& transport_bbt,
+ const nframes_t& transport_frames,
+ const BBT_Time& transport_bbt,
const SMPTE::Time& transport_smpte);
-
+
void set_session(Session& s);
void going_away() { _midi_port = 0; Ticker::going_away(); }
/// slot for the signal session::MIDIClock_PortChanged
void update_midi_clock_port();
-
+
/// slot for the signal session::TransportStateChange
void transport_state_changed();
-
+
/// slot for the signal session::PositionChanged
void position_changed(nframes_t position);
/// slot for the signal session::TransportLooped
void transport_looped();
-
+
/// pulses per quarter note (default 24)
void set_ppqn(int ppqn) { _ppqn = ppqn; }
-private:
+private:
MIDI::Port* _midi_port;
int _ppqn;
double _last_tick;
double one_ppqn_in_frames(nframes_t transport_position);
-
+
void send_midi_clock_event(nframes_t offset);
void send_start_event(nframes_t offset);
void send_continue_event(nframes_t offset);
diff --git a/libs/ardour/ardour/timestamps.h b/libs/ardour/ardour/timestamps.h
index a0aeeae13d..f4380a648d 100644
--- a/libs/ardour/ardour/timestamps.h
+++ b/libs/ardour/ardour/timestamps.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index cb2d05caa6..1b191a1d3e 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,23 +37,23 @@ class Track : public Route
Track (Session&, std::string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO);
virtual ~Track ();
-
+
bool set_name (const std::string& str);
TrackMode mode () const { return _mode; }
virtual int set_mode (TrackMode /*m*/) { return false; }
virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; }
sigc::signal<void> TrackModeChanged;
-
- virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- bool state_changing, bool can_record, bool rec_monitors_input);
-
- int silent_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+
+ virtual int no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ bool state_changing, bool can_record, bool rec_monitors_input);
+
+ int silent_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
bool can_record, bool rec_monitors_input);
- virtual int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
- int declick, bool can_record, bool rec_monitors_input) = 0;
-
+ virtual int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+ int declick, bool can_record, bool rec_monitors_input) = 0;
+
void toggle_monitor_input ();
bool can_record();
@@ -73,7 +73,7 @@ class Track : public Route
};
FreezeState freeze_state() const;
-
+
virtual void freeze (InterThreadInfo&) = 0;
virtual void unfreeze () = 0;
@@ -89,9 +89,9 @@ class Track : public Route
bool record_enabled() const;
void set_record_enable (bool yn, void *src);
-
+
void set_meter_point (MeterPoint, void* src);
-
+
sigc::signal<void> DiskstreamChanged;
sigc::signal<void> FreezeChange;
@@ -106,37 +106,37 @@ class Track : public Route
//private: (FIXME)
struct FreezeRecordProcessorInfo {
- FreezeRecordProcessorInfo(XMLNode& st, boost::shared_ptr<Processor> proc)
- : state (st), processor (proc) {}
+ FreezeRecordProcessorInfo(XMLNode& st, boost::shared_ptr<Processor> proc)
+ : state (st), processor (proc) {}
- XMLNode state;
- boost::shared_ptr<Processor> processor;
- PBD::ID id;
+ XMLNode state;
+ boost::shared_ptr<Processor> processor;
+ PBD::ID id;
};
struct FreezeRecord {
- FreezeRecord()
- : have_mementos(false)
- {}
-
- ~FreezeRecord();
-
- boost::shared_ptr<Playlist> playlist;
- std::vector<FreezeRecordProcessorInfo*> processor_info;
- bool have_mementos;
- FreezeState state;
- gain_t gain;
- AutoState gain_automation_state;
- AutoState pan_automation_state;
+ FreezeRecord()
+ : have_mementos(false)
+ {}
+
+ ~FreezeRecord();
+
+ boost::shared_ptr<Playlist> playlist;
+ std::vector<FreezeRecordProcessorInfo*> processor_info;
+ bool have_mementos;
+ FreezeState state;
+ gain_t gain;
+ AutoState gain_automation_state;
+ AutoState pan_automation_state;
};
struct RecEnableControllable : public PBD::Controllable {
- RecEnableControllable (Track&);
-
- void set_value (float);
- float get_value (void) const;
+ RecEnableControllable (Track&);
- Track& track;
+ void set_value (float);
+ float get_value (void) const;
+
+ Track& track;
};
virtual void set_state_part_two () = 0;
@@ -146,7 +146,7 @@ class Track : public Route
sigc::connection recenable_connection;
sigc::connection ic_connection;
bool _destructive;
-
+
boost::shared_ptr<RecEnableControllable> _rec_enable_control;
};
diff --git a/libs/ardour/ardour/transient_detector.h b/libs/ardour/ardour/transient_detector.h
index 2f4fc4c4f7..eb75f71c85 100644
--- a/libs/ardour/ardour/transient_detector.h
+++ b/libs/ardour/ardour/transient_detector.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,11 +41,11 @@ class TransientDetector : public AudioAnalyser
float get_threshold () const;
float get_sensitivity () const;
-
+
int run (const std::string& path, Readable*, uint32_t channel, AnalysisFeatureList& results);
static void cleanup_transients (AnalysisFeatureList&, float sr, float gap_msecs);
-
+
protected:
AnalysisFeatureList* current_results;
int use_features (Vamp::Plugin::FeatureSet&, std::ostream*);
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 1a30cfd769..38a0e6d625 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -149,7 +149,7 @@ namespace ARDOUR {
FilterChannels, ///< Ignore events on certain channels
ForceChannel ///< Force all events to a certain channel
};
-
+
enum ColorMode {
MeterColors = 0,
ChannelColors,
@@ -157,30 +157,30 @@ namespace ARDOUR {
};
struct BBT_Time {
- uint32_t bars;
- uint32_t beats;
- uint32_t ticks;
+ uint32_t bars;
+ uint32_t beats;
+ uint32_t ticks;
- BBT_Time() {
- bars = 1;
- beats = 1;
- ticks = 0;
- }
+ BBT_Time() {
+ bars = 1;
+ beats = 1;
+ ticks = 0;
+ }
- /* we can't define arithmetic operators for BBT_Time, because
- the results depend on a TempoMap, but we can define
- a useful check on the less-than condition.
- */
+ /* we can't define arithmetic operators for BBT_Time, because
+ the results depend on a TempoMap, but we can define
+ a useful check on the less-than condition.
+ */
- bool operator< (const BBT_Time& other) const {
- return bars < other.bars ||
- (bars == other.bars && beats < other.beats) ||
- (bars == other.bars && beats == other.beats && ticks < other.ticks);
- }
+ bool operator< (const BBT_Time& other) const {
+ return bars < other.bars ||
+ (bars == other.bars && beats < other.beats) ||
+ (bars == other.bars && beats == other.beats && ticks < other.ticks);
+ }
- bool operator== (const BBT_Time& other) const {
- return bars == other.bars && beats == other.beats && ticks == other.ticks;
- }
+ bool operator== (const BBT_Time& other) const {
+ return bars == other.bars && beats == other.beats && ticks == other.ticks;
+ }
};
enum SmpteFormat {
@@ -197,63 +197,63 @@ namespace ARDOUR {
};
struct AnyTime {
- enum Type {
- SMPTE,
- BBT,
- Frames,
- Seconds
- };
+ enum Type {
+ SMPTE,
+ BBT,
+ Frames,
+ Seconds
+ };
- Type type;
+ Type type;
- SMPTE::Time smpte;
- BBT_Time bbt;
+ SMPTE::Time smpte;
+ BBT_Time bbt;
- union {
- nframes_t frames;
- double seconds;
- };
+ union {
+ nframes_t frames;
+ double seconds;
+ };
- AnyTime() { type = Frames; frames = 0; }
+ AnyTime() { type = Frames; frames = 0; }
};
struct AudioRange {
- nframes_t start;
- nframes_t end;
- uint32_t id;
+ nframes_t start;
+ nframes_t end;
+ uint32_t id;
- AudioRange (nframes_t s, nframes_t e, uint32_t i) : start (s), end (e) , id (i) {}
+ AudioRange (nframes_t s, nframes_t e, uint32_t i) : start (s), end (e) , id (i) {}
- nframes_t length() { return end - start + 1; }
+ nframes_t length() { return end - start + 1; }
- bool operator== (const AudioRange& other) const {
- return start == other.start && end == other.end && id == other.id;
- }
+ bool operator== (const AudioRange& other) const {
+ return start == other.start && end == other.end && id == other.id;
+ }
- bool equal (const AudioRange& other) const {
- return start == other.start && end == other.end;
- }
+ bool equal (const AudioRange& other) const {
+ return start == other.start && end == other.end;
+ }
- OverlapType coverage (nframes_t s, nframes_t e) const {
- return ARDOUR::coverage (start, end, s, e);
- }
+ OverlapType coverage (nframes_t s, nframes_t e) const {
+ return ARDOUR::coverage (start, end, s, e);
+ }
};
struct MusicRange {
- BBT_Time start;
- BBT_Time end;
- uint32_t id;
+ BBT_Time start;
+ BBT_Time end;
+ uint32_t id;
- MusicRange (BBT_Time& s, BBT_Time& e, uint32_t i)
- : start (s), end (e), id (i) {}
+ MusicRange (BBT_Time& s, BBT_Time& e, uint32_t i)
+ : start (s), end (e), id (i) {}
- bool operator== (const MusicRange& other) const {
- return start == other.start && end == other.end && id == other.id;
- }
+ bool operator== (const MusicRange& other) const {
+ return start == other.start && end == other.end && id == other.id;
+ }
- bool equal (const MusicRange& other) const {
- return start == other.start && end == other.end;
- }
+ bool equal (const MusicRange& other) const {
+ return start == other.start && end == other.end;
+ }
};
/*
@@ -285,9 +285,9 @@ namespace ARDOUR {
};
enum RegionPoint {
- Start,
- End,
- SyncPoint
+ Start,
+ End,
+ SyncPoint
};
enum Change {
@@ -342,10 +342,10 @@ namespace ARDOUR {
};
struct InterThreadInfo {
- volatile bool done;
- volatile bool cancel;
- volatile float progress;
- pthread_t thread;
+ volatile bool done;
+ volatile bool cancel;
+ volatile float progress;
+ pthread_t thread;
};
enum SampleFormat {
@@ -371,10 +371,10 @@ namespace ARDOUR {
};
struct PeakData {
- typedef Sample PeakDatum;
+ typedef Sample PeakDatum;
- PeakDatum min;
- PeakDatum max;
+ PeakDatum min;
+ PeakDatum max;
};
enum PluginType {
@@ -383,7 +383,7 @@ namespace ARDOUR {
LV2,
VST
};
-
+
enum RunContext {
ButlerContext = 0,
TransportContext,
@@ -403,7 +403,7 @@ namespace ARDOUR {
};
enum ShuttleUnits {
- Percentage,
+ Percentage,
Semitones
};
@@ -418,15 +418,16 @@ namespace ARDOUR {
};
struct TimeFXRequest : public InterThreadInfo {
- TimeFXRequest() : time_fraction(0), pitch_fraction(0),
+ TimeFXRequest()
+ : time_fraction(0), pitch_fraction(0),
quick_seek(false), antialias(false), opts(0) {}
- float time_fraction;
- float pitch_fraction;
- /* SoundTouch */
- bool quick_seek;
- bool antialias;
- /* RubberBand */
- int opts; // really RubberBandStretcher::Options
+ float time_fraction;
+ float pitch_fraction;
+ /* SoundTouch */
+ bool quick_seek;
+ bool antialias;
+ /* RubberBand */
+ int opts; // really RubberBandStretcher::Options
};
typedef std::list<nframes64_t> AnalysisFeatureList;
diff --git a/libs/ardour/ardour/uri_map.h b/libs/ardour/ardour/uri_map.h
index 78e5393271..c62ec6bfc4 100644
--- a/libs/ardour/ardour/uri_map.h
+++ b/libs/ardour/ardour/uri_map.h
@@ -26,7 +26,7 @@
#include <boost/utility.hpp>
#include <slv2/slv2.h>
#include "lv2ext/lv2_uri_map.h"
-
+
namespace ARDOUR {
@@ -35,7 +35,7 @@ namespace ARDOUR {
class URIMap : public boost::noncopyable {
public:
URIMap();
-
+
LV2_Feature* feature() { return &uri_map_feature; }
uint32_t uri_to_id(const char* map,
@@ -43,11 +43,11 @@ public:
private:
typedef std::map<std::string, uint32_t> Map;
-
+
static uint32_t uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data,
const char* map,
const char* uri);
-
+
LV2_Feature uri_map_feature;
LV2_URI_Map_Feature uri_map_feature_data;
Map uri_map;
diff --git a/libs/ardour/ardour/user_bundle.h b/libs/ardour/ardour/user_bundle.h
index 6d197450c3..fa37392fc0 100644
--- a/libs/ardour/ardour/user_bundle.h
+++ b/libs/ardour/ardour/user_bundle.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,11 +36,11 @@ class UserBundle : public Bundle, public PBD::Stateful {
UserBundle (XMLNode const &, bool);
XMLNode& get_state ();
-
+
private:
int set_state (XMLNode const &);
};
}
-
+
#endif
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index dc6c1b8479..e41c5f64ee 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999 Paul Davis
+ Copyright (C) 1999 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ static inline float f_max(float x, float a) {
x += fabsf (x);
x *= 0.5f;
x += a;
-
+
return (x);
}
diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h
index 1cb7e376e4..2d9875df57 100644
--- a/libs/ardour/ardour/vst_plugin.h
+++ b/libs/ardour/ardour/vst_plugin.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include <dlfcn.h>
#include <sigc++/signal.h>
-#include "pbd/stateful.h"
+#include "pbd/stateful.h"
#include <jack/types.h>
#include "ardour/plugin.h"
@@ -50,7 +50,7 @@ class VSTPlugin : public ARDOUR::Plugin
~VSTPlugin ();
/* Plugin interface */
-
+
std::string unique_id() const;
const char * label() const;
const char * name() const;
@@ -104,7 +104,7 @@ class VSTPluginInfo : public PluginInfo
public:
VSTPluginInfo () {}
~VSTPluginInfo () {}
-
+
PluginPtr load (Session& session);
};
diff --git a/libs/ardour/audio_buffer.cc b/libs/ardour/audio_buffer.cc
index c5717f0528..a57891a27d 100644
--- a/libs/ardour/audio_buffer.cc
+++ b/libs/ardour/audio_buffer.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006-2007 Paul Davis
-
+ Copyright (C) 2006-2007 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 04f4173e4d..55664eb352 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -81,7 +81,7 @@ AudioDiskstream::AudioDiskstream (Session &sess, const string &name, Diskstream:
in_set_state = false;
}
-
+
AudioDiskstream::AudioDiskstream (Session& sess, const XMLNode& node)
: Diskstream(sess, node)
, deprecated_io_node(NULL)
@@ -126,7 +126,7 @@ AudioDiskstream::~AudioDiskstream ()
{
RCUWriter<ChannelList> writer (channels);
boost::shared_ptr<ChannelList> c = writer.get_copy();
-
+
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
delete *chan;
}
@@ -170,31 +170,31 @@ AudioDiskstream::non_realtime_input_change ()
{
RCUWriter<ChannelList> writer (channels);
boost::shared_ptr<ChannelList> c = writer.get_copy();
-
+
_n_channels.set(DataType::AUDIO, c->size());
-
+
if (_io->n_ports().n_audio() > _n_channels.n_audio()) {
add_channel_to (c, _io->n_ports().n_audio() - _n_channels.n_audio());
} else if (_io->n_ports().n_audio() < _n_channels.n_audio()) {
remove_channel_from (c, _n_channels.n_audio() - _io->n_ports().n_audio());
}
}
-
+
get_input_sources ();
set_capture_offset ();
-
+
if (first_input_change) {
set_align_style (_persistent_alignment_style);
first_input_change = false;
} else {
set_align_style_from_io ();
}
-
+
input_change_pending = NoChange;
/* implicit unlock */
}
-
+
/* reset capture files */
reset_write_sources (false);
@@ -231,28 +231,28 @@ AudioDiskstream::get_input_sources ()
vector<string> connections;
for (n = 0, chan = c->begin(); chan != c->end() && n < ni; ++chan, ++n) {
-
+
connections.clear ();
if (_io->nth (n)->get_connections (connections) == 0) {
-
+
if ((*chan)->source) {
// _source->disable_metering ();
}
-
+
(*chan)->source = 0;
-
+
} else {
(*chan)->source = dynamic_cast<AudioPort*>(_session.engine().get_port_by_name (connections[0]) );
}
}
-}
+}
int
AudioDiskstream::find_and_use_playlist (const string& name)
{
boost::shared_ptr<AudioPlaylist> playlist;
-
+
if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist> (_session.playlist_by_name (name))) == 0) {
playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (DataType::AUDIO, _session, name));
}
@@ -280,7 +280,7 @@ AudioDiskstream::use_new_playlist ()
{
string newname;
boost::shared_ptr<AudioPlaylist> playlist;
-
+
if (!in_set_state && destructive()) {
return 0;
}
@@ -292,11 +292,11 @@ AudioDiskstream::use_new_playlist ()
}
if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (DataType::AUDIO, _session, newname, hidden()))) != 0) {
-
+
playlist->set_orig_diskstream_id (id());
return use_playlist (playlist);
- } else {
+ } else {
return -1;
}
}
@@ -319,11 +319,11 @@ AudioDiskstream::use_copy_playlist ()
boost::shared_ptr<AudioPlaylist> playlist;
newname = Playlist::bump_name (_playlist->name(), _session);
-
+
if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist>(PlaylistFactory::create (audio_playlist(), newname))) != 0) {
playlist->set_orig_diskstream_id (id());
return use_playlist (playlist);
- } else {
+ } else {
return -1;
}
}
@@ -333,7 +333,7 @@ AudioDiskstream::setup_destructive_playlist ()
{
SourceList srcs;
boost::shared_ptr<ChannelList> c = channels.reader();
-
+
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
srcs.push_back ((*chan)->write_source);
}
@@ -341,7 +341,7 @@ AudioDiskstream::setup_destructive_playlist ()
/* a single full-sized region */
boost::shared_ptr<Region> region (RegionFactory::create (srcs, 0, max_frames - srcs.front()->natural_position(), _name));
- _playlist->add_region (region, srcs.front()->natural_position());
+ _playlist->add_region (region, srcs.front()->natural_position());
}
void
@@ -349,7 +349,7 @@ AudioDiskstream::use_destructive_playlist ()
{
/* this is called from the XML-based constructor or ::set_destructive. when called,
we already have a playlist and a region, but we need to
- set up our sources for write. we use the sources associated
+ set up our sources for write. we use the sources associated
with the (presumed single, full-extent) region.
*/
@@ -413,9 +413,9 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfr
/* if per-track or global rec-enable turned on while the other was already on, we've started recording */
- if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
+ if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
-
+
/* starting to record: compute first+last frames */
first_recordable_frame = transport_frame + _capture_offset;
@@ -430,7 +430,7 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfr
first_recordable_frame += _session.worst_output_latency();
} else {
first_recordable_frame += _roll_delay;
- }
+ }
} else {
@@ -441,8 +441,8 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfr
if (!_session.config.get_punch_in()) {
/* manual punch in happens at the correct transport frame
- because the user hit a button. but to get alignment correct
- we have to back up the position of the new region to the
+ because the user hit a button. but to get alignment correct
+ we have to back up the position of the new region to the
appropriate spot given the roll delay.
*/
@@ -473,16 +473,16 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfr
capture_start_frame -= _roll_delay;
}
}
-
+
}
if (recordable() && destructive()) {
boost::shared_ptr<ChannelList> c = channels.reader();
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-
+
RingBufferNPT<CaptureTransition>::rw_vector transvec;
(*chan)->capture_transition_buf->get_write_vector(&transvec);
-
+
if (transvec.len[0] > 0) {
transvec.buf[0]->type = CaptureStart;
transvec.buf[0]->capture_val = capture_start_frame;
@@ -490,18 +490,18 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfr
}
else {
// bad!
- fatal << X_("programming error: capture_transition_buf is full on rec start! inconceivable!")
+ fatal << X_("programming error: capture_transition_buf is full on rec start! inconceivable!")
<< endmsg;
}
- }
+ }
}
} else if (!record_enabled() || !can_record) {
-
+
/* stop recording */
last_recordable_frame = transport_frame + _capture_offset;
-
+
if (_alignment_style == ExistingMaterial) {
last_recordable_frame += _session.worst_output_latency();
} else {
@@ -561,7 +561,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
// If we can't take the state lock return.
if (!state_lock.trylock()) {
return 1;
- }
+ }
commit_should_unlock = true;
adjust_capture_position = 0;
@@ -572,10 +572,10 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
if (nominally_recording || (_session.get_record_enabled() && _session.config.get_punch_in())) {
OverlapType ot;
-
+
// Safeguard against situations where process() goes haywire when autopunching and last_recordable_frame < first_recordable_frame
if (last_recordable_frame < first_recordable_frame) {
- last_recordable_frame = max_frames;
+ last_recordable_frame = max_frames;
}
ot = coverage (first_recordable_frame, last_recordable_frame, transport_frame, transport_frame + nframes);
@@ -584,7 +584,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
case OverlapNone:
rec_nframes = 0;
break;
-
+
case OverlapInternal:
/* ---------- recrange
|---| transrange
@@ -592,7 +592,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
rec_nframes = nframes;
rec_offset = 0;
break;
-
+
case OverlapStart:
/* |--------| recrange
-----| transrange
@@ -602,7 +602,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
rec_offset = first_recordable_frame - transport_frame;
}
break;
-
+
case OverlapEnd:
/* |--------| recrange
|-------- transrange
@@ -610,7 +610,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
rec_nframes = last_recordable_frame - transport_frame;
rec_offset = 0;
break;
-
+
case OverlapExternal:
/* |--------| recrange
-------------- transrange
@@ -643,13 +643,13 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
*/
for (n = 0, chan = c->begin(); chan != c->end() && n < limit; ++chan, ++n) {
-
+
ChannelInfo* chaninfo (*chan);
chaninfo->capture_buf->get_write_vector (&chaninfo->capture_vector);
if (rec_nframes <= chaninfo->capture_vector.len[0]) {
-
+
chaninfo->current_capture_buffer = chaninfo->capture_vector.buf[0];
/* note: grab the entire port buffer, but only copy what we were supposed to
@@ -681,7 +681,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
memcpy (chaninfo->capture_vector.buf[0], buf, sizeof (Sample) * first);
memcpy (chaninfo->capture_wrap_buffer+first, buf + first, sizeof (Sample) * (rec_nframes - first));
memcpy (chaninfo->capture_vector.buf[1], buf + first, sizeof (Sample) * (rec_nframes - first));
-
+
chaninfo->current_capture_buffer = chaninfo->capture_wrap_buffer;
}
}
@@ -693,9 +693,9 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
}
}
-
+
if (rec_nframes) {
-
+
/* data will be written to disk */
if (rec_nframes == nframes && rec_offset == 0) {
@@ -747,15 +747,15 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
} else {
necessary_samples = nframes;
}
-
+
for (chan = c->begin(); chan != c->end(); ++chan) {
(*chan)->playback_buf->get_read_vector (&(*chan)->playback_vector);
}
- n = 0;
+ n = 0;
for (chan = c->begin(); chan != c->end(); ++chan, ++n) {
-
+
ChannelInfo* chaninfo (*chan);
if (necessary_samples <= chaninfo->playback_vector.len[0]) {
@@ -764,26 +764,26 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
} else {
nframes_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
-
+
if (necessary_samples > total) {
cerr << "underrun for " << _name << endl;
DiskUnderrun ();
goto out;
-
+
} else {
-
+
memcpy ((char *) chaninfo->playback_wrap_buffer,
chaninfo->playback_vector.buf[0],
chaninfo->playback_vector.len[0] * sizeof (Sample));
memcpy (chaninfo->playback_wrap_buffer + chaninfo->playback_vector.len[0],
- chaninfo->playback_vector.buf[1],
+ chaninfo->playback_vector.buf[1],
(necessary_samples - chaninfo->playback_vector.len[0])
* sizeof (Sample));
-
+
chaninfo->current_playback_buffer = chaninfo->playback_wrap_buffer;
}
}
- }
+ }
if (rec_nframes == 0 && _actual_speed != 1.0f && _actual_speed != -1.0f) {
process_varispeed_playback(nframes, c);
@@ -805,10 +805,10 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can
/* we're exiting with failure, so ::commit will not
be called. unlock the state lock.
*/
-
+
commit_should_unlock = false;
state_lock.unlock();
- }
+ }
return ret;
}
@@ -817,16 +817,16 @@ void
AudioDiskstream::process_varispeed_playback(nframes_t nframes, boost::shared_ptr<ChannelList> c)
{
ChannelList::iterator chan;
-
+
interpolation.set_speed (_target_speed);
-
+
int channel = 0;
for (chan = c->begin(); chan != c->end(); ++chan, ++channel) {
ChannelInfo* chaninfo (*chan);
-
+
playback_distance = interpolation.interpolate (
channel, nframes, chaninfo->current_playback_buffer, chaninfo->speed_buffer);
-
+
chaninfo->current_playback_buffer = chaninfo->speed_buffer;
}
}
@@ -850,17 +850,17 @@ AudioDiskstream::commit (nframes_t /*nframes*/)
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
(*chan)->playback_buf->increment_read_ptr (playback_distance);
-
+
if (adjust_capture_position) {
(*chan)->capture_buf->increment_write_ptr (adjust_capture_position);
}
}
-
+
if (adjust_capture_position != 0) {
capture_captured += adjust_capture_position;
adjust_capture_position = 0;
}
-
+
if (_slaved) {
if (_io && _io->active()) {
need_butler = c->front()->playback_buf->write_space() >= c->front()->playback_buf->bufsize() / 2;
@@ -889,7 +889,7 @@ void
AudioDiskstream::set_pending_overwrite (bool yn)
{
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
-
+
pending_overwrite = yn;
overwrite_frame = playback_sample;
@@ -900,22 +900,22 @@ int
AudioDiskstream::overwrite_existing_buffers ()
{
boost::shared_ptr<ChannelList> c = channels.reader();
- Sample* mixdown_buffer;
- float* gain_buffer;
- int ret = -1;
+ Sample* mixdown_buffer;
+ float* gain_buffer;
+ int ret = -1;
bool reversed = (_visible_speed * _session.transport_speed()) < 0.0f;
overwrite_queued = false;
/* assume all are the same size */
nframes_t size = c->front()->playback_buf->bufsize();
-
- mixdown_buffer = new Sample[size];
- gain_buffer = new float[size];
-
+
+ mixdown_buffer = new Sample[size];
+ gain_buffer = new float[size];
+
/* reduce size so that we can fill the buffer correctly. */
size--;
-
+
uint32_t n=0;
nframes_t start;
@@ -923,7 +923,7 @@ AudioDiskstream::overwrite_existing_buffers ()
start = overwrite_frame;
nframes_t cnt = size;
-
+
/* to fill the buffer without resetting the playback sample, we need to
do it one or two chunks (normally two).
@@ -932,9 +932,9 @@ AudioDiskstream::overwrite_existing_buffers ()
^
overwrite_offset
|<- second chunk->||<----------------- first chunk ------------------>|
-
+
*/
-
+
nframes_t to_read = size - overwrite_offset;
if (read ((*chan)->playback_buf->buffer() + overwrite_offset, mixdown_buffer, gain_buffer, start, to_read, *chan, n, reversed)) {
@@ -942,11 +942,11 @@ AudioDiskstream::overwrite_existing_buffers ()
_id, size, playback_sample) << endmsg;
goto out;
}
-
+
if (cnt > to_read) {
cnt -= to_read;
-
+
if (read ((*chan)->playback_buf->buffer(), mixdown_buffer, gain_buffer,
start, cnt, *chan, n, reversed)) {
error << string_compose(_("AudioDiskstream %1: when refilling, cannot read %2 from playlist at frame %3"),
@@ -957,12 +957,12 @@ AudioDiskstream::overwrite_existing_buffers ()
}
ret = 0;
-
+
out:
pending_overwrite = false;
- delete [] gain_buffer;
- delete [] mixdown_buffer;
- return ret;
+ delete [] gain_buffer;
+ delete [] mixdown_buffer;
+ return ret;
}
int
@@ -974,21 +974,21 @@ AudioDiskstream::seek (nframes_t frame, bool complete_refill)
boost::shared_ptr<ChannelList> c = channels.reader();
Glib::Mutex::Lock lm (state_lock);
-
+
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
(*chan)->playback_buf->reset ();
(*chan)->capture_buf->reset ();
}
-
+
/* can't rec-enable in destructive mode if transport is before start */
-
+
if (destructive() && record_enabled() && frame < _session.current_start_frame()) {
disengage_record_enable ();
}
-
+
playback_sample = frame;
file_frame = frame;
-
+
if (complete_refill) {
while ((ret = do_refill_with_alloc ()) > 0) ;
} else {
@@ -1007,7 +1007,7 @@ AudioDiskstream::can_internal_playback_seek (nframes_t distance)
for (chan = c->begin(); chan != c->end(); ++chan) {
if ((*chan)->playback_buf->read_space() < distance) {
return false;
- }
+ }
}
return true;
}
@@ -1024,12 +1024,12 @@ AudioDiskstream::internal_playback_seek (nframes_t distance)
first_recordable_frame += distance;
playback_sample += distance;
-
+
return 0;
}
int
-AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, nframes_t& start, nframes_t cnt,
+AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, nframes_t& start, nframes_t cnt,
ChannelInfo* /*channel_info*/, int channel, bool reversed)
{
nframes_t this_read = 0;
@@ -1045,23 +1045,23 @@ AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
if (!reversed) {
/* Make the use of a Location atomic for this read operation.
-
+
Note: Locations don't get deleted, so all we care about
when I say "atomic" is that we are always pointing to
the same one and using a start/length values obtained
just once.
*/
-
+
if ((loc = loop_location) != 0) {
loop_start = loc->start();
loop_end = loc->end();
loop_length = loop_end - loop_start;
}
-
+
/* if we are looping, ensure that the first frame we read is at the correct
position within the loop.
*/
-
+
if (loc && start >= loop_end) {
//cerr << "start adjusted from " << start;
start = loop_start + ((start - loop_start) % loop_length);
@@ -1076,7 +1076,7 @@ AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
if (reversed) {
start -= cnt;
}
-
+
/* take any loop into account. we can't read past the end of the loop. */
if (loc && (loop_end - start < cnt)) {
@@ -1095,27 +1095,27 @@ AudioDiskstream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
this_read = min(cnt,this_read);
if (audio_playlist()->read (buf+offset, mixdown_buffer, gain_buffer, start, this_read, channel) != this_read) {
- error << string_compose(_("AudioDiskstream %1: cannot read %2 from playlist at frame %3"), _id, this_read,
+ error << string_compose(_("AudioDiskstream %1: cannot read %2 from playlist at frame %3"), _id, this_read,
start) << endmsg;
return -1;
}
_read_data_count = _playlist->read_data_count();
-
+
if (reversed) {
swap_by_ptr (buf, buf + this_read - 1);
-
+
} else {
-
+
/* if we read to the end of the loop, go back to the beginning */
-
+
if (reloop) {
start = loop_start;
} else {
start += this_read;
}
- }
+ }
cnt -= this_read;
offset += this_read;
@@ -1131,7 +1131,7 @@ AudioDiskstream::do_refill_with_alloc ()
float* gain_buf = new float[disk_io_chunk_frames];
int ret = _do_refill(mix_buf, gain_buf);
-
+
delete [] mix_buf;
delete [] gain_buf;
@@ -1165,7 +1165,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
vector.len[1] = 0;
c->front()->playback_buf->get_write_vector (&vector);
-
+
if ((total_space = vector.len[0] + vector.len[1]) == 0) {
return 0;
}
@@ -1174,27 +1174,27 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
this track, let the caller know so that it can arrange
for us to be called again, ASAP.
*/
-
+
if (total_space >= (_slaved?3:2) * disk_io_chunk_frames) {
ret = 1;
}
-
- /* if we're running close to normal speed and there isn't enough
- space to do disk_io_chunk_frames of I/O, then don't bother.
-
+
+ /* if we're running close to normal speed and there isn't enough
+ space to do disk_io_chunk_frames of I/O, then don't bother.
+
at higher speeds, just do it because the sync between butler
and audio thread may not be good enough.
*/
-
+
if ((total_space < disk_io_chunk_frames) && fabs (_actual_speed) < 2.0f) {
return 0;
}
-
+
/* when slaved, don't try to get too close to the read pointer. this
leaves space for the buffer reversal to have something useful to
work with.
*/
-
+
if (_slaved && total_space < (c->front()->playback_buf->bufsize() / 2)) {
return 0;
}
@@ -1210,7 +1210,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
/* at start: nothing to do but fill with silence */
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
-
+
ChannelInfo* chan (*i);
chan->playback_buf->get_write_vector (&vector);
memset (vector.buf[0], 0, sizeof(Sample) * vector.len[0]);
@@ -1224,8 +1224,8 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
if (file_frame < total_space) {
- /* too close to the start: read what we can,
- and then zero fill the rest
+ /* too close to the start: read what we can,
+ and then zero fill the rest
*/
zero_fill = total_space - file_frame;
@@ -1233,7 +1233,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
file_frame = 0;
} else {
-
+
zero_fill = 0;
}
@@ -1242,9 +1242,9 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
if (file_frame == max_frames) {
/* at end: nothing to do but fill with silence */
-
+
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
-
+
ChannelInfo* chan (*i);
chan->playback_buf->get_write_vector (&vector);
memset (vector.buf[0], 0, sizeof(Sample) * vector.len[0]);
@@ -1255,7 +1255,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
}
return 0;
}
-
+
if (file_frame > max_frames - total_space) {
/* to close to the end: read what we can, and zero fill the rest */
@@ -1267,7 +1267,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
zero_fill = 0;
}
}
-
+
nframes_t file_frame_tmp = 0;
for (chan_n = 0, i = c->begin(); i != c->end(); ++i, ++chan_n) {
@@ -1280,27 +1280,27 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
chan->playback_buf->get_write_vector (&vector);
if (vector.len[0] > disk_io_chunk_frames) {
-
+
/* we're not going to fill the first chunk, so certainly do not bother with the
other part. it won't be connected with the part we do fill, as in:
-
+
.... => writable space
++++ => readable space
^^^^ => 1 x disk_io_chunk_frames that would be filled
-
+
|......|+++++++++++++|...............................|
buf1 buf0
^^^^^^^^^^^^^^^
-
-
- So, just pretend that the buf1 part isn't there.
-
+
+
+ So, just pretend that the buf1 part isn't there.
+
*/
-
+
vector.buf[1] = 0;
vector.len[1] = 0;
-
- }
+
+ }
ts = total_space;
file_frame_tmp = file_frame;
@@ -1336,7 +1336,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
ret = -1;
goto out;
}
-
+
chan->playback_buf->increment_write_ptr (to_read);
}
@@ -1345,13 +1345,13 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
}
}
-
+
file_frame = file_frame_tmp;
out:
return ret;
-}
+}
/** Flush pending data to disk.
*
@@ -1359,7 +1359,7 @@ AudioDiskstream::_do_refill (Sample* mixdown_buffer, float* gain_buffer)
* of data to disk. it will never write more than that. If it writes that
* much and there is more than that waiting to be written, it will return 1,
* otherwise 0 on success or -1 on failure.
- *
+ *
* If there is less than disk_io_chunk_frames to be written, no data will be
* written at all unless @a force_flush is true.
*/
@@ -1381,7 +1381,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
boost::shared_ptr<ChannelList> c = channels.reader();
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-
+
(*chan)->capture_buf->get_read_vector (&vector);
total = vector.len[0] + vector.len[1];
@@ -1393,7 +1393,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
/* if there are 2+ chunks of disk i/o possible for
this track, let the caller know so that it can arrange
for us to be called again, ASAP.
-
+
if we are forcing a flush, then if there is* any* extra
work, let the caller know.
@@ -1403,10 +1403,10 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
if (total >= 2 * disk_io_chunk_frames || ((force_flush || !was_recording) && total > disk_io_chunk_frames)) {
ret = 1;
- }
+ }
to_write = min (disk_io_chunk_frames, (nframes_t) vector.len[0]);
-
+
// check the transition buffer when recording destructive
// important that we get this after the capture buf
@@ -1418,7 +1418,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
for (ti=0; ti < transcount; ++ti) {
CaptureTransition & captrans = (ti < transvec.len[0]) ? transvec.buf[0][ti] : transvec.buf[1][ti-transvec.len[0]];
-
+
if (captrans.type == CaptureStart) {
// by definition, the first data we got above represents the given capture pos
@@ -1434,7 +1434,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
if (captrans.capture_val <= (*chan)->curr_capture_cnt + to_write) {
// shorten to make the write a perfect fit
- uint32_t nto_write = (captrans.capture_val - (*chan)->curr_capture_cnt);
+ uint32_t nto_write = (captrans.capture_val - (*chan)->curr_capture_cnt);
if (nto_write < to_write) {
ret = 1; // should we?
@@ -1442,7 +1442,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
to_write = nto_write;
(*chan)->write_source->mark_capture_end ();
-
+
// increment past this transition, but go no further
++ti;
break;
@@ -1467,14 +1467,14 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
(*chan)->capture_buf->increment_read_ptr (to_write);
(*chan)->curr_capture_cnt += to_write;
-
+
if ((to_write == vector.len[0]) && (total > to_write) && (to_write < disk_io_chunk_frames) && !destructive()) {
-
+
/* we wrote all of vector.len[0] but it wasn't an entire
- disk_io_chunk_frames of data, so arrange for some part
+ disk_io_chunk_frames of data, so arrange for some part
of vector.len[1] to be flushed to disk as well.
*/
-
+
to_write = min ((nframes_t)(disk_io_chunk_frames - to_write), (nframes_t) vector.len[1]);
if ((*chan)->write_source->write (vector.buf[1], to_write) != to_write) {
@@ -1483,7 +1483,7 @@ AudioDiskstream::do_flush (RunContext /*context*/, bool force_flush)
}
_write_data_count += (*chan)->write_source->write_data_count();
-
+
(*chan)->capture_buf->increment_read_ptr (to_write);
(*chan)->curr_capture_cnt += to_write;
}
@@ -1506,12 +1506,12 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
ChannelList::iterator chan;
vector<CaptureInfo*>::iterator ci;
boost::shared_ptr<ChannelList> c = channels.reader();
- uint32_t n = 0;
+ uint32_t n = 0;
bool mark_write_completed = false;
finish_capture (true, c);
- /* butler is already stopped, but there may be work to do
+ /* butler is already stopped, but there may be work to do
to flush remaining data to disk.
*/
@@ -1530,13 +1530,13 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
/* XXX is there anything we can do if err != 0 ? */
Glib::Mutex::Lock lm (capture_info_lock);
-
+
if (capture_info.empty()) {
return;
}
if (abort_capture) {
-
+
if (destructive()) {
goto outout;
}
@@ -1544,17 +1544,17 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
if ((*chan)->write_source) {
-
+
(*chan)->write_source->mark_for_remove ();
(*chan)->write_source->drop_references ();
(*chan)->write_source.reset ();
}
-
+
/* new source set up in "out" below */
}
goto out;
- }
+ }
for (total_capture = 0, ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
total_capture += (*ci)->frames;
@@ -1565,7 +1565,7 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
boost::shared_ptr<AudioFileSource> s = (*chan)->write_source;
-
+
if (s) {
srcs.push_back (s);
s->update_header (capture_info.front()->start, when, twhen);
@@ -1581,12 +1581,12 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
if (destructive()) {
- /* send a signal that any UI can pick up to do the right thing. there is
+ /* send a signal that any UI can pick up to do the right thing. there is
a small problem here in that a UI may need the peak data to be ready
for the data that was recorded and this isn't interlocked with that
process. this problem is deferred to the UI.
*/
-
+
_playlist->Modified();
} else {
@@ -1599,56 +1599,56 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
so that any sub-regions will obviously be
children of this one (later!)
*/
-
+
try {
boost::shared_ptr<Region> rx (RegionFactory::create (srcs,
- c->front()->write_source->last_capture_start_frame(), total_capture,
+ c->front()->write_source->last_capture_start_frame(), total_capture,
whole_file_region_name, 0,
Region::Flag (Region::DefaultFlags|Region::Automatic|Region::WholeFile)));
region = boost::dynamic_pointer_cast<AudioRegion> (rx);
region->special_set_position (capture_info.front()->start);
}
-
-
+
+
catch (failed_constructor& err) {
error << string_compose(_("%1: could not create region for complete audio file"), _name) << endmsg;
/* XXX what now? */
}
-
+
_last_capture_regions.push_back (region);
// cerr << _name << ": there are " << capture_info.size() << " capture_info records\n";
-
+
XMLNode &before = _playlist->get_state();
_playlist->freeze ();
-
+
for (buffer_position = c->front()->write_source->last_capture_start_frame(), ci = capture_info.begin(); ci != capture_info.end(); ++ci) {
-
+
string region_name;
_session.region_name (region_name, whole_file_region_name, false);
-
+
// cerr << _name << ": based on ci of " << (*ci)->start << " for " << (*ci)->frames << " add region " << region_name << endl;
-
+
try {
boost::shared_ptr<Region> rx (RegionFactory::create (srcs, buffer_position, (*ci)->frames, region_name));
region = boost::dynamic_pointer_cast<AudioRegion> (rx);
}
-
+
catch (failed_constructor& err) {
error << _("AudioDiskstream: could not create region for captured audio!") << endmsg;
continue; /* XXX is this OK? */
}
-
+
region->GoingAway.connect (bind (mem_fun (*this, &Diskstream::remove_region_from_last_capture), boost::weak_ptr<Region>(region)));
-
+
_last_capture_regions.push_back (region);
-
+
i_am_the_modifier++;
_playlist->add_region (region, (*ci)->start, 1, non_layered());
i_am_the_modifier--;
-
+
buffer_position += (*ci)->frames;
}
@@ -1703,10 +1703,10 @@ AudioDiskstream::transport_looped (nframes_t transport_frame)
if (recordable() && destructive()) {
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-
+
RingBufferNPT<CaptureTransition>::rw_vector transvec;
(*chan)->capture_transition_buf->get_write_vector(&transvec);
-
+
if (transvec.len[0] > 0) {
transvec.buf[0]->type = CaptureStart;
transvec.buf[0]->capture_val = capture_start_frame;
@@ -1714,10 +1714,10 @@ AudioDiskstream::transport_looped (nframes_t transport_frame)
}
else {
// bad!
- fatal << X_("programming error: capture_transition_buf is full on rec loop! inconceivable!")
+ fatal << X_("programming error: capture_transition_buf is full on rec loop! inconceivable!")
<< endmsg;
}
- }
+ }
}
}
@@ -1727,17 +1727,17 @@ void
AudioDiskstream::finish_capture (bool /*rec_monitors_input*/, boost::shared_ptr<ChannelList> c)
{
was_recording = false;
-
+
if (capture_captured == 0) {
return;
}
if (recordable() && destructive()) {
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-
+
RingBufferNPT<CaptureTransition>::rw_vector transvec;
(*chan)->capture_transition_buf->get_write_vector(&transvec);
-
+
if (transvec.len[0] > 0) {
transvec.buf[0]->type = CaptureEnd;
transvec.buf[0]->capture_val = capture_captured;
@@ -1749,15 +1749,15 @@ AudioDiskstream::finish_capture (bool /*rec_monitors_input*/, boost::shared_ptr<
}
}
}
-
-
+
+
CaptureInfo* ci = new CaptureInfo;
-
+
ci->start = capture_start_frame;
ci->frames = capture_captured;
-
- /* XXX theoretical race condition here. Need atomic exchange ?
- However, the circumstances when this is called right
+
+ /* XXX theoretical race condition here. Need atomic exchange ?
+ However, the circumstances when this is called right
now (either on record-disable or transport_stopped)
mean that no actual race exists. I think ...
We now have a capture_info_lock, but it is only to be used
@@ -1827,7 +1827,7 @@ AudioDiskstream::engage_record_enable ()
capturing_sources.push_back ((*chan)->write_source);
(*chan)->write_source->mark_streaming_write_started ();
}
-
+
} else {
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
capturing_sources.push_back ((*chan)->write_source);
@@ -1868,7 +1868,7 @@ AudioDiskstream::get_state ()
node->add_property ("channels", buf);
node->add_property ("playlist", _playlist->name());
-
+
snprintf (buf, sizeof(buf), "%.12g", _visible_speed);
node->add_property ("speed", buf);
@@ -1920,23 +1920,23 @@ AudioDiskstream::set_state (const XMLNode& node)
in_set_state = true;
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() == IO::state_node_name) {
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+ if ((*niter)->name() == IO::state_node_name) {
deprecated_io_node = new XMLNode (**niter);
- }
+ }
if ((*niter)->name() == X_("CapturingSources")) {
capture_pending_node = *niter;
}
- }
+ }
/* prevent write sources from being created */
-
+
in_set_state = true;
-
+
if ((prop = node.property ("name")) != 0) {
_name = prop->value();
- }
+ }
if (deprecated_io_node) {
if ((prop = deprecated_io_node->property ("id")) != 0) {
@@ -1955,12 +1955,12 @@ AudioDiskstream::set_state (const XMLNode& node)
if ((prop = node.property ("channels")) != 0) {
nchans = atoi (prop->value().c_str());
}
-
+
// create necessary extra channels
// we are always constructed with one and we always need one
_n_channels.set(DataType::AUDIO, channels.reader()->size());
-
+
if (nchans > _n_channels.n_audio()) {
add_channel (nchans - _n_channels.n_audio());
@@ -1977,7 +1977,7 @@ AudioDiskstream::set_state (const XMLNode& node)
{
bool had_playlist = (_playlist != 0);
-
+
if (find_and_use_playlist (prop->value())) {
return -1;
}
@@ -1985,7 +1985,7 @@ AudioDiskstream::set_state (const XMLNode& node)
if (!had_playlist) {
_playlist->set_orig_diskstream_id (_id);
}
-
+
if (!destructive() && capture_pending_node) {
/* destructive streams have one and only one source per channel,
and so they never end up in pending capture in any useful
@@ -2010,10 +2010,10 @@ AudioDiskstream::set_state (const XMLNode& node)
capturing_sources.clear ();
- /* write sources are handled when we handle the input set
+ /* write sources are handled when we handle the input set
up of the IO that owns this DS (::non_realtime_input_change())
*/
-
+
return 0;
}
@@ -2032,7 +2032,7 @@ AudioDiskstream::use_new_write_source (uint32_t n)
}
ChannelInfo* chan = (*c)[n];
-
+
if (chan->write_source) {
chan->write_source->done_with_peakfile_writes ();
chan->write_source->set_allow_remove_if_empty (true);
@@ -2043,7 +2043,7 @@ AudioDiskstream::use_new_write_source (uint32_t n)
if ((chan->write_source = _session.create_audio_source_for_session (*this, n, destructive())) == 0) {
throw failed_constructor();
}
- }
+ }
catch (failed_constructor &err) {
error << string_compose (_("%1:%2 new capture file not initialized correctly"), _name, n) << endmsg;
@@ -2068,7 +2068,7 @@ AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
if (!_session.writable() || !recordable()) {
return;
}
-
+
capturing_sources.clear ();
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
@@ -2153,10 +2153,10 @@ AudioDiskstream::allocate_temporary_buffers ()
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
if ((*chan)->playback_wrap_buffer)
delete [] (*chan)->playback_wrap_buffer;
- (*chan)->playback_wrap_buffer = new Sample[required_wrap_size];
+ (*chan)->playback_wrap_buffer = new Sample[required_wrap_size];
if ((*chan)->capture_wrap_buffer)
delete [] (*chan)->capture_wrap_buffer;
- (*chan)->capture_wrap_buffer = new Sample[required_wrap_size];
+ (*chan)->capture_wrap_buffer = new Sample[required_wrap_size];
}
wrap_buffer_size = required_wrap_size;
@@ -2169,7 +2169,7 @@ AudioDiskstream::monitor_input (bool yn)
boost::shared_ptr<ChannelList> c = channels.reader();
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
-
+
if ((*chan)->source) {
(*chan)->source->ensure_monitor_input (yn);
}
@@ -2186,7 +2186,7 @@ AudioDiskstream::set_align_style_from_io ()
}
get_input_sources ();
-
+
boost::shared_ptr<ChannelList> c = channels.reader();
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
@@ -2213,7 +2213,7 @@ AudioDiskstream::add_channel_to (boost::shared_ptr<ChannelList> c, uint32_t how_
}
_n_channels.set(DataType::AUDIO, c->size());
-
+
return 0;
}
@@ -2232,7 +2232,7 @@ AudioDiskstream::remove_channel_from (boost::shared_ptr<ChannelList> c, uint32_t
while (how_many-- && !c->empty()) {
// FIXME: crash (thread safe with RCU?)
// memory leak, when disabled.... :(
- //delete c->back();
+ //delete c->back();
c->pop_back();
interpolation.remove_channel_from ();
}
@@ -2247,7 +2247,7 @@ AudioDiskstream::remove_channel (uint32_t how_many)
{
RCUWriter<ChannelList> writer (channels);
boost::shared_ptr<ChannelList> c = writer.get_copy();
-
+
return remove_channel_from (c, how_many);
}
@@ -2316,7 +2316,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
}
pending_sources.push_back (fs);
-
+
if (first_fs == 0) {
first_fs = fs;
}
@@ -2337,7 +2337,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
}
boost::shared_ptr<AudioRegion> region;
-
+
try {
region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (
pending_sources, 0, first_fs->length(first_fs->timeline_position()),
@@ -2350,7 +2350,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
error << string_compose (
_("%1: cannot create whole-file region from pending capture sources"),
_name) << endmsg;
-
+
return -1;
}
@@ -2364,7 +2364,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
error << string_compose (_("%1: cannot create region from pending capture sources"),
_name)
<< endmsg;
-
+
return -1;
}
@@ -2377,7 +2377,7 @@ int
AudioDiskstream::set_non_layered (bool yn)
{
if (yn != non_layered()) {
-
+
if (yn) {
_flags = Flag (_flags | NonLayered);
} else {
@@ -2394,10 +2394,10 @@ AudioDiskstream::set_destructive (bool yn)
bool bounce_ignored;
if (yn != destructive()) {
-
+
if (yn) {
/* requestor should already have checked this and
- bounced if necessary and desired
+ bounced if necessary and desired
*/
if (!can_become_destructive (bounce_ignored)) {
return -1;
@@ -2432,7 +2432,7 @@ AudioDiskstream::can_become_destructive (bool& requires_bounce) const
assert (first);
/* do the source(s) for the region cover the session start position ? */
-
+
if (first->position() != _session.current_start_frame()) {
if (first->start() > _session.current_start_frame()) {
requires_bounce = true;
@@ -2447,7 +2447,7 @@ AudioDiskstream::can_become_destructive (bool& requires_bounce) const
assert (afirst);
if (afirst->source()->used() > 1) {
- requires_bounce = true;
+ requires_bounce = true;
return false;
}
@@ -2470,11 +2470,11 @@ AudioDiskstream::ChannelInfo::ChannelInfo (nframes_t bufsize, nframes_t speed_si
playback_buf = new RingBufferNPT<Sample> (bufsize);
capture_buf = new RingBufferNPT<Sample> (bufsize);
capture_transition_buf = new RingBufferNPT<CaptureTransition> (256);
-
+
/* touch the ringbuffer buffers, which will cause
them to be mapped into locked physical RAM if
we're running with mlockall(). this doesn't do
- much if we're not.
+ much if we're not.
*/
memset (playback_buf->buffer(), 0, sizeof (Sample) * playback_buf->bufsize());
@@ -2487,7 +2487,7 @@ AudioDiskstream::ChannelInfo::~ChannelInfo ()
if (write_source) {
write_source.reset ();
}
-
+
delete [] speed_buffer;
speed_buffer = 0;
@@ -2496,7 +2496,7 @@ AudioDiskstream::ChannelInfo::~ChannelInfo ()
delete [] capture_wrap_buffer;
capture_wrap_buffer = 0;
-
+
delete playback_buf;
playback_buf = 0;
diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc
index 3dc97c622a..26f225273f 100644
--- a/libs/ardour/audio_library.cc
+++ b/libs/ardour/audio_library.cc
@@ -51,7 +51,7 @@ AudioLibrary::AudioLibrary ()
sfdb_file_path /= sfdb_file_name;
src = Glib::filename_to_uri (sfdb_file_path.to_string ());
-
+
// workaround for possible bug in raptor that crashes when saving to a
// non-existant file.
@@ -77,11 +77,11 @@ AudioLibrary::set_tags (string member, vector<string> tags)
{
sort (tags.begin(), tags.end());
tags.erase (unique(tags.begin(), tags.end()), tags.end());
-
+
const string file_uri(Glib::filename_to_uri (member));
-
+
lrdf_remove_uri_matches (file_uri.c_str());
-
+
for (vector<string>::iterator i = tags.begin(); i != tags.end(); ++i) {
lrdf_add_triple (src.c_str(), file_uri.c_str(), TAG, (*i).c_str(), lrdf_literal);
}
@@ -91,27 +91,27 @@ vector<string>
AudioLibrary::get_tags (string member)
{
vector<string> tags;
-
+
lrdf_statement pattern;
pattern.subject = strdup(Glib::filename_to_uri(member).c_str());
pattern.predicate = (char*)TAG;
pattern.object = 0;
pattern.object_type = lrdf_literal;
-
+
lrdf_statement* matches = lrdf_matches (&pattern);
free (pattern.subject);
-
+
lrdf_statement* current = matches;
while (current != 0) {
tags.push_back (current->object);
-
+
current = current->next;
}
-
+
lrdf_free_statements (matches);
-
+
sort (tags.begin(), tags.end());
-
+
return tags;
}
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index d6bd83a478..a140d19da1 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
+ Copyright (C) 2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -73,9 +73,9 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, stri
RegionList::const_iterator out_n = regions.begin();
while (out_o != other->regions.end()) {
-
+
boost::shared_ptr<AudioRegion>ar2 = boost::dynamic_pointer_cast<AudioRegion>(*out_o);
-
+
if ((*xfades)->out() == ar2) {
boost::shared_ptr<AudioRegion>in = boost::dynamic_pointer_cast<AudioRegion>(*in_n);
boost::shared_ptr<AudioRegion>out = boost::dynamic_pointer_cast<AudioRegion>(*out_n);
@@ -83,7 +83,7 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, stri
add_crossfade(new_fade);
break;
}
-
+
out_o++;
out_n++;
}
@@ -104,12 +104,12 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, nfra
AudioPlaylist::~AudioPlaylist ()
{
- GoingAway (); /* EMIT SIGNAL */
+ GoingAway (); /* EMIT SIGNAL */
/* drop connections to signals */
notify_callbacks ();
-
+
_crossfades.clear ();
}
@@ -129,9 +129,9 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf
nframes_t skip_frames;
/* optimizing this memset() away involves a lot of conditionals
- that may well cause more of a hit due to cache misses
+ that may well cause more of a hit due to cache misses
and related stuff than just doing this here.
-
+
it would be great if someone could measure this
at some point.
@@ -143,7 +143,7 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf
memset (buf, 0, sizeof (Sample) * cnt);
- /* this function is never called from a realtime thread, so
+ /* this function is never called from a realtime thread, so
its OK to block (for short intervals).
*/
@@ -202,7 +202,7 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf
ar->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n, read_frames, skip_frames);
_read_data_count += ar->read_data_count();
}
-
+
for (vector<boost::shared_ptr<Crossfade> >::iterator i = x.begin(); i != x.end(); ++i) {
(*i)->read_at (buf, mixdown_buffer, gain_buffer, start, cnt, chan_n);
@@ -225,7 +225,7 @@ AudioPlaylist::remove_dependents (boost::shared_ptr<Region> region)
if (in_set_state) {
return;
}
-
+
if (r == 0) {
fatal << _("programming error: non-audio Region passed to remove_overlap in audio playlist")
<< endmsg;
@@ -233,7 +233,7 @@ AudioPlaylist::remove_dependents (boost::shared_ptr<Region> region)
}
for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ) {
-
+
if ((*i)->involves (r)) {
i = _crossfades.erase (i);
} else {
@@ -260,7 +260,7 @@ AudioPlaylist::flush_notifications ()
}
_pending_xfade_adds.clear ();
-
+
in_flush = false;
}
@@ -277,7 +277,7 @@ AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r)
for (Crossfades::iterator x = _crossfades.begin(); x != _crossfades.end();) {
Crossfades::iterator tmp;
-
+
tmp = x;
++tmp;
@@ -286,7 +286,7 @@ AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r)
if ((*x)->involves (ar)) {
pair<set<boost::shared_ptr<Crossfade> >::iterator, bool> const u = updated.insert (*x);
-
+
if (u.second) {
/* x was successfully inserted into the set, so it has not already been updated */
try {
@@ -316,7 +316,7 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared
++tmp;
boost::shared_ptr<Crossfade> fade;
-
+
if ((*x)->_in == orig) {
if (! (*x)->covers(right->position())) {
fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, left, (*x)->_out));
@@ -325,7 +325,7 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared
fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, right, (*x)->_out));
}
}
-
+
if ((*x)->_out == orig) {
if (! (*x)->covers(right->position())) {
fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, (*x)->_in, right));
@@ -334,7 +334,7 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared
fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, (*x)->_in, left));
}
}
-
+
if (fade) {
_crossfades.remove (*x);
add_crossfade (fade);
@@ -385,7 +385,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
if (other->muted() || region->muted()) {
continue;
}
-
+
if (other->layer() < region->layer()) {
top = region;
@@ -413,41 +413,41 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
break;
case OverlapExternal:
-
+
/* [ -------- top ------- ]
* {=========== bottom =============}
*/
-
+
/* to avoid discontinuities at the region boundaries of an internal
overlap (this region is completely within another), we create
two hidden crossfades at each boundary. this is not dependent
on the auto-xfade option, because we require it as basic
audio engineering.
*/
-
+
xfade_length = min ((nframes_t) 720, top->length());
if (top_region_at (top->first_frame()) == top) {
-
+
xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
add_crossfade (xfade);
}
if (top_region_at (top->last_frame() - 1) == top) {
- /*
- only add a fade out if there is no region on top of the end of 'top' (which
+ /*
+ only add a fade out if there is no region on top of the end of 'top' (which
would cover it).
*/
-
+
xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, top->last_frame() - xfade_length, EndOfOut));
add_crossfade (xfade);
}
break;
case OverlapStart:
- /* { ==== top ============ }
- * [---- bottom -------------------]
+ /* { ==== top ============ }
+ * [---- bottom -------------------]
*/
if (_session.config.get_xfade_model() == FullCrossfade) {
@@ -458,8 +458,8 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
}
} else {
- touched_regions = regions_touched (top->first_frame(),
- top->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(),
+ touched_regions = regions_touched (top->first_frame(),
+ top->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(),
top->length()));
if (touched_regions->size() <= 2) {
xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, _session.config.get_xfade_model(), _session.config.get_xfades_active()));
@@ -470,22 +470,22 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
case OverlapEnd:
- /* [---- top ------------------------]
- * { ==== bottom ============ }
- */
+ /* [---- top ------------------------]
+ * { ==== bottom ============ }
+ */
if (_session.config.get_xfade_model() == FullCrossfade) {
touched_regions = regions_touched (bottom->first_frame(), top->last_frame());
if (touched_regions->size() <= 2) {
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
_session.config.get_xfade_model(), _session.config.get_xfades_active()));
add_crossfade (xfade);
}
} else {
- touched_regions = regions_touched (bottom->first_frame(),
- bottom->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(),
+ touched_regions = regions_touched (bottom->first_frame(),
+ bottom->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(),
bottom->length()));
if (touched_regions->size() <= 2) {
xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, _session.config.get_xfade_model(), _session.config.get_xfades_active()));
@@ -494,7 +494,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
}
break;
default:
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
_session.config.get_xfade_model(), _session.config.get_xfades_active()));
add_crossfade (xfade);
}
@@ -503,11 +503,11 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
catch (failed_constructor& err) {
continue;
}
-
+
catch (Crossfade::NoCrossfadeHere& err) {
continue;
}
-
+
}
}
@@ -521,7 +521,7 @@ AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade)
break;
}
}
-
+
if (ci != _crossfades.end()) {
// it will just go away
} else {
@@ -533,7 +533,7 @@ AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade)
notify_crossfade_added (xfade);
}
}
-
+
void AudioPlaylist::notify_crossfade_added (boost::shared_ptr<Crossfade> x)
{
if (g_atomic_int_get(&block_notifications)) {
@@ -569,7 +569,7 @@ AudioPlaylist::set_state (const XMLNode& node)
Playlist::set_state (node);
freeze ();
-
+
nlist = node.children();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
@@ -587,10 +587,10 @@ AudioPlaylist::set_state (const XMLNode& node)
xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed));
NewCrossfade(xfade);
}
-
+
catch (failed_constructor& err) {
// cout << string_compose (_("could not create crossfade object in playlist %1"),
- // _name)
+ // _name)
// << endl;
continue;
}
@@ -619,7 +619,7 @@ AudioPlaylist::state (bool full_state)
node.add_child_nocopy ((*i)->get_state());
}
}
-
+
return node;
}
@@ -636,9 +636,9 @@ AudioPlaylist::dump () const
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
r = *i;
- cerr << " " << r->name() << " @ " << r << " ["
- << r->start() << "+" << r->length()
- << "] at "
+ cerr << " " << r->name() << " @ " << r << " ["
+ << r->start() << "+" << r->length()
+ << "] at "
<< r->position()
<< " on layer "
<< r->layer ()
@@ -647,13 +647,13 @@ AudioPlaylist::dump () const
for (Crossfades::const_iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
x = *i;
- cerr << " xfade ["
+ cerr << " xfade ["
<< x->out()->name()
<< ','
<< x->in()->name()
<< " @ "
<< x->position()
- << " length = "
+ << " length = "
<< x->length ()
<< " active ? "
<< (x->active() ? "yes" : "no")
@@ -680,15 +680,15 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region)
RegionLock rlock (this);
for (RegionList::iterator i = regions.begin(); i != regions.end(); ) {
-
+
RegionList::iterator tmp = i;
++tmp;
-
+
if ((*i) == region) {
regions.erase (i);
changed = true;
}
-
+
i = tmp;
}
@@ -696,12 +696,12 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region)
set<boost::shared_ptr<Region> >::iterator xtmp = x;
++xtmp;
-
+
if ((*x) == region) {
all_regions.erase (x);
changed = true;
}
-
+
x = xtmp;
}
@@ -716,7 +716,7 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region)
unique_xfades.insert (*c);
_crossfades.erase (c);
}
-
+
c = ctmp;
}
@@ -766,7 +766,7 @@ AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> re
notify_modified ();
}
- return true;
+ return true;
}
void
@@ -782,7 +782,7 @@ AudioPlaylist::crossfades_at (nframes_t frame, Crossfades& clist)
if (frame >= start && frame <= end) {
clist.push_back (*i);
- }
+ }
}
}
diff --git a/libs/ardour/audio_playlist_importer.cc b/libs/ardour/audio_playlist_importer.cc
index 905169345f..d97e95195f 100644
--- a/libs/ardour/audio_playlist_importer.cc
+++ b/libs/ardour/audio_playlist_importer.cc
@@ -42,11 +42,11 @@ AudioPlaylistImportHandler::AudioPlaylistImportHandler (XMLTree const & source,
{
XMLNode const * root = source.root();
XMLNode const * playlists;
-
+
if (!(playlists = root->child (nodename))) {
throw failed_constructor();
}
-
+
XMLNodeList const & pl_children = playlists->children();
for (XMLNodeList::const_iterator it = pl_children.begin(); it != pl_children.end(); ++it) {
const XMLProperty* type = (*it)->property("type");
@@ -92,7 +92,7 @@ AudioPlaylistImportHandler::playlists_by_diskstream (PBD::ID const & id, Playlis
}
/*** AudioPlaylistImporter ***/
-AudioPlaylistImporter::AudioPlaylistImporter (XMLTree const & source, Session & session, AudioPlaylistImportHandler & handler, XMLNode const & node) :
+AudioPlaylistImporter::AudioPlaylistImporter (XMLTree const & source, Session & session, AudioPlaylistImportHandler & handler, XMLNode const & node) :
ElementImporter (source, session),
handler (handler),
orig_node (node),
@@ -100,9 +100,9 @@ AudioPlaylistImporter::AudioPlaylistImporter (XMLTree const & source, Session &
diskstream_id ("0")
{
bool ds_ok = false;
-
+
populate_region_list ();
-
+
// Parse XML
XMLPropertyList const & props = xml_playlist.properties();
for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
@@ -118,7 +118,7 @@ AudioPlaylistImporter::AudioPlaylistImporter (XMLTree const & source, Session &
std::cerr << string_compose (X_("AudioPlaylistImporter did not recognise XML-property \"%1\""), prop) << endmsg;
}
}
-
+
if (!ds_ok) {
error << string_compose (X_("AudioPlaylistImporter (%1): did not find XML-property \"orig_diskstream_id\" which is mandatory"), name) << endmsg;
throw failed_constructor();
@@ -137,7 +137,7 @@ AudioPlaylistImporter::AudioPlaylistImporter (AudioPlaylistImporter const & othe
AudioPlaylistImporter::~AudioPlaylistImporter ()
{
-
+
}
string
@@ -146,21 +146,21 @@ AudioPlaylistImporter::get_info () const
XMLNodeList children = xml_playlist.children();
unsigned int regions = 0;
std::ostringstream oss;
-
+
for (XMLNodeIterator it = children.begin(); it != children.end(); it++) {
if ((*it)->name() == "Region") {
++regions;
}
}
-
+
oss << regions << " ";
-
+
if (regions == 1) {
oss << _("region");
} else {
oss << _("regions");
}
-
+
return oss.str();
}
@@ -177,7 +177,7 @@ AudioPlaylistImporter::_prepare_move ()
}
xml_playlist.property ("name")->set_value (name);
handler.add_name (name);
-
+
return true;
}
@@ -191,10 +191,10 @@ void
AudioPlaylistImporter::_move ()
{
boost::shared_ptr<Playlist> playlist;
-
+
// Update diskstream id
xml_playlist.property ("orig-diskstream-id")->set_value (diskstream_id.to_s());
-
+
// Update region XML in playlist and prepare sources
xml_playlist.remove_nodes("Region");
for (RegionList::iterator it = regions.begin(); it != regions.end(); ++it) {
@@ -206,7 +206,7 @@ AudioPlaylistImporter::_move ()
return; // TODO clean up?
}
}
-
+
// Update region ids in crossfades
XMLNodeList crossfades = xml_playlist.children("Crossfade");
for (XMLNodeIterator it = crossfades.begin(); it != crossfades.end(); ++it) {
@@ -215,22 +215,22 @@ AudioPlaylistImporter::_move ()
if (!in || !out) {
error << string_compose (X_("AudioPlaylistImporter (%1): did not find the \"in\" or \"out\" property from a crossfade"), name) << endmsg;
}
-
+
handler.update_region_id (in);
handler.update_region_id (out);
-
+
// rate convert length and position
XMLProperty* length = (*it)->property("length");
if (length) {
length->set_value (rate_convert_samples (length->value()));
}
-
+
XMLProperty* position = (*it)->property("position");
if (position) {
position->set_value (rate_convert_samples (position->value()));
}
}
-
+
// Create playlist
playlist = PlaylistFactory::create (session, xml_playlist, false, true);
}
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc
index f69d6685ff..a75f7d7a09 100644
--- a/libs/ardour/audio_port.cc
+++ b/libs/ardour/audio_port.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,8 +44,8 @@ AudioPort::cycle_start (nframes_t nframes)
/* get_buffer() must only be run on outputs here in cycle_start().
- Inputs must be done in the correct processing order, which
- requires interleaving with route processing. that will
+ Inputs must be done in the correct processing order, which
+ requires interleaving with route processing. that will
happen when Port::get_buffer() is called.
*/
@@ -89,8 +89,8 @@ AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
*/
_buffer->set_data ((Sample *) jack_port_get_buffer (_jack_port, nframes) + offset + _port_offset, nframes);
- }
-
+ }
+
/* output ports set their _buffer data information during ::cycle_start()
*/
diff --git a/libs/ardour/audio_region_importer.cc b/libs/ardour/audio_region_importer.cc
index de5d6f7102..19653f55c0 100644
--- a/libs/ardour/audio_region_importer.cc
+++ b/libs/ardour/audio_region_importer.cc
@@ -44,11 +44,11 @@ AudioRegionImportHandler::AudioRegionImportHandler (XMLTree const & source, Sess
{
XMLNode const * root = source.root();
XMLNode const * regions;
-
+
if (!(regions = root->child (X_("Regions")))) {
throw failed_constructor();
}
-
+
create_regions_from_children (*regions, elements);
}
@@ -105,7 +105,7 @@ AudioRegionImportHandler::get_new_id (PBD::ID & old_id) const
}
/*** AudioRegionImporter ***/
-AudioRegionImporter::AudioRegionImporter (XMLTree const & source, Session & session, AudioRegionImportHandler & handler, XMLNode const & node) :
+AudioRegionImporter::AudioRegionImporter (XMLTree const & source, Session & session, AudioRegionImportHandler & handler, XMLNode const & node) :
ElementImporter (source, session),
xml_region (node),
handler (handler),
@@ -129,26 +129,26 @@ AudioRegionImporter::get_info () const
nframes_t length, position;
SMPTE::Time length_time, position_time;
std::ostringstream oss;
-
+
// Get sample positions
std::istringstream iss_length(xml_region.property ("length")->value());
iss_length >> length;
std::istringstream iss_position(xml_region.property ("position")->value());
iss_position >> position;
-
+
// Convert to smpte
session.sample_to_smpte(length, length_time, true, false);
session.sample_to_smpte(position, position_time, true, false);
-
+
// return info
oss << _("Length: ") <<
smpte_to_string(length_time) <<
- _("\nPosition: ") <<
+ _("\nPosition: ") <<
smpte_to_string(position_time) <<
_("\nChannels: ") <<
xml_region.property ("channels")->value();
-
+
return oss.str();
}
@@ -172,11 +172,11 @@ AudioRegionImporter::_move ()
return;
}
}
-
+
if (broken()) {
return;
}
-
+
session.add_regions (region);
}
@@ -186,7 +186,7 @@ AudioRegionImporter::parse_xml_region ()
XMLPropertyList const & props = xml_region.properties();
bool id_ok = false;
bool name_ok = false;
-
+
for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
string prop = (*it)->name();
if (!prop.compare ("type") || !prop.compare ("stretch") ||
@@ -216,17 +216,17 @@ AudioRegionImporter::parse_xml_region ()
std::cerr << string_compose (X_("AudioRegionImporter (%1): did not recognise XML-property \"%2\""), name, prop) << endmsg;
}
}
-
+
if (!id_ok) {
error << string_compose (X_("AudioRegionImporter (%1): did not find necessary XML-property \"id\""), name) << endmsg;
return false;
}
-
+
if (!name_ok) {
error << X_("AudioRegionImporter: did not find necessary XML-property \"name\"") << endmsg;
return false;
}
-
+
return true;
}
@@ -239,23 +239,23 @@ AudioRegionImporter::parse_source_xml ()
PBD::sys::path source_path;
XMLNode * source_node;
XMLProperty *prop;
-
+
// Get XML for sources
if (!(source_node = source.root()->child (X_("Sources")))) {
return false;
}
XMLNodeList const & sources = source_node->children();
-
+
// Get source for each channel
if (!(prop = xml_region.property ("channels"))) {
error << string_compose (X_("AudioRegionImporter (%1): did not find necessary XML-property \"channels\""), name) << endmsg;
return false;
}
-
+
channels = atoi (prop->value());
for (uint32_t i = 0; i < channels; ++i) {
bool source_found = false;
-
+
// Get id for source-n
snprintf (buf, sizeof(buf), X_("source-%d"), i);
prop = xml_region.property (buf);
@@ -264,7 +264,7 @@ AudioRegionImporter::parse_source_xml ()
return false;
}
string source_id = prop->value();
-
+
// Get source
for (XMLNodeList::const_iterator it = sources.begin(); it != sources.end(); it++) {
prop = (*it)->property ("id");
@@ -277,18 +277,18 @@ AudioRegionImporter::parse_source_xml ()
}
source_path /= prop->value();
filenames.push_back (source_path.to_string());
-
+
source_found = true;
break;
}
}
-
+
if (!source_found) {
error << string_compose (X_("AudioRegionImporter (%1): could not find all necessary sources"), name) << endmsg;
return false;
}
}
-
+
return true;
}
@@ -299,7 +299,7 @@ AudioRegionImporter::get_sound_dir (XMLTree const & tree)
source_dir = source_dir.branch_path();
SessionDirectory session_dir(source_dir);
source_dir = session_dir.sound_path();
-
+
return source_dir;
}
@@ -309,15 +309,15 @@ AudioRegionImporter::prepare_region ()
if (region_prepared) {
return;
}
-
+
SourceList source_list;
prepare_sources();
-
+
// Create source list
for (std::list<string>::iterator it = filenames.begin(); it != filenames.end(); ++it) {
source_list.push_back (handler.get_source (*it));
}
-
+
// create region and update XML
region.push_back (RegionFactory::create (source_list, xml_region));
if (*region.begin()) {
@@ -336,7 +336,7 @@ AudioRegionImporter::prepare_sources ()
if (sources_prepared) {
return;
}
-
+
status.total = 0;
status.replace_existing_source = false;
status.done = false;
@@ -344,7 +344,7 @@ AudioRegionImporter::prepare_sources ()
status.freeze = false;
status.progress = 0.0;
status.quality = SrcBest; // TODO other qualities also
-
+
// Get sources that still need to be imported
for (std::list<string>::iterator it = filenames.begin(); it != filenames.end(); ++it) {
if (!handler.check_source (*it)) {
@@ -352,11 +352,11 @@ AudioRegionImporter::prepare_sources ()
status.total++;
}
}
-
+
// import files
// TODO: threading & exception handling
session.import_audiofiles (status);
-
+
// Add imported sources to handlers map
std::vector<Glib::ustring>::iterator file_it = status.paths.begin();
for (SourceList::iterator source_it = status.sources.begin(); source_it != status.sources.end(); ++source_it) {
@@ -367,10 +367,10 @@ AudioRegionImporter::prepare_sources ()
handler.set_errors();
set_broken();
}
-
+
++file_it;
}
-
+
sources_prepared = true;
}
@@ -380,22 +380,22 @@ AudioRegionImporter::add_sources_to_session ()
if (!sources_prepared) {
prepare_sources();
}
-
+
if (broken()) {
return;
}
-
+
for (std::list<string>::iterator it = filenames.begin(); it != filenames.end(); ++it) {
session.add_source (handler.get_source (*it));
}
}
-XMLNode const &
+XMLNode const &
AudioRegionImporter::get_xml ()
{
if(!region_prepared) {
prepare_region();
}
-
+
return xml_region;
}
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index 8e68eb0140..1d4412b950 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -82,10 +82,10 @@ AudioTrack::use_new_diskstream ()
} else if (_mode == NonLayered){
dflags = AudioDiskstream::Flag(dflags | AudioDiskstream::NonLayered);
}
-
+
boost::shared_ptr<AudioDiskstream> ds (new AudioDiskstream (_session, name(), dflags));
-
+
_session.add_diskstream (ds);
set_diskstream (boost::dynamic_pointer_cast<AudioDiskstream> (ds), this);
@@ -99,10 +99,10 @@ AudioTrack::set_mode (TrackMode m)
if (_diskstream->set_destructive (m == Destructive)) {
return -1;
}
-
+
_diskstream->set_non_layered (m == NonLayered);
_mode = m;
-
+
TrackModeChanged (); /* EMIT SIGNAL */
}
@@ -117,7 +117,7 @@ AudioTrack::can_use_mode (TrackMode m, bool& bounce_required)
case Normal:
bounce_required = false;
return true;
-
+
case Destructive:
default:
return _diskstream->can_become_destructive (bounce_required);
@@ -146,16 +146,16 @@ AudioTrack::deprecated_use_diskstream_connections ()
if ((prop = node.property ("input-connection")) != 0) {
boost::shared_ptr<Bundle> c = _session.bundle_by_name (prop->value());
-
+
if (c == 0) {
- error << string_compose(_("Unknown bundle \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
-
+ error << string_compose(_("Unknown bundle \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+
if ((c = _session.bundle_by_name (_("in 1"))) == 0) {
- error << _("No input bundles available as a replacement")
+ error << _("No input bundles available as a replacement")
<< endmsg;
return -1;
} else {
- info << string_compose (_("Bundle %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Bundle %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
@@ -164,11 +164,11 @@ AudioTrack::deprecated_use_diskstream_connections ()
} else if ((prop = node.property ("inputs")) != 0) {
if (_input->set_ports (prop->value())) {
- error << string_compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
+ error << string_compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
return -1;
}
}
-
+
return 0;
}
@@ -198,9 +198,9 @@ AudioTrack::set_diskstream (boost::shared_ptr<AudioDiskstream> ds, void * /*src*
DiskstreamChanged (); /* EMIT SIGNAL */
return 0;
-}
+}
-int
+int
AudioTrack::use_diskstream (string name)
{
boost::shared_ptr<AudioDiskstream> dstream;
@@ -209,20 +209,20 @@ AudioTrack::use_diskstream (string name)
error << string_compose(_("AudioTrack: audio diskstream \"%1\" not known by session"), name) << endmsg;
return -1;
}
-
+
return set_diskstream (dstream, this);
}
-int
+int
AudioTrack::use_diskstream (const PBD::ID& id)
{
boost::shared_ptr<AudioDiskstream> dstream;
if ((dstream = boost::dynamic_pointer_cast<AudioDiskstream> (_session.diskstream_by_id (id))) == 0) {
- error << string_compose(_("AudioTrack: audio diskstream \"%1\" not known by session"), id) << endmsg;
+ error << string_compose(_("AudioTrack: audio diskstream \"%1\" not known by session"), id) << endmsg;
return -1;
}
-
+
return set_diskstream (dstream, this);
}
@@ -257,7 +257,7 @@ AudioTrack::_set_state (const XMLNode& node, bool call_base)
}
if ((prop = node.property ("diskstream-id")) == 0) {
-
+
/* some old sessions use the diskstream name rather than the ID */
if ((prop = node.property ("diskstream")) == 0) {
@@ -271,10 +271,10 @@ AudioTrack::_set_state (const XMLNode& node, bool call_base)
}
} else {
-
+
PBD::ID id (prop->value());
PBD::ID zero ("0");
-
+
/* this wierd hack is used when creating tracks from a template. there isn't
a particularly good time to interpose between setting the first part of
the track state (notably Route::set_state() and the track mode), and the
@@ -282,7 +282,7 @@ AudioTrack::_set_state (const XMLNode& node, bool call_base)
that means "you should create a new diskstream here, not look for
an old one.
*/
-
+
if (id == zero) {
use_new_diskstream ();
} else if (use_diskstream (id)) {
@@ -316,7 +316,7 @@ AudioTrack::_set_state (const XMLNode& node, bool call_base)
return 0;
}
-XMLNode&
+XMLNode&
AudioTrack::state(bool full_state)
{
XMLNode& root (Route::state(full_state));
@@ -335,7 +335,7 @@ AudioTrack::state(bool full_state)
(*i)->id.print (buf, sizeof (buf));
inode->add_property (X_("id"), buf);
inode->add_child_copy ((*i)->state);
-
+
freeze_node->add_child_nocopy (*inode);
}
@@ -343,7 +343,7 @@ AudioTrack::state(bool full_state)
}
/* Alignment: act as a proxy for the diskstream */
-
+
XMLNode* align_node = new XMLNode (X_("Alignment"));
AlignStyle as = _diskstream->alignment_style ();
align_node->add_property (X_("style"), enum_2_string (as));
@@ -383,12 +383,12 @@ AudioTrack::set_state_part_two ()
if ((fnode = find_named_node (*pending_state, X_("freeze-info"))) != 0) {
_freeze_record.state = Frozen;
-
+
for (vector<FreezeRecordProcessorInfo*>::iterator i = _freeze_record.processor_info.begin(); i != _freeze_record.processor_info.end(); ++i) {
delete *i;
}
_freeze_record.processor_info.clear ();
-
+
if ((prop = fnode->property (X_("playlist"))) != 0) {
boost::shared_ptr<Playlist> pl = _session.playlist_by_name (prop->value());
if (pl) {
@@ -399,23 +399,23 @@ AudioTrack::set_state_part_two ()
return;
}
}
-
+
if ((prop = fnode->property (X_("state"))) != 0) {
_freeze_record.state = FreezeState (string_2_enum (prop->value(), _freeze_record.state));
}
-
+
XMLNodeConstIterator citer;
XMLNodeList clist = fnode->children();
-
+
for (citer = clist.begin(); citer != clist.end(); ++citer) {
if ((*citer)->name() != X_("processor")) {
continue;
}
-
+
if ((prop = (*citer)->property (X_("id"))) == 0) {
continue;
}
-
+
FreezeRecordProcessorInfo* frii = new FreezeRecordProcessorInfo (*((*citer)->children().front()),
boost::shared_ptr<Processor>());
frii->id = prop->value ();
@@ -446,7 +446,7 @@ AudioTrack::set_state_part_two ()
}
}
return;
-}
+}
int
AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick,
@@ -457,7 +457,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
Sample* tmpb;
nframes_t transport_frame;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
-
+
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (lm.locked()) {
@@ -467,7 +467,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
}
-
+
if (n_outputs().n_total() == 0 && _processors.empty()) {
return 0;
}
@@ -486,7 +486,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
to do nothing.
*/
return diskstream->process (transport_frame, 0, can_record, rec_monitors_input);
- }
+ }
_silent = false;
_amp->apply_gain_automation(false);
@@ -497,7 +497,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
/* special condition applies */
-
+
if (_meter_point == MeterInput) {
_input->process_input (_meter, start_frame, end_frame, nframes);
}
@@ -520,7 +520,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
while in the process() tree.
*/
-
+
/* copy the diskstream data to all output buffers */
size_t limit = n_process_buffers().n_audio();
@@ -536,19 +536,19 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
but loaded with an 8 channel file. there are only
2 passthrough buffers, but n_process_buffers() will
return 8.
-
+
arbitrary decision: map all channels in the diskstream
to the outputs available.
*/
float scaling = limit/blimit;
-
+
for (i = 0, n = 1; i < blimit; ++i, ++n) {
- /* first time through just copy a channel into
+ /* first time through just copy a channel into
the output buffer.
*/
-
+
Sample* bb = bufs.get_audio (i).data();
for (nframes_t xx = 0; xx < nframes; ++xx) {
@@ -564,27 +564,27 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
for (;i < limit; ++i, ++n) {
-
+
/* for all remaining channels, sum with existing
- data in the output buffers
+ data in the output buffers
*/
-
+
bufs.get_audio (i%blimit).accumulate_with_gain_from (b, nframes, 0, scaling);
-
+
if (n < diskstream->n_channels().n_audio()) {
tmpb = diskstream->playback_buffer(n);
if (tmpb!=0) {
b = tmpb;
}
}
-
+
}
limit = blimit;
} else {
for (i = 0, n = 1; i < limit; ++i, ++n) {
- memcpy (bufs.get_audio (i).data(), b, sizeof (Sample) * nframes);
+ memcpy (bufs.get_audio (i).data(), b, sizeof (Sample) * nframes);
if (n < diskstream->n_channels().n_audio()) {
tmpb = diskstream->playback_buffer(n);
if (tmpb!=0) {
@@ -594,7 +594,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
/* try to leave any MIDI buffers alone */
-
+
ChanCount chn;
chn.set_audio (limit);
chn.set_midi (_input->n_ports().n_midi());
@@ -606,7 +606,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
if (!diskstream->record_enabled() && _session.transport_rolling()) {
#ifdef XXX_MOVE_THIS_TO_AMP
Glib::Mutex::Lock am (data().control_lock(), Glib::TRY_LOCK);
-
+
if (am.locked() && gain_control()->automation_playback()) {
_amp->apply_gain_automation(
gain_control()->list()->curve().rt_safe_get_vector (
@@ -616,7 +616,7 @@ AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
process_output_buffers (bufs, start_frame, end_frame, nframes, (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick);
-
+
} else {
/* problem with the diskstream; just be quiet for a bit */
silence (nframes);
@@ -632,7 +632,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
float mix_buffer[nframes];
ProcessorList::iterator i;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
-
+
Glib::RWLock::ReaderLock rlock (_processor_lock);
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(diskstream->playlist());
@@ -658,7 +658,7 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
}
else {
/* duplicate last across remaining buffers */
- memcpy (bi->data(), b, sizeof (Sample) * nframes);
+ memcpy (bi->data(), b, sizeof (Sample) * nframes);
}
}
@@ -670,14 +670,14 @@ AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes
/* note: only run processors during export. other layers in the machinery
will already have checked that there are no external port processors.
*/
-
+
for (i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<Processor> processor;
if ((processor = boost::dynamic_pointer_cast<Processor>(*i)) != 0) {
processor->run (buffers, start, start+nframes, nframes);
}
}
-
+
return 0;
}
@@ -704,7 +704,7 @@ AudioTrack::freeze (InterThreadInfo& itt)
string dir;
string region_name;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
-
+
if ((_freeze_record.playlist = boost::dynamic_pointer_cast<AudioPlaylist>(diskstream->playlist())) == 0) {
return;
}
@@ -712,9 +712,9 @@ AudioTrack::freeze (InterThreadInfo& itt)
uint32_t n = 1;
while (n < (UINT_MAX-1)) {
-
+
string candidate;
-
+
candidate = string_compose ("<F%2>%1", _freeze_record.playlist->name(), n);
if (_session.playlist_by_name (candidate) == 0) {
@@ -724,11 +724,11 @@ AudioTrack::freeze (InterThreadInfo& itt)
++n;
- }
+ }
if (n == (UINT_MAX-1)) {
error << string_compose (X_("There are too many frozen versions of playlist \"%1\""
- " to create another one"), _freeze_record.playlist->name())
+ " to create another one"), _freeze_record.playlist->name())
<< endmsg;
return;
}
@@ -743,21 +743,21 @@ AudioTrack::freeze (InterThreadInfo& itt)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) {
-
+
boost::shared_ptr<Processor> processor;
if ((processor = boost::dynamic_pointer_cast<Processor>(*r)) != 0) {
-
+
FreezeRecordProcessorInfo* frii = new FreezeRecordProcessorInfo ((*r)->get_state(), processor);
-
+
frii->id = processor->id();
_freeze_record.processor_info.push_back (frii);
-
+
/* now deactivate the processor */
-
+
processor->deactivate ();
_session.set_dirty ();
}
@@ -775,7 +775,7 @@ AudioTrack::freeze (InterThreadInfo& itt)
/* create a new region from all filesources, keep it private */
boost::shared_ptr<Region> region (RegionFactory::create (srcs, 0,
- srcs[0]->length(srcs[0]->timeline_position()),
+ srcs[0]->length(srcs[0]->timeline_position()),
region_name, 0,
(Region::Flag) (Region::WholeFile|Region::DefaultFlags),
false));
@@ -789,7 +789,7 @@ AudioTrack::freeze (InterThreadInfo& itt)
diskstream->set_record_enabled (false);
/* reset stuff that has already been accounted for in the freeze process */
-
+
set_gain (1.0, this);
_amp->gain_control()->set_automation_state (Off);
/* XXX need to use _main_outs _panner->set_automation_state (Off); */
@@ -815,7 +815,7 @@ AudioTrack::unfreeze ()
}
}
}
-
+
_freeze_record.playlist.reset ();
set_gain (_freeze_record.gain, this);
_amp->gain_control()->set_automation_state (_freeze_record.gain_automation_state);
diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc
index dd453f34c3..364d681217 100644
--- a/libs/ardour/audio_track_importer.cc
+++ b/libs/ardour/audio_track_importer.cc
@@ -44,11 +44,11 @@ AudioTrackImportHandler::AudioTrackImportHandler (XMLTree const & source, Sessio
{
XMLNode const * root = source.root();
XMLNode const * routes;
-
+
if (!(routes = root->child ("Routes"))) {
throw failed_constructor();
}
-
+
XMLNodeList const & route_list = routes->children();
for (XMLNodeList::const_iterator it = route_list.begin(); it != route_list.end(); ++it) {
const XMLProperty* type = (*it)->property("default-type");
@@ -86,22 +86,22 @@ AudioTrackImporter::AudioTrackImporter (XMLTree const & source,
if (!parse_route_xml ()) {
throw failed_constructor();
}
-
+
if (!parse_io ()) {
throw failed_constructor();
}
-
+
XMLNodeList const & controllables = node.children ("Controllable");
for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
parse_controllable (**it);
}
-
+
XMLNode * remote_control = xml_track.child ("RemoteControl");
if (remote_control && (prop = remote_control->property ("id"))) {
uint32_t control_id = session.ntracks() + session.nbusses() + 1;
prop->set_value (to_string (control_id, std::dec));
}
-
+
xml_track.remove_nodes_and_delete ("Extra");
}
@@ -136,12 +136,12 @@ AudioTrackImporter::parse_route_xml ()
std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg;
}
}
-
+
if (!ds_ok) {
error << X_("AudioTrackImporter: did not find necessary XML-property \"diskstream-id\"") << endmsg;
return false;
}
-
+
return true;
}
@@ -155,7 +155,7 @@ AudioTrackImporter::parse_io ()
if (!(io = xml_track.child ("IO"))) {
return false;
}
-
+
XMLPropertyList const & props = io->properties();
for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
@@ -186,32 +186,32 @@ AudioTrackImporter::parse_io ()
std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg;
}
}
-
+
if (!name_ok) {
error << X_("AudioTrackImporter: did not find necessary XML-property \"name\"") << endmsg;
return false;
}
-
+
if (!id_ok) {
error << X_("AudioTrackImporter: did not find necessary XML-property \"id\"") << endmsg;
return false;
}
-
+
XMLNodeList const & controllables = io->children ("Controllable");
for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
parse_controllable (**it);
}
-
+
XMLNodeList const & processors = io->children ("Processor");
for (XMLNodeList::const_iterator it = processors.begin(); it != processors.end(); ++it) {
parse_processor (**it);
}
-
+
XMLNodeList const & automations = io->children ("Automation");
for (XMLNodeList::const_iterator it = automations.begin(); it != automations.end(); ++it) {
parse_automation (**it);
}
-
+
return true;
}
@@ -228,7 +228,7 @@ AudioTrackImporter::_prepare_move ()
/* Copy dependent playlists */
pl_handler.playlists_by_diskstream (old_ds_id, playlists);
-
+
for (PlaylistList::iterator it = playlists.begin(); it != playlists.end(); ++it) {
if (!(*it)->prepare_move ()) {
playlists.clear ();
@@ -236,9 +236,9 @@ AudioTrackImporter::_prepare_move ()
}
(*it)->set_diskstream (new_ds_id);
}
-
+
/* Rename */
-
+
while (session.route_by_name (name) || !track_handler.check_name (name)) {
std::pair<bool, string> rename_pair = Rename (_("A playlist with this name already exists, please rename it."), name);
if (!rename_pair.first) {
@@ -248,7 +248,7 @@ AudioTrackImporter::_prepare_move ()
}
xml_track.child ("IO")->property ("name")->set_value (name);
track_handler.add_name (name);
-
+
return true;
}
@@ -261,21 +261,21 @@ AudioTrackImporter::_cancel_move ()
void
AudioTrackImporter::_move ()
-{
+{
/* Add diskstream */
-
+
boost::shared_ptr<XMLSharedNodeList> ds_node_list;
string xpath = "/Session/DiskStreams/AudioDiskstream[@id='" + old_ds_id.to_s() + "']";
ds_node_list = source.root()->find (xpath);
-
+
if (ds_node_list->size() != 1) {
error << string_compose (_("Error Importing Audio track %1"), name) << endmsg;
return;
}
-
+
boost::shared_ptr<XMLNode> ds_node = ds_node_list->front();
ds_node->property ("id")->set_value (new_ds_id.to_s());
-
+
boost::shared_ptr<Diskstream> new_ds (new AudioDiskstream (session, *ds_node));
new_ds->set_name (name);
session.add_diskstream (new_ds);
@@ -300,7 +300,7 @@ AudioTrackImporter::parse_processor (XMLNode & node)
if (automation) {
parse_automation (*automation);
}
-
+
return true;
}
@@ -308,7 +308,7 @@ bool
AudioTrackImporter::parse_controllable (XMLNode & node)
{
XMLProperty * prop;
-
+
if ((prop = node.property ("id"))) {
PBD::ID new_id;
prop->set_value (new_id.to_s());
@@ -326,12 +326,12 @@ AudioTrackImporter::parse_automation (XMLNode & node)
XMLNodeList const & lists = node.children ("AutomationList");
for (XMLNodeList::const_iterator it = lists.begin(); it != lists.end(); ++it) {
XMLProperty * prop;
-
+
if ((prop = (*it)->property ("id"))) {
PBD::ID id;
prop->set_value (id.to_s());
}
-
+
if (!(*it)->name().compare ("events")) {
rate_convert_events (**it);
}
@@ -352,14 +352,14 @@ AudioTrackImporter::rate_convert_events (XMLNode & node)
if (content_node->content().empty()) {
return false;
}
-
+
std::stringstream str (content_node->content());
std::ostringstream new_content;
-
+
nframes_t x;
double y;
bool ok = true;
-
+
while (str) {
str >> x;
if (!str) {
@@ -370,10 +370,10 @@ AudioTrackImporter::rate_convert_events (XMLNode & node)
ok = false;
break;
}
-
+
new_content << rate_convert_samples (x) << ' ' << y;
}
-
+
if (!ok) {
error << X_("AudioTrackImporter: error in rate converting automation events") << endmsg;
return false;
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index 9b313a3659..b0ced9bdfb 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -1,6 +1,6 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -62,7 +62,7 @@ static string preset_search_path = "/Library/Audio/Presets:/Network/Library/Audi
static string preset_suffix = ".aupreset";
static bool preset_search_path_initialized = false;
-static OSStatus
+static OSStatus
_render_callback(void *userData,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
@@ -73,7 +73,7 @@ _render_callback(void *userData,
return ((AUPlugin*)userData)->render_callback (ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData);
}
-static int
+static int
save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
{
@@ -81,7 +81,7 @@ save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
int fd;
// Convert the property list into XML data.
-
+
xmlData = CFPropertyListCreateXMLData( kCFAllocatorDefault, propertyList);
if (!xmlData) {
@@ -119,10 +119,10 @@ save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
close (fd);
return 0;
}
-
-static CFPropertyListRef
-load_property_list (Glib::ustring path)
+
+static CFPropertyListRef
+load_property_list (Glib::ustring path)
{
int fd;
CFPropertyListRef propertyList;
@@ -130,12 +130,12 @@ load_property_list (Glib::ustring path)
CFStringRef errorString;
// Read the XML file.
-
+
if ((fd = open (path.c_str(), O_RDONLY)) < 0) {
return propertyList;
}
-
+
off_t len = lseek (fd, 0, SEEK_END);
char* buf = new char[len];
lseek (fd, 0, SEEK_SET);
@@ -145,13 +145,13 @@ load_property_list (Glib::ustring path)
close (fd);
return propertyList;
}
-
+
close (fd);
xmlData = CFDataCreateWithBytesNoCopy (kCFAllocatorDefault, (UInt8*) buf, len, kCFAllocatorNull);
-
+
// Reconstitute the dictionary using the XML data.
-
+
propertyList = CFPropertyListCreateFromXMLData( kCFAllocatorDefault,
xmlData,
kCFPropertyListImmutable,
@@ -164,7 +164,7 @@ load_property_list (Glib::ustring path)
}
//-----------------------------------------------------------------------------
-static void
+static void
set_preset_name_in_plist (CFPropertyListRef plist, string preset_name)
{
if (!plist) {
@@ -175,7 +175,7 @@ set_preset_name_in_plist (CFPropertyListRef plist, string preset_name)
if (CFGetTypeID (plist) == CFDictionaryGetTypeID()) {
CFDictionarySetValue ((CFMutableDictionaryRef)plist, CFSTR(kAUPresetNameKey), pn);
}
-
+
CFRelease (pn);
}
@@ -199,7 +199,7 @@ get_preset_name_in_plist (CFPropertyListRef plist)
if (CFStringGetCString (str, local_buffer, len, kCFStringEncodingUTF8)) {
ret = local_buffer;
}
- }
+ }
}
return ret;
}
@@ -213,7 +213,7 @@ Boolean ComponentDescriptionsMatch_General(const ComponentDescription * inCompon
if ( (inComponentDescription1 == NULL) || (inComponentDescription2 == NULL) )
return FALSE;
- if ( (inComponentDescription1->componentSubType == inComponentDescription2->componentSubType)
+ if ( (inComponentDescription1->componentSubType == inComponentDescription2->componentSubType)
&& (inComponentDescription1->componentManufacturer == inComponentDescription2->componentManufacturer) )
{
// only sub-type and manufacturer IDs need to be equal
@@ -250,7 +250,7 @@ Boolean ComponentAndDescriptionMatch_General(Component inComponent, const Compon
//--------------------------------------------------------------------------
// determine if 2 ComponentDescriptions are basically equal
-// (by that, I mean that the important identifying values are compared,
+// (by that, I mean that the important identifying values are compared,
// but not the ComponentDescription flags)
Boolean ComponentDescriptionsMatch(const ComponentDescription * inComponentDescription1, const ComponentDescription * inComponentDescription2)
{
@@ -289,7 +289,7 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
current_offset (0),
current_buffers (0),
frames_processed (0)
-{
+{
if (!preset_search_path_initialized) {
Glib::ustring p = Glib::get_home_dir();
p += "/Library/Audio/Presets:";
@@ -311,7 +311,7 @@ AUPlugin::AUPlugin (const AUPlugin& other)
, current_offset (0)
, current_buffers (0)
, frames_processed (0)
-
+
{
init ();
}
@@ -344,13 +344,13 @@ AUPlugin::init ()
error << _("AudioUnit: Could not convert CAComponent to CAAudioUnit") << endmsg;
throw failed_constructor ();
}
-
+
AURenderCallbackStruct renderCallbackInfo;
renderCallbackInfo.inputProc = _render_callback;
renderCallbackInfo.inputProcRefCon = this;
- if ((err = unit->SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
+ if ((err = unit->SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
0, (void*) &renderCallbackInfo, sizeof(renderCallbackInfo))) != 0) {
cerr << "cannot install render callback (err = " << err << ')' << endl;
throw failed_constructor();
@@ -381,8 +381,8 @@ void
AUPlugin::discover_parameters ()
{
/* discover writable parameters */
-
- AudioUnitScope scopes[] = {
+
+ AudioUnitScope scopes[] = {
kAudioUnitScope_Global,
kAudioUnitScope_Output,
kAudioUnitScope_Input
@@ -393,7 +393,7 @@ AUPlugin::discover_parameters ()
for (uint32_t i = 0; i < sizeof (scopes) / sizeof (scopes[0]); ++i) {
AUParamInfo param_info (unit->AU(), false, false, scopes[i]);
-
+
for (uint32_t i = 0; i < param_info.NumParams(); ++i) {
AUParameterDescriptor d;
@@ -472,10 +472,10 @@ AUPlugin::discover_parameters ()
d.toggled = (info.unit & kAudioUnitParameterUnit_Boolean) ||
(d.integer_step && ((d.upper - d.lower) == 1.0));
d.sr_dependent = (info.unit & kAudioUnitParameterUnit_SampleFrames);
- d.automatable = !d.toggled &&
+ d.automatable = !d.toggled &&
!(info.flags & kAudioUnitParameterFlag_NonRealTime) &&
(info.flags & kAudioUnitParameterFlag_IsWritable);
-
+
d.logarithmic = (info.flags & kAudioUnitParameterFlag_DisplayLogarithmic);
d.unit = info.unit;
@@ -551,7 +551,7 @@ AUPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& pd) con
if (which < descriptors.size()) {
pd = descriptors[which];
return 0;
- }
+ }
return -1;
}
@@ -604,7 +604,7 @@ AUPlugin::_set_block_size (nframes_t nframes)
initialized = false;
}
- if ((err = unit->SetProperty (kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global,
+ if ((err = unit->SetProperty (kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global,
0, &numFrames, sizeof (numFrames))) != noErr) {
cerr << "cannot set max frames (err = " << err << ')' << endl;
return -1;
@@ -702,7 +702,7 @@ AUPlugin::can_do (int32_t in, int32_t& out)
plugcnt = 1;
}
}
-
+
if (possible_in == -1) {
/* wildcard for input */
@@ -724,8 +724,8 @@ AUPlugin::can_do (int32_t in, int32_t& out)
out = possible_out;
plugcnt = 1;
}
- }
-
+ }
+
if (possible_in == -2) {
if (possible_out == -1) {
@@ -778,7 +778,7 @@ AUPlugin::can_do (int32_t in, int32_t& out)
if (possible_in == in) {
/* exact number of inputs ... must match obviously */
-
+
if (possible_out == -1) {
/* out must match in */
out = in;
@@ -824,8 +824,8 @@ AUPlugin::set_output_format (AudioStreamBasicDescription& fmt)
free (buffers);
buffers = 0;
}
-
- buffers = (AudioBufferList *) malloc (offsetof(AudioBufferList, mBuffers) +
+
+ buffers = (AudioBufferList *) malloc (offsetof(AudioBufferList, mBuffers) +
fmt.mChannelsPerFrame * sizeof(AudioBuffer));
Glib::Mutex::Lock em (_session.engine().process_lock());
@@ -877,7 +877,7 @@ AUPlugin::output_streams() const
return output_channels;
}
-OSStatus
+OSStatus
AUPlugin::render_callback(AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
@@ -928,7 +928,7 @@ AUPlugin::connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in,
current_maxbuf = 0;
frames_processed += nframes;
-
+
for (uint32_t i = 0; i < maxbuf; ++i) {
if (bufs[i] + offset != buffers->mBuffers[i].mData) {
memcpy (bufs[i]+offset, buffers->mBuffers[i].mData, nframes * sizeof (Sample));
@@ -1005,7 +1005,7 @@ AUPlugin::get_state()
}
// Convert the property list into XML data.
-
+
xmlData = CFPropertyListCreateXMLData( kCFAllocatorDefault, propertyList);
if (!xmlData) {
@@ -1034,7 +1034,7 @@ AUPlugin::get_state()
seen_get_state_message = true;
}
#endif
-
+
return *root;
}
@@ -1050,7 +1050,7 @@ AUPlugin::set_state(const XMLNode& node)
error << _("Bad node sent to AUPlugin::set_state") << endmsg;
return -1;
}
-
+
if (node.children().empty()) {
return -1;
}
@@ -1071,14 +1071,14 @@ AUPlugin::set_state(const XMLNode& node)
&errorString);
CFRelease (xmlData);
-
+
if (propertyList) {
if (unit->SetAUPreset (propertyList) == noErr) {
ret = 0;
- }
+ }
CFRelease (propertyList);
}
-
+
return ret;
#else
if (!seen_set_state_message) {
@@ -1101,14 +1101,14 @@ AUPlugin::load_preset (const string preset_label)
if (x == preset_map.end()) {
return false;
}
-
+
if ((propertyList = load_property_list (x->second)) != 0) {
if (unit->SetAUPreset (propertyList) == noErr) {
ret = true;
}
CFRelease(propertyList);
}
-
+
return ret;
#else
if (!seen_loading_message) {
@@ -1131,7 +1131,7 @@ AUPlugin::save_preset (string preset_name)
std::string m = maker();
std::string n = name();
-
+
strip_whitespace_edges (m);
strip_whitespace_edges (n);
@@ -1141,7 +1141,7 @@ AUPlugin::save_preset (string preset_name)
v.push_back ("Presets");
v.push_back (m);
v.push_back (n);
-
+
user_preset_path = Glib::build_filename (v);
if (g_mkdir_with_parents (user_preset_path.c_str(), 0775) < 0) {
@@ -1156,11 +1156,11 @@ AUPlugin::save_preset (string preset_name)
// add the actual preset name */
v.push_back (preset_name + preset_suffix);
-
+
// rebuild
user_preset_path = Glib::build_filename (v);
-
+
set_preset_name_in_plist (propertyList, preset_name);
if (save_property_list (propertyList, user_preset_path)) {
@@ -1183,7 +1183,7 @@ AUPlugin::save_preset (string preset_name)
//-----------------------------------------------------------------------------
// this is just a little helper function used by GetAUComponentDescriptionFromPresetFile()
-static SInt32
+static SInt32
GetDictionarySInt32Value(CFDictionaryRef inAUStateDictionary, CFStringRef inDictionaryKey, Boolean * outSuccess)
{
CFNumberRef cfNumber;
@@ -1211,7 +1211,7 @@ GetDictionarySInt32Value(CFDictionaryRef inAUStateDictionary, CFStringRef inDict
return 0;
}
-static OSStatus
+static OSStatus
GetAUComponentDescriptionFromStateData(CFPropertyListRef inAUStateData, ComponentDescription * outComponentDescription)
{
CFDictionaryRef auStateDictionary;
@@ -1221,7 +1221,7 @@ GetAUComponentDescriptionFromStateData(CFPropertyListRef inAUStateData, Componen
if ( (inAUStateData == NULL) || (outComponentDescription == NULL) )
return paramErr;
-
+
// the property list for AU state data must be of the dictionary type
if (CFGetTypeID(inAUStateData) != CFDictionaryGetTypeID()) {
return kAudioUnitErr_InvalidPropertyValue;
@@ -1259,7 +1259,7 @@ static bool au_preset_filter (const string& str, void* arg)
/* Not a dotfile, has a prefix before a period, suffix is aupreset */
bool ret;
-
+
ret = (str[0] != '.' && str.length() > 9 && str.find (preset_suffix) == (str.length() - preset_suffix.length()));
if (ret && arg) {
@@ -1284,32 +1284,32 @@ static bool au_preset_filter (const string& str, void* arg)
match = m;
match += '/';
match += n;
-
+
ret = str.find (match) != string::npos;
}
}
-
+
return ret;
}
-bool
+bool
check_and_get_preset_name (Component component, const string& pathstr, string& preset_name)
{
OSStatus status;
CFPropertyListRef plist;
ComponentDescription presetDesc;
bool ret = false;
-
+
plist = load_property_list (pathstr);
if (!plist) {
return ret;
}
-
+
// get the ComponentDescription from the AU preset file
-
+
status = GetAUComponentDescriptionFromStateData(plist, &presetDesc);
-
+
if (status == noErr) {
if (ComponentAndDescriptionMatch_Loosely(component, &presetDesc)) {
@@ -1332,7 +1332,7 @@ check_and_get_preset_name (Component component, const string& pathstr, string& p
}
}
}
- }
+ }
}
CFRelease (plist);
@@ -1344,7 +1344,7 @@ std::string
AUPlugin::current_preset() const
{
string preset_name;
-
+
#ifdef AU_STATE_SUPPORT
CFPropertyListRef propertyList;
@@ -1364,7 +1364,7 @@ AUPlugin::get_presets ()
PathScanner scanner;
preset_files = scanner (preset_search_path, au_preset_filter, this, true, true, -1, true);
-
+
if (!preset_files) {
return presets;
}
@@ -1387,13 +1387,13 @@ AUPlugin::get_presets ()
if (check_and_get_preset_name (get_comp()->Comp(), path, preset_name)) {
presets.push_back (preset_name);
preset_map[preset_name] = path;
- }
+ }
delete *x;
}
delete preset_files;
-
+
return presets;
}
@@ -1422,13 +1422,13 @@ AUPluginInfo::load (Session& session)
PluginPtr plugin;
boost::shared_ptr<CAComponent> comp (new CAComponent(*descriptor));
-
+
if (!comp->IsValid()) {
error << ("AudioUnit: not a valid Component") << endmsg;
} else {
plugin.reset (new AUPlugin (session.engine(), session, comp));
}
-
+
plugin->set_info (PluginInfoPtr (new AUPluginInfo (*this)));
return plugin;
}
@@ -1454,7 +1454,7 @@ AUPluginInfo::discover ()
}
PluginInfoList plugs;
-
+
discover_fx (plugs);
discover_music (plugs);
discover_generators (plugs);
@@ -1512,7 +1512,7 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
CAComponentDescription temp;
GetComponentInfo (comp, &temp, NULL, NULL, NULL);
- AUPluginInfoPtr info (new AUPluginInfo
+ AUPluginInfoPtr info (new AUPluginInfo
(boost::shared_ptr<CAComponentDescription> (new CAComponentDescription(temp))));
/* no panners, format converters or i/o AU's for our purposes
@@ -1649,14 +1649,14 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
if (cacomp.GetResourceVersion (info->version) != noErr) {
info->version = 0;
}
-
+
if (cached_io_configuration (info->unique_id, info->version, cacomp, info->cache, info->name)) {
/* here we have to map apple's wildcard system to a simple pair
of values. in ::can_do() we use the whole system, but here
we need a single pair of values. XXX probably means we should
remove any use of these values.
- */
+ */
info->n_inputs = info->cache.io_configs.front().first;
info->n_outputs = info->cache.io_configs.front().second;
@@ -1670,16 +1670,16 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
} else {
error << string_compose (_("Cannot get I/O configuration info for AU %1"), info->name) << endmsg;
}
-
+
comp = FindNextComponent (comp, &desc);
}
}
bool
-AUPluginInfo::cached_io_configuration (const std::string& unique_id,
+AUPluginInfo::cached_io_configuration (const std::string& unique_id,
UInt32 version,
- CAComponent& comp,
- AUPluginCachedInfo& cinfo,
+ CAComponent& comp,
+ AUPluginCachedInfo& cinfo,
const std::string& name)
{
std::string id;
@@ -1706,9 +1706,9 @@ AUPluginInfo::cached_io_configuration (const std::string& unique_id,
AUChannelInfo* channel_info;
UInt32 cnt;
int ret;
-
+
ARDOUR::BootMessage (string_compose (_("Checking AudioUnit: %1"), name));
-
+
try {
if (CAAudioUnit::Open (comp, unit) != noErr) {
@@ -1722,7 +1722,7 @@ AUPluginInfo::cached_io_configuration (const std::string& unique_id,
return false;
}
-
+
if ((ret = unit.GetChannelInfo (&channel_info, cnt)) < 0) {
return false;
}
@@ -1733,9 +1733,9 @@ AUPluginInfo::cached_io_configuration (const std::string& unique_id,
cinfo.io_configs.push_back (pair<int,int> (-1, -1));
} else {
-
+
/* store each configuration */
-
+
for (uint32_t n = 0; n < cnt; ++n) {
cinfo.io_configs.push_back (pair<int,int> (channel_info[n].inChannels,
channel_info[n].outChannels));
@@ -1762,7 +1762,7 @@ AUPluginInfo::save_cached_info ()
XMLNode* node;
node = new XMLNode (X_("AudioUnitPluginCache"));
-
+
for (map<string,AUPluginCachedInfo>::iterator i = cached_info.begin(); i != cached_info.end(); ++i) {
XMLNode* parent = new XMLNode (X_("plugin"));
parent->add_property ("id", i->first);
@@ -1798,7 +1798,7 @@ AUPluginInfo::load_cached_info ()
{
Glib::ustring path = au_cache_path ();
XMLTree tree;
-
+
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
return 0;
}
@@ -1815,9 +1815,9 @@ AUPluginInfo::load_cached_info ()
const XMLNodeList children = root->children();
for (XMLNodeConstIterator iter = children.begin(); iter != children.end(); ++iter) {
-
+
const XMLNode* child = *iter;
-
+
if (child->name() == X_("plugin")) {
const XMLNode* gchild;
@@ -1846,7 +1846,7 @@ AUPluginInfo::load_cached_info ()
((oprop = gchild->property (X_("out"))) != 0)) {
in = atoi (iprop->value());
out = atoi (iprop->value());
-
+
cinfo.io_configs.push_back (pair<int,int> (in, out));
}
}
@@ -1882,16 +1882,16 @@ AUPluginInfo::get_names (CAComponentDescription& comp_desc, std::string& name, G
DisposeHandle(nameHandle);
}
}
-
+
// if Marc-style fails, do the original way
if (itemName == NULL) {
CFStringRef compTypeString = UTCreateStringForOSType(comp_desc.componentType);
CFStringRef compSubTypeString = UTCreateStringForOSType(comp_desc.componentSubType);
CFStringRef compManufacturerString = UTCreateStringForOSType(comp_desc.componentManufacturer);
-
- itemName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ - %@ - %@"),
+
+ itemName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ - %@ - %@"),
compTypeString, compManufacturerString, compSubTypeString);
-
+
if (compTypeString != NULL)
CFRelease(compTypeString);
if (compSubTypeString != NULL)
@@ -1899,7 +1899,7 @@ AUPluginInfo::get_names (CAComponentDescription& comp_desc, std::string& name, G
if (compManufacturerString != NULL)
CFRelease(compManufacturerString);
}
-
+
string str = CFStringRefToStdString(itemName);
string::size_type colon = str.find (':');
@@ -1925,10 +1925,10 @@ AUPluginInfo::stringify_descriptor (const CAComponentDescription& desc)
s << StringForOSType (desc.Type(), str);
s << " - ";
-
+
s << StringForOSType (desc.SubType(), str);
s << " - ";
-
+
s << StringForOSType (desc.Manu(), str);
return s.str();
diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc
index 53b60f9eaa..3acfc9bce4 100644
--- a/libs/ardour/audioanalyser.cc
+++ b/libs/ardour/audioanalyser.cc
@@ -26,11 +26,11 @@ AudioAnalyser::AudioAnalyser (float sr, AnalysisPluginKey key)
, plugin_key (key)
{
/* create VAMP plugin and initialize */
-
+
if (initialize_plugin (plugin_key, sample_rate)) {
error << string_compose (_("cannot load VAMP plugin \"%1\""), key) << endmsg;
throw failed_constructor();
- }
+ }
}
AudioAnalyser::~AudioAnalyser ()
@@ -50,7 +50,7 @@ AudioAnalyser::initialize_plugin (AnalysisPluginKey key, float sr)
if (!plugin) {
error << string_compose (_("VAMP Plugin \"%1\" could not be loaded"), key) << endmsg;
return -1;
- }
+ }
/* we asked for the buffering adapter, so set the blocksize to
something that makes for efficient disk i/o
@@ -79,7 +79,7 @@ AudioAnalyser::reset ()
plugin->reset ();
}
}
-
+
int
AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
{
@@ -96,7 +96,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
if (!path.empty()) {
/* store data in tmp file, not the real one */
-
+
tmp_path = path;
tmp_path += ".tmp";
@@ -112,11 +112,11 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
while (!done) {
nframes64_t to_read;
-
+
/* read from source */
to_read = min ((len - pos), bufsize);
-
+
if (src->read (data, pos, to_read, channel) != to_read) {
goto out;
}
@@ -126,7 +126,7 @@ AudioAnalyser::analyse (const string& path, Readable* src, uint32_t channel)
if (to_read != bufsize) {
memset (data + to_read, 0, (bufsize - to_read) * sizeof (Sample));
}
-
+
features = plugin->process (bufs, RealTime::fromSeconds ((double) pos / sample_rate));
if (use_features (features, (path.empty() ? 0 : &ofile))) {
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 56f78482ee..6f153dcc9e 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ using namespace PBD;
gint AudioEngine::m_meter_exit;
-AudioEngine::AudioEngine (string client_name)
+AudioEngine::AudioEngine (string client_name)
: ports (new Ports)
{
session = 0;
@@ -82,7 +82,7 @@ AudioEngine::AudioEngine (string client_name)
}
Port::set_engine (this);
-
+
// Initialize parameter metadata (e.g. ranges)
Evoral::Parameter p(NullAutomation);
p = EventTypeMap::instance().new_parameter(NullAutomation);
@@ -106,12 +106,12 @@ AudioEngine::~AudioEngine ()
{
Glib::Mutex::Lock tm (_process_lock);
session_removed.signal ();
-
+
if (_running) {
jack_client_close (_jack);
_jack = 0;
}
-
+
stop_metering_thread ();
}
}
@@ -146,13 +146,13 @@ AudioEngine::start ()
if (!_running) {
nframes_t blocksize = jack_get_buffer_size (_jack);
-
+
if (session) {
BootMessage (_("Connect session to engine"));
session->set_block_size (blocksize);
session->set_frame_rate (jack_get_sample_rate (_jack));
-
+
/* page in as much of the session process code as we
can before we really start running.
*/
@@ -224,10 +224,10 @@ AudioEngine::get_sync_offset (nframes_t& offset) const
#ifdef HAVE_JACK_VIDEO_SUPPORT
jack_position_t pos;
-
+
if (_jack) {
(void) jack_transport_query (_jack, &pos);
-
+
if (pos.valid & JackVideoFrameOffset) {
offset = pos.video_offset;
return true;
@@ -346,7 +346,7 @@ AudioEngine::process_callback (nframes_t nframes)
/// The number of frames that will have been processed when we've finished
nframes_t next_processed_frames;
-
+
/* handle wrap around of total frames counter */
if (max_frames - _processed_frames < nframes) {
@@ -395,7 +395,7 @@ AudioEngine::process_callback (nframes_t nframes)
session->process (nframes);
}
}
-
+
if (_freewheeling) {
return 0;
}
@@ -410,13 +410,13 @@ AudioEngine::process_callback (nframes_t nframes)
boost::shared_ptr<Ports> p = ports.reader();
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-
+
Port *port = (*i);
bool x;
-
+
if (port->_last_monitor != (x = port->monitoring_input ())) {
port->_last_monitor = x;
- /* XXX I think this is dangerous, due to
+ /* XXX I think this is dangerous, due to
a likely mutex in the signal handlers ...
*/
port->MonitorInputChanged (x); /* EMIT SIGNAL */
@@ -430,14 +430,14 @@ AudioEngine::process_callback (nframes_t nframes)
boost::shared_ptr<Ports> p = ports.reader();
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-
+
Port *port = (*i);
-
+
if (port->sends_output()) {
port->get_buffer(nframes).silence(nframes);
}
}
- }
+ }
// Finalize ports
@@ -460,12 +460,12 @@ AudioEngine::jack_sample_rate_callback (nframes_t nframes)
{
_frame_rate = nframes;
_usecs_per_cycle = (int) floor ((((double) frames_per_cycle() / nframes)) * 1000000.0);
-
+
/* check for monitor input change every 1/10th of second */
monitor_check_interval = nframes / 10;
last_monitor_check = 0;
-
+
if (session) {
session->set_frame_rate (nframes);
}
@@ -536,7 +536,7 @@ AudioEngine::meter_thread ()
}
}
-void
+void
AudioEngine::set_session (Session *s)
{
Glib::Mutex::Lock pl (_process_lock);
@@ -546,11 +546,11 @@ AudioEngine::set_session (Session *s)
session = s;
nframes_t blocksize = jack_get_buffer_size (_jack);
-
+
/* page in as much of the session process code as we
can before we really start running.
*/
-
+
boost::shared_ptr<Ports> p = ports.reader();
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
@@ -572,7 +572,7 @@ AudioEngine::set_session (Session *s)
}
}
-void
+void
AudioEngine::remove_session ()
{
Glib::Mutex::Lock lm (_process_lock);
@@ -587,7 +587,7 @@ AudioEngine::remove_session ()
} else {
session = 0;
}
-
+
remove_all_ports ();
}
@@ -597,19 +597,19 @@ AudioEngine::port_registration_failure (const std::string& portname)
string full_portname = jack_client_name;
full_portname += ':';
full_portname += portname;
-
-
+
+
jack_port_t* p = jack_port_by_name (_jack, full_portname.c_str());
string reason;
-
+
if (p) {
reason = string_compose (_("a port with the name \"%1\" already exists: check for duplicated track/bus names"), portname);
} else {
reason = _("No more JACK ports are available. You will need to stop Ardour and restart JACK with ports if you need this many tracks.");
}
-
+
throw PortRegistrationFailure (string_compose (_("AudioEngine: cannot register port \"%1\": %2"), portname, reason).c_str());
-}
+}
Port *
AudioEngine::register_port (DataType dtype, const string& portname, bool input)
@@ -624,7 +624,7 @@ AudioEngine::register_port (DataType dtype, const string& portname, bool input)
} else {
throw PortRegistrationFailure("unable to create port (unknown type)");
}
-
+
size_t& old_buffer_size = _raw_buffer_sizes[newport->type()];
size_t port_buffer_size = newport->raw_buffer_size(0);
if (port_buffer_size > old_buffer_size) {
@@ -667,7 +667,7 @@ AudioEngine::unregister_port (Port& port)
{
/* caller must hold process lock */
- if (!_running) {
+ if (!_running) {
/* probably happening when the engine has been halted by JACK,
in which case, there is nothing we can do here.
*/
@@ -677,7 +677,7 @@ AudioEngine::unregister_port (Port& port)
{
RCUWriter<Ports> writer (ports);
boost::shared_ptr<Ports> ps = writer.get_copy ();
-
+
for (Ports::iterator i = ps->begin(); i != ps->end(); ++i) {
if ((*i) == &port) {
delete *i;
@@ -685,18 +685,18 @@ AudioEngine::unregister_port (Port& port)
break;
}
}
-
+
/* writer goes out of scope, forces update */
}
-
+
return 0;
}
-int
+int
AudioEngine::connect (const string& source, const string& destination)
{
/* caller must hold process lock */
-
+
int ret;
if (!_running) {
@@ -722,23 +722,23 @@ AudioEngine::connect (const string& source, const string& destination)
/* neither port is known to us, and this API isn't intended for use as a general patch bay */
ret = -1;
}
-
+
if (ret > 0) {
/* already exists - no error, no warning */
} else if (ret < 0) {
- error << string_compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"),
- source, s, destination, d)
+ error << string_compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"),
+ source, s, destination, d)
<< endmsg;
}
return ret;
}
-int
+int
AudioEngine::disconnect (const string& source, const string& destination)
{
/* caller must hold process lock */
-
+
int ret;
if (!_running) {
@@ -749,7 +749,7 @@ AudioEngine::disconnect (const string& source, const string& destination)
return -1;
}
}
-
+
string s = make_port_name_non_relative (source);
string d = make_port_name_non_relative (destination);
@@ -836,7 +836,7 @@ AudioEngine::get_port_by_name (const string& portname)
} else {
s = portname;
}
-
+
Glib::Mutex::Lock lm (_process_lock);
return get_port_by_name_locked (s);
}
@@ -909,7 +909,7 @@ AudioEngine::halted (void *arg)
}
bool
-AudioEngine::can_request_hardware_monitoring ()
+AudioEngine::can_request_hardware_monitoring ()
{
const char ** ports;
@@ -952,11 +952,11 @@ AudioEngine::n_physical_inputs (DataType type) const
{
const char ** ports;
uint32_t i = 0;
-
+
if (!_jack) {
return 0;
}
-
+
if ((ports = jack_get_ports (_jack, NULL, type.to_jack_type(), JackPortIsPhysical|JackPortIsOutput)) == 0) {
return 0;
}
@@ -973,11 +973,11 @@ AudioEngine::get_physical_inputs (DataType type, vector<string>& ins)
{
const char ** ports;
uint32_t i = 0;
-
+
if (!_jack) {
return;
}
-
+
if ((ports = jack_get_ports (_jack, NULL, type.to_jack_type(), JackPortIsPhysical|JackPortIsOutput)) == 0) {
return;
}
@@ -995,11 +995,11 @@ AudioEngine::get_physical_outputs (DataType type, vector<string>& outs)
{
const char ** ports;
uint32_t i = 0;
-
+
if (!_jack) {
return;
}
-
+
if ((ports = jack_get_ports (_jack, NULL, type.to_jack_type(), JackPortIsPhysical|JackPortIsInput)) == 0) {
return;
}
@@ -1031,7 +1031,7 @@ AudioEngine::get_nth_physical (DataType type, uint32_t n, int flag)
}
ports = jack_get_ports (_jack, NULL, type.to_jack_type(), JackPortIsPhysical|flag);
-
+
if (ports == 0) {
return "";
}
@@ -1059,7 +1059,7 @@ AudioEngine::update_total_latency (const Port& port)
if (!_has_run) {
fatal << _("update_total_latency() called before engine was started") << endmsg;
/*NOTREACHED*/
- }
+ }
}
port.recompute_total_latency ();
@@ -1150,13 +1150,13 @@ AudioEngine::remove_all_ports ()
for (Ports::iterator i = ps->begin(); i != ps->end(); ++i) {
delete *i;
}
-
+
ps->clear ();
}
}
-static void
-ardour_jack_error (const char* msg)
+static void
+ardour_jack_error (const char* msg)
{
error << "JACK: " << msg << endmsg;
}
@@ -1181,11 +1181,11 @@ AudioEngine::connect_to_jack (string client_name)
}
jack_set_error_function (ardour_jack_error);
-
+
return 0;
}
-int
+int
AudioEngine::disconnect_from_jack ()
{
if (!_jack) {
@@ -1196,7 +1196,7 @@ AudioEngine::disconnect_from_jack ()
stop_metering_thread ();
}
- {
+ {
Glib::Mutex::Lock lm (_process_lock);
jack_client_close (_jack);
_jack = 0;
@@ -1235,14 +1235,14 @@ AudioEngine::reconnect_to_jack ()
for (i = p->begin(); i != p->end(); ++i) {
if ((*i)->reestablish ()) {
break;
- }
+ }
}
if (i != p->end()) {
/* failed */
remove_all_ports ();
return -1;
- }
+ }
if (session) {
@@ -1250,14 +1250,14 @@ AudioEngine::reconnect_to_jack ()
nframes_t blocksize = jack_get_buffer_size (_jack);
session->set_block_size (blocksize);
session->set_frame_rate (jack_get_sample_rate (_jack));
-
+
_raw_buffer_sizes[DataType::AUDIO] = blocksize * sizeof(float);
cout << "FIXME: Assuming maximum MIDI buffer size " << blocksize * 4 << "bytes" << endl;
_raw_buffer_sizes[DataType::MIDI] = blocksize * 4;
}
last_monitor_check = 0;
-
+
jack_on_shutdown (_jack, halted, this);
jack_set_graph_order_callback (_jack, _graph_order_callback, this);
jack_set_thread_init_callback (_jack, _thread_init_callback, this);
@@ -1267,11 +1267,11 @@ AudioEngine::reconnect_to_jack ()
jack_set_xrun_callback (_jack, _xrun_callback, this);
jack_set_sync_callback (_jack, _jack_sync_callback, this);
jack_set_freewheel_callback (_jack, _freewheel_callback, this);
-
+
if (session && session->config.get_jack_time_master()) {
jack_set_timebase_callback (_jack, 0, _jack_timebase_callback, this);
- }
-
+ }
+
if (jack_activate (_jack) == 0) {
_running = true;
_has_run = true;
@@ -1280,7 +1280,7 @@ AudioEngine::reconnect_to_jack ()
}
/* re-establish connections */
-
+
for (i = p->begin(); i != p->end(); ++i) {
(*i)->reconnect ();
}
@@ -1317,13 +1317,13 @@ AudioEngine::update_total_latencies ()
}
#endif
}
-
+
string
AudioEngine::make_port_name_relative (string portname)
{
string::size_type len;
string::size_type n;
-
+
len = portname.length();
for (n = 0; n < len; ++n) {
@@ -1331,7 +1331,7 @@ AudioEngine::make_port_name_relative (string portname)
break;
}
}
-
+
if ((n != len) && (portname.substr (0, n) == jack_client_name)) {
return portname.substr (n+1);
}
@@ -1351,7 +1351,7 @@ AudioEngine::make_port_name_non_relative (string portname)
str = jack_client_name;
str += ':';
str += portname;
-
+
return str;
}
diff --git a/libs/ardour/audiofile_tagger.cc b/libs/ardour/audiofile_tagger.cc
index cfd839fc0c..c06b712f4e 100644
--- a/libs/ardour/audiofile_tagger.cc
+++ b/libs/ardour/audiofile_tagger.cc
@@ -44,11 +44,11 @@ AudiofileTagger::tag_file (string const & filename, SessionMetadata const & meta
{
TagLib::FileRef file (filename.c_str());
TagLib::Tag & tag (*file.tag());
-
+
tag_generic (tag, metadata);
-
+
/* FLAC */
-
+
TagLib::FLAC::File * flac_file;
if ((flac_file = dynamic_cast<TagLib::FLAC::File *> (file.file()))) {
TagLib::Ogg::XiphComment * vorbis_tag;
@@ -58,9 +58,9 @@ AudiofileTagger::tag_file (string const & filename, SessionMetadata const & meta
std::cerr << "Could not get Xiph comment for FLAC file!" << std::endl;
}
}
-
+
/* Ogg */
-
+
TagLib::Ogg::File * ogg_file;
if ((ogg_file = dynamic_cast<TagLib::Ogg::File *> (file.file()))) {
TagLib::Ogg::XiphComment * vorbis_tag;
@@ -70,7 +70,7 @@ AudiofileTagger::tag_file (string const & filename, SessionMetadata const & meta
std::cerr << "Could not get Xiph comment for Ogg file!" << std::endl;
}
}
-
+
file.save();
return true;
}
@@ -85,7 +85,7 @@ AudiofileTagger::tag_generic (TagLib::Tag & tag, SessionMetadata const & metadat
tag.setGenre (TL_STR(metadata.genre()));
tag.setYear (metadata.year());
tag.setTrack (metadata.track_number());
-
+
return true;
}
@@ -109,7 +109,7 @@ AudiofileTagger::tag_vorbis_comment (TagLib::Ogg::XiphComment & tag, SessionMeta
tag.addField ("COMPILATION", TL_STR(metadata.compilation()));
tag.addField ("DISCSUBTITLE", TL_STR(metadata.disc_subtitle()));
tag.addField ("DISCNUMBER", to_string (metadata.disc_number(), std::dec));
-
+
// No field for total discs or tracks
return true;
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index fa3a86e44b..0412ee0966 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,7 +54,7 @@
// if these headers come before sigc++ is included
// the parser throws ObjC++ errors. (nil is a keyword)
-#ifdef HAVE_COREAUDIO
+#ifdef HAVE_COREAUDIO
#include "ardour/coreaudiosource.h"
#include <AudioToolbox/ExtendedAudioFile.h>
#include <AudioToolbox/AudioFormat.h>
@@ -79,7 +79,7 @@ struct SizedSampleBuffer {
nframes_t size;
Sample* buf;
- SizedSampleBuffer (nframes_t sz) : size (sz) {
+ SizedSampleBuffer (nframes_t sz) : size (sz) {
buf = new Sample[size];
}
@@ -163,33 +163,33 @@ AudioFileSource::find_broken_peakfile (ustring peak_path, ustring audio_path)
ustring str;
/* check for the broken location in use by 2.0 for several months */
-
+
str = broken_peak_path (audio_path);
-
+
if (Glib::file_test (str, Glib::FILE_TEST_EXISTS)) {
-
+
if (is_embedded()) {
-
- /* it would be nice to rename it but the nature of
+
+ /* it would be nice to rename it but the nature of
the bug means that we can't reliably use it.
*/
-
+
peak_path = str;
-
+
} else {
/* all native files are mono, so we can just rename
it.
*/
::rename (str.c_str(), peak_path.c_str());
}
-
+
} else {
/* Nasty band-aid for older sessions that were created before we
used libsndfile for all audio files.
*/
-
-
- str = old_peak_path (audio_path);
+
+
+ str = old_peak_path (audio_path);
if (Glib::file_test (str, Glib::FILE_TEST_EXISTS)) {
peak_path = str;
}
@@ -267,7 +267,7 @@ AudioFileSource::set_state (const XMLNode& node)
if (AudioSource::set_state (node)) {
return -1;
}
-
+
if (FileSource::set_state (node)) {
return -1;
}
@@ -281,7 +281,7 @@ AudioFileSource::mark_streaming_write_completed ()
if (!writable()) {
return;
}
-
+
/* XXX notice that we're readers of _peaks_built
but we must hold a solid lock on PeaksReady.
*/
@@ -311,10 +311,10 @@ AudioFileSource::is_empty (Session& /*s*/, ustring path)
{
SoundFileInfo info;
string err;
-
+
if (!get_soundfile_info (path, info, err)) {
/* dangerous: we can't get info, so assume that its not empty */
- return false;
+ return false;
}
return info.length == 0;
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index a3444c0b23..38fede7c51 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -170,7 +170,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, nframes_t
_scale_amplitude = other->_scale_amplitude;
assert(_type == DataType::AUDIO);
-
+
listen_to_my_curves ();
connect_to_analysis_changed ();
@@ -321,7 +321,7 @@ ARDOUR::nframes_t
AudioRegion::read_peaks (PeakData *buf, nframes_t npeaks, nframes_t offset, nframes_t cnt, uint32_t chan_n, double samples_per_unit) const
{
if (chan_n >= _sources.size()) {
- return 0;
+ return 0;
}
if (audio_source(chan_n)->read_peaks (buf, npeaks, offset, cnt, samples_per_unit)) {
@@ -366,16 +366,16 @@ AudioRegion::master_read_at (Sample *buf, Sample *mixdown_buffer, float *gain_bu
{
/* do not read gain/scaling/fades and do not count this disk i/o in statistics */
- return _read_at (_master_sources, _master_sources.front()->length(_master_sources.front()->timeline_position()),
+ return _read_at (_master_sources, _master_sources.front()->length(_master_sources.front()->timeline_position()),
buf, mixdown_buffer, gain_buffer, position, cnt, chan_n, 0, 0, ReadOps (0));
}
nframes_t
AudioRegion::_read_at (const SourceList& /*srcs*/, nframes_t limit,
Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
- sframes_t position, nframes_t cnt,
- uint32_t chan_n,
- nframes_t /*read_frames*/,
+ sframes_t position, nframes_t cnt,
+ uint32_t chan_n,
+ nframes_t /*read_frames*/,
nframes_t /*skip_frames*/,
ReadOps rops) const
{
@@ -424,13 +424,13 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, nframes_t limit,
if (src->read (mixdown_buffer, _start + internal_offset, to_read) != to_read) {
return 0; /* "read nothing" */
}
-
+
if (rops & ReadOpsCount) {
_read_data_count += src->read_data_count();
}
} else {
-
+
/* track is N-channel, this region has less channels; silence the ones
we don't have.
*/
@@ -439,53 +439,53 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, nframes_t limit,
}
if (rops & ReadOpsFades) {
-
+
/* fade in */
if ((_flags & FadeIn) && _session.config.get_use_region_fades()) {
-
+
nframes_t fade_in_length = (nframes_t) _fade_in->back()->when;
-
+
/* see if this read is within the fade in */
-
+
if (internal_offset < fade_in_length) {
-
+
nframes_t fi_limit;
-
+
fi_limit = min (to_read, fade_in_length - internal_offset);
-
+
_fade_in->curve().get_vector (internal_offset, internal_offset+fi_limit, gain_buffer, fi_limit);
-
+
for (nframes_t n = 0; n < fi_limit; ++n) {
mixdown_buffer[n] *= gain_buffer[n];
}
}
}
-
+
/* fade out */
-
+
if ((_flags & FadeOut) && _session.config.get_use_region_fades()) {
/* see if some part of this read is within the fade out */
-
+
/* ................. >| REGION
limit
-
+
{ } FADE
fade_out_length
- ^
+ ^
limit - fade_out_length
|--------------|
^internal_offset
^internal_offset + to_read
-
+
we need the intersection of [internal_offset,internal_offset+to_read] with
[limit - fade_out_length, limit]
-
+
*/
-
+
nframes_t fade_out_length = (nframes_t) _fade_out->back()->when;
nframes_t fade_interval_start = max(internal_offset, limit-fade_out_length);
nframes_t fade_interval_end = min(internal_offset + to_read, limit);
@@ -496,22 +496,22 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, nframes_t limit,
nframes_t fo_limit = fade_interval_end - fade_interval_start;
nframes_t curve_offset = fade_interval_start - (limit-fade_out_length);
nframes_t fade_offset = fade_interval_start - internal_offset;
-
+
_fade_out->curve().get_vector (curve_offset, curve_offset+fo_limit, gain_buffer, fo_limit);
for (nframes_t n = 0, m = fade_offset; n < fo_limit; ++n, ++m) {
mixdown_buffer[m] *= gain_buffer[n];
}
- }
-
+ }
+
}
}
-
+
/* Regular gain curves and scaling */
-
+
if ((rops & ReadOpsOwnAutomation) && envelope_active()) {
_envelope->curve().get_vector (internal_offset, internal_offset + to_read, gain_buffer, to_read);
-
+
if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
for (nframes_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n] * _scale_amplitude;
@@ -523,29 +523,29 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, nframes_t limit,
}
} else if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
- // XXX this should be using what in 2.0 would have been:
+ // XXX this should be using what in 2.0 would have been:
// Session::apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
for (nframes_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= _scale_amplitude;
}
}
-
+
if (!opaque()) {
-
+
/* gack. the things we do for users.
*/
-
+
buf += buf_offset;
-
+
for (nframes_t n = 0; n < to_read; ++n) {
buf[n] += mixdown_buffer[n];
}
- }
+ }
return to_read;
}
-
+
XMLNode&
AudioRegion::state (bool full)
{
@@ -554,7 +554,7 @@ AudioRegion::state (bool full)
char buf[64];
char buf2[64];
LocaleGuard lg (X_("POSIX"));
-
+
node.add_property ("flags", enum_2_string (_flags));
snprintf (buf, sizeof(buf), "%.12g", _scale_amplitude);
@@ -578,9 +578,9 @@ AudioRegion::state (bool full)
node.add_property ("channels", buf);
if (full) {
-
+
child = node.add_child (X_("FadeIn"));
-
+
if ((_flags & DefaultFadeIn)) {
child->add_property (X_("default"), X_("yes"));
} else {
@@ -588,23 +588,23 @@ AudioRegion::state (bool full)
}
child->add_property (X_("active"), _fade_in_disabled ? X_("no") : X_("yes"));
-
+
child = node.add_child (X_("FadeOut"));
-
+
if ((_flags & DefaultFadeOut)) {
child->add_property (X_("default"), X_("yes"));
} else {
child->add_child_nocopy (_fade_out->get_state ());
}
-
+
child->add_property (X_("active"), _fade_out_disabled ? X_("no") : X_("yes"));
}
-
+
child = node.add_child ("Envelope");
if (full) {
bool default_env = false;
-
+
// If there are only two points, the points are in the start of the region and the end of the region
// so, if they are both at 1.0f, that means the default region.
@@ -614,7 +614,7 @@ AudioRegion::state (bool full)
if (_envelope->front()->when == 0 && _envelope->back()->when == _length) {
default_env = true;
}
- }
+ }
if (default_env) {
child->add_property ("default", "yes");
@@ -677,16 +677,16 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
} else {
_scale_amplitude = 1.0;
}
-
+
/* Now find envelope description and other misc child items */
-
+
for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
XMLNode *child;
XMLProperty *prop;
-
+
child = (*niter);
-
+
if (child->name() == "Envelope") {
_envelope->clear ();
@@ -699,9 +699,9 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
_envelope->truncate_end (_length);
} else if (child->name() == "FadeIn") {
-
+
_fade_in->clear ();
-
+
if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
set_default_fade_in ();
} else {
@@ -720,7 +720,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
}
} else if (child->name() == "FadeOut") {
-
+
_fade_out->clear ();
if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
@@ -729,7 +729,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
XMLNode* grandchild = child->child ("AutomationList");
if (grandchild) {
_fade_out->set_state (*grandchild);
- }
+ }
}
if ((prop = child->property ("active")) != 0) {
@@ -740,7 +740,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
}
}
- }
+ }
}
if (send) {
@@ -997,10 +997,10 @@ AudioRegion::set_default_envelope ()
void
AudioRegion::recompute_at_end ()
{
- /* our length has changed. recompute a new final point by interpolating
+ /* our length has changed. recompute a new final point by interpolating
based on the the existing curve.
*/
-
+
_envelope->freeze ();
_envelope->truncate_end (_length);
_envelope->set_max_xval (_length);
@@ -1015,7 +1015,7 @@ AudioRegion::recompute_at_end ()
_fade_out->extend_to (_length);
send_change (FadeOutChanged);
}
-}
+}
void
AudioRegion::recompute_at_start ()
@@ -1070,7 +1070,7 @@ AudioRegion::separate_by_channel (Session& /*session*/, vector<boost::shared_ptr
Flag f = Flag (_flags & ~WholeFile);
v.push_back(RegionFactory::create (srcs, _start, _length, new_name, _layer, f));
-
+
++n;
}
@@ -1087,65 +1087,65 @@ int
AudioRegion::exportme (Session& /*session*/, ARDOUR::ExportSpecification& /*spec*/)
{
// TODO EXPORT
-// const nframes_t blocksize = 4096;
-// nframes_t to_read;
-// int status = -1;
-//
-// spec.channels = _sources.size();
-//
-// if (spec.prepare (blocksize, session.frame_rate())) {
-// goto out;
-// }
-//
-// spec.pos = 0;
-// spec.total_frames = _length;
-//
-// while (spec.pos < _length && !spec.stop) {
-//
-//
-// /* step 1: interleave */
-//
-// to_read = min (_length - spec.pos, blocksize);
-//
-// if (spec.channels == 1) {
-//
-// if (read_raw_internal (spec.dataF, _start + spec.pos, to_read) != to_read) {
-// goto out;
-// }
-//
-// } else {
-//
-// Sample buf[blocksize];
-//
-// for (uint32_t chan = 0; chan < spec.channels; ++chan) {
-//
-// if (audio_source(chan)->read (buf, _start + spec.pos, to_read) != to_read) {
-// goto out;
-// }
-//
-// for (nframes_t x = 0; x < to_read; ++x) {
-// spec.dataF[chan+(x*spec.channels)] = buf[x];
-// }
-// }
-// }
-//
-// if (spec.process (to_read)) {
-// goto out;
-// }
-//
-// spec.pos += to_read;
-// spec.progress = (double) spec.pos /_length;
-//
-// }
-//
-// status = 0;
-//
-// out:
-// spec.running = false;
-// spec.status = status;
-// spec.clear();
-//
-// return status;
+// const nframes_t blocksize = 4096;
+// nframes_t to_read;
+// int status = -1;
+//
+// spec.channels = _sources.size();
+//
+// if (spec.prepare (blocksize, session.frame_rate())) {
+// goto out;
+// }
+//
+// spec.pos = 0;
+// spec.total_frames = _length;
+//
+// while (spec.pos < _length && !spec.stop) {
+//
+//
+// /* step 1: interleave */
+//
+// to_read = min (_length - spec.pos, blocksize);
+//
+// if (spec.channels == 1) {
+//
+// if (read_raw_internal (spec.dataF, _start + spec.pos, to_read) != to_read) {
+// goto out;
+// }
+//
+// } else {
+//
+// Sample buf[blocksize];
+//
+// for (uint32_t chan = 0; chan < spec.channels; ++chan) {
+//
+// if (audio_source(chan)->read (buf, _start + spec.pos, to_read) != to_read) {
+// goto out;
+// }
+//
+// for (nframes_t x = 0; x < to_read; ++x) {
+// spec.dataF[chan+(x*spec.channels)] = buf[x];
+// }
+// }
+// }
+//
+// if (spec.process (to_read)) {
+// goto out;
+// }
+//
+// spec.pos += to_read;
+// spec.progress = (double) spec.pos /_length;
+//
+// }
+//
+// status = 0;
+//
+// out:
+// spec.running = false;
+// spec.status = status;
+// spec.clear();
+//
+// return status;
return 0;
}
@@ -1157,7 +1157,7 @@ AudioRegion::set_scale_amplitude (gain_t g)
_scale_amplitude = g;
/* tell the diskstream we're in */
-
+
if (pl) {
pl->Modified();
}
@@ -1203,7 +1203,7 @@ AudioRegion::normalize_to (float target_dB)
if (read_raw_internal (buf, fpos, to_read, 0) != to_read) {
return;
}
-
+
maxamp = compute_peak (buf, to_read, maxamp);
}
@@ -1321,7 +1321,7 @@ AudioRegion::source_offset_changed ()
if (afs && afs->destructive()) {
// set_start (source()->natural_position(), this);
set_position (source()->natural_position(), this);
- }
+ }
}
boost::shared_ptr<AudioSource>
@@ -1346,14 +1346,14 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
}
SourceList::iterator s;
-
+
for (s = _sources.begin() ; s != _sources.end(); ++s) {
if (!(*s)->has_been_analysed()) {
cerr << "For " << name() << " source " << (*s)->name() << " has not been analyzed\n";
break;
}
}
-
+
if (s == _sources.end()) {
/* all sources are analyzed, merge data from each one */
@@ -1368,14 +1368,14 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
AnalysisFeatureList::iterator high = upper_bound ((*s)->transients.begin(),
(*s)->transients.end(),
_start + _length);
-
+
/* and add them */
results.insert (results.end(), low, high);
}
TransientDetector::cleanup_transients (results, pl->session().frame_rate(), 3.0);
-
+
/* translate all transients to current position */
for (AnalysisFeatureList::iterator x = results.begin(); x != results.end(); ++x) {
@@ -1418,19 +1418,19 @@ then quit ardour and restart."));
}
/* translate all transients to give absolute position */
-
+
for (AnalysisFeatureList::iterator i = these_results.begin(); i != these_results.end(); ++i) {
(*i) += _position;
}
/* merge */
-
+
_transients.insert (_transients.end(), these_results.begin(), these_results.end());
}
-
+
if (!results.empty()) {
if (existing_results) {
-
+
/* merge our transients into the existing ones, then clean up
those.
*/
@@ -1467,7 +1467,7 @@ AudioRegion::find_silence (Sample threshold, nframes_t min_length) const
nframes_t const block_size = 64 * 1024;
Sample loudest[block_size];
Sample buf[block_size];
-
+
nframes_t pos = _start;
nframes_t const end = _start + _length - 1;
@@ -1519,7 +1519,7 @@ AudioRegion::find_silence (Sample threshold, nframes_t min_length) const
extern "C" {
- int region_read_peaks_from_c (void *arg, uint32_t npeaks, uint32_t start, uint32_t cnt, intptr_t data, uint32_t n_chan, double samples_per_unit)
+ int region_read_peaks_from_c (void *arg, uint32_t npeaks, uint32_t start, uint32_t cnt, intptr_t data, uint32_t n_chan, double samples_per_unit)
{
return ((AudioRegion *) arg)->read_peaks ((PeakData *) data, (nframes_t) npeaks, (nframes_t) start, (nframes_t) cnt, n_chan,samples_per_unit);
}
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 78e3cd2c6b..f9864d69b3 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -71,11 +71,11 @@ AudioSource::AudioSource (Session& s, ustring name)
peak_leftovers = 0;
}
-AudioSource::AudioSource (Session& s, const XMLNode& node)
+AudioSource::AudioSource (Session& s, const XMLNode& node)
: Source (s, node)
, _length (0)
{
-
+
_peaks_built = false;
_peak_byte_max = 0;
peakfile = -1;
@@ -93,7 +93,7 @@ AudioSource::AudioSource (Session& s, const XMLNode& node)
AudioSource::~AudioSource ()
{
/* shouldn't happen but make sure we don't leak file descriptors anyway */
-
+
if (peak_leftover_cnt) {
cerr << "AudioSource destroyed with leftover peak data pending" << endl;
}
@@ -173,12 +173,12 @@ AudioSource::touch_peakfile ()
if (stat (peakpath.c_str(), &statbuf) != 0 || statbuf.st_size == 0) {
return;
}
-
+
struct utimbuf tbuf;
-
+
tbuf.actime = statbuf.st_atime;
tbuf.modtime = time ((time_t) 0);
-
+
utime (peakpath.c_str(), &tbuf);
}
@@ -209,7 +209,7 @@ AudioSource::initialize_peakfile (bool newfile, ustring audio_path)
peakpath = peak_path (audio_path);
/* if the peak file should be there, but isn't .... */
-
+
if (!newfile && !Glib::file_test (peakpath.c_str(), Glib::FILE_TEST_EXISTS)) {
peakpath = find_broken_peakfile (peakpath, audio_path);
}
@@ -217,19 +217,19 @@ AudioSource::initialize_peakfile (bool newfile, ustring audio_path)
if (stat (peakpath.c_str(), &statbuf)) {
if (errno != ENOENT) {
/* it exists in the peaks dir, but there is some kind of error */
-
+
error << string_compose(_("AudioSource: cannot stat peakfile \"%1\""), peakpath) << endmsg;
return -1;
}
/* peakfile does not exist */
-
+
_peaks_built = false;
-
+
} else {
-
+
/* we found it in the peaks dir, so check it out */
-
+
if (statbuf.st_size == 0 || ((nframes_t) statbuf.st_size < ((length(_timeline_position) / _FPP) * sizeof (PeakData)))) {
// empty
_peaks_built = false;
@@ -237,7 +237,7 @@ AudioSource::initialize_peakfile (bool newfile, ustring audio_path)
// Check if the audio file has changed since the peakfile was built.
struct stat stat_file;
int err = stat (audio_path.c_str(), &stat_file);
-
+
if (err) {
_peaks_built = false;
_peak_byte_max = 0;
@@ -260,8 +260,8 @@ AudioSource::initialize_peakfile (bool newfile, ustring audio_path)
if (!newfile && !_peaks_built && _build_missing_peakfiles && _build_peakfiles) {
build_peaks_from_scratch ();
- }
-
+ }
+
return 0;
}
@@ -289,8 +289,8 @@ AudioSource::read_peaks (PeakData *peaks, nframes_t npeaks, sframes_t start, nfr
* @param npeaks Number of peaks to write.
*/
-int
-AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t start, nframes_t cnt,
+int
+AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t start, nframes_t cnt,
double samples_per_visual_peak, nframes_t samples_per_file_peak) const
{
Glib::Mutex::Lock lm (_lock);
@@ -311,15 +311,15 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
#undef DEBUG_READ_PEAKS
#ifdef DEBUG_READ_PEAKS
- cerr << "======>RP: npeaks = " << npeaks
- << " start = " << start
- << " cnt = " << cnt
- << " len = " << _length
- << " samples_per_visual_peak =" << samples_per_visual_peak
+ cerr << "======>RP: npeaks = " << npeaks
+ << " start = " << start
+ << " cnt = " << cnt
+ << " len = " << _length
+ << " samples_per_visual_peak =" << samples_per_visual_peak
<< " expected was " << expected_peaks << " ... scale = " << scale
<< " PD ptr = " << peaks
<<endl;
-
+
#endif
/* fix for near-end-of-file conditions */
@@ -331,20 +331,20 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
npeaks = min ((nframes_t) floor (cnt / samples_per_visual_peak), npeaks);
zero_fill = old - npeaks;
}
-
+
// cerr << "actual npeaks = " << npeaks << " zf = " << zero_fill << endl;
if (npeaks == cnt) {
#ifdef DEBUG_READ_PEAKS
cerr << "RAW DATA\n";
-#endif
+#endif
/* no scaling at all, just get the sample data and duplicate it for
both max and min peak values.
*/
Sample* raw_staging = new Sample[cnt];
-
+
if (read_unlocked (raw_staging, start, cnt) != cnt) {
error << _("cannot read sample data for unscaled peak computation") << endmsg;
return -1;
@@ -373,18 +373,18 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
#ifdef DEBUG_READ_PEAKS
cerr << "DIRECT PEAKS\n";
#endif
-
+
nread = ::pread (_peakfile, peaks, sizeof (PeakData)* npeaks, first_peak_byte);
close (_peakfile);
if (nread != sizeof (PeakData) * npeaks) {
cerr << "AudioSource["
<< _name
- << "]: cannot read peaks from peakfile! (read only "
+ << "]: cannot read peaks from peakfile! (read only "
<< nread
- << " not "
+ << " not "
<< npeaks
- << "at sample "
+ << "at sample "
<< start
<< " = byte "
<< first_peak_byte
@@ -407,7 +407,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
#ifdef DEBUG_READ_PEAKS
cerr << "DOWNSAMPLE\n";
-#endif
+#endif
/* the caller wants:
- more frames-per-peak (lower resolution) than the peakfile, or to put it another way,
@@ -415,15 +415,15 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
So, read a block into a staging area, and then downsample from there.
- to avoid confusion, I'll refer to the requested peaks as visual_peaks and the peakfile peaks as stored_peaks
+ to avoid confusion, I'll refer to the requested peaks as visual_peaks and the peakfile peaks as stored_peaks
*/
const uint32_t chunksize = (uint32_t) min (expected_peaks, 65536.0);
-
+
staging = new PeakData[chunksize];
-
+
/* compute the rounded up frame position */
-
+
nframes_t current_frame = start;
nframes_t current_stored_peak = (nframes_t) ceil (current_frame / (double) samples_per_file_peak);
uint32_t next_visual_peak = (uint32_t) ceil (current_frame / samples_per_visual_peak);
@@ -451,16 +451,16 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
uint32_t start_byte = current_stored_peak * sizeof(PeakData);
tnp = min ((nframes_t)(_length/samples_per_file_peak - current_stored_peak), (nframes_t) expected_peaks);
to_read = min (chunksize, tnp);
-
+
#ifdef DEBUG_READ_PEAKS
cerr << "read " << sizeof (PeakData) * to_read << " from peakfile @ " << start_byte << endl;
#endif
-
+
if ((nread = ::pread (_peakfile, staging, sizeof (PeakData) * to_read, start_byte))
!= sizeof (PeakData) * to_read) {
off_t fend = lseek (_peakfile, 0, SEEK_END);
-
+
cerr << "AudioSource["
<< _name
<< "]: cannot read peak data from peakfile ("
@@ -470,18 +470,18 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
<< ") ("
<< strerror (errno)
<< ')'
- << " at start_byte = " << start_byte
+ << " at start_byte = " << start_byte
<< " _length = " << _length << " versus len = " << fend
<< " expected maxpeaks = " << (_length - current_frame)/samples_per_file_peak
<< " npeaks was " << npeaks
<< endl;
goto out;
}
-
+
i = 0;
stored_peaks_read = nread / sizeof(PeakData);
}
-
+
xmax = -1.0;
xmin = 1.0;
@@ -501,21 +501,21 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
//next_visual_peak_frame = min ((next_visual_peak * samples_per_visual_peak), (next_visual_peak_frame+samples_per_visual_peak) );
next_visual_peak_frame = min ((double) start+cnt, (next_visual_peak_frame+samples_per_visual_peak) );
- stored_peak_before_next_visual_peak = (uint32_t) next_visual_peak_frame / samples_per_file_peak;
+ stored_peak_before_next_visual_peak = (uint32_t) next_visual_peak_frame / samples_per_file_peak;
}
if (zero_fill) {
- memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill);
- }
-
+ memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill);
+ }
+
ret = 0;
} else {
-
+
#ifdef DEBUG_READ_PEAKS
cerr << "UPSAMPLE\n";
#endif
- /* the caller wants
+ /* the caller wants
- less frames-per-peak (more resolution)
- more peaks than stored in the Peakfile
@@ -530,7 +530,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
nframes_t nvisual_peaks = 0;
nframes_t chunksize = (nframes_t) min (cnt, (nframes_t) 4096);
raw_staging = new Sample[chunksize];
-
+
nframes_t frame_pos = start;
double pixel_pos = floor (frame_pos / samples_per_visual_peak);
double next_pixel_pos = ceil (frame_pos / samples_per_visual_peak);
@@ -556,14 +556,14 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
if ((frames_read = read_unlocked (raw_staging, current_frame, to_read)) == 0) {
error << string_compose(_("AudioSource[%1]: peak read - cannot read %2 samples at offset %3 of %4 (%5)"),
- _name, to_read, current_frame, _length, strerror (errno))
+ _name, to_read, current_frame, _length, strerror (errno))
<< endmsg;
goto out;
}
-
+
i = 0;
}
-
+
xmax = max (xmax, raw_staging[i]);
xmin = min (xmin, raw_staging[i]);
++i;
@@ -581,7 +581,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, nframes_t npeaks, sframes_t s
next_pixel_pos = ceil (pixel_pos + 0.5);
}
}
-
+
if (zero_fill) {
memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill);
}
@@ -622,18 +622,18 @@ AudioSource::build_peaks_from_scratch ()
/* hold lock while building peaks */
Glib::Mutex::Lock lp (_lock);
-
+
if (prepare_for_peakfile_writes ()) {
goto out;
}
-
+
current_frame = 0;
cnt = _length;
_peaks_built = false;
buf = new Sample[bufsize];
while (cnt) {
-
+
frames_to_read = min (bufsize, cnt);
if ((frames_read = read_unlocked (buf, current_frame, frames_to_read)) != frames_to_read) {
@@ -645,7 +645,7 @@ AudioSource::build_peaks_from_scratch ()
if (compute_and_write_peaks (buf, current_frame, frames_read, true, false, _FPP)) {
break;
}
-
+
current_frame += frames_read;
cnt -= frames_read;
}
@@ -653,14 +653,14 @@ AudioSource::build_peaks_from_scratch ()
if (cnt == 0) {
/* success */
truncate_peakfile();
- }
+ }
done_with_peakfile_writes ((cnt == 0));
}
-
+
{
Glib::Mutex::Lock lm (_peaks_ready_lock);
-
+
if (_peaks_built) {
PeaksReady (); /* EMIT SIGNAL */
ret = 0;
@@ -693,7 +693,7 @@ AudioSource::done_with_peakfile_writes (bool done)
if (peak_leftover_cnt) {
compute_and_write_peaks (0, 0, 0, true, false, _FPP);
}
-
+
if (done) {
_peaks_built = true;
}
@@ -734,13 +734,13 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
if (first_frame != peak_leftover_frame + peak_leftover_cnt) {
- /* uh-oh, ::seek() since the last ::compute_and_write_peaks(),
+ /* uh-oh, ::seek() since the last ::compute_and_write_peaks(),
and we have leftovers. flush a single peak (since the leftovers
never represent more than that, and restart.
*/
-
+
PeakData x;
-
+
x.min = peak_leftovers[0];
x.max = peak_leftovers[0];
@@ -753,12 +753,12 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
_peak_byte_max = max (_peak_byte_max, (off_t) (byte + sizeof(PeakData)));
- {
+ {
Glib::Mutex::Lock lm (_peaks_ready_lock);
PeakRangeReady (peak_leftover_frame, peak_leftover_cnt); /* EMIT SIGNAL */
if (intermediate_peaks_ready) {
PeaksReady (); /* EMIT SIGNAL */
- }
+ }
}
/* left overs are done */
@@ -791,7 +791,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
/* make sure that when we write into the peakfile, we startup where we left off */
first_frame = peak_leftover_frame;
-
+
} else {
to_do = cnt;
}
@@ -824,7 +824,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
break;
}
-
+
nframes_t this_time = min (fpp, to_do);
peakbuf[peaks_computed].max = buf[0];
@@ -838,20 +838,20 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
frames_done += this_time;
current_frame += this_time;
}
-
+
first_peak_byte = (first_frame / fpp) * sizeof (PeakData);
if (can_truncate_peaks()) {
/* on some filesystems (ext3, at least) this helps to reduce fragmentation of
the peakfiles. its not guaranteed to do so, and even on ext3 (as of december 2006)
- it does not cause single-extent allocation even for peakfiles of
+ it does not cause single-extent allocation even for peakfiles of
less than BLOCKSIZE bytes. only call ftruncate if we'll make the file larger.
*/
-
+
off_t endpos = lseek (peakfile, 0, SEEK_END);
off_t target_length = blocksize * ((first_peak_byte + blocksize + 1) / blocksize);
-
+
if (endpos < target_length) {
ftruncate (peakfile, target_length);
/* error doesn't actually matter though, so continue on without testing */
@@ -863,7 +863,7 @@ AudioSource::compute_and_write_peaks (Sample* buf, sframes_t first_frame, nframe
goto out;
}
- _peak_byte_max = max (_peak_byte_max, (off_t) (first_peak_byte + sizeof(PeakData)*peaks_computed));
+ _peak_byte_max = max (_peak_byte_max, (off_t) (first_peak_byte + sizeof(PeakData)*peaks_computed));
if (frames_done) {
Glib::Mutex::Lock lm (_peaks_ready_lock);
@@ -894,7 +894,7 @@ AudioSource::truncate_peakfile ()
/* truncate the peakfile down to its natural length if necessary */
off_t end = lseek (peakfile, 0, SEEK_END);
-
+
if (end > _peak_byte_max) {
ftruncate (peakfile, _peak_byte_max);
}
@@ -908,7 +908,7 @@ AudioSource::file_changed (ustring path)
int e1 = stat (path.c_str(), &stat_file);
int e2 = stat (peak_path(path).c_str(), &stat_peak);
-
+
if (!e1 && !e2 && stat_file.st_mtime > stat_peak.st_mtime){
return true;
} else {
@@ -921,8 +921,8 @@ AudioSource::available_peaks (double zoom_factor) const
{
if (zoom_factor < _FPP) {
return length(_timeline_position); // peak data will come from the audio file
- }
-
+ }
+
/* peak data comes from peakfile, but the filesize might not represent
the valid data due to ftruncate optimizations, so use _peak_byte_max state.
XXX - there might be some atomicity issues here, we should probably add a lock,
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index 4d99e2f5e0..9db604cd54 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,13 +46,13 @@ Auditioner::Auditioner (Session& s)
string right = _session.config.get_auditioner_output_right();
if (left == "default") {
- left = _session.engine().get_nth_physical_output (DataType::AUDIO, 0);
+ left = _session.engine().get_nth_physical_output (DataType::AUDIO, 0);
}
if (right == "default") {
right = _session.engine().get_nth_physical_output (DataType::AUDIO, 1);
}
-
+
if ((left.length() == 0) && (right.length() == 0)) {
warning << _("no outputs available for auditioner - manual connection required") << endmsg;
return;
@@ -68,7 +68,7 @@ Auditioner::Auditioner (Session& s)
audio_diskstream()->add_channel (1);
_output->add_port (right, this, DataType::AUDIO);
}
-
+
_main_outs->allow_pan_reset ();
_main_outs->reset_panner ();
@@ -216,7 +216,7 @@ Auditioner::output_changed (IOChange change, void* /*src*/)
} else {
_session.config.set_auditioner_output_left ("");
}
-
+
connections.clear ();
if (_output->nth (1)->get_connections (connections)) {
diff --git a/libs/ardour/auto_bundle.cc b/libs/ardour/auto_bundle.cc
index fc70768601..bedb270dc5 100644
--- a/libs/ardour/auto_bundle.cc
+++ b/libs/ardour/auto_bundle.cc
@@ -10,7 +10,7 @@ ARDOUR::AutoBundle::AutoBundle (bool i)
ARDOUR::AutoBundle::AutoBundle (std::string const & n, bool i)
: Bundle (n, i)
{
-
+
}
ARDOUR::ChanCount
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index bf08a4026c..85f083ca37 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001,2007 Paul Davis
+ Copyright (C) 2001,2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -53,19 +53,19 @@ int
Automatable::old_set_automation_state (const XMLNode& node)
{
const XMLProperty *prop;
-
+
if ((prop = node.property ("path")) != 0) {
load_automation (prop->value());
} else {
warning << _("Automation node has no path property") << endmsg;
}
-
+
if ((prop = node.property ("visible")) != 0) {
uint32_t what;
stringstream sstr;
-
+
_visible_controls.clear ();
-
+
sstr << prop->value();
while (1) {
sstr >> what;
@@ -75,7 +75,7 @@ Automatable::old_set_automation_state (const XMLNode& node)
mark_automation_visible (Evoral::Parameter(PluginAutomation, 0, what), true);
}
}
-
+
_last_automation_snapshot = 0;
return 0;
@@ -103,7 +103,7 @@ Automatable::load_automation (const string& path)
Glib::Mutex::Lock lm (control_lock());
set<Evoral::Parameter> tosave;
controls().clear ();
-
+
_last_automation_snapshot = 0;
while (in) {
@@ -114,14 +114,14 @@ Automatable::load_automation (const string& path)
in >> port; if (!in) break;
in >> when; if (!in) goto bad;
in >> value; if (!in) goto bad;
-
+
Evoral::Parameter param(PluginAutomation, 0, port);
/* FIXME: this is legacy and only used for plugin inserts? I think? */
boost::shared_ptr<Evoral::Control> c = control (param, true);
c->list()->add (when, value);
tosave.insert (param);
}
-
+
return 0;
bad:
@@ -134,7 +134,7 @@ void
Automatable::add_control(boost::shared_ptr<Evoral::Control> ac)
{
Evoral::Parameter param = ac->parameter();
-
+
ControlSet::add_control(ac);
_can_automate_list.insert(param);
auto_state_changed(param); // sync everything up
@@ -145,7 +145,7 @@ Automatable::what_has_visible_data(set<Evoral::Parameter>& s) const
{
Glib::Mutex::Lock lm (control_lock());
set<Evoral::Parameter>::const_iterator li;
-
+
for (li = _visible_controls.begin(); li != _visible_controls.end(); ++li) {
s.insert (*li);
}
@@ -201,7 +201,7 @@ Automatable::mark_automation_visible (Evoral::Parameter what, bool yn)
*/
int
Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy_param)
-{
+{
Glib::Mutex::Lock lm (control_lock());
/* Don't clear controls, since some may be special derived Controllable classes */
@@ -210,7 +210,7 @@ Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
/*if (sscanf ((*niter)->name().c_str(), "parameter-%" PRIu32, &param) != 1) {
@@ -230,9 +230,9 @@ Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy
warning << "Automation has null type" << endl;
continue;
}
-
+
boost::shared_ptr<AutomationList> al (new AutomationList(**niter, param));
-
+
if (!id_prop) {
warning << "AutomationList node without automation-id property, "
<< "using default: " << EventTypeMap::instance().to_symbol(legacy_param) << endmsg;
@@ -262,7 +262,7 @@ Automatable::get_automation_state ()
{
Glib::Mutex::Lock lm (control_lock());
XMLNode* node = new XMLNode (X_("Automation"));
-
+
if (controls().empty()) {
return *node;
}
@@ -282,7 +282,7 @@ void
Automatable::set_parameter_automation_state (Evoral::Parameter param, AutoState s)
{
Glib::Mutex::Lock lm (control_lock());
-
+
boost::shared_ptr<Evoral::Control> c = control (param, true);
boost::shared_ptr<AutomationList> l = boost::dynamic_pointer_cast<AutomationList>(c->list());
@@ -305,7 +305,7 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param, bool lock)
if (c)
result = l->automation_state();
-
+
if (lock)
control_lock().unlock();
@@ -316,7 +316,7 @@ void
Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle s)
{
Glib::Mutex::Lock lm (control_lock());
-
+
boost::shared_ptr<Evoral::Control> c = control(param, true);
boost::shared_ptr<AutomationList> l = boost::dynamic_pointer_cast<AutomationList>(c->list());
@@ -379,7 +379,7 @@ Automatable::automation_snapshot (nframes_t now, bool force)
c->list()->rt_add (now, i->second->user_float());
}
}
-
+
_last_automation_snapshot = now;
}
}
@@ -388,12 +388,12 @@ void
Automatable::transport_stopped (sframes_t now)
{
for (Controls::iterator li = controls().begin(); li != controls().end(); ++li) {
-
+
boost::shared_ptr<AutomationControl> c
= boost::dynamic_pointer_cast<AutomationControl>(li->second);
boost::shared_ptr<AutomationList> l
= boost::dynamic_pointer_cast<AutomationList>(c->list());
-
+
c->list()->reposition_for_rt_add (now);
if (c->automation_state() != Off) {
diff --git a/libs/ardour/automation.cc b/libs/ardour/automation.cc
index c6e96cfac8..931e2f45b8 100644
--- a/libs/ardour/automation.cc
+++ b/libs/ardour/automation.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ struct AutomationEvent {
void (AutomatedObject::*function) (void *);
void *arg;
- void operator() (){
+ void operator() (){
object->function (arg);
}
};
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index ef54705e03..1460c42c7b 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -54,7 +54,7 @@ AutomationControl::set_value(float value)
{
bool to_list = _list && _session.transport_stopped()
&& ((AutomationList*)_list.get())->automation_write();
-
+
Control::set_float(value, to_list, _session.transport_frame());
Changed(); /* EMIT SIGNAL */
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 08cf69308f..2f06f267c1 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -70,9 +70,9 @@ AutomationList::AutomationList (const AutomationList& other)
_style = other._style;
_state = other._state;
_touching = other._touching;
-
+
create_curve_if_necessary();
-
+
assert(_parameter.type() != NullAutomation);
AutomationListCreated(this);
}
@@ -83,7 +83,7 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl
_style = other._style;
_state = other._state;
_touching = other._touching;
-
+
create_curve_if_necessary();
assert(_parameter.type() != NullAutomation);
@@ -99,13 +99,13 @@ AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id)
_touching = false;
_state = Off;
_style = Absolute;
-
+
set_state (node);
if (id) {
_parameter = id;
}
-
+
create_curve_if_necessary();
assert(_parameter.type() != NullAutomation);
@@ -149,18 +149,18 @@ AutomationList&
AutomationList::operator= (const AutomationList& other)
{
if (this != &other) {
-
+
_events.clear ();
-
+
for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) {
_events.push_back (new Evoral::ControlEvent (**i));
}
-
+
_min_yval = other._min_yval;
_max_yval = other._max_yval;
_max_xval = other._max_xval;
_default_value = other._default_value;
-
+
mark_dirty ();
maybe_signal_changed ();
}
@@ -226,7 +226,7 @@ AutomationList::thaw ()
}
}
-void
+void
AutomationList::mark_dirty () const
{
ControlList::mark_dirty ();
@@ -317,13 +317,13 @@ AutomationList::deserialize_events (const XMLNode& node)
freeze ();
clear ();
-
+
stringstream str (content_node->content());
-
+
double x;
double y;
bool ok = true;
-
+
while (str) {
str >> x;
if (!str) {
@@ -336,7 +336,7 @@ AutomationList::deserialize_events (const XMLNode& node)
}
fast_simple_add (x, y);
}
-
+
if (!ok) {
clear ();
error << _("automation list: cannot load coordinates from XML, all points ignored") << endmsg;
@@ -363,7 +363,7 @@ AutomationList::set_state (const XMLNode& node)
/* partial state setting*/
return deserialize_events (node);
}
-
+
if (node.name() == X_("Envelope") || node.name() == X_("FadeOut") || node.name() == X_("FadeIn")) {
if ((nsos = node.child (X_("AutomationList")))) {
@@ -378,27 +378,27 @@ AutomationList::set_state (const XMLNode& node)
XMLProperty* prop;
nframes_t x;
double y;
-
+
freeze ();
clear ();
-
+
for (i = elist.begin(); i != elist.end(); ++i) {
-
+
if ((prop = (*i)->property ("x")) == 0) {
error << _("automation list: no x-coordinate stored for control point (point ignored)") << endmsg;
continue;
}
x = atoi (prop->value().c_str());
-
+
if ((prop = (*i)->property ("y")) == 0) {
error << _("automation list: no y-coordinate stored for control point (point ignored)") << endmsg;
continue;
}
y = atof (prop->value().c_str());
-
+
fast_simple_add (x, y);
}
-
+
thaw ();
return 0;
@@ -414,20 +414,20 @@ AutomationList::set_state (const XMLNode& node)
/* update session AL list */
AutomationListCreated(this);
}
-
- if ((prop = node.property (X_("automation-id"))) != 0){
+
+ if ((prop = node.property (X_("automation-id"))) != 0){
_parameter = EventTypeMap::instance().new_parameter(prop->value());
} else {
warning << "Legacy session: automation list has no automation-id property.";
}
-
+
if ((prop = node.property (X_("interpolation-style"))) != 0) {
_interpolation = (InterpolationStyle)string_2_enum(prop->value(), _interpolation);
} else {
_interpolation = Linear;
}
-
- if ((prop = node.property (X_("default"))) != 0){
+
+ if ((prop = node.property (X_("default"))) != 0){
_default_value = atof (prop->value().c_str());
} else {
_default_value = 0.0;
diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc
index f3d4840f34..da0f6e4c18 100644
--- a/libs/ardour/beats_frames_converter.cc
+++ b/libs/ardour/beats_frames_converter.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
diff --git a/libs/ardour/broadcast_info.cc b/libs/ardour/broadcast_info.cc
index 1144aaa2cd..f956e1207d 100644
--- a/libs/ardour/broadcast_info.cc
+++ b/libs/ardour/broadcast_info.cc
@@ -56,10 +56,10 @@ BroadcastInfo::BroadcastInfo () :
{
info = new SF_BROADCAST_INFO;
memset (info, 0, sizeof (*info));
-
+
// Note: Set version to 1 when UMID is used, otherwise version should stay at 0
info->version = 0;
-
+
time_t rawtime;
std::time (&rawtime);
_time = *localtime (&rawtime);
@@ -85,16 +85,16 @@ BroadcastInfo::load_from_file (std::string const & filename)
{
SNDFILE * file = 0;
SF_INFO info;
-
+
info.format = 0;
-
+
if (!(file = sf_open (filename.c_str(), SFM_READ, &info))) {
update_error();
return false;
}
-
+
bool ret = load_from_file (file);
-
+
sf_close (file);
return ret;
}
@@ -107,7 +107,7 @@ BroadcastInfo::load_from_file (SNDFILE* sf)
_has_info = false;
return false;
}
-
+
_has_info = true;
return true;
}
@@ -124,7 +124,7 @@ BroadcastInfo::get_time_reference () const
if (!_has_info) {
return 0;
}
-
+
int64_t ret = (uint32_t) info->time_reference_high;
ret <<= 32;
ret |= (uint32_t) info->time_reference_low;
@@ -135,17 +135,17 @@ struct tm
BroadcastInfo::get_origination_time () const
{
struct tm ret;
-
+
std::string date = info->origination_date;
ret.tm_year = atoi (date.substr (0, 4)) - 1900;
ret.tm_mon = atoi (date.substr (5, 2));
ret.tm_mday = atoi (date.substr (8, 2));
-
+
std::string time = info->origination_time;
ret.tm_hour = atoi (time.substr (0,2));
ret.tm_min = atoi (time.substr (3,2));
ret.tm_sec = atoi (time.substr (6,2));
-
+
return ret;
}
@@ -166,16 +166,16 @@ BroadcastInfo::write_to_file (std::string const & filename)
{
SNDFILE * file = 0;
SF_INFO info;
-
+
info.format = 0;
-
+
if (!(file = sf_open (filename.c_str(), SFM_RDWR, &info))) {
update_error();
return false;
}
-
+
bool ret = write_to_file (file);
-
+
sf_close (file);
return ret;
}
@@ -187,7 +187,7 @@ BroadcastInfo::write_to_file (SNDFILE* sf)
update_error();
return false;
}
-
+
return true;
}
@@ -195,7 +195,7 @@ void
BroadcastInfo::set_description (std::string const & desc)
{
_has_info = true;
-
+
snprintf_bounded_null_filled (info->description, sizeof (info->description), desc.c_str());
}
@@ -203,7 +203,7 @@ void
BroadcastInfo::set_time_reference (int64_t when)
{
_has_info = true;
-
+
info->time_reference_high = (when >> 32);
info->time_reference_low = (when & 0xffffffff);
}
@@ -212,16 +212,16 @@ void
BroadcastInfo::set_origination_time (struct tm * now)
{
_has_info = true;
-
+
if (now) {
_time = *now;
}
-
+
snprintf_bounded_null_filled (info->origination_date, sizeof (info->origination_date), "%4d-%02d-%02d",
_time.tm_year + 1900,
_time.tm_mon + 1,
_time.tm_mday);
-
+
snprintf_bounded_null_filled (info->origination_time, sizeof (info->origination_time), "%02d:%02d:%02d",
_time.tm_hour,
_time.tm_min,
@@ -232,12 +232,12 @@ void
BroadcastInfo::set_originator (std::string const & str)
{
_has_info = true;
-
+
if (!str.empty()) {
snprintf_bounded_null_filled (info->originator, sizeof (info->originator), str.c_str());
return;
}
-
+
snprintf_bounded_null_filled (info->originator, sizeof (info->originator), Glib::get_real_name().c_str());
}
@@ -245,21 +245,21 @@ void
BroadcastInfo::set_originator_ref (Session const & session, std::string const & str)
{
_has_info = true;
-
+
if (!str.empty()) {
snprintf_bounded_null_filled (info->originator_reference, sizeof (info->originator_reference), str.c_str());
return;
}
-
+
/* random code is 9 digits */
-
+
int random_code = random() % 999999999;
-
+
/* Serial number is 12 chars */
-
+
std::ostringstream serial_number;
serial_number << "ARDOUR" << "r" << std::setfill('0') << std::right << std::setw(5) << svn_revision;
-
+
snprintf_bounded_null_filled (info->originator_reference, sizeof (info->originator_reference), "%2s%3s%12s%02d%02d%02d%9d",
session.config.get_bwf_country_code().c_str(),
session.config.get_bwf_organization_code().c_str(),
@@ -268,7 +268,7 @@ BroadcastInfo::set_originator_ref (Session const & session, std::string const &
_time.tm_min,
_time.tm_sec,
random_code);
-
+
}
void
diff --git a/libs/ardour/buffer.cc b/libs/ardour/buffer.cc
index 21803c3854..3d4737911b 100644
--- a/libs/ardour/buffer.cc
+++ b/libs/ardour/buffer.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc
index e02e2ba2cb..71b9ee6d9f 100644
--- a/libs/ardour/buffer_set.cc
+++ b/libs/ardour/buffer_set.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -88,7 +88,7 @@ BufferSet::attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset)
v.push_back(&(p->get_buffer(nframes, offset)));
}
}
-
+
_count = ports.count();
_available = ports.count();
@@ -110,7 +110,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
// The vector of buffers of the type we care about
BufferVec& bufs = _buffers[type];
-
+
// If we're a mirror just make sure we're ok
if (_is_mirror) {
assert(_count.get(type) >= num_buffers);
@@ -133,7 +133,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
for (size_t i = 0; i < num_buffers; ++i) {
bufs.push_back(Buffer::create(type, buffer_capacity));
}
-
+
_available.set(type, num_buffers);
_count.set (type, num_buffers);
}
@@ -177,7 +177,7 @@ BufferSet::ensure_buffers(const ChanCount& chns, size_t buffer_capacity)
BufferVec& bufs = _buffers[*t];
uint32_t nbufs = chns.get (*t);
-
+
if (nbufs == 0) {
// Nuke it
for (BufferVec::iterator i = bufs.begin(); i != bufs.end(); ++i) {
@@ -191,21 +191,21 @@ BufferSet::ensure_buffers(const ChanCount& chns, size_t buffer_capacity)
// rebuild it (so I'm lazy..)
if (bufs.size() < nbufs
|| (bufs.size() > 0 && bufs[0]->capacity() < buffer_capacity)) {
-
+
// Nuke it
for (BufferVec::iterator i = bufs.begin(); i != bufs.end(); ++i) {
delete (*i);
}
bufs.clear();
-
+
// Rebuild it
for (size_t i = 0; i < nbufs; ++i) {
bufs.push_back(Buffer::create(*t, buffer_capacity));
}
-
+
_available.set (*t, nbufs);
}
-
+
#ifdef HAVE_SLV2
// Ensure enough low level MIDI format buffers are available for conversion
// in both directions (input & output, out-of-place)
@@ -215,13 +215,13 @@ BufferSet::ensure_buffers(const ChanCount& chns, size_t buffer_capacity)
}
}
#endif
-
+
// Post-conditions
assert(bufs[0]->type() == *t);
assert(bufs.size() == _available.get(*t));
assert(bufs[0]->capacity() >= buffer_capacity);
}
-
+
assert (available() == chns);
}
@@ -251,7 +251,7 @@ BufferSet::get_lv2_midi(bool input, size_t i)
MidiBuffer& mbuf = get_midi(i);
LV2Buffers::value_type b = _lv2_buffers.at(i * 2 + (input ? 0 : 1));
LV2EventBuffer* ebuf = b.second;
-
+
ebuf->reset();
if (input) {
for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index c21f239a45..cd416c6a67 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -84,7 +84,7 @@ Bundle::Bundle (boost::shared_ptr<Bundle> other)
_signals_suspended (other->_signals_suspended),
_pending_change (other->_pending_change)
{
-
+
}
uint32_t
@@ -136,7 +136,7 @@ Bundle::remove_port_from_channel (uint32_t ch, string portname)
Glib::Mutex::Lock lm (_channel_mutex);
PortList& pl = _channel[ch].ports;
PortList::iterator i = find (pl.begin(), pl.end(), portname);
-
+
if (i != pl.end()) {
pl.erase (i);
changed = true;
@@ -183,7 +183,7 @@ bool
Bundle::port_attached_to_channel (uint32_t ch, std::string portname)
{
assert (ch < nchannels());
-
+
Glib::Mutex::Lock lm (_channel_mutex);
return (std::find (_channel[ch].ports.begin (), _channel[ch].ports.end (), portname) != _channel[ch].ports.end ());
}
@@ -283,7 +283,7 @@ void
Bundle::add_channels_from_bundle (boost::shared_ptr<Bundle> other)
{
uint32_t const ch = nchannels ();
-
+
for (uint32_t i = 0; i < other->nchannels(); ++i) {
std::stringstream s;
@@ -361,7 +361,7 @@ void
Bundle::remove_ports_from_channel (uint32_t ch)
{
assert (ch < nchannels ());
-
+
{
Glib::Mutex::Lock lm (_channel_mutex);
_channel[ch].ports.clear ();
@@ -396,7 +396,7 @@ Bundle::emit_changed (Change c)
Changed (c);
}
}
-
+
bool
Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
{
@@ -410,7 +410,7 @@ Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
for (uint32_t i = 0; i < nchannels(); ++i) {
Bundle::PortList const & A = channel_ports (i);
Bundle::PortList const & B = other->channel_ports (i);
-
+
for (uint32_t j = 0; j < A.size(); ++j) {
for (uint32_t k = 0; k < B.size(); ++k) {
diff --git a/libs/ardour/caimportable.cc b/libs/ardour/caimportable.cc
index 37e8f487f2..f5a70a5f6a 100644
--- a/libs/ardour/caimportable.cc
+++ b/libs/ardour/caimportable.cc
@@ -35,7 +35,7 @@ CAImportableSource::~CAImportableSource ()
}
nframes_t
-CAImportableSource::read (Sample* buffer, nframes_t nframes)
+CAImportableSource::read (Sample* buffer, nframes_t nframes)
{
nframes_t nread = 0;
AudioBufferList abl;
@@ -48,12 +48,12 @@ CAImportableSource::read (Sample* buffer, nframes_t nframes)
per_channel = nframes / abl.mBuffers[0].mNumberChannels;
while (nread < per_channel) {
-
+
UInt32 new_cnt = per_channel - nread;
-
+
abl.mBuffers[0].mDataByteSize = new_cnt * abl.mBuffers[0].mNumberChannels * sizeof(Sample);
abl.mBuffers[0].mData = buffer + nread;
-
+
try {
af.Read (new_cnt, &abl);
} catch (CAXException& cax) {
@@ -73,18 +73,18 @@ CAImportableSource::read (Sample* buffer, nframes_t nframes)
if (!at_end && nread < per_channel) {
return 0;
} else {
- return nread * abl.mBuffers[0].mNumberChannels;
+ return nread * abl.mBuffers[0].mNumberChannels;
}
}
uint
-CAImportableSource::channels () const
+CAImportableSource::channels () const
{
return af.GetFileDataFormat().NumberChannels();
}
nframes_t
-CAImportableSource::length () const
+CAImportableSource::length () const
{
return af.GetNumberFrames();
}
@@ -114,5 +114,5 @@ CAImportableSource::seek (nframes_t pos)
}
}
-
+
diff --git a/libs/ardour/chan_count.cc b/libs/ardour/chan_count.cc
index b11c578455..c6764456e0 100644
--- a/libs/ardour/chan_count.cc
+++ b/libs/ardour/chan_count.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc
index 653d45d58f..20ea6722a9 100644
--- a/libs/ardour/chan_mapping.cc
+++ b/libs/ardour/chan_mapping.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -99,7 +99,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
o << "\t" << i->first << " => " << i->second << endl;
}
}
-
+
return o;
}
diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc
index 79f36c86d8..68f13f8245 100644
--- a/libs/ardour/configuration.cc
+++ b/libs/ardour/configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2009 Paul Davis
+ Copyright (C) 1999-2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,20 +48,20 @@ bool
ConfigVariableBase::set_from_node (XMLNode const & node)
{
if (node.name() == "Config" || node.name() == "Canvas" || node.name() == "UI") {
-
+
/* ardour.rc */
-
+
const XMLProperty* prop;
XMLNodeList nlist;
XMLNodeConstIterator niter;
XMLNode* child;
-
+
nlist = node.children();
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
child = *niter;
-
+
if (child->name() == "Option") {
if ((prop = child->property ("name")) != 0) {
if (prop->value() == _name) {
@@ -73,7 +73,7 @@ ConfigVariableBase::set_from_node (XMLNode const & node)
}
}
}
-
+
} else if (node.name() == "Options") {
/* session file */
@@ -82,13 +82,13 @@ ConfigVariableBase::set_from_node (XMLNode const & node)
XMLNodeConstIterator oiter;
XMLNode* option;
const XMLProperty* opt_prop;
-
+
olist = node.children();
-
+
for (oiter = olist.begin(); oiter != olist.end(); ++oiter) {
-
+
option = *oiter;
-
+
if (option->name() == _name) {
if ((opt_prop = option->property ("val")) != 0) {
set_from_string (opt_prop->value());
@@ -97,7 +97,7 @@ ConfigVariableBase::set_from_node (XMLNode const & node)
}
}
}
-
+
return false;
}
@@ -125,7 +125,7 @@ ConfigVariableBase::notify ()
void
ConfigVariableBase::miss ()
{
- // placeholder for any debugging desired when a config variable
+ // placeholder for any debugging desired when a config variable
// is set but to the same value as it already has
}
diff --git a/libs/ardour/control_outputs.cc b/libs/ardour/control_outputs.cc
index 8efb75145c..570e7ab72b 100644
--- a/libs/ardour/control_outputs.cc
+++ b/libs/ardour/control_outputs.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index f0bdfae874..18e6534c84 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ const string ControlProtocolManager::state_node_name = X_("ControlProtocols");
ControlProtocolManager::ControlProtocolManager ()
: _session (0)
{
-
+
}
ControlProtocolManager::~ControlProtocolManager()
@@ -54,7 +54,7 @@ ControlProtocolManager::~ControlProtocolManager()
control_protocols.clear ();
-
+
for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) {
delete (*p);
}
@@ -91,7 +91,7 @@ ControlProtocolManager::drop_session ()
delete *p;
}
control_protocols.clear ();
-
+
for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) {
// otherwise the ControlProtocol instances are not recreated in set_session
if ((*p)->protocol) {
@@ -143,7 +143,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
}
cpi.descriptor->destroy (cpi.descriptor, cpi.protocol);
-
+
{
Glib::Mutex::Lock lm (protocols_lock);
list<ControlProtocol*>::iterator p = find (control_protocols.begin(), control_protocols.end(), cpi.protocol);
@@ -160,7 +160,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
cerr << "Programming error: ControlProtocolManager::teardown() called for " << cpi.name << ", but it was not found in control_protocol_info" << endl;
}
}
-
+
cpi.protocol = 0;
dlclose (cpi.descriptor->module);
return 0;
@@ -223,9 +223,9 @@ ControlProtocolManager::control_protocol_discover (string path)
cpi->mandatory = descriptor->mandatory;
cpi->supports_feedback = descriptor->supports_feedback;
cpi->state = 0;
-
+
control_protocol_info.push_back (cpi);
-
+
info << string_compose(_("Control surface protocol discovered: \"%1\""), cpi->name) << endmsg;
}
@@ -310,7 +310,7 @@ ControlProtocolManager::set_state (const XMLNode& node)
} else {
cpi->state = 0;
}
-
+
if (_session) {
instantiate (*cpi);
} else {
@@ -319,7 +319,7 @@ ControlProtocolManager::set_state (const XMLNode& node)
}
}
}
- }
+ }
}
return 0;
}
diff --git a/libs/ardour/control_protocol_search_path.cc b/libs/ardour/control_protocol_search_path.cc
index a74195b4c0..7cdf75a441 100644
--- a/libs/ardour/control_protocol_search_path.cc
+++ b/libs/ardour/control_protocol_search_path.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@ control_protocol_search_path ()
{
bool surfaces_path_defined = false;
SearchPath spath_env(Glib::getenv(surfaces_env_variable_name, surfaces_path_defined));
-
+
if (surfaces_path_defined)
{
return spath_env;
diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc
index d9d1f01601..eac6426520 100644
--- a/libs/ardour/coreaudiosource.cc
+++ b/libs/ardour/coreaudiosource.cc
@@ -38,8 +38,8 @@ using namespace ARDOUR;
using namespace PBD;
CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node)
- : Source (s, node),
- AudioFileSource (s, node)
+ : Source (s, node)
+ , AudioFileSource (s, node)
{
init ();
}
@@ -54,7 +54,7 @@ CoreAudioSource::CoreAudioSource (Session& s, const string& path, bool, int chn,
init ();
}
-void
+void
CoreAudioSource::init ()
{
/* note that we temporarily truncated _id at the colon */
@@ -63,7 +63,7 @@ CoreAudioSource::init ()
CAStreamBasicDescription file_format (af.GetFileDataFormat());
n_channels = file_format.NumberChannels();
-
+
if (_channel >= n_channels) {
error << string_compose("CoreAudioSource: file only contains %1 channels; %2 is invalid as a channel number (%3)", n_channels, _channel, name()) << endmsg;
throw failed_constructor();
@@ -81,8 +81,8 @@ CoreAudioSource::init ()
af.SetClientFormat (client_format);
} catch (CAXException& cax) {
-
- error << string_compose(_("CoreAudioSource: cannot open file \"%1\" for %2"),
+
+ error << string_compose(_("CoreAudioSource: cannot open file \"%1\" for %2"),
_path, (writable() ? "read+write" : "reading")) << endmsg;
throw failed_constructor ();
}
@@ -99,19 +99,19 @@ CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu
nframes_t nread = 0;
while (nread < cnt) {
-
+
try {
af.Seek (start+nread);
} catch (CAXException& cax) {
error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.substr (1)) << endmsg;
return -1;
}
-
+
UInt32 new_cnt = cnt - nread;
-
+
abl.mBuffers[0].mDataByteSize = new_cnt * n_channels * sizeof(Sample);
abl.mBuffers[0].mData = dst + nread;
-
+
try {
af.Read (new_cnt, &abl);
} catch (CAXException& cax) {
@@ -137,7 +137,7 @@ CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu
return 0;
}
}
-
+
nframes_t
CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
@@ -151,17 +151,17 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
if (start > _length) {
/* read starts beyond end of data, just memset to zero */
-
+
file_cnt = 0;
} else if (start + cnt > _length) {
-
+
/* read ends beyond end of data, read some, memset the rest */
-
+
file_cnt = _length - start;
} else {
-
+
/* read is entirely within data */
file_cnt = cnt;
@@ -184,7 +184,7 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
}
Sample* interleave_buf = get_interleave_buffer (file_cnt * n_channels);
-
+
if (safe_read (interleave_buf, start, file_cnt, abl) != 0) {
return 0;
}
@@ -192,9 +192,9 @@ CoreAudioSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) con
_read_data_count = cnt * sizeof(float);
Sample *ptr = interleave_buf + _channel;
-
+
/* stride through the interleaved data */
-
+
for (uint32_t n = 0; n < file_cnt; ++n) {
dst[n] = *ptr;
ptr += n_channels;
@@ -227,7 +227,7 @@ CoreAudioSource::update_header (sframes_t when, struct tm&, time_t)
int
CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
{
- FSRef ref;
+ FSRef ref;
ExtAudioFileRef af = 0;
size_t size;
CFStringRef name;
@@ -236,18 +236,18 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
if (FSPathMakeRef ((UInt8*)path.c_str(), &ref, 0) != noErr) {
goto out;
}
-
+
if (ExtAudioFileOpen(&ref, &af) != noErr) {
goto out;
}
-
+
AudioStreamBasicDescription absd;
memset(&absd, 0, sizeof(absd));
size = sizeof(AudioStreamBasicDescription);
if (ExtAudioFileGetProperty (af, kExtAudioFileProperty_FileDataFormat, &size, &absd) != noErr) {
goto out;
}
-
+
_info.samplerate = absd.mSampleRate;
_info.channels = absd.mChannelsPerFrame;
@@ -255,7 +255,7 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
if (ExtAudioFileGetProperty(af, kExtAudioFileProperty_FileLengthFrames, &size, &_info.length) != noErr) {
goto out;
}
-
+
size = sizeof(CFStringRef);
if (AudioFormatGetProperty(kAudioFormatProperty_FormatName, sizeof(absd), &absd, &size, &name) != noErr) {
goto out;
@@ -269,12 +269,12 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
} else {
_info.format_name += "little-endian";
}
-
+
char buf[32];
snprintf (buf, sizeof (buf), " %" PRIu32 " bit", absd.mBitsPerChannel);
_info.format_name += buf;
_info.format_name += '\n';
-
+
if (absd.mFormatFlags & kAudioFormatFlagIsFloat) {
_info.format_name += "float";
} else {
@@ -285,14 +285,14 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
}
/* integer is typical, do not show it */
}
-
+
if (_info.channels > 1) {
if (absd.mFormatFlags & kAudioFormatFlagIsNonInterleaved) {
_info.format_name += " noninterleaved";
}
/* interleaved is the normal case, do not show it */
}
-
+
_info.format_name += ' ';
}
@@ -363,9 +363,9 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
_info.timecode = 0;
ret = 0;
-
+
out:
ExtAudioFileDispose (af);
return ret;
-
+
}
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc
index 2d46c0c01a..f12b32228d 100644
--- a/libs/ardour/crossfade.cc
+++ b/libs/ardour/crossfade.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003-2006 Paul Davis
+ Copyright (C) 2003-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ Crossfade::operator== (const Crossfade& other)
return (_in == other._in) && (_out == other._out);
}
-Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<AudioRegion> out,
+Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<AudioRegion> out,
nframes_t length,
nframes_t position,
AnchorPoint ap)
@@ -123,7 +123,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
error << _("Crossfade: no \"in\" region in state") << endmsg;
throw failed_constructor();
}
-
+
PBD::ID id (prop->value());
if ((r = playlist.find_region (id)) == 0) {
@@ -131,7 +131,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
<< endmsg;
throw failed_constructor();
}
-
+
if ((_in = boost::dynamic_pointer_cast<AudioRegion> (r)) == 0) {
throw failed_constructor();
}
@@ -148,7 +148,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
<< endmsg;
throw failed_constructor();
}
-
+
if ((_out = boost::dynamic_pointer_cast<AudioRegion> (r)) == 0) {
throw failed_constructor();
}
@@ -156,7 +156,7 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
_length = 0;
initialize();
_active = true;
-
+
if (set_state (node)) {
throw failed_constructor();
}
@@ -172,13 +172,13 @@ Crossfade::Crossfade (boost::shared_ptr<Crossfade> orig, boost::shared_ptr<Audio
_anchor_point = orig->_anchor_point;
_follow_overlap = orig->_follow_overlap;
_fixed = orig->_fixed;
-
+
_in = newin;
_out = newout;
// copied from Crossfade::initialize()
_in_update = false;
-
+
_out->suspend_fade_out ();
_in->suspend_fade_in ();
@@ -204,9 +204,9 @@ Crossfade::initialize ()
_sources.insert (_sources.end(), _out->sources().begin(), _out->sources().end());
_master_sources = _in->master_sources();
_master_sources.insert(_master_sources.end(), _out->master_sources().begin(), _out->master_sources().end());
-
+
_in_update = false;
-
+
_out->suspend_fade_out ();
_in->suspend_fade_in ();
@@ -236,7 +236,7 @@ Crossfade::initialize ()
#endif
_fade_out.thaw ();
-
+
_fade_in.freeze ();
_fade_in.clear ();
@@ -267,9 +267,9 @@ Crossfade::initialize ()
overlap_type = _in->coverage (_out->position(), _out->last_frame());
layer_relation = (int32_t) (_in->layer() - _out->layer());
-}
+}
-nframes_t
+nframes_t
Crossfade::read_raw_internal (Sample* /*buf*/, sframes_t /*start*/, nframes_t cnt, int /*channel*/) const
{
// FIXME: Why is this disabled?
@@ -288,8 +288,8 @@ Crossfade::read_raw_internal (Sample* /*buf*/, sframes_t /*start*/, nframes_t cn
return cnt;
}
-nframes_t
-Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
+nframes_t
+Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
float *gain_buffer, sframes_t start, nframes_t cnt, uint32_t chan_n,
nframes_t read_frames, nframes_t skip_frames) const
{
@@ -313,15 +313,15 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
} else {
return 0;
}
-
+
start = _position;
buf += offset;
to_write = min (_length, cnt);
} else {
-
+
to_write = min (nframes_t(_length - (start - _position)), cnt);
-
+
}
offset = start - _position;
@@ -345,7 +345,7 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
/* note: although we have not explicitly taken into account the return values
from _out->read_at() or _in->read_at(), the length() function does this
implicitly. why? because it computes a value based on the in+out regions'
- position and length, and so we know precisely how much data they could return.
+ position and length, and so we know precisely how much data they could return.
*/
for (nframes_t n = 0; n < to_write; ++n) {
@@ -356,9 +356,9 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
delete [] fiv;
return to_write;
-}
+}
-OverlapType
+OverlapType
Crossfade::coverage (nframes_t start, nframes_t end) const
{
nframes_t my_end = _position + _length;
@@ -391,14 +391,14 @@ bool
Crossfade::refresh ()
{
/* crossfades must be between non-muted regions */
-
+
if (_out->muted() || _in->muted()) {
Invalidated (shared_from_this ());
return false;
}
/* Top layer shouldn't be transparent */
-
+
if (!((layer_relation > 0 ? _in : _out)->opaque())) {
Invalidated (shared_from_this());
return false;
@@ -418,7 +418,7 @@ Crossfade::refresh ()
if (ot == OverlapNone) {
Invalidated (shared_from_this ());
return false;
- }
+ }
bool send_signal;
@@ -428,7 +428,7 @@ Crossfade::refresh ()
try {
compute (_in, _out, _session.config.get_xfade_model());
- }
+ }
catch (NoCrossfadeHere& err) {
Invalidated (shared_from_this ());
@@ -460,39 +460,39 @@ bool
Crossfade::update ()
{
nframes_t newlen;
-
+
if (_follow_overlap) {
newlen = _out->first_frame() + _out->length() - _in->first_frame();
} else {
newlen = _length;
}
-
+
if (newlen == 0) {
Invalidated (shared_from_this ());
return false;
}
-
+
_in_update = true;
-
+
if ((_follow_overlap && newlen != _length) || (_length > newlen)) {
-
+
double factor = newlen / (double) _length;
-
+
_fade_out.x_scale (factor);
_fade_in.x_scale (factor);
-
+
_length = newlen;
- }
-
+ }
+
switch (_anchor_point) {
case StartOfIn:
_position = _in->first_frame();
break;
-
+
case EndOfIn:
_position = _in->last_frame() - _length;
break;
-
+
case EndOfOut:
_position = _out->last_frame() - _length;
}
@@ -507,7 +507,7 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
boost::shared_ptr<AudioRegion> bottom;
nframes_t short_xfade_length;
- short_xfade_length = _short_xfade_length;
+ short_xfade_length = _short_xfade_length;
if (a->layer() < b->layer()) {
top = b;
@@ -516,19 +516,19 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
top = a;
bottom = b;
}
-
+
/* first check for matching ends */
-
+
if (top->first_frame() == bottom->first_frame()) {
/* Both regions start at the same point */
-
+
if (top->last_frame() < bottom->last_frame()) {
-
+
/* top ends before bottom, so put an xfade
in at the end of top.
*/
-
+
/* [-------- top ---------- ]
* {====== bottom =====================}
*/
@@ -551,24 +551,24 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
} else {
/* top ends after (or same time) as bottom - no xfade
*/
-
+
/* [-------- top ------------------------ ]
* {====== bottom =====================}
*/
throw NoCrossfadeHere();
}
-
+
} else if (top->last_frame() == bottom->last_frame()) {
-
+
/* Both regions end at the same point */
-
+
if (top->first_frame() > bottom->first_frame()) {
-
+
/* top starts after bottom, put an xfade in at the
start of top
*/
-
+
/* [-------- top ---------- ]
* {====== bottom =====================}
*/
@@ -581,7 +581,7 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
_anchor_point = StartOfIn;
_active = true;
_fixed = true;
-
+
} else {
/* top starts before bottom - no xfade
*/
@@ -594,7 +594,7 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
}
} else {
-
+
/* OK, time to do more regular overlapping */
OverlapType ot = top->coverage (bottom->first_frame(), bottom->last_frame());
@@ -606,18 +606,18 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
*/
throw NoCrossfadeHere();
break;
-
+
case OverlapInternal:
case OverlapExternal:
/* should be NOTREACHED because of tests above */
throw NoCrossfadeHere();
break;
-
+
case OverlapEnd: /* top covers start of bottom but ends within it */
- /* [---- top ------------------------]
- * { ==== bottom ============ }
- */
+ /* [---- top ------------------------]
+ * { ==== bottom ============ }
+ */
_in = bottom;
_out = top;
@@ -630,17 +630,17 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
_follow_overlap = true;
} else {
_length = min (short_xfade_length, top->length());
- _position = top->last_frame() - _length; // "]" - length
+ _position = top->last_frame() - _length; // "]" - length
_active = true;
_follow_overlap = false;
-
+
}
break;
-
+
case OverlapStart: /* top starts within bottom but covers bottom's end */
- /* { ==== top ============ }
- * [---- bottom -------------------]
+ /* { ==== top ============ }
+ * [---- bottom -------------------]
*/
_in = top;
@@ -656,18 +656,18 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg
_length = min (short_xfade_length, top->length());
_active = true;
_follow_overlap = false;
-
+
}
-
+
break;
}
}
-
+
return 0;
}
XMLNode&
-Crossfade::get_state ()
+Crossfade::get_state ()
{
XMLNode* node = new XMLNode (X_("Crossfade"));
XMLNode* child;
@@ -779,11 +779,11 @@ Crossfade::set_state (const XMLNode& node)
}
} else {
-
+
/* XXX this branch is legacy code from before
the point where we stored xfade lengths.
*/
-
+
if ((_length = overlap_length()) == 0) {
throw failed_constructor();
}
@@ -792,26 +792,26 @@ Crossfade::set_state (const XMLNode& node)
if ((fi = find_named_node (node, "FadeIn")) == 0) {
return -1;
}
-
+
if ((fo = find_named_node (node, "FadeOut")) == 0) {
return -1;
}
/* fade in */
-
+
_fade_in.freeze ();
_fade_in.clear ();
-
+
children = fi->children();
-
+
for (i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == "point") {
nframes_t x;
float y;
-
+
prop = (*i)->property ("x");
sscanf (prop->value().c_str(), "%" PRIu32, &x);
-
+
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);
@@ -820,14 +820,14 @@ Crossfade::set_state (const XMLNode& node)
}
_fade_in.thaw ();
-
+
/* fade out */
-
+
_fade_out.freeze ();
_fade_out.clear ();
children = fo->children();
-
+
for (i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == "point") {
nframes_t x;
@@ -839,7 +839,7 @@ Crossfade::set_state (const XMLNode& node)
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);
-
+
_fade_out.add (x, y);
}
}
@@ -892,7 +892,7 @@ Crossfade::set_xfade_length (nframes_t len)
case EndOfOut:
limit = _out->length();
break;
-
+
}
len = min (limit, len);
@@ -903,7 +903,7 @@ Crossfade::set_xfade_length (nframes_t len)
_fade_out.x_scale (factor);
_fade_in.x_scale (factor);
_in_update = false;
-
+
_length = len;
StateChanged (LengthChanged);
diff --git a/libs/ardour/cycle_timer.cc b/libs/ardour/cycle_timer.cc
index e7cfc9402c..7a6b1fcab2 100644
--- a/libs/ardour/cycle_timer.cc
+++ b/libs/ardour/cycle_timer.cc
@@ -31,7 +31,7 @@ float
CycleTimer::get_mhz()
{
FILE *f;
-
+
if ((f = fopen("/proc/cpuinfo", "r")) == 0) {
fatal << _("CycleTimer::get_mhz(): can't open /proc/cpuinfo") << endmsg;
/*NOTREACHED*/
@@ -68,7 +68,7 @@ CycleTimer::get_mhz()
}
}
- fatal << _("cannot locate cpu MHz in /proc/cpuinfo") << endmsg;
+ fatal << _("cannot locate cpu MHz in /proc/cpuinfo") << endmsg;
/*NOTREACHED*/
return 0.0f;
}
diff --git a/libs/ardour/default_click.cc b/libs/ardour/default_click.cc
index 585d660809..b1f4772852 100644
--- a/libs/ardour/default_click.cc
+++ b/libs/ardour/default_click.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 20002 Paul Davis
+ Copyright (C) 20002 Paul Davis
Sounds by Nick Mainsbridge.
This program is free software; you can redistribute it and/or modify
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index 1b5f96d36c..17e073b070 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2009 Paul Davis
-
+ Copyright (C) 2009 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -62,7 +62,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Mute
{
_panner = boost::shared_ptr<Panner>(new Panner (_name, _session));
-
+
if (_output) {
_output->changed.connect (mem_fun (*this, &Delivery::output_changed));
}
@@ -192,7 +192,7 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) con
of our output object.
*/
- if (_output) {
+ if (_output) {
if (_output->n_ports() != ChanCount::ZERO) {
out = _output->n_ports();
return true;
@@ -210,10 +210,10 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) con
} else if (_role == Insert) {
/* the output buffers will be filled with data from the *input* ports
- of this Insert.
+ of this Insert.
*/
- if (_input) {
+ if (_input) {
if (_input->n_ports() != ChanCount::ZERO) {
out = _input->n_ports();
return true;
@@ -238,12 +238,12 @@ bool
Delivery::configure_io (ChanCount in, ChanCount out)
{
/* check configuration by comparison with our I/O port configuration, if appropriate.
- see ::can_support_io_configuration() for comments
+ see ::can_support_io_configuration() for comments
*/
if (_role == Main) {
- if (_output) {
+ if (_output) {
if (_output->n_ports() != out) {
if (_output->n_ports() != ChanCount::ZERO) {
fatal << _name << " programming error: configure_io with nports = " << _output->n_ports() << " called with " << in << " and " << out << " with " << _output->n_ports() << " output ports" << endmsg;
@@ -251,12 +251,12 @@ Delivery::configure_io (ChanCount in, ChanCount out)
} else {
/* I/O not yet configured */
}
- }
+ }
}
} else if (_role == Insert) {
- if (_input) {
+ if (_input) {
if (_input->n_ports() != in) {
if (_input->n_ports() != ChanCount::ZERO) {
fatal << _name << " programming error: configure_io called with " << in << " and " << out << " with " << _input->n_ports() << " input ports" << endmsg;
@@ -294,7 +294,7 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
goto out;
}
- /* this setup is not just for our purposes, but for anything that comes after us in the
+ /* this setup is not just for our purposes, but for anything that comes after us in the
processing pathway that wants to use this->output_buffers() for some reason.
*/
@@ -306,9 +306,9 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
// which cannot do this.
tgain = target_gain ();
-
+
if (tgain != _current_gain) {
-
+
/* target gain has changed */
Amp::apply_gain (bufs, nframes, _current_gain, tgain);
@@ -319,7 +319,7 @@ Delivery::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nfra
/* we were quiet last time, and we're still supposed to be quiet.
Silence the outputs, and make sure the buffers are quiet too,
*/
-
+
_output->silence (nframes);
Amp::apply_simple_gain (bufs, nframes, 0.0);
goto out;
@@ -379,7 +379,7 @@ Delivery::set_state (const XMLNode& node)
if (IOProcessor::set_state (node)) {
return -1;
}
-
+
if ((prop = node.property ("role")) != 0) {
_role = Role (string_2_enum (prop->value(), _role));
// std::cerr << this << ' ' << _name << " set role to " << enum_2_string (_role) << std::endl;
@@ -388,10 +388,10 @@ Delivery::set_state (const XMLNode& node)
}
XMLNode* pan_node = node.child (X_("Panner"));
-
+
if (pan_node) {
_panner->set_state (*pan_node);
- }
+ }
reset_panner ();
@@ -405,7 +405,7 @@ Delivery::reset_panner ()
if (!no_panner_reset) {
uint32_t ntargets;
-
+
if (_output) {
ntargets = _output->n_ports().n_audio();
} else {
@@ -493,7 +493,7 @@ void
Delivery::flush (nframes_t nframes)
{
/* io_lock, not taken: function must be called from Session::process() calltree */
-
+
PortSet& ports (_output->ports());
for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
@@ -525,7 +525,7 @@ Delivery::target_gain ()
} else {
MuteMaster::MutePoint mp;
-
+
switch (_role) {
case Main:
mp = MuteMaster::Main;
@@ -542,9 +542,9 @@ Delivery::target_gain ()
}
if (_solo_isolated) {
-
+
/* ... but we are isolated from all that nonsense */
-
+
desired_gain = _mute_master->mute_gain_at (mp);
} else if (_session.soloing()) {
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 6b9ecc53fe..6912846cd0 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
{
init (flag);
}
-
+
Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
: SessionObject(sess, "unnamed diskstream")
{
@@ -183,21 +183,21 @@ Diskstream::realtime_set_speed (double sp, bool global)
{
bool changed = false;
double new_speed = sp * _session.transport_speed();
-
+
if (_visible_speed != sp) {
_visible_speed = sp;
changed = true;
}
-
+
if (new_speed != _actual_speed) {
-
- nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() *
+
+ nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() *
fabs (new_speed)) + 1;
-
+
if (required_wrap_size > wrap_buffer_size) {
_buffer_reallocation_required = true;
}
-
+
_actual_speed = new_speed;
_target_speed = fabs(_actual_speed);
}
@@ -326,14 +326,14 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
if (_playlist) {
_playlist->release();
}
-
+
_playlist = playlist;
_playlist->use();
if (!in_set_state && recordable()) {
reset_write_sources (false);
}
-
+
plmod_connection = _playlist->Modified.connect (mem_fun (*this, &Diskstream::playlist_modified));
plgone_connection = _playlist->GoingAway.connect (bind (mem_fun (*this, &Diskstream::playlist_deleted), boost::weak_ptr<Playlist>(_playlist)));
plregion_connection = _playlist->RangesMoved.connect (mem_fun (*this, &Diskstream::playlist_ranges_moved));
@@ -348,7 +348,7 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
_session.request_overwrite_buffer (this);
overwrite_queued = true;
}
-
+
PlaylistChanged (); /* EMIT SIGNAL */
_session.set_dirty ();
@@ -367,7 +367,7 @@ Diskstream::playlist_modified ()
if (!i_am_the_modifier && !overwrite_queued) {
_session.request_overwrite_buffer (this);
overwrite_queued = true;
- }
+ }
}
void
@@ -377,14 +377,14 @@ Diskstream::playlist_deleted (boost::weak_ptr<Playlist> wpl)
if (pl == _playlist) {
- /* this catches an ordering issue with session destruction. playlists
+ /* this catches an ordering issue with session destruction. playlists
are destroyed before diskstreams. we have to invalidate any handles
we have to the playlist.
*/
-
+
if (_playlist) {
_playlist.reset ();
- }
+ }
}
}
@@ -394,9 +394,9 @@ Diskstream::set_name (const string& str)
if (str != _name) {
assert(playlist());
playlist()->set_name (str);
-
+
SessionObject::set_name(str);
-
+
if (!in_set_state && recordable()) {
/* rename existing capture files so that they have the correct name */
return rename_write_sources ();
@@ -416,7 +416,7 @@ Diskstream::remove_region_from_last_capture (boost::weak_ptr<Region> wregion)
if (!region) {
return;
}
-
+
_last_capture_regions.remove (region);
}
@@ -435,7 +435,7 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<nframes_t> > const &
movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to));
}
-
+
/* move panner automation */
boost::shared_ptr<Panner> p = _route->main_outs()->panner ();
if (p) {
@@ -460,13 +460,13 @@ Diskstream::move_processor_automation (boost::weak_ptr<Processor> p,
if (!processor) {
return;
}
-
+
list< Evoral::RangeMove<double> > movements;
for (list< Evoral::RangeMove<nframes_t> >::const_iterator i = movements_frames.begin();
i != movements_frames.end(); ++i) {
movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to));
}
-
+
set<Evoral::Parameter> const a = processor->what_can_be_automated ();
for (set<Evoral::Parameter>::iterator i = a.begin (); i != a.end (); ++i) {
diff --git a/libs/ardour/element_importer.cc b/libs/ardour/element_importer.cc
index eb6e39d13a..4438985586 100644
--- a/libs/ardour/element_importer.cc
+++ b/libs/ardour/element_importer.cc
@@ -35,7 +35,7 @@ using namespace ARDOUR;
sigc::signal <std::pair<bool, string>, string, string> ElementImporter::Rename;
sigc::signal <bool, string> ElementImporter::Prompt;
-ElementImporter::ElementImporter (XMLTree const & source, ARDOUR::Session & session) :
+ElementImporter::ElementImporter (XMLTree const & source, ARDOUR::Session & session) :
source (source),
session(session),
_queued (false),
@@ -91,7 +91,7 @@ ElementImporter::smpte_to_string(SMPTE::Time & time) const
time.seconds << ":" <<
std::setw(2) <<
time.frames;
-
+
return oss.str();
}
@@ -101,7 +101,7 @@ ElementImporter::rate_convert_samples (nframes_t samples) const
if (sample_rate == session.frame_rate()) {
return samples;
}
-
+
// +0.5 for proper rounding
return static_cast<nframes_t> (samples * (static_cast<double> (session.nominal_frame_rate()) / sample_rate) + 0.5);
}
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index 92810534ee..1ca26f8fae 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -177,7 +177,7 @@ setup_enum_writer ()
REGISTER_ENUM (ChannelColors);
REGISTER_ENUM (TrackColor);
REGISTER (_ColorMode);
-
+
REGISTER_ENUM (MeterFalloffOff);
REGISTER_ENUM (MeterFalloffSlowest);
REGISTER_ENUM (MeterFalloffSlow);
diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc
index d380906c0c..dd5b1a9149 100644
--- a/libs/ardour/event_type_map.cc
+++ b/libs/ardour/event_type_map.cc
@@ -49,10 +49,10 @@ uint8_t
EventTypeMap::parameter_midi_type(const Evoral::Parameter& param) const
{
switch (param.type()) {
- case MidiCCAutomation: return MIDI_CMD_CONTROL; break;
- case MidiPgmChangeAutomation: return MIDI_CMD_PGM_CHANGE; break;
- case MidiChannelPressureAutomation: return MIDI_CMD_CHANNEL_PRESSURE; break;
- case MidiPitchBenderAutomation: return MIDI_CMD_BENDER; break;
+ case MidiCCAutomation: return MIDI_CMD_CONTROL; break;
+ case MidiPgmChangeAutomation: return MIDI_CMD_PGM_CHANGE; break;
+ case MidiChannelPressureAutomation: return MIDI_CMD_CHANNEL_PRESSURE; break;
+ case MidiPitchBenderAutomation: return MIDI_CMD_BENDER; break;
case MidiSystemExclusiveAutomation: return MIDI_CMD_COMMON_SYSEX; break;
default: return 0;
}
@@ -78,7 +78,7 @@ EventTypeMap::is_integer(const Evoral::Parameter& param) const
&& param.type() <= MidiChannelPressureAutomation);
}
-Evoral::ControlList::InterpolationStyle
+Evoral::ControlList::InterpolationStyle
EventTypeMap::interpolation_of(const Evoral::Parameter& param)
{
switch (param.type()) {
@@ -117,15 +117,15 @@ EventTypeMap::interpolation_of(const Evoral::Parameter& param)
case MIDI_CTL_OMNI_OFF:
case MIDI_CTL_OMNI_ON:
case MIDI_CTL_MONO:
- case MIDI_CTL_POLY:
+ case MIDI_CTL_POLY:
return Evoral::ControlList::Discrete;
break;
default: return Evoral::ControlList::Linear; break;
}
- break;
- case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;
- case MidiChannelPressureAutomation: return Evoral::ControlList::Linear; break;
- case MidiPitchBenderAutomation: return Evoral::ControlList::Linear; break;
+ break;
+ case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;
+ case MidiChannelPressureAutomation: return Evoral::ControlList::Linear; break;
+ case MidiPitchBenderAutomation: return Evoral::ControlList::Linear; break;
default: assert(false);
}
return Evoral::ControlList::Linear; // Not reached, suppress warnings
@@ -167,7 +167,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const
case MidiSystemExclusiveAutomation:
return p;
}
-
+
p.set_range(type, min, max, normal);
return p;
}
diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc
index 58110ea5a9..583dc9a843 100644
--- a/libs/ardour/export_channel.cc
+++ b/libs/ardour/export_channel.cc
@@ -46,7 +46,7 @@ PortExportChannel::read (Sample * data, nframes_t frames) const
for (PortSet::const_iterator it = ports.begin(); it != ports.end(); ++it) {
if (*it != 0) {
Sample* port_buffer = (*it)->get_audio_buffer(frames, 0).data();
-
+
for (uint32_t i = 0; i < frames; ++i) {
data[i] += (float) port_buffer[i];
}
@@ -95,11 +95,11 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
break;
case Fades:
n_channels = region.n_channels();
-
+
mixdown_buffer = new Sample [frames_per_cycle];
gain_buffer = new Sample [frames_per_cycle];
memset (gain_buffer, 1.0, sizeof (Sample) * frames_per_cycle);
-
+
break;
case Processed:
n_channels = track.n_outputs().n_audio();
@@ -107,9 +107,9 @@ RegionExportChannelFactory::RegionExportChannelFactory (Session * session, Audio
default:
throw ExportFailed ("Unhandled type in ExportChannelFactory constructor");
}
-
+
session->ProcessExport.connect (sigc::hide (sigc::mem_fun (*this, &RegionExportChannelFactory::new_cycle_started)));
-
+
buffers.set_count (ChanCount (DataType::AUDIO, n_channels));
buffers.ensure_buffers (DataType::AUDIO, n_channels, frames_per_cycle);
}
@@ -132,12 +132,12 @@ RegionExportChannelFactory::read (uint32_t channel, Sample * data, nframes_t fra
{
assert (channel < n_channels);
assert (frames_to_read <= frames_per_cycle);
-
+
if (!buffers_up_to_date) {
update_buffers(frames_to_read);
buffers_up_to_date = true;
}
-
+
memcpy (data, buffers.get_audio (channel).data(), frames_to_read * sizeof (Sample));
}
@@ -165,6 +165,6 @@ RegionExportChannelFactory::update_buffers (nframes_t frames)
default:
throw ExportFailed ("Unhandled type in ExportChannelFactory::update_buffers");
}
-
+
position += frames;
}
diff --git a/libs/ardour/export_channel_configuration.cc b/libs/ardour/export_channel_configuration.cc
index 4fe8c09cb6..47bbbd276c 100644
--- a/libs/ardour/export_channel_configuration.cc
+++ b/libs/ardour/export_channel_configuration.cc
@@ -57,21 +57,21 @@ ExportChannelConfiguration::get_state ()
{
XMLNode * root = new XMLNode ("ExportChannelConfiguration");
XMLNode * channel;
-
+
root->add_property ("split", get_split() ? "true" : "false");
root->add_property ("channels", to_string (get_n_chans(), std::dec));
-
+
uint32_t i = 1;
for (ExportChannelConfiguration::ChannelList::const_iterator c_it = channels.begin(); c_it != channels.end(); ++c_it) {
channel = root->add_child ("Channel");
if (!channel) { continue; }
-
+
channel->add_property ("number", to_string (i, std::dec));
(*c_it)->get_state (channel);
-
+
++i;
}
-
+
return *root;
}
@@ -79,7 +79,7 @@ int
ExportChannelConfiguration::set_state (const XMLNode & root)
{
XMLProperty const * prop;
-
+
if ((prop = root.property ("split"))) {
set_split (!prop->value().compare ("true"));
}
@@ -100,7 +100,7 @@ ExportChannelConfiguration::all_channels_have_ports () const
for (ChannelList::const_iterator it = channels.begin(); it != channels.end(); ++it) {
if ((*it)->empty ()) { return false; }
}
-
+
return true;
}
@@ -110,23 +110,23 @@ ExportChannelConfiguration::write_files (boost::shared_ptr<ExportProcessor> new_
if (files_written || writer_thread.running) {
return false;
}
-
+
files_written = true;
if (!timespan) {
throw ExportFailed (X_("Programming error: No timespan registered to channel configuration when requesting files to be written"));
}
-
+
/* Take a local copy of the processor to be used in the thread that is created below */
-
+
processor.reset (new_processor->copy());
-
+
/* Create new thread for post processing */
-
+
pthread_create (&writer_thread.thread, 0, _write_files, &writer_thread);
writer_thread.running = true;
pthread_detach (writer_thread.thread);
-
+
return true;
}
@@ -139,36 +139,36 @@ ExportChannelConfiguration::write_file ()
nframes_t frames = 2048; // TODO good block size ?
nframes_t frames_read = 0;
-
+
float * channel_buffer = new float [frames];
float * file_buffer = new float [channels.size() * frames];
uint32_t channel_count = channels.size();
uint32_t channel;
-
+
do {
if (status->aborted()) { break; }
-
+
channel = 0;
for (ChannelList::iterator it = channels.begin(); it != channels.end(); ++it) {
-
+
/* Get channel data */
-
+
frames_read = timespan->get_data (channel_buffer, frames, *it);
-
+
/* Interleave into file buffer */
-
+
for (uint32_t i = 0; i < frames_read; ++i) {
file_buffer[channel + (channel_count * i)] = channel_buffer[i];
}
-
+
++channel;
}
-
+
progress += frames_read;
status->progress = (float) progress / timespan_length;
-
+
} while (processor->process (file_buffer, frames_read) > 0);
-
+
delete [] channel_buffer;
delete [] file_buffer;
}
@@ -177,10 +177,10 @@ void *
ExportChannelConfiguration::_write_files (void *arg)
{
notify_gui_about_thread_creation (pthread_self(), "Export post-processing");
-
+
// cc can be trated like 'this'
WriterThread & cc (*((WriterThread *) arg));
-
+
try {
for (FileConfigList::iterator it = cc->file_configs.begin(); it != cc->file_configs.end(); ++it) {
if (cc->status->aborted()) {
@@ -194,11 +194,11 @@ ExportChannelConfiguration::_write_files (void *arg)
} catch (ExportFailed & e) {
cc->status->abort (true);
}
-
+
cc.running = false;
cc->files_written = true;
cc->FilesWritten();
-
+
return 0; // avoid compiler warnings
}
@@ -206,7 +206,7 @@ void
ExportChannelConfiguration::register_with_timespan (TimespanPtr new_timespan)
{
timespan = new_timespan;
-
+
for (ChannelList::iterator it = channels.begin(); it != channels.end(); ++it) {
timespan->register_channel (*it);
}
diff --git a/libs/ardour/export_file_io.cc b/libs/ardour/export_file_io.cc
index 2f8fdeacdf..4c39e5c907 100644
--- a/libs/ardour/export_file_io.cc
+++ b/libs/ardour/export_file_io.cc
@@ -40,24 +40,24 @@ SndfileWriterBase::SndfileWriterBase (int channels, nframes_t samplerate, int fo
ExportFileWriter (path)
{
char errbuf[256];
-
+
sf_info.channels = channels;
sf_info.samplerate = samplerate;
sf_info.format = format;
-
+
if (!sf_format_check (&sf_info)) {
throw ExportFailed (X_("Invalid format given for SndfileWriter!"));
}
-
+
if (path.length() == 0) {
throw ExportFailed (X_("No output file specified for SndFileWriter"));
}
- /* TODO add checks that the directory path exists, and also
+ /* TODO add checks that the directory path exists, and also
check if we are overwriting an existing file...
*/
-
- // Open file TODO make sure we have enough disk space for the output
+
+ // Open file TODO make sure we have enough disk space for the output
if (path.compare ("temp")) {
if ((sndfile = sf_open (path.c_str(), SFM_WRITE, &sf_info)) == 0) {
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
@@ -118,11 +118,11 @@ SndfileWriter<T>::write (T * data, nframes_t frames)
sf_error_str (sndfile, errbuf, sizeof (errbuf) - 1);
throw ExportFailed (string_compose(_("Could not write data to output file (%1)"), errbuf));
}
-
+
if (GraphSink<T>::end_of_input) {
sf_write_sync (sndfile);
}
-
+
return frames;
}
@@ -152,9 +152,9 @@ ExportTempFile::read (float * data, nframes_t frames)
nframes_t frames_read = 0;
nframes_t to_read = 0;
sf_count_t read_status = 0;
-
+
/* Initialize state at first read */
-
+
if (!reading) {
if (!end_set) {
end = get_length();
@@ -163,25 +163,25 @@ ExportTempFile::read (float * data, nframes_t frames)
locate_to (start);
reading = true;
}
-
+
/* Add silence to beginning */
-
+
if (silence_beginning > 0) {
if (silence_beginning >= frames) {
memset (data, 0, channels * frames * sizeof (float));
silence_beginning -= frames;
return frames;
}
-
+
memset (data, 0, channels * silence_beginning * sizeof (float));
-
+
frames_read += silence_beginning;
data += channels * silence_beginning;
silence_beginning = 0;
}
-
+
/* Read file, but don't read past end */
-
+
if (get_read_position() >= end) {
// File already read, do nothing!
} else {
@@ -190,32 +190,32 @@ ExportTempFile::read (float * data, nframes_t frames)
} else {
to_read = frames - frames_read;
}
-
+
read_status = sf_readf_float (sndfile, data, to_read);
-
+
frames_read += to_read;
data += channels * to_read;
}
-
+
/* Check for errors */
-
+
if (read_status != to_read) {
throw ExportFailed (X_("Error reading temporary export file, export might not be complete!"));
}
-
+
/* Add silence at end */
-
+
if (silence_end > 0) {
to_read = frames - frames_read;
if (silence_end < to_read) {
to_read = silence_end;
}
-
+
memset (data, 0, channels * to_read * sizeof (float));
silence_end -= to_read;
frames_read += to_read;
}
-
+
return frames_read;
}
@@ -230,10 +230,10 @@ ExportTempFile::trim_beginning (bool yn)
if (!beginning_processed) {
process_beginning ();
}
-
+
start = silent_frames_beginning;
return start;
-
+
}
nframes_t
@@ -249,7 +249,7 @@ ExportTempFile::trim_end (bool yn)
if (!end_processed) {
process_end ();
}
-
+
end = silent_frames_end;
return end;
}
@@ -261,10 +261,10 @@ ExportTempFile::process_beginning ()
nframes_t frames = 1024;
nframes_t frames_read;
float * buf = new float[channels * frames];
-
+
nframes_t pos = 0;
locate_to (pos);
-
+
while ((frames_read = _read (buf, frames)) > 0) {
for (nframes_t i = 0; i < frames_read; i++) {
for (uint32_t chn = 0; chn < channels; ++chn) {
@@ -276,12 +276,12 @@ ExportTempFile::process_beginning ()
++pos;
}
}
-
+
out:
-
+
silent_frames_beginning = pos;
beginning_processed = true;
-
+
delete [] buf;
}
@@ -291,9 +291,9 @@ ExportTempFile::process_end ()
nframes_t frames = 1024;
nframes_t frames_read;
float * buf = new float[channels * frames];
-
+
nframes_t pos = get_length() - 1;
-
+
while (pos > 0) {
if (pos > frames) {
locate_to (pos - frames);
@@ -303,7 +303,7 @@ ExportTempFile::process_end ()
locate_to (0);
frames_read = _read (buf, pos);
}
-
+
for (nframes_t i = frames_read; i > 0; --i) {
for (uint32_t chn = 0; chn < channels; ++chn) {
if (buf[chn + (i - 1) * channels] != 0.0f) {
@@ -313,12 +313,12 @@ ExportTempFile::process_end ()
--pos;
}
}
-
+
out:
-
+
silent_frames_end = pos;
end_processed = true;
-
+
delete [] buf;
}
@@ -397,37 +397,37 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr
typedef boost::shared_ptr<SampleFormatConverter<short> > ShortConverterPtr;
typedef boost::shared_ptr<SampleFormatConverter<int> > IntConverterPtr;
typedef boost::shared_ptr<SampleFormatConverter<float> > FloatConverterPtr;
-
+
typedef boost::shared_ptr<SndfileWriter<short> > ShortWriterPtr;
typedef boost::shared_ptr<SndfileWriter<int> > IntWriterPtr;
typedef boost::shared_ptr<SndfileWriter<float> > FloatWriterPtr;
-
+
int real_format = format->format_id() | format->sample_format() | format->endianness();
uint32_t data_width = sndfile_data_width (real_format);
if (data_width == 8 || data_width == 16) {
-
+
ShortConverterPtr sfc = ShortConverterPtr (new SampleFormatConverter<short> (channels, format->dither_type(), data_width));
ShortWriterPtr sfw = ShortWriterPtr (new SndfileWriter<short> (channels, format->sample_rate(), real_format, filename));
sfc->pipe_to (sfw);
-
+
return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
} else if (data_width == 24 || data_width == 32) {
-
+
IntConverterPtr sfc = IntConverterPtr (new SampleFormatConverter<int> (channels, format->dither_type(), data_width));
IntWriterPtr sfw = IntWriterPtr (new SndfileWriter<int> (channels, format->sample_rate(), real_format, filename));
sfc->pipe_to (sfw);
-
+
return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
}
-
+
FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter<float> (channels, format->dither_type(), data_width));
FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter<float> (channels, format->sample_rate(), real_format, filename));
sfc->pipe_to (sfw);
-
+
return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
}
diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc
index 539d4f2027..51e32a4ca9 100644
--- a/libs/ardour/export_filename.cc
+++ b/libs/ardour/export_filename.cc
@@ -54,9 +54,9 @@ ExportFilename::ExportFilename (Session & session) :
time_t rawtime;
std::time (&rawtime);
time_struct = localtime (&rawtime);
-
+
folder = session.session_directory().export_path().to_string();
-
+
XMLNode * instant_node = session.instant_xml ("ExportFilename");
if (instant_node) {
set_state (*instant_node);
@@ -68,22 +68,22 @@ ExportFilename::get_state ()
{
XMLNode * node = new XMLNode ("ExportFilename");
XMLNode * child;
-
+
FieldPair dir = analyse_folder();
child = node->add_child ("Folder");
child->add_property ("relative", dir.first ? "true" : "false");
child->add_property ("path", dir.second);
-
+
add_field (node, "label", include_label, label);
add_field (node, "session", include_session);
add_field (node, "revision", include_revision);
add_field (node, "time", include_time, enum_2_string (time_format));
add_field (node, "date", include_date, enum_2_string (date_format));
-
+
XMLNode * instant_node = new XMLNode ("ExportRevision");
instant_node->add_property ("revision", to_string (revision, std::dec));
session.add_instant_xml (*instant_node);
-
+
return *node;
}
@@ -93,37 +93,37 @@ ExportFilename::set_state (const XMLNode & node)
XMLNode * child;
XMLProperty * prop;
FieldPair pair;
-
+
child = node.child ("Folder");
if (!child) { return -1; }
-
+
folder = "";
-
+
if ((prop = child->property ("relative"))) {
if (!prop->value().compare ("true")) {
folder = session.session_directory().root_path().to_string();
}
}
-
+
if ((prop = child->property ("path"))) {
folder += prop->value();
}
-
-
+
+
pair = get_field (node, "label");
include_label = pair.first;
label = pair.second;
-
+
pair = get_field (node, "session");
include_session = pair.first;
-
+
pair = get_field (node, "revision");
include_revision = pair.first;
-
+
pair = get_field (node, "time");
include_time = pair.first;
time_format = (TimeFormat) string_2_enum (pair.second, time_format);
-
+
pair = get_field (node, "date");
include_date = pair.first;
date_format = (DateFormat) string_2_enum (pair.second, date_format);
@@ -137,66 +137,66 @@ ExportFilename::set_state (const XMLNode & node)
}
ustring
-ExportFilename::get_path (FormatPtr format) const
+ExportFilename::get_path (FormatPtr format) const
{
ustring path = folder;
bool filename_empty = true;
-
+
path += "/";
-
+
if (include_session) {
path += filename_empty ? "" : "_";
path += session.name();
filename_empty = false;
}
-
+
if (include_label) {
path += filename_empty ? "" : "_";
path += label;
filename_empty = false;
}
-
+
if (include_revision) {
path += filename_empty ? "" : "_";
path += "r";
path += to_string (revision, std::dec);
filename_empty = false;
}
-
+
if (include_timespan && timespan) {
path += filename_empty ? "" : "_";
path += timespan->name();
filename_empty = false;
}
-
+
if (include_channel_config && channel_config) {
path += filename_empty ? "" : "_";
path += channel_config->name();
filename_empty = false;
}
-
+
if (include_channel) {
path += filename_empty ? "" : "_";
path += "channel";
path += to_string (channel, std::dec);
filename_empty = false;
}
-
+
if (include_date) {
path += filename_empty ? "" : "_";
path += get_date_format_str (date_format);
filename_empty = false;
}
-
+
if (include_time) {
path += filename_empty ? "" : "_";
path += get_time_format_str (time_format);
filename_empty = false;
}
-
+
path += ".";
path += format->extension ();
-
+
return path;
}
@@ -206,13 +206,13 @@ ExportFilename::get_time_format_str (TimeFormat format) const
switch ( format ) {
case T_None:
return _("No Time");
-
+
case T_NoDelim:
return get_formatted_time ("%H%M");
-
+
case T_Delim:
return get_formatted_time ("%H.%M");
-
+
default:
return _("Invalid time format");
}
@@ -224,19 +224,19 @@ ExportFilename::get_date_format_str (DateFormat format) const
switch (format) {
case D_None:
return _("No Date");
-
+
case D_BE:
return get_formatted_time ("%Y%m%d");
-
+
case D_ISO:
return get_formatted_time ("%Y-%m-%d");
-
+
case D_BEShortY:
return get_formatted_time ("%y%m%d");
-
+
case D_ISOShortY:
return get_formatted_time ("%y-%m-%d");
-
+
default:
return _("Invalid date format");
}
@@ -246,7 +246,7 @@ void
ExportFilename::set_time_format (TimeFormat format)
{
time_format = format;
-
+
if (format == T_None) {
include_time = false;
} else {
@@ -258,7 +258,7 @@ void
ExportFilename::set_date_format (DateFormat format)
{
date_format = format;
-
+
if (format == D_None) {
include_date = false;
} else {
@@ -286,7 +286,7 @@ ExportFilename::get_formatted_time (ustring const & format) const
{
char buffer [80];
strftime (buffer, 80, format.c_str(), time_struct);
-
+
ustring return_value (buffer);
return return_value;
}
@@ -295,12 +295,12 @@ void
ExportFilename::add_field (XMLNode * node, ustring const & name, bool enabled, ustring const & value)
{
XMLNode * child = node->add_child ("Field");
-
+
if (!child) {
std::cerr << "Error adding a field to ExportFilename XML-tree" << std::endl;
return;
}
-
+
child->add_property ("name", name);
child->add_property ("enabled", enabled ? "true" : "false");
if (!value.empty()) {
@@ -315,27 +315,27 @@ ExportFilename::get_field (XMLNode const & node, ustring const & name)
pair.first = false;
XMLNodeList children = node.children();
-
+
for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) {
XMLProperty * prop = (*it)->property ("name");
if (prop && !prop->value().compare (name)) {
-
+
prop = (*it)->property ("enabled");
if (prop && !prop->value().compare ("true")) {
pair.first = true;
} else {
pair.first = false;
}
-
+
prop = (*it)->property ("value");
if (prop) {
pair.second = prop->value();
}
-
+
return pair;
}
}
-
+
return pair;
}
@@ -343,12 +343,12 @@ ExportFilename::FieldPair
ExportFilename::analyse_folder ()
{
FieldPair pair;
-
+
ustring session_dir = session.session_directory().root_path().to_string();
ustring::size_type session_dir_len = session_dir.length();
-
+
ustring folder_beginning = folder.substr (0, session_dir_len);
-
+
if (!folder_beginning.compare (session_dir)) {
pair.first = true;
pair.second = folder.substr (session_dir_len);
@@ -356,7 +356,7 @@ ExportFilename::analyse_folder ()
pair.first = false;
pair.second = folder;
}
-
+
return pair;
}
diff --git a/libs/ardour/export_format_base.cc b/libs/ardour/export_format_base.cc
index f2570f8f65..a994b97ac3 100644
--- a/libs/ardour/export_format_base.cc
+++ b/libs/ardour/export_format_base.cc
@@ -46,7 +46,7 @@ ExportFormatBase::SelectableCompatible::set_compatible (bool value)
ExportFormatBase::ExportFormatBase ()
{
-
+
}
ExportFormatBase::ExportFormatBase (ExportFormatBase const & other) :
@@ -61,7 +61,7 @@ ExportFormatBase::ExportFormatBase (ExportFormatBase const & other) :
ExportFormatBase::~ExportFormatBase ()
{
-
+
}
boost::shared_ptr<ExportFormatBase>
@@ -86,9 +86,9 @@ boost::shared_ptr<ExportFormatBase>
ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation operation) const
{
boost::shared_ptr<ExportFormatBase> result (new ExportFormatBase ());
-
+
/* Sets */
-
+
// Endiannesses
{
EndianSet::const_iterator start1 = endiannesses.begin();
@@ -96,7 +96,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
EndianSet::const_iterator start2 = other.endiannesses.begin();
EndianSet::const_iterator end2 = other.endiannesses.end();
std::insert_iterator<EndianSet> insert (result->endiannesses, result->endiannesses.begin());
-
+
switch (operation) {
case SetIntersection:
std::set_intersection (start1, end1, start2, end2, insert);
@@ -109,7 +109,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
break;
}
}
-
+
// Sample formats
{
SampleFormatSet::const_iterator start1 = sample_formats.begin();
@@ -117,7 +117,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
SampleFormatSet::const_iterator start2 = other.sample_formats.begin();
SampleFormatSet::const_iterator end2 = other.sample_formats.end();
std::insert_iterator<SampleFormatSet> insert (result->sample_formats, result->sample_formats.begin());
-
+
switch (operation) {
case SetIntersection:
std::set_intersection (start1, end1, start2, end2, insert);
@@ -130,8 +130,8 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
break;
}
}
-
-
+
+
// Sample rates
{
SampleRateSet::const_iterator start1 = sample_rates.begin();
@@ -139,7 +139,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
SampleRateSet::const_iterator start2 = other.sample_rates.begin();
SampleRateSet::const_iterator end2 = other.sample_rates.end();
std::insert_iterator<SampleRateSet> insert (result->sample_rates, result->sample_rates.begin());
-
+
switch (operation) {
case SetIntersection:
std::set_intersection (start1, end1, start2, end2, insert);
@@ -152,7 +152,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
break;
}
}
-
+
// Format ids
{
FormatSet::const_iterator start1 = format_ids.begin();
@@ -160,7 +160,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
FormatSet::const_iterator start2 = other.format_ids.begin();
FormatSet::const_iterator end2 = other.format_ids.end();
std::insert_iterator<FormatSet> insert (result->format_ids, result->format_ids.begin());
-
+
switch (operation) {
case SetIntersection:
std::set_intersection (start1, end1, start2, end2, insert);
@@ -173,7 +173,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
break;
}
}
-
+
// Qualities
{
QualitySet::const_iterator start1 = qualities.begin();
@@ -181,7 +181,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
QualitySet::const_iterator start2 = other.qualities.begin();
QualitySet::const_iterator end2 = other.qualities.end();
std::insert_iterator<QualitySet> insert (result->qualities, result->qualities.begin());
-
+
switch (operation) {
case SetIntersection:
std::set_intersection (start1, end1, start2, end2, insert);
@@ -194,7 +194,7 @@ ExportFormatBase::do_set_operation (ExportFormatBase const & other, SetOperation
break;
}
}
-
+
return result;
}
diff --git a/libs/ardour/export_format_manager.cc b/libs/ardour/export_format_manager.cc
index 8b4b9e550f..908ae6f8a8 100644
--- a/libs/ardour/export_format_manager.cc
+++ b/libs/ardour/export_format_manager.cc
@@ -48,9 +48,9 @@ ExportFormatManager::~ExportFormatManager ()
void
ExportFormatManager::init_compatibilities ()
-{
+{
CompatPtr c_ptr;
-
+
c_ptr.reset (new ExportFormatCompatibility (_("CD")));
c_ptr->add_sample_rate (ExportFormatBase::SR_44_1);
c_ptr->add_format_id (ExportFormatBase::F_WAV);
@@ -59,7 +59,7 @@ ExportFormatManager::init_compatibilities ()
c_ptr->add_sample_format (ExportFormatBase::SF_16);
c_ptr->add_endianness (ExportFormatBase::E_FileDefault);
add_compatibility (c_ptr);
-
+
c_ptr.reset (new ExportFormatCompatibility (_("DVD-A")));
c_ptr->add_sample_rate (ExportFormatBase::SR_44_1);
c_ptr->add_sample_rate (ExportFormatBase::SR_48);
@@ -73,7 +73,7 @@ ExportFormatManager::init_compatibilities ()
c_ptr->add_sample_format (ExportFormatBase::SF_24);
c_ptr->add_endianness (ExportFormatBase::E_FileDefault);
add_compatibility (c_ptr);
-
+
c_ptr.reset (new ExportFormatCompatibility (_("iPod")));
c_ptr->add_sample_rate (ExportFormatBase::SR_44_1);
c_ptr->add_sample_rate (ExportFormatBase::SR_48);
@@ -84,7 +84,7 @@ ExportFormatManager::init_compatibilities ()
c_ptr->add_sample_format (ExportFormatBase::SF_24);
c_ptr->add_endianness (ExportFormatBase::E_FileDefault);
add_compatibility (c_ptr);
-
+
c_ptr.reset (new ExportFormatCompatibility (_("Something else")));
c_ptr->add_sample_rate (ExportFormatBase::SR_44_1);
c_ptr->add_sample_rate (ExportFormatBase::SR_48);
@@ -112,10 +112,10 @@ ExportFormatManager::init_qualities ()
void
ExportFormatManager::init_formats ()
-{
+{
FormatPtr f_ptr;
ExportFormatLinear * fl_ptr;
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("AIFF", ExportFormatBase::F_AIFF));
fl_ptr->add_sample_format (ExportFormatBase::SF_U8);
fl_ptr->add_sample_format (ExportFormatBase::SF_8);
@@ -127,7 +127,7 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_16);
fl_ptr->set_extension ("aiff");
add_format (f_ptr);
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("AU", ExportFormatBase::F_AU));
fl_ptr->add_sample_format (ExportFormatBase::SF_8);
fl_ptr->add_sample_format (ExportFormatBase::SF_16);
@@ -138,10 +138,10 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_16);
fl_ptr->set_extension ("au");
add_format (f_ptr);
-
+
f_ptr.reset (new ExportFormatBWF ());
add_format (f_ptr);
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("IRCAM", ExportFormatBase::F_IRCAM));
fl_ptr->add_sample_format (ExportFormatBase::SF_16);
fl_ptr->add_sample_format (ExportFormatBase::SF_24);
@@ -150,7 +150,7 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_24);
fl_ptr->set_extension ("sf");
add_format (f_ptr);
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("WAV", ExportFormatBase::F_WAV));
fl_ptr->add_sample_format (ExportFormatBase::SF_U8);
fl_ptr->add_sample_format (ExportFormatBase::SF_16);
@@ -161,7 +161,7 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_16);
fl_ptr->set_extension ("wav");
add_format (f_ptr);
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("W64", ExportFormatBase::F_W64));
fl_ptr->add_sample_format (ExportFormatBase::SF_U8);
fl_ptr->add_sample_format (ExportFormatBase::SF_16);
@@ -172,7 +172,7 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_Double);
fl_ptr->set_extension ("w64");
add_format (f_ptr);
-
+
f_ptr.reset (fl_ptr = new ExportFormatLinear ("RAW", ExportFormatBase::F_RAW));
fl_ptr->add_sample_format (ExportFormatBase::SF_U8);
fl_ptr->add_sample_format (ExportFormatBase::SF_8);
@@ -184,12 +184,12 @@ ExportFormatManager::init_formats ()
fl_ptr->set_default_sample_format (ExportFormatBase::SF_Float);
fl_ptr->set_extension ("raw");
add_format (f_ptr);
-
+
try {
f_ptr.reset (new ExportFormatOggVorbis ());
add_format (f_ptr);
} catch (ExportFormatIncompatible & e) {}
-
+
try {
f_ptr.reset (new ExportFormatFLAC ());
add_format (f_ptr);
@@ -201,9 +201,9 @@ ExportFormatManager::init_sample_rates ()
{
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_22_05, "22,05 kHz")));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_44_1, "44,1 kHz")));
- add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_48, "48 kHz")));
- add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_88_2, "88,2 kHz")));
- add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_96, "96 kHz")));
+ add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_48, "48 kHz")));
+ add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_88_2, "88,2 kHz")));
+ add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_96, "96 kHz")));
add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_192, "192 kHz")));
}
@@ -227,11 +227,11 @@ ExportFormatManager::add_format (FormatPtr ptr)
formats.push_back (ptr);
ptr->SelectChanged.connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatManager::change_format_selection), WeakFormatPtr (ptr)));
universal_set = universal_set->get_union (*ptr);
-
+
/* Encoding options */
-
+
boost::shared_ptr<HasSampleFormat> hsf;
-
+
if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (ptr)) {
hsf->SampleFormatSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatManager::change_sample_format_selection));
hsf->DitherTypeSelectChanged.connect (sigc::mem_fun (*this, &ExportFormatManager::change_dither_type_selection));
@@ -308,7 +308,7 @@ ExportFormatManager::change_compatibility_selection (bool select, WeakCompatPtr
}
CompatPtr ptr = compat.lock();
-
+
if (ptr && select) {
select_compatibility (ptr);
}
@@ -322,11 +322,11 @@ void
ExportFormatManager::change_quality_selection (bool select, WeakQualityPtr const & quality)
{
QualityPtr ptr = quality.lock ();
-
+
if (!ptr) {
return;
}
-
+
if (select) {
select_quality (ptr);
} else if (ptr->quality == current_selection->quality()) {
@@ -339,11 +339,11 @@ void
ExportFormatManager::change_format_selection (bool select, WeakFormatPtr const & format)
{
FormatPtr ptr = format.lock();
-
+
if (!ptr) {
return;
}
-
+
if (select) {
select_format (ptr);
} else if (ptr->get_format_id() == current_selection->format_id()) {
@@ -356,11 +356,11 @@ void
ExportFormatManager::change_sample_rate_selection (bool select, WeakSampleRatePtr const & rate)
{
SampleRatePtr ptr = rate.lock();
-
+
if (!ptr) {
return;
}
-
+
if (select) {
select_sample_rate (ptr);
} else if (ptr->rate == current_selection->sample_rate()) {
@@ -373,11 +373,11 @@ void
ExportFormatManager::change_sample_format_selection (bool select, WeakSampleFormatPtr const & format)
{
SampleFormatPtr ptr = format.lock();
-
+
if (!ptr) {
return;
}
-
+
if (select) {
select_sample_format (ptr);
} else if (ptr->format == current_selection->sample_format()) {
@@ -390,11 +390,11 @@ void
ExportFormatManager::change_dither_type_selection (bool select, WeakDitherTypePtr const & type)
{
DitherTypePtr ptr = type.lock();
-
+
if (!ptr) {
return;
}
-
+
if (select) {
select_dither_type (ptr);
} else if (ptr->type == current_selection->dither_type()) {
@@ -407,28 +407,28 @@ void
ExportFormatManager::select_compatibility (WeakCompatPtr const & /*compat*/)
{
/* Calculate compatibility intersection for the selection */
-
+
FormatBasePtr compat_intersect = get_compatibility_intersection ();
-
+
/* Unselect incompatible items */
-
+
boost::shared_ptr<ExportFormatBase> select_intersect;
-
+
select_intersect = compat_intersect->get_intersection (*current_selection);
if (select_intersect->qualities_empty()) {
select_quality (QualityPtr());
}
-
+
select_intersect = compat_intersect->get_intersection (*current_selection);
if (select_intersect->formats_empty()) {
select_format (FormatPtr());
}
-
+
select_intersect = compat_intersect->get_intersection (*current_selection);
if (select_intersect->sample_rates_empty()) {
select_sample_rate (SampleRatePtr());
}
-
+
select_intersect = compat_intersect->get_intersection (*current_selection);
if (select_intersect->sample_formats_empty()) {
select_sample_format (SampleFormatPtr());
@@ -445,29 +445,29 @@ ExportFormatManager::select_quality (QualityPtr const & quality)
if (quality) {
current_selection->set_quality (quality->quality);
-
+
/* Deselect format if it is incompatible */
-
+
FormatPtr format = get_selected_format();
if (format && !format->has_quality (quality->quality)) {
format->set_selected (false);
}
-
+
} else {
current_selection->set_quality (ExportFormatBase::Q_None);
-
+
QualityPtr current_quality = get_selected_quality();
if (current_quality) {
current_quality->set_selected (false);
}
-
+
/* Note:
* A quality is never explicitly deselected without also deselecting the format
* so we don't need to deselect the format here.
* doing so causes extra complications
*/
}
-
+
if (do_selection_changed) {
selection_changed ();
}
@@ -484,9 +484,9 @@ ExportFormatManager::select_format (FormatPtr const & format)
current_selection->set_format (format);
if (format) {
-
+
/* Slect right quality for format */
-
+
ExportFormatBase::Quality quality = format->get_quality();
for (QualityList::iterator it = qualities.begin (); it != qualities.end (); ++it) {
if ((*it)->quality == quality) {
@@ -495,16 +495,16 @@ ExportFormatManager::select_format (FormatPtr const & format)
(*it)->set_selected (false);
}
}
-
+
/* Handle sample formats */
-
+
ExportFormatBase::SampleFormat format_to_select;
if (format->sample_format_is_compatible (current_selection->sample_format())) {
format_to_select = current_selection->sample_format();
} else {
format_to_select = format->default_sample_format();
}
-
+
boost::shared_ptr<HasSampleFormat> hsf;
if ((hsf = boost::dynamic_pointer_cast<HasSampleFormat> (format))) {
SampleFormatList sample_formats = hsf->get_sample_formats();
@@ -516,16 +516,16 @@ ExportFormatManager::select_format (FormatPtr const & format)
}
}
}
-
+
current_selection->set_sample_format (format_to_select);
-
+
} else {
FormatPtr current_format = get_selected_format ();
if (current_format) {
current_format->set_selected (false);
}
}
-
+
if (do_selection_changed) {
selection_changed ();
}
@@ -544,13 +544,13 @@ ExportFormatManager::select_sample_rate (SampleRatePtr const & rate)
current_selection->set_sample_rate (rate->rate);
} else {
current_selection->set_sample_rate (ExportFormatBase::SR_None);
-
+
SampleRatePtr current_rate = get_selected_sample_rate();
if (current_rate) {
current_rate->set_selected (false);
}
}
-
+
if (do_selection_changed) {
selection_changed ();
}
@@ -569,13 +569,13 @@ ExportFormatManager::select_sample_format (SampleFormatPtr const & format)
current_selection->set_sample_format (format->format);
} else {
current_selection->set_sample_format (ExportFormatBase::SF_None);
-
+
SampleFormatPtr current_format = get_selected_sample_format();
if (current_format) {
current_format->set_selected (false);
}
}
-
+
if (do_selection_changed) {
selection_changed ();
}
@@ -595,7 +595,7 @@ ExportFormatManager::select_dither_type (DitherTypePtr const & type)
} else {
current_selection->set_dither_type (ExportFormatBase::D_None);
}
-
+
if (do_selection_changed) {
selection_changed ();
}
@@ -605,46 +605,46 @@ void
ExportFormatManager::selection_changed ()
{
/* Get a list of incompatible compatibility selections */
-
+
CompatList incompatibles;
for (CompatList::iterator it = compatibilities.begin(); it != compatibilities.end(); ++it) {
if (!current_selection->is_compatible_with (**it)) {
incompatibles.push_back (*it);
}
}
-
+
/* Deselect them */
-
+
for (CompatList::iterator it = incompatibles.begin(); it != incompatibles.end(); ++it) {
(*it)->set_selected (false);
}
-
+
/* Mark compatibility for everything necessary */
-
+
std::set<ExportFormatBase::Quality> compatible_qualities;
FormatBasePtr compat_intersect = get_compatibility_intersection ();
ExportFormatCompatibility global_compat (*compat_intersect);
-
+
for (FormatList::iterator it = formats.begin(); it != formats.end(); ++it) {
if ((*it)->set_compatibility_state (global_compat)) {
compatible_qualities.insert ((*it)->get_quality());
}
}
-
+
bool any_quality_compatible = true;
for (QualityList::iterator it = qualities.begin(); it != qualities.end(); ++it) {
if (compatible_qualities.find((*it)->quality) != compatible_qualities.end()) {
(*it)->set_compatible (true);
-
+
} else {
(*it)->set_compatible (false);
-
+
if ((*it)->quality != ExportFormatBase::Q_Any) {
any_quality_compatible = false;
}
}
}
-
+
if (any_quality_compatible) {
for (QualityList::iterator it = qualities.begin(); it != qualities.end(); ++it) {
if ((*it)->quality == ExportFormatBase::Q_Any) {
@@ -653,7 +653,7 @@ ExportFormatManager::selection_changed ()
}
}
}
-
+
for (SampleRateList::iterator it = sample_rates.begin(); it != sample_rates.end(); ++it) {
if (compat_intersect->has_sample_rate ((*it)->rate)) {
(*it)->set_compatible (true);
@@ -661,10 +661,10 @@ ExportFormatManager::selection_changed ()
(*it)->set_compatible (false);
}
}
-
+
boost::shared_ptr<HasSampleFormat> hsf;
if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (get_selected_format())) {
-
+
SampleFormatList sf_list = hsf->get_sample_formats();
for (SampleFormatList::iterator it = sf_list.begin(); it != sf_list.end(); ++it) {
if (compat_intersect->has_sample_format ((*it)->format)) {
@@ -673,15 +673,15 @@ ExportFormatManager::selection_changed ()
(*it)->set_compatible (false);
}
}
-
+
}
-
+
/* Signal completeness */
-
+
CompleteChanged (current_selection->is_complete());
-
+
/* Reset pending state */
-
+
pending_selection_change = false;
}
@@ -693,7 +693,7 @@ ExportFormatManager::get_selected_quality ()
return *it;
}
}
-
+
return QualityPtr();
}
@@ -707,7 +707,7 @@ ExportFormatManager::get_selected_format ()
return *it;
}
}
-
+
return format;
}
@@ -719,7 +719,7 @@ ExportFormatManager::get_selected_sample_rate ()
return *it;
}
}
-
+
return SampleRatePtr();
}
@@ -727,7 +727,7 @@ ExportFormatManager::SampleFormatPtr
ExportFormatManager::get_selected_sample_format ()
{
boost::shared_ptr<HasSampleFormat> hsf;
-
+
if (hsf = boost::dynamic_pointer_cast<HasSampleFormat> (get_selected_format())) {
return hsf->get_selected_sample_format ();
} else {
@@ -740,13 +740,13 @@ ExportFormatManager::FormatBasePtr
ExportFormatManager::get_compatibility_intersection ()
{
FormatBasePtr compat_intersect = universal_set;
-
+
for (CompatList::iterator it = compatibilities.begin(); it != compatibilities.end(); ++it) {
if ((*it)->selected ()) {
compat_intersect = compat_intersect->get_intersection (**it);
}
}
-
+
return compat_intersect;
}
diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc
index ab05aa4a64..60a7732b58 100644
--- a/libs/ardour/export_format_specification.cc
+++ b/libs/ardour/export_format_specification.cc
@@ -45,29 +45,29 @@ ExportFormatSpecification::Time::operator= (AnyTime const & other)
type = other.type;
smpte = other.smpte;
bbt = other.bbt;
-
+
if (type == Frames) {
frames = other.frames;
} else {
seconds = other.seconds;
}
-
+
return *this;
}
nframes_t
ExportFormatSpecification::Time::get_frames (nframes_t target_rate) const
-{
+{
//TODO position
nframes_t duration = session.convert_to_frames_at (0, *this);
-
+
return ((double) target_rate / session.frame_rate()) * duration + 0.5;
}
XMLNode &
ExportFormatSpecification::Time::get_state ()
{
-
+
XMLNode * node = new XMLNode ("Duration");
node->add_property ("format", enum_2_string (type));
@@ -91,7 +91,7 @@ ExportFormatSpecification::Time::get_state ()
node->add_property ("seconds", to_string (seconds, std::dec));
break;
}
-
+
return *node;
}
@@ -99,61 +99,61 @@ int
ExportFormatSpecification::Time::set_state (const XMLNode & node)
{
XMLProperty const * prop;
-
+
prop = node.property ("format");
-
+
if (!prop) { return -1; }
-
+
type = (Type) string_2_enum (prop->value(), Type);
-
+
switch (type) {
case SMPTE:
if ((prop = node.property ("hours"))) {
smpte.hours = atoi (prop->value());
}
-
+
if ((prop = node.property ("minutes"))) {
smpte.minutes = atoi (prop->value());
}
-
+
if ((prop = node.property ("seconds"))) {
smpte.seconds = atoi (prop->value());
}
-
+
if ((prop = node.property ("frames"))) {
smpte.frames = atoi (prop->value());
}
-
+
break;
-
+
case BBT:
if ((prop = node.property ("bars"))) {
bbt.bars = atoi (prop->value());
}
-
+
if ((prop = node.property ("beats"))) {
bbt.beats = atoi (prop->value());
}
-
+
if ((prop = node.property ("ticks"))) {
bbt.ticks = atoi (prop->value());
}
-
+
break;
-
+
case Frames:
if ((prop = node.property ("frames"))) {
std::istringstream iss (prop->value());
iss >> frames;
}
-
+
break;
-
+
case Seconds:
if ((prop = node.property ("seconds"))) {
seconds = atof (prop->value());
}
-
+
break;
}
@@ -162,7 +162,7 @@ ExportFormatSpecification::Time::set_state (const XMLNode & node)
ExportFormatSpecification::ExportFormatSpecification (Session & s)
: session (s)
-
+
, has_sample_format (false)
, supports_tagging (false)
, _has_broadcast_info (false)
@@ -170,12 +170,12 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s)
, _dither_type (D_None)
, _src_quality (SRC_SincBest)
, _tag (true)
-
+
, _trim_beginning (false)
, _silence_beginning (s)
, _trim_end (false)
, _silence_end (s)
-
+
, _normalize (false)
, _normalize_target (1.0)
{
@@ -207,7 +207,7 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification
_format_name = other._format_name;
has_sample_format = other.has_sample_format;
-
+
supports_tagging = other.supports_tagging;
_has_broadcast_info = other._has_broadcast_info;
_channel_limit = other._channel_limit;
@@ -218,16 +218,16 @@ ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification
set_sample_format (other.sample_format());
set_sample_rate (other.sample_rate());
set_quality (other.quality());
-
+
set_dither_type (other.dither_type());
set_src_quality (other.src_quality());
set_trim_beginning (other.trim_beginning());
set_trim_end (other.trim_end());
set_normalize (other.normalize());
set_normalize_target (other.normalize_target());
-
+
set_tag (other.tag());
-
+
set_silence_beginning (other.silence_beginning_time());
set_silence_end (other.silence_end_time());
}
@@ -241,10 +241,10 @@ ExportFormatSpecification::get_state ()
{
XMLNode * node;
XMLNode * root = new XMLNode ("ExportFormatSpecification");
-
+
root->add_property ("name", _name);
root->add_property ("id", _id.to_s());
-
+
node = root->add_child ("Encoding");
node->add_property ("id", enum_2_string (format_id()));
node->add_property ("type", enum_2_string (type()));
@@ -252,45 +252,45 @@ ExportFormatSpecification::get_state ()
node->add_property ("name", _format_name);
node->add_property ("has-sample-format", has_sample_format ? "true" : "false");
node->add_property ("channel-limit", to_string (_channel_limit, std::dec));
-
+
node = root->add_child ("SampleRate");
node->add_property ("rate", to_string (sample_rate(), std::dec));
-
+
node = root->add_child ("SRCQuality");
node->add_property ("quality", enum_2_string (src_quality()));
-
+
XMLNode * enc_opts = root->add_child ("EncodingOptions");
-
+
add_option (enc_opts, "sample-format", enum_2_string (sample_format()));
add_option (enc_opts, "dithering", enum_2_string (dither_type()));
add_option (enc_opts, "tag-metadata", _tag ? "true" : "false");
add_option (enc_opts, "tag-support", supports_tagging ? "true" : "false");
add_option (enc_opts, "broadcast-info", _has_broadcast_info ? "true" : "false");
-
+
XMLNode * processing = root->add_child ("Processing");
-
+
node = processing->add_child ("Normalize");
node->add_property ("enabled", normalize() ? "true" : "false");
node->add_property ("target", to_string (normalize_target(), std::dec));
-
+
XMLNode * silence = processing->add_child ("Silence");
XMLNode * start = silence->add_child ("Start");
XMLNode * end = silence->add_child ("End");
-
+
node = start->add_child ("Trim");
node->add_property ("enabled", trim_beginning() ? "true" : "false");
-
+
node = start->add_child ("Add");
node->add_property ("enabled", silence_beginning() > 0 ? "true" : "false");
node->add_child_nocopy (_silence_beginning.get_state());
-
+
node = end->add_child ("Trim");
node->add_property ("enabled", trim_end() ? "true" : "false");
-
+
node = end->add_child ("Add");
node->add_property ("enabled", silence_end() > 0 ? "true" : "false");
node->add_child_nocopy (_silence_end.get_state());
-
+
return *root;
}
@@ -300,57 +300,57 @@ ExportFormatSpecification::set_state (const XMLNode & root)
XMLProperty const * prop;
XMLNode const * child;
string value;
-
+
if ((prop = root.property ("name"))) {
_name = prop->value();
}
-
+
if ((prop = root.property ("id"))) {
_id = prop->value();
}
-
+
/* Encoding and SRC */
-
+
if ((child = root.child ("Encoding"))) {
if ((prop = child->property ("id"))) {
set_format_id ((FormatId) string_2_enum (prop->value(), FormatId));
}
-
+
if ((prop = child->property ("type"))) {
set_type ((Type) string_2_enum (prop->value(), Type));
}
-
+
if ((prop = child->property ("extension"))) {
set_extension (prop->value());
}
-
+
if ((prop = child->property ("name"))) {
_format_name = prop->value();
}
-
+
if ((prop = child->property ("has-sample-format"))) {
has_sample_format = !prop->value().compare ("true");
}
-
+
if ((prop = child->property ("channel-limit"))) {
_channel_limit = atoi (prop->value());
}
}
-
+
if ((child = root.child ("SampleRate"))) {
if ((prop = child->property ("rate"))) {
set_sample_rate ( (SampleRate) string_2_enum (prop->value(), SampleRate));
}
}
-
+
if ((child = root.child ("SRCQuality"))) {
if ((prop = child->property ("quality"))) {
_src_quality = (SRCQuality) string_2_enum (prop->value(), SRCQuality);
}
}
-
+
/* Encoding options */
-
+
if ((child = root.child ("EncodingOptions"))) {
set_sample_format ((SampleFormat) string_2_enum (get_option (child, "sample-format"), SampleFormat));
set_dither_type ((DitherType) string_2_enum (get_option (child, "dithering"), DitherType));
@@ -358,37 +358,37 @@ ExportFormatSpecification::set_state (const XMLNode & root)
supports_tagging = (!(get_option (child, "tag-support").compare ("true")));
_has_broadcast_info = (!(get_option (child, "broadcast-info").compare ("true")));
}
-
+
/* Processing */
-
+
XMLNode const * proc = root.child ("Processing");
if (!proc) { std::cerr << X_("Could not load processing for export format") << std::endl; return -1; }
-
+
if ((child = proc->child ("Normalize"))) {
if ((prop = child->property ("enabled"))) {
_normalize = (!prop->value().compare ("true"));
}
-
+
if ((prop = child->property ("target"))) {
_normalize_target = atof (prop->value());
}
}
-
+
XMLNode const * silence = proc->child ("Silence");
if (!silence) { std::cerr << X_("Could not load silence for export format") << std::endl; return -1; }
-
+
XMLNode const * start = silence->child ("Start");
XMLNode const * end = silence->child ("End");
if (!start || !end) { std::cerr << X_("Could not load end or start silence for export format") << std::endl; return -1; }
-
+
/* Silence start */
-
+
if ((child = start->child ("Trim"))) {
if ((prop = child->property ("enabled"))) {
_trim_beginning = (!prop->value().compare ("true"));
}
}
-
+
if ((child = start->child ("Add"))) {
if ((prop = child->property ("enabled"))) {
if (!prop->value().compare ("true")) {
@@ -400,15 +400,15 @@ ExportFormatSpecification::set_state (const XMLNode & root)
}
}
}
-
+
/* Silence end */
-
+
if ((child = end->child ("Trim"))) {
if ((prop = child->property ("enabled"))) {
_trim_end = (!prop->value().compare ("true"));
}
}
-
+
if ((child = end->child ("Add"))) {
if ((prop = child->property ("enabled"))) {
if (!prop->value().compare ("true")) {
@@ -420,7 +420,7 @@ ExportFormatSpecification::set_state (const XMLNode & root)
}
}
}
-
+
return 0;
}
@@ -428,27 +428,27 @@ bool
ExportFormatSpecification::is_compatible_with (ExportFormatCompatibility const & compatibility) const
{
boost::shared_ptr<ExportFormatBase> intersection = get_intersection (compatibility);
-
+
if (intersection->formats_empty() && format_id() != 0) {
return false;
}
-
+
if (intersection->endiannesses_empty() && endianness() != E_FileDefault) {
return false;
}
-
+
if (intersection->sample_rates_empty() && sample_rate() != SR_None) {
return false;
}
-
+
if (intersection->sample_formats_empty() && sample_format() != SF_None) {
return false;
}
-
+
if (intersection->qualities_empty() && quality() != Q_None) {
return false;
}
-
+
return true;
}
@@ -458,15 +458,15 @@ ExportFormatSpecification::is_complete () const
if (type() == T_None) {
return false;
}
-
+
if (!format_id()) {
return false;
}
-
+
if (!sample_rate()) {
return false;
}
-
+
if (has_sample_format) {
if (sample_format() == SF_None) {
return false;
@@ -483,22 +483,22 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
set_format_id (format->get_format_id ());
set_type (format->get_type());
set_extension (format->extension());
-
+
if (format->get_explicit_sample_format()) {
set_sample_format (format->get_explicit_sample_format());
}
-
+
if (format->has_sample_format()) {
has_sample_format = true;
}
-
+
if (format->has_broadcast_info()) {
_has_broadcast_info = true;
}
-
+
supports_tagging = format->supports_tagging ();
_channel_limit = format->get_channel_limit();
-
+
_format_name = format->name();
} else {
set_format_id (F_None);
@@ -516,13 +516,13 @@ Glib::ustring
ExportFormatSpecification::description ()
{
Glib::ustring desc;
-
+
desc = _name + ": ";
-
+
if (_normalize) {
desc += _("normalize, ");
}
-
+
if (_trim_beginning && _trim_end) {
desc += _("trim, ");
} else if (_trim_beginning) {
@@ -530,13 +530,13 @@ ExportFormatSpecification::description ()
} else if (_trim_end) {
desc += "trim end, ";
}
-
+
desc += _format_name + ", ";
-
+
if (has_sample_format) {
desc += HasSampleFormat::get_sample_format_name (sample_format()) + ", ";
}
-
+
switch (sample_rate()) {
case SR_22_05:
desc += "22,5 kHz";
@@ -559,7 +559,7 @@ ExportFormatSpecification::description ()
case SR_None:
break;
}
-
+
return desc;
}
@@ -575,7 +575,7 @@ std::string
ExportFormatSpecification::get_option (XMLNode const * node, std::string const & name)
{
XMLNodeList list (node->children ("Option"));
-
+
for (XMLNodeList::iterator it = list.begin(); it != list.end(); ++it) {
XMLProperty * prop = (*it)->property ("name");
if (prop && !name.compare (prop->value())) {
@@ -585,9 +585,9 @@ ExportFormatSpecification::get_option (XMLNode const * node, std::string const &
}
}
}
-
+
std::cerr << "Could not load encoding option \"" << name << "\" for export format" << std::endl;
-
+
return "";
}
diff --git a/libs/ardour/export_formats.cc b/libs/ardour/export_formats.cc
index a3fa389e8c..362076876e 100644
--- a/libs/ardour/export_formats.cc
+++ b/libs/ardour/export_formats.cc
@@ -45,7 +45,7 @@ HasSampleFormat::HasSampleFormat (ExportFormatBase::SampleFormatSet & sample_for
_sample_formats (sample_formats)
{
/* Dither Types */
-
+
add_dither_type (ExportFormatBase::D_Shaped, _("Shaped Noise"));
add_dither_type (ExportFormatBase::D_Tri, _("Triangular"));
add_dither_type (ExportFormatBase::D_Rect, _("Rectangular"));
@@ -56,7 +56,7 @@ void
HasSampleFormat::add_sample_format (ExportFormatBase::SampleFormat format)
{
_sample_formats.insert (format);
-
+
SampleFormatPtr ptr (new SampleFormatState (format, get_sample_format_name (format)));
sample_format_states.push_back (ptr);
ptr->SelectChanged.connect (sigc::bind (SampleFormatSelectChanged.make_slot(), WeakSampleFormatPtr (ptr)));
@@ -82,7 +82,7 @@ HasSampleFormat::get_selected_sample_format ()
return *it;
}
}
-
+
return SampleFormatPtr();
}
@@ -94,7 +94,7 @@ HasSampleFormat::get_selected_dither_type ()
return *it;
}
}
-
+
return DitherTypePtr();
}
@@ -105,7 +105,7 @@ HasSampleFormat::update_sample_format_selection (bool)
if (!format) {
return;
}
-
+
if (format->format == ExportFormatBase::SF_24 ||
format->format == ExportFormatBase::SF_32 ||
format->format == ExportFormatBase::SF_Float ||
@@ -132,13 +132,13 @@ HasSampleFormat::update_dither_type_selection (bool)
if (!type) {
return;
}
-
+
if (!type->compatible()) {
SampleFormatPtr format = get_selected_sample_format();
if (format) {
format->set_selected (false);
}
-
+
for (DitherTypeList::iterator it = dither_type_states.begin(); it != dither_type_states.end(); ++it) {
(*it)->set_compatible (true);
}
@@ -179,16 +179,16 @@ ExportFormatLinear::ExportFormatLinear (Glib::ustring name, FormatId format_id)
{
set_name (name);
set_format_id (format_id);
-
+
add_sample_rate (SR_22_05);
add_sample_rate (SR_44_1);
add_sample_rate (SR_48);
add_sample_rate (SR_88_2);
add_sample_rate (SR_96);
add_sample_rate (SR_192);
-
+
add_endianness (E_FileDefault);
-
+
set_quality (Q_LosslessLinear);
}
@@ -202,29 +202,29 @@ ExportFormatLinear::set_compatibility_state (ExportFormatCompatibility const & c
if (!compatibility.has_quality (Q_LosslessLinear)) {
compatible = false;
}
-
+
if (!compatibility.has_format (get_format_id())) {
compatible = false;
}
boost::shared_ptr<ExportFormatBase> intersection = get_intersection (compatibility);
-
+
if (intersection->endiannesses_empty()) {
compatible = false;
}
-
+
if (intersection->sample_rates_empty()) {
compatible = false;
}
-
+
if (intersection->sample_formats_empty()) {
compatible = false;
}
-
+
set_compatible (compatible);
/* Sample Formats */
-
+
for (SampleFormatList::iterator it = sample_format_states.begin(); it != sample_format_states.end(); ++it) {
(*it)->set_compatible (compatibility.has_sample_format ((*it)->format));
}
@@ -237,7 +237,7 @@ ExportFormatLinear::set_compatibility_state (ExportFormatCompatibility const & c
ExportFormatOggVorbis::ExportFormatOggVorbis ()
{
/* Check system compatibility */
-
+
SF_INFO sf_info;
sf_info.channels = 2;
sf_info.samplerate = SR_44_1;
@@ -245,20 +245,20 @@ ExportFormatOggVorbis::ExportFormatOggVorbis ()
if (sf_format_check (&sf_info) != SF_TRUE) {
throw ExportFormatIncompatible();
}
-
+
set_name ("Ogg Vorbis");
set_format_id (F_Ogg);
sample_formats.insert (SF_Vorbis);
-
+
add_sample_rate (SR_22_05);
add_sample_rate (SR_44_1);
add_sample_rate (SR_48);
add_sample_rate (SR_88_2);
add_sample_rate (SR_96);
add_sample_rate (SR_192);
-
+
add_endianness (E_FileDefault);
-
+
set_extension ("ogg");
set_quality (Q_LossyCompression);
}
@@ -277,7 +277,7 @@ ExportFormatFLAC::ExportFormatFLAC () :
HasSampleFormat (sample_formats)
{
/* Check system compatibility */
-
+
SF_INFO sf_info;
sf_info.channels = 2;
sf_info.samplerate = SR_44_1;
@@ -285,23 +285,23 @@ ExportFormatFLAC::ExportFormatFLAC () :
if (sf_format_check (&sf_info) != SF_TRUE) {
throw ExportFormatIncompatible();
}
-
+
set_name ("FLAC");
set_format_id (F_FLAC);
-
+
add_sample_rate (SR_22_05);
add_sample_rate (SR_44_1);
add_sample_rate (SR_48);
add_sample_rate (SR_88_2);
add_sample_rate (SR_96);
add_sample_rate (SR_192);
-
+
add_sample_format (SF_8);
add_sample_format (SF_16);
add_sample_format (SF_24);
-
+
add_endianness (E_FileDefault);
-
+
set_extension ("flac");
set_quality (Q_LosslessCompression);
}
@@ -321,7 +321,7 @@ ExportFormatBWF::ExportFormatBWF () :
{
set_name ("BWF");
set_format_id (F_WAV);
-
+
add_sample_rate (SR_22_05);
add_sample_rate (SR_44_1);
add_sample_rate (SR_48);
@@ -335,9 +335,9 @@ ExportFormatBWF::ExportFormatBWF () :
add_sample_format (SF_32);
add_sample_format (SF_Float);
add_sample_format (SF_Double);
-
+
add_endianness (E_FileDefault);
-
+
set_extension ("wav");
set_quality (Q_LosslessLinear);
}
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index 59da803ac9..0c7a2e8d48 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -116,7 +116,7 @@ ExportHandler::~ExportHandler ()
sys::remove (sys::path (*it));
}
}
-
+
channel_config_connection.disconnect();
files_written_connection.disconnect();
}
@@ -127,7 +127,7 @@ ExportHandler::add_export_config (TimespanPtr timespan, ChannelConfigPtr channel
FileSpec spec (channel_config, format, filename);
ConfigPair pair (timespan, spec);
config_map.insert (pair);
-
+
return true;
}
@@ -177,7 +177,7 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
{
string filepath;
string basename = Glib::path_get_basename(filename);
-
+
size_t ext_pos = basename.rfind('.');
if (ext_pos != string::npos) {
basename = basename.substr(0, ext_pos); /* strip file extension, if there is one */
@@ -203,18 +203,18 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
default:
return;
}
-
+
CDMarkerStatus status (filepath, timespan, file_format, filename);
if (!status.out) {
error << string_compose(_("Editor: cannot open \"%1\" as export file for CD marker file"), filepath) << endmsg;
return;
}
-
+
(this->*header_func) (status);
-
+
/* Get locations and sort */
-
+
Locations::LocationList const & locations (session.locations()->list());
Locations::LocationList::const_iterator i;
Locations::LocationList temp;
@@ -229,7 +229,7 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
// TODO One index marker for whole thing
return;
}
-
+
LocationSortByStart cmp;
temp.sort (cmp);
Locations::LocationList::const_iterator nexti;
@@ -246,45 +246,45 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
if ((*i)->start() < last_end_time) {
if ((*i)->is_mark()) {
/* Index within track */
-
+
status.index_position = (*i)->start() - timespan->get_start();
(this->*index_func) (status);
}
-
+
continue;
}
/* A track, defined by a cd range marker or a cd location marker outside of a cd range */
-
+
status.track_position = last_end_time - timespan->get_start();
status.track_start_frame = (*i)->start() - timespan->get_start(); // everything before this is the pregap
status.track_duration = 0;
-
+
if ((*i)->is_mark()) {
// a mark track location needs to look ahead to the next marker's start to determine length
nexti = i;
++nexti;
-
+
if (nexti != temp.end()) {
status.track_duration = (*nexti)->start() - last_end_time;
-
+
last_start_time = (*i)->start();
last_end_time = (*nexti)->start();
} else {
// this was the last marker, use timespan end
status.track_duration = timespan->get_end() - last_end_time;
-
+
last_start_time = (*i)->start();
last_end_time = timespan->get_end();
}
} else {
// range
status.track_duration = (*i)->end() - last_end_time;
-
+
last_start_time = (*i)->start();
last_end_time = (*i)->end();
}
-
+
(this->*track_func) (status);
}
}
@@ -349,31 +349,31 @@ ExportHandler::write_track_info_cue (CDMarkerStatus & status)
snprintf (buf, sizeof(buf), " TRACK %02d AUDIO", status.track_number);
status.out << buf << endl;
-
+
status.out << " FLAGS" ;
if (status.marker->cd_info.find("scms") != status.marker->cd_info.end()) {
status.out << " SCMS ";
} else {
status.out << " DCP ";
}
-
+
if (status.marker->cd_info.find("preemph") != status.marker->cd_info.end()) {
status.out << " PRE";
}
status.out << endl;
-
+
if (status.marker->cd_info.find("isrc") != status.marker->cd_info.end()) {
status.out << " ISRC " << status.marker->cd_info["isrc"] << endl;
-
+
}
if (status.marker->name() != "") {
status.out << " TITLE \"" << status.marker->name() << "\"" << endl;
}
-
+
if (status.marker->cd_info.find("performer") != status.marker->cd_info.end()) {
status.out << " PERFORMER \"" << status.marker->cd_info["performer"] << "\"" << endl;
}
-
+
if (status.marker->cd_info.find("string_composer") != status.marker->cd_info.end()) {
status.out << " SONGWRITER \"" << status.marker->cd_info["string_composer"] << "\"" << endl;
}
@@ -382,10 +382,10 @@ ExportHandler::write_track_info_cue (CDMarkerStatus & status)
frames_to_cd_frames_string (buf, status.track_position);
status.out << " INDEX 00" << buf << endl;
}
-
+
frames_to_cd_frames_string (buf, status.track_start_frame);
status.out << " INDEX 01" << buf << endl;
-
+
status.index_number = 2;
status.track_number++;
}
@@ -396,22 +396,22 @@ ExportHandler::write_track_info_toc (CDMarkerStatus & status)
gchar buf[18];
status.out << endl << "TRACK AUDIO" << endl;
-
+
if (status.marker->cd_info.find("scms") != status.marker->cd_info.end()) {
status.out << "NO ";
}
status.out << "COPY" << endl;
-
+
if (status.marker->cd_info.find("preemph") != status.marker->cd_info.end()) {
status.out << "PRE_EMPHASIS" << endl;
} else {
status.out << "NO PRE_EMPHASIS" << endl;
}
-
+
if (status.marker->cd_info.find("isrc") != status.marker->cd_info.end()) {
status.out << "ISRC \"" << status.marker->cd_info["isrc"] << "\"" << endl;
}
-
+
status.out << "CD_TEXT {" << endl << " LANGUAGE 0 {" << endl << " TITLE \"" << status.marker->name() << "\"" << endl;
if (status.marker->cd_info.find("performer") != status.marker->cd_info.end()) {
status.out << " PERFORMER \"" << status.marker->cd_info["performer"] << "\"" << endl;
@@ -419,23 +419,23 @@ ExportHandler::write_track_info_toc (CDMarkerStatus & status)
if (status.marker->cd_info.find("string_composer") != status.marker->cd_info.end()) {
status.out << " COMPOSER \"" << status.marker->cd_info["string_composer"] << "\"" << endl;
}
-
- if (status.marker->cd_info.find("isrc") != status.marker->cd_info.end()) {
+
+ if (status.marker->cd_info.find("isrc") != status.marker->cd_info.end()) {
status.out << " ISRC \"";
status.out << status.marker->cd_info["isrc"].substr(0,2) << "-";
status.out << status.marker->cd_info["isrc"].substr(2,3) << "-";
status.out << status.marker->cd_info["isrc"].substr(5,2) << "-";
status.out << status.marker->cd_info["isrc"].substr(7,5) << "\"" << endl;
}
-
+
status.out << " }" << endl << "}" << endl;
-
+
frames_to_cd_frames_string (buf, status.track_position);
status.out << "FILE \"" << status.filename << "\" " << buf;
-
+
frames_to_cd_frames_string (buf, status.track_duration);
status.out << buf << endl;
-
+
frames_to_cd_frames_string (buf, status.track_start_frame - status.track_position);
status.out << "START" << buf << endl;
}
@@ -449,7 +449,7 @@ ExportHandler::write_index_info_cue (CDMarkerStatus & status)
status.out << buf;
frames_to_cd_frames_string (buf, status.index_position);
status.out << buf << endl;
-
+
cue_indexnum++;
}
@@ -488,11 +488,11 @@ ExportHandler::start_timespan ()
}
current_timespan = config_map.begin()->first;
-
+
/* Register channel configs with timespan */
-
+
timespan_bounds = config_map.equal_range (current_timespan);
-
+
for (ConfigMap::iterator it = timespan_bounds.first; it != timespan_bounds.second; ++it) {
it->second.channel_config->register_with_timespan (current_timespan);
}
@@ -507,29 +507,29 @@ void
ExportHandler::finish_timespan ()
{
current_timespan->process_connection.disconnect ();
-
+
/* Register formats and filenames to relevant channel configs */
-
+
export_status->total_formats = 0;
export_status->format = 0;
-
+
for (ConfigMap::iterator it = timespan_bounds.first; it != timespan_bounds.second; ++it) {
-
+
export_status->total_formats++;
-
+
/* Setup filename */
-
+
it->second.filename->set_timespan (current_timespan);
it->second.filename->set_channel_config (it->second.channel_config);
-
+
/* Do actual registration */
-
+
ChannelConfigPtr chan_config = it->second.channel_config;
chan_config->register_file_config (it->second.format, it->second.filename);
}
-
+
/* Start writing files by doing a manual call to timespan_thread_finished */
-
+
current_map_it = timespan_bounds.first;
timespan_thread_finished ();
}
@@ -540,44 +540,44 @@ ExportHandler::timespan_thread_finished ()
channel_config_connection.disconnect();
if (current_map_it != timespan_bounds.second) {
-
+
/* Get next configuration as long as no new export process is started */
-
+
ChannelConfigPtr cc = current_map_it->second.channel_config;
while (!cc->write_files(processor)) {
-
+
++current_map_it;
-
+
if (current_map_it == timespan_bounds.second) {
-
+
/* reached end of bounds, this call will end up in the else block below */
-
+
timespan_thread_finished ();
return;
}
-
+
cc = current_map_it->second.channel_config;
}
-
+
channel_config_connection = cc->FilesWritten.connect (sigc::mem_fun (*this, &ExportHandler::timespan_thread_finished));
++current_map_it;
-
+
} else { /* All files are written from current timespan, reset timespan and start new */
-
+
/* Unregister configs and remove configs with this timespan */
-
+
for (ConfigMap::iterator it = timespan_bounds.first; it != timespan_bounds.second;) {
it->second.channel_config->unregister_all ();
-
+
ConfigMap::iterator to_erase = it;
++it;
config_map.erase (to_erase);
}
-
+
/* Start new timespan */
-
+
start_timespan ();
-
+
}
}
diff --git a/libs/ardour/export_multiplication.cc b/libs/ardour/export_multiplication.cc
index 943ca5a172..a0bc7f830e 100644
--- a/libs/ardour/export_multiplication.cc
+++ b/libs/ardour/export_multiplication.cc
@@ -9,48 +9,48 @@ ExportProfileManager::register_all_configs ()
{
list<TimespanNodePtr>::iterator tsl_it; // timespan list node iterator
for (tsl_it = graph.timespans.begin(); tsl_it != graph.timespans.end(); ++tsl_it) {
- list<GraphNode *>::const_iterator cc_it; // channel config node iterator
- for (cc_it = (*tsl_it)->get_children().begin(); cc_it != (*tsl_it)->get_children().end(); ++cc_it) {
- list<GraphNode *>::const_iterator f_it; // format node iterator
- for (f_it = (*cc_it)->get_children().begin(); f_it != (*cc_it)->get_children().end(); ++f_it) {
- list<GraphNode *>::const_iterator fn_it; // filename node iterator
- for (fn_it = (*f_it)->get_children().begin(); fn_it != (*f_it)->get_children().end(); ++fn_it) {
- /* Finally loop through each timespan in the timespan list */
-
- TimespanNodePtr ts_node;
- if (!(ts_node = boost::dynamic_pointer_cast<TimespanNode> (*tsl_it))) {
- throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
- }
-
- TimespanListPtr ts_list = ts_node->data()->timespans;
- TimespanList::iterator ts_it;
- for (ts_it = ts_list->begin(); ts_it != ts_list->end(); ++ts_it) {
-
- TimespanPtr timespan = *ts_it;
-
- ChannelConfigNode * cc_node;
- if (!(cc_node = dynamic_cast<ChannelConfigNode *> (*cc_it))) {
- throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
- }
- ChannelConfigPtr channel_config = cc_node->data()->config;
-
- FormatNode * f_node;
- if (!(f_node = dynamic_cast<FormatNode *> (*f_it))) {
- throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
- }
- FormatPtr format = f_node->data()->format;
-
- FilenameNode * fn_node;
- if (!(fn_node = dynamic_cast<FilenameNode *> (*fn_it))) {
- throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
+ list<GraphNode *>::const_iterator cc_it; // channel config node iterator
+ for (cc_it = (*tsl_it)->get_children().begin(); cc_it != (*tsl_it)->get_children().end(); ++cc_it) {
+ list<GraphNode *>::const_iterator f_it; // format node iterator
+ for (f_it = (*cc_it)->get_children().begin(); f_it != (*cc_it)->get_children().end(); ++f_it) {
+ list<GraphNode *>::const_iterator fn_it; // filename node iterator
+ for (fn_it = (*f_it)->get_children().begin(); fn_it != (*f_it)->get_children().end(); ++fn_it) {
+ /* Finally loop through each timespan in the timespan list */
+
+ TimespanNodePtr ts_node;
+ if (!(ts_node = boost::dynamic_pointer_cast<TimespanNode> (*tsl_it))) {
+ throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
+ }
+
+ TimespanListPtr ts_list = ts_node->data()->timespans;
+ TimespanList::iterator ts_it;
+ for (ts_it = ts_list->begin(); ts_it != ts_list->end(); ++ts_it) {
+
+ TimespanPtr timespan = *ts_it;
+
+ ChannelConfigNode * cc_node;
+ if (!(cc_node = dynamic_cast<ChannelConfigNode *> (*cc_it))) {
+ throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
+ }
+ ChannelConfigPtr channel_config = cc_node->data()->config;
+
+ FormatNode * f_node;
+ if (!(f_node = dynamic_cast<FormatNode *> (*f_it))) {
+ throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
+ }
+ FormatPtr format = f_node->data()->format;
+
+ FilenameNode * fn_node;
+ if (!(fn_node = dynamic_cast<FilenameNode *> (*fn_it))) {
+ throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
+ }
+ FilenamePtr filename = fn_node->data()->filename;
+
+ handler->add_export_config (timespan, channel_config, format, filename);
+ }
+ }
}
- FilenamePtr filename = fn_node->data()->filename;
-
- handler->add_export_config (timespan, channel_config, format, filename);
}
- }
- }
- }
}
}
@@ -61,7 +61,7 @@ ExportProfileManager::create_empty_config ()
timespan->data()->timespans->push_back (handler->add_timespan());
ChannelConfigNodePtr channel_config = ChannelConfigNode::create (new ChannelConfigState(handler->add_channel_config()));
-
+
FormatNodePtr format;
load_formats ();
if (!format_list.empty()) {
@@ -69,15 +69,15 @@ ExportProfileManager::create_empty_config ()
} else {
format = FormatNode::create (new FormatState (handler->add_format ()));
}
-
+
FilenameNodePtr filename = FilenameNode::create (new FilenameState (handler->add_filename()));
-
+
/* Bring everything together */
-
+
timespan->add_child (channel_config.get(), 0);
channel_config->add_child (format.get(), 0);
format->add_child (filename.get(), 0);
-
+
graph.timespans.push_back (timespan);
graph.channel_configs.push_back (channel_config);
graph.formats.push_back (format);
@@ -98,7 +98,7 @@ ExportProfileManager::GraphNode::~GraphNode ()
while (!children.empty()) {
remove_child (children.front());
}
-
+
while (!parents.empty()) {
parents.front()->remove_child (this);
}
@@ -130,7 +130,7 @@ ExportProfileManager::GraphNode::add_child (GraphNode * child, GraphNode * left_
} else {
children.push_back (child);
}
-
+
child->add_parent (this);
}
@@ -142,7 +142,7 @@ ExportProfileManager::GraphNode::is_ancestor_of (GraphNode const * node) const
return true;
}
}
-
+
return false;
}
@@ -154,7 +154,7 @@ ExportProfileManager::GraphNode::is_descendant_of (GraphNode const * node) const
return true;
}
}
-
+
return false;
}
@@ -162,7 +162,7 @@ void
ExportProfileManager::GraphNode::select (bool value)
{
if (_selected == value) { return; }
-
+
_selected = value;
SelectChanged (value);
}
@@ -187,7 +187,7 @@ ExportProfileManager::GraphNode::remove_child (GraphNode * child)
break;
}
}
-
+
child->remove_parent (this);
}
@@ -199,19 +199,19 @@ ExportProfileManager::split_node (GraphNode * node, float position)
split_timespan (ts_node->self_ptr(), position);
return;
}
-
+
ChannelConfigNode * cc_node;
if ((cc_node = dynamic_cast<ChannelConfigNode *> (node))) {
split_channel_config (cc_node->self_ptr(), position);
return;
}
-
+
FormatNode * f_node;
if ((f_node = dynamic_cast<FormatNode *> (node))) {
split_format (f_node->self_ptr(), position);
return;
}
-
+
FilenameNode * fn_node;
if ((fn_node = dynamic_cast<FilenameNode *> (node))) {
split_filename (fn_node->self_ptr(), position);
@@ -227,19 +227,19 @@ ExportProfileManager::remove_node (GraphNode * node)
remove_timespan (ts_node->self_ptr());
return;
}
-
+
ChannelConfigNode * cc_node;
if ((cc_node = dynamic_cast<ChannelConfigNode *> (node))) {
remove_channel_config (cc_node->self_ptr());
return;
}
-
+
FormatNode * f_node;
if ((f_node = dynamic_cast<FormatNode *> (node))) {
remove_format (f_node->self_ptr());
return;
}
-
+
FilenameNode * fn_node;
if ((fn_node = dynamic_cast<FilenameNode *> (node))) {
remove_filename (fn_node->self_ptr());
@@ -258,7 +258,7 @@ ExportProfileManager::purge_graph ()
graph.timespans.erase (tmp);
}
}
-
+
for (list<ChannelConfigNodePtr>::iterator it = graph.channel_configs.begin(); it != graph.channel_configs.end(); ) {
list<ChannelConfigNodePtr>::iterator tmp = it;
++it;
@@ -267,7 +267,7 @@ ExportProfileManager::purge_graph ()
graph.channel_configs.erase (tmp);
}
}
-
+
for (list<FormatNodePtr>::iterator it = graph.formats.begin(); it != graph.formats.end(); ) {
list<FormatNodePtr>::iterator tmp = it;
++it;
@@ -276,7 +276,7 @@ ExportProfileManager::purge_graph ()
graph.formats.erase (tmp);
}
}
-
+
for (list<FilenameNodePtr>::iterator it = graph.filenames.begin(); it != graph.filenames.end(); ) {
list<FilenameNodePtr>::iterator tmp = it;
++it;
@@ -285,7 +285,7 @@ ExportProfileManager::purge_graph ()
graph.filenames.erase (tmp);
}
}
-
+
GraphChanged();
}
@@ -300,9 +300,9 @@ ExportProfileManager::insert_after (list<T> & the_list, T const & position, T co
return;
}
}
-
+
std::cerr << "invalid position given to ExportProfileManager::insert_after (aborting)" << std::endl;
-
+
abort();
}
@@ -330,12 +330,12 @@ ExportProfileManager::end_of_common_child_range (list<GraphNode *> const & the_l
{
if ((*beginning)->get_children().size() != 1) { return beginning; }
GraphNode * child = (*beginning)->get_children().front();
-
+
list<GraphNode *>::const_iterator it = beginning;
while (it != the_list.end() && (*it)->get_children().size() == 1 && (*it)->get_children().front() == child) {
++it;
}
-
+
return --it;
}
@@ -345,7 +345,7 @@ ExportProfileManager::split_node_at_position (GraphNode * old_node, GraphNode *
list<GraphNode *> const & node_parents = old_node->get_parents();
uint32_t split_index = (int) (node_parents.size() * position + 0.5);
split_index = std::max ((uint32_t) 1, std::min (split_index, node_parents.size() - 1));
-
+
list<GraphNode *>::const_iterator it = node_parents.begin();
for (uint32_t index = 1; it != node_parents.end(); ++index) {
if (index > split_index) {
@@ -362,14 +362,14 @@ void
ExportProfileManager::split_timespan (TimespanNodePtr node, float)
{
TimespanNodePtr new_timespan = duplicate_timespan_node (node);
- insert_after (graph.timespans, node, new_timespan);
-
+ insert_after (graph.timespans, node, new_timespan);
+
/* Note: Since a timespan selector allows all combinations of ranges
* there is no reason for a channel configuration to have two parents
*/
-
+
duplicate_timespan_children (node->self_ptr(), new_timespan);
-
+
GraphChanged();
}
@@ -378,16 +378,16 @@ ExportProfileManager::split_channel_config (ChannelConfigNodePtr node, float)
{
ChannelConfigNodePtr new_config = duplicate_channel_config_node (node);
insert_after (graph.channel_configs, node, new_config);
-
+
/* Channel configs have only one parent, see above! */
node->get_parents().front()->add_child (new_config.get(), node.get());
-
+
if (node->get_children().size() == 1) {
new_config->add_child (node->first_child(), 0);
} else {
duplicate_channel_config_children (node, new_config);
}
-
+
GraphChanged();
}
@@ -404,13 +404,13 @@ ExportProfileManager::split_format (FormatNodePtr node, float position)
node->sort_parents (graph.channel_configs);
split_node_at_position (node.get(), new_format.get(), position);
}
-
+
if (node->get_children().size() == 1) {
new_format->add_child (node->first_child(), 0);
} else {
duplicate_format_children (node, new_format);
}
-
+
GraphChanged();
}
@@ -428,7 +428,7 @@ ExportProfileManager::split_filename (FilenameNodePtr node, float position)
node->sort_parents (graph.formats);
split_node_at_position (node.get(), new_filename.get(), position);
}
-
+
GraphChanged();
}
@@ -446,35 +446,35 @@ ExportProfileManager::duplicate_timespan_children (TimespanNodePtr source, Times
throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
}
node_insertion_point = node_insertion_ptr->self_ptr();
-
+
/* Keep track of common children */
-
+
list<GraphNode *>::const_iterator common_children_begin = source_children.begin();
list<GraphNode *>::const_iterator common_children_end = end_of_common_child_range (source_children, source_children.begin());
GraphNode * common_child = 0;
-
+
for (list<GraphNode *>::const_iterator it = source_children.begin(); it != source_children.end(); ++it) {
/* Duplicate node */
-
+
ChannelConfigNode * node;
ChannelConfigNodePtr new_node;
-
+
if (!(node = dynamic_cast<ChannelConfigNode *> (*it))) {
throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
}
-
+
new_node = duplicate_channel_config_node (node->self_ptr());
-
+
/* Insert in gaph's list and update insertion position */
-
+
insert_after (graph.channel_configs, node_insertion_point, new_node);
node_insertion_point = new_node;
-
+
/* Handle children */
-
+
target->add_child (new_node.get(), child_insertion_point);
child_insertion_point = new_node.get();
-
+
if (one_grandchild) {
new_node->add_child (node->first_child(), 0);
} else {
@@ -483,7 +483,7 @@ ExportProfileManager::duplicate_timespan_children (TimespanNodePtr source, Times
common_children_begin = it;
common_children_end = end_of_common_child_range (source_children, it);
}
-
+
if (it == common_children_begin) { // At beginning => do duplication
GraphNode * grand_child_ins_pt = common_child;
if (!grand_child_ins_pt) {
@@ -514,33 +514,33 @@ ExportProfileManager::duplicate_channel_config_children (ChannelConfigNodePtr so
node_insertion_point = node_insertion_ptr->self_ptr();
/* Keep track of common children */
-
+
list<GraphNode *>::const_iterator common_children_begin = source_children.begin();
list<GraphNode *>::const_iterator common_children_end = end_of_common_child_range (source_children, source_children.begin());
GraphNode * common_child = 0;
for (list<GraphNode *>::const_iterator it = source_children.begin(); it != source_children.end(); ++it) {
/* Duplicate node */
-
+
FormatNode * node;
FormatNodePtr new_node;
-
+
if (!(node = dynamic_cast<FormatNode *> (*it))) {
throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
}
-
+
new_node = duplicate_format_node (node->self_ptr());
-
+
/* Insert in gaph's list and update insertion position */
-
+
insert_after (graph.formats, node_insertion_point, new_node);
node_insertion_point = new_node;
-
+
/* Handle children */
-
+
target->add_child (new_node.get(), child_insertion_point);
child_insertion_point = new_node.get();
-
+
if (one_grandchild) {
new_node->add_child (node->first_child(), 0);
} else {
@@ -549,7 +549,7 @@ ExportProfileManager::duplicate_channel_config_children (ChannelConfigNodePtr so
common_children_begin = it;
common_children_end = end_of_common_child_range (source_children, it);
}
-
+
if (it == common_children_begin) { // At beginning => do duplication
GraphNode * grand_child_ins_pt = common_child;
if (!grand_child_ins_pt) {
@@ -579,23 +579,23 @@ ExportProfileManager::duplicate_format_children (FormatNodePtr source, FormatNod
for (list<GraphNode *>::const_iterator it = source->get_children().begin(); it != source->get_children().end(); ++it) {
/* Duplicate node */
-
+
FilenameNode * node;
FilenameNodePtr new_node;
-
+
if (!(node = dynamic_cast<FilenameNode *> (*it))) {
throw ExportFailed (X_("Programming error, Invalid pointer cast in ExportProfileManager"));
}
-
+
new_node = duplicate_filename_node (node->self_ptr());
-
+
/* Insert in gaph's list and update insertion position */
-
+
insert_after (graph.filenames, node_insertion_point, new_node);
node_insertion_point = new_node;
-
+
/* Handle children */
-
+
target->add_child (new_node.get(), child_insertion_point);
child_insertion_point = new_node.get();
}
@@ -607,14 +607,14 @@ ExportProfileManager::duplicate_timespan_node (TimespanNodePtr node)
TimespanStatePtr state = node->data();
TimespanStatePtr new_state (new TimespanState ());
TimespanNodePtr new_node = TimespanNode::create (new_state);
-
+
for (TimespanList::iterator it = state->timespans->begin(); it != state->timespans->end(); ++it) {
new_state->timespans->push_back (handler->add_timespan_copy (*it));
}
-
+
new_state->time_format = state->time_format;
new_state->marker_format = state->marker_format;
-
+
return new_node;
}
@@ -624,7 +624,7 @@ ExportProfileManager::duplicate_channel_config_node (ChannelConfigNodePtr node)
ChannelConfigStatePtr state = node->data();
ChannelConfigStatePtr new_state (new ChannelConfigState (handler->add_channel_config_copy (state->config)));
ChannelConfigNodePtr new_node = ChannelConfigNode::create (new_state);
-
+
return new_node;
}
@@ -634,7 +634,7 @@ ExportProfileManager::duplicate_format_node (FormatNodePtr node)
FormatStatePtr state = node->data();
FormatStatePtr new_state (new FormatState (handler->add_format_copy (state->format)));
FormatNodePtr new_node = FormatNode::create (new_state);
-
+
return new_node;
}
@@ -644,7 +644,7 @@ ExportProfileManager::duplicate_filename_node (FilenameNodePtr node)
FilenameStatePtr state = node->data();
FilenameStatePtr new_state (new FilenameState (handler->add_filename_copy (state->filename)));
FilenameNodePtr new_node = FilenameNode::create (new_state);
-
+
return new_node;
}
@@ -674,4 +674,4 @@ ExportProfileManager::remove_filename (FilenameNodePtr node)
{
remove_by_element (graph.filenames, node);
purge_graph ();
-} \ No newline at end of file
+}
diff --git a/libs/ardour/export_preset.cc b/libs/ardour/export_preset.cc
index 093803daa6..92fcb9e5a7 100644
--- a/libs/ardour/export_preset.cc
+++ b/libs/ardour/export_preset.cc
@@ -37,7 +37,7 @@ ExportPreset::ExportPreset (string filename, Session & s) :
if ((prop = root->property ("name"))) {
set_name (prop->value());
}
-
+
XMLNode * instant_xml = get_instant_xml ();
if (instant_xml) {
XMLNode * instant_copy = new XMLNode (*instant_xml);
@@ -56,7 +56,7 @@ ExportPreset::set_name (string const & name)
{
_name = name;
- XMLNode * node;
+ XMLNode * node;
if ((node = global.root())) {
node->add_property ("name", name);
}
@@ -84,7 +84,7 @@ ExportPreset::set_global_state (XMLNode & state)
{
delete global.root ();
global.set_root (&state);
-
+
set_id (_id.to_s());
set_name (_name);
}
@@ -94,7 +94,7 @@ ExportPreset::set_local_state (XMLNode & state)
{
delete local;
local = &state;
-
+
set_id (_id.to_s());
set_name (_name);
}
@@ -119,7 +119,7 @@ XMLNode *
ExportPreset::get_instant_xml () const
{
XMLNode * instant_xml;
-
+
if ((instant_xml = session.instant_xml ("ExportPresets"))) {
XMLNodeList children = instant_xml->children ("ExportPreset");
for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) {
@@ -129,7 +129,7 @@ ExportPreset::get_instant_xml () const
}
}
}
-
+
return 0;
}
@@ -139,9 +139,9 @@ ExportPreset::save_instant_xml () const
if (!local) { return; }
/* First remove old, then add new */
-
+
remove_instant_xml ();
-
+
XMLNode * instant_xml;
if ((instant_xml = session.instant_xml ("ExportPresets"))) {
instant_xml->add_child_copy (*local);
diff --git a/libs/ardour/export_processor.cc b/libs/ardour/export_processor.cc
index 19ff9ac001..d36ef9f18a 100644
--- a/libs/ardour/export_processor.cc
+++ b/libs/ardour/export_processor.cc
@@ -73,11 +73,11 @@ ExportProcessor::prepare (FormatPtr format, FilenamePtr fname, uint32_t chans, b
temp_file_length = 0;
/* Reset just to be sure all references are dropped */
-
+
reset();
-
+
/* Get parameters needed later on */
-
+
channels = chans;
split_files = split;
filename = fname;
@@ -88,50 +88,50 @@ ExportProcessor::prepare (FormatPtr format, FilenamePtr fname, uint32_t chans, b
trim_end = format->trim_end();
silence_beginning = format->silence_beginning();
silence_end = format->silence_end();
-
+
/* SRC */
-
+
src.reset (new SampleRateConverter (channels, frame_rate, format->sample_rate(), format->src_quality()));
-
+
/* Construct export pipe to temp file */
-
+
status->stage = export_PostProcess;
-
+
if (normalize) {
/* Normalizing => we need a normalizer, peak reader and tempfile */
-
+
normalizer.reset (new Normalizer (channels, format->normalize_target()));
-
+
peak_reader.reset (new PeakReader (channels));
temp_file.reset (new ExportTempFile (channels, format->sample_rate()));
-
+
src->pipe_to (peak_reader);
peak_reader->pipe_to (temp_file);
-
+
} else if (trim_beginning || trim_end) {
/* Not normalizing, but silence will be trimmed => need for a tempfile */
-
+
temp_file.reset (new ExportTempFile (channels, format->sample_rate()));
src->pipe_to (temp_file);
-
+
} else {
/* Due to complexity and time running out, a tempfile will be created for this also... */
-
+
temp_file.reset (new ExportTempFile (channels, format->sample_rate()));
src->pipe_to (temp_file);
}
/* Ensure directory exists */
-
+
sys::path folder (filename->get_folder());
if (!sys::exists (folder)) {
if (!sys::create_directory (folder)) {
throw ExportFailed (X_("sys::create_directory failed for export dir"));
}
}
-
+
/* prep file sinks */
-
+
if (split) {
filename->include_channel = true;
for (uint32_t chn = 1; chn <= channels; ++chn) {
@@ -148,23 +148,23 @@ ExportProcessor::prepare (FormatPtr format, FilenamePtr fname, uint32_t chans, b
writer_list.push_back (pair.second);
WritingFile (filename->get_path (format));
}
-
+
/* Set position info */
-
+
nframes_t start_position = ((double) format->sample_rate() / frame_rate) * start + 0.5;
-
+
for (FileWriterList::iterator it = writer_list.begin(); it != writer_list.end(); ++it) {
(*it)->set_position (start_position);
}
-
+
/* set broadcast info if necessary */
-
+
if (broadcast_info) {
for (FileWriterList::iterator it = writer_list.begin(); it != writer_list.end(); ++it) {
-
+
BroadcastInfo bci;
bci.set_from_session (session, (*it)->position());
-
+
boost::shared_ptr<SndfileWriterBase> sndfile_ptr;
if ((sndfile_ptr = boost::dynamic_pointer_cast<SndfileWriterBase> (*it))) {
if (!bci.write_to_file (sndfile_ptr->get_sndfile())) {
@@ -196,17 +196,17 @@ ExportProcessor::prepare_post_processors ()
float dummy;
src->set_end_of_input ();
src->write (&dummy, 0);
-
+
/* Trim and add silence */
-
+
temp_file->trim_beginning (trim_beginning);
temp_file->trim_end (trim_end);
-
+
temp_file->set_silence_beginning (silence_beginning);
temp_file->set_silence_end (silence_end);
-
+
/* Set up normalizer */
-
+
if (normalize) {
normalizer->set_peak (peak_reader->get_peak ());
}
@@ -216,35 +216,35 @@ void
ExportProcessor::write_files ()
{
/* Write to disk */
-
+
status->stage = export_Write;
temp_file_position = 0;
-
+
uint32_t buffer_size = 4096; // TODO adjust buffer size?
float * buf = new float[channels * buffer_size];
int frames_read;
-
+
FloatSinkPtr disk_sink;
-
+
if (normalize) {
disk_sink = boost::dynamic_pointer_cast<FloatSink> (normalizer);
normalizer->pipe_to (file_sinks[0]);
} else {
disk_sink = file_sinks[0];
}
-
+
if (split_files) {
-
+
/* Get buffers for each channel separately */
-
+
std::vector<float *> chan_bufs;
-
+
for (uint32_t i = 0; i < channels; ++i) {
chan_bufs.push_back(new float[buffer_size]);
}
-
+
/* de-interleave and write files */
-
+
while ((frames_read = temp_file->read (buf, buffer_size)) > 0) {
for (uint32_t channel = 0; channel < channels; ++channel) {
for (uint32_t i = 0; i < buffer_size; ++i) {
@@ -257,33 +257,33 @@ ExportProcessor::write_files ()
}
disk_sink->write (chan_bufs[channel], frames_read);
}
-
+
if (status->aborted()) { break; }
temp_file_position += frames_read;
status->progress = (float) temp_file_position / temp_file_length;
}
-
+
/* Clean up */
-
+
for (std::vector<float *>::iterator it = chan_bufs.begin(); it != chan_bufs.end(); ++it) {
delete[] *it;
}
-
+
} else {
while ((frames_read = temp_file->read (buf, buffer_size)) > 0) {
disk_sink->write (buf, frames_read);
-
+
if (status->aborted()) { break; }
temp_file_position += frames_read;
status->progress = (float) temp_file_position / temp_file_length;
}
}
-
+
delete [] buf;
-
+
/* Tag files if necessary and send exported signal */
-
-
+
+
for (FileWriterList::iterator it = writer_list.begin(); it != writer_list.end(); ++it) {
if (tag) {
AudiofileTagger::tag_file ((*it)->filename(), session.metadata());
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc
index 6e6d2ea290..2b1b15dbce 100644
--- a/libs/ardour/export_profile_manager.cc
+++ b/libs/ardour/export_profile_manager.cc
@@ -63,21 +63,21 @@ ExportProfileManager::ExportProfileManager (Session & s) :
export_config_dir = user_config_directory();
export_config_dir /= "export";
search_path += export_config_dir;
-
+
search_path += ardour_search_path().add_subdirectory_to_paths("export");
search_path += system_config_search_path().add_subdirectory_to_paths("export");;
-
+
/* create export config directory if necessary */
if (!sys::exists (export_config_dir)) {
sys::create_directory (export_config_dir);
}
-
+
load_presets ();
load_formats ();
-
+
/* Initialize all lists with an empty config */
-
+
XMLNodeList dummy;
init_timespans (dummy);
init_channel_configs (dummy);
@@ -88,7 +88,7 @@ ExportProfileManager::ExportProfileManager (Session & s) :
ExportProfileManager::~ExportProfileManager ()
{
if (single_range_mode) { return; }
-
+
XMLNode * instant_xml (new XMLNode ("ExportProfile"));
serialize_profile (*instant_xml);
session.add_instant_xml (*instant_xml, false);
@@ -111,15 +111,15 @@ ExportProfileManager::prepare_for_export ()
{
ChannelConfigPtr channel_config = channel_configs.front()->config;
TimespanListPtr ts_list = timespans.front()->timespans;
-
+
FormatStateList::const_iterator format_it;
FilenameStateList::const_iterator filename_it;
-
+
for (TimespanList::iterator ts_it = ts_list->begin(); ts_it != ts_list->end(); ++ts_it) {
for (format_it = formats.begin(), filename_it = filenames.begin();
format_it != formats.end() && filename_it != filenames.end();
++format_it, ++filename_it) {
-
+
// filename->include_timespan = (ts_list->size() > 1); Disabled for now...
handler->add_export_config (*ts_it, channel_config, (*format_it)->format, (*filename_it)->filename);
}
@@ -138,13 +138,13 @@ ExportProfileManager::load_preset (PresetPtr preset)
if ((state = preset->get_local_state())) {
set_local_state (*state);
} else { ok = false; }
-
+
if ((state = preset->get_global_state())) {
if (!set_global_state (*state)) {
ok = false;
}
} else { ok = false; }
-
+
return ok;
}
@@ -167,7 +167,7 @@ ExportProfileManager::save_preset (string const & name)
current_preset.reset (new ExportPreset (filename, session));
preset_list.push_back (current_preset);
}
-
+
XMLNode * global_preset = new XMLNode ("ExportPreset");
XMLNode * local_preset = new XMLNode ("ExportPreset");
@@ -177,9 +177,9 @@ ExportProfileManager::save_preset (string const & name)
current_preset->set_name (name);
current_preset->set_global_state (*global_preset);
current_preset->set_local_state (*local_preset);
-
+
current_preset->save (filename);
-
+
return current_preset;
}
@@ -200,7 +200,7 @@ ExportProfileManager::remove_preset ()
sys::remove (it->second);
preset_file_map.erase (it);
}
-
+
current_preset->remove_local();
current_preset.reset();
}
@@ -209,9 +209,9 @@ void
ExportProfileManager::load_preset_from_disk (PBD::sys::path const & path)
{
PresetPtr preset (new ExportPreset (path.to_string(), session));
-
+
/* Handle id to filename mapping and don't add duplicates to list */
-
+
FilePair pair (preset->id(), path);
if (preset_file_map.insert (pair).second) {
preset_list.push_back (preset);
@@ -263,7 +263,7 @@ ExportProfileManager::serialize_local_profile (XMLNode & root)
for (TimespanStateList::iterator it = timespans.begin(); it != timespans.end(); ++it) {
root.add_child_nocopy (serialize_timespan (*it));
}
-
+
for (ChannelConfigStateList::iterator it = channel_configs.begin(); it != channel_configs.end(); ++it) {
root.add_child_nocopy ((*it)->config->get_state());
}
@@ -291,7 +291,7 @@ ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
} else {
selection_range.reset();
}
-
+
for (TimespanStateList::iterator it = timespans.begin(); it != timespans.end(); ++it) {
(*it)->selection_range = selection_range;
}
@@ -301,13 +301,13 @@ std::string
ExportProfileManager::set_single_range (nframes_t start, nframes_t end, Glib::ustring name)
{
single_range_mode = true;
-
+
single_range.reset (new Location());
single_range->set_name (name);
single_range->set (start, end);
-
+
update_ranges ();
-
+
return single_range->id().to_s();
}
@@ -316,7 +316,7 @@ ExportProfileManager::init_timespans (XMLNodeList nodes)
{
timespans.clear ();
update_ranges ();
-
+
bool ok = true;
for (XMLNodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
TimespanStatePtr span = deserialize_timespan (**it);
@@ -324,13 +324,13 @@ ExportProfileManager::init_timespans (XMLNodeList nodes)
timespans.push_back (span);
} else { ok = false; }
}
-
+
if (timespans.empty()) {
TimespanStatePtr timespan (new TimespanState (session_range, selection_range, ranges));
timespans.push_back (timespan);
return false;
}
-
+
return ok;
}
@@ -339,14 +339,14 @@ ExportProfileManager::deserialize_timespan (XMLNode & root)
{
TimespanStatePtr state (new TimespanState (session_range, selection_range, ranges));
XMLProperty const * prop;
-
+
XMLNodeList spans = root.children ("Range");
for (XMLNodeList::iterator node_it = spans.begin(); node_it != spans.end(); ++node_it) {
-
+
prop = (*node_it)->property ("id");
if (!prop) { continue; }
ustring id = prop->value();
-
+
for (LocationList::iterator it = ranges->begin(); it != ranges->end(); ++it) {
if ((!id.compare ("session") && *it == session_range.get()) ||
(!id.compare ("selection") && *it == selection_range.get()) ||
@@ -359,11 +359,11 @@ ExportProfileManager::deserialize_timespan (XMLNode & root)
}
}
}
-
+
if ((prop = root.property ("format"))) {
state->time_format = (TimeFormat) string_2_enum (prop->value(), TimeFormat);
}
-
+
return state;
}
@@ -372,24 +372,24 @@ ExportProfileManager::serialize_timespan (TimespanStatePtr state)
{
XMLNode & root = *(new XMLNode ("ExportTimespan"));
XMLNode * span;
-
+
update_ranges ();
-
+
for (TimespanList::iterator it = state->timespans->begin(); it != state->timespans->end(); ++it) {
if ((span = root.add_child ("Range"))) {
span->add_property ("id", (*it)->range_id());
}
}
-
+
root.add_property ("format", enum_2_string (state->time_format));
-
+
return root;
}
void
ExportProfileManager::update_ranges () {
ranges->clear();
-
+
if (single_range_mode) {
ranges->push_back (single_range.get());
return;
@@ -400,15 +400,15 @@ ExportProfileManager::update_ranges () {
session_range->set_name (_("Session"));
session_range->set (session.current_start_frame(), session.current_end_frame());
ranges->push_back (session_range.get());
-
+
/* Selection */
-
+
if (selection_range) {
ranges->push_back (selection_range.get());
}
-
+
/* ranges */
-
+
LocationList const & list (session.locations()->list());
for (LocationList::const_iterator it = list.begin(); it != list.end(); ++it) {
if ((*it)->is_range_marker()) {
@@ -422,18 +422,18 @@ ExportProfileManager::init_channel_configs (XMLNodeList nodes)
{
channel_configs.clear();
- if (nodes.empty()) {
+ if (nodes.empty()) {
ChannelConfigStatePtr config (new ChannelConfigState (handler->add_channel_config()));
channel_configs.push_back (config);
return false;
}
-
+
for (XMLNodeList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
ChannelConfigStatePtr config (new ChannelConfigState (handler->add_channel_config()));
config->config->set_state (**it);
channel_configs.push_back (config);
}
-
+
return true;
}
@@ -468,46 +468,46 @@ ExportProfileManager::save_format_to_disk (FormatPtr format)
Glib::ustring new_name = format->name();
new_name += export_format_suffix;
-
+
sys::path new_path (export_config_dir);
new_path /= new_name;
/* Check if format is on disk already */
FileMap::iterator it;
if ((it = format_file_map.find (format->id())) != format_file_map.end()) {
-
+
/* Check if config is not in user config dir */
if (it->second.branch_path().to_string().compare (export_config_dir.to_string())) {
-
+
/* Write new file */
-
+
XMLTree tree (new_path.to_string());
tree.set_root (&format->get_state());
tree.write();
-
+
} else {
-
+
/* Update file and rename if necessary */
-
+
XMLTree tree (it->second.to_string());
tree.set_root (&format->get_state());
tree.write();
-
+
if (new_name.compare (it->second.leaf())) {
sys::rename (it->second, new_path);
}
}
-
+
it->second = new_path;
-
+
} else {
/* Write new file */
-
+
XMLTree tree (new_path.to_string());
tree.set_root (&format->get_state());
tree.write();
}
-
+
FormatListChanged ();
return new_path;
}
@@ -527,13 +527,13 @@ ExportProfileManager::remove_format_profile (FormatPtr format)
sys::remove (it->second);
format_file_map.erase (it);
}
-
+
FormatListChanged ();
}
ExportProfileManager::FormatPtr
ExportProfileManager::get_new_format (FormatPtr original)
-{
+{
FormatPtr format;
if (original) {
format.reset (new ExportFormatSpecification (*original));
@@ -541,14 +541,14 @@ ExportProfileManager::get_new_format (FormatPtr original)
format = handler->add_format();
format->set_name ("empty format");
}
-
+
sys::path path = save_format_to_disk (format);
FilePair pair (format->id(), path);
format_file_map.insert (pair);
-
+
format_list->push_back (format);
FormatListChanged ();
-
+
return format;
}
@@ -564,13 +564,13 @@ ExportProfileManager::init_formats (XMLNodeList nodes)
formats.push_back (format);
} else { ok = false; }
}
-
+
if (formats.empty ()) {
FormatStatePtr format (new FormatState (format_list, FormatPtr ()));
formats.push_back (format);
return false;
}
-
+
return ok;
}
@@ -579,11 +579,11 @@ ExportProfileManager::deserialize_format (XMLNode & root)
{
XMLProperty * prop;
UUID id;
-
+
if ((prop = root.property ("id"))) {
id = prop->value();
}
-
+
for (FormatList::iterator it = format_list->begin(); it != format_list->end(); ++it) {
if ((*it)->id() == id) {
return FormatStatePtr (new FormatState (format_list, *it));
@@ -597,10 +597,10 @@ XMLNode &
ExportProfileManager::serialize_format (FormatStatePtr state)
{
XMLNode * root = new XMLNode ("ExportFormat");
-
+
string id = state->format ? state->format->id().to_s() : "";
root->add_property ("id", id);
-
+
return *root;
}
@@ -619,14 +619,14 @@ ExportProfileManager::load_format_from_disk (PBD::sys::path const & path)
{
XMLTree const tree (path.to_string());
FormatPtr format = handler->add_format (*tree.root());
-
+
/* Handle id to filename mapping and don't add duplicates to list */
-
+
FilePair pair (format->id(), path);
if (format_file_map.insert (pair).second) {
format_list->push_back (format);
}
-
+
FormatListChanged ();
}
@@ -659,13 +659,13 @@ ExportProfileManager::init_filenames (XMLNodeList nodes)
filename->set_state (**it);
filenames.push_back (FilenameStatePtr (new FilenameState (filename)));
}
-
+
if (filenames.empty()) {
FilenameStatePtr filename (new FilenameState (handler->add_filename()));
filenames.push_back (filename);
return false;
}
-
+
return true;
}
@@ -676,26 +676,26 @@ ExportProfileManager::get_warnings ()
ChannelConfigStatePtr channel_config_state = channel_configs.front();
TimespanStatePtr timespan_state = timespans.front();
-
+
/*** Check "global" config ***/
-
+
TimespanListPtr timespans = timespan_state->timespans;
ChannelConfigPtr channel_config = channel_config_state->config;
/* Check Timespans are not empty */
-
+
if (timespans->empty()) {
warnings->errors.push_back (_("No timespan has been selected!"));
}
/* Check channel config ports */
-
+
if (!channel_config->all_channels_have_ports ()) {
warnings->warnings.push_back (_("Some channels are empty"));
}
-
+
/*** Check files ***/
-
+
FormatStateList::const_iterator format_it;
FilenameStateList::const_iterator filename_it;
for (format_it = formats.begin(), filename_it = filenames.begin();
@@ -703,7 +703,7 @@ ExportProfileManager::get_warnings ()
++format_it, ++filename_it) {
check_config (warnings, timespan_state, channel_config_state, *format_it, *filename_it);
}
-
+
return warnings;
}
@@ -733,32 +733,32 @@ ExportProfileManager::check_config (boost::shared_ptr<Warnings> warnings,
format->channel_limit(),
channel_config->get_n_chans()));
}
-
+
if (!warnings->errors.empty()) { return; }
-
+
/* Check filenames */
-
+
// filename->include_timespan = (timespans->size() > 1); Disabled for now...
-
+
for (std::list<TimespanPtr>::iterator timespan_it = timespans->begin(); timespan_it != timespans->end(); ++timespan_it) {
filename->set_timespan (*timespan_it);
-
+
if (channel_config->get_split()) {
filename->include_channel = true;
-
+
for (uint32_t chan = 1; chan <= channel_config->get_n_chans(); ++chan) {
filename->set_channel (chan);
-
+
Glib::ustring path = filename->get_path (format);
-
+
if (sys::exists (sys::path (path))) {
warnings->conflicting_filenames.push_back (path);
}
}
-
+
} else {
Glib::ustring path = filename->get_path (format);
-
+
if (sys::exists (sys::path (path))) {
warnings->conflicting_filenames.push_back (path);
}
diff --git a/libs/ardour/export_status.cc b/libs/ardour/export_status.cc
index c575ee79be..eb0a3504b4 100644
--- a/libs/ardour/export_status.cc
+++ b/libs/ardour/export_status.cc
@@ -36,16 +36,16 @@ ExportStatus::init ()
_aborted = false;
_finished = false;
_errors = false;
-
+
stage = export_None;
progress = 0.0;
-
+
total_timespans = 0;
timespan = 0;
-
+
total_channel_configs = 0;
channel_config = 0;
-
+
total_formats = 0;
format = 0;
}
diff --git a/libs/ardour/export_timespan.cc b/libs/ardour/export_timespan.cc
index 60654cf06a..d638c84b16 100644
--- a/libs/ardour/export_timespan.cc
+++ b/libs/ardour/export_timespan.cc
@@ -64,7 +64,7 @@ ExportTimespan::get_data (float * data, nframes_t frames, ExportChannelPtr chann
if (it == filemap.end()) {
throw ExportFailed (X_("Trying to get data from ExportTimespan for channel that was never registered!"));
}
-
+
return it->second->read (data, frames);
}
@@ -84,26 +84,26 @@ ExportTimespan::process (nframes_t frames)
/* update position */
nframes_t frames_to_read;
-
+
if (position + frames <= end_frame) {
frames_to_read = frames;
} else {
frames_to_read = end_frame - position;
status->stop = true;
}
-
+
position += frames_to_read;
status->progress = (float) (position - start_frame) / (end_frame - start_frame);
/* Read channels from ports and save to tempfiles */
float * data = new float[frames_to_read];
-
+
for (TempFileMap::iterator it = filemap.begin(); it != filemap.end(); ++it) {
it->first->read (data, frames_to_read);
it->second->write (data, frames_to_read);
}
-
+
delete [] data;
return 0;
diff --git a/libs/ardour/export_utilities.cc b/libs/ardour/export_utilities.cc
index dcc43c8a7f..a91912359e 100644
--- a/libs/ardour/export_utilities.cc
+++ b/libs/ardour/export_utilities.cc
@@ -24,7 +24,7 @@
#include <cmath>
#undef _ISOC99_SOURCE
#undef _ISOC9X_SOURCE
-#undef __USE_SVID
+#undef __USE_SVID
#define __USE_SVID 1
#include <cstdlib>
#undef __USE_SVID
@@ -68,14 +68,14 @@ SampleRateConverter::SampleRateConverter (uint32_t channels, nframes_t in_rate,
active = false;
return;
}
-
+
active = true;
int err;
if ((src_state = src_new (quality, channels, &err)) == 0) {
throw ExportFailed (string_compose (X_("Cannot initialize sample rate conversion: %1"), src_strerror (err)));
}
-
+
src_data.src_ratio = out_rate / (double) in_rate;
}
@@ -101,7 +101,7 @@ SampleRateConverter::process (float * data, nframes_t frames)
}
/* Manage memory */
-
+
nframes_t out_samples_max = (nframes_t) ceil (frames * src_data.src_ratio * channels);
if (data_out_size < out_samples_max) {
@@ -109,13 +109,13 @@ SampleRateConverter::process (float * data, nframes_t frames)
data_out = new float[out_samples_max];
src_data.data_out = data_out;
-
+
max_leftover_frames = 4 * frames;
leftover_data = (float *) realloc (leftover_data, max_leftover_frames * channels * sizeof (float));
if (!leftover_data) {
throw ExportFailed (X_("A memory allocation error occured during sample rate conversion"));
}
-
+
data_out_size = out_samples_max;
}
@@ -127,7 +127,7 @@ SampleRateConverter::process (float * data, nframes_t frames)
int err;
int cnt = 0;
nframes_t frames_out_total = 0;
-
+
do {
src_data.output_frames = out_samples_max / channels;
src_data.end_of_input = end_of_input;
@@ -140,13 +140,13 @@ SampleRateConverter::process (float * data, nframes_t frames)
src_data.data_in = leftover_data;
if (cnt == 0) {
-
+
/* first time, append new data from data_in into the leftover_data buffer */
memcpy (leftover_data + (leftover_frames * channels), data_in, frames_in * channels * sizeof(float));
src_data.input_frames = frames_in + leftover_frames;
} else {
-
+
/* otherwise, just use whatever is still left in leftover_data; the contents
were adjusted using memmove() right after the last SRC call (see
below)
@@ -154,7 +154,7 @@ SampleRateConverter::process (float * data, nframes_t frames)
src_data.input_frames = leftover_frames;
}
-
+
} else {
src_data.data_in = data_in;
@@ -167,7 +167,7 @@ SampleRateConverter::process (float * data, nframes_t frames)
if ((err = src_process (src_state, &src_data)) != 0) {
throw ExportFailed (string_compose ("An error occured during sample rate conversion: %1", src_strerror (err)));
}
-
+
frames_out = src_data.output_frames_gen;
leftover_frames = src_data.input_frames - src_data.input_frames_used;
@@ -179,14 +179,14 @@ SampleRateConverter::process (float * data, nframes_t frames)
memmove (leftover_data, (char *) (src_data.data_in + (src_data.input_frames_used * channels)),
leftover_frames * channels * sizeof(float));
}
-
-
+
+
nframes_t frames_written = piped_to->write (data_out, frames_out);
frames_out_total += frames_written;
} while (leftover_frames > frames_in);
-
+
return frames_out_total;
}
@@ -204,7 +204,7 @@ SampleFormatConverter<TOut>::SampleFormatConverter (uint32_t channels, ExportFor
if (data_width != 24) {
data_width = sizeof (TOut) * 8;
}
-
+
GDitherSize dither_size = GDitherFloat;
switch (data_width) {
@@ -218,7 +218,7 @@ SampleFormatConverter<TOut>::SampleFormatConverter (uint32_t channels, ExportFor
case 24:
dither_size = GDither32bit;
}
-
+
dither = gdither_new ((GDitherType) type, channels, dither_size, data_width);
}
@@ -237,7 +237,7 @@ nframes_t
SampleFormatConverter<TOut>::process (float * data, nframes_t frames)
{
/* Make sure we have enough memory allocated */
-
+
size_t data_size = channels * frames * sizeof (TOut);
if (data_size > data_out_size) {
@@ -246,24 +246,24 @@ SampleFormatConverter<TOut>::process (float * data, nframes_t frames)
data_out = new TOut[data_size];
data_out_size = data_size;
}
-
+
/* Do conversion */
-
+
if (data_width < 32) {
for (uint32_t chn = 0; chn < channels; ++chn) {
gdither_runf (dither, chn, frames, data, data_out);
}
} else {
for (uint32_t chn = 0; chn < channels; ++chn) {
-
+
TOut * ob = data_out;
const double int_max = (float) INT_MAX;
const double int_min = (float) INT_MIN;
-
+
nframes_t i;
for (nframes_t x = 0; x < frames; ++x) {
i = chn + (x * channels);
-
+
if (data[i] > 1.0f) {
ob[i] = static_cast<TOut> (INT_MAX);
} else if (data[i] < -1.0f) {
@@ -278,9 +278,9 @@ SampleFormatConverter<TOut>::process (float * data, nframes_t frames)
}
}
}
-
+
/* Write forward */
-
+
return GraphSinkVertex<float, TOut>::piped_to->write (data_out, frames);
}
@@ -294,10 +294,10 @@ SampleFormatConverter<float>::process (float * data, nframes_t frames)
data[x] = 1.0f;
} else if (data[x] < -1.0f) {
data[x] = -1.0f;
- }
+ }
}
}
-
+
return piped_to->write (data, frames);
}
@@ -311,8 +311,8 @@ Normalizer::Normalizer (uint32_t channels, float target_dB) :
channels (channels),
enabled (false)
{
- target = dB_to_coefficient (target_dB);
-
+ target = dB_to_coefficient (target_dB);
+
if (target == 1.0f) {
/* do not normalize to precisely 1.0 (0 dBFS), to avoid making it appear
that we may have clipped.
@@ -328,7 +328,7 @@ Normalizer::~Normalizer ()
void
Normalizer::set_peak (float peak)
-{
+{
if (peak == 0.0f || peak == target) {
/* don't even try */
enabled = false;
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index a8119170de..f5b06ee046 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006-2009 Paul Davis
+ Copyright (C) 2006-2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -99,7 +99,7 @@ FileSource::init (const ustring& pathstr, bool must_exist)
if (_file_is_new && must_exist) {
return -1;
}
-
+
return 0;
}
@@ -142,10 +142,10 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
/* don't move the file across filesystems, just stick it in the
trash_dir_name directory on whichever filesystem it was already on
*/
-
+
ustring newpath;
newpath = Glib::path_get_dirname (_path);
- newpath = Glib::path_get_dirname (newpath);
+ newpath = Glib::path_get_dirname (newpath);
newpath += string(PATH_SEP) + trash_dir_name + PATH_SEP;
newpath += Glib::path_get_basename (_path);
@@ -163,7 +163,7 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
snprintf (buf, sizeof (buf), "%s.%d", newpath.c_str(), ++version);
newpath_v = buf;
}
-
+
if (version == 999) {
PBD::error << string_compose (
_("there are already 1000 files with names like %1; versioning discontinued"),
@@ -185,9 +185,9 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
rename (newpath.c_str(), _path.c_str());
return -1;
}
-
+
_path = newpath;
-
+
/* file can not be removed twice, since the operation is not idempotent */
_flags = Flag (_flags & ~(RemoveAtDestroy|Removable|RemovableIfEmpty));
@@ -195,7 +195,7 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
}
/** Find the actual source file based on \a filename.
- *
+ *
* If the source is embedded, \a filename should be a simple filename (no slashes).
* If the source is external, \a filename should be a full path.
* In either case, found_path is set to the complete absolute path of the source file.
@@ -230,7 +230,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
split (search_path, dirs, ':');
cnt = 0;
-
+
for (vector<ustring>::iterator i = dirs.begin(); i != dirs.end(); ++i) {
fullpath = *i;
if (fullpath[fullpath.length()-1] != '/') {
@@ -242,24 +242,24 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
/* i (paul) made a nasty design error by using ':' as a special character in
Ardour 0.99 .. this hack tries to make things sort of work.
*/
-
+
if ((pos = pathstr.find_last_of (':')) != ustring::npos) {
-
+
if (Glib::file_test (fullpath, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
/* its a real file, no problem */
-
+
keeppath = fullpath;
++cnt;
} else {
-
+
if (must_exist) {
-
+
/* might be an older session using file:channel syntax. see if the version
without the :suffix exists
*/
-
+
ustring shorter = pathstr.substr (0, pos);
fullpath = *i;
@@ -274,12 +274,12 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
pathstr = shorter;
keeppath = fullpath;
++cnt;
- }
-
+ }
+
} else {
-
+
/* new derived file (e.g. for timefx) being created in a newer session */
-
+
}
}
@@ -288,7 +288,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
if (Glib::file_test (fullpath, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
keeppath = fullpath;
++cnt;
- }
+ }
}
}
@@ -322,17 +322,17 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
}
found_path = keeppath;
-
+
ret = true;
} else {
-
+
/* external files and/or very very old style sessions include full paths */
/* ugh, handle ':' situation */
if ((pos = pathstr.find_last_of (':')) != ustring::npos) {
-
+
ustring shorter = pathstr.substr (0, pos);
if (Glib::file_test (shorter, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
@@ -340,38 +340,38 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
pathstr = shorter;
}
}
-
+
found_path = pathstr;
if (!Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
/* file does not exist or we cannot read it */
-
+
if (must_exist) {
error << string_compose(
_("Filesource: cannot find required file (%1): %2"),
path, strerror (errno)) << endmsg;
goto out;
}
-
+
if (errno != ENOENT) {
error << string_compose(
_("Filesource: cannot check for existing file (%1): %2"),
path, strerror (errno)) << endmsg;
goto out;
}
-
+
/* a new file */
isnew = true;
ret = true;
} else {
-
+
/* already exists */
ret = true;
}
}
-
+
out:
return ret;
}
@@ -382,13 +382,13 @@ FileSource::set_source_name (const ustring& newname, bool destructive)
Glib::Mutex::Lock lm (_lock);
ustring oldpath = _path;
ustring newpath = Session::change_source_path_by_name (oldpath, _name, newname, destructive);
-
+
if (newpath.empty()) {
error << string_compose (_("programming error: %1"), "cannot generate a changed file path") << endmsg;
return -1;
}
- // Test whether newpath exists, if yes notify the user but continue.
+ // Test whether newpath exists, if yes notify the user but continue.
if (access(newpath.c_str(),F_OK) == 0) {
error << _("Programming error! Ardour tried to rename a file over another file! It's safe to continue working, but please report this to the developers.") << endmsg;
return -1;
diff --git a/libs/ardour/filename_extensions.cc b/libs/ardour/filename_extensions.cc
index c30483456e..c09a8c481c 100644
--- a/libs/ardour/filename_extensions.cc
+++ b/libs/ardour/filename_extensions.cc
@@ -3,7 +3,7 @@
#include <stdint.h>
#include "i18n.h"
-namespace ARDOUR {
+namespace ARDOUR {
const char* const template_suffix = X_(".template");
const char* const statefile_suffix = X_(".ardour");
diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc
index 7372c467a6..2f2afe3c7b 100644
--- a/libs/ardour/filesystem_paths.cc
+++ b/libs/ardour/filesystem_paths.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc
index 88a6e1d253..53a28c8691 100644
--- a/libs/ardour/filter.cc
+++ b/libs/ardour/filter.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004-2007 Paul Davis
+ Copyright (C) 2004-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
PBD::basename_nosuffix (names[i]), string (""));
if (path.length() == 0) {
- error << string_compose (_("filter: error creating name for new file based on %1"), region->name())
+ error << string_compose (_("filter: error creating name for new file based on %1"), region->name())
<< endmsg;
return -1;
}
@@ -72,7 +72,7 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
SourceFactory::createWritable (region->data_type(), session,
path, true,
false, session.frame_rate())));
- }
+ }
catch (failed_constructor& err) {
error << string_compose (_("filter: error creating new file %1 (%2)"), path, strerror (errno)) << endmsg;
@@ -102,15 +102,15 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
afs->update_header (region->position(), *now, xnow);
afs->mark_immutable ();
}
-
+
boost::shared_ptr<SMFSource> smfs = boost::dynamic_pointer_cast<SMFSource>(*si);
if (smfs) {
smfs->set_timeline_position (region->position());
smfs->flush ();
}
-
+
/* now that there is data there, requeue the file for analysis */
-
+
Analyser::queue_source_for_analysis (*si, false);
}
@@ -121,7 +121,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
}
results.clear ();
- boost::shared_ptr<Region> r = RegionFactory::create (nsrcs, 0, region->length(), region_name, 0,
+ boost::shared_ptr<Region> r = RegionFactory::create (nsrcs, 0, region->length(), region_name, 0,
Region::Flag (Region::WholeFile|Region::DefaultFlags));
r->set_position (region->position(), 0);
@@ -131,7 +131,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
audio_r->set_scale_amplitude (audio_region->scale_amplitude());
}
results.push_back (r);
-
+
return 0;
}
diff --git a/libs/ardour/find_session.cc b/libs/ardour/find_session.cc
index e28bbe9ccb..a572a9a7a3 100644
--- a/libs/ardour/find_session.cc
+++ b/libs/ardour/find_session.cc
@@ -31,7 +31,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
}
str = buf;
-
+
/* check to see if it exists, and what it is */
if (stat (str.c_str(), &statbuf)) {
@@ -54,9 +54,9 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
if (S_ISDIR (statbuf.st_mode)) {
string::size_type slash = str.find_last_of ('/');
-
+
if (slash == string::npos) {
-
+
/* a subdirectory of cwd, so statefile should be ... */
string tmp;
@@ -66,7 +66,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
tmp += statefile_suffix;
/* is it there ? */
-
+
if (stat (tmp.c_str(), &statbuf)) {
error << string_compose (_("cannot check statefile %1 (%2)"), tmp, strerror (errno))
<< endmsg;
@@ -85,16 +85,16 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
path = str;
snapshot = str.substr (slash+1);
-
+
}
} else if (S_ISREG (statbuf.st_mode)) {
-
+
string::size_type slash = str.find_last_of ('/');
string::size_type suffix;
/* remove the suffix */
-
+
if (slash != string::npos) {
snapshot = str.substr (slash+1);
} else {
@@ -102,7 +102,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
}
suffix = snapshot.find (statefile_suffix);
-
+
if (suffix == string::npos) {
error << string_compose (_("%1 is not an Ardour snapshot file"), str) << endmsg;
return -1;
@@ -111,10 +111,10 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
/* remove suffix */
snapshot = snapshot.substr (0, suffix);
-
+
if (slash == string::npos) {
-
- /* we must be in the directory where the
+
+ /* we must be in the directory where the
statefile lives. get it using cwd().
*/
@@ -134,7 +134,7 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
path = str.substr (0, slash);
}
-
+
} else {
/* what type of file is it? */
@@ -151,14 +151,14 @@ ARDOUR::find_session (string str, string& path, string& snapshot, bool& isnew)
string::size_type slash = str.find_last_of ('/');
if (slash == string::npos) {
-
+
/* no slash, just use the name, but clean it up */
-
+
path = legalize_for_path (str);
snapshot = path;
-
+
} else {
-
+
path = str;
snapshot = str.substr (slash+1);
}
diff --git a/libs/ardour/gain.cc b/libs/ardour/gain.cc
index cf38050063..6f2161f578 100644
--- a/libs/ardour/gain.cc
+++ b/libs/ardour/gain.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/gdither.cc b/libs/ardour/gdither.cc
index 7ad9bebd6d..f09e06edc2 100644
--- a/libs/ardour/gdither.cc
+++ b/libs/ardour/gdither.cc
@@ -35,7 +35,7 @@
#include <math.h>
#endif
-#undef __USE_SVID
+#undef __USE_SVID
#define __USE_SVID 1
#ifdef __cplusplus
#include <cstdlib>
@@ -163,13 +163,13 @@ void gdither_free(GDither s)
}
}
-inline static void gdither_innner_loop(const GDitherType dt,
- const uint32_t stride, const float bias, const float scale,
+inline static void gdither_innner_loop(const GDitherType dt,
+ const uint32_t stride, const float bias, const float scale,
- const uint32_t post_scale, const int bit_depth,
- const uint32_t channel, const uint32_t length, float *ts,
+ const uint32_t post_scale, const int bit_depth,
+ const uint32_t channel, const uint32_t length, float *ts,
- GDitherShapedState *ss, float *x, void *y, const int clamp_u,
+ GDitherShapedState *ss, float *x, void *y, const int clamp_u,
const int clamp_l)
{
@@ -216,7 +216,7 @@ inline static void gdither_innner_loop(const GDitherType dt,
ss->buffer[ss->phase] = (float)lrintf(tmp) - ideal;
break;
}
-
+
clamped = lrintf(tmp);
if (clamped > clamp_u) {
clamped = clamp_u;
@@ -239,13 +239,13 @@ inline static void gdither_innner_loop(const GDitherType dt,
}
/* floating pint version of the inner loop function */
-inline static void gdither_innner_loop_fp(const GDitherType dt,
- const uint32_t stride, const float bias, const float scale,
+inline static void gdither_innner_loop_fp(const GDitherType dt,
+ const uint32_t stride, const float bias, const float scale,
- const float post_scale, const int bit_depth,
- const uint32_t channel, const uint32_t length, float *ts,
+ const float post_scale, const int bit_depth,
+ const uint32_t channel, const uint32_t length, float *ts,
- GDitherShapedState *ss, float *x, void *y, const int clamp_u,
+ GDitherShapedState *ss, float *x, void *y, const int clamp_u,
const int clamp_l)
{
@@ -291,7 +291,7 @@ inline static void gdither_innner_loop_fp(const GDitherType dt,
ss->buffer[ss->phase] = (float)lrintf(tmp) - ideal;
break;
}
-
+
clamped = rintf(tmp);
if (clamped > clamp_u) {
clamped = clamp_u;
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 4d6498654f..acd7da1bc5 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -182,17 +182,17 @@ ARDOUR::setup_midi ()
<< endmsg;
return 0;
}
-
+
if (default_mtc_port == 0) {
warning << string_compose (_("No MTC support (MIDI port \"%1\" not available)"), Config->get_mtc_port_name())
<< endmsg;
- }
+ }
if (default_midi_port == 0) {
warning << string_compose (_("No MIDI parameter support (MIDI port \"%1\" not available)"), Config->get_midi_port_name())
<< endmsg;
- }
+ }
if (default_midi_clock_port == 0) {
warning << string_compose (_("No MIDI Clock support (MIDI port \"%1\" not available)"), Config->get_midi_clock_port_name())
@@ -438,7 +438,7 @@ ARDOUR::find_bindings_files (map<string,string>& files)
}
bool
-ARDOUR::no_auto_connect()
+ARDOUR::no_auto_connect()
{
return getenv ("ARDOUR_NO_AUTOCONNECT") != 0;
}
@@ -569,7 +569,7 @@ ARDOUR::coverage (nframes_t sa, nframes_t ea,
/*
|---------------------| A
|----------------- B
- |----------------------- B
+ |----------------------- B
|- B
"B overlaps the end of A"
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index f98e42d051..94d26ed4da 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -80,15 +80,15 @@ open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQua
#ifdef USE_COREAUDIO_FOR_FILE_IO
/* see if we can use CoreAudio to handle the IO */
-
- try {
+
+ try {
CAImportableSource* src = new CAImportableSource(path);
boost::shared_ptr<CAImportableSource> source (src);
-
+
if (source->samplerate() == samplerate) {
return source;
}
-
+
/* rewrap as a resampled source */
return boost::shared_ptr<ImportableSource>(new ResampledImportableSource(source, samplerate, quality));
@@ -97,26 +97,26 @@ open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQua
catch (...) {
/* fall back to SndFile */
-#endif
+#endif
#endif
- try {
+ try {
boost::shared_ptr<SndFileImportableSource> source(new SndFileImportableSource(path));
-
+
if (source->samplerate() == samplerate) {
return source;
}
-
+
/* rewrap as a resampled source */
-
+
return boost::shared_ptr<ImportableSource>(new ResampledImportableSource(source, samplerate, quality));
}
-
+
catch (...) {
throw; // rethrow
}
-
-#ifdef HAVE_COREAUDIO
+
+#ifdef HAVE_COREAUDIO
#ifdef USE_COREAUDIO_FOR_FILE_IO
}
#endif
@@ -144,7 +144,7 @@ get_non_existent_filename (DataType type, const bool allow_replacing, const std:
} else {
snprintf (buf, sizeof(buf), "%s.%s", base.c_str(), ext);
}
-
+
string tempname = destdir + "/" + buf;
if (!allow_replacing && Glib::file_test (tempname, Glib::FILE_TEST_EXISTS)) {
@@ -183,7 +183,7 @@ get_paths_for_new_sources (const bool allow_replacing, const string& import_file
? sdir.midi_path().to_string() : sdir.sound_path().to_string();
filepath += '/';
- filepath += get_non_existent_filename (type, allow_replacing, filepath, basename, n, channels);
+ filepath += get_non_existent_filename (type, allow_replacing, filepath, basename, n, channels);
new_paths.push_back (filepath);
}
@@ -223,7 +223,7 @@ create_mono_sources_for_writing (const vector<string>& new_paths, Session& sess,
{
const DataType type = ((*i).rfind(".mid") != string::npos)
? DataType::MIDI : DataType::AUDIO;
-
+
source = SourceFactory::createWritable (type, sess,
i->c_str(), true,
false, // destructive
@@ -255,7 +255,7 @@ compose_status_message (const string& path,
current_file, total_files);
}
- return string_compose (_("copying %1\n(%2 of %3)"),
+ return string_compose (_("copying %1\n(%2 of %3)"),
Glib::path_get_basename (path),
current_file, total_files);
}
@@ -274,7 +274,7 @@ write_audio_data_to_new_files (ImportableSource* source, Session::ImportStatus&
for (uint n = 0; n < channels; ++n) {
channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes]));
}
-
+
uint read_count = 0;
status.progress = 0.0f;
@@ -326,13 +326,13 @@ write_midi_data_to_new_files (Evoral::SMF* source, Session::ImportStatus& status
for (unsigned i = 1; i <= source->num_tracks(); ++i) {
boost::shared_ptr<SMFSource> smfs = boost::dynamic_pointer_cast<SMFSource>(newfiles[i-1]);
smfs->drop_model();
-
+
source->seek_to_track(i);
-
+
uint64_t t = 0;
uint32_t delta_t = 0;
uint32_t size = 0;
-
+
while (!status.cancel) {
size = buf_size;
@@ -343,7 +343,7 @@ write_midi_data_to_new_files (Evoral::SMF* source, Session::ImportStatus& status
if (ret < 0) { // EOT
break;
}
-
+
t += delta_t;
if (ret == 0) { // Meta
@@ -403,7 +403,7 @@ Session::import_audiofiles (ImportStatus& status)
{
boost::shared_ptr<ImportableSource> source;
std::auto_ptr<Evoral::SMF> smf_reader;
- const DataType type = ((*p).rfind(".mid") != string::npos) ?
+ const DataType type = ((*p).rfind(".mid") != string::npos) ?
DataType::MIDI : DataType::AUDIO;
if (type == DataType::AUDIO) {
@@ -476,14 +476,14 @@ Session::import_audiofiles (ImportStatus& status)
if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(*x)) != 0) {
afs->update_header(0, *now, xnow);
afs->done_with_peakfile_writes ();
-
+
/* now that there is data there, requeue the file for analysis */
-
+
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
}
}
-
+
/* don't create tracks for empty MIDI sources (channels) */
if ((smfs = boost::dynamic_pointer_cast<SMFSource>(*x)) != 0 && smfs->is_empty()) {
diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc
index 807582c379..b9efaf9a18 100644
--- a/libs/ardour/internal_return.cc
+++ b/libs/ardour/internal_return.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ InternalReturn::configure_io (ChanCount in, ChanCount out)
return true;
}
-void
+void
InternalReturn::set_block_size (nframes_t nframes)
{
allocate_buffers (nframes);
@@ -136,7 +136,7 @@ InternalReturn::set_state (const XMLNode& node)
return Return::set_state (node);
}
-bool
+bool
InternalReturn::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
{
out = in;
@@ -146,5 +146,5 @@ InternalReturn::can_support_io_configuration (const ChanCount& in, ChanCount& ou
bool
InternalReturn::visible () const
{
- return false;
+ return false;
}
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index ad56622fc7..7d1f316c78 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, boost:
}
set_name (sendto->name());
-
+
_send_to->GoingAway.connect (mem_fun (*this, &InternalSend::send_to_going_away));
}
@@ -79,16 +79,16 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
// we have to copy the input, because we may alter the buffers with the amp
// in-place, which a send must never do.
-
+
assert(mixbufs.available() >= bufs.count());
mixbufs.read_from (bufs, nframes);
-
+
/* gain control */
gain_t tgain = target_gain ();
-
+
if (tgain != _current_gain) {
-
+
/* target gain has changed */
Amp::apply_gain (mixbufs, nframes, _current_gain, tgain);
@@ -109,7 +109,7 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
Amp::apply_simple_gain (mixbufs, nframes, tgain);
}
-
+
// Can't automate gain for sends or returns yet because we need different buffers
// so that we don't overwrite the main automation data for the route amp
// _amp->setup_gain_automation (start_frame, end_frame, nframes);
@@ -119,7 +119,7 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
/* XXX NEED TO PAN */
/* consider metering */
-
+
if (_metering) {
if (_amp->gain_control()->get_value() == 0) {
_meter->reset();
@@ -160,7 +160,7 @@ InternalSend::state (bool full)
if (_send_to) {
node.add_property ("target", _send_to->id().to_s());
}
-
+
return node;
}
@@ -192,7 +192,7 @@ InternalSend::set_state (const XMLNode& node)
connect_when_legal ();
}
}
-
+
return 0;
}
@@ -209,8 +209,8 @@ InternalSend::connect_when_legal ()
if ((_send_to = _session.route_by_id (_send_to_id)) == 0) {
error << X_("cannot find route to connect to") << endmsg;
return -1;
- }
-
+ }
+
if ((target = _send_to->get_return_buffer ()) == 0) {
error << X_("target for internal send has no return buffer") << endmsg;
return -1;
@@ -219,7 +219,7 @@ InternalSend::connect_when_legal ()
return 0;
}
-bool
+bool
InternalSend::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
{
out = in;
@@ -258,5 +258,5 @@ InternalSend::visible () const
return true;
}
- return false;
+ return false;
}
diff --git a/libs/ardour/interpolation.cc b/libs/ardour/interpolation.cc
index 9a45d560c0..79ec82b482 100644
--- a/libs/ardour/interpolation.cc
+++ b/libs/ardour/interpolation.cc
@@ -11,16 +11,16 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
{
// index in the input buffers
nframes_t i = 0;
-
+
double acceleration;
double distance = 0.0;
-
+
if (_speed != _target_speed) {
acceleration = _target_speed - _speed;
} else {
acceleration = 0.0;
}
-
+
distance = phase[channel];
for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
i = floor(distance);
@@ -29,19 +29,19 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
fractional_phase_part -= 1.0;
i++;
}
-
+
if (input && output) {
// Linearly interpolate into the output buffer
- output[outsample] =
+ output[outsample] =
input[i] * (1.0f - fractional_phase_part) +
input[i+1] * fractional_phase_part;
}
distance += _speed + acceleration;
}
-
+
i = floor(distance);
phase[channel] = distance - floor(distance);
-
+
return i;
}
@@ -50,16 +50,16 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
{
// index in the input buffers
nframes_t i = 0;
-
+
double acceleration;
double distance = 0.0;
-
+
if (_speed != _target_speed) {
acceleration = _target_speed - _speed;
} else {
acceleration = 0.0;
}
-
+
distance = phase[channel];
for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
i = floor(distance);
@@ -68,16 +68,16 @@ CubicInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
fractional_phase_part -= 1.0;
i++;
}
-
+
if (input && output) {
// Cubically interpolate into the output buffer
output[outsample] = cube_interp(fractional_phase_part, input[i-1], input[i], input[i+1], input[i+2]);
}
distance += _speed + acceleration;
}
-
+
i = floor(distance);
phase[channel] = distance - floor(distance);
-
+
return i;
}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 2749b9f405..9811cfed3a 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@
#include <cmath>
/*
- A bug in OS X's cmath that causes isnan() and isinf() to be
+ A bug in OS X's cmath that causes isnan() and isinf() to be
"undeclared". the following works around that
*/
@@ -128,7 +128,7 @@ void
IO::check_bundles (std::vector<UserBundleInfo>& list, const PortSet& ports)
{
std::vector<UserBundleInfo> new_list;
-
+
for (std::vector<UserBundleInfo>::iterator i = list.begin(); i != list.end(); ++i) {
uint32_t const N = i->bundle->nchannels ();
@@ -172,20 +172,20 @@ IO::disconnect (Port* our_port, string other_port, void* src)
return 0;
}
- {
+ {
BLOCK_PROCESS_CALLBACK ();
-
+
{
Glib::Mutex::Lock lm (io_lock);
-
+
/* check that our_port is really one of ours */
-
+
if ( ! _ports.contains(our_port)) {
return -1;
}
-
+
/* disconnect it from the source */
-
+
if (our_port->disconnect (other_port)) {
error << string_compose(_("IO: cannot disconnect port %1 from %2"), our_port->name(), other_port) << endmsg;
return -1;
@@ -210,16 +210,16 @@ IO::connect (Port* our_port, string other_port, void* src)
{
BLOCK_PROCESS_CALLBACK ();
-
+
{
Glib::Mutex::Lock lm (io_lock);
-
+
/* check that our_port is really one of ours */
-
+
if ( ! _ports.contains(our_port) ) {
return -1;
}
-
+
/* connect it to the source */
if (our_port->connect (other_port)) {
@@ -241,7 +241,7 @@ IO::remove_port (Port* port, void* src)
{
BLOCK_PROCESS_CALLBACK ();
-
+
{
Glib::Mutex::Lock lm (io_lock);
@@ -250,7 +250,7 @@ IO::remove_port (Port* port, void* src)
if (port->connected()) {
change = IOChange (change|ConnectionsChanged);
- }
+ }
_session.engine().unregister_port (*port);
check_bundles_connected ();
@@ -291,12 +291,12 @@ IO::add_port (string destination, void* src, DataType type)
{
BLOCK_PROCESS_CALLBACK ();
-
- {
+
+ {
Glib::Mutex::Lock lm (io_lock);
-
+
/* Create a new output port */
-
+
string portname = build_legal_port_name (type);
if (_direction == Input) {
@@ -322,7 +322,7 @@ IO::add_port (string destination, void* src, DataType type)
return -1;
}
}
-
+
// pan_changed (src); /* EMIT SIGNAL */
changed (ConfigurationChanged, src); /* EMIT SIGNAL */
setup_bundles ();
@@ -334,12 +334,12 @@ IO::add_port (string destination, void* src, DataType type)
int
IO::disconnect (void* src)
{
- {
+ {
BLOCK_PROCESS_CALLBACK ();
-
+
{
Glib::Mutex::Lock lm (io_lock);
-
+
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
i->disconnect_all ();
}
@@ -347,9 +347,9 @@ IO::disconnect (void* src)
check_bundles_connected ();
}
}
-
+
changed (ConnectionsChanged, src); /* EMIT SIGNAL */
-
+
return 0;
}
@@ -358,15 +358,15 @@ IO::ensure_ports_locked (ChanCount count, bool clear, void* /*src*/)
{
Port* port = 0;
bool changed = false;
-
+
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
-
+
const size_t n = count.get(*t);
-
+
/* remove unused ports */
for (size_t i = n_ports().get(*t); i > n; --i) {
port = _ports.port(*t, i-1);
-
+
assert(port);
_ports.remove(port);
_session.engine().unregister_port (*port);
@@ -403,13 +403,13 @@ IO::ensure_ports_locked (ChanCount count, bool clear, void* /*src*/)
changed = true;
}
}
-
+
if (changed) {
check_bundles_connected ();
PortCountChanged (n_ports()); /* EMIT SIGNAL */
_session.set_dirty ();
}
-
+
if (clear) {
/* disconnect all existing ports so that we get a fresh start */
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
@@ -483,7 +483,7 @@ IO::state (bool /*full_state*/)
}
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
-
+
vector<string> connections;
XMLNode* pnode = new XMLNode (X_("Port"));
@@ -500,14 +500,14 @@ IO::state (bool /*full_state*/)
to be re-established even when our
client name is different.
*/
-
+
XMLNode* cnode = new XMLNode (X_("Connection"));
cnode->add_property (X_("other"), _session.engine().make_port_name_relative (*ci));
pnode->add_child_nocopy (*cnode);
- }
+ }
}
-
+
node->add_child_nocopy (*pnode);
}
@@ -529,7 +529,7 @@ IO::set_state (const XMLNode& node)
error << string_compose(_("incorrect XML node \"%1\" passed to IO object"), node.name()) << endmsg;
return -1;
}
-
+
if ((prop = node.property ("name")) != 0) {
set_name (prop->value());
}
@@ -552,7 +552,7 @@ IO::set_state (const XMLNode& node)
}
if (connecting_legal) {
-
+
if (make_connections (node)) {
return -1;
}
@@ -577,7 +577,7 @@ IO::connecting_became_legal ()
connection_legal_c.disconnect ();
ret = make_connections (*pending_state_node);
-
+
delete pending_state_node;
pending_state_node = 0;
@@ -590,7 +590,7 @@ IO::find_possible_bundle (const string &desired_name)
static const string digits = "0123456789";
const string &default_name = (_direction == Input ? _("in") : _("out"));
const string &bundle_type_name = (_direction == Input ? _("input") : _("output"));
-
+
boost::shared_ptr<Bundle> c = _session.bundle_by_name (desired_name);
if (!c) {
@@ -604,7 +604,7 @@ IO::find_possible_bundle (const string &desired_name)
// find numeric suffix of desired name
bundle_number = 0;
-
+
last_non_digit_pos = desired_name.find_last_not_of(digits);
if (last_non_digit_pos != string::npos) {
@@ -612,7 +612,7 @@ IO::find_possible_bundle (const string &desired_name)
s << desired_name.substr(last_non_digit_pos);
s >> bundle_number;
}
-
+
// see if it's a stereo connection e.g. "in 3+4"
if (last_non_digit_pos > 1 && desired_name[last_non_digit_pos] == '+') {
@@ -640,22 +640,22 @@ IO::find_possible_bundle (const string &desired_name)
// find highest set bit
mask = 1;
while ((mask <= bundle_number) && (mask <<= 1)) {}
-
- // "wrap" bundle number into largest possible power of 2
+
+ // "wrap" bundle number into largest possible power of 2
// that works...
while (mask) {
if (bundle_number & mask) {
bundle_number &= ~mask;
-
+
stringstream s;
s << default_name << " " << bundle_number + 1;
if (stereo) {
s << "+" << bundle_number + 2;
}
-
+
possible_name = s.str();
if ((c = _session.bundle_by_name (possible_name)) != 0) {
@@ -696,7 +696,7 @@ IO::get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle
}
return 0;
}
-
+
for (iter = node.children().begin(); iter != node.children().end(); ++iter) {
if ((*iter)->name() == X_("Bundle")) {
@@ -722,7 +722,7 @@ IO::get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle
}
}
}
-
+
n = ChanCount::max (n, cnt);
return 0;
}
@@ -732,9 +732,9 @@ IO::create_ports (const XMLNode& node)
{
ChanCount n;
boost::shared_ptr<Bundle> c;
-
+
get_port_counts (node, n, c);
-
+
if (ensure_ports (n, true, true, this)) {
error << string_compose(_("%1: cannot create I/O ports"), _name) << endmsg;
return -1;
@@ -771,22 +771,22 @@ IO::make_connections (const XMLNode& node)
if (!prop) {
continue;
}
-
+
Port* p = port_by_name (prop->value());
if (p) {
- for (XMLNodeConstIterator c = (*i)->children().begin(); c != (*i)->children().end(); ++c) {
+ for (XMLNodeConstIterator c = (*i)->children().begin(); c != (*i)->children().end(); ++c) {
XMLNode* cnode = (*c);
-
+
if (cnode->name() != X_("Connection")) {
continue;
}
-
+
if ((prop = cnode->property (X_("other"))) == 0) {
continue;
}
-
+
if (prop) {
p->connect (prop->value());
}
@@ -794,7 +794,7 @@ IO::make_connections (const XMLNode& node)
}
}
}
-
+
return 0;
}
@@ -805,7 +805,7 @@ IO::set_ports (const string& str)
int i;
int n;
uint32_t nports;
-
+
if ((nports = count (str.begin(), str.end(), '{')) == 0) {
return 0;
}
@@ -834,7 +834,7 @@ IO::set_ports (const string& str)
error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
return -1;
-
+
} else if (n > 0) {
for (int x = 0; x < n; ++x) {
@@ -867,7 +867,7 @@ IO::parse_io_string (const string& str, vector<string>& ports)
ports.push_back (str.substr (opos, pos - opos));
opos = pos + 1;
}
-
+
if (opos < str.length()) {
ports.push_back (str.substr(opos));
}
@@ -888,7 +888,7 @@ IO::parse_gain_string (const string& str, vector<string>& ports)
ports.push_back (str.substr (opos, pos - opos));
opos = pos + 1;
}
-
+
if (opos < str.length()) {
ports.push_back (str.substr(opos));
}
@@ -904,7 +904,7 @@ IO::set_name (const string& requested_name)
if (name == _name) {
return true;
}
-
+
/* replace all colons in the name. i wish we didn't have to do this */
if (replace_all (name, ":", "-")) {
@@ -947,7 +947,7 @@ IO::latency () const
for (PortSet::const_iterator i = _ports.begin(); i != _ports.end(); ++i) {
if ((latency = i->total_latency ()) > max_latency) {
max_latency = latency;
- }
+ }
}
return max_latency;
@@ -1002,7 +1002,7 @@ IO::disconnect_ports_from_bundle (boost::shared_ptr<Bundle> c, void* src)
Glib::Mutex::Lock lm2 (io_lock);
c->disconnect (_bundle, _session.engine());
-
+
/* If this is a UserBundle, make a note of what we've done */
boost::shared_ptr<UserBundle> ub = boost::dynamic_pointer_cast<UserBundle> (c);
@@ -1060,7 +1060,7 @@ IO::build_legal_port_name (DataType type)
} else {
throw unknown_type();
}
-
+
/* note that if "in" or "out" are translated it will break a session
across locale switches because a port's connection list will
show (old) translated names, but the current port name will
@@ -1079,9 +1079,9 @@ IO::build_legal_port_name (DataType type)
char buf1[name_size+1];
char buf2[name_size+1];
-
+
snprintf (buf1, name_size+1, ("%.*s/%s"), limit, _name.c_str(), suffix.c_str());
-
+
int port_number = find_port_hole (buf1);
snprintf (buf2, name_size+1, "%s %d", buf1, port_number);
@@ -1205,7 +1205,7 @@ IO::bundles_connected ()
}
}
}
-
+
return bundles;
}
@@ -1222,7 +1222,7 @@ std::string
IO::bundle_channel_name (uint32_t c, uint32_t n) const
{
char buf[32];
-
+
switch (n) {
case 1:
return _("mono");
@@ -1240,11 +1240,11 @@ string
IO::name_from_state (const XMLNode& node)
{
const XMLProperty* prop;
-
+
if ((prop = node.property ("name")) != 0) {
return prop->value();
- }
-
+ }
+
return string();
}
@@ -1252,10 +1252,10 @@ void
IO::set_name_in_state (XMLNode& node, const string& new_name)
{
const XMLProperty* prop;
-
+
if ((prop = node.property ("name")) != 0) {
node.add_property ("name", new_name);
- }
+ }
}
bool
@@ -1278,7 +1278,7 @@ IO::connected_to (boost::shared_ptr<const IO> other) const
uint32_t i, j;
uint32_t no = n_ports().n_total();
uint32_t ni = other->n_ports ().n_total();
-
+
for (i = 0; i < no; ++i) {
for (j = 0; j < ni; ++j) {
if (nth(i)->connected_to (other->nth(j)->name())) {
@@ -1305,7 +1305,7 @@ void
IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
{
assert(bufs.available() >= _ports.count());
-
+
if (_ports.count() == ChanCount::ZERO) {
return;
}
@@ -1333,7 +1333,7 @@ void
IO::copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset)
{
// Copy any buffers 1:1 to outputs
-
+
PortSet::iterator o = _ports.begin(type);
BufferSet::iterator i = bufs.begin(type);
BufferSet::iterator prev = i;
@@ -1345,7 +1345,7 @@ IO::copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_
++i;
++o;
}
-
+
// Copy last buffer to any extra outputs
while (o != _ports.end(type)) {
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc
index 1408cdcafb..af07f7242a 100644
--- a/libs/ardour/io_processor.cc
+++ b/libs/ardour/io_processor.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2001 Paul Davis
+ Copyright (C) 2001 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
/* create an IOProcessor that proxies to an existing IO object */
-IOProcessor::IOProcessor (Session& s, boost::shared_ptr<IO> in, boost::shared_ptr<IO> out,
+IOProcessor::IOProcessor (Session& s, boost::shared_ptr<IO> in, boost::shared_ptr<IO> out,
const string& proc_name, DataType /*dtype*/)
: Processor(s, proc_name)
, _input (in)
@@ -114,7 +114,7 @@ XMLNode&
IOProcessor::state (bool full_state)
{
XMLNode& node (Processor::state (full_state));
-
+
if (_own_input) {
node.add_property ("own-input", "yes");
if (_input) {
@@ -128,7 +128,7 @@ IOProcessor::state (bool full_state)
node.add_property ("input", _input->name());
}
}
-
+
if (_own_output) {
node.add_property ("own-output", "yes");
if (_output) {
@@ -166,7 +166,7 @@ IOProcessor::set_state (const XMLNode& node)
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
-
+
if (_own_input) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "input") {
@@ -174,21 +174,21 @@ IOProcessor::set_state (const XMLNode& node)
break;
}
}
-
+
if (io_node) {
_input->set_state(*io_node);
-
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_input->name());
}
-
+
} else {
/* no input */
}
}
-
+
if (_own_output) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "output") {
@@ -196,10 +196,10 @@ IOProcessor::set_state (const XMLNode& node)
break;
}
}
-
+
if (io_node) {
_output->set_state(*io_node);
-
+
// legacy sessions: use IO name
if ((prop = node.property ("name")) == 0) {
set_name (_output->name());
diff --git a/libs/ardour/jack_slave.cc b/libs/ardour/jack_slave.cc
index 289b0a8fa9..9f92f1b21f 100644
--- a/libs/ardour/jack_slave.cc
+++ b/libs/ardour/jack_slave.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -63,8 +63,8 @@ JACK_Slave::ok() const
return true;
}
-bool
-JACK_Slave::speed_and_position (double& sp, nframes_t& position)
+bool
+JACK_Slave::speed_and_position (double& sp, nframes_t& position)
{
jack_position_t pos;
jack_transport_state_t state;
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index 06a67aca08..70a8390de1 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -102,7 +102,7 @@ LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
error << string_compose(_("LADSPA: \"%1\" cannot be used, since it cannot do inplace processing"), _descriptor->Name) << endmsg;
throw failed_constructor();
}
-
+
_sample_rate = rate;
if (_descriptor->instantiate == 0) {
@@ -121,7 +121,7 @@ LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
for (i = 0; i < port_cnt; ++i) {
if (LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
connect_port (i, &_control_data[i]);
-
+
if (LADSPA_IS_PORT_OUTPUT(port_descriptor (i)) &&
strcmp (port_names()[i], X_("latency")) == 0) {
_latency_control_port = &_control_data[i];
@@ -131,7 +131,7 @@ LadspaPlugin::init (void *mod, uint32_t index, nframes_t rate)
if (!LADSPA_IS_PORT_INPUT(port_descriptor (i))) {
continue;
}
-
+
_shadow_data[i] = default_value (i);
}
}
@@ -145,7 +145,7 @@ LadspaPlugin::~LadspaPlugin ()
cleanup ();
GoingAway (); /* EMIT SIGNAL */
-
+
/* XXX who should close a plugin? */
// dlclose (module);
@@ -172,16 +172,16 @@ LadspaPlugin::default_value (uint32_t port)
bool earlier_hint = false;
/* defaults - case 1 */
-
+
if (LADSPA_IS_HINT_HAS_DEFAULT(prh[port].HintDescriptor)) {
if (LADSPA_IS_HINT_DEFAULT_MINIMUM(prh[port].HintDescriptor)) {
ret = prh[port].LowerBound;
bounds_given = true;
sr_scaling = true;
}
-
+
/* FIXME: add support for logarithmic defaults */
-
+
else if (LADSPA_IS_HINT_DEFAULT_LOW(prh[port].HintDescriptor)) {
if (LADSPA_IS_HINT_LOGARITHMIC(prh[port].HintDescriptor)) {
ret = exp(log(prh[port].LowerBound) * 0.75f + log(prh[port].UpperBound) * 0.25f);
@@ -238,11 +238,11 @@ LadspaPlugin::default_value (uint32_t port)
ret = 0.0f;
}
}
-
+
/* defaults - case 2 */
else if (LADSPA_IS_HINT_BOUNDED_BELOW(prh[port].HintDescriptor) &&
!LADSPA_IS_HINT_BOUNDED_ABOVE(prh[port].HintDescriptor)) {
-
+
if (prh[port].LowerBound < 0) {
ret = 0.0f;
} else {
@@ -252,11 +252,11 @@ LadspaPlugin::default_value (uint32_t port)
bounds_given = true;
sr_scaling = true;
}
-
+
/* defaults - case 3 */
else if (!LADSPA_IS_HINT_BOUNDED_BELOW(prh[port].HintDescriptor) &&
LADSPA_IS_HINT_BOUNDED_ABOVE(prh[port].HintDescriptor)) {
-
+
if (prh[port].UpperBound > 0) {
ret = 0.0f;
} else {
@@ -266,11 +266,11 @@ LadspaPlugin::default_value (uint32_t port)
bounds_given = true;
sr_scaling = true;
}
-
+
/* defaults - case 4 */
else if (LADSPA_IS_HINT_BOUNDED_BELOW(prh[port].HintDescriptor) &&
LADSPA_IS_HINT_BOUNDED_ABOVE(prh[port].HintDescriptor)) {
-
+
if (prh[port].LowerBound < 0 && prh[port].UpperBound > 0) {
ret = 0.0f;
} else if (prh[port].LowerBound < 0 && prh[port].UpperBound < 0) {
@@ -278,12 +278,12 @@ LadspaPlugin::default_value (uint32_t port)
} else {
ret = prh[port].LowerBound;
}
- bounds_given = true;
+ bounds_given = true;
sr_scaling = true;
}
-
+
/* defaults - case 5 */
-
+
if (LADSPA_IS_HINT_SAMPLE_RATE(prh[port].HintDescriptor) && !earlier_hint) {
if (bounds_given) {
if (sr_scaling) {
@@ -295,7 +295,7 @@ LadspaPlugin::default_value (uint32_t port)
}
return ret;
-}
+}
void
LadspaPlugin::set_parameter (uint32_t which, float val)
@@ -309,7 +309,7 @@ LadspaPlugin::set_parameter (uint32_t which, float val)
controls[which]->Changed ();
}
#endif
-
+
} else {
warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may"
"indicate a change in the plugin design, and presets may be"
@@ -356,7 +356,7 @@ LadspaPlugin::get_state()
for (uint32_t i = 0; i < parameter_count(); ++i){
- if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
+ if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
child = new XMLNode("Port");
@@ -428,7 +428,7 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des
LADSPA_PortRangeHint prh;
prh = port_range_hints()[which];
-
+
if (LADSPA_IS_HINT_BOUNDED_BELOW(prh.HintDescriptor)) {
desc.min_unbound = false;
@@ -441,7 +441,7 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des
desc.min_unbound = true;
desc.lower = 0;
}
-
+
if (LADSPA_IS_HINT_BOUNDED_ABOVE(prh.HintDescriptor)) {
desc.max_unbound = false;
@@ -454,7 +454,7 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des
desc.max_unbound = true;
desc.upper = 4; /* completely arbitrary */
}
-
+
if (LADSPA_IS_HINT_INTEGER (prh.HintDescriptor)) {
desc.step = 1.0;
desc.smallstep = 0.1;
@@ -465,7 +465,7 @@ LadspaPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& des
desc.smallstep = delta / 10000.0f;
desc.largestep = delta/10.0f;
}
-
+
desc.toggled = LADSPA_IS_HINT_TOGGLED (prh.HintDescriptor);
desc.logarithmic = LADSPA_IS_HINT_LOGARITHMIC (prh.HintDescriptor);
desc.sr_dependent = LADSPA_IS_HINT_SAMPLE_RATE (prh.HintDescriptor);
@@ -506,9 +506,9 @@ LadspaPlugin::automatable () const
set<Evoral::Parameter> ret;
for (uint32_t i = 0; i < parameter_count(); ++i){
- if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
+ if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
-
+
ret.insert (ret.end(), Evoral::Parameter(PluginAutomation, 0, i));
}
}
@@ -537,7 +537,7 @@ LadspaPlugin::connect_and_run (BufferSet& bufs,
}
}
}
-
+
run_in_place (nframes);
now = get_cycles ();
set_cycles ((uint32_t) (now - then));
@@ -602,9 +602,9 @@ LadspaPlugin::latency_compute_run ()
/* we need to run the plugin so that it can set its latency
parameter.
*/
-
+
activate ();
-
+
uint32_t port_index = 0;
uint32_t in_index = 0;
uint32_t out_index = 0;
@@ -612,13 +612,13 @@ LadspaPlugin::latency_compute_run ()
LADSPA_Data buffer[bufsize];
memset(buffer,0,sizeof(LADSPA_Data)*bufsize);
-
+
/* Note that we've already required that plugins
be able to handle in-place processing.
*/
-
+
port_index = 0;
-
+
while (port_index < parameter_count()) {
if (LADSPA_IS_PORT_AUDIO (port_descriptor (port_index))) {
if (LADSPA_IS_PORT_INPUT (port_descriptor (port_index))) {
@@ -631,7 +631,7 @@ LadspaPlugin::latency_compute_run ()
}
port_index++;
}
-
+
run_in_place (bufsize);
deactivate ();
}
@@ -656,5 +656,5 @@ LadspaPluginInfo::load (Session& session)
catch (failed_constructor &err) {
return PluginPtr ((Plugin*) 0);
- }
+ }
}
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index c232b9738e..4db398e534 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -83,7 +83,7 @@ Location::operator= (const Location& other)
_locked = false;
/* "changed" not emitted on purpose */
-
+
return this;
}
@@ -121,7 +121,7 @@ Location::set_start (nframes64_t s)
}
if (s != _start) {
- _start = s;
+ _start = s;
start_changed(this); /* EMIT SIGNAL */
}
@@ -159,7 +159,7 @@ Location::set_end (nframes64_t e)
}
if (e != _end) {
- _end = e;
+ _end = e;
end_changed(this); /* EMIT SIGNAL */
}
return 0;
@@ -177,7 +177,7 @@ Location::set (nframes64_t start, nframes64_t end)
} else if (((is_auto_punch() || is_auto_loop()) && start >= end) || (start > end)) {
return -1;
}
-
+
if (_start != start) {
_start = start;
start_changed(this); /* EMIT SIGNAL */
@@ -191,7 +191,7 @@ Location::set (nframes64_t start, nframes64_t end)
}
int
-Location::move_to (nframes64_t pos)
+Location::move_to (nframes64_t pos)
{
if (_locked) {
return -1;
@@ -200,10 +200,10 @@ Location::move_to (nframes64_t pos)
if (_start != pos) {
_start = pos;
_end = _start + length();
-
+
changed (this); /* EMIT SIGNAL */
}
-
+
return 0;
}
@@ -256,7 +256,7 @@ Location::set_is_range_marker (bool yn, void *src)
}
void
-Location::set_auto_punch (bool yn, void *src)
+Location::set_auto_punch (bool yn, void *src)
{
if (is_mark() || _start == _end) {
return;
@@ -268,7 +268,7 @@ Location::set_auto_punch (bool yn, void *src)
}
void
-Location::set_auto_loop (bool yn, void *src)
+Location::set_auto_loop (bool yn, void *src)
{
if (is_mark() || _start == _end) {
return;
@@ -304,7 +304,7 @@ Location::set_mark (bool yn)
if (_start != _end) {
return;
}
-
+
set_flag_internal (yn, IsMark);
}
@@ -316,11 +316,11 @@ Location::cd_info_node(const string & name, const string & value)
root->add_property("name", name);
root->add_property("value", value);
-
+
return *root;
}
-
+
XMLNode&
Location::get_state (void)
{
@@ -354,7 +354,7 @@ Location::set_state (const XMLNode& node)
XMLNodeList cd_list = node.children();
XMLNodeConstIterator cd_iter;
XMLNode *cd_node;
-
+
string cd_name;
string cd_value;
@@ -373,32 +373,32 @@ Location::set_state (const XMLNode& node)
error << _("XML node for Location has no name information") << endmsg;
return -1;
}
-
+
set_name (prop->value());
-
+
if ((prop = node.property ("start")) == 0) {
- error << _("XML node for Location has no start information") << endmsg;
+ error << _("XML node for Location has no start information") << endmsg;
return -1;
}
-
+
/* can't use set_start() here, because _end
may make the value of _start illegal.
*/
-
+
sscanf (prop->value().c_str(), "%" PRId64, &_start);
-
+
if ((prop = node.property ("end")) == 0) {
- error << _("XML node for Location has no end information") << endmsg;
+ error << _("XML node for Location has no end information") << endmsg;
return -1;
}
-
+
sscanf (prop->value().c_str(), "%" PRId64, &_end);
-
+
if ((prop = node.property ("flags")) == 0) {
- error << _("XML node for Location has no flags information") << endmsg;
+ error << _("XML node for Location has no flags information") << endmsg;
return -1;
}
-
+
_flags = Flags (string_2_enum (prop->value(), _flags));
if ((prop = node.property ("locked")) != 0) {
@@ -408,32 +408,32 @@ Location::set_state (const XMLNode& node)
}
for (cd_iter = cd_list.begin(); cd_iter != cd_list.end(); ++cd_iter) {
-
+
cd_node = *cd_iter;
-
+
if (cd_node->name() != "CD-Info") {
continue;
}
-
+
if ((prop = cd_node->property ("name")) != 0) {
cd_name = prop->value();
} else {
throw failed_constructor ();
}
-
+
if ((prop = cd_node->property ("value")) != 0) {
cd_value = prop->value();
} else {
throw failed_constructor ();
}
-
-
+
+
cd_info[cd_name] = cd_value;
-
+
}
changed(this); /* EMIT SIGNAL */
-
+
return 0;
}
@@ -445,7 +445,7 @@ Locations::Locations ()
current_location = 0;
}
-Locations::~Locations ()
+Locations::~Locations ()
{
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
LocationList::iterator tmp = i;
@@ -499,7 +499,7 @@ Locations::next_available_name(string& result,string base)
}
}
for (int k=1; k<=SUFFIX_MAX; k++) {
- if (available[k]) {
+ if (available[k]) {
snprintf (buf, 31, "%d", k);
result += buf;
return 1;
@@ -515,7 +515,7 @@ Locations::set_current_unlocked (Location *loc)
error << _("Locations: attempt to use unknown location as selected location") << endmsg;
return -1;
}
-
+
current_location = loc;
return 0;
}
@@ -543,7 +543,7 @@ Locations::clear ()
changed (); /* EMIT SIGNAL */
current_changed (0); /* EMIT SIGNAL */
-}
+}
void
Locations::clear_markers ()
@@ -565,7 +565,7 @@ Locations::clear_markers ()
}
changed (); /* EMIT SIGNAL */
-}
+}
void
Locations::clear_ranges ()
@@ -573,7 +573,7 @@ Locations::clear_ranges ()
{
Glib::Mutex::Lock lm (lock);
LocationList::iterator tmp;
-
+
for (LocationList::iterator i = locations.begin(); i != locations.end(); ) {
tmp = i;
@@ -592,7 +592,7 @@ Locations::clear_ranges ()
changed (); /* EMIT SIGNAL */
current_changed (0); /* EMIT SIGNAL */
-}
+}
void
Locations::add (Location *loc, bool make_current)
@@ -605,12 +605,12 @@ Locations::add (Location *loc, bool make_current)
current_location = loc;
}
}
-
+
added (loc); /* EMIT SIGNAL */
if (make_current) {
current_changed (current_location); /* EMIT SIGNAL */
- }
+ }
}
void
@@ -640,9 +640,9 @@ Locations::remove (Location *loc)
}
}
}
-
+
if (was_removed) {
-
+
removed (loc); /* EMIT SIGNAL */
if (was_current) {
@@ -665,13 +665,13 @@ Locations::get_state ()
XMLNode *node = new XMLNode ("Locations");
LocationList::iterator iter;
Glib::Mutex::Lock lm (lock);
-
+
for (iter = locations.begin(); iter != locations.end(); ++iter) {
node->add_child_nocopy ((*iter)->get_state ());
}
return *node;
-}
+}
int
Locations::set_state (const XMLNode& node)
@@ -683,7 +683,7 @@ Locations::set_state (const XMLNode& node)
error << _("incorrect XML mode passed to Locations::set_state") << endmsg;
return -1;
}
-
+
nlist = node.children();
locations.clear ();
@@ -693,7 +693,7 @@ Locations::set_state (const XMLNode& node)
Glib::Mutex::Lock lm (lock);
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
try {
Location *loc = new Location (**niter);
@@ -704,7 +704,7 @@ Locations::set_state (const XMLNode& node)
error << _("could not load location from session file - ignored") << endmsg;
}
}
-
+
if (locations.size()) {
current_location = locations.front();
@@ -714,18 +714,18 @@ Locations::set_state (const XMLNode& node)
}
changed (); /* EMIT SIGNAL */
-
+
return 0;
-}
+}
-struct LocationStartEarlierComparison
+struct LocationStartEarlierComparison
{
bool operator() (Location *a, Location *b) {
return a->start() < b->start();
}
};
-struct LocationStartLaterComparison
+struct LocationStartLaterComparison
{
bool operator() (Location *a, Location *b) {
return a->start() > b->start();
@@ -746,7 +746,7 @@ Locations::first_location_before (nframes64_t frame, bool include_special_ranges
locs.sort (cmp);
/* locs is now sorted latest..earliest */
-
+
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
continue;
@@ -773,7 +773,7 @@ Locations::first_location_after (nframes64_t frame, bool include_special_ranges)
locs.sort (cmp);
/* locs is now sorted earliest..latest */
-
+
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
continue;
@@ -800,7 +800,7 @@ Locations::first_mark_before (nframes64_t frame, bool include_special_ranges)
locs.sort (cmp);
/* locs is now sorted latest..earliest */
-
+
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
continue;
@@ -840,7 +840,7 @@ Locations::first_mark_after (nframes64_t frame, bool include_special_ranges)
locs.sort (cmp);
/* locs is now sorted earliest..latest */
-
+
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
continue;
@@ -875,7 +875,7 @@ Locations::end_location () const
}
}
return 0;
-}
+}
Location*
Locations::start_location () const
@@ -886,7 +886,7 @@ Locations::start_location () const
}
}
return 0;
-}
+}
Location*
Locations::auto_loop_location () const
@@ -897,7 +897,7 @@ Locations::auto_loop_location () const
}
}
return 0;
-}
+}
Location*
Locations::auto_punch_location () const
@@ -908,7 +908,7 @@ Locations::auto_punch_location () const
}
}
return 0;
-}
+}
uint32_t
Locations::num_range_markers () const
@@ -940,7 +940,7 @@ Locations::find_all_between (nframes64_t start, nframes64_t end, LocationList& l
Glib::Mutex::Lock lm (lock);
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
- if ((flags == 0 || (*i)->matches (flags)) &&
+ if ((flags == 0 || (*i)->matches (flags)) &&
((*i)->start() >= start && (*i)->end() < end)) {
ll.push_back (*i);
}
diff --git a/libs/ardour/location_importer.cc b/libs/ardour/location_importer.cc
index 31a49e44f5..fd74e802a7 100644
--- a/libs/ardour/location_importer.cc
+++ b/libs/ardour/location_importer.cc
@@ -39,11 +39,11 @@ LocationImportHandler::LocationImportHandler (XMLTree const & source, Session &
{
XMLNode const *root = source.root();
XMLNode const * location_node;
-
+
if (!(location_node = root->child ("Locations"))) {
throw failed_constructor();
}
-
+
// Construct importable locations
XMLNodeList const & locations = location_node->children();
for (XMLNodeList::const_iterator it = locations.begin(); it != locations.end(); it++) {
@@ -62,7 +62,7 @@ LocationImportHandler::get_info () const
}
/*** LocationImporter ***/
-LocationImporter::LocationImporter (XMLTree const & source, Session & session, LocationImportHandler & handler, XMLNode const & node) :
+LocationImporter::LocationImporter (XMLTree const & source, Session & session, LocationImportHandler & handler, XMLNode const & node) :
ElementImporter (source, session),
handler (handler),
xml_location (node),
@@ -71,7 +71,7 @@ LocationImporter::LocationImporter (XMLTree const & source, Session & session, L
// Parse XML
bool name_ok = false;
XMLPropertyList props = xml_location.properties();
-
+
for (XMLPropertyIterator it = props.begin(); it != props.end(); ++it) {
string prop = (*it)->name();
if (!prop.compare ("id") || !prop.compare ("flags") || !prop.compare ("locked")) {
@@ -87,7 +87,7 @@ LocationImporter::LocationImporter (XMLTree const & source, Session & session, L
std::cerr << string_compose (X_("LocationImporter did not recognise XML-property \"%1\""), prop) << endmsg;
}
}
-
+
if (!name_ok) {
error << X_("LocationImporter did not find necessary XML-property \"name\"") << endmsg;
throw failed_constructor();
@@ -106,17 +106,17 @@ LocationImporter::get_info () const
{
nframes_t start, end;
SMPTE::Time start_time, end_time;
-
+
// Get sample positions
std::istringstream iss_start (xml_location.property ("start")->value());
iss_start >> start;
std::istringstream iss_end (xml_location.property ("end")->value());
iss_end >> end;
-
+
// Convert to smpte
session.sample_to_smpte (start, start_time, true, false);
session.sample_to_smpte (end, end_time, true, false);
-
+
// return info
std::ostringstream oss;
if (start == end) {
@@ -125,7 +125,7 @@ LocationImporter::get_info () const
oss << _("Range\nstart: ") << smpte_to_string (start_time) <<
_("\nend: ") << smpte_to_string (end_time);
}
-
+
return oss.str();
}
@@ -137,30 +137,30 @@ LocationImporter::_prepare_move ()
location = new Location (original); // Updates id
} catch (failed_constructor& err) {
throw std::runtime_error (X_("Error in session file!"));
- return false;
+ return false;
}
-
+
std::pair<bool, string> rename_pair;
-
+
if (location->is_auto_punch()) {
rename_pair = Rename (_("The location is the Punch range. It will be imported as a normal range.\nYou may rename the imported location:"), name);
if (!rename_pair.first) {
return false;
}
-
+
name = rename_pair.second;
location->set_auto_punch (false, this);
location->set_is_range_marker (true, this);
}
-
+
if (location->is_auto_loop()) {
rename_pair = Rename (_("The location is a Loop range. It will be imported as a normal range.\nYou may rename the imported location:"), name);
if (!rename_pair.first) { return false; }
-
+
location->set_auto_loop (false, this);
location->set_is_range_marker (true, this);
}
-
+
// duplicate name checking
Locations::LocationList const & locations(session.locations()->list());
for (Locations::LocationList::const_iterator it = locations.begin(); it != locations.end(); ++it) {
@@ -170,7 +170,7 @@ LocationImporter::_prepare_move ()
name = rename_pair.second;
}
}
-
+
location->set_name (name);
return true;
@@ -178,7 +178,7 @@ LocationImporter::_prepare_move ()
void
LocationImporter::_cancel_move ()
-{
+{
delete location;
location = 0;
}
diff --git a/libs/ardour/lv2_event_buffer.cc b/libs/ardour/lv2_event_buffer.cc
index 88ecfe1433..9bc61d93d1 100644
--- a/libs/ardour/lv2_event_buffer.cc
+++ b/libs/ardour/lv2_event_buffer.cc
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -99,14 +99,14 @@ LV2EventBuffer::is_valid() const
/** Read an event from the current position in the buffer
- *
+ *
* \return true if read was successful, or false if end of buffer reached
*/
bool
LV2EventBuffer::get_event(uint32_t* frames,
- uint32_t* subframes,
- uint16_t* type,
- uint16_t* size,
+ uint32_t* subframes,
+ uint16_t* type,
+ uint16_t* size,
uint8_t** data) const
{
if (lv2_event_is_valid(&_iter)) {
@@ -188,7 +188,7 @@ LV2EventBuffer::append(const LV2_Event_Buffer* /*buf*/)
_latest_frames = ev->frames;
_latest_subframes = ev->subframes;
}
-
+
return ret;
}
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index c6f18da80e..0fb766e7d4 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -82,7 +82,7 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
_shadow_data = 0;
_latency_control_port = 0;
_was_activated = false;
-
+
_instance = slv2_plugin_instantiate(plugin, rate, _features);
_name = slv2_plugin_get_name(plugin);
assert(_name);
@@ -101,14 +101,14 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
slv2_value_free(_author);
throw failed_constructor();
}
-
+
_instance_access_feature.URI = "http://lv2plug.in/ns/ext/instance-access";
_instance_access_feature.data = (void*)_instance->lv2_handle;
_data_access_extension_data.extension_data = _instance->lv2_descriptor->extension_data;
_data_access_feature.URI = "http://lv2plug.in/ns/ext/data-access";
_data_access_feature.data = &_data_access_extension_data;
-
+
_features = (LV2_Feature**)malloc(sizeof(LV2_Feature*) * 4);
_features[0] = &_instance_access_feature;
_features[1] = &_data_access_feature;
@@ -150,7 +150,7 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, nframes_t rate)
_defaults[i] = 0.0f;
}
}
-
+
SLV2UIs uis = slv2_plugin_get_uis(_plugin);
if (slv2_uis_size(uis) > 0) {
for (unsigned i=0; i < slv2_uis_size(uis); ++i) {
@@ -182,7 +182,7 @@ LV2Plugin::~LV2Plugin ()
cleanup ();
GoingAway (); /* EMIT SIGNAL */
-
+
slv2_instance_free(_instance);
slv2_value_free(_name);
slv2_value_free(_author);
@@ -208,7 +208,7 @@ float
LV2Plugin::default_value (uint32_t port)
{
return _defaults[port];
-}
+}
const char*
LV2Plugin::port_symbol (uint32_t index)
@@ -235,7 +235,7 @@ LV2Plugin::set_parameter (uint32_t which, float val)
controls[which]->Changed ();
}
#endif
-
+
} else {
warning << string_compose (_("Illegal parameter number used with plugin \"%1\"."
"This is a bug in either Ardour or the LV2 plugin (%2)"),
@@ -269,7 +269,7 @@ LV2Plugin::nth_parameter (uint32_t n, bool& ok) const
}
}
}
-
+
return 0;
}
@@ -346,7 +346,7 @@ LV2Plugin::save_preset (string /*name*/)
{
return false;
}
-
+
bool
LV2Plugin::has_editor() const
{
@@ -400,7 +400,7 @@ LV2Plugin::set_state(const XMLNode& node)
set_parameter (port_id, atof(value));
}
-
+
latency_compute_run ();
return 0;
@@ -413,7 +413,7 @@ LV2Plugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
SLV2Value def, min, max;
slv2_port_get_range(_plugin, port, &def, &min, &max);
-
+
desc.integer_step = slv2_port_has_property(_plugin, port, _world.integer);
desc.toggled = slv2_port_has_property(_plugin, port, _world.toggled);
desc.logarithmic = slv2_port_has_property(_plugin, port, _world.logarithmic);
@@ -423,7 +423,7 @@ LV2Plugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
desc.upper = max ? slv2_value_as_float(max) : 1.0f;
desc.min_unbound = false; // TODO (LV2 extension)
desc.max_unbound = false; // TODO (LV2 extension)
-
+
if (desc.integer_step) {
desc.step = 1.0;
desc.smallstep = 0.1;
@@ -522,9 +522,9 @@ LV2Plugin::connect_and_run (BufferSet& bufs,
slv2_instance_connect_port(_instance, port_index, NULL);
}
}
-
+
run (nframes);
-
+
midi_out_index = 0;
for (uint32_t port_index = 0; port_index < parameter_count(); ++port_index) {
if (parameter_is_midi(port_index) && parameter_is_output(port_index)) {
@@ -532,7 +532,7 @@ LV2Plugin::connect_and_run (BufferSet& bufs,
bufs.flush_lv2_midi(true, buf_index);
}
}
-
+
cycles_t now = get_cycles ();
set_cycles ((uint32_t) (now - then));
@@ -609,9 +609,9 @@ LV2Plugin::latency_compute_run ()
/* we need to run the plugin so that it can set its latency
parameter.
*/
-
+
activate ();
-
+
uint32_t port_index = 0;
uint32_t in_index = 0;
uint32_t out_index = 0;
@@ -619,13 +619,13 @@ LV2Plugin::latency_compute_run ()
float buffer[bufsize];
memset(buffer,0,sizeof(float)*bufsize);
-
+
/* Note that we've already required that plugins
be able to handle in-place processing.
*/
-
+
port_index = 0;
-
+
while (port_index < parameter_count()) {
if (parameter_is_audio (port_index)) {
if (parameter_is_input (port_index)) {
@@ -638,7 +638,7 @@ LV2Plugin::latency_compute_run ()
}
port_index++;
}
-
+
run (bufsize);
deactivate ();
}
@@ -659,7 +659,7 @@ LV2World::LV2World()
srate = slv2_value_new_uri(world, SLV2_NAMESPACE_LV2 "sampleRate");
gtk_gui = slv2_value_new_uri(world, "http://lv2plug.in/ns/extensions/ui#GtkUI");
external_gui = slv2_value_new_uri(world, "http://lv2plug.in/ns/extensions/ui#external");
- logarithmic = slv2_value_new_uri(world, "http://lv2plug.in/ns/dev/extportinfo#logarithmic");
+ logarithmic = slv2_value_new_uri(world, "http://lv2plug.in/ns/dev/extportinfo#logarithmic");
}
LV2World::~LV2World()
@@ -698,8 +698,8 @@ LV2PluginInfo::load (Session& session)
catch (failed_constructor &err) {
return PluginPtr ((Plugin*) 0);
- }
-
+ }
+
return PluginPtr();
}
@@ -707,7 +707,7 @@ PluginInfoList
LV2PluginInfo::discover (void* lv2_world)
{
PluginInfoList plugs;
-
+
LV2World* world = (LV2World*)lv2_world;
SLV2Plugins plugins = slv2_world_get_all_plugins(world->world);
@@ -723,7 +723,7 @@ LV2PluginInfo::discover (void* lv2_world)
cerr << "LV2: invalid plugin\n";
continue;
}
-
+
info->name = string(slv2_value_as_string(name));
slv2_value_free(name);
@@ -741,7 +741,7 @@ LV2PluginInfo::discover (void* lv2_world)
world->input_class, world->audio_class, NULL));
info->n_inputs.set_midi(slv2_plugin_get_num_ports_of_class(p,
world->input_class, world->event_class, NULL));
-
+
info->n_outputs.set_audio(slv2_plugin_get_num_ports_of_class(p,
world->output_class, world->audio_class, NULL));
info->n_outputs.set_midi(slv2_plugin_get_num_ports_of_class(p,
@@ -749,7 +749,7 @@ LV2PluginInfo::discover (void* lv2_world)
info->unique_id = slv2_value_as_uri(slv2_plugin_get_uri(p));
info->index = 0; // Meaningless for LV2
-
+
plugs.push_back (info);
}
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index 76d2be262c..a5e82c3bf3 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -53,11 +53,11 @@ Metering::disconnect (sigc::connection& c)
/**
Update the meters.
- The meter signal lock is taken to prevent modification of the
+ The meter signal lock is taken to prevent modification of the
Meter signal while updating the meters, taking the meter signal
- lock prior to taking the io_lock ensures that all IO will remain
+ lock prior to taking the io_lock ensures that all IO will remain
valid while metering.
-*/
+*/
void
Metering::update_meters()
{
@@ -79,9 +79,9 @@ PeakMeter::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_fram
const uint32_t n_audio = min(_configured_input.n_audio(), bufs.count().n_audio());
const uint32_t n_midi = min(_configured_input.n_midi(), bufs.count().n_midi());
-
+
uint32_t n = 0;
-
+
// Meter MIDI in to the first n_midi peaks
for (uint32_t i = 0; i < n_midi; ++i, ++n) {
float val = 0.0f;
@@ -104,7 +104,7 @@ PeakMeter::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_fram
// Meter audio in to the rest of the peaks
for (uint32_t i = 0; i < n_audio; ++i, ++n) {
- _peak_power[n] = compute_peak (bufs.get_audio(i).data(), nframes, _peak_power[n]);
+ _peak_power[n] = compute_peak (bufs.get_audio(i).data(), nframes, _peak_power[n]);
}
// Zero any excess peaks
@@ -149,9 +149,9 @@ PeakMeter::configure_io (ChanCount in, ChanCount out)
if (out != in) { // always 1:1
return false;
}
-
+
uint32_t limit = in.n_total();
-
+
while (_peak_power.size() > limit) {
_peak_power.pop_back();
_visible_peak_power.pop_back();
@@ -191,7 +191,7 @@ PeakMeter::meter ()
/* grab peak since last read */
- float new_peak = _peak_power[n]; /* XXX we should use atomic exchange from here ... */
+ float new_peak = _peak_power[n]; /* XXX we should use atomic exchange from here ... */
_peak_power[n] = 0; /* ... to here */
/* compute new visible value using falloff */
@@ -201,11 +201,11 @@ PeakMeter::meter ()
} else {
new_peak = minus_infinity();
}
-
+
/* update max peak */
-
+
_max_peak_power[n] = std::max (new_peak, _max_peak_power[n]);
-
+
if (Config->get_meter_falloff() == 0.0f || new_peak > _visible_peak_power[n]) {
_visible_peak_power[n] = new_peak;
} else {
diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc
index 1e049eba72..1e41668889 100644
--- a/libs/ardour/midi_buffer.cc
+++ b/libs/ardour/midi_buffer.cc
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006-2007 Paul Davis
+ Copyright (C) 2006-2007 Paul Davis
Author: Dave Robillard
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -34,7 +34,7 @@ MidiBuffer::MidiBuffer(size_t capacity)
silence(_capacity);
}
}
-
+
MidiBuffer::~MidiBuffer()
{
free(_data);
@@ -79,7 +79,7 @@ MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offse
assert (&src != this);
const MidiBuffer& msrc = (MidiBuffer&) src;
-
+
assert (_capacity >= msrc.size());
if (dst_offset == 0) {
@@ -88,7 +88,7 @@ MidiBuffer::read_from (const Buffer& src, nframes_t nframes, nframes_t dst_offse
}
/* XXX use dst_offset somehow */
-
+
for (MidiBuffer::const_iterator i = msrc.begin(); i != msrc.end(); ++i) {
const Evoral::MIDIEvent<TimeType> ev(*i, false);
if (ev.time() >= src_offset && ev.time() < (nframes+src_offset)) {
@@ -123,7 +123,7 @@ MidiBuffer::push_back(const Evoral::MIDIEvent<TimeType>& ev)
const size_t stamp_size = sizeof(TimeType);
/*cerr << "MidiBuffer: pushing event @ " << ev.time()
<< " size = " << ev.size() << endl;*/
-
+
if (_size + stamp_size + ev.size() >= _capacity) {
cerr << "MidiBuffer::push_back failed (buffer is full)" << endl;
return false;
@@ -135,7 +135,7 @@ MidiBuffer::push_back(const Evoral::MIDIEvent<TimeType>& ev)
}
push_back(ev.time(), ev.size(), ev.buffer());
-
+
return true;
}
@@ -149,7 +149,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data)
const size_t stamp_size = sizeof(TimeType);
/*cerr << "MidiBuffer: pushing event @ " << ev.time()
<< " size = " << ev.size() << endl;*/
-
+
if (_size + stamp_size + size >= _capacity) {
cerr << "MidiBuffer::push_back failed (buffer is full)" << endl;
return false;
@@ -166,7 +166,7 @@ MidiBuffer::push_back(TimeType time, size_t size, const uint8_t* data)
_size += stamp_size + size;
_silent = false;
-
+
return true;
}
@@ -186,7 +186,7 @@ MidiBuffer::push_back(const jack_midi_event_t& ev)
cerr << "MidiBuffer::push_back failed (buffer is full)" << endl;
return false;
}
-
+
if (!Evoral::midi_event_is_valid(ev.buffer, ev.size)) {
cerr << "WARNING: MidiBuffer ignoring illegal MIDI event" << endl;
return false;
@@ -198,7 +198,7 @@ MidiBuffer::push_back(const jack_midi_event_t& ev)
_size += stamp_size + ev.size;
_silent = false;
-
+
return true;
}
@@ -221,13 +221,13 @@ MidiBuffer::reserve(TimeType time, size_t size)
// write timestamp
uint8_t* write_loc = _data + _size;
*((TimeType*)write_loc) = time;
-
+
// move write_loc to begin of MIDI buffer data to write to
write_loc += stamp_size;
_size += stamp_size + size;
_silent = false;
-
+
return write_loc;
}
@@ -322,7 +322,7 @@ bool
MidiBuffer::merge(const MidiBuffer& a, const MidiBuffer& b)
{
_size = 0;
-
+
if (this == &a) {
merge_in_place(b);
}
@@ -330,7 +330,7 @@ MidiBuffer::merge(const MidiBuffer& a, const MidiBuffer& b)
if (this == &b) {
merge_in_place(a);
}
-
+
cerr << "FIXME: MIDI BUFFER MERGE" << endl;
return true;
}
diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc
index 1182fed23d..a41864571d 100644
--- a/libs/ardour/midi_clock_slave.cc
+++ b/libs/ardour/midi_clock_slave.cc
@@ -75,7 +75,7 @@ MIDIClock_Slave::rebind (MIDI::Port& p)
port = &p;
- #ifdef DEBUG_MIDI_CLOCK
+ #ifdef DEBUG_MIDI_CLOCK
std::cerr << "MIDIClock_Slave: connecting to port " << port->name() << std::endl;
#endif
@@ -86,7 +86,7 @@ MIDIClock_Slave::rebind (MIDI::Port& p)
connections.push_back (port->input()->position.connect (mem_fun (*this, &MIDIClock_Slave::position)));
}
-void
+void
MIDIClock_Slave::calculate_one_ppqn_in_frames_at(nframes_t time)
{
const Tempo& current_tempo = session->tempo_map().tempo_at(time);
@@ -101,7 +101,7 @@ MIDIClock_Slave::calculate_one_ppqn_in_frames_at(nframes_t time)
one_ppqn_in_frames = frames_per_quarter_note / double (ppqn);
}
-ARDOUR::nframes_t
+ARDOUR::nframes_t
MIDIClock_Slave::calculate_song_position(uint16_t song_position_in_sixteenth_notes)
{
nframes_t song_position_frames = 0;
@@ -110,49 +110,49 @@ MIDIClock_Slave::calculate_song_position(uint16_t song_position_in_sixteenth_not
calculate_one_ppqn_in_frames_at(song_position_frames);
song_position_frames += one_ppqn_in_frames * nframes_t(ppqn / 4);
}
-
+
return song_position_frames;
}
-void
+void
MIDIClock_Slave::calculate_filter_coefficients()
{
// omega = 2 * PI * Bandwidth / MIDI clock frame frequency in Hz
omega = 2.0 * 3.14159265358979323846 * bandwidth * one_ppqn_in_frames / session->frame_rate();
b = 1.4142135623730950488 * omega;
- c = omega * omega;
+ c = omega * omega;
}
void
MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes_t timestamp)
-{
- // some pieces of hardware send MIDI Clock all the time
+{
+ // some pieces of hardware send MIDI Clock all the time
if ( (!_starting) && (!_started) ) {
return;
}
-
+
calculate_one_ppqn_in_frames_at(should_be_position);
-
+
nframes_t elapsed_since_start = timestamp - first_timestamp;
double error = 0;
-
- if (_starting || last_timestamp == 0) {
+
+ if (_starting || last_timestamp == 0) {
midi_clock_count = 0;
-
+
first_timestamp = timestamp;
elapsed_since_start = should_be_position;
-
+
// calculate filter coefficients
calculate_filter_coefficients();
-
+
// initialize DLL
e2 = double(one_ppqn_in_frames) / double(session->frame_rate());
t0 = double(elapsed_since_start) / double(session->frame_rate());
t1 = t0 + e2;
-
+
// let ardour go after first MIDI Clock Event
_starting = false;
- } else {
+ } else {
midi_clock_count++;
should_be_position += one_ppqn_in_frames;
calculate_filter_coefficients();
@@ -161,33 +161,33 @@ MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes_t timestamp)
// we use session->transport_frame() instead of t1 here
// because t1 is used to calculate the transport speed,
// so the loop will compensate for accumulating rounding errors
- error = (double(should_be_position) - double(session->audible_frame()));
+ error = (double(should_be_position) - double(session->audible_frame()));
e = error / double(session->frame_rate());
-
+
// update DLL
t0 = t1;
t1 += b * e + e2;
- e2 += c * e;
- }
-
- #ifdef DEBUG_MIDI_CLOCK
- cerr
+ e2 += c * e;
+ }
+
+ #ifdef DEBUG_MIDI_CLOCK
+ cerr
<< "MIDI Clock #" << midi_clock_count
- //<< "@" << timestamp
- << " arrived at: " << elapsed_since_start << " (elapsed time) "
- << " should-be transport: " << should_be_position
+ //<< "@" << timestamp
+ << " arrived at: " << elapsed_since_start << " (elapsed time) "
+ << " should-be transport: " << should_be_position
<< " audible: " << session->audible_frame()
<< " real transport: " << session->transport_frame()
<< " error: " << error
- //<< " engine: " << session->frame_time()
- << " real delta: " << timestamp - last_timestamp
+ //<< " engine: " << session->frame_time()
+ << " real delta: " << timestamp - last_timestamp
<< " should-be delta: " << one_ppqn_in_frames
<< " t1-t0: " << (t1 -t0) * session->frame_rate()
<< " t0: " << t0 * session->frame_rate()
- << " t1: " << t1 * session->frame_rate()
- << " frame-rate: " << session->frame_rate()
+ << " t1: " << t1 * session->frame_rate()
+ << " frame-rate: " << session->frame_rate()
<< endl;
-
+
cerr << "frames since cycle start: " << session->frames_since_cycle_start() << endl;
#endif // DEBUG_MIDI_CLOCK
@@ -196,14 +196,14 @@ MIDIClock_Slave::update_midi_clock (Parser& /*parser*/, nframes_t timestamp)
void
MIDIClock_Slave::start (Parser& /*parser*/, nframes_t /*timestamp*/)
-{
- #ifdef DEBUG_MIDI_CLOCK
+{
+ #ifdef DEBUG_MIDI_CLOCK
cerr << "MIDIClock_Slave got start message at time " << timestamp << " engine time: " << session->frame_time() << endl;
#endif
-
+
if (!_started) {
reset();
-
+
_started = true;
_starting = true;
}
@@ -213,24 +213,24 @@ void
MIDIClock_Slave::reset ()
{
- should_be_position = 0;
+ should_be_position = 0;
last_timestamp = 0;
-
+
_starting = false;
_started = false;
-
+
session->request_locate(0, false);
}
void
MIDIClock_Slave::contineu (Parser& /*parser*/, nframes_t /*timestamp*/)
{
- #ifdef DEBUG_MIDI_CLOCK
+ #ifdef DEBUG_MIDI_CLOCK
std::cerr << "MIDIClock_Slave got continue message" << endl;
#endif
if (!_started) {
_starting = true;
- _started = true;
+ _started = true;
}
}
@@ -238,29 +238,29 @@ MIDIClock_Slave::contineu (Parser& /*parser*/, nframes_t /*timestamp*/)
void
MIDIClock_Slave::stop (Parser& /*parser*/, nframes_t /*timestamp*/)
{
- #ifdef DEBUG_MIDI_CLOCK
+ #ifdef DEBUG_MIDI_CLOCK
std::cerr << "MIDIClock_Slave got stop message" << endl;
#endif
-
+
if (_started || _starting) {
_starting = false;
_started = false;
// locate to last MIDI clock position
session->request_transport_speed(0.0);
-
+
// we need to go back to the last MIDI beat (6 ppqn)
// and lets hope the tempo didnt change in the meantime :)
-
+
// begin at the should be position, because
// that is the position of the last MIDI Clock
// message and that is probably what the master
// expects where we are right now
nframes_t stop_position = should_be_position;
-
+
// find out the last MIDI beat: go back #midi_clocks mod 6
// and lets hope the tempo didnt change in those last 6 beats :)
stop_position -= (midi_clock_count % 6) * one_ppqn_in_frames;
-
+
session->request_locate(stop_position, false);
should_be_position = stop_position;
last_timestamp = 0;
@@ -275,23 +275,23 @@ MIDIClock_Slave::position (Parser& /*parser*/, byte* message, size_t size)
if (_started || _starting) {
return;
}
-
+
assert(size == 3);
byte lsb = message[1];
byte msb = message[2];
assert((lsb <= 0x7f) && (msb <= 0x7f));
-
+
uint16_t position_in_sixteenth_notes = (uint16_t(msb) << 7) | uint16_t(lsb);
nframes_t position_in_frames = calculate_song_position(position_in_sixteenth_notes);
-
+
#ifdef DEBUG_MIDI_CLOCK
- cerr << "Song Position: " << position_in_sixteenth_notes << " frames: " << position_in_frames << endl;
+ cerr << "Song Position: " << position_in_sixteenth_notes << " frames: " << position_in_frames << endl;
#endif
-
+
session->request_locate(position_in_frames, false);
should_be_position = position_in_frames;
last_timestamp = 0;
-
+
}
bool
@@ -316,12 +316,12 @@ bool
MIDIClock_Slave::stop_if_no_more_clock_events(nframes_t& pos, nframes_t now)
{
/* no timecode for 1/4 second ? conclude that its stopped */
- if (last_timestamp &&
- now > last_timestamp &&
+ if (last_timestamp &&
+ now > last_timestamp &&
now - last_timestamp > session->frame_rate() / 4) {
- #ifdef DEBUG_MIDI_CLOCK
+ #ifdef DEBUG_MIDI_CLOCK
cerr << "No MIDI Clock frames received for some time, stopping!" << endl;
- #endif
+ #endif
pos = should_be_position;
session->request_transport_speed (0);
session->request_locate (should_be_position, false);
@@ -339,16 +339,16 @@ MIDIClock_Slave::speed_and_position (double& speed, nframes_t& pos)
pos = should_be_position;
return true;
}
-
+
nframes_t engine_now = session->frame_time();
-
+
if (stop_if_no_more_clock_events(pos, engine_now)) {
return false;
}
// calculate speed
speed = ((t1 - t0) * session->frame_rate()) / one_ppqn_in_frames;
-
+
// calculate position
if (engine_now > last_timestamp) {
// we are in between MIDI clock messages
@@ -359,11 +359,11 @@ MIDIClock_Slave::speed_and_position (double& speed, nframes_t& pos)
// A new MIDI clock message has arrived this cycle
pos = should_be_position;
}
-
- #ifdef DEBUG_MIDI_CLOCK
+
+ #ifdef DEBUG_MIDI_CLOCK
cerr << "speed_and_position: " << speed << " & " << pos << " <-> " << session->transport_frame() << " (transport)" << endl;
- #endif
-
+ #endif
+
return true;
}
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index 97a8fb3044..dd221e103b 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2003 Paul Davis
+ Copyright (C) 2000-2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -84,7 +84,7 @@ MidiDiskstream::MidiDiskstream (Session &sess, const string &name, Diskstream::F
assert(!destructive());
}
-
+
MidiDiskstream::MidiDiskstream (Session& sess, const XMLNode& node)
: Diskstream(sess, node)
, _playback_buf(0)
@@ -126,7 +126,7 @@ MidiDiskstream::init (Diskstream::Flag f)
const size_t size = _session.midi_diskstream_buffer_size();
_playback_buf = new MidiRingBuffer<nframes_t>(size);
_capture_buf = new MidiRingBuffer<nframes_t>(size);
-
+
_n_channels = ChanCount(DataType::MIDI, 1);
assert(recordable());
@@ -137,7 +137,7 @@ MidiDiskstream::~MidiDiskstream ()
Glib::Mutex::Lock lm (state_lock);
}
-
+
void
MidiDiskstream::non_realtime_locate (nframes_t position)
{
@@ -151,7 +151,7 @@ MidiDiskstream::non_realtime_locate (nframes_t position)
void
MidiDiskstream::non_realtime_input_change ()
{
- {
+ {
Glib::Mutex::Lock lm (state_lock);
if (input_change_pending == NoChange) {
@@ -163,7 +163,7 @@ MidiDiskstream::non_realtime_input_change ()
error << "Can not feed IO " << _io->n_ports()
<< " with diskstream " << _n_channels << endl;
}
- }
+ }
get_input_sources ();
set_capture_offset ();
@@ -176,7 +176,7 @@ MidiDiskstream::non_realtime_input_change ()
}
input_change_pending = NoChange;
-
+
/* implicit unlock */
}
@@ -211,13 +211,13 @@ MidiDiskstream::get_input_sources ()
_source_port = _io->midi(0);
// do... stuff?
-}
+}
int
MidiDiskstream::find_and_use_playlist (const string& name)
{
boost::shared_ptr<MidiPlaylist> playlist;
-
+
if ((playlist = boost::dynamic_pointer_cast<MidiPlaylist> (_session.playlist_by_name (name))) == 0) {
playlist = boost::dynamic_pointer_cast<MidiPlaylist> (PlaylistFactory::create (DataType::MIDI, _session, name));
}
@@ -232,7 +232,7 @@ MidiDiskstream::find_and_use_playlist (const string& name)
int
MidiDiskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
-{
+{
assert(boost::dynamic_pointer_cast<MidiPlaylist>(playlist));
Diskstream::use_playlist(playlist);
@@ -242,7 +242,7 @@ MidiDiskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
int
MidiDiskstream::use_new_playlist ()
-{
+{
string newname;
boost::shared_ptr<MidiPlaylist> playlist;
@@ -258,11 +258,11 @@ MidiDiskstream::use_new_playlist ()
if ((playlist = boost::dynamic_pointer_cast<MidiPlaylist> (PlaylistFactory::create (
DataType::MIDI, _session, newname, hidden()))) != 0) {
-
+
playlist->set_orig_diskstream_id (id());
return use_playlist (playlist);
- } else {
+ } else {
return -1;
}
}
@@ -285,11 +285,11 @@ MidiDiskstream::use_copy_playlist ()
boost::shared_ptr<MidiPlaylist> playlist;
newname = Playlist::bump_name (_playlist->name(), _session);
-
+
if ((playlist = boost::dynamic_pointer_cast<MidiPlaylist>(PlaylistFactory::create (midi_playlist(), newname))) != 0) {
playlist->set_orig_diskstream_id (id());
return use_playlist (playlist);
- } else {
+ } else {
return -1;
}
}
@@ -303,7 +303,7 @@ MidiDiskstream::set_destructive (bool yn)
assert( ! yn);
return -1;
}
-
+
void
MidiDiskstream::set_note_mode (NoteMode m)
{
@@ -317,7 +317,7 @@ void
MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nframes*/, bool can_record)
{
// FIXME: waaay too much code to duplicate (AudioDiskstream)
-
+
int possibly_recording;
int rolling;
int change;
@@ -341,9 +341,9 @@ MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfra
/* if per-track or global rec-enable turned on while the other was already on, we've started recording */
- if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
+ if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
-
+
/* starting to record: compute first+last frames */
first_recordable_frame = transport_frame + _capture_offset;
@@ -358,8 +358,8 @@ MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfra
first_recordable_frame += _session.worst_output_latency();
} else {
first_recordable_frame += _roll_delay;
- }
-
+ }
+
} else {
/* was rolling, but record state changed */
@@ -370,8 +370,8 @@ MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfra
if (!_session.config.get_punch_in()) {
/* manual punch in happens at the correct transport frame
- because the user hit a button. but to get alignment correct
- we have to back up the position of the new region to the
+ because the user hit a button. but to get alignment correct
+ we have to back up the position of the new region to the
appropriate spot given the roll delay.
*/
@@ -402,15 +402,15 @@ MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t /*nfra
capture_start_frame -= _roll_delay;
}
}
-
+
}
} else if (!record_enabled() || !can_record) {
-
+
/* stop recording */
last_recordable_frame = transport_frame + _capture_offset;
-
+
if (_alignment_style == ExistingMaterial) {
last_recordable_frame += _session.worst_output_latency();
} else {
@@ -428,7 +428,7 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
using namespace MIDI;
eventType type;
const char trace_prefix = ':';
-
+
type = (eventType) (msg[0]&0xF0);
switch (type) {
@@ -442,7 +442,7 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endl;
break;
-
+
case on:
o << trace_prefix
<< "Channel "
@@ -453,7 +453,7 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endl;
break;
-
+
case polypress:
o << trace_prefix
<< "Channel "
@@ -462,7 +462,7 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
<< (int) msg[1]
<< endl;
break;
-
+
case MIDI::controller:
o << trace_prefix
<< "Channel "
@@ -473,25 +473,25 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
<< (int) msg[2]
<< endl;
break;
-
+
case program:
- o << trace_prefix
+ o << trace_prefix
<< "Channel "
<< (msg[0]&0xF)+1
<< " Program Change ProgNum "
<< (int) msg[1]
<< endl;
break;
-
+
case chanpress:
- o << trace_prefix
+ o << trace_prefix
<< "Channel "
<< (msg[0]&0xF)+1
<< " Channel Pressure "
<< (int) msg[1]
<< endl;
break;
-
+
case MIDI::pitchbend:
o << trace_prefix
<< "Channel "
@@ -500,7 +500,7 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
<< ((msg[2]<<7)|msg[1])
<< endl;
break;
-
+
case MIDI::sysex:
if (len == 1) {
switch (msg[0]) {
@@ -537,9 +537,9 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
default:
o << trace_prefix
<< "System Exclusive (1 byte : " << hex << (int) *msg << dec << ')'
- << endl;
+ << endl;
break;
- }
+ }
} else {
o << trace_prefix
<< "System Exclusive (" << len << ") = [ " << hex;
@@ -547,42 +547,42 @@ trace_midi (ostream& o, MIDI::byte *msg, size_t len)
o << (int) msg[i] << ' ';
}
o << dec << ']' << endl;
-
+
}
break;
-
+
case MIDI::song:
o << trace_prefix << "Song" << endl;
break;
-
+
case MIDI::tune:
o << trace_prefix << "Tune" << endl;
break;
-
+
case MIDI::eox:
o << trace_prefix << "End-of-System Exclusive" << endl;
break;
-
+
case MIDI::timing:
o << trace_prefix << "Timing" << endl;
break;
-
+
case MIDI::start:
o << trace_prefix << "Start" << endl;
break;
-
+
case MIDI::stop:
o << trace_prefix << "Stop" << endl;
break;
-
+
case MIDI::contineu:
o << trace_prefix << "Continue" << endl;
break;
-
+
case active:
o << trace_prefix << "Active Sense" << endl;
break;
-
+
default:
o << trace_prefix << "Unrecognized MIDI message" << endl;
break;
@@ -611,7 +611,7 @@ MidiDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can_
if (_processed) {
return 0;
}
-
+
commit_should_unlock = false;
check_record_status (transport_frame, nframes, can_record);
@@ -700,7 +700,7 @@ MidiDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can_
assert(ev.buffer());
_capture_buf->write(ev.time() + transport_frame, ev.type(), ev.size(), ev.buffer());
}
-
+
} else {
if (was_recording) {
@@ -741,7 +741,7 @@ MidiDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can_
commit_should_unlock = false;
state_lock.unlock();
- }
+ }
return ret;
}
@@ -771,7 +771,7 @@ MidiDiskstream::commit (nframes_t nframes)
/*cerr << "MDS written: " << frames_written << " - read: " << frames_read <<
" = " << frames_written - frames_read
<< " + " << nframes << " < " << midi_readahead << " = " << need_butler << ")" << endl;*/
-
+
if (commit_should_unlock) {
state_lock.unlock();
}
@@ -785,9 +785,9 @@ void
MidiDiskstream::set_pending_overwrite (bool yn)
{
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
-
+
pending_overwrite = yn;
-
+
overwrite_frame = playback_sample;
}
@@ -806,7 +806,7 @@ MidiDiskstream::seek (nframes_t frame, bool complete_refill)
{
Glib::Mutex::Lock lm (state_lock);
int ret = -1;
-
+
_playback_buf->reset();
_capture_buf->reset();
g_atomic_int_set(&_frames_read_from_ringbuffer, 0);
@@ -844,7 +844,7 @@ MidiDiskstream::internal_playback_seek (nframes_t distance)
/** @a start is set to the new frame position (TIME) read up to */
int
MidiDiskstream::read (nframes_t& start, nframes_t dur, bool reversed)
-{
+{
nframes_t this_read = 0;
bool reloop = false;
nframes_t loop_end = 0;
@@ -854,23 +854,23 @@ MidiDiskstream::read (nframes_t& start, nframes_t dur, bool reversed)
if (!reversed) {
/* Make the use of a Location atomic for this read operation.
-
+
Note: Locations don't get deleted, so all we care about
when I say "atomic" is that we are always pointing to
the same one and using a start/length values obtained
just once.
*/
-
+
if ((loc = loop_location) != 0) {
loop_start = loc->start();
loop_end = loc->end();
loop_length = loop_end - loop_start;
}
-
+
/* if we are looping, ensure that the first frame we read is at the correct
position within the loop.
*/
-
+
if (loc && (start >= loop_end)) {
//cerr << "start adjusted from " << start;
start = loop_start + ((start - loop_start) % loop_length);
@@ -908,7 +908,7 @@ MidiDiskstream::read (nframes_t& start, nframes_t dur, bool reversed)
g_atomic_int_add(&_frames_written_to_ringbuffer, this_read);
_read_data_count = _playlist->read_data_count();
-
+
if (reversed) {
// Swap note ons with note offs here. etc?
@@ -916,21 +916,21 @@ MidiDiskstream::read (nframes_t& start, nframes_t dur, bool reversed)
// CC values etc. hard.
} else {
-
+
/* if we read to the end of the loop, go back to the beginning */
-
+
if (reloop) {
// Synthesize LoopEvent here, because the next events
// written will have non-monotonic timestamps.
_playback_buf->write(loop_end - 1, LoopEventType, 0, 0);
- cout << "Pushing LoopEvent ts=" << loop_end-1
+ cout << "Pushing LoopEvent ts=" << loop_end-1
<< " start+this_read " << start+this_read << endl;
start = loop_start;
} else {
start += this_read;
}
- }
+ }
dur -= this_read;
//offset += this_read;
@@ -955,7 +955,7 @@ MidiDiskstream::do_refill ()
if (write_space == 0) {
return 0;
}
-
+
if (reversed) {
return 0;
}
@@ -984,11 +984,11 @@ MidiDiskstream::do_refill ()
// << frames_written - frames_read << endl;
to_read = min(to_read, (max_frames - file_frame));
-
+
if (read (file_frame, to_read, reversed)) {
ret = -1;
}
-
+
return ret;
}
@@ -998,7 +998,7 @@ MidiDiskstream::do_refill ()
* of data to disk. it will never write more than that. If it writes that
* much and there is more than that waiting to be written, it will return 1,
* otherwise 0 on success or -1 on failure.
- *
+ *
* If there is less than disk_io_chunk_frames to be written, no data will be
* written at all unless @a force_flush is true.
*/
@@ -1012,7 +1012,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
_write_data_count = 0;
total = _session.transport_frame() - _last_flush_frame;
-
+
if (_last_flush_frame > _session.transport_frame()
|| _last_flush_frame < capture_start_frame) {
_last_flush_frame = _session.transport_frame();
@@ -1036,7 +1036,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
if (total >= 2 * disk_io_chunk_frames || ((force_flush || !was_recording) && total > disk_io_chunk_frames)) {
ret = 1;
- }
+ }
to_write = disk_io_chunk_frames;
@@ -1072,7 +1072,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a
finish_capture (true);
- /* butler is already stopped, but there may be work to do
+ /* butler is already stopped, but there may be work to do
to flush remaining data to disk.
*/
@@ -1116,7 +1116,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a
}
/* figure out the name for this take */
-
+
srcs.push_back (_write_source);
_write_source->set_timeline_position (capture_info.front()->start);
_write_source->set_captured_for (_name);
@@ -1169,7 +1169,7 @@ MidiDiskstream::transport_stopped (struct tm& /*when*/, time_t /*twhen*/, bool a
error << _("MidiDiskstream: could not create region for captured midi!") << endmsg;
continue; /* XXX is this OK? */
}
-
+
region->GoingAway.connect (bind (mem_fun (*this, &Diskstream::remove_region_from_last_capture), boost::weak_ptr<Region>(region)));
_last_capture_regions.push_back (region);
@@ -1234,7 +1234,7 @@ void
MidiDiskstream::finish_capture (bool /*rec_monitors_input*/)
{
was_recording = false;
-
+
if (capture_captured == 0) {
return;
}
@@ -1243,12 +1243,12 @@ MidiDiskstream::finish_capture (bool /*rec_monitors_input*/)
assert(!destructive());
CaptureInfo* ci = new CaptureInfo;
-
+
ci->start = capture_start_frame;
ci->frames = capture_captured;
-
- /* XXX theoretical race condition here. Need atomic exchange ?
- However, the circumstances when this is called right
+
+ /* XXX theoretical race condition here. Need atomic exchange ?
+ However, the circumstances when this is called right
now (either on record-disable or transport_stopped)
mean that no actual race exists. I think ...
We now have a capture_info_lock, but it is only to be used
@@ -1270,7 +1270,7 @@ MidiDiskstream::set_record_enabled (bool yn)
}
assert(!destructive());
-
+
if (yn && _source_port == 0) {
/* pick up connections not initiated *from* the IO object
@@ -1299,7 +1299,7 @@ MidiDiskstream::engage_record_enable ()
bool rolling = _session.transport_speed() != 0.0f;
g_atomic_int_set (&_record_enabled, 1);
-
+
if (_source_port && Config->get_monitoring_model() == HardwareMonitoring) {
_source_port->request_monitor_input (!(_session.config.get_auto_input() && rolling));
}
@@ -1337,12 +1337,12 @@ MidiDiskstream::get_state ()
node->add_property ("flags", buf);
node->add_property("channel-mode", enum_2_string(get_channel_mode()));
-
+
snprintf (buf, sizeof(buf), "0x%x", get_channel_mask());
node->add_property("channel-mask", buf);
-
+
node->add_property ("playlist", _playlist->name());
-
+
snprintf (buf, sizeof(buf), "%f", _visible_speed);
node->add_property ("speed", buf);
@@ -1392,24 +1392,24 @@ MidiDiskstream::set_state (const XMLNode& node)
in_set_state = true;
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- /*if ((*niter)->name() == IO::state_node_name) {
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+ /*if ((*niter)->name() == IO::state_node_name) {
deprecated_io_node = new XMLNode (**niter);
- }*/
- assert ((*niter)->name() != IO::state_node_name);
+ }*/
+ assert ((*niter)->name() != IO::state_node_name);
if ((*niter)->name() == X_("CapturingSources")) {
capture_pending_node = *niter;
}
- }
+ }
/* prevent write sources from being created */
-
+
in_set_state = true;
-
+
if ((prop = node.property ("name")) != 0) {
_name = prop->value();
- }
+ }
if ((prop = node.property ("id")) != 0) {
_id = prop->value ();
@@ -1423,7 +1423,7 @@ MidiDiskstream::set_state (const XMLNode& node)
if ((prop = node.property ("channel-mode")) != 0) {
channel_mode = ChannelMode (string_2_enum(prop->value(), channel_mode));
}
-
+
unsigned int channel_mask = 0xFFFF;
if ((prop = node.property ("channel-mask")) != 0) {
sscanf (prop->value().c_str(), "0x%x", &channel_mask);
@@ -1433,18 +1433,18 @@ MidiDiskstream::set_state (const XMLNode& node)
}
set_channel_mode(channel_mode, channel_mask);
-
+
if ((prop = node.property ("channels")) != 0) {
nchans = atoi (prop->value().c_str());
}
-
+
if ((prop = node.property ("playlist")) == 0) {
return -1;
}
{
bool had_playlist = (_playlist != 0);
-
+
if (find_and_use_playlist (prop->value())) {
return -1;
}
@@ -1452,7 +1452,7 @@ MidiDiskstream::set_state (const XMLNode& node)
if (!had_playlist) {
_playlist->set_orig_diskstream_id (_id);
}
-
+
if (capture_pending_node) {
use_pending_capture_data (*capture_pending_node);
}
@@ -1474,10 +1474,10 @@ MidiDiskstream::set_state (const XMLNode& node)
// FIXME?
//_capturing_source = 0;
- /* write sources are handled when we handle the input set
+ /* write sources are handled when we handle the input set
up of the IO that owns this DS (::non_realtime_input_change())
*/
-
+
in_set_state = false;
return 0;
@@ -1507,7 +1507,7 @@ MidiDiskstream::use_new_write_source (uint32_t n)
if (!_write_source) {
throw failed_constructor();
}
- }
+ }
catch (failed_constructor &err) {
error << string_compose (_("%1:%2 new capture file not initialized correctly"), _name, n) << endmsg;
@@ -1532,7 +1532,7 @@ MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
}
use_new_write_source (0);
-
+
if (record_enabled()) {
//_capturing_sources.push_back (_write_source);
}
@@ -1575,7 +1575,7 @@ MidiDiskstream::set_align_style_from_io ()
}
get_input_sources ();
-
+
if (_source_port && _source_port->flags() & JackPortIsPhysical) {
have_physical = true;
}
@@ -1616,7 +1616,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, nframes_t start, nframes_t end)
{
dst.clear();
assert(dst.size() == 0);
-
+
// Reverse. ... We just don't do reverse, ok? Back off.
if (end <= start) {
return;
@@ -1633,7 +1633,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, nframes_t start, nframes_t end)
<< " readspace " << _playback_buf->read_space()
<< " writespace " << _playback_buf->write_space() << endl;
#endif
-
+
gint32 frames_read = end - start;
g_atomic_int_add(&_frames_read_from_ringbuffer, frames_read);
}
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 79e59ecde4..fb09cda60f 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -146,7 +146,7 @@ MidiModel::DeltaCommand::operator()()
for (NoteList::iterator i = _removed_notes.begin(); i != _removed_notes.end(); ++i) {
_model->remove_note_unlocked(*i);
}
-
+
_model->write_unlock();
_model->ContentsChanged(); /* EMIT SIGNAL */
}
@@ -156,7 +156,7 @@ MidiModel::DeltaCommand::undo()
{
// This could be made much faster by using a priority_queue for added and
// removed notes (or sort here), and doing a single iteration over _model
-
+
Glib::Mutex::Lock lm (_model->_midi_source->mutex());
_model->_midi_source->invalidate(); // release model read lock
_model->write_lock();
@@ -411,7 +411,7 @@ MidiModel::DiffCommand::operator()()
break;
}
}
-
+
_model->write_unlock();
_model->ContentsChanged(); /* EMIT SIGNAL */
}
@@ -452,7 +452,7 @@ XMLNode&
MidiModel::DiffCommand::marshal_change(const NotePropertyChange& change)
{
XMLNode* xml_change = new XMLNode("change");
-
+
/* first, the change itself */
xml_change->add_property ("property", enum_2_string (change.property));
@@ -480,13 +480,13 @@ MidiModel::DiffCommand::marshal_change(const NotePropertyChange& change)
/* now the rest of the note */
const SMFSource* smf = dynamic_cast<const SMFSource*> (_model->midi_source());
-
+
if (change.property != NoteNumber) {
ostringstream note_str;
note_str << int(change.note->note());
xml_change->add_property("note", note_str.str());
}
-
+
if (change.property != Channel) {
ostringstream channel_str;
channel_str << int(change.note->channel());
@@ -631,7 +631,7 @@ MidiModel::DiffCommand::unmarshal_change(XMLNode *xml_change)
/* we must point at the instance of the note that is actually in the model.
so go look for it ...
*/
-
+
boost::shared_ptr<Evoral::Note<TimeType> > new_note (new Evoral::Note<TimeType> (channel, time, length, note, velocity));
change.note = _model->find_note (new_note);
@@ -696,13 +696,13 @@ MidiModel::write_to(boost::shared_ptr<MidiSource> source)
set_percussive(false);
source->drop_model();
-
+
for (Evoral::Sequence<TimeType>::const_iterator i = begin(); i != end(); ++i) {
source->append_event_unlocked_beats(*i);
}
-
+
set_percussive(old_percussive);
-
+
read_unlock();
set_edited(false);
@@ -717,14 +717,14 @@ MidiModel::get_state()
}
boost::shared_ptr<Evoral::Note<MidiModel::TimeType> >
-MidiModel::find_note (boost::shared_ptr<Evoral::Note<TimeType> > other)
+MidiModel::find_note (boost::shared_ptr<Evoral::Note<TimeType> > other)
{
for (Notes::iterator x = notes().begin(); x != notes().end(); ++x) {
if (**x == *other) {
return *x;
}
- /* XXX optimize by using a stored iterator and break out
+ /* XXX optimize by using a stored iterator and break out
when passed start time.
*/
}
diff --git a/libs/ardour/midi_patch_manager.cc b/libs/ardour/midi_patch_manager.cc
index 7c824b1e8d..a0ccbdec9e 100644
--- a/libs/ardour/midi_patch_manager.cc
+++ b/libs/ardour/midi_patch_manager.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Hans Baier
+ Copyright (C) 2008 Hans Baier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ MidiPatchManager::set_session (Session& s)
{
_session = &s;
_session->GoingAway.connect (mem_fun (*this, &MidiPatchManager::drop_session));
-
+
refresh();
}
@@ -56,27 +56,27 @@ MidiPatchManager::refresh()
_documents.clear();
_master_devices_by_model.clear();
_all_models.clear();
-
+
path path_to_patches = _session->session_directory().midi_patch_path();
-
+
if (!exists(path_to_patches)) {
return;
}
-
+
assert(is_directory(path_to_patches));
-
+
Glib::PatternSpec pattern(Glib::ustring("*.midnam"));
vector<path> result;
-
+
find_matching_files_in_directory(path_to_patches, pattern, result);
cerr << "Loading " << result.size() << " MIDI patches from " << path_to_patches.to_string() << endl;
-
+
for (vector<path>::iterator i = result.begin(); i != result.end(); ++i) {
boost::shared_ptr<MIDINameDocument> document(new MIDINameDocument(i->to_string()));
- for (MIDINameDocument::MasterDeviceNamesList::const_iterator device =
+ for (MIDINameDocument::MasterDeviceNamesList::const_iterator device =
document->master_device_names_by_model().begin();
- device != document->master_device_names_by_model().end();
+ device != document->master_device_names_by_model().end();
++device) {
//cerr << "got model " << device->first << endl;
// have access to the documents by model name
@@ -84,7 +84,7 @@ MidiPatchManager::refresh()
// build a list of all master devices from all documents
_master_devices_by_model[device->first] = device->second;
_all_models.push_back(device->first);
-
+
// make sure there are no double model names
// TODO: handle this gracefully.
assert(_documents.count(device->first) == 1);
diff --git a/libs/ardour/midi_playlist.cc b/libs/ardour/midi_playlist.cc
index 82f8827f21..cc72a630ba 100644
--- a/libs/ardour/midi_playlist.cc
+++ b/libs/ardour/midi_playlist.cc
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006 Paul Davis
- Written by Dave Robillard, 2006
+ Copyright (C) 2006 Paul Davis
+ Written by Dave Robillard, 2006
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -109,10 +109,10 @@ MidiPlaylist::MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes
MidiPlaylist::~MidiPlaylist ()
{
- GoingAway (); /* EMIT SIGNAL */
-
+ GoingAway (); /* EMIT SIGNAL */
+
/* drop connections to signals */
-
+
notify_callbacks ();
}
@@ -294,7 +294,7 @@ MidiPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> reg
}
// Feeling rather uninterested today, but thanks for the heads up anyway!
-
+
Change our_interests = Change (/*MidiRegion::FadeInChanged|
MidiRegion::FadeOutChanged|
MidiRegion::FadeInActiveChanged|
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index b07eb84f1b..880c1b5474 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ MidiPort::cycle_start (nframes_t nframes)
{
_buffer->clear ();
assert (_buffer->size () == 0);
-
+
if (sends_output ()) {
jack_midi_clear_buffer (jack_port_get_buffer (_jack_port, nframes));
}
@@ -59,34 +59,34 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
void* jack_buffer = jack_port_get_buffer (_jack_port, nframes);
const nframes_t event_count = jack_midi_get_event_count(jack_buffer);
-
+
assert (event_count < _buffer->capacity());
/* suck all relevant MIDI events from the JACK MIDI port buffer
into our MidiBuffer
*/
-
+
nframes_t off = offset + _port_offset;
for (nframes_t i = 0; i < event_count; ++i) {
-
+
jack_midi_event_t ev;
jack_midi_event_get (&ev, jack_buffer, i);
-
+
if (ev.time > off && ev.time < off+nframes) {
_buffer->push_back (ev);
}
}
-
+
if (nframes) {
_has_been_mixed_down = true;
}
-
+
} else {
_buffer->silence (nframes);
}
-
+
if (nframes) {
_has_been_mixed_down = true;
}
@@ -94,7 +94,7 @@ MidiPort::get_midi_buffer (nframes_t nframes, nframes_t offset)
return *_buffer;
}
-
+
void
MidiPort::cycle_end (nframes_t /*nframes*/)
{
@@ -111,7 +111,7 @@ void
MidiPort::flush_buffers (nframes_t nframes, nframes_t offset)
{
if (sends_output ()) {
-
+
void* jack_buffer = jack_port_get_buffer (_jack_port, nframes);
for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc
index aca8d039ad..87c7d656e7 100644
--- a/libs/ardour/midi_region.cc
+++ b/libs/ardour/midi_region.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -123,7 +123,7 @@ MidiRegion::set_position_internal (nframes_t pos, bool allow_bbt_recompute)
double length_beats = old_converter.from(_length);
Region::set_position_internal(pos, allow_bbt_recompute);
-
+
BeatsFramesConverter new_converter(_session, pos - _start);
set_length(new_converter.to(length_beats), 0);
@@ -151,7 +151,7 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, MidiRingBuffer<nframes_t>& dst
/* precondition: caller has verified that we cover the desired section */
assert(chan_n == 0);
-
+
if (position < _position) {
internal_offset = 0;
src_offset = _position - position;
@@ -164,7 +164,7 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, MidiRingBuffer<nframes_t>& dst
if (internal_offset >= _length) {
return 0; /* read nothing */
}
-
+
if ((to_read = min (dur, _length - internal_offset)) == 0) {
return 0; /* read nothing */
}
@@ -189,15 +189,15 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, MidiRingBuffer<nframes_t>& dst
} else {
// when _start is greater than _position, we have to subtract
// _start from the note times in the midi source
- negative_output_buffer_position = _start;
+ negative_output_buffer_position = _start;
}
-#if 0
+#if 0
cerr << "\t\tsource read from " << _position << " - " << _start << " (" << _position - _start << ") "
<< " start in source " << _start << " + " << internal_offset << " (" << _start + internal_offset << ") "
- << " dur = " << to_read
- << " offset = " << output_buffer_position
- << " negoffset = " << negative_output_buffer_position
+ << " dur = " << to_read
+ << " offset = " << output_buffer_position
+ << " negoffset = " << negative_output_buffer_position
<< endl;
#endif
@@ -216,7 +216,7 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, MidiRingBuffer<nframes_t>& dst
return to_read;
}
-
+
XMLNode&
MidiRegion::state (bool full)
{
@@ -224,11 +224,11 @@ MidiRegion::state (bool full)
char buf[64];
char buf2[64];
LocaleGuard lg (X_("POSIX"));
-
+
node.add_property ("flags", enum_2_string (_flags));
// XXX these should move into Region
-
+
for (uint32_t n=0; n < _sources.size(); ++n) {
snprintf (buf2, sizeof(buf2), "source-%d", n);
_sources[n]->id().print (buf, sizeof(buf));
@@ -257,7 +257,7 @@ MidiRegion::set_live_state (const XMLNode& node, Change& what_changed, bool send
Region::set_live_state (node, what_changed, false);
uint32_t old_flags = _flags;
-
+
if ((prop = node.property ("flags")) != 0) {
_flags = Flag (string_2_enum (prop->value(), _flags));
@@ -302,7 +302,7 @@ MidiRegion::recompute_at_end ()
* (non destructively) "chop" notes that pass the end boundary, to
* prevent stuck notes.
*/
-}
+}
void
MidiRegion::recompute_at_start ()
diff --git a/libs/ardour/midi_ring_buffer.cc b/libs/ardour/midi_ring_buffer.cc
index e5e01cc8cb..f886eb8443 100644
--- a/libs/ardour/midi_ring_buffer.cc
+++ b/libs/ardour/midi_ring_buffer.cc
@@ -46,7 +46,7 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
while (this->read_space() >= sizeof(T) + sizeof(Evoral::EventType) + sizeof(uint32_t)) {
this->full_peek(sizeof(T), (uint8_t*)&ev_time);
-
+
if (ev_time > end) {
// cerr << "MRB event @ " << ev_time << " past end @ " << end << endl;
break;
@@ -85,7 +85,7 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
continue;
}
}
-
+
assert(ev_time >= start);
ev_time -= start;
ev_time += offset;
@@ -96,10 +96,10 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
// cerr << "MRB: Unable to reserve space in buffer, event skipped";
continue;
}
-
+
// write MIDI buffer contents
success = Evoral::EventRingBuffer<T>::full_read(ev_size, write_loc);
-
+
#if 0
cerr << "wrote MidiEvent to Buffer: " << hex;
for (size_t i=0; i < ev_size; ++i) {
@@ -117,12 +117,12 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
cerr << "WARNING: error reading event contents from MIDI ring" << endl;
}
}
-
+
return count;
}
template<typename T>
void
-MidiRingBuffer<T>::dump(ostream& str)
+MidiRingBuffer<T>::dump(ostream& str)
{
size_t rspace;
@@ -137,21 +137,21 @@ MidiRingBuffer<T>::dump(ostream& str)
size_t read_ptr = g_atomic_int_get (&this->_read_ptr);
str << "Dump @ " << read_ptr << endl;
-
+
while (1) {
uint8_t* wp;
uint8_t* data;
size_t write_ptr;
#define space(r,w) ((w > r) ? (w - r) : ((w - r + this->_size) % this->_size))
-
+
write_ptr = g_atomic_int_get (&this->_write_ptr);
if (space (read_ptr, write_ptr) < sizeof (T)) {
break;
}
wp = &this->_buf[read_ptr];
- memcpy (&ev_time, wp, sizeof (T));
+ memcpy (&ev_time, wp, sizeof (T));
read_ptr = (read_ptr + sizeof (T)) % this->_size;
str << "time " << ev_time;
@@ -161,7 +161,7 @@ MidiRingBuffer<T>::dump(ostream& str)
}
wp = &this->_buf[read_ptr];
- memcpy (&ev_type, wp, sizeof (ev_type));
+ memcpy (&ev_type, wp, sizeof (ev_type));
read_ptr = (read_ptr + sizeof (ev_type)) % this->_size;
str << " type " << ev_type;
@@ -172,7 +172,7 @@ MidiRingBuffer<T>::dump(ostream& str)
}
wp = &this->_buf[read_ptr];
- memcpy (&ev_size, wp, sizeof (ev_size));
+ memcpy (&ev_size, wp, sizeof (ev_size));
read_ptr = (read_ptr + sizeof (ev_size)) % this->_size;
str << " size " << ev_size;
@@ -181,11 +181,11 @@ MidiRingBuffer<T>::dump(ostream& str)
str << "!OUT!\n";
break;
}
-
+
data = new uint8_t[ev_size];
-
+
wp = &this->_buf[read_ptr];
- memcpy (data, wp, ev_size);
+ memcpy (data, wp, ev_size);
read_ptr = (read_ptr + ev_size) % this->_size;
for (uint32_t i = 0; i != ev_size; ++i) {
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index 4da2dbb845..f92d6a2a4f 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -60,7 +60,7 @@ MidiSource::MidiSource (Session& s, string name, Source::Flag flags)
{
}
-MidiSource::MidiSource (Session& s, const XMLNode& node)
+MidiSource::MidiSource (Session& s, const XMLNode& node)
: Source (s, node)
, _read_data_count(0)
, _write_data_count(0)
@@ -177,7 +177,7 @@ MidiSource::file_changed (string path)
struct stat stat_file;
int e1 = stat (path.c_str(), &stat_file);
-
+
return !e1;
}
@@ -252,7 +252,7 @@ MidiSource::session_saved()
// cyclic dependency here, ugly :(
newsrc->set_model(_model);
_model->set_midi_source(newsrc.get());
-
+
newsrc->flush_midi();
Switched.emit(newsrc);
diff --git a/libs/ardour/midi_state_tracker.cc b/libs/ardour/midi_state_tracker.cc
index e25dbdd094..69d1807623 100644
--- a/libs/ardour/midi_state_tracker.cc
+++ b/libs/ardour/midi_state_tracker.cc
@@ -1,17 +1,17 @@
/*
- Copyright (C) 2006-2008 Paul Davis
+ Copyright (C) 2006-2008 Paul Davis
Author: Torben Hohn
-
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -73,8 +73,8 @@ MidiStateTracker::resolve_notes (MidiBuffer &dst, nframes_t time)
uint8_t buffer[3] = { MIDI_CMD_NOTE_OFF | channel, note, 0 };
Evoral::MIDIEvent<MidiBuffer::TimeType> noteoff
(time, MIDI_CMD_NOTE_OFF, 3, buffer, false);
-
- dst.push_back (noteoff);
+
+ dst.push_back (noteoff);
_active_notes[channel * 128 + note]--;
}
}
diff --git a/libs/ardour/midi_stretch.cc b/libs/ardour/midi_stretch.cc
index ea5ab62d02..9cd1321a12 100644
--- a/libs/ardour/midi_stretch.cc
+++ b/libs/ardour/midi_stretch.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Dave Robillard
This program is free software; you can redistribute it and/or modify
@@ -54,9 +54,9 @@ MidiStretch::run (boost::shared_ptr<Region> r)
/* the name doesn't need to be super-precise, but allow for 2 fractional
digits just to disambiguate close but not identical stretches.
*/
-
+
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (_request.time_fraction * 100.0f));
-
+
string new_name = region->name();
string::size_type at = new_name.find ('@');
@@ -67,15 +67,15 @@ MidiStretch::run (boost::shared_ptr<Region> r)
}
new_name += suffix;
-
+
/* create new sources */
-
+
if (make_new_sources (region, nsrcs, suffix))
return -1;
// FIXME: how to make a whole file region if it isn't?
//assert(region->whole_file());
-
+
boost::shared_ptr<MidiSource> src = region->midi_source(0);
src->load_model();
@@ -87,11 +87,11 @@ MidiStretch::run (boost::shared_ptr<Region> r)
new_src->load_model(true, true);
boost::shared_ptr<MidiModel> new_model = new_src->model();
new_model->start_write();
-
+
for (Evoral::Sequence<MidiModel::TimeType>::const_iterator i = old_model->begin();
i != old_model->end(); ++i) {
const double new_time = i->time() * _request.time_fraction;
-
+
// FIXME: double copy
Evoral::Event<MidiModel::TimeType> ev(*i, true);
ev.time() = new_time;
@@ -100,9 +100,9 @@ MidiStretch::run (boost::shared_ptr<Region> r)
new_model->end_write();
new_model->set_edited(true);
-
+
const int ret = finish (region, nsrcs, new_name);
-
+
results[0]->set_length((nframes_t) floor (r->length() * _request.time_fraction), NULL);
return ret;
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index bc6ea5fe58..c399cc94dd 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
By Dave Robillard, 2006
This program is free software; you can redistribute it and/or modify
@@ -99,7 +99,7 @@ MidiTrack::use_new_diskstream ()
_session.add_diskstream (ds);
set_diskstream (boost::dynamic_pointer_cast<MidiDiskstream> (ds));
-}
+}
int
MidiTrack::set_diskstream (boost::shared_ptr<MidiDiskstream> ds)
@@ -117,9 +117,9 @@ MidiTrack::set_diskstream (boost::shared_ptr<MidiDiskstream> ds)
DiskstreamChanged (); /* EMIT SIGNAL */
return 0;
-}
+}
-int
+int
MidiTrack::use_diskstream (string name)
{
boost::shared_ptr<MidiDiskstream> dstream;
@@ -130,21 +130,21 @@ MidiTrack::use_diskstream (string name)
error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), name) << endmsg;
return -1;
}
-
+
cerr << "\n\n\nMIDI found DS\n";
return set_diskstream (dstream);
}
-int
+int
MidiTrack::use_diskstream (const PBD::ID& id)
{
boost::shared_ptr<MidiDiskstream> dstream;
if ((dstream = boost::dynamic_pointer_cast<MidiDiskstream> (_session.diskstream_by_id (id))) == 0) {
- error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), id) << endmsg;
+ error << string_compose(_("MidiTrack: midi diskstream \"%1\" not known by session"), id) << endmsg;
return -1;
}
-
+
return set_diskstream (dstream);
}
@@ -169,10 +169,10 @@ MidiTrack::_set_state (const XMLNode& node, bool call_base)
if (Route::_set_state (node, call_base)) {
return -1;
}
-
+
// No destructive MIDI tracks (yet?)
_mode = Normal;
-
+
if ((prop = node.property (X_("note-mode"))) != 0) {
_note_mode = NoteMode (string_2_enum (prop->value(), _note_mode));
} else {
@@ -188,7 +188,7 @@ MidiTrack::_set_state (const XMLNode& node, bool call_base)
}
if ((prop = node.property ("diskstream-id")) == 0) {
-
+
/* some old sessions use the diskstream name rather than the ID */
if ((prop = node.property ("diskstream")) == 0) {
@@ -202,10 +202,10 @@ MidiTrack::_set_state (const XMLNode& node, bool call_base)
}
} else {
-
+
PBD::ID id (prop->value());
PBD::ID zero ("0");
-
+
/* this wierd hack is used when creating tracks from a template. there isn't
a particularly good time to interpose between setting the first part of
the track state (notably Route::set_state() and the track mode), and the
@@ -215,7 +215,7 @@ MidiTrack::_set_state (const XMLNode& node, bool call_base)
*/
cerr << "\n\n\n\n MIDI track " << name() << " found DS id " << id << endl;
-
+
if (id == zero) {
use_new_diskstream ();
} else if (use_diskstream (id)) {
@@ -248,7 +248,7 @@ MidiTrack::_set_state (const XMLNode& node, bool call_base)
return 0;
}
-XMLNode&
+XMLNode&
MidiTrack::state(bool full_state)
{
XMLNode& root (Route::state(full_state));
@@ -267,7 +267,7 @@ MidiTrack::state(bool full_state)
(*i)->id.print (buf, sizeof(buf));
inode->add_property (X_("id"), buf);
inode->add_child_copy ((*i)->state);
-
+
freeze_node->add_child_nocopy (*inode);
}
@@ -275,14 +275,14 @@ MidiTrack::state(bool full_state)
}
/* Alignment: act as a proxy for the diskstream */
-
+
XMLNode* align_node = new XMLNode (X_("Alignment"));
AlignStyle as = _diskstream->alignment_style ();
align_node->add_property (X_("style"), enum_2_string (as));
root.add_child_nocopy (*align_node);
root.add_property (X_("note-mode"), enum_2_string (_note_mode));
-
+
/* we don't return diskstream state because we don't
own the diskstream exclusively. control of the diskstream
state is ceded to the Session, even if we create the
@@ -291,7 +291,7 @@ MidiTrack::state(bool full_state)
_diskstream->id().print (buf, sizeof(buf));
root.add_property ("diskstream-id", buf);
-
+
root.add_child_nocopy (_rec_enable_control->get_state());
root.add_property ("step-editing", (_step_editing ? "yes" : "no"));
@@ -299,7 +299,7 @@ MidiTrack::state(bool full_state)
root.add_property ("midi-thru", (_midi_thru ? "yes" : "no"));
snprintf (buf, sizeof (buf), "%d", (int) _default_channel);
root.add_property ("default-channel", buf);
-
+
return root;
}
@@ -321,12 +321,12 @@ MidiTrack::set_state_part_two ()
if ((fnode = find_named_node (*pending_state, X_("freeze-info"))) != 0) {
_freeze_record.state = Frozen;
-
+
for (vector<FreezeRecordProcessorInfo*>::iterator i = _freeze_record.processor_info.begin(); i != _freeze_record.processor_info.end(); ++i) {
delete *i;
}
_freeze_record.processor_info.clear ();
-
+
if ((prop = fnode->property (X_("playlist"))) != 0) {
boost::shared_ptr<Playlist> pl = _session.playlist_by_name (prop->value());
if (pl) {
@@ -337,23 +337,23 @@ MidiTrack::set_state_part_two ()
return;
}
}
-
+
if ((prop = fnode->property (X_("state"))) != 0) {
_freeze_record.state = FreezeState (string_2_enum (prop->value(), _freeze_record.state));
}
-
+
XMLNodeConstIterator citer;
XMLNodeList clist = fnode->children();
-
+
for (citer = clist.begin(); citer != clist.end(); ++citer) {
if ((*citer)->name() != X_("processor")) {
continue;
}
-
+
if ((prop = (*citer)->property (X_("id"))) == 0) {
continue;
}
-
+
FreezeRecordProcessorInfo* frii = new FreezeRecordProcessorInfo (*((*citer)->children().front()),
boost::shared_ptr<Processor>());
frii->id = prop->value ();
@@ -384,7 +384,7 @@ MidiTrack::set_state_part_two ()
}
}
return;
-}
+}
int
MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick,
@@ -392,7 +392,7 @@ MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
{
int dret;
boost::shared_ptr<MidiDiskstream> diskstream = midi_diskstream();
-
+
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
if (lm.locked()) {
@@ -413,14 +413,14 @@ MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
nframes_t transport_frame = _session.transport_frame();
-
+
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
playback distance to zero, thus causing diskstream::commit
to do nothing.
*/
return diskstream->process (transport_frame, 0, can_record, rec_monitors_input);
- }
+ }
_silent = false;
@@ -442,7 +442,7 @@ MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
*/
passthru (start_frame, end_frame, nframes, 0);
-
+
} else {
/*
XXX is it true that the earlier test on n_outputs()
@@ -458,12 +458,12 @@ MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
//const size_t limit = n_process_buffers().n_audio();
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
MidiBuffer& mbuf (bufs.get_midi (0));
-
+
diskstream->get_playback (mbuf, start_frame, end_frame);
/* append immediate messages to the first MIDI buffer (thus sending it to the first output port) */
- write_out_of_band_data (bufs, start_frame, end_frame, nframes);
+ write_out_of_band_data (bufs, start_frame, end_frame, nframes);
// Feed the data through the MidiStateTracker
bool did_loop;
@@ -487,7 +487,7 @@ MidiTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
int
-MidiTrack::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+MidiTrack::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
bool state_changing, bool can_record, bool rec_monitors_input)
{
int ret = Track::no_roll (nframes, start_frame, end_frame, state_changing, can_record, rec_monitors_input);
@@ -499,13 +499,13 @@ MidiTrack::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_fram
return ret;
}
-void
+void
MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_processors)
{
/* turn off any notes that are on */
- MidiBuffer buf (1024); // XXX is this a reasonable size ?
-
+ MidiBuffer buf (1024); // XXX is this a reasonable size ?
+
_midi_state_tracker.resolve_notes (buf, 0); // time is zero because notes are immediate
for (MidiBuffer::iterator i = buf.begin(); i != buf.end(); ++i) {
@@ -514,7 +514,7 @@ MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_pro
Route::handle_transport_stopped (abort, did_locate, flush_processors);
}
-
+
void
MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
@@ -530,7 +530,7 @@ MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
for (MidiBuffer::const_iterator e = mb->begin(); e != mb->end(); ++e) {
const Evoral::MIDIEvent<nframes_t> ev(*e, false);
-
+
/* we don't care about the time for this purpose */
_step_edit_ring_buffer.write (0, ev.type(), ev.size(), ev.buffer());
@@ -605,7 +605,7 @@ MidiTrack::set_note_mode (NoteMode m)
}
void
-MidiTrack::midi_panic()
+MidiTrack::midi_panic()
{
for (uint8_t channel = 0; channel <= 0xF; channel++) {
uint8_t ev[3] = { MIDI_CMD_CONTROL | channel, MIDI_CTL_SUSTAIN, 0 };
@@ -645,7 +645,7 @@ MidiTrack::MidiControl::set_value(float val)
} else {
valid = true;
}
-
+
if (!valid) {
return;
}
@@ -661,25 +661,25 @@ MidiTrack::MidiControl::set_value(float val)
ev[1] = _list->parameter().id();
ev[2] = int(val);
break;
-
+
case MidiPgmChangeAutomation:
size = 2;
ev[0] += MIDI_CMD_PGM_CHANGE;
ev[1] = int(val);
break;
-
+
case MidiChannelPressureAutomation:
size = 2;
ev[0] += MIDI_CMD_CHANNEL_PRESSURE;
ev[1] = int(val);
break;
-
+
case MidiPitchBenderAutomation:
ev[0] += MIDI_CMD_BENDER;
ev[1] = 0x7F & int(val);
ev[2] = 0x7F & (int(val) >> 7);
break;
-
+
default:
assert(false);
}
@@ -687,7 +687,7 @@ MidiTrack::MidiControl::set_value(float val)
}
AutomationControl::set_value(val);
-}
+}
void
MidiTrack::set_step_editing (bool yn)
diff --git a/libs/ardour/mix.cc b/libs/ardour/mix.cc
index 0bdbf7aa1b..c058dec06b 100644
--- a/libs/ardour/mix.cc
+++ b/libs/ardour/mix.cc
@@ -30,7 +30,7 @@ using namespace ARDOUR;
// Debug wrappers
float
-debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
+debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current)
{
if ( ((intptr_t)buf % 16) != 0) {
std::cerr << "compute_peak(): buffer unaligned!" << std::endl;
@@ -83,14 +83,14 @@ debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t n
float
-default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
+default_compute_peak (const ARDOUR::Sample * buf, nframes_t nsamples, float current)
{
for (nframes_t i = 0; i < nsamples; ++i) {
current = f_max (current, fabsf (buf[i]));
}
return current;
-}
+}
void
default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, float *max)
@@ -101,7 +101,7 @@ default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, f
a = *max;
b = *min;
- for (i = 0; i < nframes; i++)
+ for (i = 0; i < nframes; i++)
{
a = fmax (buf[i], a);
b = fmin (buf[i], b);
@@ -113,7 +113,7 @@ default_find_peaks (const ARDOUR::Sample * buf, nframes_t nframes, float *min, f
void
default_apply_gain_to_buffer (ARDOUR::Sample * buf, nframes_t nframes, float gain)
-{
+{
for (nframes_t i=0; i<nframes; i++)
buf[i] *= gain;
}
@@ -173,5 +173,5 @@ veclib_mix_buffers_no_gain (ARDOUR::Sample * dst, const ARDOUR::Sample * src, nf
}
#endif
-
+
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index 587d6007b3..a97b8aa658 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-4 Paul Davis
+ Copyright (C) 2002-4 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@ using namespace sigc;
using namespace MIDI;
using namespace PBD;
-MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
+MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
: session (s)
{
can_notify_on_unknown_rate = true;
@@ -93,14 +93,14 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full)
{
nframes_t now = session.engine().frame_time();
SMPTE::Time smpte;
-
+
smpte.hours = msg[3];
smpte.minutes = msg[2];
smpte.seconds = msg[1];
smpte.frames = msg[0];
last_mtc_fps_byte = msg[4];
-
+
switch (msg[4]) {
case MTC_24_FPS:
smpte.rate = 24;
@@ -126,7 +126,7 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full)
/* throttle error messages about unknown MTC rates */
if (can_notify_on_unknown_rate) {
error << string_compose (_("Unknown rate/drop value %1 in incoming MTC stream, session values used instead"),
- (int) msg[4])
+ (int) msg[4])
<< endmsg;
can_notify_on_unknown_rate = false;
}
@@ -135,42 +135,42 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full)
}
session.smpte_to_sample (smpte, mtc_frame, true, false);
-
+
if (was_full) {
-
- current.guard1++;
- current.position = mtc_frame;
- current.timestamp = 0;
- current.guard2++;
-
- session.request_locate (mtc_frame, false);
+
+ current.guard1++;
+ current.position = mtc_frame;
+ current.timestamp = 0;
+ current.guard2++;
+
+ session.request_locate (mtc_frame, false);
session.request_transport_speed (0);
- update_mtc_status (MIDI::Parser::MTC_Stopped);
+ update_mtc_status (MIDI::Parser::MTC_Stopped);
+
+ reset ();
- reset ();
-
} else {
-
+
/* We received the last quarter frame 7 quarter frames (1.75 mtc
frames) after the instance when the contents of the mtc quarter
frames were decided. Add time to compensate for the elapsed 1.75
frames.
- Also compensate for audio latency.
+ Also compensate for audio latency.
*/
mtc_frame += (long) (1.75 * session.frames_per_smpte_frame()) + session.worst_output_latency();
-
+
if (first_mtc_frame == 0) {
first_mtc_frame = mtc_frame;
first_mtc_time = now;
- }
-
+ }
+
current.guard1++;
current.position = mtc_frame;
current.timestamp = now;
current.guard2++;
}
-
+
last_inbound_frame = now;
}
@@ -178,7 +178,7 @@ void
MTC_Slave::handle_locate (const MIDI::byte* mmc_tc)
{
MIDI::byte mtc[5];
-
+
mtc[4] = last_mtc_fps_byte;
mtc[3] = mmc_tc[0] & 0xf; /* hrs only */
mtc[2] = mmc_tc[1];
@@ -257,7 +257,7 @@ MTC_Slave::ok() const
return true;
}
-bool
+bool
MTC_Slave::speed_and_position (double& speed, nframes_t& pos)
{
nframes_t now = session.engine().frame_time();
@@ -273,7 +273,7 @@ MTC_Slave::speed_and_position (double& speed, nframes_t& pos)
pos = last.position;
return true;
}
-
+
/* no timecode for 1/4 second ? conclude that its stopped */
if (last_inbound_frame && now > last_inbound_frame && now - last_inbound_frame > session.frame_rate() / 4) {
@@ -317,9 +317,9 @@ MTC_Slave::speed_and_position (double& speed, nframes_t& pos)
elapsed = 0;
} else {
-
+
/* scale elapsed time by the current MTC speed */
-
+
if (last.timestamp && (now > last.timestamp)) {
elapsed = (nframes_t) floor (mtc_speed * (now - last.timestamp));
} else {
@@ -348,9 +348,9 @@ MTC_Slave::reset ()
be being updated as we call this. but this
supposed to be a realtime-safe call.
*/
-
+
port->input()->reset_mtc_state ();
-
+
last_inbound_frame = 0;
current.guard1++;
current.position = 0;
diff --git a/libs/ardour/mtdm.cc b/libs/ardour/mtdm.cc
index c2a0e1e021..4e208a56f7 100644
--- a/libs/ardour/mtdm.cc
+++ b/libs/ardour/mtdm.cc
@@ -1,6 +1,6 @@
/*
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -18,25 +18,25 @@
#include <ardour/mtdm.h>
-MTDM::MTDM (void)
+MTDM::MTDM (void)
: _cnt (0)
, _inv (0)
{
int i;
Freq *F;
-
+
_freq [0].f = 4096;
_freq [1].f = 512;
_freq [2].f = 1088;
_freq [3].f = 1544;
_freq [4].f = 2049;
-
+
_freq [0].a = 0.2f;
_freq [1].a = 0.1f;
_freq [2].a = 0.1f;
_freq [3].a = 0.1f;
_freq [4].a = 0.1f;
-
+
for (i = 0, F = _freq; i < 5; i++, F++) {
F->p = 128;
F->xa = F->ya = 0.0f;
@@ -44,27 +44,27 @@ MTDM::MTDM (void)
}
}
-int
+int
MTDM::process (size_t len, float *ip, float *op)
{
int i;
float vip, vop, a, c, s;
Freq *F;
-
+
while (len--)
{
vop = 0.0f;
vip = *ip++;
for (i = 0, F = _freq; i < 5; i++, F++)
{
- a = 2 * (float) M_PI * (F->p & 65535) / 65536.0;
+ a = 2 * (float) M_PI * (F->p & 65535) / 65536.0;
F->p += F->f;
- c = cosf (a);
- s = -sinf (a);
+ c = cosf (a);
+ s = -sinf (a);
vop += F->a * s;
F->xa += s * vip;
F->ya += c * vip;
- }
+ }
*op++ = vop;
if (++_cnt == 16)
{
@@ -81,13 +81,13 @@ MTDM::process (size_t len, float *ip, float *op)
return 0;
}
-int
+int
MTDM::resolve ()
{
int i, k, m;
double d, e, f0, p;
Freq *F = _freq;
-
+
if (hypot (F->xf, F->yf) < 0.01) {
return -1;
}
@@ -120,13 +120,13 @@ MTDM::resolve ()
_err = e;
}
if (e > 0.4) {
- return 1;
+ return 1;
}
d += m * (k & 7);
m *= 8;
- }
+ }
_del = 16 * d;
-
+
return 0;
}
diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc
index db4b6ca178..9aea8f981a 100644
--- a/libs/ardour/mute_master.cc
+++ b/libs/ardour/mute_master.cc
@@ -1,6 +1,6 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/named_selection.cc b/libs/ardour/named_selection.cc
index dbb4a8ca4d..d2cf1c03a8 100644
--- a/libs/ardour/named_selection.cc
+++ b/libs/ardour/named_selection.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
+ Copyright (C) 2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@ sigc::signal<void,NamedSelection*> NamedSelection::NamedSelectionCreated;
typedef std::list<boost::shared_ptr<Playlist> > PlaylistList;
-NamedSelection::NamedSelection (string n, PlaylistList& l)
+NamedSelection::NamedSelection (string n, PlaylistList& l)
: name (n)
{
playlists = l;
@@ -65,7 +65,7 @@ NamedSelection::NamedSelection (Session& session, const XMLNode& node)
}
name = property->value();
-
+
if ((lists_node = find_named_node (node, "Playlists")) == 0) {
return;
}
@@ -126,6 +126,6 @@ NamedSelection::get_state ()
plnode->add_property ("name", (*i)->name());
child->add_child_nocopy (*plnode);
}
-
+
return *root;
}
diff --git a/libs/ardour/onset_detector.cc b/libs/ardour/onset_detector.cc
index 474632115f..85917041b6 100644
--- a/libs/ardour/onset_detector.cc
+++ b/libs/ardour/onset_detector.cc
@@ -16,9 +16,9 @@ OnsetDetector::OnsetDetector (float sr)
/* update the op_id */
_op_id = X_("libardourvampplugins:aubioonset");
-
+
// XXX this should load the above-named plugin and get the current version
-
+
_op_id += ":2";
}
@@ -48,13 +48,13 @@ OnsetDetector::use_features (Plugin::FeatureSet& features, ostream* out)
const Plugin::FeatureList& fl (features[0]);
for (Plugin::FeatureList::const_iterator f = fl.begin(); f != fl.end(); ++f) {
-
+
if ((*f).hasTimestamp) {
if (out) {
(*out) << (*f).timestamp.toString() << endl;
- }
-
+ }
+
current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
}
}
@@ -94,23 +94,23 @@ OnsetDetector::cleanup_onsets (AnalysisFeatureList& t, float sr, float gap_msecs
}
t.sort ();
-
+
/* remove duplicates or other things that are too close */
-
+
AnalysisFeatureList::iterator i = t.begin();
AnalysisFeatureList::iterator f, b;
const nframes64_t gap_frames = (nframes64_t) floor (gap_msecs * (sr / 1000.0));
-
+
while (i != t.end()) {
// move front iterator to just past i, and back iterator the same place
-
+
f = i;
++f;
b = f;
// move f until we find a new value that is far enough away
-
+
while ((f != t.end()) && (((*f) - (*i)) < gap_frames)) {
++f;
}
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index d23929232a..a8d30954cc 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -62,15 +62,15 @@ string EqualPowerStereoPanner::name = "Equal Power Stereo";
string Multi2dPanner::name = "Multiple (2D)";
/* this is a default mapper of control values to a pan position
- others can be imagined.
+ others can be imagined.
*/
-static pan_t direct_control_to_pan (double fract) {
+static pan_t direct_control_to_pan (double fract) {
return fract;
}
-//static double direct_pan_to_control (pan_t val) {
+//static double direct_pan_to_control (pan_t val) {
// return val;
//}
@@ -82,7 +82,7 @@ StreamPanner::StreamPanner (Panner& p, Evoral::Parameter param)
_muted = false;
_control = boost::dynamic_pointer_cast<AutomationControl>( parent.control( param, true ) );
-
+
x = 0.5;
y = 0.5;
z = 0.5;
@@ -137,7 +137,7 @@ StreamPanner::set_position (float xpos, float ypos, bool link_call)
}
if (x != xpos || y != ypos) {
-
+
x = xpos;
y = ypos;
update ();
@@ -196,7 +196,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
{
char line[128];
LocaleGuard lg (X_("POSIX"));
-
+
_control->list()->clear ();
while (in.getline (line, sizeof (line), '\n')) {
@@ -236,55 +236,55 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
if (_muted) {
return;
}
-
+
Sample* const src = srcbuf.data();
/* LEFT */
dst = obufs.get_audio(0).data();
- if (fabsf ((delta = (left - desired_left))) > 0.002) { // about 1 degree of arc
-
+ if (fabsf ((delta = (left - desired_left))) > 0.002) { // about 1 degree of arc
+
/* interpolate over 64 frames or nframes, whichever is smaller */
-
+
nframes_t limit = min ((nframes_t)64, nframes);
nframes_t n;
delta = -(delta / (float) (limit));
-
+
for (n = 0; n < limit; n++) {
left_interp = left_interp + delta;
left = left_interp + 0.9 * (left - left_interp);
dst[n] += src[n] * left * gain_coeff;
}
-
+
pan = left * gain_coeff;
mix_buffers_with_gain (dst+n,src+n,nframes-n,pan);
-
+
} else {
-
+
left = desired_left;
left_interp = left;
if ((pan = (left * gain_coeff)) != 1.0f) {
-
+
if (pan != 0.0f) {
-
+
mix_buffers_with_gain(dst,src,nframes,pan);
/* mark that we wrote into the buffer */
// obufs[0] = 0;
- }
-
+ }
+
} else {
-
+
mix_buffers_no_gain(dst,src,nframes);
-
+
/* mark that we wrote into the buffer */
-
+
// obufs[0] = 0;
}
}
@@ -292,11 +292,11 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
/* RIGHT */
dst = obufs.get_audio(1).data();
-
- if (fabsf ((delta = (right - desired_right))) > 0.002) { // about 1 degree of arc
-
+
+ if (fabsf ((delta = (right - desired_right))) > 0.002) { // about 1 degree of arc
+
/* interpolate over 64 frames or nframes, whichever is smaller */
-
+
nframes_t limit = min ((nframes_t)64, nframes);
nframes_t n;
@@ -307,31 +307,31 @@ BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain
right = right_interp + 0.9 * (right - right_interp);
dst[n] += src[n] * right * gain_coeff;
}
-
+
pan = right * gain_coeff;
-
+
mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
-
+
/* XXX it would be nice to mark the buffer as written to */
} else {
right = desired_right;
right_interp = right;
-
+
if ((pan = (right * gain_coeff)) != 1.0f) {
-
+
if (pan != 0.0f) {
-
+
mix_buffers_with_gain(dst,src,nframes,pan);
-
+
/* XXX it would be nice to mark the buffer as written to */
}
-
+
} else {
-
+
mix_buffers_no_gain(dst,src,nframes);
-
+
/* XXX it would be nice to mark the buffer as written to */
}
}
@@ -359,7 +359,7 @@ EqualPowerStereoPanner::update ()
{
/* it would be very nice to split this out into a virtual function
that can be accessed from BaseStereoPanner and used in distribute_automated().
-
+
but the place where its used in distribute_automated() is a tight inner loop,
and making "nframes" virtual function calls to compute values is an absurd
overhead.
@@ -374,7 +374,7 @@ EqualPowerStereoPanner::update ()
const float pan_law_attenuation = -3.0f;
const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
-
+
desired_left = panL * (scale * panL + 1.0f - scale);
desired_right = panR * (scale * panR + 1.0f - scale);
@@ -383,7 +383,7 @@ EqualPowerStereoPanner::update ()
}
void
-EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& obufs,
+EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& obufs,
nframes_t start, nframes_t end, nframes_t nframes,
pan_t** buffers)
{
@@ -424,7 +424,7 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
float panR = buffers[0][n];
float panL = 1 - panR;
-
+
buffers[0][n] = panL * (scale * panL + 1.0f - scale);
buffers[1][n] = panR * (scale * panR + 1.0f - scale);
}
@@ -433,10 +433,10 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
dst = obufs.get_audio(0).data();
pbuf = buffers[0];
-
+
for (nframes_t n = 0; n < nframes; ++n) {
dst[n] += src[n] * pbuf[n];
- }
+ }
/* XXX it would be nice to mark the buffer as written to */
@@ -447,8 +447,8 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
for (nframes_t n = 0; n < nframes; ++n) {
dst[n] += src[n] * pbuf[n];
- }
-
+ }
+
/* XXX it would be nice to mark the buffer as written to */
}
@@ -471,7 +471,7 @@ EqualPowerStereoPanner::state (bool /*full_state*/)
char buf[64];
LocaleGuard lg (X_("POSIX"));
- snprintf (buf, sizeof (buf), "%.12g", x);
+ snprintf (buf, sizeof (buf), "%.12g", x);
root->add_property (X_("x"), buf);
root->add_property (X_("type"), EqualPowerStereoPanner::name);
@@ -494,7 +494,7 @@ EqualPowerStereoPanner::set_state (const XMLNode& node)
if ((prop = node.property (X_("x")))) {
pos = atof (prop->value().c_str());
set_position (pos, true);
- }
+ }
StreamPanner::set_state (node);
@@ -554,7 +554,7 @@ Multi2dPanner::update ()
fr = (float) (1.0 / sqrt((double)f));
#else
fr = 1.0 / sqrtf(f);
-#endif
+#endif
for (i = 0; i < nouts; ++i) {
parent.outputs[i].desired_pan = 1.0f - (dsq[i] * fr);
}
@@ -573,43 +573,43 @@ Multi2dPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
if (_muted) {
return;
}
-
+
Sample* const src = srcbuf.data();
for (n = 0, o = parent.outputs.begin(); o != parent.outputs.end(); ++o, ++n) {
dst = obufs.get_audio(n).data();
-
+
#ifdef CAN_INTERP
- if (fabsf ((delta = (left_interp - desired_left))) > 0.002) { // about 1 degree of arc
-
+ if (fabsf ((delta = (left_interp - desired_left))) > 0.002) { // about 1 degree of arc
+
/* interpolate over 64 frames or nframes, whichever is smaller */
-
+
nframes_t limit = min ((nframes_t)64, nframes);
nframes_t n;
-
+
delta = -(delta / (float) (limit));
-
+
for (n = 0; n < limit; n++) {
left_interp = left_interp + delta;
left = left_interp + 0.9 * (left - left_interp);
dst[n] += src[n] * left * gain_coeff;
}
-
+
pan = left * gain_coeff;
mix_buffers_with_gain(dst+n,src+n,nframes-n,pan);
-
+
} else {
-#else
+#else
pan = (*o).desired_pan;
-
+
if ((pan *= gain_coeff) != 1.0f) {
-
+
if (pan != 0.0f) {
mix_buffers_with_gain(dst,src,nframes,pan);
- }
+ }
} else {
mix_buffers_no_gain(dst,src,nframes);
}
@@ -618,12 +618,12 @@ Multi2dPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
}
#endif
}
-
+
return;
}
void
-Multi2dPanner::distribute_automated (AudioBuffer& /*src*/, BufferSet& /*obufs*/,
+Multi2dPanner::distribute_automated (AudioBuffer& /*src*/, BufferSet& /*obufs*/,
nframes_t /*start*/, nframes_t /*end*/, nframes_t /*nframes*/,
pan_t** /*buffers*/)
{
@@ -661,9 +661,9 @@ Multi2dPanner::state (bool /*full_state*/)
char buf[64];
LocaleGuard lg (X_("POSIX"));
- snprintf (buf, sizeof (buf), "%.12g", x);
+ snprintf (buf, sizeof (buf), "%.12g", x);
root->add_property (X_("x"), buf);
- snprintf (buf, sizeof (buf), "%.12g", y);
+ snprintf (buf, sizeof (buf), "%.12g", y);
root->add_property (X_("y"), buf);
root->add_property (X_("type"), Multi2dPanner::name);
@@ -685,17 +685,17 @@ Multi2dPanner::set_state (const XMLNode& node)
if ((prop = node.property (X_("x")))) {
newx = atof (prop->value().c_str());
}
-
+
if ((prop = node.property (X_("y")))) {
newy = atof (prop->value().c_str());
}
-
+
if (x < 0 || y < 0) {
error << _("badly-formed positional data for Multi2dPanner - ignored")
<< endmsg;
return -1;
- }
-
+ }
+
set_position (newx, newy);
return 0;
}
@@ -759,7 +759,7 @@ Panner::reset_to_default ()
case 1:
return;
}
-
+
if (outputs.size() == 2) {
switch (_streampanners.size()) {
case 1:
@@ -777,7 +777,7 @@ Panner::reset_to_default ()
break;
}
}
-
+
vector<Output>::iterator o;
vector<StreamPanner*>::iterator p;
@@ -792,7 +792,7 @@ Panner::reset_streampanner (uint32_t which)
if (which >= _streampanners.size() || which >= outputs.size()) {
return;
}
-
+
switch (outputs.size()) {
case 0:
case 1:
@@ -830,14 +830,14 @@ Panner::reset (uint32_t nouts, uint32_t npans)
bool changed = false;
bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2));
- /* if new and old config don't need panning, or if
+ /* if new and old config don't need panning, or if
the config hasn't changed, we're done.
*/
- if (do_not_and_did_not_need_panning ||
+ if (do_not_and_did_not_need_panning ||
((nouts == outputs.size()) && (npans == _streampanners.size()))) {
return;
- }
+ }
n = _streampanners.size();
clear_panners ();
@@ -889,7 +889,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
_streampanners.push_back (new Multi2dPanner (*this, Evoral::Parameter(PanAutomation, 0, n)));
}
- break;
+ break;
case 4: // square
outputs.push_back (Output (0, 0));
@@ -901,7 +901,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
_streampanners.push_back (new Multi2dPanner (*this, Evoral::Parameter(PanAutomation, 0, n)));
}
- break;
+ break;
case 5: //square+offcenter center
outputs.push_back (Output (0, 0));
@@ -933,9 +933,9 @@ Panner::reset (uint32_t nouts, uint32_t npans)
(*x)->update ();
}
- /* force hard left/right panning in a common case: 2in/2out
+ /* force hard left/right panning in a common case: 2in/2out
*/
-
+
if (npans == 2 && outputs.size() == 2) {
/* Do this only if we changed configuration, or our configuration
@@ -949,13 +949,13 @@ Panner::reset (uint32_t nouts, uint32_t npans)
_streampanners.back()->get_position (right);
if (changed || ((left == 0.5) && (right == 0.5))) {
-
+
_streampanners.front()->set_position (0.0);
_streampanners.front()->pan_control()->list()->reset_default (0.0);
-
+
_streampanners.back()->set_position (1.0);
_streampanners.back()->pan_control()->list()->reset_default (1.0);
-
+
changed = true;
}
}
@@ -999,7 +999,7 @@ Panner::set_automation_style (AutoStyle style)
((AutomationList*)(*i)->pan_control()->list().get())->set_automation_style (style);
}
_session.set_dirty ();
-}
+}
void
Panner::set_automation_state (AutoState state)
@@ -1008,7 +1008,7 @@ Panner::set_automation_state (AutoState state)
((AutomationList*)(*i)->pan_control()->list().get())->set_automation_state (state);
}
_session.set_dirty ();
-}
+}
AutoState
Panner::automation_state () const
@@ -1075,7 +1075,7 @@ Panner::state (bool full)
onode->add_property (X_("y"), buf);
node->add_child_nocopy (*onode);
}
-
+
for (vector<StreamPanner*>::const_iterator i = _streampanners.begin(); i != _streampanners.end(); ++i) {
node->add_child_nocopy ((*i)->state (full));
}
@@ -1111,7 +1111,7 @@ Panner::set_state (const XMLNode& node)
if ((prop = node.property (X_("bypassed"))) != 0) {
set_bypassed (string_is_affirmative (prop->value()));
}
-
+
if ((prop = node.property (X_("link_direction"))) != 0) {
LinkDirection ld; /* here to provide type information */
set_link_direction (LinkDirection (string_2_enum (prop->value(), ld)));
@@ -1121,15 +1121,15 @@ Panner::set_state (const XMLNode& node)
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == X_("Output")) {
-
+
float x, y;
-
+
prop = (*niter)->property (X_("x"));
sscanf (prop->value().c_str(), "%g", &x);
-
+
prop = (*niter)->property (X_("y"));
sscanf (prop->value().c_str(), "%g", &y);
-
+
outputs.push_back (Output (x, y));
}
}
@@ -1137,30 +1137,30 @@ Panner::set_state (const XMLNode& node)
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == X_("StreamPanner")) {
-
+
if ((prop = (*niter)->property (X_("type")))) {
-
+
for (i = 0; pan_plugins[i].factory; ++i) {
if (prop->value() == pan_plugins[i].name) {
-
-
+
+
/* note that we assume that all the stream panners
are of the same type. pretty good
assumption, but it's still an assumption.
*/
-
+
sp = pan_plugins[i].factory (*this, Evoral::Parameter(PanAutomation, 0, num_panners));
num_panners++;
-
+
if (sp->set_state (**niter) == 0) {
_streampanners.push_back (sp);
}
-
+
break;
}
}
-
-
+
+
if (!pan_plugins[i].factory) {
error << string_compose (_("Unknown panner plugin \"%1\" found in pan state - ignored"),
prop->value())
@@ -1173,7 +1173,7 @@ Panner::set_state (const XMLNode& node)
return -1;
}
- }
+ }
}
reset (outputs.size (), num_panners);
@@ -1182,9 +1182,9 @@ Panner::set_state (const XMLNode& node)
if ((prop = node.property (X_("automation")))) {
/* automation path is relative */
-
+
automation_path = Glib::build_filename(_session.automation_dir(), prop->value ());
- }
+ }
return 0;
}
@@ -1210,7 +1210,7 @@ Panner::set_position (float xpos, StreamPanner& orig)
orig.get_position (xnow);
xdelta = xpos - xnow;
-
+
if (_link_direction == SameDirection) {
for (vector<StreamPanner*>::iterator i = _streampanners.begin(); i != _streampanners.end(); ++i) {
@@ -1249,7 +1249,7 @@ Panner::set_position (float xpos, float ypos, StreamPanner& orig)
orig.get_position (xnow, ynow);
xdelta = xpos - xnow;
ydelta = ypos - ynow;
-
+
if (_link_direction == SameDirection) {
for (vector<StreamPanner*>::iterator i = _streampanners.begin(); i != _streampanners.end(); ++i) {
@@ -1275,7 +1275,7 @@ Panner::set_position (float xpos, float ypos, StreamPanner& orig)
(*i)->set_position (xpos, ypos, true);
} else {
(*i)->get_position (xnow, ynow);
-
+
xnew = min (1.0f, xnow - xdelta);
xnew = max (0.0f, xnew);
@@ -1307,7 +1307,7 @@ Panner::set_position (float xpos, float ypos, float zpos, StreamPanner& orig)
(*i)->set_position (xpos, ypos, zpos, true);
} else {
(*i)->get_position (xnow, ynow, znow);
-
+
xnew = min (1.0f, xnow + xdelta);
xnew = max (0.0f, xnew);
@@ -1357,7 +1357,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
assert(!bypassed());
assert(!empty());
-
+
if (outbufs.count().n_audio() == 1) {
AudioBuffer& dst = outbufs.get_audio(0);
@@ -1367,14 +1367,14 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
/* only one output, and gain was zero, so make it silent */
dst.silence (nframes);
-
+
} else if (gain_coeff == 1.0f){
/* mix all buffers into the output */
// copy the first
dst.read_from(inbufs.get_audio(0), nframes);
-
+
// accumulate starting with the second
if (inbufs.count().n_audio() > 0) {
BufferSet::audio_iterator i = inbufs.audio_begin();
@@ -1389,7 +1389,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
// copy the first
dst.read_from(inbufs.get_audio(0), nframes);
-
+
// accumulate (with gain) starting with the second
if (inbufs.count().n_audio() > 0) {
BufferSet::audio_iterator i = inbufs.audio_begin();
@@ -1402,7 +1402,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
return;
}
-
+
/* the terrible silence ... */
for (BufferSet::audio_iterator i = outbufs.audio_begin(); i != outbufs.audio_end(); ++i) {
i->silence(nframes);
@@ -1417,7 +1417,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
void
Panner::run (BufferSet& inbufs, BufferSet& outbufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
-{
+{
if (outbufs.count().n_audio() == 0) {
// Failing to deliver audio we were asked to deliver is a bug
assert(inbufs.count().n_audio() == 0);
@@ -1443,7 +1443,7 @@ Panner::run (BufferSet& inbufs, BufferSet& outbufs, sframes_t start_frame, sfram
}
// Otherwise.. let the automation flow, baby
-
+
if (outbufs.count().n_audio() == 1) {
AudioBuffer& dst = outbufs.get_audio(0);
@@ -1464,7 +1464,7 @@ Panner::run (BufferSet& inbufs, BufferSet& outbufs, sframes_t start_frame, sfram
// More than 1 output, we should have 1 panner for each input
//assert(_streampanners.size() == inbufs.count().n_audio());
-
+
/* the terrible silence ... */
for (BufferSet::audio_iterator i = outbufs.audio_begin(); i != outbufs.audio_end(); ++i) {
i->silence(nframes);
@@ -1482,7 +1482,7 @@ Panner::run (BufferSet& inbufs, BufferSet& outbufs, sframes_t start_frame, sfram
void
Panner::set_name (string str)
{
- automation_path = Glib::build_filename(_session.automation_dir(),
+ automation_path = Glib::build_filename(_session.automation_dir(),
_session.snap_name() + "-pan-" + legalize_for_path (str) + ".automation");
}
*/
@@ -1499,7 +1499,7 @@ Panner::load ()
if (automation_path.length() == 0) {
return 0;
}
-
+
if (access (automation_path.c_str(), F_OK)) {
return 0;
}
@@ -1524,7 +1524,7 @@ Panner::load ()
return -1;
}
} else {
- error << string_compose(_("no version information in pan automation event file \"%1\" (first line = %2)"),
+ error << string_compose(_("no version information in pan automation event file \"%1\" (first line = %2)"),
automation_path, line) << endmsg;
return -1;
}
@@ -1537,7 +1537,7 @@ Panner::load ()
}
if (strcmp (line, "begin") == 0) {
-
+
if (sp == _streampanners.end()) {
error << string_compose (_("too many panner states found in pan automation file %1"),
automation_path)
@@ -1548,7 +1548,7 @@ Panner::load ()
if ((*sp)->load (in, automation_path, linecnt)) {
return -1;
}
-
+
++sp;
}
}
diff --git a/libs/ardour/pcm_utils.cc b/libs/ardour/pcm_utils.cc
index 0e810ba599..de3497d977 100644
--- a/libs/ardour/pcm_utils.cc
+++ b/libs/ardour/pcm_utils.cc
@@ -38,7 +38,7 @@ pcm_let2f_array (tribyte *src, int count, float *dest)
static const float normfact = 1.0 / ((float) 0x80000000);
unsigned char *ucptr ;
- int value ;
+ int value ;
ucptr = ((unsigned char*) src) + 3 * count ;
while (--count >= 0)
@@ -53,11 +53,11 @@ pcm_bet2f_array (tribyte *src, int count, float *dest)
{
/* Special normfactor because tribyte value is read into an int. */
static const float normfact = 1.0 / ((float) 0x80000000);
-
+
unsigned char *ucptr ;
int value ;
-
+
ucptr = ((unsigned char*) src) + 3 * count ;
while (--count >= 0)
{ ucptr -= 3 ;
@@ -125,7 +125,7 @@ void
pcm_f2bet_array (const float *src, tribyte *dest, int count)
{
static const float normfact = (1.0 * 0x7FFFFF);
-
+
unsigned char *ucptr ;
int value ;
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 53d749db82..ce9f0335b8 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2003 Paul Davis
+ Copyright (C) 2000-2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,8 +47,8 @@ using namespace PBD;
struct ShowMeTheList {
ShowMeTheList (boost::shared_ptr<Playlist> pl, const string& n) : playlist (pl), name (n) {}
- ~ShowMeTheList () {
- cerr << ">>>>" << name << endl; playlist->dump(); cerr << "<<<<" << name << endl << endl;
+ ~ShowMeTheList () {
+ cerr << ">>>>" << name << endl; playlist->dump(); cerr << "<<<<" << name << endl << endl;
};
boost::shared_ptr<Playlist> playlist;
string name;
@@ -62,17 +62,17 @@ struct RegionSortByLayer {
struct RegionSortByLayerWithPending {
bool operator () (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) {
-
+
double p = a->layer ();
if (a->pending_explicit_relayer()) {
p += 0.5;
}
-
+
double q = b->layer ();
if (b->pending_explicit_relayer()) {
q += 0.5;
}
-
+
return p < q;
}
};
@@ -97,7 +97,7 @@ Playlist::Playlist (Session& sess, string nom, DataType type, bool hide)
init (hide);
first_set_state = false;
_name = nom;
-
+
}
Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide)
@@ -120,7 +120,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, boo
RegionList tmp;
other->copy_regions (tmp);
-
+
in_set_state++;
for (list<boost::shared_ptr<Region> >::iterator x = tmp.begin(); x != tmp.end(); ++x) {
@@ -140,7 +140,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, boo
subcnt = 0;
_read_data_count = 0;
_frozen = other->_frozen;
-
+
layer_op_counter = other->layer_op_counter;
freeze_length = other->freeze_length;
}
@@ -205,7 +205,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, nframes_t start, nf
add_region_internal (new_region, position);
}
-
+
in_set_state--;
first_set_state = false;
@@ -223,7 +223,7 @@ void
Playlist::release ()
{
if (_refcnt > 0) {
- _refcnt--;
+ _refcnt--;
}
if (_refcnt == 0) {
@@ -299,7 +299,7 @@ Playlist::set_name (const string& str)
/***********************************************************************
CHANGE NOTIFICATION HANDLING
-
+
Notifications must be delayed till the region_lock is released. This
is necessary because handlers for the signals may need to acquire
the lock (e.g. to read from the playlist).
@@ -330,9 +330,9 @@ Playlist::delay_notifications ()
void
Playlist::release_notifications ()
{
- if (g_atomic_int_dec_and_test (&block_notifications)) {
+ if (g_atomic_int_dec_and_test (&block_notifications)) {
flush_notifications ();
- }
+ }
}
void
@@ -369,11 +369,11 @@ void
Playlist::notify_region_moved (boost::shared_ptr<Region> r)
{
Evoral::RangeMove<nframes_t> const move (r->last_position (), r->length (), r->position ());
-
+
if (holding_state ()) {
pending_range_moves.push_back (move);
-
+
} else {
list< Evoral::RangeMove<nframes_t> > m;
@@ -431,7 +431,7 @@ Playlist::flush_notifications ()
/* we have no idea what order the regions ended up in pending
bounds (it could be based on selection order, for example).
- so, to preserve layering in the "most recently moved is higher"
+ so, to preserve layering in the "most recently moved is higher"
model, sort them by existing layer, then timestamp them.
*/
@@ -496,11 +496,11 @@ Playlist::flush_notifications ()
*************************************************************/
void
-Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, float times, bool auto_partition)
+Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, float times, bool auto_partition)
{
RegionLock rlock (this);
times = fabs (times);
-
+
int itimes = (int) floor (times);
nframes_t pos = position;
@@ -508,14 +508,14 @@ Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, floa
if(times == 1 && auto_partition){
partition(pos, (nframes_t) (pos + region->length()), true);
}
-
+
if (itimes >= 1) {
add_region_internal (region, pos);
pos += region->length();
--itimes;
}
-
-
+
+
/* note that itimes can be zero if we being asked to just
insert a single fraction of the region.
*/
@@ -525,7 +525,7 @@ Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, floa
add_region_internal (copy, pos);
pos += region->length();
}
-
+
nframes_t length = 0;
if (floor (times) != times) {
@@ -559,7 +559,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
}
RegionSortByPosition cmp;
-
+
nframes_t old_length = 0;
if (!holding_state()) {
@@ -569,7 +569,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
if (!first_set_state) {
boost::shared_ptr<Playlist> foo (shared_from_this());
region->set_playlist (boost::weak_ptr<Playlist>(foo));
- }
+ }
region->set_position (position, this);
@@ -588,7 +588,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
/* we need to notify the existence of new region before checking dependents. Ick. */
notify_region_added (region);
-
+
if (!holding_state ()) {
check_dependents (region, false);
@@ -599,7 +599,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
}
region_state_changed_connections.push_back (
- region->StateChanged.connect (sigc::bind (mem_fun (this, &Playlist::region_changed_proxy),
+ region->StateChanged.connect (sigc::bind (mem_fun (this, &Playlist::region_changed_proxy),
boost::weak_ptr<Region> (region)))
);
@@ -657,7 +657,7 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
if (!holding_state ()) {
relayer ();
remove_dependents (region);
-
+
if (old_length != _get_maximum_extent()) {
notify_length_changed ();
}
@@ -728,20 +728,20 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
RegionList::iterator tmp;
OverlapType overlap;
nframes_t pos1, pos2, pos3, pos4;
-
+
in_partition = true;
-
+
/* need to work from a copy, because otherwise the regions we add during the process
get operated on as well.
*/
-
+
RegionList copy = regions;
-
+
for (RegionList::iterator i = copy.begin(); i != copy.end(); i = tmp) {
tmp = i;
++tmp;
-
+
current = *i;
if (current->first_frame() >= start && current->last_frame() < end) {
@@ -752,7 +752,7 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
continue;
}
-
+
/* coverage will return OverlapStart if the start coincides
with the end point. we do not partition such a region,
so catch this special case.
@@ -770,12 +770,12 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
pos2 = start;
pos3 = end;
pos4 = current->last_frame();
-
+
if (overlap == OverlapInternal) {
/* split: we need 3 new regions, the front, middle and end.
cut: we need 2 regions, the front and end.
*/
-
+
/*
start end
---------------*************************------------
@@ -784,30 +784,30 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
---------------*****++++++++++++++++====------------
CUT
---------------*****----------------====------------
-
+
*/
if (!cutting) {
/* "middle" ++++++ */
-
+
_session.region_name (new_name, current->name(), false);
region = RegionFactory::create (current, pos2 - pos1, pos3 - pos2, new_name,
regions.size(), Region::Flag(current->flags()|Region::Automatic|Region::LeftOfSplit|Region::RightOfSplit));
add_region_internal (region, start);
new_regions.push_back (region);
}
-
+
/* "end" ====== */
-
+
_session.region_name (new_name, current->name(), false);
- region = RegionFactory::create (current, pos3 - pos1, pos4 - pos3, new_name,
+ region = RegionFactory::create (current, pos3 - pos1, pos4 - pos3, new_name,
regions.size(), Region::Flag(current->flags()|Region::Automatic|Region::RightOfSplit));
add_region_internal (region, end);
new_regions.push_back (region);
-
+
/* "front" ***** */
-
+
current->freeze ();
thawlist.push_back (current);
current->trim_end (pos2, this);
@@ -818,16 +818,16 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
start end
---------------*************************------------
P1 P2 P4 P3
- SPLIT:
+ SPLIT:
---------------**************+++++++++++------------
- CUT:
+ CUT:
---------------**************-----------------------
*/
-
+
if (!cutting) {
/* end +++++ */
-
+
_session.region_name (new_name, current->name(), false);
region = RegionFactory::create (current, pos2 - pos1, pos4 - pos2, new_name, (layer_t) regions.size(),
Region::Flag(current->flags()|Region::Automatic|Region::LeftOfSplit));
@@ -835,9 +835,9 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
add_region_internal (region, start);
new_regions.push_back (region);
}
-
+
/* front ****** */
-
+
current->freeze ();
thawlist.push_back (current);
current->trim_end (pos2, this);
@@ -847,17 +847,17 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
/* split: we need 2 regions: the front and the end.
cut: just trim current to skip the cut area
*/
-
+
/*
start end
---------------*************************------------
- P2 P1 P3 P4
+ P2 P1 P3 P4
SPLIT:
---------------****+++++++++++++++++++++------------
CUT:
-------------------*********************------------
-
+
*/
if (!cutting) {
@@ -868,10 +868,10 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
add_region_internal (region, pos1);
new_regions.push_back (region);
- }
-
+ }
+
/* end */
-
+
current->freeze ();
thawlist.push_back (current);
current->trim_front (pos3, this);
@@ -880,19 +880,19 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
/* split: no split required.
cut: remove the region.
*/
-
+
/*
start end
---------------*************************------------
- P2 P1 P3 P4
+ P2 P1 P3 P4
SPLIT:
---------------*************************------------
CUT:
----------------------------------------------------
-
+
*/
-
+
if (cutting) {
remove_region_internal (current);
}
@@ -925,11 +925,11 @@ Playlist::cut_copy (boost::shared_ptr<Playlist> (Playlist::*pmf)(nframes_t, nfra
for (list<AudioRange>::iterator i = ranges.begin(); i != ranges.end(); ++i) {
pl = (this->*pmf)((*i).start, (*i).length(), result_is_hidden);
-
+
if (i == ranges.begin()) {
ret = pl;
} else {
-
+
/* paste the next section into the nascent playlist,
offset to reflect the start of the first range we
chopped.
@@ -985,7 +985,7 @@ boost::shared_ptr<Playlist>
Playlist::copy (nframes_t start, nframes_t cnt, bool result_is_hidden)
{
char buf[32];
-
+
snprintf (buf, sizeof (buf), "%" PRIu32, ++subcnt);
string new_name = _name;
new_name += '.';
@@ -1006,7 +1006,7 @@ Playlist::paste (boost::shared_ptr<Playlist> other, nframes_t position, float ti
RegionLock rl2 (other.get());
old_length = _get_maximum_extent();
-
+
int itimes = (int) floor (times);
nframes_t pos = position;
nframes_t shift = other->_get_maximum_extent();
@@ -1019,7 +1019,7 @@ Playlist::paste (boost::shared_ptr<Playlist> other, nframes_t position, float ti
/* put these new regions on top of all existing ones, but preserve
the ordering they had in the original playlist.
*/
-
+
copy_of_region->set_layer (copy_of_region->layer() + top_layer);
add_region_internal (copy_of_region, copy_of_region->position() + pos);
}
@@ -1033,7 +1033,7 @@ Playlist::paste (boost::shared_ptr<Playlist> other, nframes_t position, float ti
notify_length_changed ();
}
-
+
}
return 0;
@@ -1077,14 +1077,14 @@ Playlist::shift (nframes64_t at, nframes64_t distance, bool move_intersected, bo
/* too early */
continue;
}
-
+
if (at > (*r)->first_frame() && at < (*r)->last_frame()) {
/* intersected region */
if (!move_intersected) {
continue;
}
}
-
+
/* do not move regions glued to music time - that
has to be done separately.
*/
@@ -1143,13 +1143,13 @@ Playlist::_split_region (boost::shared_ptr<Region> region, nframes_t playlist_po
string after_name;
/* split doesn't change anything about length, so don't try to splice */
-
+
bool old_sp = _splicing;
_splicing = true;
before = playlist_position - region->position();
after = region->length() - before;
-
+
_session.region_name (before_name, region->name(), false);
left = RegionFactory::create (region, 0, before, before_name, region->layer(), Region::Flag (region->flags()|Region::LeftOfSplit));
@@ -1165,14 +1165,14 @@ Playlist::_split_region (boost::shared_ptr<Region> region, nframes_t playlist_po
(*i)->set_last_layer_op( (*i)->last_layer_op() + 1 );
}
}
-
+
left->set_last_layer_op ( orig_layer_op );
right->set_last_layer_op ( orig_layer_op + 1);
layer_op_counter++;
finalize_split_region (region, left, right);
-
+
remove_region_internal (region);
_splicing = old_sp;
@@ -1236,8 +1236,8 @@ Playlist::core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Reg
new_pos = 0;
} else if (new_pos >= max_frames - (*i)->length()) {
new_pos = max_frames - (*i)->length();
- }
-
+ }
+
(*i)->set_position (new_pos, this);
}
}
@@ -1259,11 +1259,11 @@ Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region>
/* remove it from the list then add it back in
the right place again.
*/
-
+
RegionSortByPosition cmp;
RegionList::iterator i = find (regions.begin(), regions.end(), region);
-
+
if (i == regions.end()) {
warning << string_compose (_("%1: bounds changed received for region (%2)not in playlist"),
_name, region->name())
@@ -1276,16 +1276,16 @@ Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region>
}
if (what_changed & Change (ARDOUR::PositionChanged|ARDOUR::LengthChanged)) {
-
+
nframes64_t delta = 0;
-
+
if (what_changed & ARDOUR::PositionChanged) {
delta = (nframes64_t) region->position() - (nframes64_t) region->last_position();
- }
-
+ }
+
if (what_changed & ARDOUR::LengthChanged) {
delta += (nframes64_t) region->length() - (nframes64_t) region->last_length();
- }
+ }
if (delta) {
possibly_splice (region->last_position() + region->last_length(), delta, region);
@@ -1298,7 +1298,7 @@ Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region>
/* it moved or changed length, so change the timestamp */
timestamp_layer_op (region);
}
-
+
notify_length_changed ();
relayer ();
check_dependents (region, false);
@@ -1335,8 +1335,8 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
region_bounds_changed (what_changed, region);
save = !(_splicing || _nudging);
}
-
- if ((what_changed & our_interests) &&
+
+ if ((what_changed & our_interests) &&
!(what_changed & Change (ARDOUR::PositionChanged|ARDOUR::LengthChanged))) {
check_dependents (region, false);
}
@@ -1344,7 +1344,7 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
if (what_changed & Change (ARDOUR::PositionChanged)) {
notify_region_moved (region);
}
-
+
if (what_changed & our_interests) {
save = true;
}
@@ -1371,9 +1371,9 @@ Playlist::clear (bool with_signals)
i != region_state_changed_connections.end ();
++i
) {
- i->disconnect ();
+ i->disconnect ();
}
-
+
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
pending_removes.insert (*i);
}
@@ -1400,7 +1400,7 @@ Playlist::regions_at (nframes_t frame)
{
RegionLock rlock (this);
return find_regions_at (frame);
-}
+}
boost::shared_ptr<Region>
Playlist::top_region_at (nframes_t frame)
@@ -1409,12 +1409,12 @@ Playlist::top_region_at (nframes_t frame)
RegionLock rlock (this);
RegionList *rlist = find_regions_at (frame);
boost::shared_ptr<Region> region;
-
+
if (rlist->size()) {
RegionSortByLayer cmp;
rlist->sort (cmp);
region = rlist->back();
- }
+ }
delete rlist;
return region;
@@ -1438,14 +1438,14 @@ Playlist::top_unmuted_region_at (nframes_t frame)
i = tmp;
}
-
+
boost::shared_ptr<Region> region;
-
+
if (rlist->size()) {
RegionSortByLayer cmp;
rlist->sort (cmp);
region = rlist->back();
- }
+ }
delete rlist;
return region;
@@ -1507,45 +1507,45 @@ Playlist::regions_to_read (nframes_t start, nframes_t end)
if (covering.size() == 1) {
rlist->push_back (covering.front());
-
+
} else {
-
+
for (set<nframes_t>::iterator t = to_check.begin(); t != to_check.end(); ++t) {
-
+
here.clear ();
-
+
for (RegionList::iterator x = covering.begin(); x != covering.end(); ++x) {
-
+
if ((*x)->covers (*t)) {
here.push_back (*x);
}
}
-
+
RegionSortByLayer cmp;
here.sort (cmp);
-
+
/* ... and get the top/transparent regions at "here" */
-
+
for (RegionList::reverse_iterator c = here.rbegin(); c != here.rend(); ++c) {
-
+
unique.insert (*c);
-
+
if ((*c)->opaque()) {
-
+
/* the other regions at this position are hidden by this one */
-
+
break;
}
}
}
-
+
for (set<boost::shared_ptr<Region> >::iterator s = unique.begin(); s != unique.end(); ++s) {
rlist->push_back (*s);
}
if (rlist->size() > 1) {
/* now sort by time order */
-
+
RegionSortByPosition cmp;
rlist->sort (cmp);
}
@@ -1606,26 +1606,26 @@ Playlist::find_next_transient (nframes64_t from, int dir)
(*i)->get_transients (these_points);
/* add first frame, just, err, because */
-
+
these_points.push_back ((*i)->first_frame());
-
+
points.insert (points.end(), these_points.begin(), these_points.end());
these_points.clear ();
}
-
+
if (points.empty()) {
return -1;
}
TransientDetector::cleanup_transients (points, _session.frame_rate(), 3.0);
bool reached = false;
-
+
if (dir > 0) {
for (AnalysisFeatureList::iterator x = points.begin(); x != points.end(); ++x) {
if ((*x) >= from) {
reached = true;
}
-
+
if (reached && (*x) > from) {
return *x;
}
@@ -1635,7 +1635,7 @@ Playlist::find_next_transient (nframes64_t from, int dir)
if ((*x) <= from) {
reached = true;
}
-
+
if (reached && (*x) < from) {
return *x;
}
@@ -1689,7 +1689,7 @@ Playlist::find_next_region (nframes_t frame, RegionPoint point, int dir)
break;
default: /* backwards */
-
+
if (pos < frame) {
if ((distance = frame - pos) < closest) {
closest = distance;
@@ -1721,11 +1721,11 @@ Playlist::find_next_region_boundary (nframes64_t frame, int dir)
boost::shared_ptr<Region> r = (*i);
nframes64_t distance;
-
+
if (r->first_frame() > frame) {
distance = r->first_frame() - frame;
-
+
if (distance < closest) {
ret = r->first_frame();
closest = distance;
@@ -1733,9 +1733,9 @@ Playlist::find_next_region_boundary (nframes64_t frame, int dir)
}
if (r->last_frame () > frame) {
-
+
distance = r->last_frame () - frame;
-
+
if (distance < closest) {
ret = r->last_frame ();
closest = distance;
@@ -1746,14 +1746,14 @@ Playlist::find_next_region_boundary (nframes64_t frame, int dir)
} else {
for (RegionList::reverse_iterator i = regions.rbegin(); i != regions.rend(); ++i) {
-
+
boost::shared_ptr<Region> r = (*i);
nframes64_t distance;
if (r->last_frame() < frame) {
distance = frame - r->last_frame();
-
+
if (distance < closest) {
ret = r->last_frame();
closest = distance;
@@ -1761,7 +1761,7 @@ Playlist::find_next_region_boundary (nframes64_t frame, int dir)
}
if (r->first_frame() < frame) {
-
+
distance = frame - r->first_frame();
if (distance < closest) {
@@ -1814,7 +1814,7 @@ Playlist::set_state (const XMLNode& node)
for (piter = plist.begin(); piter != plist.end(); ++piter) {
prop = *piter;
-
+
if (prop->name() == X_("name")) {
_name = prop->value();
} else if (prop->name() == X_("orig_diskstream_id")) {
@@ -1825,22 +1825,22 @@ Playlist::set_state (const XMLNode& node)
}
clear (false);
-
+
nlist = node.children();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
child = *niter;
-
+
if (child->name() == "Region") {
if ((prop = child->property ("id")) == 0) {
error << _("region state node has no ID, ignored") << endmsg;
continue;
}
-
+
ID id = prop->value ();
-
+
if ((region = region_by_id (id))) {
Change what_changed = Change (0);
@@ -1860,15 +1860,15 @@ Playlist::set_state (const XMLNode& node)
// So that layer_op ordering doesn't get screwed up
region->set_last_layer_op( region->layer());
- }
+ }
}
-
+
notify_modified ();
thaw ();
- /* update dependents, which was not done during add_region_internal
- due to in_set_state being true
+ /* update dependents, which was not done during add_region_internal
+ due to in_set_state being true
*/
for (RegionList::iterator r = regions.begin(); r != regions.end(); ++r) {
@@ -1899,7 +1899,7 @@ Playlist::state (bool full_state)
{
XMLNode *node = new XMLNode (X_("Playlist"));
char buf[64];
-
+
node->add_property (X_("name"), _name);
node->add_property (X_("type"), _type.to_string());
@@ -1958,7 +1958,7 @@ Playlist::_get_maximum_extent () const
return max_extent;
}
-string
+string
Playlist::bump_name (string name, Session &session)
{
string newname = name;
@@ -1974,7 +1974,7 @@ Playlist::bump_name (string name, Session &session)
layer_t
Playlist::top_layer() const
{
- RegionLock rlock (const_cast<Playlist *> (this));
+ RegionLock rlock (const_cast<Playlist *> (this));
layer_t top = 0;
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
@@ -2039,7 +2039,7 @@ Playlist::relayer ()
} else if (_session.config.get_layer_model() == MoveAddHigher || _session.config.get_layer_model() == AddHigher) {
copy.sort (RegionSortByLastLayerOp ());
-
+
}
for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
@@ -2083,7 +2083,7 @@ Playlist::relayer ()
/* overlap, so we must use layer j */
break;
}
-
+
--j;
}
@@ -2174,9 +2174,9 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
{
RegionLock rlock (const_cast<Playlist *> (this));
-
+
for (i = regions.begin(); i != regions.end(); ++i) {
-
+
if (region == *i) {
continue;
}
@@ -2186,7 +2186,7 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
/* region is moving up, move all regions on intermediate layers
down 1
*/
-
+
if ((*i)->layer() > region->layer() && (*i)->layer() <= target_layer) {
dest = (*i)->layer() - 1;
} else {
@@ -2208,12 +2208,12 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
}
LayerInfo newpair;
-
+
newpair.first = *i;
newpair.second = dest;
-
+
layerinfo.push_back (newpair);
- }
+ }
}
/* now reset the layers without holding the region lock */
@@ -2230,10 +2230,10 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
for (list<LayerInfo>::iterator x = layerinfo.begin(); x != layerinfo.end(); ++x) {
check_dependents (x->first, false);
}
-
+
check_dependents (region, false);
#endif
-
+
return 0;
}
@@ -2248,7 +2248,7 @@ Playlist::nudge_after (nframes_t start, nframes_t distance, bool forwards)
{
RegionLock rlock (const_cast<Playlist *> (this));
-
+
for (i = regions.begin(); i != regions.end(); ++i) {
if ((*i)->position() >= start) {
@@ -2260,9 +2260,9 @@ Playlist::nudge_after (nframes_t start, nframes_t distance, bool forwards)
} else {
new_pos = (*i)->position() + distance;
}
-
+
} else {
-
+
if ((*i)->position() > distance) {
new_pos = (*i)->position() - distance;
} else {
@@ -2311,7 +2311,7 @@ Playlist::region_by_id (ID id)
}
return boost::shared_ptr<Region> ();
}
-
+
void
Playlist::dump () const
{
@@ -2323,9 +2323,9 @@ Playlist::dump () const
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
r = *i;
- cerr << " " << r->name() << " ["
- << r->start() << "+" << r->length()
- << "] at "
+ cerr << " " << r->name() << " ["
+ << r->start() << "+" << r->length()
+ << "] at "
<< r->position()
<< " on layer "
<< r->layer ()
@@ -2362,13 +2362,13 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
{
RegionLock rlock (const_cast<Playlist*> (this));
-
-
+
+
if (dir > 0) {
-
+
RegionList::iterator next;
- for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
+ for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if ((*i) == region) {
next = i;
++next;
@@ -2408,10 +2408,10 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
}
}
} else {
-
+
RegionList::iterator prev = regions.end();
-
- for (RegionList::iterator i = regions.begin(); i != regions.end(); prev = i, ++i) {
+
+ for (RegionList::iterator i = regions.begin(); i != regions.end(); prev = i, ++i) {
if ((*i) == region) {
if (prev != regions.end()) {
@@ -2435,7 +2435,7 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
region->set_position ((*prev)->position(), this);
(*prev)->set_position (new_pos, this);
-
+
/* avoid a full sort */
regions.erase (i); // remove region
@@ -2456,17 +2456,17 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
relayer ();
check_dependents (region, false);
-
+
notify_modified();
}
}
bool
-Playlist::region_is_shuffle_constrained (boost::shared_ptr<Region>)
+Playlist::region_is_shuffle_constrained (boost::shared_ptr<Region>)
{
RegionLock rlock (const_cast<Playlist*> (this));
-
+
if (regions.size() > 1) {
return true;
}
@@ -2481,8 +2481,8 @@ Playlist::update_after_tempo_map_change ()
RegionList copy (regions);
freeze ();
-
- for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
+
+ for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
(*i)->update_position_after_tempo_map_change ();
}
diff --git a/libs/ardour/playlist_factory.cc b/libs/ardour/playlist_factory.cc
index 7088fa67a3..554c36df17 100644
--- a/libs/ardour/playlist_factory.cc
+++ b/libs/ardour/playlist_factory.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ using namespace PBD;
sigc::signal<void,boost::shared_ptr<Playlist>, bool> PlaylistFactory::PlaylistCreated;
-boost::shared_ptr<Playlist>
+boost::shared_ptr<Playlist>
PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden, bool unused)
{
const XMLProperty* type = node.property("type");
@@ -53,8 +53,8 @@ PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden, bool unus
return pl;
}
-boost::shared_ptr<Playlist>
-PlaylistFactory::create (DataType type, Session& s, string name, bool hidden)
+boost::shared_ptr<Playlist>
+PlaylistFactory::create (DataType type, Session& s, string name, bool hidden)
{
boost::shared_ptr<Playlist> pl;
@@ -70,8 +70,8 @@ PlaylistFactory::create (DataType type, Session& s, string name, bool hidden)
return pl;
}
-boost::shared_ptr<Playlist>
-PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, bool hidden)
+boost::shared_ptr<Playlist>
+PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, bool hidden)
{
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<const AudioPlaylist> apl;
@@ -92,13 +92,13 @@ PlaylistFactory::create (boost::shared_ptr<const Playlist> old, string name, boo
return pl;
}
-boost::shared_ptr<Playlist>
-PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden)
+boost::shared_ptr<Playlist>
+PlaylistFactory::create (boost::shared_ptr<const Playlist> old, nframes_t start, nframes_t cnt, string name, bool hidden)
{
boost::shared_ptr<Playlist> pl;
boost::shared_ptr<const AudioPlaylist> apl;
boost::shared_ptr<const MidiPlaylist> mpl;
-
+
if ((apl = boost::dynamic_pointer_cast<const AudioPlaylist> (old)) != 0) {
pl = boost::shared_ptr<Playlist> (new AudioPlaylist (apl, start, cnt, name, hidden));
pl->set_region_ownership ();
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index e94487845e..6778a3af19 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2002 Paul Davis
+ Copyright (C) 2000-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -114,7 +114,7 @@ Plugin::get_presets()
uint32_t id;
std::string unique (unique_id());
- /* XXX problem: AU plugins don't have numeric ID's.
+ /* XXX problem: AU plugins don't have numeric ID's.
Solution: they have a different method of providing presets.
XXX sub-problem: implement it.
*/
@@ -148,7 +148,7 @@ Plugin::load_preset(const string preset_uri)
if (defs) {
for (uint32_t i = 0; i < (uint32_t) defs->count; ++i) {
- // The defs->items[i].pid < defs->count check is to work around
+ // The defs->items[i].pid < defs->count check is to work around
// a bug in liblrdf that saves invalid values into the presets file.
if (((uint32_t) defs->items[i].pid < (uint32_t) defs->count) && parameter_is_input (defs->items[i].pid)) {
set_parameter(defs->items[i].pid, defs->items[i].value);
@@ -168,7 +168,7 @@ Plugin::save_preset (string uri, string domain)
uint32_t id;
std::string unique (unique_id());
- /* XXX problem: AU plugins don't have numeric ID's.
+ /* XXX problem: AU plugins don't have numeric ID's.
Solution: they have a different method of providing/saving presets.
XXX sub-problem: implement it.
*/
@@ -194,7 +194,7 @@ Plugin::save_preset (string uri, string domain)
warning << _("Could not locate HOME. Preset not saved.") << endmsg;
return false;
}
-
+
string source(string_compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
map<string,PresetRecord>::const_iterator pr = presets.find(uri);
@@ -209,13 +209,13 @@ Plugin::save_preset (string uri, string domain)
warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
-
+
path += "/rdf";
if (g_mkdir_with_parents (path.c_str(), 0775)) {
warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
-
+
if (lrdf_export_by_source(source.c_str(), source.substr(5).c_str())) {
warning << string_compose(_("Error saving presets file %1."), source) << endmsg;
return false;
@@ -234,7 +234,7 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
case ARDOUR::LADSPA:
plugs = mgr->ladspa_plugin_info();
break;
-
+
#ifdef HAVE_SLV2
case ARDOUR::LV2:
plugs = mgr->lv2_plugin_info();
@@ -277,7 +277,7 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
}
}
#endif
-
+
return PluginPtr ((Plugin*) 0);
}
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index d00129e9c5..1fff176713 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -107,10 +107,10 @@ PluginInsert::set_count (uint32_t num)
bool require_state = !_plugins.empty();
/* this is a bad idea.... we shouldn't do this while active.
- only a route holding their redirect_lock should be calling this
+ only a route holding their redirect_lock should be calling this
*/
- if (num == 0) {
+ if (num == 0) {
return false;
} else if (num > _plugins.size()) {
uint32_t diff = num - _plugins.size();
@@ -176,7 +176,7 @@ ChanCount
PluginInsert::input_streams() const
{
ChanCount in = _plugins[0]->get_info()->n_inputs;
-
+
if (in == ChanCount::INFINITE) {
return _plugins[0]->input_streams ();
} else {
@@ -257,7 +257,7 @@ void
PluginInsert::activate ()
{
Processor::activate ();
-
+
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
(*i)->activate ();
}
@@ -267,7 +267,7 @@ void
PluginInsert::deactivate ()
{
Processor::deactivate ();
-
+
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
(*i)->deactivate ();
}
@@ -293,22 +293,22 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
if (with_auto) {
uint32_t n = 0;
-
+
for (Controls::iterator li = data().controls().begin(); li != data().controls().end(); ++li, ++n) {
-
+
boost::shared_ptr<AutomationControl> c
= boost::dynamic_pointer_cast<AutomationControl>(li->second);
if (c->parameter().type() == PluginAutomation && c->automation_playback()) {
bool valid;
- const float val = c->list()->rt_safe_eval (now, valid);
+ const float val = c->list()->rt_safe_eval (now, valid);
if (valid) {
c->set_value(val);
}
- }
+ }
}
}
@@ -326,7 +326,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
collect_signal_nframes,
_signal_analysis_collected_nframes); // offset is for target buffer
}
-
+
}
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
@@ -346,8 +346,8 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
for (uint32_t i = 0; i < output_streams().n_audio(); ++i) {
_signal_analysis_outputs.get_audio(i).read_from(
- bufs.get_audio(i),
- collect_signal_nframes,
+ bufs.get_audio(i),
+ collect_signal_nframes,
_signal_analysis_collected_nframes); // offset is for target buffer
}
@@ -358,7 +358,7 @@ PluginInsert::connect_and_run (BufferSet& bufs, nframes_t nframes, nframes_t off
_signal_analysis_collect_nframes_max = 0;
_signal_analysis_collected_nframes = 0;
- AnalysisDataGathered(&_signal_analysis_inputs,
+ AnalysisDataGathered(&_signal_analysis_inputs,
&_signal_analysis_outputs);
}
}
@@ -377,7 +377,7 @@ PluginInsert::silence (nframes_t nframes)
}
}
}
-
+
void
PluginInsert::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_frame*/, nframes_t nframes)
{
@@ -399,7 +399,7 @@ PluginInsert::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*end_f
if (out > in) {
/* not active, but something has make up for any channel count increase */
-
+
for (uint32_t n = out - in; n < out; ++n) {
memcpy (bufs.get_audio(n).data(), bufs.get_audio(in - 1).data(), sizeof (Sample) * nframes);
}
@@ -420,10 +420,10 @@ PluginInsert::set_parameter (Evoral::Parameter param, float val)
/* the others will be set from the event triggered by this */
_plugins[0]->set_parameter (param.id(), val);
-
+
boost::shared_ptr<AutomationControl> ac
= boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
-
+
if (ac) {
ac->set_value(val);
} else {
@@ -458,36 +458,36 @@ PluginInsert::automation_run (BufferSet& bufs, nframes_t nframes)
connect_and_run (bufs, nframes, offset, false);
return;
}
-
+
if (!data().find_next_event (now, end, next_event)) {
-
- /* no events have a time within the relevant range */
-
- connect_and_run (bufs, nframes, offset, true, now);
- return;
- }
-
- while (nframes) {
+
+ /* no events have a time within the relevant range */
+
+ connect_and_run (bufs, nframes, offset, true, now);
+ return;
+ }
+
+ while (nframes) {
nframes_t cnt = min (((nframes_t) ceil (next_event.when) - now), nframes);
-
- connect_and_run (bufs, cnt, offset, true, now);
-
- nframes -= cnt;
- offset += cnt;
+
+ connect_and_run (bufs, cnt, offset, true, now);
+
+ nframes -= cnt;
+ offset += cnt;
now += cnt;
if (!data().find_next_event (now, end, next_event)) {
break;
}
- }
-
- /* cleanup anything that is left to do */
-
- if (nframes) {
- connect_and_run (bufs, nframes, offset, true, now);
- }
-}
+ }
+
+ /* cleanup anything that is left to do */
+
+ if (nframes) {
+ connect_and_run (bufs, nframes, offset, true, now);
+ }
+}
float
PluginInsert::default_parameter_value (const Evoral::Parameter& param)
@@ -561,11 +561,11 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
// we don't know the analysis window size, so we must work with the
// current buffer size here. each request for data fills in these
- // buffers and the analyser makes sure it gets enough data for the
+ // buffers and the analyser makes sure it gets enough data for the
// analysis window
session().ensure_buffer_set (_signal_analysis_inputs, in);
//_signal_analysis_inputs.set_count (in);
-
+
session().ensure_buffer_set (_signal_analysis_outputs, out);
//_signal_analysis_outputs.set_count (out);
@@ -605,12 +605,12 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
} else if (inputs.get(*t) >= in.get(*t)) {
can_replicate = false;
break;
-
+
// Plugin inputs is not a factor of requested inputs, can not replicate
} else if (inputs.get(*t) == 0 || in.get(*t) % inputs.get(*t) != 0) {
can_replicate = false;
break;
-
+
// Potential factor not set yet
} else if (f == 0) {
f = in.get(*t) / inputs.get(*t);;
@@ -646,7 +646,7 @@ PluginInsert::count_for_configuration (ChanCount in, ChanCount /*out*/) const
}
// FIXME: take 'out' into consideration
-
+
ChanCount outputs = _plugins[0]->get_info()->n_outputs;
ChanCount inputs = _plugins[0]->get_info()->n_inputs;
@@ -697,13 +697,13 @@ PluginInsert::state (bool full)
/* add port automation state */
//XMLNode *autonode = new XMLNode(port_automation_node_name);
set<Evoral::Parameter> automatable = _plugins[0]->automatable();
-
+
for (set<Evoral::Parameter>::iterator x = automatable.begin(); x != automatable.end(); ++x) {
-
+
/*XMLNode* child = new XMLNode("port");
snprintf(buf, sizeof(buf), "%" PRIu32, *x);
child->add_property("number", string(buf));
-
+
child->add_child_nocopy (automation_list (*x).state (full));
autonode->add_child_nocopy (*child);
*/
@@ -711,7 +711,7 @@ PluginInsert::state (bool full)
}
//node.add_child_nocopy (*autonode);
-
+
return node;
}
@@ -741,7 +741,7 @@ PluginInsert::set_state(const XMLNode& node)
<< endmsg;
return -1;
}
-
+
prop = node.property ("unique-id");
if (prop == 0) {
error << _("Plugin has no unique ID field") << endmsg;
@@ -749,12 +749,12 @@ PluginInsert::set_state(const XMLNode& node)
}
boost::shared_ptr<Plugin> plugin;
-
- plugin = find_plugin (_session, prop->value(), type);
+
+ plugin = find_plugin (_session, prop->value(), type);
if (plugin == 0) {
error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
- "Perhaps it was removed or moved since it was last used."), prop->value())
+ "Perhaps it was removed or moved since it was last used."), prop->value())
<< endmsg;
return -1;
}
@@ -766,14 +766,14 @@ PluginInsert::set_state(const XMLNode& node)
}
if (_plugins.size() != count) {
-
+
_plugins.push_back (plugin);
-
+
for (uint32_t n=1; n < count; ++n) {
_plugins.push_back (plugin_factory (plugin));
}
}
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == plugin->state_node_name()) {
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
@@ -781,7 +781,7 @@ PluginInsert::set_state(const XMLNode& node)
}
break;
}
- }
+ }
const XMLNode* insert_node = &node;
@@ -792,11 +792,11 @@ PluginInsert::set_state(const XMLNode& node)
break;
}
}
-
+
Processor::set_state (*insert_node);
/* look for port automation node */
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() != port_automation_node_name) {
@@ -809,22 +809,22 @@ PluginInsert::set_state(const XMLNode& node)
XMLNode *child;
const char *port;
uint32_t port_id;
-
+
cnodes = (*niter)->children ("Port");
-
+
for (iter = cnodes.begin(); iter != cnodes.end(); ++iter) {
-
+
child = *iter;
-
+
if ((cprop = child->property("number")) != 0) {
port = cprop->value().c_str();
} else {
warning << _("PluginInsert: Auto: no plugin port number") << endmsg;
continue;
}
-
+
sscanf (port, "%" PRIu32, &port_id);
-
+
if (port_id >= _plugins[0]->parameter_count()) {
warning << _("PluginInsert: Auto: port id out of range") << endmsg;
continue;
@@ -837,7 +837,7 @@ PluginInsert::set_state(const XMLNode& node)
c->alist()->set_state (*child->children().front());
} else {
if ((cprop = child->property("auto")) != 0) {
-
+
/* old school */
int x;
@@ -845,9 +845,9 @@ PluginInsert::set_state(const XMLNode& node)
c->alist()->set_automation_state (AutoState (x));
} else {
-
+
/* missing */
-
+
c->alist()->set_automation_state (Off);
}
}
@@ -857,11 +857,11 @@ PluginInsert::set_state(const XMLNode& node)
/* done */
break;
- }
+ }
// The name of the PluginInsert comes from the plugin, nothing else
_name = plugin->get_info()->name;
-
+
return 0;
}
@@ -874,7 +874,7 @@ PluginInsert::describe_parameter (Evoral::Parameter param)
return _plugins[0]->describe_parameter (param);
}
-ARDOUR::nframes_t
+ARDOUR::nframes_t
PluginInsert::signal_latency() const
{
if (_user_latency) {
@@ -894,7 +894,7 @@ PluginInsert::type ()
#ifdef HAVE_AUDIOUNITS
boost::shared_ptr<AUPlugin> ap;
#endif
-
+
PluginPtr other = plugin ();
if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
@@ -922,12 +922,12 @@ PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Param
_logarithmic = desc.logarithmic;
_toggled = desc.toggled;
}
-
+
void
PluginInsert::PluginControl::set_value (float val)
{
/* FIXME: probably should be taking out some lock here.. */
-
+
if (_toggled) {
if (val > 0.5) {
val = 1.0;
@@ -935,7 +935,7 @@ PluginInsert::PluginControl::set_value (float val)
val = 0.0;
}
} else {
-
+
/*const float range = _list->get_max_y() - _list->get_min_y();
const float lower = _list->get_min_y();
@@ -969,21 +969,21 @@ float
PluginInsert::PluginControl::get_value (void) const
{
/* FIXME: probably should be taking out some lock here.. */
-
+
float val = _plugin->get_parameter (_list->parameter());
return val;
/*if (_toggled) {
-
+
return val;
-
+
} else {
-
+
if (_logarithmic) {
val = log(val);
}
-
+
return ((val - lower) / range);
}*/
}
@@ -1007,10 +1007,10 @@ PluginInsert::collect_signal_for_analysis(nframes_t nframes)
{
// called from outside the audio thread, so this should be safe
// only do audio as analysis is (currently) only for audio plugins
- _signal_analysis_inputs.ensure_buffers( DataType::AUDIO, input_streams().n_audio(), nframes);
- _signal_analysis_outputs.ensure_buffers( DataType::AUDIO, output_streams().n_audio(), nframes);
+ _signal_analysis_inputs.ensure_buffers( DataType::AUDIO, input_streams().n_audio(), nframes);
+ _signal_analysis_outputs.ensure_buffers( DataType::AUDIO, output_streams().n_audio(), nframes);
_signal_analysis_collected_nframes = 0;
- _signal_analysis_collect_nframes_max = nframes;
+ _signal_analysis_collect_nframes_max = nframes;
}
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index bdc4d9e9b5..6ac57400c4 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -81,7 +81,7 @@ PluginManager::PluginManager ()
load_favorites ();
#ifdef HAVE_AUDIOUNITS
- ProcessSerialNumber psn = { 0, kCurrentProcess };
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
if( returnCode != 0) {
error << _("Cannot become GUI app") << endmsg;
@@ -128,7 +128,7 @@ PluginManager::PluginManager ()
ladspa_plugin_whitelist.push_back (1061); // feedback delay line (max 5s)
ladspa_plugin_whitelist.push_back (1216); // gverb
ladspa_plugin_whitelist.push_back (2150); // tap pitch shifter
- }
+ }
#ifdef HAVE_SLV2
_lv2_world = new LV2World();
@@ -159,45 +159,45 @@ PluginManager::refresh ()
void
PluginManager::ladspa_refresh ()
{
- _ladspa_plugin_info.clear ();
-
- static const char *standard_paths[] = {
- "/usr/local/lib64/ladspa",
- "/usr/local/lib/ladspa",
- "/usr/lib64/ladspa",
- "/usr/lib/ladspa",
- "/Library/Audio/Plug-Ins/LADSPA",
- ""
- };
-
- /* allow LADSPA_PATH to augment, not override standard locations */
-
- /* Only add standard locations to ladspa_path if it doesn't
- * already contain them. Check for trailing '/'s too.
- */
-
- int i;
- for (i = 0; standard_paths[i][0]; i++) {
- size_t found = ladspa_path.find(standard_paths[i]);
- if (found != ladspa_path.npos) {
- switch (ladspa_path[found + strlen(standard_paths[i])]) {
- case ':' :
- case '\0':
- continue;
- case '/' :
- if (ladspa_path[found + strlen(standard_paths[i]) + 1] == ':' ||
- ladspa_path[found + strlen(standard_paths[i]) + 1] == '\0') {
- continue;
- }
- }
- }
- if (!ladspa_path.empty())
- ladspa_path += ":";
-
- ladspa_path += standard_paths[i];
-
- }
-
+ _ladspa_plugin_info.clear ();
+
+ static const char *standard_paths[] = {
+ "/usr/local/lib64/ladspa",
+ "/usr/local/lib/ladspa",
+ "/usr/lib64/ladspa",
+ "/usr/lib/ladspa",
+ "/Library/Audio/Plug-Ins/LADSPA",
+ ""
+ };
+
+ /* allow LADSPA_PATH to augment, not override standard locations */
+
+ /* Only add standard locations to ladspa_path if it doesn't
+ * already contain them. Check for trailing '/'s too.
+ */
+
+ int i;
+ for (i = 0; standard_paths[i][0]; i++) {
+ size_t found = ladspa_path.find(standard_paths[i]);
+ if (found != ladspa_path.npos) {
+ switch (ladspa_path[found + strlen(standard_paths[i])]) {
+ case ':' :
+ case '\0':
+ continue;
+ case '/' :
+ if (ladspa_path[found + strlen(standard_paths[i]) + 1] == ':' ||
+ ladspa_path[found + strlen(standard_paths[i]) + 1] == '\0') {
+ continue;
+ }
+ }
+ }
+ if (!ladspa_path.empty())
+ ladspa_path += ":";
+
+ ladspa_path += standard_paths[i];
+
+ }
+
ladspa_discover_from_path (ladspa_path);
}
@@ -209,14 +209,14 @@ PluginManager::add_ladspa_directory (string path)
ladspa_path += ':';
ladspa_path += path;
return 0;
- }
+ }
return -1;
}
static bool ladspa_filter (const string& str, void */*arg*/)
{
/* Not a dotfile, has a prefix before a period, suffix is "so" */
-
+
return str[0] != '.' && (str.length() > 3 && str.find (".so") == (str.length() - 3));
}
@@ -242,7 +242,7 @@ PluginManager::ladspa_discover_from_path (string /*path*/)
static bool rdf_filter (const string &str, void */*arg*/)
{
- return str[0] != '.' &&
+ return str[0] != '.' &&
((str.find(".rdf") == (str.length() - 4)) ||
(str.find(".rdfs") == (str.length() - 5)) ||
(str.find(".n3") == (str.length() - 3)));
@@ -310,7 +310,7 @@ PluginManager::add_lrdf_data (const string &path)
vector_delete (rdf_files);
}
-int
+int
PluginManager::ladspa_discover (string path)
{
void *module;
@@ -341,7 +341,7 @@ PluginManager::ladspa_discover (string path)
if (find (ladspa_plugin_whitelist.begin(), ladspa_plugin_whitelist.end(), descriptor->UniqueID) == ladspa_plugin_whitelist.end()) {
continue;
}
- }
+ }
PluginInfoPtr info(new LadspaPluginInfo);
info->name = descriptor->Name;
@@ -352,11 +352,11 @@ PluginManager::ladspa_discover (string path)
info->n_inputs = ChanCount();
info->n_outputs = ChanCount();
info->type = ARDOUR::LADSPA;
-
+
char buf[32];
snprintf (buf, sizeof (buf), "%lu", descriptor->UniqueID);
info->unique_id = buf;
-
+
for (uint32_t n=0; n < descriptor->PortCount; ++n) {
if ( LADSPA_IS_PORT_AUDIO (descriptor->PortDescriptors[n]) ) {
if ( LADSPA_IS_PORT_INPUT (descriptor->PortDescriptors[n]) ) {
@@ -481,7 +481,7 @@ PluginManager::add_vst_directory (string path)
vst_path += ':';
vst_path += path;
return 0;
- }
+ }
return -1;
}
@@ -530,7 +530,7 @@ PluginManager::vst_discover (string path)
finfo->name)
<< endl;
}
-
+
PluginInfoPtr info(new VSTPluginInfo);
/* what a joke freeware VST is */
@@ -541,7 +541,7 @@ PluginManager::vst_discover (string path)
info->name = finfo->name;
}
-
+
snprintf (buf, sizeof (buf), "%d", finfo->UniqueID);
info->unique_id = buf;
info->category = "VST";
@@ -551,7 +551,7 @@ PluginManager::vst_discover (string path)
info->n_inputs.set_audio (finfo->numInputs);
info->n_outputs.set_audio (finfo->numOutputs);
info->type = ARDOUR::VST;
-
+
_vst_plugin_info.push_back (info);
fst_free_info (finfo);
@@ -595,7 +595,7 @@ PluginManager::save_favorites ()
ofs << "VST";
break;
}
-
+
ofs << ' ' << (*i).unique_id << endl;
}
@@ -612,7 +612,7 @@ PluginManager::load_favorites ()
if (!ifs) {
return;
}
-
+
std::string stype;
std::string id;
PluginType type;
@@ -642,10 +642,10 @@ PluginManager::load_favorites ()
<< endmsg;
continue;
}
-
+
add_favorite (type, id);
}
-
+
ifs.close ();
}
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index 4b4f0a939a..95073806d6 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,11 +46,11 @@ Port::Port (std::string const & n, DataType t, Flags f)
/* Unfortunately we have to pass the DataType into this constructor so that we can
create the right kind of JACK port; aside from this we'll use the virtual function type ()
- to establish type.
+ to establish type.
*/
assert (_name.find_first_of (':') == std::string::npos);
-
+
if ((_jack_port = jack_port_register (_engine->jack (), _name.c_str (), t.to_jack_type (), _flags, 0)) == 0) {
throw failed_constructor ();
}
@@ -100,7 +100,7 @@ Port::get_connections (std::vector<std::string> & c) const
++n;
}
}
-
+
return n;
}
@@ -113,13 +113,13 @@ Port::connect (std::string const & other)
std::string const this_shrt = _engine->make_port_name_non_relative (_name);
int r = 0;
-
+
if (sends_output ()) {
r = jack_connect (_engine->jack (), this_shrt.c_str (), other_shrt.c_str ());
} else {
r = jack_connect (_engine->jack (), other_shrt.c_str (), this_shrt.c_str());
}
-
+
if (r == 0) {
_connections.insert (other);
}
@@ -136,17 +136,17 @@ Port::disconnect (std::string const & other)
std::string const this_shrt = _engine->make_port_name_non_relative (_name);
int r = 0;
-
+
if (sends_output ()) {
r = jack_disconnect (_engine->jack (), this_shrt.c_str (), other_shrt.c_str ());
} else {
r = jack_disconnect (_engine->jack (), other_shrt.c_str (), this_shrt.c_str ());
}
-
+
if (r == 0) {
_connections.erase (other);
}
-
+
return r;
}
@@ -200,9 +200,9 @@ Port::reset ()
void
Port::recompute_total_latency () const
{
-#ifdef HAVE_JACK_RECOMPUTE_LATENCY
+#ifdef HAVE_JACK_RECOMPUTE_LATENCY
jack_recompute_total_latency (_engine->jack (), _jack_port);
-#endif
+#endif
}
nframes_t
@@ -253,7 +253,7 @@ Port::set_name (std::string const & n)
int const r = jack_port_set_name (_jack_port, n.c_str());
if (r == 0) {
- _name = n;
+ _name = n;
}
return r;
diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc
index a46f7a7da3..61ae4d37e8 100644
--- a/libs/ardour/port_insert.cc
+++ b/libs/ardour/port_insert.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000,2007 Paul Davis
+ Copyright (C) 2000,2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -115,7 +115,7 @@ PortInsert::set_state(const XMLNode& node)
error << _("XML node describing port insert is missing the `type' field") << endmsg;
return -1;
}
-
+
if (prop->value() != "port") {
error << _("non-port insert XML used for port plugin insert") << endmsg;
return -1;
@@ -137,13 +137,13 @@ PortInsert::set_state(const XMLNode& node)
break;
}
}
-
+
Processor::set_state (*insert_node);
return 0;
}
-ARDOUR::nframes_t
+ARDOUR::nframes_t
PortInsert::signal_latency() const
{
/* because we deliver and collect within the same cycle,
diff --git a/libs/ardour/port_set.cc b/libs/ardour/port_set.cc
index 6fdfa763cb..b96e45662b 100644
--- a/libs/ardour/port_set.cc
+++ b/libs/ardour/port_set.cc
@@ -1,16 +1,16 @@
/*
- Copyright (C) 2006 Paul Davis
-
+ Copyright (C) 2006 Paul Davis
+
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
-
+
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
@@ -37,7 +37,7 @@ void
PortSet::add(Port* port)
{
PortVec& v = _ports[port->type()];
-
+
v.push_back(port);
sort(v.begin(), v.end(), sort_ports_by_name);
@@ -88,7 +88,7 @@ Port*
PortSet::port(size_t n) const
{
// This is awesome. Awesomely slow.
-
+
size_t size_so_far = 0;
for (std::vector<PortVec>::const_iterator l = _ports.begin(); l != _ports.end(); ++l) {
diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc
index 6f32afc925..c8f7a136bb 100644
--- a/libs/ardour/processor.cc
+++ b/libs/ardour/processor.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -92,8 +92,8 @@ Processor::get_state (void)
return state (true);
}
-/* NODE STRUCTURE
-
+/* NODE STRUCTURE
+
<Automation [optionally with visible="...." ]>
<parameter-N>
<AutomationList id=N>
@@ -112,18 +112,18 @@ Processor::state (bool full_state)
XMLNode* node = new XMLNode (state_node_name);
stringstream sstr;
char buf[64];
-
+
id().print (buf, sizeof (buf));
node->add_property("id", buf);
node->add_property("name", _name);
- node->add_property("active", active() ? "yes" : "no");
+ node->add_property("active", active() ? "yes" : "no");
if (_extra_xml){
node->add_child_copy (*_extra_xml);
}
-
+
if (full_state) {
- XMLNode& automation = Automatable::get_automation_state();
+ XMLNode& automation = Automatable::get_automation_state();
if (!automation.children().empty()
|| !automation.properties().empty()
|| !_visible_controls.empty()) {
@@ -158,7 +158,7 @@ Processor::set_state (const XMLNode& node)
// may not exist for legacy 3.0 sessions
if ((prop = node.property ("id")) != 0) {
_id = prop->value();
- }
+ }
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
@@ -168,7 +168,7 @@ Processor::set_state (const XMLNode& node)
if ((*niter)->name() == X_("Automation")) {
XMLProperty *prop;
-
+
if ((prop = (*niter)->property ("path")) != 0) {
old_set_automation_state (*(*niter));
} else {
@@ -180,7 +180,7 @@ Processor::set_state (const XMLNode& node)
stringstream sstr;
_visible_controls.clear ();
-
+
sstr << prop->value();
while (1) {
sstr >> what;
@@ -215,7 +215,7 @@ Processor::set_state (const XMLNode& node)
if (_active != string_is_affirmative (prop->value())) {
_active = !_active;
ActiveChanged (); /* EMIT_SIGNAL */
- }
+ }
return 0;
}
@@ -225,11 +225,11 @@ Processor::configure_io (ChanCount in, ChanCount out)
{
/* This class assumes 1:1 input:output.static output stream count.
Derived classes must override and set _configured_output appropriately
- if this is not the case
+ if this is not the case
*/
- _configured_input = in;
- _configured_output = out;
+ _configured_input = in;
+ _configured_output = out;
_configured = true;
ConfigurationChanged.emit (in, out);
diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc
index 7aedb98a4d..97be158bad 100644
--- a/libs/ardour/quantize.cc
+++ b/libs/ardour/quantize.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,9 +40,9 @@ using namespace ARDOUR;
* 0.25 = quantize to beats/4, etc.
*/
-Quantize::Quantize (Session& s, QuantizeType /* type */,
+Quantize::Quantize (Session& s, QuantizeType /* type */,
bool snap_start, bool snap_end,
- double start_grid, double end_grid,
+ double start_grid, double end_grid,
float strength, float swing, float threshold)
: session (s)
, _snap_start (snap_start)
@@ -70,35 +70,35 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model, std::vector<Evoral::S
even = false;
for (Evoral::Sequence<MidiModel::TimeType>::Notes::iterator i = (*s).begin(); i != (*s).end(); ++i) {
-
- double new_start = round ((*i)->time() / _start_grid) * _start_grid;
+
+ double new_start = round ((*i)->time() / _start_grid) * _start_grid;
double new_end = round ((*i)->end_time() / _end_grid) * _end_grid;
double delta;
-
+
if (_swing > 0.0 && !even) {
-
+
double next_grid = new_start + _start_grid;
-
+
/* find a spot 2/3 (* swing factor) of the way between the grid point
we would put this note at, and the nominal position of the next note.
*/
-
+
new_start = new_start + (2.0/3.0 * _swing * (next_grid - new_start));
-
+
} else if (_swing < 0.0 && !even) {
-
+
double prev_grid = new_start - _start_grid;
-
+
/* find a spot 2/3 (* swing factor) of the way between the grid point
we would put this note at, and the nominal position of the previous note.
*/
-
+
new_start = new_start - (2.0/3.0 * _swing * (new_start - prev_grid));
-
+
}
-
+
delta = new_start - (*i)->time();
-
+
if (fabs (delta) >= _threshold) {
if (_snap_start) {
delta *= _strength;
@@ -106,21 +106,21 @@ Quantize::operator () (boost::shared_ptr<MidiModel> model, std::vector<Evoral::S
(*i)->time() + delta);
}
}
-
+
if (_snap_end) {
delta = new_end - (*i)->end_time();
-
+
if (fabs (delta) >= _threshold) {
double new_dur = new_end - new_start;
-
+
if (new_dur == 0.0) {
new_dur = _end_grid;
}
-
+
cmd->change ((*i), MidiModel::DiffCommand::Length, new_dur);
}
}
-
+
even = !even;
}
}
diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc
index b61170da09..99c60d224e 100644
--- a/libs/ardour/rb_effect.cc
+++ b/libs/ardour/rb_effect.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004-2007 Paul Davis
+ Copyright (C) 2004-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -83,7 +83,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
cerr << "RBEffect: source region: position = " << region->position()
<< ", start = " << region->start()
- << ", length = " << region->length()
+ << ", length = " << region->length()
<< ", ancestral_start = " << region->ancestral_start()
<< ", ancestral_length = " << region->ancestral_length()
<< ", stretch " << region->stretch()
@@ -91,33 +91,33 @@ RBEffect::run (boost::shared_ptr<Region> r)
/*
We have two cases to consider:
-
+
1. The region has not been stretched before.
-
+
In this case, we just want to read region->length() frames
from region->start().
-
+
We will create a new region of region->length() *
tsr.time_fraction frames. The new region will have its
start set to 0 (because it has a new audio file that begins
at the start of the stretched area) and its ancestral_start
set to region->start() (so that we know where to begin
reading if we want to stretch it again).
-
+
2. The region has been stretched before.
-
+
The region starts at region->start() frames into its
(possibly previously stretched) source file. But we don't
want to read from its source file; we want to read from the
file it was originally stretched from.
-
+
The region's source begins at region->ancestral_start()
frames into its master source file. Thus, we need to start
reading at region->ancestral_start() + (region->start() /
region->stretch()) frames into the master source. This
value will also become the ancestral_start for the new
region.
-
+
We cannot use region->ancestral_length() to establish how
many frames to read, because it won't be up to date if the
region has been trimmed since it was last stretched. We
@@ -125,10 +125,10 @@ RBEffect::run (boost::shared_ptr<Region> r)
stretch them by tsr.time_fraction * region->stretch(), for
a new region of region->length() * tsr.time_fraction
frames.
-
+
Case 1 is of course a special case of 2, where
region->ancestral_start() == 0 and region->stretch() == 1.
-
+
When we ask to read from a region, we supply a position on
the global timeline. The read function calculates the
offset into the source as (position - region->position()) +
@@ -138,9 +138,9 @@ RBEffect::run (boost::shared_ptr<Region> r)
n frames into the master source, we need to provide n -
region->start() + region->position() as our position
argument to master_read_at().
-
+
Note that region->ancestral_length() is not used.
-
+
I hope this is clear.
*/
@@ -158,7 +158,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
RubberBandStretcher stretcher
(session.frame_rate(), channels,
(RubberBandStretcher::Options) tsr.opts, stretch, shift);
-
+
tsr.progress = 0.0f;
tsr.done = false;
@@ -174,7 +174,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
} else if (shift == 1.0) {
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (stretch * 100.0f));
} else {
- snprintf (suffix, sizeof (suffix), "@%d-%d",
+ snprintf (suffix, sizeof (suffix), "@%d-%d",
(int) floor (stretch * 100.0f),
(int) floor (shift * 100.0f));
}
@@ -202,18 +202,18 @@ RBEffect::run (boost::shared_ptr<Region> r)
avail = 0;
done = 0;
- try {
+ try {
while (pos < read_duration && !tsr.cancel) {
-
+
nframes_t this_read = 0;
for (uint32_t i = 0; i < channels; ++i) {
-
+
this_read = 0;
nframes_t this_time;
this_time = min(bufsize, read_duration - pos);
-
+
nframes_t this_position;
this_position = read_start + pos -
region->start() + region->position();
@@ -225,7 +225,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
this_position,
this_time,
i);
-
+
if (this_read != this_time) {
error << string_compose
(_("tempoize: error reading data from %1 at %2 (wanted %3, got %4)"),
@@ -233,7 +233,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
goto out;
}
}
-
+
pos += this_read;
done += this_read;
@@ -241,16 +241,16 @@ RBEffect::run (boost::shared_ptr<Region> r)
stretcher.study(buffers, this_read, pos == read_duration);
}
-
+
done = 0;
pos = 0;
while (pos < read_duration && !tsr.cancel) {
-
+
nframes_t this_read = 0;
-
+
for (uint32_t i = 0; i < channels; ++i) {
-
+
this_read = 0;
nframes_t this_time;
this_time = min(bufsize, read_duration - pos);
@@ -258,7 +258,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
nframes_t this_position;
this_position = read_start + pos -
region->start() + region->position();
-
+
this_read = region->master_read_at
(buffers[i],
buffers[i],
@@ -266,7 +266,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
this_position,
this_time,
i);
-
+
if (this_read != this_time) {
error << string_compose
(_("tempoize: error reading data from %1 at %2 (wanted %3, got %4)"),
@@ -289,7 +289,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
this_read = min(bufsize, uint32_t(avail));
stretcher.retrieve(buffers, this_read);
-
+
for (uint32_t i = 0; i < nsrcs.size(); ++i) {
boost::shared_ptr<AudioSource> asrc = boost::dynamic_pointer_cast<AudioSource>(nsrcs[i]);
@@ -317,7 +317,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
if (!asrc) {
continue;
}
-
+
if (asrc->write(buffers[i], this_read) !=
this_read) {
error << string_compose (_("error writing tempo-adjusted data to %1"), nsrcs[i]->name()) << endmsg;
@@ -372,7 +372,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
(*si)->mark_for_remove ();
}
}
-
+
tsr.done = true;
return ret;
@@ -381,4 +381,4 @@ RBEffect::run (boost::shared_ptr<Region> r)
-
+
diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc
index d39dcb602a..ba9389eec8 100644
--- a/libs/ardour/rc_configuration.cc
+++ b/libs/ardour/rc_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2006 Paul Davis
+ Copyright (C) 1999-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <cstdio> /* for snprintf, grrr */
-#include <glib.h>
+#include <glib.h>
#include <glib/gstdio.h> /* for g_stat() */
#include <glibmm/miscutils.h>
@@ -55,7 +55,7 @@ RCConfiguration::RCConfiguration ()
:
/* construct variables */
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) var (name,value),
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) var (name,value,mutator),
#include "ardour/rc_configuration_vars.h"
@@ -74,7 +74,7 @@ RCConfiguration::load_state ()
struct stat statbuf;
/* load system configuration first */
-
+
if (find_file_in_search_path (ardour_search_path() + system_config_search_path(),
"ardour_system.rc", system_rc_file) )
{
@@ -84,19 +84,19 @@ RCConfiguration::load_state ()
string rcfile = system_rc_file.to_string();
/* stupid XML Parser hates empty files */
-
+
if (g_stat (rcfile.c_str(), &statbuf)) {
return -1;
}
if (statbuf.st_size != 0) {
cerr << string_compose (_("Loading system configuration file %1"), rcfile) << endl;
-
+
if (!tree.read (rcfile.c_str())) {
error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
-
+
if (set_state (*tree.root())) {
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
@@ -126,19 +126,19 @@ RCConfiguration::load_state ()
if (statbuf.st_size != 0) {
cerr << string_compose (_("Loading user configuration file %1"), rcfile) << endl;
-
+
if (!tree.read (rcfile)) {
error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
-
+
if (set_state (*tree.root())) {
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
} else {
warning << _("your Ardour configuration file is empty. This is not normal.") << endmsg;
- }
+ }
}
if (!found)
@@ -161,7 +161,7 @@ RCConfiguration::save_state()
error << "Could not create user configuration directory" << endmsg;
return -1;
}
-
+
sys::path rcfile_path(user_config_directory());
rcfile_path /= "ardour.rc";
@@ -202,19 +202,19 @@ RCConfiguration::get_state ()
MIDI::Manager::PortMap::const_iterator i;
const MIDI::Manager::PortMap& ports = MIDI::Manager::instance()->get_midi_ports();
-
+
for (i = ports.begin(); i != ports.end(); ++i) {
root->add_child_nocopy(i->second->get_state());
}
-
+
root->add_child_nocopy (get_variables ());
-
+
if (_extra_xml) {
root->add_child_copy (*_extra_xml);
}
-
+
root->add_child_nocopy (ControlProtocolManager::instance().get_state());
-
+
return *root;
}
@@ -227,14 +227,14 @@ RCConfiguration::get_variables ()
node = new XMLNode ("Config");
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,Name,value) \
var.add_to_node (*node);
#define CONFIG_VARIABLE_SPECIAL(type,var,Name,value,mutator) \
var.add_to_node (*node);
#include "ardour/rc_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
return *node;
}
@@ -271,9 +271,9 @@ RCConfiguration::set_state (const XMLNode& root)
}
} else if (node->name() == "Config") {
-
+
set_variables (*node);
-
+
} else if (node->name() == "Extra") {
_extra_xml = new XMLNode (*node);
@@ -291,7 +291,7 @@ void
RCConfiguration::set_variables (const XMLNode& node)
{
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,name,value) \
if (var.set_from_node (node)) { \
ParameterChanged (name); \
@@ -304,16 +304,16 @@ RCConfiguration::set_variables (const XMLNode& node)
#include "ardour/rc_configuration_vars.h"
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
-
+
}
void
RCConfiguration::map_parameters (sigc::slot<void, std::string> theSlot)
{
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,name,value) theSlot (name);
#define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) theSlot (name);
#include "ardour/rc_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
}
diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc
index 7d62300e3d..dfe85190b3 100644
--- a/libs/ardour/recent_sessions.cc
+++ b/libs/ardour/recent_sessions.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -50,11 +50,11 @@ ARDOUR::read_recent_sessions (RecentSessions& rs)
sys::path recent_file_path(user_config_directory());
recent_file_path /= recent_file_name;
-
+
const string path = recent_file_path.to_string();
ifstream recent (path.c_str());
-
+
if (!recent) {
if (errno != ENOENT) {
error << string_compose (_("cannot open recent session file %1 (%2)"), path, strerror (errno)) << endmsg;
@@ -73,7 +73,7 @@ ARDOUR::read_recent_sessions (RecentSessions& rs)
if (!recent.good()) {
break;
}
-
+
getline(recent, newpair.second);
if (!recent.good()) {
@@ -96,7 +96,7 @@ ARDOUR::write_recent_sessions (RecentSessions& rs)
sys::path recent_file_path(user_config_directory());
recent_file_path /= recent_file_name;
-
+
const string path = recent_file_path.to_string();
ofstream recent (path.c_str());
@@ -108,10 +108,10 @@ ARDOUR::write_recent_sessions (RecentSessions& rs)
for (RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
recent << (*i).first << '\n' << (*i).second << endl;
}
-
+
return 0;
}
-
+
int
ARDOUR::store_recent_sessions (string name, string path)
{
@@ -127,7 +127,7 @@ ARDOUR::store_recent_sessions (string name, string path)
newpair.second = path;
rs.erase(remove(rs.begin(), rs.end(), newpair), rs.end());
-
+
rs.push_front (newpair);
if (rs.size() > 10) {
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 0e0df08284..e1bc5c0883 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2003 Paul Davis
+ Copyright (C) 2000-2003 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -62,10 +62,10 @@ Region::Region (Session& s, nframes_t start, nframes_t length, const string& nam
: SessionObject(s, name)
, _type(type)
, _flags(Flag (flags|DoNotSendPropertyChanges))
- , _start(start)
- , _length(length)
- , _position(0)
- , _last_position(0)
+ , _start(start)
+ , _length(length)
+ , _position(0)
+ , _last_position(0)
, _positional_lock_style(AudioTime)
, _sync_position(_start)
, _layer(layer)
@@ -88,10 +88,10 @@ Region::Region (boost::shared_ptr<Source> src, nframes_t start, nframes_t length
: SessionObject(src->session(), name)
, _type(type)
, _flags(Flag (flags|DoNotSendPropertyChanges))
- , _start(start)
- , _length(length)
- , _position(0)
- , _last_position(0)
+ , _start(start)
+ , _length(length)
+ , _position(0)
+ , _last_position(0)
, _positional_lock_style(AudioTime)
, _sync_position(_start)
, _layer(layer)
@@ -121,10 +121,10 @@ Region::Region (const SourceList& srcs, nframes_t start, nframes_t length, const
: SessionObject(srcs.front()->session(), name)
, _type(type)
, _flags(Flag (flags|DoNotSendPropertyChanges))
- , _start(start)
- , _length(length)
- , _position(0)
- , _last_position(0)
+ , _start(start)
+ , _length(length)
+ , _position(0)
+ , _last_position(0)
, _positional_lock_style(AudioTime)
, _sync_position(_start)
, _layer(layer)
@@ -198,15 +198,15 @@ Region::Region (boost::shared_ptr<const Region> other, nframes_t length, const s
/* sync pos is relative to start of file. our start-in-file is now zero,
so set our sync position to whatever the the difference between
- _start and _sync_pos was in the other region.
+ _start and _sync_pos was in the other region.
- result is that our new sync pos points to the same point in our source(s)
+ result is that our new sync pos points to the same point in our source(s)
as the sync in the other region did in its source(s).
since we start at zero in our source(s), it is not possible to use a sync point that
is before the start. reset it to _start if that was true in the other region.
*/
-
+
if (other->flags() & SyncMarked) {
if (other->_start < other->_sync_position) {
/* sync pos was after the start point of the other region */
@@ -220,7 +220,7 @@ Region::Region (boost::shared_ptr<const Region> other, nframes_t length, const s
_flags = Flag (_flags & ~SyncMarked);
_sync_position = _start;
}
-
+
if (Profile->get_sae()) {
/* reset sync point to start if its ended up
outside region bounds.
@@ -243,10 +243,10 @@ Region::Region (boost::shared_ptr<const Region> other)
: SessionObject(other->session(), other->name())
, _type(other->data_type())
, _flags(Flag(other->_flags & ~(Locked|PositionLocked)))
- , _start(other->_start)
- , _length(other->_length)
- , _position(other->_position)
- , _last_position(other->_last_position)
+ , _start(other->_start)
+ , _length(other->_length)
+ , _position(other->_position)
+ , _last_position(other->_last_position)
, _positional_lock_style(other->_positional_lock_style)
, _sync_position(other->_sync_position)
, _layer(other->_layer)
@@ -280,10 +280,10 @@ Region::Region (const SourceList& srcs, const XMLNode& node)
: SessionObject(srcs.front()->session(), X_("error: XML did not reset this"))
, _type(DataType::NIL) // to be loaded from XML
, _flags(DoNotSendPropertyChanges)
- , _start(0)
- , _length(0)
- , _position(0)
- , _last_position(0)
+ , _start(0)
+ , _length(0)
+ , _position(0)
+ , _last_position(0)
, _positional_lock_style(AudioTime)
, _sync_position(_start)
, _layer(0)
@@ -310,10 +310,10 @@ Region::Region (boost::shared_ptr<Source> src, const XMLNode& node)
: SessionObject(src->session(), X_("error: XML did not reset this"))
, _type(DataType::NIL)
, _flags(DoNotSendPropertyChanges)
- , _start(0)
- , _length(0)
- , _position(0)
- , _last_position(0)
+ , _start(0)
+ , _length(0)
+ , _position(0)
+ , _last_position(0)
, _positional_lock_style(AudioTime)
, _sync_position(_start)
, _layer(0)
@@ -331,7 +331,7 @@ Region::Region (boost::shared_ptr<Source> src, const XMLNode& node)
if (set_state (node)) {
throw failed_constructor();
}
-
+
assert(_type != DataType::NIL);
assert(_sources.size() > 0);
}
@@ -348,7 +348,7 @@ Region::~Region ()
(*i)->remove_playlist (pl);
}
}
-
+
notify_callbacks ();
GoingAway (); /* EMIT SIGNAL */
}
@@ -361,17 +361,17 @@ Region::copy_stuff (boost::shared_ptr<const Region> other, nframes_t /*offset*/,
_read_data_count = 0;
_valid_transients = false;
- _length = length;
- _last_length = length;
+ _length = length;
+ _last_length = length;
_sync_position = other->_sync_position;
_ancestral_start = other->_ancestral_start;
- _ancestral_length = other->_ancestral_length;
+ _ancestral_length = other->_ancestral_length;
_stretch = other->_stretch;
_shift = other->_shift;
_name = name;
- _last_position = 0;
- _position = 0;
- _layer = layer;
+ _last_position = 0;
+ _position = 0;
+ _layer = layer;
_flags = Flag (flags & ~(Locked|WholeFile|Hidden));
_first_edit = EditChangesNothing;
_last_layer_op = 0;
@@ -396,11 +396,11 @@ Region::set_playlist (boost::weak_ptr<Playlist> wpl)
if (pl) {
if (old_playlist) {
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
- (*i)->remove_playlist (_playlist);
+ (*i)->remove_playlist (_playlist);
(*i)->add_playlist (pl);
}
for (SourceList::const_iterator i = _master_sources.begin(); i != _master_sources.end(); ++i) {
- (*i)->remove_playlist (_playlist);
+ (*i)->remove_playlist (_playlist);
(*i)->add_playlist (pl);
}
} else {
@@ -428,7 +428,7 @@ Region::set_name (const std::string& str)
{
if (_name != str) {
SessionObject::set_name(str); // EMIT SIGNAL NameChanged()
- assert(_name == str);
+ assert(_name == str);
send_change (ARDOUR::NameChanged);
}
@@ -445,7 +445,7 @@ Region::set_length (nframes_t len, void */*src*/)
if (_length != len && len != 0) {
- /* check that the current _position wouldn't make the new
+ /* check that the current _position wouldn't make the new
length impossible.
*/
@@ -456,7 +456,7 @@ Region::set_length (nframes_t len, void */*src*/)
if (!verify_length (len)) {
return;
}
-
+
_last_length = _length;
_length = len;
@@ -503,7 +503,7 @@ Region::at_natural_position () const
if (!pl) {
return false;
}
-
+
boost::shared_ptr<Region> whole_file_region = get_parent();
if (whole_file_region) {
@@ -523,18 +523,18 @@ Region::move_to_natural_position (void *src)
if (!pl) {
return;
}
-
+
boost::shared_ptr<Region> whole_file_region = get_parent();
if (whole_file_region) {
set_position (whole_file_region->position() + _start, src);
}
}
-
+
void
Region::special_set_position (nframes_t pos)
{
- /* this is used when creating a whole file region as
+ /* this is used when creating a whole file region as
a way to store its "natural" or "captured" position.
*/
@@ -556,14 +556,14 @@ Region::set_position_lock_style (PositionLockStyle ps)
if (_positional_lock_style == MusicTime) {
pl->session().tempo_map().bbt_time (_position, _bbt_time);
}
-
+
}
void
Region::update_position_after_tempo_map_change ()
{
boost::shared_ptr<Playlist> pl (playlist());
-
+
if (!pl || _positional_lock_style != MusicTime) {
return;
}
@@ -591,7 +591,7 @@ Region::set_position_internal (nframes_t pos, bool allow_bbt_recompute)
_position = pos;
/* check that the new _position wouldn't make the current
- length impossible - if so, change the length.
+ length impossible - if so, change the length.
XXX is this the right thing to do?
*/
@@ -636,7 +636,7 @@ Region::set_position_on_top (nframes_t pos, void */*src*/)
/* do this even if the position is the same. this helps out
a GUI that has moved its representation already.
*/
-
+
send_change (PositionChanged);
}
@@ -650,7 +650,7 @@ Region::recompute_position_from_lock_style ()
}
}
}
-
+
void
Region::nudge_position (nframes64_t n, void */*src*/)
{
@@ -661,7 +661,7 @@ Region::nudge_position (nframes64_t n, void */*src*/)
if (n == 0) {
return;
}
-
+
_last_position = _position;
if (n > 0) {
@@ -724,7 +724,7 @@ Region::trim_start (nframes_t new_position, void */*src*/)
}
nframes_t new_start;
int32_t start_shift;
-
+
if (new_position > _position) {
start_shift = new_position - _position;
} else {
@@ -757,7 +757,7 @@ Region::trim_start (nframes_t new_position, void */*src*/)
if (new_start == _start) {
return;
}
-
+
_start = new_start;
_flags = Region::Flag (_flags & ~WholeFile);
first_edit ();
@@ -782,20 +782,20 @@ Region::trim_front (nframes_t new_position, void *src)
}
if (new_position < end) { /* can't trim it zero or negative length */
-
+
nframes_t newlen;
/* can't trim it back passed where source position zero is located */
-
+
new_position = max (new_position, source_zero);
-
-
+
+
if (new_position > _position) {
newlen = _length - (new_position - _position);
} else {
newlen = _length + (_position - new_position);
}
-
+
trim_to_internal (new_position, newlen, src);
if (!_frozen) {
recompute_at_start ();
@@ -893,17 +893,17 @@ Region::trim_to_internal (nframes_t position, nframes_t length, void */*src*/)
_position = position;
what_changed = Change (what_changed|PositionChanged);
}
-
+
_flags = Region::Flag (_flags & ~WholeFile);
if (what_changed & (StartChanged|LengthChanged)) {
first_edit ();
- }
+ }
if (what_changed) {
send_change (what_changed);
}
-}
+}
void
Region::set_hidden (bool yn)
@@ -982,7 +982,7 @@ Region::set_sync_position (nframes_t absolute_pos)
file_pos = _start + (absolute_pos - _position);
if (file_pos != _sync_position) {
-
+
_sync_position = file_pos;
_flags = Flag (_flags|SyncMarked);
@@ -1014,7 +1014,7 @@ Region::sync_offset (int& dir) const
if (_flags & SyncMarked) {
if (_sync_position > _start) {
dir = 1;
- return _sync_position - _start;
+ return _sync_position - _start;
} else {
dir = -1;
return _start - _sync_position;
@@ -1025,14 +1025,14 @@ Region::sync_offset (int& dir) const
}
}
-nframes_t
+nframes_t
Region::adjust_to_sync (nframes_t pos) const
{
int sync_dir;
nframes_t offset = sync_offset (sync_dir);
// cerr << "adjusting pos = " << pos << " to sync at " << _sync_position << " offset = " << offset << " with dir = " << sync_dir << endl;
-
+
if (sync_dir > 0) {
if (pos > offset) {
pos -= offset;
@@ -1052,7 +1052,7 @@ nframes_t
Region::sync_position() const
{
if (_flags & SyncMarked) {
- return _sync_position;
+ return _sync_position;
} else {
return _start;
}
@@ -1100,7 +1100,7 @@ Region::set_layer (layer_t l)
{
if (_layer != l) {
_layer = l;
-
+
send_change (LayerChanged);
}
}
@@ -1130,7 +1130,7 @@ Region::state (bool /*full_state*/)
node->add_property ("stretch", buf);
snprintf (buf, sizeof (buf), "%.12g", _shift);
node->add_property ("shift", buf);
-
+
switch (_first_edit) {
case EditChangesNothing:
fe = X_("nothing");
@@ -1178,7 +1178,7 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
const XMLProperty *prop;
nframes_t val;
- /* this is responsible for setting those aspects of Region state
+ /* this is responsible for setting those aspects of Region state
that are mutable after construction.
*/
@@ -1188,7 +1188,7 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
}
_name = prop->value();
-
+
if ((prop = node.property ("type")) == 0) {
_type = DataType::AUDIO;
} else {
@@ -1198,7 +1198,7 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
if ((prop = node.property ("start")) != 0) {
sscanf (prop->value().c_str(), "%" PRIu32, &val);
if (val != _start) {
- what_changed = Change (what_changed|StartChanged);
+ what_changed = Change (what_changed|StartChanged);
_start = val;
}
} else {
@@ -1258,7 +1258,7 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
/* missing BBT info, revert to audio time locking */
_positional_lock_style = AudioTime;
} else {
- if (sscanf (prop->value().c_str(), "%d|%d|%d",
+ if (sscanf (prop->value().c_str(), "%d|%d|%d",
&_bbt_time.bars,
&_bbt_time.beats,
&_bbt_time.ticks) != 3) {
@@ -1266,13 +1266,13 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
}
}
}
-
+
} else {
_positional_lock_style = AudioTime;
}
/* XXX FIRST EDIT !!! */
-
+
/* these 3 properties never change as a result of any editing */
if ((prop = node.property ("ancestral-start")) != 0) {
@@ -1320,11 +1320,11 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
_extra_xml = 0;
for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
XMLNode *child;
-
+
child = (*niter);
-
+
if (child->name () == "Extra") {
_extra_xml = new XMLNode (*child);
break;
@@ -1352,9 +1352,9 @@ Region::set_state (const XMLNode& node)
}
_id = prop->value();
-
+
_first_edit = EditChangesNothing;
-
+
set_live_state (node, what_changed, true);
return 0;
@@ -1393,10 +1393,10 @@ Region::thaw (const string& /*why*/)
if (what_changed & LengthChanged) {
if (what_changed & PositionChanged) {
recompute_at_start ();
- }
+ }
recompute_at_end ();
}
-
+
StateChanged (what_changed);
}
@@ -1408,17 +1408,17 @@ Region::send_change (Change what_changed)
if (_frozen) {
_pending_changed = Change (_pending_changed|what_changed);
return;
- }
+ }
}
StateChanged (what_changed);
-
+
if (!(_flags & DoNotSendPropertyChanges)) {
-
+
/* Try and send a shared_pointer unless this is part of the constructor.
If so, do nothing.
*/
-
+
try {
boost::shared_ptr<Region> rptr = shared_from_this();
RegionPropertyChanged (rptr);
@@ -1426,7 +1426,7 @@ Region::send_change (Change what_changed)
/* no shared_ptr available, relax; */
}
}
-
+
}
void
@@ -1531,9 +1531,9 @@ Region::verify_length (nframes_t len)
for (uint32_t n=0; n < _sources.size(); ++n) {
maxlen = max (maxlen, (nframes_t)source_length(n) - _start);
}
-
+
len = min (len, maxlen);
-
+
return true;
}
@@ -1593,12 +1593,12 @@ Region::get_parent() const
if (pl) {
boost::shared_ptr<Region> r;
boost::shared_ptr<Region const> grrr2 = boost::dynamic_pointer_cast<Region const> (shared_from_this());
-
+
if (grrr2 && (r = pl->session().find_whole_file_parent (grrr2))) {
return boost::static_pointer_cast<Region> (r);
}
}
-
+
return boost::shared_ptr<Region>();
}
@@ -1621,7 +1621,7 @@ void
Region::use_sources (SourceList const & s)
{
set<boost::shared_ptr<Source> > unique_srcs;
-
+
for (SourceList::const_iterator i = s.begin (); i != s.end(); ++i) {
_sources.push_back (*i);
(*i)->GoingAway.connect (bind (mem_fun (*this, &Region::source_deleted), *i));
@@ -1635,4 +1635,4 @@ Region::use_sources (SourceList const & s)
}
}
}
-
+
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc
index 004321fa9e..6ff4ae2dc1 100644
--- a/libs/ardour/region_factory.cc
+++ b/libs/ardour/region_factory.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,8 +36,8 @@ using namespace PBD;
sigc::signal<void,boost::shared_ptr<Region> > RegionFactory::CheckNewRegion;
boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
- nframes_t length, const std::string& name,
+RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
+ nframes_t length, const std::string& name,
layer_t layer, Region::Flag flags, bool announce)
{
boost::shared_ptr<const AudioRegion> other_a;
@@ -94,8 +94,8 @@ RegionFactory::create (boost::shared_ptr<const Region> region)
}
boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<AudioRegion> region, nframes_t start,
- nframes_t length, const std::string& name,
+RegionFactory::create (boost::shared_ptr<AudioRegion> region, nframes_t start,
+ nframes_t length, const std::string& name,
layer_t layer, Region::Flag flags, bool announce)
{
return create (boost::static_pointer_cast<Region> (region), start, length, name, layer, flags, announce);
@@ -141,8 +141,8 @@ RegionFactory::create (Session& session, XMLNode& node, bool yn)
return r;
}
-
-boost::shared_ptr<Region>
+
+boost::shared_ptr<Region>
RegionFactory::create (const SourceList& srcs, nframes_t start, nframes_t length, const string& name, layer_t layer, Region::Flag flags, bool announce)
{
if (srcs.empty()) {
@@ -150,7 +150,7 @@ RegionFactory::create (const SourceList& srcs, nframes_t start, nframes_t length
}
if (srcs[0]->type() == DataType::AUDIO) {
-
+
AudioRegion* ar = new AudioRegion (srcs, start, length, name, layer, flags);
boost::shared_ptr<AudioRegion> arp (ar);
boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (arp));
@@ -161,7 +161,7 @@ RegionFactory::create (const SourceList& srcs, nframes_t start, nframes_t length
return ret;
} else if (srcs[0]->type() == DataType::MIDI) {
-
+
MidiRegion* ar = new MidiRegion (srcs, start, length, name, layer, flags);
boost::shared_ptr<MidiRegion> mrp (ar);
boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (mrp));
@@ -174,9 +174,9 @@ RegionFactory::create (const SourceList& srcs, nframes_t start, nframes_t length
}
return boost::shared_ptr<Region> ();
-}
+}
-boost::shared_ptr<Region>
+boost::shared_ptr<Region>
RegionFactory::create (SourceList& srcs, const XMLNode& node)
{
if (srcs.empty()) {
@@ -198,7 +198,7 @@ RegionFactory::create (SourceList& srcs, const XMLNode& node)
return boost::shared_ptr<Region> ();
}
-boost::shared_ptr<Region>
+boost::shared_ptr<Region>
RegionFactory::create (boost::shared_ptr<Source> src, nframes_t start, nframes_t length, const string& name, layer_t layer, Region::Flag flags, bool announce)
{
boost::shared_ptr<AudioSource> as;
diff --git a/libs/ardour/resampled_source.cc b/libs/ardour/resampled_source.cc
index cfc5c9f4f1..57811312f1 100644
--- a/libs/ardour/resampled_source.cc
+++ b/libs/ardour/resampled_source.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Paul Davis
+ Copyright (C) 2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,12 +32,12 @@ ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<Importab
: source (src)
{
int err;
-
+
source->seek (0);
-
+
/* Initialize the sample rate converter. */
-
- int src_type = SRC_SINC_BEST_QUALITY;
+
+ int src_type = SRC_SINC_BEST_QUALITY;
switch (srcq) {
case SrcBest:
@@ -56,21 +56,21 @@ ResampledImportableSource::ResampledImportableSource (boost::shared_ptr<Importab
src_type = SRC_LINEAR;
break;
}
-
- if ((src_state = src_new (src_type, source->channels(), &err)) == 0) {
+
+ if ((src_state = src_new (src_type, source->channels(), &err)) == 0) {
error << string_compose(_("Import: src_new() failed : %1"), src_strerror (err)) << endmsg ;
throw failed_constructor ();
}
-
+
src_data.end_of_input = 0 ; /* Set this later. */
-
+
/* Start with zero to force load in while loop. */
-
+
src_data.input_frames = 0 ;
src_data.data_in = input ;
-
+
src_data.src_ratio = ((float) rate) / source->samplerate();
-
+
input = new float[blocksize];
}
@@ -80,14 +80,14 @@ ResampledImportableSource::~ResampledImportableSource ()
delete [] input;
}
-nframes_t
+nframes_t
ResampledImportableSource::read (Sample* output, nframes_t nframes)
{
int err;
/* If the input buffer is empty, refill it. */
-
- if (src_data.input_frames == 0) {
+
+ if (src_data.input_frames == 0) {
src_data.input_frames = source->read (input, blocksize);
@@ -95,12 +95,12 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
if ((nframes_t) src_data.input_frames < blocksize) {
src_data.end_of_input = true;
- }
+ }
src_data.input_frames /= source->channels();
src_data.data_in = input;
- }
-
+ }
+
src_data.data_out = output;
if (!src_data.end_of_input) {
@@ -112,14 +112,14 @@ ResampledImportableSource::read (Sample* output, nframes_t nframes)
if ((err = src_process (src_state, &src_data))) {
error << string_compose(_("Import: %1"), src_strerror (err)) << endmsg ;
return 0 ;
- }
-
+ }
+
/* Terminate if at end */
-
+
if (src_data.end_of_input && src_data.output_frames_gen == 0) {
return 0;
}
-
+
src_data.data_in += src_data.input_frames_used * source->channels();
src_data.input_frames -= src_data.input_frames_used ;
diff --git a/libs/ardour/return.cc b/libs/ardour/return.cc
index e5af719afd..858d658c9c 100644
--- a/libs/ardour/return.cc
+++ b/libs/ardour/return.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ using namespace ARDOUR;
using namespace PBD;
Return::Return (Session& s, bool internal)
- : IOProcessor (s, (internal ? false : true), false,
+ : IOProcessor (s, (internal ? false : true), false,
string_compose (_("return %1"), (_bitslot = s.next_return_id()) + 1))
, _metering (false)
{
@@ -113,7 +113,7 @@ Return::set_state(const XMLNode& node)
// _io->set_automation_state (*(*niter), Evoral::Parameter(GainAutomation));
}
}
-
+
IOProcessor::set_state (*insert_node);
return 0;
@@ -125,7 +125,7 @@ Return::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframe
if ((!_active && !_pending_active) || _input->n_ports() == ChanCount::ZERO) {
return;
}
-
+
_input->collect_input (bufs, nframes, _configured_input);
bufs.set_count(_configured_output);
@@ -133,7 +133,7 @@ Return::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframe
// so that we don't overwrite the main automation data for the route amp
// _amp->setup_gain_automation (start_frame, end_frame, nframes);
_amp->run (bufs, start_frame, end_frame, nframes);
-
+
if (_metering) {
if (_amp->gain_control()->get_value() == 0) {
_meter->reset();
@@ -184,7 +184,7 @@ Return::make_unique (XMLNode &state, Session &session)
state.property("bitslot")->set_value (buf);
std::string const name = string_compose (_("return %1"), bitslot);
-
+
state.property("name")->set_value (name);
XMLNode* io = state.child ("IO");
diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc
index ed3970bdfc..a35858ce97 100644
--- a/libs/ardour/reverse.cc
+++ b/libs/ardour/reverse.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -83,13 +83,13 @@ Reverse::run (boost::shared_ptr<Region> r)
for (n = 0, si = nsrcs.begin(); n < region->n_channels(); ++n, ++si) {
/* read it in directly from the source */
-
+
if (region->audio_source (n)->read (buf, fpos, to_read) != to_read) {
goto out;
}
/* swap memory order */
-
+
for (nframes_t i = 0; i < to_read/2; ++i) {
swap (buf[i],buf[to_read-1-i]);
}
@@ -124,6 +124,6 @@ Reverse::run (boost::shared_ptr<Region> r)
asrc->mark_for_remove ();
}
}
-
+
return ret;
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 5595ac3972..862dbdece7 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -73,12 +73,12 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
, _solo_control (new SoloControllable (X_("solo"), *this))
, _mute_master (new MuteMaster (sess, name))
, _default_type (default_type)
-
+
{
init ();
-
+
/* add standard processors other than amp (added by ::init()) */
-
+
_meter.reset (new PeakMeter (_session));
add_processor (_meter, PreFader);
@@ -87,7 +87,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
_intreturn.reset (new InternalReturn (_session));
add_processor (_intreturn, PreFader);
}
-
+
_main_outs.reset (new Delivery (_session, _output, _mute_master, _name, Delivery::Main));
add_processor (_main_outs, PostFader);
@@ -108,7 +108,7 @@ Route::Route (Session& sess, const XMLNode& node, DataType default_type)
_set_state (node, false);
/* now that we have _meter, its safe to connect to this */
-
+
_meter_connection = Metering::connect (mem_fun (*this, &Route::meter));
}
@@ -131,7 +131,7 @@ Route::init ()
_pending_declick = true;
_remote_control_id = 0;
_in_configure_processors = false;
-
+
_route_group = 0;
_phase_invert = 0;
@@ -141,7 +141,7 @@ Route::init ()
add_control (_solo_control);
add_control (_mute_master);
-
+
/* input and output objects */
_input.reset (new IO (_session, _name, IO::Input, _default_type));
@@ -199,7 +199,7 @@ Route::set_order_key (std::string const & name, long n)
for (OrderKeys::iterator x = order_keys.begin(); x != order_keys.end(); ++x) {
x->second = n;
}
- }
+ }
_session.set_dirty ();
}
@@ -257,14 +257,14 @@ void
Route::set_gain (gain_t val, void *src)
{
if (src != 0 && _route_group && src != _route_group && _route_group->active_property (RouteGroup::Gain)) {
-
+
if (_route_group->is_relative()) {
gain_t usable_gain = _amp->gain();
if (usable_gain < 0.000001f) {
usable_gain = 0.000001f;
}
-
+
gain_t delta = val;
if (delta < 0.000001f) {
delta = 0.000001f;
@@ -290,16 +290,16 @@ Route::set_gain (gain_t val, void *src)
return;
}
}
-
+
_route_group->apply (&Route::inc_gain, factor, _route_group);
} else {
-
+
_route_group->apply (&Route::set_gain, val, _route_group);
}
return;
- }
+ }
if (val == _amp->gain()) {
return;
@@ -311,7 +311,7 @@ Route::set_gain (gain_t val, void *src)
/** Process this route for one (sub) cycle (process thread)
*
* @param bufs Scratch buffers to use for the signal path
- * @param start_frame Initial transport frame
+ * @param start_frame Initial transport frame
* @param end_frame Final transport frame
* @param nframes Number of frames to output (to ports)
*
@@ -342,7 +342,7 @@ Route::process_output_buffers (BufferSet& bufs,
/* figure out if we're going to use gain automation */
_amp->setup_gain_automation (start_frame, end_frame, nframes);
-
+
/* tell main outs what to do about monitoring */
_main_outs->no_outs_cuz_we_no_monitor (!monitor);
@@ -356,20 +356,20 @@ Route::process_output_buffers (BufferSet& bufs,
Amp::apply_gain (bufs, nframes, 0.0, 1.0);
} else if (declick < 0) {
Amp::apply_gain (bufs, nframes, 1.0, 0.0);
- }
+ }
_pending_declick = 0;
-
+
/* -------------------------------------------------------------------------------------------
DENORMAL CONTROL/PHASE INVERT
----------------------------------------------------------------------------------------- */
if (_phase_invert) {
-
+
int chn = 0;
if (_denormal_protection || Config->get_denormal_protection()) {
-
+
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i, ++chn) {
Sample* const sp = i->data();
@@ -389,19 +389,19 @@ Route::process_output_buffers (BufferSet& bufs,
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i, ++chn) {
Sample* const sp = i->data();
-
+
if (_phase_invert & chn) {
for (nframes_t nx = 0; nx < nframes; ++nx) {
sp[nx] = -sp[nx];
}
- }
+ }
}
}
} else {
if (_denormal_protection || Config->get_denormal_protection()) {
-
+
for (BufferSet::audio_iterator i = bufs.audio_begin(); i != bufs.audio_end(); ++i) {
Sample* const sp = i->data();
for (nframes_t nx = 0; nx < nframes; ++nx) {
@@ -409,7 +409,7 @@ Route::process_output_buffers (BufferSet& bufs,
}
}
- }
+ }
}
/* -------------------------------------------------------------------------------------------
@@ -450,29 +450,29 @@ Route::passthru (sframes_t start_frame, sframes_t end_frame, nframes_t nframes,
_silent = false;
assert (bufs.available() >= _input->n_ports());
-
+
if (_input->n_ports() == ChanCount::ZERO) {
silence (nframes);
}
-
+
bufs.set_count (_input->n_ports());
if (is_control() && _session.listening()) {
-
+
/* control/monitor bus ignores input ports when something is
feeding the listen "stream". data will "arrive" into the
route from the intreturn processor element.
*/
-
+
bufs.silence (nframes, 0);
} else {
-
+
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
-
+
BufferSet::iterator o = bufs.begin(*t);
PortSet& ports (_input->ports());
-
+
for (PortSet::iterator i = ports.begin(*t); i != ports.end(*t); ++i, ++o) {
o->read_from (i->get_buffer(nframes), nframes);
}
@@ -494,7 +494,7 @@ Route::passthru_silence (sframes_t start_frame, sframes_t end_frame, nframes_t n
void
Route::set_listen (bool yn, void* src)
{
- if (_control_outs) {
+ if (_control_outs) {
if (yn != _control_outs->active()) {
if (yn) {
_control_outs->activate ();
@@ -533,7 +533,7 @@ Route::set_solo (bool yn, void *src)
mod_solo_level (yn ? 1 : -1);
solo_changed (src); /* EMIT SIGNAL */
_solo_control->Changed (); /* EMIT SIGNAL */
- }
+ }
}
void
@@ -569,7 +569,7 @@ Route::set_solo_isolated (bool yn, void *src)
/* tell main outs what the solo situation is
*/
-
+
_main_outs->set_solo_level (_solo_level);
_main_outs->set_solo_isolated (_solo_isolated);
@@ -578,7 +578,7 @@ Route::set_solo_isolated (bool yn, void *src)
}
bool
-Route::solo_isolated () const
+Route::solo_isolated () const
{
return _solo_isolated;
}
@@ -595,10 +595,10 @@ Route::set_mute (bool yn, void *src)
_mute_master->mute (yn);
mute_changed (src);
}
-}
+}
bool
-Route::muted() const
+Route::muted() const
{
return _mute_master->muted ();
}
@@ -682,7 +682,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
// Set up processor list channels. This will set processor->[input|output]_streams(),
// configure redirect ports properly, etc.
-
+
if (configure_processors_unlocked (err)) {
ProcessorList::iterator ploc = loc;
@@ -692,16 +692,16 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
cerr << "configure failed\n";
return -1;
}
-
+
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(processor)) != 0) {
-
+
if (pi->natural_input_streams() == ChanCount::ZERO) {
/* generator plugin */
_have_internal_generator = true;
}
-
+
}
-
+
if (_control_outs != processor) {
// XXX: do we want to emit the signal here ? change call order.
processor->activate ();
@@ -710,9 +710,9 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
_output->set_user_latency (0);
}
-
+
processors_changed (); /* EMIT SIGNAL */
-
+
return 0;
}
@@ -724,23 +724,23 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
if (node.name() != "Processor") {
return false;
}
-
+
try {
if ((prop = node.property ("type")) != 0) {
-
+
boost::shared_ptr<Processor> processor;
- if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
+ if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
prop->value() == "lv2" ||
prop->value() == "vst" ||
prop->value() == "audiounit") {
-
+
processor.reset (new PluginInsert(_session, node));
-
+
} else if (prop->value() == "port") {
processor.reset (new PortInsert (_session, _mute_master, node));
-
+
} else if (prop->value() == "send") {
processor.reset (new Send (_session, _mute_master, node));
@@ -755,13 +755,13 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
}
}
- _meter.reset (new PeakMeter (_session, node));
+ _meter.reset (new PeakMeter (_session, node));
processor = _meter;
-
+
} else if (prop->value() == "amp") {
/* amp always exists */
-
+
processor = _amp;
if (processor->set_state (node)) {
return false;
@@ -769,13 +769,13 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
/* never any reason to add it */
return true;
}
-
+
} else if (prop->value() == "intsend") {
processor.reset (new InternalSend (_session, _mute_master, node));
} else if (prop->value() == "intreturn") {
-
+
if (_intreturn) {
if (_intreturn->set_state (node)) {
return false;
@@ -787,7 +787,7 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
processor = _intreturn;
} else if (prop->value() == "main-outs") {
-
+
if (_main_outs) {
if (_main_outs->set_state (node)) {
return false;
@@ -803,7 +803,7 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
error << string_compose(_("unknown Processor type \"%1\"; ignored"), prop->value()) << endmsg;
return false;
}
-
+
if (iter == _processors.end() && processor->visible() && !_processors.empty()) {
/* check for invisible processors stacked at the end and leave them there */
ProcessorList::iterator p;
@@ -817,7 +817,7 @@ Route::add_processor_from_xml (const XMLNode& node, ProcessorList::iterator iter
}
return (add_processor (processor, iter) == 0);
-
+
} else {
error << _("Processor XML node has no type property") << endmsg;
return false;
@@ -871,7 +871,7 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter
ChanCount potential_max_streams = ChanCount::max (_input->n_ports(), _output->n_ports());
for (ProcessorList::const_iterator i = others.begin(); i != others.end(); ++i) {
-
+
// Ensure meter only appears in the list once
if (*i == _meter) {
ProcessorList::iterator m = find(_processors.begin(), _processors.end(), *i);
@@ -879,12 +879,12 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter
_processors.erase(m);
}
}
-
+
boost::shared_ptr<PluginInsert> pi;
-
+
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
pi->set_count (1);
-
+
ChanCount m = max (pi->input_streams(), pi->output_streams());
if (m > potential_max_streams) {
@@ -893,20 +893,20 @@ Route::add_processors (const ProcessorList& others, ProcessorList::iterator iter
}
_processors.insert (iter, *i);
-
+
if (configure_processors_unlocked (err)) {
++existing_end;
_processors.erase (existing_end, _processors.end());
configure_processors_unlocked (0); // it worked before we tried to add it ...
return -1;
}
-
+
(*i)->ActiveChanged.connect (bind (mem_fun (_session, &Session::update_latency_compensation), false, false));
}
_output->set_user_latency (0);
}
-
+
processors_changed (); /* EMIT SIGNAL */
return 0;
@@ -932,10 +932,10 @@ void
Route::disable_processors (Placement p)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
ProcessorList::iterator start, end;
placement_range(p, start, end);
-
+
for (ProcessorList::iterator i = start; i != end; ++i) {
(*i)->deactivate ();
}
@@ -943,17 +943,17 @@ Route::disable_processors (Placement p)
_session.set_dirty ();
}
-/** Turn off all redirects
+/** Turn off all redirects
*/
void
Route::disable_processors ()
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
(*i)->deactivate ();
}
-
+
_session.set_dirty ();
}
@@ -964,16 +964,16 @@ void
Route::disable_plugins (Placement p)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
ProcessorList::iterator start, end;
placement_range(p, start, end);
-
+
for (ProcessorList::iterator i = start; i != end; ++i) {
if (boost::dynamic_pointer_cast<PluginInsert> (*i)) {
(*i)->deactivate ();
}
}
-
+
_session.set_dirty ();
}
@@ -983,13 +983,13 @@ void
Route::disable_plugins ()
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<PluginInsert> (*i)) {
(*i)->deactivate ();
}
}
-
+
_session.set_dirty ();
}
@@ -998,7 +998,7 @@ void
Route::ab_plugins (bool forward)
{
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
if (forward) {
/* forward = turn off all active redirects, and mark them so that the next time
@@ -1035,11 +1035,11 @@ Route::ab_plugins (bool forward)
}
}
}
-
+
_session.set_dirty ();
}
-
-
+
+
/** Remove processors with a given placement.
* @param p Placement of processors to remove.
*/
@@ -1051,7 +1051,7 @@ Route::clear_processors (Placement p)
if (!_session.engine().connected()) {
return;
}
-
+
bool already_deleting = _session.deletion_in_progress();
if (!already_deleting) {
_session.set_deletion_in_progress();
@@ -1070,7 +1070,7 @@ Route::clear_processors (Placement p)
}
if ((*i) == _amp || (*i) == _meter || (*i) == _main_outs) {
-
+
/* you can't remove these */
new_list.push_back (*i);
@@ -1187,7 +1187,7 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream
for (i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<PluginInsert> pi;
-
+
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
if (pi->is_generator()) {
_have_internal_generator = true;
@@ -1223,7 +1223,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
as_we_were = _processors;
for (i = _processors.begin(); i != _processors.end(); ) {
-
+
processor = *i;
/* these can never be removed */
@@ -1232,9 +1232,9 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
++i;
continue;
}
-
+
/* see if its in the list of processors to delete */
-
+
if (find (to_be_deleted.begin(), to_be_deleted.end(), processor) == to_be_deleted.end()) {
++i;
continue;
@@ -1244,9 +1244,9 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
from causing noise as a result of no longer being
run.
*/
-
+
boost::shared_ptr<IOProcessor> iop;
-
+
if ((iop = boost::dynamic_pointer_cast<IOProcessor> (processor)) != 0) {
iop->disconnect ();
}
@@ -1274,7 +1274,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
for (i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<PluginInsert> pi;
-
+
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
if (pi->is_generator()) {
_have_internal_generator = true;
@@ -1323,7 +1323,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
ChanCount out;
list< pair<ChanCount,ChanCount> > configuration;
uint32_t index = 0;
-
+
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++index) {
if ((*p)->can_support_io_configuration(in, out)) {
configuration.push_back(make_pair(in, out));
@@ -1337,7 +1337,7 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
return -1;
}
}
-
+
// We can, so configure everything
list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin();
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {
@@ -1366,7 +1366,7 @@ Route::all_processors_flip ()
}
bool first_is_on = _processors.front()->active();
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (first_is_on) {
(*i)->deactivate ();
@@ -1374,7 +1374,7 @@ Route::all_processors_flip ()
(*i)->activate ();
}
}
-
+
_session.set_dirty ();
}
@@ -1407,7 +1407,7 @@ Route::all_processors_active (Placement p, bool state)
}
}
}
-
+
_session.set_dirty ();
}
@@ -1454,12 +1454,12 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
ProcessorList as_it_will_be;
oiter = _processors.begin();
- niter = new_order.begin();
+ niter = new_order.begin();
while (niter != new_order.end()) {
-
+
/* if the next processor in the old list is invisible (i.e. should not be in the new order)
- then append it to the temp list.
+ then append it to the temp list.
Otherwise, see if the next processor in the old list is in the new list. if not,
its been deleted. If its there, append it to the temp list.
@@ -1467,7 +1467,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
if (oiter == _processors.end()) {
- /* no more elements in the old list, so just stick the rest of
+ /* no more elements in the old list, so just stick the rest of
the new order onto the temp list.
*/
@@ -1478,7 +1478,7 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
break;
} else {
-
+
if (!(*oiter)->visible()) {
as_it_will_be.push_back (*oiter);
@@ -1495,11 +1495,11 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
++niter;
}
}
-
+
/* now remove from old order - its taken care of no matter what */
oiter = _processors.erase (oiter);
}
-
+
}
_processors.insert (oiter, as_it_will_be.begin(), as_it_will_be.end());
@@ -1508,8 +1508,8 @@ Route::reorder_processors (const ProcessorList& new_order, ProcessorStreams* err
_processors = as_it_was_before;
processor_max_streams = old_pms;
return -1;
- }
- }
+ }
+ }
processors_changed (); /* EMIT SIGNAL */
@@ -1554,14 +1554,14 @@ Route::state(bool full_state)
}
string order_string;
- OrderKeys::iterator x = order_keys.begin();
+ OrderKeys::iterator x = order_keys.begin();
while (x != order_keys.end()) {
order_string += string ((*x).first);
order_string += '=';
snprintf (buf, sizeof(buf), "%ld", (*x).second);
order_string += buf;
-
+
++x;
if (x == order_keys.end()) {
@@ -1594,7 +1594,7 @@ Route::state(bool full_state)
if (_extra_xml){
node->add_child_copy (*_extra_xml);
}
-
+
return *node;
}
@@ -1621,7 +1621,7 @@ Route::_set_state (const XMLNode& node, bool /*call_base*/)
if ((prop = node.property (X_("name"))) != 0) {
Route::set_name (prop->value());
- }
+ }
if ((prop = node.property ("id")) != 0) {
_id = prop->value ();
@@ -1639,28 +1639,28 @@ Route::_set_state (const XMLNode& node, bool /*call_base*/)
XMLNode processor_state (X_("processor_state"));
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
-
+
child = *niter;
if (child->name() == IO::state_node_name) {
if ((prop = child->property (X_("direction"))) == 0) {
continue;
}
-
+
if (prop->value() == "Input") {
_input->set_state (*child);
} else if (prop->value() == "Output") {
_output->set_state (*child);
}
}
-
+
if (child->name() == X_("Processor")) {
processor_state.add_child_copy (*child);
}
}
set_processor_state (processor_state);
-
+
if ((prop = node.property ("solo_level")) != 0) {
_solo_level = 0; // needed for mod_solo_level() to work
mod_solo_level (atoi (prop->value()));
@@ -1677,7 +1677,7 @@ Route::_set_state (const XMLNode& node, bool /*call_base*/)
if ((prop = node.property (X_("denormal-protection"))) != 0) {
set_denormal_protection (string_is_affirmative (prop->value()));
}
-
+
if ((prop = node.property (X_("active"))) != 0) {
bool yn = string_is_affirmative (prop->value());
_active = !yn; // force switch
@@ -1695,7 +1695,7 @@ Route::_set_state (const XMLNode& node, bool /*call_base*/)
if ((prop = node.property (X_("meter-point"))) != 0) {
_meter_point = MeterPoint (string_2_enum (prop->value (), _meter_point));
}
-
+
if ((prop = node.property (X_("route-group"))) != 0) {
RouteGroup* route_group = _session.route_group_by_name(prop->value());
if (route_group == 0) {
@@ -1751,11 +1751,11 @@ Route::_set_state (const XMLNode& node, bool /*call_base*/)
_extra_xml = new XMLNode (*child);
} else if (child->name() == X_("Controllable") && (prop = child->property("name")) != 0) {
-
+
if (prop->value() == "solo") {
_solo_control->set_state (*child);
_session.add_controllable (_solo_control);
- }
+ }
} else if (child->name() == X_("RemoteControl")) {
if ((prop = child->property (X_("id"))) != 0) {
@@ -1815,7 +1815,7 @@ Route::set_processor_state (const XMLNode& node)
break;
}
}
-
+
if (!processorInStateList) {
remove_processor (*i);
}
@@ -1829,7 +1829,7 @@ Route::set_processor_state (const XMLNode& node)
i = _processors.begin();
for (niter = nlist.begin(); niter != nlist.end(); ++niter, ++i) {
-
+
XMLProperty* prop = (*niter)->property ("type");
o = i;
@@ -1837,14 +1837,14 @@ Route::set_processor_state (const XMLNode& node)
// Check whether the next processor in the list is the right one,
// except for "amp" which is always there and may not have the
// old ID since it is always created anew in every Route
-
+
if (prop->value() != "amp") {
while (o != _processors.end()) {
XMLProperty* id_prop = (*niter)->property(X_("id"));
if (id_prop && (*o)->id() == id_prop->value()) {
break;
}
-
+
++o;
}
}
@@ -1898,10 +1898,10 @@ Route::silence (nframes_t nframes)
if (!_silent) {
_output->silence (nframes);
-
- {
+
+ {
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
-
+
if (lm.locked()) {
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<PluginInsert> pi;
@@ -1910,7 +1910,7 @@ Route::silence (nframes_t nframes)
// skip plugins, they don't need anything when we're not active
continue;
}
-
+
(*i)->silence (nframes);
}
@@ -1919,9 +1919,9 @@ Route::silence (nframes_t nframes)
}
}
}
-
+
}
-}
+}
void
Route::add_internal_return ()
@@ -1936,16 +1936,16 @@ BufferSet*
Route::get_return_buffer () const
{
Glib::RWLock::ReaderLock rm (_processor_lock);
-
+
for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*x);
-
+
if (d) {
BufferSet* bs = d->get_buffers ();
return bs;
}
}
-
+
return 0;
}
@@ -1953,10 +1953,10 @@ void
Route::release_return_buffer () const
{
Glib::RWLock::ReaderLock rm (_processor_lock);
-
+
for (ProcessorList::const_iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalReturn> d = boost::dynamic_pointer_cast<InternalReturn>(*x);
-
+
if (d) {
return d->release_buffers ();
}
@@ -1971,13 +1971,13 @@ Route::listen_via (boost::shared_ptr<Route> route, Placement placement, bool /*a
{
Glib::RWLock::ReaderLock rm (_processor_lock);
-
+
for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ++x) {
boost::shared_ptr<InternalSend> d = boost::dynamic_pointer_cast<InternalSend>(*x);
if (d && d->target_route() == route) {
-
+
/* if the target is the control outs, then make sure
we take note of which i-send is doing that.
*/
@@ -1987,12 +1987,12 @@ Route::listen_via (boost::shared_ptr<Route> route, Placement placement, bool /*a
}
/* already listening via the specified IO: do nothing */
-
+
return 0;
}
}
}
-
+
boost::shared_ptr<InternalSend> listener;
try {
@@ -2007,9 +2007,9 @@ Route::listen_via (boost::shared_ptr<Route> route, Placement placement, bool /*a
}
add_processor (listener, placement);
-
- return 0;
-}
+
+ return 0;
+}
void
Route::drop_listen (boost::shared_ptr<Route> route)
@@ -2019,12 +2019,12 @@ Route::drop_listen (boost::shared_ptr<Route> route)
Glib::RWLock::ReaderLock rl(_processor_lock);
rl.acquire ();
-
+
again:
for (ProcessorList::iterator x = _processors.begin(); x != _processors.end(); ) {
-
+
boost::shared_ptr<InternalSend> d = boost::dynamic_pointer_cast<InternalSend>(*x);
-
+
if (d && d->target_route() == route) {
rl.release ();
remove_processor (*x, &err);
@@ -2034,8 +2034,8 @@ Route::drop_listen (boost::shared_ptr<Route> route)
so start over.
*/
- goto again;
- }
+ goto again;
+ }
}
rl.release ();
@@ -2091,9 +2091,9 @@ Route::feeds (boost::shared_ptr<Route> other)
}
for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); r++) {
-
+
boost::shared_ptr<IOProcessor> iop;
-
+
if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*r)) != 0) {
if (iop->feeds (other)) {
// cerr << "\tIOP " << iop->name() << " feeds " << other->name() << endl;
@@ -2121,12 +2121,12 @@ Route::handle_transport_stopped (bool /*abort_ignored*/, bool did_locate, bool c
}
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
-
+
if (Config->get_plugins_stop_with_transport() && can_flush_processors) {
(*i)->deactivate ();
(*i)->activate ();
}
-
+
(*i)->transport_stopped (now);
}
}
@@ -2146,9 +2146,9 @@ void
Route::output_change_handler (IOChange change, void * /*src*/)
{
if ((change & ConfigurationChanged)) {
-
+
/* XXX resize all listeners to match _main_outs? */
-
+
// configure_processors (0);
}
}
@@ -2159,12 +2159,12 @@ Route::pans_required () const
if (n_outputs().n_audio() < 2) {
return 0;
}
-
+
return max (n_inputs ().n_audio(), processor_max_streams.n_audio());
}
-int
-Route::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+int
+Route::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
bool session_state_changing, bool /*can_record*/, bool /*rec_monitors_input*/)
{
if (n_outputs().n_total() == 0) {
@@ -2196,7 +2196,7 @@ Route::check_initial_delay (nframes_t nframes, nframes_t& transport_frame)
nframes -= _roll_delay;
silence (_roll_delay);
- /* we've written _roll_delay of samples into the
+ /* we've written _roll_delay of samples into the
output ports, so make a note of that for
future reference.
*/
@@ -2231,7 +2231,7 @@ Route::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int
silence (nframes);
return 0;
}
-
+
nframes_t unused = 0;
if ((nframes = check_initial_delay (nframes, unused)) == 0) {
@@ -2246,7 +2246,7 @@ Route::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int
}
int
-Route::silent_roll (nframes_t nframes, sframes_t /*start_frame*/, sframes_t /*end_frame*/,
+Route::silent_roll (nframes_t nframes, sframes_t /*start_frame*/, sframes_t /*end_frame*/,
bool /*can_record*/, bool /*rec_monitors_input*/)
{
silence (nframes);
@@ -2267,18 +2267,18 @@ Route::has_external_redirects () const
// FIXME: what about sends? - they don't return a signal back to ardour?
boost::shared_ptr<const PortInsert> pi;
-
+
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((pi = boost::dynamic_pointer_cast<const PortInsert>(*i)) != 0) {
for (PortSet::const_iterator port = pi->output()->ports().begin(); port != pi->output()->ports().end(); ++port) {
-
+
string port_name = port->name();
string client_name = port_name.substr (0, port_name.find(':'));
/* only say "yes" if the redirect is actually in use */
-
+
if (client_name != "ardour" && pi->active()) {
return true;
}
@@ -2325,7 +2325,7 @@ Route::set_meter_point (MeterPoint p, void *src)
break;
}
_processors.insert(loc, _meter);
-
+
meter_change (src); /* EMIT SIGNAL */
processors_changed (); /* EMIT SIGNAL */
_session.set_dirty ();
@@ -2380,7 +2380,7 @@ Route::update_total_latency ()
#endif
_output->set_port_latency (own_latency);
-
+
if (_output->user_latency() == 0) {
/* this (virtual) function is used for pure Routes,
@@ -2389,7 +2389,7 @@ Route::update_total_latency ()
port, not prerecorded material, and therefore we
have to take into account any input latency.
*/
-
+
own_latency += _input->signal_latency ();
}
@@ -2397,7 +2397,7 @@ Route::update_total_latency ()
_output->set_latency_delay (own_latency);
signal_latency_changed (); /* EMIT SIGNAL */
}
-
+
#ifdef DEBUG_LATENCY
cerr << _name << ": input latency = " << _input->signal_latency() << " total = "
<< own_latency << endl;
@@ -2442,7 +2442,7 @@ Route::automation_snapshot (nframes_t now, bool force)
}
Route::SoloControllable::SoloControllable (std::string name, Route& r)
- : AutomationControl (r.session(), Evoral::Parameter (SoloAutomation),
+ : AutomationControl (r.session(), Evoral::Parameter (SoloAutomation),
boost::shared_ptr<AutomationList>(), name)
, route (r)
{
@@ -2454,7 +2454,7 @@ void
Route::SoloControllable::set_value (float val)
{
bool bval = ((val >= 0.5f) ? true: false);
-
+
route.set_solo (bval, this);
}
@@ -2464,7 +2464,7 @@ Route::SoloControllable::get_value (void) const
return route.soloed() ? 1.0f : 0.0f;
}
-void
+void
Route::set_block_size (nframes_t nframes)
{
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
@@ -2526,10 +2526,10 @@ Route::shift (nframes64_t /*pos*/, nframes64_t /*frames*/)
{
Glib::RWLock::ReaderLock lm (redirect_lock);
for (RedirectList::iterator i = _redirects.begin (); i != _redirects.end (); ++i) {
-
+
set<uint32_t> a;
(*i)->what_has_automation (a);
-
+
for (set<uint32_t>::const_iterator j = a.begin (); j != a.end (); ++j) {
AutomationList & al = (*i)->automation_list (*j);
XMLNode &before = al.get_state ();
@@ -2549,9 +2549,9 @@ Route::save_as_template (const string& path, const string& name)
{
XMLNode& node (state (false));
XMLTree tree;
-
+
IO::set_name_in_state (*node.children().front(), name);
-
+
tree.set_root (&node);
return tree.write (path.c_str());
}
@@ -2566,15 +2566,15 @@ Route::set_name (const string& str)
name = Route::ensure_track_or_route_name (str, _session);
SessionObject::set_name (name);
-
+
ret = (_input->set_name(name) && _output->set_name(name));
if (ret) {
-
+
Glib::RWLock::ReaderLock lm (_processor_lock);
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
-
+
/* rename all I/O processors that have inputs or outputs */
boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
@@ -2598,14 +2598,14 @@ Route::internal_send_for (boost::shared_ptr<const Route> target) const
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
boost::shared_ptr<InternalSend> send;
-
+
if ((send = boost::dynamic_pointer_cast<InternalSend>(*i)) != 0) {
if (send->target_route() == target) {
return send;
}
}
}
-
+
return boost::shared_ptr<Send>();
}
@@ -2696,7 +2696,7 @@ Route::get_control (const Evoral::Parameter& param)
if (!c) {
/* maybe one of our processors does or ... */
-
+
Glib::RWLock::ReaderLock rm (_processor_lock, Glib::TRY_LOCK);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((c = boost::dynamic_pointer_cast<AutomationControl>((*i)->data().control (param))) != 0) {
@@ -2704,7 +2704,7 @@ Route::get_control (const Evoral::Parameter& param)
}
}
}
-
+
if (!c) {
/* nobody does so we'll make a new one */
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc
index 26612226a7..5cfc1fb3d0 100644
--- a/libs/ardour/route_group.cc
+++ b/libs/ardour/route_group.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2002 Paul Davis
+ Copyright (C) 2000-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -68,9 +68,9 @@ RouteGroup::remove_when_going_away (Route *r)
{
remove (r);
}
-
+
int
-RouteGroup::remove (Route *r)
+RouteGroup::remove (Route *r)
{
list<Route *>::iterator i;
@@ -88,7 +88,7 @@ gain_t
RouteGroup::get_min_factor(gain_t factor)
{
gain_t g;
-
+
for (list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
g = (*i)->amp()->gain();
@@ -97,9 +97,9 @@ RouteGroup::get_min_factor(gain_t factor)
if ( g <= 0.0000003f )
return 0.0f;
-
+
factor = 0.0000003f/g - 1.0f;
- }
+ }
return factor;
}
@@ -107,14 +107,14 @@ gain_t
RouteGroup::get_max_factor(gain_t factor)
{
gain_t g;
-
+
for (list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
g = (*i)->amp()->gain();
-
+
// if the current factor woulnd't raise this route above maximum
- if ( (g+g*factor) <= 1.99526231f)
+ if ( (g+g*factor) <= 1.99526231f)
continue;
-
+
// if route gain is already at peak, return 0.0f factor
if (g>=1.99526231f)
return 0.0f;
@@ -136,7 +136,7 @@ RouteGroup::get_state (void)
return *node;
}
-int
+int
RouteGroup::set_state (const XMLNode& node)
{
const XMLProperty *prop;
@@ -152,7 +152,7 @@ RouteGroup::set_state (const XMLNode& node)
if ((prop = node.property ("properties")) != 0) {
_properties = Property (string_2_enum (prop->value(), _properties));
}
-
+
return 0;
}
@@ -200,7 +200,7 @@ RouteGroup::set_hidden (bool yn, void *src)
_flags = Flag (_flags & ~Active);
}
} else {
- _flags = Flag (_flags & ~Hidden);
+ _flags = Flag (_flags & ~Hidden);
if (Config->get_hiding_groups_deactivates_groups()) {
_flags = Flag (_flags | Active);
}
@@ -210,8 +210,8 @@ RouteGroup::set_hidden (bool yn, void *src)
}
void
-RouteGroup::audio_track_group (set<AudioTrack*>& ats)
-{
+RouteGroup::audio_track_group (set<AudioTrack*>& ats)
+{
for (list<Route*>::iterator i = routes.begin(); i != routes.end(); ++i) {
AudioTrack* at = dynamic_cast<AudioTrack*>(*i);
if (at) {
@@ -238,7 +238,7 @@ RouteGroup::make_subgroup ()
for (list<Route*>::iterator i = routes.begin(); i != routes.end(); ++i) {
nin = max (nin, (*i)->output()->n_ports().n_audio());
}
-
+
try {
/* use master bus etc. to determine default nouts */
rl = _session.new_audio_route (nin, 2, 0, 1);
@@ -250,7 +250,7 @@ RouteGroup::make_subgroup ()
subgroup_bus->set_name (_name);
boost::shared_ptr<Bundle> bundle = subgroup_bus->input()->bundle ();
-
+
for (list<Route*>::iterator i = routes.begin(); i != routes.end(); ++i) {
(*i)->output()->disconnect (this);
(*i)->output()->connect_ports_to_bundle (bundle, this);
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index a90f31c2cf..f01512332e 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -101,7 +101,7 @@ Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_
// we have to copy the input, because deliver_output() may alter the buffers
// in-place, which a send must never do.
-
+
BufferSet& sendbufs = _session.get_mix_buffers (bufs.count());
sendbufs.read_from (bufs, nframes);
assert(sendbufs.count() == bufs.count());
@@ -118,7 +118,7 @@ Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_
Delivery::run (sendbufs, start_frame, end_frame, nframes);
/* consider metering */
-
+
if (_metering) {
if (_amp->gain_control()->get_value() == 0) {
_meter->reset();
@@ -166,7 +166,7 @@ Send::set_state(const XMLNode& node)
const XMLNode* insert_node = &node;
/* XXX need to load automation state & data for amp */
-
+
Delivery::set_state (*insert_node);
return 0;
@@ -178,7 +178,7 @@ Send::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
/* sends have no impact at all on the channel configuration of the
streams passing through the route. so, out == in.
*/
-
+
out = in;
return true;
}
@@ -189,13 +189,13 @@ Send::configure_io (ChanCount in, ChanCount out)
if (!_amp->configure_io (in, out) || !_meter->configure_io (in, out)) {
return false;
}
-
+
if (!Processor::configure_io (in, out)) {
return false;
}
reset_panner ();
-
+
return true;
}
@@ -213,7 +213,7 @@ Send::make_unique (XMLNode &state, Session &session)
state.property("bitslot")->set_value (buf);
std::string const name = string_compose (_("send %1"), bitslot);
-
+
state.property("name")->set_value (name);
XMLNode* io = state.child ("IO");
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index d3acc19319..96bd69eca3 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -563,14 +563,14 @@ Session::when_engine_running ()
for (int physport = 0; physport < 2; ++physport) {
string physical_output = _engine.get_nth_physical_output (DataType::AUDIO, physport);
-
+
if (physical_output.length()) {
if (_click_io->add_port (physical_output, this)) {
// relax, even though its an error
}
}
}
-
+
if (_click_io->n_ports () > ChanCount::ZERO) {
_clicking = Config->get_clicking ();
}
@@ -596,7 +596,7 @@ Session::when_engine_running ()
mono and stereo bundles, so that the common cases of mono
and stereo tracks get bundles to put in their mixer strip
in / out menus. There may be a nicer way of achieving that;
- it doesn't really scale that well to higher channel counts
+ it doesn't really scale that well to higher channel counts
*/
/* mono output bundles */
@@ -605,11 +605,11 @@ Session::when_engine_running ()
char buf[32];
snprintf (buf, sizeof (buf), _("out %" PRIu32), np+1);
- shared_ptr<Bundle> c (new Bundle (buf, true));
+ shared_ptr<Bundle> c (new Bundle (buf, true));
c->add_channel (_("mono"));
- c->set_port (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
+ c->set_port (0, _engine.get_nth_physical_output (DataType::AUDIO, np));
- add_bundle (c);
+ add_bundle (c);
}
/* stereo output bundles */
@@ -634,11 +634,11 @@ Session::when_engine_running ()
char buf[32];
snprintf (buf, sizeof (buf), _("in %" PRIu32), np+1);
- shared_ptr<Bundle> c (new Bundle (buf, false));
+ shared_ptr<Bundle> c (new Bundle (buf, false));
c->add_channel (_("mono"));
- c->set_port (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
+ c->set_port (0, _engine.get_nth_physical_input (DataType::AUDIO, np));
- add_bundle (c);
+ add_bundle (c);
}
/* stereo input bundles */
@@ -657,7 +657,7 @@ Session::when_engine_running ()
add_bundle (c);
}
}
-
+
BootMessage (_("Setup signal flow and plugins"));
hookup_io ();
@@ -665,19 +665,19 @@ Session::when_engine_running ()
if (!no_auto_connect()) {
if (_master_out && Config->get_auto_connect_standard_busses()) {
-
+
/* if requested auto-connect the outputs to the first N physical ports.
*/
uint32_t limit = _master_out->n_outputs().n_total();
-
+
for (uint32_t n = 0; n < limit; ++n) {
Port* p = _master_out->output()->nth (n);
string connect_to = _engine.get_nth_physical_output (DataType (p->type()), n);
if (!connect_to.empty() && p->connected_to (connect_to) == false) {
if (_master_out->output()->connect (p, connect_to, this)) {
- error << string_compose (_("cannot connect master output %1 to %2"), n, connect_to)
+ error << string_compose (_("cannot connect master output %1 to %2"), n, connect_to)
<< endmsg;
break;
}
@@ -691,21 +691,21 @@ Session::when_engine_running ()
are undefined, at best.
*/
- /* control out listens to master bus (but ignores it
+ /* control out listens to master bus (but ignores it
under some conditions)
*/
uint32_t limit = _control_out->n_inputs().n_audio();
-
+
if (_master_out) {
for (uint32_t n = 0; n < limit; ++n) {
AudioPort* p = _control_out->input()->ports().nth_audio_port (n);
AudioPort* o = _master_out->output()->ports().nth_audio_port (n);
-
+
if (o) {
string connect_to = o->name();
if (_control_out->input()->connect (p, connect_to, this)) {
- error << string_compose (_("cannot connect control input %1 to %2"), n, connect_to)
+ error << string_compose (_("cannot connect control input %1 to %2"), n, connect_to)
<< endmsg;
break;
}
@@ -713,7 +713,7 @@ Session::when_engine_running ()
}
}
- /* if control out is not connected,
+ /* if control out is not connected,
connect control out to physical outs, but use ones after the master if possible
*/
@@ -727,28 +727,28 @@ Session::when_engine_running ()
_control_out->output()->connect_ports_to_bundle (b, this);
} else {
warning << string_compose (_("The preferred I/O for the monitor bus (%1) cannot be found"),
- Config->get_monitor_bus_preferred_bundle())
+ Config->get_monitor_bus_preferred_bundle())
<< endmsg;
}
} else {
/* XXX this logic is wrong for mixed port types */
-
+
uint32_t shift = _master_out->n_outputs().n_audio();
uint32_t mod = _engine.n_physical_outputs (DataType::AUDIO);
limit = _control_out->n_outputs().n_audio();
cerr << "Connecting " << limit << " control out ports, shift is " << shift << " mod is " << mod << endl;
-
+
for (uint32_t n = 0; n < limit; ++n) {
-
+
Port* p = _control_out->output()->nth (n);
string connect_to = _engine.get_nth_physical_output (DataType (p->type()), (n+shift) % mod);
-
+
if (!connect_to.empty()) {
if (_control_out->output()->connect (p, connect_to, this)) {
- error << string_compose (_("cannot connect control output %1 to %2"), n, connect_to)
+ error << string_compose (_("cannot connect control output %1 to %2"), n, connect_to)
<< endmsg;
break;
}
@@ -815,14 +815,14 @@ Session::hookup_io ()
if (_control_out) {
boost::shared_ptr<RouteList> r = routes.reader ();
-
+
for (RouteList::iterator x = r->begin(); x != r->end(); ++x) {
if ((*x)->is_control() || (*x)->is_master()) {
continue;
}
- (*x)->listen_via (_control_out,
+ (*x)->listen_via (_control_out,
(Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
false, false);
}
@@ -878,9 +878,9 @@ bool
Session::record_enabling_legal () const
{
/* this used to be in here, but survey says.... we don't need to restrict it */
- // if (record_status() == Recording) {
- // return false;
- // }
+ // if (record_status() == Recording) {
+ // return false;
+ // }
if (Config->get_all_safe()) {
return false;
@@ -1254,7 +1254,7 @@ Session::audible_frame () const
} else {
tf = _transport_frame;
}
-
+
ret = tf;
if (!non_realtime_work_pending()) {
@@ -1273,8 +1273,8 @@ Session::audible_frame () const
if (tf < _last_roll_location + offset) {
return _last_roll_location;
}
- }
-
+ }
+
/* forwards */
ret -= offset;
@@ -1759,7 +1759,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
<< endmsg;
goto failed;
}
-
+
if (track->output()->ensure_io (ChanCount(DataType::AUDIO, output_channels), false, this)) {
error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
input_channels, output_channels)
@@ -1789,7 +1789,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
for (uint32_t x = 0; x < track->n_outputs().n_audio(); ++x) {
port = "";
-
+
if (Config->get_output_auto_connect() & AutoConnectPhysical) {
port = physoutputs[(channels_used+x)%nphysical_out];
} else if (Config->get_output_auto_connect() & AutoConnectMaster) {
@@ -1797,7 +1797,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
port = _master_out->input()->nth (x % _master_out->input()->n_ports().n_audio())->name();
}
}
-
+
if (port.length() && track->output()->connect (track->output()->nth(x), port, this)) {
break;
}
@@ -1957,11 +1957,11 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
for (uint32_t x = 0; n_physical_audio_inputs && x < bus->input()->n_ports().n_audio(); ++x) {
port = "";
-
+
if (Config->get_input_auto_connect() & AutoConnectPhysical) {
port = physinputs[((n+x)%n_physical_audio_inputs)];
- }
-
+ }
+
if (port.length() && bus->input()->connect (bus->input()->nth (x), port, this)) {
break;
}
@@ -2036,34 +2036,34 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
while (how_many) {
XMLNode node_copy (*node); // make a copy so we can change the name if we need to
-
+
std::string node_name = IO::name_from_state (*node_copy.children().front());
/* generate a new name by adding a number to the end of the template name */
-
+
do {
snprintf (name, sizeof (name), "%s %" PRIu32, node_name.c_str(), number);
-
+
number++;
-
+
if (route_by_name (name) == 0) {
break;
}
-
+
} while (number < UINT_MAX);
-
+
if (number == UINT_MAX) {
fatal << _("Session: UINT_MAX routes? impossible!") << endmsg;
/*NOTREACHED*/
}
-
+
IO::set_name_in_state (*node_copy.children().front(), name);
Track::zero_diskstream_id_in_xml (node_copy);
try {
shared_ptr<Route> route (XMLRouteFactory (node_copy));
-
+
if (route == 0) {
error << _("Session: cannot create track/bus from template description") << endmsg;
goto out;
@@ -2077,23 +2077,23 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
route->input()->changed (IOChange (ConfigurationChanged|ConnectionsChanged), this);
route->output()->changed (IOChange (ConfigurationChanged|ConnectionsChanged), this);
}
-
+
route->set_remote_control_id (control_id);
++control_id;
-
+
ret.push_back (route);
}
-
+
catch (failed_constructor &err) {
error << _("Session: could not create new route from template") << endmsg;
goto out;
}
-
+
catch (AudioEngine::PortRegistrationFailure& pfe) {
error << pfe.what() << endmsg;
goto out;
}
-
+
--how_many;
}
@@ -2116,7 +2116,7 @@ Session::add_routes (RouteList& new_routes, bool save)
/* if there is no control out and we're not in the middle of loading,
resort the graph here. if there is a control out, we will resort
- toward the end of this method. if we are in the middle of loading,
+ toward the end of this method. if we are in the middle of loading,
we will resort when done.
*/
@@ -2151,7 +2151,7 @@ Session::add_routes (RouteList& new_routes, bool save)
if ((*x)->is_control() || (*x)->is_master()) {
continue;
}
- (*x)->listen_via (_control_out,
+ (*x)->listen_via (_control_out,
(Config->get_listen_position() == AfterFaderListen ? PostFader : PreFader),
false, false);
}
@@ -2412,7 +2412,7 @@ Session::route_solo_changed (void* /*src*/, boost::weak_ptr<Route> wpr)
/* now mod the solo level of all other routes except master & control outs
so that they will be silent if appropriate.
*/
-
+
solo_update_disabled = true;
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
@@ -2775,17 +2775,17 @@ void
Session::update_region_name_map (boost::shared_ptr<Region> region)
{
string::size_type last_period = region->name().find_last_of ('.');
-
+
if (last_period != string::npos && last_period < region->name().length() - 1) {
-
+
string base = region->name().substr (0, last_period);
string number = region->name().substr (last_period+1);
map<string,uint32_t>::iterator x;
-
+
/* note that if there is no number, we get zero from atoi,
which is just fine
*/
-
+
region_name_map[base] = atoi (number);
}
}
@@ -3800,7 +3800,7 @@ shared_ptr<Bundle>
Session::bundle_by_name (string name) const
{
boost::shared_ptr<BundleList> b = _bundles.reader ();
-
+
for (BundleList::const_iterator i = b->begin(); i != b->end(); ++i) {
if ((*i)->name() == name) {
return* i;
@@ -4095,8 +4095,8 @@ Session::freeze (InterThreadInfo& itt)
}
boost::shared_ptr<Region>
-Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
- bool /*overwrite*/, vector<boost::shared_ptr<Source> >& srcs,
+Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
+ bool /*overwrite*/, vector<boost::shared_ptr<Source> >& srcs,
InterThreadInfo& itt, bool enable_processing)
{
boost::shared_ptr<Region> result;
@@ -4225,7 +4225,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
/* construct a region to represent the bounced material */
result = RegionFactory::create (srcs, 0,
- srcs.front()->length(srcs.front()->timeline_position()),
+ srcs.front()->length(srcs.front()->timeline_position()),
region_name_from_path (srcs.front()->name(), true));
}
@@ -4237,7 +4237,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
if (afs) {
afs->mark_for_remove ();
}
-
+
(*src)->drop_references ();
}
diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc
index 59fe9e29a8..4f8f244c22 100644
--- a/libs/ardour/session_butler.cc
+++ b/libs/ardour/session_butler.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2002 Paul Davis
+ Copyright (C) 1999-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -64,7 +64,7 @@ static inline uint32_t next_power_of_two (uint32_t n)
}
/*---------------------------------------------------------------------------
- BUTLER THREAD
+ BUTLER THREAD
---------------------------------------------------------------------------*/
int
@@ -72,14 +72,14 @@ Session::start_butler_thread ()
{
/* size is in Samples, not bytes */
audio_dstream_buffer_size = (uint32_t) floor (Config->get_audio_track_buffer_seconds() * (float) frame_rate());
-
+
/* size is in bytes
* XXX: Jack needs to tell us the MIDI buffer size
* (i.e. how many MIDI bytes we might see in a cycle)
*/
midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * (float)frame_rate());
MidiDiskstream::set_readahead_frames ((nframes_t) (Config->get_midi_readahead() * (float) frame_rate()));
-
+
Crossfade::set_buffer_size (audio_dstream_buffer_size);
butler_should_run = false;
@@ -183,13 +183,13 @@ Session::butler_thread_work ()
while (true) {
pfd[0].fd = butler_request_pipe[0];
pfd[0].events = POLLIN|POLLERR|POLLHUP;
-
+
if (poll (pfd, 1, (disk_work_outstanding ? 0 : -1)) < 0) {
-
+
if (errno == EINTR) {
continue;
}
-
+
error << string_compose (_("poll on butler request pipe failed (%1)"),
strerror (errno))
<< endmsg;
@@ -200,39 +200,39 @@ Session::butler_thread_work ()
error << string_compose (_("Error on butler thread request pipe: fd=%1 err=%2"), pfd[0].fd, pfd[0].revents) << endmsg;
break;
}
-
+
if (pfd[0].revents & POLLIN) {
char req;
-
+
/* empty the pipe of all current requests */
-
+
while (1) {
size_t nread = ::read (butler_request_pipe[0], &req, sizeof (req));
if (nread == 1) {
-
+
switch ((ButlerRequest::Type) req) {
-
+
case ButlerRequest::Wake:
break;
case ButlerRequest::Run:
butler_should_run = true;
break;
-
+
case ButlerRequest::Pause:
butler_should_run = false;
break;
-
+
case ButlerRequest::Quit:
pthread_exit_pbd (0);
/*NOTREACHED*/
break;
-
+
default:
break;
}
-
+
} else if (nread == 0) {
break;
} else if (errno == EAGAIN) {
@@ -267,7 +267,7 @@ Session::butler_thread_work ()
/* don't read inactive tracks */
boost::shared_ptr<IO> io = ds->io();
-
+
if (io && !io->active()) {
continue;
}
@@ -280,7 +280,7 @@ Session::butler_thread_work ()
bytes += ds->read_data_count();
disk_work_outstanding = true;
break;
-
+
default:
compute_io = false;
error << string_compose(_("Butler read ahead failure on dstream %1"), (*i)->name()) << endmsg;
@@ -293,13 +293,13 @@ Session::butler_thread_work ()
/* we didn't get to all the streams */
disk_work_outstanding = true;
}
-
+
if (!err && transport_work_requested()) {
continue;
}
if (compute_io) {
- end = get_microseconds();
+ end = get_microseconds();
if(end-begin > 0) {
_read_data_rate = (float) bytes / (float) (end - begin);
} else { _read_data_rate = 0; // infinity better
@@ -315,7 +315,7 @@ Session::butler_thread_work ()
/* note that we still try to flush diskstreams attached to inactive routes
*/
-
+
switch ((*i)->do_flush (ButlerContext)) {
case 0:
bytes += (*i)->write_data_count();
@@ -324,12 +324,12 @@ Session::butler_thread_work ()
bytes += (*i)->write_data_count();
disk_work_outstanding = true;
break;
-
+
default:
err++;
compute_io = false;
error << string_compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << endmsg;
- /* don't break - try to flush all streams in case they
+ /* don't break - try to flush all streams in case they
are split across disks.
*/
}
@@ -346,7 +346,7 @@ Session::butler_thread_work ()
/* we didn't get to all the streams */
disk_work_outstanding = true;
}
-
+
if (!err && transport_work_requested()) {
continue;
}
@@ -360,7 +360,7 @@ Session::butler_thread_work ()
_write_data_rate = 0; // Well, infinity would be better
}
}
-
+
if (!disk_work_outstanding) {
refresh_disk_space ();
}
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index caff7dd1a7..2e7e077ce7 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 20002 Paul Davis
+ Copyright (C) 20002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,11 +48,11 @@ Session::click (nframes_t start, nframes_t nframes)
}
Glib::RWLock::WriterLock clickm (click_lock, Glib::TRY_LOCK);
-
+
if (!clickm.locked() || _transport_speed != 1.0 || !_clicking || click_data == 0) {
_click_io->silence (nframes);
return;
- }
+ }
const nframes_t end = start + nframes;
@@ -80,11 +80,11 @@ Session::click (nframes_t start, nframes_t nframes)
case TempoMap::Bar:
if (click_emphasis_data) {
clicks.push_back (new Click ((*i).frame, click_emphasis_length, click_emphasis_data));
- }
+ }
break;
}
}
-
+
run_clicks:
memset (buf, 0, sizeof (Sample) * nframes);
@@ -98,7 +98,7 @@ Session::click (nframes_t start, nframes_t nframes)
clk = *i;
next = i;
++next;
-
+
if (clk->start < start) {
internal_offset = 0;
} else {
@@ -106,7 +106,7 @@ Session::click (nframes_t start, nframes_t nframes)
}
if (nframes < internal_offset) {
- /* we've just located or something..
+ /* we've just located or something..
effectively going backwards.
lets get the flock out of here */
break;
@@ -126,7 +126,7 @@ Session::click (nframes_t start, nframes_t nframes)
i = next;
}
-
+
_click_io->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0);
}
@@ -139,7 +139,7 @@ Session::setup_click_sounds (int which)
clear_clicks();
if ((which == 0 || which == 1)) {
-
+
if (click_data != default_click) {
delete [] click_data;
click_data = 0;
@@ -162,22 +162,22 @@ Session::setup_click_sounds (int which)
_clicking = false;
return;
}
-
+
click_data = new Sample[info.frames];
click_length = info.frames;
-
+
if (sf_read_float (sndfile, click_data, info.frames) != info.frames) {
- warning << _("cannot read data from click soundfile") << endmsg;
+ warning << _("cannot read data from click soundfile") << endmsg;
delete click_data;
click_data = 0;
_clicking = false;
}
-
+
sf_close (sndfile);
}
}
-
+
if ((which == 0 || which == -1)) {
if (click_emphasis_data != default_click_emphasis) {
@@ -198,20 +198,20 @@ Session::setup_click_sounds (int which)
warning << string_compose (_("cannot open click emphasis soundfile %1 (%2)"), path, errbuf) << endmsg;
return;
}
-
+
click_emphasis_data = new Sample[info.frames];
click_emphasis_length = info.frames;
-
+
if (sf_read_float (sndfile, click_emphasis_data, info.frames) != info.frames) {
- warning << _("cannot read data from click emphasis soundfile") << endmsg;
+ warning << _("cannot read data from click emphasis soundfile") << endmsg;
delete click_emphasis_data;
click_emphasis_data = 0;
}
-
+
sf_close (sndfile);
}
}
-}
+}
void
Session::clear_clicks ()
diff --git a/libs/ardour/session_command.cc b/libs/ardour/session_command.cc
index 4af18fcd12..af1286e8f2 100644
--- a/libs/ardour/session_command.cc
+++ b/libs/ardour/session_command.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,7 @@ void Session::register_with_memento_command_factory(PBD::ID id, PBD::StatefulThi
{
registry[id] = ptr;
}
-
+
Command *
Session::memento_command_factory(XMLNode *n)
{
@@ -73,8 +73,8 @@ Session::memento_command_factory(XMLNode *n)
before = new XMLNode(*n->children().front());
after = new XMLNode(*n->children().back());
child = before;
- }
-
+ }
+
if (!child) {
error << _("Tried to reconstitute a MementoCommand with no contents, failing. id=") << id.to_s() << endmsg;
return 0;
@@ -102,7 +102,7 @@ Session::memento_command_factory(XMLNode *n)
if (boost::shared_ptr<Playlist> pl = playlist_by_name(child->property("name")->value())) {
return new MementoCommand<Playlist>(*(pl.get()), before, after);
}
- } else if (obj_T == typeid (Route).name() || obj_T == typeid (AudioTrack).name() || obj_T == typeid(MidiTrack).name()) {
+ } else if (obj_T == typeid (Route).name() || obj_T == typeid (AudioTrack).name() || obj_T == typeid(MidiTrack).name()) {
if (boost::shared_ptr<Route> r = route_by_id(id)) {
return new MementoCommand<Route>(*r, before, after);
} else {
@@ -133,7 +133,7 @@ Session::global_state_command_factory (const XMLNode& node)
error << _("GlobalRouteStateCommand has no \"type\" node, ignoring") << endmsg;
return 0;
}
-
+
try {
if (prop->value() == "solo") {
@@ -181,7 +181,7 @@ Session::GlobalRouteStateCommand::set_state (const XMLNode& node)
before.clear ();
after.clear ();
-
+
for (loop = 0; loop < 2; ++loop) {
const char *str;
@@ -191,7 +191,7 @@ Session::GlobalRouteStateCommand::set_state (const XMLNode& node)
} else {
str = "before";
}
-
+
if ((child = node.child (str)) == 0) {
warning << string_compose (_("global route state command has no \"%1\" node, ignoring entire command"), str) << endmsg;
return -1;
@@ -200,24 +200,24 @@ Session::GlobalRouteStateCommand::set_state (const XMLNode& node)
nlist = child->children();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
RouteBooleanState rbs;
boost::shared_ptr<Route> route;
ID id;
-
+
prop = (*niter)->property ("id");
id = prop->value ();
-
+
if ((route = sess.route_by_id (id)) == 0) {
warning << string_compose (_("cannot find track/bus \"%1\" while rebuilding a global route state command, ignored"), id.to_s()) << endmsg;
continue;
}
-
+
rbs.first = boost::weak_ptr<Route> (route);
-
+
prop = (*niter)->property ("yn");
rbs.second = (prop->value() == "1");
-
+
if (loop) {
after.push_back (rbs);
} else {
@@ -277,19 +277,19 @@ Session::GlobalSoloStateCommand::GlobalSoloStateCommand (Session& sess, const XM
{
}
-void
+void
Session::GlobalSoloStateCommand::mark()
{
after = sess.get_global_route_boolean(&Route::soloed);
}
-void
+void
Session::GlobalSoloStateCommand::operator()()
{
sess.set_global_solo(after, src);
}
-void
+void
Session::GlobalSoloStateCommand::undo()
{
sess.set_global_solo(before, src);
@@ -315,19 +315,19 @@ Session::GlobalMuteStateCommand::GlobalMuteStateCommand (Session& sess, const XM
{
}
-void
+void
Session::GlobalMuteStateCommand::mark()
{
after = sess.get_global_route_boolean(&Route::muted);
}
-void
+void
Session::GlobalMuteStateCommand::operator()()
{
sess.set_global_mute(after, src);
}
-void
+void
Session::GlobalMuteStateCommand::undo()
{
sess.set_global_mute(before, src);
@@ -342,7 +342,7 @@ Session::GlobalMuteStateCommand::get_state()
}
// record enable
-Session::GlobalRecordEnableStateCommand::GlobalRecordEnableStateCommand(Session &sess, void *src)
+Session::GlobalRecordEnableStateCommand::GlobalRecordEnableStateCommand(Session &sess, void *src)
: GlobalRouteStateCommand (sess, src)
{
after = before = sess.get_global_route_boolean(&Route::record_enabled);
@@ -353,25 +353,25 @@ Session::GlobalRecordEnableStateCommand::GlobalRecordEnableStateCommand (Session
{
}
-void
+void
Session::GlobalRecordEnableStateCommand::mark()
{
after = sess.get_global_route_boolean(&Route::record_enabled);
}
-void
+void
Session::GlobalRecordEnableStateCommand::operator()()
{
sess.set_global_record_enable(after, src);
}
-void
+void
Session::GlobalRecordEnableStateCommand::undo()
{
sess.set_global_record_enable(before, src);
}
-XMLNode&
+XMLNode&
Session::GlobalRecordEnableStateCommand::get_state()
{
XMLNode& node = GlobalRouteStateCommand::get_state();
@@ -380,7 +380,7 @@ Session::GlobalRecordEnableStateCommand::get_state()
}
// metering
-Session::GlobalMeteringStateCommand::GlobalMeteringStateCommand(Session &s, void *p)
+Session::GlobalMeteringStateCommand::GlobalMeteringStateCommand(Session &s, void *p)
: sess (s), src (p)
{
after = before = sess.get_global_route_metering();
@@ -394,19 +394,19 @@ Session::GlobalMeteringStateCommand::GlobalMeteringStateCommand (Session& s, con
}
}
-void
+void
Session::GlobalMeteringStateCommand::mark()
{
after = sess.get_global_route_metering();
}
-void
+void
Session::GlobalMeteringStateCommand::operator()()
{
sess.set_global_route_metering(after, src);
}
-void
+void
Session::GlobalMeteringStateCommand::undo()
{
sess.set_global_route_metering(before, src);
@@ -427,7 +427,7 @@ Session::GlobalMeteringStateCommand::get_state()
child->add_property (X_("id"), r->id().to_s());
const char* meterstr = 0;
-
+
switch (x->second) {
case MeterInput:
meterstr = X_("input");
@@ -455,7 +455,7 @@ Session::GlobalMeteringStateCommand::get_state()
child->add_property (X_("id"), r->id().to_s());
const char* meterstr;
-
+
switch (x->second) {
case MeterInput:
meterstr = X_("input");
@@ -494,7 +494,7 @@ Session::GlobalMeteringStateCommand::set_state (const XMLNode& node)
before.clear ();
after.clear ();
-
+
for (loop = 0; loop < 2; ++loop) {
const char *str;
@@ -504,7 +504,7 @@ Session::GlobalMeteringStateCommand::set_state (const XMLNode& node)
} else {
str = "before";
}
-
+
if ((child = node.child (str)) == 0) {
warning << string_compose (_("global route meter state command has no \"%1\" node, ignoring entire command"), str) << endmsg;
return -1;
@@ -513,21 +513,21 @@ Session::GlobalMeteringStateCommand::set_state (const XMLNode& node)
nlist = child->children();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
RouteMeterState rms;
boost::shared_ptr<Route> route;
ID id;
-
+
prop = (*niter)->property ("id");
id = prop->value ();
-
+
if ((route = sess.route_by_id (id)) == 0) {
warning << string_compose (_("cannot find track/bus \"%1\" while rebuilding a global route state command, ignored"), id.to_s()) << endmsg;
continue;
}
-
+
rms.first = boost::weak_ptr<Route> (route);
-
+
prop = (*niter)->property ("meter");
if (prop->value() == X_("pre")) {
@@ -537,7 +537,7 @@ Session::GlobalMeteringStateCommand::set_state (const XMLNode& node)
} else {
rms.second = MeterInput;
}
-
+
if (loop) {
after.push_back (rms);
} else {
diff --git a/libs/ardour/session_configuration.cc b/libs/ardour/session_configuration.cc
index 498e91ea20..2cae7021e1 100644
--- a/libs/ardour/session_configuration.cc
+++ b/libs/ardour/session_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ SessionConfiguration::SessionConfiguration ()
:
/* construct variables */
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) var (name,value),
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) var (name,value,mutator),
#include "ardour/session_configuration_vars.h"
@@ -37,7 +37,7 @@ SessionConfiguration::SessionConfiguration ()
#undef CONFIG_VARIABLE_SPECIAL
foo (0)
{
-
+
}
XMLNode&
@@ -62,14 +62,14 @@ SessionConfiguration::get_variables ()
node = new XMLNode ("Config");
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,Name,value) \
var.add_to_node (*node);
#define CONFIG_VARIABLE_SPECIAL(type,var,Name,value,mutator) \
var.add_to_node (*node);
#include "ardour/session_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
return *node;
}
@@ -95,7 +95,7 @@ void
SessionConfiguration::set_variables (const XMLNode& node)
{
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,name,value) \
if (var.set_from_node (node)) { \
ParameterChanged (name); \
@@ -108,16 +108,16 @@ SessionConfiguration::set_variables (const XMLNode& node)
#include "ardour/session_configuration_vars.h"
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
-
+
}
void
SessionConfiguration::map_parameters (sigc::slot<void, std::string> theSlot)
{
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(type,var,name,value) theSlot (name);
#define CONFIG_VARIABLE_SPECIAL(type,var,name,value,mutator) theSlot (name);
#include "ardour/session_configuration_vars.h"
#undef CONFIG_VARIABLE
-#undef CONFIG_VARIABLE_SPECIAL
+#undef CONFIG_VARIABLE_SPECIAL
}
diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc
index d56998b550..09c2154c30 100644
--- a/libs/ardour/session_directory.cc
+++ b/libs/ardour/session_directory.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -140,7 +140,7 @@ SessionDirectory::export_path () const
const vector<path>
SessionDirectory::sub_directories () const
{
- vector<path> tmp_paths;
+ vector<path> tmp_paths;
tmp_paths.push_back ( sound_path () );
tmp_paths.push_back ( midi_path () );
diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc
index d631eda710..cf6e9f9c51 100644
--- a/libs/ardour/session_events.cc
+++ b/libs/ardour/session_events.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2004 Paul Davis
+ Copyright (C) 1999-2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -100,8 +100,8 @@ Session::dump_events () const
if ((Events::const_iterator) next_event == events.end()) {
cerr << "none" << endl;
} else {
- cerr << "at " << (*next_event)->action_frame << ' '
- << (*next_event)->type << " target = "
+ cerr << "at " << (*next_event)->action_frame << ' '
+ << (*next_event)->type << " target = "
<< (*next_event)->target_frame << endl;
}
cerr << "Immediate events pending:\n";
@@ -138,7 +138,7 @@ Session::merge_event (Event* ev)
_clear_event_type (ev->type);
delete ev;
return;
-
+
case Event::Add:
break;
}
@@ -149,7 +149,7 @@ Session::merge_event (Event* ev)
process_event (ev);
return;
}
-
+
switch (ev->type) {
case Event::AutoLoop:
case Event::StopOnce:
@@ -159,7 +159,7 @@ Session::merge_event (Event* ev)
default:
for (Events::iterator i = events.begin(); i != events.end(); ++i) {
if ((*i)->type == ev->type && (*i)->action_frame == ev->action_frame) {
- error << string_compose(_("Session: cannot have two events of type %1 at the same frame (%2)."),
+ error << string_compose(_("Session: cannot have two events of type %1 at the same frame (%2)."),
event_names[ev->type], ev->action_frame) << endmsg;
return;
}
@@ -210,7 +210,7 @@ Session::_remove_event (Session::Event* ev)
{
bool ret = false;
Events::iterator i;
-
+
for (i = events.begin(); i != events.end(); ++i) {
if ((*i)->type == ev->type && (*i)->action_frame == ev->action_frame) {
if ((*i) == ev) {
@@ -237,7 +237,7 @@ void
Session::_clear_event_type (Event::Type type)
{
Events::iterator i, tmp;
-
+
for (i = events.begin(); i != events.end(); ) {
tmp = i;
@@ -276,7 +276,7 @@ Session::set_next_event ()
if (events.empty()) {
next_event = events.end();
return;
- }
+ }
if (next_event == events.end()) {
next_event = events.begin();
@@ -306,7 +306,7 @@ Session::process_event (Event* ev)
*/
if (non_realtime_work_pending()) {
-
+
/* except locates, which we have the capability to handle */
if (ev->type != Event::Locate) {
@@ -363,7 +363,7 @@ Session::process_event (Event* ev)
case Event::SetTransportSpeed:
set_transport_speed (ev->speed, ev->yes_or_no);
break;
-
+
case Event::PunchIn:
// cerr << "PunchIN at " << transport_frame() << endl;
if (config.get_punch_in() && record_status() == Enabled) {
@@ -372,7 +372,7 @@ Session::process_event (Event* ev)
remove = false;
del = false;
break;
-
+
case Event::PunchOut:
// cerr << "PunchOUT at " << transport_frame() << endl;
if (config.get_punch_out()) {
@@ -398,7 +398,7 @@ Session::process_event (Event* ev)
remove = false;
del = false;
break;
-
+
case Event::RangeLocate:
start_locate (ev->target_frame, true, true, false);
remove = false;
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index 7982f89507..77f0d89d97 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2008 Paul Davis
+ Copyright (C) 1999-2008 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@ Session::get_export_handler ()
if (!export_handler) {
export_handler.reset (new ExportHandler (*this));
}
-
+
return export_handler;
}
@@ -54,7 +54,7 @@ Session::get_export_status ()
if (!export_status) {
export_status.reset (new ExportStatus ());
}
-
+
return export_status;
}
@@ -88,7 +88,7 @@ Session::pre_export ()
post_export_position = _transport_frame;
Config->set_slave_source (None);
-
+
_exporting = true;
export_status->running = true;
export_status->Aborting.connect (sigc::hide_return (sigc::mem_fun (*this, &Session::stop_audio_export)));
@@ -125,7 +125,7 @@ Session::start_audio_export (nframes_t position, bool realtime)
*/
_transport_frame = position;
-
+
_exporting_realtime = realtime;
export_status->stop = false;
@@ -141,7 +141,7 @@ Session::start_audio_export (nframes_t position, bool realtime)
post_transport ();
/* we are ready to go ... */
-
+
if (!_engine.connected()) {
return -1;
}
@@ -166,21 +166,21 @@ Session::process_export (nframes_t nframes)
stop_audio_export ();
return;
}
-
+
if (!_exporting_realtime) {
/* make sure we've caught up with disk i/o, since
we're running faster than realtime c/o JACK.
*/
-
+
wait_till_butler_finished ();
}
-
+
/* do the usual stuff */
-
+
process_without_events (nframes);
-
+
/* handle export */
-
+
ProcessExport (nframes);
} catch (ExportFailed e) {
@@ -191,7 +191,7 @@ Session::process_export (nframes_t nframes)
int
Session::process_export_fw (nframes_t nframes)
{
- process_export (nframes);
+ process_export (nframes);
return 0;
}
@@ -217,7 +217,7 @@ Session::stop_audio_export ()
} else {
finalize_audio_export ();
}
-
+
return 0;
}
@@ -234,7 +234,7 @@ Session::finalize_audio_export ()
}
/* Clean up */
-
+
ProcessExport.clear();
ExportReadFinished.clear();
export_freewheel_connection.disconnect();
diff --git a/libs/ardour/session_feedback.cc b/libs/ardour/session_feedback.cc
index e6d1086126..6e08fc01b0 100644
--- a/libs/ardour/session_feedback.cc
+++ b/libs/ardour/session_feedback.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,4 +46,4 @@ using namespace ARDOUR;
//using namespace sigc;
-
+
diff --git a/libs/ardour/session_metadata.cc b/libs/ardour/session_metadata.cc
index 8805cf5a0d..e792fd1585 100644
--- a/libs/ardour/session_metadata.cc
+++ b/libs/ardour/session_metadata.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Paul Davis
+ Copyright (C) 2008 Paul Davis
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@ using namespace Glib;
using namespace ARDOUR;
SessionMetadata::SessionMetadata ()
-{
+{
/*** General ***/
map.insert (Property ("comment", ""));
map.insert (Property ("copyright", ""));
@@ -94,11 +94,11 @@ SessionMetadata::get_xml (const ustring & name)
if (value.empty()) {
return 0;
}
-
+
XMLNode val ("value", value);
XMLNode * node = new XMLNode (name);
node->add_child_copy (val);
-
+
return node;
}
@@ -111,7 +111,7 @@ SessionMetadata::get_value (const ustring & name) const
std::cerr << "Programming error in SessionMetadata::get_value" << std::endl;
return "";
}
-
+
return it->second;
}
@@ -130,7 +130,7 @@ SessionMetadata::set_value (const ustring & name, const ustring & value)
std::cerr << "Programming error in SessionMetadata::set_value" << std::endl;
return;
}
-
+
it->second = value;
}
@@ -152,13 +152,13 @@ SessionMetadata::get_state ()
{
XMLNode * node = new XMLNode ("Metadata");
XMLNode * prop;
-
+
for (PropertyMap::const_iterator it = map.begin(); it != map.end(); ++it) {
if ((prop = get_xml (it->first))) {
node->add_child_nocopy (*prop);
}
}
-
+
return *node;
}
@@ -169,20 +169,20 @@ SessionMetadata::set_state (const XMLNode & state)
ustring name;
ustring value;
XMLNode * node;
-
+
for (XMLNodeConstIterator it = children.begin(); it != children.end(); it++) {
node = *it;
if (node->children().empty()) {
continue;
}
-
+
name = node->name();
node = *node->children().begin();
value = node->content();
-
+
set_value (name, value);
}
-
+
return 0;
}
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 990246aa7c..25807687a8 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -330,7 +330,7 @@ Session::set_trace_midi_input (bool yn, MIDI::Port* port)
MIDI::Parser* input_parser;
cerr << "enabling tracing: " << yn << " for input port " << port->name() << endl;
-
+
if (port) {
if ((input_parser = port->input()) != 0) {
input_parser->trace (yn, &cout, "input: ");
@@ -354,10 +354,10 @@ Session::set_trace_midi_input (bool yn, MIDI::Port* port)
input_parser->trace (yn, &cout, "input: ");
}
}
-
- if (_midi_clock_port
- && _midi_clock_port != _mmc_port
- && _midi_clock_port != _mtc_port
+
+ if (_midi_clock_port
+ && _midi_clock_port != _mmc_port
+ && _midi_clock_port != _mtc_port
&& _midi_clock_port != _midi_port) {
if ((input_parser = _midi_clock_port->input()) != 0) {
input_parser->trace (yn, &cout, "input: ");
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 2dd68744b4..41f3a52d7d 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2002 Paul Davis
+ Copyright (C) 1999-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -66,11 +66,11 @@ Session::process (nframes_t nframes)
if (non_realtime_work_pending()) {
if (!transport_work_requested ()) {
post_transport ();
- }
- }
+ }
+ }
(this->*process_function) (nframes);
-
+
// the ticker is for sending time information like MidiClock
nframes_t transport_frames = transport_frame();
BBT_Time transport_bbt;
@@ -78,9 +78,9 @@ Session::process (nframes_t nframes)
SMPTE::Time transport_smpte;
smpte_time(transport_frames, transport_smpte);
tick (transport_frames, transport_bbt, transport_smpte); /* EMIT SIGNAL */
-
+
SendFeedback (); /* EMIT SIGNAL */
-
+
MIDI::Manager::instance()->cycle_end();
}
@@ -112,14 +112,14 @@ Session::no_roll (nframes_t nframes)
}
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-
+
if ((*i)->is_hidden()) {
continue;
}
-
+
(*i)->set_pending_declick (declick);
-
- if ((*i)->no_roll (nframes, _transport_frame, end_frame, non_realtime_work_pending(),
+
+ if ((*i)->no_roll (nframes, _transport_frame, end_frame, non_realtime_work_pending(),
actively_recording(), declick)) {
error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
ret = -1;
@@ -172,7 +172,7 @@ Session::process_routes (nframes_t nframes)
stop_transport ();
return -1;
- }
+ }
}
return 0;
@@ -190,7 +190,7 @@ Session::silent_process_routes (nframes_t nframes)
/* force a declick out */
declick = -1;
}
-
+
const nframes_t start_frame = _transport_frame;
const nframes_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
@@ -203,7 +203,7 @@ Session::silent_process_routes (nframes_t nframes)
}
if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, record_active, rec_monitors)) < 0) {
-
+
/* we have to do this here. Route::roll() for an AudioTrack will have called AudioDiskstream::process(),
and the DS will expect AudioDiskstream::commit() to be called. but we're aborting from that
call path, so make sure we release any outstanding locks here before we return failure.
@@ -216,7 +216,7 @@ Session::silent_process_routes (nframes_t nframes)
stop_transport ();
return -1;
- }
+ }
}
return 0;
@@ -235,7 +235,7 @@ Session::commit_diskstreams (nframes_t nframes, bool &needs_butler)
if ((*i)->hidden()) {
continue;
}
-
+
/* force all diskstreams not handled by a Route to call do their stuff.
Note: the diskstreams that were handled by a route will just return zero
from this call, because they know they were processed. So in fact, this
@@ -250,7 +250,7 @@ Session::commit_diskstreams (nframes_t nframes, bool &needs_butler)
} else if (dret < 0) {
(*i)->recover();
}
-
+
pworst = min (pworst, (*i)->playback_buffer_load());
cworst = min (cworst, (*i)->capture_buffer_load());
}
@@ -280,7 +280,7 @@ Session::process_with_events (nframes_t nframes)
bool session_needs_butler = false;
nframes_t stop_limit;
long frames_moved;
-
+
/* make sure the auditioner is silent */
if (auditioner) {
@@ -295,7 +295,7 @@ Session::process_with_events (nframes_t nframes)
/* if we are not in the middle of a state change,
and there are immediate events queued up,
- process them.
+ process them.
*/
while (!non_realtime_work_pending() && !immediate_events.empty()) {
@@ -324,7 +324,7 @@ Session::process_with_events (nframes_t nframes)
if (_transport_speed == 1.0) {
frames_moved = (long) nframes;
- } else {
+ } else {
interpolation.set_target_speed (fabs(_target_transport_speed));
interpolation.set_speed (fabs(_transport_speed));
frames_moved = (long) interpolation.interpolate (0, nframes, 0, 0);
@@ -335,23 +335,23 @@ Session::process_with_events (nframes_t nframes)
{
Event* this_event;
Events::iterator the_next_one;
-
+
if (!process_can_proceed()) {
_silent = true;
return;
}
-
+
if (!_exporting && _slave) {
if (!follow_slave (nframes)) {
return;
}
- }
+ }
if (_transport_speed == 0) {
no_roll (nframes);
return;
}
-
+
if (!_exporting) {
send_midi_time_code_for_cycle (nframes);
}
@@ -370,14 +370,14 @@ Session::process_with_events (nframes_t nframes)
if (maybe_stop (stop_limit)) {
no_roll (nframes);
return;
- }
+ }
this_event = *next_event;
the_next_one = next_event;
++the_next_one;
/* yes folks, here it is, the actual loop where we really truly
- process some audio
+ process some audio
*/
while (nframes) {
@@ -390,12 +390,12 @@ Session::process_with_events (nframes_t nframes)
/* this isn't quite right for reverse play */
frames_moved = (long) (this_event->action_frame - _transport_frame);
this_nframes = (nframes_t) abs( floor(frames_moved / _transport_speed) );
- }
+ }
if (this_nframes) {
-
+
click (_transport_frame, this_nframes);
-
+
/* now process frames between now and the first event in this block */
prepare_diskstreams ();
@@ -403,11 +403,11 @@ Session::process_with_events (nframes_t nframes)
fail_roll (nframes);
return;
}
-
+
commit_diskstreams (this_nframes, session_needs_butler);
nframes -= this_nframes;
-
+
if (frames_moved < 0) {
decrement_transport_position (-frames_moved);
} else {
@@ -419,9 +419,9 @@ Session::process_with_events (nframes_t nframes)
}
_engine.split_cycle (this_nframes);
-
+
/* now handle this event and all others scheduled for the same time */
-
+
while (this_event && this_event->action_frame == _transport_frame) {
process_event (this_event);
@@ -431,7 +431,7 @@ Session::process_with_events (nframes_t nframes)
this_event = *the_next_one;
++the_next_one;
}
- }
+ }
/* if an event left our state changing, do the right thing */
@@ -442,7 +442,7 @@ Session::process_with_events (nframes_t nframes)
/* this is necessary to handle the case of seamless looping */
end_frame = _transport_frame + (nframes_t) floor (nframes * _transport_speed);
-
+
}
set_next_event ();
@@ -488,7 +488,7 @@ Session::follow_slave (nframes_t nframes)
Config->set_slave_source (None);
goto noroll;
}
-
+
_slave->speed_and_position (slave_speed, slave_transport_frame);
if (!_slave->locked()) {
@@ -509,13 +509,13 @@ Session::follow_slave (nframes_t nframes)
if (_slave->is_always_synced() || config.get_timecode_source_is_synced()) {
- /* if the TC source is synced, then we assume that its
+ /* if the TC source is synced, then we assume that its
speed is binary: 0.0 or 1.0
*/
if (slave_speed != 0.0f) {
slave_speed = 1.0f;
- }
+ }
} else {
@@ -526,17 +526,17 @@ Session::follow_slave (nframes_t nframes)
calculate_moving_average_of_slave_delta(dir, this_delta);
}
-
+
track_slave_state(slave_speed, slave_transport_frame, this_delta, starting);
if (slave_state == Running && !_slave->is_always_synced() && !config.get_timecode_source_is_synced()) {
if (_transport_speed != 0.0f) {
-
- /*
- note that average_dir is +1 or -1
+
+ /*
+ note that average_dir is +1 or -1
*/
-
+
float delta;
#ifdef USE_MOVING_AVERAGE_OF_SLAVE
@@ -553,7 +553,7 @@ Session::follow_slave (nframes_t nframes)
#endif
float adjusted_speed = slave_speed + (delta / float(_current_frame_rate));
-
+
if (_slave->give_slave_full_control_over_transport_speed()) {
request_transport_speed(slave_speed);
} else {
@@ -567,23 +567,23 @@ Session::follow_slave (nframes_t nframes)
<< endl;
#endif
}
-
+
if (abs(average_slave_delta) > (long) _slave->resolution()) {
cerr << "average slave delta greater than slave resolution, going to silent motion\n";
goto silent_motion;
}
}
- }
-
+ }
+
#ifdef DEBUG_SLAVES
if (slave_speed != 0.0)
cerr << "delta = " << (int) (dir * this_delta)
- << " speed = " << slave_speed
- << " ts = " << _transport_speed
- << " M@ "<< slave_transport_frame << " S@ " << _transport_frame
- << " avgdelta = " << average_slave_delta
+ << " speed = " << slave_speed
+ << " ts = " << _transport_speed
+ << " M@ "<< slave_transport_frame << " S@ " << _transport_frame
+ << " avgdelta = " << average_slave_delta
<< endl;
- #endif
+ #endif
if (!starting && !non_realtime_work_pending()) {
/* speed is set, we're locked, and good to go */
@@ -591,15 +591,15 @@ Session::follow_slave (nframes_t nframes)
}
silent_motion:
- #ifdef DEBUG_SLAVES
+ #ifdef DEBUG_SLAVES
cerr << "reached silent_motion:" <<endl;
#endif
-
+
follow_slave_silently (nframes, slave_speed);
-
+
noroll:
/* don't move at all */
- #ifdef DEBUG_SLAVES
+ #ifdef DEBUG_SLAVES
cerr << "reached no_roll:" <<endl;
#endif
no_roll (nframes);
@@ -617,7 +617,7 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
if (delta_accumulator_cnt != 0 || this_delta < _current_frame_rate) {
delta_accumulator[delta_accumulator_cnt++] = long(dir) * long(this_delta);
}
-
+
if (have_first_delta_accumulator) {
average_slave_delta = 0L;
for (int i = 0; i < delta_accumulator_size; ++i) {
@@ -635,8 +635,8 @@ Session::calculate_moving_average_of_slave_delta(int dir, nframes_t this_delta)
void
Session::track_slave_state(
- float slave_speed,
- nframes_t slave_transport_frame,
+ float slave_speed,
+ nframes_t slave_transport_frame,
nframes_t this_delta,
bool starting)
{
@@ -681,7 +681,7 @@ Session::track_slave_state(
#ifdef DEBUG_SLAVES
cerr << "waiting at " << slave_transport_frame << endl;
- #endif
+ #endif
if (slave_transport_frame >= slave_wait_end) {
#ifdef DEBUG_SLAVES
cerr << "\tstart at " << _transport_frame << endl;
@@ -692,7 +692,7 @@ Session::track_slave_state(
nframes_t frame_delta = slave_transport_frame - _transport_frame;
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
-
+
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
if (!(*i)->can_internal_playback_seek (frame_delta)) {
ok = false;
@@ -705,7 +705,7 @@ Session::track_slave_state(
(*i)->internal_playback_seek (frame_delta);
}
_transport_frame += frame_delta;
-
+
} else {
cerr << "cannot micro-seek\n";
/* XXX what? */
@@ -716,14 +716,14 @@ Session::track_slave_state(
this_delta = 0;
}
}
-
+
if (slave_state == Running && _transport_speed == 0.0f) {
-
+
#ifdef DEBUG_SLAVES
cerr << "slave starts transport\n";
#endif
start_transport ();
- }
+ }
} else { // slave_speed is 0
@@ -732,15 +732,15 @@ Session::track_slave_state(
if (_transport_speed != 0.0f) {
#ifdef DEBUG_SLAVES
- cerr << "slave stops transport: " << slave_speed << " frame: " << slave_transport_frame
+ cerr << "slave stops transport: " << slave_speed << " frame: " << slave_transport_frame
<< " tf = " << _transport_frame << endl;
#endif
-
+
stop_transport();
}
if (slave_transport_frame != _transport_frame) {
- #ifdef DEBUG_SLAVES
+ #ifdef DEBUG_SLAVES
cerr << "slave stopped, move to " << slave_transport_frame << endl;
#endif
force_locate (slave_transport_frame, false);
@@ -760,7 +760,7 @@ Session::follow_slave_silently (nframes_t nframes, float slave_speed)
*/
bool need_butler;
-
+
prepare_diskstreams ();
silent_process_routes (nframes);
commit_diskstreams (nframes, need_butler);
@@ -768,17 +768,17 @@ Session::follow_slave_silently (nframes_t nframes, float slave_speed)
if (need_butler) {
summon_butler ();
}
-
+
int32_t frames_moved = (int32_t) floor (_transport_speed * nframes);
-
+
if (frames_moved < 0) {
decrement_transport_position (-frames_moved);
} else {
increment_transport_position (frames_moved);
}
-
+
nframes_t stop_limit;
-
+
if (actively_recording()) {
stop_limit = max_frames;
} else {
@@ -809,13 +809,13 @@ Session::process_without_events (nframes_t nframes)
if (!follow_slave (nframes)) {
return;
}
- }
+ }
if (_transport_speed == 0) {
fail_roll (nframes);
return;
}
-
+
if (!_exporting) {
send_midi_time_code_for_cycle (nframes);
}
@@ -829,11 +829,11 @@ Session::process_without_events (nframes_t nframes)
stop_limit = max_frames;
}
}
-
+
if (maybe_stop (stop_limit)) {
fail_roll (nframes);
return;
- }
+ }
if (maybe_sync_start (nframes)) {
return;
@@ -842,10 +842,10 @@ Session::process_without_events (nframes_t nframes)
click (_transport_frame, nframes);
prepare_diskstreams ();
-
+
if (_transport_speed == 1.0) {
frames_moved = (long) nframes;
- } else {
+ } else {
interpolation.set_target_speed (fabs(_target_transport_speed));
interpolation.set_speed (fabs(_transport_speed));
frames_moved = (long) interpolation.interpolate (0, nframes, 0, 0);
@@ -887,10 +887,10 @@ Session::process_audition (nframes_t nframes)
}
/* run the auditioner, and if it says we need butler service, ask for it */
-
+
if (auditioner->play_audition (nframes) > 0) {
summon_butler ();
- }
+ }
/* handle pending events */
@@ -900,7 +900,7 @@ Session::process_audition (nframes_t nframes)
/* if we are not in the middle of a state change,
and there are immediate events queued up,
- process them.
+ process them.
*/
while (!non_realtime_work_pending() && !immediate_events.empty()) {
@@ -935,15 +935,15 @@ Session::maybe_sync_start (nframes_t& nframes)
nframes -= sync_offset;
Port::increment_port_offset (sync_offset);
waiting_for_sync_offset = false;
-
+
if (nframes == 0) {
return true; // done, nothing left to process
}
-
+
} else {
/* sync offset point is not within this process()
- cycle, so just generate silence. and don't bother
+ cycle, so just generate silence. and don't bother
with any fancy stuff here, just the minimal silence.
*/
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 771e3b2bc6..b85f2ac078 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2002 Paul Davis
+ Copyright (C) 1999-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+
*/
@@ -145,7 +145,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
_writable = false;
} else {
cerr << "Session writable based on " << _path << endl;
- _writable = true;
+ _writable = true;
}
/* these two are just provisional settings. set_state()
@@ -234,7 +234,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
/* click sounds are unset by default, which causes us to internal
waveforms for clicks.
*/
-
+
click_length = 0;
click_emphasis_length = 0;
_clicking = false;
@@ -346,7 +346,7 @@ Session::second_stage_init (bool new_session)
}
/* handle this one in a different way than all others, so that its clear what happened */
-
+
catch (AudioEngine::PortRegistrationFailure& err) {
error << err.what() << endmsg;
return -1;
@@ -362,7 +362,7 @@ Session::second_stage_init (bool new_session)
_engine.transport_locate (0);
deliver_mmc (MIDI::MachineControl::cmdMmcReset, 0);
deliver_mmc (MIDI::MachineControl::cmdLocate, 0);
-
+
MidiClockTicker::instance().set_session(*this);
MIDI::Name::MidiPatchManager::instance().set_session(*this);
@@ -375,7 +375,7 @@ Session::second_stage_init (bool new_session)
config.set_end_marker_is_free (new_session);
_state_of_the_state = Clean;
-
+
DirtyChanged (); /* EMIT SIGNAL */
if (state_was_pending) {
@@ -383,7 +383,7 @@ Session::second_stage_init (bool new_session)
remove_pending_capture_state ();
state_was_pending = false;
}
-
+
BootMessage (_("Session loading complete"));
return 0;
@@ -397,7 +397,7 @@ Session::raid_path () const
for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) {
raid_search_path += sys::path((*i).path);
}
-
+
return raid_search_path.to_string ();
}
@@ -407,7 +407,7 @@ Session::setup_raid_path (string path)
if (path.empty()) {
return;
}
-
+
space_and_path sp;
string fspath;
@@ -454,7 +454,7 @@ Session::ensure_subdirs ()
error << string_compose(_("Session: cannot create session sounds dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
-
+
dir = session_directory().midi_path().to_string();
if (g_mkdir_with_parents (dir.c_str(), 0755) < 0) {
@@ -523,21 +523,21 @@ Session::create (bool& new_session, const string& mix_template, nframes_t initia
return 0;
} else {
- error << string_compose (_("Could not open %1 for writing mix template"), out_path)
+ error << string_compose (_("Could not open %1 for writing mix template"), out_path)
<< endmsg;
return -1;
}
} else {
- error << string_compose (_("Could not open mix template %1 for reading"), in_path)
+ error << string_compose (_("Could not open mix template %1 for reading"), in_path)
<< endmsg;
return -1;
}
}
-
+
/* Instantiate metadata */
-
+
_metadata = new SessionMetadata ();
/* set initial start + end point */
@@ -561,7 +561,7 @@ Session::load_diskstreams (const XMLNode& node)
{
XMLNodeList clist;
XMLNodeConstIterator citer;
-
+
clist = node.children();
for (citer = clist.begin(); citer != clist.end(); ++citer) {
@@ -577,8 +577,8 @@ Session::load_diskstreams (const XMLNode& node)
} else {
error << _("Session: unknown diskstream type in XML") << endmsg;
}
- }
-
+ }
+
catch (failed_constructor& err) {
error << _("Session: could not load diskstream via XML state") << endmsg;
return -1;
@@ -600,7 +600,7 @@ void
Session::remove_pending_capture_state ()
{
sys::path pending_state_file_path(_session_dir->root_path());
-
+
pending_state_file_path /= legalize_for_path (_current_snapshot_name) + pending_suffix;
try
@@ -697,7 +697,7 @@ Session::save_state (string snapshot_name, bool pending)
if (!pending) {
/* proper save: use statefile_suffix (.ardour in English) */
-
+
xml_path /= legalize_for_path (snapshot_name) + statefile_suffix;
/* make a backup copy of the old file */
@@ -741,7 +741,7 @@ Session::save_state (string snapshot_name, bool pending)
bool was_dirty = dirty();
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
-
+
if (was_dirty) {
DirtyChanged (); /* EMIT SIGNAL */
}
@@ -758,7 +758,7 @@ Session::restore_state (string snapshot_name)
if (load_state (snapshot_name) == 0) {
set_state (*state_tree->root());
}
-
+
return 0;
}
@@ -781,14 +781,14 @@ Session::load_state (string snapshot_name)
if (AskAboutPendingState()) {
state_was_pending = true;
- }
- }
+ }
+ }
if (!state_was_pending) {
xmlpath = _session_dir->root_path();
xmlpath /= legalize_for_path (snapshot_name) + statefile_suffix;
}
-
+
if (!sys::exists (xmlpath)) {
error << string_compose(_("%1: session state information file \"%2\" doesn't exist!"), _name, xmlpath.to_string()) << endmsg;
return 1;
@@ -815,7 +815,7 @@ Session::load_state (string snapshot_name)
}
XMLNode& root (*state_tree->root());
-
+
if (root.name() != X_("Session")) {
error << string_compose (_("Session file %1 is not an Ardour session"), xmlpath.to_string()) << endmsg;
delete state_tree;
@@ -849,7 +849,7 @@ Session::load_state (string snapshot_name)
}
info << string_compose (_("Copying old session file %1 to %2\nUse %2 with Ardour versions before 2.0 from now on"),
- xmlpath.to_string(), backup_path.to_string())
+ xmlpath.to_string(), backup_path.to_string())
<< endmsg;
try
@@ -875,7 +875,7 @@ Session::load_options (const XMLNode& node)
config.set_variables (node);
- /* now reset MIDI ports because the session can have its own
+ /* now reset MIDI ports because the session can have its own
MIDI configuration.
*/
@@ -895,9 +895,9 @@ Session::get_template()
{
/* if we don't disable rec-enable, diskstreams
will believe they need to store their capture
- sources in their state node.
+ sources in their state node.
*/
-
+
disable_record (false);
return state(false);
@@ -913,11 +913,11 @@ Session::state(bool full_state)
char buf[16];
snprintf(buf, sizeof(buf), "%d.%d.%d", libardour3_major_version, libardour3_minor_version, libardour3_micro_version);
node->add_property("version", string(buf));
-
+
/* store configuration settings */
if (full_state) {
-
+
node->add_property ("name", _name);
snprintf (buf, sizeof (buf), "%" PRId32, _nominal_frame_rate);
node->add_property ("sample-rate", buf);
@@ -946,14 +946,14 @@ Session::state(bool full_state)
++next;
++i;
}
-
+
child = node->add_child ("Path");
child->add_content (p);
}
}
/* save the ID counter */
-
+
snprintf (buf, sizeof (buf), "%" PRIu64, ID::counter());
node->add_property ("id-counter", buf);
@@ -969,10 +969,10 @@ Session::state(bool full_state)
Glib::Mutex::Lock sl (source_lock);
for (SourceMap::iterator siter = sources.begin(); siter != sources.end(); ++siter) {
-
+
/* Don't save information about non-destructive file sources that are empty */
/* FIXME: MIDI breaks if this is made FileSource like it should be... */
-
+
boost::shared_ptr<AudioFileSource> fs;
if ((fs = boost::dynamic_pointer_cast<AudioFileSource> (siter->second)) != 0) {
if (!fs->destructive()) {
@@ -981,18 +981,18 @@ Session::state(bool full_state)
}
}
}
-
+
child->add_child_nocopy (siter->second->get_state());
}
}
child = node->add_child ("Regions");
- if (full_state) {
+ if (full_state) {
Glib::Mutex::Lock rl (region_lock);
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
-
+
/* only store regions not attached to playlists */
if (i->second->playlist() == 0) {
@@ -1003,7 +1003,7 @@ Session::state(bool full_state)
child = node->add_child ("DiskStreams");
- {
+ {
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
if (!(*i)->hidden()) {
@@ -1026,7 +1026,7 @@ Session::state(bool full_state)
loc.add (end);
node->add_child_nocopy (loc.get_state());
}
-
+
child = node->add_child ("Bundles");
{
boost::shared_ptr<BundleList> bundles = _bundles.reader ();
@@ -1041,11 +1041,11 @@ Session::state(bool full_state)
child = node->add_child ("Routes");
{
boost::shared_ptr<RouteList> r = routes.reader ();
-
+
RoutePublicOrderSorter cmp;
RouteList public_order (*r);
public_order.sort (cmp);
-
+
for (RouteList::iterator i = public_order.begin(); i != public_order.end(); ++i) {
if (!(*i)->is_hidden()) {
if (full_state) {
@@ -1057,7 +1057,7 @@ Session::state(bool full_state)
}
}
-
+
child = node->add_child ("RouteGroups");
for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
child->add_child_nocopy ((*i)->get_state());
@@ -1088,8 +1088,8 @@ Session::state(bool full_state)
}
}
}
-
-
+
+
if (_click_io) {
child = node->add_child ("Click");
child->add_child_nocopy (_click_io->state (full_state));
@@ -1100,7 +1100,7 @@ Session::state(bool full_state)
for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ++i) {
if (full_state) {
child->add_child_nocopy ((*i)->get_state());
- }
+ }
}
}
@@ -1131,7 +1131,7 @@ Session::set_state (const XMLNode& node)
int ret = -1;
_state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave);
-
+
if (node.name() != X_("Session")){
fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg;
return -1;
@@ -1168,7 +1168,7 @@ Session::set_state (const XMLNode& node)
ID::init_counter (now);
}
-
+
IO::disable_connecting ();
/* Object loading order:
@@ -1270,7 +1270,7 @@ Session::set_state (const XMLNode& node)
} else if (load_unused_playlists (*child)) {
goto out;
}
-
+
if ((child = find_named_node (node, "NamedSelections")) != 0) {
if (load_named_selections (*child)) {
goto out;
@@ -1293,7 +1293,7 @@ Session::set_state (const XMLNode& node)
later */
_bundle_xml_node = new XMLNode (*child);
}
-
+
if ((child = find_named_node (node, "RouteGroups")) == 0) {
error << _("Session: XML state has no route groups section") << endmsg;
goto out;
@@ -1373,14 +1373,14 @@ Session::XMLRouteFactory (const XMLNode& node)
}
bool has_diskstream = (node.property ("diskstream") != 0 || node.property ("diskstream-id") != 0);
-
+
DataType type = DataType::AUDIO;
const XMLProperty* prop = node.property("default-type");
if (prop) {
type = DataType(prop->value());
- }
-
+ }
+
assert(type != DataType::NIL);
if (has_diskstream) {
@@ -1430,17 +1430,17 @@ Session::XMLRegionFactory (const XMLNode& node, bool full)
const XMLProperty* type = node.property("type");
try {
-
+
if ( !type || type->value() == "audio" ) {
return boost::shared_ptr<Region>(XMLAudioRegionFactory (node, full));
-
+
} else if (type->value() == "midi") {
-
+
return boost::shared_ptr<Region>(XMLMidiRegionFactory (node, full));
}
-
+
} catch (failed_constructor& err) {
return boost::shared_ptr<Region> ();
}
@@ -1458,7 +1458,7 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
SourceList master_sources;
uint32_t nchans = 1;
char buf[128];
-
+
if (node.name() != X_("Region")) {
return boost::shared_ptr<AudioRegion>();
}
@@ -1471,7 +1471,7 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
cerr << "no name for this region\n";
abort ();
}
-
+
if ((prop = node.property (X_("source-0"))) == 0) {
if ((prop = node.property ("source")) == 0) {
error << _("Session: XMLNode describing a AudioRegion is incomplete (no source)") << endmsg;
@@ -1485,7 +1485,7 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), s_id) << endmsg;
return boost::shared_ptr<AudioRegion>();
}
-
+
as = boost::dynamic_pointer_cast<AudioSource>(source);
if (!as) {
error << string_compose(_("Session: XMLNode describing a AudioRegion references a non-audio source id =%1"), s_id) << endmsg;
@@ -1499,14 +1499,14 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
for (uint32_t n=1; n < nchans; ++n) {
snprintf (buf, sizeof(buf), X_("source-%d"), n);
if ((prop = node.property (buf)) != 0) {
-
+
PBD::ID id2 (prop->value());
-
+
if ((source = source_by_id (id2)) == 0) {
error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), id2) << endmsg;
return boost::shared_ptr<AudioRegion>();
}
-
+
as = boost::dynamic_pointer_cast<AudioSource>(source);
if (!as) {
error << string_compose(_("Session: XMLNode describing a AudioRegion references a non-audio source id =%1"), id2) << endmsg;
@@ -1519,14 +1519,14 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
for (uint32_t n = 0; n < nchans; ++n) {
snprintf (buf, sizeof(buf), X_("master-source-%d"), n);
if ((prop = node.property (buf)) != 0) {
-
+
PBD::ID id2 (prop->value());
-
+
if ((source = source_by_id (id2)) == 0) {
error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), id2) << endmsg;
return boost::shared_ptr<AudioRegion>();
}
-
+
as = boost::dynamic_pointer_cast<AudioSource>(source);
if (!as) {
error << string_compose(_("Session: XMLNode describing a AudioRegion references a non-audio source id =%1"), id2) << endmsg;
@@ -1559,7 +1559,7 @@ Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
}
return region;
-
+
}
catch (failed_constructor& err) {
@@ -1575,7 +1575,7 @@ Session::XMLMidiRegionFactory (const XMLNode& node, bool /*full*/)
boost::shared_ptr<MidiSource> ms;
SourceList sources;
uint32_t nchans = 1;
-
+
if (node.name() != X_("Region")) {
return boost::shared_ptr<MidiRegion>();
}
@@ -1583,7 +1583,7 @@ Session::XMLMidiRegionFactory (const XMLNode& node, bool /*full*/)
if ((prop = node.property (X_("channels"))) != 0) {
nchans = atoi (prop->value().c_str());
}
-
+
if ((prop = node.property ("name")) == 0) {
cerr << "no name for this region\n";
abort ();
@@ -1662,7 +1662,7 @@ Session::path_from_region_name (DataType type, string name, string identifier)
for (n = 0; n < 999999; ++n) {
if (identifier.length()) {
- snprintf (buf, sizeof(buf), "%s%s%" PRIu32 "%s", name.c_str(),
+ snprintf (buf, sizeof(buf), "%s%s%" PRIu32 "%s", name.c_str(),
identifier.c_str(), n, ext.c_str());
} else {
snprintf (buf, sizeof(buf), "%s-%" PRIu32 "%s", name.c_str(),
@@ -1682,7 +1682,7 @@ Session::path_from_region_name (DataType type, string name, string identifier)
return "";
}
-
+
int
Session::load_sources (const XMLNode& node)
@@ -1770,7 +1770,7 @@ Session::save_template (string template_name)
}
int
-Session::rename_template (string old_name, string new_name)
+Session::rename_template (string old_name, string new_name)
{
sys::path old_path (user_template_directory());
old_path /= old_name + template_suffix;
@@ -1793,7 +1793,7 @@ Session::rename_template (string old_name, string new_name)
}
int
-Session::delete_template (string name)
+Session::delete_template (string name)
{
sys::path path = user_template_directory();
path /= name + template_suffix;
@@ -1818,7 +1818,7 @@ Session::refresh_disk_space ()
/* get freespace on every FS that is part of the session path */
_total_free_4k_blocks = 0;
-
+
for (i = session_dirs.begin(); i != session_dirs.end(); ++i) {
statfs ((*i).path.c_str(), &statfsbuf);
@@ -1843,8 +1843,8 @@ Session::get_best_session_directory_for_new_source ()
}
/* OK, here's the algorithm we're following here:
-
- We want to select which directory to use for
+
+ We want to select which directory to use for
the next file source to be created. Ideally,
we'd like to use a round-robin process so as to
get maximum performance benefits from splitting
@@ -1863,15 +1863,15 @@ Session::get_best_session_directory_for_new_source ()
So, we use a user-configurable space threshold. If
there are at least 2 filesystems with more than this
- much space available, we use RR selection between them.
+ much space available, we use RR selection between them.
If not, then we pick the filesystem with the most space.
This gets a good balance between the two
- approaches.
+ approaches.
*/
-
+
refresh_disk_space ();
-
+
int free_enough = 0;
for (i = session_dirs.begin(); i != session_dirs.end(); ++i) {
@@ -1907,13 +1907,13 @@ Session::get_best_session_directory_for_new_source ()
/* pick FS with the most freespace (and that
seems to actually work ...)
*/
-
+
vector<space_and_path> sorted;
space_and_path_ascending_cmp cmp;
sorted = session_dirs;
sort (sorted.begin(), sorted.end(), cmp);
-
+
for (i = sorted.begin(); i != sorted.end(); ++i) {
if (create_session_directory ((*i).path)) {
result = (*i).path;
@@ -1938,7 +1938,7 @@ Session::load_playlists (const XMLNode& node)
set_dirty();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
if ((playlist = XMLPlaylistFactory (**niter)) == 0) {
error << _("Session: cannot create Playlist from XML description.") << endmsg;
}
@@ -1959,7 +1959,7 @@ Session::load_unused_playlists (const XMLNode& node)
set_dirty();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
if ((playlist = XMLPlaylistFactory (**niter)) == 0) {
error << _("Session: cannot create Playlist from XML description.") << endmsg;
continue;
@@ -1997,7 +1997,7 @@ Session::load_named_selections (const XMLNode& node)
set_dirty();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
if ((ns = XMLNamedSelectionFactory (**niter)) == 0) {
error << _("Session: cannot create Named Selection from XML description.") << endmsg;
}
@@ -2033,24 +2033,24 @@ Session::analysis_dir () const
int
Session::load_bundles (XMLNode const & node)
{
- XMLNodeList nlist = node.children();
- XMLNodeConstIterator niter;
+ XMLNodeList nlist = node.children();
+ XMLNodeConstIterator niter;
- set_dirty();
+ set_dirty();
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() == "InputBundle") {
+ for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+ if ((*niter)->name() == "InputBundle") {
add_bundle (boost::shared_ptr<UserBundle> (new UserBundle (**niter, true)));
- } else if ((*niter)->name() == "OutputBundle") {
- add_bundle (boost::shared_ptr<UserBundle> (new UserBundle (**niter, false)));
- } else {
- error << string_compose(_("Unknown node \"%1\" found in Bundles list from state file"), (*niter)->name()) << endmsg;
- return -1;
- }
- }
+ } else if ((*niter)->name() == "OutputBundle") {
+ add_bundle (boost::shared_ptr<UserBundle> (new UserBundle (**niter, false)));
+ } else {
+ error << string_compose(_("Unknown node \"%1\" found in Bundles list from state file"), (*niter)->name()) << endmsg;
+ return -1;
+ }
+ }
return 0;
-}
+}
int
Session::load_route_groups (const XMLNode& node)
@@ -2067,9 +2067,9 @@ Session::load_route_groups (const XMLNode& node)
rg->set_state (**niter);
}
}
-
+
return 0;
-}
+}
void
Session::auto_save()
@@ -2094,12 +2094,12 @@ static string*
remove_end(string* state)
{
string statename(*state);
-
+
string::size_type start,end;
if ((start = statename.find_last_of ('/')) != string::npos) {
statename = statename.substr (start+1);
}
-
+
if ((end = statename.rfind(".ardour")) == string::npos) {
end = statename.length();
}
@@ -2108,16 +2108,16 @@ remove_end(string* state)
}
vector<string *> *
-Session::possible_states (string path)
+Session::possible_states (string path)
{
PathScanner scanner;
vector<string*>* states = scanner (path, state_file_filter, 0, false, false);
-
+
transform(states->begin(), states->end(), states->begin(), remove_end);
-
+
string_cmp cmp;
sort (states->begin(), states->end(), cmp);
-
+
return states;
}
@@ -2198,7 +2198,7 @@ Session::commit_reversible_command(Command *cmd)
_current_trans.pop();
}
-Session::GlobalRouteBooleanState
+Session::GlobalRouteBooleanState
Session::get_global_route_boolean (bool (Route::*method)(void) const)
{
GlobalRouteBooleanState s;
@@ -2207,11 +2207,11 @@ Session::get_global_route_boolean (bool (Route::*method)(void) const)
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (!(*i)->is_hidden()) {
RouteBooleanState v;
-
+
v.first =* i;
Route* r = (*i).get();
v.second = (r->*method)();
-
+
s.push_back (v);
}
}
@@ -2228,10 +2228,10 @@ Session::get_global_route_metering ()
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (!(*i)->is_hidden()) {
RouteMeterState v;
-
+
v.first =* i;
v.second = (*i)->meter_point();
-
+
s.push_back (v);
}
}
@@ -2240,7 +2240,7 @@ Session::get_global_route_metering ()
}
void
-Session::set_global_route_metering (GlobalRouteMeterState s, void* arg)
+Session::set_global_route_metering (GlobalRouteMeterState s, void* arg)
{
for (GlobalRouteMeterState::iterator i = s.begin(); i != s.end(); ++i) {
@@ -2296,7 +2296,7 @@ accept_all_state_files (const string& path, void */*arg*/)
return (path.length() > 7 && path.find (".ardour") == (path.length() - 7));
}
-int
+int
Session::find_all_sources (string path, set<string>& result)
{
XMLTree tree;
@@ -2318,7 +2318,7 @@ Session::find_all_sources (string path, set<string>& result)
set_dirty();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
+
XMLProperty* prop;
if ((prop = (*niter)->property (X_("type"))) == 0) {
@@ -2335,7 +2335,7 @@ Session::find_all_sources (string path, set<string>& result)
/* external file, ignore */
continue;
}
-
+
Glib::ustring found_path;
bool is_new;
uint16_t chan;
@@ -2365,7 +2365,7 @@ Session::find_all_sources_across_snapshots (set<string>& result, bool exclude_th
}
state_files = scanner (ripped, accept_all_state_files, (void *) 0, false, true);
-
+
if (state_files == 0) {
/* impossible! */
return 0;
@@ -2394,7 +2394,7 @@ struct RegionCounter {
AudioSourceList::iterator iter;
boost::shared_ptr<Region> region;
uint32_t count;
-
+
RegionCounter() : count (0) {}
};
@@ -2402,7 +2402,7 @@ int
Session::cleanup_sources (Session::cleanup_report& rep)
{
// FIXME: needs adaptation to midi
-
+
vector<boost::shared_ptr<Source> > dead_sources;
vector<boost::shared_ptr<Playlist> > playlists_tbd;
PathScanner scanner;
@@ -2415,10 +2415,10 @@ Session::cleanup_sources (Session::cleanup_report& rep)
bool used;
string spath;
int ret = -1;
-
+
_state_of_the_state = (StateOfTheState) (_state_of_the_state | InCleanup);
-
+
/* step 1: consider deleting all unused playlists */
for (PlaylistList::iterator x = unused_playlists.begin(); x != unused_playlists.end(); ++x) {
@@ -2456,7 +2456,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
rep.space = 0;
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ) {
-
+
SourceMap::iterator tmp;
tmp = i;
@@ -2466,10 +2466,10 @@ Session::cleanup_sources (Session::cleanup_report& rep)
capture files.
*/
- if (!i->second->used() && i->second->length(i->second->timeline_position()) > 0) {
+ if (!i->second->used() && i->second->length(i->second->timeline_position()) > 0) {
dead_sources.push_back (i->second);
i->second->GoingAway();
- }
+ }
i = tmp;
}
@@ -2491,7 +2491,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
i = nexti;
}
- /* now do the same thing for the files that ended up in the sounds dir(s)
+ /* now do the same thing for the files that ended up in the sounds dir(s)
but are not referenced as sources in any snapshot.
*/
@@ -2505,23 +2505,23 @@ Session::cleanup_sources (Session::cleanup_report& rep)
state file on disk still references sources we may have already
dropped.
*/
-
+
find_all_sources_across_snapshots (all_sources, true);
/* add our current source list
*/
-
+
for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
boost::shared_ptr<FileSource> fs;
-
+
if ((fs = boost::dynamic_pointer_cast<FileSource> (i->second)) != 0) {
all_sources.insert (fs->path());
- }
+ }
}
char tmppath1[PATH_MAX+1];
char tmppath2[PATH_MAX+1];
-
+
for (vector<string*>::iterator x = soundfiles->begin(); x != soundfiles->end(); ++x) {
used = false;
@@ -2554,7 +2554,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
}
string newpath;
-
+
/* don't move the file across filesystems, just
stick it in the `dead_sound_dir_name' directory
on whichever filesystem it was already on.
@@ -2564,14 +2564,14 @@ Session::cleanup_sources (Session::cleanup_report& rep)
/* old school, go up 1 level */
- newpath = Glib::path_get_dirname (*x); // "sounds"
+ newpath = Glib::path_get_dirname (*x); // "sounds"
newpath = Glib::path_get_dirname (newpath); // "session-name"
} else {
/* new school, go up 4 levels */
-
- newpath = Glib::path_get_dirname (*x); // "audiofiles"
+
+ newpath = Glib::path_get_dirname (*x); // "audiofiles"
newpath = Glib::path_get_dirname (newpath); // "session-name"
newpath = Glib::path_get_dirname (newpath); // "interchange"
newpath = Glib::path_get_dirname (newpath); // "session-dir"
@@ -2587,15 +2587,15 @@ Session::cleanup_sources (Session::cleanup_report& rep)
newpath += '/';
newpath += Glib::path_get_basename ((*x));
-
+
if (access (newpath.c_str(), F_OK) == 0) {
-
+
/* the new path already exists, try versioning */
-
+
char buf[PATH_MAX+1];
int version = 1;
string newpath_v;
-
+
snprintf (buf, sizeof (buf), "%s.%d", newpath.c_str(), version);
newpath_v = buf;
@@ -2603,7 +2603,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
snprintf (buf, sizeof (buf), "%s.%d", newpath.c_str(), ++version);
newpath_v = buf;
}
-
+
if (version == 999) {
error << string_compose (_("there are already 1000 files with names like %1; versioning discontinued"),
newpath)
@@ -2611,11 +2611,11 @@ Session::cleanup_sources (Session::cleanup_report& rep)
} else {
newpath = newpath_v;
}
-
+
} else {
-
+
/* it doesn't exist, or we can't read it or something */
-
+
}
if (::rename ((*x).c_str(), newpath.c_str()) != 0) {
@@ -2652,7 +2652,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
/* save state so we don't end up a session file
referring to non-existent sources.
*/
-
+
save_state ("");
out:
@@ -2665,7 +2665,7 @@ int
Session::cleanup_trash_sources (Session::cleanup_report& rep)
{
// FIXME: needs adaptation for MIDI
-
+
vector<space_and_path>::iterator i;
string dead_sound_dir;
struct dirent* dentry;
@@ -2676,7 +2676,7 @@ Session::cleanup_trash_sources (Session::cleanup_report& rep)
rep.space = 0;
for (i = session_dirs.begin(); i != session_dirs.end(); ++i) {
-
+
dead_sound_dir = (*i).path;
dead_sound_dir += dead_sound_dir_name;
@@ -2687,8 +2687,8 @@ Session::cleanup_trash_sources (Session::cleanup_report& rep)
while ((dentry = readdir (dead)) != 0) {
/* avoid '.' and '..' */
-
- if ((dentry->d_name[0] == '.' && dentry->d_name[1] == '\0') ||
+
+ if ((dentry->d_name[0] == '.' && dentry->d_name[1] == '\0') ||
(dentry->d_name[2] == '\0' && dentry->d_name[0] == '.' && dentry->d_name[1] == '.')) {
continue;
}
@@ -2718,7 +2718,7 @@ Session::cleanup_trash_sources (Session::cleanup_report& rep)
}
closedir (dead);
-
+
}
return 0;
@@ -2742,7 +2742,7 @@ void
Session::set_clean ()
{
bool was_dirty = dirty();
-
+
_state_of_the_state = Clean;
@@ -2775,7 +2775,7 @@ Session::add_controllable (boost::shared_ptr<Controllable> c)
Glib::Mutex::Lock lm (controllables_lock);
controllables.insert (c);
}
-
+
struct null_deleter { void operator()(void const *) const {} };
void
@@ -2793,13 +2793,13 @@ Session::remove_controllable (Controllable* c)
if (x != controllables.end()) {
controllables.erase (x);
}
-}
+}
boost::shared_ptr<Controllable>
Session::controllable_by_id (const PBD::ID& id)
{
Glib::Mutex::Lock lm (controllables_lock);
-
+
for (Controllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
if ((*i)->id() == id) {
return *i;
@@ -2809,7 +2809,7 @@ Session::controllable_by_id (const PBD::ID& id)
return boost::shared_ptr<Controllable>();
}
-void
+void
Session::add_instant_xml (XMLNode& node, bool write_to_config)
{
if (_writable) {
@@ -2827,22 +2827,22 @@ Session::instant_xml (const string& node_name)
return Stateful::instant_xml (node_name, _path);
}
-int
+int
Session::save_history (string snapshot_name)
{
XMLTree tree;
-
+
if (!_writable) {
return 0;
- }
+ }
- if (snapshot_name.empty()) {
+ if (snapshot_name.empty()) {
snapshot_name = _current_snapshot_name;
}
-
- const string history_filename = legalize_for_path (snapshot_name) + history_suffix;
+
+ const string history_filename = legalize_for_path (snapshot_name) + history_suffix;
const string backup_filename = history_filename + backup_suffix;
- const sys::path xml_path = _session_dir->root_path() / history_filename;
+ const sys::path xml_path = _session_dir->root_path() / history_filename;
const sys::path backup_path = _session_dir->root_path() / backup_filename;
if (sys::exists (xml_path)) {
@@ -2855,13 +2855,13 @@ Session::save_history (string snapshot_name)
error << _("could not backup old history file, current history not saved") << endmsg;
return -1;
}
- }
+ }
if (!Config->get_save_history() || Config->get_saved_history_depth() < 0) {
return 0;
}
- tree.set_root (&_history.get_state (Config->get_saved_history_depth()));
+ tree.set_root (&_history.get_state (Config->get_saved_history_depth()));
if (!tree.write (xml_path.to_string()))
{
@@ -2892,10 +2892,10 @@ Session::restore_history (string snapshot_name)
if (snapshot_name.empty()) {
snapshot_name = _current_snapshot_name;
}
-
+
const string xml_filename = legalize_for_path (snapshot_name) + history_suffix;
const sys::path xml_path = _session_dir->root_path() / xml_filename;
-
+
cerr << "Loading history from " << xml_path.to_string() << endmsg;
if (!sys::exists (xml_path)) {
@@ -2913,67 +2913,67 @@ Session::restore_history (string snapshot_name)
// replace history
_history.clear();
- for (XMLNodeConstIterator it = tree.root()->children().begin(); it != tree.root()->children().end(); it++) {
-
- XMLNode *t = *it;
- UndoTransaction* ut = new UndoTransaction ();
- struct timeval tv;
-
- ut->set_name(t->property("name")->value());
- stringstream ss(t->property("tv-sec")->value());
- ss >> tv.tv_sec;
- ss.str(t->property("tv-usec")->value());
- ss >> tv.tv_usec;
- ut->set_timestamp(tv);
-
- for (XMLNodeConstIterator child_it = t->children().begin();
+ for (XMLNodeConstIterator it = tree.root()->children().begin(); it != tree.root()->children().end(); it++) {
+
+ XMLNode *t = *it;
+ UndoTransaction* ut = new UndoTransaction ();
+ struct timeval tv;
+
+ ut->set_name(t->property("name")->value());
+ stringstream ss(t->property("tv-sec")->value());
+ ss >> tv.tv_sec;
+ ss.str(t->property("tv-usec")->value());
+ ss >> tv.tv_usec;
+ ut->set_timestamp(tv);
+
+ for (XMLNodeConstIterator child_it = t->children().begin();
child_it != t->children().end(); child_it++)
- {
- XMLNode *n = *child_it;
- Command *c;
-
- if (n->name() == "MementoCommand" ||
+ {
+ XMLNode *n = *child_it;
+ Command *c;
+
+ if (n->name() == "MementoCommand" ||
n->name() == "MementoUndoCommand" ||
n->name() == "MementoRedoCommand") {
- if ((c = memento_command_factory(n))) {
- ut->add_command(c);
- }
-
- } else if (n->name() == X_("GlobalRouteStateCommand")) {
-
- if ((c = global_state_command_factory (*n))) {
- ut->add_command (c);
- }
-
- } else if (n->name() == "DeltaCommand") {
- PBD::ID id(n->property("midi-source")->value());
- boost::shared_ptr<MidiSource> midi_source =
- boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
- if(midi_source) {
- ut->add_command(new MidiModel::DeltaCommand(midi_source->model(), *n));
- } else {
- error << "FIXME: Failed to downcast MidiSource for DeltaCommand" << endmsg;
- }
- } else if (n->name() == "DiffCommand") {
- PBD::ID id(n->property("midi-source")->value());
- boost::shared_ptr<MidiSource> midi_source =
- boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
- if(midi_source) {
- ut->add_command(new MidiModel::DiffCommand(midi_source->model(), *n));
- } else {
- error << "FIXME: Failed to downcast MidiSource for DeltaCommand" << endmsg;
- }
-
- } else {
- error << string_compose(_("Couldn't figure out how to make a Command out of a %1 XMLNode."), n->name()) << endmsg;
- }
- }
-
- _history.add (ut);
- }
-
- return 0;
+ if ((c = memento_command_factory(n))) {
+ ut->add_command(c);
+ }
+
+ } else if (n->name() == X_("GlobalRouteStateCommand")) {
+
+ if ((c = global_state_command_factory (*n))) {
+ ut->add_command (c);
+ }
+
+ } else if (n->name() == "DeltaCommand") {
+ PBD::ID id(n->property("midi-source")->value());
+ boost::shared_ptr<MidiSource> midi_source =
+ boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
+ if(midi_source) {
+ ut->add_command(new MidiModel::DeltaCommand(midi_source->model(), *n));
+ } else {
+ error << "FIXME: Failed to downcast MidiSource for DeltaCommand" << endmsg;
+ }
+ } else if (n->name() == "DiffCommand") {
+ PBD::ID id(n->property("midi-source")->value());
+ boost::shared_ptr<MidiSource> midi_source =
+ boost::dynamic_pointer_cast<MidiSource, Source>(source_by_id(id));
+ if(midi_source) {
+ ut->add_command(new MidiModel::DiffCommand(midi_source->model(), *n));
+ } else {
+ error << "FIXME: Failed to downcast MidiSource for DeltaCommand" << endmsg;
+ }
+
+ } else {
+ error << string_compose(_("Couldn't figure out how to make a Command out of a %1 XMLNode."), n->name()) << endmsg;
+ }
+ }
+
+ _history.add (ut);
+ }
+
+ return 0;
}
void
@@ -2982,20 +2982,20 @@ Session::config_changed (std::string p, bool ours)
if (ours) {
set_dirty ();
}
-
+
if (p == "seamless-loop") {
-
+
} else if (p == "rf-speed") {
-
+
} else if (p == "auto-loop") {
-
+
} else if (p == "auto-input") {
-
+
if (Config->get_monitoring_model() == HardwareMonitoring && transport_rolling()) {
/* auto-input only makes a difference if we're rolling */
-
+
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
-
+
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
if ((*i)->record_enabled ()) {
(*i)->monitor_input (!config.get_auto_input());
@@ -3006,22 +3006,22 @@ Session::config_changed (std::string p, bool ours)
} else if (p == "punch-in") {
Location* location;
-
+
if ((location = _locations.auto_punch_location()) != 0) {
-
+
if (config.get_punch_in ()) {
replace_event (Event::PunchIn, location->start());
} else {
remove_event (location->start(), Event::PunchIn);
}
}
-
+
} else if (p == "punch-out") {
Location* location;
-
+
if ((location = _locations.auto_punch_location()) != 0) {
-
+
if (config.get_punch_out()) {
replace_event (Event::PunchOut, location->end());
} else {
@@ -3032,7 +3032,7 @@ Session::config_changed (std::string p, bool ours)
} else if (p == "edit-mode") {
Glib::Mutex::Lock lm (playlist_lock);
-
+
for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
(*i)->set_edit_mode (Config->get_edit_mode ());
}
@@ -3058,7 +3058,7 @@ Session::config_changed (std::string p, bool ours)
}
} else if (p == "midi-control") {
-
+
//poke_midi_thread ();
} else if (p == "raid-path") {
@@ -3104,11 +3104,11 @@ Session::config_changed (std::string p, bool ours)
}
} else if (p == "send-mtc") {
-
+
/* only set the internal flag if we have
a port.
*/
-
+
if (_mtc_port != 0) {
session_send_mtc = Config->get_send_mtc();
if (session_send_mtc) {
@@ -3120,24 +3120,24 @@ Session::config_changed (std::string p, bool ours)
}
} else if (p == "send-mmc") {
-
+
/* only set the internal flag if we have
a port.
*/
-
+
if (_mmc_port != 0) {
session_send_mmc = Config->get_send_mmc();
} else {
mmc = 0;
- session_send_mmc = false;
+ session_send_mmc = false;
}
} else if (p == "midi-feedback") {
-
+
/* only set the internal flag if we have
a port.
*/
-
+
if (_mtc_port != 0) {
session_midi_feedback = Config->get_midi_feedback();
}
@@ -3176,7 +3176,7 @@ Session::config_changed (std::string p, bool ours)
if (_mmc_port && Config->get_initial_program_change() >= 0) {
MIDI::byte buf[2];
-
+
buf[0] = MIDI::program; // channel zero by default
buf[1] = (Config->get_initial_program_change() & 0x7f);
@@ -3186,7 +3186,7 @@ Session::config_changed (std::string p, bool ours)
if (_mmc_port && Config->get_initial_program_change() >= 0) {
MIDI::byte* buf = new MIDI::byte[2];
-
+
buf[0] = MIDI::program; // channel zero by default
buf[1] = (Config->get_initial_program_change() & 0x7f);
// deliver_midi (_mmc_port, buf, 2);
diff --git a/libs/ardour/session_state_utils.cc b/libs/ardour/session_state_utils.cc
index 7f12cb4066..a855072413 100644
--- a/libs/ardour/session_state_utils.cc
+++ b/libs/ardour/session_state_utils.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ get_state_files_in_directory (const sys::path & directory_path,
vector<sys::path> & result)
{
Glib::PatternSpec state_file_pattern('*' + string(statefile_suffix));
-
+
find_matching_files_in_directory (directory_path, state_file_pattern,
result);
}
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index 0363c48339..ae8d07e9ee 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -1,6 +1,6 @@
/*
- Copyright (C) 1999-2002 Paul Davis
+ Copyright (C) 1999-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -57,43 +57,43 @@ float
Session::smpte_frames_per_second() const
{
switch (config.get_smpte_format()) {
- case smpte_23976:
+ case smpte_23976:
return 23.976;
break;
- case smpte_24:
+ case smpte_24:
return 24;
break;
- case smpte_24976:
+ case smpte_24976:
return 24.976;
break;
- case smpte_25:
+ case smpte_25:
return 25;
break;
- case smpte_2997:
+ case smpte_2997:
return 29.97;
break;
- case smpte_2997drop:
+ case smpte_2997drop:
return 29.97;
break;
- case smpte_30:
+ case smpte_30:
return 30;
break;
- case smpte_30drop:
+ case smpte_30drop:
return 30;
break;
- case smpte_5994:
+ case smpte_5994:
return 59.94;
break;
- case smpte_60:
+ case smpte_60:
return 60;
break;
@@ -106,43 +106,43 @@ bool
Session::smpte_drop_frames() const
{
switch (config.get_smpte_format()) {
- case smpte_23976:
+ case smpte_23976:
return false;
break;
- case smpte_24:
+ case smpte_24:
return false;
break;
- case smpte_24976:
+ case smpte_24976:
return false;
break;
- case smpte_25:
+ case smpte_25:
return false;
break;
- case smpte_2997:
+ case smpte_2997:
return false;
break;
- case smpte_2997drop:
+ case smpte_2997drop:
return true;
break;
- case smpte_30:
+ case smpte_30:
return false;
break;
- case smpte_30drop:
+ case smpte_30drop:
return true;
break;
- case smpte_5994:
+ case smpte_5994:
return false;
break;
- case smpte_60:
+ case smpte_60:
return false;
break;
@@ -219,9 +219,9 @@ Session::smpte_to_sample( SMPTE::Time& smpte, nframes_t& sample, bool use_offset
// approx. 0.2 frames too early. This adds up with 0.2 too early for each minute until we are 1.8
// frames too early at 0:9:0:2 (9 * 0.2 = 1.8). The 10th minute brings us 1.8 frames later again
// (at end of 0:9:59:29), which sums up to 0 (we are back to zero at 0:10:0:0 :-).
- //
+ //
// In table form:
- //
+ //
// SMPTE value frames offset subframes offset seconds (rounded) 44100 sample (rounded)
// 0:00:00:00 0.0 0 0.000 0 (accurate)
// 0:00:59:29 1.8 144 60.027 2647177
@@ -257,20 +257,20 @@ Session::smpte_to_sample( SMPTE::Time& smpte, nframes_t& sample, bool use_offset
nframes_t exceeding_samples = (nframes_t) rint(exceeding_df_frames * _frames_per_smpte_frame);
sample = base_samples + exceeding_samples;
} else {
- /*
- Non drop is easy.. just note the use of
+ /*
+ Non drop is easy.. just note the use of
rint(smpte.rate) * _frames_per_smpte_frame
- (frames per SMPTE second), which is larger than
+ (frames per SMPTE second), which is larger than
frame_rate() in the non-integer SMPTE rate case.
*/
sample = (nframes_t)rint((((smpte.hours * 60 * 60) + (smpte.minutes * 60) + smpte.seconds) * (rint(smpte.rate) * _frames_per_smpte_frame)) + (smpte.frames * _frames_per_smpte_frame));
}
-
+
if (use_subframes) {
sample += (long) (((double)smpte.subframes * _frames_per_smpte_frame) / config.get_subframes_per_frame());
}
-
+
if (use_offset) {
if (smpte_offset_negative()) {
if (sample >= smpte_offset()) {
@@ -317,11 +317,11 @@ Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset,
}
}
}
-
+
double smpte_frames_left_exact;
double smpte_frames_fraction;
unsigned long smpte_frames_left;
-
+
// Extract whole hours. Do this to prevent rounding errors with
// high sample numbers in the calculations that follow.
smpte.hours = offset_sample / _frames_per_hour;
@@ -331,7 +331,7 @@ Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset,
smpte_frames_left_exact = (double) offset_sample / _frames_per_smpte_frame;
smpte_frames_fraction = smpte_frames_left_exact - floor( smpte_frames_left_exact );
smpte.subframes = (long) rint(smpte_frames_fraction * config.get_subframes_per_frame());
-
+
// XXX Not sure if this is necessary anymore...
if (smpte.subframes == config.get_subframes_per_frame()) {
// This can happen with 24 fps (and 29.97 fps ?)
@@ -357,7 +357,7 @@ Session::sample_to_smpte( nframes_t sample, SMPTE::Time& smpte, bool use_offset,
exceeding_df_frames -= extra_minutes_minus_1 * 1798; // take away the (extra) minutes just found
smpte.minutes += extra_minutes_minus_1 + 1; // update with exceeding minutes
}
-
+
// Adjust frame numbering for dropped frames (frame 0 and 1 skipped at start of every minute except every 10th)
if (smpte.minutes % 10) {
// Every minute except every 10th
@@ -414,7 +414,7 @@ Session::smpte_time_subframes (nframes_t when, SMPTE::Time& smpte)
smpte = last_smpte;
return;
}
-
+
sample_to_smpte( when, smpte, true /* use_offset */, true /* use_subframes */ );
last_smpte_when = when;
@@ -453,13 +453,13 @@ Session::jack_sync_callback (jack_transport_state_t state,
switch (state) {
case JackTransportStopped:
if (slave && _transport_frame != pos->frame && post_transport_work == 0) {
- request_locate (pos->frame, false);
+ request_locate (pos->frame, false);
// cerr << "SYNC: stopped, locate to " << pos->frame << " from " << _transport_frame << endl;
return false;
} else {
return true;
}
-
+
case JackTransportStarting:
// cerr << "SYNC: starting @ " << pos->frame << " a@ " << _transport_frame << " our work = " << post_transport_work << " pos matches ? " << (_transport_frame == pos->frame) << endl;
if (slave) {
@@ -479,7 +479,7 @@ Session::jack_sync_callback (jack_transport_state_t state,
default:
error << string_compose (_("Unknown JACK transport state %1 in sync callback"), state)
<< endmsg;
- }
+ }
return true;
}
@@ -498,12 +498,12 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/,
pos->valid = JackPositionTimecode;
/* BBT info */
-
+
if (_tempo_map) {
TempoMap::Metric metric (_tempo_map->metric_at (_transport_frame));
_tempo_map->bbt_time_with_metric (_transport_frame, bbt, metric);
-
+
pos->bar = bbt.bars;
pos->beat = bbt.beats;
pos->tick = bbt.ticks;
@@ -559,16 +559,16 @@ Session::jack_timebase_callback (jack_transport_state_t /*state*/,
}
- }
+ }
-#endif
+#endif
}
ARDOUR::nframes_t
Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
{
double secs;
-
+
switch (any.type) {
case AnyTime::BBT:
return _tempo_map->frame_time ( any.bbt);
@@ -580,7 +580,7 @@ Session::convert_to_frames_at (nframes_t /*position*/, AnyTime const & any)
secs += any.smpte.minutes * 60;
secs += any.smpte.seconds;
secs += any.smpte.frames / smpte_frames_per_second();
- if (_smpte_offset_negative)
+ if (_smpte_offset_negative)
{
return (nframes_t) floor (secs * frame_rate()) - _smpte_offset;
}
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index a20856b818..ff36e30743 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -213,7 +213,7 @@ Session::butler_transport_work ()
}
if (post_transport_work & PostTransportReverse) {
-
+
clear_clicks();
cumulative_rf_motion = 0;
reset_rf_scale (0);
@@ -390,7 +390,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
bool const auto_return_enabled =
(Config->get_slave_source() == None && config.get_auto_return());
-
+
if (auto_return_enabled ||
(post_transport_work & PostTransportLocate) ||
(_requested_return_frame >= 0) ||
@@ -442,7 +442,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
#endif
- have_looped = false;
+ have_looped = false;
send_full_time_code (0);
deliver_mmc (MIDI::MachineControl::cmdStop, 0);
@@ -650,7 +650,7 @@ int
Session::micro_locate (nframes_t distance)
{
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
-
+
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
if (!(*i)->can_internal_playback_seek (distance)) {
return -1;
@@ -660,7 +660,7 @@ Session::micro_locate (nframes_t distance)
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
(*i)->internal_playback_seek (distance);
}
-
+
_transport_frame += distance;
return 0;
}
@@ -805,7 +805,7 @@ Session::set_transport_speed (double speed, bool abort)
/* 8.0 max speed is somewhat arbitrary but based on guestimates regarding disk i/o capability
and user needs. We really need CD-style "skip" playback for ffwd and rewind.
*/
-
+
if (speed > 0) {
speed = min (8.0, speed);
} else if (speed < 0) {
@@ -981,7 +981,7 @@ Session::start_transport ()
}
transport_sub_state |= PendingDeclickIn;
-
+
_transport_speed = 1.0;
_target_transport_speed = 1.0;
@@ -1060,9 +1060,9 @@ Session::set_slave_source (SlaveSource src)
return;
}
-// if (src == JACK && Config->get_jack_time_master()) {
-// return;
-// }
+// if (src == JACK && Config->get_jack_time_master()) {
+// return;
+// }
delete _slave;
_slave = 0;
@@ -1251,7 +1251,7 @@ Session::setup_auto_play ()
void
Session::request_roll_at_and_return (nframes_t start, nframes_t return_to)
{
- Event *ev = new Event (Event::LocateRollLocate, Event::Add, Event::Immediate, return_to, 1.0);
+ Event *ev = new Event (Event::LocateRollLocate, Event::Add, Event::Immediate, return_to, 1.0);
ev->target2_frame = start;
queue_event (ev);
}
@@ -1260,7 +1260,7 @@ void
Session::request_bounded_roll (nframes_t start, nframes_t end)
{
request_stop ();
- Event *ev = new Event (Event::StopOnce, Event::Replace, end, Event::Immediate, 0.0);
+ Event *ev = new Event (Event::StopOnce, Event::Replace, end, Event::Immediate, 0.0);
queue_event (ev);
request_locate (start, true);
}
@@ -1338,7 +1338,7 @@ Session::update_latency_compensation (bool with_stop, bool abort)
update_jack = true;
}
- if (!(*i)->is_hidden() && ((*i)->active())) {
+ if (!(*i)->is_hidden() && ((*i)->active())) {
_worst_track_latency = max (_worst_track_latency, track_latency);
}
}
diff --git a/libs/ardour/session_utils.cc b/libs/ardour/session_utils.cc
index d6e7ac20cc..9c367a702f 100644
--- a/libs/ardour/session_utils.cc
+++ b/libs/ardour/session_utils.cc
@@ -8,7 +8,7 @@
namespace ARDOUR {
-using namespace std;
+using namespace std;
using namespace PBD;
bool
diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc
index 3a158a3e73..7f13d3e18b 100644
--- a/libs/ardour/session_vst.cc
+++ b/libs/ardour/session_vst.cc
@@ -54,7 +54,7 @@ long Session::vst_callback (AEffect* effect,
if (debug_callbacks < 0) {
debug_callbacks = (getenv ("ARDOUR_DEBUG_VST_CALLBACKS") != 0);
}
-
+
if (effect && effect->user) {
plug = (VSTPlugin*) (effect->user);
session = &plug->session();
@@ -80,22 +80,22 @@ long Session::vst_callback (AEffect* effect,
// vst version, currently 2 (0 for older)
return 2;
- case audioMasterCurrentId:
+ case audioMasterCurrentId:
SHOW_CALLBACK ("amc: audioMasterCurrentId\n");
// returns the unique id of a plug that's currently
// loading
return 0;
-
+
case audioMasterIdle:
SHOW_CALLBACK ("amc: audioMasterIdle\n");
// call application idle routine (this will
- // call effEditIdle for all open editors too)
+ // call effEditIdle for all open editors too)
if (effect) {
effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
}
return 0;
- case audioMasterPinConnected:
+ case audioMasterPinConnected:
SHOW_CALLBACK ("amc: audioMasterPinConnected\n");
// inquire if an input or output is beeing connected;
// index enumerates input or output counting from zero:
@@ -120,7 +120,7 @@ long Session::vst_callback (AEffect* effect,
_timeInfo.samplePos = session->transport_frame();
_timeInfo.sampleRate = session->frame_rate();
_timeInfo.flags = 0;
-
+
if (value & (kVstTempoValid)) {
const Tempo& t (session->tempo_map().tempo_at (session->transport_frame()));
_timeInfo.tempo = t.beats_per_minute ();
@@ -132,10 +132,10 @@ long Session::vst_callback (AEffect* effect,
_timeInfo.timeSigDenominator = m.note_divisor ();
_timeInfo.flags |= (kVstBarsValid);
}
-
+
if (session->transport_speed() != 0.0f) {
_timeInfo.flags |= kVstTransportPlaying;
- }
+ }
}
return (long)&_timeInfo;
@@ -164,7 +164,7 @@ long Session::vst_callback (AEffect* effect,
SHOW_CALLBACK ("amc: audioMasterGetNumAutomatableParameters\n");
return 0;
- case audioMasterGetParameterQuantization:
+ case audioMasterGetParameterQuantization:
SHOW_CALLBACK ("amc: audioMasterGetParameterQuantization\n");
// returns the integer value for +1.0 representation,
// or 1 if full single float precision is maintained
@@ -234,7 +234,7 @@ long Session::vst_callback (AEffect* effect,
// 4: currently offline processing and thus in user thread
// other: not defined, but probably pre-empting user thread.
return 0;
-
+
case audioMasterGetAutomationState:
SHOW_CALLBACK ("amc: audioMasterGetAutomationState\n");
// returns 0: not supported, 1: off, 2:read, 3:write, 4:read/write
@@ -285,42 +285,42 @@ long Session::vst_callback (AEffect* effect,
SHOW_CALLBACK ("amc: audioMasterGetVendorVersion\n");
// returns vendor-specific version
return 900;
-
+
case audioMasterVendorSpecific:
SHOW_CALLBACK ("amc: audioMasterVendorSpecific\n");
// no definition, vendor specific handling
return 0;
-
+
case audioMasterSetIcon:
SHOW_CALLBACK ("amc: audioMasterSetIcon\n");
// void* in <ptr>, format not defined yet
return 0;
-
+
case audioMasterCanDo:
SHOW_CALLBACK ("amc: audioMasterCanDo\n");
// string in ptr, see below
return 0;
-
+
case audioMasterGetLanguage:
SHOW_CALLBACK ("amc: audioMasterGetLanguage\n");
// see enum
return 0;
-
+
case audioMasterOpenWindow:
SHOW_CALLBACK ("amc: audioMasterOpenWindow\n");
// returns platform specific ptr
return 0;
-
+
case audioMasterCloseWindow:
SHOW_CALLBACK ("amc: audioMasterCloseWindow\n");
// close window, platform specific handle in <ptr>
return 0;
-
+
case audioMasterGetDirectory:
SHOW_CALLBACK ("amc: audioMasterGetDirectory\n");
// get plug directory, FSSpec on MAC, else char*
return 0;
-
+
case audioMasterUpdateDisplay:
SHOW_CALLBACK ("amc: audioMasterUpdateDisplay\n");
// something has changed, update 'multi-fx' display
@@ -328,27 +328,27 @@ long Session::vst_callback (AEffect* effect,
effect->dispatcher(effect, effEditIdle, 0, 0, NULL, 0.0f);
}
return 0;
-
+
case audioMasterBeginEdit:
SHOW_CALLBACK ("amc: audioMasterBeginEdit\n");
// begin of automation session (when mouse down), parameter index in <index>
return 0;
-
+
case audioMasterEndEdit:
SHOW_CALLBACK ("amc: audioMasterEndEdit\n");
// end of automation session (when mouse up), parameter index in <index>
return 0;
-
+
case audioMasterOpenFileSelector:
SHOW_CALLBACK ("amc: audioMasterOpenFileSelector\n");
// open a fileselector window with VstFileSelect* in <ptr>
return 0;
-
+
default:
SHOW_CALLBACK ("VST master dispatcher: undefed: %d\n", opcode);
break;
- }
-
+ }
+
return 0;
}
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index ec47554243..679f244dbe 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
Written by Dave Robillard, 2006
This program is free software; you can redistribute it and/or modify
@@ -60,7 +60,7 @@ SMFSource::SMFSource (Session& s, const ustring& path, bool embedded, Source::Fl
if (init(_name, false)) {
throw failed_constructor ();
}
-
+
if (create(path)) {
throw failed_constructor ();
}
@@ -78,11 +78,11 @@ SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist)
if (set_state(node)) {
throw failed_constructor ();
}
-
+
if (init(_name, true)) {
throw failed_constructor ();
}
-
+
if (open(_path)) {
throw failed_constructor ();
}
@@ -113,7 +113,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
uint8_t* ev_buffer = 0;
size_t scratch_size = 0; // keep track of scratch to minimize reallocs
-
+
BeatsFramesConverter converter(_session, source_start);
const uint64_t start_ticks = (uint64_t)(converter.from(start) * ppqn());
@@ -130,7 +130,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
time += ev_delta_t; // accumulate delta time
}
}
-
+
_smf_last_read_end = start + duration;
while (true) {
@@ -138,13 +138,13 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
if (ret == -1) { // EOF
break;
}
-
+
time += ev_delta_t; // accumulate delta time
if (ret == 0) { // meta-event (skipped, just accumulate time)
continue;
}
-
+
ev_type = EventTypeMap::instance().midi_event_type(ev_buffer[0]);
#if 0
@@ -159,7 +159,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
const sframes_t ev_frame_time = converter.to(time / (double)ppqn()) + stamp_offset;
#if 0
- cerr << " frames = " << ev_frame_time
+ cerr << " frames = " << ev_frame_time
<< " w/offset = " << ev_frame_time - negative_stamp_offset
<< endl;
#endif
@@ -178,7 +178,7 @@ SMFSource::read_unlocked (MidiRingBuffer<nframes_t>& destination, sframes_t sour
}
ev_size = scratch_size; // ensure read_event only allocates if necessary
}
-
+
return duration;
}
@@ -187,14 +187,14 @@ nframes_t
SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position, nframes_t duration)
{
_write_data_count = 0;
-
+
nframes_t time;
Evoral::EventType type;
uint32_t size;
size_t buf_capacity = 4;
uint8_t* buf = (uint8_t*)malloc(buf_capacity);
-
+
if (_model && ! _model->writing()) {
_model->start_write();
}
@@ -223,10 +223,10 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position
cerr << "ERROR: Read time/size but not buffer, corrupt MIDI ring buffer" << endl;
break;
}
-
+
assert(time >= position);
time -= position;
-
+
ev.set(buf, size, time);
ev.set_event_type(EventTypeMap::instance().midi_event_type(ev.buffer()[0]));
if (!(ev.is_channel_event() || ev.is_smf_meta_event() || ev.is_sysex())) {
@@ -234,7 +234,7 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position
<< std::hex << int(ev.buffer()[0]) << endl;
continue;
}
-
+
append_event_unlocked_frames(ev, position);
}
@@ -249,7 +249,7 @@ SMFSource::write_unlocked (MidiRingBuffer<nframes_t>& source, sframes_t position
return duration;
}
-
+
/** Append an event with a timestamp in beats (double) */
void
@@ -260,20 +260,20 @@ SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
}
/*printf("SMFSource: %s - append_event_unlocked_beats time = %lf, size = %u, data = ",
- name().c_str(), ev.time(), ev.size());
+ name().c_str(), ev.time(), ev.size());
for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/
-
+
assert(ev.time() >= 0);
if (ev.time() < _last_ev_time_beats) {
cerr << "SMFSource: Warning: Skipping event with non-monotonic time" << endl;
return;
}
-
+
_length_beats = max(_length_beats, ev.time());
-
+
const double delta_time_beats = ev.time() - _last_ev_time_beats;
const uint32_t delta_time_ticks = (uint32_t)lrint(delta_time_beats * (double)ppqn());
-
+
Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer());
_last_ev_time_beats = ev.time();
@@ -293,18 +293,18 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sfr
}
/*printf("SMFSource: %s - append_event_unlocked_frames time = %u, size = %u, data = ",
- name().c_str(), ev.time(), ev.size());
+ name().c_str(), ev.time(), ev.size());
for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/
-
+
if (ev.time() < _last_ev_time_frames) {
cerr << "SMFSource: Warning: Skipping event with non-monotonic time" << endl;
return;
}
-
+
BeatsFramesConverter converter(_session, position);
-
+
_length_beats = max(_length_beats, converter.from(ev.time()));
-
+
const sframes_t delta_time_frames = ev.time() - _last_ev_time_frames;
const double delta_time_beats = converter.from(delta_time_frames);
const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn()));
@@ -338,7 +338,7 @@ SMFSource::set_state (const XMLNode& node)
if (MidiSource::set_state (node)) {
return -1;
}
-
+
if (FileSource::set_state (node)) {
return -1;
}
@@ -363,7 +363,7 @@ SMFSource::mark_streaming_write_completed ()
if (!writable()) {
return;
}
-
+
_model->set_edited(false);
Evoral::SMF::end_write ();
}
@@ -380,7 +380,7 @@ SMFSource::load_model (bool lock, bool force_reload)
if (_writing) {
return;
}
-
+
if (lock) {
Glib::Mutex::Lock lm (_lock);
}
@@ -403,9 +403,9 @@ SMFSource::load_model (bool lock, bool force_reload)
uint64_t time = 0; /* in SMF ticks */
Evoral::Event<double> ev;
-
+
size_t scratch_size = 0; // keep track of scratch and minimize reallocs
-
+
uint32_t delta_t = 0;
uint32_t size = 0;
uint8_t* buf = NULL;
@@ -423,12 +423,12 @@ SMFSource::load_model (bool lock, bool force_reload)
scratch_size = ev.size();
}
ev.size() = scratch_size; // ensure read_event only allocates if necessary
-
+
_length_beats = max(_length_beats, ev.time());
}
set_default_controls_interpolation();
-
+
_model->end_write(false);
_model->set_edited(false);
diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc
index 56259f0812..057efff48c 100644
--- a/libs/ardour/sndfile_helpers.cc
+++ b/libs/ardour/sndfile_helpers.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 Paul Davis
+ Copyright (C) 2000-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -125,7 +125,7 @@ sndfile_endian_format_from_string (string str)
string
sndfile_file_ending_from_string (string str)
-{
+{
static vector<string> file_endings;
if (file_endings.empty()) {
@@ -163,7 +163,7 @@ sndfile_data_width (int format)
}
}
-string
+string
sndfile_major_format(int format)
{
static map<int, string> m;
@@ -174,12 +174,12 @@ sndfile_major_format(int format)
sf_command(0, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int));
for (int i = 0; i < count; ++i){
format_info.format = i;
- sf_command (0, SFC_GET_FORMAT_MAJOR,
+ sf_command (0, SFC_GET_FORMAT_MAJOR,
&format_info, sizeof (format_info));
m[format_info.format & SF_FORMAT_TYPEMASK] = format_info.name;
}
}
-
+
map<int, string>::iterator p = m.find(format & SF_FORMAT_TYPEMASK);
if(p != m.end()){
return m[format & SF_FORMAT_TYPEMASK];
@@ -199,12 +199,12 @@ sndfile_minor_format(int format)
sf_command(0, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int));
for (int i = 0; i < count; ++i){
format_info.format = i;
- sf_command (0, SFC_GET_FORMAT_SUBTYPE,
+ sf_command (0, SFC_GET_FORMAT_SUBTYPE,
&format_info, sizeof (format_info));
m[format_info.format & SF_FORMAT_SUBMASK] = format_info.name;
}
}
-
+
map<int, string>::iterator p = m.find(format & SF_FORMAT_SUBMASK);
if(p != m.end()){
return m[format & SF_FORMAT_SUBMASK];
diff --git a/libs/ardour/sndfileimportable.cc b/libs/ardour/sndfileimportable.cc
index d741dd008b..cc68f3ea01 100644
--- a/libs/ardour/sndfileimportable.cc
+++ b/libs/ardour/sndfileimportable.cc
@@ -13,8 +13,8 @@ SndFileImportableSource::get_timecode_info (SNDFILE* sf, SF_BROADCAST_INFO* binf
if (sf_command (sf, SFC_GET_BROADCAST_INFO, binfo, sizeof (*binfo)) != SF_TRUE) {
exists = false;
return 0;
- }
-
+ }
+
exists = true;
int64_t ret = (uint32_t) binfo->time_reference_high;
ret <<= 32;
@@ -27,13 +27,13 @@ SndFileImportableSource::SndFileImportableSource (const string& path)
memset(&sf_info, 0 , sizeof(sf_info));
in.reset( sf_open(path.c_str(), SFM_READ, &sf_info), sf_close);
if (!in) throw failed_constructor();
-
+
SF_BROADCAST_INFO binfo;
bool timecode_exists;
memset (&binfo, 0, sizeof (binfo));
timecode = get_timecode_info (in.get(), &binfo, timecode_exists);
-
+
if (!timecode_exists) {
timecode = 0;
}
@@ -44,7 +44,7 @@ SndFileImportableSource::~SndFileImportableSource ()
}
nframes_t
-SndFileImportableSource::read (Sample* buffer, nframes_t nframes)
+SndFileImportableSource::read (Sample* buffer, nframes_t nframes)
{
nframes_t per_channel = nframes / sf_info.channels;
per_channel = sf_readf_float (in.get(), buffer, per_channel);
@@ -52,13 +52,13 @@ SndFileImportableSource::read (Sample* buffer, nframes_t nframes)
}
uint
-SndFileImportableSource::channels () const
+SndFileImportableSource::channels () const
{
return sf_info.channels;
}
nframes_t
-SndFileImportableSource::length () const
+SndFileImportableSource::length () const
{
return sf_info.frames;
}
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index f84c0ae14b..1b8b01b85a 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -139,7 +139,7 @@ SndFileSource::SndFileSource (Session& s, const ustring& path, bool embedded,
fmt |= SF_FORMAT_PCM_16;
break;
}
-
+
_info.channels = 1;
_info.samplerate = rate;
_info.format = fmt;
@@ -168,7 +168,7 @@ SndFileSource::SndFileSource (Session& s, const ustring& path, bool embedded,
}
}
-void
+void
SndFileSource::init_sndfile ()
{
ustring file;
@@ -194,7 +194,7 @@ SndFileSource::init_sndfile ()
_capture_end = false;
file_pos = 0;
- if (destructive()) {
+ if (destructive()) {
xfade_buf = new Sample[xfade_frames];
_timeline_position = header_position_offset;
}
@@ -214,7 +214,7 @@ SndFileSource::open ()
so we don't want to see this message.
*/
- error << string_compose(_("SndFileSource: cannot open file \"%1\" for %2 (%3)"),
+ error << string_compose(_("SndFileSource: cannot open file \"%1\" for %2 (%3)"),
_path, (writable() ? "read+write" : "reading"), errbuf) << endmsg;
#endif
return -1;
@@ -234,7 +234,7 @@ SndFileSource::open ()
if (!_broadcast_info) {
_broadcast_info = new BroadcastInfo;
}
-
+
bool bwf_info_exists = _broadcast_info->load_from_file (sf);
set_timeline_position (bwf_info_exists ? _broadcast_info->get_time_reference() : header_position_offset);
@@ -274,7 +274,7 @@ SndFileSource::~SndFileSource ()
}
float
-SndFileSource::sample_rate () const
+SndFileSource::sample_rate () const
{
return _info.samplerate;
}
@@ -290,22 +290,22 @@ SndFileSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
if (start > _length) {
/* read starts beyond end of data, just memset to zero */
-
+
file_cnt = 0;
} else if (start + cnt > _length) {
-
+
/* read ends beyond end of data, read some, memset the rest */
-
+
file_cnt = _length - start;
} else {
-
+
/* read is entirely within data */
file_cnt = cnt;
}
-
+
if (file_cnt != cnt) {
nframes_t delta = cnt - file_cnt;
memset (dst+file_cnt, 0, sizeof (Sample) * delta);
@@ -319,7 +319,7 @@ SndFileSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
error << string_compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.substr (1), errbuf) << endmsg;
return 0;
}
-
+
if (_info.channels == 1) {
nframes_t ret = sf_read_float (sf, dst, file_cnt);
_read_data_count = ret * sizeof(float);
@@ -335,24 +335,24 @@ SndFileSource::read_unlocked (Sample *dst, sframes_t start, nframes_t cnt) const
real_cnt = cnt * _info.channels;
Sample* interleave_buf = get_interleave_buffer (real_cnt);
-
+
nread = sf_read_float (sf, interleave_buf, real_cnt);
ptr = interleave_buf + _channel;
nread /= _info.channels;
-
+
/* stride through the interleaved data */
-
+
for (int32_t n = 0; n < nread; ++n) {
dst[n] = *ptr;
ptr += _info.channels;
}
_read_data_count = cnt * sizeof(float);
-
+
return nread;
}
-nframes_t
+nframes_t
SndFileSource::write_unlocked (Sample *data, nframes_t cnt)
{
if (destructive()) {
@@ -362,7 +362,7 @@ SndFileSource::write_unlocked (Sample *data, nframes_t cnt)
}
}
-nframes_t
+nframes_t
SndFileSource::nondestructive_write_unlocked (Sample *data, nframes_t cnt)
{
if (!writable()) {
@@ -375,7 +375,7 @@ SndFileSource::nondestructive_write_unlocked (Sample *data, nframes_t cnt)
/*NOTREACHED*/
return 0;
}
-
+
nframes_t oldlen;
int32_t frame_pos = _length;
@@ -413,28 +413,28 @@ SndFileSource::destructive_write_unlocked (Sample* data, nframes_t cnt)
_capture_start = false;
_capture_end = false;
-
+
/* move to the correct location place */
file_pos = capture_start_frame - _timeline_position;
-
+
// split cnt in half
nframes_t subcnt = cnt / 2;
nframes_t ofilepos = file_pos;
-
+
// fade in
if (crossfade (data, subcnt, 1) != subcnt) {
return 0;
}
-
+
file_pos += subcnt;
Sample * tmpdata = data + subcnt;
-
+
// fade out
subcnt = cnt - subcnt;
if (crossfade (tmpdata, subcnt, 0) != subcnt) {
return 0;
}
-
+
file_pos = ofilepos; // adjusted below
} else if (_capture_start) {
@@ -445,14 +445,14 @@ SndFileSource::destructive_write_unlocked (Sample* data, nframes_t cnt)
_capture_start = false;
_capture_end = false;
-
+
/* move to the correct location place */
file_pos = capture_start_frame - _timeline_position;
if (crossfade (data, cnt, 1) != cnt) {
return 0;
}
-
+
} else if (_capture_end) {
/* end of capture both occur within the data we are writing,
@@ -461,7 +461,7 @@ SndFileSource::destructive_write_unlocked (Sample* data, nframes_t cnt)
_capture_start = false;
_capture_end = false;
-
+
if (crossfade (data, cnt, 0) != cnt) {
return 0;
}
@@ -483,20 +483,20 @@ SndFileSource::destructive_write_unlocked (Sample* data, nframes_t cnt)
}
file_pos += cnt;
-
+
return cnt;
}
int
SndFileSource::update_header (sframes_t when, struct tm& now, time_t tnow)
-{
+{
set_timeline_position (when);
if (_flags & Broadcast) {
if (setup_broadcast_info (when, now, tnow)) {
return -1;
}
- }
+ }
return flush_header ();
}
@@ -525,9 +525,9 @@ SndFileSource::setup_broadcast_info (sframes_t /*when*/, struct tm& now, time_t
_broadcast_info->set_originator_ref (_session);
_broadcast_info->set_origination_time (&now);
-
+
/* now update header position taking header offset into account */
-
+
set_header_timeline_position ();
if (!_broadcast_info->write_to_file (sf)) {
@@ -570,11 +570,11 @@ SndFileSource::write_float (Sample* data, sframes_t frame_pos, nframes_t cnt)
error << string_compose (_("%1: cannot seek to %2 (libsndfile error: %3"), _path, frame_pos, errbuf) << endmsg;
return 0;
}
-
+
if (sf_writef_float (sf, data, cnt) != (ssize_t) cnt) {
return 0;
}
-
+
return cnt;
}
@@ -608,7 +608,7 @@ SndFileSource::clear_capture_marks ()
{
_capture_start = false;
_capture_end = false;
-}
+}
void
SndFileSource::mark_capture_start (sframes_t pos)
@@ -650,26 +650,26 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
}
if (fade_position > _length) {
-
+
/* read starts beyond end of data, just memset to zero */
-
+
file_cnt = 0;
} else if (fade_position + xfade > _length) {
-
+
/* read ends beyond end of data, read some, memset the rest */
-
+
file_cnt = _length - fade_position;
} else {
-
+
/* read is entirely within data */
file_cnt = xfade;
}
if (file_cnt) {
-
+
if ((retval = read_unlocked (xfade_buf, fade_position, file_cnt)) != (ssize_t) file_cnt) {
if (retval >= 0 && errno == EAGAIN) {
/* XXX - can we really trust that errno is meaningful here? yes POSIX, i'm talking to you.
@@ -680,13 +680,13 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
return 0;
}
}
- }
+ }
if (file_cnt != xfade) {
nframes_t delta = xfade - file_cnt;
memset (xfade_buf+file_cnt, 0, sizeof (Sample) * delta);
}
-
+
if (nofade && !fade_in) {
if (write_float (data, file_pos, nofade) != nofade) {
error << string_compose(_("SndFileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
@@ -699,11 +699,11 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
nframes_t n;
/* use the standard xfade curve */
-
+
if (fade_in) {
/* fade new material in */
-
+
for (n = 0; n < xfade; ++n) {
xfade_buf[n] = (xfade_buf[n] * out_coefficient[n]) + (fade_data[n] * in_coefficient[n]);
}
@@ -712,7 +712,7 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
/* fade new material out */
-
+
for (n = 0; n < xfade; ++n) {
xfade_buf[n] = (xfade_buf[n] * in_coefficient[n]) + (fade_data[n] * out_coefficient[n]);
}
@@ -728,7 +728,7 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
compute_equal_power_fades (xfade, in, out);
for (nframes_t n = 0; n < xfade; ++n) {
- xfade_buf[n] = (xfade_buf[n] * out[n]) + (fade_data[n] * in[n]);
+ xfade_buf[n] = (xfade_buf[n] * out[n]) + (fade_data[n] * in[n]);
}
} else if (xfade) {
@@ -743,7 +743,7 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
return 0;
}
}
-
+
if (fade_in && nofade) {
if (write_float (data + xfade, file_pos + xfade, nofade) != nofade) {
error << string_compose(_("SndFileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
@@ -800,12 +800,12 @@ void
SndFileSource::set_timeline_position (int64_t pos)
{
// destructive track timeline postion does not change
- // except at instantion or when header_position_offset
+ // except at instantion or when header_position_offset
// (session start) changes
if (!destructive()) {
AudioFileSource::set_timeline_position (pos);
- }
+ }
}
int
@@ -817,7 +817,7 @@ SndFileSource::get_soundfile_info (const ustring& path, SoundFileInfo& info, str
sf_info.format = 0; // libsndfile says to clear this before sf_open().
- if ((sf = sf_open ((char*) path.c_str(), SFM_READ, &sf_info)) == 0) {
+ if ((sf = sf_open ((char*) path.c_str(), SFM_READ, &sf_info)) == 0) {
char errbuf[256];
error_msg = sf_error_str (0, errbuf, sizeof (errbuf) - 1);
return false;
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index d7002f2fe1..45cd1fb904 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000 Paul Davis
+ Copyright (C) 2000 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ Source::Source (Session& s, DataType type, const string& name, Flag flags)
fix_writable_flags ();
}
-Source::Source (Session& s, const XMLNode& node)
+Source::Source (Session& s, const XMLNode& node)
: SessionObject(s, "unnamed source")
, _type(DataType::AUDIO)
, _flags (Flag (Writable|CanRename))
@@ -119,7 +119,7 @@ Source::set_state (const XMLNode& node)
} else {
return -1;
}
-
+
if ((prop = node.property ("id")) != 0) {
_id = prop->value ();
} else {
@@ -133,14 +133,14 @@ Source::set_state (const XMLNode& node)
if ((prop = node.property ("timestamp")) != 0) {
sscanf (prop->value().c_str(), "%ld", &_timestamp);
}
-
+
if ((prop = node.property (X_("flags"))) != 0) {
_flags = Flag (string_2_enum (prop->value(), _flags));
} else {
_flags = Flag (0);
}
-
+
/* old style, from the period when we had DestructiveFileSource */
if ((prop = node.property (X_("destructive"))) != 0) {
_flags = Flag (_flags | Destructive);
@@ -162,7 +162,7 @@ Source::add_playlist (boost::shared_ptr<Playlist> pl)
/* it already existed, bump count */
res.first->second++;
}
-
+
pl->GoingAway.connect (bind (
mem_fun (*this, &Source::remove_playlist),
boost::weak_ptr<Playlist> (pl)));
@@ -209,7 +209,7 @@ Source::set_been_analysed (bool yn)
Glib::Mutex::Lock lm (_analysis_lock);
_analysed = yn;
}
-
+
if (yn) {
load_transients (get_transients_path());
AnalysisChanged(); // EMIT SIGNAL
@@ -224,7 +224,7 @@ Source::load_transients (const string& path)
if (!file) {
return -1;
}
-
+
transients.clear ();
stringstream strstr;
@@ -242,14 +242,14 @@ Source::load_transients (const string& path)
return 0;
}
-string
+string
Source::get_transients_path () const
{
vector<string> parts;
string s;
/* old sessions may not have the analysis directory */
-
+
_session.ensure_subdirs ();
s = _session.analysis_dir ();
@@ -259,12 +259,12 @@ Source::get_transients_path () const
s += '.';
s += TransientDetector::operational_identifier();
parts.push_back (s);
-
+
return Glib::build_filename (parts);
}
bool
-Source::check_for_analysis_data_on_disk ()
+Source::check_for_analysis_data_on_disk ()
{
/* looks to see if the analysis files for this source are on disk.
if so, mark us already analysed.
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index 2438d5f6f9..a0aa24a2d0 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2006 Paul Davis
+ Copyright (C) 2000-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -54,7 +54,7 @@ Glib::Cond* SourceFactory::PeaksToBuild;
Glib::StaticMutex SourceFactory::peak_building_lock = GLIBMM_STATIC_MUTEX_INIT;
std::list<boost::weak_ptr<AudioSource> > SourceFactory::files_with_peaks;
-static void
+static void
peak_thread_work ()
{
PBD::notify_gui_about_thread_creation (pthread_self(), string ("peakbuilder-") + to_string (pthread_self(), std::dec));
@@ -62,7 +62,7 @@ peak_thread_work ()
while (true) {
SourceFactory::peak_building_lock.lock ();
-
+
wait:
if (SourceFactory::files_with_peaks.empty()) {
SourceFactory::PeaksToBuild->wait (SourceFactory::peak_building_lock);
@@ -75,7 +75,7 @@ peak_thread_work ()
boost::shared_ptr<AudioSource> as (SourceFactory::files_with_peaks.front().lock());
SourceFactory::files_with_peaks.pop_front ();
SourceFactory::peak_building_lock.unlock ();
-
+
if (!as) {
continue;
}
@@ -143,7 +143,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
if (type == DataType::AUDIO) {
try {
-
+
boost::shared_ptr<Source> ret (new SndFileSource (s, node));
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
@@ -151,25 +151,25 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
ret->check_for_analysis_data_on_disk ();
SourceCreated (ret);
return ret;
- }
-
+ }
+
catch (failed_constructor& err) {
#ifdef USE_COREAUDIO_FOR_FILES
-
+
/* this is allowed to throw */
-
+
boost::shared_ptr<Source> ret (new CoreAudioSource (s, node));
-
+
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
-
+
ret->check_for_analysis_data_on_disk ();
SourceCreated (ret);
return ret;
#else
- throw; // rethrow
+ throw; // rethrow
#endif
}
@@ -190,25 +190,25 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo
if (type == DataType::AUDIO) {
if (!(flags & Destructive)) {
-
+
try {
-
+
boost::shared_ptr<Source> ret (new SndFileSource (s, path, embedded, chn, flags));
-
+
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
-
+
ret->check_for_analysis_data_on_disk ();
if (announce) {
SourceCreated (ret);
}
return ret;
}
-
+
catch (failed_constructor& err) {
#ifdef USE_COREAUDIO_FOR_FILES
-
+
boost::shared_ptr<Source> ret (new CoreAudioSource (s, path, embedded, chn, flags));
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
@@ -218,7 +218,7 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo
SourceCreated (ret);
}
return ret;
-
+
#else
throw; // rethrow
#endif
@@ -227,11 +227,11 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo
} else {
// eh?
}
-
+
} else if (type == DataType::MIDI) {
-
+
boost::shared_ptr<Source> ret (new SMFSource (s, path, embedded, SMFSource::Flag(0)));
-
+
if (announce) {
SourceCreated (ret);
}
@@ -248,20 +248,20 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat
bool destructive, nframes_t rate, bool announce, bool defer_peaks)
{
/* this might throw failed_constructor(), which is OK */
-
+
if (type == DataType::AUDIO) {
boost::shared_ptr<Source> ret (new SndFileSource (s, path, embedded,
s.config.get_native_file_data_format(),
s.config.get_native_file_header_format(),
rate,
(destructive
- ? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive)
- : SndFileSource::default_writable_flags)));
+ ? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive)
+ : SndFileSource::default_writable_flags)));
if (setup_peakfile (ret, defer_peaks)) {
return boost::shared_ptr<Source>();
}
-
+
// no analysis data - this is a new file
if (announce) {
@@ -272,9 +272,9 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat
} else if (type == DataType::MIDI) {
boost::shared_ptr<Source> ret (new SMFSource (s, path, embedded, Source::Flag(0)));
-
+
// no analysis data - this is a new file
-
+
if (announce) {
SourceCreated (ret);
}
diff --git a/libs/ardour/sse_functions_xmm.cc b/libs/ardour/sse_functions_xmm.cc
index dede02303c..c20dbb4e27 100644
--- a/libs/ardour/sse_functions_xmm.cc
+++ b/libs/ardour/sse_functions_xmm.cc
@@ -1,6 +1,6 @@
/*
Copyright (C) 2007 Paul sDavis
- Written by Sampo Savolainen
+ Written by Sampo Savolainen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, nframes_t nframes, float *min, flo
current_min = _mm_min_ps(current_min, work);
current_max = _mm_max_ps(current_max, work);
-
+
buf++;
nframes--;
}
@@ -77,7 +77,7 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, nframes_t nframes, float *min, flo
buf+=4;
nframes-=4;
}
-
+
// work through the rest < 4 samples
while ( nframes > 0) {
@@ -86,7 +86,7 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, nframes_t nframes, float *min, flo
current_min = _mm_min_ps(current_min, work);
current_max = _mm_max_ps(current_max, work);
-
+
buf++;
nframes--;
}
diff --git a/libs/ardour/st_pitch.cc b/libs/ardour/st_pitch.cc
index 6138249e61..307a41cbf7 100644
--- a/libs/ardour/st_pitch.cc
+++ b/libs/ardour/st_pitch.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004-2007 Paul Davis
+ Copyright (C) 2004-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc
index 5adf8ad6d1..369ed95279 100644
--- a/libs/ardour/st_stretch.cc
+++ b/libs/ardour/st_stretch.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004-2007 Paul Davis
+ Copyright (C) 2004-2007 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,8 +41,8 @@ STStretch::STStretch (Session& s, TimeFXRequest& req)
{
float percentage;
- /* the soundtouch code wants a *tempo* change percentage, which is
- of opposite sign to the length change.
+ /* the soundtouch code wants a *tempo* change percentage, which is
+ of opposite sign to the length change.
*/
percentage = -tsr.time_fraction;
@@ -52,7 +52,7 @@ STStretch::STStretch (Session& s, TimeFXRequest& req)
st.setTempoChange (percentage);
st.setPitchSemiTones (0);
st.setRateChange (0);
-
+
st.setSetting(SETTING_USE_QUICKSEEK, tsr.quick_seek);
st.setSetting(SETTING_USE_AA_FILTER, tsr.antialias);
@@ -79,7 +79,7 @@ STStretch::run (boost::shared_ptr<Region> a_region)
tsr.progress = 0.0f;
tsr.done = false;
-
+
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(a_region);
total_frames = region->length() * region->n_channels();
@@ -88,11 +88,11 @@ STStretch::run (boost::shared_ptr<Region> a_region)
/* the name doesn't need to be super-precise, but allow for 2 fractional
digits just to disambiguate close but not identical stretches.
*/
-
+
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (tsr.time_fraction * 100.0f));
/* create new sources */
-
+
if (make_new_sources (region, nsrcs, suffix)) {
goto out;
}
@@ -115,26 +115,26 @@ STStretch::run (boost::shared_ptr<Region> a_region)
while (!tsr.cancel && pos < region->length()) {
nframes_t this_time;
-
+
this_time = min (bufsize, region->length() - pos);
- /* read from the master (original) sources for the region,
- not the ones currently in use, in case it's already been
- subject to timefx.
+ /* read from the master (original) sources for the region,
+ not the ones currently in use, in case it's already been
+ subject to timefx.
*/
if ((this_read = region->master_read_at (buffer, buffer, gain_buffer, pos + region->position(), this_time)) != this_time) {
error << string_compose (_("tempoize: error reading data from %1"), asrc->name()) << endmsg;
goto out;
}
-
+
pos += this_read;
done += this_read;
tsr.progress = (float) done / total_frames;
-
+
st.putSamples (buffer, this_read);
-
+
while ((this_read = st.receiveSamples (buffer, bufsize)) > 0 && !tsr.cancel) {
if (asrc->write (buffer, this_read) != this_read) {
error << string_compose (_("error writing tempo-adjusted data to %1"), asrc->name()) << endmsg;
@@ -142,11 +142,11 @@ STStretch::run (boost::shared_ptr<Region> a_region)
}
}
}
-
+
if (!tsr.cancel) {
st.flush ();
}
-
+
while (!tsr.cancel && (this_read = st.receiveSamples (buffer, bufsize)) > 0) {
if (asrc->write (buffer, this_read) != this_read) {
error << string_compose (_("error writing tempo-adjusted data to %1"), asrc->name()) << endmsg;
@@ -182,7 +182,7 @@ STStretch::run (boost::shared_ptr<Region> a_region)
nframes_t start;
nframes_t length;
- // note: tsr.fraction is a percentage of original length. 100 = no change,
+ // note: tsr.fraction is a percentage of original length. 100 = no change,
// 50 is half as long, 200 is twice as long, etc.
float stretch = (*x)->stretch() * (tsr.time_fraction/100.0);
@@ -203,7 +203,7 @@ STStretch::run (boost::shared_ptr<Region> a_region)
(*si)->mark_for_remove ();
}
}
-
+
tsr.done = true;
return ret;
diff --git a/libs/ardour/strip_silence.cc b/libs/ardour/strip_silence.cc
index dbb36735dd..256e06eccf 100644
--- a/libs/ardour/strip_silence.cc
+++ b/libs/ardour/strip_silence.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2009 Paul Davis
+ Copyright (C) 2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ using namespace ARDOUR;
* @param minimum_length Minimum length of silence period to recognise, in samples.
* @param fade_length Length of fade in/out to apply to trimmed regions, in samples.
*/
-
+
StripSilence::StripSilence (Session & s, double threshold, nframes_t minimum_length, nframes_t fade_length)
: Filter (s), _threshold (threshold), _minimum_length (minimum_length), _fade_length (fade_length)
{
@@ -42,7 +42,7 @@ int
StripSilence::run (boost::shared_ptr<Region> r)
{
results.clear ();
-
+
/* we only operate on AudioRegions, for now, though this could be adapted to MIDI
as well I guess */
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r);
@@ -75,7 +75,7 @@ StripSilence::run (boost::shared_ptr<Region> r)
region->set_name (session.new_region_name (region->name ()));
boost::shared_ptr<AudioRegion> last_region = region;
results.push_back (region);
-
+
if (s->first == 0) {
/* the region starts with some silence */
@@ -83,7 +83,7 @@ StripSilence::run (boost::shared_ptr<Region> r)
** to set_start will fail */
region->set_length (region->length() - s->second + _fade_length, 0);
region->set_start (start + s->second - _fade_length, 0);
- region->set_position (pos + s->second - _fade_length, 0);
+ region->set_position (pos + s->second - _fade_length, 0);
region->set_fade_in_active (true);
region->set_fade_in (AudioRegion::Linear, _fade_length);
s++;
diff --git a/libs/ardour/tape_file_matcher.cc b/libs/ardour/tape_file_matcher.cc
index bedb7e629b..0f8594d731 100644
--- a/libs/ardour/tape_file_matcher.cc
+++ b/libs/ardour/tape_file_matcher.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007 Tim Mayberry
+ Copyright (C) 2007 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,9 +40,9 @@ TapeFileMatcher::TapeFileMatcher()
tape_file_regex_string, REG_EXTENDED|REG_NOSUB)))
{
char msg[256];
-
+
regerror (err, &m_compiled_pattern, msg, sizeof (msg));
-
+
PBD::error << string_compose (_("Cannot compile tape track regexp for use (%1)"), msg) << endmsg;
// throw
}
diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc
index a0daca713d..aa0a583af4 100644
--- a/libs/ardour/template_utils.cc
+++ b/libs/ardour/template_utils.cc
@@ -80,14 +80,14 @@ find_session_templates (vector<TemplateInfo>& template_names)
spath += user_template_directory ();
templates = scanner (spath.to_string(), template_filter, 0, false, true);
-
+
if (!templates) {
cerr << "Found nothing along " << spath.to_string() << endl;
return;
}
cerr << "Found " << templates->size() << " along " << spath.to_string() << endl;
-
+
for (vector<string*>::iterator i = templates->begin(); i != templates->end(); ++i) {
string fullpath = *(*i);
@@ -117,11 +117,11 @@ find_route_templates (vector<TemplateInfo>& template_names)
spath += user_route_template_directory ();
templates = scanner (spath.to_string(), template_filter, 0, false, true);
-
+
if (!templates) {
return;
}
-
+
for (vector<string*>::iterator i = templates->begin(); i != templates->end(); ++i) {
string fullpath = *(*i);
@@ -132,7 +132,7 @@ find_route_templates (vector<TemplateInfo>& template_names)
}
XMLNode* root = tree.root();
-
+
TemplateInfo rti;
rti.name = IO::name_from_state (*root->children().front());
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 2ee0e456fc..623dd21627 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2002 Paul Davis
+ Copyright (C) 2000-2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -91,7 +91,7 @@ TempoSection::TempoSection (const XMLNode& node)
error << _("TempoSection XML node has an illegal \"beats_per_minute\" value") << endmsg;
throw failed_constructor();
}
-
+
if ((prop = node.property ("note-type")) == 0) {
/* older session, make note type be quarter by default */
_note_type = 4.0;
@@ -117,7 +117,7 @@ TempoSection::get_state() const
char buf[256];
LocaleGuard lg (X_("POSIX"));
- snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
+ snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
start().bars,
start().beats,
start().ticks);
@@ -172,7 +172,7 @@ MeterSection::MeterSection (const XMLNode& node)
error << _("MeterSection XML node has no \"note-type\" property") << endmsg;
throw failed_constructor();
}
-
+
if (sscanf (prop->value().c_str(), "%lf", &_note_type) != 1 || _note_type < 0.0) {
error << _("MeterSection XML node has an illegal \"note-type\" value") << endmsg;
throw failed_constructor();
@@ -193,7 +193,7 @@ MeterSection::get_state() const
char buf[256];
LocaleGuard lg (X_("POSIX"));
- snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
+ snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
start().bars,
start().beats,
start().ticks);
@@ -222,7 +222,7 @@ TempoMap::TempoMap (nframes_t fr)
_frame_rate = fr;
last_bbt_valid = false;
BBT_Time start;
-
+
start.bars = 1;
start.beats = 1;
start.ticks = 0;
@@ -234,7 +234,7 @@ TempoMap::TempoMap (nframes_t fr)
m->set_movable (false);
/* note: frame time is correct (zero) for both of these */
-
+
metrics->push_back (t);
metrics->push_back (m);
}
@@ -262,7 +262,7 @@ TempoMap::move_metric_section (MetricSection& section, const BBT_Time& when)
nframes_t prev_frame = round_to_type (frame, -1, Beat);
nframes_t next_frame = round_to_type (frame, 1, Beat);
-
+
// cerr << "previous beat at " << prev_frame << " next at " << next_frame << endl;
/* use the closest beat */
@@ -272,7 +272,7 @@ TempoMap::move_metric_section (MetricSection& section, const BBT_Time& when)
} else {
frame = next_frame;
}
-
+
// cerr << "actual frame time = " << frame << endl;
section.set_frame (frame);
// cerr << "frame time = " << section.frame() << endl;
@@ -369,7 +369,7 @@ TempoMap::do_insert (MetricSection* section, bool with_bbt)
Metrics::iterator i;
for (i = metrics->begin(); i != metrics->end(); ++i) {
-
+
if (with_bbt) {
if ((*i)->start() < section->start()) {
continue;
@@ -377,19 +377,19 @@ TempoMap::do_insert (MetricSection* section, bool with_bbt)
} else {
if ((*i)->frame() < section->frame()) {
continue;
- }
+ }
}
metrics->insert (i, section);
break;
}
-
+
if (i == metrics->end()) {
metrics->insert (metrics->end(), section);
}
-
+
timestamp_metrics (with_bbt);
-}
+}
void
TempoMap::add_tempo (const Tempo& tempo, BBT_Time where)
@@ -398,9 +398,9 @@ TempoMap::add_tempo (const Tempo& tempo, BBT_Time where)
Glib::RWLock::WriterLock lm (lock);
/* new tempos always start on a beat */
-
+
where.ticks = 0;
-
+
do_insert (new TempoSection (where, tempo.beats_per_minute(), tempo.note_type()), true);
}
@@ -423,10 +423,10 @@ TempoMap::replace_tempo (TempoSection& existing, const Tempo& replacement)
{
bool replaced = false;
- {
+ {
Glib::RWLock::WriterLock lm (lock);
Metrics::iterator i;
-
+
for (i = metrics->begin(); i != metrics->end(); ++i) {
TempoSection *ts;
@@ -441,7 +441,7 @@ TempoMap::replace_tempo (TempoSection& existing, const Tempo& replacement)
}
}
}
-
+
if (replaced) {
StateChanged (Change (0));
}
@@ -466,7 +466,7 @@ TempoMap::add_meter (const Meter& meter, BBT_Time where)
}
/* new meters *always* start on a beat. */
-
+
where.ticks = 0;
do_insert (new MeterSection (where, meter.beats_per_bar(), meter.note_divisor()), true);
@@ -491,14 +491,14 @@ TempoMap::replace_meter (MeterSection& existing, const Meter& replacement)
{
bool replaced = false;
- {
+ {
Glib::RWLock::WriterLock lm (lock);
Metrics::iterator i;
-
+
for (i = metrics->begin(); i != metrics->end(); ++i) {
MeterSection *ms;
if ((ms = dynamic_cast<MeterSection*>(*i)) != 0 && ms == &existing) {
-
+
*((Meter*) ms) = replacement;
replaced = true;
@@ -507,7 +507,7 @@ TempoMap::replace_meter (MeterSection& existing, const Meter& replacement)
}
}
}
-
+
if (replaced) {
StateChanged (Change (0));
}
@@ -625,17 +625,17 @@ TempoMap::timestamp_metrics (bool use_bbt)
BBT_Time end;
for (i = metrics->begin(); i != metrics->end(); ++i) {
-
+
end = (*i)->start();
-
+
section_frames = count_frames_between_metrics (*meter, *tempo, start, end);
-
+
current += section_frames;
-
+
start = end;
-
+
(*i)->set_frame (current);
-
+
if ((t = dynamic_cast<TempoSection*>(*i)) != 0) {
tempo = t;
} else if ((m = dynamic_cast<MeterSection*>(*i)) != 0) {
@@ -657,7 +657,7 @@ TempoMap::timestamp_metrics (bool use_bbt)
BBT_Time bbt;
Metric metric (*meter, *tempo);
-
+
if (prev) {
metric.set_start (prev->start());
metric.set_frame (prev->frame());
@@ -665,20 +665,20 @@ TempoMap::timestamp_metrics (bool use_bbt)
// metric will be at frames=0 bbt=1|1|0 by default
// which is correct for our purpose
}
-
+
bbt_time_with_metric ((*i)->frame(), bbt, metric);
// cerr << "timestamp @ " << (*i)->frame() << " with " << bbt.bars << "|" << bbt.beats << "|" << bbt.ticks << " => ";
-
+
if (first) {
first = false;
} else {
-
+
if (bbt.ticks > Meter::ticks_per_beat/2) {
/* round up to next beat */
bbt.beats += 1;
- }
+ }
bbt.ticks = 0;
@@ -688,9 +688,9 @@ TempoMap::timestamp_metrics (bool use_bbt)
bbt.beats = 1;
}
}
-
+
//s cerr << bbt.bars << "|" << bbt.beats << "|" << bbt.ticks << endl;
-
+
(*i)->set_start (bbt);
if ((t = dynamic_cast<TempoSection*>(*i)) != 0) {
@@ -742,7 +742,7 @@ TempoMap::metric_at (nframes_t frame) const
m.set_frame ((*i)->frame ());
m.set_start ((*i)->start ());
}
-
+
return m;
}
@@ -773,7 +773,7 @@ TempoMap::metric_at (BBT_Time bbt) const
} else if ((meter = dynamic_cast<const MeterSection*>(*i)) != 0) {
m.set_meter (*meter);
}
-
+
m.set_frame ((*i)->frame ());
m.set_start (section_start);
}
@@ -842,10 +842,10 @@ TempoMap::bbt_time_with_metric (nframes_t frame, BBT_Time& bbt, const Metric& me
// cerr << "-----\t RETURN " << bbt << endl;
}
-nframes_t
+nframes_t
TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) const
{
- /* for this to work with fractional measure types, start and end have to be "legal" BBT types,
+ /* for this to work with fractional measure types, start and end have to be "legal" BBT types,
that means that the beats and ticks should be inside a bar
*/
@@ -857,17 +857,17 @@ TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) con
uint32_t bar_offset = start.bars - m.start().bars;
- double beat_offset = bar_offset*m.meter().beats_per_bar() - (m.start().beats-1) + (start.beats -1)
+ double beat_offset = bar_offset*m.meter().beats_per_bar() - (m.start().beats-1) + (start.beats -1)
+ start.ticks/Meter::ticks_per_beat;
start_frame = m.frame() + (nframes_t) rint( beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter()));
- m = metric_at(end);
+ m = metric_at(end);
bar_offset = end.bars - m.start().bars;
- beat_offset = bar_offset * m.meter().beats_per_bar() - (m.start().beats -1) + (end.beats - 1)
+ beat_offset = bar_offset * m.meter().beats_per_bar() - (m.start().beats -1) + (end.beats - 1)
+ end.ticks/Meter::ticks_per_beat;
end_frame = m.frame() + (nframes_t) rint(beat_offset * m.tempo().frames_per_beat(_frame_rate, m.meter()));
@@ -875,13 +875,13 @@ TempoMap::count_frames_between ( const BBT_Time& start, const BBT_Time& end) con
frames = end_frame - start_frame;
return frames;
-
-}
-nframes_t
+}
+
+nframes_t
TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo, const BBT_Time& start, const BBT_Time& end) const
{
- /* this is used in timestamping the metrics by actually counting the beats */
+ /* this is used in timestamping the metrics by actually counting the beats */
nframes_t frames = 0;
uint32_t bar = start.bars;
@@ -896,7 +896,7 @@ TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo,
frames = 0;
while (bar < end.bars || (bar == end.bars && beat < end.beats)) {
-
+
if (beat >= beats_per_bar) {
beat = 1;
++bar;
@@ -905,7 +905,7 @@ TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo,
if (beat > beats_per_bar) {
/* this is a fractional beat at the end of a fractional bar
- so it should only count for the fraction
+ so it should only count for the fraction
*/
beats_counted -= (ceil(beats_per_bar) - beats_per_bar);
@@ -917,18 +917,18 @@ TempoMap::count_frames_between_metrics (const Meter& meter, const Tempo& tempo,
}
}
- // cerr << "Counted " << beats_counted << " from " << start << " to " << end
- // << " bpb were " << beats_per_bar
+ // cerr << "Counted " << beats_counted << " from " << start << " to " << end
+ // << " bpb were " << beats_per_bar
// << " fpb was " << beat_frames
// << endl;
-
+
frames = (nframes_t) floor (beats_counted * beat_frames);
return frames;
-
-}
-nframes_t
+}
+
+nframes_t
TempoMap::frame_time (const BBT_Time& bbt) const
{
BBT_Time start ; /* 1|1|0 */
@@ -936,7 +936,7 @@ TempoMap::frame_time (const BBT_Time& bbt) const
return count_frames_between ( start, bbt);
}
-nframes_t
+nframes_t
TempoMap::bbt_duration_at (nframes_t pos, const BBT_Time& bbt, int dir) const
{
nframes_t frames = 0;
@@ -952,7 +952,7 @@ TempoMap::bbt_duration_at (nframes_t pos, const BBT_Time& bbt, int dir) const
return frames;
}
-nframes_t
+nframes_t
TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, int dir) const
{
@@ -960,7 +960,7 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
double beats_per_bar;
BBT_Time result;
-
+
result.bars = max(1U, when.bars + dir * bbt.bars) ;
result.beats = 1;
result.ticks = 0;
@@ -970,13 +970,13 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
- /*reduce things to legal bbt values
+ /*reduce things to legal bbt values
we have to handle possible fractional=shorter beats at the end of measures
and things like 0|11|9000 as a duration in a 4.5/4 measure
- the musical decision is that the fractional beat is also a beat , although a shorter one
+ the musical decision is that the fractional beat is also a beat , although a shorter one
*/
-
+
if (dir >= 0) {
result.beats = when.beats + bbt.beats;
result.ticks = when.ticks + bbt.ticks;
@@ -986,9 +986,9 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
result.beats -= (uint32_t) ceil(beats_per_bar);
metric = metric_at(result); // maybe there is a meter change
beats_per_bar = metric.meter().beats_per_bar();
-
+
}
- /*we now counted the beats and landed in the target measure, now deal with ticks
+ /*we now counted the beats and landed in the target measure, now deal with ticks
this seems complicated, but we want to deal with the corner case of a sequence of time signatures like 0.2/4-0.7/4
and with request like bbt = 3|2|9000 ,so we repeat the same loop but add ticks
*/
@@ -997,7 +997,7 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
*/
uint32_t ticks_at_beat = (uint32_t) ( result.beats == ceil(beats_per_bar) ?
- (1 - (ceil(beats_per_bar) - beats_per_bar))* Meter::ticks_per_beat
+ (1 - (ceil(beats_per_bar) - beats_per_bar))* Meter::ticks_per_beat
: Meter::ticks_per_beat );
while (result.ticks >= ticks_at_beat) {
@@ -1010,30 +1010,30 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
beats_per_bar = metric.meter().beats_per_bar();
}
ticks_at_beat= (uint32_t) ( result.beats == ceil(beats_per_bar) ?
- (1 - (ceil(beats_per_bar) - beats_per_bar) ) * Meter::ticks_per_beat
+ (1 - (ceil(beats_per_bar) - beats_per_bar) ) * Meter::ticks_per_beat
: Meter::ticks_per_beat);
}
-
+
} else {
uint32_t b = bbt.beats;
/* count beats */
while( b > when.beats ) {
-
+
result.bars = max(1U,result.bars-- ) ;
metric = metric_at(result); // maybe there is a meter change
beats_per_bar = metric.meter().beats_per_bar();
if (b >= ceil(beats_per_bar)) {
-
+
b -= (uint32_t) ceil(beats_per_bar);
} else {
b = (uint32_t) ceil(beats_per_bar) - b + when.beats ;
}
}
result.beats = when.beats - b;
-
+
/*count ticks */
if (bbt.ticks <= when.ticks) {
@@ -1055,9 +1055,9 @@ TempoMap::bbt_duration_at_unlocked (const BBT_Time& when, const BBT_Time& bbt, i
result.beats --;
ticks_at_beat = (uint32_t) Meter::ticks_per_beat;
}
-
+
if (t <= ticks_at_beat) {
- result.ticks = ticks_at_beat - t;
+ result.ticks = ticks_at_beat - t;
} else {
t-= ticks_at_beat;
}
@@ -1111,14 +1111,14 @@ TempoMap::round_to_beat_subdivision (nframes_t fr, int sub_num, int dir)
ticks_one_subdivisions_worth = (uint32_t)Meter::ticks_per_beat / sub_num;
ticks_one_half_subdivisions_worth = ticks_one_subdivisions_worth / 2;
-
+
if (dir > 0) {
-
+
/* round to next */
uint32_t mod = the_beat.ticks % ticks_one_subdivisions_worth;
- if (mod == 0) {
+ if (mod == 0) {
/* right on the subdivision, so the difference is just the subdivision ticks */
difference = ticks_one_subdivisions_worth;
@@ -1132,7 +1132,7 @@ TempoMap::round_to_beat_subdivision (nframes_t fr, int sub_num, int dir)
the_beat.beats++;
the_beat.ticks += difference;
the_beat.ticks -= (uint32_t)Meter::ticks_per_beat;
- } else {
+ } else {
the_beat.ticks += difference;
}
@@ -1142,7 +1142,7 @@ TempoMap::round_to_beat_subdivision (nframes_t fr, int sub_num, int dir)
uint32_t mod = the_beat.ticks % ticks_one_subdivisions_worth;
- if (mod == 0) {
+ if (mod == 0) {
/* right on the subdivision, so the difference is just the subdivision ticks */
difference = ticks_one_subdivisions_worth;
cerr << "On the sub, move by 1 sub = " << difference << endl;
@@ -1163,12 +1163,12 @@ TempoMap::round_to_beat_subdivision (nframes_t fr, int sub_num, int dir)
<< (uint32_t)Meter::ticks_per_beat - difference << endl;
the_beat.beats--;
the_beat.ticks = (uint32_t)Meter::ticks_per_beat - difference;
- } else {
+ } else {
cerr << " reduce ticks\n";
the_beat.ticks -= difference;
}
- } else {
+ } else {
/* round to nearest */
if (the_beat.ticks % ticks_one_subdivisions_worth > ticks_one_half_subdivisions_worth) {
@@ -1177,7 +1177,7 @@ TempoMap::round_to_beat_subdivision (nframes_t fr, int sub_num, int dir)
the_beat.beats++;
the_beat.ticks += difference;
the_beat.ticks -= (uint32_t)Meter::ticks_per_beat;
- } else {
+ } else {
the_beat.ticks += difference;
}
} else {
@@ -1217,7 +1217,7 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type)
bbt.beats = 1;
bbt.ticks = 0;
break;
-
+
case Beat:
if (dir < 0) {
if (bbt.beats > 1) {
@@ -1240,15 +1240,15 @@ TempoMap::round_to_type (nframes_t frame, int dir, BBTPointType type)
}
bbt.ticks = 0;
break;
-
+
}
-
+
/*
cerr << "for " << frame << " round to " << bbt << " using "
<< metric.start()
<< endl;
*/
-
+
return metric.frame() + count_frames_between (metric.start(), bbt);
}
@@ -1293,7 +1293,7 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
}
/* We now have:
-
+
meter -> the Meter for "lower"
tempo -> the Tempo for "lower"
i -> for first new metric after "lower", possibly metrics->end()
@@ -1304,7 +1304,7 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
beats_per_bar = meter->beats_per_bar ();
frames_per_bar = meter->frames_per_bar (*tempo, _frame_rate);
beat_frames = tempo->frames_per_beat (_frame_rate, *meter);
-
+
if (meter->frame() > tempo->frame()) {
bar = meter->start().bars;
beat = meter->start().beats;
@@ -1319,7 +1319,7 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
lower frame bound passed in. assumes that current is initialized
above to be on a beat.
*/
-
+
delta_bars = (lower-current) / frames_per_bar;
delta_beats = modf(delta_bars, &dummy) * beats_per_bar;
current += (floor(delta_bars) * frames_per_bar) + (floor(delta_beats) * beat_frames);
@@ -1329,21 +1329,21 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
beat += (uint32_t) (floor(delta_beats));
points = new BBTPointList;
-
+
do {
if (i == metrics->end()) {
limit = upper;
// cerr << "== limit set to end of request @ " << limit << endl;
} else {
- // cerr << "== limit set to next metric @ " << (*i)->frame() << endl;
+ // cerr << "== limit set to next metric @ " << (*i)->frame() << endl;
limit = (*i)->frame();
}
limit = min (limit, upper);
while (current < limit) {
-
+
/* if we're at the start of a bar, add bar point */
if (beat == 1) {
@@ -1365,7 +1365,7 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
}
beat_frame += beat_frames;
current+= beat_frames;
-
+
beat++;
}
@@ -1386,8 +1386,8 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
just filled had 10 beat marks,
but the bar end is 1/2 beat before
the last beat mark.
- And it is also possible that a tempo
- change occured in the middle of a bar,
+ And it is also possible that a tempo
+ change occured in the middle of a bar,
so we subtract the possible extra fraction from the current
*/
@@ -1402,8 +1402,8 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
}
bar++;
beat = 1;
- }
-
+ }
+
}
/* if we're done, then we're done */
@@ -1432,14 +1432,14 @@ TempoMap::get_points (nframes_t lower, nframes_t upper) const
beats_per_bar = meter->beats_per_bar ();
frames_per_bar = meter->frames_per_bar (*tempo, _frame_rate);
beat_frames = tempo->frames_per_beat (_frame_rate, *meter);
-
+
++i;
}
} while (1);
return points;
-}
+}
const TempoSection&
TempoMap::tempo_section_at (nframes_t frame)
@@ -1447,7 +1447,7 @@ TempoMap::tempo_section_at (nframes_t frame)
Glib::RWLock::ReaderLock lm (lock);
Metrics::iterator i;
TempoSection* prev = 0;
-
+
for (i = metrics->begin(); i != metrics->end(); ++i) {
TempoSection* t;
@@ -1508,32 +1508,32 @@ TempoMap::set_state (const XMLNode& node)
XMLNodeList nlist;
XMLNodeConstIterator niter;
Metrics old_metrics (*metrics);
-
+
metrics->clear();
nlist = node.children();
-
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
XMLNode* child = *niter;
-
+
if (child->name() == TempoSection::xml_state_node_name) {
-
+
try {
metrics->push_back (new TempoSection (*child));
}
-
+
catch (failed_constructor& err){
error << _("Tempo map: could not set new state, restoring old one.") << endmsg;
*metrics = old_metrics;
break;
}
-
+
} else if (child->name() == MeterSection::xml_state_node_name) {
-
+
try {
metrics->push_back (new MeterSection (*child));
}
-
+
catch (failed_constructor& err) {
error << _("Tempo map: could not set new state, restoring old one.") << endmsg;
*metrics = old_metrics;
@@ -1541,15 +1541,15 @@ TempoMap::set_state (const XMLNode& node)
}
}
}
-
+
if (niter == nlist.end()) {
-
+
MetricSectionSorter cmp;
metrics->sort (cmp);
timestamp_metrics (true);
}
}
-
+
StateChanged (Change (0));
return 0;
@@ -1560,14 +1560,14 @@ TempoMap::dump (std::ostream& o) const
{
const MeterSection* m;
const TempoSection* t;
-
+
for (Metrics::const_iterator i = metrics->begin(); i != metrics->end(); ++i) {
if ((t = dynamic_cast<const TempoSection*>(*i)) != 0) {
o << "Tempo @ " << *i << ' ' << t->beats_per_minute() << " BPM (denom = " << t->note_type() << ") at " << t->start() << " frame= " << t->frame() << " (move? "
<< t->movable() << ')' << endl;
} else if ((m = dynamic_cast<const MeterSection*>(*i)) != 0) {
- o << "Meter @ " << *i << ' ' << m->beats_per_bar() << '/' << m->note_divisor() << " at " << m->start() << " frame= " << m->frame()
+ o << "Meter @ " << *i << ' ' << m->beats_per_bar() << '/' << m->note_divisor() << " at " << m->start() << " frame= " << m->frame()
<< " (move? " << m->movable() << ')' << endl;
}
}
@@ -1613,6 +1613,6 @@ TempoMap::insert_time (nframes_t where, nframes_t amount)
}
timestamp_metrics (false);
-
+
StateChanged (Change (0));
}
diff --git a/libs/ardour/tempo_map_importer.cc b/libs/ardour/tempo_map_importer.cc
index 457f8c7b53..1d37383fb5 100644
--- a/libs/ardour/tempo_map_importer.cc
+++ b/libs/ardour/tempo_map_importer.cc
@@ -39,11 +39,11 @@ TempoMapImportHandler::TempoMapImportHandler (XMLTree const & source, Session &
{
XMLNode const * root = source.root();
XMLNode const * tempo_map;
-
+
if (!(tempo_map = root->child (X_("TempoMap")))) {
throw failed_constructor();
}
-
+
elements.push_back (ElementPtr ( new TempoMapImporter (source, session, *tempo_map)));
}
@@ -54,7 +54,7 @@ TempoMapImportHandler::get_info () const
}
/*** TempoMapImporter ***/
-TempoMapImporter::TempoMapImporter (XMLTree const & source, Session & session, XMLNode const & node) :
+TempoMapImporter::TempoMapImporter (XMLTree const & source, Session & session, XMLNode const & node) :
ElementImporter (source, session),
xml_tempo_map (node)
{
@@ -68,7 +68,7 @@ TempoMapImporter::get_info () const
unsigned int tempos = 0;
unsigned int meters = 0;
XMLNodeList children = xml_tempo_map.children();
-
+
for (XMLNodeIterator it = children.begin(); it != children.end(); it++) {
if ((*it)->name() == "Tempo") {
tempos++;
@@ -76,10 +76,10 @@ TempoMapImporter::get_info () const
meters++;
}
}
-
+
// return info
oss << _("Tempo marks: ") << tempos << _("\nMeter marks: ") << meters;
-
+
return oss.str();
}
diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc
index de42683c15..6f831e8808 100644
--- a/libs/ardour/ticker.cc
+++ b/libs/ardour/ticker.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Hans Baier
+ Copyright (C) 2008 Hans Baier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,25 +26,25 @@ namespace ARDOUR
{
-void Ticker::set_session(Session& s)
+void Ticker::set_session(Session& s)
{
_session = &s;
-
+
if(_session) {
_session->tick.connect(mem_fun (*this, &Ticker::tick));
_session->GoingAway.connect(mem_fun (*this, &Ticker::going_away));
}
}
-void MidiClockTicker::set_session(Session& s)
+void MidiClockTicker::set_session(Session& s)
{
Ticker::set_session(s);
-
+
if(_session) {
_session->MIDIClock_PortChanged.connect(mem_fun (*this, &MidiClockTicker::update_midi_clock_port));
_session->TransportStateChange .connect(mem_fun (*this, &MidiClockTicker::transport_state_changed));
- _session->PositionChanged .connect(mem_fun (*this, &MidiClockTicker::position_changed));
- _session->TransportLooped .connect(mem_fun (*this, &MidiClockTicker::transport_looped));
+ _session->PositionChanged .connect(mem_fun (*this, &MidiClockTicker::position_changed));
+ _session->TransportLooped .connect(mem_fun (*this, &MidiClockTicker::transport_looped));
update_midi_clock_port();
}
}
@@ -60,18 +60,18 @@ void MidiClockTicker::transport_state_changed()
/* no midi clock during export, for now */
return;
}
-
+
float speed = _session->transport_speed();
nframes_t position = _session->transport_frame();
-#ifdef DEBUG_MIDI_CLOCK
+#ifdef DEBUG_MIDI_CLOCK
cerr << "Transport state change, speed:" << speed << "position:" << position<< " play loop " << _session->get_play_loop() << endl;
-#endif
+#endif
if (speed == 1.0f) {
_last_tick = position;
-
- if (!Config->get_send_midi_clock())
+
+ if (!Config->get_send_midi_clock())
return;
-
+
if (_session->get_play_loop()) {
assert(_session->locations()->auto_loop_location());
if (position == _session->locations()->auto_loop_location()->start()) {
@@ -84,24 +84,24 @@ void MidiClockTicker::transport_state_changed()
} else {
send_continue_event(0);
}
-
+
send_midi_clock_event(0);
-
+
} else if (speed == 0.0f) {
- if (!Config->get_send_midi_clock())
+ if (!Config->get_send_midi_clock())
return;
-
+
send_stop_event(0);
}
-
+
tick(position, *((ARDOUR::BBT_Time *) 0), *((SMPTE::Time *)0));
}
void MidiClockTicker::position_changed(nframes_t position)
{
-#ifdef DEBUG_MIDI_CLOCK
+#ifdef DEBUG_MIDI_CLOCK
cerr << "Position changed:" << position << endl;
-#endif
+#endif
_last_tick = position;
}
@@ -110,15 +110,15 @@ void MidiClockTicker::transport_looped()
Location* loop_location = _session->locations()->auto_loop_location();
assert(loop_location);
-#ifdef DEBUG_MIDI_CLOCK
+#ifdef DEBUG_MIDI_CLOCK
cerr << "Transport looped, position:" << _session->transport_frame()
<< " loop start " << loop_location->start( )
<< " loop end " << loop_location->end( )
<< " play loop " << _session->get_play_loop()
<< endl;
#endif
-
- // adjust _last_tick, so that the next MIDI clock message is sent
+
+ // adjust _last_tick, so that the next MIDI clock message is sent
// in due time (and the tick interval is still constant)
nframes_t elapsed_since_last_tick = loop_location->end() - _last_tick;
_last_tick = loop_location->start() - elapsed_since_last_tick;
@@ -132,25 +132,25 @@ void MidiClockTicker::tick(const nframes_t& transport_frames, const BBT_Time& /*
MIDI::JACK_MidiPort* jack_port = dynamic_cast<MIDI::JACK_MidiPort*>(_midi_port);
assert(jack_port);
-
+
while (true) {
double next_tick = _last_tick + one_ppqn_in_frames(transport_frames);
nframes_t next_tick_offset = nframes_t(next_tick) - transport_frames;
-
-#ifdef DEBUG_MIDI_CLOCK
- cerr << "Transport:" << transport_frames
- << ":Last tick time:" << _last_tick << ":"
- << ":Next tick time:" << next_tick << ":"
+
+#ifdef DEBUG_MIDI_CLOCK
+ cerr << "Transport:" << transport_frames
+ << ":Last tick time:" << _last_tick << ":"
+ << ":Next tick time:" << next_tick << ":"
<< "Offset:" << next_tick_offset << ":"
- << "cycle length:" << jack_port->nframes_this_cycle()
- << endl;
-#endif
-
+ << "cycle length:" << jack_port->nframes_this_cycle()
+ << endl;
+#endif
+
if (next_tick_offset >= jack_port->nframes_this_cycle())
return;
-
+
send_midi_clock_event(next_tick_offset);
-
+
_last_tick = next_tick;
}
#endif // WITH_JACK_MIDI
@@ -175,7 +175,7 @@ void MidiClockTicker::send_midi_clock_event(nframes_t offset)
#ifdef WITH_JACK_MIDI
assert (MIDI::JACK_MidiPort::is_process_thread());
#endif // WITH_JACK_MIDI
-#ifdef DEBUG_MIDI_CLOCK
+#ifdef DEBUG_MIDI_CLOCK
cerr << "Tick with offset " << offset << endl;
#endif // DEBUG_MIDI_CLOCK
static uint8_t _midi_clock_tick[1] = { MIDI_CMD_COMMON_CLOCK };
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index 62639c8d3e..bf5737f29d 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -95,7 +95,7 @@ Track::update_total_latency ()
{
nframes_t old = _output->effective_latency();
nframes_t own_latency = _output->user_latency();
-
+
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
if ((*i)->active ()) {
own_latency += (*i)->signal_latency ();
@@ -108,7 +108,7 @@ Track::update_total_latency ()
#endif
_output->set_port_latency (own_latency);
-
+
if (old != own_latency) {
_output->set_latency_delay (own_latency);
signal_latency_changed (); /* EMIT SIGNAL */
@@ -166,7 +166,7 @@ Track::can_record()
return will_record;
}
-
+
void
Track::set_record_enable (bool yn, void *src)
{
@@ -187,7 +187,7 @@ Track::set_record_enable (bool yn, void *src)
if (!_diskstream->record_enabled()) {
_saved_meter_point = _meter_point;
}
-
+
_diskstream->set_record_enabled (yn);
if (_diskstream->record_enabled()) {
@@ -215,7 +215,7 @@ Track::set_name (const string& str)
}
/* save state so that the statefile fully reflects any filename changes */
-
+
if ((ret = Route::set_name (str)) == 0) {
_session.save_state ("");
}
@@ -238,8 +238,8 @@ Track::zero_diskstream_id_in_xml (XMLNode& node)
}
}
-int
-Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
+int
+Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
bool session_state_changing, bool can_record, bool /*rec_monitors_input*/)
{
if (n_outputs().n_total() == 0) {
@@ -262,7 +262,7 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
diskstream()->check_record_status (start_frame, nframes, can_record);
bool send_silence;
-
+
if (_have_internal_generator) {
/* since the instrument has no input streams,
there is no reason to send any signal
@@ -271,9 +271,9 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
send_silence = true;
} else {
if (!Config->get_tape_machine_mode()) {
- /*
- ADATs work in a strange way..
- they monitor input always when stopped.and auto-input is engaged.
+ /*
+ ADATs work in a strange way..
+ they monitor input always when stopped.and auto-input is engaged.
*/
if ((Config->get_monitoring_model() == SoftwareMonitoring)
&& (_session.config.get_auto_input () || _diskstream->record_enabled())) {
@@ -282,10 +282,10 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
send_silence = true;
}
} else {
- /*
+ /*
Other machines switch to input on stop if the track is record enabled,
- regardless of the auto input setting (auto input only changes the
- monitoring state when the transport is rolling)
+ regardless of the auto input setting (auto input only changes the
+ monitoring state when the transport is rolling)
*/
if ((Config->get_monitoring_model() == SoftwareMonitoring)
&& _diskstream->record_enabled()) {
@@ -299,11 +299,11 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
_amp->apply_gain_automation(false);
if (send_silence) {
-
+
/* if we're sending silence, but we want the meters to show levels for the signal,
meter right here.
*/
-
+
if (_have_internal_generator) {
passthru_silence (start_frame, end_frame, nframes, 0);
} else {
@@ -314,8 +314,8 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
} else {
-
- /* we're sending signal, but we may still want to meter the input.
+
+ /* we're sending signal, but we may still want to meter the input.
*/
passthru (start_frame, end_frame, nframes, false);
@@ -327,7 +327,7 @@ Track::no_roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
}
int
-Track::silent_roll (nframes_t nframes, sframes_t /*start_frame*/, sframes_t /*end_frame*/,
+Track::silent_roll (nframes_t nframes, sframes_t /*start_frame*/, sframes_t /*end_frame*/,
bool can_record, bool rec_monitors_input)
{
if (n_outputs().n_total() == 0 && _processors.empty()) {
diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc
index da167e4bd6..1eca79e67d 100644
--- a/libs/ardour/transient_detector.cc
+++ b/libs/ardour/transient_detector.cc
@@ -16,9 +16,9 @@ TransientDetector::TransientDetector (float sr)
/* update the op_id */
_op_id = X_("libardourvampplugins:percussiononsets");
-
+
// XXX this should load the above-named plugin and get the current version
-
+
_op_id += ":2";
}
@@ -48,13 +48,13 @@ TransientDetector::use_features (Plugin::FeatureSet& features, ostream* out)
const Plugin::FeatureList& fl (features[0]);
for (Plugin::FeatureList::const_iterator f = fl.begin(); f != fl.end(); ++f) {
-
+
if ((*f).hasTimestamp) {
if (out) {
(*out) << (*f).timestamp.toString() << endl;
- }
-
+ }
+
current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (nframes_t) floor(sample_rate)));
}
}
@@ -86,23 +86,23 @@ TransientDetector::cleanup_transients (AnalysisFeatureList& t, float sr, float g
}
t.sort ();
-
+
/* remove duplicates or other things that are too close */
-
+
AnalysisFeatureList::iterator i = t.begin();
AnalysisFeatureList::iterator f, b;
const nframes64_t gap_frames = (nframes64_t) floor (gap_msecs * (sr / 1000.0));
-
+
while (i != t.end()) {
// move front iterator to just past i, and back iterator the same place
-
+
f = i;
++f;
b = f;
// move f until we find a new value that is far enough away
-
+
while ((f != t.end()) && (((*f) - (*i)) < gap_frames)) {
++f;
}
diff --git a/libs/ardour/uri_map.cc b/libs/ardour/uri_map.cc
index 82869de134..35308b02f4 100644
--- a/libs/ardour/uri_map.cc
+++ b/libs/ardour/uri_map.cc
@@ -1,15 +1,15 @@
/* This file is part of Ingen.
* Copyright (C) 2008 Dave Robillard <http://drobilla.net>
- *
+ *
* Ingen is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
- *
+ *
* Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -24,7 +24,7 @@
using namespace std;
namespace ARDOUR {
-
+
URIMap::URIMap()
: next_uri_id(1)
@@ -35,7 +35,7 @@ URIMap::URIMap()
uri_map_feature.data = &uri_map_feature_data;
}
-
+
uint32_t
URIMap::uri_to_id(const char* map,
const char* uri)
@@ -50,7 +50,7 @@ URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data,
const char* uri)
{
// TODO: map ignored, < UINT16_MAX assumed
-
+
URIMap* me = (URIMap*)callback_data;
uint32_t ret = 0;
@@ -61,7 +61,7 @@ URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data,
ret = me->next_uri_id++;
me->uri_map.insert(make_pair(string(uri), ret));
}
-
+
/*cout << "URI MAP (" << (map ? (void*)map : NULL)
<< "): " << uri << " -> " << ret << endl;*/
diff --git a/libs/ardour/user_bundle.cc b/libs/ardour/user_bundle.cc
index 1abb3fba87..e2d46ab6e0 100644
--- a/libs/ardour/user_bundle.cc
+++ b/libs/ardour/user_bundle.cc
@@ -27,7 +27,7 @@ int
ARDOUR::UserBundle::set_state (XMLNode const & node)
{
XMLProperty const * name;
-
+
if ((name = node.property ("name")) == 0) {
PBD::error << _("Node for Bundle has no \"name\" property") << endmsg;
return -1;
@@ -49,7 +49,7 @@ ARDOUR::UserBundle::set_state (XMLNode const & node)
PBD::error << _("Node for Channel has no \"name\" property") << endmsg;
return -1;
}
-
+
add_channel (name->value ());
XMLNodeList const ports = (*i)->children ();
@@ -63,8 +63,8 @@ ARDOUR::UserBundle::set_state (XMLNode const & node)
if ((name = (*j)->property ("name")) == 0) {
PBD::error << _("Node for Port has no \"name\" property") << endmsg;
return -1;
- }
-
+ }
+
add_port_to_channel (n, name->value ());
}
@@ -78,7 +78,7 @@ XMLNode&
ARDOUR::UserBundle::get_state ()
{
XMLNode *node;
-
+
if (ports_are_inputs ()) {
node = new XMLNode ("InputBundle");
} else {
@@ -93,13 +93,13 @@ ARDOUR::UserBundle::get_state ()
for (std::vector<Channel>::iterator i = _channel.begin(); i != _channel.end(); ++i) {
XMLNode* c = new XMLNode ("Channel");
c->add_property ("name", i->name);
-
+
for (PortList::iterator j = i->ports.begin(); j != i->ports.end(); ++j) {
XMLNode* p = new XMLNode ("Port");
p->add_property ("name", *j);
c->add_child_nocopy (*p);
}
-
+
node->add_child_nocopy (*c);
}
}
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 1ecaba55e5..f7a4e14316 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -210,7 +210,7 @@ path_is_paired (ustring path, ustring& pair_base)
path = path.substr(pos+1);
}
- /* remove filename suffixes etc. */
+ /* remove filename suffixes etc. */
if ((pos = path.find_last_of ('.')) != string::npos) {
path = path.substr (0, pos);
@@ -425,7 +425,7 @@ meter_falloff_from_float (float val)
}
else if (val <= METER_FALLOFF_FASTER) {
return MeterFalloffFaster;
- }
+ }
else {
return MeterFalloffFastest;
}
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index 0aca137150..81e9674f1a 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2004 Paul Davis
+ Copyright (C) 2004 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -74,15 +74,15 @@ VSTPlugin::VSTPlugin (AudioEngine& e, Session& session, FSTHandle* h)
/* set rate and blocksize */
- _plugin->dispatcher (_plugin, effSetSampleRate, 0, 0, NULL,
+ _plugin->dispatcher (_plugin, effSetSampleRate, 0, 0, NULL,
(float) session.frame_rate());
- _plugin->dispatcher (_plugin, effSetBlockSize, 0,
+ _plugin->dispatcher (_plugin, effSetBlockSize, 0,
session.get_block_size(), NULL, 0.0f);
-
+
/* set program to zero */
_plugin->dispatcher (_plugin, effSetProgram, 0, 0, NULL, 0.0f);
-
+
// Plugin::setup_controls ();
}
@@ -95,7 +95,7 @@ VSTPlugin::VSTPlugin (const VSTPlugin &other)
throw failed_constructor();
}
_plugin = _fst->plugin;
-
+
// Plugin::setup_controls ();
}
@@ -118,7 +118,7 @@ float
VSTPlugin::default_value (uint32_t port)
{
return 0;
-}
+}
void
VSTPlugin::set_parameter (uint32_t which, float val)
@@ -131,7 +131,7 @@ float
VSTPlugin::get_parameter (uint32_t which) const
{
return _plugin->getParameter (_plugin, which);
-
+
}
uint32_t
@@ -156,10 +156,10 @@ VSTPlugin::get_state()
if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
/* fetch the current chunk */
-
+
guchar* data;
long data_size;
-
+
if ((data_size = _plugin->dispatcher (_plugin, 23 /* effGetChunk */, 0, 0, &data, false)) == 0) {
return *root;
}
@@ -173,7 +173,7 @@ VSTPlugin::get_state()
g_free (encoded_data);
root->add_child_nocopy (*chunk_node);
-
+
} else {
XMLNode* parameters = new XMLNode ("parameters");
@@ -210,7 +210,7 @@ VSTPlugin::set_state(const XMLNode& node)
XMLNode* child;
int ret = -1;
-
+
if ((child = find_named_node (node, X_("chunk"))) != 0) {
XMLPropertyList::const_iterator i;
@@ -228,7 +228,7 @@ VSTPlugin::set_state(const XMLNode& node)
}
} else if ((child = find_named_node (node, X_("parameters"))) != 0) {
-
+
XMLPropertyList::const_iterator i;
for (i = child->properties().begin(); i != child->properties().end(); ++i) {
@@ -274,28 +274,28 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
desc.lower = 0;
desc.upper = 1.0;
}
-
+
if (prop.flags & kVstParameterUsesIntStep) {
-
+
desc.step = prop.stepInteger;
desc.smallstep = prop.stepInteger;
desc.largestep = prop.stepInteger;
-
+
} else if (prop.flags & kVstParameterUsesFloatStep) {
-
+
desc.step = prop.stepFloat;
desc.smallstep = prop.smallStepFloat;
desc.largestep = prop.largeStepFloat;
-
+
} else {
-
+
float range = desc.upper - desc.lower;
-
+
desc.step = range / 100.0f;
desc.smallstep = desc.step / 2.0f;
desc.largestep = desc.step * 10.0f;
}
-
+
desc.toggled = prop.flags & kVstParameterIsSwitch;
desc.logarithmic = false;
desc.sr_dependent = false;
@@ -402,10 +402,10 @@ VSTPlugin::connect_and_run (BufferSet& bufs,
outs[i] = bufs.get_audio(min((uint32_t) out_index, nbufs - 1)).data() + offset;
/* unbelievably, several VST plugins still rely on Cubase
- behaviour and do not silence the buffer in processReplacing
+ behaviour and do not silence the buffer in processReplacing
when they have no output.
*/
-
+
// memset (outs[i], 0, sizeof (Sample) * nframes);
out_index++;
}
@@ -414,7 +414,7 @@ VSTPlugin::connect_and_run (BufferSet& bufs,
/* we already know it can support processReplacing */
_plugin->processReplacing (_plugin, ins, outs, nframes);
-
+
return 0;
}
@@ -504,9 +504,9 @@ VSTPluginInfo::load (Session& session)
if (Config->get_use_vst()) {
FSTHandle* handle;
-
+
handle = fst_load(path.c_str());
-
+
if ( (int)handle == -1) {
error << string_compose(_("VST: cannot load module from \"%1\""), path) << endmsg;
} else {
@@ -519,7 +519,7 @@ VSTPluginInfo::load (Session& session)
plugin->set_info(PluginInfoPtr(new VSTPluginInfo(*this)));
return plugin;
- }
+ }
catch (failed_constructor &err) {
return PluginPtr ((Plugin*) 0);