void ags_notation_toolbar_init(AgsNotationToolbar *notation_toolbar) { GtkLabel *label; GtkMenu *menu; GtkMenuItem *item; notation_toolbar->flags = 0; /* position */ notation_toolbar->position = (GtkToggleToolButton *) g_object_new(GTK_TYPE_TOGGLE_TOOL_BUTTON, "label", i18n("Position"), "stock-id", GTK_STOCK_JUMP_TO, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->position, i18n("position cursor"), NULL); /* edit */ notation_toolbar->edit = (GtkToggleToolButton *) g_object_new(GTK_TYPE_TOGGLE_TOOL_BUTTON, "stock-id", GTK_STOCK_EDIT, "active", TRUE, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->edit, i18n("edit notes"), NULL); notation_toolbar->selected_edit_mode = notation_toolbar->edit; /* clear */ notation_toolbar->clear = (GtkToggleToolButton *) g_object_new(GTK_TYPE_TOGGLE_TOOL_BUTTON, "stock-id", GTK_STOCK_CLEAR, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->clear, i18n("clear notes"), NULL); /* select */ notation_toolbar->select = (GtkToggleToolButton *) g_object_new(GTK_TYPE_TOGGLE_TOOL_BUTTON, "label", i18n("Select"), "stock-id", GTK_STOCK_SELECT_ALL, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->select, i18n("select notes"), NULL); /* copy */ notation_toolbar->copy = (GtkToolButton *) g_object_new(GTK_TYPE_TOOL_BUTTON, "stock-id", GTK_STOCK_COPY, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->copy, i18n("copy notes"), NULL); /* cut */ notation_toolbar->cut = (GtkToolButton *) g_object_new(GTK_TYPE_TOOL_BUTTON, "stock-id", GTK_STOCK_CUT, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->cut, i18n("cut notes"), NULL); /* paste */ notation_toolbar->paste_tool = (GtkMenuToolButton *) g_object_new(GTK_TYPE_MENU_TOOL_BUTTON, "stock-id", GTK_STOCK_PASTE, NULL); menu = (GtkMenu *) gtk_menu_new(); item = g_object_new(GTK_TYPE_CHECK_MENU_ITEM, "label", i18n("match audio channel"), "active", TRUE, NULL); gtk_menu_shell_append((GtkMenuShell *) menu, (GtkWidget *) item); item = g_object_new(GTK_TYPE_CHECK_MENU_ITEM, "label", i18n("no duplicates"), "active", TRUE, NULL); gtk_menu_shell_append((GtkMenuShell *) menu, (GtkWidget *) item); gtk_menu_tool_button_set_menu(notation_toolbar->paste_tool, (GtkWidget *) menu); gtk_widget_show_all((GtkWidget *) menu); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->paste_tool, i18n("paste notes"), NULL); /* invert */ notation_toolbar->invert = (GtkButton *) g_object_new(GTK_TYPE_TOOL_BUTTON, "icon-widget", (GtkWidget *) gtk_image_new_from_icon_name("object-flip-vertical", GTK_ICON_SIZE_LARGE_TOOLBAR), "label", i18n("Invert"), NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->invert, i18n("invert notes"), NULL); /* menu tool */ notation_toolbar->menu_tool = (GtkMenuToolButton *) g_object_new(GTK_TYPE_MENU_TOOL_BUTTON, "label", i18n("Tool"), "stock-id", GTK_STOCK_EXECUTE, NULL); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->menu_tool, i18n("additional tools"), NULL); /* menu tool - tool popup */ notation_toolbar->tool_popup = ags_notation_toolbar_tool_popup_new(notation_toolbar); gtk_menu_tool_button_set_menu(notation_toolbar->menu_tool, (GtkWidget *) notation_toolbar->tool_popup); /* menu tool - dialogs */ notation_toolbar->move_note = (GtkDialog *) ags_move_note_dialog_new(NULL); notation_toolbar->crop_note = (GtkDialog *) ags_crop_note_dialog_new(NULL); notation_toolbar->select_note = (GtkDialog *) ags_select_note_dialog_new(NULL); notation_toolbar->position_notation_cursor = (GtkDialog *) ags_position_notation_cursor_dialog_new(NULL); /* zoom */ label = (GtkLabel *) gtk_label_new(i18n("Zoom")); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) label, NULL, NULL); notation_toolbar->zoom_history = 2; notation_toolbar->zoom = (GtkComboBoxText *) ags_zoom_combo_box_new(); gtk_combo_box_set_active((GtkComboBox *) notation_toolbar->zoom, 2); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->zoom, NULL , NULL); /* opacity */ label = (GtkLabel *) gtk_label_new(i18n("Opacity")); gtk_container_add(GTK_CONTAINER(notation_toolbar), (GtkWidget *) label); notation_toolbar->opacity = (GtkSpinButton *) gtk_spin_button_new_with_range(0.0, 1.0, 0.001); gtk_spin_button_set_value(notation_toolbar->opacity, 0.8); gtk_toolbar_append_widget((GtkToolbar *) notation_toolbar, (GtkWidget *) notation_toolbar->opacity, NULL, NULL); }
void ags_automation_toolbar_init(AgsAutomationToolbar *automation_toolbar) { GtkMenuToolButton *menu_tool_button; GtkMenu *menu; GtkLabel *label; GtkCellRenderer *cell_renderer; automation_toolbar->position = g_object_new(GTK_TYPE_TOGGLE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, (GtkWidget *) automation_toolbar->position, "position cursor\0", NULL); automation_toolbar->edit = g_object_new(GTK_TYPE_TOGGLE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_EDIT, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); automation_toolbar->selected_edit_mode = automation_toolbar->edit; gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, (GtkWidget *) automation_toolbar->edit, "edit automation\0", NULL); automation_toolbar->clear = g_object_new(GTK_TYPE_TOGGLE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); automation_toolbar->select = g_object_new(GTK_TYPE_TOGGLE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_SELECT_ALL, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, (GtkWidget *) automation_toolbar->select, "select automation\0", NULL); automation_toolbar->copy = (GtkButton *) g_object_new(GTK_TYPE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_COPY, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, automation_toolbar->copy, "copy automation\0", NULL); automation_toolbar->cut = (GtkButton *) g_object_new(GTK_TYPE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_CUT, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, automation_toolbar->cut, "cut automation\0", NULL); automation_toolbar->paste = (GtkButton *) g_object_new(GTK_TYPE_BUTTON, "image\0", gtk_image_new_from_stock(GTK_STOCK_PASTE, GTK_ICON_SIZE_LARGE_TOOLBAR), "relief\0", GTK_RELIEF_NONE, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, automation_toolbar->paste, "paste automation\0", NULL); /* */ automation_toolbar->zoom_history = 4; label = gtk_label_new("zoom\0"); gtk_container_add(GTK_CONTAINER(automation_toolbar), label); automation_toolbar->zoom = ags_zoom_combo_box_new(); gtk_combo_box_set_active(automation_toolbar->zoom, 4); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, (GtkWidget *) automation_toolbar->zoom, NULL, NULL); /* */ label = gtk_label_new("port\0"); gtk_container_add(GTK_CONTAINER(automation_toolbar), label); automation_toolbar->port = gtk_combo_box_new(); cell_renderer = gtk_cell_renderer_toggle_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(automation_toolbar->port), cell_renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(automation_toolbar->port), cell_renderer, "active\0", 0, NULL); gtk_cell_renderer_toggle_set_activatable(cell_renderer, TRUE); cell_renderer = gtk_cell_renderer_text_new(); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(automation_toolbar->port), cell_renderer, FALSE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(automation_toolbar->port), cell_renderer, "text\0", 1, NULL); gtk_toolbar_append_widget((GtkToolbar *) automation_toolbar, (GtkWidget *) automation_toolbar->port, NULL, NULL); }