Music Controls in Notification Window
My choice of ROM lately has been MIUI but, there are a few features missing from most other ROMs. One of these is music controls in the notification bar. So I set up something similar with Tasker that I quite like. It works using the Alert action and Notification Click contexts.
Task : Play Music
Action : Media>>Media Controls
Choose, toggle pause ( so you can use this same task to pause your music) and check 'simulate media button' You can select an icon for this task.
Create a similar task called
Skip Forward Music that will skip your track. Choose, 'Next' in the drop down menu.
Now you have your
tasks to control the music. Let's work on an interface for them.
Task : Popup MC
Action: Alert>>Popup Task Icons
This will display a pop-up alert that can contain some text and also displays the icons of upto two tasks(above) for you to choose from. You can also set variables like time for which the pop-up flashes.
Text: 'Playback Controls'
Task 1: Play Music
Task 2: Skip Forward Music
This will pop-up the play and skip tasks.
Now set up a
task that will display a permanent music control access in your notification bar.
Task : Music Controls On
Action : Alert>>Notify
In the title field type in what you would like to see in your status bar. In the text field fill in what you would like to see in the notification window. You can select an icon if you want to. Make sure to
check permanent as you don't want the controls to disappear after your first click of the alert.
Since the above notification is permanent, I wanted
a way to clear it when I didn't need the controls. So this a task I set up. More on this later.
Task : Music Controls Off
Action : Alert>>Notify Cancel
In the title enter the same title as the notification alert that we created and will want to cancel. ie. Music Controls On
Next we will setup
a profile and task that displays the music controls when the 'Music Controls On' notification alert is clicked.
Profile Context :
Event>>UI>>Notification Click
This will implement your chosen tasks when a defined notification is clicked.
In the title enter the same title as the notification alert that we created and will click. ie. Music Controls On
Now we will
create a task that will display a pop-up which will give us an option to display the music controls po-up ( Popup MC ) and an option to clear the permanent Music Control On notification.
New Task : Action>>Alert>>Popup Task Icons
Task 1 : Popup MC
Task 2 : Music Controls Off
Now, clicking on the
Popup MC task will bring up our music control pop-up(play and skip) and clicking on
Music Controls Off task will clear the
permanent Music Controls On
alert from the notification bar when we're not using it.
To further advance the control system I wanted to
have them display only when music was playing. I used the following profile.
Profile Context :
Event>>UI>>Notification
Here we can choose the
owner program of the notification. This will activate the profile's tasks only when a notification from the owner program is received. In this case we will choose the
Music app.
The task for this profile will be 'Music Controls On' ie. the task that will display an alert that gives us access to music controls. And we're set!
Controls in action (notice the status bar)
Typed on my phone. Please excuse any errors!