Version: 2.0-SVN (using Devel) OS: Linux Installed from: Compiled sources Extend the script API in order to allow the access of the image cover Attached 2 (not exactly) patch for the files - scriptengine/MetaTypeExporter.h - scriptengine/MetaTypeExporter.cpp But it's not working !!! Peter can you help us ?? After this, we should be able to write script like this : function hasPicture() { var TrackInfo = Amarok.Engine.currentTrack(); if (TrackInfo.isValid) { var box = new QMessageBox("New Track " + TrackInfo.title + " - " +TrackInfo.artist); box.setIconPixmap(TrackInfo.image); box.show(); } } Which will be super great !! Thanks in advance
Created attachment 29936 [details] (not exactly) patch for the file scriptengine/MetaTypeExporter.h
Created attachment 29937 [details] (not exactly) patch for the file scriptengine/MetaTypeExporter.cpp
Here is a patch, with this, we can access the current cover url using : Amarok.Engine.currentTrack().imageUrl; And we should be able able to change the cover of the current image using Amarok.Engine.currentTrack().imageUrl.setImageUrl("/the/new/url"); Read the cover url worls fine but not writing, can someone have a look ? If we can find a way, it will be a read only parameter :o)
Created attachment 30067 [details] Patch for retrieving cover url from script
Created attachment 30068 [details] Patch for retrieving cover url from script
SVN commit 908640 by seb: Cover art can get/set from the script API. BUG: 179732 M +2 -0 ChangeLog M +13 -0 src/scriptengine/MetaTypeExporter.cpp M +4 -2 src/scriptengine/MetaTypeExporter.h WebSVN link: http://websvn.kde.org/?view=rev&revision=908640
Could someone please remember to update our Wiki with the API information, once 2.1 gets released? Thanks :)
Setting the cover image through Amarok.Engine.currentTrack().imageUrl = "/the/url/image.jpg"; seems to work for some collection types, though the "current track information" widget seems to not update the newly set image (any hints on how to address this?). For setting images also for streamed music, I've had some success changing the "image" method and adding setImage, hasImage methods to meta/stream/Stream_p.h file. If this seems a sensible approach, let me know and I'll post a patch for this as well.