Generic MIDI control now saves+restores its state; PBD::ID now requires a buffer size for its print() method

git-svn-id: svn://localhost/ardour2/trunk@949 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-10-05 01:49:32 +00:00
parent 5ad68cf2c5
commit ffdf5ada61
31 changed files with 209 additions and 77 deletions

View file

@ -40,16 +40,15 @@ ID::string_assign (string str)
}
void
ID::print (char* buf) const
ID::print (char* buf, uint32_t bufsize) const
{
/* XXX sizeof buf is unknown. bad API design */
snprintf (buf, 32, "%" PRIu64, _id);
snprintf (buf, bufsize, "%" PRIu64, _id);
}
string ID::to_s() const
{
char buf[32]; // see print()
print(buf);
print(buf, sizeof (buf));
return string(buf);
}
@ -64,7 +63,7 @@ ostream&
operator<< (ostream& ostr, const ID& _id)
{
char buf[32];
_id.print (buf);
_id.print (buf, sizeof (buf));
ostr << buf;
return ostr;
}