mykl
New Member
Posts: 2
|
Post by mykl on Apr 11, 2016 16:04:13 GMT -5
I've spent ages searching and can't find anything that works. Can someone please tell me what Intents I can use in Tasker to play, pause, skip forward and skip backward? And also what other information I need to fill in the 'extra', 'package', 'target', etc. boxes. I've only just started looking at Intents and I'm a bit lost at the moment.
|
|
|
Post by GoneMAD on Apr 12, 2016 21:42:14 GMT -5
|
|
mykl
New Member
Posts: 2
|
Post by mykl on Apr 13, 2016 16:35:18 GMT -5
That's not what I'm looking for. I don't want to use Media Control (it doesn't work very well). I want to send and receive intents.
|
|
|
Post by GoneMAD on Apr 14, 2016 18:48:49 GMT -5
gmmp does not have any official support for that. The only tasker support is the population of some variables like %MTRACK %MALBUM %MARTIST and %MPLAYSTATE
here are the intents tho
public static final String INTENT_PLAYBACK_COMMAND_PLAYPAUSE = "gonemad.gmmp.command.PLAYPAUSE"; public static final String INTENT_PLAYBACK_COMMAND_NEXT = "gonemad.gmmp.command.NEXT"; public static final String INTENT_PLAYBACK_COMMAND_PREV = "gonemad.gmmp.command.PREV"; public static final String INTENT_PLAYBACK_COMMAND_STOP = "gonemad.gmmp.command.STOP"; public static final String INTENT_PLAYBACK_COMMAND_FFWD = "gonemad.gmmp.command.FASTFORWARD"; public static final String INTENT_PLAYBACK_COMMAND_REWIND = "gonemad.gmmp.command.REWIND"; public static final String INTENT_PLAYBACK_COMMAND_PAUSE = "gonemad.gmmp.command.PAUSE"; public static final String INTENT_PLAYBACK_COMMAND_PLAY = "gonemad.gmmp.command.PLAY";
gmmps package is gonemad.gmmp
As for using that info in tasker, i dont use tasker so i cannot help with that
|
|
sdfg
New Member
Posts: 7
|
Post by sdfg on May 15, 2017 13:27:53 GMT -5
For those interested, it's Send Intent -> Action gonemad.gmmp.command.COMMAND, where COMMAND is one of the above.
However, there seems to be a bug somewhere, and I'm not sure where. Even if headset controls are turned off, using the above turns it back on again (although not in the settings).
|
|
|
Post by GoneMAD on May 15, 2017 21:07:07 GMT -5
For those interested, it's Send Intent -> Action gonemad.gmmp.command.COMMAND, where COMMAND is one of the above. However, there seems to be a bug somewhere, and I'm not sure where. Even if headset controls are turned off, using the above turns it back on again (although not in the settings). its not a bug. its not possible to completely disable headset controls.. gmmp blocks media intents that it receives from being processed but there are other ways that the OS can control playback. When an app takes audio focus and creates a media session it defines a callback for standard playback commands that the OS can use for headset controls and controlling playback from things like voice commands or other remote controls. There is no way to distinguish the source of the commands
|
|
sdfg
New Member
Posts: 7
|
Post by sdfg on May 16, 2017 3:25:48 GMT -5
Oh I see, so when audio is playing, the app playing it tells the OS, and the OS transfers any media controls directly to that, irrespective of anything else that is 'listening' for them? Is that what you mean?
If that's the case, given you've already got excellent support for advanced media controls (double click etc), what are the chances of adding 'launch app' and 'launch activity' to the list? That would be a pretty unique selling point from what I've seen. Or even just 'launch tasker task', offload the work.
|
|
|
Post by GoneMAD on May 16, 2017 18:50:47 GMT -5
Oh I see, so when audio is playing, the app playing it tells the OS, and the OS transfers any media controls directly to that, irrespective of anything else that is 'listening' for them? Is that what you mean? If that's the case, given you've already got excellent support for advanced media controls (double click etc), what are the chances of adding 'launch app' and 'launch activity' to the list? That would be a pretty unique selling point from what I've seen. Or even just 'launch tasker task', offload the work. Yeah thats basically what it does. The app with audio focus gets routed the media controls. Its something somewhat newer they added around android 5.0 or so. You should be able to launch any app with tasker (its how the OS launches an app. should be able to google how to do it fairly easily). The main activity is gonemad.gmmp.activities.MainActivity (i think thats it.. my internal build has things moved around for my work on 3.0) here is the full list of intents since whats posted above was a bit older public static final String INTENT_PLAYBACK_COMMAND_PLAYPAUSE = "gonemad.gmmp.command.PLAYPAUSE"; public static final String INTENT_PLAYBACK_COMMAND_NEXT = "gonemad.gmmp.command.NEXT"; public static final String INTENT_PLAYBACK_COMMAND_PREV = "gonemad.gmmp.command.PREV"; public static final String INTENT_PLAYBACK_COMMAND_STOP = "gonemad.gmmp.command.STOP"; public static final String INTENT_PLAYBACK_COMMAND_EXIT = "gonemad.gmmp.command.EXIT"; public static final String INTENT_PLAYBACK_COMMAND_FFWD = "gonemad.gmmp.command.FASTFORWARD"; public static final String INTENT_PLAYBACK_COMMAND_REWIND = "gonemad.gmmp.command.REWIND"; public static final String INTENT_PLAYBACK_COMMAND_PAUSE = "gonemad.gmmp.command.PAUSE"; public static final String INTENT_PLAYBACK_COMMAND_PLAY = "gonemad.gmmp.command.PLAY"; public static final String INTENT_PLAYBACK_COMMAND_NEXT_ALBUM = "gonemad.gmmp.command.NEXT_ALBUM"; public static final String INTENT_PLAYBACK_COMMAND_PREV_ALBUM = "gonemad.gmmp.command.PREV_ALBUM"; public static final String INTENT_PLAYBACK_COMMAND_NEXT_FOLDER = "gonemad.gmmp.command.NEXT_FOLDER"; public static final String INTENT_PLAYBACK_COMMAND_PREV_FOLDER = "gonemad.gmmp.command.PREV_FOLDER"; public static final String INTENT_PLAYBACK_COMMAND_NEXT_ALBUM_BY_ARTIST = "gonemad.gmmp.command.NEXT_ALBUM_BY_ARTIST"; public static final String INTENT_PLAYBACK_COMMAND_PREV_ALBUM_BY_ARTIST = "gonemad.gmmp.command.PREV_ALBUM_BY_ARTIST"; public static final String INTENT_PLAYBACK_COMMAND_RANDOM_ALBUM = "gonemad.gmmp.command.RANDOM_ALBUM"; public static final String INTENT_PLAYBACK_COMMAND_RANDOM_TRACK = "gonemad.gmmp.command.RANDOM_TRACK"; public static final String INTENT_PLAYBACK_COMMAND_RANDOM_TRACK_FROM_QUEUE = "gonemad.gmmp.command.RANDOM_TRACK_FROM_QUEUE"; public static final String INTENT_PLAYBACK_COMMAND_STOP_AFTER_CURRENT = "gonemad.gmmp.command.STOP_AFTER_CURRENT"; public static final String INTENT_PLAYBACK_COMMAND_TOGGLE_SHUFFLE = "gonemad.gmmp.command.TOGGLE_SHUFFLE"; public static final String INTENT_PLAYBACK_COMMAND_TOGGLE_REPEAT = "gonemad.gmmp.command.TOGGLE_REPEAT";
|
|
sdfg
New Member
Posts: 7
|
Post by sdfg on May 17, 2017 15:09:10 GMT -5
Thanks for the confirmation. I can get tasker to do all those things fine, as long as I don't use any audio player, for the reasons you explained. But if gmmp has the media control focus, if gmmp had a way to call tasker tasks, then it would get round everything nicely. :-)
|
|
|
Post by GoneMAD on May 17, 2017 16:07:37 GMT -5
oh have gmmp call a tasker task? yea i dont see that happening. True tasker support (like via a plugin) is already one of the stretch tasks that who knows if i'll ever get to working.
|
|
|
Post by gorman on Sept 23, 2017 5:56:41 GMT -5
Yesterday I found a way to emulate different sounds profiles according to different output device (headphones, bluetooth, etc.). You need root.
As a shell action, with root privileges:
am force-stop gonemad.gmmp; cp /storage/emulated/0/gonemad.gmmp_preferences_CAR.xml /data/data/gonemad.gmmp/shared_prefs/gonemad.gmmp_preferences.xml
Clearly the "CAR" file is the one you edit with the wanted settings for car use. You can have as many different files as you want, and overwrite them as needed. The force-stop command is needed so that GMMP re-reads its preference file entirely when you launch it.
If you link this to a bluetooth event in the car, you can have the bluetooth preference file overwrite the original one everytime you connect. As an exit task you copy back the original prefs file and you should be set:
am force-stop gonemad.gmmp; cp /storage/emulated/0/gonemad.gmmp_preferences_ORIGINAL.xml /data/data/gonemad.gmmp/shared_prefs/gonemad.gmmp_preferences.xml
|
|
|
Post by GoneMAD on Sept 23, 2017 18:26:04 GMT -5
Yesterday I found a way to emulate different sounds profiles according to different output device (headphones, bluetooth, etc.). You need root. As a shell action, with root privileges: am force-stop gonemad.gmmp; cp /storage/emulated/0/gonemad.gmmp_preferences_CAR.xml /data/data/gonemad.gmmp/shared_prefs/gonemad.gmmp_preferences.xml Clearly the "CAR" file is the one you edit with the wanted settings for car use. You can have as many different files as you want, and overwrite them as needed. The force-stop command is needed so that GMMP re-reads its preference file entirely when you launch it. If you link this to a bluetooth event in the car, you can have the bluetooth preference file overwrite the original one everytime you connect. As an exit task you copy back the original prefs file and you should be set: am force-stop gonemad.gmmp; cp /storage/emulated/0/gonemad.gmmp_preferences_ORIGINAL.xml /data/data/gonemad.gmmp/shared_prefs/gonemad.gmmp_preferences.xml ikf you are talking about swapping out files.. if you just want to just the equalizer.. you can swap out the storage/gmmp/eq_presets/eqstate.eq That is thefile that gets loaded on startup for the equalizer.. although i cannot remember if its actually a text file or binary
|
|
|
Post by gorman on Oct 21, 2017 11:51:13 GMT -5
Unfortunately the equaliser does not include the virtualizer setting. But maybe yours was a generic note for people reading this post.
On a related note, I'm trying to understand where, when and how the current position in the queue is saved.
In the example above, I kill the process and proceed with swapping files. But that apparently messes up saving the queue position.
I've tried stopping playback and waiting 30 seconds before killing gmmp and swapping the prefs but the queue always goes back, when I relaunch gmmp to a fixed position. This until I completely change the queue, when a new, arbitrary position is saved and used for every restart.
How can I solve this? Can I, somehow? Thanks in advance.
|
|
|
Post by GoneMAD on Oct 22, 2017 16:56:45 GMT -5
playback position is stored in the preferences when the play state changes.. so swapping out the preference file will overwrite the saved position
|
|
|
Post by Alextremotion on Jun 20, 2021 18:08:31 GMT -5
Hello. I can't get it to work: gonemad.gmmp.command.PLAY_FILE I don't know if I'm doing it wrong. Could you give me an example please? to see how the file location should go. Note. gonemad.gmmp.command.PLAY and the like if they work.
|
|