summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/file_source.h28
-rw-r--r--libs/ardour/ardour/session.h15
-rw-r--r--libs/ardour/ardour/session_configuration_vars.h2
3 files changed, 37 insertions, 8 deletions
diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h
index aa4fe973b1..78210916f0 100644
--- a/libs/ardour/ardour/file_source.h
+++ b/libs/ardour/ardour/file_source.h
@@ -20,15 +20,25 @@
#ifndef __ardour_filesource_h__
#define __ardour_filesource_h__
+#include <list>
+#include <string>
#include <exception>
#include <time.h>
#include "ardour/source.h"
namespace ARDOUR {
-class MissingSource : public std::exception {
-public:
+class MissingSource : public std::exception
+{
+ public:
+ MissingSource (const std::string& p, DataType t) throw ()
+ : path (p), type (t) {}
+ ~MissingSource() throw() {}
+
virtual const char *what() const throw() { return "source file does not exist"; }
+
+ std::string path;
+ DataType type;
};
/** A source associated with a file on disk somewhere */
@@ -54,15 +64,19 @@ public:
int set_source_name (const std::string& newname, bool destructive);
- static void set_search_path (DataType type, const std::string& path);
+ static bool find (Session&, DataType type, const std::string& path,
+ bool must_exist, bool& is_new, uint16_t& chan,
+ std::string& found_path);
- static bool find (DataType type, const std::string& path,
- bool must_exist, bool& is_new, uint16_t& chan,
- std::string& found_path);
+ static bool find_2X (Session&, DataType type, const std::string& path,
+ bool must_exist, bool& is_new, uint16_t& chan,
+ std::string& found_path);
void inc_use_count ();
bool removable () const;
+ static PBD::Signal3<int,std::string,std::string,std::vector<std::string> > AmbiguousFileName;
+
protected:
FileSource (Session& session, DataType type,
const std::string& path,
@@ -81,8 +95,6 @@ protected:
bool _file_is_new;
uint16_t _channel;
bool _within_session;
-
- static std::map<DataType, std::string> search_paths;
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 7c7ff820e9..d0fe89ee52 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -785,6 +785,19 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void request_resume_timecode_transmission ();
bool timecode_transmission_suspended () const;
+ std::string source_search_path(DataType) const;
+
+ /* handlers can return an integer value:
+ 0: config.set_audio_search_path() or config.set_midi_search_path() was used
+ to modify the search path and we should try to find it again.
+ 1: quit entire session load
+ 2: as 0, but don't ask about other missing files
+ 3: don't ask about other missing files, and just mark this one missing
+ -1: just mark this one missing
+ any other value: as -1
+ */
+ static PBD::Signal3<int,Session*,std::string,DataType> MissingFile;
+
/** Emitted when the session wants Ardour to quit */
static PBD::Signal0<void> Quit;
@@ -1310,6 +1323,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
uint32_t _total_free_4k_blocks;
Glib::Mutex space_lock;
+ bool no_questions_about_missing_files;
+
std::string get_best_session_directory_for_new_source ();
mutable gint _playback_load;
diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h
index 828b2cbfcf..057cff01fe 100644
--- a/libs/ardour/ardour/session_configuration_vars.h
+++ b/libs/ardour/ardour/session_configuration_vars.h
@@ -35,6 +35,8 @@ CONFIG_VARIABLE (bool, punch_out, "punch-out", false)
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
CONFIG_VARIABLE (TimecodeFormat, timecode_format, "timecode-format", timecode_30)
CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", path_expand)
+CONFIG_VARIABLE_SPECIAL(std::string, audio_search_path, "audio-search-path", "", path_expand)
+CONFIG_VARIABLE_SPECIAL(std::string, midi_search_path, "midi-search-path", "", path_expand)
CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US")
CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US")
CONFIG_VARIABLE (LayerModel, layer_model, "layer-model", MoveAddHigher)