summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_diskstream.h58
-rw-r--r--libs/ardour/ardour/audio_library.h50
-rw-r--r--libs/ardour/ardour/audioengine.h5
-rw-r--r--libs/ardour/ardour/audiofilesource.h2
-rw-r--r--libs/ardour/ardour/audioplaylist.h9
-rw-r--r--libs/ardour/ardour/audiosource.h5
-rw-r--r--libs/ardour/ardour/automation_event.h6
-rw-r--r--libs/ardour/ardour/configuration_vars.h18
-rw-r--r--libs/ardour/ardour/crossfade.h5
-rw-r--r--libs/ardour/ardour/cycles.h2
-rw-r--r--libs/ardour/ardour/diskstream.h16
-rw-r--r--libs/ardour/ardour/insert.h11
-rw-r--r--libs/ardour/ardour/io.h6
-rw-r--r--libs/ardour/ardour/location.h5
-rw-r--r--libs/ardour/ardour/meter.h10
-rw-r--r--libs/ardour/ardour/midi_diskstream.h4
-rw-r--r--libs/ardour/ardour/midi_playlist.h9
-rw-r--r--libs/ardour/ardour/named_selection.h5
-rw-r--r--libs/ardour/ardour/playlist.h54
-rw-r--r--libs/ardour/ardour/playlist_factory.h25
-rw-r--r--libs/ardour/ardour/redirect.h2
-rw-r--r--libs/ardour/ardour/region.h7
-rw-r--r--libs/ardour/ardour/route.h2
-rw-r--r--libs/ardour/ardour/route_group.h2
-rw-r--r--libs/ardour/ardour/send.h8
-rw-r--r--libs/ardour/ardour/session.h181
-rw-r--r--libs/ardour/ardour/session_playlist.h2
-rw-r--r--libs/ardour/ardour/source.h6
-rw-r--r--libs/ardour/ardour/track.h5
-rw-r--r--libs/ardour/ardour/types.h15
-rw-r--r--libs/ardour/ardour/utils.h12
31 files changed, 291 insertions, 256 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h
index 4a95e094a9..1da8903a41 100644
--- a/libs/ardour/ardour/audio_diskstream.h
+++ b/libs/ardour/ardour/audio_diskstream.h
@@ -90,9 +90,9 @@ class AudioDiskstream : public Diskstream
}
}
- AudioPlaylist* audio_playlist () { return dynamic_cast<AudioPlaylist*>(_playlist); }
+ boost::shared_ptr<AudioPlaylist> audio_playlist () { return boost::dynamic_pointer_cast<AudioPlaylist>(_playlist); }
- int use_playlist (Playlist *);
+ int use_playlist (boost::shared_ptr<Playlist>);
int use_new_playlist ();
int use_copy_playlist ();
@@ -173,33 +173,39 @@ class AudioDiskstream : public Diskstream
private:
struct 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;
-
- Port *source;
- Sample *current_capture_buffer;
- Sample *current_playback_buffer;
+ ChannelInfo ();
+ ~ChannelInfo ();
- RingBufferNPT<Sample> *playback_buf;
- RingBufferNPT<Sample> *capture_buf;
+ void init (nframes_t buffer_size, nframes_t speed_buffer_size, nframes_t wrap_buffer_size);
+ void release ();
- 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;
+ 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;
+
+ 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;
};
/* The two central butler operations */
diff --git a/libs/ardour/ardour/audio_library.h b/libs/ardour/ardour/audio_library.h
index f5ac6da654..8c01f0e3dc 100644
--- a/libs/ardour/ardour/audio_library.h
+++ b/libs/ardour/ardour/audio_library.h
@@ -1,6 +1,5 @@
/*
- Copyright (C) 2003 Paul Davis
- Author: Taybin Rutkin
+ 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
@@ -16,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_library_h__
@@ -26,64 +24,30 @@
#include <map>
#include <vector>
-#include <sigc++/signal.h>
-
-#include <pbd/stateful.h>
-
using std::vector;
using std::string;
using std::map;
namespace ARDOUR {
-class AudioLibrary : public Stateful
+class AudioLibrary
{
public:
AudioLibrary ();
~AudioLibrary ();
- static string state_node_name;
-
- XMLNode& get_state (void);
- int set_state (const XMLNode&);
-
- void set_paths (vector<string> paths);
- vector<string> get_paths ();
- void scan_paths ();
-
- void add_member (string member);
- void remove_member (string uri);
+ void set_tags (string member, vector<string> tags);
+ vector<string> get_tags (string member);
- void search_members_and (vector<string>& results,
- const map<string,string>& fields);
- void search_members_or (vector<string>& results,
- const map<string,string>& fields);
-
- void add_field (string field);
- void get_fields (vector<string>& fields);
- void remove_field (string field);
- string get_field (string uri, string field);
- void set_field (string uri, string field, string literal);
- string get_label (string uri);
- void set_label (string uri, string name);
+ void search_members_and (vector<string>& results, const vector<string> tags);
void save_changes();
-
- sigc::signal<void> fields_changed;
private:
- vector<string> sfdb_paths;
-
- string field_uri (string name);
-
- bool is_rdf_type (string uri, string type);
- void remove_uri (string uri);
-
string src;
- void initialize_db();
- void compact_vector (vector<string>& vec);
- bool safe_file_extension (string);
+ string path2uri (string path);
+ string uri2path (string uri);
};
extern AudioLibrary* Library;
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index 207e3c6428..3dbd30f841 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -61,7 +61,7 @@ class AudioEngine : public sigc::trackable
bool will_reconnect_at_halt ();
void set_reconnect_at_halt (bool);
- int stop ();
+ int stop (bool forever = false);
int start ();
bool running() const { return _running; }
@@ -195,8 +195,7 @@ class AudioEngine : public sigc::trackable
jack_client_t *_jack;
std::string jack_client_name;
Glib::Mutex _process_lock;
- Glib::Mutex session_remove_lock;
- Glib::Cond session_removed;
+ Glib::Cond session_removed;
bool session_remove_pending;
bool _running;
bool _has_run;
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h
index bd609a7d80..c1dc7d1e93 100644
--- a/libs/ardour/ardour/audiofilesource.h
+++ b/libs/ardour/ardour/audiofilesource.h
@@ -59,6 +59,8 @@ class AudioFileSource : public AudioSource {
static bool get_soundfile_info (string path, SoundFileInfo& _info, string& error);
+ static bool safe_file_extension (string path);
+
void set_allow_remove_if_empty (bool yn);
void mark_for_remove();
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 383ec73531..c0d5ed6e75 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -42,8 +42,10 @@ class AudioPlaylist : public ARDOUR::Playlist
public:
AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
AudioPlaylist (Session&, string name, bool hidden = false);
- AudioPlaylist (const AudioPlaylist&, string name, bool hidden = false);
- AudioPlaylist (const AudioPlaylist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+ AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, string name, bool hidden = false);
+ AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+
+ ~AudioPlaylist ();
void clear (bool with_signals=true);
@@ -70,9 +72,6 @@ class AudioPlaylist : public ARDOUR::Playlist
void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
void remove_dependents (boost::shared_ptr<Region> region);
- protected:
- ~AudioPlaylist (); /* public should use unref() */
-
private:
Crossfades _crossfades; /* xfades currently in use */
Crossfades _pending_xfade_adds;
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index 2ada255236..0734a66319 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -113,6 +113,9 @@ const nframes_t frames_per_peak = 256;
void build_peaks_from_scratch ();
int do_build_peak (nframes_t, nframes_t);
+ void truncate_peakfile();
+
+ mutable off_t _peak_byte_max; // modified in do_build_peaks()
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;
@@ -135,7 +138,7 @@ const nframes_t frames_per_peak = 256;
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>);
+ static void queue_for_peaks (boost::shared_ptr<AudioSource>, bool notify=true);
static void clear_queue_for_peaks ();
struct PeakBuildRecord {
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h
index e5c194e683..a2cfb23e61 100644
--- a/libs/ardour/ardour/automation_event.h
+++ b/libs/ardour/ardour/automation_event.h
@@ -82,7 +82,8 @@ class AutomationList : public PBD::StatefulDestructible
void clear ();
void x_scale (double factor);
bool extend_to (double);
-
+ void slide (iterator before, double distance);
+
void reposition_for_rt_add (double when);
void rt_add (double when, double value);
void add (double when, double value);
@@ -190,7 +191,7 @@ class AutomationList : public PBD::StatefulDestructible
AutomationEventList events;
mutable Glib::Mutex lock;
- bool _frozen;
+ int8_t _frozen;
bool changed_when_thawed;
bool _dirty;
@@ -209,6 +210,7 @@ class AutomationList : public PBD::StatefulDestructible
double min_yval;
double max_yval;
double default_value;
+ bool sort_pending;
iterator rt_insertion_point;
double rt_pos;
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 8044190066..c520477c55 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -3,13 +3,8 @@
CONFIG_VARIABLE (AutoConnectOption, output_auto_connect, "output-auto-connect", AutoConnectOption (0))
CONFIG_VARIABLE (AutoConnectOption, input_auto_connect, "input-auto-connect", AutoConnectOption (0))
-#ifdef __APPLE__
-CONFIG_VARIABLE (std::string, auditioner_output_left, "auditioner-output-left", "coreaudio:Built-in Audio:in1")
-CONFIG_VARIABLE (std::string, auditioner_output_right, "auditioner-output-right", "coreaudio:Built-in Audio:in2")
-#else
-CONFIG_VARIABLE (std::string, auditioner_output_left, "auditioner-output-left", "alsa_pcm:playback_1")
-CONFIG_VARIABLE (std::string, auditioner_output_right, "auditioner-output-right", "alsa_pcm:playback_2")
-#endif
+CONFIG_VARIABLE (std::string, auditioner_output_left, "auditioner-output-left", "default")
+CONFIG_VARIABLE (std::string, auditioner_output_right, "auditioner-output-right", "default")
/* MIDI and MIDI related */
@@ -100,16 +95,15 @@ CONFIG_VARIABLE (bool, quieten_at_speed, "quieten-at-speed", true)
/* timecode and sync */
CONFIG_VARIABLE (bool, jack_time_master, "jack-time-master", true)
+CONFIG_VARIABLE (SmpteFormat, smpte_format, "smpte-format", smpte_30)
CONFIG_VARIABLE (bool, use_video_sync, "use-video-sync", false)
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
-CONFIG_VARIABLE (float, smpte_frames_per_second, "smpte-frames-per-second", 30.0f)
CONFIG_VARIABLE (float, video_pullup, "video-pullup", 0.0f)
-CONFIG_VARIABLE (bool, smpte_drop_frames, "smpte-drop-frames", false)
/* metering */
CONFIG_VARIABLE (float, meter_hold, "meter-hold", 100.0f)
-CONFIG_VARIABLE (float, meter_falloff, "meter-falloff", 0.375f)
+CONFIG_VARIABLE (float, meter_falloff, "meter-falloff", 27.0f)
CONFIG_VARIABLE (nframes_t, over_length_short, "over-length-short", 2)
CONFIG_VARIABLE (nframes_t, over_length_long, "over-length-long", 10)
@@ -119,6 +113,8 @@ CONFIG_VARIABLE (bool, hiding_groups_deactivates_groups, "hiding-groups-deactiva
CONFIG_VARIABLE (bool, verify_remove_last_capture, "verify-remove-last-capture", true)
CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false)
CONFIG_VARIABLE (bool, use_vst, "use-vst", true)
+CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
+CONFIG_VARIABLE (uint32_t, saved_history_depth, "save-history-depth", 100)
/* BWAV */
@@ -127,4 +123,4 @@ CONFIG_VARIABLE (string, bwf_organization_code, "bwf-organization-code", "US")
/* these variables have custom set() methods (e.g. path globbing) */
-CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", path_expand)
+CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand)
diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h
index d29ba47056..0422698c5e 100644
--- a/libs/ardour/ardour/crossfade.h
+++ b/libs/ardour/ardour/crossfade.h
@@ -64,12 +64,13 @@ class Crossfade : public PBD::StatefulDestructible
/* 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 (const Crossfade &, boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>);
/* the usual XML constructor */
- Crossfade (const ARDOUR::Playlist&, XMLNode&);
+ Crossfade (const Playlist&, XMLNode&);
virtual ~Crossfade();
bool operator== (const ARDOUR::Crossfade&);
diff --git a/libs/ardour/ardour/cycles.h b/libs/ardour/ardour/cycles.h
index ad3e512669..a6f34d59be 100644
--- a/libs/ardour/ardour/cycles.h
+++ b/libs/ardour/ardour/cycles.h
@@ -187,7 +187,7 @@ static inline cycles_t get_cycles (void)
/* begin mach */
#elif defined(__APPLE__)
-#ifdef HAVE_COREAUDIO
+#ifdef HAVE_WEAK_COREAUDIO
#include <CoreAudio/HostTime.h>
#else // Due to MacTypes.h and libgnomecanvasmm Rect conflict
typedef unsigned long long UInt64;
diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h
index eb6d936222..a81921b9f1 100644
--- a/libs/ardour/ardour/diskstream.h
+++ b/libs/ardour/ardour/diskstream.h
@@ -76,8 +76,8 @@ class IO;
virtual float playback_buffer_load() const = 0;
virtual float capture_buffer_load() const = 0;
- void set_flag (Flag f) { _flags |= f; }
- void unset_flag (Flag f) { _flags &= ~f; }
+ void set_flag (Flag f) { _flags = Flag (_flags | f); }
+ void unset_flag (Flag f) { _flags = Flag (_flags & ~f); }
AlignStyle alignment_style() const { return _alignment_style; }
void set_align_style (AlignStyle);
@@ -104,9 +104,9 @@ class IO;
void set_speed (double);
void non_realtime_set_speed ();
- Playlist* playlist () { return _playlist; }
+ boost::shared_ptr<Playlist> playlist () { return _playlist; }
- virtual int use_playlist (Playlist *);
+ virtual int use_playlist (boost::shared_ptr<Playlist>);
virtual int use_new_playlist () = 0;
virtual int use_copy_playlist () = 0;
@@ -205,7 +205,7 @@ class IO;
virtual void playlist_changed (Change);
virtual void playlist_modified ();
- virtual void playlist_deleted (Playlist*);
+ 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;
@@ -245,7 +245,8 @@ class IO;
ARDOUR::Session& _session;
ARDOUR::IO* _io;
ChanCount _n_channels;
- Playlist* _playlist;
+
+ boost::shared_ptr<Playlist> _playlist;
mutable gint _record_enabled;
double _visible_speed;
@@ -299,10 +300,9 @@ class IO;
sigc::connection ports_created_c;
sigc::connection plmod_connection;
- sigc::connection plstate_connection;
sigc::connection plgone_connection;
- unsigned char _flags;
+ Flag _flags;
};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/insert.h b/libs/ardour/ardour/insert.h
index 217fd89885..31e59e6704 100644
--- a/libs/ardour/ardour/insert.h
+++ b/libs/ardour/ardour/insert.h
@@ -46,10 +46,8 @@ class Plugin;
class Insert : public Redirect
{
public:
- Insert(Session& s, Placement p);
- Insert(Session& s, string name, Placement p);
-
- Insert(Session& s, Placement p, int imin, int imax, int omin, int omax);
+ Insert(Session& s, std::string name, Placement p);
+ Insert(Session& s, std::string name, Placement p, int imin, int imax, int omin, int omax);
virtual ~Insert() { }
@@ -87,6 +85,11 @@ class PortInsert : public Insert
int32_t can_support_input_configuration (int32_t) const;
int32_t configure_io (int32_t magic, int32_t in, int32_t out);
int32_t compute_output_streams (int32_t cnt) const;
+
+ uint32_t bit_slot() const { return bitslot; }
+
+ private:
+ uint32_t bitslot;
};
class PluginInsert : public Insert
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index f7e1993bb2..c4df46415b 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -203,16 +203,16 @@ class IO : public PBD::StatefulDestructible
PBD::Controllable& gain_control() {
return _gain_control;
}
-
+
static void update_meters();
-private:
+ private:
static sigc::signal<void> Meter;
static Glib::StaticMutex m_meter_signal_lock;
sigc::connection m_meter_connection;
-public:
+ public:
/* automation */
diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h
index 94f70bb4e8..57e13de5af 100644
--- a/libs/ardour/ardour/location.h
+++ b/libs/ardour/ardour/location.h
@@ -68,7 +68,7 @@ class Location : public PBD::StatefulDestructible
Location () {
_start = 0;
_end = 0;
- _flags = 0;
+ _flags = Flags (0);
}
Location (const Location& other);
@@ -124,7 +124,7 @@ class Location : public PBD::StatefulDestructible
string _name;
nframes_t _start;
nframes_t _end;
- uint32_t _flags;
+ Flags _flags;
void set_mark (bool yn);
bool set_flag_internal (bool yn, Flags flag);
@@ -153,6 +153,7 @@ class Locations : public PBD::StatefulDestructible
Location* end_location() const;
Location* start_location() const;
+ int next_available_name(string& result,string base);
uint32_t num_range_markers() const;
int set_current (Location *, bool want_lock = true);
diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h
index f18a2e6de9..17379c3baa 100644
--- a/libs/ardour/ardour/meter.h
+++ b/libs/ardour/ardour/meter.h
@@ -38,6 +38,7 @@ public:
void setup (const ChanCount& in);
void reset ();
+ void reset_max ();
/** Compute peaks */
void run (BufferSet& bufs, jack_nframes_t nframes, jack_nframes_t offset=0);
@@ -49,6 +50,14 @@ public:
return minus_infinity();
}
}
+
+ float max_peak_power (uint32_t n) {
+ if (n < _max_peak_power.size()) {
+ return _max_peak_power[n];
+ } else {
+ return minus_infinity();
+ }
+ }
private:
@@ -58,6 +67,7 @@ private:
Session& _session;
std::vector<float> _peak_power;
std::vector<float> _visible_peak_power;
+ std::vector<float> _max_peak_power;
};
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index 583cc23de5..ee11b5e133 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -72,9 +72,9 @@ class MidiDiskstream : public Diskstream
void set_record_enabled (bool yn);
- MidiPlaylist* midi_playlist () { return dynamic_cast<MidiPlaylist*>(_playlist); }
+ boost::shared_ptr<MidiPlaylist> midi_playlist () { return boost::dynamic_pointer_cast<MidiPlaylist>(_playlist); }
- int use_playlist (Playlist *);
+ int use_playlist (boost::shared_ptr<Playlist>);
int use_new_playlist ();
int use_copy_playlist ();
diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h
index 6f89d23404..492241d6b5 100644
--- a/libs/ardour/ardour/midi_playlist.h
+++ b/libs/ardour/ardour/midi_playlist.h
@@ -40,10 +40,12 @@ class MidiPlaylist : public ARDOUR::Playlist
public:
MidiPlaylist (Session&, const XMLNode&, bool hidden = false);
MidiPlaylist (Session&, string name, bool hidden = false);
- MidiPlaylist (const MidiPlaylist&, string name, bool hidden = false);
- MidiPlaylist (const MidiPlaylist&, jack_nframes_t start, jack_nframes_t cnt,
+ MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, string name, bool hidden = false);
+ MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, jack_nframes_t start, jack_nframes_t cnt,
string name, bool hidden = false);
+ ~MidiPlaylist ();
+
nframes_t read (MidiRingBuffer& buf,
jack_nframes_t start, jack_nframes_t cnt, uint32_t chan_n=0);
@@ -63,9 +65,6 @@ protected:
void refresh_dependents (boost::shared_ptr<Region> region);
void remove_dependents (boost::shared_ptr<Region> region);
-protected:
- ~MidiPlaylist (); /* public should use unref() */
-
private:
XMLNode& state (bool full_state);
void dump () const;
diff --git a/libs/ardour/ardour/named_selection.h b/libs/ardour/ardour/named_selection.h
index 87b71e73ff..fd5777ccf6 100644
--- a/libs/ardour/ardour/named_selection.h
+++ b/libs/ardour/ardour/named_selection.h
@@ -23,6 +23,7 @@
#include <string>
#include <list>
+#include <boost/shared_ptr.hpp>
#include <pbd/stateful.h>
@@ -35,12 +36,12 @@ class Playlist;
struct NamedSelection : public Stateful
{
- NamedSelection (std::string, std::list<Playlist*>&);
+ NamedSelection (std::string, std::list<boost::shared_ptr<Playlist> >&);
NamedSelection (Session&, const XMLNode&);
virtual ~NamedSelection ();
std::string name;
- std::list<Playlist*> playlists;
+ std::list<boost::shared_ptr<Playlist> > playlists;
XMLNode& get_state (void);
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 831c9b3905..9893f7391a 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -26,6 +26,7 @@
#include <map>
#include <list>
#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
#include <sys/stat.h>
@@ -47,21 +48,25 @@ namespace ARDOUR {
class Session;
class Region;
-class Playlist : public PBD::StatefulDestructible {
+class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_from_this<Playlist> {
public:
typedef list<boost::shared_ptr<Region> > RegionList;
Playlist (Session&, const XMLNode&, DataType type, bool hidden = false);
Playlist (Session&, string name, DataType type, bool hidden = false);
- Playlist (const Playlist&, string name, bool hidden = false);
- Playlist (const Playlist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+ Playlist (boost::shared_ptr<const Playlist>, string name, bool hidden = false);
+ Playlist (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+
+ virtual ~Playlist ();
+
+ void set_region_ownership ();
virtual void clear (bool with_signals=true);
virtual void dump () const;
- void ref();
- void unref();
- uint32_t refcnt() const { return _refcnt; }
+ void use();
+ void release();
+ bool used () const { return _refcnt != 0; }
std::string name() const { return _name; }
void set_name (std::string str);
@@ -92,9 +97,9 @@ class Playlist : public PBD::StatefulDestructible {
void duplicate (boost::shared_ptr<Region>, nframes_t position, float times);
void nudge_after (nframes_t start, nframes_t distance, bool forwards);
- Playlist* cut (list<AudioRange>&, bool result_is_hidden = true);
- Playlist* copy (list<AudioRange>&, bool result_is_hidden = true);
- int paste (Playlist&, nframes_t position, float times);
+ boost::shared_ptr<Playlist> cut (list<AudioRange>&, bool result_is_hidden = true);
+ boost::shared_ptr<Playlist> copy (list<AudioRange>&, bool result_is_hidden = true);
+ int paste (boost::shared_ptr<Playlist>, nframes_t position, float times);
RegionList* regions_at (nframes_t frame);
RegionList* regions_touched (nframes_t start, nframes_t end);
@@ -109,14 +114,11 @@ class Playlist : public PBD::StatefulDestructible {
int set_state (const XMLNode&);
XMLNode& get_template ();
- sigc::signal<void,Playlist*,bool> InUse;
- sigc::signal<void> Modified;
- sigc::signal<void> NameChanged;
- sigc::signal<void> LengthChanged;
- sigc::signal<void> LayeringChanged;
- sigc::signal<void> StatePushed;
-
- static sigc::signal<void,Playlist*> PlaylistCreated;
+ sigc::signal<void,bool> InUse;
+ sigc::signal<void> Modified;
+ sigc::signal<void> NameChanged;
+ sigc::signal<void> LengthChanged;
+ sigc::signal<void> LayeringChanged;
static string bump_name (string old_name, Session&);
static string bump_name_once (string old_name);
@@ -142,7 +144,6 @@ class Playlist : public PBD::StatefulDestructible {
protected:
friend class Session;
- virtual ~Playlist (); /* members of the public use unref() */
protected:
struct RegionLock {
@@ -244,26 +245,23 @@ class Playlist : public PBD::StatefulDestructible {
boost::shared_ptr<Region> region_by_id (PBD::ID);
- void add_region_internal (boost::shared_ptr<Region>, nframes_t position, bool delay_sort = false);
-
- int remove_region_internal (boost::shared_ptr<Region>, bool delay_sort = false);
+ void 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;
void partition_internal (nframes_t start, nframes_t end, bool cutting, RegionList& thawlist);
nframes_t _get_maximum_extent() const;
- Playlist* cut_copy (Playlist* (Playlist::*pmf)(nframes_t, nframes_t, bool),
- list<AudioRange>& ranges, bool result_is_hidden);
- Playlist *cut (nframes_t start, nframes_t cnt, bool result_is_hidden);
- Playlist *copy (nframes_t start, nframes_t cnt, bool result_is_hidden);
+ boost::shared_ptr<Playlist> cut_copy (boost::shared_ptr<Playlist> (Playlist::*pmf)(nframes_t, nframes_t, bool),
+ 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 ();
-
- static Playlist* copyPlaylist (const Playlist&, nframes_t start, nframes_t length,
- string name, bool result_is_hidden);
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
new file mode 100644
index 0000000000..23aad3cd78
--- /dev/null
+++ b/libs/ardour/ardour/playlist_factory.h
@@ -0,0 +1,25 @@
+#ifndef __ardour_playlist_factory_h__
+#define __ardour_playlist_factory_h__
+
+#include <ardour/playlist.h>
+
+class XMLNode;
+
+namespace ARDOUR {
+
+class Session;
+
+class PlaylistFactory {
+
+ public:
+ static sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistCreated;
+
+ static boost::shared_ptr<Playlist> create (Session&, const XMLNode&, bool hidden = false);
+ static boost::shared_ptr<Playlist> create (DataType type, Session&, string name, bool hidden = false);
+ static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, string name, bool hidden = false);
+ static boost::shared_ptr<Playlist> create (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+};
+
+}
+
+#endif /* __ardour_playlist_factory_h__ */
diff --git a/libs/ardour/ardour/redirect.h b/libs/ardour/ardour/redirect.h
index 79ae4516c5..8c3de09c10 100644
--- a/libs/ardour/ardour/redirect.h
+++ b/libs/ardour/ardour/redirect.h
@@ -111,8 +111,6 @@ class Redirect : public IO
virtual void transport_stopped (nframes_t frame) {};
protected:
- void set_placement (const string&, void *src);
-
/* children may use this stuff as they see fit */
map<uint32_t,AutomationList*> parameter_automation;
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 88bb294e5d..46865d8357 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -167,9 +167,8 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro
virtual uint32_t read_data_count() const { return _read_data_count; }
- ARDOUR::Playlist* playlist() const { return _playlist; }
-
- void set_playlist (ARDOUR::Playlist*);
+ boost::shared_ptr<ARDOUR::Playlist> playlist() const { return _playlist.lock(); }
+ virtual void set_playlist (boost::weak_ptr<ARDOUR::Playlist>);
void source_deleted (boost::shared_ptr<Source>);
@@ -238,7 +237,7 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro
Change _pending_changed;
uint64_t _last_layer_op; ///< timestamp
Glib::Mutex _lock;
- ARDOUR::Playlist* _playlist;
+ boost::weak_ptr<ARDOUR::Playlist> _playlist;
SourceList _sources;
/** Used when timefx are applied, so we can always use the original source */
SourceList _master_sources;
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 6bc37ee51e..2f94e0c80a 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -248,7 +248,7 @@ class Route : public IO
void curve_reallocate ();
protected:
- unsigned char _flags;
+ Flag _flags;
/* tight cache-line access here is more important than sheer speed of
access.
diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h
index e9fad1aa2b..d87d3fa3a4 100644
--- a/libs/ardour/ardour/route_group.h
+++ b/libs/ardour/ardour/route_group.h
@@ -115,7 +115,7 @@ class RouteGroup : public Stateful, public sigc::trackable {
Session& _session;
list<Route *> routes;
string _name;
- uint32_t _flags;
+ Flag _flags;
void remove_when_going_away (Route*);
};
diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h
index 12a0cba3ec..eceb301bf8 100644
--- a/libs/ardour/ardour/send.h
+++ b/libs/ardour/ardour/send.h
@@ -33,12 +33,15 @@
namespace ARDOUR {
-class Send : public Redirect {
+class Send : public Redirect
+{
public:
Send (Session&, Placement);
Send (Session&, const XMLNode&);
Send (const Send&);
~Send ();
+
+ uint32_t bit_slot() const { return bitslot; }
void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset);
@@ -54,9 +57,12 @@ class Send : public Redirect {
uint32_t pans_required() const { return _expected_inputs.get(DataType::AUDIO); }
void expect_inputs (const ChanCount&);
+ static uint32_t how_many_sends();
+
private:
bool _metering;
ChanCount _expected_inputs;
+ uint32_t bitslot;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 039bf92362..1c1ea9e62c 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -29,6 +29,7 @@
#include <stack>
#include <boost/weak_ptr.hpp>
+#include <boost/dynamic_bitset.hpp>
#include <stdint.h>
@@ -117,9 +118,9 @@ using std::set;
class Session : public PBD::StatefulDestructible
{
private:
- typedef std::pair<boost::shared_ptr<Route>,bool> RouteBooleanState;
+ typedef std::pair<boost::weak_ptr<Route>,bool> RouteBooleanState;
typedef vector<RouteBooleanState> GlobalRouteBooleanState;
- typedef std::pair<boost::shared_ptr<Route>,MeterPoint> RouteMeterState;
+ typedef std::pair<boost::weak_ptr<Route>,MeterPoint> RouteMeterState;
typedef vector<RouteMeterState> GlobalRouteMeterState;
public:
@@ -253,6 +254,7 @@ class Session : public PBD::StatefulDestructible
void set_dirty ();
void set_clean ();
bool dirty() const { return _state_of_the_state & Dirty; }
+ void set_deletion_in_progress ();
bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
sigc::signal<void> DirtyChanged;
@@ -391,6 +393,9 @@ class Session : public PBD::StatefulDestructible
double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
+ float smpte_frames_per_second() const;
+ bool smpte_drop_frames() const;
+
/* Locations */
Locations *locations() { return &_locations; }
@@ -401,6 +406,7 @@ class Session : public PBD::StatefulDestructible
void set_auto_punch_location (Location *);
void set_auto_loop_location (Location *);
+ int location_name(string& result, string base = string(""));
void reset_input_monitor_state ();
@@ -495,19 +501,6 @@ class Session : public PBD::StatefulDestructible
nframes_t transport_frame () const {return _transport_frame; }
nframes_t audible_frame () const;
- enum SmpteFormat {
- smpte_23976,
- smpte_24,
- smpte_24976,
- smpte_25,
- smpte_2997,
- smpte_2997drop,
- smpte_30,
- smpte_30drop,
- smpte_5994,
- smpte_60,
- };
-
enum PullupFormat {
pullup_Plus4Plus1,
pullup_Plus4,
@@ -517,11 +510,10 @@ class Session : public PBD::StatefulDestructible
pullup_Minus1,
pullup_Minus4Plus1,
pullup_Minus4,
- pullup_Minus4Minus1,
+ pullup_Minus4Minus1
};
- int set_smpte_type (float fps, bool drop_frames);
-
+ int set_smpte_format (SmpteFormat);
void sync_time_vars();
void bbt_time (nframes_t when, BBT_Time&);
@@ -584,7 +576,7 @@ class Session : public PBD::StatefulDestructible
bool multichan;
bool sample_convert;
volatile bool freeze;
- string pathname;
+ std::vector<Glib::ustring> paths;
/* result */
std::vector<boost::shared_ptr<Region> > new_regions;
@@ -602,7 +594,6 @@ class Session : public PBD::StatefulDestructible
void add_source (boost::shared_ptr<Source>);
void remove_source (boost::weak_ptr<Source>);
- int cleanup_audio_file_source (boost::shared_ptr<AudioFileSource>);
struct cleanup_report {
vector<string> paths;
@@ -622,8 +613,7 @@ class Session : public PBD::StatefulDestructible
this playlist.
*/
- sigc::signal<int,ARDOUR::Playlist*> AskAboutPlaylistDeletion;
-
+ sigc::signal<int,boost::shared_ptr<ARDOUR::Playlist> > AskAboutPlaylistDeletion;
/* handlers should return !0 for use pending state, 0 for
ignore it.
@@ -631,9 +621,6 @@ class Session : public PBD::StatefulDestructible
static sigc::signal<int> AskAboutPendingState;
- sigc::signal<void,boost::shared_ptr<Source> > SourceAdded;
- sigc::signal<void,boost::shared_ptr<Source> > SourceRemoved;
-
boost::shared_ptr<AudioFileSource> create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive);
boost::shared_ptr<MidiSource> create_midi_source_for_session (ARDOUR::MidiDiskstream&);
@@ -642,15 +629,15 @@ class Session : public PBD::StatefulDestructible
/* playlist management */
- Playlist* playlist_by_name (string name);
- void add_playlist (Playlist *);
- sigc::signal<void,Playlist*> PlaylistAdded;
- sigc::signal<void,Playlist*> PlaylistRemoved;
+ boost::shared_ptr<Playlist> playlist_by_name (string name);
+ void add_playlist (boost::shared_ptr<Playlist>);
+ sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistAdded;
+ sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistRemoved;
uint32_t n_playlists() const;
- template<class T> void foreach_playlist (T *obj, void (T::*func)(Playlist *));
- void get_playlists (std::vector<Playlist*>&);
+ template<class T> void foreach_playlist (T *obj, void (T::*func)(boost::shared_ptr<Playlist>));
+ void get_playlists (std::vector<boost::shared_ptr<Playlist> >&);
/* named selections */
@@ -711,9 +698,11 @@ class Session : public PBD::StatefulDestructible
uint32_t n_plugin_inserts() const { return _plugin_inserts.size(); }
uint32_t n_sends() const { return _sends.size(); }
- string next_send_name();
- string next_insert_name();
-
+ uint32_t next_send_id();
+ uint32_t next_insert_id();
+ void mark_send_id (uint32_t);
+ void mark_insert_id (uint32_t);
+
/* s/w "RAID" management */
nframes_t available_capture_duration();
@@ -786,59 +775,75 @@ class Session : public PBD::StatefulDestructible
std::map<PBD::ID, PBD::StatefulThingWithGoingAway*> registry;
// these commands are implemented in libs/ardour/session_command.cc
- Command *memento_command_factory(XMLNode *n);
- void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway *);
+ Command* memento_command_factory(XMLNode* n);
+ void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway*);
+
+ Command* global_state_command_factory (const XMLNode& n);
+
+ class GlobalRouteStateCommand : public Command
+ {
+ public:
+ GlobalRouteStateCommand (Session&, void*);
+ GlobalRouteStateCommand (Session&, const XMLNode& node);
+ int set_state (const XMLNode&);
+ XMLNode& get_state ();
+
+ protected:
+ GlobalRouteBooleanState before, after;
+ Session& sess;
+ void* src;
+
+ };
- class GlobalSoloStateCommand : public Command
+ class GlobalSoloStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalSoloStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalSoloStateCommand (Session &, void *src);
+ GlobalSoloStateCommand (Session&, const XMLNode&);
+ void operator()(); //redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
- class GlobalMuteStateCommand : public Command
+ class GlobalMuteStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalMuteStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalMuteStateCommand(Session &, void *src);
+ GlobalMuteStateCommand (Session&, const XMLNode&);
+ void operator()(); // redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
- class GlobalRecordEnableStateCommand : public Command
+ class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalRecordEnableStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalRecordEnableStateCommand(Session &, void *src);
+ GlobalRecordEnableStateCommand (Session&, const XMLNode&);
+ void operator()(); // redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
class GlobalMeteringStateCommand : public Command
{
- GlobalRouteMeterState before, after;
- Session &sess;
- void *src;
- public:
- GlobalMeteringStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalMeteringStateCommand(Session &, void *src);
+ GlobalMeteringStateCommand (Session&, const XMLNode&);
+ void operator()();
+ void undo();
+ XMLNode &get_state();
+ int set_state (const XMLNode&);
+ void mark();
+
+ protected:
+ Session& sess;
+ void* src;
+ GlobalRouteMeterState before;
+ GlobalRouteMeterState after;
};
/* clicking */
@@ -951,6 +956,7 @@ class Session : public PBD::StatefulDestructible
private:
int create (bool& new_session, string* mix_template, nframes_t initial_length);
+ void destroy ();
nframes_t compute_initial_length ();
@@ -1102,7 +1108,6 @@ class Session : public PBD::StatefulDestructible
void hookup_io ();
void when_engine_running ();
- sigc::connection first_time_running;
void graph_reordered ();
string _current_snapshot_name;
@@ -1134,6 +1139,8 @@ class Session : public PBD::StatefulDestructible
bool butler_should_run;
mutable gint butler_should_do_transport_work;
int butler_request_pipe[2];
+
+ inline bool transport_work_requested() const { return g_atomic_int_get(&butler_should_do_transport_work); }
struct ButlerRequest {
enum Type {
@@ -1306,7 +1313,7 @@ class Session : public PBD::StatefulDestructible
nframes_t _smpte_frames_per_hour;
nframes_t _smpte_offset;
bool _smpte_offset_negative;
-
+
/* cache the most-recently requested time conversions. This helps when we
* have multiple clocks showing the same time (e.g. the transport frame) */
bool last_smpte_valid;
@@ -1392,9 +1399,8 @@ class Session : public PBD::StatefulDestructible
void realtime_stop (bool abort);
void non_realtime_start_scrub ();
void non_realtime_set_speed ();
- void non_realtime_stop (bool abort);
- void non_realtime_overwrite ();
- void non_realtime_buffer_fill ();
+ void non_realtime_stop (bool abort, int entry_request_count, bool& finished);
+ void non_realtime_overwrite (int entry_request_count, bool& finished);
void butler_transport_work ();
void post_transport ();
void engine_halted ();
@@ -1469,19 +1475,19 @@ class Session : public PBD::StatefulDestructible
/* PLAYLISTS */
mutable Glib::Mutex playlist_lock;
- typedef set<Playlist *> PlaylistList;
+ typedef set<boost::shared_ptr<Playlist> > PlaylistList;
PlaylistList playlists;
PlaylistList unused_playlists;
int load_playlists (const XMLNode&);
int load_unused_playlists (const XMLNode&);
- void remove_playlist (Playlist *);
- void track_playlist (Playlist *, bool);
+ void remove_playlist (boost::weak_ptr<Playlist>);
+ void track_playlist (bool, boost::weak_ptr<Playlist>);
- Playlist *playlist_factory (string name);
- Playlist *XMLPlaylistFactory (const XMLNode&);
+ boost::shared_ptr<Playlist> playlist_factory (string name);
+ boost::shared_ptr<Playlist> XMLPlaylistFactory (const XMLNode&);
- void playlist_length_changed (Playlist *);
+ void playlist_length_changed ();
void diskstream_playlist_changed (boost::shared_ptr<Diskstream>);
/* NAMED SELECTIONS */
@@ -1522,9 +1528,12 @@ class Session : public PBD::StatefulDestructible
list<PortInsert *> _port_inserts;
list<PluginInsert *> _plugin_inserts;
list<Send *> _sends;
+ boost::dynamic_bitset<uint32_t> send_bitset;
+ boost::dynamic_bitset<uint32_t> insert_bitset;
uint32_t send_cnt;
uint32_t insert_cnt;
+
void add_redirect (Redirect *);
void remove_redirect (Redirect *);
diff --git a/libs/ardour/ardour/session_playlist.h b/libs/ardour/ardour/session_playlist.h
index 6f1b8dbd12..20cf4d8f2e 100644
--- a/libs/ardour/ardour/session_playlist.h
+++ b/libs/ardour/ardour/session_playlist.h
@@ -27,7 +27,7 @@
namespace ARDOUR {
template<class T> void
-Session::foreach_playlist (T *obj, void (T::*func)(Playlist *))
+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/source.h b/libs/ardour/ardour/source.h
index e94b1af54f..8eaab14ec5 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -66,8 +66,8 @@ class Source : public PBD::StatefulDestructible
void use () { _in_use++; }
void disuse () { if (_in_use) { _in_use--; } }
- void add_playlist (ARDOUR::Playlist*);
- void remove_playlist (ARDOUR::Playlist*);
+ void add_playlist (boost::shared_ptr<ARDOUR::Playlist>);
+ void remove_playlist (boost::weak_ptr<ARDOUR::Playlist>);
uint32_t used() const;
@@ -83,7 +83,7 @@ class Source : public PBD::StatefulDestructible
time_t _timestamp;
jack_nframes_t _length;
- std::set<ARDOUR::Playlist*> _playlists;
+ std::set<boost::shared_ptr<ARDOUR::Playlist> > _playlists;
private:
uint32_t _in_use;
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index d7a2da2f46..eee04d9bfa 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -115,13 +115,12 @@ class Track : public Route
struct FreezeRecord {
FreezeRecord()
- : playlist(0)
- , have_mementos(false)
+ : have_mementos(false)
{}
~FreezeRecord();
- Playlist* playlist;
+ boost::shared_ptr<Playlist> playlist;
vector<FreezeRecordInsertInfo*> insert_info;
bool have_mementos;
FreezeState state;
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 1138b5208f..30cdcd8232 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -143,6 +143,18 @@ namespace ARDOUR {
}
};
+ enum SmpteFormat {
+ smpte_23976,
+ smpte_24,
+ smpte_24976,
+ smpte_25,
+ smpte_2997,
+ smpte_2997drop,
+ smpte_30,
+ smpte_30drop,
+ smpte_5994,
+ smpte_60
+ };
struct AnyTime {
enum Type {
@@ -322,7 +334,7 @@ namespace ARDOUR {
};
enum ShuttleUnits {
- Percentage,
+ Percentage,
Semitones
};
@@ -340,6 +352,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SlaveSource& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf);
using ARDOUR::nframes_t;
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index d926f52f82..de97a5c150 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -34,10 +34,9 @@
class XMLNode;
void elapsed_time_to_str (char *buf, uint32_t seconds);
-std::string legalize_for_path (std::string str);
+Glib::ustring legalize_for_path (Glib::ustring str);
std::ostream& operator<< (std::ostream& o, const ARDOUR::BBT_Time& bbt);
XMLNode* find_named_node (const XMLNode& node, std::string name);
-std::string placement_as_string (ARDOUR::Placement);
static inline float f_max(float x, float a) {
x -= a;
@@ -52,10 +51,11 @@ int cmp_nocase (const std::string& s, const std::string& s2);
int tokenize_fullpath (std::string fullpath, std::string& path, std::string& name);
-int touch_file(std::string path);
+int touch_file(Glib::ustring path);
-std::string region_name_from_path (std::string path);
-std::string path_expand (std::string);
+Glib::ustring path_expand (Glib::ustring);
+Glib::ustring region_name_from_path (Glib::ustring path, bool strip_channels);
+bool path_is_paired (Glib::ustring path, Glib::ustring& pair_base);
void compute_equal_power_fades (nframes_t nframes, float* in, float* out);
@@ -66,6 +66,8 @@ const char* edit_mode_to_string (ARDOUR::EditMode);
ARDOUR::EditMode string_to_edit_mode (std::string);
float meter_falloff_to_float (ARDOUR::MeterFalloff);
+ARDOUR::MeterFalloff meter_falloff_from_float (float);
+float meter_falloff_to_db_per_sec (float);
float meter_hold_to_float (ARDOUR::MeterHold);
#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)