[How To] Tap to Add (Revised)

Tap to add as the default action has been requested for a long time now, myself included, but mainly for accesibilty reasons, especially for my missus who has Multiple Sclerosis (MS), who finds it extremly difficult to use the kebab menu (3 dots) on a mobile device to “add to queue”. Now she can just tap away on her chosen tracks and they just get added to the queue.
Also works very well when you have guests around and they can just tap the track they want and it adds to the bottom of the queue (like a jukebox), instead of cutting a track short and playing their choice. (Teaching drunken guests to use the kebab menu in nigh on impossible)

There maybe more elegant ways to do this, but…what this does is modify the “addplay” action of volumio. So instead of adding and immediately playing, it will simply add to the queue. I have also added a toast message to let you know each track is added.
The only caveat is anything else that uses the “addplay” action Like “play” in the kebab menu and the play symbols while browsing in desktop mode will only add it to the queue and obviously not play immediately.

This modification was done using the current latest version of volumio 3.449 (30-3-2023)
Official Link

I only use local network files stored on my server and have no idea how this interacts with streaming services.
So before messing around BACKUP your SD or use a spare.

To be able to tap and add single tracks only
goto…
General Playback options
Playback mode
set to single
click “Save”

SSH into volumio

Back up the file we are going to modify.

sudo mkdir /home/backup-tta

sudo cp /volumio/app/index.js /home/backup-tta/index.js.orig

If things get messed up you can retore the original file

cp /home/backup-tta/index.js.orig /volumio/app/index.js

reboot

Modify the file

nano /volumio/app/index.js

find the text below with… Where is (ctrl w)

CoreCommandRouter.prototype.addPlay

Now go down a line and delete all the text pictured in the red box

Then paste in the text below one line at a time (or go to the EDIT for the revised code)

  this.addQueueItems(data)
  this.pushToastMessage('success', this.getI18nString('COMMON.ADD_QUEUE_TITLE'), data.title || data.uri)

So it looks like this

write out (ctrl o) and exit (ctrl x)
reboot and test

If you want to go back and forth between original and modded first back up your modded file

sudo cp /volumio/app/index.js /home/backup-tta/index.js.tta

Now to change between default volumio action or Tap to Add

Default

cp /home/backup-tta/index.js.orig /volumio/app/index.js

reboot

Tap to add

cp /home/backup-tta/index.js.tta /volumio/app/index.js

reboot

I hope this helps someone, as my missus thinks its Just the Job

-----EDIT-----

The original mod works quite well as is, I use it myself. But… The only niggle I have with it… is if the queue finishes and then you tap another track it just gets added to the queue and does not play, you then have to visit the queue scroll to the bottom and tap on it to play.

So what we need is a hybrid of the default Volumio addplay action when the player is in the stopped state and the tap to add whilst its playing.

What this does now…
Volumio in a Stopped state (ie, just booted up or queue finished), tap on a track in your library and it will be added to the bottom of the queue and then play
Volumio Playing, tap on a track in your library and it simply gets added to the bottom of the queue.
Volumio Paused, tap on a track in your library and it simply gets added to the bottom of the queue. un-pause will carry on where it left off.

Pretty much alike to the default way Volumio works other than if a track is selected from the library while Volumio is already playing its will get added to the bottom of the queue.

Only tested with local network libray, no I dea how this interacts with streaming services.
.
.
.

Start above from where you delete all the text in the red box

Now add these lines one at a time ( some of this is the original Volumio code, Just easier in a tut to delete all and enter one at a time, but if you can work out what goes where then…)

var self = this;

var state = this.stateMachine.getState();

if (state.status === 'stop') {

self.addQueueItems(data)

.then(function (e) {

return self.volumioPlay(e.firstItemIndex);

});

}else{

this.addQueueItems(data)

this.pushToastMessage('success', this.getI18nString('COMMON.ADD_QUEUE_TITLE'), data.title || data.uri)

}

so it looks like this

write out (ctrl o) and exit (ctrl x)
reboot and test.

If you want to go back and forth between original and modded first back up your modded file

sudo cp /volumio/app/index.js /home/backup-tta/index.js.tta

Now to change between default volumio action or Tap to Add

Default

cp /home/backup-tta/index.js.orig /volumio/app/index.js

reboot

Tap to add

cp /home/backup-tta/index.js.tta /volumio/app/index.js

reboot

2 Likes

Thanks, this is perfect. I’ll give Volumio another try.

Also works fine with V3.569 Official link

Hi @M1ck, many thanks for sharing this and pointing me to it! Unfortunately I have to admit it does not work for me. I have Volumio version 3 (don’t know the exact version). I proceeded exactly according your manual, did everything twice to be sure. But there is no difference in the behavior of Volumio at all. Checked local collection as well as streaming. Tapping still wipes the queue.

@raphi

Ive set this up a few times now, having the desired effect each time.

You must have missed a part or forgotten to save.

If it is clearing the queue like you say, did you do the very first part that is in the actual options of Volumio ?

General Playback options
Playback mode
set to single

Dont forget to click “Save”

All the best :slight_smile:

Oh my! That’s it, I did not do the first step. Thank you so much! :smiley:

The original mod works quite well as is, I use it myself. But… The only niggle I have with it… is if the queue finishes and then you tap another track it just gets added to the queue and does not play, you then have to visit the queue scroll to the bottom and tap on it to play.

So what we need is a hybrid of the default Volumio addplay action when the player is in the stopped state and the tap to add whilst its playing.

Check the EDIT in the opening post for how.