string dir = session->export_dir();
string::size_type last_slash;
- if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) {
+ if ((last_slash = dir.find_last_of (G_DIR_SEPARATOR_S)) != string::npos && last_slash != 0) {
dir = dir.substr (0, last_slash+1);
}
if (!wants_dir()) {
- dir = dir + "export.wav";
+ dir = dir + "export.wav"; // Glib::build_filename() ?
}
file_entry.set_text (dir);
ustring
AudioFileSource::broken_peak_path (ustring audio_path)
{
- ustring res;
-
- res = _session.peak_dir ();
- res += PBD::basename_nosuffix (audio_path);
- res += ".peak";
-
- return res;
+ return Glib::build_filename(_session.peak_dir (), PBD::basename_nosuffix (audio_path) + ".peak");
}
ustring
#include <sigc++/bind.h>
+#include <glibmm.h>
#include <glibmm/thread.h>
#include <pbd/xml++.h>
float version;
LocaleGuard lg (X_("POSIX"));
- fullpath = _session.automation_dir();
- fullpath += path;
+ fullpath = Glib::build_filename(_session.automation_dir(), path);
in.open (fullpath.c_str());
if (!in) {
- fullpath = _session.automation_dir();
- fullpath += _session.snap_name();
- fullpath += '-';
- fullpath += path;
+ fullpath = Glib::build_filename(_session.automation_dir(), _session.snap_name() + '-' + path);
in.open (fullpath.c_str());
/* automation path is relative */
- automation_path = _session.automation_dir();
- automation_path += prop->value ();
+ automation_path = Glib::build_filename(_session.automation_dir(), prop->value ());
}
return 0;
void
Panner::set_name (string str)
{
- automation_path = _session.automation_dir();
- automation_path += _session.snap_name();
- automation_path += "-pan-";
- automation_path += legalize_for_path (str);
- automation_path += ".automation";
+ automation_path = Glib::build_filename(_session.automation_dir(),
+ _session.snap_name() + "-pan-" + legalize_for_path (str) + ".automation");
}
int
#include <sigc++/bind.h>
+#include <glibmm.h>
+
#include <pbd/xml++.h>
#include <pbd/enumwriter.h>
if (path[0] == '/') { // legacy
fullpath = path;
} else {
- fullpath = _session.automation_dir();
- fullpath += path;
+ fullpath = Glib::build_filename(_session.automation_dir(), path);
}
ifstream in (fullpath.c_str());
Glib::ustring
Session::peak_path (Glib::ustring base) const
{
- Glib::ustring res;
-
- res = peak_dir ();
- res += base;
- res += ".peak";
-
- return res;
+ return Glib::build_filename(peak_dir (), base + ".peak");
}
string