diff options
author | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
commit | 99904735e066804358f1d0bd138a84f1e9ecda91 (patch) | |
tree | 71a924cf1660b5b00231275bd481bbd27094dd9b /libs/ardour/ardour | |
parent | eb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff) |
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
65 files changed, 257 insertions, 290 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 5cc2359632..332b9af733 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_ardour_h__ diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index 1da8903a41..4846a20cbd 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -32,6 +32,7 @@ #include <pbd/fastlog.h> #include <pbd/ringbufferNPT.h> #include <pbd/stateful.h> +#include <pbd/rcu.h> #include <ardour/ardour.h> #include <ardour/configuration.h> @@ -65,24 +66,28 @@ class AudioDiskstream : public Diskstream float capture_buffer_load() const; string input_source (uint32_t n=0) const { - if (n < channels.size()) { - return channels[n].source ? channels[n].source->name() : ""; + boost::shared_ptr<ChannelList> c = channels.reader(); + if (n < c->size()) { + return (*c)[n]->source ? (*c)[n]->source->name() : ""; } else { return ""; } } Port *input_source_port (uint32_t n=0) const { - if (n < channels.size()) return channels[n].source; return 0; + boost::shared_ptr<ChannelList> c = channels.reader(); + if (n < c->size()) return (*c)[n]->source; return 0; } void set_record_enabled (bool yn); int set_destructive (bool yn); bool can_become_destructive (bool& requires_bounce) const; - float peak_power(uint32_t n=0) { - float x = channels[n].peak_power; - channels[n].peak_power = 0.0f; + float peak_power(uint32_t n = 0) { + boost::shared_ptr<ChannelList> c = channels.reader(); + ChannelInfo* chaninfo = (*c)[n]; + float x = chaninfo->peak_power; + chaninfo->peak_power = 0.0f; if (x > 0.0f) { return 20.0f * fast_log10(x); } else { @@ -96,27 +101,29 @@ class AudioDiskstream : public Diskstream int use_new_playlist (); int use_copy_playlist (); - Sample *playback_buffer (uint32_t n=0) { - if (n < channels.size()) - return channels[n].current_playback_buffer; + Sample *playback_buffer (uint32_t n = 0) { + boost::shared_ptr<ChannelList> c = channels.reader(); + if (n < c->size()) + return (*c)[n]->current_playback_buffer; return 0; } - Sample *capture_buffer (uint32_t n=0) { - if (n < channels.size()) - return channels[n].current_capture_buffer; + Sample *capture_buffer (uint32_t n = 0) { + boost::shared_ptr<ChannelList> c = channels.reader(); + if (n < c->size()) + return (*c)[n]->current_capture_buffer; return 0; } boost::shared_ptr<AudioFileSource> write_source (uint32_t n=0) { - if (n < channels.size()) - return channels[n].write_source; + boost::shared_ptr<ChannelList> c = channels.reader(); + if (n < c->size()) + return (*c)[n]->write_source; return boost::shared_ptr<AudioFileSource>(); } - int add_channel (); - int remove_channel (); - + int add_channel (uint32_t how_many); + int remove_channel (uint32_t how_many); /* stateful */ @@ -174,12 +181,9 @@ class AudioDiskstream : public Diskstream struct ChannelInfo { - ChannelInfo (); + ChannelInfo (nframes_t buffer_size, nframes_t speed_buffer_size, nframes_t wrap_buffer_size); ~ChannelInfo (); - void init (nframes_t buffer_size, nframes_t speed_buffer_size, nframes_t wrap_buffer_size); - void release (); - Sample *playback_wrap_buffer; Sample *capture_wrap_buffer; Sample *speed_buffer; @@ -208,17 +212,19 @@ class AudioDiskstream : public Diskstream nframes_t curr_capture_cnt; }; + typedef std::vector<ChannelInfo*> ChannelList; + /* The two central butler operations */ int do_flush (Session::RunContext context, bool force = false); int do_refill () { return _do_refill(_mixdown_buffer, _gain_buffer); } - int do_refill_with_alloc(); + 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); + void finish_capture (bool rec_monitors_input, boost::shared_ptr<ChannelList>); void transport_stopped (struct tm&, time_t, bool abort); void init (Diskstream::Flag); @@ -251,14 +257,17 @@ class AudioDiskstream : public Diskstream static Sample* _mixdown_buffer; static gain_t* _gain_buffer; - // Uh, /really/ private? (there should probably be less friends of Diskstream) - int _do_refill (Sample *mixdown_buffer, float *gain_buffer); - - std::vector<boost::shared_ptr<AudioFileSource> > capturing_sources; - typedef vector<ChannelInfo> ChannelList; - ChannelList channels; + SerializedRCUManager<ChannelList> channels; + + /* really */ + private: + int _do_refill (Sample *mixdown_buffer, float *gain_buffer); + + int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many); + int remove_channel_from (boost::shared_ptr<ChannelList>, uint32_t how_many); + }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index e87434b0fb..3546545329 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audio_track_h__ diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 3dbd30f841..48a3426d53 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audioengine_h__ @@ -53,6 +52,8 @@ class AudioEngine : public sigc::trackable jack_client_t* jack() const { return _jack; } bool connected() const { return _jack != 0; } + bool is_realtime () const; + std::string client_name() const { return jack_client_name; } int reconnect_to_jack (); diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index 0e1caf5245..913cd7d5ed 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -20,12 +20,19 @@ #ifndef __ardour_audiofilesource_h__ #define __ardour_audiofilesource_h__ +#include <exception> + #include <time.h> #include <ardour/audiosource.h> namespace ARDOUR { +class non_existent_source : public std::exception { + public: + virtual const char *what() const throw() { return "audio file does not exist"; } +}; + struct SoundFileInfo { float samplerate; uint16_t channels; @@ -49,17 +56,19 @@ class AudioFileSource : public AudioSource { virtual ~AudioFileSource (); - int set_name (string newname, bool destructive); + int set_name (Glib::ustring newname, bool destructive); + + Glib::ustring path() const { return _path; } + Glib::ustring peak_path (Glib::ustring audio_path); + Glib::ustring old_peak_path (Glib::ustring audio_path); - string path() const { return _path; } - string peak_path (string audio_path); - string old_peak_path (string audio_path); + uint16_t channel() const { return _channel; } - static void set_peak_dir (string dir) { peak_dir = dir; } + static void set_peak_dir (Glib::ustring dir) { peak_dir = dir; } - static bool get_soundfile_info (string path, SoundFileInfo& _info, string& error); + static bool get_soundfile_info (Glib::ustring path, SoundFileInfo& _info, std::string& error); - static bool safe_file_extension (string path); + static bool safe_file_extension (Glib::ustring path); void set_allow_remove_if_empty (bool yn); void mark_for_remove(); @@ -76,19 +85,19 @@ class AudioFileSource : public AudioSource { virtual int update_header (nframes_t when, struct tm&, time_t) = 0; virtual int flush_header () = 0; - int move_to_trash (const string trash_dir_name); + int move_to_trash (const Glib::ustring& trash_dir_name); - static bool is_empty (Session&, string path); + static bool is_empty (Session&, Glib::ustring path); void mark_streaming_write_completed (); - void mark_take (string); - string take_id() const { return _take_id; } + void mark_take (Glib::ustring); + Glib::ustring take_id() const { return _take_id; } bool is_embedded() const { return _is_embedded; } static void set_bwf_serial_number (int); - static void set_search_path (string); + static void set_search_path (Glib::ustring string); static void set_header_position_offset (nframes_t offset ); int setup_peakfile (); @@ -100,6 +109,7 @@ class AudioFileSource : public AudioSource { bool destructive() const { return (_flags & Destructive); } virtual bool set_destructive (bool yn) { return false; } + bool can_truncate_peaks() const { return !destructive(); } Flag flags() const { return _flags; } @@ -116,31 +126,31 @@ class AudioFileSource : public AudioSource { /* constructor to be called for existing external-to-session files */ - AudioFileSource (Session&, std::string path, Flag flags); + AudioFileSource (Session&, Glib::ustring path, Flag flags); /* constructor to be called for new in-session files */ - AudioFileSource (Session&, std::string path, Flag flags, + AudioFileSource (Session&, Glib::ustring path, Flag flags, SampleFormat samp_format, HeaderFormat hdr_format); /* constructor to be called for existing in-session files */ - AudioFileSource (Session&, const XMLNode&); + AudioFileSource (Session&, const XMLNode&, bool must_exit = true); - int init (string idstr, bool must_exist); + int init (Glib::ustring idstr, bool must_exist); - string _path; + Glib::ustring _path; Flag _flags; - string _take_id; + Glib::ustring _take_id; int64_t timeline_position; bool file_is_new; - uint16_t channel; + uint16_t _channel; bool _is_embedded; - static bool determine_embeddedness(string path); + static bool determine_embeddedness(Glib::ustring path); - static string peak_dir; - static string search_path; + static Glib::ustring peak_dir; + static Glib::ustring search_path; static char bwf_country_code[3]; static char bwf_organization_code[4]; @@ -151,7 +161,7 @@ class AudioFileSource : public AudioSource { virtual void set_timeline_position (int64_t pos); virtual void set_header_timeline_position () = 0; - bool find (std::string path, bool must_exist, bool& is_new); + bool find (Glib::ustring& path, bool must_exist, bool& is_new); bool removable() const; bool writable() const { return _flags & Writable; } }; diff --git a/libs/ardour/ardour/audiofilter.h b/libs/ardour/ardour/audiofilter.h index c8762dbf69..6b60544942 100644 --- a/libs/ardour/ardour/audiofilter.h +++ b/libs/ardour/ardour/audiofilter.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audiofilter_h__ diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index 36fe027a6f..39f41d5d1c 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audio_playlist_h__ diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index e3c5db561d..3b592a54ee 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audio_region_h__ diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index 0734a66319..812c30e8c2 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: audio_source.h 486 2006-04-27 09:04:24Z pauld $ */ #ifndef __ardour_audio_source_h__ @@ -23,7 +22,6 @@ #include <list> #include <vector> -#include <string> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> @@ -31,6 +29,7 @@ #include <time.h> #include <glibmm/thread.h> +#include <glibmm/ustring.h> #include <sigc++/signal.h> @@ -41,7 +40,7 @@ using std::list; using std::vector; -using std::string; +using Glib::ustring; namespace ARDOUR { @@ -50,7 +49,7 @@ const nframes_t frames_per_peak = 256; class AudioSource : public Source, public boost::enable_shared_from_this<ARDOUR::AudioSource> { public: - AudioSource (Session&, string name); + AudioSource (Session&, ustring name); AudioSource (Session&, const XMLNode&); virtual ~AudioSource (); @@ -64,8 +63,10 @@ const nframes_t frames_per_peak = 256; virtual void mark_for_remove() = 0; virtual void mark_streaming_write_completed () {} - void set_captured_for (string str) { _captured_for = str; } - string captured_for() const { return _captured_for; } + virtual bool can_truncate_peaks() const { return true; } + + void set_captured_for (ustring str) { _captured_for = str; } + ustring captured_for() const { return _captured_for; } uint32_t read_data_count() const { return _read_data_count; } uint32_t write_data_count() const { return _write_data_count; } @@ -80,10 +81,7 @@ const nframes_t frames_per_peak = 256; XMLNode& get_state (); int set_state (const XMLNode&); - static int start_peak_thread (); - static void stop_peak_thread (); - - int rename_peakfile (std::string newpath); + int rename_peakfile (ustring newpath); void touch_peakfile (); static void set_build_missing_peakfiles (bool yn) { @@ -96,67 +94,41 @@ const nframes_t frames_per_peak = 256; virtual int setup_peakfile () { return 0; } + int prepare_for_peakfile_writes (); + void done_with_peakfile_writes (); + protected: static bool _build_missing_peakfiles; static bool _build_peakfiles; bool _peaks_built; mutable Glib::Mutex _lock; - bool next_peak_clear_should_notify; - string peakpath; - string _captured_for; + ustring peakpath; + ustring _captured_for; mutable uint32_t _read_data_count; // modified in read() mutable uint32_t _write_data_count; // modified in write() - int initialize_peakfile (bool newfile, string path); - void build_peaks_from_scratch (); - - int do_build_peak (nframes_t, nframes_t); + int initialize_peakfile (bool newfile, ustring path); + int build_peaks_from_scratch (); + int compute_and_write_peaks (Sample* buf, nframes_t first_frame, nframes_t cnt, bool force); void truncate_peakfile(); - mutable off_t _peak_byte_max; // modified in do_build_peaks() + mutable off_t _peak_byte_max; // modified in compute_and_write_peak() virtual nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const = 0; virtual nframes_t write_unlocked (Sample *dst, nframes_t cnt) = 0; - virtual string peak_path(string audio_path) = 0; - virtual string old_peak_path(string audio_path) = 0; + virtual ustring peak_path(ustring audio_path) = 0; + virtual ustring old_peak_path(ustring audio_path) = 0; - static pthread_t peak_thread; - static bool have_peak_thread; - static void* peak_thread_work(void*); - - static int peak_request_pipe[2]; - - struct PeakRequest { - enum Type { - Build, - Quit - }; - }; - - static vector<boost::shared_ptr<AudioSource> > pending_peak_sources; - static Glib::Mutex* pending_peak_sources_lock; - - static void queue_for_peaks (boost::shared_ptr<AudioSource>, bool notify=true); - static void clear_queue_for_peaks (); - - struct PeakBuildRecord { - nframes_t frame; - nframes_t cnt; - - PeakBuildRecord (nframes_t f, nframes_t c) - : frame (f), cnt (c) {} - PeakBuildRecord (const PeakBuildRecord& other) { - frame = other.frame; - cnt = other.cnt; - } - }; - - list<AudioSource::PeakBuildRecord *> pending_peak_builds; - private: - bool file_changed (string path); + int peakfile; + nframes_t peak_leftover_cnt; + nframes_t peak_leftover_size; + Sample* peak_leftovers; + nframes_t peak_leftover_frame; + + bool file_changed (ustring path); }; } diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index e6091cfba0..06d521ea21 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_auditioner_h__ diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h index a2cfb23e61..007bad7259 100644 --- a/libs/ardour/ardour/automation_event.h +++ b/libs/ardour/ardour/automation_event.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_automation_event_h__ diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h index 71214978a5..60499b98da 100644 --- a/libs/ardour/ardour/click.h +++ b/libs/ardour/ardour/click.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_click_h__ diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h index bb49b2dce4..31cb74ab33 100644 --- a/libs/ardour/ardour/configuration.h +++ b/libs/ardour/ardour/configuration.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_configuration_h__ diff --git a/libs/ardour/ardour/configuration_variable.h b/libs/ardour/ardour/configuration_variable.h index 8710369a64..81e282ff64 100644 --- a/libs/ardour/ardour/configuration_variable.h +++ b/libs/ardour/ardour/configuration_variable.h @@ -27,10 +27,13 @@ class ConfigVariableBase { virtual void add_to_node (XMLNode& node) = 0; virtual bool set_from_node (const XMLNode& node, Owner owner) = 0; + void show_stored_value (const std::string&); + static void set_show_stored_values (bool yn); protected: std::string _name; Owner _owner; + static bool show_stores; void notify (); void miss (); @@ -61,7 +64,7 @@ class ConfigVariable : public ConfigVariableBase void add_to_node (XMLNode& node) { std::stringstream ss; ss << value; - cerr << "Config variable " << _name << " stored as " << ss.str() << endl; + show_stored_value (ss.str()); XMLNode* child = new XMLNode ("Option"); child->add_property ("name", _name); child->add_property ("value", ss.str()); diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h index 703352b305..674a9232b5 100644 --- a/libs/ardour/ardour/configuration_vars.h +++ b/libs/ardour/ardour/configuration_vars.h @@ -18,11 +18,14 @@ CONFIG_VARIABLE (bool, send_mmc, "send-mmc", false) CONFIG_VARIABLE (bool, mmc_control, "mmc-control", false) CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false) CONFIG_VARIABLE (bool, midi_control, "midi-control", false) +CONFIG_VARIABLE (uint8_t, mmc_device_id, "mmc-device-id", 0) /* control surfaces */ CONFIG_VARIABLE (uint32_t, feedback_interval_ms, "feedback-interval-ms", 100) CONFIG_VARIABLE (bool, use_tranzport, "use-tranzport", false) +CONFIG_VARIABLE (std::string, mackie_emulation, "mackie-emulation", "mcu") +CONFIG_VARIABLE (RemoteModel, remote_model, "remote-model", MixerOrdered) /* disk operations */ @@ -35,7 +38,7 @@ CONFIG_VARIABLE (HeaderFormat, native_file_header_format, "native-file-header-f /* OSC */ CONFIG_VARIABLE (uint32_t, osc_port, "osc-port", 3819) -CONFIG_VARIABLE (bool, use_osc, "use-osc", true) +CONFIG_VARIABLE (bool, use_osc, "use-osc", false) /* crossfades */ @@ -62,6 +65,7 @@ CONFIG_VARIABLE (SoloModel, solo_model, "solo-model", InverseMute) CONFIG_VARIABLE (bool, solo_latched, "solo-latched", true) CONFIG_VARIABLE (bool, latched_record_enable, "latched-record-enable", false) CONFIG_VARIABLE (bool, all_safe, "all-safe", false) +CONFIG_VARIABLE (bool, show_solo_mutes, "show-solo-mutes", false) /* click */ diff --git a/libs/ardour/ardour/connection.h b/libs/ardour/ardour/connection.h index da4d4e2684..d2f1cb4294 100644 --- a/libs/ardour/ardour/connection.h +++ b/libs/ardour/ardour/connection.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_connection_h__ diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 3eafed818c..7346e645fb 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_overlap_h__ diff --git a/libs/ardour/ardour/crossfade_compare.h b/libs/ardour/ardour/crossfade_compare.h index 2ecf79c04c..b92806a6bb 100644 --- a/libs/ardour/ardour/crossfade_compare.h +++ b/libs/ardour/ardour/crossfade_compare.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_crossfade_compare_h__ diff --git a/libs/ardour/ardour/curve.h b/libs/ardour/ardour/curve.h index df984b74e0..dd63439f08 100644 --- a/libs/ardour/ardour/curve.h +++ b/libs/ardour/ardour/curve.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_curve_h__ diff --git a/libs/ardour/ardour/cycle_timer.h b/libs/ardour/ardour/cycle_timer.h index b9cbbbf0a8..4e1a50e602 100644 --- a/libs/ardour/ardour/cycle_timer.h +++ b/libs/ardour/ardour/cycle_timer.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_cycle_timer_h__ diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h index a6f34d59be..f1422880b8 100644 --- a/libs/ardour/ardour/cycles.h +++ b/libs/ardour/ardour/cycles.h @@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_cycles_h__ diff --git a/libs/ardour/ardour/dB.h b/libs/ardour/ardour/dB.h index 703de6fb1a..b67e581067 100644 --- a/libs/ardour/ardour/dB.h +++ b/libs/ardour/ardour/dB.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_dB_h__ diff --git a/libs/ardour/ardour/destructive_filesource.h b/libs/ardour/ardour/destructive_filesource.h deleted file mode 100644 index 2e6f5d0e57..0000000000 --- a/libs/ardour/ardour/destructive_filesource.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - 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. - - $Id$ -*/ - -#ifndef __ardour_destructive_file_source_h__ -#define __ardour_destructive_file_source_h__ - -#include <string> - -#include <ardour/sndfilesource.h> - -struct tm; - -namespace ARDOUR { - -class DestructiveFileSource : public SndFileSource { - public: - DestructiveFileSource (Session&, std::string path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, - Flag flags = AudioFileSource::Flag (AudioFileSource::Writable)); - - DestructiveFileSource (Session&, std::string path, Flag flags); - - DestructiveFileSource (Session&, const XMLNode&); - ~DestructiveFileSource (); - - nframes_t last_capture_start_frame() const; - void mark_capture_start (nframes_t); - void mark_capture_end (); - void clear_capture_marks(); - - XMLNode& get_state (); - - static void setup_standard_crossfades (nframes_t sample_rate); - - int read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit) const; - - protected: - nframes_t write_unlocked (Sample *src, nframes_t cnt); - - virtual void handle_header_position_change (); - - private: - static nframes_t xfade_frames; - static gain_t* out_coefficient; - static gain_t* in_coefficient; - - bool _capture_start; - bool _capture_end; - nframes_t capture_start_frame; - nframes_t file_pos; // unit is frames - Sample* xfade_buf; - - void init (); - nframes_t crossfade (Sample* data, nframes_t cnt, int dir); - void set_timeline_position (int64_t); -}; - -} - -#endif /* __ardour_destructive_file_source_h__ */ diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index a81921b9f1..10b3bbfe92 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: diskstream.h 579 2006-06-12 19:56:37Z essej $ */ #ifndef __ardour_diskstream_h__ @@ -54,7 +53,7 @@ class Session; class Playlist; class IO; - class Diskstream : public PBD::StatefulDestructible +class Diskstream : public PBD::StatefulDestructible { public: enum Flag { @@ -199,7 +198,6 @@ class IO; /** For non-butler contexts (allocates temporary working buffers) */ virtual int do_refill_with_alloc() = 0; - /* XXX fix this redundancy ... */ @@ -207,7 +205,6 @@ class IO; virtual void playlist_modified (); virtual void playlist_deleted (boost::weak_ptr<Playlist>); - virtual void finish_capture (bool rec_monitors_input) = 0; virtual void transport_stopped (struct tm&, time_t, bool abort) = 0; struct CaptureInfo { @@ -236,7 +233,7 @@ class IO; virtual void use_destructive_playlist () {} static nframes_t disk_io_chunk_frames; - vector<CaptureInfo*> capture_info; + std::vector<CaptureInfo*> capture_info; Glib::Mutex capture_info_lock; uint32_t i_am_the_modifier; diff --git a/libs/ardour/ardour/export.h b/libs/ardour/ardour/export.h index f66acec893..66e5b1b7d5 100644 --- a/libs/ardour/ardour/export.h +++ b/libs/ardour/ardour/export.h @@ -76,9 +76,9 @@ namespace ARDOUR /* shared between UI thread and audio thread */ - float progress; /* audio thread sets this */ - bool stop; /* UI sets this */ - 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; diff --git a/libs/ardour/ardour/gain.h b/libs/ardour/ardour/gain.h index 3613ea1a5a..5832f71101 100644 --- a/libs/ardour/ardour/gain.h +++ b/libs/ardour/ardour/gain.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_gain_h__ diff --git a/libs/ardour/ardour/gdither.h b/libs/ardour/ardour/gdither.h index 51343b13c4..67efcc3583 100644 --- a/libs/ardour/ardour/gdither.h +++ b/libs/ardour/ardour/gdither.h @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id$ */ #ifndef GDITHER_H diff --git a/libs/ardour/ardour/gdither_types.h b/libs/ardour/ardour/gdither_types.h index 46feb55fbc..bcc0097d7f 100644 --- a/libs/ardour/ardour/gdither_types.h +++ b/libs/ardour/ardour/gdither_types.h @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id$ */ #ifndef GDITHER_TYPES_H diff --git a/libs/ardour/ardour/gdither_types_internal.h b/libs/ardour/ardour/gdither_types_internal.h index 55d5792833..e73a256310 100644 --- a/libs/ardour/ardour/gdither_types_internal.h +++ b/libs/ardour/ardour/gdither_types_internal.h @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id$ */ #ifndef GDITHER_TYPES_H diff --git a/libs/ardour/ardour/insert.h b/libs/ardour/ardour/insert.h index 31e59e6704..e58cb71754 100644 --- a/libs/ardour/ardour/insert.h +++ b/libs/ardour/ardour/insert.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_insert_h__ diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index c4df46415b..51423e9ab2 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_io_h__ @@ -113,7 +112,8 @@ class IO : public PBD::StatefulDestructible Panner& panner() { return *_panner; } PeakMeter& peak_meter() { return *_meter; } - + const Panner& panner() const { return *_panner; } + int ensure_io (ChanCount in, ChanCount out, bool clear, void *src); int use_input_connection (Connection&, void *src); diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h index 27e8bc5e84..f1f1bb8811 100644 --- a/libs/ardour/ardour/ladspa_plugin.h +++ b/libs/ardour/ardour/ladspa_plugin.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_ladspa_plugin_h__ diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index 57e13de5af..6625b7dbf5 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_location_h__ @@ -159,11 +158,11 @@ class Locations : public PBD::StatefulDestructible int set_current (Location *, bool want_lock = true); Location *current () const { return current_location; } - Location *first_location_before (nframes_t); - Location *first_location_after (nframes_t); + Location *first_location_before (nframes_t, bool include_special_ranges = false); + Location *first_location_after (nframes_t, bool include_special_ranges = false); - nframes_t first_mark_before (nframes_t); - nframes_t first_mark_after (nframes_t); + nframes_t first_mark_before (nframes_t, bool include_special_ranges = false); + nframes_t first_mark_after (nframes_t, bool include_special_ranges = false); sigc::signal<void,Location*> current_changed; sigc::signal<void> changed; diff --git a/libs/ardour/ardour/logcurve.h b/libs/ardour/ardour/logcurve.h index ac60a10fd7..dd58263313 100644 --- a/libs/ardour/ardour/logcurve.h +++ b/libs/ardour/ardour/logcurve.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_logcurve_h__ diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h index 653b61cb95..5555f5437e 100644 --- a/libs/ardour/ardour/mix.h +++ b/libs/ardour/ardour/mix.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_mix_h__ #define __ardour_mix_h__ @@ -28,7 +27,7 @@ extern "C" { /* SSE functions */ - float x86_sse_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); + float x86_sse_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); void x86_sse_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain); @@ -37,9 +36,11 @@ extern "C" { void x86_sse_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes); } +void x86_sse_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max); + /* debug wrappers for SSE functions */ -float debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); +float debug_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); void debug_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain); @@ -53,6 +54,8 @@ void debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nfra float veclib_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); +void veclib_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max); + void veclib_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain); void veclib_mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain); @@ -63,12 +66,14 @@ void veclib_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src /* non-optimized functions */ -float compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); +float compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current); + +void find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max); -void apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain); +void apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain); -void mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain); +void mix_buffers_with_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes, float gain); -void mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes); +void mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes); #endif /* __ardour_mix_h__ */ diff --git a/libs/ardour/ardour/named_selection.h b/libs/ardour/ardour/named_selection.h index fd5777ccf6..7636099e1f 100644 --- a/libs/ardour/ardour/named_selection.h +++ b/libs/ardour/ardour/named_selection.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_named_selection_h__ diff --git a/libs/ardour/ardour/osc.h b/libs/ardour/ardour/osc.h index 0a34f44a41..ca2f4488dd 100644 --- a/libs/ardour/ardour/osc.h +++ b/libs/ardour/ardour/osc.h @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ */ #ifndef ardour_osc_h diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h index 79bff7d2a5..9d6a7e7fb6 100644 --- a/libs/ardour/ardour/panner.h +++ b/libs/ardour/ardour/panner.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_panner_h__ diff --git a/libs/ardour/ardour/pcm_utils.h b/libs/ardour/ardour/pcm_utils.h index 6866e53251..5e6436cc94 100644 --- a/libs/ardour/ardour/pcm_utils.h +++ b/libs/ardour/ardour/pcm_utils.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_pcm_utils_h__ diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 9893f7391a..54863b6fb0 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_playlist_h__ diff --git a/libs/ardour/ardour/playlist_templates.h b/libs/ardour/ardour/playlist_templates.h index 603e0bef37..bf072a71c1 100644 --- a/libs/ardour/ardour/playlist_templates.h +++ b/libs/ardour/ardour/playlist_templates.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_playlist_templates_h__ diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index 431b55db8b..feb86f1b7b 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_plugin_h__ diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 8e6c0bd1c7..b4d2e5e99d 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -7,7 +7,6 @@ #include <ardour/types.h> #include <ardour/plugin.h> -#include <ardour/audio_unit.h> namespace ARDOUR { diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h index 4e4ad0fec6..7891a0e6f2 100644 --- a/libs/ardour/ardour/port.h +++ b/libs/ardour/ardour/port.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_port_h__ diff --git a/libs/ardour/ardour/redirect.h b/libs/ardour/ardour/redirect.h index 8c3de09c10..fac2241f14 100644 --- a/libs/ardour/ardour/redirect.h +++ b/libs/ardour/ardour/redirect.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_redirect_h__ diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 46865d8357..716c7dec20 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_region_h__ diff --git a/libs/ardour/ardour/reverse.h b/libs/ardour/ardour/reverse.h index c60df990f2..3296c77c62 100644 --- a/libs/ardour/ardour/reverse.h +++ b/libs/ardour/ardour/reverse.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_reverse_h__ diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 2f94e0c80a..70091ef85d 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_route_h__ @@ -78,8 +77,8 @@ class Route : public IO std::string comment() { return _comment; } void set_comment (std::string str, void *src); - long order_key(std::string name) const; - void set_order_key (std::string name, long n); + long order_key (const char* name) const; + void set_order_key (const char* name, long n); bool hidden() const { return _flags & Hidden; } bool master() const { return _flags & MasterOut; } @@ -121,6 +120,7 @@ class Route : public IO void set_mute (bool yn, void *src); bool muted() const { return _muted; } + bool solo_muted() const { return desired_solo_gain == 0.0; } void set_mute_config (mute_type, bool, void *src); bool get_mute_config (mute_type); @@ -256,7 +256,6 @@ class Route : public IO bool _muted : 1; bool _soloed : 1; - bool _solo_muted : 1; bool _solo_safe : 1; bool _recordable : 1; bool _active : 1; @@ -324,7 +323,16 @@ class Route : public IO void init (); static uint32_t order_key_cnt; - typedef std::map<std::string,long> OrderKeys; + + struct ltstr + { + bool operator()(const char* s1, const char* s2) const + { + return strcmp(s1, s2) < 0; + } + }; + + typedef std::map<const char*,long,ltstr> OrderKeys; OrderKeys order_keys; void input_change_handler (IOChange, void *src); diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index d87d3fa3a4..55448df45b 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_route_group_h__ diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index eceb301bf8..d4c0572811 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_send_h__ diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 63fa608499..2022b21a05 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1,22 +1,21 @@ - /* - 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 - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + 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. + 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. + 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. - $Id$ - */ +*/ #ifndef __ardour_session_h__ #define __ardour_session_h__ @@ -176,7 +175,7 @@ class Session : public PBD::StatefulDestructible Route* route; }; - boost::shared_ptr<Region> region; + boost::shared_ptr<Region> region; list<AudioRange> audio_range; list<MusicRange> music_range; @@ -248,6 +247,7 @@ class Session : public PBD::StatefulDestructible string name() const { return _name; } string snap_name() const { return _current_snapshot_name; } string raid_path () const; + string export_dir () const; void set_snap_name (); @@ -491,6 +491,8 @@ class Session : public PBD::StatefulDestructible void resort_routes (); void resort_routes_using (boost::shared_ptr<RouteList>); + void set_remote_control_ids(); + AudioEngine &engine() { return _engine; }; int32_t max_level; @@ -591,13 +593,14 @@ class Session : public PBD::StatefulDestructible int start_audio_export (ARDOUR::AudioExportSpecification&); int stop_audio_export (ARDOUR::AudioExportSpecification&); - + void finalize_audio_export (); + void add_source (boost::shared_ptr<Source>); void remove_source (boost::weak_ptr<Source>); struct cleanup_report { vector<string> paths; - int32_t space; + int64_t space; }; int cleanup_sources (cleanup_report&); @@ -626,6 +629,7 @@ class Session : public PBD::StatefulDestructible boost::shared_ptr<MidiSource> create_midi_source_for_session (ARDOUR::MidiDiskstream&); boost::shared_ptr<Source> source_by_id (const PBD::ID&); + boost::shared_ptr<Source> source_by_path_and_channel (const Glib::ustring&, uint16_t); /* playlist management */ @@ -683,6 +687,7 @@ class Session : public PBD::StatefulDestructible void set_all_mute (bool); sigc::signal<void,bool> SoloActive; + sigc::signal<void> SoloChanged; void record_disenable_all (); void record_enable_all (); @@ -740,6 +745,8 @@ class Session : public PBD::StatefulDestructible void deliver_midi (MIDI::Port*, MIDI::byte*, int32_t size); + void set_mmc_device_id (uint32_t id); + /* Scrubbing */ void start_scrub (nframes_t where); @@ -920,12 +927,14 @@ class Session : public PBD::StatefulDestructible void* ptr, float opt); - typedef float (*compute_peak_t) (Sample *, nframes_t, float); + typedef float (*compute_peak_t) (Sample *, nframes_t, float); + typedef void (*find_peaks_t) (Sample *, nframes_t, float *, float*); typedef void (*apply_gain_to_buffer_t) (Sample *, nframes_t, float); typedef void (*mix_buffers_with_gain_t) (Sample *, Sample *, nframes_t, float); typedef void (*mix_buffers_no_gain_t) (Sample *, Sample *, nframes_t); - static compute_peak_t compute_peak; + static compute_peak_t compute_peak; + static find_peaks_t find_peaks; static apply_gain_to_buffer_t apply_gain_to_buffer; static mix_buffers_with_gain_t mix_buffers_with_gain; static mix_buffers_no_gain_t mix_buffers_no_gain; @@ -1283,8 +1292,7 @@ class Session : public PBD::StatefulDestructible void mmc_record_pause (MIDI::MachineControl &); void mmc_record_strobe (MIDI::MachineControl &); void mmc_record_exit (MIDI::MachineControl &); - void mmc_track_record_status (MIDI::MachineControl &, - uint32_t track, bool enabled); + void mmc_track_record_status (MIDI::MachineControl &, uint32_t track, bool enabled); void mmc_fast_forward (MIDI::MachineControl &); void mmc_rewind (MIDI::MachineControl &); void mmc_locate (MIDI::MachineControl &, const MIDI::byte *); @@ -1566,7 +1574,9 @@ class Session : public PBD::StatefulDestructible static const char* dead_sound_dir_name; static const char* interchange_dir_name; static const char* peak_dir_name; - + static const char* export_dir_name; + + string old_sound_dir (bool with_path = true) const; string discover_best_sound_dir (bool destructive = false); int ensure_sound_dir (string, string&); void refresh_disk_space (); diff --git a/libs/ardour/ardour/session_connection.h b/libs/ardour/ardour/session_connection.h index addc896b0b..d5e32c7904 100644 --- a/libs/ardour/ardour/session_connection.h +++ b/libs/ardour/ardour/session_connection.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_session_connection_h__ diff --git a/libs/ardour/ardour/session_playlist.h b/libs/ardour/ardour/session_playlist.h index 20cf4d8f2e..baeb74916d 100644 --- a/libs/ardour/ardour/session_playlist.h +++ b/libs/ardour/ardour/session_playlist.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_session_playlist_h__ diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h index feacc14775..0c70bf407d 100644 --- a/libs/ardour/ardour/session_route.h +++ b/libs/ardour/ardour/session_route.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_session_route_h__ diff --git a/libs/ardour/ardour/session_selection.h b/libs/ardour/ardour/session_selection.h index a110c2c3da..4169a3a511 100644 --- a/libs/ardour/ardour/session_selection.h +++ b/libs/ardour/ardour/session_selection.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_session_named_selection_h__ diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h new file mode 100644 index 0000000000..92ef076a9b --- /dev/null +++ b/libs/ardour/ardour/silentfilesource.h @@ -0,0 +1,66 @@ +/* + 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 + 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. + +*/ + +#ifndef __ardour_silentfilesource_h__ +#define __ardour_silentfilesource_h__ + +#include <ardour/audiofilesource.h> + +namespace ARDOUR { + +class SilentFileSource : public AudioFileSource { + public: + virtual ~SilentFileSource (); + + int update_header (nframes_t when, struct tm&, time_t) { return 0; } + int flush_header () { return 0; } + float sample_rate () const { return _sample_rate; } + + void set_length (nframes_t len); + + int read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit) const { + memset (peaks, 0, sizeof (PeakData) * npeaks); + return 0; + } + + bool destructive() const { return false; } + + protected: + + float _sample_rate; + + SilentFileSource (Session&, const XMLNode&, nframes_t nframes, float sample_rate); + + friend class SourceFactory; + + nframes_t read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const { + memset (dst, 0, sizeof (Sample) * cnt); + return cnt; + } + + nframes_t write_unlocked (Sample *dst, nframes_t cnt) { return 0; } + + void set_header_timeline_position () {} + +}; + +} // namespace ARDOUR + +#endif /* __ardour_audiofilesource_h__ */ + diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index d4a7e2f22a..170facb1de 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_slave_h__ @@ -70,6 +69,7 @@ class MTC_Slave : public Slave, public sigc::trackable { Session& session; MIDI::Port* port; std::vector<sigc::connection> connections; + bool can_notify_on_unknown_rate; struct SafeTime { diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index a5000a4b63..2fc3872887 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __sndfile_source_h__ @@ -31,11 +30,11 @@ class SndFileSource : public AudioFileSource { public: /* constructor to be called for existing external-to-session files */ - SndFileSource (Session&, std::string path, int chn, Flag flags); + SndFileSource (Session&, Glib::ustring path, int chn, Flag flags); /* constructor to be called for new in-session files */ - SndFileSource (Session&, std::string path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, + SndFileSource (Session&, Glib::ustring path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, Flag flags = SndFileSource::default_writable_flags); /* constructor to be called for existing in-session files */ @@ -60,7 +59,7 @@ class SndFileSource : public AudioFileSource { static void setup_standard_crossfades (nframes_t sample_rate); static const AudioFileSource::Flag default_writable_flags; - static int get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg); + static int get_soundfile_info (const Glib::ustring& path, SoundFileInfo& _info, string& error_msg); protected: void set_header_timeline_position (); diff --git a/libs/ardour/ardour/soundseq.h b/libs/ardour/ardour/soundseq.h index 4a318e9750..c7157428ee 100644 --- a/libs/ardour/ardour/soundseq.h +++ b/libs/ardour/ardour/soundseq.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __soundseq_h__ diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index 8eaab14ec5..45c91950fc 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_source_h__ diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h index b69645b031..a8b0ae54a3 100644 --- a/libs/ardour/ardour/source_factory.h +++ b/libs/ardour/ardour/source_factory.h @@ -20,8 +20,8 @@ class SourceFactory { static sigc::signal<void,boost::shared_ptr<Source> > SourceCreated; static boost::shared_ptr<Source> create (Session&, const XMLNode& node); + static boost::shared_ptr<Source> createSilent (Session&, const XMLNode& node, nframes_t nframes, float sample_rate); - // MIDI sources will have to be hacked in here somehow static boost::shared_ptr<Source> createReadable (DataType type, Session&, std::string path, int chn, AudioFileSource::Flag flags, bool announce = true); static boost::shared_ptr<Source> createWritable (DataType type, Session&, std::string name, bool destructive, nframes_t rate, bool announce = true); diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index f8751b5d2b..5e3e93e48b 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_tempo_h__ diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 30cdcd8232..b155965cab 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_types_h__ @@ -265,6 +264,12 @@ namespace ARDOUR { ExternalMonitoring, }; + enum RemoteModel { + UserOrdered, + MixerOrdered, + EditorOrdered, + }; + enum CrossfadeModel { FullCrossfade, ShortCrossfade @@ -346,6 +351,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::HeaderFormat& sf); std::istream& operator>>(std::istream& o, ARDOUR::AutoConnectOption& sf); std::istream& operator>>(std::istream& o, ARDOUR::EditMode& sf); std::istream& operator>>(std::istream& o, ARDOUR::MonitorModel& sf); +std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::SoloModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf); diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h index de97a5c150..20badf5ea1 100644 --- a/libs/ardour/ardour/utils.h +++ b/libs/ardour/ardour/utils.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_utils_h__ diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h index 8034341bcc..f7ec486d36 100644 --- a/libs/ardour/ardour/vst_plugin.h +++ b/libs/ardour/ardour/vst_plugin.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_vst_plugin_h__ |