LamaDiLuce / polaris-opencore

Open Source development for Polaris lightsaber electronic core, Anima EVO RGBW.
https://www.lamadiluce.it
GNU General Public License v3.0
17 stars 21 forks source link

[ENHANCEMENT] base volume setting #62

Closed OnefITA closed 1 year ago

OnefITA commented 2 years ago

will be great (with some gesture or via pc software) to add the possibility to increase or decrease the volume.-

also at "step" let's say MUTE - 30% - 60% - 90% - FULL (1tap - 2tap - 3tap - 4tap - 5tap)

feel free to disregard if not applicable

FarFlyer commented 2 years ago

It's a nice to have feature.

We already have the TAP recognition, so it's not so complicated to implement.

We need to modify the state machine of the audio module. Now after the first TAP it enters the mute state and exits only on disarm.

This can be done from the Automaton template editor.

I can give advices to who wants to try.

jramboz commented 1 year ago

My C++ is rusty, but after looking through the repo I think I could give this a try. I'd be very grateful for any tips and suggestions!

FarFlyer commented 1 year ago

Hello, Feel free to ask if you need help.

You can create a branch and share the link.

Best regards,

Davide Tagliafierro Mechatronics Engineer Mobile: +39 329 067 0099

[from mobile]

Il Sab 5 Nov 2022, 18:19 Jason Ramboz @.***> ha scritto:

My C++ is rusty, but after looking through the repo I think I could give this a try. I'd be very grateful for any tips and suggestions!

— Reply to this email directly, view it on GitHub https://github.com/LamaDiLuce/polaris-opencore/issues/62#issuecomment-1304594356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQREVEEURX25DIGAN5WIGHTWG2JJJANCNFSM5LHHR6PA . You are receiving this because you commented.Message ID: @.***>

jramboz commented 1 year ago

So far, I can see where the calls to enter the MUTE state are, but I can't figure out how it's actually muting the audio. I see CoreAudio::action(ENT_MUTE), but it seems to just beep twice. How is it actually affecting the sound playback?

Edit: Never mind, I think I see it now. Once it enters the MUTE state, the only event it will handle is EVT_DISARM, which sends it back to IDLE. So once it enters MUTE, it never enters any of the other states (ARM, SWING, etc.).

Also, the Automaton Template Editor appears to be offline. Do you know if there's a mirror anywhere?

FarFlyer commented 1 year ago

Unfortunately, the template was hosted by the creator on his own server, but now he is in another country and cannot host it. There are no other mirror. The trick to enter the mute rely on the state machine and the state transitions. With the template editor would have been more easy to understand. You should look to the table on top of the cpp file. Basically, entering the mute state prevents the transitions to other states. The states transitions are also reported in this picture: https://github.com/LamaDiLuce/polaris-opencore/wiki/Automaton#state-machine-flowcharts

Davide Tagliafierro Mechatronics Engineer www.daveamps.it Mobile: +39 329 067 0099

[from mobile]

Il Sab 5 Nov 2022, 22:21 Jason Ramboz @.***> ha scritto:

So far, I can see where the calls to enter the MUTE state are, but I can't figure out how it's actually muting the audio. I see CoreAudio::action(ENT_MUTE), but it seems to just beep twice. How is it actually affecting the sound playback?

Also, the Automaton Template Editor appears to be offline. Do you know if there's a mirror anywhere?

— Reply to this email directly, view it on GitHub https://github.com/LamaDiLuce/polaris-opencore/issues/62#issuecomment-1304644098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQREVEFZRXZQFIHSEFXO3F3WG3FXDANCNFSM5LHHR6PA . You are receiving this because you commented.Message ID: @.***>

jramboz commented 1 year ago

I found the source for the template editor on his GitHub page. I'll host a local copy and continue exploring!

FarFlyer commented 1 year ago

Great! I don't know where to start for hosting it XD

Davide Tagliafierro Mechatronics Engineer www.daveamps.it Mobile: +39 329 067 0099

[from mobile]

Il Sab 5 Nov 2022, 23:34 Jason Ramboz @.***> ha scritto:

I found the source for the template editor on his GitHub page. I'll host a local copy and continue exploring!

— Reply to this email directly, view it on GitHub https://github.com/LamaDiLuce/polaris-opencore/issues/62#issuecomment-1304653849, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQREVEENKLMIKHHRVIPHXZLWG3OI5ANCNFSM5LHHR6PA . You are receiving this because you commented.Message ID: @.***>