[SCM] gsequencer/master: New upstream version 0.4.2-76
jkraehemann-guest at users.alioth.debian.org
jkraehemann-guest at users.alioth.debian.org
Tue Jun 23 19:44:16 UTC 2015
The following commit has been merged in the master branch:
commit 696ed0142aceeb72dd2bda4f3eb004f7413983c7
Author: Joël Krähemann <jkraehemann-guest at users.alioth.debian.org>
Date: Tue Jun 23 21:31:56 2015 +0200
New upstream version 0.4.2-76
diff --git a/ChangeLog b/ChangeLog
index 643b619..0379f7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+ags (0.4.2-76-1)
+
+ [ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
+ * fixed boundary for matrix clipboard
+ * fixed paste to mono or different audio allocation
+ * fixed piano shift to correct direction
+ * fixed reset vscrollbar in editor widgets
+ * refactored ags_editor.c
+ * fixed already selected machines in editor not to add again
+ * fixed audio channel resize for mono machines, disabled it in machine properties dialog
+ * enhanced LADSPA browser refresh
+
ags (0.4.2-75-1)
[ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
diff --git a/configure b/configure
index 4f5f0ff..46c228b 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ags 0.4.2-75.
+# Generated by GNU Autoconf 2.69 for ags 0.4.2-76.
#
# Report bugs to <jkraehemann-guest at users.alioth.debian.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ags'
PACKAGE_TARNAME='ags'
-PACKAGE_VERSION='0.4.2-75'
-PACKAGE_STRING='ags 0.4.2-75'
+PACKAGE_VERSION='0.4.2-76'
+PACKAGE_STRING='ags 0.4.2-76'
PACKAGE_BUGREPORT='jkraehemann-guest at users.alioth.debian.org'
PACKAGE_URL=''
@@ -1317,7 +1317,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ags 0.4.2-75 to adapt to many kinds of systems.
+\`configure' configures ags 0.4.2-76 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1387,7 +1387,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ags 0.4.2-75:";;
+ short | recursive ) echo "Configuration of ags 0.4.2-76:";;
esac
cat <<\_ACEOF
@@ -1523,7 +1523,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ags configure 0.4.2-75
+ags configure 0.4.2-76
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2000,7 +2000,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ags $as_me 0.4.2-75, which was
+It was created by ags $as_me 0.4.2-76, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2866,7 +2866,7 @@ fi
# Define the identity of the package.
PACKAGE='ags'
- VERSION='0.4.2-75'
+ VERSION='0.4.2-76'
cat >>confdefs.h <<_ACEOF
@@ -7161,7 +7161,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ags $as_me 0.4.2-75, which was
+This file was extended by ags $as_me 0.4.2-76, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7227,7 +7227,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ags config.status 0.4.2-75
+ags config.status 0.4.2-76
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index ef96979..22c2dc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([ags],[0.4.2-75],[jkraehemann-guest at users.alioth.debian.org])
+AC_INIT([ags],[0.4.2-76],[jkraehemann-guest at users.alioth.debian.org])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
diff --git a/src/ags/X/ags_editor.c b/src/ags/X/ags_editor.c
index 0dbb0b3..2f44d24 100644
--- a/src/ags/X/ags_editor.c
+++ b/src/ags/X/ags_editor.c
@@ -31,6 +31,7 @@
#include <ags/X/editor/ags_pattern_edit.h>
#include <ags/X/editor/ags_pattern_edit_callbacks.h>
+#include <stdlib.h>
#include <math.h>
#include <cairo.h>
@@ -223,19 +224,20 @@ ags_editor_init(AgsEditor *editor)
editor->selected_machine = NULL;
+ editor->editor_child = NULL;
editor->table = (GtkTable *) gtk_table_new(4, 3, FALSE);
gtk_paned_pack2((GtkPaned *) paned, (GtkWidget *) editor->table, TRUE, FALSE);
- editor->notebook = NULL;
+ editor->current_notebook = NULL;
- editor->meter = NULL;
- editor->edit_widget = NULL;
+ editor->current_meter = NULL;
+ editor->current_edit_widget = NULL;
//TODO:JK: remove me
/*
- editor->meter = g_object_new(AGS_TYPE_METER,
+ editor->current_meter = g_object_new(AGS_TYPE_METER,
NULL);
- gtk_table_attach(table, (GtkWidget *) editor->meter,
+ gtk_table_attach(table, (GtkWidget *) editor->current_meter,
0, 1, 1, 2,
GTK_FILL, GTK_FILL,
0, 0);
@@ -332,8 +334,8 @@ ags_editor_connect(AgsConnectable *connectable)
/* */
ags_connectable_connect(AGS_CONNECTABLE(editor->toolbar));
ags_connectable_connect(AGS_CONNECTABLE(editor->machine_selector));
- ags_connectable_connect(AGS_CONNECTABLE(editor->notebook));
- // ags_connectable_connect(AGS_CONNECTABLE(editor->meter));
+ // ags_connectable_connect(AGS_CONNECTABLE(editor->current_notebook));
+ // ags_connectable_connect(AGS_CONNECTABLE(editor->current_meter));
// ags_connectable_connect(AGS_CONNECTABLE(editor->note_edit));
}
@@ -347,30 +349,12 @@ void
ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
{
AgsMachine *machine_old;
- AgsNotebook *notebook;
- GtkTable *table;
- GList *list, *list_start;
-
- guint pads;
- guint i, stop;
-
- auto void ags_editor_notebook_change_machine_shrink();
- auto void ags_editor_notebook_change_machine_grow();
-
- void ags_editor_notebook_change_machine_shrink(){
- GtkWidget *widget;
-
- for(; i < stop; i++)
- ags_notebook_remove_tab(notebook,
- 0);
- }
- void ags_editor_notebook_change_machine_grow(){
- for(; i < stop; i++){
- ags_notebook_add_tab(notebook);
- }
- }
+ GList *list;
+ guint pads;
+ guint i;
+
if(editor->selected_machine == machine){
return;
}
@@ -378,97 +362,134 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
machine_old = editor->selected_machine;
editor->selected_machine = machine;
- if(machine_old != NULL){
- g_signal_handler_disconnect(machine_old->audio,
- editor->set_audio_channels_handler);
- g_signal_handler_disconnect(machine_old->audio,
- editor->set_pads_handler);
+ list = editor->editor_child;
+
+ while(list != NULL){
+ if(AGS_EDITOR_CHILD(list->data) == machine){
+ break;
+ }
- gtk_widget_destroy(editor->meter);
- gtk_widget_destroy(editor->edit_widget);
- gtk_widget_destroy(editor->notebook);
+ list = list->next;
+ }
- editor->meter = NULL;
- editor->edit_widget = NULL;
- editor->notebook = NULL;
+ if(editor->current_notebook != NULL){
+ gtk_container_remove(editor->table,
+ editor->current_notebook);
+ gtk_container_remove(editor->table,
+ editor->current_meter);
+ gtk_container_remove(editor->table,
+ editor->current_edit_widget);
}
+ editor->current_notebook = NULL;
+ editor->current_meter = NULL;
+ editor->current_edit_widget = NULL;
+
/* instantiate note edit or pattern edit */
if(machine == NULL){
return;
}
-
- table = editor->table;
-
- notebook =
- editor->notebook = g_object_new(AGS_TYPE_NOTEBOOK,
- "homogeneous\0", FALSE,
- "spacing\0", 0,
- NULL);
- gtk_table_attach(editor->table, (GtkWidget *) editor->notebook,
- 0, 3, 0, 1,
- GTK_FILL|GTK_EXPAND, GTK_FILL,
- 0, 0);
-
- i = 0;
- stop = machine->audio->audio_channels;
-
- ags_editor_notebook_change_machine_grow();
- editor->set_audio_channels_handler = g_signal_connect(machine->audio, "set-audio-channels\0",
- G_CALLBACK(ags_editor_set_audio_channels_callback), editor);
- editor->set_pads_handler = g_signal_connect(machine->audio, "set-pads\0",
- G_CALLBACK(ags_editor_set_pads_callback), editor);
+ if(list == NULL){
+ AgsEditorChild *child;
+
+ child = ags_editor_child_alloc(machine, NULL, NULL, NULL);
+ editor->editor_child = g_list_prepend(editor->editor_child,
+ child);
+
+ child->notebook =
+ editor->current_notebook = g_object_new(AGS_TYPE_NOTEBOOK,
+ "homogeneous\0", FALSE,
+ "spacing\0", 0,
+ NULL);
+ g_object_ref(child->notebook);
+ gtk_table_attach(editor->table, (GtkWidget *) child->notebook,
+ 0, 3, 0, 1,
+ GTK_FILL|GTK_EXPAND, GTK_FILL,
+ 0, 0);
- if((AGS_AUDIO_NOTATION_DEFAULT & (machine->audio->flags)) != 0){
+ for(i = 0; i < machine->audio->audio_channels; i++){
+ ags_notebook_insert_tab(child->notebook,
+ i);
+ AGS_NOTEBOOK_TAB(child->notebook->tabs->data)->notation = g_list_nth(machine->audio->notation,
+ i);
+ }
+
pads = machine->audio->input_pads;
- }else{
- pads = machine->audio->output_pads;
- }
- if((AGS_MACHINE_IS_SYNTHESIZER & (machine->flags)) != 0){
- editor->meter = ags_meter_new();
- gtk_table_attach(editor->table, (GtkWidget *) editor->meter,
+ child->meter =
+ editor->current_meter = ags_meter_new();
+ g_object_ref(child->meter);
+ gtk_table_attach(editor->table, (GtkWidget *) child->meter,
0, 1, 1, 2,
GTK_FILL, GTK_FILL,
0, 0);
- ags_connectable_connect(AGS_CONNECTABLE(editor->meter));
- gtk_widget_show_all(editor->meter);
+ ags_connectable_connect(AGS_CONNECTABLE(child->meter));
+ gtk_widget_show_all(child->meter);
+
+ if((AGS_MACHINE_IS_SYNTHESIZER & (machine->flags)) != 0){
+ child->edit_widget =
+ editor->current_edit_widget = ags_note_edit_new();
+ g_object_ref(child->edit_widget);
+ gtk_table_attach(editor->table, (GtkWidget *) child->edit_widget,
+ 1, 2, 1, 2,
+ GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
+ 0, 0);
+
+ ags_connectable_connect(AGS_CONNECTABLE(child->edit_widget));
+ gtk_widget_show_all(child->edit_widget);
+
+ ags_note_edit_set_map_height(child->edit_widget,
+ pads * AGS_NOTE_EDIT(child->edit_widget)->control_height);
+ }else if((AGS_MACHINE_IS_SEQUENCER & (machine->flags)) != 0){
+ child->edit_widget =
+ editor->current_edit_widget = ags_pattern_edit_new();
+ g_object_ref(child->edit_widget);
+ gtk_table_attach(editor->table, (GtkWidget *) child->edit_widget,
+ 1, 2, 1, 2,
+ GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
+ 0, 0);
+
+ ags_connectable_connect(AGS_CONNECTABLE(child->edit_widget));
+ gtk_widget_show_all(child->edit_widget);
+
+ ags_pattern_edit_set_map_height(child->edit_widget,
+ pads * AGS_PATTERN_EDIT(child->edit_widget)->control_height);
+ }
+ }else{
+ AgsEditorChild *child;
- editor->edit_widget = ags_note_edit_new();
- gtk_table_attach(table, (GtkWidget *) editor->edit_widget,
- 1, 2, 1, 2,
- GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
+ child = list->data;
+
+ gtk_table_attach(editor->table, (GtkWidget *) child->notebook,
+ 0, 3, 0, 1,
+ GTK_FILL|GTK_EXPAND, GTK_FILL,
0, 0);
- ags_connectable_connect(AGS_CONNECTABLE(editor->edit_widget));
- gtk_widget_show_all(editor->edit_widget);
-
- ags_note_edit_set_map_height(editor->edit_widget,
- pads * AGS_NOTE_EDIT(editor->edit_widget)->control_height);
- }else if((AGS_MACHINE_IS_SEQUENCER & (machine->flags)) != 0){
- editor->meter = ags_meter_new();
- gtk_table_attach(editor->table, (GtkWidget *) editor->meter,
+ gtk_table_attach(editor->table, (GtkWidget *) child->meter,
0, 1, 1, 2,
GTK_FILL, GTK_FILL,
0, 0);
- ags_connectable_connect(AGS_CONNECTABLE(editor->meter));
- gtk_widget_show_all(editor->meter);
-
- editor->edit_widget = ags_pattern_edit_new();
- gtk_table_attach(table, (GtkWidget *) editor->edit_widget,
+ gtk_table_attach(editor->table, (GtkWidget *) child->edit_widget,
1, 2, 1, 2,
GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
0, 0);
+ }
+}
- ags_connectable_connect(AGS_CONNECTABLE(editor->edit_widget));
- gtk_widget_show_all(editor->edit_widget);
+AgsEditorChild*
+ags_editor_child_alloc(AgsMachine *machine, AgsNotebook *notebook, AgsMeter *meter, GtkWidget *edit_widget)
+{
+ AgsEditorChild *editor_child;
- ags_pattern_edit_set_map_height(editor->edit_widget,
- pads * AGS_PATTERN_EDIT(editor->edit_widget)->control_height);
- }else{
- /* empty */
- }
+ editor_child = (AgsEditorChild *) malloc(sizeof(AgsEditorChild));
+
+ editor_child->machine = machine;
+ editor_child->notebook = notebook;
+ editor_child->meter = meter;
+ editor_child->edit_widget = edit_widget;
+
+ return(editor_child);
}
/**
@@ -491,13 +512,13 @@ ags_editor_select_all(AgsEditor *editor)
gint i;
gint selected_channel;
- if(editor->selected_machine != NULL && editor->edit_widget != NULL){
+ if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -506,21 +527,21 @@ ags_editor_select_all(AgsEditor *editor)
i++;
}
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window);
cairo_push_group(cr);
- ags_note_edit_draw_segment(editor->edit_widget, cr);
- ags_note_edit_draw_notation(editor->edit_widget, cr);
+ ags_note_edit_draw_segment(editor->current_edit_widget, cr);
+ ags_note_edit_draw_notation(editor->current_edit_widget, cr);
cairo_pop_group_to_source(cr);
cairo_paint(cr);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window);
cairo_push_group(cr);
- ags_pattern_edit_draw_segment(editor->edit_widget, cr);
- ags_pattern_edit_draw_notation(editor->edit_widget, cr);
+ ags_pattern_edit_draw_segment(editor->current_edit_widget, cr);
+ ags_pattern_edit_draw_notation(editor->current_edit_widget, cr);
cairo_pop_group_to_source(cr);
cairo_paint(cr);
@@ -576,6 +597,10 @@ ags_editor_paste(AgsEditor *editor)
10);
notation_list = g_list_nth(machine->audio->notation,
audio_channel);
+
+ if(notation_list == NULL){
+ break;
+ }
if(paste_from_position){
xmlNode *child;
@@ -668,7 +693,7 @@ ags_editor_paste(AgsEditor *editor)
}
}
- if((machine = editor->selected_machine) != NULL && editor->edit_widget != NULL){
+ if((machine = editor->selected_machine) != NULL && editor->current_edit_widget != NULL){
/* get clipboard */
buffer = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
@@ -680,12 +705,12 @@ ags_editor_paste(AgsEditor *editor)
last_x = 0;
paste_from_position = TRUE;
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- position_x = AGS_NOTE_EDIT(editor->edit_widget)->selected_x;
- position_y = AGS_NOTE_EDIT(editor->edit_widget)->selected_y;
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- position_x = AGS_PATTERN_EDIT(editor->edit_widget)->selected_x;
- position_y = AGS_PATTERN_EDIT(editor->edit_widget)->selected_y;
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ position_x = AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x;
+ position_y = AGS_NOTE_EDIT(editor->current_edit_widget)->selected_y;
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ position_x = AGS_PATTERN_EDIT(editor->current_edit_widget)->selected_x;
+ position_y = AGS_PATTERN_EDIT(editor->current_edit_widget)->selected_y;
}
#ifdef DEBUG
@@ -716,30 +741,30 @@ ags_editor_paste(AgsEditor *editor)
xmlFreeDoc(clipboard);
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window);
cairo_push_group(cr);
- ags_note_edit_draw_segment(editor->edit_widget, cr);
- ags_note_edit_draw_notation(editor->edit_widget, cr);
+ ags_note_edit_draw_segment(editor->current_edit_widget, cr);
+ ags_note_edit_draw_notation(editor->current_edit_widget, cr);
if(paste_from_position){
- AGS_NOTE_EDIT(editor->edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
- ags_note_edit_draw_position(AGS_NOTE_EDIT(editor->edit_widget), cr);
+ AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
+ ags_note_edit_draw_position(AGS_NOTE_EDIT(editor->current_edit_widget), cr);
}
cairo_pop_group_to_source(cr);
cairo_paint(cr);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window);
cairo_push_group(cr);
- ags_pattern_edit_draw_segment(editor->edit_widget, cr);
- ags_pattern_edit_draw_notation(editor->edit_widget, cr);
+ ags_pattern_edit_draw_segment(editor->current_edit_widget, cr);
+ ags_pattern_edit_draw_notation(editor->current_edit_widget, cr);
if(paste_from_position){
- AGS_PATTERN_EDIT(editor->edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
- ags_pattern_edit_draw_position(AGS_PATTERN_EDIT(editor->edit_widget), cr);
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
+ ags_pattern_edit_draw_position(AGS_PATTERN_EDIT(editor->current_edit_widget), cr);
}
cairo_pop_group_to_source(cr);
@@ -772,7 +797,7 @@ ags_editor_copy(AgsEditor *editor)
gint i;
gint selected_channel;
- if(editor->selected_machine != NULL && editor->edit_widget != NULL){
+ if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
/* create document */
clipboard = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
@@ -785,7 +810,7 @@ ags_editor_copy(AgsEditor *editor)
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -833,7 +858,7 @@ ags_editor_cut(AgsEditor *editor)
gint i;
gint selected_channel;
- if(editor->selected_machine != NULL && editor->edit_widget != NULL){
+ if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
/* create document */
@@ -847,27 +872,27 @@ ags_editor_cut(AgsEditor *editor)
list_notation = machine->audio->notation;
i = 0;
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window);
}
cairo_push_group(cr);
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
notation_node = ags_notation_cut_selection(AGS_NOTATION(list_notation->data));
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- ags_note_edit_draw_segment(AGS_NOTE_EDIT(editor->edit_widget), cr);
- ags_note_edit_draw_notation(AGS_NOTE_EDIT(editor->edit_widget), cr);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- ags_pattern_edit_draw_segment(AGS_PATTERN_EDIT(editor->edit_widget), cr);
- ags_pattern_edit_draw_notation(AGS_PATTERN_EDIT(editor->edit_widget), cr);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ ags_note_edit_draw_segment(AGS_NOTE_EDIT(editor->current_edit_widget), cr);
+ ags_note_edit_draw_notation(AGS_NOTE_EDIT(editor->current_edit_widget), cr);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ ags_pattern_edit_draw_segment(AGS_PATTERN_EDIT(editor->current_edit_widget), cr);
+ ags_pattern_edit_draw_notation(AGS_PATTERN_EDIT(editor->current_edit_widget), cr);
}
i++;
diff --git a/src/ags/X/ags_editor.h b/src/ags/X/ags_editor.h
index a54a6ac..e0d3bea 100644
--- a/src/ags/X/ags_editor.h
+++ b/src/ags/X/ags_editor.h
@@ -42,6 +42,8 @@
#define AGS_IS_EDITOR_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), AGS_TYPE_EDITOR))
#define AGS_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AGS_TYPE_EDITOR, AgsEditorClass))
+#define AGS_EDITOR_CHILD(ptr) ((AgsEditorChild *)(ptr))
+
#define AGS_EDITOR_DEFAULT_VERSION "0.4.2\0"
#define AGS_EDITOR_DEFAULT_BUILD_ID "CEST 02-10-2014 19:36\0"
@@ -50,6 +52,8 @@
typedef struct _AgsEditor AgsEditor;
typedef struct _AgsEditorClass AgsEditorClass;
+typedef struct _AgsEditorChild AgsEditorChild;
+
struct _AgsEditor
{
GtkVBox vbox;
@@ -63,16 +67,15 @@ struct _AgsEditor
AgsMachineSelector *machine_selector;
AgsMachine *selected_machine;
- gulong set_audio_channels_handler;
- gulong set_pads_handler;
AgsToolbar *toolbar;
- AgsNotebook *notebook;
-
+ GList *editor_child;
GtkTable *table;
- AgsMeter *meter;
- GtkWidget *edit_widget;
+
+ AgsNotebook *current_notebook;
+ AgsMeter *current_meter;
+ GtkWidget *current_edit_widget;
guint tact_counter;
};
@@ -84,8 +87,19 @@ struct _AgsEditorClass
void (*machine_changed)(AgsEditor *editor, AgsMachine *machine);
};
+struct _AgsEditorChild
+{
+ AgsMachine *machine;
+
+ AgsNotebook *notebook;
+ AgsMeter *meter;
+ GtkWidget *edit_widget;
+};
+
GType ags_editor_get_type(void);
+AgsEditorChild* ags_editor_child_alloc(AgsMachine *machine, AgsNotebook *notebook, AgsMeter *meter, GtkWidget *edit_widget);
+
void ags_editor_select_all(AgsEditor *editor);
void ags_editor_paste(AgsEditor *copy);
diff --git a/src/ags/X/ags_editor_callbacks.c b/src/ags/X/ags_editor_callbacks.c
index 4ee8c96..0b15e40 100644
--- a/src/ags/X/ags_editor_callbacks.c
+++ b/src/ags/X/ags_editor_callbacks.c
@@ -23,11 +23,6 @@
#include <ags/thread/ags_audio_loop.h>
#include <ags/thread/ags_task_thread.h>
-#include <ags/audio/ags_audio.h>
-#include <ags/audio/ags_channel.h>
-#include <ags/audio/ags_output.h>
-#include <ags/audio/ags_input.h>
-
#include <ags/audio/task/ags_scroll_on_play.h>
#include <ags/X/ags_window.h>
@@ -48,71 +43,14 @@ ags_editor_parent_set_callback(GtkWidget *widget, GtkObject *old_parent, AgsEdi
if(old_parent != NULL)
return;
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- AGS_NOTE_EDIT(editor->edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
- ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR);
- AGS_NOTE_EDIT(editor->edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- AGS_PATTERN_EDIT(editor->edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
- ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR);
- AGS_PATTERN_EDIT(editor->edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
- }
-}
-
-void
-ags_editor_set_audio_channels_callback(AgsAudio *audio,
- guint audio_channels, guint audio_channels_old,
- AgsEditor *editor)
-{
- GList *tabs;
- GList *notation;
- guint i;
-
- if(audio_channels_old < audio_channels){
- notation = g_list_nth(audio->notation,
- audio_channels_old - 1);
-
- for(i = audio_channels_old; i < audio_channels; i++){
- ags_notebook_insert_tab(editor->notebook,
- i);
- tabs = editor->notebook->tabs;
- notation = notation->next;
- AGS_NOTEBOOK_TAB(tabs->data)->notation = notation->data;
- gtk_toggle_button_set_active(AGS_NOTEBOOK_TAB(tabs->data)->toggle,
- TRUE);
- }
-
- gtk_widget_show_all(editor->notebook);
- }else{
- for(i = audio_channels; i < audio_channels_old; i++){
- ags_notebook_remove_tab(editor->notebook,
- i);
- }
- }
-}
-
-void
-ags_editor_set_pads_callback(AgsAudio *audio,
- GType channel_type,
- guint pads, guint pads_old,
- AgsEditor *editor)
-{
- if((AGS_AUDIO_NOTATION_DEFAULT & (audio->flags)) != 0){
- if(!g_type_is_a(channel_type, AGS_TYPE_INPUT)){
- return;
- }
- }else{
- if(!g_type_is_a(channel_type, AGS_TYPE_OUTPUT)){
- return;
- }
- }
-
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- ags_note_edit_set_map_height(AGS_NOTE_EDIT(editor->edit_widget),
- pads * AGS_NOTE_EDIT(editor->edit_widget)->control_height);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- ags_pattern_edit_set_map_height(AGS_PATTERN_EDIT(editor->edit_widget),
- pads * AGS_PATTERN_EDIT(editor->edit_widget)->control_height);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
+ ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->current_edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR);
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
+ ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->current_edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR);
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
}
}
diff --git a/src/ags/X/ags_ladspa_browser_callbacks.c b/src/ags/X/ags_ladspa_browser_callbacks.c
index 879f4c8..ac34701 100644
--- a/src/ags/X/ags_ladspa_browser_callbacks.c
+++ b/src/ags/X/ags_ladspa_browser_callbacks.c
@@ -51,7 +51,7 @@ ags_ladspa_browser_plugin_filename_callback(GtkComboBoxText *combo_box,
filename = GTK_COMBO_BOX_TEXT(list->next->data);
effect = GTK_COMBO_BOX_TEXT(list->next->next->next->data);
- ags_combo_box_text_remove_all(effect);
+ gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(effect)));
ags_ladspa_manager_load_file(gtk_combo_box_text_get_active_text(filename));
ladspa_plugin = ags_ladspa_manager_find_ladspa_plugin(gtk_combo_box_text_get_active_text(filename));
diff --git a/src/ags/X/ags_machine.c b/src/ags/X/ags_machine.c
index 9a9fdd8..66e9649 100644
--- a/src/ags/X/ags_machine.c
+++ b/src/ags/X/ags_machine.c
@@ -254,6 +254,7 @@ ags_machine_init(AgsMachine *machine)
machine->flags = 0;
machine->file_input_flags = 0;
+ machine->mapping_flags = 0;
machine->name = NULL;
diff --git a/src/ags/X/ags_machine.h b/src/ags/X/ags_machine.h
index 53b2eba..c4b7a46 100644
--- a/src/ags/X/ags_machine.h
+++ b/src/ags/X/ags_machine.h
@@ -59,8 +59,12 @@ typedef enum{
}AgsMachineFileInputFlags;
typedef enum{
+ AGS_MACHINE_MONO = 1,
+}AgsMachineMappingFlags;
+
+typedef enum{
AGS_MACHINE_POPUP_COPY_PATTERN = 1,
- AGS_MACHINE_POPUP_PASTE_PATTERN = 1 << 1,
+ AGS_MACHINE_POPUP_PASTE_PATTERN = 1 << 1,
}AgsMachineEditOptions;
struct _AgsMachine
@@ -76,7 +80,8 @@ struct _AgsMachine
guint flags;
guint file_input_flags;
-
+ guint mapping_flags;
+
guint bank_0;
guint bank_1;
diff --git a/src/ags/X/ags_machine_callbacks.c b/src/ags/X/ags_machine_callbacks.c
index 86e3172..9f3ddec 100644
--- a/src/ags/X/ags_machine_callbacks.c
+++ b/src/ags/X/ags_machine_callbacks.c
@@ -252,8 +252,18 @@ ags_machine_popup_copy_pattern_callback(GtkWidget *widget, AgsMachine *machine)
x_boundary = k;
}
- if(y_boundary > current->pad){
- y_boundary = current->pad;
+ if((AGS_MACHINE_REVERSE_NOTATION & (machine->flags)) != 0){
+ guint tmp;
+
+ tmp = machine->audio->input_pads - current->pad - 1;
+
+ if(y_boundary > tmp){
+ y_boundary = tmp;
+ }
+ }else{
+ if(y_boundary > current->pad){
+ y_boundary = current->pad;
+ }
}
}
}
diff --git a/src/ags/X/ags_navigation.c b/src/ags/X/ags_navigation.c
index 5c310a5..1a3f185 100644
--- a/src/ags/X/ags_navigation.c
+++ b/src/ags/X/ags_navigation.c
@@ -487,12 +487,12 @@ ags_navigation_real_change_position(AgsNavigation *navigation,
tact_factor = exp2(6.0 - (double) gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom));
tact = exp2((double) gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom) - 2.0);
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- gtk_adjustment_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar)->adjustment,
- tact_counter * AGS_NOTE_EDIT(editor->edit_widget)->control_current.control_width * (16.0 / tact_factor));
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- gtk_adjustment_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar)->adjustment,
- tact_counter * AGS_PATTERN_EDIT(editor->edit_widget)->control_current.control_width * (16.0 / tact_factor));
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ gtk_adjustment_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment,
+ tact_counter * AGS_NOTE_EDIT(editor->current_edit_widget)->control_current.control_width * (16.0 / tact_factor));
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ gtk_adjustment_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment,
+ tact_counter * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width * (16.0 / tact_factor));
}
timestr = ags_navigation_tact_to_time_string(tact_counter,
diff --git a/src/ags/X/ags_resize_editor.c b/src/ags/X/ags_resize_editor.c
index bef8c43..fba6907 100644
--- a/src/ags/X/ags_resize_editor.c
+++ b/src/ags/X/ags_resize_editor.c
@@ -294,6 +294,11 @@ ags_resize_editor_reset(AgsApplicable *applicable)
audio = machine_editor->machine->audio;
+ if((AGS_MACHINE_MONO & (machine_editor->machine->mapping_flags)) != 0){
+ gtk_spin_button_set_range(resize_editor->audio_channels,
+ 0.0, 1.0);
+ }
+
gtk_spin_button_set_value(resize_editor->audio_channels,
audio->audio_channels);
diff --git a/src/ags/X/editor/ags_machine_selector_callbacks.c b/src/ags/X/editor/ags_machine_selector_callbacks.c
index cf90aa0..2e48371 100644
--- a/src/ags/X/editor/ags_machine_selector_callbacks.c
+++ b/src/ags/X/editor/ags_machine_selector_callbacks.c
@@ -57,9 +57,14 @@ ags_machine_selector_popup_add_index_callback(GtkWidget *menu_item, AgsMachineSe
void
ags_machine_selector_popup_remove_index_callback(GtkWidget *menu_item, AgsMachineSelector *machine_selector)
{
+ AgsEditor *editor;
AgsMachineRadioButton *machine_radio_button;
GList *list, *list_start;
+ editor = gtk_widget_get_ancestor(machine_selector,
+ AGS_TYPE_EDITOR);
+
+ /* emit changed */
list_start =
list = gtk_container_get_children(GTK_CONTAINER(machine_selector));
list = list->next;
@@ -68,8 +73,6 @@ ags_machine_selector_popup_remove_index_callback(GtkWidget *menu_item, AgsMachin
machine_radio_button = AGS_MACHINE_RADIO_BUTTON(list->data);
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(machine_radio_button))){
- gtk_widget_destroy(GTK_WIDGET(machine_radio_button));
-
ags_machine_selector_changed(machine_selector,
NULL);
@@ -80,6 +83,26 @@ ags_machine_selector_popup_remove_index_callback(GtkWidget *menu_item, AgsMachin
}
g_list_free(list_start);
+
+ /* destroy edit widgets */
+ if(machine_radio_button->machine != NULL){
+ list = editor->editor_child;
+
+ while(list != NULL){
+ if(AGS_EDITOR_CHILD(list->data) == machine_radio_button->machine){
+ gtk_widget_destroy(AGS_EDITOR_CHILD(list->data)->notebook);
+ gtk_widget_destroy(AGS_EDITOR_CHILD(list->data)->meter);
+ gtk_widget_destroy(AGS_EDITOR_CHILD(list->data)->edit_widget);
+
+ break;
+ }
+
+ list = list->next;
+ }
+ }
+
+ /**/
+ gtk_widget_destroy(GTK_WIDGET(machine_radio_button));
}
void
@@ -105,85 +128,18 @@ ags_machine_selector_popup_link_index_callback(GtkWidget *menu_item, AgsMachineS
}
void
-ags_machine_selector_popup_invert_mapping_callback(GtkWidget *menu_item, AgsMachineSelector *machine_selector)
-{
- AgsEditor *editor;
-
- editor = gtk_widget_get_ancestor(machine_selector,
- AGS_TYPE_EDITOR);
-
- if(editor->selected_machine != NULL){
- GList *notation;
-
- notation = editor->selected_machine->audio->notation;
-
- while(notation != NULL){
- if(gtk_check_menu_item_get_active(menu_item)){
- AGS_NOTATION(notation->data)->flags |= AGS_NOTATION_INVERTED_MAPPING;
- }else{
- AGS_NOTATION(notation->data)->flags &= (~AGS_NOTATION_INVERTED_MAPPING);
- }
-
- notation = notation->next;
- }
-
- gtk_widget_queue_draw(editor->edit_widget);
- }
-}
-
-void
-ags_machine_selector_popup_shift_piano_callback(GtkWidget *menu_item, AgsMachineSelector *machine_selector)
-{
- AgsEditor *editor;
-
- editor = gtk_widget_get_ancestor(machine_selector,
- AGS_TYPE_EDITOR);
-
- if(editor->selected_machine != NULL){
- GList *notation;
-
- notation = editor->selected_machine->audio->notation;
-
- while(notation != NULL){
- g_free(AGS_NOTATION(notation->data)->base_note);
- AGS_NOTATION(notation->data)->base_note = g_strdup(gtk_menu_item_get_label(menu_item));
-
- notation = notation->next;
- }
-
- ags_meter_paint(editor->meter);
- }
-}
-
-void
ags_machine_selector_selection_response(GtkWidget *machine_selection,
gint response,
AgsMachineSelector *machine_selector)
{
AgsMachine *machine;
- AgsMachineRadioButton *machine_radio_button;
+ AgsMachineRadioButton *machine_radio_button, *existing_radio_button;
GtkVBox *vbox;
GtkContainer *content_area;
GList *list, *list_start, *index, *index_start;;
if(response == GTK_RESPONSE_ACCEPT){
- machine_radio_button = NULL;
- list_start =
- list = gtk_container_get_children(GTK_CONTAINER(machine_selector));
- list = list->next;
-
- while(list != NULL){
- if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(list->data))){
- machine_radio_button = AGS_MACHINE_RADIO_BUTTON(list->data);
-
- break;
- }
-
- list = list->next;
- }
-
- g_list_free(list_start);
-
+ /* retrieve machine */
machine = NULL;
vbox = GTK_DIALOG(machine_selection)->vbox;
@@ -211,9 +167,37 @@ ags_machine_selector_selection_response(GtkWidget *machine_selection,
g_list_free(index_start);
}
- g_object_set(G_OBJECT(machine_radio_button),
- "machine\0", machine,
- NULL);
+ /* retrieve selected */
+ machine_radio_button = NULL;
+ existing_radio_button = NULL;
+
+ list_start =
+ list = gtk_container_get_children(GTK_CONTAINER(machine_selector));
+ list = list->next;
+
+ while(list != NULL){
+ if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(list->data))){
+ machine_radio_button = AGS_MACHINE_RADIO_BUTTON(list->data);
+ }
+
+ if(AGS_MACHINE_RADIO_BUTTON(list->data)->machine == machine){
+ existing_radio_button = AGS_MACHINE_RADIO_BUTTON(list->data);
+ }
+
+ list = list->next;
+ }
+
+ g_list_free(list_start);
+
+
+ /* decide if link to editor or change index */
+ if(existing_radio_button != NULL){
+ gtk_button_clicked(existing_radio_button);
+ }else{
+ g_object_set(G_OBJECT(machine_radio_button),
+ "machine\0", machine,
+ NULL);
+ }
}
gtk_widget_destroy(machine_selection);
@@ -224,3 +208,54 @@ ags_machine_selector_radio_changed(GtkWidget *radio_button, AgsMachineSelector *
{
ags_machine_selector_changed(machine_selector, AGS_MACHINE_RADIO_BUTTON(radio_button)->machine);
}
+
+void
+ags_machine_selector_popup_invert_mapping_callback(GtkWidget *menu_item, AgsMachineSelector *machine_selector)
+{
+ AgsEditor *editor;
+
+ editor = gtk_widget_get_ancestor(machine_selector,
+ AGS_TYPE_EDITOR);
+
+ if(editor->selected_machine != NULL){
+ GList *notation;
+
+ notation = editor->selected_machine->audio->notation;
+
+ while(notation != NULL){
+ if(gtk_check_menu_item_get_active(menu_item)){
+ AGS_NOTATION(notation->data)->flags |= AGS_NOTATION_INVERTED_MAPPING;
+ }else{
+ AGS_NOTATION(notation->data)->flags &= (~AGS_NOTATION_INVERTED_MAPPING);
+ }
+
+ notation = notation->next;
+ }
+
+ gtk_widget_queue_draw(editor->current_edit_widget);
+ }
+}
+
+void
+ags_machine_selector_popup_shift_piano_callback(GtkWidget *menu_item, AgsMachineSelector *machine_selector)
+{
+ AgsEditor *editor;
+
+ editor = gtk_widget_get_ancestor(machine_selector,
+ AGS_TYPE_EDITOR);
+
+ if(editor->selected_machine != NULL){
+ GList *notation;
+
+ notation = editor->selected_machine->audio->notation;
+
+ while(notation != NULL){
+ g_free(AGS_NOTATION(notation->data)->base_note);
+ AGS_NOTATION(notation->data)->base_note = g_strdup(gtk_menu_item_get_label(menu_item));
+
+ notation = notation->next;
+ }
+
+ ags_meter_paint(editor->current_meter);
+ }
+}
diff --git a/src/ags/X/editor/ags_meter.c b/src/ags/X/editor/ags_meter.c
index b82fdfc..80cf3cf 100644
--- a/src/ags/X/editor/ags_meter.c
+++ b/src/ags/X/editor/ags_meter.c
@@ -168,18 +168,18 @@ ags_meter_paint(AgsMeter *meter)
bitmap = 0x52a52a; // description of the keyboard
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- control_height = AGS_NOTE_EDIT(editor->edit_widget)->control_height;
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ control_height = AGS_NOTE_EDIT(editor->current_edit_widget)->control_height;
- j = (guint) ceil(GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->vscrollbar)->adjustment->value / (double) control_height);
+ j = (guint) ceil(GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->vscrollbar)->adjustment->value / (double) control_height);
- y[0] = (guint) round(GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->vscrollbar)->adjustment->value) % control_height;
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- control_height = AGS_PATTERN_EDIT(editor->edit_widget)->control_height;
+ y[0] = (guint) round(GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->vscrollbar)->adjustment->value) % control_height;
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ control_height = AGS_PATTERN_EDIT(editor->current_edit_widget)->control_height;
- j = (guint) ceil(GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->vscrollbar)->adjustment->value / (double) control_height);
+ j = (guint) ceil(GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->vscrollbar)->adjustment->value / (double) control_height);
- y[0] = (guint) round(GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->vscrollbar)->adjustment->value) % control_height;
+ y[0] = (guint) round(GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->vscrollbar)->adjustment->value) % control_height;
}
base_note = AGS_NOTATION(editor->selected_machine->audio->notation->data)->base_note;
@@ -188,51 +188,51 @@ ags_meter_paint(AgsMeter *meter)
if(!g_ascii_strncasecmp(base_note,
"A\0",
2)){
- j = (editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (11 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"A#\0",
3)){
- j = (1 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (10 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"H\0",
2)){
- j = (2 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (9 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"C\0",
2)){
- j = (3 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (8 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"C#\0",
3)){
- j = (4 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (7 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"D\0",
2)){
- j = (5 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (6 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"D#\0",
3)){
- j = (6 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (5 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"E\0",
2)){
- j = (7 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (4 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"F\0",
2)){
- j = (8 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (3 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"F#\0",
3)){
- j = (9 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (2 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"G\0",
2)){
- j = (10 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (1 + editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}else if(!g_ascii_strncasecmp(base_note,
"G#\0",
3)){
- j = (11 + editor->selected_machine->audio->input_pads - j - 1) + ((editor->selected_machine->audio->input_pads % 12));
+ j = (editor->selected_machine->audio->input_pads - (editor->selected_machine->audio->input_pads - j) - 1) + ((editor->selected_machine->audio->input_pads));
}
j = j % 12;
diff --git a/src/ags/X/editor/ags_note_edit.c b/src/ags/X/editor/ags_note_edit.c
index 1f017c2..41bbe82 100644
--- a/src/ags/X/editor/ags_note_edit.c
+++ b/src/ags/X/editor/ags_note_edit.c
@@ -200,10 +200,21 @@ ags_note_edit_init(AgsNoteEdit *note_edit)
void
ags_note_edit_connect(AgsConnectable *connectable)
{
+ AgsEditor *editor;
AgsNoteEdit *note_edit;
note_edit = AGS_NOTE_EDIT(connectable);
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(note_edit),
+ AGS_TYPE_EDITOR);
+
+ if(editor != NULL && editor->selected_machine != NULL){
+ g_signal_connect(editor->selected_machine->audio, "set-audio-channels\0",
+ G_CALLBACK(ags_note_edit_set_audio_channels_callback), note_edit);
+ g_signal_connect(editor->selected_machine->audio, "set-pads\0",
+ G_CALLBACK(ags_note_edit_set_pads_callback), note_edit);
+ }
+
g_signal_connect_after((GObject *) note_edit->drawing_area, "expose_event\0",
G_CALLBACK(ags_note_edit_drawing_area_expose_event), (gpointer) note_edit);
@@ -296,7 +307,10 @@ ags_note_edit_reset_vertically(AgsNoteEdit *note_edit, guint flags)
height = widget->allocation.height;
gtk_adjustment_set_upper(adjustment,
(gdouble) (note_edit->map_height - height));
- gtk_adjustment_set_value(adjustment, 0.0);
+
+ if(adjustment->value > adjustment->upper){
+ gtk_adjustment_set_value(adjustment, adjustment->upper);
+ }
}else{
height = note_edit->map_height;
@@ -672,7 +686,7 @@ ags_note_edit_draw_notation(AgsNoteEdit *note_edit, cairo_t *cr)
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
diff --git a/src/ags/X/editor/ags_note_edit_callbacks.c b/src/ags/X/editor/ags_note_edit_callbacks.c
index a9e9d80..2ff6804 100644
--- a/src/ags/X/editor/ags_note_edit_callbacks.c
+++ b/src/ags/X/editor/ags_note_edit_callbacks.c
@@ -18,6 +18,11 @@
#include <ags/X/editor/ags_note_edit_callbacks.h>
+#include <ags/audio/ags_audio.h>
+#include <ags/audio/ags_channel.h>
+#include <ags/audio/ags_output.h>
+#include <ags/audio/ags_input.h>
+
#include <ags/X/ags_editor.h>
#include <ags/X/machine/ags_panel.h>
@@ -29,6 +34,88 @@
#include <gdk/gdkkeysyms.h>
+
+void
+ags_note_edit_set_audio_channels_callback(AgsAudio *audio,
+ guint audio_channels, guint audio_channels_old,
+ AgsNoteEdit *note_edit)
+{
+ AgsEditor *editor;
+ AgsEditorChild *editor_child;
+
+ GList *list;
+ GList *tabs;
+ GList *notation;
+ guint i;
+
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(note_edit),
+ AGS_TYPE_EDITOR);
+
+ editor_child = NULL;
+ list = editor->editor_child;
+
+ while(list != NULL){
+ if(AGS_EDITOR_CHILD(list->data)->edit_widget == note_edit){
+ editor_child = AGS_EDITOR_CHILD(list->data);
+ break;
+ }
+
+ list = list->next;
+ }
+
+ if(audio_channels_old < audio_channels){
+ notation = g_list_nth(audio->notation,
+ audio_channels_old - 1);
+
+ for(i = audio_channels_old; i < audio_channels; i++){
+ ags_notebook_insert_tab(editor_child->notebook,
+ i);
+ tabs = editor_child->notebook->tabs;
+ notation = notation->next;
+ AGS_NOTEBOOK_TAB(tabs->data)->notation = notation->data;
+ gtk_toggle_button_set_active(AGS_NOTEBOOK_TAB(tabs->data)->toggle,
+ TRUE);
+ }
+
+ gtk_widget_show_all(editor_child->notebook);
+ }else{
+ for(i = audio_channels; i < audio_channels_old; i++){
+ ags_notebook_remove_tab(editor_child->notebook,
+ i);
+ }
+ }
+}
+
+void
+ags_note_edit_set_pads_callback(AgsAudio *audio,
+ GType channel_type,
+ guint pads, guint pads_old,
+ AgsNoteEdit *note_edit)
+{
+ AgsEditor *editor;
+
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(note_edit),
+ AGS_TYPE_EDITOR);
+
+ if((AGS_AUDIO_NOTATION_DEFAULT & (audio->flags)) != 0){
+ if(!g_type_is_a(channel_type, AGS_TYPE_INPUT)){
+ return;
+ }
+ }else{
+ if(!g_type_is_a(channel_type, AGS_TYPE_OUTPUT)){
+ return;
+ }
+ }
+
+ if(AGS_IS_NOTE_EDIT(note_edit)){
+ ags_note_edit_set_map_height(note_edit,
+ pads * note_edit->control_height);
+ }else if(AGS_IS_NOTE_EDIT(note_edit)){
+ ags_note_edit_set_map_height(AGS_NOTE_EDIT(note_edit),
+ pads * AGS_NOTE_EDIT(note_edit)->control_height);
+ }
+}
+
gboolean
ags_note_edit_drawing_area_expose_event(GtkWidget *widget, GdkEventExpose *event, AgsNoteEdit *note_edit)
{
@@ -259,7 +346,7 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -350,7 +437,7 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -405,7 +492,7 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -825,7 +912,7 @@ ags_note_edit_vscrollbar_value_changed(GtkRange *range, AgsNoteEdit *note_edit)
editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(note_edit),
AGS_TYPE_EDITOR);
- ags_meter_paint(editor->meter);
+ ags_meter_paint(editor->current_meter);
note_edit->flags |= AGS_NOTE_EDIT_RESETING_VERTICALLY;
ags_note_edit_reset_vertically(note_edit, 0);
diff --git a/src/ags/X/editor/ags_note_edit_callbacks.h b/src/ags/X/editor/ags_note_edit_callbacks.h
index d85ca6b..8f28eea 100644
--- a/src/ags/X/editor/ags_note_edit_callbacks.h
+++ b/src/ags/X/editor/ags_note_edit_callbacks.h
@@ -25,6 +25,14 @@
#include <ags/X/editor/ags_note_edit.h>
+void ags_note_edit_set_audio_channels_callback(AgsAudio *audio,
+ guint audio_channels, guint audio_channels_old,
+ AgsNoteEdit *note_edit);
+void ags_note_edit_set_pads_callback(AgsAudio *audio,
+ GType channel_type,
+ guint pads, guint pads_old,
+ AgsNoteEdit *note_edit);
+
gboolean ags_note_edit_drawing_area_expose_event(GtkWidget *widget, GdkEventExpose *event, AgsNoteEdit *note_edit);
gboolean ags_note_edit_drawing_area_configure_event(GtkWidget *widget, GdkEventConfigure *event, AgsNoteEdit *note_edit);
gboolean ags_note_edit_drawing_area_button_press_event(GtkWidget *widget, GdkEventButton *event, AgsNoteEdit *note_edit);
diff --git a/src/ags/X/editor/ags_pattern_edit.c b/src/ags/X/editor/ags_pattern_edit.c
index a58ee84..57cdbd8 100644
--- a/src/ags/X/editor/ags_pattern_edit.c
+++ b/src/ags/X/editor/ags_pattern_edit.c
@@ -193,10 +193,21 @@ ags_pattern_edit_init(AgsPatternEdit *pattern_edit)
void
ags_pattern_edit_connect(AgsConnectable *connectable)
{
+ AgsEditor *editor;
AgsPatternEdit *pattern_edit;
pattern_edit = AGS_PATTERN_EDIT(connectable);
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(pattern_edit),
+ AGS_TYPE_EDITOR);
+
+ if(editor != NULL && editor->selected_machine != NULL){
+ g_signal_connect(editor->selected_machine->audio, "set-audio-channels\0",
+ G_CALLBACK(ags_pattern_edit_set_audio_channels_callback), pattern_edit);
+ g_signal_connect(editor->selected_machine->audio, "set-pads\0",
+ G_CALLBACK(ags_pattern_edit_set_pads_callback), pattern_edit);
+ }
+
g_signal_connect_after((GObject *) pattern_edit->drawing_area, "expose_event\0",
G_CALLBACK (ags_pattern_edit_drawing_area_expose_event), (gpointer) pattern_edit);
@@ -290,7 +301,10 @@ ags_pattern_edit_reset_vertically(AgsPatternEdit *pattern_edit, guint flags)
height = widget->allocation.height;
gtk_adjustment_set_upper(adjustment,
(gdouble) (pattern_edit->map_height - height));
- gtk_adjustment_set_value(adjustment, 0.0);
+
+ if(adjustment->value > adjustment->upper){
+ gtk_adjustment_set_value(adjustment, adjustment->upper);
+ }
}else{
height = pattern_edit->map_height;
@@ -328,7 +342,7 @@ ags_pattern_edit_reset_vertically(AgsPatternEdit *pattern_edit, guint flags)
cairo_paint(cr);
}
- // ags_meter_paint(editor->meter);
+ // ags_meter_paint(editor->current_meter);
}
}
@@ -668,7 +682,7 @@ ags_pattern_edit_draw_notation(AgsPatternEdit *pattern_edit, cairo_t *cr)
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
diff --git a/src/ags/X/editor/ags_pattern_edit_callbacks.c b/src/ags/X/editor/ags_pattern_edit_callbacks.c
index 936ba53..5244b82 100644
--- a/src/ags/X/editor/ags_pattern_edit_callbacks.c
+++ b/src/ags/X/editor/ags_pattern_edit_callbacks.c
@@ -18,6 +18,11 @@
#include <ags/X/editor/ags_pattern_edit_callbacks.h>
+#include <ags/audio/ags_audio.h>
+#include <ags/audio/ags_channel.h>
+#include <ags/audio/ags_output.h>
+#include <ags/audio/ags_input.h>
+
#include <ags/X/ags_editor.h>
#include <ags/X/machine/ags_panel.h>
@@ -29,6 +34,87 @@
#include <gdk/gdkkeysyms.h>
+void
+ags_pattern_edit_set_audio_channels_callback(AgsAudio *audio,
+ guint audio_channels, guint audio_channels_old,
+ AgsPatternEdit *pattern_edit)
+{
+ AgsEditor *editor;
+ AgsEditorChild *editor_child;
+
+ GList *list;
+ GList *tabs;
+ GList *notation;
+ guint i;
+
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(pattern_edit),
+ AGS_TYPE_EDITOR);
+
+ editor_child = NULL;
+ list = editor->editor_child;
+
+ while(list != NULL){
+ if(AGS_EDITOR_CHILD(list->data)->edit_widget == pattern_edit){
+ editor_child = AGS_EDITOR_CHILD(list->data);
+ break;
+ }
+
+ list = list->next;
+ }
+
+ if(audio_channels_old < audio_channels){
+ notation = g_list_nth(audio->notation,
+ audio_channels_old - 1);
+
+ for(i = audio_channels_old; i < audio_channels; i++){
+ ags_notebook_insert_tab(editor_child->notebook,
+ i);
+ tabs = editor_child->notebook->tabs;
+ notation = notation->next;
+ AGS_NOTEBOOK_TAB(tabs->data)->notation = notation->data;
+ gtk_toggle_button_set_active(AGS_NOTEBOOK_TAB(tabs->data)->toggle,
+ TRUE);
+ }
+
+ gtk_widget_show_all(editor_child->notebook);
+ }else{
+ for(i = audio_channels; i < audio_channels_old; i++){
+ ags_notebook_remove_tab(editor_child->notebook,
+ i);
+ }
+ }
+}
+
+void
+ags_pattern_edit_set_pads_callback(AgsAudio *audio,
+ GType channel_type,
+ guint pads, guint pads_old,
+ AgsPatternEdit *pattern_edit)
+{
+ AgsEditor *editor;
+
+ editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(pattern_edit),
+ AGS_TYPE_EDITOR);
+
+ if((AGS_AUDIO_NOTATION_DEFAULT & (audio->flags)) != 0){
+ if(!g_type_is_a(channel_type, AGS_TYPE_INPUT)){
+ return;
+ }
+ }else{
+ if(!g_type_is_a(channel_type, AGS_TYPE_OUTPUT)){
+ return;
+ }
+ }
+
+ if(AGS_IS_PATTERN_EDIT(pattern_edit)){
+ ags_pattern_edit_set_map_height(pattern_edit,
+ pads * pattern_edit->control_height);
+ }else if(AGS_IS_PATTERN_EDIT(pattern_edit)){
+ ags_pattern_edit_set_map_height(AGS_PATTERN_EDIT(pattern_edit),
+ pads * AGS_PATTERN_EDIT(pattern_edit)->control_height);
+ }
+}
+
gboolean
ags_pattern_edit_drawing_area_expose_event(GtkWidget *widget, GdkEventExpose *event, AgsPatternEdit *pattern_edit)
{
@@ -259,9 +345,9 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
switch(history){
case 0:
{
- if(editor->notebook->tabs != NULL){
+ if(editor->current_notebook->tabs != NULL){
list_notation = g_list_nth(list_notation,
- ags_notebook_next_active_tab(editor->notebook,
+ ags_notebook_next_active_tab(editor->current_notebook,
0));
note0 = ags_note_duplicate(note);
@@ -276,7 +362,7 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -380,9 +466,9 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
history = gtk_combo_box_get_active(editor->toolbar->mode);
if(history == 0){
- if(editor->notebook->tabs != NULL){
+ if(editor->current_notebook->tabs != NULL){
list_notation = g_list_nth(list_notation,
- ags_notebook_next_active_tab(editor->notebook,
+ ags_notebook_next_active_tab(editor->current_notebook,
0));
ags_notation_remove_note_at_position(AGS_NOTATION(list_notation->data),
@@ -393,7 +479,7 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->notebook,
+ while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
selected_channel);
@@ -453,9 +539,9 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
list_notation = machine->audio->notation;
if(gtk_combo_box_get_active(editor->toolbar->mode) == 0){
- if(editor->notebook->tabs != NULL){
+ if(editor->current_notebook->tabs != NULL){
list_notation = g_list_nth(list_notation,
- ags_notebook_next_active_tab(editor->notebook,
+ ags_notebook_next_active_tab(editor->current_notebook,
0));
ags_notation_add_region_to_selection(AGS_NOTATION(list_notation->data),
@@ -882,7 +968,7 @@ ags_pattern_edit_vscrollbar_value_changed(GtkRange *range, AgsPatternEdit *patte
editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(pattern_edit),
AGS_TYPE_EDITOR);
- ags_meter_paint(editor->meter);
+ ags_meter_paint(editor->current_meter);
pattern_edit->flags |= AGS_PATTERN_EDIT_RESETING_VERTICALLY;
ags_pattern_edit_reset_vertically(pattern_edit, 0);
diff --git a/src/ags/X/editor/ags_pattern_edit_callbacks.h b/src/ags/X/editor/ags_pattern_edit_callbacks.h
index cb553f6..5e02fd6 100644
--- a/src/ags/X/editor/ags_pattern_edit_callbacks.h
+++ b/src/ags/X/editor/ags_pattern_edit_callbacks.h
@@ -25,6 +25,14 @@
#include <ags/X/editor/ags_pattern_edit.h>
+void ags_pattern_edit_set_audio_channels_callback(AgsAudio *audio,
+ guint audio_channels, guint audio_channels_old,
+ AgsPatternEdit *pattern_edit);
+void ags_pattern_edit_set_pads_callback(AgsAudio *audio,
+ GType channel_type,
+ guint pads, guint pads_old,
+ AgsPatternEdit *pattern_edit);
+
gboolean ags_pattern_edit_drawing_area_expose_event(GtkWidget *widget, GdkEventExpose *event, AgsPatternEdit *pattern_edit);
gboolean ags_pattern_edit_drawing_area_configure_event(GtkWidget *widget, GdkEventConfigure *event, AgsPatternEdit *pattern_edit);
gboolean ags_pattern_edit_drawing_area_button_press_event(GtkWidget *widget, GdkEventButton *event, AgsPatternEdit *pattern_edit);
diff --git a/src/ags/X/editor/ags_toolbar_callbacks.c b/src/ags/X/editor/ags_toolbar_callbacks.c
index 501984e..e64776a 100644
--- a/src/ags/X/editor/ags_toolbar_callbacks.c
+++ b/src/ags/X/editor/ags_toolbar_callbacks.c
@@ -46,33 +46,33 @@ ags_toolbar_position_callback(GtkToggleButton *toggle_button, AgsToolbar *toolba
rectangle->x = 0;
rectangle->y = 0;
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
/* refresh editor */
- gtk_widget_get_size_request(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area),
+ gtk_widget_get_size_request(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area),
&width,
&height);
rectangle->width = width;
rectangle->height = height;
- gdk_window_invalidate_rect(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window,
+ gdk_window_invalidate_rect(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window,
rectangle,
TRUE);
- gdk_window_process_updates(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window,
+ gdk_window_process_updates(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window,
TRUE);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
/* refresh editor */
- gtk_widget_get_size_request(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area),
+ gtk_widget_get_size_request(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area),
&width,
&height);
rectangle->width = width;
rectangle->height = height;
- gdk_window_invalidate_rect(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window,
+ gdk_window_invalidate_rect(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window,
rectangle,
TRUE);
- gdk_window_process_updates(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window,
+ gdk_window_process_updates(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window,
TRUE);
}
@@ -90,14 +90,14 @@ ags_toolbar_position_callback(GtkToggleButton *toggle_button, AgsToolbar *toolba
gtk_toggle_button_set_active(old_selected_edit_mode, FALSE);
/* refresh note_edit */
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window);
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window);
- ags_note_edit_draw_position(AGS_NOTE_EDIT(editor->edit_widget), cr);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window);
+ ags_note_edit_draw_position(AGS_NOTE_EDIT(editor->current_edit_widget), cr);
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window);
- ags_pattern_edit_draw_position(AGS_PATTERN_EDIT(editor->edit_widget), cr);
+ ags_pattern_edit_draw_position(AGS_PATTERN_EDIT(editor->current_edit_widget), cr);
}
}
}
@@ -216,31 +216,31 @@ ags_toolbar_zoom_callback(GtkComboBox *combo_box, AgsToolbar *toolbar)
toolbar->zoom_history = history;
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
- position = GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar)->adjustment->value;
- old_upper = GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar)->adjustment->upper;
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
+ position = GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->value;
+ old_upper = GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->upper;
- AGS_NOTE_EDIT(editor->edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
- ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR |
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
+ ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->current_edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR |
AGS_NOTE_EDIT_RESET_WIDTH);
- AGS_NOTE_EDIT(editor->edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
- new_upper = GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar)->adjustment->upper;
+ new_upper = GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->upper;
- gtk_adjustment_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar)->adjustment,
+ gtk_adjustment_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment,
position / old_upper * new_upper);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
- position = GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar)->adjustment->value;
- old_upper = GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar)->adjustment->upper;
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
+ position = GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->value;
+ old_upper = GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->upper;
- AGS_PATTERN_EDIT(editor->edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
- ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR |
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
+ ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->current_edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR |
AGS_PATTERN_EDIT_RESET_WIDTH);
- AGS_PATTERN_EDIT(editor->edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
- new_upper = GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar)->adjustment->upper;
+ new_upper = GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment->upper;
- gtk_adjustment_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar)->adjustment,
+ gtk_adjustment_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar)->adjustment,
position / old_upper * new_upper);
}
}
@@ -257,7 +257,7 @@ ags_toolbar_mode_callback(GtkWidget *widget, AgsToolbar *toolbar)
editor = (AgsEditor *) gtk_widget_get_ancestor(GTK_WIDGET(toolbar),
AGS_TYPE_EDITOR);
- notebook = editor->notebook;
+ notebook = editor->current_notebook;
/* toggle AgsNotebook */
history = gtk_combo_box_get_active((GtkComboBox *) toolbar->mode);
diff --git a/src/ags/X/machine/ags_matrix.c b/src/ags/X/machine/ags_matrix.c
index 39ecbf2..8d53c85 100644
--- a/src/ags/X/machine/ags_matrix.c
+++ b/src/ags/X/machine/ags_matrix.c
@@ -261,6 +261,8 @@ ags_matrix_init(AgsMatrix *matrix)
/* */
AGS_MACHINE(matrix)->flags |= (AGS_MACHINE_IS_SEQUENCER |
AGS_MACHINE_REVERSE_NOTATION);
+ AGS_MACHINE(matrix)->mapping_flags |= AGS_MACHINE_MONO;
+
matrix->flags = 0;
matrix->name = NULL;
diff --git a/src/ags/X/machine/ags_synth.c b/src/ags/X/machine/ags_synth.c
index 1f7030a..ce3f4f0 100644
--- a/src/ags/X/machine/ags_synth.c
+++ b/src/ags/X/machine/ags_synth.c
@@ -241,7 +241,8 @@ ags_synth_init(AgsSynth *synth)
G_CALLBACK(ags_synth_set_pads), synth);
AGS_MACHINE(synth)->flags |= AGS_MACHINE_IS_SYNTHESIZER;
-
+ AGS_MACHINE(synth)->mapping_flags |= AGS_MACHINE_MONO;
+
/* create widgets */
synth->flags = 0;
diff --git a/src/ags/audio/task/ags_scroll_on_play.c b/src/ags/audio/task/ags_scroll_on_play.c
index 23b71de..34e1158 100644
--- a/src/ags/audio/task/ags_scroll_on_play.c
+++ b/src/ags/audio/task/ags_scroll_on_play.c
@@ -165,48 +165,48 @@ ags_scroll_on_play_launch(AgsTask *task)
tact = gtk_spin_button_get_value(window->navigation->position_tact);
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
if(!gtk_toggle_button_get_active((GtkToggleButton *) window->navigation->loop) || tact <= loop_end){
- position = tact * AGS_NOTE_EDIT(editor->edit_widget)->control_current.control_width;
+ position = tact * AGS_NOTE_EDIT(editor->current_edit_widget)->control_current.control_width;
}else{
- position = loop_start * AGS_NOTE_EDIT(editor->edit_widget)->control_current.control_width;
+ position = loop_start * AGS_NOTE_EDIT(editor->current_edit_widget)->control_current.control_width;
}
/* scroll */
- if(position - (0.125 * AGS_NOTE_EDIT(editor->edit_widget)->control_current.control_width) > 0.0){
- gtk_range_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->edit_widget)->hscrollbar),
- position - (0.125 * AGS_NOTE_EDIT(editor->edit_widget)->control_current.control_width));
+ if(position - (0.125 * AGS_NOTE_EDIT(editor->current_edit_widget)->control_current.control_width) > 0.0){
+ gtk_range_set_value(GTK_RANGE(AGS_NOTE_EDIT(editor->current_edit_widget)->hscrollbar),
+ position - (0.125 * AGS_NOTE_EDIT(editor->current_edit_widget)->control_current.control_width));
}
/* draw fader */
cairo_push_group(cr);
- cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->edit_widget)->drawing_area)->window);
- ags_note_edit_draw_scroll(AGS_NOTE_EDIT(editor->edit_widget), cr,
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_NOTE_EDIT(editor->current_edit_widget)->drawing_area)->window);
+ ags_note_edit_draw_scroll(AGS_NOTE_EDIT(editor->current_edit_widget), cr,
position);
cairo_pop_group_to_source(cr);
cairo_paint(cr);
cairo_destroy(cr);
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
if(!gtk_toggle_button_get_active((GtkToggleButton *) window->navigation->loop) || tact <= loop_end){
- position = tact * AGS_PATTERN_EDIT(editor->edit_widget)->control_current.control_width;
+ position = tact * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width;
}else{
- position = loop_start * AGS_PATTERN_EDIT(editor->edit_widget)->control_current.control_width;
+ position = loop_start * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width;
}
/* scroll */
- if(position - (0.125 * AGS_PATTERN_EDIT(editor->edit_widget)->control_current.control_width) > 0.0){
- gtk_range_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->edit_widget)->hscrollbar),
- position - (0.125 * AGS_PATTERN_EDIT(editor->edit_widget)->control_current.control_width));
+ if(position - (0.125 * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width) > 0.0){
+ gtk_range_set_value(GTK_RANGE(AGS_PATTERN_EDIT(editor->current_edit_widget)->hscrollbar),
+ position - (0.125 * AGS_PATTERN_EDIT(editor->current_edit_widget)->control_current.control_width));
}
/* draw fader */
cairo_push_group(cr);
- cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->edit_widget)->drawing_area)->window);
- ags_pattern_edit_draw_scroll(AGS_PATTERN_EDIT(editor->edit_widget), cr,
+ cr = gdk_cairo_create(GTK_WIDGET(AGS_PATTERN_EDIT(editor->current_edit_widget)->drawing_area)->window);
+ ags_pattern_edit_draw_scroll(AGS_PATTERN_EDIT(editor->current_edit_widget), cr,
position);
cairo_pop_group_to_source(cr);
diff --git a/src/ags/file/ags_file_gui.c b/src/ags/file/ags_file_gui.c
index 6734e9d..3764295 100644
--- a/src/ags/file/ags_file_gui.c
+++ b/src/ags/file/ags_file_gui.c
@@ -2539,7 +2539,7 @@ ags_file_read_editor(AgsFile *file, xmlNode *node, AgsEditor **editor)
13)){
ags_file_read_notebook(file,
child,
- &(gobject->notebook));
+ &(gobject->current_notebook));
}
}
@@ -2592,10 +2592,10 @@ ags_file_read_editor_launch(AgsFileLaunch *file_launch,
tabs = machine->audio->audio_channels;
for(i = 0; i < tabs; i++){
- ags_notebook_add_tab(editor->notebook);
+ ags_notebook_add_tab(editor->current_notebook);
}
- list = editor->notebook->tabs;
+ list = editor->current_notebook->tabs;
while(list != NULL){
gtk_toggle_button_set_active(AGS_NOTEBOOK_TAB(list->data)->toggle,
@@ -2610,42 +2610,42 @@ ags_file_read_editor_launch(AgsFileLaunch *file_launch,
tact_factor = exp2(8.0 - (double) gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom));
tact = exp2((double) gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom) - 4.0);
- if(AGS_IS_NOTE_EDIT(editor->edit_widget)){
+ if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
/* reset note edit */
history = gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom);
editor->toolbar->zoom_history = history;
- AGS_NOTE_EDIT(editor->edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
- ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR |
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags |= AGS_NOTE_EDIT_RESETING_HORIZONTALLY;
+ ags_note_edit_reset_horizontally(AGS_NOTE_EDIT(editor->current_edit_widget), AGS_NOTE_EDIT_RESET_HSCROLLBAR |
AGS_NOTE_EDIT_RESET_WIDTH);
- AGS_NOTE_EDIT(editor->edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
+ AGS_NOTE_EDIT(editor->current_edit_widget)->flags &= (~AGS_NOTE_EDIT_RESETING_HORIZONTALLY);
/* reset ruler */
- AGS_NOTE_EDIT(editor->edit_widget)->ruler->factor = tact_factor;
- AGS_NOTE_EDIT(editor->edit_widget)->ruler->precision = tact;
- AGS_NOTE_EDIT(editor->edit_widget)->ruler->scale_precision = 1.0 / tact;
+ AGS_NOTE_EDIT(editor->current_edit_widget)->ruler->factor = tact_factor;
+ AGS_NOTE_EDIT(editor->current_edit_widget)->ruler->precision = tact;
+ AGS_NOTE_EDIT(editor->current_edit_widget)->ruler->scale_precision = 1.0 / tact;
- gtk_widget_queue_draw((GtkWidget *) AGS_NOTE_EDIT(editor->edit_widget)->ruler);
- gtk_widget_queue_draw((GtkWidget *) AGS_NOTE_EDIT(editor->edit_widget));
- }else if(AGS_IS_PATTERN_EDIT(editor->edit_widget)){
+ gtk_widget_queue_draw((GtkWidget *) AGS_NOTE_EDIT(editor->current_edit_widget)->ruler);
+ gtk_widget_queue_draw((GtkWidget *) AGS_NOTE_EDIT(editor->current_edit_widget));
+ }else if(AGS_IS_PATTERN_EDIT(editor->current_edit_widget)){
/* reset pattern edit */
history = gtk_combo_box_get_active((GtkComboBox *) editor->toolbar->zoom);
editor->toolbar->zoom_history = history;
- AGS_PATTERN_EDIT(editor->edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
- ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR |
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags |= AGS_PATTERN_EDIT_RESETING_HORIZONTALLY;
+ ags_pattern_edit_reset_horizontally(AGS_PATTERN_EDIT(editor->current_edit_widget), AGS_PATTERN_EDIT_RESET_HSCROLLBAR |
AGS_PATTERN_EDIT_RESET_WIDTH);
- AGS_PATTERN_EDIT(editor->edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->flags &= (~AGS_PATTERN_EDIT_RESETING_HORIZONTALLY);
/* reset ruler */
- AGS_PATTERN_EDIT(editor->edit_widget)->ruler->factor = tact_factor;
- AGS_PATTERN_EDIT(editor->edit_widget)->ruler->precision = tact;
- AGS_PATTERN_EDIT(editor->edit_widget)->ruler->scale_precision = 1.0 / tact;
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->ruler->factor = tact_factor;
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->ruler->precision = tact;
+ AGS_PATTERN_EDIT(editor->current_edit_widget)->ruler->scale_precision = 1.0 / tact;
- gtk_widget_queue_draw((GtkWidget *) AGS_PATTERN_EDIT(editor->edit_widget)->ruler);
- gtk_widget_queue_draw((GtkWidget *) AGS_PATTERN_EDIT(editor->edit_widget));
+ gtk_widget_queue_draw((GtkWidget *) AGS_PATTERN_EDIT(editor->current_edit_widget)->ruler);
+ gtk_widget_queue_draw((GtkWidget *) AGS_PATTERN_EDIT(editor->current_edit_widget));
}
}
@@ -2691,7 +2691,7 @@ ags_file_write_editor(AgsFile *file, xmlNode *parent, AgsEditor *editor)
/* child elements */
ags_file_write_machine_selector(file, node, editor->machine_selector);
ags_file_write_toolbar(file, node, editor->toolbar);
- ags_file_write_notebook(file, node, editor->notebook);
+ ags_file_write_notebook(file, node, editor->current_notebook);
}
void
diff --git a/src/ags/lib/ags_combo_box_text.c b/src/ags/lib/ags_combo_box_text.c
index 7da3d86..303c59c 100644
--- a/src/ags/lib/ags_combo_box_text.c
+++ b/src/ags/lib/ags_combo_box_text.c
@@ -38,14 +38,5 @@
*/
void
ags_combo_box_text_remove_all(GtkComboBoxText *combo_box){
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo_box));
-
- if(GTK_IS_LIST_STORE(model) && gtk_tree_model_get_iter_first(model, &iter)){
- do{
- gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
- }while(gtk_tree_model_iter_next(model, &iter));
- }
+ gtk_list_store_clear(GTK_LIST_STORE(gtk_combo_box_get_model(combo_box)));
}
--
gsequencer packaging
More information about the pkg-multimedia-commits
mailing list