xrun/load progressbar reborn in new place
This commit is contained in:
parent
7a24d7c912
commit
c7af2a1a45
|
@ -249,6 +249,7 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="related_action">clear_xruns_and_max_dsp_load_action</property>
|
||||
<property name="use_action_appearance">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -438,15 +439,33 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="position">204</property>
|
||||
<child>
|
||||
<object class="GtkViewport" id="world_tree_viewport">
|
||||
<object class="GtkVBox" id="left_pane_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="resize_mode">queue</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="world_tree">
|
||||
<object class="GtkViewport" id="world_tree_viewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="resize_mode">queue</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="world_tree">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="xrun_progress_bar">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
12
gui/main.c
12
gui/main.c
|
@ -92,6 +92,8 @@ GtkWidget * g_latency_label;
|
|||
GtkWidget * g_dsp_load_label;
|
||||
GtkWidget * g_xruns_label;
|
||||
|
||||
GtkWidget * g_xrun_progress_bar;
|
||||
|
||||
graph_view_handle g_jack_view = NULL;
|
||||
graph_view_handle g_studio_view = NULL;
|
||||
|
||||
|
@ -323,9 +325,12 @@ static void update_load(void)
|
|||
{
|
||||
snprintf(tmp_buf, sizeof(tmp_buf), "%" PRIu32 " dropouts", xruns);
|
||||
gtk_label_set_text(GTK_LABEL(g_xruns_label), tmp_buf);
|
||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), tmp_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), "error");
|
||||
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), 0.0);
|
||||
gtk_label_set_text(GTK_LABEL(g_xruns_label), "?");
|
||||
}
|
||||
|
||||
|
@ -334,6 +339,7 @@ static void update_load(void)
|
|||
if (load > g_jack_max_dsp_load)
|
||||
{
|
||||
g_jack_max_dsp_load = load;
|
||||
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), load / 100.0);
|
||||
}
|
||||
|
||||
snprintf(tmp_buf, sizeof(tmp_buf), "DSP: %5.1f%% (%5.1f%%)", (float)load, (float)g_jack_max_dsp_load);
|
||||
|
@ -799,7 +805,7 @@ bool studio_state_changed(char ** name_ptr_ptr)
|
|||
status_image_path = STATUS_ICON_ERROR;
|
||||
}
|
||||
|
||||
//gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), status);
|
||||
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), status);
|
||||
gtk_label_set_text(GTK_LABEL(g_studio_status_label), name);
|
||||
|
||||
if (status_image_path == NULL || (pixbuf = load_pixbuf(status_image_path)) == NULL)
|
||||
|
@ -838,7 +844,7 @@ bool studio_state_changed(char ** name_ptr_ptr)
|
|||
}
|
||||
else
|
||||
{
|
||||
gtk_label_set_text(GTK_LABEL(g_sample_rate_label), g_jack_state == JACK_STATE_NA ? "JACK is sick" : "JACK is stopped");
|
||||
gtk_label_set_text(GTK_LABEL(g_sample_rate_label), "");
|
||||
gtk_label_set_text(GTK_LABEL(g_latency_label), "");
|
||||
gtk_label_set_text(GTK_LABEL(g_dsp_load_label), "");
|
||||
gtk_label_set_text(GTK_LABEL(g_xruns_label), "");
|
||||
|
@ -1009,6 +1015,7 @@ void jack_stopped(void)
|
|||
set_latency_items_sensivity(false);
|
||||
buffer_size_clear();
|
||||
gtk_action_set_sensitive(g_clear_load_and_max_dsp_action, false);
|
||||
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), 0.0);
|
||||
}
|
||||
|
||||
void jack_appeared(void)
|
||||
|
@ -1226,6 +1233,7 @@ int main(int argc, char** argv)
|
|||
g_menu_item_view_toolbar = get_gtk_builder_widget("menu_item_view_toolbar");
|
||||
g_toolbar = get_gtk_builder_widget("toolbar");
|
||||
g_statusbar = GTK_STATUSBAR(get_gtk_builder_widget("statusbar"));
|
||||
g_xrun_progress_bar = get_gtk_builder_widget("xrun_progress_bar");
|
||||
|
||||
g_name_dialog = get_gtk_builder_widget("name_dialog");
|
||||
g_app_dialog = get_gtk_builder_widget("app_dialog");
|
||||
|
|
Loading…
Reference in New Issue