The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)
Nemo/NonGraphicFeedback
(Initial page) |
(Initial page) |
||
Line 17: | Line 17: | ||
# List all events | # List all events | ||
$ grep -e '\[.*\]' /usr/share/ngfd/events.d/* | cut -d: -f2 | $ grep -e '\[.*\]' /usr/share/ngfd/events.d/* | cut -d: -f2 | ||
+ | |||
+ | Basic playback with libngf-qt is as simple as | ||
+ | |||
+ | Ngf::Client *client = new Ngf::Client(this); | ||
+ | client->connect(); | ||
+ | client->play("ringtone"); | ||
+ | client->stop("ringtone"); | ||
== Writing Events == | == Writing Events == |
Latest revision as of 07:48, 26 May 2015
Contents |
[edit] Non Graphic Feedback in Nemo
Non graphic feedback is for example ringtones, notification tones, blinking LED, vibration, etc. effects meant for providing non graphical information to user. One key element for this in Nemo is NGFD, or Non Graphic Feedback Daemon.
[edit] Relevant Components
[edit] Usage
ngfd has D-Bus API for launching NGF Events. So that everyone wouldn't need to implement the API use themselves, two libraries abstracting the API exist, one for C (libngf) and one for Qt/QML (libngf-qt).
Libraries themselves do not contain any way to list available events, but available events on device can be seen by listing /usr/share/ngfd/events.d/ where usually one configuration file matches one event.
# List all events $ grep -e '\[.*\]' /usr/share/ngfd/events.d/* | cut -d: -f2
Basic playback with libngf-qt is as simple as
Ngf::Client *client = new Ngf::Client(this); client->connect(); client->play("ringtone"); client->stop("ringtone");
[edit] Writing Events
TODO
[edit] Testing
Events can be played from command line using ngf-client from libngf.
$ ngf-client simple ngf client > play ringtone PLAY (event=ringtone, event_id=1) > Playing (event_id=1) > stop 1 STOP (event_id=1) > Paused (event_id=1) > Completed (event_id=1)