wrong submenu order in a menu [temporarily solved]

I am a nob with fvwm and I have done my own music player menu based on the ones in fvwm crystal. It work almost very well. but sometime the submenus are in the right order, other time the submenu order is wrong.

As exemple, I get the start options with the Seek menu and the seek options with the start options. The order in the main menu is always the same, it is just at the submenu are shifting.

Here is what I wrote:
Music-alsaplayer

[code]# Support for Alsaplayer music player

Where are stored Alsaplayer playlists

SetEnv Alsaplayer-Playlists “$[HOME]/Alsaplayer-playlists”

If there is no selected mixer, load the default

CheckPreferences DefaultMixer “Include components/functions/Mixer-alsaplayer”

Main functions and menus

DestroyMenu /Music
AddToMenu /Music

  • DynamicPopupAction Function /Music-generator

DestroyFunc /Music-generator
AddToFunc /Music-generator

  • I DestroyMenu recreate /Music
  • I AddToMenu /Music ‘$[gt.Start player]’ Popup /Start
  • I AddToMenu /Music “” Nop
  • I AddToMenu /Music ‘$[gt.Load playlist]’ Popup /Music/LoadPlaylist
  • I AddToMenu /Music ‘$[gt.Clear playlist]’ Music-ClearPlaylist
  • I AddToMenu /Music ‘$[gt.Remove playlist]’ Popup /Music/RemovePlaylist
  • I AddToMenu /Music “” Nop
    Test (EnvMatch LANG fr_) + I AddToMenu /Music ‘$[gt.Volume]’ Popup /VolumeFr
    Test (!EnvMatch LANG fr_
    ) + I AddToMenu /Music ‘$[gt.Volume]’ Popup /VolumeEn
    Test (EnvMatch LANG fr_) + I AddToMenu /Music ‘$[gt.Speed]’ Popup /SpeedFr
    Test (!EnvMatch LANG fr_
    ) + I AddToMenu /Music ‘$[gt.Speed]’ Popup /SpeedEn
  • I AddToMenu /Music “” Nop
  • I AddToMenu /Music ‘$[gt.Show/hide player]’ Music-GUI
  • I AddToMenu /Music ‘$[gt.Stop playback]’ Music-Stop
  • I AddToMenu /Music ‘$[gt.Play]’ Music-Play
  • I AddToMenu /Music ‘$[gt.Pause]’ Music-Pause
  • I AddToMenu /Music ‘$[gt.Play/Pause]’ Music-PlayPause
  • I AddToMenu /Music “” Nop
  • I AddToMenu /Music ‘$[gt.Next]’ Music-Next
  • I AddToMenu /Music ‘$[gt.Prev]’ Music-Prev
  • I AddToMenu /Music ‘$[gt.Jump]’ Popup /Jump
  • I AddToMenu /Music ‘$[gt.Seek]’ Popup /Seek
  • I AddToMenu /Music ‘$[gt.Seek relative]’ Popup /Rel

---------------------------------------------------------------------------

Basic control functions

DestroyFunc Music-GUI
AddToFunc Music-GUI

  • I All (alsaplayer) Iconify toggle

DestroyFunc Music-Stop
AddToFunc Music-Stop

  • I Exec exec $[A_Player] --stop

DestroyFunc Music-Play
AddToFunc Music-Play

  • I Exec exec $[A_Player] --start

DestroyFunc Music-Pause
AddToFunc Music-Pause

  • I Exec exec $[A_Player] --speed 0

DestroyFunc Music-PlayPause
AddToFunc Music-PlayPause

  • I Exec exec $[A_Player] --speed 1

DestroyFunc Music-Next
AddToFunc Music-Next

  • I Exec exec $[A_Player] --next

DestroyFunc Music-Prev
AddToFunc Music-Prev

  • I Exec exec $[A_Player] --prev

---------------------------------------------------------------------------

Playlist functions

DestroyMenu /Music/LoadPlaylist
AddToMenu /Music/LoadPlaylist

  • DynamicPopupAction Function /Music/LoadPlaylist-generator

DestroyFunc /Music/LoadPlaylist-generator
AddToFunc /Music/LoadPlaylist-generator

  • I DestroyMenu recreate /Music/LoadPlaylist
  • I AddToMenu /Music/LoadPlaylist
  • I PipeRead ‘for i in $[Alsaplayer-Playlists]/.m3u $[Alsaplayer-Playlists]/.pls; do
    name=$(basename “$i”);
    sname=${name%%.m3u};
    sname=${sname%%.pls};
    echo “AddToMenu /Music/LoadPlaylist ‘$sname’ Exec exec alsaplayer -e ‘$i’”; done’

DestroyFunc Music-ClearPlaylist
AddToFunc Music-ClearPlaylist

  • I Exec exec $[A_Player] --clear

DestroyMenu /Music/RemovePlaylist
AddToMenu /Music/RemovePlaylist

  • DynamicPopupAction Function /Music/RemovePlaylist-generator

DestroyFunc /Music/RemovePlaylist-generator
AddToFunc /Music/RemovePlaylist-generator

  • I DestroyMenu recreate /Music/RemovePlaylist
  • I AddToMenu /Music/RemovePlaylist
  • I PipeRead ‘for i in $[Alsaplayer-Playlists]/.m3u $[Alsaplayer-Playlists]/.pls; do
    name=$(basename “$i”);
    sname=${name%%.m3u};
    sname=${sname%%.pls};
    echo “AddToMenu /Music/RemovePlaylist ‘$sname’ Exec rm -f ‘$i’”; done’
    [/code]
    Mixer-alsaplayer

[code]# Support for Alsaplayer music player - mixer and speed control

DestroyFunc Mixer-Start
AddToFunc Mixer-Start

  • I SetEnv A_Player “$0”
  • I Exec exec killall alsaplayer
  • I Exec exec $[A_Player]

DestroyFunc Mixer-VolumeFr
AddToFunc Mixer-VolumeFr

  • I Exec exec $[A_Player] --volume $0

DestroyFunc Mixer-VolumeEn
AddToFunc Mixer-VolumeEn

  • I Exec exec $[A_Player] --volume $0

#DestroyFunc Mixer-GUI
#AddToFunc Mixer-GUI
#+ I Nop

DestroyFunc Mixer-SpeedFr
AddToFunc Mixer-SpeedFr

  • I Exec exec $[A_Player] --speed $0

DestroyFunc Mixer-SpeedEn
AddToFunc Mixer-SpeedEn

  • I Exec exec $[A_Player] --speed $0

DestroyFunc Mixer-Jump
AddToFunc Mixer-Jump

  • I Exec exec $[A_Player] --jump $0

DestroyFunc Mixer-Seek
AddToFunc Mixer-Seek

  • I Exec exec $[A_Player] --seek $0

DestroyFunc Mixer-Rel
AddToFunc Mixer-Rel

  • I Exec exec $[A_Player] --relative $0

DestroyMenu /Start
AddToMenu /Start

  • “Alsa%” Mixer-Start “alsaplayer -o alsa”
  • “Jack%” Mixer-Start “alsaplayer -o jack -F 48000”

DestroyMenu /VolumeFr
AddToMenu /VolumeFr

  • " 0 db%" Mixer-VolumeFr ‘1,0’
  • “-3 db%” Mixer-VolumeFr ‘0,707’
  • “-6 db%” Mixer-VolumeFr ‘0,5’
  • “-12 dB%” Mixer-VolumeFr ‘0,25’
  • “-18 db%” Mixer-VolumeFr ‘0,125’
  • “-24 db%” Mixer-VolumeFr ‘0,0625’
  • “-30 db%” Mixer-VolumeFr ‘0,03125’
  • “-36 db%” Mixer-VolumeFr ‘0,015625’
  • " 0" Mixer-VolumeFr ‘0,0’

DestroyMenu /VolumeEn
AddToMenu /VolumeEn

  • " 0 db%" Mixer-VolumeEn ‘1.0’
  • “-3 db%” Mixer-VolumeEn ‘0.707’
  • “-6 db%” Mixer-VolumeEn ‘0.5’
  • “-12 dB%” Mixer-VolumeEn ‘0.25’
  • “-18 db%” Mixer-VolumeEn ‘0.125’
  • “-24 db%” Mixer-VolumeEn ‘0.0625’
  • “-30 db%” Mixer-VolumeEn ‘0.03125’
  • “-36 db%” Mixer-VolumeEn ‘0.015625’
  • " 0" Mixer-VolumeEn ‘0.0’

DestroyMenu /SpeedFr
AddToMenu /SpeedFr

  • “Max%” Mixer-SpeedFr ‘10’
  • “+ 3 octaves%” Mixer-SpeedFr ‘8’
  • “+ 2 octaves%” Mixer-SpeedFr ‘4’
  • “+ 1 octave 1/2%” Mixer-SpeedFr ‘2,9966’
  • “+ 1 octave%” Mixer-SpeedFr ‘2’
  • “+ 1 septieme%” Mixer-SpeedFr ‘1,8877’
  • “+ 5 tons%” Mixer-SpeedFr ‘1,7818’
  • “+ 1 sixte%” Mixer-SpeedFr ‘1,6818’
  • “+ 4 tons%” Mixer-SpeedFr ‘1,5874’
  • “+ 1 quinte%” Mixer-SpeedFr ‘1,4983’
  • “+ 3 tons%” Mixer-SpeedFr ‘1,4142’
  • “+ 1 quarte%” Mixer-SpeedFr ‘1,3348’
  • “+ 1 tierce%” Mixer-SpeedFr ‘1,2599’
  • “+ 1 ton 1/2%” Mixer-SpeedFr ‘1,1892’
  • “+ 1 seconde%” Mixer-SpeedFr ‘1,1225’
  • “+ 1/2 ton%” Mixer-SpeedFr ‘1,0595’
  • “+ 3 commas%” Mixer-SpeedFr ‘1,0414’
  • “+ 2 commas%” Mixer-SpeedFr ‘1,0275’
  • “+ 1 comma%” Mixer-SpeedFr ‘1,0136’
  • “Normal%” Mixer-SpeedFr ‘1,0’
  • “-1 comma%” Mixer-SpeedFr ‘0,9865’
  • “-2 commas%” Mixer-SpeedFr ‘0,9733’
  • “-3 commas%” Mixer-SpeedFr ‘0,9602’
  • “-1 1/2 ton%” Mixer-SpeedFr ‘0,9439’
  • “-1 seconde%” Mixer-SpeedFr ‘0,8909’
  • “-1 ton 1/2%” Mixer-SpeedFr ‘0,8409’
  • “-1 tierce%” Mixer-SpeedFr ‘0,7937’
  • “-1 quarte%” Mixer-SpeedFr ‘0,7492’
  • “-3 tons %” Mixer-SpeedFr ‘0,7071’
  • “-1 quinte%” Mixer-SpeedFr ‘0,6674’
  • “-4 tons%” Mixer-SpeedFr ‘0,623’
  • “-1 sixte%” Mixer-SpeedFr ‘0,5946’
  • “-5 tons%” Mixer-SpeedFr ‘0,561’
  • “-1 septieme%” Mixer-SpeedFr ‘0,5297’
  • “-1 octave%” Mixer-SpeedFr ‘0,5’
  • “-1 octave 1/2%” Mixer-SpeedFr ‘0,3337’
  • “-2 octaves%” Mixer-SpeedFr ‘0,25’
  • “-3 octaves%” Mixer-SpeedFr ‘0,125’
  • “-4 octaves%” Mixer-SpeedFr ‘0,0625’
  • “Pause%” Mixer-SpeedFr ‘0’
  • “-4 octaves back%” Mixer-SpeedFr ‘-0,0625’
  • “-3 octave back%” Mixer-SpeedFr ‘-0,125’
  • “-2 octaves back%” Mixer-SpeedFr ‘-0,25’
  • “-1 octave 1/2 back%” Mixer-SpeedFr ‘-0,3337’
  • “-1 octave back%” Mixer-SpeedFr ‘-0,5’
  • “-1 quinte back%” Mixer-SpeedFr ‘-0,6674’
  • “-1 tierce back%” Mixer-SpeedFr ‘-0,7937’
  • “-1 seconde back%” Mixer-SpeedFr ‘-0,8909’
  • “-1 1/2 ton% back” Mixer-SpeedFr ‘-0,9439’
  • “Normal backward speed%” Mixer-SpeedFr ‘-1,0’
  • “+ 1/2 ton back%” Mixer-SpeedFr ‘-1,0595’
  • “+ 1 seconde back%” Mixer-SpeedFr ‘-1,1225’
  • “+ 1 tierce back%” Mixer-SpeedFr ‘-1,2599’
  • “+ 1 quinte back%” Mixer-SpeedFr ‘-1,4983’
  • “+ 1 octave back%” Mixer-SpeedFr ‘-2’
  • “+ 1 octave 1/2 back%” Mixer-SpeedFr ‘-2,9966’
  • “+ 2 octavesback%” Mixer-SpeedFr ‘-4’
  • “+ 3 octaves back%” Mixer-SpeedFr ‘-8’
  • “Max back%” Mixer-SpeedFr ‘-10’

DestroyMenu /SpeedEn
AddToMenu /SpeedEn

  • “Max%” Mixer-SpeedEn ‘10’
  • “+ 3 octaves%” Mixer-SpeedEn ‘8’
  • “+ 2 octaves%” Mixer-SpeedEn ‘4’
  • “+ 1 octave 1/2%” Mixer-SpeedEn ‘2.9966’
  • “+ 1 octave%” Mixer-SpeedEn ‘2’
  • “+ 1 septieme%” Mixer-SpeedEn ‘1.8877’
  • “+ 5 tons%” Mixer-SpeedEn ‘1.7818’
  • “+ 1 sixte%” Mixer-SpeedEn ‘1.6818’
  • “+ 4 tons%” Mixer-SpeedEn ‘1.5874’
  • “+ 1 quinte%” Mixer-SpeedEn ‘1.4983’
  • “+ 3 tons%” Mixer-SpeedEn ‘1.4142’
  • “+ 1 quarte%” Mixer-SpeedEn ‘1.3348’
  • “+ 1 tierce%” Mixer-SpeedEn ‘1.2599’
  • “+ 1 ton 1/2%” Mixer-SpeedEn ‘1.1892’
  • “+ 1 seconde%” Mixer-SpeedEn ‘1.1225’
  • “+ 1/2 ton%” Mixer-SpeedEn ‘1.0595’
  • “+ 3 commas%” Mixer-SpeedEn ‘1.0414’
  • “+ 2 commas%” Mixer-SpeedEn ‘1.0275’
  • “+ 1 comma%” Mixer-SpeedEn ‘1.0136’
  • “Normal%” Mixer-SpeedEn ‘1.0’
  • “-1 comma%” Mixer-SpeedEn ‘0.9865’
  • “-2 commas%” Mixer-SpeedEn ‘0.9733’
  • “-3 commas%” Mixer-SpeedEn ‘0.9602’
  • “-1 1/2 ton%” Mixer-SpeedEn ‘0.9439’
  • “-1 seconde%” Mixer-SpeedEn ‘0.8909’
  • “-1 ton 1/2%” Mixer-SpeedEn ‘0.8409’
  • “-1 tierce%” Mixer-SpeedEn ‘0.7937’
  • “-1 quarte%” Mixer-SpeedEn ‘0.7492’
  • “-3 tons %” Mixer-SpeedEn ‘0.7071’
  • “-1 quinte%” Mixer-SpeedEn ‘0.6674’
  • “-4 tons%” Mixer-SpeedEn ‘0.623’
  • “-1 sixte%” Mixer-SpeedEn ‘0.5946’
  • “-5 tons%” Mixer-SpeedEn ‘0.561’
  • “-1 septieme%” Mixer-SpeedEn ‘0.5297’
  • “-1 octave%” Mixer-SpeedEn ‘0.5’
  • “-1 octave 1/2%” Mixer-SpeedEn ‘0.3337’
  • “-2 octaves%” Mixer-SpeedEn ‘0.25’
  • “-3 octaves%” Mixer-SpeedEn ‘0.125’
  • “-4 octaves%” Mixer-SpeedEn ‘0.0625’
  • “Pause%” Mixer-SpeedEn ‘0’
  • “-4 octaves back%” Mixer-SpeedEn ‘-0.0625’
  • “-3 octave back%” Mixer-SpeedEn ‘-0.125’
  • “-2 octaves back%” Mixer-SpeedEn ‘-0.25’
  • “-1 octave 1/2 back%” Mixer-SpeedEn ‘-0.3337’
  • “-1 octave back%” Mixer-SpeedEn ‘-0.5’
  • “-1 quinte back%” Mixer-SpeedEn ‘-0.6674’
  • “-1 tierce back%” Mixer-SpeedEn ‘-0.7937’
  • “-1 seconde back%” Mixer-SpeedEn ‘-0.8909’
  • “-1 1/2 ton% back” Mixer-SpeedEn ‘-0.9439’
  • “Normal backward speed%” Mixer-SpeedEn ‘-1.0’
  • “+ 1/2 ton back%” Mixer-SpeedEn ‘-1.0595’
  • “+ 1 seconde back%” Mixer-SpeedEn ‘-1.1225’
  • “+ 1 tierce back%” Mixer-SpeedEn ‘-1.2599’
  • “+ 1 quinte back%” Mixer-SpeedEn ‘-1.4983’
  • “+ 1 octave back%” Mixer-SpeedEn ‘-2’
  • “+ 1 octave 1/2 back%” Mixer-SpeedEn ‘-2.9966’
  • “+ 2 octavesback%” Mixer-SpeedEn ‘-4’
  • “+ 3 octaves back%” Mixer-SpeedEn ‘-8’
  • “Max back%” Mixer-SpeedEn ‘-10’

DestroyMenu /Jump
AddToMenu /Jump

  • " 1%" Mixer-Jump ‘1’
  • " 2%" Mixer-Jump ‘2’
  • " 3%" Mixer-Jump ‘3’
  • " 5%" Mixer-Jump ‘5’
  • " 6%" Mixer-Jump ‘6’
  • " 7%" Mixer-Jump ‘7’
  • " 8%" Mixer-Jump ‘8’
  • " 9%" Mixer-Jump ‘9’
  • “10%” Mixer-Jump ‘10’
  • “11%” Mixer-Jump ‘11’
  • “12%” Mixer-Jump ‘12’
  • “13%” Mixer-Jump ‘13’
  • “14%” Mixer-Jump ‘14’
  • “15%” Mixer-Jump ‘15’
  • “16%” Mixer-Jump ‘16’
  • “17%” Mixer-Jump ‘17’
  • “18%” Mixer-Jump ‘18’
  • “19%” Mixer-Jump ‘19’
  • “20%” Mixer-Jump ‘20’

DestroyMenu /Seek
AddToMenu /Seek

  • " 15 min" Mixer-Seek ‘900’
  • " 10 min" Mixer-Seek ‘600’
  • " 5 min" Mixer-Seek ‘300’
  • " 3 min" Mixer-Seek ‘180’
  • " 2 min" Mixer-Seek ‘120’
  • “1 min 30” Mixer-Seek ‘90’
  • " 1 min" Mixer-Seek ‘60’
  • " 30 sec" Mixer-Seek ‘30’

DestroyMenu /Rel
AddToMenu /Rel

  • " 10 min" Mixer-Rel ‘600’
  • " 5 min" Mixer-Rel ‘300’
  • " 3 min" Mixer-Rel ‘180’
  • " 2 min" Mixer-Rel ‘120’
  • “1 min 30” Mixer-Rel ‘90’
  • " 1 min" Mixer-Rel ‘60’
  • " 45 sec" Mixer-Rel ‘45’
  • " 30 sec" Mixer-Rel ‘30’
  • " 20 sec" Mixer-Rel ‘20’
  • " 10 sec" Mixer-Rel ‘10’
  • “-10 sec” Mixer-Rel ‘-10’
  • “-20 sec” Mixer-Rel ‘-20’
  • “-30 sec” Mixer-Rel ‘-30’
  • “-45 sec” Mixer-Rel ‘-45’
  • " -1 min" Mixer-Rel ‘-60’
  • “-1 min 30” Mixer-Rel ‘-90’
  • " -2 min" Mixer-Rel ‘-120’
  • " -3 min" Mixer-Rel ‘-180’
  • " -5 min" Mixer-Rel ‘-300’
  • “-10 min” Mixer-Rel ‘-600’
    [/code]
    In Preferences-Menu

[code]# Music player

DestroyMenu /Preferences/MusicPlayer
AddToMenu /Preferences/MusicPlayer
Test (x alsaplayer) + ‘%22x22/apps/alsaplayer.png%Alsaplayer’ SelectMusicPlayer alsaplayer

It is more players here

DestroyFunc SelectMusicPlayer
AddToFunc SelectMusicPlayer

  • I FindCommand MusicPlayer $0 alsaplayer mpd quodlibet xmms xmm2 cmus cdcd
  • I Include components/functions/Music-$[MusicPlayer]
  • I SavePreferences DefaultMusicPlayer “Include components/functions/Music-$[MusicPlayer]”

Audio mixer

DestroyMenu /Preferences/Mixer
AddToMenu /Preferences/Mixer
Test (x aumix) + ‘%22x22/apps/aumix.png%Aumix’ SelectMixer aumix
+ “” Nop
Test (x alsaplayer) + ‘%22x22/apps/alsaplayer.png%Alsaplayer’ SelectMixer alsaplayer

More plaers here too.

DestroyFunc SelectMixer
AddToFunc SelectMixer

  • I FindCommand DefaultMixer $0 aumix alsaplayer mpd quodlibet xmms xmms2 cmus cdcd
  • I Include components/functions/Mixer-$[DefaultMixer]
  • I SavePreferences DefaultMixer “Include components/functions/Mixer-$[DefaultMixer]”
    [/code]

The alsaplayer is the only linux audio player that have both a speed control and a simple API.

I get a problem with the , and the . in the decimal numbers with fvwm and my locales. It is strange because when I run the alsaplayer from a console and issue the command from another console, it doesn’t matter if I send 0.5 or 0,5 to the player, but it doesn’t work with this menu, so I done a locale test to select the volume and the speed control.

I don’t know if I want to keep all the values in the speed control because I use mostly only a few of them, the small values around the normal speed. It is very useful when playing guitar at the same time I am listening to some music, and with the slider in the alsaplayer GUI, it is almost impossible to get so small changes.

Another good thing is at the volume control is in db. :slight_smile: The last value, -36 db, = ~ to 1 % of the 0 db volume.

But my first concern is the order of the submenus. I cannot figure out what is going out.

I would expect this at times, if you’re globbing files and so on. I’d much rather, in your question, you would post only the relevant functions which exhibit this behaviour, rather than making those that help you wade through it all. I certainly won’t bother running these to see what happens. Do you think you could do that?

Those two functions above do the exact same thing. The only thing which changes is the action of the menu item. It would be easier to merge them, as in:

DestroyFunc foo
AddToFunc   foo
+ I DestroyMenu recreate /Music/LoadPlaylist
+ I AddToMenu /Music/LoadPlaylist
+ I PipeRead 'for i in $[Alsaplayer-Playlists]/*.m3u $[Alsaplayer-Playlists]/*.pls; do \
  name=$(basename "$i"); \
  sname=${name%%.m3u}; \
  sname=${sname%%.pls}; \
  echo \"AddToMenu /Music/LoadPlaylist \'$sname\' Exec exec $0 \'$i\'\"; done'

Then just pass in the value of the command:

.... foo "rm -fr"

Yes – I discussed this with you on the mailing list.

– Thomas Adam

I posted all because 1) I am lost, and 2) such a menu can maybe be useful to someone else.

The wrong submenu are Popup /Start and Popup /Rel and they are cross, and /Music/LoadPlaylist and Popup /Jump and they are cross too.

– Thomas Adam
[/quote]

And when I said sometime, it is in fact once on two. :question:

They are the same functions as in Music-xmms from fvwm-crystal, I changed only “xmms -e” with “alsaplayer -e” in the first one and nothing in the second one.

[quote]

DestroyFunc foo
AddToFunc   foo
+ I DestroyMenu recreate /Music/LoadPlaylist
+ I AddToMenu /Music/LoadPlaylist
+ I PipeRead 'for i in $[Alsaplayer-Playlists]/*.m3u $[Alsaplayer-Playlists]/*.pls; do \
  name=$(basename "$i"); \
  sname=${name%%.m3u}; \
  sname=${sname%%.pls}; \
  echo \"AddToMenu /Music/LoadPlaylist \'$sname\' Exec exec $0 \'$i\'\"; done'

Then just pass in the value of the command:

.... foo "rm -fr"

Those function are not the same. The last line of the first one is

echo \"AddToMenu /Music/LoadPlaylist \'$sname\' Exec exec alsaplayer -e \'$i\'\"; done'[/code]and the last line of the second one is[code]echo \"AddToMenu /Music/RemovePlaylist \'$sname\' Exec rm -f \'$i\'\"; done'

I try to do something as you said, but things become only worse, because the menu shifting problem remain, and I get no submenu for those 2 functions.

I read in fvwm man page:

It is not clear to me what “user interaction” mean. For me, an user interaction in a menu is to choose a menu item and click on it.

No matter, I modified Mixer-alsaplayer to get:

[code]DestroyFunc Music-Start
AddToFunc Music-Start

  • I Exec exec killall alsaplayer
  • I Exec exec $0

DestroyMenu /Start
AddToMenu /Start

  • “Alsa%” Music-Start “alsaplayer -o alsa”
  • “Jack%” Music-Start “alsaplayer -o jack -F 48000”[/code]

I also moved it in Music-alsaplayer and changed in Mixer-alsaplayer all the $[A_Player] into alsaplayer, but the sub menus are always shifted as before.

What I can see, is at all the individual functions are working, it is only at the sub menus are not working as expected once on two. So, if it is not a bug, say me something that I can understand and not at I am globbing files. This word in not even in my lexicon and altavista don’t know it either.

Which word? Since you’re autogenerating them, it is most likely that which is causing the menus to appear out of order. I am not sure why.

– Thomas Adam

globbing

Yes, it is strange. It is a mean to get some messages from the process as menu generation?

I try to do the following, but it doesn’t work:

[code]DestroyFunc /Music-generator
AddToFunc /Music-generator

  • I AddToMenu /Music ‘$[gt.Playlist]’ Popup /Music/Playlist

DestroyFunc Music-Playlist-generator
AddToFunc Music-Playlist-generator

  • I DestroyMenu recreate /Music/Playlist
  • I AddToMenu /Music/Playlist
  • I PipeRead ‘for i in $[Alsaplayer-Playlists]/.m3u $[Alsaplayer-Playlists]/.pls; do
    name=$(basename “$i”);
    sname=${name%%.m3u};
    sname=${sname%%.pls};
    echo “AddToMenu /Music/Playlist ‘$sname’ Exec $0 ‘$i’”; done’

DestroyMenu /Music/Playlist
AddToMenu /Music/Playlist

  • “Load” Music-Playlist-generator ‘exec alsaplayer -e’
  • “Remove” Music-Playlist-generator ‘rm -f’
    [/code]

The Playlist sub menu show only Load and remove, but nothing else. I don’t get the list.

The only good is at it is only one crossing left once on two: /rel and /start.

I found a solution. It is to do 4 menus at the place of one, and add a button in the audio button so at I can have better bindings.

It is less candy as only one menu, but not buggy. If someone have another solution, I will really appreciate to know about it.

This problem with the order of the sub menus is very strange. One of my menu in the audio button is as follow:

[code]DestroyFunc /Music-generator
AddToFunc /Music-generator

  • I DestroyMenu recreate /Music
  • I AddToMenu /Music ‘$[gt.Speed]’ Popup /Music/Speed
  • I AddToMenu /Music “” Nop
  • I AddToMenu /Music ‘$[gt.Stop playback]’ Music-Stop
  • I AddToMenu /Music ‘$[gt.Play]’ Music-Play
  • I AddToMenu /Music ‘$[gt.Pause]’ Music-Pause
  • I AddToMenu /Music ‘$[gt.Play/Pause]’ Music-PlayPause
  • I AddToMenu /Music “” Nop
  • I AddToMenu /Music ‘$[gt.Next]’ Music-Next
  • I AddToMenu /Music ‘$[gt.Prev]’ Music-Prev
  • I AddToMenu /Music ‘$[gt.Song change]’ Popup /Music/SongChange
  • I AddToMenu /Music ‘$[gt.Jump]’ Popup /Music/Jump
  • I AddToMenu /Music ‘$[gt.Seek]’ Popup /Music/Seek
    [/code]
    It have 4 Popup menu and work very well, but if I comment out the last line, it is only 3 Popup sub menus, and the order of those Popup is wrong once on two.

If it is possible to debug such a thing, I can help you, but you must help me by telling me what I can do.

The problem is down to how FVWM starts commands in the 'I’mmediate context within a function. As I have written about so many times before, the commands in an 'I’mmediate context are not executed synchronously – hence what I suspect is happening here is that you’re getting some menus being opened/created before others, and here’s the kicker: not necessarily in the order you’re specifying them. You should probably try mitigating this with Schedule.

Apologies for the long delay – I’ve been busy.

– Thomas Adam

Me too you know… Real life is calling all the time.

I will try you advice with Schedule when I get some time for that.

Thank you.

Now that the wiki is back up:

fvwmwiki.xteddy.org/fvwmwiki/Fun … onisation/

– Thomas Adam