Example #1
0
static void set_time_label (gint time, gint len)
{
    gchar s[128] = "<b>";

    if (len && aud_get_bool ("gtkui", "show_remaining_time"))
        append_time_str (s, sizeof s, len - time);
    else
        append_time_str (s, sizeof s, time);

    if (len)
    {
        append_str (s, sizeof s, " / ");
        append_time_str (s, sizeof s, len);

        int a, b;
        aud_drct_get_ab_repeat (& a, & b);

        if (a >= 0)
        {
            append_str (s, sizeof s, " A=");
            append_time_str (s, sizeof s, a);
        }

        if (b >= 0)
        {
            append_str (s, sizeof s, " B=");
            append_time_str (s, sizeof s, b);
        }
    }

    append_str (s, sizeof s, "</b>");
    gtk_label_set_markup ((GtkLabel *) label_time, s);
}
Example #2
0
static void set_time_label (int time, int len)
{
    char s[128] = "<b>";

    if (len && aud_get_bool ("gtkui", "show_remaining_time"))
        append_time_str (s, sizeof s, len - time);
    else
        append_time_str (s, sizeof s, time);

    if (len)
    {
        append_str (s, sizeof s, " / ");
        append_time_str (s, sizeof s, len);

        int a, b;
        aud_drct_get_ab_repeat (& a, & b);

        if (a >= 0)
        {
            append_str (s, sizeof s, " A=");
            append_time_str (s, sizeof s, a);
        }

        if (b >= 0)
        {
            append_str (s, sizeof s, " B=");
            append_time_str (s, sizeof s, b);
        }
    }

    append_str (s, sizeof s, "</b>");

    /* only update label if necessary */
    if (strcmp (gtk_label_get_label ((GtkLabel *) label_time), s))
        gtk_label_set_markup ((GtkLabel *) label_time, s);
}