isspace
[ardour.git] / libs / ardour / lv2_plugin.cc
index fa11f7b051227543516357615dc9aaec4117cc1b..9e253a359fb12f9487f1d10e0148e3ebc238f6a5 100644 (file)
@@ -17,6 +17,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <cctype>
 #include <string>
 #include <vector>
 #include <limits>
@@ -237,6 +238,14 @@ log_vprintf(LV2_Log_Handle /*handle*/,
 {
        char* str = NULL;
        const int ret = g_vasprintf(&str, fmt, args);
+       /* strip trailing whitespace */
+       while (strlen (str) > 0 && isspace (str[strlen (str) - 1])) {
+               str[strlen (str) - 1] = '\0';
+       }
+       if (strlen (str) == 0) {
+               return 0;
+       }
+
        if (type == URIMap::instance().urids.log_Error) {
                error << str << endmsg;
        } else if (type == URIMap::instance().urids.log_Warning) {
@@ -2310,7 +2319,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
                                        if (_session.transport_frame() != _next_cycle_start ||
                                            _session.transport_speed() != _next_cycle_speed) {
                                                // Transport has changed, write position at cycle start
-                                               tmap.bbt_time(_session.transport_frame(), bbt);
+                                               bbt = tmap.bbt_at_frame (_session.transport_frame());
                                                write_position(&_impl->forge, _ev_buffers[port_index],
                                                               tmetric, bbt, _session.transport_speed(),
                                                               _session.transport_frame(), 0);