diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-28 21:36:40 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-28 21:36:40 +0000 |
commit | c4ac43749048c4c0e0ab3656d39384112a628742 (patch) | |
tree | 72d3452034c1a0a661587611a63d00509684ca27 /gtk2_ardour/ardour_ui.cc | |
parent | ee4493301a8247fb8032dd949f4c44cd4c641221 (diff) |
* libardour uses ARDOUR::nframes_t and ARDOUR::nframes64_t explicitly in headers
* use explicit operator<< and operator>> that in turn use PBD::EnumWriter when serializing and deserializing to/from rc files
* adds scrolling in mixer window (from 2.X)
* BBT math stuff - untested, but basically operational
* move LocaleGuard into its own file(s) in libs/pbd
* Tempo now uses nframes64_t everywhere (except for sample rate values)
* as in 2.X, use mkstemp and hack to avoid temp file nonsense, and remove erroneous free() from disk stats output
git-svn-id: svn://localhost/ardour2/branches/3.0@5961 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index f10f287ef8..f6208fab8c 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3009,36 +3009,38 @@ ARDOUR_UI::push_buffer_stats (uint32_t capture, uint32_t playback) void ARDOUR_UI::write_buffer_stats () { + + std::ofstream fout; struct tm tm; char buf[64]; + char path[PATH_MAX+1]; int fd; + + strcpy (path, "ardourBufferingXXXXXX"); - char* tmplt = (char*)calloc(strlen("ardourXXXXXX"), sizeof(char)); - int fd = mkstemp (tmplt); - if (fd) { + if ((fd = mkstemp (path )) < 0) { cerr << X_("cannot find temporary name for ardour buffer stats") << endl; return; } + + fout.open (path); + close (fd); - FILE* fout = fdopen (fd, "w"); if (!fout) { - cerr << string_compose (X_("cannot open file %1 for ardour buffer stats"), tmplt) << endl; + cerr << string_compose (X_("cannot open file %1 for ardour buffer stats"), path) << endl; return; } for (list<DiskBufferStat>::iterator i = disk_buffer_stats.begin(); i != disk_buffer_stats.end(); ++i) { - std::ostringstream ss; localtime_r (&(*i).when, &tm); strftime (buf, sizeof (buf), "%T", &tm); - fprintf(fout, "%s %u %u\n", buf, (*i).capture, (*i).playback); + fout << buf << ' ' << (*i).capture << ' ' << (*i).playback << endl; } - + disk_buffer_stats.clear (); - fclose (fout); - close (fd); + fout.close (); - cerr << "Ardour buffering statistics can be found in: " << tmplt << endl; - free (tmplt); + cerr << "Ardour buffering statistics can be found in: " << path << endl; } void |