Poweramp close intent

1,753 views
Skip to first unread message

James Watkins

unread,
Oct 2, 2014, 11:25:58 AM10/2/14
to tas...@googlegroups.com
Hey all,
I'm currently working on a task that runs when I disconnect from the bluetooth in my car.  Currently I have it set where when the bluetooth disconnects, it pauses music (Poweramp) and closes Waze and Torque.  Unfortunately when the music pauses, Poweramp remains open and I'd rather the app just close entirely.  My phone is not rooted so I'm using send intent commands with Waze and Torque to close the apps.  Does anyone know the Send Intent action command in order to close Poweramp?

James Watkins

unread,
Oct 2, 2014, 12:23:58 PM10/2/14
to tas...@googlegroups.com
Getting a little bit closer to finding my own answer, I came across a way to toggle play/pause via Tasker intent:

Action: com.maxmpz.audioplayer.API_COMMAND
Cat: None
Extra: cmd:1
Target: Service

I'm experimenting with changing the cmd to different numbers to see what Poweramp will do.  If anyone else has been curious of this I hope my posting this helps.

James Watkins

unread,
Oct 2, 2014, 12:41:31 PM10/2/14
to tas...@googlegroups.com
following the cmd: in the Extra line:  1 Toggles play/pause.  2 Pauses music entirely. 3 No idea what that does.. 4 Advances to next track. 5 Goes back to the beginning of the current track or goes to the previous track. 6 No idea what that does. 7 No idea. 8 Toggles repeat settings. 9 Toggles shuffle settings. 10 Fast forwards. 11 No clue.  12 Fast rewinds.  13 No idea. 14 Either stops playback or closes the app, I couldn't determine which one.  I stopped at 14 since that was what I was wanting in the first place.  I hope this helps someone else out there.

Bob Hansen

unread,
Oct 2, 2014, 2:41:02 PM10/2/14
to tas...@googlegroups.com
PowerAmp cmd:14 is a Stop playing but does not close poweramp

Use cmd:100 to Stop playing and close poweramp

James Watkins

unread,
Oct 2, 2014, 2:43:39 PM10/2/14
to tas...@googlegroups.com
Well that makes it a lot easier than testing them all one by one.  Thanks!

My-kl

unread,
Apr 11, 2016, 5:52:22 PM4/11/16
to Tasker
This is driving me nuts but no matter what music app I use it doesn't do the right thing.

If I use Tasker's media control to send play [simulated], pause, or toggle pause it will skip to the next track and play the first time I tap, then it alternates between skipping to the next track / pausing and skipping to the next track / playing. This means it will only play every other track if I do anything!

If I send an intent to PowerAmp and use cmd:1 it plays two track simultaneously! cmd:2 or cmd:14  don't pause or stop but skip to the next track!

(Galaxy s5 neo, unrooted.)

My-kl

unread,
Apr 12, 2016, 5:51:01 AM4/12/16
to Tasker
Never mind, it's behaving now. It was obviously just in a funny mood.

Rodney Alan

unread,
May 18, 2016, 10:55:25 PM5/18/16
to Tasker

Did you find a way to close Poweramp ? if I use cmd:100 on my S5 it stops play but the app is still front and centre on the screen rather than closed.? sent intent to service.

My-kl

unread,
May 19, 2016, 10:50:21 AM5/19/16
to Tasker
On Thursday, May 19, 2016 at 3:55:25 AM UTC+1, Rodney A wrote:

Did you find a way to close Poweramp ? if I use cmd:100 on my S5 it stops play but the app is still front and centre on the screen rather than closed.? sent intent to service.

Yes, but I don't know why it works. Just using Media Control > Cmd: Stop works for me (S5 Neo, rooted stock).

Steve Waring

unread,
Apr 1, 2020, 6:28:15 PM4/1/20
to Tasker
If you look in https://github.com/maxmpz/powerampapi/blob/master/poweramp_api_lib/src/com/maxmpz/poweramp/player/PowerampAPI.java from about line 25 you will see what all the commands do. Some commands take additional extras. For example command 15 = Seek and you can see that just above it is shown another extra EXTRA_POSITION and this shows where the player should skip to in seconds. If you search for EXTRA_POSITION you will find that the extra to use is "pos". Some commands send back a broadcast intent that Tasker can intercept. Command 16 sends back the current number of seconds into play. You can see just above it that the response is ACTION_TRACK_POS_SYNC. If you search for this, you will see that the intent will be com.maxmpz.audioplayer.TPOS_SYNC and the current play time will come back in an extra called pos.

Putting this all together, to have a task that skips the player forward 15 seconds, you have:
Variable Set
 
Name:%PowerAmpSkip To:15
Send Intent
 
Action:com.maxmpz.audioplayer.API_COMMAND
 
Extra:cmd:16
 
Target:Service

You need a profile to intercept the Event of Intent com.maxmpz.audioplayer.API_COMMAND, it should run this task

Stop
 
If %PowerAmpSkip !Set
Variable Add
 
Name:%pos
 
Value:%PowerAmpSkip
Variable Clear
 
Name:%PowerAmpSkip
Send Intent
 
Action:com.maxmpz.audioplayer.API_COMMAND
 
Extra:cmd:15
 
Extra:pos:%pos
 
Target:Service

You need the test to stop if %PowerAmpSkip is not set, because ANY intent sent to PowerAmp causes it to send the current play position back in a broadcast, so without this you would just endlessly skip forward 15 seconds over and over again.

Logan Fury

unread,
Apr 3, 2020, 8:22:30 PM4/3/20
to Tasker
Have you got a Task of Intents that launches PowerAmp and plays a specified Playlist?

Logan Fury

unread,
Apr 4, 2020, 12:52:50 AM4/4/20
to Tasker
research uncovered this piece of java:

public void playSelectedPlaylist(String playlist_id){

    Intent intent = new Intent(PowerampAPI.ACTION_API_COMMAND);
            intent.putExtra(PowerampAPI.COMMAND, PowerampAPI.Commands.OPEN_TO_PLAY)
                    .setData(PowerampAPI.ROOT_URI.buildUpon()
                    .appendEncodedPath("playlists")
                    .appendEncodedPath(playlist_id)
                    .appendEncodedPath("files")
                    .build());
    Intent explicit_intent = new Intent(createExplicitFromImplicitIntent(getActivity(), intent));
    getActivity().startService(explicit_intent);

anyone know how to format this for Tasker to test?

Steve Waring

unread,
Apr 4, 2020, 12:34:48 PM4/4/20
to Tasker
If you look in the source (see my post just above) you will see that OPEN_TO_PLAY is 20
So you would want an Extra "cmd:20"

The ACTION_API_COMMAND intent is com.maxmpz.audioplayer.API_COMMAND same as in my description just above.

You will need to set the Data field in Tasker, and I'm not sure what to.

Another option might be to open the PowerAmp app with the standard Tasker command and then use the general intent: android.media.action.MEDIA_PLAY_FROM_SEARCH again, see the source file. The comments say it will take keywords such as playlist. There are links to documentation for this in the source. It does say this is the recommended way.

I think you will just have to read the source comments and play around with it.

Steve Waring

unread,
Apr 9, 2020, 12:50:53 PM4/9/20
to Tasker
I've managed to work out an answer for you. Try this:
Send Intent
    Action:android.media.action.MEDIA_PLAY_FROM_SEARCH
    Extra:query:%playlistname
    Package:com.maxmpz.audioplayer
    Target:Activity 

The playlist name should not be encoded, ie use "Good Stuff" rather than "Good+Stuff"


On Saturday, 4 April 2020 05:52:50 UTC+1, Logan Fury wrote:

Logan Fury

unread,
Apr 9, 2020, 1:22:12 PM4/9/20
to Tasker
Hello Steve,

This intent is working to open PowerAmp, find the designated playlist, and start playing the 1st song in the playlist everytime. 

It is a great working intent! Mine is only fully functioning without the % preceding the playlist name however.

with the % present, it opens the playlist to the first song but doesnt actually play. removing the % made the intent start playing as well.

Thank you very much for taking the time to work this out!

Do you think its possible to use an intent to open a playlist and shuffle it instead of playing sequentially?

Thanks again,

Logan

Logan Fury

unread,
Apr 9, 2020, 1:32:31 PM4/9/20
to tas...@googlegroups.com
I've replaced the playlist name with my AutoVoice variable and this now opens any designated playlist :)

    Profile: AV:Poweramp ANY (598)
    Restore: no
    Event: AutoVoice Recognized [ Configuration:Easy Commands: poweramp $artist ]
    Enter: PowerAmp (592)
    A1: Send Intent [ Action:android.media.action.MEDIA_PLAY_FROM_SEARCH Cat:None Mime Type: Data: Extra:query:%artist Extra: Extra: Package:com.maxmpz.audioplayer Class: Target:Activity ] 
   
Woot! 

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/014722ff-868b-4dd8-9d18-5b493e5ef065%40googlegroups.com.

Steve Waring

unread,
Apr 9, 2020, 3:31:36 PM4/9/20
to Tasker
It really is worth looking in  https://github.com/maxmpz/powerampapi/blob/master/poweramp_api_lib/src/com/maxmpz/poweramp/player/PowerampAPI.java  because the comments do give you a lot of info even though it is hard to make out. So, looking in that file we see SHUFFLE = 9
so sending another intent
Send Intent
 
Action:com.maxmpz.audioplayer.API_COMMAND
 
Extra:cmd:9
 Target:Service
should I think turn shuffle mode on. I'm not sure if you could do that before requesting the play list played. If not, you might have to wait for powerAmp to load the Playlist.To do this you could do one of three things.
1) Just use wait in your tasker script.
2) Send the report play position command I showed above and have a profile listen out for the response, again as I showed above.
3) Turn on Scrobbling in PowerAmp and set a profile to pick up the intent issued.
Option 1 would be the simplest.

Logan Fury

unread,
Apr 9, 2020, 8:02:10 PM4/9/20
to tas...@googlegroups.com
Hello

Sorry for delay sleep caught up with me for a while. 

Experimented with this:


    Poweramp Shuffle (635)
    A1: Send Intent [ Action:android.media.action.MEDIA_PLAY_FROM_SEARCH Cat:None Mime Type: Data: Extra:query:%artist Extra: Extra: Package:com.maxmpz.audioplayer Class: Target:Activity ] 
    A2: Wait [ MS:500 Seconds:1 Minutes:0 Hours:0 Days:0 ] 
    A3: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra: Extra: Package: Class: Target:Service ] 
    
First Intent fires perfectly second Intent does not seem to activate. Perhaps it needs more parameters filled? 

I'm have checked out the page you linked but I have no idea how to format the Tasker Intent, as I don't know any coding languages. 

Have you any further ideas please? 

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Logan Fury

unread,
Apr 10, 2020, 1:00:38 PM4/10/20
to Tasker
"
* Uri query parameter - shuffle mode
*/
public static final String PARAM_SHUFFLE = "shf";
/**
* Sent by your app to Poweramp.<br>
* Poweramp Control action.<br>
* Can be sent to {@link #API_RECEIVER_NAME}, {@link #API_ACTIVITY_NAME}, {@link #PLAYER_SERVICE_NAME}<br>
* Starting from Poweramp build-855 this is now also a broadcast intent (which should be the primary target of this action).<br>
* Previously this was executed directly by service and though this is still supported it's deprecated.<br>
* The issue with sending intents to service is foreground processing, which on current Androids 8-10 can't be 100% reliable processed and may cause unexpected ANR errors<br><br>
*
* Extras:<br>
* {@link #COMMAND} - command to execute<br>
* {@link #PACKAGE} - optional - the command issuing plugin/app package name - for the debugging purposes. Poweramp will log appropriate command details if specified<br>
* {@link #SOURCE} - optional - the source of command, e.g. "widget", "UI", etc. - for the debugging purposes<br>
*/
public static final String ACTION_API_COMMAND = "com.maxmpz.audioplayer.API_COMMAND";" Does this mean PARAM_SHUFFLE needs to be present in the code somewhere?


Steve Waring

unread,
Apr 10, 2020, 5:43:01 PM4/10/20
to Tasker
It says that is for a query URI, ie when you are asking if shuffle is on or off. You are not using a URI, it would go in the data section if you were. There are lots of commands you can send. in this case we are interested in:

/**
* Set shuffle mode<br>
* Extras:<br>
* {@code boolean showToast} - (optional) if false, no toast will be shown. Applied for cycle only<br>
* {@code int shuffle} - (optional) if exists, appropriate mode will be directly selected, otherwise modes will be cycled
* @see PowerampAPI.ShuffleMode
*/
public static final int SHUFFLE = 9;

So the second intent is the right one you are sending. The comments suggest that this would cycle through the shuffle modes. An extra called shuffle can be sent to specifically request which mode you want. It's an integer and looking through the comments you see this:

public static final class ShuffleMode {
/**
* No any shuffle selected
*/
public static final int SHUFFLE_NONE = 0;
/**
* All songs global category shuffle
*/
public static final int SHUFFLE_ALL = 1;
/**
* Just songs from current category shuffled
*/
public static final int SHUFFLE_SONGS = 2;
/**
* Categories shuffled, songs in order
*/
public static final int SHUFFLE_CATS = 3;
/**
* Songs shuffled, categories in order
*/
public static final int SHUFFLE_SONGS_AND_CATS = 4;

Now it says if you don't provide this extra, which you didn't, it will cycle through the shuffle modes. You could make yourself a little text task that sent the shuffle command, and run it four times whilst the playlist is playing, to see what happens. It looks like you can provide an additional extra showToast:1 which will pop up a message (like Tasker Flash) to show what the shuffle mode is. If you find one that works, you can use an additional extra shuffle:X where X is the mode you want. It says showToast will be ignored in this case, so take it out. It looks like a shuffle mode of 2 might be what you want.

Logan Fury

unread,
Apr 10, 2020, 6:34:30 PM4/10/20
to tas...@googlegroups.com
I tried adding the extra but this still just opens Poweramp, displaying the correct playlist background but not playing or shuffling any tracks. Track 1 seems queued to play but doesn't start:

    Poweramp Shuffle (635)
    A1: Send Intent [ Action:android.media.action.MEDIA_PLAY_FROM_SEARCH Cat:None Mime Type: Data: Extra:query:%artist Extra: Extra: Package:com.maxmpz.audioplayer Class: Target:Activity ] 
    A2: Wait [ MS:500 Seconds:1 Minutes:0 Hours:0 Days:0 ] 
    A3: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra:shuffle:2 Extra: Package: Class: Target:Service ] 
    

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Steve Waring

unread,
Apr 10, 2020, 7:07:39 PM4/10/20
to Tasker
PLAY = 3;

Send another intent with cmd:3 as the extra. There are lots of commands, they start at line 227 in the file.
You may need to wait for the playlist to load. Once you know the shuffle mode you need, I suspect that if you send that before you send the play command you will get what you want.
To unsubscribe from this group and all its topics, send an email to tas...@googlegroups.com.

Logan Fury

unread,
Apr 10, 2020, 7:13:41 PM4/10/20
to tas...@googlegroups.com
So this will be a third Send Intent in the Task? I have no idea how to format anything other than the extra you specified.

To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/c906d28a-8a11-463f-9a1d-a93056836e67%40googlegroups.com.

Steve Waring

unread,
Apr 11, 2020, 3:37:52 AM4/11/20
to Tasker
Ok, to step back a bit, just so you are sure what's going on. The intents are messages you are sending to PowerAmp.The extras are little bits of information tacked onto the standard message. The first one which works is a general one that any music player should understand. The second one is specifically for PowerAmp and invented by the PowerAmp developer. PowerAmp uses many different intents, and indeed different types of intents. We are only interested in one which is used to send a command to PowerAmp. This takes an extra called cmd which is set to a number. The number for this is shown in the documentation. For example number 1 toggles play/pause mode. There are lots of different commands (numbers) you can send.

So to turn shuffle mode on you send cmd:9. The comments for this show there are two other extras you can include. One called shuffle takes a number, which will set the shuffle mode. If you don't include this second extra, then each time you send the intent, PowerAmp cycles round to the next shuffle mode. The other extra you can include is showToast, set this to 1 to have a toast message pop up to tell you which shuffle mode you have cycled round to. it is ignored if you specify a shuffle mode using the shuffle extra.

So I suggest you set up a little test task that just ends the shuffle command (number 9) and has a second extra showToast:1 Start a play list playing and run the task. If it sets shuffle mode, great you have found the shuffle mode you want. A little toast message should pop up each time you run it. If you go through all the shuffle modes and none do what you want, then tough. Once you know the number you want, you can include the intent in your main task, with extra cmd:9 to change the shuffle mode and a second extra shuffle:x where x is the magic number you have found

To stat the play list playing just send another intent exactly the same as the shuffle intent, but with just one extra cmd:3 which is the compand to play.

You may need to wait between each intent. Put a wait in. If it works take the wait out to see if you need it. I'd actually start with PowerAmp not running just to be sure. If you do need the waits, you can add them back in, or there may be ways that you can be told when PowerAmp is ready. These could be explored later.

Logan Fury

unread,
Apr 11, 2020, 8:02:08 AM4/11/20
to tas...@googlegroups.com
I'm not getting the toast Flash. Can you check my test Task please?

I start with a Task to start a specific playlist without AutoVoice:

    Poweramp Test (493)
    A1: Send Intent [ Action:android.media.action.MEDIA_PLAY_FROM_SEARCH Cat:None Mime Type: Data: Extra:query:rush Extra: Extra: Package:com.maxmpz.audioplayer Class: Target:Activity ] 
   

Then once PowerAmp was launched and playing, I used this to get toast:

    Poweramp Shuffle Test (617)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:shuffle:2 Extra:showToast:1 Extra: Package: Class: Target:Service ] 
   
Did I get the Test Task correctly? 

To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/25150bfc-c8bd-41c7-8e84-e871420b0fde%40googlegroups.com.

Steve Waring

unread,
Apr 11, 2020, 9:58:58 AM4/11/20
to Tasker
No, you need to send a command to tell it what to do with an extra like this:
cmd:x
Where x is the number of the command you want.
Eg 1=toggle play/pause, 2=pause, 3=play etc. They are listed from about line 227. In the list
The comments above each command show what additional extras can be used with each one.
You want
cmd:9
To shuffle. Don't try to code it all yet. Just start a playlist running and just use
cmd:9
showToast:1
Run this task whilst your playlist is playing. If it does not do what you want, run it again. It's cycling through the different shuffle modes.

If you find one that works you can change the intent, replacing showToast:1 with
shuffle:X

You will need to send cmd:3 afterwards to start playing.

Logan Fury

unread,
Apr 11, 2020, 10:13:47 AM4/11/20
to tas...@googlegroups.com
I've edited to:

    Poweramp Shuffle Test (617)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra:showToast:1 Extra: Package: Class: Target:Service ] 
   
Clicked several times after PA was playing and never saw any Toast flashes. Should my category be "None"? 

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Steve Waring

unread,
Apr 11, 2020, 10:32:48 AM4/11/20
to Tasker
I'm not sure exactly how you ask Tasker to pass a boolean value in an intent. Maybe as true or as True. However since the playlist did not go into shuffle mode it is not good. You could try replacing the showToast:1 with shuffle:2 as that is the most likely one. Failing that you might have to settle for just using the play command and forgoing shuffle mode.


There is one other option. Tasker allows you to embed Java code. I could try and see what I can do with that. But I won't have any spare time for weeks. I don't really see how it can do anything that the native tasker send intent can do anyway.

Logan Fury

unread,
Apr 11, 2020, 10:41:30 AM4/11/20
to tas...@googlegroups.com
I appreciate all the help Steve. My edit was unsuccessful however launching Test Task didn't produce any Toast or appear to effect the playing song in any way. I stopped and restarted PA to see if command had been received but it always starts at song one

On Sat, Apr 11, 2020, 7:33 AM 'Steve Waring' via Tasker <tas...@googlegroups.com> wrote:
I'm not sure exactly how you ask Tasker to pass a boolean value in an intent. Maybe as true or as True. However since the playlist did not go into shuffle mode it is not good. You could try replacing the showToast:1 with shuffle:2 as that is the most likely one. Failing that you might have to settle for just using the play command and forgoing shuffle mode.


There is one other option. Tasker allows you to embed Java code. I could try and see what I can do with that. But I won't have any spare time for weeks. I don't really see how it can do anything that the native tasker send intent can do anyway.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Logan Fury

unread,
Apr 11, 2020, 10:26:43 PM4/11/20
to tas...@googlegroups.com
I managed something productive!

I noted that Music Stop works on PlayMusic but not PowerAmp. I searched the github page for instances of "stop" and found command numerals. I used the intent below and it worked perfectly.

I stuck my head outside and peered about but I didn't see any injured animals and the sky hadn't seemed to have flipped upside-down. I think I did this correctly and the universe is OK with it.

Here's the Intent. This just rekindles my hope for a working shuffle Intent:


    Poweramp Stop Test (637)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:14 Extra:STOP:14 Extra: Package: Class: Target:Service ] 

Logan Fury

unread,
Apr 11, 2020, 11:43:20 PM4/11/20
to tas...@googlegroups.com
More Success! And I haven't gotten dizzy, passed out, or fallen over. This is eerie!

Here is WORKING pause and resume Intents! 

    Poweramp Pause (639)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:2 Extra:PAUSE:2 Extra: Package: Class: Target:Service ] 
   
    Poweramp Resume (640)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:3 Extra:RESUME:3 Extra: Package: Class: Target:Service ] 
   

Still experimenting this is exciting :) 

Logan Fury

unread,
Apr 11, 2020, 11:58:41 PM4/11/20
to tas...@googlegroups.com
Here's working start and stop Fast Fwd:

    Poweramp FF Start (641)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:10 Extra:BEGIN_FAST_FORWARD:10 Extra: Package: Class: Target:Service ] 
   

    Poweramp FF Stop (642)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:11 Extra:END_FAST_FORWARD:10 Extra: Package: Class: Target:Service ] 
   
This is absolutely baffling to me. From the last several Intents I posted THIS should logically work:

    Poweramp Shuffle Test (617)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra:SHUFFLE:9 Extra: Package: Class: Target:Service ] 
    

But it does nothing. I can't understand the failure when I seem to have found the pattern 

Logan Fury

unread,
Apr 12, 2020, 12:34:14 AM4/12/20
to Tasker
this shuffle Intent IS doing something!

 Poweramp Shuffle Test (617)
     A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra:SHUFFLE:9 Extra: Package: Class: Target:Service ] 

I started the rush playlist, clicked the shuffle test task, navigated back to PowerAmp and the shuffle icon was now Highlighted! This hadnt been happening earlier but my phone was dangerously low on battery and I guess not functioning perfectly. So now Ive got some juice on the battery, I ran this noted the Shuffle lit up, and advanced the playing song to a second from end. It then ended on its own and the player jumped out of the rush playlist and started playing christmas songs!

So it seems that cmd:9/SHUFFLE:9 produce a Shuffle Category! If I can puzzle this out to Shuffle Current Songlist, then I will have achieved goal!

Will keep updated to anyone following the thread.

Logan

Logan Fury

unread,
Apr 12, 2020, 12:57:22 AM4/12/20
to tas...@googlegroups.com
    Poweramp Shuffle Songs (643)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:9 Extra:SHUFFLE_SONGS:9 Extra: Package: Class: Target:Service ] 
   
This seems to set from shuffle OFF to shuffle songs icon properly but at end of 1st song it's jumping out of the playlist from RUSH to Pink Floyd. It was supposed to randomize the order of the next song in the RUSH playlist.

Gonna email the Poweramp dev and see what he/she has to say about Intents 

Logan

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/Pqo-6J--UKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Message has been deleted

Logan Fury

unread,
Apr 12, 2020, 2:00:00 AM4/12/20
to Tasker
OK on further experimentation, ive figured it out :D :D :D

It turns out that no matter how the SHUFFLE command is used, be it SHUFFLE_SONGS or SHUFFLE_CATEGORIES all the Intent is capable of doing is advancing the player to the next shuffle mode. It turns out that Shuffle Songs equates to Shuffle Playlist (at least on my first three tests) so I use the shuffle intent to go from shuffle off to shuffle all, pause 500 miliseconds, then run the intent again to advance from shuffle all to shuffle songs. Next is cmd:4 to immediately change the first song to the next random song without having to listen to the same first song everytime. it all takes place in 500ms so you barely hear the default first song of playlist :)

ALSO, Ive got rewind and stop rewind working:

    Poweramp Rew Start (645)
    A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:12 Extra:BEGIN_REWIND:12 Extra: Package: Class: Target:Service ] 


       Poweramp Rew Stop (646)
     A1: Send Intent [ Action:com.maxmpz.audioplayer.API_COMMAND Cat:None Mime Type: Data: Extra:cmd:13 Extra:END_REWIND:13 Extra: Package: Class: Target:Service ] 

With play, shuffle play, stop, ff, rew, ff/rew stop and next song, there are enough Intents here to create a Scene with buttons that I dont see obviously apparent on the Poweramp play window.

Even better would be an AutoApp created floating control panel, that would be much cleaner than a scene.

Think I just figured out my next quarantine project!

Viki Malik

unread,
Apr 12, 2020, 5:06:21 AM4/12/20
to tas...@googlegroups.com
Thanks Logan and Steve waring

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/a1a79589-8df5-4e6b-a1a8-3ef1f02b0dd0%40googlegroups.com.

Steve Waring

unread,
Apr 13, 2020, 2:00:37 PM4/13/20
to Tasker
I don't need these additional extras to use play and pause (cmd 2/3). Of course, if you provide additional extras to PowerAmp that it's not looking for, it will just ignore them. You should check because some of the extra's you are using are not needed.

Here is how to avoid hard coding times in waits. It will only work following a command that causes a different track to start playing.
In PowerAmp / Settings / Misc turn on Scrobble via Simple Last.fm
Set up a profile (event) to listen for this Intent:

com.adam.aslfms.notify.playstatechanged

The task for that profile will be fired every time a new track starts playing. There will be variables like %track, %album, %artist etc that describe the current track playing. Google will tell you all of them.
Split your task into two, the commands to run after the track changes in the second task fired by the scrobble intent. You can set a global variable to guide the second task in what to do, for example, don't do anything. You can also enable and disable the profile from your task, but be careful these commands don't take effect until after the current task ends.

You also need to take care because the Intent you are sending to PowerAmp is not saying "Play this playlist xxxx" it is just saying "Play xxxx" so if you have an artist with the same name as your playlist, it's up to Power amp to decide if it should play the songs by the artist, or the playlist, or both. Basically a playlist with the same name as an artist, album, or genre is not a good idea when used with this intent.

To unsubscribe from this group and all its topics, send an email to tas...@googlegroups.com.

Logan Fury

unread,
Apr 13, 2020, 2:37:09 PM4/13/20
to tas...@googlegroups.com
Thanks Steve, i'll strip down the commands.

To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/60243b1b-ecf5-468d-a358-20212e4f138f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages