remove Glib::ustring from libardour; allow any characters except '/' and '\' in paths (may cause issues when loading creatively named 2.X sessions; fix a couple of details of name collection and usage from the startup dialog

git-svn-id: svn://localhost/ardour2/branches/3.0@7772 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-09-14 15:45:21 +00:00
parent 875f0befd5
commit 4d112a8e6b
57 changed files with 563 additions and 474 deletions

View file

@ -118,6 +118,8 @@ sigc::signal<void> ARDOUR_UI::RapidScreenUpdate;
sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate; sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate;
sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock; sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock;
bool could_be_a_valid_path (const string& path);
ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
: Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp), : Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp),
@ -2465,9 +2467,9 @@ ARDOUR_UI::loading_message (const std::string& /*msg*/)
int int
ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, string load_template) ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, string load_template)
{ {
Glib::ustring session_name; string session_name;
Glib::ustring session_path; string session_path;
Glib::ustring template_name; string template_name;
int ret = -1; int ret = -1;
bool likely_new = false; bool likely_new = false;
@ -2496,6 +2498,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
} else { } else {
bool const apply = run_startup (should_be_new, load_template); bool const apply = run_startup (should_be_new, load_template);
if (!apply) { if (!apply) {
if (quit_on_cancel) { if (quit_on_cancel) {
exit (1); exit (1);
@ -2513,16 +2516,17 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
/* this shouldn't happen, but we catch it just in case it does */ /* this shouldn't happen, but we catch it just in case it does */
if (session_name.empty()) { if (session_name.empty()) {
break; continue;
} }
if (_startup->use_session_template()) { if (_startup->use_session_template()) {
template_name = _startup->session_template_name(); template_name = _startup->session_template_name();
_session_is_new = true; _session_is_new = true;
} }
if (session_name[0] == '/' || if (session_name[0] == G_DIR_SEPARATOR ||
(session_name.length() > 2 && session_name[0] == '.' && session_name[1] == '/') || (session_name.length() > 2 && session_name[0] == '.' && session_name[1] == G_DIR_SEPARATOR) ||
(session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == '/')) { (session_name.length() > 3 && session_name[0] == '.' && session_name[1] == '.' && session_name[2] == G_DIR_SEPARATOR)) {
/* absolute path or cwd-relative path specified for session name: infer session folder /* absolute path or cwd-relative path specified for session name: infer session folder
from what was given. from what was given.
@ -2534,6 +2538,22 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
} else { } else {
session_path = _startup->session_folder(); session_path = _startup->session_folder();
if (session_name.find ('/') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '/' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
if (session_name.find ('\\') != string::npos) {
MessageDialog msg (*_startup, _("To ensure compatibility with various systems\n"
"session names may not contain a '\\' character"));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
}
} }
} }

View file

@ -3223,7 +3223,7 @@ Editor::setup_midi_toolbar ()
int int
Editor::convert_drop_to_paths ( Editor::convert_drop_to_paths (
vector<ustring>& paths, vector<string>& paths,
const RefPtr<Gdk::DragContext>& /*context*/, const RefPtr<Gdk::DragContext>& /*context*/,
gint /*x*/, gint /*x*/,
gint /*y*/, gint /*y*/,

View file

@ -27,8 +27,6 @@
#include <sys/time.h> #include <sys/time.h>
#include <bitset> #include <bitset>
#include <glibmm/ustring.h>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <libgnomecanvasmm/canvas.h> #include <libgnomecanvasmm/canvas.h>
@ -424,8 +422,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>); int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&); void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&); void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions); void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
@ -1172,21 +1170,21 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void session_import_dialog (); void session_import_dialog ();
int check_whether_and_how_to_import(std::string, bool all_or_nothing = true); int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
bool check_multichannel_status (const std::vector<Glib::ustring>& paths); bool check_multichannel_status (const std::vector<std::string>& paths);
SoundFileOmega* sfbrowser; SoundFileOmega* sfbrowser;
void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos); void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos); bool idle_drop_paths (std::vector<std::string> paths, nframes64_t frame, double ypos);
void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos); void drop_paths_part_two (const std::vector<std::string>& paths, nframes64_t frame, double ypos);
int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos, int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool); int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool);
int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, int embed_sndfiles (std::vector<std::string> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&); nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode, int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix); int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode, int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
boost::shared_ptr<ARDOUR::Track>& existing_track); boost::shared_ptr<ARDOUR::Track>& existing_track);
@ -1217,7 +1215,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* to support this ... */ /* to support this ... */
void import_audio (bool as_tracks); void import_audio (bool as_tracks);
void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks); void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
void move_to_start (); void move_to_start ();
void move_to_end (); void move_to_end ();
@ -1722,7 +1720,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* Drag-n-Drop */ /* Drag-n-Drop */
int convert_drop_to_paths ( int convert_drop_to_paths (
std::vector<Glib::ustring>& paths, std::vector<std::string>& paths,
const Glib::RefPtr<Gdk::DragContext>& context, const Glib::RefPtr<Gdk::DragContext>& context,
gint x, gint x,
gint y, gint y,

View file

@ -24,6 +24,8 @@
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <glibmm/ustring.h>
#include <sndfile.h> #include <sndfile.h>
#include "pbd/pthread_utils.h" #include "pbd/pthread_utils.h"
@ -94,7 +96,7 @@ Editor::add_external_audio_action (ImportMode mode_hint)
void void
Editor::external_audio_dialog () Editor::external_audio_dialog ()
{ {
vector<Glib::ustring> paths; vector<string> paths;
uint32_t track_cnt; uint32_t track_cnt;
if (_session == 0) { if (_session == 0) {
@ -148,7 +150,10 @@ Editor::external_audio_dialog ()
/* lets do it */ /* lets do it */
paths = sfbrowser->get_paths (); vector<ustring> upaths = sfbrowser->get_paths ();
for (vector<ustring>::iterator x = upaths.begin(); x != upaths.end(); ++x) {
paths.push_back (*x);
}
ImportPosition pos = sfbrowser->get_position (); ImportPosition pos = sfbrowser->get_position ();
ImportMode mode = sfbrowser->get_mode (); ImportMode mode = sfbrowser->get_mode ();
@ -322,10 +327,10 @@ Editor::get_nth_selected_midi_track (int nth) const
} }
void void
Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos) Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
{ {
boost::shared_ptr<Track> track; boost::shared_ptr<Track> track;
vector<ustring> to_import; vector<string> to_import;
int nth = 0; int nth = 0;
bool use_timestamp = (pos == -1); bool use_timestamp = (pos == -1);
@ -342,7 +347,7 @@ Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mod
*/ */
bool cancel = false; bool cancel = false;
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) { for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
int check = check_whether_and_how_to_import(*a, false); int check = check_whether_and_how_to_import(*a, false);
if (check == 2) { if (check == 2) {
cancel = true; cancel = true;
@ -359,7 +364,7 @@ Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mod
bool replace = false; bool replace = false;
bool ok = true; bool ok = true;
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) { for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
const int check = check_whether_and_how_to_import (*a, true); const int check = check_whether_and_how_to_import (*a, true);
@ -423,18 +428,18 @@ Editor::do_import (vector<ustring> paths, ImportDisposition chns, ImportMode mod
} }
void void
Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode, nframes64_t& pos) Editor::do_embed (vector<string> paths, ImportDisposition chns, ImportMode mode, nframes64_t& pos)
{ {
boost::shared_ptr<Track> track; boost::shared_ptr<Track> track;
bool check_sample_rate = true; bool check_sample_rate = true;
bool ok = false; bool ok = false;
vector<ustring> to_embed; vector<string> to_embed;
bool multi = paths.size() > 1; bool multi = paths.size() > 1;
int nth = 0; int nth = 0;
switch (chns) { switch (chns) {
case Editing::ImportDistinctFiles: case Editing::ImportDistinctFiles:
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) { for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
to_embed.clear (); to_embed.clear ();
to_embed.push_back (*a); to_embed.push_back (*a);
@ -450,7 +455,7 @@ Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode
break; break;
case Editing::ImportDistinctChannels: case Editing::ImportDistinctChannels:
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) { for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
to_embed.clear (); to_embed.clear ();
to_embed.push_back (*a); to_embed.push_back (*a);
@ -468,7 +473,7 @@ Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode
break; break;
case Editing::ImportSerializeFiles: case Editing::ImportSerializeFiles:
for (vector<ustring>::iterator a = paths.begin(); a != paths.end(); ++a) { for (vector<string>::iterator a = paths.begin(); a != paths.end(); ++a) {
to_embed.clear (); to_embed.clear ();
to_embed.push_back (*a); to_embed.push_back (*a);
@ -489,7 +494,7 @@ Editor::do_embed (vector<ustring> paths, ImportDisposition chns, ImportMode mode
} }
int int
Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality quality, nframes64_t& pos, Editor::import_sndfiles (vector<string> paths, ImportMode mode, SrcQuality quality, nframes64_t& pos,
int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool replace) int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool replace)
{ {
import_status.paths = paths; import_status.paths = paths;
@ -546,7 +551,7 @@ Editor::import_sndfiles (vector<ustring> paths, ImportMode mode, SrcQuality qual
} }
int int
Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile, Editor::embed_sndfiles (vector<string> paths, bool multifile,
bool& check_sample_rate, ImportMode mode, nframes64_t& pos, int target_regions, int target_tracks, bool& check_sample_rate, ImportMode mode, nframes64_t& pos, int target_regions, int target_tracks,
boost::shared_ptr<Track>& track) boost::shared_ptr<Track>& track)
{ {
@ -555,14 +560,14 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
string linked_path; string linked_path;
SoundFileInfo finfo; SoundFileInfo finfo;
int ret = 0; int ret = 0;
Glib::ustring path_to_use; string path_to_use;
track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH)); track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
gdk_flush (); gdk_flush ();
for (vector<Glib::ustring>::iterator p = paths.begin(); p != paths.end(); ++p) { for (vector<string>::iterator p = paths.begin(); p != paths.end(); ++p) {
ustring path = *p; string path = *p;
if (Config->get_try_link_for_embed()) { if (Config->get_try_link_for_embed()) {
@ -714,11 +719,11 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
} }
int int
Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64_t& pos, ImportMode mode, Editor::add_sources (vector<string> paths, SourceList& sources, nframes64_t& pos, ImportMode mode,
int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool /*add_channel_suffix*/) int target_regions, int target_tracks, boost::shared_ptr<Track>& track, bool /*add_channel_suffix*/)
{ {
vector<boost::shared_ptr<Region> > regions; vector<boost::shared_ptr<Region> > regions;
ustring region_name; string region_name;
uint32_t input_chan = 0; uint32_t input_chan = 0;
uint32_t output_chan = 0; uint32_t output_chan = 0;
bool use_timestamp; bool use_timestamp;

View file

@ -443,14 +443,14 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context
} }
bool bool
Editor::idle_drop_paths (vector<ustring> paths, nframes64_t frame, double ypos) Editor::idle_drop_paths (vector<string> paths, nframes64_t frame, double ypos)
{ {
drop_paths_part_two (paths, frame, ypos); drop_paths_part_two (paths, frame, ypos);
return false; return false;
} }
void void
Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, double ypos) Editor::drop_paths_part_two (const vector<string>& paths, nframes64_t frame, double ypos)
{ {
RouteTimeAxisView* tv; RouteTimeAxisView* tv;
@ -490,7 +490,7 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
const SelectionData& data, const SelectionData& data,
guint info, guint time) guint info, guint time)
{ {
vector<ustring> paths; vector<string> paths;
GdkEvent ev; GdkEvent ev;
nframes64_t frame; nframes64_t frame;
double wx; double wx;

View file

@ -1119,7 +1119,7 @@ EditorRegions::drag_data_received (const RefPtr<Gdk::DragContext>& context,
const SelectionData& data, const SelectionData& data,
guint info, guint time) guint info, guint time)
{ {
vector<ustring> paths; vector<string> paths;
if (data.get_target() == "GTK_TREE_MODEL_ROW") { if (data.get_target() == "GTK_TREE_MODEL_ROW") {
/* something is being dragged over the region list */ /* something is being dragged over the region list */

View file

@ -33,6 +33,7 @@
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using std::string;
ExportDialog::ExportDialog (PublicEditor & editor, Glib::ustring title) : ExportDialog::ExportDialog (PublicEditor & editor, Glib::ustring title) :
ArdourDialog (title), ArdourDialog (title),
@ -243,18 +244,18 @@ ExportDialog::update_warnings ()
boost::shared_ptr<ExportProfileManager::Warnings> warnings = profile_manager->get_warnings(); boost::shared_ptr<ExportProfileManager::Warnings> warnings = profile_manager->get_warnings();
for (std::list<Glib::ustring>::iterator it = warnings->errors.begin(); it != warnings->errors.end(); ++it) { for (std::list<string>::iterator it = warnings->errors.begin(); it != warnings->errors.end(); ++it) {
add_error (*it); add_error (*it);
} }
for (std::list<Glib::ustring>::iterator it = warnings->warnings.begin(); it != warnings->warnings.end(); ++it) { for (std::list<string>::iterator it = warnings->warnings.begin(); it != warnings->warnings.end(); ++it) {
add_warning (*it); add_warning (*it);
} }
if (!warnings->conflicting_filenames.empty()) { if (!warnings->conflicting_filenames.empty()) {
list_files_hbox.show (); list_files_hbox.show ();
for (std::list<Glib::ustring>::iterator it = warnings->conflicting_filenames.begin(); it != warnings->conflicting_filenames.end(); ++it) { for (std::list<string>::iterator it = warnings->conflicting_filenames.begin(); it != warnings->conflicting_filenames.end(); ++it) {
Glib::ustring::size_type pos = it->find_last_of ("/"); string::size_type pos = it->find_last_of ("/");
list_files_string += "\n" + it->substr (0, pos + 1) + "<b>" + it->substr (pos + 1) + "</b>"; list_files_string += "\n" + it->substr (0, pos + 1) + "<b>" + it->substr (pos + 1) + "</b>";
} }
} }
@ -350,7 +351,7 @@ ExportDialog::progress_timeout ()
} }
void void
ExportDialog::add_error (Glib::ustring const & text) ExportDialog::add_error (string const & text)
{ {
fast_export_button->set_sensitive (false); fast_export_button->set_sensitive (false);
//rt_export_button->set_sensitive (false); //rt_export_button->set_sensitive (false);
@ -365,7 +366,7 @@ ExportDialog::add_error (Glib::ustring const & text)
} }
void void
ExportDialog::add_warning (Glib::ustring const & text) ExportDialog::add_warning (string const & text)
{ {
if (warn_string.empty()) { if (warn_string.empty()) {
warn_string = _("<span color=\"#ffa755\">Warning: ") + text + "</span>"; warn_string = _("<span color=\"#ffa755\">Warning: ") + text + "</span>";
@ -378,7 +379,7 @@ ExportDialog::add_warning (Glib::ustring const & text)
/*** Dialog specializations ***/ /*** Dialog specializations ***/
ExportRangeDialog::ExportRangeDialog (PublicEditor & editor, Glib::ustring range_id) : ExportRangeDialog::ExportRangeDialog (PublicEditor & editor, string range_id) :
ExportDialog (editor, _("Export Range")), ExportDialog (editor, _("Export Range")),
range_id (range_id) range_id (range_id)
{} {}
@ -422,7 +423,7 @@ ExportRegionDialog::init_gui ()
void void
ExportRegionDialog::init_components () ExportRegionDialog::init_components ()
{ {
Glib::ustring loc_id = profile_manager->set_single_range (region.position(), region.position() + region.length(), region.name()); string loc_id = profile_manager->set_single_range (region.position(), region.position() + region.length(), region.name());
preset_selector.reset (new ExportPresetSelector ()); preset_selector.reset (new ExportPresetSelector ());
timespan_selector.reset (new ExportTimespanSelectorSingle (_session, profile_manager, loc_id)); timespan_selector.reset (new ExportTimespanSelectorSingle (_session, profile_manager, loc_id));

View file

@ -22,6 +22,7 @@
#define __export_dialog_h__ #define __export_dialog_h__
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <string>
#include "ardour/export_profile_manager.h" #include "ardour/export_profile_manager.h"
@ -120,8 +121,8 @@ class ExportDialog : public ArdourDialog {
Gtk::Button list_files_button; Gtk::Button list_files_button;
Glib::ustring list_files_string; Glib::ustring list_files_string;
void add_error (Glib::ustring const & text); void add_error (std::string const & text);
void add_warning (Glib::ustring const & text); void add_warning (std::string const & text);
/* Progress bar */ /* Progress bar */
@ -140,12 +141,12 @@ class ExportDialog : public ArdourDialog {
class ExportRangeDialog : public ExportDialog class ExportRangeDialog : public ExportDialog
{ {
public: public:
ExportRangeDialog (PublicEditor & editor, Glib::ustring range_id); ExportRangeDialog (PublicEditor & editor, std::string range_id);
private: private:
void init_components (); void init_components ();
Glib::ustring range_id; std::string range_id;
}; };
class ExportSelectionDialog : public ExportDialog class ExportSelectionDialog : public ExportDialog

View file

@ -21,12 +21,12 @@
#ifndef __export_format_selector_h__ #ifndef __export_format_selector_h__
#define __export_format_selector_h__ #define __export_format_selector_h__
#include "ardour/export_profile_manager.h" #include <string>
#include <gtkmm.h> #include <gtkmm.h>
#include <sigc++/signal.h> #include <sigc++/signal.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include "ardour/export_profile_manager.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
namespace ARDOUR { namespace ARDOUR {
@ -76,7 +76,7 @@ class ExportFormatSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr
{ {
public: public:
Gtk::TreeModelColumn<FormatPtr> format; Gtk::TreeModelColumn<FormatPtr> format;
Gtk::TreeModelColumn<Glib::ustring> label; Gtk::TreeModelColumn<std::string> label;
FormatCols () { add (format); add (label); } FormatCols () { add (format); add (label); }
}; };

View file

@ -37,7 +37,7 @@ using namespace Glib;
/*** MetadataField ***/ /*** MetadataField ***/
MetadataField::MetadataField (ustring const & field_name) : MetadataField::MetadataField (string const & field_name) :
_name (field_name) _name (field_name)
{ {
} }
@ -46,7 +46,7 @@ MetadataField::~MetadataField() { }
/* TextMetadataField */ /* TextMetadataField */
TextMetadataField::TextMetadataField (Getter getter, Setter setter, ustring const & field_name, guint width ) : TextMetadataField::TextMetadataField (Getter getter, Setter setter, string const & field_name, guint width ) :
MetadataField (field_name), MetadataField (field_name),
getter (getter), getter (getter),
setter (setter), setter (setter),
@ -112,7 +112,7 @@ TextMetadataField::update_value ()
/* NumberMetadataField */ /* NumberMetadataField */
NumberMetadataField::NumberMetadataField (Getter getter, Setter setter, ustring const & field_name, guint numbers, guint width) : NumberMetadataField::NumberMetadataField (Getter getter, Setter setter, string const & field_name, guint numbers, guint width) :
MetadataField (field_name), MetadataField (field_name),
getter (getter), getter (getter),
setter (setter), setter (setter),
@ -183,7 +183,7 @@ NumberMetadataField::edit_widget ()
return *entry; return *entry;
} }
ustring string
NumberMetadataField::uint_to_str (uint32_t i) const NumberMetadataField::uint_to_str (uint32_t i) const
{ {
std::ostringstream oss (""); std::ostringstream oss ("");
@ -196,11 +196,11 @@ NumberMetadataField::uint_to_str (uint32_t i) const
} }
uint32_t uint32_t
NumberMetadataField::str_to_uint (ustring const & str) const NumberMetadataField::str_to_uint (string const & str) const
{ {
ustring tmp (str); string tmp (str);
ustring::size_type i; string::size_type i;
while ((i = tmp.find_first_not_of("1234567890")) != ustring::npos) { while ((i = tmp.find_first_not_of("1234567890")) != string::npos) {
tmp.erase (i, 1); tmp.erase (i, 1);
} }
@ -213,8 +213,8 @@ NumberMetadataField::str_to_uint (ustring const & str) const
/* SessionMetadataSet */ /* SessionMetadataSet */
SessionMetadataSet::SessionMetadataSet (ustring const & name) : SessionMetadataSet::SessionMetadataSet (string const & name)
name (name) : name (name)
{ {
} }
@ -226,8 +226,8 @@ SessionMetadataSet::add_data_field (MetadataPtr field)
/* SessionMetadataSetEditable */ /* SessionMetadataSetEditable */
SessionMetadataSetEditable::SessionMetadataSetEditable (ustring const & name) : SessionMetadataSetEditable::SessionMetadataSetEditable (string const & name)
SessionMetadataSet (name) : SessionMetadataSet (name)
{ {
table.set_row_spacings (6); table.set_row_spacings (6);
table.set_col_spacings (12); table.set_col_spacings (12);
@ -277,9 +277,9 @@ SessionMetadataSetEditable::save_data ()
/* SessionMetadataSetImportable */ /* SessionMetadataSetImportable */
SessionMetadataSetImportable::SessionMetadataSetImportable (ustring const & name) : SessionMetadataSetImportable::SessionMetadataSetImportable (string const & name)
SessionMetadataSet (name), : SessionMetadataSet (name)
session_list (list) , session_list (list)
{ {
tree = Gtk::ListStore::create (tree_cols); tree = Gtk::ListStore::create (tree_cols);
tree_view.set_model (tree); tree_view.set_model (tree);
@ -351,7 +351,7 @@ SessionMetadataSetImportable::load_extra_data (ARDOUR::SessionMetadata const & d
import_field->load_data(data); // hasn't been done yet import_field->load_data(data); // hasn't been done yet
// Make string for values TODO get color from somewhere? // Make string for values TODO get color from somewhere?
ustring values = "<span weight=\"ultralight\" color=\"#777\">" + session_field->value() + "</span>\n" string values = "<span weight=\"ultralight\" color=\"#777\">" + session_field->value() + "</span>\n"
+ "<span weight=\"bold\">" + import_field->value() + "</span>"; + "<span weight=\"bold\">" + import_field->value() + "</span>";
Gtk::TreeModel::iterator row_iter = tree->append(); Gtk::TreeModel::iterator row_iter = tree->append();
@ -401,7 +401,7 @@ SessionMetadataSetImportable::select_all ()
} }
void void
SessionMetadataSetImportable::selection_changed (ustring const & path) SessionMetadataSetImportable::selection_changed (string const & path)
{ {
select_all_check.set_inconsistent (true); select_all_check.set_inconsistent (true);
@ -413,7 +413,7 @@ SessionMetadataSetImportable::selection_changed (ustring const & path)
/* SessionMetadataDialog */ /* SessionMetadataDialog */
template <typename DataSet> template <typename DataSet>
SessionMetadataDialog<DataSet>::SessionMetadataDialog (ustring const & name) : SessionMetadataDialog<DataSet>::SessionMetadataDialog (string const & name) :
ArdourDialog (name, true) ArdourDialog (name, true)
{ {
cancel_button = add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); cancel_button = add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
@ -477,7 +477,7 @@ SessionMetadataDialog<DataSet>::end_dialog ()
template <typename DataSet> template <typename DataSet>
void void
SessionMetadataDialog<DataSet>::warn_user (ustring const & string) SessionMetadataDialog<DataSet>::warn_user (string const & string)
{ {
Gtk::MessageDialog msg (string, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msg (string, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true);
msg.run(); msg.run();

View file

@ -36,15 +36,15 @@ typedef boost::shared_ptr<MetadataField> MetadataPtr;
/// Wraps a metadata field to be used in a GUI /// Wraps a metadata field to be used in a GUI
class MetadataField { class MetadataField {
public: public:
MetadataField (Glib::ustring const & field_name); MetadataField (std::string const & field_name);
virtual ~MetadataField(); virtual ~MetadataField();
virtual MetadataPtr copy () = 0; virtual MetadataPtr copy () = 0;
virtual void save_data (ARDOUR::SessionMetadata & data) const = 0; virtual void save_data (ARDOUR::SessionMetadata & data) const = 0;
virtual void load_data (ARDOUR::SessionMetadata const & data) = 0; virtual void load_data (ARDOUR::SessionMetadata const & data) = 0;
virtual Glib::ustring name() { return _name; } virtual std::string name() { return _name; }
virtual Glib::ustring value() { return _value; } virtual std::string value() { return _value; }
/// Get widget containing name of field /// Get widget containing name of field
virtual Gtk::Widget & name_widget () = 0; virtual Gtk::Widget & name_widget () = 0;
@ -53,17 +53,17 @@ class MetadataField {
/// Get widget for editing value /// Get widget for editing value
virtual Gtk::Widget & edit_widget () = 0; virtual Gtk::Widget & edit_widget () = 0;
protected: protected:
Glib::ustring _name; std::string _name;
Glib::ustring _value; std::string _value;
}; };
/// MetadataField that contains text /// MetadataField that contains text
class TextMetadataField : public MetadataField { class TextMetadataField : public MetadataField {
private: private:
typedef Glib::ustring (ARDOUR::SessionMetadata::*Getter) () const; typedef std::string (ARDOUR::SessionMetadata::*Getter) () const;
typedef void (ARDOUR::SessionMetadata::*Setter) (Glib::ustring const &); typedef void (ARDOUR::SessionMetadata::*Setter) (std::string const &);
public: public:
TextMetadataField (Getter getter, Setter setter, Glib::ustring const & field_name, guint width = 50); TextMetadataField (Getter getter, Setter setter, std::string const & field_name, guint width = 50);
MetadataPtr copy (); MetadataPtr copy ();
void save_data (ARDOUR::SessionMetadata & data) const; void save_data (ARDOUR::SessionMetadata & data) const;
@ -91,7 +91,7 @@ class NumberMetadataField : public MetadataField {
typedef uint32_t (ARDOUR::SessionMetadata::*Getter) () const; typedef uint32_t (ARDOUR::SessionMetadata::*Getter) () const;
typedef void (ARDOUR::SessionMetadata::*Setter) (uint32_t); typedef void (ARDOUR::SessionMetadata::*Setter) (uint32_t);
public: public:
NumberMetadataField (Getter getter, Setter setter, Glib::ustring const & field_name, guint numbers, guint width = 50); NumberMetadataField (Getter getter, Setter setter, std::string const & field_name, guint numbers, guint width = 50);
MetadataPtr copy (); MetadataPtr copy ();
void save_data (ARDOUR::SessionMetadata & data) const; void save_data (ARDOUR::SessionMetadata & data) const;
@ -102,8 +102,8 @@ class NumberMetadataField : public MetadataField {
Gtk::Widget & edit_widget (); Gtk::Widget & edit_widget ();
private: private:
void update_value (); void update_value ();
Glib::ustring uint_to_str (uint32_t i) const; std::string uint_to_str (uint32_t i) const;
uint32_t str_to_uint (Glib::ustring const & str) const; uint32_t str_to_uint (std::string const & str) const;
Getter getter; Getter getter;
Setter setter; Setter setter;
@ -119,7 +119,7 @@ class NumberMetadataField : public MetadataField {
/// Interface for MetadataFields /// Interface for MetadataFields
class SessionMetadataSet : public ARDOUR::SessionHandlePtr { class SessionMetadataSet : public ARDOUR::SessionHandlePtr {
public: public:
SessionMetadataSet (Glib::ustring const & name); SessionMetadataSet (std::string const & name);
virtual ~SessionMetadataSet () {}; virtual ~SessionMetadataSet () {};
void add_data_field (MetadataPtr field); void add_data_field (MetadataPtr field);
@ -135,13 +135,13 @@ class SessionMetadataSet : public ARDOUR::SessionHandlePtr {
protected: protected:
typedef std::list<MetadataPtr> DataList; typedef std::list<MetadataPtr> DataList;
DataList list; DataList list;
Glib::ustring name; std::string name;
}; };
/// Contains MetadataFields for editing /// Contains MetadataFields for editing
class SessionMetadataSetEditable : public SessionMetadataSet { class SessionMetadataSetEditable : public SessionMetadataSet {
public: public:
SessionMetadataSetEditable (Glib::ustring const & name); SessionMetadataSetEditable (std::string const & name);
Gtk::Widget & get_widget () { return vbox; } Gtk::Widget & get_widget () { return vbox; }
Gtk::Widget & get_tab_widget (); Gtk::Widget & get_tab_widget ();
@ -160,7 +160,7 @@ class SessionMetadataSetEditable : public SessionMetadataSet {
/// Contains MetadataFields for importing /// Contains MetadataFields for importing
class SessionMetadataSetImportable : public SessionMetadataSet { class SessionMetadataSetImportable : public SessionMetadataSet {
public: public:
SessionMetadataSetImportable (Glib::ustring const & name); SessionMetadataSetImportable (std::string const & name);
Gtk::Widget & get_widget () { return tree_view; } Gtk::Widget & get_widget () { return tree_view; }
Gtk::Widget & get_tab_widget (); Gtk::Widget & get_tab_widget ();
@ -178,8 +178,8 @@ class SessionMetadataSetImportable : public SessionMetadataSet {
struct Columns : public Gtk::TreeModel::ColumnRecord struct Columns : public Gtk::TreeModel::ColumnRecord
{ {
public: public:
Gtk::TreeModelColumn<Glib::ustring> field; Gtk::TreeModelColumn<std::string> field;
Gtk::TreeModelColumn<Glib::ustring> values; Gtk::TreeModelColumn<std::string> values;
Gtk::TreeModelColumn<bool> import; Gtk::TreeModelColumn<bool> import;
Gtk::TreeModelColumn<MetadataPtr> data; Gtk::TreeModelColumn<MetadataPtr> data;
@ -194,7 +194,7 @@ class SessionMetadataSetImportable : public SessionMetadataSet {
Gtk::CheckButton select_all_check; Gtk::CheckButton select_all_check;
void select_all (); void select_all ();
void selection_changed (Glib::ustring const & path); void selection_changed (std::string const & path);
}; };
/// Metadata dialog interface /// Metadata dialog interface
@ -206,7 +206,7 @@ template <typename DataSet>
class SessionMetadataDialog : public ArdourDialog class SessionMetadataDialog : public ArdourDialog
{ {
public: public:
SessionMetadataDialog (Glib::ustring const & name); SessionMetadataDialog (std::string const & name);
protected: protected:
void init_data (); void init_data ();
@ -217,7 +217,7 @@ class SessionMetadataDialog : public ArdourDialog
virtual void save_and_close (); virtual void save_and_close ();
virtual void end_dialog (); virtual void end_dialog ();
void warn_user (Glib::ustring const & string); void warn_user (std::string const & string);
typedef std::list<Gtk::Widget *> WidgetList; typedef std::list<Gtk::Widget *> WidgetList;
typedef boost::shared_ptr<WidgetList> WidgetListPtr; typedef boost::shared_ptr<WidgetList> WidgetListPtr;

View file

@ -27,6 +27,7 @@
#include "pbd/file_utils.h" #include "pbd/file_utils.h"
#include "pbd/filesystem.h" #include "pbd/filesystem.h"
#include "pbd/replace_all.h" #include "pbd/replace_all.h"
#include "pbd/whitespace.h"
#include "ardour/filesystem_paths.h" #include "ardour/filesystem_paths.h"
#include "ardour/recent_sessions.h" #include "ardour/recent_sessions.h"
@ -207,7 +208,9 @@ ArdourStartup::session_name (bool& should_be_new)
{ {
if (ic_new_session_button.get_active()) { if (ic_new_session_button.get_active()) {
should_be_new = true; should_be_new = true;
return new_name_entry.get_text (); string val = new_name_entry.get_text ();
strip_whitespace_edges (val);
return val;
} else if (_existing_session_chooser_used) { } else if (_existing_session_chooser_used) {
/* existing session chosen from file chooser */ /* existing session chosen from file chooser */
should_be_new = false; should_be_new = false;

View file

@ -167,7 +167,7 @@ class AUPluginInfo : public PluginInfo {
AUPluginCachedInfo cache; AUPluginCachedInfo cache;
static PluginInfoList* discover (); static PluginInfoList* discover ();
static void get_names (CAComponentDescription&, std::string& name, Glib::ustring& maker); static void get_names (CAComponentDescription&, std::string& name, std::string& maker);
static std::string stringify_descriptor (const CAComponentDescription&); static std::string stringify_descriptor (const CAComponentDescription&);
static int load_cached_info (); static int load_cached_info ();
@ -180,7 +180,7 @@ class AUPluginInfo : public PluginInfo {
static void discover_fx (PluginInfoList&); static void discover_fx (PluginInfoList&);
static void discover_generators (PluginInfoList&); static void discover_generators (PluginInfoList&);
static void discover_by_description (PluginInfoList&, CAComponentDescription&); static void discover_by_description (PluginInfoList&, CAComponentDescription&);
static Glib::ustring au_cache_path (); static std::string au_cache_path ();
typedef std::map<std::string,AUPluginCachedInfo> CachedInfoMap; typedef std::map<std::string,AUPluginCachedInfo> CachedInfoMap;
static CachedInfoMap cached_info; static CachedInfoMap cached_info;

View file

@ -43,15 +43,15 @@ public:
return (set_source_name(newname, destructive()) == 0); return (set_source_name(newname, destructive()) == 0);
} }
Glib::ustring peak_path (Glib::ustring audio_path); std::string peak_path (std::string audio_path);
Glib::ustring find_broken_peakfile (Glib::ustring missing_peak_path, std::string find_broken_peakfile (std::string missing_peak_path,
Glib::ustring audio_path); std::string audio_path);
static void set_peak_dir (Glib::ustring dir) { peak_dir = dir; } static void set_peak_dir (std::string dir) { peak_dir = dir; }
static bool get_soundfile_info (Glib::ustring path, SoundFileInfo& _info, std::string& error); static bool get_soundfile_info (std::string path, SoundFileInfo& _info, std::string& error);
bool safe_file_extension (const Glib::ustring& path) const { bool safe_file_extension (const std::string& path) const {
return safe_audio_file_extension(path); return safe_audio_file_extension(path);
} }
@ -77,9 +77,9 @@ public:
bool can_truncate_peaks() const { return !destructive(); } bool can_truncate_peaks() const { return !destructive(); }
bool can_be_analysed() const { return _length > 0; } bool can_be_analysed() const { return _length > 0; }
static bool safe_audio_file_extension (const Glib::ustring& path); static bool safe_audio_file_extension (const std::string& path);
static bool is_empty (Session&, Glib::ustring path); static bool is_empty (Session&, std::string path);
static void set_bwf_serial_number (int); static void set_bwf_serial_number (int);
static void set_header_position_offset (nframes_t offset ); static void set_header_position_offset (nframes_t offset );
@ -88,16 +88,16 @@ public:
protected: protected:
/** Constructor to be called for existing external-to-session files */ /** Constructor to be called for existing external-to-session files */
AudioFileSource (Session&, const Glib::ustring& path, Source::Flag flags); AudioFileSource (Session&, const std::string& path, Source::Flag flags);
/** Constructor to be called for new in-session files */ /** Constructor to be called for new in-session files */
AudioFileSource (Session&, const Glib::ustring& path, Source::Flag flags, AudioFileSource (Session&, const std::string& path, Source::Flag flags,
SampleFormat samp_format, HeaderFormat hdr_format); SampleFormat samp_format, HeaderFormat hdr_format);
/** Constructor to be called for existing in-session files */ /** Constructor to be called for existing in-session files */
AudioFileSource (Session&, const XMLNode&, bool must_exist = true); AudioFileSource (Session&, const XMLNode&, bool must_exist = true);
int init (const Glib::ustring& idstr, bool must_exist); int init (const std::string& idstr, bool must_exist);
virtual void set_header_timeline_position () = 0; virtual void set_header_timeline_position () = 0;
virtual void handle_header_position_change () {} virtual void handle_header_position_change () {}
@ -106,7 +106,7 @@ protected:
static Sample* get_interleave_buffer (nframes_t size); static Sample* get_interleave_buffer (nframes_t size);
static Glib::ustring peak_dir; static std::string peak_dir;
static char bwf_country_code[3]; static char bwf_country_code[3];
static char bwf_organization_code[4]; static char bwf_organization_code[4];
@ -115,8 +115,8 @@ protected:
static uint64_t header_position_offset; static uint64_t header_position_offset;
private: private:
Glib::ustring old_peak_path (Glib::ustring audio_path); std::string old_peak_path (std::string audio_path);
Glib::ustring broken_peak_path (Glib::ustring audio_path); std::string broken_peak_path (std::string audio_path);
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -26,7 +26,6 @@
#include <time.h> #include <time.h>
#include <glibmm/thread.h> #include <glibmm/thread.h>
#include <glibmm/ustring.h>
#include <boost/function.hpp> #include <boost/function.hpp>
#include "ardour/source.h" #include "ardour/source.h"
@ -43,7 +42,7 @@ class AudioSource : virtual public Source,
public boost::enable_shared_from_this<ARDOUR::AudioSource> public boost::enable_shared_from_this<ARDOUR::AudioSource>
{ {
public: public:
AudioSource (Session&, Glib::ustring name); AudioSource (Session&, std::string name);
AudioSource (Session&, const XMLNode&); AudioSource (Session&, const XMLNode&);
virtual ~AudioSource (); virtual ~AudioSource ();
@ -65,8 +64,8 @@ class AudioSource : virtual public Source,
virtual bool can_truncate_peaks() const { return true; } virtual bool can_truncate_peaks() const { return true; }
void set_captured_for (Glib::ustring str) { _captured_for = str; } void set_captured_for (std::string str) { _captured_for = str; }
Glib::ustring captured_for() const { return _captured_for; } std::string captured_for() const { return _captured_for; }
uint32_t read_data_count() const { return _read_data_count; } uint32_t read_data_count() const { return _read_data_count; }
uint32_t write_data_count() const { return _write_data_count; } uint32_t write_data_count() const { return _write_data_count; }
@ -84,7 +83,7 @@ class AudioSource : virtual public Source,
XMLNode& get_state (); XMLNode& get_state ();
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
int rename_peakfile (Glib::ustring newpath); int rename_peakfile (std::string newpath);
void touch_peakfile (); void touch_peakfile ();
static void set_build_missing_peakfiles (bool yn) { static void set_build_missing_peakfiles (bool yn) {
@ -114,13 +113,13 @@ class AudioSource : virtual public Source,
framecnt_t _length; framecnt_t _length;
bool _peaks_built; bool _peaks_built;
mutable Glib::Mutex _peaks_ready_lock; mutable Glib::Mutex _peaks_ready_lock;
Glib::ustring peakpath; std::string peakpath;
Glib::ustring _captured_for; std::string _captured_for;
mutable uint32_t _read_data_count; // modified in read() mutable uint32_t _read_data_count; // modified in read()
mutable uint32_t _write_data_count; // modified in write() mutable uint32_t _write_data_count; // modified in write()
int initialize_peakfile (bool newfile, Glib::ustring path); int initialize_peakfile (bool newfile, std::string path);
int build_peaks_from_scratch (); int build_peaks_from_scratch ();
int compute_and_write_peaks (Sample* buf, framepos_t first_frame, framecnt_t cnt, int compute_and_write_peaks (Sample* buf, framepos_t first_frame, framecnt_t cnt,
bool force, bool intermediate_peaks_ready_signal); bool force, bool intermediate_peaks_ready_signal);
@ -130,9 +129,9 @@ class AudioSource : virtual public Source,
virtual framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const = 0; virtual framecnt_t read_unlocked (Sample *dst, framepos_t start, framecnt_t cnt) const = 0;
virtual framecnt_t write_unlocked (Sample *dst, framecnt_t cnt) = 0; virtual framecnt_t write_unlocked (Sample *dst, framecnt_t cnt) = 0;
virtual Glib::ustring peak_path(Glib::ustring audio_path) = 0; virtual std::string peak_path(std::string audio_path) = 0;
virtual Glib::ustring find_broken_peakfile (Glib::ustring missing_peak_path, virtual std::string find_broken_peakfile (std::string missing_peak_path,
Glib::ustring audio_path) = 0; std::string audio_path) = 0;
virtual int read_peaks_with_fpp (PeakData *peaks, virtual int read_peaks_with_fpp (PeakData *peaks,
framecnt_t npeaks, framepos_t start, framecnt_t cnt, framecnt_t npeaks, framepos_t start, framecnt_t cnt,

View file

@ -22,7 +22,7 @@
#define __ardour_export_channel_configuration_h__ #define __ardour_export_channel_configuration_h__
#include <list> #include <list>
#include <glibmm/ustring.h> #include <string>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include "ardour/export_channel.h" #include "ardour/export_channel.h"
@ -62,8 +62,8 @@ class ExportChannelConfiguration : public boost::enable_shared_from_this<ExportC
ChannelList const & get_channels () const { return channels; } ChannelList const & get_channels () const { return channels; }
bool all_channels_have_ports () const; bool all_channels_have_ports () const;
Glib::ustring name () const { return _name; } std::string name () const { return _name; }
void set_name (Glib::ustring name) { _name = name; } void set_name (std::string name) { _name = name; }
void set_split (bool value) { split = value; } void set_split (bool value) { split = value; }
bool get_split () const { return split; } bool get_split () const { return split; }
@ -82,7 +82,7 @@ class ExportChannelConfiguration : public boost::enable_shared_from_this<ExportC
ChannelList channels; ChannelList channels;
bool split; // Split to mono files bool split; // Split to mono files
Glib::ustring _name; std::string _name;
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -22,7 +22,7 @@
#define __ardour_export_filename_h__ #define __ardour_export_filename_h__
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <glibmm/ustring.h> #include <string>
#include "pbd/statefuldestructible.h" #include "pbd/statefuldestructible.h"
namespace ARDOUR namespace ARDOUR
@ -68,25 +68,25 @@ class ExportFilename {
/* data access */ /* data access */
Glib::ustring get_path (FormatPtr format) const; std::string get_path (FormatPtr format) const;
Glib::ustring get_folder () const { return folder; } std::string get_folder () const { return folder; }
TimeFormat get_time_format () const { return time_format; } TimeFormat get_time_format () const { return time_format; }
DateFormat get_date_format () const { return date_format; } DateFormat get_date_format () const { return date_format; }
Glib::ustring get_time_format_str (TimeFormat format) const; std::string get_time_format_str (TimeFormat format) const;
Glib::ustring get_date_format_str (DateFormat format) const; std::string get_date_format_str (DateFormat format) const;
Glib::ustring get_label () const { return label; } std::string get_label () const { return label; }
uint32_t get_revision () const { return revision; } uint32_t get_revision () const { return revision; }
/* data modification */ /* data modification */
void set_time_format (TimeFormat format); void set_time_format (TimeFormat format);
void set_date_format (DateFormat format); void set_date_format (DateFormat format);
void set_label (Glib::ustring value); void set_label (std::string value);
void set_revision (uint32_t value) { revision = value; } void set_revision (uint32_t value) { revision = value; }
void set_channel (uint32_t value) { channel = value; } void set_channel (uint32_t value) { channel = value; }
bool set_folder (Glib::ustring path); bool set_folder (std::string path);
void set_timespan (TimespanPtr ts) { timespan = ts; } void set_timespan (TimespanPtr ts) { timespan = ts; }
void set_channel_config (ChannelConfigPtr cc) { channel_config = cc; } void set_channel_config (ChannelConfigPtr cc) { channel_config = cc; }
@ -106,16 +106,16 @@ class ExportFilename {
Session & session; Session & session;
Glib::ustring label; std::string label;
uint32_t revision; uint32_t revision;
uint32_t channel; uint32_t channel;
Glib::ustring folder; std::string folder;
DateFormat date_format; DateFormat date_format;
TimeFormat time_format; TimeFormat time_format;
Glib::ustring get_formatted_time (Glib::ustring const & format) const; std::string get_formatted_time (std::string const & format) const;
// Due to the static allocation used in strftime(), no destructor or copy-ctor is needed for this // Due to the static allocation used in strftime(), no destructor or copy-ctor is needed for this
struct tm * time_struct; struct tm * time_struct;
@ -124,10 +124,10 @@ class ExportFilename {
/* Serialization helpers */ /* Serialization helpers */
typedef std::pair<bool, Glib::ustring> FieldPair; typedef std::pair<bool, std::string> FieldPair;
void add_field (XMLNode * node, Glib::ustring const & name, bool enabled, Glib::ustring const & value = ""); void add_field (XMLNode * node, std::string const & name, bool enabled, std::string const & value = "");
FieldPair get_field (XMLNode const & node, Glib::ustring const & name); FieldPair get_field (XMLNode const & node, std::string const & name);
FieldPair analyse_folder (); FieldPair analyse_folder ();
}; };

View file

@ -24,7 +24,7 @@
#include <set> #include <set>
#include <algorithm> #include <algorithm>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <glibmm/ustring.h> #include <string>
#include <sndfile.h> #include <sndfile.h>
#include <samplerate.h> #include <samplerate.h>
@ -122,19 +122,19 @@ class ExportFormatBase {
bool selected () const { return _selected; } bool selected () const { return _selected; }
bool compatible () const { return _compatible; } bool compatible () const { return _compatible; }
Glib::ustring name () const { return _name; } std::string name () const { return _name; }
void set_selected (bool value); void set_selected (bool value);
void set_compatible (bool value); void set_compatible (bool value);
protected: protected:
void set_name (Glib::ustring name) { _name = name; } void set_name (std::string name) { _name = name; }
private: private:
bool _selected; bool _selected;
bool _compatible; bool _compatible;
Glib::ustring _name; std::string _name;
}; };
public: public:
@ -160,8 +160,8 @@ class ExportFormatBase {
bool has_format (FormatId format) const { return format_ids.find (format) != format_ids.end(); } bool has_format (FormatId format) const { return format_ids.find (format) != format_ids.end(); }
bool has_quality (Quality quality) const { return qualities.find (quality) != qualities.end(); } bool has_quality (Quality quality) const { return qualities.find (quality) != qualities.end(); }
void set_extension (Glib::ustring const & extension) { _extension = extension; } void set_extension (std::string const & extension) { _extension = extension; }
Glib::ustring const & extension () const { return _extension; } std::string const & extension () const { return _extension; }
protected: protected:
@ -182,7 +182,7 @@ class ExportFormatBase {
private: private:
Glib::ustring _extension; std::string _extension;
enum SetOperation { enum SetOperation {
SetUnion, SetUnion,

View file

@ -21,6 +21,7 @@
#ifndef __ardour_export_format_compatibility_h__ #ifndef __ardour_export_format_compatibility_h__
#define __ardour_export_format_compatibility_h__ #define __ardour_export_format_compatibility_h__
#include <string>
#include "ardour/export_format_base.h" #include "ardour/export_format_base.h"
namespace ARDOUR namespace ARDOUR
@ -31,7 +32,7 @@ class ExportFormatCompatibility : public ExportFormatBase, public ExportFormatBa
private: private:
public: public:
ExportFormatCompatibility (Glib::ustring name) ExportFormatCompatibility (std::string name)
{ {
set_name (name); set_name (name);
sample_formats.insert (SF_None); sample_formats.insert (SF_None);

View file

@ -65,7 +65,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
class QualityState : public ExportFormatBase::SelectableCompatible { class QualityState : public ExportFormatBase::SelectableCompatible {
public: public:
QualityState (ExportFormatBase::Quality quality, Glib::ustring name) : QualityState (ExportFormatBase::Quality quality, std::string name) :
quality (quality) { set_name (name); } quality (quality) { set_name (name); }
ExportFormatBase::Quality quality; ExportFormatBase::Quality quality;
}; };
@ -77,7 +77,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
class SampleRateState : public ExportFormatBase::SelectableCompatible { class SampleRateState : public ExportFormatBase::SelectableCompatible {
public: public:
SampleRateState (ExportFormatBase::SampleRate rate, Glib::ustring name) SampleRateState (ExportFormatBase::SampleRate rate, std::string name)
: rate (rate) { set_name (name); } : rate (rate) { set_name (name); }
ExportFormatBase::SampleRate rate; ExportFormatBase::SampleRate rate;
}; };
@ -103,7 +103,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
/* Non interactive selections */ /* Non interactive selections */
void set_name (Glib::ustring name); void set_name (std::string name);
void select_src_quality (ExportFormatBase::SRCQuality value); void select_src_quality (ExportFormatBase::SRCQuality value);
void select_trim_beginning (bool value); void select_trim_beginning (bool value);

View file

@ -21,7 +21,7 @@
#ifndef __ardour_export_format_specification_h__ #ifndef __ardour_export_format_specification_h__
#define __ardour_export_format_specification_h__ #define __ardour_export_format_specification_h__
#include <glibmm/ustring.h> #include <string>
#include "pbd/uuid.h" #include "pbd/uuid.h"
@ -76,7 +76,7 @@ class ExportFormatSpecification : public ExportFormatBase {
void set_format (boost::shared_ptr<ExportFormat> format); void set_format (boost::shared_ptr<ExportFormat> format);
void set_name (Glib::ustring const & name) { _name = name; } void set_name (std::string const & name) { _name = name; }
void set_type (Type type) { _type = type; } void set_type (Type type) { _type = type; }
void set_format_id (FormatId value) { format_ids.clear(); format_ids.insert (value); } void set_format_id (FormatId value) { format_ids.clear(); format_ids.insert (value); }
@ -100,12 +100,12 @@ class ExportFormatSpecification : public ExportFormatBase {
/* Accessing functions */ /* Accessing functions */
PBD::UUID const & id () { return _id; } PBD::UUID const & id () { return _id; }
Glib::ustring const & name () const { return _name; } std::string const & name () const { return _name; }
Glib::ustring description (); std::string description ();
bool has_broadcast_info () const { return _has_broadcast_info; } bool has_broadcast_info () const { return _has_broadcast_info; }
uint32_t channel_limit () const { return _channel_limit; } uint32_t channel_limit () const { return _channel_limit; }
Glib::ustring format_name () const { return _format_name; } std::string format_name () const { return _format_name; }
Type type () const { return _type; } Type type () const { return _type; }
FormatId format_id () const { return *format_ids.begin(); } FormatId format_id () const { return *format_ids.begin(); }
@ -144,7 +144,7 @@ class ExportFormatSpecification : public ExportFormatBase {
/* The variables below do not have setters (usually set via set_format) */ /* The variables below do not have setters (usually set via set_format) */
Glib::ustring _format_name; std::string _format_name;
bool has_sample_format; bool has_sample_format;
bool supports_tagging; bool supports_tagging;
bool _has_broadcast_info; bool _has_broadcast_info;
@ -152,7 +152,7 @@ class ExportFormatSpecification : public ExportFormatBase {
/* The variables below have getters and setters */ /* The variables below have getters and setters */
Glib::ustring _name; std::string _name;
PBD::UUID _id; PBD::UUID _id;
Type _type; Type _type;

View file

@ -91,7 +91,7 @@ class HasSampleFormat : public PBD::ScopedConnectionList {
class SampleFormatState : public ExportFormatBase::SelectableCompatible { class SampleFormatState : public ExportFormatBase::SelectableCompatible {
public: public:
SampleFormatState (ExportFormatBase::SampleFormat format, Glib::ustring name) : SampleFormatState (ExportFormatBase::SampleFormat format, std::string name) :
format (format) { set_name (name); } format (format) { set_name (name); }
ExportFormatBase::SampleFormat format; ExportFormatBase::SampleFormat format;
@ -145,7 +145,7 @@ class HasSampleFormat : public PBD::ScopedConnectionList {
private: private:
/* Connected to signals */ /* Connected to signals */
void add_dither_type (ExportFormatBase::DitherType type, Glib::ustring name); void add_dither_type (ExportFormatBase::DitherType type, std::string name);
void update_sample_format_selection (bool); void update_sample_format_selection (bool);
void update_dither_type_selection (bool); void update_dither_type_selection (bool);
@ -156,7 +156,7 @@ class HasSampleFormat : public PBD::ScopedConnectionList {
class ExportFormatLinear : public ExportFormat, public HasSampleFormat { class ExportFormatLinear : public ExportFormat, public HasSampleFormat {
public: public:
ExportFormatLinear (Glib::ustring name, FormatId format_id); ExportFormatLinear (std::string name, FormatId format_id);
~ExportFormatLinear () {}; ~ExportFormatLinear () {};
bool set_compatibility_state (ExportFormatCompatibility const & compatibility); bool set_compatibility_state (ExportFormatCompatibility const & compatibility);

View file

@ -25,10 +25,10 @@
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdexcept> #include <stdexcept>
#include <string>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
#include <glibmm/ustring.h>
#include "pbd/uuid.h" #include "pbd/uuid.h"
#include "pbd/file_utils.h" #include "pbd/file_utils.h"
@ -137,7 +137,7 @@ class ExportProfileManager
typedef std::list<TimespanStatePtr> TimespanStateList; typedef std::list<TimespanStatePtr> TimespanStateList;
void set_selection_range (nframes_t start = 0, nframes_t end = 0); void set_selection_range (nframes_t start = 0, nframes_t end = 0);
std::string set_single_range (nframes_t start, nframes_t end, Glib::ustring name); std::string set_single_range (nframes_t start, nframes_t end, std::string name);
TimespanStateList const & get_timespans () { return check_list (timespans); } TimespanStateList const & get_timespans () { return check_list (timespans); }
private: private:
@ -250,9 +250,9 @@ class ExportProfileManager
/* Warnings */ /* Warnings */
public: public:
struct Warnings { struct Warnings {
std::list<Glib::ustring> errors; std::list<std::string> errors;
std::list<Glib::ustring> warnings; std::list<std::string> warnings;
std::list<Glib::ustring> conflicting_filenames; std::list<std::string> conflicting_filenames;
}; };
boost::shared_ptr<Warnings> get_warnings (); boost::shared_ptr<Warnings> get_warnings ();

View file

@ -23,8 +23,7 @@
#include <map> #include <map>
#include <list> #include <list>
#include <string>
#include <glibmm/ustring.h>
#include "ardour/export_status.h" #include "ardour/export_status.h"
#include "ardour/export_channel.h" #include "ardour/export_channel.h"
@ -48,11 +47,11 @@ class ExportTimespan
public: public:
~ExportTimespan (); ~ExportTimespan ();
Glib::ustring name () const { return _name; } std::string name () const { return _name; }
void set_name (Glib::ustring name) { _name = name; } void set_name (std::string name) { _name = name; }
Glib::ustring range_id () const { return _range_id; } std::string range_id () const { return _range_id; }
void set_range_id (Glib::ustring range_id) { _range_id = range_id; } void set_range_id (std::string range_id) { _range_id = range_id; }
void set_range (nframes_t start, nframes_t end); void set_range (nframes_t start, nframes_t end);
nframes_t get_length () const { return end_frame - start_frame; } nframes_t get_length () const { return end_frame - start_frame; }
@ -68,8 +67,8 @@ class ExportTimespan
nframes_t position; nframes_t position;
nframes_t frame_rate; nframes_t frame_rate;
Glib::ustring _name; std::string _name;
Glib::ustring _range_id; std::string _range_id;
}; };

View file

@ -34,55 +34,55 @@ public:
/** A source associated with a file on disk somewhere */ /** A source associated with a file on disk somewhere */
class FileSource : virtual public Source { class FileSource : virtual public Source {
public: public:
const Glib::ustring& path() const { return _path; } const std::string& path() const { return _path; }
int unstubify (); int unstubify ();
void stubify (); void stubify ();
virtual bool safe_file_extension (const Glib::ustring& path) const = 0; virtual bool safe_file_extension (const std::string& path) const = 0;
int move_to_trash (const Glib::ustring& trash_dir_name); int move_to_trash (const std::string& trash_dir_name);
void mark_take (const Glib::ustring& id); void mark_take (const std::string& id);
void mark_immutable (); void mark_immutable ();
void mark_nonremovable (); void mark_nonremovable ();
const Glib::ustring& take_id () const { return _take_id; } const std::string& take_id () const { return _take_id; }
bool within_session () const { return _within_session; } bool within_session () const { return _within_session; }
uint16_t channel() const { return _channel; } uint16_t channel() const { return _channel; }
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
int set_source_name (const Glib::ustring& newname, bool destructive); int set_source_name (const std::string& newname, bool destructive);
static void set_search_path (DataType type, const Glib::ustring& path); static void set_search_path (DataType type, const std::string& path);
static bool find (DataType type, const Glib::ustring& path, static bool find (DataType type, const std::string& path,
bool must_exist, bool& is_new, uint16_t& chan, bool must_exist, bool& is_new, uint16_t& chan,
Glib::ustring& found_path); std::string& found_path);
void inc_use_count (); void inc_use_count ();
bool removable () const; bool removable () const;
protected: protected:
FileSource (Session& session, DataType type, FileSource (Session& session, DataType type,
const Glib::ustring& path, const std::string& path,
Source::Flag flags = Source::Flag(0)); Source::Flag flags = Source::Flag(0));
FileSource (Session& session, const XMLNode& node, bool must_exist); FileSource (Session& session, const XMLNode& node, bool must_exist);
virtual int init (const Glib::ustring& idstr, bool must_exist); virtual int init (const std::string& idstr, bool must_exist);
virtual void set_path (const std::string&); virtual void set_path (const std::string&);
virtual int move_dependents_to_trash() { return 0; } virtual int move_dependents_to_trash() { return 0; }
void set_within_session_from_path (const std::string&); void set_within_session_from_path (const std::string&);
Glib::ustring _path; std::string _path;
Glib::ustring _take_id; std::string _take_id;
bool _file_is_new; bool _file_is_new;
uint16_t _channel; uint16_t _channel;
bool _within_session; bool _within_session;
static std::map<DataType, Glib::ustring> search_paths; static std::map<DataType, std::string> search_paths;
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -37,7 +37,7 @@ struct ImportStatus : public InterThreadInfo {
uint32_t total; uint32_t total;
SrcQuality quality; SrcQuality quality;
volatile bool freeze; volatile bool freeze;
std::vector<Glib::ustring> paths; std::vector<std::string> paths;
bool replace_existing_source; bool replace_existing_source;
/* result */ /* result */

View file

@ -21,7 +21,7 @@
#define __ardour_plugin_h__ #define __ardour_plugin_h__
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <glibmm/ustring.h> #include <string>
#include "pbd/statefuldestructible.h" #include "pbd/statefuldestructible.h"
#include "pbd/controllable.h" #include "pbd/controllable.h"
@ -55,8 +55,8 @@ class PluginInfo {
std::string name; std::string name;
std::string category; std::string category;
Glib::ustring creator; std::string creator;
Glib::ustring path; std::string path;
ChanCount n_inputs; ChanCount n_inputs;
ChanCount n_outputs; ChanCount n_outputs;
ARDOUR::PluginType type; ARDOUR::PluginType type;

View file

@ -177,7 +177,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
int ensure_subdirs (); int ensure_subdirs ();
Glib::ustring peak_path (Glib::ustring) const; std::string peak_path (std::string) const;
std::string change_source_path_by_name (std::string oldpath, std::string oldname, std::string newname, bool destructive); std::string change_source_path_by_name (std::string oldpath, std::string oldname, std::string newname, bool destructive);
@ -540,7 +540,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<MidiSource> create_midi_source_for_session (Track*, std::string const &, bool as_stub = false); boost::shared_ptr<MidiSource> create_midi_source_for_session (Track*, std::string const &, bool as_stub = false);
boost::shared_ptr<Source> source_by_id (const PBD::ID&); boost::shared_ptr<Source> source_by_id (const PBD::ID&);
boost::shared_ptr<Source> source_by_path_and_channel (const Glib::ustring&, uint16_t); boost::shared_ptr<Source> source_by_path_and_channel (const std::string&, uint16_t);
void add_playlist (boost::shared_ptr<Playlist>, bool unused = false); void add_playlist (boost::shared_ptr<Playlist>, bool unused = false);

View file

@ -34,7 +34,7 @@ CONFIG_VARIABLE (bool, punch_in, "punch-in", false)
CONFIG_VARIABLE (bool, punch_out, "punch-out", false) CONFIG_VARIABLE (bool, punch_out, "punch-out", false)
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100) CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
CONFIG_VARIABLE (TimecodeFormat, timecode_format, "timecode-format", timecode_30) CONFIG_VARIABLE (TimecodeFormat, timecode_format, "timecode-format", timecode_30)
CONFIG_VARIABLE_SPECIAL(Glib::ustring, raid_path, "raid-path", "", path_expand) CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", path_expand)
CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US") CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US")
CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US") CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US")
CONFIG_VARIABLE (LayerModel, layer_model, "layer-model", MoveAddHigher) CONFIG_VARIABLE (LayerModel, layer_model, "layer-model", MoveAddHigher)

View file

@ -21,7 +21,6 @@
#define __ardour_session_metadata_h__ #define __ardour_session_metadata_h__
#include <string> #include <string>
#include <glibmm/ustring.h>
#include <map> #include <map>
#include <utility> #include <utility>
@ -42,68 +41,68 @@ class SessionMetadata : public PBD::StatefulDestructible
~SessionMetadata (); ~SessionMetadata ();
/*** Accessing ***/ /*** Accessing ***/
Glib::ustring comment () const; std::string comment () const;
Glib::ustring copyright () const; std::string copyright () const;
Glib::ustring isrc () const; std::string isrc () const;
uint32_t year () const; uint32_t year () const;
Glib::ustring grouping () const; std::string grouping () const;
Glib::ustring title () const; std::string title () const;
Glib::ustring subtitle () const; std::string subtitle () const;
Glib::ustring artist () const; std::string artist () const;
Glib::ustring album_artist () const; std::string album_artist () const;
Glib::ustring lyricist () const; std::string lyricist () const;
Glib::ustring composer () const; std::string composer () const;
Glib::ustring conductor () const; std::string conductor () const;
Glib::ustring remixer () const; std::string remixer () const;
Glib::ustring arranger () const; std::string arranger () const;
Glib::ustring engineer () const; std::string engineer () const;
Glib::ustring producer () const; std::string producer () const;
Glib::ustring dj_mixer () const; std::string dj_mixer () const;
Glib::ustring mixer () const; std::string mixer () const;
Glib::ustring album () const; std::string album () const;
Glib::ustring compilation () const; std::string compilation () const;
Glib::ustring disc_subtitle () const; std::string disc_subtitle () const;
uint32_t disc_number () const; uint32_t disc_number () const;
uint32_t total_discs () const; uint32_t total_discs () const;
uint32_t track_number () const; uint32_t track_number () const;
uint32_t total_tracks () const; uint32_t total_tracks () const;
Glib::ustring genre () const; std::string genre () const;
/*** Editing ***/ /*** Editing ***/
void set_comment (const Glib::ustring &); void set_comment (const std::string &);
void set_copyright (const Glib::ustring &); void set_copyright (const std::string &);
void set_isrc (const Glib::ustring &); void set_isrc (const std::string &);
void set_year (uint32_t); void set_year (uint32_t);
void set_grouping (const Glib::ustring &); void set_grouping (const std::string &);
void set_title (const Glib::ustring &); void set_title (const std::string &);
void set_subtitle (const Glib::ustring &); void set_subtitle (const std::string &);
void set_artist (const Glib::ustring &); void set_artist (const std::string &);
void set_album_artist (const Glib::ustring &); void set_album_artist (const std::string &);
void set_lyricist (const Glib::ustring &); void set_lyricist (const std::string &);
void set_composer (const Glib::ustring &); void set_composer (const std::string &);
void set_conductor (const Glib::ustring &); void set_conductor (const std::string &);
void set_remixer (const Glib::ustring &); void set_remixer (const std::string &);
void set_arranger (const Glib::ustring &); void set_arranger (const std::string &);
void set_engineer (const Glib::ustring &); void set_engineer (const std::string &);
void set_producer (const Glib::ustring &); void set_producer (const std::string &);
void set_dj_mixer (const Glib::ustring &); void set_dj_mixer (const std::string &);
void set_mixer (const Glib::ustring &); void set_mixer (const std::string &);
void set_album (const Glib::ustring &); void set_album (const std::string &);
void set_compilation (const Glib::ustring &); void set_compilation (const std::string &);
void set_disc_subtitle (const Glib::ustring &); void set_disc_subtitle (const std::string &);
void set_disc_number (uint32_t); void set_disc_number (uint32_t);
void set_total_discs (uint32_t); void set_total_discs (uint32_t);
void set_track_number (uint32_t); void set_track_number (uint32_t);
void set_total_tracks (uint32_t); void set_total_tracks (uint32_t);
void set_genre (const Glib::ustring &); void set_genre (const std::string &);
/*** Serialization ***/ /*** Serialization ***/
XMLNode & get_state (); XMLNode & get_state ();
@ -111,17 +110,17 @@ class SessionMetadata : public PBD::StatefulDestructible
private: private:
typedef std::pair<Glib::ustring, Glib::ustring> Property; typedef std::pair<std::string, std::string> Property;
typedef std::map<Glib::ustring, Glib::ustring> PropertyMap; typedef std::map<std::string, std::string> PropertyMap;
PropertyMap map; PropertyMap map;
XMLNode * get_xml (const Glib::ustring & name); XMLNode * get_xml (const std::string & name);
Glib::ustring get_value (const Glib::ustring & name) const; std::string get_value (const std::string & name) const;
uint32_t get_uint_value (const Glib::ustring & name) const; uint32_t get_uint_value (const std::string & name) const;
void set_value (const Glib::ustring & name, const Glib::ustring & value); void set_value (const std::string & name, const std::string & value);
void set_value (const Glib::ustring & name, uint32_t value); void set_value (const std::string & name, uint32_t value);
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -37,7 +37,7 @@ template<typename T> class MidiRingBuffer;
class SMFSource : public MidiSource, public FileSource, public Evoral::SMF { class SMFSource : public MidiSource, public FileSource, public Evoral::SMF {
public: public:
/** Constructor for existing external-to-session files */ /** Constructor for existing external-to-session files */
SMFSource (Session& session, const Glib::ustring& path, SMFSource (Session& session, const std::string& path,
Source::Flag flags = Source::Flag(0)); Source::Flag flags = Source::Flag(0));
/** Constructor for existing in-session files */ /** Constructor for existing in-session files */
@ -45,7 +45,7 @@ public:
virtual ~SMFSource (); virtual ~SMFSource ();
bool safe_file_extension (const Glib::ustring& path) const { bool safe_file_extension (const std::string& path) const {
return safe_midi_file_extension(path); return safe_midi_file_extension(path);
} }
@ -67,7 +67,7 @@ public:
static void set_header_position_offset (nframes_t offset, bool negative); static void set_header_position_offset (nframes_t offset, bool negative);
static bool safe_midi_file_extension (const Glib::ustring& path); static bool safe_midi_file_extension (const std::string& path);
protected: protected:
void set_path (const std::string& newpath); void set_path (const std::string& newpath);

View file

@ -31,10 +31,10 @@ namespace ARDOUR {
class SndFileSource : public AudioFileSource { class SndFileSource : public AudioFileSource {
public: public:
/** Constructor to be called for existing external-to-session files */ /** Constructor to be called for existing external-to-session files */
SndFileSource (Session&, const Glib::ustring& path, int chn, Flag flags); SndFileSource (Session&, const std::string& path, int chn, Flag flags);
/* Constructor to be called for new in-session files */ /* Constructor to be called for new in-session files */
SndFileSource (Session&, const Glib::ustring& path, SndFileSource (Session&, const std::string& path,
SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
Flag flags = SndFileSource::default_writable_flags); Flag flags = SndFileSource::default_writable_flags);
@ -63,7 +63,7 @@ class SndFileSource : public AudioFileSource {
static void setup_standard_crossfades (Session const &, nframes_t sample_rate); static void setup_standard_crossfades (Session const &, nframes_t sample_rate);
static const Source::Flag default_writable_flags; static const Source::Flag default_writable_flags;
static int get_soundfile_info (const Glib::ustring& path, SoundFileInfo& _info, std::string& error_msg); static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg);
protected: protected:
void set_path (const std::string& p); void set_path (const std::string& p);

View file

@ -64,7 +64,7 @@ class Source : public SessionObject
virtual framecnt_t length (framepos_t pos) const = 0; virtual framecnt_t length (framepos_t pos) const = 0;
virtual void update_length (framepos_t pos, framecnt_t cnt) = 0; virtual void update_length (framepos_t pos, framecnt_t cnt) = 0;
virtual const Glib::ustring& path() const = 0; virtual const std::string& path() const = 0;
virtual framepos_t natural_position() const { return 0; } virtual framepos_t natural_position() const { return 0; }

View file

@ -39,7 +39,7 @@ bool string_is_affirmative (const std::string&);
class XMLNode; class XMLNode;
Glib::ustring legalize_for_path (Glib::ustring str); std::string legalize_for_path (const std::string& str);
XMLNode* find_named_node (const XMLNode& node, std::string name); XMLNode* find_named_node (const XMLNode& node, std::string name);
std::string bool_as_string (bool); std::string bool_as_string (bool);
@ -56,11 +56,11 @@ std::string bump_name_once(const std::string& s, char delimiter);
int cmp_nocase (const std::string& s, const std::string& s2); int cmp_nocase (const std::string& s, const std::string& s2);
int touch_file(Glib::ustring path); int touch_file(std::string path);
Glib::ustring path_expand (Glib::ustring); std::string path_expand (std::string);
Glib::ustring region_name_from_path (Glib::ustring path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0); std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0);
bool path_is_paired (Glib::ustring path, Glib::ustring& pair_base); bool path_is_paired (std::string path, std::string& pair_base);
void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out); void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out);

View file

@ -356,7 +356,7 @@ AudioRegionImporter::prepare_sources ()
session.import_audiofiles (status); session.import_audiofiles (status);
// Add imported sources to handlers map // Add imported sources to handlers map
std::vector<Glib::ustring>::iterator file_it = status.paths.begin(); std::vector<string>::iterator file_it = status.paths.begin();
for (SourceList::iterator source_it = status.sources.begin(); source_it != status.sources.end(); ++source_it) { for (SourceList::iterator source_it = status.sources.begin(); source_it != status.sources.end(); ++source_it) {
if (*source_it) { if (*source_it) {
handler.add_source(*file_it, *source_it); handler.add_source(*file_it, *source_it);

View file

@ -74,7 +74,7 @@ _render_callback(void *userData,
} }
static int static int
save_property_list (CFPropertyListRef propertyList, Glib::ustring path) save_property_list (CFPropertyListRef propertyList, string path)
{ {
CFDataRef xmlData; CFDataRef xmlData;
@ -122,7 +122,7 @@ save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
static CFPropertyListRef static CFPropertyListRef
load_property_list (Glib::ustring path) load_property_list (string path)
{ {
int fd; int fd;
CFPropertyListRef propertyList; CFPropertyListRef propertyList;
@ -291,7 +291,7 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
frames_processed (0) frames_processed (0)
{ {
if (!preset_search_path_initialized) { if (!preset_search_path_initialized) {
Glib::ustring p = Glib::get_home_dir(); string p = Glib::get_home_dir();
p += "/Library/Audio/Presets:"; p += "/Library/Audio/Presets:";
p += preset_search_path; p += preset_search_path;
preset_search_path = p; preset_search_path = p;
@ -1093,7 +1093,7 @@ AUPlugin::load_preset (const string& preset_label)
#ifdef AU_STATE_SUPPORT #ifdef AU_STATE_SUPPORT
bool ret = false; bool ret = false;
CFPropertyListRef propertyList; CFPropertyListRef propertyList;
Glib::ustring path; string path;
PresetMap::iterator x = preset_map.find (preset_label); PresetMap::iterator x = preset_map.find (preset_label);
if (x == preset_map.end()) { if (x == preset_map.end()) {
@ -1123,8 +1123,8 @@ AUPlugin::save_preset (string preset_name)
{ {
#ifdef AU_STATE_SUPPORT #ifdef AU_STATE_SUPPORT
CFPropertyListRef propertyList; CFPropertyListRef propertyList;
vector<Glib::ustring> v; vector<string> v;
Glib::ustring user_preset_path; string user_preset_path;
bool ret = true; bool ret = true;
std::string m = maker(); std::string m = maker();
@ -1436,7 +1436,7 @@ AUPluginInfo::load (Session& session)
} }
} }
Glib::ustring string
AUPluginInfo::au_cache_path () AUPluginInfo::au_cache_path ()
{ {
return Glib::build_filename (ARDOUR::get_user_ardour_path(), "au_cache"); return Glib::build_filename (ARDOUR::get_user_ardour_path(), "au_cache");
@ -1780,7 +1780,7 @@ AUPluginInfo::save_cached_info ()
} }
Glib::ustring path = au_cache_path (); string path = au_cache_path ();
XMLTree tree; XMLTree tree;
tree.set_root (node); tree.set_root (node);
@ -1794,7 +1794,7 @@ AUPluginInfo::save_cached_info ()
int int
AUPluginInfo::load_cached_info () AUPluginInfo::load_cached_info ()
{ {
Glib::ustring path = au_cache_path (); string path = au_cache_path ();
XMLTree tree; XMLTree tree;
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) { if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
@ -1858,7 +1858,7 @@ AUPluginInfo::load_cached_info ()
} }
void void
AUPluginInfo::get_names (CAComponentDescription& comp_desc, std::string& name, Glib::ustring& maker) AUPluginInfo::get_names (CAComponentDescription& comp_desc, std::string& name, string& maker)
{ {
CFStringRef itemName = NULL; CFStringRef itemName = NULL;

View file

@ -31,8 +31,8 @@
#include "taglib/taglib.h" #include "taglib/taglib.h"
#include "taglib/xiphcomment.h" #include "taglib/xiphcomment.h"
/* Convert Glib::ustring to TagLib::String */ /* Convert string to TagLib::String */
#define TL_STR(ustring) TagLib::String ((ustring).c_str(), TagLib::String::UTF8) #define TL_STR(string) TagLib::String ((string).c_str(), TagLib::String::UTF8)
using namespace PBD; using namespace PBD;

View file

@ -68,7 +68,7 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
ustring AudioFileSource::peak_dir = ""; string AudioFileSource::peak_dir = "";
PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged; PBD::Signal0<void> AudioFileSource::HeaderPositionOffsetChanged;
uint64_t AudioFileSource::header_position_offset = 0; uint64_t AudioFileSource::header_position_offset = 0;
@ -92,7 +92,7 @@ struct SizedSampleBuffer {
Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT; Glib::StaticPrivate<SizedSampleBuffer> thread_interleave_buffer = GLIBMM_STATIC_PRIVATE_INIT;
/** Constructor used for existing internal-to-session files. */ /** Constructor used for existing internal-to-session files. */
AudioFileSource::AudioFileSource (Session& s, const ustring& path, Source::Flag flags) AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags)
: Source (s, DataType::AUDIO, path, flags) : Source (s, DataType::AUDIO, path, flags)
, AudioSource (s, path) , AudioSource (s, path)
, FileSource (s, DataType::AUDIO, path, flags) , FileSource (s, DataType::AUDIO, path, flags)
@ -104,7 +104,7 @@ AudioFileSource::AudioFileSource (Session& s, const ustring& path, Source::Flag
} }
/** Constructor used for new internal-to-session files. */ /** Constructor used for new internal-to-session files. */
AudioFileSource::AudioFileSource (Session& s, const ustring& path, Source::Flag flags, AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags,
SampleFormat /*samp_format*/, HeaderFormat /*hdr_format*/) SampleFormat /*samp_format*/, HeaderFormat /*hdr_format*/)
: Source (s, DataType::AUDIO, path, flags) : Source (s, DataType::AUDIO, path, flags)
, AudioSource (s, path) , AudioSource (s, path)
@ -140,16 +140,16 @@ AudioFileSource::~AudioFileSource ()
} }
int int
AudioFileSource::init (const ustring& pathstr, bool must_exist) AudioFileSource::init (const string& pathstr, bool must_exist)
{ {
_peaks_built = false; _peaks_built = false;
return FileSource::init (pathstr, must_exist); return FileSource::init (pathstr, must_exist);
} }
ustring string
AudioFileSource::peak_path (ustring audio_path) AudioFileSource::peak_path (string audio_path)
{ {
ustring base; string base;
base = PBD::basename_nosuffix (audio_path); base = PBD::basename_nosuffix (audio_path);
base += '%'; base += '%';
@ -158,10 +158,10 @@ AudioFileSource::peak_path (ustring audio_path)
return _session.peak_path (base); return _session.peak_path (base);
} }
ustring string
AudioFileSource::find_broken_peakfile (ustring peak_path, ustring audio_path) AudioFileSource::find_broken_peakfile (string peak_path, string audio_path)
{ {
ustring str; string str;
/* check for the broken location in use by 2.0 for several months */ /* check for the broken location in use by 2.0 for several months */
@ -199,21 +199,21 @@ AudioFileSource::find_broken_peakfile (ustring peak_path, ustring audio_path)
return peak_path; return peak_path;
} }
ustring string
AudioFileSource::broken_peak_path (ustring audio_path) AudioFileSource::broken_peak_path (string audio_path)
{ {
return _session.peak_path (audio_path); return _session.peak_path (audio_path);
} }
ustring string
AudioFileSource::old_peak_path (ustring audio_path) AudioFileSource::old_peak_path (string audio_path)
{ {
/* XXX hardly bombproof! fix me */ /* XXX hardly bombproof! fix me */
struct stat stat_file; struct stat stat_file;
struct stat stat_mount; struct stat stat_mount;
ustring mp = mountpoint (audio_path); string mp = mountpoint (audio_path);
stat (audio_path.c_str(), &stat_file); stat (audio_path.c_str(), &stat_file);
stat (mp.c_str(), &stat_mount); stat (mp.c_str(), &stat_mount);
@ -225,7 +225,7 @@ AudioFileSource::old_peak_path (ustring audio_path)
snprintf (buf, sizeof (buf), "%" PRId64 "-%" PRId64 "-%d.peak", (int64_t) stat_mount.st_ino, (int64_t) stat_file.st_ino, _channel); snprintf (buf, sizeof (buf), "%" PRId64 "-%" PRId64 "-%d.peak", (int64_t) stat_mount.st_ino, (int64_t) stat_file.st_ino, _channel);
#endif #endif
ustring res = peak_dir; string res = peak_dir;
res += buf; res += buf;
res += peakfile_suffix; res += peakfile_suffix;
@ -233,7 +233,7 @@ AudioFileSource::old_peak_path (ustring audio_path)
} }
bool bool
AudioFileSource::get_soundfile_info (ustring path, SoundFileInfo& _info, string& error_msg) AudioFileSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
{ {
/* try sndfile first because it gets timecode info from .wav (BWF) if it exists, /* try sndfile first because it gets timecode info from .wav (BWF) if it exists,
which at present, ExtAudioFile from Apple seems unable to do. which at present, ExtAudioFile from Apple seems unable to do.
@ -312,7 +312,7 @@ AudioFileSource::set_header_position_offset (nframes_t offset)
} }
bool bool
AudioFileSource::is_empty (Session& /*s*/, ustring path) AudioFileSource::is_empty (Session& /*s*/, string path)
{ {
SoundFileInfo info; SoundFileInfo info;
string err; string err;
@ -336,7 +336,7 @@ AudioFileSource::setup_peakfile ()
} }
bool bool
AudioFileSource::safe_audio_file_extension(const ustring& file) AudioFileSource::safe_audio_file_extension(const string& file)
{ {
const char* suffixes[] = { const char* suffixes[] = {
".aif", ".AIF", ".aif", ".AIF",

View file

@ -48,7 +48,6 @@
using namespace std; using namespace std;
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using Glib::ustring;
bool AudioSource::_build_missing_peakfiles = false; bool AudioSource::_build_missing_peakfiles = false;
@ -57,7 +56,7 @@ bool AudioSource::_build_peakfiles = false;
#define _FPP 256 #define _FPP 256
AudioSource::AudioSource (Session& s, ustring name) AudioSource::AudioSource (Session& s, string name)
: Source (s, DataType::AUDIO, name) : Source (s, DataType::AUDIO, name)
, _length (0) , _length (0)
{ {
@ -196,11 +195,11 @@ AudioSource::touch_peakfile ()
} }
int int
AudioSource::rename_peakfile (ustring newpath) AudioSource::rename_peakfile (string newpath)
{ {
/* caller must hold _lock */ /* caller must hold _lock */
ustring oldpath = peakpath; string oldpath = peakpath;
if (access (oldpath.c_str(), F_OK) == 0) { if (access (oldpath.c_str(), F_OK) == 0) {
if (rename (oldpath.c_str(), newpath.c_str()) != 0) { if (rename (oldpath.c_str(), newpath.c_str()) != 0) {
@ -215,7 +214,7 @@ AudioSource::rename_peakfile (ustring newpath)
} }
int int
AudioSource::initialize_peakfile (bool newfile, ustring audio_path) AudioSource::initialize_peakfile (bool newfile, string audio_path)
{ {
struct stat statbuf; struct stat statbuf;

View file

@ -18,6 +18,7 @@
*/ */
#include <string>
#include "ardour/export_filename.h" #include "ardour/export_filename.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
@ -35,6 +36,7 @@
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
using std::string;
namespace ARDOUR namespace ARDOUR
{ {
@ -136,10 +138,10 @@ ExportFilename::set_state (const XMLNode & node)
return 0; return 0;
} }
ustring string
ExportFilename::get_path (FormatPtr format) const ExportFilename::get_path (FormatPtr format) const
{ {
ustring path = folder; string path = folder;
bool filename_empty = true; bool filename_empty = true;
path += "/"; path += "/";
@ -200,7 +202,7 @@ ExportFilename::get_path (FormatPtr format) const
return path; return path;
} }
ustring string
ExportFilename::get_time_format_str (TimeFormat format) const ExportFilename::get_time_format_str (TimeFormat format) const
{ {
switch ( format ) { switch ( format ) {
@ -218,7 +220,7 @@ ExportFilename::get_time_format_str (TimeFormat format) const
} }
} }
ustring string
ExportFilename::get_date_format_str (DateFormat format) const ExportFilename::get_date_format_str (DateFormat format) const
{ {
switch (format) { switch (format) {
@ -267,32 +269,32 @@ ExportFilename::set_date_format (DateFormat format)
} }
void void
ExportFilename::set_label (ustring value) ExportFilename::set_label (string value)
{ {
label = value; label = value;
include_label = !value.compare (""); include_label = !value.compare ("");
} }
bool bool
ExportFilename::set_folder (ustring path) ExportFilename::set_folder (string path)
{ {
// TODO check folder existence // TODO check folder existence
folder = path; folder = path;
return true; return true;
} }
ustring string
ExportFilename::get_formatted_time (ustring const & format) const ExportFilename::get_formatted_time (string const & format) const
{ {
char buffer [80]; char buffer [80];
strftime (buffer, 80, format.c_str(), time_struct); strftime (buffer, 80, format.c_str(), time_struct);
ustring return_value (buffer); string return_value (buffer);
return return_value; return return_value;
} }
void void
ExportFilename::add_field (XMLNode * node, ustring const & name, bool enabled, ustring const & value) ExportFilename::add_field (XMLNode * node, string const & name, bool enabled, string const & value)
{ {
XMLNode * child = node->add_child ("Field"); XMLNode * child = node->add_child ("Field");
@ -309,7 +311,7 @@ ExportFilename::add_field (XMLNode * node, ustring const & name, bool enabled, u
} }
ExportFilename::FieldPair ExportFilename::FieldPair
ExportFilename::get_field (XMLNode const & node, ustring const & name) ExportFilename::get_field (XMLNode const & node, string const & name)
{ {
FieldPair pair; FieldPair pair;
pair.first = false; pair.first = false;
@ -344,10 +346,10 @@ ExportFilename::analyse_folder ()
{ {
FieldPair pair; FieldPair pair;
ustring session_dir = session.session_directory().root_path().to_string(); string session_dir = session.session_directory().root_path().to_string();
ustring::size_type session_dir_len = session_dir.length(); string::size_type session_dir_len = session_dir.length();
ustring folder_beginning = folder.substr (0, session_dir_len); string folder_beginning = folder.substr (0, session_dir_len);
if (!folder_beginning.compare (session_dir)) { if (!folder_beginning.compare (session_dir)) {
pair.first = true; pair.first = true;

View file

@ -26,6 +26,8 @@
#include "i18n.h" #include "i18n.h"
using std::string;
namespace ARDOUR namespace ARDOUR
{ {
@ -248,7 +250,7 @@ ExportFormatManager::add_sample_rate (SampleRatePtr ptr)
} }
void void
ExportFormatManager::set_name (Glib::ustring name) ExportFormatManager::set_name (string name)
{ {
current_selection->set_name (name); current_selection->set_name (name);
} }

View file

@ -512,10 +512,10 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
} }
} }
Glib::ustring string
ExportFormatSpecification::description () ExportFormatSpecification::description ()
{ {
Glib::ustring desc; string desc;
desc = _name + ": "; desc = _name + ": ";

View file

@ -68,7 +68,7 @@ HasSampleFormat::add_sample_format (ExportFormatBase::SampleFormat format)
} }
void void
HasSampleFormat::add_dither_type (ExportFormatBase::DitherType type, Glib::ustring name) HasSampleFormat::add_dither_type (ExportFormatBase::DitherType type, string name)
{ {
DitherTypePtr ptr (new DitherTypeState (type, name)); DitherTypePtr ptr (new DitherTypeState (type, name));
dither_type_states.push_back (ptr); dither_type_states.push_back (ptr);
@ -179,7 +179,7 @@ HasSampleFormat::get_sample_format_name (ExportFormatBase::SampleFormat format)
/*** Linear ***/ /*** Linear ***/
ExportFormatLinear::ExportFormatLinear (Glib::ustring name, FormatId format_id) : ExportFormatLinear::ExportFormatLinear (string name, FormatId format_id) :
HasSampleFormat (sample_formats), HasSampleFormat (sample_formats),
_default_sample_format (SF_None) _default_sample_format (SF_None)
{ {

View file

@ -20,6 +20,7 @@
#include "pbd/filesystem.h" #include "pbd/filesystem.h"
using namespace AudioGrapher; using namespace AudioGrapher;
using std::string;
namespace ARDOUR { namespace ARDOUR {
@ -166,7 +167,7 @@ ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::Sndfil
{ {
unsigned channels = config.channel_config->get_n_chans(); unsigned channels = config.channel_config->get_n_chans();
int format = get_real_format (config); int format = get_real_format (config);
Glib::ustring filename = config.filename->get_path (config.format); string filename = config.filename->get_path (config.format);
writer.reset (new AudioGrapher::SndfileWriter<T> (filename, format, channels, config.format->sample_rate(), config.broadcast_info)); writer.reset (new AudioGrapher::SndfileWriter<T> (filename, format, channels, config.format->sample_rate(), config.broadcast_info));
writer->FileWritten.connect_same_thread (copy_files_connection, boost::bind (&ExportGraphBuilder::Encoder::copy_files, this, _1)); writer->FileWritten.connect_same_thread (copy_files_connection, boost::bind (&ExportGraphBuilder::Encoder::copy_files, this, _1));

View file

@ -364,7 +364,7 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
void void
ExportHandler::write_cue_header (CDMarkerStatus & status) ExportHandler::write_cue_header (CDMarkerStatus & status)
{ {
Glib::ustring title = status.timespan->name().compare ("Session") ? status.timespan->name() : (Glib::ustring) session.name(); string title = status.timespan->name().compare ("Session") ? status.timespan->name() : (string) session.name();
status.out << "REM Cue file generated by Ardour" << endl; status.out << "REM Cue file generated by Ardour" << endl;
status.out << "TITLE \"" << title << "\"" << endl; status.out << "TITLE \"" << title << "\"" << endl;
@ -388,7 +388,7 @@ ExportHandler::write_cue_header (CDMarkerStatus & status)
status.out << "FILE \"" << Glib::path_get_basename(status.filename) << "\" "; status.out << "FILE \"" << Glib::path_get_basename(status.filename) << "\" ";
if (!status.format->format_name().compare ("WAV")) { if (!status.format->format_name().compare ("WAV")) {
status.out << "WAVE"; status.out << "WAVE";
} else if (status.format->format_name() == ExportFormatBase::F_RAW && } else if (status.format->format_id() == ExportFormatBase::F_RAW &&
status.format->sample_format() == ExportFormatBase::SF_16 && status.format->sample_format() == ExportFormatBase::SF_16 &&
status.format->sample_rate() == ExportFormatBase::SR_44_1) { status.format->sample_rate() == ExportFormatBase::SR_44_1) {
// Format is RAW 16bit 44.1kHz // Format is RAW 16bit 44.1kHz
@ -407,7 +407,7 @@ ExportHandler::write_cue_header (CDMarkerStatus & status)
void void
ExportHandler::write_toc_header (CDMarkerStatus & status) ExportHandler::write_toc_header (CDMarkerStatus & status)
{ {
Glib::ustring title = status.timespan->name().compare ("Session") ? status.timespan->name() : (Glib::ustring) session.name(); string title = status.timespan->name().compare ("Session") ? status.timespan->name() : (string) session.name();
status.out << "CD_DA" << endl; status.out << "CD_DA" << endl;
status.out << "CD_TEXT {" << endl << " LANGUAGE_MAP {" << endl << " 0 : EN" << endl << " }" << endl; status.out << "CD_TEXT {" << endl << " LANGUAGE_MAP {" << endl << " 0 : EN" << endl << " }" << endl;

View file

@ -307,7 +307,7 @@ ExportProfileManager::set_selection_range (nframes_t start, nframes_t end)
} }
std::string std::string
ExportProfileManager::set_single_range (nframes_t start, nframes_t end, Glib::ustring name) ExportProfileManager::set_single_range (nframes_t start, nframes_t end, string name)
{ {
single_range_mode = true; single_range_mode = true;
@ -361,7 +361,7 @@ ExportProfileManager::deserialize_timespan (XMLNode & root)
prop = (*node_it)->property ("id"); prop = (*node_it)->property ("id");
if (!prop) { continue; } if (!prop) { continue; }
ustring id = prop->value(); string id = prop->value();
for (LocationList::iterator it = ranges->begin(); it != ranges->end(); ++it) { for (LocationList::iterator it = ranges->begin(); it != ranges->end(); ++it) {
if ((!id.compare ("session") && *it == session_range.get()) || if ((!id.compare ("session") && *it == session_range.get()) ||
@ -494,7 +494,7 @@ ExportProfileManager::save_format_to_disk (FormatPtr format)
/* Get filename for file */ /* Get filename for file */
Glib::ustring new_name = format->name(); string new_name = format->name();
new_name += export_format_suffix; new_name += export_format_suffix;
sys::path new_path (export_config_dir); sys::path new_path (export_config_dir);
@ -777,7 +777,7 @@ ExportProfileManager::check_config (boost::shared_ptr<Warnings> warnings,
for (uint32_t chan = 1; chan <= channel_config->get_n_chans(); ++chan) { for (uint32_t chan = 1; chan <= channel_config->get_n_chans(); ++chan) {
filename->set_channel (chan); filename->set_channel (chan);
Glib::ustring path = filename->get_path (format); string path = filename->get_path (format);
if (sys::exists (sys::path (path))) { if (sys::exists (sys::path (path))) {
warnings->conflicting_filenames.push_back (path); warnings->conflicting_filenames.push_back (path);
@ -785,7 +785,7 @@ ExportProfileManager::check_config (boost::shared_ptr<Warnings> warnings,
} }
} else { } else {
Glib::ustring path = filename->get_path (format); string path = filename->get_path (format);
if (sys::exists (sys::path (path))) { if (sys::exists (sys::path (path))) {
warnings->conflicting_filenames.push_back (path); warnings->conflicting_filenames.push_back (path);

View file

@ -52,9 +52,9 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using namespace Glib; using namespace Glib;
map<DataType, ustring> FileSource::search_paths; map<DataType, string> FileSource::search_paths;
FileSource::FileSource (Session& session, DataType type, const ustring& path, Source::Flag flag) FileSource::FileSource (Session& session, DataType type, const string& path, Source::Flag flag)
: Source(session, type, path, flag) : Source(session, type, path, flag)
, _path(path) , _path(path)
, _file_is_new(true) , _file_is_new(true)
@ -90,7 +90,7 @@ FileSource::removable () const
} }
int int
FileSource::init (const ustring& pathstr, bool must_exist) FileSource::init (const string& pathstr, bool must_exist)
{ {
_timeline_position = 0; _timeline_position = 0;
@ -126,7 +126,7 @@ FileSource::set_state (const XMLNode& node, int /*version*/)
} }
void void
FileSource::mark_take (const ustring& id) FileSource::mark_take (const string& id)
{ {
if (writable ()) { if (writable ()) {
_take_id = id; _take_id = id;
@ -134,7 +134,7 @@ FileSource::mark_take (const ustring& id)
} }
int int
FileSource::move_to_trash (const ustring& trash_dir_name) FileSource::move_to_trash (const string& trash_dir_name)
{ {
if (!within_session() || !writable()) { if (!within_session() || !writable()) {
return -1; return -1;
@ -156,7 +156,7 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
if (Glib::file_test (newpath.c_str(), Glib::FILE_TEST_EXISTS)) { if (Glib::file_test (newpath.c_str(), Glib::FILE_TEST_EXISTS)) {
char buf[PATH_MAX+1]; char buf[PATH_MAX+1];
int version = 1; int version = 1;
ustring newpath_v; string newpath_v;
snprintf (buf, sizeof (buf), "%s.%d", newpath.c_str(), version); snprintf (buf, sizeof (buf), "%s.%d", newpath.c_str(), version);
newpath_v = buf; newpath_v = buf;
@ -204,13 +204,13 @@ FileSource::move_to_trash (const ustring& trash_dir_name)
* \return true iff the file was found. * \return true iff the file was found.
*/ */
bool bool
FileSource::find (DataType type, const ustring& path, bool must_exist, FileSource::find (DataType type, const string& path, bool must_exist,
bool& isnew, uint16_t& chan, ustring& found_path) bool& isnew, uint16_t& chan, string& found_path)
{ {
Glib::ustring search_path = search_paths[type]; string search_path = search_paths[type];
ustring pathstr = path; string pathstr = path;
ustring::size_type pos; string::size_type pos;
bool ret = false; bool ret = false;
isnew = false; isnew = false;
@ -219,10 +219,10 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
/* non-absolute pathname: find pathstr in search path */ /* non-absolute pathname: find pathstr in search path */
vector<ustring> dirs; vector<string> dirs;
int cnt; int cnt;
ustring fullpath; string fullpath;
ustring keeppath; string keeppath;
if (search_path.length() == 0) { if (search_path.length() == 0) {
error << _("FileSource: search path not set") << endmsg; error << _("FileSource: search path not set") << endmsg;
@ -233,7 +233,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
cnt = 0; cnt = 0;
for (vector<ustring>::iterator i = dirs.begin(); i != dirs.end(); ++i) { for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) {
fullpath = Glib::build_filename (*i, pathstr); fullpath = Glib::build_filename (*i, pathstr);
@ -241,7 +241,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
Ardour 0.99 .. this hack tries to make things sort of work. Ardour 0.99 .. this hack tries to make things sort of work.
*/ */
if ((pos = pathstr.find_last_of (':')) != ustring::npos) { if ((pos = pathstr.find_last_of (':')) != string::npos) {
if (Glib::file_test (fullpath, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) { if (Glib::file_test (fullpath, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
@ -258,7 +258,7 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
without the :suffix exists without the :suffix exists
*/ */
ustring shorter = pathstr.substr (0, pos); string shorter = pathstr.substr (0, pos);
fullpath = Glib::build_filename (*i, shorter); fullpath = Glib::build_filename (*i, shorter);
if (Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) { if (Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
@ -323,9 +323,9 @@ FileSource::find (DataType type, const ustring& path, bool must_exist,
/* ugh, handle ':' situation */ /* ugh, handle ':' situation */
if ((pos = pathstr.find_last_of (':')) != ustring::npos) { if ((pos = pathstr.find_last_of (':')) != string::npos) {
ustring shorter = pathstr.substr (0, pos); string shorter = pathstr.substr (0, pos);
if (Glib::file_test (shorter, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) { if (Glib::file_test (shorter, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
chan = atoi (pathstr.substr (pos+1)); chan = atoi (pathstr.substr (pos+1));
@ -369,11 +369,11 @@ out:
} }
int int
FileSource::set_source_name (const ustring& newname, bool destructive) FileSource::set_source_name (const string& newname, bool destructive)
{ {
Glib::Mutex::Lock lm (_lock); Glib::Mutex::Lock lm (_lock);
ustring oldpath = _path; string oldpath = _path;
ustring newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive); string newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive);
if (newpath.empty()) { if (newpath.empty()) {
error << string_compose (_("programming error: %1"), "cannot generate a changed file path") << endmsg; error << string_compose (_("programming error: %1"), "cannot generate a changed file path") << endmsg;
@ -398,7 +398,7 @@ FileSource::set_source_name (const ustring& newname, bool destructive)
} }
void void
FileSource::set_search_path (DataType type, const ustring& p) FileSource::set_search_path (DataType type, const string& p)
{ {
search_paths[type] = p; search_paths[type] = p;
} }

View file

@ -240,7 +240,7 @@ create_mono_sources_for_writing (const vector<string>& new_paths, Session& sess,
return true; return true;
} }
static Glib::ustring static string
compose_status_message (const string& path, compose_status_message (const string& path,
uint file_samplerate, uint file_samplerate,
uint session_samplerate, uint session_samplerate,
@ -448,7 +448,7 @@ Session::import_audiofiles (ImportStatus& status)
status.sources.clear (); status.sources.clear ();
for (vector<Glib::ustring>::iterator p = status.paths.begin(); for (vector<string>::iterator p = status.paths.begin();
p != status.paths.end() && !status.cancel; p != status.paths.end() && !status.cancel;
++p) ++p)
{ {

View file

@ -65,7 +65,7 @@ MidiPatchManager::refresh()
assert(is_directory(path_to_patches)); assert(is_directory(path_to_patches));
Glib::PatternSpec pattern(Glib::ustring("*.midnam")); Glib::PatternSpec pattern(string("*.midnam"));
vector<path> result; vector<path> result;
find_matching_files_in_directory(path_to_patches, pattern, result); find_matching_files_in_directory(path_to_patches, pattern, result);

View file

@ -16,12 +16,14 @@
675 Mass Ave, Cambridge, MA 02139, USA. 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <glibmm/ustring.h> #include <string>
#include "ardour/port_set.h" #include "ardour/port_set.h"
#include "ardour/midi_port.h" #include "ardour/midi_port.h"
#include "ardour/audio_port.h" #include "ardour/audio_port.h"
using std::string;
namespace ARDOUR { namespace ARDOUR {
PortSet::PortSet() PortSet::PortSet()
@ -32,18 +34,18 @@ PortSet::PortSet()
static bool sort_ports_by_name (Port* a, Port* b) static bool sort_ports_by_name (Port* a, Port* b)
{ {
Glib::ustring aname (a->name()); string aname (a->name());
Glib::ustring bname (b->name()); string bname (b->name());
Glib::ustring::size_type last_digit_position_a = aname.size(); string::size_type last_digit_position_a = aname.size();
Glib::ustring::reverse_iterator r_iterator = aname.rbegin(); string::reverse_iterator r_iterator = aname.rbegin();
while (r_iterator!= aname.rend() && Glib::Unicode::isdigit(*r_iterator)) { while (r_iterator!= aname.rend() && Glib::Unicode::isdigit(*r_iterator)) {
r_iterator++; r_iterator++;
last_digit_position_a--; last_digit_position_a--;
} }
Glib::ustring::size_type last_digit_position_b = bname.size(); string::size_type last_digit_position_b = bname.size();
r_iterator = bname.rbegin(); r_iterator = bname.rbegin();
while (r_iterator != bname.rend() && Glib::Unicode::isdigit(*r_iterator)) { while (r_iterator != bname.rend() && Glib::Unicode::isdigit(*r_iterator)) {

View file

@ -2719,7 +2719,7 @@ Session::source_by_id (const PBD::ID& id)
} }
boost::shared_ptr<Source> boost::shared_ptr<Source>
Session::source_by_path_and_channel (const Glib::ustring& path, uint16_t chn) Session::source_by_path_and_channel (const string& path, uint16_t chn)
{ {
Glib::Mutex::Lock lm (source_lock); Glib::Mutex::Lock lm (source_lock);
@ -2865,8 +2865,8 @@ Session::new_source_path_from_name (DataType type, const string& name, bool as_s
return p.to_string(); return p.to_string();
} }
Glib::ustring string
Session::peak_path (Glib::ustring base) const Session::peak_path (string base) const
{ {
sys::path peakfile_path(_session_dir->peak_path()); sys::path peakfile_path(_session_dir->peak_path());
peakfile_path /= basename_nosuffix (base) + peakfile_suffix; peakfile_path /= basename_nosuffix (base) + peakfile_suffix;

View file

@ -88,9 +88,9 @@ SessionMetadata::~SessionMetadata ()
} }
XMLNode * XMLNode *
SessionMetadata::get_xml (const ustring & name) SessionMetadata::get_xml (const string & name)
{ {
ustring value = get_value (name); string value = get_value (name);
if (value.empty()) { if (value.empty()) {
return 0; return 0;
} }
@ -102,8 +102,8 @@ SessionMetadata::get_xml (const ustring & name)
return node; return node;
} }
ustring string
SessionMetadata::get_value (const ustring & name) const SessionMetadata::get_value (const string & name) const
{ {
PropertyMap::const_iterator it = map.find (name); PropertyMap::const_iterator it = map.find (name);
if (it == map.end()) { if (it == map.end()) {
@ -116,13 +116,13 @@ SessionMetadata::get_value (const ustring & name) const
} }
uint32_t uint32_t
SessionMetadata::get_uint_value (const ustring & name) const SessionMetadata::get_uint_value (const string & name) const
{ {
return atoi (get_value (name).c_str()); return atoi (get_value (name).c_str());
} }
void void
SessionMetadata::set_value (const ustring & name, const ustring & value) SessionMetadata::set_value (const string & name, const string & value)
{ {
PropertyMap::iterator it = map.find (name); PropertyMap::iterator it = map.find (name);
if (it == map.end()) { if (it == map.end()) {
@ -135,7 +135,7 @@ SessionMetadata::set_value (const ustring & name, const ustring & value)
} }
void void
SessionMetadata::set_value (const ustring & name, uint32_t value) SessionMetadata::set_value (const string & name, uint32_t value)
{ {
std::ostringstream oss; std::ostringstream oss;
oss << value; oss << value;
@ -166,8 +166,8 @@ int
SessionMetadata::set_state (const XMLNode & state, int /*version*/) SessionMetadata::set_state (const XMLNode & state, int /*version*/)
{ {
const XMLNodeList & children = state.children(); const XMLNodeList & children = state.children();
ustring name; string name;
ustring value; string value;
XMLNode * node; XMLNode * node;
for (XMLNodeConstIterator it = children.begin(); it != children.end(); it++) { for (XMLNodeConstIterator it = children.begin(); it != children.end(); it++) {
@ -187,19 +187,19 @@ SessionMetadata::set_state (const XMLNode & state, int /*version*/)
} }
/*** Accessing ***/ /*** Accessing ***/
ustring string
SessionMetadata::comment () const SessionMetadata::comment () const
{ {
return get_value("comment"); return get_value("comment");
} }
ustring string
SessionMetadata::copyright () const SessionMetadata::copyright () const
{ {
return get_value("copyright"); return get_value("copyright");
} }
ustring string
SessionMetadata::isrc () const SessionMetadata::isrc () const
{ {
return get_value("isrc"); return get_value("isrc");
@ -211,103 +211,103 @@ SessionMetadata::year () const
return get_uint_value("year"); return get_uint_value("year");
} }
ustring string
SessionMetadata::grouping () const SessionMetadata::grouping () const
{ {
return get_value("grouping"); return get_value("grouping");
} }
ustring string
SessionMetadata::title () const SessionMetadata::title () const
{ {
return get_value("title"); return get_value("title");
} }
ustring string
SessionMetadata::subtitle () const SessionMetadata::subtitle () const
{ {
return get_value("subtitle"); return get_value("subtitle");
} }
ustring string
SessionMetadata::artist () const SessionMetadata::artist () const
{ {
return get_value("artist"); return get_value("artist");
} }
ustring string
SessionMetadata::album_artist () const SessionMetadata::album_artist () const
{ {
return get_value("album_artist"); return get_value("album_artist");
} }
ustring string
SessionMetadata::lyricist () const SessionMetadata::lyricist () const
{ {
return get_value("lyricist"); return get_value("lyricist");
} }
ustring string
SessionMetadata::composer () const SessionMetadata::composer () const
{ {
return get_value("composer"); return get_value("composer");
} }
ustring string
SessionMetadata::conductor () const SessionMetadata::conductor () const
{ {
return get_value("conductor"); return get_value("conductor");
} }
ustring string
SessionMetadata::remixer () const SessionMetadata::remixer () const
{ {
return get_value("remixer"); return get_value("remixer");
} }
ustring string
SessionMetadata::arranger () const SessionMetadata::arranger () const
{ {
return get_value("arranger"); return get_value("arranger");
} }
ustring string
SessionMetadata::engineer () const SessionMetadata::engineer () const
{ {
return get_value("engineer"); return get_value("engineer");
} }
ustring string
SessionMetadata::producer () const SessionMetadata::producer () const
{ {
return get_value("producer"); return get_value("producer");
} }
ustring string
SessionMetadata::dj_mixer () const SessionMetadata::dj_mixer () const
{ {
return get_value("dj_mixer"); return get_value("dj_mixer");
} }
ustring string
SessionMetadata::mixer () const SessionMetadata::mixer () const
{ {
return get_value("mixer"); return get_value("mixer");
} }
ustring string
SessionMetadata::album () const SessionMetadata::album () const
{ {
return get_value("album"); return get_value("album");
} }
ustring string
SessionMetadata::compilation () const SessionMetadata::compilation () const
{ {
return get_value("compilation"); return get_value("compilation");
} }
ustring string
SessionMetadata::disc_subtitle () const SessionMetadata::disc_subtitle () const
{ {
return get_value("disc_subtitle"); return get_value("disc_subtitle");
@ -337,7 +337,7 @@ SessionMetadata::total_tracks () const
return get_uint_value("total_tracks"); return get_uint_value("total_tracks");
} }
ustring string
SessionMetadata::genre () const SessionMetadata::genre () const
{ {
return get_value("genre"); return get_value("genre");
@ -345,19 +345,19 @@ SessionMetadata::genre () const
/*** Editing ***/ /*** Editing ***/
void void
SessionMetadata::set_comment (const ustring & v) SessionMetadata::set_comment (const string & v)
{ {
set_value ("comment", v); set_value ("comment", v);
} }
void void
SessionMetadata::set_copyright (const ustring & v) SessionMetadata::set_copyright (const string & v)
{ {
set_value ("copyright", v); set_value ("copyright", v);
} }
void void
SessionMetadata::set_isrc (const ustring & v) SessionMetadata::set_isrc (const string & v)
{ {
set_value ("isrc", v); set_value ("isrc", v);
} }
@ -369,103 +369,103 @@ SessionMetadata::set_year (uint32_t v)
} }
void void
SessionMetadata::set_grouping (const ustring & v) SessionMetadata::set_grouping (const string & v)
{ {
set_value ("grouping", v); set_value ("grouping", v);
} }
void void
SessionMetadata::set_title (const ustring & v) SessionMetadata::set_title (const string & v)
{ {
set_value ("title", v); set_value ("title", v);
} }
void void
SessionMetadata::set_subtitle (const ustring & v) SessionMetadata::set_subtitle (const string & v)
{ {
set_value ("subtitle", v); set_value ("subtitle", v);
} }
void void
SessionMetadata::set_artist (const ustring & v) SessionMetadata::set_artist (const string & v)
{ {
set_value ("artist", v); set_value ("artist", v);
} }
void void
SessionMetadata::set_album_artist (const ustring & v) SessionMetadata::set_album_artist (const string & v)
{ {
set_value ("album_artist", v); set_value ("album_artist", v);
} }
void void
SessionMetadata::set_lyricist (const ustring & v) SessionMetadata::set_lyricist (const string & v)
{ {
set_value ("lyricist", v); set_value ("lyricist", v);
} }
void void
SessionMetadata::set_composer (const ustring & v) SessionMetadata::set_composer (const string & v)
{ {
set_value ("composer", v); set_value ("composer", v);
} }
void void
SessionMetadata::set_conductor (const ustring & v) SessionMetadata::set_conductor (const string & v)
{ {
set_value ("conductor", v); set_value ("conductor", v);
} }
void void
SessionMetadata::set_remixer (const ustring & v) SessionMetadata::set_remixer (const string & v)
{ {
set_value ("remixer", v); set_value ("remixer", v);
} }
void void
SessionMetadata::set_arranger (const ustring & v) SessionMetadata::set_arranger (const string & v)
{ {
set_value ("arranger", v); set_value ("arranger", v);
} }
void void
SessionMetadata::set_engineer (const ustring & v) SessionMetadata::set_engineer (const string & v)
{ {
set_value ("engineer", v); set_value ("engineer", v);
} }
void void
SessionMetadata::set_producer (const ustring & v) SessionMetadata::set_producer (const string & v)
{ {
set_value ("producer", v); set_value ("producer", v);
} }
void void
SessionMetadata::set_dj_mixer (const ustring & v) SessionMetadata::set_dj_mixer (const string & v)
{ {
set_value ("dj_mixer", v); set_value ("dj_mixer", v);
} }
void void
SessionMetadata::set_mixer (const ustring & v) SessionMetadata::set_mixer (const string & v)
{ {
set_value ("mixer", v); set_value ("mixer", v);
} }
void void
SessionMetadata::set_album (const ustring & v) SessionMetadata::set_album (const string & v)
{ {
set_value ("album", v); set_value ("album", v);
} }
void void
SessionMetadata::set_compilation (const ustring & v) SessionMetadata::set_compilation (const string & v)
{ {
set_value ("compilation", v); set_value ("compilation", v);
} }
void void
SessionMetadata::set_disc_subtitle (const ustring & v) SessionMetadata::set_disc_subtitle (const string & v)
{ {
set_value ("disc_subtitle", v); set_value ("disc_subtitle", v);
} }
@ -495,7 +495,7 @@ SessionMetadata::set_total_tracks (uint32_t v)
} }
void void
SessionMetadata::set_genre (const ustring & v) SessionMetadata::set_genre (const string & v)
{ {
set_value ("genre", v); set_value ("genre", v);
} }

View file

@ -2417,7 +2417,7 @@ Session::find_all_sources (string path, set<string>& result)
continue; continue;
} }
Glib::ustring found_path; string found_path;
bool is_new; bool is_new;
uint16_t chan; uint16_t chan;

View file

@ -50,7 +50,7 @@ using namespace Glib;
using namespace PBD; using namespace PBD;
/** Constructor used for new internal-to-session files. File cannot exist. */ /** Constructor used for new internal-to-session files. File cannot exist. */
SMFSource::SMFSource (Session& s, const ustring& path, Source::Flag flags) SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags)
: Source(s, DataType::MIDI, path, flags) : Source(s, DataType::MIDI, path, flags)
, MidiSource(s, path) , MidiSource(s, path)
, FileSource(s, DataType::MIDI, path, flags) , FileSource(s, DataType::MIDI, path, flags)
@ -416,9 +416,9 @@ SMFSource::mark_streaming_write_completed ()
} }
bool bool
SMFSource::safe_midi_file_extension (const Glib::ustring& file) SMFSource::safe_midi_file_extension (const string& file)
{ {
return (file.rfind(".mid") != Glib::ustring::npos); return (file.rfind(".mid") != string::npos);
} }
void void

View file

@ -44,7 +44,7 @@
using namespace std; using namespace std;
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
using Glib::ustring; using std::string;
gain_t* SndFileSource::out_coefficient = 0; gain_t* SndFileSource::out_coefficient = 0;
gain_t* SndFileSource::in_coefficient = 0; gain_t* SndFileSource::in_coefficient = 0;
@ -67,7 +67,7 @@ SndFileSource::SndFileSource (Session& s, const XMLNode& node)
} }
/** Files created this way are never writable or removable */ /** Files created this way are never writable or removable */
SndFileSource::SndFileSource (Session& s, const ustring& path, int chn, Flag flags) SndFileSource::SndFileSource (Session& s, const string& path, int chn, Flag flags)
: Source(s, DataType::AUDIO, path, flags) : Source(s, DataType::AUDIO, path, flags)
, AudioFileSource (s, path, Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))) , AudioFileSource (s, path, Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))
{ {
@ -81,7 +81,7 @@ SndFileSource::SndFileSource (Session& s, const ustring& path, int chn, Flag fla
} }
/** This constructor is used to construct new files, not open existing ones. */ /** This constructor is used to construct new files, not open existing ones. */
SndFileSource::SndFileSource (Session& s, const ustring& path, SndFileSource::SndFileSource (Session& s, const string& path,
SampleFormat sfmt, HeaderFormat hf, nframes_t rate, Flag flags) SampleFormat sfmt, HeaderFormat hf, nframes_t rate, Flag flags)
: Source(s, DataType::AUDIO, path, flags) : Source(s, DataType::AUDIO, path, flags)
, AudioFileSource (s, path, flags, sfmt, hf) , AudioFileSource (s, path, flags, sfmt, hf)
@ -178,7 +178,7 @@ SndFileSource::SndFileSource (Session& s, const ustring& path,
void void
SndFileSource::init_sndfile () SndFileSource::init_sndfile ()
{ {
ustring file; string file;
// lets try to keep the object initalizations here at the top // lets try to keep the object initalizations here at the top
xfade_buf = 0; xfade_buf = 0;
@ -830,7 +830,7 @@ SndFileSource::set_timeline_position (int64_t pos)
} }
int int
SndFileSource::get_soundfile_info (const ustring& path, SoundFileInfo& info, string& error_msg) SndFileSource::get_soundfile_info (const string& path, SoundFileInfo& info, string& error_msg)
{ {
SNDFILE *sf; SNDFILE *sf;
SF_INFO sf_info; SF_INFO sf_info;

View file

@ -39,6 +39,7 @@
#include <errno.h> #include <errno.h>
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#ifdef HAVE_WORDEXP #ifdef HAVE_WORDEXP
#include <wordexp.h> #include <wordexp.h>
@ -48,6 +49,7 @@
#include "pbd/stacktrace.h" #include "pbd/stacktrace.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/basename.h" #include "pbd/basename.h"
#include "pbd/strsplit.h"
#include "ardour/utils.h" #include "ardour/utils.h"
#include "i18n.h" #include "i18n.h"
@ -55,14 +57,14 @@
using namespace ARDOUR; using namespace ARDOUR;
using namespace std; using namespace std;
using namespace PBD; using namespace PBD;
using Glib::ustring;
ustring string
legalize_for_path (ustring str) legalize_for_path (const string& str)
{ {
ustring::size_type pos; #if OLD_SCHOOL_PROHIBITIVE
ustring legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: "; string::size_type pos;
ustring legal; string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
string legal;
legal = str; legal = str;
pos = 0; pos = 0;
@ -73,6 +75,21 @@ legalize_for_path (ustring str)
} }
return legal; return legal;
#else
string::size_type pos;
string illegal_chars = "/\\"; /* DOS, POSIX. Yes, we're going to ignore HFS */
string legal;
legal = str;
pos = 0;
while ((pos = legal.find_first_of (illegal_chars, pos)) != string::npos) {
legal.replace (pos, 1, "_");
pos += 1;
}
return legal;
#endif
} }
string string
@ -117,6 +134,46 @@ bump_name_once (const std::string& name, char delimiter)
} }
bool
could_be_a_valid_path (const string& path)
{
vector<string> posix_dirs;
vector<string> dos_dirs;
string testpath;
split (path, posix_dirs, '/');
split (path, dos_dirs, '\\');
/* remove the last component of each */
posix_dirs.erase (--posix_dirs.end());
dos_dirs.erase (--dos_dirs.end());
if (G_DIR_SEPARATOR == '/') {
for (vector<string>::iterator x = posix_dirs.begin(); x != posix_dirs.end(); ++x) {
testpath = Glib::build_filename (testpath, *x);
cerr << "Testing " << testpath << endl;
if (!Glib::file_test (testpath, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) {
return false;
}
}
}
if (G_DIR_SEPARATOR == '\\') {
testpath = "";
for (vector<string>::iterator x = dos_dirs.begin(); x != dos_dirs.end(); ++x) {
testpath = Glib::build_filename (testpath, *x);
cerr << "Testing " << testpath << endl;
if (!Glib::file_test (testpath, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) {
return false;
}
}
}
return true;
}
XMLNode * XMLNode *
find_named_node (const XMLNode& node, string name) find_named_node (const XMLNode& node, string name)
{ {
@ -156,7 +213,7 @@ cmp_nocase (const string& s, const string& s2)
} }
int int
touch_file (ustring path) touch_file (string path)
{ {
int fd = open (path.c_str(), O_RDWR|O_CREAT, 0660); int fd = open (path.c_str(), O_RDWR|O_CREAT, 0660);
if (fd >= 0) { if (fd >= 0) {
@ -166,8 +223,8 @@ touch_file (ustring path)
return 1; return 1;
} }
ustring string
region_name_from_path (ustring path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one) region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one)
{ {
path = PBD::basename_nosuffix (path); path = PBD::basename_nosuffix (path);
@ -175,7 +232,7 @@ region_name_from_path (ustring path, bool strip_channels, bool add_channel_suffi
/* remove any "?R", "?L" or "?[a-z]" channel identifier */ /* remove any "?R", "?L" or "?[a-z]" channel identifier */
ustring::size_type len = path.length(); string::size_type len = path.length();
if (len > 3 && (path[len-2] == '%' || path[len-2] == '?' || path[len-2] == '.') && if (len > 3 && (path[len-2] == '%' || path[len-2] == '?' || path[len-2] == '.') &&
(path[len-1] == 'R' || path[len-1] == 'L' || (islower (path[len-1])))) { (path[len-1] == 'R' || path[len-1] == 'L' || (islower (path[len-1])))) {
@ -199,9 +256,9 @@ region_name_from_path (ustring path, bool strip_channels, bool add_channel_suffi
} }
bool bool
path_is_paired (ustring path, ustring& pair_base) path_is_paired (string path, string& pair_base)
{ {
ustring::size_type pos; string::size_type pos;
/* remove any leading path */ /* remove any leading path */
@ -215,7 +272,7 @@ path_is_paired (ustring path, ustring& pair_base)
path = path.substr (0, pos); path = path.substr (0, pos);
} }
ustring::size_type len = path.length(); string::size_type len = path.length();
/* look for possible channel identifier: "?R", "%R", ".L" etc. */ /* look for possible channel identifier: "?R", "%R", ".L" etc. */
@ -230,8 +287,8 @@ path_is_paired (ustring path, ustring& pair_base)
return false; return false;
} }
ustring string
path_expand (ustring path) path_expand (string path)
{ {
#ifdef HAVE_WORDEXP #ifdef HAVE_WORDEXP
/* Handle tilde and environment variable expansion in session path */ /* Handle tilde and environment variable expansion in session path */

View file

@ -30,7 +30,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <cerrno> #include <cerrno>
#include <glibmm/ustring.h> #include <glibmm/string.h>
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>
#include <lrdf.h> #include <lrdf.h>