View Issue Details

IDProjectCategoryView StatusLast Update
0001396ardourfeaturespublic2007-01-03 11:03
Reportermtaht Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status newResolutionopen 
Summary0001396: Support for Play/Record/Mute/etc Xwindow keysyms?
DescriptionMany advanced keyboards have play/rec/ff/volume keys. Most are available via Xwindows via configuring your keyboard - and xorg/xfree have standard names for them, being:

XF86AudioLowerVolume :1008FF11 - active track volume
XF86AudioMute :1008FF12 - map to global mute?
XF86AudioRaiseVolume :1008FF13 - active track volume
XF86AudioPlay :1008FF14
XF86AudioStop :1008FF15
XF86AudioPrev :1008FF16
XF86AudioNext :1008FF17

Although it appears that GDK doesn't have them by default, it's trivial to add them with a define... but where to add them to ardour?

(I will probably find this on my own)

Additional InformationFor a logitech keyboard, one way to setup the keyboard to "do the right thing" is to do this:

mingus:/home/m$ more ~m/.xmodmap
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 129 = XF86AudioRecord

But the keysyms also have to be accepted by ardour.

Other potentially useful keysyms are:

XF86Start :1008FF1A
XF86Search :1008FF1B
XF86Eject :1008FF2C - I've always wanted this one mapped by something!
XF86ScreenSaver :1008FF2D - guess the window manager should map this
XF86Favorites :1008FF30 -
XF86AudioPause :1008FF31 - not sure how this would work vs play
XF86AudioMedia :1008FF32 - dunno, pop up file->open?
XF86AudioRewind :1008FF3E -
I don't know what FF would be... Backfoward?
XF86BackForward :1008FF3F
XF86ZoomIn :1008FF8B - zoom in
XF86ZoomOut :1008FF8C - zoom out

There are plenty of other keysyms worth mapping, and I keep wondering what to do with this 8 button mouse....

I have a 100% button on this keyboard, too, but it doesn't seem to generate
a code....
TagsNo tags attached.

Activities

mtaht

2007-01-03 08:36

developer   ~0002974

As per the gdk keysym list

http://cvs.gnome.org/viewcvs/*checkout*/gtk%2B/gdk/gdkkeysyms.h?rev=1.9

The ardour doc is out of date if it's really ardour.bindings where this info is kept...

http://ardour.org/manual/intro/mouse_and_keyboard

Patch coming shortly.

mtaht

2007-01-03 08:57

developer   ~0002975

um, er, patch not coming, I can't figure out how gtk_accel in ardour.bindings get's the english language name for a key....

mtaht

2007-01-03 09:27

developer   ~0002976

Index: gtkscrolledwindow.c
===================================================================
--- gtkscrolledwindow.c (revision 1260)
+++ gtkscrolledwindow.c (working copy)
@@ -33,6 +33,7 @@
 #include <gtk/gtkintl.h>
 #include <gtk/gtkalias.h>

+#include "gdkextrakeysyms.h"

 /* scrolled window policy and size requisition handling:
  *
Index: keyboard.cc
===================================================================
--- keyboard.cc (revision 1260)
+++ keyboard.cc (working copy)
@@ -30,6 +30,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <pbd/error.h>

+#include "gdkextrakeysyms.h"
 #include "keyboard.h"
 #include "gui_thread.h"

2007-01-03 09:29

 

gdkextrakeysyms.h (2,015 bytes)   
/*
    Copyright (C) 2007 Paul Davis

    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
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    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., 675 Mass Ave, Cambridge, MA 02139, USA.

    $Id keyboard.h 669 2006/*07/*07 235130Z paul $
*/

#ifndef __ardour_extrakeysyms_h__
#define __ardour_extrakeysyms_h__

/* despite advanced keyboards having buttons like these for a decade, they aren't part of gdk */

#ifndef __GDK_KEYSYMS_H__
#include <gdk/gdkkeysyms.h>
#endif

/* maybe one day gdk will include these */

#ifndef GDK_AudioLowerVolume

#define GDK_AudioLowerVolume 1008FF11 
#define GDK_AudioMute 1008FF12 /* Mute */
#define GDK_AudioRaiseVolume 1008FF13 /* active track volume */
#define GDK_AudioPlay 1008FF14 /* Perhaps change to PlayPause */
#define GDK_AudioStop 1008FF15
#define GDK_AudioPrev 1008FF16
#define GDK_AudioNext 1008FF17

/* other potentially useful keysyms are: */

#define GDK_Start 1008FF1A
#define GDK_Search 1008FF1B
#define GDK_Eject 1008FF2C /* I've always wanted this one mapped by something! */
#define GDK_ScreenSaver 1008FF2D /* guess the window manager should map this */
#define GDK_Favorites 1008FF30 
#define GDK_AudioPause 1008FF31 /* not sure how this would work vs play */
#define GDK_AudioMedia 1008FF32 /* pop up region editor? */
#define GDK_AudioRewind 1008FF3E 
#define GDK_BackForward 1008FF3F /* Assuming this means fast forward */
#define GDK_ZoomIn 1008FF8B 
#define GDK_ZoomOut 1008FF8C 

#endif
#endif

gdkextrakeysyms.h (2,015 bytes)   

mtaht

2007-01-03 09:30

developer   ~0002977

can't claim that the patch and extra include actually work, as I'm still trying to figure out where gtk_accel gets it's human names from.

mtaht

2007-01-03 09:37

developer   ~0002978

The keyname just comes from xlib.

http://developer.gnome.org/doc/GGAD/sec-gdkevent.html

This patch appears unnessessary, testing w/patch now.

mtaht

2007-01-03 10:15

developer   ~0002979

I note that at least on my hw ardour2 makes 225 attempts to open ardour.bindings just on startup... somehow I don't think it shold be even trying to write to /usr/local/etc/ardour2... and even if the file exists, it opened it 300+ times during startup.

[pid 9761] open("/usr/local/etc/ardour2/ardour.bindings", O_RDONLY) = 16
[pid 9761] open("/usr/local/etc/ardour2/ardour.bindings", O_WRONLY|O_CREAT|O_TRUNC, 0644) = -1 EACCES (Permission denied)
[pid 9761] open("/usr/local/etc/ardour2/ardour.bindings", O_WRONLY|O_CREAT|O_TRUNC, 0644 <unfinished ...>
[pid 9761] stat("/usr/local/etc/ardour2/ardour.bindings", {st_mode=S_IFREG|0644, st_size=18622, ...}) = 0
[pid 9761] write(2, "/usr/local/etc/ardour2/ardour.bi"..., 38/usr/local/etc/ardour2/ardour.bindings) = 38

mtaht

2007-01-03 10:32

developer   ~0002980

Nope. (patch compiles tho). But XlookupString doesn't do the right thing.

In X - the easy things are hard, the hard things possible.

As a total aside, it would be cool if in gtk2_ardour, alt-mousewheel moved the shuttle....

mtaht

2007-01-03 10:39

developer   ~0002981

Last edited: 2007-01-03 10:46

While I'm on this kick, I uploaded a sorted file of all the syscalls ardour makes during startup. (this is without the patch I just put in, which is not relevant to this...)

really, really need to not go crazy writing ardour bindings. hundreds and hundreds of writes....

Also down in the obscurity of things in this file I see it trying to open truly oddball things like:

      2 [pid 9813] open("/usr/share/pixmaps/gnome/cursors/2199331288f9cf411e8100000000f00c", O_RDONLY) = -1 ENOENT (No such file or directory)

but I remember dave taylor(?) ranting on this one

This is against a somewhat older version of svn...

2007-01-03 10:39

 

sorted_startup.txt (774,474 bytes)

mtaht

2007-01-03 11:03

developer   ~0002982

Last edited: 2007-01-03 11:39

As well as truly oddball things like:

      1 open("x86_64/libz.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

I note that SOMETHING is calling clock_gettime - yea - but at least on current versions of linux-rt - CLOCK_MONOTONIC is better because ntp doesn't muck with it. Unless you care about it being wallclock time. I'll find this one in the code outside of ardour....

      1 [pid 9816] clock_gettime(CLOCK_REALTIME, {1167819272, 961881575}) = 0

I incidentally HATE gettimeofday but that's a long story and bound to X in this case I think.

The thing is opening my entire home directory for some reason. Why on earth would we want to do that?

      1 [pid 9839] open("/home/m/a.out", O_RDONLY) = 22

And zillions of calls to mmap and brk. I note that there is an obscure option to malloc that tunes it's default algorithm somewhat - you can, for example, tell it to not use brk at all and/or get memory from the OS in much larger chunks Experimentation is required, however, but it can be done with just environment variables... see:
http://www.linuxjournal.com/article/6390

(also I daydream about one day making hugetlbs useful - which makes a lot of sense for an application this big - but not today. )

also

http://www.zeroc.com/faq/largeRequests.html

Also, I did just compile and try libhoard http://www.hoard.org/ it appeared to work but I didn't do any serious testing.

Issue History

Date Modified Username Field Change
2007-01-03 07:49 mtaht New Issue
2007-01-03 08:36 mtaht Note Added: 0002974
2007-01-03 08:57 mtaht Note Added: 0002975
2007-01-03 09:27 mtaht Note Added: 0002976
2007-01-03 09:29 mtaht File Added: gdkextrakeysyms.h
2007-01-03 09:30 mtaht Note Added: 0002977
2007-01-03 09:37 mtaht Note Added: 0002978
2007-01-03 10:15 mtaht Note Added: 0002979
2007-01-03 10:32 mtaht Note Added: 0002980
2007-01-03 10:39 mtaht Note Added: 0002981
2007-01-03 10:39 mtaht File Added: sorted_startup.txt
2007-01-03 10:40 mtaht Note Edited: 0002981
2007-01-03 10:46 mtaht Note Edited: 0002981
2007-01-03 11:03 mtaht Note Added: 0002982
2007-01-03 11:08 mtaht Note Edited: 0002982
2007-01-03 11:23 mtaht Note Edited: 0002982
2007-01-03 11:25 mtaht Note Edited: 0002982
2007-01-03 11:39 mtaht Note Edited: 0002982