MildenhallProgressBar

MildenhallProgressBar — MildenhallProgressBar creates a new progress bar wigets which extends from LightwoodProgressBase.

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── LightwoodProgressBase
                ╰── MildenhallProgressBar

Description

MildenhallProgressBar provides seek end, seek-start, update progress bar and top to seek,play started,pause features. It is designed to use mostly for the media player applications.

Freeing the widget

Call g_object_unref() to free the widget.

Sample C Code

How to create MildenhallProgressBar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ThornburyItemFactory *item_factory = NULL;
GObject *object = NULL;
MildenhallProgressBar *progress_bar

item_factory = thornbury_item_factory_generate_widget_with_props (
     MILDENHALL_TYPE_PROGRESS_BAR,
     "/usr/share/mildenhall/mildenhall_progress_bar_prop.json");
g_object_get (itemFactory, "object", &object, NULL);

progress_bar = MILDENHALL_PROGRESS_BAR (object);

g_object_set (progress_bar, "current-duration", 0.5, NULL);
clutter_actor_add_child (CLUTTER_ACTOR (stage), CLUTTER_ACTOR (progress_bar));

g_signal_connect (progress_bar, "play-requested",
     G_CALLBACK (on_play_requested_cb), progress_bar);

Example of “play-requested” callback implementation

1
2
3
4
5
6
7
static gboolean
on_play_requested_cb (MildenhallProgressBar *progress_bar, gpointer user_data)
{
  g_timeout_add_seconds (1, set_current_duration, (gpointer) progress_bar);

  return TRUE;
}

“play-requested” will be called when “play-state” is changed.

1
g_object_set (progress_bar, "play-state", FALSE, NULL);

Functions

Types and Values

See Also

ThornburyItemFactory, ClutterActor