From ca40990444b09d1de532c572793ab702840714f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 6 Jun 2007 15:39:56 +0000 Subject: Fix MIDI session path problems (thanks timbyr). Fix conversion warnings in smf_source.cc. git-svn-id: svn://localhost/ardour2/trunk@1957 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/session.h | 1 - libs/ardour/directory_names.cc | 2 +- libs/ardour/session_directory.cc | 1 + libs/ardour/session_state.cc | 27 --------------------------- libs/ardour/smf_source.cc | 4 ++-- 5 files changed, 4 insertions(+), 31 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 6cf7f9530b..80362e45b5 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -256,7 +256,6 @@ class Session : public PBD::StatefulDestructible sigc::signal DirtyChanged; std::string sound_dir (bool with_path = true) const; - std::string midi_dir (bool with_path = true) const; std::string peak_dir () const; std::string dead_sound_dir () const; std::string automation_dir () const; diff --git a/libs/ardour/directory_names.cc b/libs/ardour/directory_names.cc index becef7c519..602d23e737 100644 --- a/libs/ardour/directory_names.cc +++ b/libs/ardour/directory_names.cc @@ -6,7 +6,7 @@ namespace ARDOUR { const char* const old_sound_dir_name = X_("sounds"); const char* const sound_dir_name = X_("audiofiles"); -const char* const midi_dir_name = X_("audiofiles"); +const char* const midi_dir_name = X_("midifiles"); const char* const peak_dir_name = X_("peaks"); const char* const dead_sound_dir_name = X_("dead_sounds"); const char* const interchange_dir_name = X_("interchange"); diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc index 4a9ff1b988..0b778d85ca 100644 --- a/libs/ardour/session_directory.cc +++ b/libs/ardour/session_directory.cc @@ -142,6 +142,7 @@ SessionDirectory::sub_directories () const vector tmp_paths; tmp_paths.push_back ( sound_path () ); + tmp_paths.push_back ( midi_path () ); tmp_paths.push_back ( peak_path () ); tmp_paths.push_back ( dead_sound_path () ); tmp_paths.push_back ( export_path () ); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 7f53f9c5b1..285e3fd4c4 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2036,33 +2036,6 @@ Session::sound_dir (bool with_path) const return res; } -string -Session::midi_dir (bool with_path) const -{ - string res; - string full; - - if (with_path) { - res = _path; - } else { - full = _path; - } - - res += interchange_dir_name; - res += '/'; - res += legalize_for_path (_name); - res += '/'; - res += midi_dir_name; - - if (with_path) { - full = res; - } else { - full += res; - } - - return res; -} - string Session::peak_dir () const { diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 0bc02f3998..730ba053bd 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -370,7 +370,7 @@ SMFSource::write_unlocked (MidiRingBuffer& src, nframes_t cnt) assert(ev.time >= _timeline_position); ev.time -= _timeline_position; assert(ev.time >= _last_ev_time); - const uint32_t delta_time = (uint32_t)(ev.time - _last_ev_time) / frames_per_beat * _ppqn; + const uint32_t delta_time = (uint32_t)((ev.time - _last_ev_time) / frames_per_beat * _ppqn); /*printf("SMF - writing event, delta = %u, size = %zu, data = ", delta_time, ev.size); @@ -781,7 +781,7 @@ SMFSource::load_model(bool lock) fseek(_fd, _header_size, 0); - double time = 0; + nframes_t time = 0; MidiEvent ev; int ret; -- cgit v1.2.3