Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr80 mpd as audio player #94

Merged
merged 6 commits into from
Jul 26, 2018
Merged

Pr80 mpd as audio player #94

merged 6 commits into from
Jul 26, 2018

Conversation

Luegengladiator
Copy link
Contributor

Code cleanup if elif -> case
added support of second RFID read.

playlistaddplay and playlistadd added:
        echo $VALUE > $PATHDATA/../shared/audiofolders/playing.txt
code cleanup
Add stop on second rfid-read
cleaned up code 
added playlistcheck on second RFID read
@zxa
Copy link
Contributor

zxa commented Jul 25, 2018

Hi @Luegengladiator
it's quite hard to read code on the mobile phone (side effect of holidays), but i think the "second swipe problem" could be solved a little bit easier. For example we don't have to save the playing status, as we can simply ask mpd. I would do it like that (everything in rfid_trigger_play):
- compare the swiped RFID id with that in "lastID.txt" (i think that's the file name)

  • If they are the same, get the playlist name (=folder name) with "mpc lsplaylists"
  • If it matches with the RFID id (so no playlist change via web app was done), ask mpd for its status.
  • get the name of the loaded playlist
  • compare it with the swiped RFID folder
  • If they match (so it's a second swipe), get the play status
  • act accordingly to the play status

If mpd is playing and it's a second swipe, it would bei a nice feature to have the behaviour configurable with for example "do nothing", "pause" and "play from beginning".

@Luegengladiator
Copy link
Contributor Author

Luegengladiator commented Jul 26, 2018

I'll have a look on that.
Maybe it's not so easy because of side effects by using a different mpd-Client without rfid.
UPDATE:
Thinking about it there can be some trouble using "lastID.txt". LastID is always the last ID read. If you start with ID 1 and use ID 2 for pause/play or ID 3 for "shutdown in 30 minutes" there is no link to the actual playlist in lastID.txt

@MiczFlor
Copy link
Owner

The file ‚latestID.txt‘ is currently also sensitibe to RFID chips changing volume etc. It‘s easy enough though to add to lines writing the ID to a file in ‚settings‘ calles ‚latestRFID‘ and another ‚latestRFIDaudioShortcut‘ or the like.

I am on mobile only at the moment. Shall I merge @Luegengladiator big change anyhow so you can both work from that?

@Luegengladiator
Copy link
Contributor Author

Yes I think settings folder is the better place to save the actual playlist. But thats only a little update on the path. Should I do it before the merge or should we fix it later?

@zxa
Copy link
Contributor

zxa commented Jul 26, 2018

Hi @MiczFlor
I've updated the "second swipe concept". Now there's no need to know the last swiped RFID (so even if you started the playout via web app, the swipe of the matching RFID Souls recognised as second swipe). As i'm not near of any Phoniebox, i can't contribute at the moment.

@Luegengladiator
Copy link
Contributor Author

Hi @zxa
did you also did the code cleanup if elif else -> case?
In that case we can delete the Pull Request

@zxa
Copy link
Contributor

zxa commented Jul 26, 2018

Hi @Luegengladiator

I haven't done anything else than to lie on the beach fantasizing about how i would tackle the problem. ;-)

@MiczFlor MiczFlor merged commit 5cef972 into MiczFlor:pr80-mpd-as-audio-player Jul 26, 2018
@Luegengladiator Luegengladiator deleted the pr80-mpd-as-audio-player branch July 26, 2018 17:56
@MiczFlor
Copy link
Owner

MiczFlor commented Aug 6, 2018

Hi @Luegengladiator
you are not listed as a contributor on the contributors tab. That happened before and because I would like to have a complete list of contributors (credit where credit is due) I asked github why that is. Here is what they said, possibly it helps you to make you appear:

Hey Micz,

It can take up to 24 hours for new contributions to be counted by our system, though it often happens much more quickly than that.

Taking a look at the specific commit that keinkurt authored:

006ecc2

The email address associated with this commit isn't associated with their account. That's why you see the name "Christian Elmer" instead of their username.

They'll need to add this email address to their account in order for the commit to be associated with them & have them show up in the contributors list.

We're happy to walk through it with them directly as well, if you'd like! Feel free to cc them into this thread or have them write in via our contact form:

https://github.com/contact

Best,
Shawna

<<<

@zxa
Copy link
Contributor

zxa commented Aug 6, 2018

Regarding the listing as contributor: isn't that in this case here because that page only counts "Contributions to master, excluding merge commits"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants