freesound icon indicating copy to clipboard operation
freesound copied to clipboard

Tried to add preview of freesound thumbnails

Open tin2tin opened this issue 2 years ago • 4 comments

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?

freesound_addon2

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.

tin2tin avatar Nov 06 '21 16:11 tin2tin

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.

iwkse avatar Dec 19 '21 02:12 iwkse

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.

tin2tin avatar Dec 19 '21 04:12 tin2tin

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.

iwkse avatar Dec 19 '21 09:12 iwkse

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): image

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

tin2tin avatar Dec 19 '21 10:12 tin2tin