[SCM] gsequencer/master: New upstream version 0.4.2.82
jkraehemann-guest at users.alioth.debian.org
jkraehemann-guest at users.alioth.debian.org
Fri Jun 26 01:27:48 UTC 2015
The following commit has been merged in the master branch:
commit 3ceae151d4465210bd98d30b71e9a8691340ca4b
Author: Joël Krähemann <jkraehemann-guest at users.alioth.debian.org>
Date: Fri Jun 26 03:22:06 2015 +0200
New upstream version 0.4.2.82
diff --git a/ChangeLog b/ChangeLog
index 53c3846..4bd8507 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+ags (0.4.2.82)
+
+ [ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
+ * fixed default device as reading XML files
+ * fixed floor to round in XSL for reading MIDI notes
+ * fixed unlink AgsAudio on remove
+ * fixed termination of sequencer in ags_machine_play_callback()
+ * fixed crash during channel resize if not shown in editor, hide widgets instead of remove
+ * fixed destroying of machines removing editor widget
+ * fixed paste notes
+ * added flag to AgsDevout to fix unavailable soundcard
+
ags (0.4.2.81)
[ Joël Krähemann (Maintainer of Advanced Gtk+ Sequencer) ]
diff --git a/ags.xsl b/ags.xsl
index dcbe5e2..754f006 100644
--- a/ags.xsl
+++ b/ags.xsl
@@ -89,7 +89,7 @@
<xsl:with-param name="current-tick" select="$current-tick"/>
</xsl:call-template>
</xsl:variable>
- <xsl:attribute name="x0"><xsl:value-of select="floor($x0)"/></xsl:attribute>
+ <xsl:attribute name="x0"><xsl:value-of select="round($x0)"/></xsl:attribute>
<xsl:if test="following-sibling::node()[@event='note-off' and @note='$y']">
<xsl:variable name="next-tick"><xsl:value-of select="following-sibling::node()[@event='note-off' and @note='$y']/@delta-time"/></xsl:variable>
@@ -107,7 +107,7 @@
<xsl:if test="not(following-sibling::ags-note[@event='note-off' and @note='$y'])">
<xsl:variable name="add-one" select="1"/>
- <xsl:attribute name="x1"><xsl:value-of select="floor($x0) + $add-one"/></xsl:attribute>
+ <xsl:attribute name="x1"><xsl:value-of select="round($x0) + $add-one"/></xsl:attribute>
</xsl:if>
</ags-note>
diff --git a/configure b/configure
index 484e65e..aa15929 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 gsequencer 0.4.2.81.
+# Generated by GNU Autoconf 2.69 for gsequencer 0.4.2.82.
#
# Report bugs to <jkraehemann-guest at users.alioth.debian.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gsequencer'
PACKAGE_TARNAME='gsequencer'
-PACKAGE_VERSION='0.4.2.81'
-PACKAGE_STRING='gsequencer 0.4.2.81'
+PACKAGE_VERSION='0.4.2.82'
+PACKAGE_STRING='gsequencer 0.4.2.82'
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 gsequencer 0.4.2.81 to adapt to many kinds of systems.
+\`configure' configures gsequencer 0.4.2.82 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 gsequencer 0.4.2.81:";;
+ short | recursive ) echo "Configuration of gsequencer 0.4.2.82:";;
esac
cat <<\_ACEOF
@@ -1523,7 +1523,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gsequencer configure 0.4.2.81
+gsequencer configure 0.4.2.82
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 gsequencer $as_me 0.4.2.81, which was
+It was created by gsequencer $as_me 0.4.2.82, 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='gsequencer'
- VERSION='0.4.2.81'
+ VERSION='0.4.2.82'
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 gsequencer $as_me 0.4.2.81, which was
+This file was extended by gsequencer $as_me 0.4.2.82, 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="\\
-gsequencer config.status 0.4.2.81
+gsequencer config.status 0.4.2.82
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 1fe8c1e..66a1a24 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([gsequencer],[0.4.2.81],[jkraehemann-guest at users.alioth.debian.org])
+AC_INIT([gsequencer],[0.4.2.82],[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 68f624a..d233073 100644
--- a/src/ags/X/ags_editor.c
+++ b/src/ags/X/ags_editor.c
@@ -388,12 +388,9 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
}
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);
+ gtk_widget_hide(editor->current_notebook);
+ gtk_widget_hide(editor->current_meter);
+ gtk_widget_hide(editor->current_edit_widget);
}
editor->current_notebook = NULL;
@@ -420,7 +417,10 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
if(child == NULL){
AgsEditorChild *editor_child;
+ guint y;
+ y = 2 * g_list_length(editor->editor_child);
+
editor_child = ags_editor_child_alloc(machine, NULL, NULL, NULL);
editor->editor_child = g_list_prepend(editor->editor_child,
editor_child);
@@ -432,7 +432,7 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
NULL);
g_object_ref(editor_child->notebook);
gtk_table_attach(editor->table, (GtkWidget *) editor_child->notebook,
- 0, 3, 0, 1,
+ 0, 3, y, y + 1,
GTK_FILL|GTK_EXPAND, GTK_FILL,
0, 0);
@@ -453,7 +453,7 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
editor->current_meter = ags_meter_new();
g_object_ref(editor_child->meter);
gtk_table_attach(editor->table, (GtkWidget *) editor_child->meter,
- 0, 1, 1, 2,
+ 0, 1, y + 1, y + 2,
GTK_FILL, GTK_FILL,
0, 0);
ags_connectable_connect(AGS_CONNECTABLE(editor_child->meter));
@@ -464,7 +464,7 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
editor->current_edit_widget = ags_note_edit_new();
g_object_ref(editor_child->edit_widget);
gtk_table_attach(editor->table, (GtkWidget *) editor_child->edit_widget,
- 1, 2, 1, 2,
+ 1, 2, y + 1, y + 2,
GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
0, 0);
@@ -478,7 +478,7 @@ ags_editor_real_machine_changed(AgsEditor *editor, AgsMachine *machine)
editor->current_edit_widget = ags_pattern_edit_new();
g_object_ref(editor_child->edit_widget);
gtk_table_attach(editor->table, (GtkWidget *) editor_child->edit_widget,
- 1, 2, 1, 2,
+ 1, 2, y + 1, y + 2,
GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND,
0, 0);
@@ -549,7 +549,6 @@ ags_editor_select_all(AgsEditor *editor)
GList *list_notation;
gint i;
- gint selected_channel;
if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
@@ -557,10 +556,10 @@ ags_editor_select_all(AgsEditor *editor)
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
ags_notation_add_all_to_selection(AGS_NOTATION(list_notation->data));
i++;
@@ -609,33 +608,48 @@ ags_editor_paste(AgsEditor *editor)
gchar *buffer;
guint position_x, position_y;
- guint last_x;
+ gint first_x, last_x;
gboolean paste_from_position;
+
+ auto gint ags_editor_paste_read_notation();
- void ags_editor_paste_read_notation(){
+ gint ags_editor_paste_read_notation(){
xmlXPathContextPtr xpathCtxt;
xmlXPathObjectPtr xpathObj;
xmlNodeSetPtr nodes;
GList *notation_list;
+ guint first_x;
+
xpathCtxt = xmlXPathNewContext(clipboard);
xpathObj = xmlXPathEvalExpression("/audio/notation\0", xpathCtxt);
+ first_x = -1;
+
if(xpathObj != NULL){
- int i, size;
+ int i, j, size;
guint audio_channel;
guint current_x;
nodes = xpathObj->nodesetval;
size = (nodes != NULL) ? nodes->nodeNr: 0;
+ j = 0;
for(i = 0; i < size; i++){
- audio_channel = (guint) g_ascii_strtoull(xmlGetProp(nodes->nodeTab[i],
- "audio-channel\0"),
- NULL,
- 10);
+
+ j = ags_notebook_next_active_tab(editor->current_notebook,
+ j);
+
+ if(j == -1){
+ break;
+ }
+
+ // audio_channel = (guint) g_ascii_strtoull(xmlGetProp(nodes->nodeTab[i],
+ // "audio-channel\0"),
+ // NULL,
+ // 10);
notation_list = g_list_nth(machine->audio->notation,
- audio_channel);
+ j);
if(notation_list == NULL){
break;
@@ -680,6 +694,10 @@ ags_editor_paste(AgsEditor *editor)
NULL,
10);
+
+ if(first_x == -1 || x_boundary < first_x){
+ first_x = x_boundary;
+ }
if(position_x > x_boundary){
current_x += (position_x - x_boundary);
@@ -730,6 +748,8 @@ ags_editor_paste(AgsEditor *editor)
xmlXPathFreeObject(xpathObj);
}
+
+ return(first_x);
}
if((machine = editor->selected_machine) != NULL && editor->current_edit_widget != NULL){
@@ -764,20 +784,27 @@ ags_editor_paste(AgsEditor *editor)
NULL, "UTF-8\0",
0);
audio_node = xmlDocGetRootElement(clipboard);
+
+ first_x = -1;
/* iterate xml tree */
while(audio_node != NULL){
if(audio_node->type == XML_ELEMENT_NODE && !xmlStrncmp("audio\0", audio_node->name, 6)){
+
notation_node = audio_node->children;
- ags_editor_paste_read_notation();
-
+ first_x = ags_editor_paste_read_notation();
+
break;
}
audio_node = audio_node->next;
}
+ if(first_x == -1){
+ first_x = 0;
+ }
+
xmlFreeDoc(clipboard);
if(AGS_IS_NOTE_EDIT(editor->current_edit_widget)){
@@ -788,7 +815,17 @@ ags_editor_paste(AgsEditor *editor)
ags_note_edit_draw_notation(editor->current_edit_widget, cr);
if(paste_from_position){
- AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
+ gint big_step, small_step;
+
+ big_step = (guint) ceil((double) last_x * AGS_NOTATION_MINIMUM_NOTE_LENGTH) / AGS_NOTATION_MINIMUM_NOTE_LENGTH + (AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x % (guint) (1 / AGS_NOTATION_MINIMUM_NOTE_LENGTH));
+ small_step = (guint) big_step - (1 / AGS_NOTATION_MINIMUM_NOTE_LENGTH);
+
+ if(small_step < last_x){
+ AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = big_step;
+ }else{
+ AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = small_step;
+ }
+
ags_note_edit_draw_position(AGS_NOTE_EDIT(editor->current_edit_widget), cr);
}
@@ -802,7 +839,17 @@ ags_editor_paste(AgsEditor *editor)
ags_pattern_edit_draw_notation(editor->current_edit_widget, cr);
if(paste_from_position){
- AGS_PATTERN_EDIT(editor->current_edit_widget)->selected_x = (guint) ceil((double) last_x / 16.0) * 16;
+ gint big_step, small_step;
+
+ big_step = (guint) ceil((double) last_x * AGS_NOTATION_MINIMUM_NOTE_LENGTH) / AGS_NOTATION_MINIMUM_NOTE_LENGTH + (AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x % (guint) (1 / AGS_NOTATION_MINIMUM_NOTE_LENGTH));
+ small_step = (guint) big_step - (1 / AGS_NOTATION_MINIMUM_NOTE_LENGTH);
+
+ if(small_step < last_x){
+ AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = big_step;
+ }else{
+ AGS_NOTE_EDIT(editor->current_edit_widget)->selected_x = small_step;
+ }
+
ags_pattern_edit_draw_position(AGS_PATTERN_EDIT(editor->current_edit_widget), cr);
}
@@ -834,7 +881,6 @@ ags_editor_copy(AgsEditor *editor)
xmlChar *buffer;
int size;
gint i;
- gint selected_channel;
if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
@@ -849,10 +895,10 @@ ags_editor_copy(AgsEditor *editor)
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
notation_node = ags_notation_copy_selection(AGS_NOTATION(list_notation->data));
@@ -895,7 +941,6 @@ ags_editor_cut(AgsEditor *editor)
xmlChar *buffer;
int size;
gint i;
- gint selected_channel;
if(editor->selected_machine != NULL && editor->current_edit_widget != NULL){
machine = editor->selected_machine;
@@ -919,10 +964,10 @@ ags_editor_cut(AgsEditor *editor)
cairo_push_group(cr);
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
notation_node = ags_notation_cut_selection(AGS_NOTATION(list_notation->data));
@@ -965,7 +1010,6 @@ ags_editor_invert(AgsEditor *editor)
int size;
gint i;
- gint selected_channel;
auto void ags_editor_invert_notation(AgsNotation *notation);
@@ -1024,10 +1068,10 @@ ags_editor_invert(AgsEditor *editor)
cairo_push_group(cr);
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
ags_editor_invert_notation(AGS_NOTATION(list_notation->data));
diff --git a/src/ags/X/ags_machine.c b/src/ags/X/ags_machine.c
index f474f9c..9ab7d64 100644
--- a/src/ags/X/ags_machine.c
+++ b/src/ags/X/ags_machine.c
@@ -817,9 +817,11 @@ ags_machine_set_run(AgsMachine *machine,
}
/**
- * ags_machine_set_run:
+ * ags_machine_set_run_extended:
* @machine: the #AgsMachine
* @run: if %TRUE playback is started, otherwise stopped
+ * @sequencer:
+ * @notation:
*
* Start/stop playback of @machine.
*
diff --git a/src/ags/X/ags_machine_callbacks.c b/src/ags/X/ags_machine_callbacks.c
index 9362aed..05eda23 100644
--- a/src/ags/X/ags_machine_callbacks.c
+++ b/src/ags/X/ags_machine_callbacks.c
@@ -36,8 +36,10 @@
#include <ags/audio/task/ags_remove_audio.h>
#include <ags/X/ags_window.h>
+#include <ags/X/ags_editor.h>
#include <ags/X/ags_machine_editor.h>
+#include <ags/X/editor/ags_machine_radio_button.h>
#include <ags/X/editor/ags_file_selection.h>
int ags_machine_popup_rename_response_callback(GtkWidget *widget, gint response, AgsMachine *machine);
@@ -125,7 +127,8 @@ ags_machine_popup_destroy_activate_callback(GtkWidget *widget, AgsMachine *machi
{
AgsWindow *window;
AgsRemoveAudio *remove_audio;
-
+ GList *list, *list_start;
+
window = (AgsWindow *) gtk_widget_get_toplevel((GtkWidget *) machine);
remove_audio = ags_remove_audio_new(window->devout,
@@ -134,6 +137,38 @@ ags_machine_popup_destroy_activate_callback(GtkWidget *widget, AgsMachine *machi
AGS_TASK(remove_audio));
ags_connectable_disconnect(AGS_CONNECTABLE(machine));
+
+ /* destroy editor */
+ list = window->editor->editor_child;
+
+ while(list != NULL){
+ if(AGS_EDITOR_CHILD(list->data)->machine == 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;
+ }
+
+ list =
+ list_start = gtk_container_get_children(window->editor->machine_selector);
+
+ list = list->next;
+
+ while(list != NULL){
+ if(AGS_IS_MACHINE_RADIO_BUTTON(list->data) && AGS_MACHINE_RADIO_BUTTON(list->data)->machine == machine){
+ gtk_widget_destroy(list->data);
+ break;
+ }
+
+ list = list->next;
+ }
+
+ g_list_free(list_start);
+
+ /* destroy machine */
gtk_widget_destroy((GtkWidget *) machine);
}
@@ -501,13 +536,13 @@ ags_machine_play_callback(GtkWidget *toggle_button, AgsMachine *machine)
printf("machine: off\n\0");
- machine->flags |= AGS_MACHINE_BLOCK_STOP;
+ // machine->flags |= AGS_MACHINE_BLOCK_STOP;
ags_machine_set_run_extended(machine,
FALSE,
TRUE, FALSE);
- machine->flags &= (~AGS_MACHINE_BLOCK_STOP);
+ // machine->flags &= (~AGS_MACHINE_BLOCK_STOP);
}
}
diff --git a/src/ags/X/editor/ags_machine_selector.c b/src/ags/X/editor/ags_machine_selector.c
index c6f91d8..0a731be 100644
--- a/src/ags/X/editor/ags_machine_selector.c
+++ b/src/ags/X/editor/ags_machine_selector.c
@@ -153,7 +153,24 @@ ags_machine_selector_init(AgsMachineSelector *machine_selector)
void
ags_machine_selector_connect(AgsConnectable *connectable)
{
- //TODO:JK: implement me
+ AgsMachineSelector *machine_selector;
+ GList *list, *list_start;
+
+ machine_selector = AGS_MACHINE_SELECTOR(connectable);
+
+ list =
+ list_start = gtk_container_get_children(machine_selector);
+
+ list = list->next;
+
+ while(list != NULL){
+ g_signal_connect_after(G_OBJECT(list->data), "clicked\0",
+ G_CALLBACK(ags_machine_selector_radio_changed), machine_selector);
+
+ list = list->next;
+ }
+
+ g_list_free(list_start);
}
void
diff --git a/src/ags/X/editor/ags_note_edit_callbacks.c b/src/ags/X/editor/ags_note_edit_callbacks.c
index c779f46..48a87d7 100644
--- a/src/ags/X/editor/ags_note_edit_callbacks.c
+++ b/src/ags/X/editor/ags_note_edit_callbacks.c
@@ -328,7 +328,6 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
guint note_x, note_y;
guint note_offset_x1;
gint i;
- gint selected_channel;
if(note_edit->control.x0 >= note_edit->map_width)
note_edit->control.x0 = note_edit->map_width - 1;
@@ -347,10 +346,10 @@ 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->current_notebook,
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
@@ -430,7 +429,6 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
guint x, y;
gint history;
gint i;
- gint selected_channel;
x = note_edit->control.x0_offset + note_edit->control.x0 - 1;
y = note_edit->control.y0_offset + note_edit->control.y0;
@@ -444,10 +442,10 @@ 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->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
@@ -466,7 +464,6 @@ ags_note_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventButto
guint x0, x1, y0, y1;
gint i;
- gint selected_channel;
/* get real size and offset */
x0 = note_edit->control.x0_offset + note_edit->control.x0;
@@ -504,10 +501,10 @@ 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->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
diff --git a/src/ags/X/editor/ags_pattern_edit_callbacks.c b/src/ags/X/editor/ags_pattern_edit_callbacks.c
index d136acf..ea660e9 100644
--- a/src/ags/X/editor/ags_pattern_edit_callbacks.c
+++ b/src/ags/X/editor/ags_pattern_edit_callbacks.c
@@ -323,10 +323,10 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
void ags_pattern_edit_drawing_area_button_release_event_set_control(){
GList *list_notation;
+ gint i;
guint note_x, note_y;
guint note_offset_x1;
gint history;
- gint selected_channel;
if(pattern_edit->control.x0 >= pattern_edit->map_width)
pattern_edit->control.x0 = pattern_edit->map_width - 1;
@@ -342,14 +342,12 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
list_notation = machine->audio->notation;
- gint i;
-
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
@@ -426,7 +424,6 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
GList *list_notation;
guint x, y;
gint history;
- gint selected_channel;
gint i;
x = pattern_edit->control.x0_offset + pattern_edit->control.x0 - 1;
@@ -441,10 +438,10 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
list_notation = machine->audio->notation;
i = 0;
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
@@ -461,7 +458,6 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
void ags_pattern_edit_drawing_area_button_release_event_select_region(){
GList *list_notation;
guint x0, x1, y0, y1;
- gint selected_channel;
gint i;
/* get real size and offset */
@@ -499,10 +495,10 @@ ags_pattern_edit_drawing_area_button_release_event(GtkWidget *widget, GdkEventBu
/* select notes */
list_notation = machine->audio->notation;
- while((selected_channel = ags_notebook_next_active_tab(editor->current_notebook,
- i)) != -1){
+ while((i = ags_notebook_next_active_tab(editor->current_notebook,
+ i)) != -1){
list_notation = g_list_nth(machine->audio->notation,
- selected_channel);
+ i);
if(list_notation == NULL){
i++;
diff --git a/src/ags/X/machine/ags_synth.c b/src/ags/X/machine/ags_synth.c
index 4c511b9..6182449 100644
--- a/src/ags/X/machine/ags_synth.c
+++ b/src/ags/X/machine/ags_synth.c
@@ -227,8 +227,7 @@ ags_synth_init(AgsSynth *synth)
audio = AGS_MACHINE(synth)->audio;
audio->flags |= (AGS_AUDIO_ASYNC |
AGS_AUDIO_OUTPUT_HAS_RECYCLING |
- AGS_AUDIO_INPUT_HAS_RECYCLING |
- AGS_AUDIO_HAS_NOTATION);
+ AGS_AUDIO_INPUT_HAS_RECYCLING);
AGS_MACHINE(synth)->input_pad_type = AGS_TYPE_SYNTH_INPUT_PAD;
AGS_MACHINE(synth)->input_line_type = AGS_TYPE_SYNTH_INPUT_LINE;
@@ -241,7 +240,7 @@ ags_synth_init(AgsSynth *synth)
g_signal_connect_after(G_OBJECT(AGS_MACHINE(synth)->audio), "set_pads\0",
G_CALLBACK(ags_synth_set_pads), synth);
- AGS_MACHINE(synth)->flags |= AGS_MACHINE_IS_SYNTHESIZER;
+ // AGS_MACHINE(synth)->flags |= AGS_MACHINE_IS_SYNTHESIZER;
AGS_MACHINE(synth)->mapping_flags |= AGS_MACHINE_MONO;
/* create widgets */
@@ -451,6 +450,9 @@ ags_synth_read(AgsFile *file, xmlNode *node, AgsPlugin *plugin)
"reference\0", gobject,
NULL));
+ /* fix wrong flag */
+ AGS_MACHINE(gobject)->flags &= (~AGS_MACHINE_IS_SYNTHESIZER);
+
list = file->lookup;
while((list = ags_file_lookup_find_by_node(list,
diff --git a/src/ags/audio/ags_devout.c b/src/ags/audio/ags_devout.c
index cbc9876..455df84 100644
--- a/src/ags/audio/ags_devout.c
+++ b/src/ags/audio/ags_devout.c
@@ -1421,6 +1421,8 @@ ags_devout_alsa_init(AgsDevout *devout,
devout->delay_counter = 0.0;
devout->tic_counter = 0;
+ devout->flags |= AGS_DEVOUT_INITIALIZED;
+
pthread_mutex_unlock(mutex);
}
@@ -1444,6 +1446,12 @@ ags_devout_alsa_play(AgsDevout *devout,
pthread_mutex_unlock(&(ags_application_mutex));
pthread_mutex_lock(mutex);
+
+ if((AGS_DEVOUT_INITIALIZED & (devout->flags)) == 0){
+ pthread_mutex_unlock(mutex);
+
+ return;
+ }
/* */
if((AGS_DEVOUT_BUFFER0 & (devout->flags)) != 0){
@@ -1631,6 +1639,10 @@ ags_devout_alsa_free(AgsDevout *devout)
pthread_mutex_unlock(&(ags_application_mutex));
+ if((AGS_DEVOUT_INITIALIZED & (devout->flags)) == 0){
+ return;
+ }
+
// pthread_mutex_lock(mutex);
snd_pcm_drain(devout->out.alsa.handle);
@@ -1638,6 +1650,7 @@ ags_devout_alsa_free(AgsDevout *devout)
devout->out.alsa.handle = NULL;
devout->tact_counter = 0.0;
+ devout->flags &= (~AGS_DEVOUT_INITIALIZED);
// pthread_mutex_unlock(mutex);
}
diff --git a/src/ags/audio/ags_devout.h b/src/ags/audio/ags_devout.h
index 9ef7547..9bad3fe 100644
--- a/src/ags/audio/ags_devout.h
+++ b/src/ags/audio/ags_devout.h
@@ -86,8 +86,7 @@ typedef enum
AGS_DEVOUT_NONBLOCKING = 1 << 11,
- AGS_DEVOUT_TIMING_SET_0 = 1 << 12,
- AGS_DEVOUT_TIMING_SET_1 = 1 << 13,
+ AGS_DEVOUT_INITIALIZED = 1 << 14,
}AgsDevoutFlags;
typedef enum
diff --git a/src/ags/audio/ags_notation.c b/src/ags/audio/ags_notation.c
index 0a4c494..64bd067 100644
--- a/src/ags/audio/ags_notation.c
+++ b/src/ags/audio/ags_notation.c
@@ -1289,7 +1289,7 @@ ags_notation_insert_native_piano_from_clipboard(AgsNotation *notation,
if(errno == ERANGE){
goto dont_reset_x_offset;
}
-
+
if(x_boundary == endptr){
goto dont_reset_x_offset;
}
diff --git a/src/ags/audio/ags_recall_channel_run.c b/src/ags/audio/ags_recall_channel_run.c
index a39362e..c83d3b7 100644
--- a/src/ags/audio/ags_recall_channel_run.c
+++ b/src/ags/audio/ags_recall_channel_run.c
@@ -770,21 +770,11 @@ ags_recall_channel_run_duplicate(AgsRecall *recall,
guint *n_params, GParameter *parameter)
{
AgsAudio *audio;
- AgsChannel *output, *destination;;
+ AgsChannel *output;
AgsRecallChannelRun *recall_channel_run, *copy;
AgsRecallID *output_recall_id;
recall_channel_run = AGS_RECALL_CHANNEL_RUN(recall);
-
- if(g_type_is_a(G_OBJECT_TYPE(recall_channel_run->source), AGS_TYPE_OUTPUT)){
- destination = NULL;
- }else{
- if(recall_id->recycling_container->parent != NULL){
- destination = AGS_RECYCLING(AGS_RECALL_ID(recall_id->recycling_container->parent->recall_id)->recycling)->channel;
- }else{
- destination = NULL;
- }
- }
parameter = ags_parameter_grow(G_OBJECT_TYPE(recall),
parameter, n_params,
@@ -792,7 +782,6 @@ ags_recall_channel_run_duplicate(AgsRecall *recall,
"recall_channel\0", recall_channel_run->recall_channel,
"audio_channel\0", recall_channel_run->audio_channel,
"source\0", recall_channel_run->source,
- "destination\0", destination,
NULL);
copy = AGS_RECALL_CHANNEL_RUN(AGS_RECALL_CLASS(ags_recall_channel_run_parent_class)->duplicate(recall,
recall_id,
diff --git a/src/ags/audio/recall/ags_buffer_channel_run.c b/src/ags/audio/recall/ags_buffer_channel_run.c
index 19ba630..6356803 100644
--- a/src/ags/audio/recall/ags_buffer_channel_run.c
+++ b/src/ags/audio/recall/ags_buffer_channel_run.c
@@ -24,11 +24,14 @@
#include <ags/main.h>
+#include <ags/lib/ags_parameter.h>
+
#include <ags/object/ags_dynamic_connectable.h>
#include <ags/object/ags_plugin.h>
#include <ags/audio/ags_devout.h>
#include <ags/audio/ags_audio.h>
+#include <ags/audio/ags_output.h>
#include <ags/audio/ags_recycling.h>
#include <ags/audio/ags_recall_id.h>
@@ -229,9 +232,27 @@ ags_buffer_channel_run_duplicate(AgsRecall *recall,
AgsRecallID *recall_id,
guint *n_params, GParameter *parameter)
{
+ AgsOutput *destination;
AgsBufferChannelRun *buffer_channel_run, *copy;
- buffer_channel_run = (AgsBufferChannelRun *) recall;
+ buffer_channel_run = (AgsBufferChannelRun *) recall;
+
+ if(AGS_IS_OUTPUT(AGS_RECALL_CHANNEL_RUN(recall)->source) ||
+ (AGS_AUDIO_OUTPUT_HAS_RECYCLING & (AGS_AUDIO(AGS_RECALL_CHANNEL_RUN(recall)->source->audio)->flags)) == 0){
+ destination = NULL;
+ }else{
+ if(recall_id->recycling_container->parent != NULL){
+ destination = AGS_RECYCLING(AGS_RECALL_ID(recall_id->recycling_container->parent->recall_id)->recycling)->channel;
+
+ parameter = ags_parameter_grow(G_OBJECT_TYPE(recall),
+ parameter, n_params,
+ "destination\0", destination,
+ NULL);
+ }else{
+ destination = NULL;
+ }
+ }
+
copy = (AgsBufferChannelRun *) AGS_RECALL_CLASS(ags_buffer_channel_run_parent_class)->duplicate(recall,
recall_id,
n_params, parameter);
diff --git a/src/ags/audio/task/ags_remove_audio.c b/src/ags/audio/task/ags_remove_audio.c
index 6d7acdb..66e3232 100644
--- a/src/ags/audio/task/ags_remove_audio.c
+++ b/src/ags/audio/task/ags_remove_audio.c
@@ -143,9 +143,30 @@ void
ags_remove_audio_launch(AgsTask *task)
{
AgsRemoveAudio *remove_audio;
-
+ AgsChannel *current;
+
remove_audio = AGS_REMOVE_AUDIO(task);
+ current = remove_audio->audio->output;
+
+ while(current != NULL){
+ ags_channel_set_link(current,
+ NULL,
+ NULL);
+
+ current = current->next;
+ }
+
+ current = remove_audio->audio->input;
+
+ while(current != NULL){
+ ags_channel_set_link(current,
+ NULL,
+ NULL);
+
+ current = current->next;
+ }
+
/* remove audio */
ags_devout_remove_audio(remove_audio->devout,
G_OBJECT(remove_audio->audio));
diff --git a/src/ags/file/ags_file.c b/src/ags/file/ags_file.c
index dd472e2..70062f7 100644
--- a/src/ags/file/ags_file.c
+++ b/src/ags/file/ags_file.c
@@ -1085,7 +1085,7 @@ ags_file_real_read(AgsFile *file)
ags_file_read_resolve(file);
gtk_window_set_title((GtkWindow *) ags_main->window,
- g_strconcat("ags - \0",
+ g_strconcat("GSequencer - \0",
ags_main->window->name,
NULL));
gtk_widget_show_all(GTK_WIDGET(ags_main->window));
diff --git a/src/ags/file/ags_file_gui.c b/src/ags/file/ags_file_gui.c
index 7de1477..98bba2a 100644
--- a/src/ags/file/ags_file_gui.c
+++ b/src/ags/file/ags_file_gui.c
@@ -137,6 +137,8 @@ ags_file_read_window(AgsFile *file, xmlNode *node, AgsWindow **window)
if(str != NULL){
gobject->name = (gchar *) g_strdup(str);
+ }else{
+ gobject->name = (gchar *) g_strdup(file->filename);
}
/* devout */
@@ -2928,7 +2930,8 @@ ags_file_read_machine_selector_resolve_parameter(AgsFileLookup *file_lookup,
if(G_VALUE_HOLDS(value, G_TYPE_OBJECT)){
AgsMachineRadioButton *machine_radio_button;
-
+ GList *list;
+
gobject = g_value_get_object(value);
if(gobject == NULL){
@@ -2938,21 +2941,26 @@ ags_file_read_machine_selector_resolve_parameter(AgsFileLookup *file_lookup,
editor = (AgsEditor *) gtk_widget_get_ancestor((GtkWidget *) machine_selector,
AGS_TYPE_EDITOR);
+ list = gtk_container_get_children(machine_selector);
+
machine_radio_button = g_object_new(AGS_TYPE_MACHINE_RADIO_BUTTON,
NULL);
gtk_box_pack_start(GTK_BOX(machine_selector),
(GtkWidget *) machine_radio_button,
FALSE, FALSE,
0);
- g_object_set(machine_radio_button,
- "machine\0", gobject,
- NULL);
-
- if(editor->selected_machine == NULL){
- ags_editor_machine_changed(editor,
- (AgsMachine *) gobject);
+ if(list->next != NULL){
+ g_object_set(machine_radio_button,
+ "group\0", list->next->data,
+ "machine\0", gobject,
+ NULL);
+ }else{
+ g_object_set(machine_radio_button,
+ "machine\0", gobject,
+ NULL);
}
+ g_list_free(list);
}
}
diff --git a/src/ags/file/ags_file_sound.c b/src/ags/file/ags_file_sound.c
index d428016..a357375 100644
--- a/src/ags/file/ags_file_sound.c
+++ b/src/ags/file/ags_file_sound.c
@@ -283,13 +283,23 @@ ags_file_read_devout(AgsFile *file, xmlNode *node, AgsDevout **devout)
}else{
gobject->delay_counter = 0;
}
+
+ str = xmlGetProp(node, "device\0");
if((AGS_DEVOUT_LIBAO & (gobject->flags)) != 0){
//TODO:JK: implement me
}else if((AGS_DEVOUT_OSS & (gobject->flags)) != 0){
- gobject->out.oss.device = xmlGetProp(node, "device\0");
+ if(str != NULL){
+ gobject->out.oss.device = g_strdup(str);
+ }else{
+ gobject->out.oss.device = g_strdup("/dev/dsp\0");
+ }
}else if((AGS_DEVOUT_ALSA & (gobject->flags)) != 0){
- gobject->out.alsa.device = xmlGetProp(node, "device\0");
+ if(str != NULL){
+ gobject->out.alsa.device = g_strdup(str);
+ }else{
+ gobject->out.alsa.device = g_strdup("default\0");
+ }
}
}
diff --git a/src/ags/lib/ags_parameter.c b/src/ags/lib/ags_parameter.c
index becab8b..de34d69 100644
--- a/src/ags/lib/ags_parameter.c
+++ b/src/ags/lib/ags_parameter.c
@@ -1,10 +1,10 @@
/* GSequencer - Advanced GTK Sequencer
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <ags/lib/ags_parameter.h>
--
gsequencer packaging
More information about the pkg-multimedia-commits
mailing list