diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2005-10-06 19:10:57 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2005-10-06 19:10:57 +0000 |
commit | 4c509656223d3ed1f0fab504cb483090d38972f9 (patch) | |
tree | 540f207b81f957fa78101d67da3094ff1e1f9456 /libs/ardour | |
parent | 5a52d8fee4c9abac7ffb1f1e6464785d979acd68 (diff) |
fix compose mess, and a number of 64 bit printf specs
git-svn-id: svn://localhost/trunk/ardour2@51 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
41 files changed, 289 insertions, 290 deletions
diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc index e9fd0111b9..f49fb4e280 100644 --- a/libs/ardour/audio_library.cc +++ b/libs/ardour/audio_library.cc @@ -103,14 +103,14 @@ void 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); @@ -184,8 +184,8 @@ AudioLibrary::get_groups (list<string>& groups, string parent_uri) 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); diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index e4a244aa16..73e0a91164 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -473,7 +473,7 @@ AudioPlaylist::set_state (const XMLNode& node) } 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; diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index b0c1d96e7b..f8817a2544 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -116,14 +116,14 @@ AudioTrack::deprecated_use_diskstream_connections () 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; } } @@ -132,7 +132,7 @@ AudioTrack::deprecated_use_diskstream_connections () } 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; } } @@ -176,7 +176,7 @@ AudioTrack::use_diskstream (string name) 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; } @@ -189,7 +189,7 @@ AudioTrack::use_diskstream (id_t id) 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; } @@ -287,7 +287,7 @@ AudioTrack::set_state (const XMLNode& node) 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; } } } @@ -447,7 +447,7 @@ AudioTrack::set_state_part_two () 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); } } @@ -855,11 +855,11 @@ AudioTrack::freeze (InterThreadInfo& itt) 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; @@ -870,8 +870,8 @@ AudioTrack::freeze (InterThreadInfo& itt) } - 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; diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 2792bd5e65..a32cb0a714 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -539,7 +539,7 @@ AudioEngine::connect (const string& source, const string& destination) 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; } @@ -908,7 +908,7 @@ AudioEngine::connect_to_jack (string client_name) 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; } @@ -988,7 +988,7 @@ AudioEngine::reconnect_to_jack () 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 { } @@ -1045,7 +1045,7 @@ AudioEngine::reconnect_to_jack () 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; } diff --git a/libs/ardour/audiofilter.cc b/libs/ardour/audiofilter.cc index ab4728495f..6145ef9c83 100644 --- a/libs/ardour/audiofilter.cc +++ b/libs/ardour/audiofilter.cc @@ -41,7 +41,7 @@ AudioFilter::make_new_sources (AudioRegion& region, AudioRegion::SourceList& nsr 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; } @@ -51,7 +51,7 @@ AudioFilter::make_new_sources (AudioRegion& region, AudioRegion::SourceList& nsr } 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; } } diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc index f7452f4fd0..4003946576 100644 --- a/libs/ardour/configuration.cc +++ b/libs/ardour/configuration.cc @@ -96,12 +96,12 @@ Configuration::load_state () 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; } } @@ -121,13 +121,13 @@ Configuration::load_state () 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; } } diff --git a/libs/ardour/connection.cc b/libs/ardour/connection.cc index ea4e6d58e5..83e0a87dc1 100644 --- a/libs/ardour/connection.cc +++ b/libs/ardour/connection.cc @@ -224,12 +224,12 @@ Connection::set_connections (const string& str) 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; diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 1e9543519b..67b6a182b4 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -122,10 +122,10 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node) 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(); } @@ -139,10 +139,10 @@ Crossfade::Crossfade (const Playlist& playlist, XMLNode& node) 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(); } diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 476c77cbec..1b8de068b2 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -324,12 +324,12 @@ DiskStream::find_and_use_playlist (const string& name) 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; } @@ -412,7 +412,7 @@ int 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; } @@ -1032,7 +1032,7 @@ DiskStream::overwrite_existing_buffers () 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; } @@ -1043,7 +1043,7 @@ DiskStream::overwrite_existing_buffers () 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; } @@ -1172,7 +1172,7 @@ DiskStream::read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer, jack_ 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; } @@ -1471,7 +1471,7 @@ DiskStream::do_flush (bool force_flush) 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; } @@ -1487,7 +1487,7 @@ DiskStream::do_flush (bool force_flush) 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; } @@ -1546,7 +1546,7 @@ DiskStream::transport_stopped (struct tm& when, time_t twhen, bool abort_capture 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++; } } @@ -1628,7 +1628,7 @@ DiskStream::transport_stopped (struct tm& when, time_t twhen, bool abort_capture } 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? */ } @@ -1801,7 +1801,7 @@ DiskStream::get_state () 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()); @@ -1877,11 +1877,11 @@ DiskStream::set_state (const XMLNode& node) 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); } } @@ -1973,7 +1973,7 @@ DiskStream::use_new_write_source (uint32_t n) } 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; } @@ -1998,7 +1998,7 @@ DiskStream::use_new_write_source (uint32_t n) } 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; } @@ -2191,7 +2191,7 @@ DiskStream::set_loop (Location *location) { 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; } } @@ -2269,7 +2269,7 @@ DiskStream::use_pending_capture_data (XMLNode& node) } 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; @@ -2291,7 +2291,7 @@ DiskStream::use_pending_capture_data (XMLNode& node) } 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; } @@ -2307,7 +2307,7 @@ DiskStream::use_pending_capture_data (XMLNode& node) } 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; @@ -2319,7 +2319,7 @@ DiskStream::use_pending_capture_data (XMLNode& node) } 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; diff --git a/libs/ardour/filesource.cc b/libs/ardour/filesource.cc index 0df4c29c3d..f7ecdc1136 100644 --- a/libs/ardour/filesource.cc +++ b/libs/ardour/filesource.cc @@ -158,13 +158,13 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) 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) { @@ -199,7 +199,7 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) 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; } @@ -207,13 +207,13 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) 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; } @@ -239,7 +239,7 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) 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; } @@ -254,17 +254,17 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) } 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; } @@ -272,7 +272,7 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate) } 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: @@ -326,7 +326,7 @@ FileSource::discover_chunks (bool silent) 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; } @@ -401,11 +401,11 @@ FileSource::fill_header (jack_nframes_t rate) 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; } @@ -543,7 +543,7 @@ FileSource::update_header (jack_nframes_t when, struct tm& now, time_t tnow) 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; } @@ -613,7 +613,7 @@ FileSource::read_broadcast_data (ChunkInfo& info) 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; } @@ -625,7 +625,7 @@ FileSource::read_broadcast_data (ChunkInfo& info) 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; } @@ -658,7 +658,7 @@ FileSource::check_header (jack_nframes_t rate, bool silent) { 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; @@ -697,17 +697,17 @@ FileSource::check_header (jack_nframes_t rate, bool silent) } 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; } @@ -724,7 +724,7 @@ FileSource::write_header() 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; } @@ -759,14 +759,14 @@ FileSource::write_header() /* 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; } @@ -836,7 +836,7 @@ FileSource::write (Sample *data, jack_nframes_t cnt) 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; } @@ -960,7 +960,7 @@ FileSource::move_to_trash (const string trash_dir_name) } 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 { @@ -974,14 +974,14 @@ FileSource::move_to_trash (const string trash_dir_name) } 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 */ diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 4dd640593d..375068b915 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -94,7 +94,7 @@ setup_midi () 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; } @@ -143,18 +143,18 @@ setup_midi () } 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; } diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index b9ebe5859e..3411481a3a 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -66,7 +66,7 @@ Session::import_audiofile (import_status& status) 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()) { @@ -75,12 +75,12 @@ Session::import_audiofile (import_status& status) // 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 @@ -136,7 +136,7 @@ Session::import_audiofile (import_status& status) } 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; } @@ -309,7 +309,7 @@ Session::sample_rate_convert (import_status& status, string infile, string& outf 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; } @@ -318,7 +318,7 @@ Session::sample_rate_convert (import_status& status, string infile, string& outf /* 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 ; } @@ -346,7 +346,7 @@ Session::sample_rate_convert (import_status& status, string infile, string& outf } 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 ; } diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index 80bc0ce862..f405af5069 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -522,7 +522,7 @@ PluginInsert::plugin_factory (Plugin& other) #endif } - fatal << compose (_("programming error: %1"), + fatal << string_compose (_("programming error: %1"), X_("unknown plugin type in PluginInsert::plugin_factory")) << endmsg; /*NOTREACHED*/ @@ -597,7 +597,7 @@ PluginInsert::state (bool full) 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 */ @@ -644,7 +644,7 @@ PluginInsert::set_state(const XMLNode& node) } 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; @@ -658,7 +658,7 @@ PluginInsert::set_state(const XMLNode& node) 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; @@ -701,7 +701,7 @@ PluginInsert::set_state(const XMLNode& node) } 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; } @@ -748,7 +748,7 @@ PluginInsert::set_state(const XMLNode& node) } 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; } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index efee6fc397..b2d3337dcb 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -416,7 +416,7 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_ } gain_t dg; - gain_t old_gain; + gain_t old_gain = _gain; if (apply_gain_automation) { @@ -424,7 +424,6 @@ IO::deliver_output_no_pan (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_ speed quietning. */ - old_gain = _gain; _gain = 1.0f; dg = _gain; @@ -585,7 +584,7 @@ IO::disconnect_input (Port* our_port, string other_port, void* src) /* 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; } @@ -653,7 +652,7 @@ IO::disconnect_output (Port* our_port, string other_port, void* src) /* 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; } @@ -800,7 +799,7 @@ IO::add_output_port (string destination, void* src) } 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; } @@ -901,7 +900,7 @@ IO::add_input_port (string source, void* src) } 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; } @@ -1007,7 +1006,7 @@ IO::ensure_inputs_locked (uint32_t n, bool clear, void* src) 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; } } @@ -1112,7 +1111,7 @@ IO::ensure_io (uint32_t nin, uint32_t nout, bool clear, void* src) 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; } } @@ -1145,7 +1144,7 @@ IO::ensure_io (uint32_t nin, uint32_t nout, bool clear, void* src) 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; } } @@ -1269,7 +1268,7 @@ IO::ensure_outputs_locked (uint32_t n, bool clear, void* src) } 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; } @@ -1579,7 +1578,7 @@ IO::set_state (const XMLNode& node) */ 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; } @@ -1589,7 +1588,7 @@ IO::set_state (const XMLNode& node) } 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) { @@ -1634,7 +1633,7 @@ IO::set_state (const XMLNode& node) 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; } } } @@ -1701,14 +1700,14 @@ IO::create_ports (const XMLNode& node) 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; } } @@ -1724,14 +1723,14 @@ IO::create_ports (const XMLNode& node) 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; } } @@ -1745,7 +1744,7 @@ IO::create_ports (const XMLNode& node) 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; } @@ -1811,14 +1810,14 @@ IO::make_connections (const XMLNode& node) 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; } } @@ -1827,7 +1826,7 @@ IO::make_connections (const XMLNode& node) } 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; } } @@ -1836,14 +1835,14 @@ IO::make_connections (const XMLNode& node) 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; } } @@ -1852,7 +1851,7 @@ IO::make_connections (const XMLNode& node) } 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; } } @@ -1887,12 +1886,12 @@ IO::set_inputs (const string& str) 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; @@ -1937,12 +1936,12 @@ IO::set_outputs (const string& str) 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; @@ -2480,7 +2479,7 @@ IO::save_automation (const string& path) 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; } @@ -2519,7 +2518,7 @@ IO::load_automation (const string& path) 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; } } @@ -2534,16 +2533,16 @@ IO::load_automation (const string& path) 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; } @@ -2551,7 +2550,7 @@ IO::load_automation (const string& path) } 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; } diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index afd0db8608..ef136a7807 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -95,7 +95,7 @@ LadspaPlugin::init (void *mod, uint32_t index, jack_nframes_t rate) _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(); } @@ -325,7 +325,7 @@ LadspaPlugin::set_parameter (uint32_t which, float val) } } 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; @@ -494,7 +494,7 @@ LadspaPlugin::set_state(const XMLNode& node) } } 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; } } } diff --git a/libs/ardour/named_selection.cc b/libs/ardour/named_selection.cc index 44e169edff..9c5830dfc1 100644 --- a/libs/ardour/named_selection.cc +++ b/libs/ardour/named_selection.cc @@ -73,10 +73,10 @@ NamedSelection::NamedSelection (Session& session, const XMLNode& node) 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(); } } diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index fdf3e39f29..63bcd7f302 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -393,7 +393,7 @@ BaseStereoPanner::save (ostream& out) const 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; } } @@ -421,7 +421,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt) } 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; } @@ -1224,7 +1224,7 @@ Panner::save () const 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; } @@ -1260,7 +1260,7 @@ Panner::load () 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; @@ -1273,17 +1273,17 @@ Panner::load () 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; } @@ -1297,7 +1297,7 @@ Panner::load () 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; @@ -1438,7 +1438,7 @@ Panner::set_state (const XMLNode& node) 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; } diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index b28e193c9b..8977135ba7 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -483,7 +483,7 @@ void 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; @@ -550,7 +550,7 @@ int 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; @@ -1061,7 +1061,7 @@ Playlist::region_bounds_changed (Change what_changed, Region *region) 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; diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index dc85e1d721..f5753fd182 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -326,24 +326,24 @@ Plugin::save_preset (string name, string domain) 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; } diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index e214e56ebc..0adf8203b6 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -183,14 +183,14 @@ PluginManager::add_presets(string domain) 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; } } } @@ -232,14 +232,14 @@ PluginManager::ladspa_discover (string path) 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; @@ -293,7 +293,7 @@ PluginManager::load (Session& session, PluginInfo *info) 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); } @@ -308,7 +308,7 @@ PluginManager::load (Session& session, PluginInfo *info) } 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()); @@ -455,7 +455,7 @@ PluginManager::vst_discover (string path) } 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; } diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc index 29cec8a9a2..a5c6b210ee 100644 --- a/libs/ardour/recent_sessions.cc +++ b/libs/ardour/recent_sessions.cc @@ -41,7 +41,7 @@ ARDOUR::read_recent_sessions (RecentSessions& rs) 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; diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc index 0a44702905..d767388363 100644 --- a/libs/ardour/redirect.cc +++ b/libs/ardour/redirect.cc @@ -98,7 +98,7 @@ Redirect::set_placement (const string& str, void *src) } 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; } } @@ -116,7 +116,7 @@ Redirect::load_automation (string path) 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; } @@ -145,7 +145,7 @@ Redirect::load_automation (string path) 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; } @@ -166,7 +166,7 @@ Redirect::save_automation (string path) 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; } @@ -185,14 +185,14 @@ Redirect::save_automation (string path) 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; } @@ -237,7 +237,7 @@ Redirect::state (bool full_state) 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: @@ -287,7 +287,7 @@ Redirect::set_state (const XMLNode& node) 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; } @@ -309,7 +309,7 @@ Redirect::set_state (const XMLNode& node) 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) { diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 4a6aea07b8..91d5704db2 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -843,7 +843,7 @@ Region::state (bool full_state) 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); @@ -885,7 +885,7 @@ Region::set_state (const XMLNode& node) 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; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index cd925e90b5..03059c6c82 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1458,7 +1458,7 @@ Route::add_redirect_from_xml (const XMLNode& node) } 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); @@ -1487,7 +1487,7 @@ Route::set_state (const XMLNode& node) 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; } @@ -1546,7 +1546,7 @@ Route::set_state (const XMLNode& node) 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); } @@ -1562,11 +1562,11 @@ Route::set_state (const XMLNode& node) 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); @@ -1667,7 +1667,7 @@ Route::set_state (const XMLNode& node) 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); } @@ -1696,7 +1696,7 @@ Route::set_state (const XMLNode& node) 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") { @@ -1704,7 +1704,7 @@ Route::set_state (const XMLNode& node) 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; } } @@ -2060,7 +2060,7 @@ Route::roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t return 0; } - jack_nframes_t unused; + jack_nframes_t unused = 0; if ((nframes = check_initial_delay (nframes, offset, unused)) == 0) { return 0; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 04be0feabb..058db6d250 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -94,7 +94,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) 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; } @@ -106,7 +106,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) 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; } @@ -136,7 +136,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) /* 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; } @@ -172,7 +172,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) 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; } @@ -189,7 +189,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) 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; } @@ -206,7 +206,7 @@ Session::find_session (string str, string& path, string& snapshot, bool& isnew) } 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; } @@ -577,7 +577,7 @@ Session::when_engine_running () _clicking = false; try { - XMLNode* child; + XMLNode* child = 0; _click_io = new ClickIO (*this, "click", 0, 0, -1, -1); @@ -1432,7 +1432,7 @@ trace_terminal (Route* r1, Route* rbase) 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; } @@ -1566,7 +1566,7 @@ Session::new_audio_track (int input_channels, int output_channels) } n++; - } while (n < ULONG_MAX); + } while (n < (ULONG_MAX-1)); if (input_auto_connect & AutoConnectPhysical) { nphysical_in = n_physical_inputs; @@ -1584,7 +1584,7 @@ Session::new_audio_track (int input_channels, int output_channels) 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; } @@ -1673,13 +1673,13 @@ Session::new_audio_route (int input_channels, int output_channels) } 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; } @@ -2153,7 +2153,7 @@ Session::new_region_name (string old) } - while (number < ULONG_MAX) { + while (number < (ULONG_MAX-1)) { AudioRegionList::const_iterator i; string sbuf; @@ -2174,11 +2174,11 @@ Session::new_region_name (string old) } } - 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; } @@ -2243,7 +2243,7 @@ Session::region_name (string& result, string base, bool newlevel) const } 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*/ } } @@ -2575,7 +2575,7 @@ Session::create_file_source (DiskStream& ds, int32_t chan) } 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(); } @@ -3341,7 +3341,7 @@ Session::write_one_track (AudioTrack& track, jack_nframes_t start, jack_nframes_ } 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; } @@ -3350,7 +3350,7 @@ Session::write_one_track (AudioTrack& track, jack_nframes_t start, jack_nframes_ } 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; } diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 56000b695e..df867c8267 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -78,17 +78,17 @@ Session::start_butler_thread () 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; } @@ -186,7 +186,7 @@ Session::butler_thread_work () continue; } - error << compose (_("poll on butler request pipe failed (%1)"), + error << string_compose (_("poll on butler request pipe failed (%1)"), strerror (errno)) << endmsg; break; @@ -269,7 +269,7 @@ Session::butler_thread_work () 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; } @@ -313,7 +313,7 @@ Session::butler_thread_work () 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. */ diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc index 6bf62bb272..d97d29cc18 100644 --- a/libs/ardour/session_click.cc +++ b/libs/ardour/session_click.cc @@ -145,7 +145,7 @@ Session::setup_click_sounds (int which) 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; } @@ -179,7 +179,7 @@ Session::setup_click_sounds (int which) 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; } diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc index 2d93108038..68555dbe40 100644 --- a/libs/ardour/session_events.cc +++ b/libs/ardour/session_events.cc @@ -158,7 +158,7 @@ Session::merge_event (Event* ev) 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; } @@ -425,7 +425,7 @@ Session::process_event (Event* ev) 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; }; diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index a17dde6979..a80ee69e56 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -201,7 +201,7 @@ AudioExportSpecification::prepare (jack_nframes_t blocksize, jack_nframes_t frat 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; } @@ -211,7 +211,7 @@ AudioExportSpecification::prepare (jack_nframes_t blocksize, jack_nframes_t frat 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; } @@ -313,7 +313,7 @@ AudioExportSpecification::process (jack_nframes_t nframes) ++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; @@ -415,7 +415,7 @@ AudioExportSpecification::process (jack_nframes_t nframes) 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; } @@ -497,7 +497,7 @@ Session::prepare_to_export (AudioExportSpecification& spec) 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; diff --git a/libs/ardour/session_feedback.cc b/libs/ardour/session_feedback.cc index d3025cef50..c2198aa55d 100644 --- a/libs/ardour/session_feedback.cc +++ b/libs/ardour/session_feedback.cc @@ -48,19 +48,19 @@ int 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; } @@ -138,7 +138,7 @@ Session::feedback_thread_work () if (errno == EINTR) { continue; } - error << compose (_("Feedback thread poll failed (%1)"), + error << string_compose (_("Feedback thread poll failed (%1)"), strerror (errno)) << endmsg; break; diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index a8ed4bc0f7..f9c8d57e62 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -201,7 +201,7 @@ Session::set_mtc_port (string port_tag) 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; } @@ -559,7 +559,7 @@ Session::midi_read (MIDI::Port* port) } 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*/ } } @@ -993,7 +993,7 @@ Session::send_midi_time_code () } 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; @@ -1099,7 +1099,7 @@ Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where) 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; } } } @@ -1201,17 +1201,17 @@ int 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; } @@ -1245,7 +1245,7 @@ Session::poke_midi_thread () 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; } } @@ -1340,7 +1340,7 @@ Session::midi_thread_work () goto again; } - error << compose(_("MIDI thread poll failed (%1)"), strerror (errno)) << endmsg; + error << string_compose(_("MIDI thread poll failed (%1)"), strerror (errno)) << endmsg; break; } @@ -1448,7 +1448,7 @@ Session::midi_thread_work () 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; } diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index 835d4ccdc2..01e75a4749 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -102,7 +102,7 @@ Session::no_roll (jack_nframes_t nframes, jack_nframes_t offset) 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; } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index bda826508c..7bc325c912 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -96,7 +96,7 @@ Session::first_stage_init (string fullpath, string snapshot_name) 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); @@ -458,7 +458,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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 { @@ -469,7 +469,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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; } } @@ -478,7 +478,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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; } } @@ -487,7 +487,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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; } } @@ -496,7 +496,7 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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; } } @@ -520,14 +520,14 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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 = ""; } @@ -553,13 +553,13 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial 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; } @@ -668,18 +668,18 @@ Session::save_state (string snapshot_name, bool pending) } 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; } } } @@ -748,7 +748,7 @@ Session::load_state (string snapshot_name) } 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; } @@ -759,7 +759,7 @@ Session::load_state (string snapshot_name) 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; @@ -1715,10 +1715,10 @@ Session::XMLRegionFactory (const XMLNode& node, bool full) } } - 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; } @@ -1729,10 +1729,10 @@ Session::XMLRegionFactory (const XMLNode& node, bool full) 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); @@ -1852,7 +1852,7 @@ Session::save_template (string template_name) 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; } } @@ -1866,7 +1866,7 @@ Session::save_template (string template_name) 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(); @@ -1933,7 +1933,7 @@ Session::ensure_sound_dir (string path, string& result) 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; } } @@ -1946,7 +1946,7 @@ Session::ensure_sound_dir (string path, string& result) 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; } } @@ -1957,7 +1957,7 @@ Session::ensure_sound_dir (string path, string& result) 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; } } @@ -1968,7 +1968,7 @@ Session::ensure_sound_dir (string path, string& result) 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; } } @@ -2266,7 +2266,7 @@ Session::load_connections (const XMLNode& node) } 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; } } @@ -2612,7 +2612,7 @@ Session::read_favorite_dirs (FavoriteDirs & favs) 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; @@ -2976,7 +2976,7 @@ Session::cleanup_sources (Session::cleanup_report& rep) } 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 { @@ -2990,7 +2990,7 @@ Session::cleanup_sources (Session::cleanup_report& rep) } 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; @@ -3005,7 +3005,7 @@ Session::cleanup_sources (Session::cleanup_report& rep) 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 */ @@ -3078,7 +3078,7 @@ Session::cleanup_trash_sources (Session::cleanup_report& rep) } 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; } diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index 27cc40ec47..e3badc5b11 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -733,7 +733,7 @@ Session::jack_sync_callback (jack_transport_state_t state, 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; } diff --git a/libs/ardour/session_timefx.cc b/libs/ardour/session_timefx.cc index a200572584..e8c5a54349 100644 --- a/libs/ardour/session_timefx.cc +++ b/libs/ardour/session_timefx.cc @@ -74,7 +74,7 @@ Session::tempoize_region (TimeStretchRequest& tsr) 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; } @@ -82,7 +82,7 @@ Session::tempoize_region (TimeStretchRequest& tsr) 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; } } @@ -107,7 +107,7 @@ Session::tempoize_region (TimeStretchRequest& tsr) 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; } @@ -120,7 +120,7 @@ Session::tempoize_region (TimeStretchRequest& tsr) 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; } } @@ -132,7 +132,7 @@ Session::tempoize_region (TimeStretchRequest& tsr) 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; } } diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 399f632caa..0baff36a3f 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -84,12 +84,12 @@ SndFileSource::init (const string& idstr, bool build_peak) 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(); @@ -137,7 +137,7 @@ SndFileSource::read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt) cons 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; } diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index c7db3337ca..12b3f08267 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -96,7 +96,7 @@ Source::get_state () 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) { @@ -123,7 +123,7 @@ Source::set_state (const XMLNode& node) } if ((prop = node.property ("id")) != 0) { - sscanf (prop->value().c_str(), "%llu", &_id); + sscanf (prop->value().c_str(), "%" PRIu64, &_id); } else { return -1; } @@ -165,7 +165,7 @@ Source::peak_thread_work (void* arg) continue; } - error << compose (_("poll on peak request pipe failed (%1)"), + error << string_compose (_("poll on peak request pipe failed (%1)"), strerror (errno)) << endmsg; break; @@ -237,17 +237,17 @@ Source::start_peak_thread () } 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; } @@ -342,7 +342,7 @@ Source::initialize_peakfile (bool newfile, string audio_path) 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; } @@ -362,7 +362,7 @@ Source::initialize_peakfile (bool newfile, string audio_path) /* 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; } @@ -394,7 +394,7 @@ Source::initialize_peakfile (bool newfile, string audio_path) } 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; } @@ -631,7 +631,7 @@ Source::read_peaks (PeakData *peaks, jack_nframes_t npeaks, jack_nframes_t start 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; @@ -767,7 +767,7 @@ Source::do_build_peak (jack_nframes_t first_frame, jack_nframes_t cnt) 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; } @@ -791,8 +791,8 @@ Source::do_build_peak (jack_nframes_t first_frame, jack_nframes_t cnt) 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; } diff --git a/libs/ardour/state_manager.cc b/libs/ardour/state_manager.cc index 30000d6784..de9a72b40a 100644 --- a/libs/ardour/state_manager.cc +++ b/libs/ardour/state_manager.cc @@ -36,7 +36,7 @@ StateManager::use_state (state_id_t id) 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; diff --git a/libs/ardour/stateful.cc b/libs/ardour/stateful.cc index 7b63d01aad..d08be38ecd 100644 --- a/libs/ardour/stateful.cc +++ b/libs/ardour/stateful.cc @@ -97,7 +97,7 @@ Stateful::add_instant_xml (XMLNode& node, const string& dir) 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; } } @@ -111,7 +111,7 @@ Stateful::instant_xml (const string& str, const string& dir) 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 { diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 8042644d39..e54231d6d1 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -67,7 +67,7 @@ TempoSection::TempoSection (const XMLNode& node) 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) { @@ -131,7 +131,7 @@ MeterSection::MeterSection (const XMLNode& node) 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) { diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 6465344d6e..053be50292 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -183,7 +183,7 @@ VSTPlugin::get_state() 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; @@ -191,14 +191,14 @@ VSTPlugin::get_state() } 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; } |