admin Posted March 29, 2011 Share Posted March 29, 2011 The code is available here: https://github.com/maxmpz/powerampapi Poweramp API Sample App is update to all recent PowerampAPI changes, they are pretty minor, except Album Art: - album art now is not sent as bitmap within Intent - original album art (embed - from track file itself, or cached downloaded album art) is provided via specific Poweramp Content provider This allows hi-res images in apps utilizing PowerampAPI, but may require additional image processing (e.g. scaling / subsampling / etc. ) Link to comment Share on other sites More sharing options...
admin Posted March 29, 2011 Author Share Posted March 29, 2011 poweramp_api_libThis is not a sample, but it's actually the Poweramp API definitions (com.maxmpz.audioplayer.player.PowerampiAPI class), Poweramp content data source definitions (com.maxmpz.audioplayer.data package) and few helper classes. This is android library project, meaning it's included into other samples as a library (ensure it's added as library in Project settings => Android => libraries list). Link to comment Share on other sites More sharing options...
admin Posted March 29, 2011 Author Share Posted March 29, 2011 poweramp_api_exampleThis is sample application utilizing Poweramp API, it consists of 4 activities:MainActivity - provides basic, but pretty complete UI for Poweramp player functionality: - current track info - current track album art - <<<, <<, >, >>, >>> buttons, with long press doing the same actions as in Poweramp (for <<, >, >>) - shuffle/repeat buttons - seekable song progress bar - few buttons which calls various Poweramp actions, like opens Poweramp activities - buttons to open other example activities - simple testing buttons for Poweramp AA Widget functionality[attachment=1]api_example.png[/attachment]EqActivity - provides almost full control over Poweramp equalizer - 10 bands, 2 tone bands, preamp, presets (directly pulled from Poweramp database).[attachment=0]api_example_eq.png[/attachment]FoldersActivity - shows simple ListView of Poweramp folders. Provides example of how Poweramp folders database can be accessed.FilesActivity - shows simple ListView of Poweramp files. Provides example of how Poweramp folders database can be accessed.This project basically demonstrates that's ultimately possible to build complete custom Poweramp UI, but of course, you can utilize just few features from the complete set. Link to comment Share on other sites More sharing options...
admin Posted March 29, 2011 Author Share Posted March 29, 2011 poweramp_api_lyrics_protoThis is prototype application utilizing Poweramp AA (Album Art) widget functionality. AA Widget is basically sort of app widget in Poweramp Album art area in main player screen. It's possible to display almost everything the app widget developer wants, and get user interaction events back in the app.Poweramp manages multiple AA widgets internally and shows appropriate UI for them - Close button (which remembers it's state), and selectable icons to switch between AA widgets.Example use of AA widgets are providing song lyrics, song extended information (e.g. pulled from internet), artist/album info, etc.[attachment=0]api_example_lyr.png[/attachment] Link to comment Share on other sites More sharing options...
horatzica Posted April 5, 2011 Share Posted April 5, 2011 Congrats, Very nice!I've been expecting this for a while, now I can share my current tracks with my friends over Twitter or Facebook with Seesmic. Last night I used the Poweramp API in a simple app to expose the current track info for a simple sharing Intent. Link to comment Share on other sites More sharing options...
Rang3r Posted April 6, 2011 Share Posted April 6, 2011 Как добавить API в Eclupse? Что-то не получается. (Надеюсь то что я написал на русском не станет проблемой, ибо для русскоговорящих всего один маленький раздел) Link to comment Share on other sites More sharing options...
admin Posted April 6, 2011 Author Share Posted April 6, 2011 Rang3rFile => Import => Existing Project into Workspace =>добавить poweramp_api_lib, poweramp_api_example, poweamp_api_lyrics_proto. Link to comment Share on other sites More sharing options...
Rang3r Posted April 6, 2011 Share Posted April 6, 2011 maxmpz, спасибо, только виджетпаку всё равно что-то не хватает. Конкретно жалуется на отсутствие этих библиотек. Link to comment Share on other sites More sharing options...
admin Posted April 7, 2011 Author Share Posted April 7, 2011 Правой кнопкой на проекте виджетпака => Properties => Android => Library - Add..=> poweramp_api_lib Link to comment Share on other sites More sharing options...
Rang3r Posted April 7, 2011 Share Posted April 7, 2011 Вот вроде всё сделал как Вы сказали, но опять проблема.. правда только в одном файле теперь. Link to comment Share on other sites More sharing options...
admin Posted April 7, 2011 Author Share Posted April 7, 2011 Попробуйте выбрать в настройках проекта другой Target SDK. Link to comment Share on other sites More sharing options...
Rang3r Posted April 7, 2011 Share Posted April 7, 2011 Моя невнимательность.. а надо было всего-то обновить версию плагина для Eclipse. Link to comment Share on other sites More sharing options...
inagy Posted April 9, 2011 Share Posted April 9, 2011 Thank you for the API. Link to comment Share on other sites More sharing options...
Soaa- Posted April 20, 2011 Share Posted April 20, 2011 Is the API capable of implementing something like ReplayGain? I'd like to give it a go. Link to comment Share on other sites More sharing options...
localh0st Posted May 10, 2011 Share Posted May 10, 2011 I have been using this method (/system/usr/keylayouts/curcial-oj.kl):key 272 MEDIA_PLAY_PAUSE WAKE_DROPPEDto play/pause Poweramp by trackpad on Froyo (desire) while screen was locked. I just updated ROM to Gingerbread and the command above doesn't work with Poweramp anymore. Is there another "MEDIA_PLAY_PAUSE" for PA? Link to comment Share on other sites More sharing options...
DulcetTone Posted May 11, 2011 Share Posted May 11, 2011 I have an app that works with many apps that all rely on the Android MediaStore. I see Poweramp supports that in addition to a more flexible storage model, but I want to start with the MediaStore support.I had database IDs for songs, artists, albums and playlists as longs.How do I prompt Poweramp to play a song (say) from the external SD card with a given database ID?I tried this, and get nothing to happen and Poweramp does not indicate anything in the logfile: protected void _playSong(Song song) { Uri uri = Uri.withAppendedPath( song.isInternal() ? MediaStore.Audio.Media.INTERNAL_CONTENT_URI : MediaStore.Audio.Media.EXTERNAL_CONTENT_URI , "" + song.mDatabaseId ); startService(new Intent(PowerAMPiAPI.ACTION_API_COMMAND) .putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.OPEN_TO_PLAY) .setData(uri) ); } Link to comment Share on other sites More sharing options...
DulcetTone Posted May 11, 2011 Share Posted May 11, 2011 I had added the library project asProject properties->Build Path->Project and was able to compile my code and run it (though it was not working fully). I went back and read your instructions that This is android library project, meaning it's included into other samples as a library (ensure it's added as library in Project settings => Android => libraries list).But this path of options does not appear to exist, or some detail is missingCan you please write out exactly where these options live in Eclipse?tone Link to comment Share on other sites More sharing options...
admin Posted May 12, 2011 Author Share Posted May 12, 2011 localh0st PowerAMP still processes headset MEDIA_* events as usual. Make sure no other apps intercepting/cancelling these messages before PowerAMP.1. Please check comments in PowerAMPiAPI.java for OPEN_TO_PLAY command (around line 94).startService(new Intent(PowerAMPiAPI.ACTION_API_COMMAND).putExtra(PowerAMPiAPI.COMMAND, PowerAMPiAPI.Commands.OPEN_TO_PLAY) .setData(Uri.parse("content://com.maxmpz.audioplayer/ALL/" + id)));The code above will force PowerAMP to play file from All Files list, by song id. You can also force to play it from other lists.Note that PowerAMP can play only from "external" storage.ALL/ARTIST/ALBUM/ARTIST_ALBUM/GENRE_ALBUM categories are library categories - media store ids are expected.FOLDER is special category - own ids namespace is used.2. This setting looks this way (right click on project => Properties).Of course you should have the poweramp_api_lib project first imported into Eclipse workspace.Thanks! Link to comment Share on other sites More sharing options...
localh0st Posted May 14, 2011 Share Posted May 14, 2011 localh0st Poweramp still processes headset MEDIA_* events as usual. Make sure no other apps intercepting/cancelling these messages before Poweramp.Thank you for your reply. The stock music player (Sense UI) had respond first for the trackpad action. I had only to enable in PA Settings > Headset Options > Respond to Headset Buttons to make it working again on GB ROM. Link to comment Share on other sites More sharing options...
dclause1 Posted May 25, 2011 Share Posted May 25, 2011 Hey thanks for the API. I am having a problem with the seek option -- instead of going to the selected spot in the song, the song starts over. This also happens when using the API test file you provided.Can you please let me know what I'm doing wrong? Link to comment Share on other sites More sharing options...
admin Posted June 1, 2011 Author Share Posted June 1, 2011 Thanks for the report - I need to update the test app.PowerAMP now uses milliseconds everywhere, previously API accepted seconds for seeking, so please multiply your seek values by 1000. Link to comment Share on other sites More sharing options...
binarytoys Posted November 1, 2011 Share Posted November 1, 2011 Уважаемый администратор, в МакОс все аттачи и картинки представлены просто в виде текстовых тегов - проверял в Сафари и Хроме. Как еще можно закачать СДК? Link to comment Share on other sites More sharing options...
Roman Posted November 14, 2011 Share Posted November 14, 2011 Уважаемый администратор, в МакОс все аттачи и картинки представлены просто в виде текстовых тегов - проверял в Сафари и Хроме. Как еще можно закачать СДК?Видимо, после смены форума ссылки не починили. Вот сдк.Ищется обновление под вторую версию плеера, т.к текущий работает не совсем корректно. Link to comment Share on other sites More sharing options...
binarytoys Posted November 15, 2011 Share Posted November 15, 2011 Видимо, после смены форума ссылки не починили. Вот сдк.Ищется обновление под вторую версию плеера, т.к текущий работает не совсем корректно.Большое спасибо, Роман! Link to comment Share on other sites More sharing options...
lukakama Posted November 16, 2011 Share Posted November 16, 2011 Hi,I just noted that from version 2.0, the OPEN_TO_PLAY API command doesn't works any more (it is like the intent-filter has been changed in Poweramp 2.0, as the intent isn't resolved by PackageManager.resolveService(...) ).There are some changes needed to use the OPEN_TO_PLAY API command in Poweramp 2.0?I ask this because my app is used by users to select a song, an artist, an album or a playlist to play, and than it launch Poweramp with what the user selected, and this upgrade simply broke my app integration.Thank,Luca.PS: Sorry for my bad english. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now