diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-09-07 15:07:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-09-07 15:07:14 +0000 |
commit | f2c8ae66c09d2caffa44743eef0a0ab873024d9a (patch) | |
tree | 8118a863600071cc545b4a127e7bb13d3e2c75fe /libs/ardour/session.cc | |
parent | babf75d871ee253fbe32c50737aa110a4fffa36f (diff) |
remove all duplicated _id members from children of PBD::Stateful.
Sources now know about Session.
rearrange session directory heirarchy. remove tape_dir stuff.
NSD allows absolute/relative paths to be typed straight into the text entry.
Session history reloaded after all 3rd party registrations done.
Editor restores its ID; other objects still need this.
use g_mkdir_with_parents() instead of mkdir()
one example of using g_file_test() instead of access.
git-svn-id: svn://localhost/ardour2/trunk@908 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b9888dfd30..bafb43a57c 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -81,10 +81,11 @@ using boost::shared_ptr; const char* Session::_template_suffix = X_(".template"); const char* Session::_statefile_suffix = X_(".ardour"); const char* Session::_pending_suffix = X_(".pending"); -const char* Session::sound_dir_name = X_("sounds"); -const char* Session::tape_dir_name = X_("tapes"); +const char* Session::old_sound_dir_name = X_("sounds"); +const char* Session::sound_dir_name = X_("audiofiles"); const char* Session::peak_dir_name = X_("peaks"); const char* Session::dead_sound_dir_name = X_("dead_sounds"); +const char* Session::interchange_dir_name = X_("interchange"); Session::compute_peak_t Session::compute_peak = 0; Session::apply_gain_to_buffer_t Session::apply_gain_to_buffer = 0; @@ -2799,17 +2800,11 @@ Session::source_by_id (const PBD::ID& id) } string -Session::peak_path_from_audio_path (string audio_path) +Session::peak_path_from_audio_path (string audio_path) const { - /* XXX hardly bombproof! fix me */ - string res; - res = Glib::path_get_dirname (audio_path); - res = Glib::path_get_dirname (res); - res += '/'; - res += peak_dir_name; - res += '/'; + res = peak_dir (); res += PBD::basename_nosuffix (audio_path); res += ".peak"; @@ -2955,11 +2950,7 @@ Session::audio_path_from_name (string name, uint32_t nchan, uint32_t chan, bool spath = (*i).path; - if (destructive) { - spath += tape_dir_name; - } else { - spath += sound_dir_name; - } + spath += sound_dir_name; if (destructive) { if (nchan < 2) { @@ -3016,11 +3007,7 @@ Session::audio_path_from_name (string name, uint32_t nchan, uint32_t chan, bool string foo = buf; - if (destructive) { - spath = tape_dir (); - } else { - spath = discover_best_sound_dir (); - } + spath = discover_best_sound_dir (); string::size_type pos = foo.find_last_of ('/'); @@ -3037,7 +3024,7 @@ boost::shared_ptr<AudioFileSource> Session::create_audio_source_for_session (AudioDiskstream& ds, uint32_t chan, bool destructive) { string spath = audio_path_from_name (ds.name(), ds.n_channels(), chan, destructive); - return boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createWritable (spath, destructive, frame_rate())); + return boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createWritable (*this, spath, destructive, frame_rate())); } /* Playlist management */ @@ -3206,7 +3193,7 @@ Session::remove_empty_sounds () for (vector<string *>::iterator i = possible_audiofiles->begin(); i != possible_audiofiles->end(); ++i) { - if (AudioFileSource::is_empty (*(*i))) { + if (AudioFileSource::is_empty (*this, *(*i))) { unlink ((*i)->c_str()); @@ -3386,7 +3373,7 @@ jack_nframes_t Session::available_capture_duration () { const double scale = 4096.0 / sizeof (Sample); - + if (_total_free_4k_blocks * scale > (double) max_frames) { return max_frames; } @@ -3713,7 +3700,7 @@ Session::write_one_audio_track (AudioTrack& track, jack_nframes_t start, jack_nf } try { - fsource = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createWritable (buf, false, frame_rate())); + fsource = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createWritable (*this, buf, false, frame_rate())); } catch (failed_constructor& err) { |