Top |
gboolean | fixed-cursor | Read / Write / Construct |
gboolean | follow-cursor | Read / Write / Construct |
gboolean | has-selection | Read |
gint64 | playback-cursor | Write |
int | pps | Write / Construct |
gint64 | selection-end | Read |
gint64 | selection-start | Read |
gboolean | show-ruler | Read / Write / Construct |
void | cursor-changed | Run First |
void | follow-cursor-changed | Run First |
void | load-progress | Run First |
void | play-toggled | Run First |
void | selection-changed | Run First |
void | zoom-in | Run First |
void | zoom-out | Run First |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkScrolledWindow ╰── PtWaveviewer
Displays a waveform and lets the user interact with it: jumping to a position, make selections and so on.
GtkWidget *
pt_waveviewer_new (void
);
Create a new, initially blank waveform viewer widget.
After use gtk_widget_destroy()
it.
Since: 1.5
void pt_waveviewer_load_wave_async (PtWaveviewer *self
,gchar *uri
,GCancellable *cancel
,GAsyncReadyCallback callback
,gpointer user_data
);
Load wave form for the given URI. The initial resolution is set to “pps”. While loading, a “load-progress” signal is emitted. A previous waveform is discarded.
self |
the widget |
|
uri |
the URI of the file |
|
cancel |
a GCancellable or NULL. |
[nullable] |
callback |
a GAsyncReadyCallback to call when the operation is complete. |
[scope async] |
user_data |
user data for callback. |
[closure] |
Since: 2.0
gboolean pt_waveviewer_load_wave_finish (PtWaveviewer *self
,GAsyncResult *result
,GError **error
);
Gives the result of the async load operation. A cancelled operation results in an error, too.
self |
the widget |
|
result |
the GAsyncResult passed to your GAsyncReadyCallback |
|
error |
a pointer to a NULL GError, or NULL. |
[nullable] |
Since: 2.0
void pt_waveviewer_set_follow_cursor (PtWaveviewer *self
,gboolean follow
);
Set follow-cursor option to TRUE or FALSE. See also “follow-cursor”.
Since: 1.5
gboolean
pt_waveviewer_get_follow_cursor (PtWaveviewer *self
);
Get follow-cursor option.
Since: 1.5
struct PtWaveviewer;
The PtWaveviewer contains only private fields and should not be directly accessed.
“fixed-cursor”
property“fixed-cursor” gboolean
If TRUE, in follow-cursor mode the cursor is at a fixed position and the waveform is scrolling. If FALSE the cursor is moving.
If “follow-cursor” is FALSE, this has no effect.
Owner: PtWaveviewer
Flags: Read / Write / Construct
Default value: TRUE
“follow-cursor”
property“follow-cursor” gboolean
If the widget follows the cursor, it scrolls automatically to the cursor’s position. Note that the widget will change this property to FALSE if the user scrolls the widget manually.
Owner: PtWaveviewer
Flags: Read / Write / Construct
Default value: TRUE
“has-selection”
property“has-selection” gboolean
Whether something is selected (TRUE) or not (FALSE).
Owner: PtWaveviewer
Flags: Read
Default value: FALSE
“playback-cursor”
property“playback-cursor” gint64
Current playback position in milliseconds. A value of -1 means an invalid or unknown position that will not be rendered.
Owner: PtWaveviewer
Flags: Write
Allowed values: >= -1
Default value: 0
“pps”
property “pps” int
Current/requested resolution of waveform in pixels per second.
Owner: PtWaveviewer
Flags: Write / Construct
Allowed values: [25,200]
Default value: 100
“selection-end”
property“selection-end” gint64
End time of selection in milliseconds. If it’s equal to the start time, there is no selection. See also “has-selection”.
Owner: PtWaveviewer
Flags: Read
Allowed values: >= 0
Default value: 0
“selection-start”
property“selection-start” gint64
Start time of selection in milliseconds. If it’s equal to the end time, there is no selection. See also “has-selection”.
Owner: PtWaveviewer
Flags: Read
Allowed values: >= 0
Default value: 0
“show-ruler”
property“show-ruler” gboolean
Whether the ruler is shown (TRUE) or not (FALSE).
Owner: PtWaveviewer
Flags: Read / Write / Construct
Default value: TRUE
“cursor-changed”
signalvoid user_function (PtWaveviewer *viewer, gint64 position, gpointer user_data)
Signals that the cursor’s position was changed by the user.
viewer |
the waveviewer emitting the signal |
|
position |
the new position in stream in milliseconds |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“follow-cursor-changed”
signalvoid user_function (PtWaveviewer *viewer, gboolean follow, gpointer user_data)
Signals that the “follow-cursor” property has changed.
viewer |
the waveviewer emitting the signal |
|
follow |
the new value |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“load-progress”
signalvoid user_function (PtWaveviewer *viewer, double progress, gpointer user_data)
Indicates progress on a scale from 0.0 to 1.0, however it does not emit the value 0.0 nor 1.0. Wait for a TRUE player-state-changed signal or an error signal to dismiss a gui element showing progress.
viewer |
the waveviewer emitting the signal |
|
progress |
the new progress state, ranging from 0.0 to 1.0 |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“play-toggled”
signalvoid user_function (PtWaveviewer *viewer, gpointer user_data)
Signals that the user requested to toggle play/pause.
viewer |
the waveviewer emitting the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“selection-changed”
signalvoid user_function (PtWaveviewer *viewer, gpointer user_data)
Signals that the selection was changed (or unselected) by the user. To query the new selection see “has-selection”, “selection-start” and “selection-end”.
viewer |
the waveviewer emitting the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“zoom-in”
signalvoid user_function (PtWaveviewer *viewer, gpointer user_data)
Signals that the user requested to zoom into the waveform.
viewer |
the waveviewer emitting the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“zoom-out”
signalvoid user_function (PtWaveviewer *viewer, gpointer user_data)
Signals that the user requested to zoom out of the waveform.
viewer |
the waveviewer emitting the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First