Parlatype.Waveviewer

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Parlatype.Waveviewer Parlatype.Waveviewer Gtk.Widget->Parlatype.Waveviewer

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_follow_cursor ()

load_wave_async (uri, cancel, callback, *user_data)

load_wave_finish (result)

set_follow_cursor (follow)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

fixed-cursor

bool

r/w/c

follow-cursor

bool

r/w/c

has-selection

bool

r

playback-cursor

int

r/w

pps

int

r/w/c

selection-end

int

r

selection-start

int

r

show-ruler

bool

r/w/c

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

cursor-changed

Signals that the cursor’s position was changed by the user.

load-progress

Indicates progress on a scale from 0.0 to 1.0.

play-toggled

Signals that the user requested to toggle play/pause.

selection-changed

Signals that the selection was changed (or unselected) by the user.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class Parlatype.Waveviewer(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Parlatype.WaveviewerClass

classmethod new()
Returns:

the widget

Return type:

Gtk.Widget

Create a new, initially blank waveform viewer widget.

After use gtk_widget_destroy() it.

New in version 1.5.

get_follow_cursor()
Returns:

True if cursor is followed, else False

Return type:

bool

Get follow-cursor option.

New in version 1.5.

load_wave_async(uri, cancel, callback, *user_data)
Parameters:

Load wave form for the given URI. The initial resolution is set to Parlatype.Waveviewer :pps. While loading, a Parlatype.Waveviewer ::load-progress signal is emitted. A previous waveform is discarded.

New in version 2.0.

load_wave_finish(result)
Parameters:

result (Gio.AsyncResult) – the Gio.AsyncResult passed to your Gio.AsyncReadyCallback

Raises:

GLib.Error

Returns:

True if successful, or False with error set

Return type:

bool

Gives the result of the async load operation. A cancelled operation results in an error, too.

New in version 2.0.

set_follow_cursor(follow)
Parameters:

follow (bool) – new value

Set follow-cursor option to True or False. See also Parlatype.Waveviewer :follow-cursor.

New in version 1.5.

Signal Details

Parlatype.Waveviewer.signals.cursor_changed(waveviewer, position)
Signal Name:

cursor-changed

Flags:

RUN_FIRST

Parameters:
  • waveviewer (Parlatype.Waveviewer) – The object which received the signal

  • position (int) – the new position in stream in milliseconds

Signals that the cursor’s position was changed by the user.

Parlatype.Waveviewer.signals.load_progress(waveviewer, progress)
Signal Name:

load-progress

Flags:

RUN_FIRST

Parameters:
  • waveviewer (Parlatype.Waveviewer) – The object which received the signal

  • progress (float) – the new progress state, ranging from 0.0 to 1.0

Indicates progress on a scale from 0.0 to 1.0. The value 0.0 is not emitted, the last signal (on success) is 1.0.

Parlatype.Waveviewer.signals.play_toggled(waveviewer)
Signal Name:

play-toggled

Flags:

RUN_FIRST

Parameters:

waveviewer (Parlatype.Waveviewer) – The object which received the signal

Signals that the user requested to toggle play/pause.

Parlatype.Waveviewer.signals.selection_changed(waveviewer)
Signal Name:

selection-changed

Flags:

RUN_FIRST

Parameters:

waveviewer (Parlatype.Waveviewer) – The object which received the signal

Signals that the selection was changed (or unselected) by the user. To query the new selection see Parlatype.Waveviewer :has-selection, Parlatype.Waveviewer :selection-start and Parlatype.Waveviewer :selection-end.

Property Details

Parlatype.Waveviewer.props.fixed_cursor
Name:

fixed-cursor

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

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 Parlatype.Waveviewer :follow-cursor is False, this has no effect.

Parlatype.Waveviewer.props.follow_cursor
Name:

follow-cursor

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

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.

Parlatype.Waveviewer.props.has_selection
Name:

has-selection

Type:

bool

Default Value:

False

Flags:

READABLE

Whether something is selected (True) or not (False).

Parlatype.Waveviewer.props.playback_cursor
Name:

playback-cursor

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Current playback position in milliseconds. A value of -1 means an invalid or unknown position that will not be rendered.

Parlatype.Waveviewer.props.pps
Name:

pps

Type:

int

Default Value:

100

Flags:

READABLE, WRITABLE, CONSTRUCT

Current/requested resolution of waveform in pixels per second.

Parlatype.Waveviewer.props.selection_end
Name:

selection-end

Type:

int

Default Value:

0

Flags:

READABLE

End time of selection in milliseconds. If it’s equal to the start time, there is no selection. See also Parlatype.Waveviewer :has-selection.

Parlatype.Waveviewer.props.selection_start
Name:

selection-start

Type:

int

Default Value:

0

Flags:

READABLE

Start time of selection in milliseconds. If it’s equal to the end time, there is no selection. See also Parlatype.Waveviewer :has-selection.

Parlatype.Waveviewer.props.show_ruler
Name:

show-ruler

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT

Whether the ruler is shown (True) or not (False).