Hello community, here is the log from the commit of package aseqview checked in at Tue Apr 3 20:54:48 CEST 2007. -------- --- aseqview/aseqview.changes 2007-03-29 16:49:24.000000000 +0200 +++ /mounts/work_src_done/STABLE/aseqview/aseqview.changes 2007-04-03 15:13:03.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Apr 3 15:12:35 CEST 2007 - tiwai@suse.de + +- updated to version 0.2.6: + * Fix segfault with thread mode (silly typo) + * Add mute-control feature by TAMUKI Shoichi + +------------------------------------------------------------------- Old: ---- aseqview-0.2.5.tar.bz2 New: ---- aseqview-0.2.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aseqview.spec ++++++ --- /var/tmp/diff_new_pack.i20490/_old 2007-04-03 20:54:35.000000000 +0200 +++ /var/tmp/diff_new_pack.i20490/_new 2007-04-03 20:54:35.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package aseqview (Version 0.2.5) +# spec file for package aseqview (Version 0.2.6) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -13,7 +13,7 @@ Name: aseqview BuildRequires: alsa-devel gtk2-devel update-desktop-files Summary: ALSA Sequencer Event Viewer -Version: 0.2.5 +Version: 0.2.6 Release: 1 License: GNU General Public License (GPL) Group: Productivity/Multimedia/Sound/Midi @@ -43,9 +43,7 @@ %build %{?suse_update_config:%{suse_update_config -f}} autoreconf --force --install -CFLAGS="$RPM_OPT_FLAGS" \ -./configure --prefix=%{_prefix} --mandir=%{_mandir} \ - --enable-gtk2 +%configure --enable-gtk2 make %install @@ -68,6 +66,10 @@ %{_datadir}/pixmaps/*.png %changelog +* Tue Apr 03 2007 - tiwai@suse.de +- updated to version 0.2.6: + * Fix segfault with thread mode (silly typo) + * Add mute-control feature by TAMUKI Shoichi * Thu Mar 29 2007 - tiwai@suse.de - fix races in thread mode * Mon Mar 26 2007 - tiwai@suse.de ++++++ aseqview-0.2.5.tar.bz2 -> aseqview-0.2.6.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.5/aseqview.c new/aseqview-0.2.6/aseqview.c --- old/aseqview-0.2.5/aseqview.c 2007-03-29 16:28:20.000000000 +0200 +++ new/aseqview-0.2.6/aseqview.c 2007-04-03 15:05:14.000000000 +0200 @@ -90,8 +90,9 @@ int midi_mode; int temper_keysig; int timer_update, queue; + int temper_type_mute; int pitch_adj, vel_scale; - GtkWidget *w_midi_mode, *w_temper_keysig, *w_time; + GtkWidget *w_midi_mode, *w_temper_keysig, *w_time, *w_tt_button[8]; GdkPixmap *w_gm_xpm, *w_gs_xpm, *w_xg_xpm; GdkPixmap *w_gm_xpm_off, *w_gs_xpm_off, *w_xg_xpm_off; GdkPixmap *w_tk_xpm[32], *w_tk_xpm_adj[32], *w_tt_xpm[9]; @@ -111,6 +112,7 @@ }; enum { + UPDATE_MUTE, VEL_COLOR, UPDATE_STATUS, NOTE_ON, @@ -119,7 +121,8 @@ UPDATE_PGM, UPDATE_MODE, UPDATE_TEMPER_KEYSIG, - UPDATE_TEMPER_TYPE + UPDATE_TEMPER_TYPE, + HIDE_TT_BUTTON }; enum { @@ -147,6 +150,7 @@ static int expose_temper_keysig(GtkWidget *); static int expose_temper_type(GtkWidget *); static int update_time(GtkWidget *); +static void suppress_temper_type(GtkToggleButton *, midi_status_t *); static GtkWidget *create_pitch_changer(midi_status_t *); static void adjust_pitch(GtkAdjustment *, midi_status_t *); static GtkWidget *create_velocity_changer(midi_status_t *); @@ -171,6 +175,7 @@ static void reset_all(midi_status_t *, int); static void send_resets(channel_status_t *); static int is_redirect(port_status_t *); +static void av_mute_update(GtkWidget *, int, int); static void set_vel_bar_color(GtkWidget *, int, int); static void av_channel_update(GtkWidget *, int, int); static void av_note_update(GtkWidget *, int, int, int); @@ -179,6 +184,7 @@ static void display_midi_mode(GtkWidget *, int); static void display_temper_keysig(GtkWidget *, int); static void display_temper_type(GtkWidget *, int); +static void av_hide_tt_button(GtkWidget *, int, int); static void av_ringbuf_init(void); static int av_ringbuf_read(int *, GtkWidget **, long *); static int av_ringbuf_write(int, GtkWidget *, long); @@ -613,10 +619,12 @@ static GtkWidget *display_midi_init(GtkWidget *window, midi_status_t *st) { int i; - GtkWidget *vbox, *hbox, *w; + GtkWidget *vbox, *hbox, *w, *table; + gchar *tmp[] = { "eq.", "Py.", "mt.", "pu.", "u0", "u1", "u2", "u3" }; st->midi_mode = MIDI_MODE_GM; st->temper_keysig = TEMPER_UNKNOWN; + st->temper_type_mute = 0; st->w_gm_xpm = create_midi_pixmap(window, gm_bits, gm_width, gm_height, 1, NULL); st->w_gs_xpm = create_midi_pixmap(window, @@ -640,6 +648,7 @@ tt_bits[i], tt_width, tt_height, 2, tt_rgb[i]); vbox = gtk_vbox_new(FALSE, 0); hbox = gtk_hbox_new(FALSE, 0); + gtk_container_border_width(GTK_CONTAINER(hbox), 10); w = st->w_midi_mode = gtk_drawing_area_new(); gtk_drawing_area_size(GTK_DRAWING_AREA(w), gm_width + gs_width + xg_width + 20, gm_height); @@ -659,11 +668,28 @@ gtk_widget_show(w); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); gtk_widget_show(hbox); + hbox = gtk_hbox_new(FALSE, 0); + gtk_container_border_width(GTK_CONTAINER(hbox), 10); w = st->w_time = gtk_label_new("00:00"); gtk_object_set_user_data(GTK_OBJECT(w), st); gtk_timeout_add(1000, (GtkFunction) update_time, (gpointer) w); - gtk_box_pack_start(GTK_BOX(vbox), w, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(hbox), w, TRUE, TRUE, 0); gtk_widget_show(w); + table = gtk_table_new(4, 2, FALSE); + for (i = 0; i < 8; i++) { + w = st->w_tt_button[i] = gtk_toggle_button_new_with_label(tmp[i]); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), FALSE); + gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(w), TRUE); + gtk_signal_connect(GTK_OBJECT(w), "clicked", + GTK_SIGNAL_FUNC(suppress_temper_type), st); + gtk_table_attach_defaults(GTK_TABLE(table), + w, i % 4, i % 4 + 1, i / 4, i / 4 + 1); + gtk_widget_show(w); + } + gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0); + gtk_widget_show(table); + gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); + gtk_widget_show(hbox); return vbox; } @@ -752,7 +778,7 @@ int x_ofs = (width - tt_width) / 2; int y_ofs = (height - tt_height - 6) / 2; - i = (tk == TEMPER_UNKNOWN) ? 0 : ((tt < 0x40) ? tt : tt - 0x3c) + 1; + i = (tk == TEMPER_UNKNOWN) ? 0 : tt - ((tt >= 0x40) ? 0x3c : 0) + 1; p = st->w_tt_xpm[i]; gdk_draw_pixmap(w->window, w->style->fg_gc[GTK_STATE_NORMAL], p, 0, 0, x_ofs, y_ofs, tt_width, tt_height); @@ -791,6 +817,29 @@ } /* + */ +static void suppress_temper_type(GtkToggleButton *w, midi_status_t *st) +{ + int i, p; + port_status_t *port; + channel_status_t *chst; + + for (i = 0; i < 8; i++) + if (w == GTK_TOGGLE_BUTTON(st->w_tt_button[i])) + st->temper_type_mute ^= 1 << i; + for (p = 0; p < st->num_ports; p++) { + if ((port = &st->ports[p])->index < 0) + continue; + for (i = 0; i < MIDI_CHANNELS; i++) { + chst = &port->ch[i]; + av_mute_update(chst->w_chnum, + st->temper_type_mute & 1 << chst->temper_type + - ((chst->temper_type >= 0x40) ? 0x3c : 0), use_thread); + } + } +} + +/* * create pitch changer */ static GtkWidget *create_pitch_changer(midi_status_t *st) @@ -988,17 +1037,14 @@ { int key, vel, key_saved, vel_saved; - if (snd_seq_ev_is_channel_type(ev)) { - /* normal MIDI events - check channel */ - if (ev->data.note.channel >= MIDI_CHANNELS) - return; - /* abondoned if muted */ + /* normal MIDI events - check channel */ + if (snd_seq_ev_is_channel_type(ev) + && ev->data.note.channel >= MIDI_CHANNELS) + return; + if (snd_seq_ev_is_note_type(ev)) { + /* abandoned if muted */ if (port->ch[ev->data.note.channel].mute) return; - } - snd_seq_ev_set_direct(ev); - snd_seq_ev_set_subs(ev); - if (snd_seq_ev_is_note_type(ev)) { /* modify key / velocity for note events */ key_saved = ev->data.note.note; vel_saved = ev->data.note.velocity; @@ -1012,11 +1058,16 @@ vel = 127; ev->data.note.note = key; ev->data.note.velocity = vel; + snd_seq_ev_set_direct(ev); + snd_seq_ev_set_subs(ev); port_write_event(port->port, ev, 0); ev->data.note.note = key_saved; ev->data.note.velocity = vel_saved; - } else + } else { + snd_seq_ev_set_direct(ev); + snd_seq_ev_set_subs(ev); port_write_event(port->port, ev, 0); + } } /* @@ -1050,8 +1101,7 @@ } } if (show_piano) - av_note_update(chst->w_piano, - key, (chst->vel[key] > 0) ? 1 : 0, in_buf); + av_note_update(chst->w_piano, key, (chst->vel[key] > 0), in_buf); } /* @@ -1178,7 +1228,7 @@ 0x43, 0x10, 0x4c, 0x00, 0x00, 0x7e, 0x00 }; midi_status_t *st = port->main; - int p, tt, i; + int p, need_visualize = FALSE, tt, i; channel_status_t *chst; if (len <= 0 || buf[0] != 0xf0) @@ -1225,9 +1275,11 @@ switch (buf[3]) { case 0x0a: if (st->temper_keysig == TEMPER_UNKNOWN) - visualize_temper_type(st, in_buf); + need_visualize = TRUE; st->temper_keysig = buf[4] - 0x40 + buf[5] * 16; display_temper_keysig(st->w_temper_keysig, in_buf); + if (need_visualize) + visualize_temper_type(st, in_buf); break; case 0x0b: tt = (buf[4] & 0x03) << 14 | buf[5] << 7 | buf[6]; @@ -1238,6 +1290,10 @@ chst = &port->ch[i]; chst->temper_type = buf[7]; display_temper_type(chst->w_temper_type, in_buf); + if (st->temper_type_mute) + av_mute_update(chst->w_chnum, + st->temper_type_mute & 1 << buf[7] + - ((buf[7] >= 0x40) ? 0x3c : 0), in_buf); } break; } @@ -1269,6 +1325,8 @@ display_temper_type(chst->w_temper_type, in_buf); } } + for (i = 0; i < 8; i++) + av_hide_tt_button(st->w_tt_button[i], FALSE, in_buf); } /* @@ -1276,7 +1334,7 @@ */ static void reset_all(midi_status_t *st, int in_buf) { - int p, i, j; + int p, i; port_status_t *port; channel_status_t *chst; @@ -1285,6 +1343,9 @@ continue; for (i = 0; i < MIDI_CHANNELS; i++) { chst = &port->ch[i]; + if (st->temper_type_mute) + av_mute_update(chst->w_chnum, + st->temper_type_mute & 1, in_buf); all_sounds_off(chst, 0); chst->is_drum = (i == 9) ? 1 : 0; set_vel_bar_color(chst->w_vel, chst->is_drum, in_buf); @@ -1306,6 +1367,8 @@ st->temper_keysig = TEMPER_UNKNOWN; display_temper_keysig(st->w_temper_keysig, 0); st->timer_update = TRUE; + for (i = 0; i < 8; i++) + av_hide_tt_button(st->w_tt_button[i], TRUE, in_buf); } /* @@ -1341,6 +1404,16 @@ } /* + */ +static void av_mute_update(GtkWidget *w, int is_mute, int in_buf) +{ + if (in_buf) + av_ringbuf_write(UPDATE_MUTE, w, is_mute); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), is_mute); +} + +/* * set color of velocity bar */ static void set_vel_bar_color(GtkWidget *w, int is_drum, int in_buf) @@ -1383,13 +1456,13 @@ */ static void av_piano_reset(GtkWidget *w, int in_buf) { + int i; + if (in_buf) av_ringbuf_write(PIANO_RESET, w, 0); - else { - int i; + else for (i = 0; i < NUM_KEYS; i++) - av_note_update(w, i, 0, 0); - } + av_note_update(w, i, FALSE, 0); } /* @@ -1434,6 +1507,16 @@ /* */ +static void av_hide_tt_button(GtkWidget *w, int is_hide, int in_buf) +{ + if (in_buf) + av_ringbuf_write(HIDE_TT_BUTTON, w, is_hide); + else + gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(w), is_hide); +} + +/* + */ struct av_ringbuf { int type; GtkWidget *w; @@ -1510,12 +1593,15 @@ */ static gboolean idle_cb(gpointer data) { - int type, i; + int type; GtkWidget *w; long val; while (av_ringbuf_read(&type, &w, &val)) { switch (type) { + case UPDATE_MUTE: + av_mute_update(w, val, 0); + break; case VEL_COLOR: set_vel_bar_color(w, val, 0); break; @@ -1523,10 +1609,10 @@ av_channel_update(w, val, 0); break; case NOTE_ON: - av_note_update(w, val, 1, 0); + av_note_update(w, val, TRUE, 0); break; case NOTE_OFF: - av_note_update(w, val, 0, 0); + av_note_update(w, val, FALSE, 0); break; case PIANO_RESET: av_piano_reset(w, 0); @@ -1543,6 +1629,9 @@ case UPDATE_TEMPER_TYPE: display_temper_type(w, 0); break; + case HIDE_TT_BUTTON: + av_hide_tt_button(w, val, 0); + break; } } usleep(1000); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.5/ChangeLog new/aseqview-0.2.6/ChangeLog --- old/aseqview-0.2.5/ChangeLog 2007-03-29 15:55:21.000000000 +0200 +++ new/aseqview-0.2.6/ChangeLog 2007-04-03 15:06:27.000000000 +0200 @@ -1,3 +1,6 @@ +0.2.6 - Fix segfault with thread mode (silly typo) + - Add mute-control feature by TAMUKI Shoichi + 0.2.5 - Fix possible segfaults due to races in thread mode 0.2.4 - Added MIDI Tunig Standard (MTS) feature diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.5/configure new/aseqview-0.2.6/configure --- old/aseqview-0.2.5/configure 2007-03-29 15:57:06.000000000 +0200 +++ new/aseqview-0.2.6/configure 2007-04-03 15:07:04.000000000 +0200 @@ -2075,7 +2075,7 @@ # Define the identity of the package. PACKAGE=aseqview - VERSION=0.2.5 + VERSION=0.2.6 cat >>confdefs.h <<_ACEOF diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.5/configure.in new/aseqview-0.2.6/configure.in --- old/aseqview-0.2.5/configure.in 2007-03-29 15:55:41.000000000 +0200 +++ new/aseqview-0.2.6/configure.in 2007-04-03 15:06:39.000000000 +0200 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) -AM_INIT_AUTOMAKE(aseqview, 0.2.5) +AM_INIT_AUTOMAKE(aseqview, 0.2.6) AM_CONFIG_HEADER(config.h) AC_PROG_CC diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.5/portlib.c new/aseqview-0.2.6/portlib.c --- old/aseqview-0.2.5/portlib.c 2007-03-29 14:56:48.000000000 +0200 +++ new/aseqview-0.2.6/portlib.c 2007-04-03 15:02:03.000000000 +0200 @@ -46,7 +46,7 @@ port_t *ports; int running; int use_pthread; - pthread_mutex_t *lock; + pthread_mutex_t lock; }; struct port_t { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org