set_name (X_("ardour"));
set_website (X_("http://ardour.org/"));
set_website_label (X_("ardour.org"));
- set_version ((compose(_("%1\n(built with ardour/gtk %2.%3.%4 libardour: %5.%6.%7)"),
+ set_version ((string_compose(_("%1\n(built with ardour/gtk %2.%3.%4 libardour: %5.%6.%7)"),
VERSIONSTRING,
gtk_ardour_major_version,
gtk_ardour_minor_version,
#include <gtkmm.h>
#include <pbd/error.h>
-#include <pbd/compose.h>
+#include <pbd/string_compose.h>
#include <pbd/basename.h>
#include <pbd/pathscanner.h>
#include <pbd/failed_constructor.h>
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &ARDOUR_UI::cannot_record_no_input), ds));
- string msg = PBD::compose (_("\
+ string msg = string_compose (_("\
You cannot record-enable\n\
track %1\n\
because it has no input connections.\n\
string msg;
- msg = PBD::compose(_("Save and %1"), what);
+ msg = string_compose(_("Save and %1"), what);
Gtk::Button save_button (msg);
save_button.set_name ("EditorGTKButton");
- msg = PBD::compose(_("Just %1"), what);
+ msg = string_compose(_("Just %1"), what);
Gtk::Button nosave_button (msg);
nosave_button.set_name ("EditorGTKButton");
- msg = PBD::compose(_("Don't %1"), what);
+ msg = string_compose(_("Don't %1"), what);
Gtk::Button noquit_button (msg);
noquit_button.set_name ("EditorGTKButton");
} else {
type = _("snapshot");
}
- prompt = PBD::compose(_("The %1\n\"%2\"\nhas not been saved.\n\nAny changes made this time\nwill be lost unless you save it.\n\nWhat do you want to do?"),
+ prompt = string_compose(_("The %1\n\"%2\"\nhas not been saved.\n\nAny changes made this time\nwill be lost unless you save it.\n\nWhat do you want to do?"),
type, session->snap_name());
prompt_label.set_text (prompt);
// Check that it doesn't already exist.
access(session_path.c_str(), R_OK);
if (errno != ENOENT){
- error << PBD::compose(_("Session %1 already exists at %2"), session_name, session_path) << endmsg;
+ error << string_compose(_("Session %1 already exists at %2"), session_name, session_path) << endmsg;
return;
}
catch (...) {
- error << PBD::compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name) << endmsg;
+ error << string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name) << endmsg;
return -1;
}
catch (...) {
- error << PBD::compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name) << endmsg;
+ error << string_compose(_("Session \"%1 (snapshot %2)\" did not load successfully"), path, snap_name) << endmsg;
return -1;
}
if (rep.space < 1048576.0f) {
if (removed > 1) {
- txt.set_text (PBD::compose (msg, removed, _("files"), (float) rep.space / 1024.0f, "kilo"));
+ txt.set_text (string_compose (msg, removed, _("files"), (float) rep.space / 1024.0f, "kilo"));
} else {
- txt.set_text (PBD::compose (msg, removed, _("file"), (float) rep.space / 1024.0f, "kilo"));
+ txt.set_text (string_compose (msg, removed, _("file"), (float) rep.space / 1024.0f, "kilo"));
}
} else {
if (removed > 1) {
- txt.set_text (PBD::compose (msg, removed, _("files"), (float) rep.space / 1048576.0f, "mega"));
+ txt.set_text (string_compose (msg, removed, _("files"), (float) rep.space / 1048576.0f, "mega"));
} else {
- txt.set_text (PBD::compose (msg, removed, _("file"), (float) rep.space / 1048576.0f, "mega"));
+ txt.set_text (string_compose (msg, removed, _("file"), (float) rep.space / 1048576.0f, "mega"));
}
}
if ((ran = find_redirect_automation_node (redirect, what)) == 0) {
fatal << _("programming error: ")
- << compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
+ << string_compose (X_("redirect automation curve for %1:%2 not registered with audio track!"),
redirect->name(), what)
<< endmsg;
/*NOTREACHED*/
playlist_menu = new Menu;
playlist_menu->set_name ("ArdourContextMenu");
- playlist_items.push_back (MenuElem (compose (_("Current: %1"), get_diskstream()->playlist()->name())));
+ playlist_items.push_back (MenuElem (string_compose (_("Current: %1"), get_diskstream()->playlist()->name())));
playlist_items.push_back (SeparatorElem());
playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist)));
if (session->undo_depth() == 0) {
label = _("Undo");
} else {
- label = compose(_("Undo (%1)"), session->next_undo());
+ label = string_compose(_("Undo (%1)"), session->next_undo());
}
edit_items.push_back (MenuElem (label, bind (mem_fun(*this, &Editor::undo), 1U)));
if (session->redo_depth() == 0) {
label = _("Redo");
} else {
- label = compose(_("Redo (%1)"), session->next_redo());
+ label = string_compose(_("Redo (%1)"), session->next_redo());
}
edit_items.push_back (MenuElem (label, bind (mem_fun(*this, &Editor::redo), 1U)));
Editor::playlist_deletion_dialog (Playlist* pl)
{
ArdourDialog dialog ("playlist deletion dialog");
- Label label (compose (_("Playlist %1 is currently unused.\n"
+ Label label (string_compose (_("Playlist %1 is currently unused.\n"
"If left alone, no audio files used by it will be cleaned.\n"
"If deleted, audio files used by it alone by will cleaned."),
pl->name()));
gnome_canvas_w2c_d (GNOME_CANVAS(track_gnome_canvas), event->crossing.x, event->crossing.y, pcx, pcy);
break;
default:
- warning << compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
+ warning << string_compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
break;
}
vector<string> choices;
string prompt;
- prompt = compose (_(" This is destructive, will possibly delete audio files\n\
+ prompt = string_compose (_(" This is destructive, will possibly delete audio files\n\
It cannot be undone\n\
Do you really want to destroy %1 ?"),
(selected > 1 ?
point = Start;
break;
default:
- fatal << compose (_("build_region_boundary_cache called with snap_type = %1"), snap_type) << endmsg;
+ fatal << string_compose (_("build_region_boundary_cache called with snap_type = %1"), snap_type) << endmsg;
/*NOTREACHED*/
return;
}
for (vector<string>::iterator i = paths.begin(); i != paths.end(); ++i ) {
- interthread_progress_window->set_title (compose (_("ardour: importing %1"), (*i)));
+ interthread_progress_window->set_title (string_compose (_("ardour: importing %1"), (*i)));
import_status.pathname = (*i);
import_status.done = false;
if (finfo.samplerate != (int) session->frame_rate()) {
vector<string> choices;
- choices.push_back (compose (_("%1 it anyway"), action));
+ choices.push_back (string_compose (_("%1 it anyway"), action));
if (multiple_pending) {
/* XXX assumptions about sentence structure
here for translators. Sorry.
*/
- choices.push_back (compose (_("Don't %1 it"), action));
- choices.push_back (compose (_("%1 all without questions"), action));
+ choices.push_back (string_compose (_("Don't %1 it"), action));
+ choices.push_back (string_compose (_("%1 all without questions"), action));
choices.push_back (_("Cancel entire import"));
} else {
choices.push_back (_("Cancel"));
}
Gtkmm2ext::Choice rate_choice (
- compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
+ string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
choices);
rate_choice.chosen.connect (Main::quit.slot());
if ((sf = sf_open (path.c_str(), SFM_READ, &finfo)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("Editor: cannot open file \"%1\" (%2)"), selection, errbuf) << endmsg;
+ error << string_compose(_("Editor: cannot open file \"%1\" (%2)"), selection, errbuf) << endmsg;
return;
}
sf_close (sf);
for (int n=0; n < finfo.channels; ++n)
{
idspec = path;
- idspec += compose(":%1", n);
+ idspec += string_compose(":%1", n);
try {
source = new SndFileSource (idspec.c_str());
}
catch (failed_constructor& err) {
- error << compose(_("could not open %1"), path) << endmsg;
+ error << string_compose(_("could not open %1"), path) << endmsg;
goto out;
}
if ((sf = sf_open ((*p).c_str(), SFM_READ, &finfo)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("Editor: cannot open file \"%1\" (%2)"), (*p), errbuf) << endmsg;
+ error << string_compose(_("Editor: cannot open file \"%1\" (%2)"), (*p), errbuf) << endmsg;
continue;
}
if ((sf = sf_open (path.c_str(), SFM_READ, &finfo)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("Editor: cannot open file \"%1\" (%2)"), path, errbuf) << endmsg;
+ error << string_compose(_("Editor: cannot open file \"%1\" (%2)"), path, errbuf) << endmsg;
return;
}
sf_close (sf);
for (int n=0; n < finfo.channels; ++n)
{
idspec = path;
- idspec += compose(":%1", n);
+ idspec += string_compose(":%1", n);
try {
source = new SndFileSource (idspec.c_str());
}
catch (failed_constructor& err) {
- error << compose(_("could not open %1"), path) << endmsg;
+ error << string_compose(_("could not open %1"), path) << endmsg;
goto out;
}
item.clear ();
if (region->n_channels() > 1) {
- str = compose("%1 [%2]", region->name(), region->n_channels());
+ str = string_compose("%1 [%2]", region->name(), region->n_channels());
item.push_back (str.c_str());
} else {
item.push_back (region->name().c_str());
item.clear ();
if (region->n_channels() > 1) {
- str = compose("%1 [%2]", region->name(), region->n_channels());
+ str = string_compose("%1 [%2]", region->name(), region->n_channels());
item.push_back (str.c_str());
} else {
item.push_back (region->name().c_str());
item.clear ();
if (region->n_channels() > 1) {
- str = compose("%1 [%2]", region->name(), region->n_channels());
+ str = string_compose("%1 [%2]", region->name(), region->n_channels());
item.push_back (str.c_str());
} else {
item.push_back (region->name().c_str());
gchar buf[18];
if (!out) {
- error << compose(_("Editor: cannot open \"%1\" as export file for CD toc file"), filepath) << endmsg;
+ error << string_compose(_("Editor: cannot open \"%1\" as export file for CD toc file"), filepath) << endmsg;
return;
}
out << "CD_DA" << endl;
if ((*i)->cd_info.find("performer") != (*i)->cd_info.end()) {
out << " PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
- if ((*i)->cd_info.find("composer") != (*i)->cd_info.end()) {
- out << " COMPOSER \"" << (*i)->cd_info["composer"] << "\"" << endl;
+ if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
+ out << " COMPOSER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
if ((*i)->cd_info.find("isrc") != (*i)->cd_info.end()) {
int numtracks = 0, tracknum = 0, indexnum = 0;
if (!out) {
- error << compose(_("Editor: cannot open \"%1\" as export file for CD cue file"), filepath) << endmsg;
+ error << string_compose(_("Editor: cannot open \"%1\" as export file for CD cue file"), filepath) << endmsg;
return;
}
out << "PERFORMER \"" << (*i)->cd_info["performer"] << "\"" << endl;
}
- if ((*i)->cd_info.find("composer") != (*i)->cd_info.end()) {
- out << "SONGWRITER \"" << (*i)->cd_info["composer"] << "\"" << endl;
+ if ((*i)->cd_info.find("string_composer") != (*i)->cd_info.end()) {
+ out << "SONGWRITER \"" << (*i)->cd_info["string_composer"] << "\"" << endl;
}
snprintf (buf, sizeof(buf), "INDEX %02d", indexnum);
out << buf;
if (route->n_outputs() == 1) {
stupid_list.push_back (route->name());
} else {
- stupid_list.push_back (compose("%1: out-%2", route->name(), i+1));
+ stupid_list.push_back (string_compose("%1: out-%2", route->name(), i+1));
}
stupid_list.push_back ("");
msgBuffer << ardourvis::ITEM_UPDATE << ardourvis::IMAGEFRAME_ITEM << ardourvis::POSITION_CHANGE ;
// add the item description
- this->compose_imageframe_item_desc(item, msgBuffer) ;
+ this->string_compose_imageframe_item_desc(item, msgBuffer) ;
msgBuffer << std::setw(ardourvis::TIME_VALUE_CHARS) << pos ;
// add the msg type
msgBuffer << ardourvis::ITEM_UPDATE << ardourvis::IMAGEFRAME_ITEM << ardourvis::DURATION_CHANGE ;
- this->compose_imageframe_item_desc(item, msgBuffer) ;
+ this->string_compose_imageframe_item_desc(item, msgBuffer) ;
msgBuffer << std::setw(ardourvis::TIME_VALUE_CHARS) << dur ;
// add the msg type
msgBuffer << ardourvis::RENAME_ITEM << ardourvis::IMAGEFRAME_ITEM ;
- this->compose_imageframe_item_desc(item, msgBuffer) ;
+ this->string_compose_imageframe_item_desc(item, msgBuffer) ;
// add the old id and length
msgBuffer << std::setw(3) << old_id.length() ;
msgBuffer << ardourvis::ITEM_UPDATE << ardourvis::MARKER_ITEM << ardourvis::POSITION_CHANGE ;
// add the item description
- this->compose_marker_item_desc(item, msgBuffer) ;
+ this->string_compose_marker_item_desc(item, msgBuffer) ;
msgBuffer << std::setw(ardourvis::TIME_VALUE_CHARS) << pos ;
// add the msg type
msgBuffer << ardourvis::ITEM_UPDATE << ardourvis::MARKER_ITEM << ardourvis::DURATION_CHANGE ;
- this->compose_marker_item_desc(item, msgBuffer) ;
+ this->string_compose_marker_item_desc(item, msgBuffer) ;
msgBuffer << std::setw(ardourvis::TIME_VALUE_CHARS) << dur ;
// add the msg type
msgBuffer << ardourvis::RENAME_ITEM << ardourvis::MARKER_ITEM ;
- this->compose_marker_item_desc(item, msgBuffer) ;
+ this->string_compose_marker_item_desc(item, msgBuffer) ;
// add the old id and length
msgBuffer << std::setw(3) << old_id.length() ;
int scene_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
// get the named time axis
ImageFrameTimeAxis* ifta = dynamic_cast<ImageFrameTimeAxis*>(thePublicEditor.get_named_time_axis(track_id)) ;
int scene_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
jack_nframes_t start_frame = strtoul(get_message_part(position, ardourvis::TIME_VALUE_CHARS, msg).c_str(), 0, 10) ;
position += ardourvis::TIME_VALUE_CHARS ;
int scene_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, scene_id, scene_id_size, item_id, item_id_size) ;
jack_nframes_t duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ;
int group_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
std::string pos_lock = get_message_part(position,1,msg) ;
bool pos_lock_active = false ;
int group_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
jack_nframes_t max_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ;
int group_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
std::string active = get_message_part(position,1,msg) ;
bool max_duration_active = false ;
int group_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
jack_nframes_t min_duration = strtoul(get_message_part(position,ardourvis::TIME_VALUE_CHARS,msg).c_str(),0,10) ;
position += ardourvis::TIME_VALUE_CHARS ;
int group_id_size ;
int item_id_size ;
- this->decompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
+ this->dstring_ecompose_imageframe_item_desc(msg, position, track_id, track_id_size, group_id, group_id_size, item_id, item_id_size) ;
std::string active = get_message_part(position,1,msg) ;
bool min_duration_active = false ;
* @param item_id_size
*/
void
-ImageFrameSocketHandler::decompose_imageframe_item_desc(const char* msg, int& position, std::string& track_id,
+ImageFrameSocketHandler::dstring_ecompose_imageframe_item_desc(const char* msg, int& position, std::string& track_id,
int& track_id_size, std::string& scene_id, int& scene_id_size, std::string& item_id, int& item_id_size)
{
// get the track Id size
* The description consists of the parent track name size and name,
* the parent group name size and name, and the item name size and name
*
- * @param ifv the item to compose a description of
+ * @param ifv the item to string_compose a description of
* @param buffer the buffer to write the description
*/
void
* The description consists of the parent track name size and name,
* and the item name size and name
*
- * @param mv the item to compose a description of
+ * @param mv the item to string_compose a description of
* @param buffer the buffer to write the description
*/
void
/**
- * Convenience method to compose and send a success messasge back to the Image Compositor
+ * Convenience method to string_compose and send a success messasge back to the Image Compositor
*
*/
void
}
/**
- * Convenience method to compose and send a failure messasge back to the Image Compositor
+ * Convenience method to string_compose and send a failure messasge back to the Image Compositor
*
* @param msg the failure message
*/
string title;
if (input) {
- title = compose(_("%1 input"), ior.name());
+ title = string_compose(_("%1 input"), ior.name());
} else {
- title = compose(_("%1 output"), ior.name());
+ title = string_compose(_("%1 output"), ior.name());
}
ok_button.set_name ("IOSelectorButton");
}
if ((keycode = gdk_keyval_from_name(get_real_keyname (keyname).c_str())) == GDK_VoidSymbol) {
- error << compose(_("KeyboardTarget: keyname \"%1\" is unknown."), keyname) << endmsg;
+ error << string_compose(_("KeyboardTarget: keyname \"%1\" is unknown."), keyname) << endmsg;
result.clear();
return result;
}
alternate_meta_modname = "Mod2";
break;
default:
- error << compose (_("Your system is completely broken - NumLock uses \"%1\""
+ error << string_compose (_("Your system is completely broken - NumLock uses \"%1\""
"as its modifier. This is madness - see the man page "
"for xmodmap to find out how to fix this."),
modname)
return;
}
- warning << compose (_("Your system generates \"%1\" when the NumLock key "
+ warning << string_compose (_("Your system generates \"%1\" when the NumLock key "
"is pressed. This can cause problems when editing "
"so Ardour will use %2 to mean Meta rather than %1"),
modname, alternate_meta_modname)
}
#ifdef WARN_ABOUT_DUPLICATE_MODIFIERS
if (bound > 1) {
- warning << compose (_("You have %1 keys bound to \"mod1\""), bound) << endmsg;
+ warning << string_compose (_("You have %1 keys bound to \"mod1\""), bound) << endmsg;
}
#endif
bound = 0;
}
#ifdef WARN_ABOUT_DUPLICATE_MODIFIERS
if (bound > 1) {
- warning << compose (_("You have %1 keys bound to \"mod2\""), bound) << endmsg;
+ warning << string_compose (_("You have %1 keys bound to \"mod2\""), bound) << endmsg;
}
#endif
bound = 0;
}
#ifdef WARN_ABOUT_DUPLICATE_MODIFIERS
if (bound > 1) {
- warning << compose (_("You have %1 keys bound to \"mod3\""), bound) << endmsg;
+ warning << string_compose (_("You have %1 keys bound to \"mod3\""), bound) << endmsg;
}
#endif
bound = 0;
}
#ifdef WARN_ABOUT_DUPLICATE_MODIFIERS
if (bound > 1) {
- warning << compose (_("You have %1 keys bound to \"mod4\""), bound) << endmsg;
+ warning << string_compose (_("You have %1 keys bound to \"mod4\""), bound) << endmsg;
}
#endif
bound = 0;
}
#ifdef WARN_ABOUT_DUPLICATE_MODIFIERS
if (bound > 1) {
- warning << compose (_("You have %1 keys bound to \"mod5\""), bound) << endmsg;
+ warning << string_compose (_("You have %1 keys bound to \"mod5\""), bound) << endmsg;
}
#endif
}
if (state.size() == 0) {
- error << compose(_("KeyboardTarget: no translation found for \"%1\""), keystring) << endmsg;
+ error << string_compose(_("KeyboardTarget: no translation found for \"%1\""), keystring) << endmsg;
return -1;
}
if (find_action (action, key_action)) {
- error << compose(_("KeyboardTarget: unknown action \"%1\""), action) << endmsg;
+ error << string_compose(_("KeyboardTarget: unknown action \"%1\""), action) << endmsg;
return -1;
}
ftw_return = 0;
if (ftw (file->c_str(), process_node, 100) < 0){
- warning << compose(_("%1 not added to database"), *file) << endmsg;
+ warning << string_compose(_("%1 not added to database"), *file) << endmsg;
}
delete old_parent;
SNDFILE *sf;
SF_INFO info;
if ((sf = sf_open ((char *) file, SFM_READ, &info)) < 0) {
- error << compose(_("file \"%1\" could not be opened"), file) << endmsg;
+ error << string_compose(_("file \"%1\" could not be opened"), file) << endmsg;
return ftw_return;
}
sf_close (sf);
string uri = Library->add_member(file, parent_uri);
- Library->set_field(uri, "channels", compose("%1", info.channels));
- Library->set_field(uri, "samplerate", compose("%1", info.samplerate));
- Library->set_field(uri, "resolution", compose("%1", sndfile_data_width(info.format)));
- Library->set_field(uri, "format", compose("%1", info.format));
+ Library->set_field(uri, "channels", string_compose("%1", info.channels));
+ Library->set_field(uri, "samplerate", string_compose("%1", info.samplerate));
+ Library->set_field(uri, "resolution", string_compose("%1", sndfile_data_width(info.format)));
+ Library->set_field(uri, "format", string_compose("%1", info.format));
return ftw_return;
}
}
if ((sf = sf_open ((char *) file.c_str(), SFM_READ, sf_info)) < 0) {
- error << compose(_("file \"%1\" could not be opened"), file) << endmsg;
+ error << string_compose(_("file \"%1\" could not be opened"), file) << endmsg;
return -1;
}
sf_info->format == 0 &&
sf_info->sections == 0) {
/* .. ok, its not a sound file */
- error << compose(_("file \"%1\" appears not to be an audio file"), file) << endmsg;
+ error << string_compose(_("file \"%1\" appears not to be an audio file"), file) << endmsg;
return -1;
}
path_entry.signal_focus_out_event()().connect (ptr_fun (ARDOUR_UI::generic_focus_out_event));
length.set_alignment (0.0f, 0.0f);
- length.set_text (compose("Length: %1", length2string(sf_info->frames, sf_info->samplerate)));
+ length.set_text (string_compose("Length: %1", length2string(sf_info->frames, sf_info->samplerate)));
format.set_alignment (0.0f, 0.0f);
- format.set_text (compose("Format: %1, %2",
+ format.set_text (string_compose("Format: %1, %2",
sndfile_major_format(sf_info->format),
sndfile_minor_format(sf_info->format)));
channels.set_alignment (0.0f, 0.0f);
- channels.set_text (compose("Channels: %1", sf_info->channels));
+ channels.set_text (string_compose("Channels: %1", sf_info->channels));
samplerate.set_alignment (0.0f, 0.0f);
- samplerate.set_text (compose("Samplerate: %1", sf_info->samplerate));
+ samplerate.set_text (string_compose("Samplerate: %1", sf_info->samplerate));
return 0;
}
}
if (access(file.c_str(), R_OK)) {
- warning << compose(_("Could not read file: %1 (%2)."), file, strerror(errno)) << endmsg;
+ warning << string_compose(_("Could not read file: %1 (%2)."), file, strerror(errno)) << endmsg;
return;
}
for (int n=0; n < sf_info->channels; ++n) {
try {
- sfs = new SndFileSource(file+":"+compose("%1", n), false);
+ sfs = new SndFileSource(file+":"+string_compose("%1", n), false);
srclist.push_back(sfs);
} catch (failed_constructor& err) {
preemph_check_button.set_name ("LocationEditCdButton");
performer_label.set_name ("LocationEditNumberLabel");
performer_entry.set_name ("LocationEditNameEntry");
- composer_label.set_name ("LocationEditNumberLabel");
- composer_entry.set_name ("LocationEditNameEntry");
+ string_composer_label.set_name ("LocationEditNumberLabel");
+ string_composer_entry.set_name ("LocationEditNameEntry");
isrc_label.set_text ("ISRC: ");
isrc_label.set_size_request (30, -1);
performer_label.set_text ("Performer: ");
performer_label.set_size_request (60, -1);
- composer_label.set_text ("Composer: ");
- composer_label.set_size_request (60, -1);
+ string_composer_label.set_text ("Composer: ");
+ string_composer_label.set_size_request (60, -1);
isrc_entry.set_size_request (112, -1);
isrc_entry.set_max_length(12);
performer_entry.set_size_request (100, -1);
performer_entry.set_editable (true);
- composer_entry.set_size_request (100, -1);
- composer_entry.set_editable (true);
+ string_composer_entry.set_size_request (100, -1);
+ string_composer_entry.set_editable (true);
cd_track_details_hbox.pack_start (isrc_label, false, false);
cd_track_details_hbox.pack_start (isrc_entry, false, false);
cd_track_details_hbox.pack_start (preemph_check_button, false, false);
cd_track_details_hbox.pack_start (performer_label, false, false);
cd_track_details_hbox.pack_start (performer_entry, true, true);
- cd_track_details_hbox.pack_start (composer_label, false, false);
- cd_track_details_hbox.pack_start (composer_entry, true, true);
+ cd_track_details_hbox.pack_start (string_composer_label, false, false);
+ cd_track_details_hbox.pack_start (string_composer_entry, true, true);
isrc_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::isrc_entry_changed));
isrc_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
performer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
performer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
- composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
- composer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
+ string_composer_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::composer_entry_changed));
+ string_composer_entry.signal_focus_in_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
+ string_composer_entry.signal_focus_out_event().connect (mem_fun(*this, &LocationEditRow::entry_focus_event));
scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
number = num;
if (number >= 0 ) {
- number_label.set_text (compose ("%1", number));
+ number_label.set_text (string_compose ("%1", number));
}
}
if (i_am_the_modifier || !location) return;
- if (composer_entry.get_text() != "") {
- location->cd_info["composer"] = composer_entry.get_text();
+ if (string_composer_entry.get_text() != "") {
+ location->cd_info["string_composer"] = string_composer_entry.get_text();
} else {
- location->cd_info.erase("composer");
+ location->cd_info.erase("string_composer");
}
}
if (location->cd_info.find("performer") != location->cd_info.end()) {
performer_entry.set_text(location->cd_info["performer"]);
}
- if (location->cd_info.find("composer") != location->cd_info.end()) {
- composer_entry.set_text(location->cd_info["composer"]);
+ if (location->cd_info.find("string_composer") != location->cd_info.end()) {
+ string_composer_entry.set_text(location->cd_info["string_composer"]);
}
if (location->cd_info.find("scms") != location->cd_info.end()) {
scms_check_button.set_active(true);
// if (setpgid (0,0)) {
if (setsid ()) {
- warning << compose (_("cannot become new process group leader (%1)"),
+ warning << string_compose (_("cannot become new process group leader (%1)"),
strerror (errno))
<< endmsg;
}
for (int i = 1; i < 32; i++) {
if (sigismember (&signals, i)) {
if (sigaction (i, &action, 0)) {
- cerr << compose (_("cannot setup signal handling for %1"), i) << endl;
+ cerr << string_compose (_("cannot setup signal handling for %1"), i) << endl;
return -1;
}
}
*/
if (pthread_sigmask (SIG_SETMASK, &signals, 0)) {
- cerr << compose (_("cannot set default signal mask (%1)"), strerror (errno)) << endl;
+ cerr << string_compose (_("cannot set default signal mask (%1)"), strerror (errno)) << endl;
return -1;
}
catch (AudioEngine::NoBackendAvailable& err) {
gui_jack_error ();
- error << compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
+ error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
bool isnew;
if (Session::find_session (session_name, path, name, isnew)) {
- error << compose(_("could not load command line session \"%1\""), session_name) << endmsg;
+ error << string_compose(_("could not load command line session \"%1\""), session_name) << endmsg;
} else {
if (new_session) {
/* it wasn't new, but we require a new session */
- error << compose (_("\n\nA session named \"%1\" already exists.\n\
+ error << string_compose (_("\n\nA session named \"%1\" already exists.\n\
To avoid this message, start ardour as \"ardour %1"), path)
<< endmsg;
goto out;
/* command line didn't require a new session */
if (isnew) {
- error << compose (_("\n\nNo session named \"%1\" exists.\n\
+ error << string_compose (_("\n\nNo session named \"%1\" exists.\n\
To create it from the command line, start ardour as \"ardour --new %1"), path)
<< endmsg;
goto out;
meter.set (log_meter (power));
if (over_short != last_over_short) {
- buf = compose("%1", over_short);
+ buf = string_compose("%1", over_short);
over_short_label.set_text (buf);
last_over_short = over_short;
}
if (over_long != last_over_long) {
- buf = compose("%1", over_long);
+ buf = string_compose("%1", over_long);
over_long_label.set_text (buf);
last_over_long = over_long;
}
set_width (Narrow);
}
else {
- error << compose(_("unknown strip width \"%1\" in XML GUI information"), prop->value()) << endmsg;
+ error << string_compose(_("unknown strip width \"%1\" in XML GUI information"), prop->value()) << endmsg;
set_width (Wide);
}
}
/* sample rate */
- sr_label1.set_text (compose
+ sr_label1.set_text (string_compose
(_("This session will playback and record at %1 Hz"),
engine.frame_rate()));
sr_label2.set_text (_("This rate is set by JACK and cannot be changed.\n"
}
if ((cui = build_control_ui (engine, i, plugin.get_nth_midi_control (i))) == 0) {
- error << compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;
+ error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;
continue;
}
Entry* entry = combo.get_entry();
if (entry->get_text().length() > 0) {
if (!plugin.load_preset(entry->get_text())) {
- warning << compose(_("Plugin preset %1 not found"), entry->get_text()) << endmsg;
+ warning << string_compose(_("Plugin preset %1 not found"), entry->get_text()) << endmsg;
}
}
/* i hate this kind of code */
if (streams > p.get_info().n_inputs) {
- label.set_text (compose (_(
+ label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
"The plugin has %2 inputs\n"
"but at the insertion point, there are\n"
p.get_info().n_inputs,
streams));
} else if (streams < p.get_info().n_inputs) {
- label.set_text (compose (_(
+ label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
"The plugin has %2 inputs\n"
"but at the insertion point there are\n"
p.get_info().n_inputs,
streams));
} else {
- label.set_text (compose (_(
+ label.set_text (string_compose (_(
"You attempted to add a plugin (%1).\n"
"\n"
"The I/O configuration doesn't make sense:\n"
if (send->get_gui() == 0) {
string title;
- title = compose(_("ardour: %1"), send->name());
+ title = string_compose(_("ardour: %1"), send->name());
send_ui = new SendUIWindow (*send, _session);
send_ui->set_title (title);
maker += " ...";
}
- title = compose(_("ardour: %1: %2 (by %3)"), _route.name(), plugin_insert->name(), maker);
+ title = string_compose(_("ardour: %1: %2 (by %3)"), _route.name(), plugin_insert->name(), maker);
plugin_ui = new PluginUIWindow (_session.engine(), *plugin_insert);
if (_owner_is_mixer) {
#include <ardour/diskstream.h>
#include "i18n.h"
-/* there is a compose() here.. */
+/* there is a string_compose() here.. */
//using namespace sigc;
using namespace Gtk;
using namespace Gtkmm2ext;
string prompt;
if (is_audio_track()) {
- prompt = compose (_("Do you really want to remove track \"%1\" ?\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove track \"%1\" ?\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route.name());
} else {
- prompt = compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
}
choices.push_back (_("Yes, remove it."));
for (i = strings.begin(); i != strings.end(); ++i) {
if (text == *i) {
if (sscanf (text.c_str(), "%*[^0-9]%lf", ¬e_type) != 1) {
- error << compose(_("garbaged note type entry (%1)"), text) << endmsg;
+ error << string_compose(_("garbaged note type entry (%1)"), text) << endmsg;
return 0;
} else {
break;
if (i == strings.end()) {
if (sscanf (text.c_str(), "%lf", ¬e_type) != 1) {
- error << compose(_("incomprehensible note type entry (%1)"), text) << endmsg;
+ error << string_compose(_("incomprehensible note type entry (%1)"), text) << endmsg;
return 0;
}
}
#include "i18n.h"
using namespace Gtk;
-/*can't use sigc namespace while we have the compose() in libs/pbd3/pbd */
+/*can't use sigc namespace while we have the string_compose() in libs/pbd3/pbd */
//using namespace sigc;
using namespace ARDOUR;
using namespace Editing;
} else if (prop->value() == "small") {
set_height (Small);
} else {
- error << compose(_("unknown track height name \"%1\" in XML GUI information"), prop->value()) << endmsg;
+ error << string_compose(_("unknown track height name \"%1\" in XML GUI information"), prop->value()) << endmsg;
set_height (Normal);
}
TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src)
{
if ((dur > max_item_duration) || (dur < min_item_duration)) {
- warning << compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
+ warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
<< endmsg;
return false;
}
return *i;
}
}
- fatal << compose (_("programming error: request for non-existent audio range (%1)!"), which) << endmsg;
+ fatal << string_compose (_("programming error: request for non-existent audio range (%1)!"), which) << endmsg;
/*NOTREACHED*/
return *(new AudioRange(0,0,0)); /* keep the compiler happy; never called */
}
// PARSE HEADER
if ( sscanf(xpm[0], "%u%u%u%u", &w, &h, &colors, &cpp) != 4 ) {
- error << compose (_("bad XPM header %1"), xpm[0])
+ error << string_compose (_("bad XPM header %1"), xpm[0])
<< endmsg;
return 0;
}
// PARSE HEADER
if ( sscanf(xpm[0], "%u%u%u%u", &w, &h, &colors, &cpp) != 4 ) {
- error << compose (_("bad XPM header %1"), xpm[0])
+ error << string_compose (_("bad XPM header %1"), xpm[0])
<< endmsg;
return 0;
}
a = waverc->fg[GTK_STATE_ACTIVE].red / 257;
} else {
- warning << compose (_("missing RGBA style for \"%1\""), style) << endl;
+ warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl;
}
return (uint32_t) RGBA_TO_UINT(r,g,b,a);
{
vector<string> choices;
- std::string prompt = compose (_("Do you really want to remove track \"%1\" ?\n(cannot be undone)"), time_axis_name);
+ std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n(cannot be undone)"), time_axis_name);
choices.push_back (_("Yes, remove it."));
choices.push_back (_("No, do nothing."));
AudioLibrary::save_changes ()
{
if (lrdf_export_by_source(src.c_str(), src.substr(5).c_str())) {
- warning << compose(_("Could not open %1. Audio Library not saved"), src) << endmsg;
+ warning << string_compose(_("Could not open %1. Audio Library not saved"), src) << endmsg;
}
}
string
AudioLibrary::add_group (string group, string parent_uri)
{
- string local_group(compose("file:sfbd/group/%1", get_uid()));
+ string local_group(string_compose("file:sfbd/group/%1", get_uid()));
lrdf_add_triple(src.c_str(), local_group.c_str(),
RDFS_BASE "label", group.c_str(), lrdf_literal);
string
AudioLibrary::add_member (string member, string parent_uri)
{
- string local_member(compose("file:sfdb/soundfile/%1", get_uid()));
- string file_uri(compose("file:%1", member));
+ string local_member(string_compose("file:sfdb/soundfile/%1", get_uid()));
+ string file_uri(string_compose("file:%1", member));
lrdf_add_triple(src.c_str(), local_member.c_str(), RDF_TYPE,
SOUNDFILE, lrdf_uri);
}
catch (failed_constructor& err) {
- // cout << compose (_("could not create crossfade object in playlist %1"),
+ // cout << string_compose (_("could not create crossfade object in playlist %1"),
// _name)
// << endl;
continue;
Connection* c = _session.connection_by_name (prop->value());
if (c == 0) {
- error << compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
if ((c = _session.connection_by_name (_("in 1"))) == 0) {
error << _("No input connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
} else if ((prop = node.property ("inputs")) != 0) {
if (set_inputs (prop->value())) {
- error << compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
+ error << string_compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
return -1;
}
}
DiskStream *dstream;
if ((dstream = _session.diskstream_by_name (name)) == 0) {
- error << compose(_("AudioTrack: diskstream \"%1\" not known by session"), name) << endmsg;
+ error << string_compose(_("AudioTrack: diskstream \"%1\" not known by session"), name) << endmsg;
return -1;
}
DiskStream *dstream;
if ((dstream = _session.diskstream_by_id (id)) == 0) {
- error << compose(_("AudioTrack: diskstream \"%1\" not known by session"), id) << endmsg;
+ error << string_compose(_("AudioTrack: diskstream \"%1\" not known by session"), id) << endmsg;
return -1;
}
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_rec_enable_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI rec_enable control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI rec_enable control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
}
FreezeRecordInsertInfo* frii = new FreezeRecordInsertInfo (*((*citer)->children().front()));
frii->insert = 0;
- sscanf (prop->value().c_str(), "%llu", &frii->id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &frii->id);
_freeze_record.insert_info.push_back (frii);
}
}
uint32_t n = 1;
- while (n < ULONG_MAX) {
+ while (n < (ULONG_MAX-1)) {
string candidate;
- candidate = compose ("<F%2>%1", _freeze_record.playlist->name(), n);
+ candidate = string_compose ("<F%2>%1", _freeze_record.playlist->name(), n);
if (_session.playlist_by_name (candidate) == 0) {
new_playlist_name = candidate;
}
- if (n == ULONG_MAX) {
- error << compose (X_("There Are too many frozen versions of playlist \"%1\""
+ if (n == (ULONG_MAX-1)) {
+ error << string_compose (X_("There Are too many frozen versions of playlist \"%1\""
" to create another one"), _freeze_record.playlist->name())
<< endmsg;
return;
pair<string,string> c (s, d);
port_connections.push_back (c);
} else {
- error << compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"),
+ error << string_compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"),
source, s, destination, d)
<< endmsg;
}
error << _("Unable to connect to JACK server") << endmsg;
}
- error << compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
+ error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
return -1;
}
short_name = long_name.substr (long_name.find_last_of (':') + 1);
if (((*i)->port = jack_port_register (_jack, short_name.c_str(), (*i)->type(), (*i)->flags(), 0)) == 0) {
- error << compose (_("could not reregister %1"), (*i)->name()) << endmsg;
+ error << string_compose (_("could not reregister %1"), (*i)->name()) << endmsg;
break;
} else {
}
if ((err = jack_connect (_jack, (*i).first.c_str(), (*i).second.c_str())) != 0) {
if (err != EEXIST) {
- error << compose (_("could not reconnect %1 and %2 (err = %3)"),
+ error << string_compose (_("could not reconnect %1 and %2 (err = %3)"),
(*i).first, (*i).second, err)
<< endmsg;
}
string path = session.path_from_region_name (PBD::basename_nosuffix (names[i]), string (""));
if (path.length() == 0) {
- error << compose (_("audiofilter: error creating name for new audio file based on %1"), region.name())
+ error << string_compose (_("audiofilter: error creating name for new audio file based on %1"), region.name())
<< endmsg;
return -1;
}
}
catch (failed_constructor& err) {
- error << compose (_("audiofilter: error creating new audio file %1 (%2)"), path, strerror (errno)) << endmsg;
+ error << string_compose (_("audiofilter: error creating new audio file %1 (%2)"), path, strerror (errno)) << endmsg;
return -1;
}
}
cerr << "Loading system configuration file " << rcfile << endl;
if (!tree.read (rcfile.c_str())) {
- error << compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
+ error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
if (set_state (*tree.root())) {
- error << compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
+ error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
cerr << "Loading user configuration file " << rcfile << endl;
if (!tree.read (rcfile)) {
- error << compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
+ error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
if (set_state (*tree.root())) {
- error << compose(_("Ardour: configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
+ error << string_compose(_("Ardour: configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
start += 1;
if ((end = str.find_first_of ('}', start)) == string::npos) {
- error << compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
+ error << string_compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
return -1;
}
if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
- error << compose(_("bad input string in XML node \"%1\""), str) << endmsg;
+ error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
return -1;
throw failed_constructor();
}
- sscanf (prop->value().c_str(), "%llu", &id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &id);
if ((r = playlist.find_region (id)) == 0) {
- error << compose (_("Crossfade: no \"in\" region %1 found in playlist %2"), id, playlist.name())
+ error << string_compose (_("Crossfade: no \"in\" region %1 found in playlist %2"), id, playlist.name())
<< endmsg;
throw failed_constructor();
}
throw failed_constructor();
}
- sscanf (prop->value().c_str(), "%llu", &id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &id);
if ((r = playlist.find_region (id)) == 0) {
- error << compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id, playlist.name())
+ error << string_compose (_("Crossfade: no \"out\" region %1 found in playlist %2"), id, playlist.name())
<< endmsg;
throw failed_constructor();
}
AudioPlaylist* playlist;
if ((pl = _session.get_playlist (name)) == 0) {
- error << compose(_("DiskStream: Session doesn't know about a Playlist called \"%1\""), name) << endmsg;
+ error << string_compose(_("DiskStream: Session doesn't know about a Playlist called \"%1\""), name) << endmsg;
return -1;
}
if ((playlist = dynamic_cast<AudioPlaylist*> (pl)) == 0) {
- error << compose(_("DiskStream: Playlist \"%1\" isn't an audio playlist"), name) << endmsg;
+ error << string_compose(_("DiskStream: Playlist \"%1\" isn't an audio playlist"), name) << endmsg;
return -1;
}
DiskStream::use_copy_playlist ()
{
if (_playlist == 0) {
- error << compose(_("DiskStream %1: there is no existing playlist to make a copy of!"), _name) << endmsg;
+ error << string_compose(_("DiskStream %1: there is no existing playlist to make a copy of!"), _name) << endmsg;
return -1;
}
if (read ((*chan).playback_buf->buffer() + overwrite_offset, mixdown_buffer, gain_buffer,
start, to_read, *chan, n, reversed)) {
- error << compose(_("DiskStream %1: when refilling, cannot read %2 from playlist at frame %3"),
+ error << string_compose(_("DiskStream %1: when refilling, cannot read %2 from playlist at frame %3"),
_id, size, playback_sample) << endmsg;
goto out;
}
if (read ((*chan).playback_buf->buffer(), mixdown_buffer, gain_buffer,
start, cnt, *chan, n, reversed)) {
- error << compose(_("DiskStream %1: when refilling, cannot read %2 from playlist at frame %3"),
+ error << string_compose(_("DiskStream %1: when refilling, cannot read %2 from playlist at frame %3"),
_id, size, playback_sample) << endmsg;
goto out;
}
this_read = min(cnt,this_read);
if (_playlist->read (buf+offset, mixdown_buffer, gain_buffer, start, this_read, channel) != this_read) {
- error << compose(_("DiskStream %1: cannot read %2 from playlist at frame %3"), _id, this_read,
+ error << string_compose(_("DiskStream %1: cannot read %2 from playlist at frame %3"), _id, this_read,
start) << endmsg;
return -1;
}
to_write = min (disk_io_chunk_frames, (jack_nframes_t) vector.len[0]);
if ((!(*chan).write_source) || (*chan).write_source->write (vector.buf[0], to_write) != to_write) {
- error << compose(_("DiskStream %1: cannot write to disk"), _id) << endmsg;
+ error << string_compose(_("DiskStream %1: cannot write to disk"), _id) << endmsg;
return -1;
}
to_write = min ((jack_nframes_t)(disk_io_chunk_frames - to_write), (jack_nframes_t) vector.len[1]);
if ((*chan).write_source->write (vector.buf[1], to_write) != to_write) {
- error << compose(_("DiskStream %1: cannot write to disk"), _id) << endmsg;
+ error << string_compose(_("DiskStream %1: cannot write to disk"), _id) << endmsg;
return -1;
}
case 1:
break;
case -1:
- error << compose(_("DiskStream \"%1\": cannot flush captured data to disk!"), _name) << endmsg;
+ error << string_compose(_("DiskStream \"%1\": cannot flush captured data to disk!"), _name) << endmsg;
err++;
}
}
}
catch (failed_constructor& err) {
- error << compose(_("%1: could not create region for complete audio file"), _name) << endmsg;
+ error << string_compose(_("%1: could not create region for complete audio file"), _name) << endmsg;
/* XXX what now? */
}
char buf[64];
LocaleGuard lg (X_("POSIX"));
- snprintf (buf, sizeof(buf), "%d", channels.size());
+ snprintf (buf, sizeof(buf), "%zd", channels.size());
node->add_property ("channels", buf);
node->add_property ("playlist", _playlist->name());
if (deprecated_io_node) {
if ((prop = deprecated_io_node->property ("id")) != 0) {
- sscanf (prop->value().c_str(), "%llu", &_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &_id);
}
} else {
if ((prop = node.property ("id")) != 0) {
- sscanf (prop->value().c_str(), "%llu", &_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &_id);
}
}
}
if (n >= channels.size()) {
- error << compose (_("DiskStream: channel %1 out of range"), n) << endmsg;
+ error << string_compose (_("DiskStream: channel %1 out of range"), n) << endmsg;
return -1;
}
}
catch (failed_constructor &err) {
- error << compose (_("%1:%2 new capture file not initialized correctly"), _name, n) << endmsg;
+ error << string_compose (_("%1:%2 new capture file not initialized correctly"), _name, n) << endmsg;
chan.write_source = 0;
return -1;
}
{
if (location) {
if (location->start() >= location->end()) {
- error << compose(_("Location \"%1\" not valid for track loop (start >= end)"), location->name()) << endl;
+ error << string_compose(_("Location \"%1\" not valid for track loop (start >= end)"), location->name()) << endl;
return -1;
}
}
}
catch (failed_constructor& err) {
- error << compose (_("%1: cannot restore pending capture source file %2"),
+ error << string_compose (_("%1: cannot restore pending capture source file %2"),
_name, prop->value())
<< endmsg;
return -1;
}
if (pending_sources.size() != _n_channels) {
- error << compose (_("%1: incorrect number of pending sources listed - ignoring them all"), _name)
+ error << string_compose (_("%1: incorrect number of pending sources listed - ignoring them all"), _name)
<< endmsg;
return -1;
}
}
catch (failed_constructor& err) {
- error << compose (_("%1: cannot create whole-file region from pending capture sources"),
+ error << string_compose (_("%1: cannot create whole-file region from pending capture sources"),
_name)
<< endmsg;
}
catch (failed_constructor& err) {
- error << compose (_("%1: cannot create region from pending capture sources"),
+ error << string_compose (_("%1: cannot create region from pending capture sources"),
_name)
<< endmsg;
vector<string*>* result = scanner (search_path, regexp, false, true, -1);
if (result == 0 || result->size() == 0) {
- error << compose (_("FileSource: \"%1\" not found when searching %2 using %3"),
+ error << string_compose (_("FileSource: \"%1\" not found when searching %2 using %3"),
pathstr, search_path, regexp) << endmsg;
goto out;
}
if (result->size() > 1) {
- string msg = compose (_("FileSource: \"%1\" is ambigous when searching %2\n\t"), pathstr, search_path);
+ string msg = string_compose (_("FileSource: \"%1\" is ambigous when searching %2\n\t"), pathstr, search_path);
vector<string*>::iterator x = result->begin();
while (true) {
if (access (_path.c_str(), F_OK) != 0) {
if (must_exist) {
- error << compose(_("Filesource: cannot find required file (%1): %2"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("Filesource: cannot find required file (%1): %2"), _path, strerror (errno)) << endmsg;
goto out;
}
if (errno == ENOENT) {
new_file = true;
} else {
- error << compose(_("Filesource: cannot check for existing file (%1): %2"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("Filesource: cannot check for existing file (%1): %2"), _path, strerror (errno)) << endmsg;
goto out;
}
}
if ((fd = open64 (_path.c_str(), O_RDWR|O_CREAT, 0644)) < 0) {
- error << compose(_("FileSource: could not open \"%1\": (%2)"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource: could not open \"%1\": (%2)"), _path, strerror (errno)) << endmsg;
goto out;
}
is_bwf = Config->get_native_format_is_bwf ();
if (fill_header (rate)) {
- error << compose (_("FileSource: cannot write header in %1"), _path) << endmsg;
+ error << string_compose (_("FileSource: cannot write header in %1"), _path) << endmsg;
goto out;
}
} else {
if (discover_chunks (must_exist)) {
- error << compose (_("FileSource: cannot locate chunks in %1"), _path) << endmsg;
+ error << string_compose (_("FileSource: cannot locate chunks in %1"), _path) << endmsg;
goto out;
}
if (read_header (must_exist)) {
- error << compose (_("FileSource: cannot read header in %1"), _path) << endmsg;
+ error << string_compose (_("FileSource: cannot read header in %1"), _path) << endmsg;
goto out;
}
if (check_header (rate, must_exist)) {
- error << compose (_("FileSource: cannot check header in %1"), _path) << endmsg;
+ error << string_compose (_("FileSource: cannot check header in %1"), _path) << endmsg;
goto out;
}
}
if ((ret = initialize_peakfile (new_file, _path))) {
- error << compose (_("FileSource: cannot initialize peakfile for %1"), _path) << endmsg;
+ error << string_compose (_("FileSource: cannot initialize peakfile for %1"), _path) << endmsg;
}
out:
if (memcmp (rw.id, "RIFF", 4) || memcmp (rw.text, "WAVE", 4)) {
if (!silent) {
- error << compose (_("FileSource %1: not a RIFF/WAVE file"), _path) << endmsg;
+ error << string_compose (_("FileSource %1: not a RIFF/WAVE file"), _path) << endmsg;
}
return -1;
}
struct utsname utsinfo;
if ((pwinfo = getpwuid (getuid())) == 0) {
- error << compose(_("FileSource: cannot get user information for BWF header (%1)"), strerror(errno)) << endmsg;
+ error << string_compose(_("FileSource: cannot get user information for BWF header (%1)"), strerror(errno)) << endmsg;
return -1;
}
if (uname (&utsinfo)) {
- error << compose(_("FileSource: cannot get host information for BWF header (%1)"), strerror(errno)) << endmsg;
+ error << string_compose(_("FileSource: cannot get host information for BWF header (%1)"), strerror(errno)) << endmsg;
return -1;
}
compute_header_size ();
if (write_header()) {
- error << compose(_("FileSource[%1]: cannot update data size: %2"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource[%1]: cannot update data size: %2"), _path, strerror (errno)) << endmsg;
return -1;
}
int32_t coding_history_size;
if (::pread (fd, (char *) &header.bext, sizeof (header.bext), info.offset + sizeof (GenericChunk)) != sizeof (header.bext)) {
- error << compose(_("FileSource: cannot read Broadcast Wave data from existing audio file \"%1\" (%2)"),
+ error << string_compose(_("FileSource: cannot read Broadcast Wave data from existing audio file \"%1\" (%2)"),
_path, strerror (errno)) << endmsg;
return -1;
}
char data[coding_history_size];
if (::pread (fd, data, coding_history_size, info.offset + sizeof (BroadcastChunk)) != coding_history_size) {
- error << compose(_("FileSource: cannot read Broadcast Wave coding history from audio file \"%1\" (%2)"),
+ error << string_compose(_("FileSource: cannot read Broadcast Wave coding history from audio file \"%1\" (%2)"),
_path, strerror (errno)) << endmsg;
return -1;
}
{
if (header.format.formatTag != 3) { /* IEEE float */
if (!silent) {
- error << compose(_("FileSource \"%1\" does not use floating point format.\n"
+ error << string_compose(_("FileSource \"%1\" does not use floating point format.\n"
"This is probably a programming error."), _path) << endmsg;
}
return -1;
}
if (data_offset == 0) {
- error << compose(_("FileSource \"%1\" has no \"data\" chunk"), _path) << endmsg;
+ error << string_compose(_("FileSource \"%1\" has no \"data\" chunk"), _path) << endmsg;
return -1;
}
if (_length * sizeof (Sample) != (jack_nframes_t) header.data.size) {
- warning << compose(_("%1: data length in header (%2) differs from implicit size in file (%3)"),
+ warning << string_compose(_("%1: data length in header (%2) differs from implicit size in file (%3)"),
_path, header.data.size, _length * sizeof (Sample)) << endmsg;
}
if ((jack_nframes_t) header.format.nSamplesPerSec != rate) {
- warning << compose(_("\"%1\" has a sample rate of %2 instead of %3 as used by this session"),
+ warning << string_compose(_("\"%1\" has a sample rate of %2 instead of %3 as used by this session"),
_path, header.format.nSamplesPerSec, rate) << endmsg;
}
pos = 0;
if (::pwrite64 (fd, (char *) &header.wave, sizeof (header.wave), pos) != sizeof (header.wave)) {
- error << compose(_("FileSource: cannot write WAVE chunk: %1"), strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource: cannot write WAVE chunk: %1"), strerror (errno)) << endmsg;
return -1;
}
/* write fmt and data chunks */
if (::pwrite64 (fd, (char *) &header.format, sizeof (header.format), pos) != sizeof (header.format)) {
- error << compose(_("FileSource: cannot write format chunk: %1"), strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource: cannot write format chunk: %1"), strerror (errno)) << endmsg;
return -1;
}
pos += sizeof (header.format);
if (::pwrite64 (fd, (char *) &header.data, sizeof (header.data), pos) != sizeof (header.data)) {
- error << compose(_("FileSource: cannot data chunk: %1"), strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource: cannot data chunk: %1"), strerror (errno)) << endmsg;
return -1;
}
jack_nframes_t oldlen;
if (::pwrite64 (fd, (char *) data, byte_cnt, byte_pos) != (off64_t) byte_cnt) {
- error << compose(_("FileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("FileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
return 0;
}
}
if (version == 999) {
- error << compose (_("there are already 1000 files with names like %1; versioning discontinued"),
+ error << string_compose (_("there are already 1000 files with names like %1; versioning discontinued"),
newpath)
<< endmsg;
} else {
}
if (::rename (_path.c_str(), newpath.c_str()) != 0) {
- error << compose (_("cannot rename audio file source from %1 to %2 (%3)"),
+ error << string_compose (_("cannot rename audio file source from %1 to %2 (%3)"),
_path, newpath, strerror (errno))
<< endmsg;
return -1;
}
if (::unlink (peakpath.c_str()) != 0) {
- error << compose (_("cannot remove peakfile %1 for %2 (%3)"),
+ error << string_compose (_("cannot remove peakfile %1 for %2 (%3)"),
peakpath, _path, strerror (errno))
<< endmsg;
/* try to back out */
port_descriptor->type);
if (request.status != MIDI::PortRequest::OK) {
- error << compose(_("MIDI port specifications for \"%1\" are not understandable."), port_descriptor->tag) << endmsg;
+ error << string_compose(_("MIDI port specifications for \"%1\" are not understandable."), port_descriptor->tag) << endmsg;
continue;
}
}
if (default_mmc_port == 0) {
- warning << compose (_("No MMC control (MIDI port \"%1\" not available)"), Config->get_mmc_port_name())
+ warning << string_compose (_("No MMC control (MIDI port \"%1\" not available)"), Config->get_mmc_port_name())
<< endmsg;
return 0;
}
if (default_mtc_port == 0) {
- warning << compose (_("No MTC support (MIDI port \"%1\" not available)"), Config->get_mtc_port_name())
+ warning << string_compose (_("No MTC support (MIDI port \"%1\" not available)"), Config->get_mtc_port_name())
<< endmsg;
}
if (default_midi_port == 0) {
- warning << compose (_("No MIDI parameter support (MIDI port \"%1\" not available)"), Config->get_midi_port_name())
+ warning << string_compose (_("No MIDI parameter support (MIDI port \"%1\" not available)"), Config->get_midi_port_name())
<< endmsg;
}
string tmp_convert_file;
if ((in = sf_open (status.pathname.c_str(), SFM_READ, &info)) == 0) {
- error << compose(_("Import: cannot open input sound file \"%1\""), status.pathname) << endmsg;
+ error << string_compose(_("Import: cannot open input sound file \"%1\""), status.pathname) << endmsg;
return -1;
} else {
if ((uint32_t) info.samplerate != frame_rate()) {
// resample to session frame_rate
if (sample_rate_convert(status, status.pathname, tmp_convert_file)) {
if ((in = sf_open (tmp_convert_file.c_str(), SFM_READ, &info)) == 0) {
- error << compose(_("Import: cannot open converted sound file \"%1\""), tmp_convert_file) << endmsg;
+ error << string_compose(_("Import: cannot open converted sound file \"%1\""), tmp_convert_file) << endmsg;
return -1;
}
} else if (!status.cancel){
// error
- error << compose(_("Import: error while resampling sound file \"%1\""), status.pathname) << endmsg;
+ error << string_compose(_("Import: error while resampling sound file \"%1\""), status.pathname) << endmsg;
return -1;
} else {
// canceled
}
catch (failed_constructor& err) {
- error << compose(_("Session::import_audiofile: cannot open new file source for channel %1"), n+1) << endmsg;
+ error << string_compose(_("Session::import_audiofile: cannot open new file source for channel %1"), n+1) << endmsg;
goto out;
}
outfile = build_tmp_convert_name(infile);
SNDFILE* out = sf_open(outfile.c_str(), SFM_RDWR, &sf_info);
if(!out) {
- error << compose(_("Import: could not open temp file: %1"), outfile) << endmsg;
+ error << string_compose(_("Import: could not open temp file: %1"), outfile) << endmsg;
return false;
}
/* Initialize the sample rate converter. */
if ((src_state = src_new (SRC_SINC_BEST_QUALITY, sf_info.channels, &err)) == 0) {
- error << compose(_("Import: src_new() failed : %1"), src_strerror (err)) << endmsg ;
+ error << string_compose(_("Import: src_new() failed : %1"), src_strerror (err)) << endmsg ;
return false ;
}
}
if ((err = src_process (src_state, &src_data))) {
- error << compose(_("Import: %1"), src_strerror (err)) << endmsg ;
+ error << string_compose(_("Import: %1"), src_strerror (err)) << endmsg ;
return false ;
}
#endif
}
- fatal << compose (_("programming error: %1"),
+ fatal << string_compose (_("programming error: %1"),
X_("unknown plugin type in PluginInsert::plugin_factory"))
<< endmsg;
/*NOTREACHED*/
node->add_property ("type", _plugins[0]->state_node_name());
snprintf(buf, sizeof(buf), "%s", _plugins[0]->name());
node->add_property("id", string(buf));
- node->add_property("count", compose("%1", _plugins.size()));
+ node->add_property("count", string_compose("%1", _plugins.size()));
node->add_child_nocopy (_plugins[0]->get_state());
/* add port automation state */
} else if (prop->value() == X_("vst")) {
type = PluginInfo::VST;
} else {
- error << compose (_("unknown plugin type %1 in plugin insert state"),
+ error << string_compose (_("unknown plugin type %1 in plugin insert state"),
prop->value())
<< endmsg;
return -1;
Plugin* plugin;
if ((plugin = find_plugin (_session, prop->value(), type)) == 0) {
- error << compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
+ error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"
"Perhaps it was removed or moved since it was last used."), prop->value())
<< endmsg;
return -1;
}
if (niter == nlist.end()) {
- error << compose(_("XML node describing a plugin insert is missing the `%1' information"), plugin->state_node_name()) << endmsg;
+ error << string_compose(_("XML node describing a plugin insert is missing the `%1' information"), plugin->state_node_name()) << endmsg;
return -1;
}
}
if (niter == nlist.end()) {
- warning << compose(_("XML node describing a port automation is missing the `%1' information"), port_automation_node_name) << endmsg;
+ warning << string_compose(_("XML node describing a port automation is missing the `%1' information"), port_automation_node_name) << endmsg;
}
}
gain_t dg;
- gain_t old_gain;
+ gain_t old_gain = _gain;
if (apply_gain_automation) {
speed quietning.
*/
- old_gain = _gain;
_gain = 1.0f;
dg = _gain;
/* disconnect it from the source */
if (_session.engine().disconnect (other_port, our_port->name())) {
- error << compose(_("IO: cannot disconnect input port %1 from %2"), our_port->name(), other_port) << endmsg;
+ error << string_compose(_("IO: cannot disconnect input port %1 from %2"), our_port->name(), other_port) << endmsg;
return -1;
}
/* disconnect it from the destination */
if (_session.engine().disconnect (our_port->name(), other_port)) {
- error << compose(_("IO: cannot disconnect output port %1 from %2"), our_port->name(), other_port) << endmsg;
+ error << string_compose(_("IO: cannot disconnect output port %1 from %2"), our_port->name(), other_port) << endmsg;
return -1;
}
}
if ((our_port = _session.engine().register_audio_output_port (buf)) == 0) {
- error << compose(_("IO: cannot register output port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register output port %1"), buf) << endmsg;
return -1;
}
}
if ((our_port = _session.engine().register_audio_input_port (buf)) == 0) {
- error << compose(_("IO: cannot register input port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register input port %1"), buf) << endmsg;
return -1;
}
try {
if ((input_port = _session.engine().register_audio_input_port (buf)) == 0) {
- error << compose(_("IO: cannot register input port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register input port %1"), buf) << endmsg;
return -1;
}
}
try {
if ((port = _session.engine().register_audio_input_port (buf)) == 0) {
- error << compose(_("IO: cannot register input port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register input port %1"), buf) << endmsg;
return -1;
}
}
try {
if ((port = _session.engine().register_audio_output_port (buf)) == 0) {
- error << compose(_("IO: cannot register output port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register output port %1"), buf) << endmsg;
return -1;
}
}
}
if ((output_port = _session.engine().register_audio_output_port (buf)) == 0) {
- error << compose(_("IO: cannot register output port %1"), buf) << endmsg;
+ error << string_compose(_("IO: cannot register output port %1"), buf) << endmsg;
return -1;
}
*/
if (node.name() != state_node_name) {
- error << compose(_("incorrect XML node \"%1\" passed to IO object"), node.name()) << endmsg;
+ error << string_compose(_("incorrect XML node \"%1\" passed to IO object"), node.name()) << endmsg;
return -1;
}
}
if ((prop = node.property ("id")) != 0) {
- sscanf (prop->value().c_str(), "%llu", &_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &_id);
}
if ((prop = node.property ("iolimits")) != 0) {
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_gain_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI gain control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI gain control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
}
Connection* c = _session.connection_by_name (prop->value());
if (c == 0) {
- error << compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
if ((c = _session.connection_by_name (_("in 1"))) == 0) {
error << _("No input connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
Connection* c = _session.connection_by_name (prop->value());
if (c == 0) {
- error << compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
if ((c = _session.connection_by_name (_("out 1"))) == 0) {
error << _("No output connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
+ info << string_compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
<< endmsg;
}
}
no_panner_reset = true;
if (ensure_io (num_inputs, num_outputs, true, this)) {
- error << compose(_("%1: cannot create I/O ports"), _name) << endmsg;
+ error << string_compose(_("%1: cannot create I/O ports"), _name) << endmsg;
return -1;
}
Connection* c = _session.connection_by_name (prop->value());
if (c == 0) {
- error << compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown connection \"%1\" listed for input of %2"), prop->value(), _name) << endmsg;
if ((c = _session.connection_by_name (_("in 1"))) == 0) {
error << _("No input connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
+ info << string_compose (_("Connection %1 was not available - \"in 1\" used instead"), prop->value())
<< endmsg;
}
}
} else if ((prop = node.property ("inputs")) != 0) {
if (set_inputs (prop->value())) {
- error << compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
+ error << string_compose(_("improper input channel list in XML node (%1)"), prop->value()) << endmsg;
return -1;
}
}
Connection* c = _session.connection_by_name (prop->value());
if (c == 0) {
- error << compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
+ error << string_compose(_("Unknown connection \"%1\" listed for output of %2"), prop->value(), _name) << endmsg;
if ((c = _session.connection_by_name (_("out 1"))) == 0) {
error << _("No output connections available as a replacement")
<< endmsg;
return -1;
} else {
- info << compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
+ info << string_compose (_("Connection %1 was not available - \"out 1\" used instead"), prop->value())
<< endmsg;
}
}
} else if ((prop = node.property ("outputs")) != 0) {
if (set_outputs (prop->value())) {
- error << compose(_("improper output channel list in XML node (%1)"), prop->value()) << endmsg;
+ error << string_compose(_("improper output channel list in XML node (%1)"), prop->value()) << endmsg;
return -1;
}
}
start += 1;
if ((end = str.find_first_of ('}', start)) == string::npos) {
- error << compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
+ error << string_compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
return -1;
}
if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
- error << compose(_("bad input string in XML node \"%1\""), str) << endmsg;
+ error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
return -1;
start += 1;
if ((end = str.find_first_of ('}', start)) == string::npos) {
- error << compose(_("IO: badly formed string in XML node for outputs \"%1\""), str) << endmsg;
+ error << string_compose(_("IO: badly formed string in XML node for outputs \"%1\""), str) << endmsg;
return -1;
}
if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
- error << compose(_("IO: bad output string in XML node \"%1\""), str) << endmsg;
+ error << string_compose(_("IO: bad output string in XML node \"%1\""), str) << endmsg;
return -1;
out.open (fullpath.c_str());
if (!out) {
- error << compose(_("%1: could not open automation event file \"%2\""), _name, fullpath) << endmsg;
+ error << string_compose(_("%1: could not open automation event file \"%2\""), _name, fullpath) << endmsg;
return -1;
}
fullpath += path;
in.open (fullpath.c_str());
if (!in) {
- error << compose(_("%1: cannot open automation event file \"%2\""), _name, fullpath) << endmsg;
+ error << string_compose(_("%1: cannot open automation event file \"%2\""), _name, fullpath) << endmsg;
return -1;
}
}
if (++linecnt == 1) {
if (memcmp (line, "version", 7) == 0) {
if (sscanf (line, "version %f", &version) != 1) {
- error << compose(_("badly formed version number in automation event file \"%1\""), path) << endmsg;
+ error << string_compose(_("badly formed version number in automation event file \"%1\""), path) << endmsg;
return -1;
}
} else {
- error << compose(_("no version information in automation event file \"%1\""), path) << endmsg;
+ error << string_compose(_("no version information in automation event file \"%1\""), path) << endmsg;
return -1;
}
if (version != current_automation_version_number) {
- error << compose(_("mismatched automation event file version (%1)"), version) << endmsg;
+ error << string_compose(_("mismatched automation event file version (%1)"), version) << endmsg;
return -1;
}
}
if (sscanf (line, "%c %" PRIu32 " %lf", &type, &when, &value) != 3) {
- warning << compose(_("badly formatted automation event record at line %1 of %2 (ignored)"), linecnt, path) << endmsg;
+ warning << string_compose(_("badly formatted automation event record at line %1 of %2 (ignored)"), linecnt, path) << endmsg;
continue;
}
_index = index;
if (LADSPA_IS_INPLACE_BROKEN(descriptor->Properties)) {
- error << compose(_("LADSPA: \"%1\" cannot be used, since it cannot do inplace processing"), descriptor->Name) << endmsg;
+ error << string_compose(_("LADSPA: \"%1\" cannot be used, since it cannot do inplace processing"), descriptor->Name) << endmsg;
throw failed_constructor();
}
}
} else {
- warning << compose (_("illegal parameter number used with plugin \"%1\". This may"
+ warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may"
"indicate a change in the plugin design, and presets may be"
"invalid"), name())
<< endmsg;
}
} else {
- error << compose(_("LADSPA LadspaPlugin MIDI control specification for port %1 is incomplete, so it has been ignored"), port) << endl;
+ error << string_compose(_("LADSPA LadspaPlugin MIDI control specification for port %1 is incomplete, so it has been ignored"), port) << endl;
}
}
}
playlist->ref();
playlists.push_back (playlist);
} else {
- warning << compose (_("Chunk %1 uses an unknown playlist \"%2\""), name, property->value()) << endmsg;
+ warning << string_compose (_("Chunk %1 uses an unknown playlist \"%2\""), name, property->value()) << endmsg;
}
} else {
- error << compose (_("Chunk %1 contains misformed playlist information"), name) << endmsg;
+ error << string_compose (_("Chunk %1 contains misformed playlist information"), name) << endmsg;
throw failed_constructor();
}
}
for (AutomationList::const_iterator i = _automation.const_begin(); i != _automation.const_end(); ++i) {
out << '\t' << (jack_nframes_t) floor ((*i)->when) << ' ' << (*i)->value << endl;
if (!out) {
- error << compose (_("error writing pan automation file (%s)"), strerror (errno)) << endmsg;
+ error << string_compose (_("error writing pan automation file (%s)"), strerror (errno)) << endmsg;
return -1;
}
}
}
if (sscanf (line, "%" PRIu32 " %lf", &when, &value) != 2) {
- warning << compose(_("badly formatted pan automation event record at line %1 of %2 (ignored) [%3]"), linecnt, path, line) << endmsg;
+ warning << string_compose(_("badly formatted pan automation event record at line %1 of %2 (ignored) [%3]"), linecnt, path, line) << endmsg;
continue;
}
ofstream out (automation_path.c_str());
if (!out) {
- error << compose (_("cannot open pan automation file \"%1\" for saving (%s)"), automation_path, strerror (errno))
+ error << string_compose (_("cannot open pan automation file \"%1\" for saving (%s)"), automation_path, strerror (errno))
<< endmsg;
return -1;
}
ifstream in (automation_path.c_str());
if (!in) {
- error << compose (_("cannot open pan automation file %1 (%2)"),
+ error << string_compose (_("cannot open pan automation file %1 (%2)"),
automation_path, strerror (errno))
<< endmsg;
return -1;
if (++linecnt == 1) {
if (memcmp (line, X_("version"), 7) == 0) {
if (sscanf (line, "version %f", &version) != 1) {
- error << compose(_("badly formed version number in pan automation event file \"%1\""), automation_path) << endmsg;
+ error << string_compose(_("badly formed version number in pan automation event file \"%1\""), automation_path) << endmsg;
return -1;
}
} else {
- error << compose(_("no version information in pan automation event file \"%1\" (first line = %2)"),
+ error << string_compose(_("no version information in pan automation event file \"%1\" (first line = %2)"),
automation_path, line) << endmsg;
return -1;
}
if (version != current_automation_version_number) {
- error << compose(_("mismatched pan automation event file version (%1)"), version) << endmsg;
+ error << string_compose(_("mismatched pan automation event file version (%1)"), version) << endmsg;
return -1;
}
if (strcmp (line, "begin") == 0) {
if (sp == end()) {
- error << compose (_("too many panner states found in pan automation file %1"),
+ error << string_compose (_("too many panner states found in pan automation file %1"),
automation_path)
<< endmsg;
return -1;
if (!pan_plugins[i].factory) {
- error << compose (_("Unknown panner plugin \"%1\" found in pan state - ignored"),
+ error << string_compose (_("Unknown panner plugin \"%1\" found in pan state - ignored"),
prop->value())
<< endmsg;
}
Playlist::add_region_internal (Region *region, jack_nframes_t position, bool delay_sort)
{
RegionSortByPosition cmp;
- jack_nframes_t old_length;
+ jack_nframes_t old_length = 0;
// cerr << "adding region " << region->name() << " at " << position << endl;
Playlist::remove_region_internal (Region *region, bool delay_sort)
{
RegionList::iterator i;
- jack_nframes_t old_length;
+ jack_nframes_t old_length = 0;
// cerr << "removing region " << region->name() << endl;
RegionList::iterator i = find (regions.begin(), regions.end(), region);
if (i == regions.end()) {
- warning << compose (_("%1: bounds changed received for region (%2)not in playlist"),
+ warning << string_compose (_("%1: bounds changed received for region (%2)not in playlist"),
_name, region->name())
<< endmsg;
return;
return false;
}
- string source(compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
+ string source(string_compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
free(lrdf_add_preset(source.c_str(), name.c_str(), unique_id(), &defaults));
- string path = compose("%1/.%2", envvar, domain);
+ string path = string_compose("%1/.%2", envvar, domain);
if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
- warning << compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
+ warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
path += "/rdf";
if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
- warning << compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
+ warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
return false;
}
if (lrdf_export_by_source(source.c_str(), source.substr(5).c_str())) {
- warning << compose(_("Error saving presets file %1."), source) << endmsg;
+ warning << string_compose(_("Error saving presets file %1."), source) << endmsg;
return false;
}
return;
}
- string path = compose("%1/.%2/rdf", envvar, domain);
+ string path = string_compose("%1/.%2/rdf", envvar, domain);
presets = scanner (path, rdf_filter, 0, true, true);
if (presets) {
for (x = presets->begin(); x != presets->end (); ++x) {
string file = "file:" + **x;
if (lrdf_read_file(file.c_str())) {
- warning << compose(_("Could not parse rdf file: %1"), *x) << endmsg;
+ warning << string_compose(_("Could not parse rdf file: %1"), *x) << endmsg;
}
}
}
const char *errstr;
if ((module = dlopen (path.c_str(), RTLD_NOW)) == 0) {
- error << compose(_("LADSPA: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg;
+ error << string_compose(_("LADSPA: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg;
return -1;
}
dfunc = (LADSPA_Descriptor_Function) dlsym (module, "ladspa_descriptor");
if ((errstr = dlerror()) != 0) {
- error << compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg;
+ error << string_compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg;
error << errstr << endmsg;
dlclose (module);
return -1;
FSTHandle* handle;
if ((handle = fst_load (info->path.c_str())) == 0) {
- error << compose(_("VST: cannot load module from \"%1\""), info->path) << endmsg;
+ error << string_compose(_("VST: cannot load module from \"%1\""), info->path) << endmsg;
} else {
plugin = new VSTPlugin (_engine, session, handle);
}
} else {
if ((module = dlopen (info->path.c_str(), RTLD_NOW)) == 0) {
- error << compose(_("LADSPA: cannot load module from \"%1\""), info->path) << endmsg;
+ error << string_compose(_("LADSPA: cannot load module from \"%1\""), info->path) << endmsg;
error << dlerror() << endmsg;
} else {
plugin = new LadspaPlugin (module, _engine, session, info->index, session.frame_rate());
}
if (!finfo->canProcessReplacing) {
- warning << compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"),
+ warning << string_compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"),
finfo->name)
<< endl;
}
if (!recent) {
if (errno != ENOENT) {
- error << compose (_("cannot open recent session file %1 (%2)"), path, strerror (errno)) << endmsg;
+ error << string_compose (_("cannot open recent session file %1 (%2)"), path, strerror (errno)) << endmsg;
return -1;
} else {
return 1;
} else if (str == _("post")) {
set_placement (PostFader, this);
} else {
- error << compose(_("Redirect: unknown placement string \"%1\" (ignored)"), str) << endmsg;
+ error << string_compose(_("Redirect: unknown placement string \"%1\" (ignored)"), str) << endmsg;
}
}
ifstream in (fullpath.c_str());
if (!in) {
- warning << compose(_("%1: cannot open %2 to load automation data (%3)"), _name, fullpath, strerror (errno)) << endmsg;
+ warning << string_compose(_("%1: cannot open %2 to load automation data (%3)"), _name, fullpath, strerror (errno)) << endmsg;
return 1;
}
return 0;
bad:
- error << compose(_("%1: cannot load automation data from %2"), _name, fullpath) << endmsg;
+ error << string_compose(_("%1: cannot load automation data from %2"), _name, fullpath) << endmsg;
parameter_automation.clear ();
return -1;
}
ofstream out (fullpath.c_str());
if (!out) {
- error << compose(_("%1: cannot open %2 to store automation data (%3)"), _name, fullpath, strerror (errno)) << endmsg;
+ error << string_compose(_("%1: cannot open %2 to store automation data (%3)"), _name, fullpath, strerror (errno)) << endmsg;
return -1;
}
if (i != (*li).second->end()) {
unlink (fullpath.c_str());
- error << compose(_("%1: could not save automation state to %2"), _name, fullpath) << endmsg;
+ error << string_compose(_("%1: could not save automation state to %2"), _name, fullpath) << endmsg;
return -1;
}
}
if (li != parameter_automation.end()) {
unlink (fullpath.c_str());
- error << compose(_("%1: could not save automation state to %2"), _name, fullpath) << endmsg;
+ error << string_compose(_("%1: could not save automation state to %2"), _name, fullpath) << endmsg;
return -1;
}
switch (save_automation (path)) {
case -1:
- error << compose(_("Could not get state from Redirect (%1). Problem with save_automation"), _name) << endmsg;
+ error << string_compose(_("Could not get state from Redirect (%1). Problem with save_automation"), _name) << endmsg;
break;
case 0:
const XMLProperty *prop;
if (node.name() != state_node_name) {
- error << compose(_("incorrect XML node \"%1\" passed to Redirect object"), node.name()) << endmsg;
+ error << string_compose(_("incorrect XML node \"%1\" passed to Redirect object"), node.name()) << endmsg;
return -1;
}
if ((prop = (*niter)->property ("path")) != 0) {
load_automation (prop->value());
} else {
- warning << compose(_("%1: Automation node has no path property"), _name) << endmsg;
+ warning << string_compose(_("%1: Automation node has no path property"), _name) << endmsg;
}
if ((prop = (*niter)->property ("visible")) != 0) {
XMLNode *node = new XMLNode ("Region");
char buf[64];
- snprintf (buf, sizeof (buf), "%llu", _id);
+ snprintf (buf, sizeof (buf), "%" PRIu64, _id);
node->add_property ("id", buf);
node->add_property ("name", _name);
snprintf (buf, sizeof (buf), "%u", _start);
return -1;
}
- sscanf (prop->value().c_str(), "%llu", &_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &_id);
if ((prop = node.property ("name")) == 0) {
error << _("Session: XMLNode describing a Region is incomplete (no name)") << endmsg;
} else {
- error << compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
+ error << string_compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
}
add_redirect (insert, this);
if (node.name() != "Route"){
- error << compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
+ error << string_compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
return -1;
}
if ((prop = node.property ("edit-group")) != 0) {
RouteGroup* edit_group = _session.edit_group_by_name(prop->value());
if(edit_group == 0) {
- error << compose(_("Route %1: unknown edit group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
+ error << string_compose(_("Route %1: unknown edit group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
} else {
set_edit_group(edit_group, this);
}
while (remaining.length()) {
if ((equal = remaining.find_first_of ('=')) == string::npos || equal == remaining.length()) {
- error << compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
+ error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
<< endmsg;
} else {
if (sscanf (remaining.substr (equal+1).c_str(), "%ld", &n) != 1) {
- error << compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
+ error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
<< endmsg;
} else {
set_order_key (remaining.substr (0, equal), n);
if ((prop = node.property ("mix-group")) != 0) {
RouteGroup* mix_group = _session.mix_group_by_name(prop->value());
if (mix_group == 0) {
- error << compose(_("Route %1: unknown mix group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
+ error << string_compose(_("Route %1: unknown mix group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
} else {
set_mix_group(mix_group, this);
}
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_mute_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
else if (child->name() == "solo") {
if (get_midi_node_info (child, ev, chn, additional)) {
_midi_solo_control.set_control_type (chn, ev, additional);
} else {
- error << compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
+ error << string_compose(_("MIDI mute control specification for %1 is incomplete, so it has been ignored"), _name) << endmsg;
}
}
return 0;
}
- jack_nframes_t unused;
+ jack_nframes_t unused = 0;
if ((nframes = check_initial_delay (nframes, offset, unused)) == 0) {
return 0;
isnew = false;
if (!realpath (str.c_str(), buf) && (errno != ENOENT && errno != ENOTDIR)) {
- error << compose (_("Could not resolve path: %1 (%2)"), buf, strerror(errno)) << endmsg;
+ error << string_compose (_("Could not resolve path: %1 (%2)"), buf, strerror(errno)) << endmsg;
return -1;
}
if (errno == ENOENT) {
isnew = true;
} else {
- error << compose (_("cannot check session path %1 (%2)"), str, strerror (errno))
+ error << string_compose (_("cannot check session path %1 (%2)"), str, strerror (errno))
<< endmsg;
return -1;
}
/* is it there ? */
if (stat (tmp.c_str(), &statbuf)) {
- error << compose (_("cannot check statefile %1 (%2)"), tmp, strerror (errno))
+ error << string_compose (_("cannot check statefile %1 (%2)"), tmp, strerror (errno))
<< endmsg;
return -1;
}
suffix = snapshot.find (_statefile_suffix);
if (suffix == string::npos) {
- error << compose (_("%1 is not an Ardour snapshot file"), str) << endmsg;
+ error << string_compose (_("%1 is not an Ardour snapshot file"), str) << endmsg;
return -1;
}
char cwd[PATH_MAX+1];
if (getcwd (cwd, sizeof (cwd)) == 0) {
- error << compose (_("cannot determine current working directory (%1)"), strerror (errno))
+ error << string_compose (_("cannot determine current working directory (%1)"), strerror (errno))
<< endmsg;
return -1;
}
} else {
/* what type of file is it? */
- error << compose (_("unknown file type for session %1"), str) << endmsg;
+ error << string_compose (_("unknown file type for session %1"), str) << endmsg;
return -1;
}
_clicking = false;
try {
- XMLNode* child;
+ XMLNode* child = 0;
_click_io = new ClickIO (*this, "click", 0, 0, -1, -1);
Route* r2;
if ((r1->fed_by.find (rbase) != r1->fed_by.end()) && (rbase->fed_by.find (r1) != rbase->fed_by.end())) {
- info << compose(_("feedback loop setup between %1 and %2"), r1->name(), rbase->name()) << endmsg;
+ info << string_compose(_("feedback loop setup between %1 and %2"), r1->name(), rbase->name()) << endmsg;
return;
}
}
n++;
- } while (n < ULONG_MAX);
+ } while (n < (ULONG_MAX-1));
if (input_auto_connect & AutoConnectPhysical) {
nphysical_in = n_physical_inputs;
track = new AudioTrack (*this, track_name);
if (track->ensure_io (input_channels, output_channels, false, this)) {
- error << compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
+ error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
input_channels, output_channels)
<< endmsg;
}
}
n++;
- } while (n < ULONG_MAX);
+ } while (n < (ULONG_MAX-1));
try {
bus = new Route (*this, bus_name, -1, -1, -1, -1);
if (bus->ensure_io (input_channels, output_channels, false, this)) {
- error << compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
+ error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"),
input_channels, output_channels)
<< endmsg;
}
}
- while (number < ULONG_MAX) {
+ while (number < (ULONG_MAX-1)) {
AudioRegionList::const_iterator i;
string sbuf;
}
}
- if (number != ULONG_MAX) {
+ if (number != (ULONG_MAX-1)) {
return buf;
}
- error << compose (_("cannot create new name for region \"%1\""), old) << endmsg;
+ error << string_compose (_("cannot create new name for region \"%1\""), old) << endmsg;
return old;
}
}
if (name_taken) {
- fatal << compose(_("too many regions with names like %1"), base) << endmsg;
+ fatal << string_compose(_("too many regions with names like %1"), base) << endmsg;
/*NOTREACHED*/
}
}
}
if (cnt > limit) {
- error << compose(_("There are already %1 recordings for %2, which I consider too many."), limit, ds.name()) << endmsg;
+ error << string_compose(_("There are already %1 recordings for %2, which I consider too many."), limit, ds.name()) << endmsg;
throw failed_constructor();
}
}
if (x == 99999) {
- error << compose (_("too many bounced versions of playlist \"%1\""), playlist->name()) << endmsg;
+ error << string_compose (_("too many bounced versions of playlist \"%1\""), playlist->name()) << endmsg;
goto out;
}
}
catch (failed_constructor& err) {
- error << compose (_("cannot create new audio file \"%1\" for %2"), buf, track.name()) << endmsg;
+ error << string_compose (_("cannot create new audio file \"%1\" for %2"), buf, track.name()) << endmsg;
goto out;
}
butler_should_run = false;
if (pipe (butler_request_pipe)) {
- error << compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (butler_request_pipe[0], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (butler_request_pipe[1], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on butler request pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
continue;
}
- error << compose (_("poll on butler request pipe failed (%1)"),
+ error << string_compose (_("poll on butler request pipe failed (%1)"),
strerror (errno))
<< endmsg;
break;
default:
compute_io = false;
- error << compose(_("Butler read ahead failure on dstream %1"), (*i)->name()) << endmsg;
+ error << string_compose(_("Butler read ahead failure on dstream %1"), (*i)->name()) << endmsg;
break;
}
default:
err++;
compute_io = false;
- error << compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << endmsg;
+ error << string_compose(_("Butler write-behind failure on dstream %1"), (*i)->name()) << endmsg;
/* don't break - try to flush all streams in case they
are split across disks.
*/
if ((sndfile = sf_open (click_sound.c_str(), SFM_READ, &info)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- warning << compose (_("cannot open click soundfile %1 (%2)"), click_sound, errbuf) << endmsg;
+ warning << string_compose (_("cannot open click soundfile %1 (%2)"), click_sound, errbuf) << endmsg;
_clicking = false;
return;
}
if ((sndfile = sf_open (click_emphasis_sound.c_str(), SFM_READ, &info)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- warning << compose (_("cannot open click emphasis soundfile %1 (%2)"), click_emphasis_sound, errbuf) << endmsg;
+ warning << string_compose (_("cannot open click emphasis soundfile %1 (%2)"), click_emphasis_sound, errbuf) << endmsg;
return;
}
default:
for (Events::iterator i = events.begin(); i != events.end(); ++i) {
if ((*i)->type == ev->type && (*i)->action_frame == ev->action_frame) {
- error << compose(_("Session: cannot have two events of type %1 at the same frame (%2)."),
+ error << string_compose(_("Session: cannot have two events of type %1 at the same frame (%2)."),
event_names[ev->type], ev->action_frame) << endmsg;
return;
}
break;
default:
- fatal << compose(_("Programming error: illegal event type in process_event (%1)"), ev->type) << endmsg;
+ fatal << string_compose(_("Programming error: illegal event type in process_event (%1)"), ev->type) << endmsg;
/*NOTREACHED*/
break;
};
if ((out = sf_open (path.c_str(), SFM_WRITE, &sfinfo)) == 0) {
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("Export: cannot open output file \"%1\" (%2)"), path, errbuf) << endmsg;
+ error << string_compose(_("Export: cannot open output file \"%1\" (%2)"), path, errbuf) << endmsg;
return -1;
}
int err;
if ((src_state = src_new (src_quality, channels, &err)) == 0) {
- error << compose (_("cannot initialize sample rate conversion: %1"), src_strerror (err)) << endmsg;
+ error << string_compose (_("cannot initialize sample rate conversion: %1"), src_strerror (err)) << endmsg;
return -1;
}
++cnt;
if ((err = src_process (src_state, &src_data)) != 0) {
- error << compose (_("an error occured during sample rate conversion: %1"),
+ error << string_compose (_("an error occured during sample rate conversion: %1"),
src_strerror (err))
<< endmsg;
return -1;
if ((jack_nframes_t) written != to_write) {
sf_error_str (out, errbuf, sizeof (errbuf) - 1);
- error << compose(_("Export: could not write data to output file (%1)"), errbuf) << endmsg;
+ error << string_compose(_("Export: could not write data to output file (%1)"), errbuf) << endmsg;
return -1;
}
LockMonitor lm (diskstream_lock, __LINE__, __FILE__);
for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) {
if ((*i)-> seek (spec.start_frame, true)) {
- error << compose (_("%1: cannot seek to %2 for export"),
+ error << string_compose (_("%1: cannot seek to %2 for export"),
(*i)->name(), spec.start_frame)
<< endmsg;
goto out;
Session::init_feedback ()
{
if (pipe (feedback_request_pipe) != 0) {
- error << compose (_("cannot create feedback request pipe (%1)"),
+ error << string_compose (_("cannot create feedback request pipe (%1)"),
strerror (errno))
<< endmsg;
return -1;
}
if (fcntl (feedback_request_pipe[0], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on " "signal read pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on " "signal read pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (feedback_request_pipe[1], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on " "signal write pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on " "signal write pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (errno == EINTR) {
continue;
}
- error << compose (_("Feedback thread poll failed (%1)"),
+ error << string_compose (_("Feedback thread poll failed (%1)"),
strerror (errno))
<< endmsg;
break;
MIDI::Port* port;
if ((port = MIDI::Manager::instance()->port (port_tag)) == 0) {
- error << compose (_("unknown port %1 requested for MTC"), port_tag) << endl;
+ error << string_compose (_("unknown port %1 requested for MTC"), port_tag) << endl;
return -1;
}
} else if (errno == EAGAIN) {
break;
} else {
- fatal << compose(_("Error reading from MIDI port %1"), port->name()) << endmsg;
+ fatal << string_compose(_("Error reading from MIDI port %1"), port->name()) << endmsg;
/*NOTREACHED*/
}
}
}
if (_mtc_port->midimsg (mtc_msg, 2)) {
- error << compose(_("Session: cannot send quarter-frame MTC message (%1)"), strerror (errno))
+ error << string_compose(_("Session: cannot send quarter-frame MTC message (%1)"), strerror (errno))
<< endmsg;
return -1;
LockMonitor lm (midi_lock, __LINE__, __FILE__);
if (_mmc_port->write (mmc_buffer, nbytes) != nbytes) {
- error << compose(_("MMC: cannot send command %1%2%3"), &hex, cmd, &dec) << endmsg;
+ error << string_compose(_("MMC: cannot send command %1%2%3"), &hex, cmd, &dec) << endmsg;
}
}
}
Session::start_midi_thread ()
{
if (pipe (midi_request_pipe)) {
- error << compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (midi_request_pipe[0], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on " "signal read pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on " "signal read pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (midi_request_pipe[1], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on " "signal write pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on " "signal write pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
char c;
if (write (midi_request_pipe[1], &c, 1) != 1) {
- error << compose(_("cannot send signal to midi thread! (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("cannot send signal to midi thread! (%1)"), strerror (errno)) << endmsg;
}
}
goto again;
}
- error << compose(_("MIDI thread poll failed (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("MIDI thread poll failed (%1)"), strerror (errno)) << endmsg;
break;
}
for (int p = 1; p < nfds; ++p) {
if ((pfd[p].revents & ~POLLIN)) {
- // error << compose(_("Transport: error polling MIDI port %1 (revents =%2%3%4"), p, &hex, pfd[p].revents, &dec) << endmsg;
+ // error << string_compose(_("Transport: error polling MIDI port %1 (revents =%2%3%4"), p, &hex, pfd[p].revents, &dec) << endmsg;
break;
}
if ((*i)->no_roll (nframes, _transport_frame, end_frame, offset, non_realtime_work_pending(),
actively_recording(), declick)) {
- error << compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
+ error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
ret = -1;
break;
}
char buf[PATH_MAX+1];
if (!realpath(fullpath.c_str(), buf) && (errno != ENOENT)) {
- error << compose(_("Could not use path %1 (%s)"), buf, strerror(errno)) << endmsg;
+ error << string_compose(_("Could not use path %1 (%s)"), buf, strerror(errno)) << endmsg;
throw failed_constructor();
}
_path = string(buf);
if (errno == EEXIST) {
new_session = false;
} else {
- error << compose(_("Session: cannot create session dir \"%1\" (%2)"), _path, strerror (errno)) << endmsg;
+ error << string_compose(_("Session: cannot create session dir \"%1\" (%2)"), _path, strerror (errno)) << endmsg;
return -1;
}
} else {
if (mkdir (dir.c_str(), 0755) < 0) {
if (errno != EEXIST) {
- error << compose(_("Session: cannot create session peakfile dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
+ error << string_compose(_("Session: cannot create session peakfile dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
if (mkdir (dir.c_str(), 0755) < 0) {
if (errno != EEXIST) {
- error << compose(_("Session: cannot create session sounds dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
+ error << string_compose(_("Session: cannot create session sounds dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
if (mkdir (dir.c_str(), 0755) < 0) {
if (errno != EEXIST) {
- error << compose(_("Session: cannot create session dead sounds dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
+ error << string_compose(_("Session: cannot create session dead sounds dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
if (mkdir (dir.c_str(), 0755) < 0) {
if (errno != EEXIST) {
- error << compose(_("Session: cannot create session automation dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
+ error << string_compose(_("Session: cannot create session automation dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
vector<string*>* result= scanner (tpath, lookfor, false, true);
if (result == 0) {
- error << compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
+ error << string_compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
<< endmsg;
*mix_template = "";
}
if (result->size() == 0) {
delete result;
- error << compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
+ error << string_compose (_("Could not find a template called %1 in %2"), *mix_template, tpath)
<< endmsg;
*mix_template = "";
}
return 0;
} else {
- error << compose (_("Could not open %1 for writing mix template"), out_path)
+ error << string_compose (_("Could not open %1 for writing mix template"), out_path)
<< endmsg;
return -1;
}
} else {
- error << compose (_("Could not open mix template %1 for reading"), in_path)
+ error << string_compose (_("Could not open mix template %1 for reading"), in_path)
<< endmsg;
return -1;
}
}
if (!tree.write (xml_path)) {
- error << compose (_("state could not be saved to %1"), xml_path) << endmsg;
+ error << string_compose (_("state could not be saved to %1"), xml_path) << endmsg;
/* don't leave a corrupt file lying around if it is
possible to fix.
*/
if (unlink (xml_path.c_str())) {
- error << compose (_("could not remove corrupt state file %1"), xml_path) << endmsg;
+ error << string_compose (_("could not remove corrupt state file %1"), xml_path) << endmsg;
} else {
if (!pending) {
if (rename (bak_path.c_str(), xml_path.c_str())) {
- error << compose (_("could not restore state file from backup %1"), bak_path) << endmsg;
+ error << string_compose (_("could not restore state file from backup %1"), bak_path) << endmsg;
}
}
}
}
if (access (xmlpath.c_str(), F_OK)) {
- error << compose(_("%1: session state information file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
+ error << string_compose(_("%1: session state information file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
return 1;
}
if (state_tree->read (xmlpath)) {
return 0;
} else {
- error << compose(_("Could not understand ardour file %1"), xmlpath) << endmsg;
+ error << string_compose(_("Could not understand ardour file %1"), xmlpath) << endmsg;
}
delete state_tree;
}
}
- sscanf (prop->value().c_str(), "%llu", &s_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &s_id);
if ((source = get_source (s_id)) == 0) {
- error << compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), s_id) << endmsg;
+ error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), s_id) << endmsg;
return 0;
}
for (uint32_t n=1; n < nchans; ++n) {
snprintf (buf, sizeof(buf), X_("source-%d"), n);
if ((prop = node.property (buf)) != 0) {
- sscanf (prop->value().c_str(), "%llu", &s_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &s_id);
if ((source = get_source (s_id)) == 0) {
- error << compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), s_id) << endmsg;
+ error << string_compose(_("Session: XMLNode describing a AudioRegion references an unknown source id =%1"), s_id) << endmsg;
return 0;
}
sources.push_back(source);
closedir (dp);
} else {
if (mkdir (dir.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)<0) {
- error << compose(_("Could not create mix templates directory \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
+ error << string_compose(_("Could not create mix templates directory \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
ifstream in(xml_path.c_str());
if (in) {
- warning << compose(_("Template \"%1\" already exists - new version not created"), template_name) << endmsg;
+ warning << string_compose(_("Template \"%1\" already exists - new version not created"), template_name) << endmsg;
return -1;
} else {
in.close();
if (mkdir (path.c_str(), 0775)) {
if (errno != EEXIST) {
- error << compose(_("cannot create session directory \"%1\"; ignored"), path) << endmsg;
+ error << string_compose(_("cannot create session directory \"%1\"; ignored"), path) << endmsg;
return -1;
}
}
if (mkdir (result.c_str(), 0775)) {
if (errno != EEXIST) {
- error << compose(_("cannot create sounds directory \"%1\"; ignored"), result) << endmsg;
+ error << string_compose(_("cannot create sounds directory \"%1\"; ignored"), result) << endmsg;
return -1;
}
}
if (mkdir (dead.c_str(), 0775)) {
if (errno != EEXIST) {
- error << compose(_("cannot create dead sounds directory \"%1\"; ignored"), dead) << endmsg;
+ error << string_compose(_("cannot create dead sounds directory \"%1\"; ignored"), dead) << endmsg;
return -1;
}
}
if (mkdir (peak.c_str(), 0775)) {
if (errno != EEXIST) {
- error << compose(_("cannot create peak file directory \"%1\"; ignored"), peak) << endmsg;
+ error << string_compose(_("cannot create peak file directory \"%1\"; ignored"), peak) << endmsg;
return -1;
}
}
} else if ((*niter)->name() == "OutputConnection") {
add_connection (new ARDOUR::OutputConnection (**niter));
} else {
- error << compose(_("Unknown node \"%1\" found in Connections list from state file"), (*niter)->name()) << endmsg;
+ error << string_compose(_("Unknown node \"%1\" found in Connections list from state file"), (*niter)->name()) << endmsg;
return -1;
}
}
if (!fav) {
if (errno != ENOENT) {
- //error << compose (_("cannot open favorite file %1 (%2)"), path, strerror (errno)) << endmsg;
+ //error << string_compose (_("cannot open favorite file %1 (%2)"), path, strerror (errno)) << endmsg;
return -1;
} else {
return 1;
}
if (version == 999) {
- error << compose (_("there are already 1000 files with names like %1; versioning discontinued"),
+ error << string_compose (_("there are already 1000 files with names like %1; versioning discontinued"),
newpath)
<< endmsg;
} else {
}
if (::rename ((*x).c_str(), newpath.c_str()) != 0) {
- error << compose (_("cannot rename audio file source from %1 to %2 (%3)"),
+ error << string_compose (_("cannot rename audio file source from %1 to %2 (%3)"),
(*x), newpath, strerror (errno))
<< endmsg;
goto out;
if (access (peakpath.c_str(), W_OK) == 0) {
if (::unlink (peakpath.c_str()) != 0) {
- error << compose (_("cannot remove peakfile %1 for %2 (%3)"),
+ error << string_compose (_("cannot remove peakfile %1 for %2 (%3)"),
peakpath, _path, strerror (errno))
<< endmsg;
/* try to back out */
}
if (unlink (fullpath.c_str())) {
- error << compose (_("cannot remove dead sound file %1 (%2)"),
+ error << string_compose (_("cannot remove dead sound file %1 (%2)"),
fullpath, strerror (errno))
<< endmsg;
}
break;
default:
- error << compose (_("Unknown JACK transport state %1 in sync callback"), state)
+ error << string_compose (_("Unknown JACK transport state %1 in sync callback"), state)
<< endmsg;
}
string path = path_from_region_name (PBD::basename_nosuffix (names[i]), ident);
if (path.length() == 0) {
- error << compose (_("tempoize: error creating name for new audio file based on %1"), tsr.region->name())
+ error << string_compose (_("tempoize: error creating name for new audio file based on %1"), tsr.region->name())
<< endmsg;
goto out;
}
try {
sources.push_back(new FileSource (path, frame_rate()));
} catch (failed_constructor& err) {
- error << compose (_("tempoize: error creating new audio file %1 (%2)"), path, strerror (errno)) << endmsg;
+ error << string_compose (_("tempoize: error creating new audio file %1 (%2)"), path, strerror (errno)) << endmsg;
goto out;
}
}
subject to timefx. */
if ((this_read = tsr.region->master_read_at (buffer, buffer, gain_buffer, pos + tsr.region->position(), this_time)) != this_time) {
- error << compose (_("tempoize: error reading data from %1"), sources[i]->name()) << endmsg;
+ error << string_compose (_("tempoize: error reading data from %1"), sources[i]->name()) << endmsg;
goto out;
}
while ((this_read = st.receiveSamples (buffer, bufsize)) > 0 && tsr.running) {
if (sources[i]->write (buffer, this_read) != this_read) {
- error << compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
+ error << string_compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
goto out;
}
}
while (tsr.running && (this_read = st.receiveSamples (buffer, bufsize)) > 0) {
if (sources[i]->write (buffer, this_read) != this_read) {
- error << compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
+ error << string_compose (_("error writing tempo-adjusted data to %1"), sources[i]->name()) << endmsg;
goto out;
}
}
if ((sf = sf_open (file.c_str(), SFM_READ, &_info)) == 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("SndFileSource: cannot open file \"%1\" (%2)"), file, errbuf) << endmsg;
+ error << string_compose(_("SndFileSource: cannot open file \"%1\" (%2)"), file, errbuf) << endmsg;
throw failed_constructor();
}
if (channel >= _info.channels) {
- error << compose(_("SndFileSource: file only contains %1 channels; %2 is invalid as a channel number"), _info.channels, channel) << endmsg;
+ error << string_compose(_("SndFileSource: file only contains %1 channels; %2 is invalid as a channel number"), _info.channels, channel) << endmsg;
sf_close (sf);
sf = 0;
throw failed_constructor();
if (sf_seek (sf, (off_t) start, SEEK_SET) < 0) {
char errbuf[256];
sf_error_str (0, errbuf, sizeof (errbuf) - 1);
- error << compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.substr (1), errbuf) << endmsg;
+ error << string_compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.substr (1), errbuf) << endmsg;
return 0;
}
char buf[64];
node->add_property ("name", _name);
- snprintf (buf, sizeof(buf)-1, "%llu", _id);
+ snprintf (buf, sizeof(buf)-1, "%" PRIu64, _id);
node->add_property ("id", buf);
if (_timestamp != 0) {
}
if ((prop = node.property ("id")) != 0) {
- sscanf (prop->value().c_str(), "%llu", &_id);
+ sscanf (prop->value().c_str(), "%" PRIu64, &_id);
} else {
return -1;
}
continue;
}
- error << compose (_("poll on peak request pipe failed (%1)"),
+ error << string_compose (_("poll on peak request pipe failed (%1)"),
strerror (errno))
<< endmsg;
break;
}
if (pipe (peak_request_pipe)) {
- error << compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (peak_request_pipe[0], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on peak request pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on peak request pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (fcntl (peak_request_pipe[1], F_SETFL, O_NONBLOCK)) {
- error << compose(_("UI: cannot set O_NONBLOCK on peak request pipe (%1)"), strerror (errno)) << endmsg;
+ error << string_compose(_("UI: cannot set O_NONBLOCK on peak request pipe (%1)"), strerror (errno)) << endmsg;
return -1;
}
if (errno != ENOENT) {
/* it exists in the peaks dir, but there is some kind of error */
- error << compose(_("Source: cannot stat peakfile \"%1\""), peakpath) << endmsg;
+ error << string_compose(_("Source: cannot stat peakfile \"%1\""), peakpath) << endmsg;
return -1;
}
/* it exists in the audio dir , but there is some kind of error */
- error << compose(_("Source: cannot stat peakfile \"%1\" or \"%2\""), peakpath, oldpeakpath) << endmsg;
+ error << string_compose(_("Source: cannot stat peakfile \"%1\" or \"%2\""), peakpath, oldpeakpath) << endmsg;
return -1;
}
}
if ((peakfile = ::open (peakpath.c_str(), O_RDWR|O_CREAT, 0664)) < 0) {
- error << compose(_("Source: cannot open peakpath \"%1\" (%2)"), peakpath, strerror (errno)) << endmsg;
+ error << string_compose(_("Source: cannot open peakpath \"%1\" (%2)"), peakpath, strerror (errno)) << endmsg;
return -1;
}
to_read = min (chunksize, (_length - current_frame));
if ((frames_read = read_unlocked (raw_staging, current_frame, to_read)) < 0) {
- error << compose(_("Source[%1]: peak read - cannot read %2 samples at offset %3")
+ error << string_compose(_("Source[%1]: peak read - cannot read %2 samples at offset %3")
, _name, to_read, current_frame)
<< endmsg;
goto out;
frames_to_read = min (frames_per_peak, cnt);
if ((frames_read = read_unlocked (buf, current_frame, frames_to_read)) != frames_to_read) {
- error << compose(_("%1: could not write read raw data for peak computation (%2)"), _name, strerror (errno)) << endmsg;
+ error << string_compose(_("%1: could not write read raw data for peak computation (%2)"), _name, strerror (errno)) << endmsg;
goto out;
}
cnt -= frames_read;
}
- if (::pwrite (peakfile, peakbuf, sizeof (PeakData) * peaki, first_peak_byte) != (size_t) sizeof (PeakData) * peaki) {
- error << compose(_("%1: could not write peak file data (%2)"), _name, strerror (errno)) << endmsg;
+ if (::pwrite (peakfile, peakbuf, sizeof (PeakData) * peaki, first_peak_byte) != (ssize_t) sizeof (PeakData) * peaki) {
+ error << string_compose(_("%1: could not write peak file data (%2)"), _name, strerror (errno)) << endmsg;
goto out;
}
for (n = 0, i = states.begin(); n < id && i != states.end(); ++n, ++i);
if (n != id || i == states.end()) {
- fatal << compose (_("programming error: illegal state ID (%1) passed to "
+ fatal << string_compose (_("programming error: illegal state ID (%1) passed to "
"StateManager::set_state() (range = 0-%3)"), id,
states.size()-1)
<< endmsg;
tree.set_root (copy);
if (!tree.write()) {
- error << compose(_("Error: could not write %1"), dir+"/instant.xml") << endmsg;
+ error << string_compose(_("Error: could not write %1"), dir+"/instant.xml") << endmsg;
}
}
if (tree.read(dir+"/instant.xml")) {
_instant_xml = new XMLNode(*(tree.root()));
} else {
- warning << compose(_("Could not understand XML file %1"), instant_file) << endmsg;
+ warning << string_compose(_("Could not understand XML file %1"), instant_file) << endmsg;
return 0;
}
} else {
throw failed_constructor();
}
- if (sscanf (prop->value().c_str(), "%lu|%lu|%lu",
+ if (sscanf (prop->value().c_str(), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
&start.bars,
&start.beats,
&start.ticks) < 3) {
throw failed_constructor();
}
- if (sscanf (prop->value().c_str(), "%lu|%lu|%lu",
+ if (sscanf (prop->value().c_str(), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
&start.bars,
&start.beats,
&start.ticks) < 3) {
if (stat (path.c_str(), &sbuf)) {
if (errno == ENOENT) {
if (mkdir (path.c_str(), 0600)) {
- error << compose (_("cannot create VST chunk directory: %1"),
+ error << string_compose (_("cannot create VST chunk directory: %1"),
strerror (errno))
<< endmsg;
return *root;
} else {
- error << compose (_("cannot check VST chunk directory: %1"),
+ error << string_compose (_("cannot check VST chunk directory: %1"),
strerror (errno))
<< endmsg;
return *root;
}
} else if (!S_ISDIR (sbuf.st_mode)) {
- error << compose (_("%1 exists but is not a directory"), path)
+ error << string_compose (_("%1 exists but is not a directory"), path)
<< endmsg;
return *root;
}
#include <gtkmm.h>
#include <pbd/error.h>
+#include <pbd/compose.h>
#include <pbd/touchable.h>
#include <pbd/failed_constructor.h>
#include <pbd/pthread_utils.h>
if (rbuf == 0) {
/* Cannot happen, but if it does we can't use the error reporting mechanism */
cerr << _("programming error: ")
- << compose (X_("no GUI request buffer found for thread %1"), pthread_self())
+ << string_compose (X_("no GUI request buffer found for thread %1"), pthread_self())
<< endl;
abort ();
}
if (vec.len[0] == 0) {
if (vec.len[1] == 0) {
- cerr << compose (X_("no space in GUI request buffer for thread %1"), pthread_self())
+ cerr << string_compose (X_("no space in GUI request buffer for thread %1"), pthread_self())
<< endl;
return 0;
} else {
thread isn't registered!
*/
cerr << _("programming error: ")
- << compose (X_("UI::send_request() called from %1, but no request buffer exists for that thread"),
+ << string_compose (X_("UI::send_request() called from %1, but no request buffer exists for that thread"),
pthread_self())
<< endl;
abort ();
}
// now for the real thing(s)
-namespace PBD
-{
+//namespace PBD
+//{
// a series of functions which accept a format string on the form "text %1
// more %2 less %3" and a number of templated parameters and spits out the
// composited string
template <typename T1>
- inline std::string compose(const std::string &fmt, const T1 &o1)
+ inline std::string string_compose(const std::string &fmt, const T1 &o1)
{
StringPrivate::Composition c(fmt);
c.arg(o1);
}
template <typename T1, typename T2>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2)
{
StringPrivate::Composition c(fmt);
}
template <typename T1, typename T2, typename T3>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3)
{
StringPrivate::Composition c(fmt);
}
template <typename T1, typename T2, typename T3, typename T4>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4)
{
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5)
{
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6)
{
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7)
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8)
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9)
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14,
typename T15>
- inline std::string compose(const std::string &fmt,
+ inline std::string string_compose(const std::string &fmt,
const T1 &o1, const T2 &o2, const T3 &o3,
const T4 &o4, const T5 &o5, const T6 &o6,
const T7 &o7, const T8 &o8, const T9 &o9,
.arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15);
return c.str();
}
-}
+//}
#endif // STRING_COMPOSE_H