[CM] Re: Re: Re: Play Head (SND-8.3)

Kjetil Svalastog Matheussen k.s.matheussen@notam02.no
Tue, 15 Aug 2006 17:42:43 +0200 (CEST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1463809280-1933900525-1155656563=:16140
Content-Type: TEXT/PLAIN; charset=US-ASCII


"Bill Schottstaedt":
> To: Kjetil Svalastog Matheussen <k.s.matheussen@notam02.no>,
>    cmdist@ccrma.Stanford.EDU
> Subject: Re: [CM] Re: Re: Play Head (SND-8.3)
> Date: Sun, 13 Aug 2006 04:28:27 -0700
> 
> > Anyone knows how to do this with gtk, if possible? 
> 
> ;; report on mouse scroll wheel changes when in the channel graph
> (g_signal_connect 
>  (car (channel-widgets)) "scroll_event" 
>  (lambda (w e i)
>    (snd-print (format #f "~%state: ~A, x: ~A, y: ~A, direction: ~A" 
>                       (.state (GDK_EVENT_SCROLL e))
>                       (.x (GDK_EVENT_SCROLL e))
>                       (.y (GDK_EVENT_SCROLL e))
>                       (.direction (GDK_EVENT_SCROLL e))))
>    #f))
> 
> ;; report which kind of click was received in the channel graph
> (g_signal_connect 
>  (car (channel-widgets)) "button_press_event"
>  (lambda (w e i)
>    (snd-print (format #f "~%button: ~A, ~A click" 
>                       (.type (GDK_EVENT_BUTTON e))
>                       (if (= (.type (GDK_EVENT_BUTTON e)) GDK_BUTTON_PRESS)
>                           "single"
>                           (if (= (.type (GDK_EVENT_BUTTON e)) GDK_2BUTTON_PRESS)
>                               "double"
>                               (if (= (.type (GDK_EVENT_BUTTON e)) GDK_3BUTTON_PRESS)
>                                   "triple"
>                                   "unknown")))))
>    #f))
> 
> ;; a double click is reported as single/single/double
> 
> ;; double-click time in milliseconds(?)
> (define (double-click-time)
>   (g_object_get (GPOINTER (gtk_settings_get_for_screen 
>                                             (gdk_display_get_default_screen 
>                                               (gdk_display_get_default))))
>                         "gtk-double-click-time" #f))
> 



Thank you very much! Attached is a diff for gui.scm that fixes the state 
for the scroll button and adds a new hook for double-click:

(-> mouse-doubleclick-hook add!
    (lambda (snd x y stat)
      (c-display "double-click" snd x y stat)))


---1463809280-1933900525-1155656563=:16140
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=gui.scm.diff
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.64.0608151742430.16140@leon.localdomain>
Content-Description: 
Content-Disposition: attachment; filename=gui.scm.diff

LS0tIGd1aS5zY20/cmV2aXNpb249MS4zOQkyMDA2LTA4LTE1IDE3OjQwOjIw
LjAwMDAwMDAwMCArMDIwMA0KKysrIGd1aS5zY20JMjAwNi0wOC0xNSAxNzoz
NToxMy4wMDAwMDAwMDAgKzAyMDANCkBAIC04OSw2ICs4OSwxNyBAQA0KIAkg
I2YpKSkNCiANCiANCis7OyBDb3BpZWQgZnJvbSBndGstcG9wdXAuc2NtDQor
KGRlZmluZSogKGMtZ19zaWduYWxfY29ubmVjdCBvYmogbmFtZSBmdW5jICM6
b3B0aW9uYWwgZGF0YSkNCisgIChnX3NpZ25hbF9jb25uZWN0X2Nsb3N1cmVf
YnlfaWQgKEdQT0lOVEVSIG9iaikNCisJCQkJICAoZ19zaWduYWxfbG9va3Vw
IG5hbWUgKEdfT0JKRUNUX1RZUEUgKEdUS19PQkpFQ1Qgb2JqKSkpDQorCQkJ
CSAgMA0KKwkJCQkgIChnX2NjbG9zdXJlX25ldyBmdW5jIGRhdGEgI2YpDQor
CQkJCSAgI2YpKQ0KKw0KKw0KKw0KKw0KIChkZWZpbmUtYyA8ZmxvYXQ+IChj
LXNjYWxlICgoPGZsb2F0PiB4KQ0KIAkJCSAgICAoPGZsb2F0PiB4MSkNCiAJ
CQkgICAgKDxmbG9hdD4geDIpDQpAQCAtMzU5LDYgKzM3MCw3IEBADQogDQog
DQogKGRlZmluZSBtb3VzZS1idXR0b24tcHJlc3MtaG9vayAoPGhvb2s+KSkN
CisoZGVmaW5lIG1vdXNlLWRvdWJsZWNsaWNrLWhvb2sgKDxob29rPikpDQog
KGRlZmluZS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