![]() |
![]() |
![]() |
libdicto Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#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; struct dicto; typedef 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
);
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 { gint 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. |