Use PBD::copy_file in Session::create() to copy the template file.
[ardour.git] / libs / ardour / ardour / audiofilesource.h
index 899b0ea3ff42affe60a3d1625dd6f074b62e72e4..149ceb7dc3a3fcd4dd895558579f66b91b731410 100644 (file)
@@ -56,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();
@@ -79,23 +81,24 @@ class AudioFileSource : public AudioSource {
        virtual void           mark_capture_start (nframes_t) {}
        virtual void           mark_capture_end () {}
        virtual void           clear_capture_marks() {}
+       virtual bool           one_of_several_channels () const { return false; }
 
        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 ();
@@ -118,37 +121,37 @@ class AudioFileSource : public AudioSource {
           to cause issues.
        */
 
-       virtual void handle_header_position_change () {}
+       virtual void handle_header_position_change ();
 
   protected:
        
        /* 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&, 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];
@@ -159,7 +162,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, uint16_t& chan);
        bool removable() const;
        bool writable() const { return _flags & Writable; }
 };