Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Chris Cannam
On 18 April 2013 23:30, D. Michael McIntyre rosegarden.trumpe...@gmail.com wrote: Yeahbut it's an ID to a member of a container. I read it as take the ID of the first thing in the container, then use an ID one lower than that. It seems random at best, destructive at worst. This code makes my

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Chris Cannam
On 19 April 2013 06:37, Holger Marzen hol...@marzen.de wrote: On Thu, 18 Apr 2013, D. Michael McIntyre wrote: Probably because there are tons and tons of situations in STL and Qt where standard idiom is to iterate through container classes with iterators, and the standard language is for

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread D. Michael McIntyre
On 04/19/2013 04:01 AM, Chris Cannam wrote: Michael's use of instead of != above was probably itself a typo, Aye, it was. for (i = 0; i 10; ++i) for (i = 0; i 10; i++) That was a pleasantly entertaining bit of reading. -- D. Michael McIntyre

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Holger Marzen
On Fri, 19 Apr 2013, Chris Cannam wrote: Note that there is no semantic difference between ++i and i++ in this context either -- not in C++ and not in C. Both of them have the same effect, which is to increment i, even though they return different results -- and in the context of a for loop

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread D. Michael McIntyre
On 04/19/2013 08:40 AM, Holger Marzen wrote: I was sure that it makes a difference inside: If it makes you feel better, brainfarting old man, I wrote this (Thunderbird is mangling the indentation for some reason), and then I flipped it for ++i and compiled it again. Different means to the

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Holger Marzen
On Fri, 19 Apr 2013, D. Michael McIntyre wrote: On 04/19/2013 08:40 AM, Holger Marzen wrote: I was sure that it makes a difference inside: If it makes you feel better, brainfarting old man, I wrote this (Thunderbird is mangling the indentation for some reason), and then I flipped it for

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Holger Marzen
On Fri, 19 Apr 2013, Holger Marzen wrote: So loops don't start with a zero offset. Bug 1358 is an off-by-one bug, so I tried pluginLatency += m_instrumentMixer-getPluginLatency((unsigned int) * connections.begin() - 1); and it looks like the bug has been gone.

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Tim Munro
Holger Marzen schrieb: I added a printf to display (unsigned int) * connections.begin() and it showed always 1 more than the subgroup number, e.g. 2 for subgroup 1, 3 for subgroup 2 and so on. In some contexts number one is the master itself; submaster numbering begins with two. Tim Munro

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-19 Thread Ted Felix
On 04/19/2013 11:28 AM, Holger Marzen wrote: So I'd say that getPluginLatency() and the data structures are ok, but we have an error in connections.begin(). Of course it should be fixed there instead subtracting 1 after its invocation. Unfortunately due to my lack of C++ know how I can't find

[Rosegarden-devel] Subgroups latency compensation off by one

2013-04-18 Thread Holger Marzen
Hi all, I reported bug 1358 some time ago. I browsed sound/JackDriver.cpp and found in line 2087 and 88: pluginLatency += m_instrumentMixer-getPluginLatency((unsigned int) * connections.begin()); I guessed this could be the latency in subgroups. So I browsed around trying to understand

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-18 Thread D. Michael McIntyre
On 04/18/2013 11:41 AM, Holger Marzen wrote: trying to understand the data structures, failing. But I noticed an excessive use of ++j in for-loops instead the C-style j++. Probably because there are tons and tons of situations in STL and Qt where standard idiom is to iterate through container

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-18 Thread Ted Felix
On 04/18/2013 05:35 PM, D. Michael McIntyre wrote: On 04/18/2013 11:41 AM, Holger Marzen wrote: pluginLatency += m_instrumentMixer-getPluginLatency((unsigned int) * connections.begin() - 1); and it looks like the bug has been gone. Nah, trying to start iterating from before

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-18 Thread Ted Felix
On 04/18/2013 06:30 PM, D. Michael McIntyre wrote: I'm only using my C++ for Dummies intuition, not any actual knowledge or skill, but that's what it looks like to me. Yeah, well, I'm not even looking at the code. I'm using the Force. And so far it hasn't revealed the location of that

Re: [Rosegarden-devel] Subgroups latency compensation off by one

2013-04-18 Thread Holger Marzen
On Thu, 18 Apr 2013, D. Michael McIntyre wrote: On 04/18/2013 11:41 AM, Holger Marzen wrote: trying to understand the data structures, failing. But I noticed an excessive use of ++j in for-loops instead the C-style j++. Probably because there are tons and tons of situations in STL and