Toggle pause with bluetooth media button - Tasker Tips & Tricks

Hello,
I've got a shiny new media bluetooth button for the car, and of course the first thing I want to do is make it go through tasker so I can get lots of lovely functionality. I've got single press, double press, and long press for the Next and Previous buttons working fine, but I'm having trouble with the Play button. I still want it to toggle the pause, but when I do that (using Media Control: Toggle Pause, Simulate Media Button On), the music player (GMMP in this case) grabs the media control focus, and all the buttons revert to the music player, instead of my wonderful tasker stuff. I've tried setting an exit task with Media Button Events Grab but that doesn't work. I'm not sure if it's possible short of sending an intent - I found a togglepause intent, but I'm not sure how to write it (found from https://stackoverflow.com/questions...of-another-music-player-from-my-code#17286986 ) for tasker, or even if that's the best way of doing it.
Any help appreciated!

If found the intent for GMMP to play/pause, and it works, but the minute it's done, the media controls revert back to GMMP (even though they are set to not to be used).
I tried PowerAmp too (because I found an intent for it), and it will work the first time, but after that the media controls stop responding at all (previous/next/play).
I've even added a new Media Button Events: Grab right after the intent is sent, but it doesn't seem to do it.

Related

Basic issue with Windows Media Player

I recently got an O2 XDA IIi (Alpine) and have fiddled about with it a bit, not gone as far as flashing the ROM or whatever. Havn't even paid for it, so don't really want to totally screw it just yet.
What I have done is transfer some songs to my SD card, and I listen to them whilst travelling to work. I just put WMP on to play, and manually disable the backlight at the moment, but its still possible for buttons or the screen to get pressed.
Simply put, short of getting a full case for it or turning it off (which stops Media Player playback) is there anyway to lock the touchscreen and hard buttons, ie: like the original Nokia Menu > * keylock? I will eventually get a case for it, but right now I've got -zero- money.
I've searched as far as I'm able this evening, and have come up with nada!
I've got a quick fix for this, in that I set my PDA to password-lock at 0 minutes, turn off the backlight manually and then turn it off and on again.
Is there a simpler way to accomplish this?
On your way to work, you could also read the manual whilst listening to the sweet music. Then you would realise that your "solution"is not the best you can find :shock:
Seriously, you can set a hardware button by clicking on Menu>Options in windows media player and set hardware button for whatever you want 8)
That works fine, but it doesn't have any keylock function. The closest is "toggle screen", but that doesn't disable any of the hard buttons (The hangup/pickup, camera, notes, calender, contacts buttons)
Also, it'd be hard to read the manual when I'm cycling to work
I use GSPlayer http://hp.vector.co.jp/authors/VA032810/
It is lot lighter, stable and has better playlist support. It has shut-off screen and buttons lock option that you can assign to a h/w button. Very handy.
Is there an MPEG4 AAC codec/plugin for GS? I've got TCPMP at the moment with the AAC codec from rareware.
Also got a free leather case from work, so it's not too much of a problem now.
Tried ScreenLock? http://www.pocketgear.com/software_detail.asp?id=14621
It's freeware.
I used to have another locking app on my XDA, but lost it when I hard reset, and now I can't remember its name Its icon was a big yellow padlock though, and it let you lock the keys by clicking on the shortcut in the Start menu, and you pressed and held down a combination of keys you set up during the installation process, which would unlock the device again (I chose the top button + the action button, for simplicity's sake).
Previously i used Resco Audio. Because it has automatic screen toggle function, and also, when riding bike or driving, it easy to skip songs by pressing either the camera or recorder button.
But for now i just stick to WMP10 since the volume control is differentiated with the phone's volume control. Unlike Resco Audio, when i try to lower the sound using hard button, the phone volume also lowers at the same time... making me missed my important calls. OTOH, I use SPB pocket plus, and put the screen toggle button on the today's screen. Hope my solution could solve your problem. TQ
Use psShutxp
Do a google search for psshutxp (make sure you get the one for a QVGA screen (NOT VGA)). The site is in Russian, but there's also an English version of the website. It's a free app that simulates the "Log off" screen of Windows XP. When the "Log Off" screen pops up, there's a button (the left one) that says "Light Off". It turns off the screen (not just the backlight) and prevents any "input".
I'm listening to Erasure on WMP using this. It should work for you. It does not disable the hardware buttons (i.e. if you press the contacts button, the Contacts application will be launched (but it will not turn the screen back on)) but I don't see that as a big issue.
Justin

Backlight while playing MP3 music

While playing MP3music, I would like my X1 to turn off (completely) the backlight, to save battery. It could go off automatically (by the timing defined in the Energy configuration), or manually (by pressing the on/off button). However, I have found this weird behaviour:
a- Using Windows Media Player, backlight goes to a "dimmed" state, but it is still on. The display never goes completely off. If I press the on/off button, reproduction is stopped (and the display goes off).
b- Using CorePlayer (my favorite media player), works similar than in Win Media Player. I have tryed all the related configuration options, but didn´t work.
c- Using the Xperia Media Panel (which I hate), while playing music if I press the on/off button, media continues playing, and the display goes completely off, as it should be.
How can I configure Windows Media Player or CorePlayer to turn off backlight, but still continue reproduction (as in the Xperia Panel) ??
Thank you.
paggps said:
While playing MP3music, I would like my X1 to turn off (completely) the backlight, to save battery. It could go off automatically (by the timing defined in the Energy configuration), or manually (by pressing the on/off button). However, I have found this weird behaviour:
a- Using Windows Media Player, backlight goes to a "dimmed" state, but it is still on. The display never goes completely off. If I press the on/off button, reproduction is stopped (and the display goes off).
b- Using CorePlayer (my favorite media player), works similar than in Win Media Player. I have tryed all the related configuration options, but didn´t work.
c- Using the Xperia Media Panel (which I hate), while playing music if I press the on/off button, media continues playing, and the display goes completely off, as it should be.
How can I configure Windows Media Player or CorePlayer to turn off backlight, but still continue reproduction (as in the Xperia Panel) ??
Thank you.
Click to expand...
Click to collapse
A) No Solution
B) No Solution.
C) This is why I use the Media Panel.
You can try Conduit's Pocket Player. It is better than CorePlayer for audio files, the only con is that it doesn't look fancy like the Media Panel. It also supports the functions you mentioned.
Thank you for your answer poetryrocksalot,
It´s incredible that such a simple feature of turning off the backlight to save battery while reproducing music is not available in a product like Core Player, wich has a lot of feedback from users, and has a LOT of configuration options...
I will try also Conduit´s..
It is incredible how unaware many users are of these features being available. WMP is easiest. Check out the options. You can set a key to turn off the display. I recommend long press up or long press down. Another option is to generally assign a hardware key to "Display off" using Spb Pocket Plus or AeButtons. This solves the problem for Coreplayer as well.
if you plugged-in your headphones, then you can turn-off display and hear music
//sorry for my bad english
many players support you making a hardware button asigned to the function
often called toggle screen
which does just what you request know that wmp have it or at least used to last
I used that player
Thank you very much! I have installed AEButtons, as suggested by Firewall, and now not only can turn off the screen, but do a lot of new things!
Now I have had to uninstall AEButtons, because it interacts with PhonEX, which is an improved dialer I use. When I have an incoming call, it seems that PhonEX "unloads" AEButtons...
then do as I told you
in wmp
click menu->options->buttons->toggle screen
assign the key you want to turn off the screen
start playing music and click the assigned button and it turn
off the screen

[Q] Remapping volume keys

Hello, i have a question about one modification... i would like to have volume controls rempaped to following:
Volume up (short press): Volume up
Volume down (short press): Volume down
Volume up (long press): Next song in playlist (HTC Sense player)
Volume down (long press): Previous song in playlist (HTC Sense player)
I imagine there are some applications out there that can handle the short-press and long-press mapping, but the mapping to HTC Sense player might be really really tricky. Pressing up key (on joystick) jumps to next song, pressing down to previous song, but it works only when media player tab is selected... any other tab uses joystick for other purposes. any suggestions for realization are welcome
I would also appreciate mapping shallow press and release of camera button to play/pause, while shallow press followed by deep press would result in launch of camera (as was intended by sony) but that's not too important as i can simply mute the radio player.
The thing is i use this phone as a MP3 player for my car radio, it is far more intuitive to use hardware buttons instead of touchscreen, not to mention safety... I'm used to this keymapping from good old K750i, unfortunately for xperia, other OS, other habbit.

[Q] How to change the music lockscreen button function?

I have my s5 mini for just a month and when I started using it, I was really pleased with the lock screen when playing music. There was a play/pause button and forward and back button. With the forward and back button I could swap between songs. But about 2 weeks ago the function changed and the forward and back buttons are now used to change the volume. This is really disappointing because I can simply change the volume with the hardware volume buttons on my phone, and if I want to go to the next or previous song, instead of just simply doing so from the lock screen I have to unlock my phone and do it there. Is there a way to tweak the settings of music lock screen? I have gone through all the settings and I don't seem to find anything. Please help!
I don't know how to return them back, just to say that I have the last firmware and the buttons are still present and work, so it will probably be related to some setting you made.
Did you make any changes to the music player or something like that?
(btw did you know that by double clicking the play/pause button on headphones you can skip the song also)
Lake292 said:
I don't know how to return them back, just to say that I have the last firmware and the buttons are still present and work, so it will probably be related to some setting you made.
Did you make any changes to the music player or something like that?
(btw did you know that by double clicking the play/pause button on headphones you can skip the song also)
Click to expand...
Click to collapse
Well, I use Rocket Player. It's definitely the best music player I know. And yeah, I know about headphones (with Rocket player I can even go to previous song by clicking two times and go forward by clicking three times) but still I would love to have this function on the lock screen too. I have changed the settings of Rocket Player to fit my personal preferences. But I have never changed the lock screen buttons settings. All I have found there in the settings of Rocket Player is the look of Lockscreen and I have tried all of them, nothing changes the function.

[Project] multi-function (long press) volume buttons

Requirements:
Tasker
AutoInput (paid version)
(tested on Nexus 5x)
I never used the volume controls unless I was listening to music so I decided to get creative with tasker.
I've used this profile for a few weeks now and it works very well, there might be some misinterprets (I've had 2 in total) if the phone is lagging heavily (like when casting and playing a video),
but I only encountered this issue once in a few weeks of use (and I've had problems with tasker and lag on other profiles), anyway your mileage might vary depending on your usage.
It also controls headphone and bluetooth volume.
**What it does**:
Reprograms the volume buttons to have a short press and long press function, depending on if media is playing they have different functions (completely customizable).
By default, if media is playing it will control media volume, if it's a long press (and it's playing) it will launch apps. If nothing is playing it will simply launch apps or whatever you want it to do (so that's 4 functions per "is media playing" state).
This is very useful for portait toggle, flashlight or even notifications pull down for those awkward hand position moments to give a few ideas.
**How it works**:
On button down events, it will check if media is playing (every 1.5s at most, this info is used to determine the button action in later if statements), then it will wait for 1.5s (by default),
if the wait is not intercepted by a button up event (short press) within those 1500ms, it will be registered as a long press.
After this comes a bunch of if statements that use the above information to choose the right action (is media playing, was it a long press?).
I'd suggest taking a look at all the tasks and profiles to see how they work, I also added a profile which disables the custom keys (and re-enables the stock function) when a call is active.
These are the main components of this project to make it work if you want to get creative yourself.
manage = CONTEXT.getSystemService (audio );
%playing = manage.isMusicActive();
Click to expand...
Click to collapse
(credit goes to the internet/google)
and AutoInputs key suppress function and key up/down event profile triggers.
**How to set up**:
Import project, use the suppress task to enable key suppression (this must be done once to disable the stock key functions).
You can then tweak the vol up/down tasks to accommodate your needs.
the first set variable %longpressduration should be pretty obvious
scrolling down to the if statements you can change the actions for each event, it can be anything, even other profiles, I'd say sky's the limit but it's tasker in this case
I don't know if these things get exported, but make sure the button up events have a higher priority than then down events.
Download:
https://drive.google.com/file/d/0Byn3Aaml1wlcRENBMTB0MVFXczA/view?usp=drivesdk
Shebee said:
Requirements:
Tasker
AutoInput (paid version)
(tested on Nexus 5x)
I never used the volume controls unless I was listening to music so I decided to get creative with tasker.
I've used this profile for a few weeks now and it works very well, there might be some misinterprets (I've had 2 in total) if the phone is lagging heavily (like when casting and playing a video),
but I only encountered this issue once in a few weeks of use (and I've had problems with tasker and lag on other profiles), anyway your mileage might vary depending on your usage.
It also controls headphone and bluetooth volume.
**What it does**:
Reprograms the volume buttons to have a short press and long press function, depending on if media is playing they have different functions (completely customizable).
By default, if media is playing it will control media volume, if it's a long press (and it's playing) it will launch apps. If nothing is playing it will simply launch apps or whatever you want it to do (so that's 4 functions per "is media playing" state).
This is very useful for portait toggle, flashlight or even notifications pull down for those awkward hand position moments to give a few ideas.
**How it works**:
On button down events, it will check if media is playing (every 1.5s at most, this info is used to determine the button action in later if statements), then it will wait for 1.5s (by default),
if the wait is not intercepted by a button up event (short press) within those 1500ms, it will be registered as a long press.
After this comes a bunch of if statements that use the above information to choose the right action (is media playing, was it a long press?).
I'd suggest taking a look at all the tasks and profiles to see how they work, I also added a profile which disables the custom keys (and re-enables the stock function) when a call is active.
These are the main components of this project to make it work if you want to get creative yourself.
(credit goes to the internet/google)
and AutoInputs key suppress function and key up/down event profile triggers.
**How to set up**:
Import project, use the suppress task to enable key suppression (this must be done once to disable the stock key functions).
You can then tweak the vol up/down tasks to accommodate your needs.
the first set variable %longpressduration should be pretty obvious
scrolling down to the if statements you can change the actions for each event, it can be anything, even other profiles, I'd say sky's the limit but it's tasker in this case
I don't know if these things get exported, but make sure the button up events have a higher priority than then down events.
Download:
https://drive.google.com/file/d/0Byn3Aaml1wlcOFVFYWZUSC1DWlE/view?usp=drivesdk
Click to expand...
Click to collapse
Nice job.
Another alternative for the same functionality is this
https://play.google.com/store/apps/details?id=com.spazedog.xposed.additionsgb
vickylahkarbytes said:
Nice job.
Another alternative for the same functionality is this
https://play.google.com/store/apps/details?id=com.spazedog.xposed.additionsgb
Click to expand...
Click to collapse
I updated my link, tweaked the settings a bit.
Nice, will definitely check it out since I've got xposed installed! For those that don't, you can give this project a try.
Edit:after trying it out it seems to respond somewhat faster under certain circumstances, but it doesn't allow to check for media playback. So I guess depending on your needs you night want to use one or the other

Categories

Resources