-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split channels: overlay param now properly displays a single canvas #2167
Conversation
Thanks! I am slightly frustrated that the split channel option is adding all these 'workarounds' and conditionals to MultiCanvas, and cluttering the API. This is not an issue to solve in this PR but something to think about.. So, I'll let others review this PR first. |
@thijstriemstra I see what you mean. It sure did feel like a work around when adding the conditional statement. However, I was doing it based on previous conditionals within the prepareDraw method. Just for thought. It looks like the split channel interacts with: filteredChannels What if there are separate methods to that specifically handle these logics based on the option params? Doing so would allow for the prepareDraw method to be less conditional, keeping each action contained within it’s own method but still handling the correct output based on option params. So having a class for channels and then each channel can have its own prototype inheritance channel.isFiltered() Additionally, splitChannelOptions feels unnecessary in my opinion. splitChannels could be a Boolean || String = ‘overlay’ These are subjective opinions since I am new to wavesurfer and audio handling altogether but might help clean up options and the MultiCanvas API as you pointed out. |
Thanks for the feedback. What about adding an additional subclass of |
@thijstriemstra I'm trying to test this but when i run
|
You're using |
I wiped node_modules and installed everything again and it gave me 5.17 again. I'll try again later... The PR is 1 line so I trust that if John says it works then it works 😃 the code looks good to me. |
I think the issue with the subclass just for split channels might be too much because it would need to be instantiated from the original prepareDraw of multicanvas ? I would vote to favor a ChannelClass where it has its own logic that can clean up the original prepareDraw. Keeping channel conditionals and logic specifically with a channel. I’ll take a look a little deeper later, I was just throwing out some ideas arbitrarily without looking at the entire code base |
Haven't looked into specifics yet.
Can you elaborate, maybe some pseudo-code example? |
Build works fine it's probably just a problem on my end, I'll clone everything again later, didnt mean to derail your PR with that |
Please open a new ticket, I'm not able to run it either, something with an ipv6 address..
|
Ah ok. Well it runs for me using @thijstriemstra in regards to the IPV6 that serving from there should work for Just change the path.resolve to:
|
@johnpaulmedina thanks for the feedback, please open a separate pr for that fix if you can. |
@thijstriemstra So I had opened a separate PR, however the forked repo was originally just for the bug fix so I had pushed on the master branch. Since I had opened this PR essentially my master branch already contains the above changes and since we had already discussed the webpack issue here - I closed the other PR #2172 and and pushed here. Sorry if that messes up your flow. [EDIT] - I'll do it the right way. Then get back to my regular work. |
This reverts commit c13e8bc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, can you also add a changelog entry (with reference to #2161)?
All set |
Can we get this merged in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks.
…atspaugh#2167) * Correct bug issue with overlay: true and offsetY still using drawIndex height offset * Lint corrections * Ensure that this.params.splitChannelsOptions && overlay * Updated changelog for katspaugh#2161
fixes #2161
When setting overlay: true on split channels the height of the waveform becomes equal to a single channel height but does not overlay the second channel.
The issue is that the offsetY value is set based on height multiplied by the drawIndex or default to zero. In this case we should check for the splitChannelOptions.overlay and set the offsetY to zero regardless of the drawIndex.