FORUMS

OnePlus 2 Forums: Discuss Everything About The OP2!

Now that the OnePlus 2 has been officially unveiled and that we have had close-up … more

Intel & Micron Announce “Revolutionary” Storage Tech

Intel & Micron have announced 3D Xpoint technology—”the … more

Google Now Interfaces With Third-Party Messaging Apps

Google has announced that Ok Google voice commands can now be used to send … more

Make Your Lockscreen More Productive With Widgets

Are you running Android Lollipop? Do you miss the ability to add widgets to your lock … more

Tasker/TasGear samples

2,544 posts
Thanks Meter: 594
 
By Brendo, Senior Member on 24th April 2014, 07:08 AM
Post Reply Subscribe to Thread Email Thread
3rd April 2015, 06:07 AM |#131  
Member
Thanks Meter: 16
 
More
Here is my set up for controlling music on the phone from the gear. There is nothing wrong with the default gear app but this set up offers a lot more. It can be modified to control any music player app on the phone but I have it customized to control Poweramp in particular (best android music app by far in my opinion)...giving options to change shuffle and repeat as well as pick out the eq preset you want, and also show the current track info and the option to delete it from a long press. This is all accomplished from a free tasker app plugin on the Play Store called "Actionbox". There is also a paid app called "AutoShare" that I'm sure would work also.
Something else unique with this set up is that I've added a file browser, so that you can browse through the internal and external SD cards and play files directly from there as well as having the option to longpress and delete them.

On the main screen:
-Long press Play to bring up eq preset selection or Swipe Play to refresh track info if for some reason you lose sync with the phone.
-Tap track info to open file browser or Long press to delete current track
-Long press Shuffle or Repeat to reset to off
-Long Press Volume Up or Volume Down to automatically jump to 15 or 0.

In file Browser:
(Browser always opens up to the folder containing the current playing track, you can then explore internal/external SD from there)
-Tap "..." to select parent directory (I've restricted this browser from going into Root folders...there is nothing to play in there and you wouldn't want to delete anything anyways :/ )
-Tap a folder to open it, tap a file to play it, long press a file to delete it (deleting entire folders does not work in this browser)
-any commas in your file names will throw off the file browser because the way it works is to seperate file paths by a comma...so a song with a comma in it will get split in half and either half will return an error if selected.


ON THE PHONE:

PROFILE: Track
Event: Variable Set [ Variable:%MTRACK Value:* ]
Enter Task: Track Changed
A1: Variable Clear [ Name:%POWERAMP]
A2: Action Box [ Configuration:[PowerAMP]
Current Track Info, |, %POWERAMP]]
A3: Wait Until [ Seconds:1] If [ %POWERAMP Set ]
A4: Send Intent [ Action:com.orbonis.gear.tasker.MESSAGE_GEAR Extra:PHONE_POWERAMP: %POWERAMP]


TASK: Poweramp
A1: If [ %G_MUSIC = 21 ]
A2: Variable Split [ Name:%POWERAMP Splitter:| Delete Base: Off]
A3: Delete File [ File:%POWERAMP1]
A4: Array Clear [ Name:%POWERAMP ]
A5: Variable Set [ Name:%G_MUSIC To:19]
A6: End If
A7: Media Control [ Cmd:Previous Simulate Media Button:on ] If [ %G_MUSIC = 18 ]
A8: Media Control [ Cmd:Next Simulate Media Button:on ] If [ %G_MUSIC = 19 ]
A9: Media Volume [ Level:%G_MUSIC ] If [ %G_MUSIC < 16 ]
A10: Media Control [ Cmd:Play [Simulated Only] Simulate Media Button:eek:n ] If [ %G_MUSIC = 16 ]
A11: Media Control [ Cmd:Pause Simulate Media Button:on ] If [ %G_MUSIC = 17 ]
A12: Stop If [ %G_MUSIC < 30 ]
A13: If [ %G_MUSIC > 30 & %G_MUSIC < 40 ]
A14: Action Box [ Configuration:[PowerAMP]
Shuffle OFF ] If [ %G_MUSIC = 31 ]
A15: Action Box [ Configuration:[PowerAMP]
Shuffle All ] If [ %G_MUSIC = 32 ]
A16: Action Box [ Configuration:[PowerAMP]
Shuffle Songs ] If [ %G_MUSIC = 33 ]
A17: Action Box [ Configuration:[PowerAMP]
Shuffle Categories ] If [ %G_MUSIC = 34 ]
A18: Action Box [ Configuration:[PowerAMP]
Shuffle Songs & Categories ] If [ %G_MUSIC = 35 ]
A19: Action Box [ Configuration:[PowerAMP]
Repeat OFF ] If [ %G_MUSIC = 36 ]
A20: Action Box [ Configuration:[PowerAMP]
Repeat List ] If [ %G_MUSIC = 37 ]
A21: Action Box [ Configuration:[PowerAMP]
Repeat Advance List ] If [ %G_MUSIC = 38 ]
A22: Action Box [ Configuration:[PowerAMP]
Repeat Songs ] If [ %G_MUSIC = 39 ]
A23: End If
A24: If [ %G_MUSIC > 40 & %G_MUSIC < 56 ]
A25: Action Box [ Configuration:[PowerAMP]
EQ Preset, Bass Extreme ] If [ %G_MUSIC = 41 ]
A26: Action Box [ Configuration:[PowerAMP]
EQ Preset, Bass Treble ] If [ %G_MUSIC = 42 ]
A27: Action Box [ Configuration:[PowerAMP]
EQ Preset, Treble ] If [ %G_MUSIC = 43 ]
A28: Action Box [ Configuration:[PowerAMP]
EQ Preset, Flat ] If [ %G_MUSIC = 44 ]
A29: Action Box [ Configuration:[PowerAMP]
EQ Preset, Classical ] If [ %G_MUSIC = 45 ]
A30: Action Box [ Configuration:[PowerAMP]
EQ Preset, Dance ] If [ %G_MUSIC = 46 ]
A31: Action Box [ Configuration:[PowerAMP]
EQ Preset, Rock ] If [ %G_MUSIC = 47 ]
A32: Action Box [ Configuration:[PowerAMP]
EQ Preset, Techno ] If [ %G_MUSIC = 48 ]
A33: Action Box [ Configuration:[PowerAMP]
EQ Preset, Phone Speaker ] If [ %G_MUSIC = 49 ]
A34: Action Box [ Configuration:[PowerAMP]
EQ Preset, Live ] If [ %G_MUSIC = 50 ]
A35: Action Box [ Configuration:[PowerAMP]
EQ Preset, Middle ] If [ %G_MUSIC = 51 ]
A36: Action Box [ Configuration:[PowerAMP]
EQ Preset, Pop ] If [ %G_MUSIC = 52 ]
A37: Action Box [ Configuration:[PowerAMP]
EQ Preset, Soft ] If [ %G_MUSIC = 53 ]
A38: Action Box [ Configuration:[PowerAMP]
EQ Preset, Soft Treble ] If [ %G_MUSIC = 54 ]
A39: Action Box [ Configuration:[PowerAMP]
EQ Preset, Soft Bass ] If [ %G_MUSIC = 55 ]
A40: End If

TASK: Gear Updates (Intent Received)
A1: If [ %gear_music Set ]
A2: Variable Set [ Name:%G_MUSIC To:%gear_music]
A3: Perform Task [ Name: Track Changed] IF [%G_MUSIC = 20]
A4: Perform Task [ Name:Poweramp]
A5: End If
A6: If [ %gear_delete Set ]
A7: Delete File [ File:%gear_delete]
A8: Variable Split [ Name:%gear_delete Splitter:/ Delete Base:on ]
A9: Array Pop [ Variable:%gear_delete Position:99 To Var: ]
A10: Variable Join [ Name:%gear_delete Joiner:/ Delete Parts:on ]
A11: Variable Set [ Name:%gear_dir To:%gear_delete ]
A12: End If
A13: If [ %gear_dir Set ]
A14: Variable Set [ Name:%G_DIR To:/%gear_dir]
A15: List Files [ Dir:%G_DIR Match: Use Root:off Variable:%dir Continue Task After Error:on ]
A16: If [ %err = 1 ]
A17: Action Box [ Configuration:[PowerAMP]
Play File, %G_DIR Continue Task After Error: On ]
A18: Stop
A19: End If
A20: Variable Split [ Name:%G_DIR Splitter:/ Delete Base:on ]
A21: Array Pop [ Variable:%G_DIR Position:99 To Var:%folder ]
A22: Variable Join [ Name:%G_DIR Joiner:/ Delete Parts:on ]
A23: Variable Set [ Name:%dirlist To:...,%dir()|/%G_DIR|%folder ]
A24: Send Intent [ Action:com.orbonis.gear.tasker.MESSAGE_GEAR Extra:PHONE_DIRLIST: %dirlist]
A25: End If

ON THE GEAR:

TASK: Poweramp
A1: Vibrate Pattern [ Pattern:0,100 ]
A2: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/play.png ] If [ %PLAY !Set ]
A3: Variable Set [ Name:%EQPRESET To:Bass,Bass_Extreme,Bass&Treble,Classical,Dance,F lat,Phone_Speaker,Rock,Techno,Treble,Live,Middle,S oft_Bass,Soft,Pop ] If [ %EQPRESET !Set ]
A4: Variable Set [ Name:%SHUFFLE To:31 ] If [ %SHUFFLE !Set ]
A5: Variable Set [ Name:%REPEAT To:36 ] If [ %REPEAT !Set ]
A6: Variable Set [ Name:%VOL To:11 ]
A7: Variable Set [ Name:%music To:20]
A8: Variable Set [ Name:%P_POWERAMP To:Loading...]
A9: Show Scene [ Name:Poweramp Display As:Dialog, Dim Behind Heavy Show Exit Button:eek:ff Continue Task Immediately:eek:n ]
A10: Element Visibility [ Scene Name:Poweramp Element Match:Track Set:True ]
A11: Element Visibility [ Scene Name:Poweramp Element Match:Presets Set:False ]
A12: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]

TASK: Phone Updates (intent received)
A1: Variable Set [ Name:%P_POWERAMP To:%phone_poweramp] If [ %phone_poweramp Set ]
A2: If [ %phone_dirlist Set ]
A3: Variable Set [ Name:%P_DIRLIST To:%phone_dirlist]
A4: Variable Split [ Name:%P_DIRLIST Splitter:| Delete Base:on ]
A5: Variable Set [ Name:%P_DIRLIST2 To:/%P_DIRLIST3] If [ %P_DIRLIST2 eq /%G_DIR ]
A6: Variable Search Replace [ Variable:%P_DIRLIST1 Search:%P_DIRLIST2/%P_DIRLIST3 Replace Matches:on Replace With:(leave blank)]
A7: Variable Search Replace [ Variable:%P_DIRLIST1 Search:/%P_DIRLIST3 Replace Matches:on Replace With:(leave blank) ] If [ %P_DIRLIST2 eq /%P_DIRLIST3 ]
A8: End If

GEAR SCENES

Scene: Poweramp
Element: Play_Pause/Image
Content: Image: %PLAY
Events:
CLICK:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: If [ %PLAY eq file:///sdcard/Tasker/poweramp/play.png ]
A3: Variable Set [ Name:%music To:16]
A4: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/pause.png]
A5: Else
A6: Variable Set [ Name:%music To:17]
A7: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/play.png]
A8: End If
A9: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
LONGCLICK:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Element Visibility [ Scene Name:Poweramp Element Match:Track Set:Toggle]
A3: Element Visibility [ Scene Name:Poweramp Element Match:Presets Set:Toggle]
STROKE (Any Direction, Length 40):
A1: Vibrate Pattern [ Pattern:0,40 ]
A2: Variable Set [ Name:%music To:20]
A3: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A4: Variable Set [ Name:%P_POWERAMP To:Loading...]

Element: Previous/Image
Image: file:///sdcard/Tasker/poweramp/previous.png
Events:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Variable Set [ Name:%music To:18 ]
A3: Variable Set [ Name:%P_POWERAMP To:Loading...]
A4: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]

Element: Next/Image
Image: file:///sdcard/Tasker/poweramp/next.png
Events:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Variable Set [ Name:%music To:19 ]
A3: Variable Set [ Name:%P_POWERAMP To:Loading...]
A4: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]


Element: Volup/Image
Image: file:///sdcard/Tasker/poweramp/volup.jpg
CLICK:
A1: If [ %VOL != 15 ]
A2: Variable Add [ Name:%VOL Value:1]
A3: Variable Set [ Name:%music To:%VOL]
A4: Vibrate Pattern [ Pattern:0,50 ]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A6: End If
A7: Variable Set [ Name:%hold To:%PLAY]
A8: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/%VOL.jpg]
A9: Wait [ MS:400 ]
A10: Variable Set [ Name:%PLAY To:%hold]
LONGCLICK:
A1: Variable Set [ Name:%VOL To:15]
A2: Variable Set [ Name:%music To:15]
A3: Vibrate Pattern [ Pattern:0,100,200,100 ]
A4: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A5: Variable Set [ Name:%hold To:%PLAY]
A6: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/%VOL.jpg]
A7: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A8: Variable Set [ Name:%PLAY To:%hold]

Element: Voldown/Image
Image: file:///sdcard/Tasker/poweramp/voldown.jpg
CLICK:
A1: If [ %VOL != 0 ]
A2: Variable Subtract [ Name:%VOL Value:1]
A3: Variable Set [ Name:%music To:%VOL]
A4: Vibrate Pattern [ Pattern:0,50 ]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A6: End If
A7: Variable Set [ Name:%hold To:%PLAY]
A8: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/%VOL.jpg]
A9: Wait [ MS:400]
A10: Variable Set [ Name:%PLAY To:%hold]
LONGCLICK:
A1: Variable Set [ Name:%VOL To:0]
A2: Variable Set [ Name:%music To:0]
A3: Vibrate Pattern [ Pattern:0,100,200,100 ]
A4: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A5: Variable Set [ Name:%hold To:%PLAY]
A6: Variable Set [ Name:%PLAY To:file:///sdcard/Tasker/poweramp/%VOL.jpg]
A7: Wait [ MS:500]
A8: Variable Set [ Name:%PLAY To:%hold ]

Element: Repeat/Image
Image: file:///sdcard/Tasker/poweramp/%REPEAT.png
CLICK:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Variable Add [ Name:%REPEAT Value:1 ]
A3: Variable Set [ Name:%REPEAT To:36 Do ] If [ %REPEAT = 40 ]
A4: Variable Set [ Name:%music To:%REPEAT]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]
LONGCLICK:
A6: Vibrate Pattern [ Pattern:0,100,200,100 ]
A7: Variable Set [ Name:%REPEAT To:36 ]
A8: Variable Set [ Name:%music To:36 ]
A9: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]

Element: Shuffle/Image
Image: file:///sdcard/Tasker/poweramp/%SHUFFLE.png
CLICK:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Variable Add [ Name:%SHUFFLE Value:1]
A3: Variable Set [ Name:%SHUFFLE To:31] If [ %SHUFFLE = 36 ]
A4: Variable Set [ Name:%music To:%SHUFFLE ]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]
LONGCLICK:
A6: Vibrate Pattern [ Pattern:0,100,200,100 ]
A7: Variable Set [ Name:%SHUFFLE To:31]
A8: Variable Set [ Name:%music To:31]
A9: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]

Element: Track/Text
Text: %P_POWERAMP
CLICK:
A1: Variable Set [ Name:%P_POWERAMP To:/storage/extSdCard/Audio/Music/ ] If [ %P_POWERAMP !Set | %P_POWERAMP eq Loading... ]
A2: Vibrate Pattern [ Pattern:0,50 ]
A3: Variable Split [ Name:%P_POWERAMP Splitter:| Delete Base:off ]
A4: Variable Set [ Name:%dir To:%P_POWERAMP1]
A5: Variable Split [ Name:%dir Splitter:/ Delete Base:on ]
A6: Array Pop [ Variable:%dir Position:99]
A7: Variable Join [ Name:%dir Joiner:/ Delete Parts:on ]
A8: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra: GEAR DIR:%dir]
A9: Show Scene [ Name:FileBrowser Display As:Dialog, Dim Behind Heavy Show Exit Button:eek:ff Continue Task Immediately:on ]
A10: Array Clear [ Name:%P_POWERAMP ]
LONGCLICK:
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Menu [ Title:Delete File? Background Image: Layout:IconAndTextMenu Timeout (Seconds):30 Show Over Keyguard:on Items:(2) ]
1.Cancel (default-checked)= Destroy Scene Menu
2.Delete = Variable Set %music to 21
A3: Stop If [ %music != 21 ]
A4: Vibrate Pattern [ Pattern:0,100,50,100 ]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music ]
A6: Variable Set [ Name:%P_POWERAMP To:Loading...]

Element: Presets/Menu
Source: Variable: %EQPRESET
A1: Vibrate Pattern [ Pattern:0,50 ]
A2: Variable Set [ Name:%music To:%tap_index+40 ]
A3: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_MUSIC: %music]
A4: Element Visibility [ Scene Name:Poweramp Element Match:Presets Set:False ]
A5: Element Visibility [ Scene Name:Poweramp Element Match:Track Set:True ]


Scene: FileBrowser
Element: FileBrowser/Menu
Source: Variable: %P_DIRLIST1
Selection Mode: None
Events:
CLICK:
A1: Vibrate Pattern [ Pattern:0,40 ]
A2: Variable Set [ Name:%dir To:%P_DIRLIST2] If [ %tap_index = 1 ]
A3: Variable Set [ Name:%dir To:%P_DIRLIST2/%P_DIRLIST3%tap_label] If [ %tap_index != 1 ]
A4: Variable Set [ Name:%dir To:/%P_DIRLIST3%tap_label] If [ %tap_index != 1 & %P_DIRLIST2 eq /%P_DIRLIST3 ]
A5: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_DIR: %dir]
LONGCLICK:
A1: Vibrate Pattern [ Pattern:0,40 ]
A2: Variable Set[Name:%temp To:%P_DIRLIST2/%P_DIRLIST3%tap_label]
A3: Menu [ Title:Delete File? Background Image: Layout:IconAndTextMenu Timeout (Seconds):31 Show Over Keyguard:on Items:(2) ]
1. Cancel (default-checked) = Destroy Scene Menu
2. Delete = Variable Set %delete to %temp
A4: Stop If [ %delete !~ %temp ]
A5: Vibrate Pattern [ Pattern:0,100,50,100 ]
A6: Send Intent [ Action:com.orbonis.gear.tasker.consumer.MESSAGE_HO ST Extra:GEAR_DELETE: %delete]

Element: Header/Text
Text: %P_DIRLIST2/%P_DIRLIST3
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2015-04-02-11-37-27.png
Views:	94
Size:	45.0 KB
ID:	3242399   Click image for larger version

Name:	Screenshot_2015-04-02-11-37-40.png
Views:	94
Size:	19.1 KB
ID:	3242400   Click image for larger version

Name:	Screenshot_2015-04-02-11-37-54.png
Views:	94
Size:	26.8 KB
ID:	3242401  
Attached Files
File Type: zip tmp_17063-PwrampScenesTasks1660578650.zip - [Click for QR Code] (119.2 KB, 4 views)
Last edited by edwardsc005; 4th April 2015 at 10:08 AM.
 
 
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes