Changeset 97f4150664c833e181971788d8f58962f4b5e66d
- Timestamp:
- 02/20/10 03:09:37 (5 months ago)
- Children:
- 44cdd3164cb959ab9418ac310b52388d8cc96ca7
- Parents:
- 0f5da82ae8555ee792aae824333798de930e1f68
- git-committer:
- Nedko Arnaudov <nedko@arnaudov.name> / 2010-02-20T03:09:37Z+0200
- Location:
- gui
- Files:
-
- 2 modified
-
gladish.ui (modified) (3 diffs)
-
main.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gui/gladish.ui
r0f5da82 r97f4150 388 388 <property name="visible">True</property> 389 389 <property name="sensitive">False</property> 390 <property name="label" translatable="yes">Clear XRuns</property> 390 391 <property name="stock_id">gtk-clear</property> 391 392 </object> … … 396 397 </child> 397 398 <child> 398 <object class="GtkToolItem" id="toolitem30">399 <property name="visible">True</property>400 <child>401 <object class="GtkAlignment" id="alignment3">402 <property name="visible">True</property>403 <property name="yscale">0</property>404 <child>405 <object class="GtkProgressBar" id="xrun_progress_bar">406 <property name="visible">True</property>407 <property name="pulse_step">0.10000000149</property>408 <property name="text" translatable="yes">Stopped</property>409 </object>410 </child>411 </object>412 </child>413 </object>414 <packing>415 <property name="expand">False</property>416 </packing>417 </child>418 <child>419 <object class="GtkSeparatorToolItem" id="toolbutton1">420 <property name="visible">True</property>421 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>422 </object>423 <packing>424 <property name="expand">False</property>425 </packing>426 </child>427 <child>428 <object class="GtkToolItem" id="toolitem_studio">429 <property name="visible">True</property>430 <property name="border_width">1</property>431 <child>432 <object class="GtkViewport" id="viewport1">433 <property name="visible">True</property>434 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>435 <property name="resize_mode">queue</property>436 <child>437 <object class="GtkLabel" id="studio_status_label">438 <property name="width_request">150</property>439 <property name="visible">True</property>440 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>441 <property name="label" translatable="yes">No studio loaded</property>442 <property name="use_markup">True</property>443 </object>444 </child>445 </object>446 </child>447 </object>448 <packing>449 <property name="expand">False</property>450 </packing>451 </child>452 <child>453 <object class="GtkSeparatorToolItem" id="toolbutton4">454 <property name="visible">True</property>455 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>456 </object>457 <packing>458 <property name="expand">False</property>459 </packing>460 </child>461 <child>462 399 <object class="GtkToolButton" id="zoom_normal_but"> 463 400 <property name="visible">True</property> … … 475 412 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 476 413 <property name="stock_id">gtk-zoom-fit</property> 477 </object>478 <packing>479 <property name="expand">False</property>480 <property name="homogeneous">True</property>481 </packing>482 </child>483 <child>484 <object class="GtkSeparatorToolItem" id="separatortoolitem1">485 <property name="visible">True</property>486 </object>487 <packing>488 <property name="expand">False</property>489 </packing>490 </child>491 <child>492 <object class="GtkToolItem" id="startstop_item">493 <property name="visible">True</property>494 <child>495 <object class="GtkImage" id="startstop">496 <property name="visible">True</property>497 <property name="stock">gtk-dialog-warning</property>498 </object>499 </child>500 414 </object> 501 415 <packing> -
gui/main.c
r0f5da82 r97f4150 54 54 55 55 GtkWidget * g_clear_load_button; 56 GtkWidget * g_xrun_progress_bar;57 56 GtkStatusbar * g_statusbar; 58 57 … … 83 82 GtkWidget * g_menu_item_start_app; 84 83 GtkWidget * g_status_image; 85 GtkWidget * g_status_tool_item;86 84 87 85 GtkWidget * g_name_dialog; … … 92 90 93 91 GtkWidget * g_latency_label; 92 GtkWidget * g_dsp_load_label; 93 GtkWidget * g_xruns_label; 94 94 95 95 graph_view_handle g_jack_view = NULL; … … 226 226 { 227 227 char buf[100]; 228 snprintf(buf, sizeof(buf), " Latency:%4.1f ms (%"PRIu32")", (float)size / (float)g_sample_rate * 1000.0f, size);228 snprintf(buf, sizeof(buf), "%4.1f ms (%"PRIu32")", (float)size / (float)g_sample_rate * 1000.0f, size); 229 229 gtk_label_set_text(GTK_LABEL(g_latency_label), buf); 230 230 } … … 276 276 char tmp_buf[100]; 277 277 278 if (!jack_proxy_get_xruns(&xruns) || !jack_proxy_get_dsp_load(&load)) 279 { 280 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), "error"); 281 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), 0.0); 282 } 283 284 snprintf(tmp_buf, sizeof(tmp_buf), "%" PRIu32 " Dropouts", xruns); 285 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), tmp_buf); 286 287 load /= 100.0; // dbus returns it in percents, we use 0..1 288 289 if (load > g_jack_max_dsp_load) 290 { 291 g_jack_max_dsp_load = load; 292 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), load); 278 if (jack_proxy_get_xruns(&xruns)) 279 { 280 snprintf(tmp_buf, sizeof(tmp_buf), "%" PRIu32 " dropouts", xruns); 281 gtk_label_set_text(GTK_LABEL(g_xruns_label), tmp_buf); 282 } 283 else 284 { 285 gtk_label_set_text(GTK_LABEL(g_xruns_label), "?"); 286 } 287 288 if (jack_proxy_get_dsp_load(&load)) 289 { 290 if (load > g_jack_max_dsp_load) 291 { 292 g_jack_max_dsp_load = load; 293 } 294 295 snprintf(tmp_buf, sizeof(tmp_buf), "DSP: %5.1f%% (%5.1f%%)", (float)load, (float)g_jack_max_dsp_load); 296 gtk_label_set_text(GTK_LABEL(g_dsp_load_label), tmp_buf); 297 } 298 else 299 { 300 gtk_label_set_text(GTK_LABEL(g_xruns_label), "?"); 293 301 } 294 302 } … … 298 306 jack_proxy_reset_xruns(); 299 307 g_jack_max_dsp_load = 0.0; 300 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), 0.0);301 308 } 302 309 … … 746 753 } 747 754 748 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), status);755 //gtk_progress_bar_set_text(GTK_PROGRESS_BAR(g_xrun_progress_bar), status); 749 756 gtk_label_set_text(GTK_LABEL(g_studio_status_label), name); 750 757 758 log_error("status icon stock id: %s", stock_id); 751 759 gtk_image_set_from_stock(GTK_IMAGE(g_status_image), stock_id, GTK_ICON_SIZE_SMALL_TOOLBAR); 752 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(g_status_tool_item), tooltip); 753 754 if (g_jack_state == JACK_STATE_STARTED && jack_proxy_sample_rate(&g_sample_rate)) 755 { 756 char buf[100]; 757 758 if (fmod(g_sample_rate, 1000.0) != 0.0) 759 { 760 snprintf(buf, sizeof(buf), "Sample rate: %.1f kHz", (float)g_sample_rate / 1000.0f); 760 //gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(g_status_tool_item), tooltip); 761 762 if (g_jack_state == JACK_STATE_STARTED) 763 { 764 if (jack_proxy_sample_rate(&g_sample_rate)) 765 { 766 char buf[100]; 767 768 if (fmod(g_sample_rate, 1000.0) != 0.0) 769 { 770 snprintf(buf, sizeof(buf), "%.1f kHz", (float)g_sample_rate / 1000.0f); 771 } 772 else 773 { 774 snprintf(buf, sizeof(buf), "%u kHz", g_sample_rate / 1000); 775 } 776 777 gtk_label_set_text(GTK_LABEL(g_sample_rate_label), buf); 761 778 } 762 779 else 763 780 { 764 snprintf(buf, sizeof(buf), "Sample rate: %u kHz", g_sample_rate / 1000); 765 } 766 767 gtk_label_set_text(GTK_LABEL(g_sample_rate_label), buf); 781 gtk_label_set_text(GTK_LABEL(g_sample_rate_label), ""); 782 } 768 783 } 769 784 else 770 785 { 771 gtk_label_set_text(GTK_LABEL(g_sample_rate_label), ""); 786 gtk_label_set_text(GTK_LABEL(g_sample_rate_label), g_jack_state == JACK_STATE_NA ? "JACK is sick" : "JACK is stopped"); 787 gtk_label_set_text(GTK_LABEL(g_latency_label), ""); 788 gtk_label_set_text(GTK_LABEL(g_dsp_load_label), ""); 789 gtk_label_set_text(GTK_LABEL(g_xruns_label), ""); 772 790 } 773 791 … … 937 955 buffer_size_clear(); 938 956 gtk_widget_set_sensitive(g_clear_load_button, false); 939 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(g_xrun_progress_bar), 0.0);940 957 } 941 958 … … 1146 1163 g_main_win = get_gtk_builder_widget("main_win"); 1147 1164 g_clear_load_button = get_gtk_builder_widget("clear_load_button"); 1148 g_xrun_progress_bar = get_gtk_builder_widget("xrun_progress_bar");1149 1165 g_menu_item_new_studio = get_gtk_builder_widget("menu_item_new_studio"); 1150 1166 g_menu_item_start_app = get_gtk_builder_widget("menu_item_start_app"); … … 1160 1176 g_menu_item_daemon_exit = get_gtk_builder_widget("menu_item_daemon_exit"); 1161 1177 g_menu_item_jack_configure = get_gtk_builder_widget("menu_item_jack_configure"); 1162 g_studio_status_label = get_gtk_builder_widget("studio_status_label");1163 1178 g_menu_item_view_toolbar = get_gtk_builder_widget("menu_item_view_toolbar"); 1164 1179 g_toolbar = get_gtk_builder_widget("toolbar"); 1165 g_status_image = get_gtk_builder_widget("startstop");1166 g_status_tool_item = get_gtk_builder_widget("startstop_item");1167 1180 g_statusbar = GTK_STATUSBAR(get_gtk_builder_widget("statusbar")); 1168 1181 … … 1183 1196 g_menu_item_jack_latency_8192 = GTK_CHECK_MENU_ITEM(get_gtk_builder_widget("menu_item_jack_latency_8192")); 1184 1197 1198 g_studio_status_label = gtk_label_new("studioname"); 1199 gtk_widget_show(g_studio_status_label); 1200 gtk_box_pack_start(GTK_BOX(g_statusbar), g_studio_status_label, FALSE, TRUE, 10); 1201 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_studio_status_label, 0); 1202 1203 g_status_image = gtk_image_new(); 1204 gtk_widget_show(g_status_image); 1205 gtk_box_pack_start(GTK_BOX(g_statusbar), g_status_image, FALSE, TRUE, 10); 1206 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_status_image, 1); 1207 1185 1208 g_sample_rate_label = gtk_label_new("srate"); 1186 1209 gtk_widget_show(g_sample_rate_label); 1187 1210 gtk_box_pack_start(GTK_BOX(g_statusbar), g_sample_rate_label, FALSE, TRUE, 10); 1188 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_sample_rate_label, 0);1211 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_sample_rate_label, 2); 1189 1212 1190 1213 g_latency_label = gtk_label_new("latency"); 1191 1214 gtk_widget_show(g_latency_label); 1192 1215 gtk_box_pack_start(GTK_BOX(g_statusbar), g_latency_label, FALSE, TRUE, 10); 1193 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_latency_label, 1); 1216 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_latency_label, 3); 1217 1218 g_xruns_label = gtk_label_new("xruns"); 1219 gtk_widget_show(g_xruns_label); 1220 gtk_box_pack_start(GTK_BOX(g_statusbar), g_xruns_label, FALSE, TRUE, 10); 1221 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_xruns_label, 4); 1222 1223 g_dsp_load_label = gtk_label_new("load"); 1224 gtk_widget_show(g_dsp_load_label); 1225 gtk_box_pack_start(GTK_BOX(g_statusbar), g_dsp_load_label, FALSE, TRUE, 10); 1226 gtk_box_reorder_child(GTK_BOX(g_statusbar), g_dsp_load_label, 5); 1194 1227 1195 1228 buffer_size_clear();
