On 23 May 2013 02:38, Gale Andrews <gale@...> wrote:
> | From Steve the Fiddle <stevethefiddle@...>
> | Wed, 22 May 2013 14:40:02 +0100
> | Subject: [Audacity-quality] Align Tracks Together (with labels)
>> On 22 May 2013 12:58, David Bailes <drbailes@...> wrote:
>> > On Tue, May 21, 2013 at 7:53 PM, Steve the Fiddle <stevethefiddle@...>
>> > wrote:
>> >> On 21 May 2013 10:03, David Bailes <drbailes@...> wrote:
>> >> >
>> >> > Hi Gale, I appear to be loosing my marbles. I misunderstood your reply
>> >> > to
>> >> > robbie on the audacity4blind mailing list in march 2012 when he was
>> >> > asking
>> >> > whether "align with cursor" was available in the exported xml file for
>> >> > keyboard shortcuts. It isn't, but all the align commands can be set in
>> >> > the
>> >> > keyboard category of preferences - I hadn't realised this. One minor
>> >> > problem
>> >> > is that the two sets of commands (with or without moving the cursor)
>> >> > have
>> >> > the same names, which is confusing.
>> >> They both use the same sub-menu ("Align Together" is excluded from the
>> >> "and Move Cursor" menu).
>> >> If we changed this then the "and Move" menu would need its own sub
>> >> menu rather than reusing the "Align Tracks" sub menu which makes the
>> >> code a bit bulkier, is more to maintain, but the biggest issue is that
>> >> different names would need to be given to the functions.
>> > I think that it's ok for the commands in the two sub-menus to have the same
>> > labels. I think that the confusion in the keyboad prefs should be sorted out
>> > there (at some point).
> ATM I feel too that the commands in the two sub-menus should
> be the same and that the issue is in the Keyboard Prefs.
> Namely even if the "Align and Move Cursor" sub-menu items have
> unique text, that text doesn't necessarily make much sense on its
> own in the Keyboard Prefs (from which you cannot access the
> menus to look at them).
Presumably if a user goes into Preferences to set or change a key
binding, they would know which menu command they want to change?
> There is the same issue with all the
> cascading menus to some extent or another.
> But rewording "Align and Move Cursor" to "Align Tracks and Move
> Cursor" would be better for that menu item if we want to spend
> another word on it (especially if we keep identically named
> commands for "Align Tracks" and "Align and Move Cursor").
A problem with having identically named commands is that you can't
tell them apart in Keyboard Preferences. Perhaps that does not need to
be solved now, but as the Align Tracks menu is having a new item added
it seems like a good idea to reduce this confusion while we are here.
>> > Also, if on the align tracks menu, both align to/with/from(!) cursor and
>> > align end to end both had predefined shortcuts, then not many people would
>> > need to assign these in keyboard prefs anyway.
>> > There seems to be a couple of issues about shortcuts in the align tracks
>> > sub-menu:
>> > 1. If I assign a keyboard shortcut in preferences, the shortcut works, but
>> > doesn't show up after the command in the sub-menu. Assigning a shortcut for
>> > a command in the effects menu shows up in the menu, but I don't know why.
>> The problem is that it's because "alignLabels" is a list of commands
>> that is shared by two sub-menus ("Align Tracks" and "Align Move"), so
>> when an access key is allocated to one of the list items, the menu
>> does not know which occurrence of that item in the menu should have
>> the shortcut assigned to it. In other words, the menu list needs to be
>> unique to one menu item.
> That sounds logical, but here on Win 7 (HEAD with no patch) I
> used Keyboard Preferences "All" category to assign CTRL + 8
> to Align Tracks > Align with Zero and CTRL + 9 to Align and
> Move Cursor > Align with Zero.
> Using the "Tracks" Category I assigned SHIFT + Y to Align Tracks >
> Align to Selection Start and Y to Align and Move Cursor > Align
> to Selection Start.
> All four commands are visible in the menu and work correctly.
> I only thought this was not so because I created an assignment
> for the wrong item in Keyboard Prefs.
> So I am certainly confused as to whether the patch is even
> needed to solve the above.
I'm confused too.
When this issue was raised, I tried setting access keys and, as David
described, they did not show in the menus. I try it again today with a
freshly patched svn checkout and I'm able to set access keys (aided by
the fact that I can now see which ones belong to the "Align Tracks"
menu and which belong to the "Align and Move Cursor" menu), and the
access keys do show up in the menus !
> However the issue that these added assignments are not in the
> exported XML does exist in HEAD.
> Before I spend time on this patch, does it address the XML issue?
No, I've not even looked at that XML issue, I've been looking at
adding an option to align tracks end to end.
>> This problem can be fixed by creating a separate menu list for the
>> "Align/Move" sub-menu so that it is not sharing the same list as
>> "Align Tracks". This can also fix the problem in the keyboard
>> preferences as the menu items can then have unique names. The question
>> then is: what names.
>> The best that I've come up with is:
>> "Tracks > Align Tracks > Align Start to ...."
>> "Tracks > Align and Move Cursor > Move Start to ...."
>> Assuming that I've not missed errors in my code, this patch solves
>> multiple problems, adds a very useful new feature, and I can live with
>> the command names.
>> I think this patch will benefit translation hints. I'm not familiar
>> with translation hints so could someone else do that?
>> > 2. I'm not sure what code is needed to set up predefined shortcuts in the
>> > align tracks sub-menu. I had a go using SetKeyFromName, using the name
>> > "Align:Align with &Cursor" for the command (this is without your patch
>> > applied) and had no joy.
>> > David.