![]() |
![]() |
![]() |
libdicto Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define DICTO_TYPE #define DICTO (obj) #define DICTO_CLASS (klass) #define IS_DICTO (obj) #define IS_DICTO_CLASS (klass) #define DICTO_GET_CLASS (obj) DictoFormat; Dicto; GType dicto_get_type (void
); Dicto * dicto_new (gchar *basedir
); Dicto * dicto_new_full (gchar *basedir
,DictoFormats f
,gchar *sink
,gchar *source
); gboolean dicto_set_basedir (Dicto *d
,const gchar *basedir
); gboolean dicto_record (Dicto *d
,const gchar *file
); gboolean dicto_play (Dicto *d
,const gchar *file
); gboolean dicto_prepare (Dicto *d
,const gchar *file
); gboolean dicto_stop (Dicto *d
); gboolean dicto_seek (Dicto *d
,gdouble pos
); gboolean dicto_delete (Dicto *d
,const gchar *file
); gboolean dicto_toggle_record (Dicto *d
,const gchar *file
); gchar * dicto_filename_time_new (Dicto *d
,time_t t
); gboolean dicto_refresh_list (Dicto *d
); GHashTable * dicto_notes_get_list (Dicto *d
); gboolean dicto_remove (Dicto *d
,const gchar *file
); gboolean dicto_get_position (Dicto *d
,gdouble *length
,gdouble *position
);
"basedir" gchar* : Read / Write / Construct "current-file" gchar* : Read "format" guint : Read / Write / Construct Only "pos-int" guint : Read / Write "prefix" gchar* : Read / Write / Construct "sink" gchar* : Read / Write / Construct Only "source" gchar* : Read / Write / Construct Only "state" guint : Read "suffix" gchar* : Read / Write / Construct "time-format" gchar* : Read / Write
"error" : Run First "level" : Run First "paused-play" : Run First "playing" : Run First "position" : Run First "ready" : Run First "recording" : Run First "refresh" : Run First "seeked" : Run First "stopped-play" : Run First "stopped-record" : Run First
Dicto is object that simplifies creating audio dictations in applications, it can be combined with DictoWidget to create a simple and automatic UI.
It uses a predefined list of some common formats, suitable for both speech and music.
The object takes care of a list of notes in the given base directory. Signals are emited when playing, recording, stopping, seeking and note list changes.
#define DICTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DICTO_TYPE, DictoClass))
|
#define IS_DICTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DICTO_TYPE))
|
#define DICTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DICTO_TYPE, DictoClass))
|
typedef struct { guint id; const gchar *desc; const gchar *ext; const gchar *filter; const gchar *muxer; const gchar *encoder; const gchar *mime; guint channels; guint rate; guint bits; } DictoFormat;
Dicto * dicto_new (gchar *basedir
);
Creates a new Dicto object ready for use with default format and audio sink/source, determined at ./configure time.
Default for desktop gtk build uses alsasink and alsasrc. Default for hildon 2.2 build uses pulsesink and pulsesrc. Default for hildon 2.0 build uses dsppcmsink and dsppcmsrc.
|
Directory to use for file lists and new recordings |
Returns : |
See dicto_new_full()
|
Dicto * dicto_new_full (gchar *basedir
,DictoFormats f
,gchar *sink
,gchar *source
);
Creates a new Dicto object ready for use.
|
Directory to use for file lists and new recordings |
|
Audio format to use |
|
GstElement audio sink element |
|
GstElement audio source element |
Returns : |
The new Dicto object. |
gboolean dicto_set_basedir (Dicto *d
,const gchar *basedir
);
Set base directory to use to for recordings.
|
A Dicto object. |
|
An absolute UNIX path to notes, it will be created if it does not exists. |
Returns : |
TRUE if new basedir was set. FALSE if basedir is not a directory or if creation failed. |
gboolean dicto_record (Dicto *d
,const gchar *file
);
Records to given file without a limit. Emits "recording" when recording starts.
|
A Dicto object |
|
Destination filename to record to. |
Returns : |
TRUE if recording started, FALSE on error. |
gboolean dicto_play (Dicto *d
,const gchar *file
);
Plays given audio note file. Does nothing if already playing. Clears current note on error.
gboolean dicto_prepare (Dicto *d
,const gchar *file
);
Prepares given file for playback but does not start playback. Use dicto_play()
with same filename to start playback.
Does nothing if we are already playing. Clears current file if error happens.
gboolean dicto_stop (Dicto *d
);
Stop recording or playback. Emits signals "stopped_play" or "stopped_record" if pipelines where stopped.
|
A Dicto object |
Returns : |
TRUE if a pipeline was stopped. |
gboolean dicto_seek (Dicto *d
,gdouble pos
);
Seeks to given position in the current playback note. The note must have been
prepared with dicto_prepare()
or beeing played back by dicto_play()
.
gboolean dicto_delete (Dicto *d
,const gchar *file
);
Simple version of dicto_delete_full
|
A Dicto object |
|
A note to delete, must be an existing note file name |
Returns : |
FALSE on error, TRUE otherwise. |
gboolean dicto_toggle_record (Dicto *d
,const gchar *file
);
Toggles recording: stops if recording, records if stopped.
gchar * dicto_filename_time_new (Dicto *d
,time_t t
);
|
A Dicto object |
|
A unix timestamp, or 0 for current time. |
Returns : |
A string containg a filename with the given or current timestamp using given format or the default "Y -m -d -H -M -S ".
|
gboolean dicto_get_position (Dicto *d
,gdouble *length
,gdouble *position
);
Get the current playback/recording position and stream length. If any of two arguments are null the queries will be skipped.
|
A Dicto object |
|
Pointer to a gdouble, to store length of the currently playing recording, dummy if recording. |
|
Pointer to a gdouble, to store the current position of playing recording or length to current recording. |
Returns : |
TRUE if any of the two queries was ok. |
"basedir"
property"basedir" gchar* : Read / Write / Construct
Base directory to store audio notes in.
Default value: "/tmp"
"format"
property"format" guint : Read / Write / Construct Only
Audio encoding format.
Allowed values: <= 23
Default value: 0
"pos-int"
property"pos-int" guint : Read / Write
Report position this often, in ms.
Allowed values: [50,1000]
Default value: 250
"prefix"
property"prefix" gchar* : Read / Write / Construct
Prefix for audio notes.
Default value: "an-"
"sink"
property"sink" gchar* : Read / Write / Construct Only
gstreamer sink element used for playback.
Default value: "alsasrc"
"source"
property"source" gchar* : Read / Write / Construct Only
gstreamer source element used for recording.
Default value: "alsasink"
"state"
property"state" guint : Read
The current DictoState state of Dicto,
Allowed values: <= 8
Default value: 0
"suffix"
property"suffix" gchar* : Read / Write / Construct
Suffix for audio notes, before file extension.
Default value: ""
"time-format"
property"time-format" gchar* : Read / Write
File timestamp format.
Default value: "%Y-%m-%d-%H-%M-%S"
"error"
signalvoid user_function (Dicto *dicto, gpointer arg1, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"level"
signalvoid user_function (Dicto *dicto, gdouble arg1, gdouble arg2, gdouble arg3, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
|
|
|
|
user data set when the signal handler was connected. |
"paused-play"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"playing"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"position"
signalvoid user_function (Dicto *dicto, gdouble arg1, gdouble arg2, gdouble arg3, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
|
|
|
|
user data set when the signal handler was connected. |
"ready"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"recording"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"refresh"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"seeked"
signalvoid user_function (Dicto *dicto, gdouble arg1, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"stopped-play"
signalvoid user_function (Dicto *dicto, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |