- string newname = PBD::basename_nosuffix(_name.val());
- string newpath;
-
- /* get a new name for the MIDI file we're going to write to
- */
-
- do {
-
- newname = bump_name_once (newname, '-');
- /* XXX build path safely */
- newpath = _session.session_directory().midi_path().to_string() +"/"+ newname + ".mid";
-
- } while (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS));
-
- boost::shared_ptr<MidiSource> newsrc = boost::dynamic_pointer_cast<MidiSource>(
- SourceFactory::createWritable(DataType::MIDI, _session,
- newpath, string(), false, _session.frame_rate()));
-