Open tin2tin opened 3 years ago
That's kind of tricky. I can't find how to get information about the active panel/tab. In such way could be possible to execute such drawing code only when on the right tab. As for the picture, I'd delete it after drawing.
I think it would be better to add the waveform previews to the list. So, each of the 10 items in the list would be shown as previews next to the titles of the files.
Actually, why did you create a new draw and attach the draw handler? That can be in the main draw handle and it will update only when dealing with the freesound tab. To make it change only when a new list item is selected it's possible to use the active_list_item.
You're more than welcome to try it out. Having waveform previews is a great help. My original thought was to add the waveform previews, like thumbnails in the UI Simple Template(since all of them from the current search are saved):
Some more code examples: https://meshlogic.github.io/posts/blender/addons/extra-image-list/ https://github.com/schroef/Extra-Image-List https://blender.stackexchange.com/questions/30444/create-an-interface-which-is-similar-to-the-material-list-box/30446#30446
The drawing leaves much to be desired. Ex. it is drawing no matter what tab is selected, and it is flooding the hdd and the image data-blocks with waveform images. I guess there must be some better strategies for adding preview images. Do you know a better way. Or have some ideas to fix the missing bits and pieces?
If you want to try it, it's in this branch: https://github.com/tin2tin/freesound/tree/Preview
I've also added exposure of license.