Skip to content

Developer documentation

jabbors edited this page Apr 12, 2013 · 20 revisions

Developer documentation for the Kolibre client libraries.

The Kolibre client libraries consist of 6 independent libraries and 1 library utilizing the functions from the other libraries resulting in a client core library which can be used to build a client for playback of accessible media.

libkolibre-narrator

TODO: Describe this component

libkolibre-player

TODO: Describe this component

libkolibre-xmlreader

TODO: Describe this component

libkolibre-amis

TODO: Describe this component

libkolibre-daisyonline

TODO: Describe this component

libkolibre-naviengine

TODO: Describe this component

libkolibre-clientcore

libkolibre-clientcore is a core library for listing accessible media, i.e. digital talking books, from online and offline sources. The library also supports playback, navigation and bookmark management for supported content formats. The library uses voice narration and can thus easily be utilized to create an easy-to-use playback client for visually impaired.

Features

  • Daisy Online compatible client with support for the required operations.
  • Single DO service
  • 100% streaming
  • TODO: identify all features

Classes

This library is built upon the libkolibre-naviengine library which allows us to focus on the logic for fetching and playing content and simultaneously maintain an easy traversable three of content and context menus. Most of the classes in the component either extend a MenuNode or a VirtualMenuNode defined in the naviengine namespace, but it also contain classes for storing user settings and handling commands within this component, (se figure below). The purpose of each class is described in more detail below.

ClientCore (public)

This is the public interface of the component. Everything in this component is controlled via this class.

The public interface contains a few getters and setters which are used to change the default configuration for the object as well as to view the current configuration. There are also getters and setters to control the sleep timer. When the object is configured properly the instance is mostly operated via the pushCommand() or the jumpToXXXXX() operation. These operators do not respond with direct feedback about the outcome of the operation. Instead the user must listen on signals defined in this interface. These signals (callbacks in other terms) inform the user what has changed or what happened in case of an error. Some of these signals are empty and some even contain data. Refer to the doxygen documentation for a more information about the signals and their purpose. One does not have to listen on these signals at all, but when connecting this library to a GUI it is a must.

CommandQueue (private)

This is a thread safe command queue allowing the application the send different types of commands, with or without data, via a general command handler to one or more command handlers. It is a singleton class and visible to all private classes

Navi (private)

This class is an implementation of the semi-abstract NaviEngine class in the naviengine namespace. This class is the core of this component and keeps track of all nodes added to the menu three and sends commands to the correct node.

Settings (private)

This class a utility for storing user settings in a SQLite3 database so that the settings can be remembered between sessions. It is a singleton class and visible to all internal classes that need to store or read settings.

DaisyNavi (private)

This class contains logic for opening and navigating in a Daisy 2.02 publication. It also manages bookmarks for the publications.

DaisyOnlieNode (private)

This class contains logic for communicating with a Daisy Online service. When a session has been established new content on the service is automatically issued and finally a list of issued content is presented for the user. Each content item available from the service is added a DaisyOnlineBookNode child to this node.

DaisyOnlineBookNode (private)

This class contains logic for fetching a list of online content resources via the Daisy Online interface. All other actions in this node is directed via the DaisyNavi class to allow playback to the online book.

TempoNode (private)

This class let the user change playback speed via the context menu.

SleepTimerNode (private)

This class lets the user activate or deactivate the sleep timer via the context menu.

GotoPageNode (private)

This class lets the user jump to a page in a Daisy publication via the context menu.

GotoPercentNode (private)

This class lets the user jump to a specific position given in percentage in a Daisy publication via the context menu.

GotoTimeNode (private)

This class lets the user jump to specific position given in hours, minutes and seconds in a Daisy publication via the context menu.

BookInfoNode (private)

This class presents information about a Daisy publication to the user.

Communication flow

The libkolibre-clientore library is multi-threaded library. The library itself only creates one thread when a ClientCore object is created, but it uses several other threaded libraries which are also initialized during creation. User actions are enters via the ClientCore thread and depending on the type of action it is either handled in the main thread or in the other threads. See the sequence diagrams below how the communication flow for some typical user scenarios.

Clone this wiki locally