[PROPOSAL]: Alarm Clock

Suggestions/requests/ideas for RuneAudio core features and functions

[PROPOSAL]: Alarm Clock

Postby cyber7 » 05 Feb 2015, 14:35

I have a proposal for an alarm-clock. Basically working just like a normal clock:

ENTRY: Once off/Repeatedly.
ENTRY: Start Time. (Mon-Fri)
ENTRY: Playlist.
ENTRY: MAX Volume.
ENTRY: Weekend Start Time.

Function:
Fade "Playlist" from 0 to "MAX Volume" over 10 Minutes starting at "Start Time".

Screens:
SCREEN1: Currently set-screen.
SCREEN2: Settings.

Depending on the amunt of interest, I will have a look at creating this as an add-in.

cheers
cyber7 (aka Aubrey Kloppers; Cape Town; South Africa)
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

Re: [PROPOSAL]: Alarm Clock

Postby ACX » 05 Feb 2015, 16:53

My suggestion for the clock setup on the frontend side is to use this component:
http://weareoutman.github.io/clockpicker/
It's built on Bootstrap and jQuery, and can be perfectly integrated in the RuneUI.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1680
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: [PROPOSAL]: Alarm Clock

Postby JB314 » 09 Feb 2015, 15:01

Hi,
I'm new to RuneAudio, great work by the way, and I've developed an Alarm Clock feature.
The ACX's suggestion is perfect and I'll integrate this time picker in my page !

Currently how it works :
- new "WakeUp" item in the menu
- a new page where you enable/disable globally the alarm feature, then, for each week day, enable/disable the alarm, set start time, set a duration and select a playlist from a drop down list (known bug : playlist name without space...).
- alarms infos stored into a separated file, json format.
- a cron is created from these data
- cron will contains 2 lines per alarm : start and stop
- start @ time: start a shell script which clear the current mpd playlist, load the new playlist and play it.
- stop @ time + duration : start a shell script which stop playing.

I would like to add a "fade-in" mode to this feature, but my volume knob a is motorized knob... need to code some gpio related stuff in order to drive this knob. But I'm looking to something more "transparent" with a alsa driver or something like that. Something which react correctly when we execute standard commands like mpc volume +5...

I'm very new to php and php-fpm and runeUI code, so I'm not sure my code is well designed (used to use C# instead ;) ), so how then can I send the new files to be reviewed ? (I have a github account)

(I've also dev a new "Podcast" entry in the library, where we can add and parse rss podcast (xml) and listen to it, don't know if it's a good feature but, if you want it too I can sent it too, just need to know how ? )
JB314
 
Posts: 8
Joined: 09 Feb 2015, 14:31

Re: [PROPOSAL]: Alarm Clock

Postby ACX » 10 Feb 2015, 01:04

JB314 wrote:I'm very new to php and php-fpm and runeUI code, so I'm not sure my code is well designed (used to use C# instead ;) ), so how then can I send the new files to be reviewed ? (I have a github account)

Hi JB31,
just link here your progress or make a pull request on the "dev" branch (start working from that).
My suggestion is to try to make that as much modular as possible, as a refactor of the entire UI is under development, so it will be easier to port it to the new code when ready.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1680
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: [PROPOSAL]: Alarm Clock

Postby cyber7 » 10 Feb 2015, 08:16

JB314 wrote:Hi,
I'm new to RuneAudio, great work by the way, and I've developed an Alarm Clock feature.
The ACX's suggestion is perfect and I'll integrate this time picker in my page !

Currently how it works :
- new "WakeUp" item in the menu
- a new page where you enable/disable globally the alarm feature, then, for each week day, enable/disable the alarm, set start time, set a ...


Hi JB314
I have also started with the project and would like to see how far you are :) - Please could I get access to your code?

kind regards
cyber7 (aka Aubrey Kloppers; Cape Town; South Africa)
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

Re: [PROPOSAL]: Alarm Clock

Postby JB314 » 12 Feb 2015, 10:33

Hi and thanks for your answers,
I'll probably push the files tonight or tomorrow.

@ACX, could you give me some info about how you imagine "plugins" should work ? (menu items into a separate file ? Separate file for all specific functionality ? avoid adding things into runeaudio.php ? ... )

BTW, I'm currently adding functionality directly on the RPi, but vi is not very "dev friendly", I'm installing a VM with Arch and the cookbook, it will be easier for future dev.
JB314
 
Posts: 8
Joined: 09 Feb 2015, 14:31

Re: [PROPOSAL]: Alarm Clock

Postby cyber7 » 12 Feb 2015, 13:35

Just completed the following alarm plugin. I decided not to go with clockpicker as it does not work that well with SmartPhones.

Function:
* Enable/Disable with the SET ALARM or RESET ALARM options
* Uses Playlists from Webradio
* 2 date functions: MON-FRI or MON-SUN[/list]

I am busy getting all the code into a tar file and will be posting it later this afternoon/tomorrow...

alarm.jpg
alarm.jpg (70.14 KiB) Viewed 2646 times
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

Re: [PROPOSAL]: Alarm Clock

Postby ACX » 12 Feb 2015, 18:24

Good job!
cyber7 wrote: I decided not to go with clockpicker as it does not work that well with SmartPhones.

Test this then:
http://jdewit.github.io/bootstrap-timepicker/
User avatar
ACX
RuneAudio co-founder
 
Posts: 1680
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: [PROPOSAL]: Alarm Clock

Postby JB314 » 22 Feb 2015, 17:24

Here is another version of the Alarm Clock feature, tested on tablet and normally well "bootstraped".

RuneAudio-Wakeup.png
RuneAudio-Wakeup.png (80.9 KiB) Viewed 2570 times


You can download the necessary files here :
RuneAudio-Wakeup.tar.gz
(41.52 KiB) Downloaded 414 times


It contains these following new or modified files :

    /var/www/assets/js/runeui.js : add clockpicker and touchspin initialisation
    /var/www/assets/js/runeui.min.js : same but minified
    /var/www/assets/js/vendor/jquery.clockpicker.min.js : new clockpicker component
    /var/www/assets/js/vendor/jquery.bootstrap-touchspin.min.js : new touchspin component (+ and - for number input)
    /var/www/assets/css/jquery.clockpicker.min.css
    /var/www/assets/css/jquery.bootstrap-touchspin.min.css
    /var/www/command/play : script used for starting properly a playlist through cron
    /var/www/command/stop : stop playback through cron
    /var/www/app/wakeup_ctl.php : new controler for handling whole AlarmClock process
    /var/www/app/templates/wakeup.php : template
    /var/www/app/templates/header.php : add .css link
    /var/www/app/templates/footer.php : add .js components

[Edit 23.02.2015] : I just thought I forgot to add a file...
in addition you have to modify the file /var/www/index.php to add a new item in the $controllers array :

Code: Select all
 
$controllers = array(
    'credits',
    'coverart',
...
    'sources',
    'tun',
    'wakeup' // <- this line
);



In order to have it working, be careful you specified a correct timezone in RuneAudio Settings.

Then connect to SSH and start the cron service (it should be already installed):

Code: Select all
systemctl enable cronie
systemctl start cronie


If you don't reboot, you may have to restart the php-fpm service in order to see the new pages :
Code: Select all
systemctl restart php-fpm


Feel free to comment and adapt!
JB314
Last edited by JB314 on 23 Feb 2015, 14:48, edited 2 times in total.
JB314
 
Posts: 8
Joined: 09 Feb 2015, 14:31

Re: [PROPOSAL]: Alarm Clock

Postby dwijtsma » 23 Feb 2015, 08:48

Maybe a little bit of topic, but what are the advantages of cron compared to systemd? I use systemd to make my runeaudio add-on script work after a reboot. I guess there's a reason both exist next to each other...
Audio gear: RuneAudio on Raspberry Pi 2 + Dr. DAC nano, Marantz pm66se, Avalon Avatar
dwijtsma
 
Posts: 51
Joined: 03 Nov 2014, 20:16

support RuneAudio Donate with PayPal

Next

Return to Feature request

Who is online

Users browsing this forum: No registered users and 0 guests