diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audiofilesource.h | 46 | ||||
-rw-r--r-- | libs/ardour/ardour/audiosource.h | 24 | ||||
-rw-r--r-- | libs/ardour/ardour/mix.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/sndfilesource.h | 6 |
5 files changed, 41 insertions, 38 deletions
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index 899b0ea3ff..6bc9ec4207 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -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(); @@ -83,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 (); @@ -124,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&, 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 +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/audiosource.h b/libs/ardour/ardour/audiosource.h index efd96e94eb..b1062c43a9 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -22,7 +22,6 @@ #include <list> #include <vector> -#include <string> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> @@ -30,6 +29,7 @@ #include <time.h> #include <glibmm/thread.h> +#include <glibmm/ustring.h> #include <sigc++/signal.h> @@ -40,7 +40,7 @@ using std::list; using std::vector; -using std::string; +using Glib::ustring; namespace ARDOUR { @@ -49,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 (); @@ -78,8 +78,8 @@ const nframes_t frames_per_peak = 256; virtual bool can_truncate_peaks() const { return true; } - void set_captured_for (string str) { _captured_for = str; } - string captured_for() const { return _captured_for; } + 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; } @@ -94,7 +94,7 @@ const nframes_t frames_per_peak = 256; XMLNode& get_state (); int set_state (const XMLNode&); - int rename_peakfile (std::string newpath); + int rename_peakfile (ustring newpath); void touch_peakfile (); static void set_build_missing_peakfiles (bool yn) { @@ -117,13 +117,13 @@ const nframes_t frames_per_peak = 256; bool _peaks_built; mutable Glib::Mutex _lock; nframes_t _length; - 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); + 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(); @@ -132,8 +132,8 @@ const nframes_t frames_per_peak = 256; 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; void update_length (nframes_t pos, nframes_t cnt); @@ -144,7 +144,7 @@ const nframes_t frames_per_peak = 256; Sample* peak_leftovers; nframes_t peak_leftover_frame; - bool file_changed (string path); + bool file_changed (ustring path); }; } diff --git a/libs/ardour/ardour/mix.h b/libs/ardour/ardour/mix.h index 68f57c1aa8..5555f5437e 100644 --- a/libs/ardour/ardour/mix.h +++ b/libs/ardour/ardour/mix.h @@ -68,7 +68,7 @@ void veclib_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src 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 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); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 05840cbc43..d65903ce85 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -608,6 +608,7 @@ class Session : public PBD::StatefulDestructible boost::shared_ptr<AudioFileSource> create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive); 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 */ diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 262dc46016..2fc3872887 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -30,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 */ @@ -59,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 (); |