Listeners when impress runs in 'default' window type (solved)

Impress runs in ‘Default’ or ‘Window’ mode. In Window mode, the presentation is displayed in the same window as the main impress design app. (I’m not sure of the correct terminology here). In Default mode, the presentation runs in its own (usually full-screen) window. A presentation is usually made in Default mode, because in Window mode, the screen or external monitor displays the control app panels and menus as well as the presentation slide, which is obviously not wanted.

Now the problem … When a listener is set in basic macro, it receives broadcasts in Window mode, but apparently not in Default mode.TestListner.odp

Diagnostics are difficult, because in Default mode msgbox and print statements do not appear (and they are dodgy in window mode). Could it be that in Default mode the presentation app is no longer ‘ThisComponent’? If so, is it possible to make the actual presentation a listener? Or is the problem something else?

The attached document contains some macros. When 'StartMusicAndShow is run, the presentation begins at the first slide, plays some music in vlc, and kills the music when the first slide ends. I works in Window mode, but in Default mode it fails to kill the music.

For diagnostics, the most reliable way is to log messages to a text file. And yes, it does sound like the problem is ThisComponent. If so, get other components by enumerating oComponents = oDesktop.getComponents().

I now have this working. The order of statements setting up the listener seems rather critical, but unfortunately the problem solved itself when I was fixing something else, and I am not sure what made the difference. The attached file reads a file prefix of slide 0, constructs a play list, begins playing randomly, and stops when slide 0 ends.testListen.odp