• Announcements

    • andrewilley

      Poweramp v3 Project Update   03/22/2017

      As you may be aware, the Poweramp developer has been working hard on an updated material design user interface for Poweramp v3 which required a full ground-up rebuild of the code. It's not quite ready for open testing yet, and although he would like to be able to get it out by the end of the March it may just drop over into April. See forum thread for more details and to discuss.    
admin

Poweramp API Lib and Sample Applications [updated 06 March 2014]

41 posts in this topic

The code is available here: https://github.com/maxmpz/powerampapi

Changes:- PowerampAPI and Sample app updated with Scanner API support. This is supported by Poweramp build 551+.- Updated reference resources to match build 550+v. 1.2- now available on Github- package name is now com.maxmpz.poweramp- added Widgetpack base classesv. 1.1- fixed few seekbar issuesv. 1.0- initial release

Share this post


Link to post
Share on other sites

poweramp_api_lib

This 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).

Share this post


Link to post
Share on other sites

poweramp_api_example

This 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.

Share this post


Link to post
Share on other sites

poweramp_api_lyrics_proto

This 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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Как добавить API в Eclupse? Что-то не получается. (Надеюсь то что я написал на русском не станет проблемой, ибо для русскоговорящих всего один маленький раздел)

Share this post


Link to post
Share on other sites

Rang3r

File => Import => Existing Project into Workspace =>

добавить poweramp_api_lib, poweramp_api_example, poweamp_api_lyrics_proto.

Share this post


Link to post
Share on other sites

maxmpz, спасибо, только виджетпаку всё равно что-то не хватает. Конкретно жалуется на отсутствие этих библиотек.

Share this post


Link to post
Share on other sites

Правой кнопкой на проекте виджетпака => Properties => Android => Library - Add..=> poweramp_api_lib

Share this post


Link to post
Share on other sites

Вот вроде всё сделал как Вы сказали, но опять проблема.. правда только в одном файле теперь.

Share this post


Link to post
Share on other sites

Попробуйте выбрать в настройках проекта другой Target SDK.

Share this post


Link to post
Share on other sites

Моя невнимательность.. а надо было всего-то обновить версию плагина для Eclipse.

Share this post


Link to post
Share on other sites

Is the API capable of implementing something like ReplayGain? I'd like to give it a go.

Share this post


Link to post
Share on other sites

I have been using this method (/system/usr/keylayouts/curcial-oj.kl):

key 272   MEDIA_PLAY_PAUSE WAKE_DROPPED

to 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?

Share this post


Link to post
Share on other sites

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)

);

}

Share this post


Link to post
Share on other sites

I had added the library project as

Project 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 missing

Can you please write out exactly where these options live in Eclipse?

tone

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Уважаемый администратор, в МакОс все аттачи и картинки представлены просто в виде текстовых тегов - проверял в Сафари и Хроме. Как еще можно закачать СДК?

Share this post


Link to post
Share on other sites

Уважаемый администратор, в МакОс все аттачи и картинки представлены просто в виде текстовых тегов - проверял в Сафари и Хроме. Как еще можно закачать СДК?

Видимо, после смены форума ссылки не починили. Вот сдк.

Ищется обновление под вторую версию плеера, т.к текущий работает не совсем корректно.

Share this post


Link to post
Share on other sites

Видимо, после смены форума ссылки не починили. Вот сдк.

Ищется обновление под вторую версию плеера, т.к текущий работает не совсем корректно.

Большое спасибо, Роман!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now