summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/coreaudiosource.h2
-rw-r--r--libs/ardour/ardour/directory_names.h1
-rw-r--r--libs/ardour/ardour/file_source.h6
-rw-r--r--libs/ardour/ardour/session.h10
-rw-r--r--libs/ardour/ardour/session_directory.h18
-rw-r--r--libs/ardour/ardour/smf_source.h5
-rw-r--r--libs/ardour/ardour/sndfilesource.h1
-rw-r--r--libs/ardour/ardour/source.h4
-rw-r--r--libs/ardour/ardour/types.h3
9 files changed, 42 insertions, 8 deletions
diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h
index f25f1b0154..33a493b040 100644
--- a/libs/ardour/ardour/coreaudiosource.h
+++ b/libs/ardour/ardour/coreaudiosource.h
@@ -34,6 +34,8 @@ class CoreAudioSource : public AudioFileSource {
CoreAudioSource (ARDOUR::Session&, const string& path, int chn, Flag);
~CoreAudioSource ();
+ void set_path (const std::string& p);
+
float sample_rate() const;
int update_header (sframes_t when, struct tm&, time_t);
diff --git a/libs/ardour/ardour/directory_names.h b/libs/ardour/ardour/directory_names.h
index cd3217b3b9..9cce077ad0 100644
--- a/libs/ardour/ardour/directory_names.h
+++ b/libs/ardour/ardour/directory_names.h
@@ -20,6 +20,7 @@ extern const char* const templates_dir_name;
extern const char* const route_templates_dir_name;
extern const char* const surfaces_dir_name;
extern const char* const user_config_dir_name;
+extern const char* const stub_dir_name;
};
diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h
index 38449def26..dfb1b43e58 100644
--- a/libs/ardour/ardour/file_source.h
+++ b/libs/ardour/ardour/file_source.h
@@ -35,6 +35,9 @@ public:
class FileSource : virtual public Source {
public:
const Glib::ustring& path() const { return _path; }
+
+ int unstubify ();
+ void stubify ();
virtual bool safe_file_extension (const Glib::ustring& path) const = 0;
@@ -57,6 +60,8 @@ public:
bool must_exist, bool& is_new, uint16_t& chan,
Glib::ustring& found_path);
+ void inc_use_count ();
+
protected:
FileSource (Session& session, DataType type,
const Glib::ustring& path,
@@ -66,6 +71,7 @@ protected:
virtual int init (const Glib::ustring& idstr, bool must_exist);
+ virtual void set_path (const std::string&);
virtual int move_dependents_to_trash() { return 0; }
void set_within_session_from_path (const std::string&);
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 5255654005..aa75cb17e6 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -185,7 +185,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
std::string peak_path_from_audio_path (std::string) const;
std::string new_audio_source_name (const std::string&, uint32_t nchans, uint32_t chan, bool destructive);
std::string new_midi_source_name (const std::string&);
- std::string new_source_path_from_name (DataType type, const std::string&);
+ std::string new_source_path_from_name (DataType type, const std::string&, bool as_stub = false);
RouteList new_route_from_template (uint32_t how_many, const std::string& template_path);
void process (nframes_t nframes);
@@ -533,9 +533,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
*/
static PBD::Signal0<int> AskAboutPendingState;
- boost::shared_ptr<AudioFileSource> create_audio_source_for_session (size_t, std::string const &, uint32_t, bool);
-
- boost::shared_ptr<MidiSource> create_midi_source_for_session (Track*, std::string const &);
+ boost::shared_ptr<AudioFileSource> create_audio_source_for_session (size_t, std::string const &, uint32_t,
+ bool destructive, bool as_stub = false);
+
+ boost::shared_ptr<MidiSource> create_midi_source_for_session (Track*, std::string const &, bool as_stub = false);
boost::shared_ptr<Source> source_by_id (const PBD::ID&);
boost::shared_ptr<Source> source_by_path_and_channel (const Glib::ustring&, uint16_t);
@@ -1415,6 +1416,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void add_session_range_location (nframes_t, nframes_t);
void setup_midi_machine_control ();
+ void cleanup_stubfiles ();
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/session_directory.h b/libs/ardour/ardour/session_directory.h
index ae6aa256cb..bcde4bdf2c 100644
--- a/libs/ardour/ardour/session_directory.h
+++ b/libs/ardour/ardour/session_directory.h
@@ -53,6 +53,17 @@ public:
/**
* @return the absolute path to the directory in which
+ * the session stores STUB audio files.
+ *
+ * If the session is an older session with an existing
+ * "sounds" directory then it will return a path to that
+ * directory otherwise it will return the new location
+ * of root_path()/interchange/session_name/audiofiles/.stubs
+ */
+ const PBD::sys::path sound_stub_path () const;
+
+ /**
+ * @return the absolute path to the directory in which
* the session stores MIDI files, ie
* root_path()/interchange/session_name/midifiles
*/
@@ -60,6 +71,13 @@ public:
/**
* @return the absolute path to the directory in which
+ * the session stores STUB MIDI files, ie
+ * root_path()/interchange/session_name/midifiles/.stubs
+ */
+ const PBD::sys::path midi_stub_path () const;
+
+ /**
+ * @return the absolute path to the directory in which
* the session stores MIDNAM patch files, ie
* root_path()/interchange/session_name/patchfiles
*/
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 6dcea9dd60..956fb6c75f 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -69,7 +69,10 @@ public:
static bool safe_midi_file_extension (const Glib::ustring& path);
-private:
+ protected:
+ void set_path (const std::string& newpath);
+
+ private:
nframes_t read_unlocked (Evoral::EventSink<nframes_t>& dst,
sframes_t position,
sframes_t start,
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index 9a01892ccf..151889dbb5 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -66,6 +66,7 @@ class SndFileSource : public AudioFileSource {
static int get_soundfile_info (const Glib::ustring& path, SoundFileInfo& _info, std::string& error_msg);
protected:
+ void set_path (const std::string& p);
void set_header_timeline_position ();
framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const;
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h
index 6f750e6fd0..cb46e90085 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -105,8 +105,8 @@ class Source : public SessionObject
Glib::Mutex& mutex() { return _lock; }
Flag flags() const { return _flags; }
- void inc_use_count () { g_atomic_int_inc (&_use_count); }
- void dec_use_count ();
+ virtual void inc_use_count ();
+ virtual void dec_use_count ();
int use_count() const { return g_atomic_int_get (&_use_count); }
bool used() const { return use_count() > 0; }
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index cff8a12fd5..c666545dfa 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -27,6 +27,7 @@
#include <istream>
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <sys/types.h>
#include <inttypes.h>
#include <jack/types.h>
@@ -440,7 +441,7 @@ namespace ARDOUR {
struct CleanupReport {
std::vector<std::string> paths;
- int64_t space;
+ size_t space;
};
enum PositionLockStyle {