Author Topic: .48 mnemonic bug with channel names  (Read 7575 times)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,676
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
.48 mnemonic bug with channel names
« on: October 07, 2007, 18:16:34 »
Full Version:
OpenMPT v1.17.02.48

Has the bug occured in previous versions? If yes, please specify version(s): (This option is optional, and doesn't need research. But in case you know...)
Also happened in original Modplug Tracker


Description of the bug:
If there is the mnemonic sign (&) in a channel name, it's handled as an mnenonic (the next char will be underlined). "D&B" will be converted into "DB" in this case:
(picture removed as it's no more necessary)

How to reproduce (step by step description):
Insert a "&" sign in a channel's name.

Fixed in OpenMPT 1.17.02.53
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Sam_Zen

  • Extreme artist
  • *****
  • Posts: 3,689
    • http://www.xs4all.nl/~samzen/
.48 mnemonic bug with channel names
« Reply #1 on: October 07, 2007, 23:34:39 »
Maybe it's a bug, but I got curious :
Is there a list of such characters which apparently are interpreted not as text ?
0.618033988

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,054
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
.48 mnemonic bug with channel names
« Reply #2 on: October 08, 2007, 06:55:15 »
I can clarify why this happens and also add that it can't be fixed.

This is a function from MS Visual Studio. It also exists in VB and such. Basically when you add a & in a menu or most controls, it underlines the next letter. This is made so you can show the letter to quick access the menu item.

I believe making a && will put 1 & in it that isn't underlined.

Perhaps Rewbs can fix it by converting all &'s to &&'s when you look in the pattern editor. But then again, is it really necessary to fix this?
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline bvanoudtshoorn

  • Extreme artist
  • *****
  • Posts: 1,053
  • Gender: Male
    • Barryvan
.48 mnemonic bug with channel names
« Reply #3 on: October 08, 2007, 09:02:44 »
Perhaps this bug could be exploited. For example, if you set a channel name to &Piano, hitting [Ctrl]+[Alt]+[P] (or something) would jump straight to that channel? That way, it'd stop being a bug, and become a feature. =P

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,676
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
.48 mnemonic bug with channel names
« Reply #4 on: October 08, 2007, 13:37:53 »
I don't think that this would work, as the underlined characters have to be pressed when their parent control (e.g. the menu) has the focus, there's also no shortcut... An underlined "O" in the file menu for example would make it possible to press O while in this menu to open a file, for example. this can't be done in the pattern editor (at least, it would be rather compliacted).
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Sam_Zen

  • Extreme artist
  • *****
  • Posts: 3,689
    • http://www.xs4all.nl/~samzen/
.48 mnemonic bug with channel names
« Reply #5 on: October 08, 2007, 22:43:07 »
I don't see a reason to fix this. It's the same issue as having more than one dot in a filename, or a space char. in an URL.
Apparently some characters here are indeed mnemonics of a protocol, so maybe just shouldn't be used.
0.618033988

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,676
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
.48 mnemonic bug with channel names
« Reply #6 on: October 08, 2007, 23:08:58 »
IMHO you are not right about that. What would you f.e. think of a text editor that does not display questionmarks because they're part of a special syntax? What would you think of a sample editor that does not allow special sample bytes because they could interfere with other settings? This is quite limiting to the user. And so is this little bug. These mnemonics were defined as help for the programmer, not as a feature for the user of a program. That's why they have to be escaped.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Sam_Zen

  • Extreme artist
  • *****
  • Posts: 3,689
    • http://www.xs4all.nl/~samzen/
.48 mnemonic bug with channel names
« Reply #7 on: October 08, 2007, 23:53:45 »
You convinced me.
0.618033988

Offline bvanoudtshoorn

  • Extreme artist
  • *****
  • Posts: 1,053
  • Gender: Male
    • Barryvan
.48 mnemonic bug with channel names
« Reply #8 on: October 08, 2007, 23:59:53 »
The easiest solution would, of course, be to prevent people from putting an ampersand into the channel name at all. But then, that's a bit limiting.

You could also go through and escape all ampersands when you're in the pattern editor.

My favourite solution, though, would be to delve into the code that actually draws the pattern editor. I know that in Delphi (not sure about C), there's an alternative to the standard DrawText function (I think that's what it's called) which doesn't draw the accelerator characters. Don't quote me on this, but I think it's the same function which allows you to draw rotated text. Of course, I'm speaking from a Delphi perspective, and although I know that a lot of these low level routines are just translated C header files for Delphi, some of them aren't, so this suggestion might not work at all. =P Of course, you could just rewrite the entire program to use GD and FreeType. =D

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,054
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
.48 mnemonic bug with channel names
« Reply #9 on: October 09, 2007, 06:47:46 »
Can someone confirm that && actually shows one &?
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,676
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
.48 mnemonic bug with channel names
« Reply #10 on: October 09, 2007, 09:44:16 »
It does, at least in Visual Basic... There's also a object property called "UseMnemonic" in Visual Basic which can be used to disable Mnemonics. This is the option to go for... If there's one in C aswell.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,054
    • http://lpchip.nl
  • Operating System: Windows 10 Pro x64
.48 mnemonic bug with channel names
« Reply #11 on: October 09, 2007, 16:54:19 »
Quote from: "Jojo"
It does, at least in Visual Basic... There's also a object property called "UseMnemonic" in Visual Basic which can be used to disable Mnemonics. This is the option to go for... If there's one in C aswell.


I've just confirmed that in OpenMPT writing 2 &'s will show it as one & in the pattern tab, so I bet there's such function too!
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,676
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
.48 mnemonic bug with channel names
« Reply #12 on: October 13, 2008, 10:44:37 »
This one will be fixed in .53
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.