Help - Search - Members - Calendar
Full Version: foobar menubar + objectbar
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
smoketetsu
I use a program called obectbar which let's you create bars of any type and I like to use it to put a menubar at the top of the desktop, MacOS style. However with foobar2000 the menu entries are all blank using the standard UI and others since they seem to be based on the standard. I was going to look to see if I could fix this myself so I checked foobar2000.exe, no menu entries... I checked the UI plugins, and there are entries but they are blank to be filled in from someplace else and I can't figure out where.

Could someone make a mod to the standard or other UI plugin that has the menubar in it's resources (and not just blanks to be filled in by something else).
foosion
The menu in foobar2000 is generated dynamically, no matter what UI you use.
smoketetsu
QUOTE(foosion @ Aug 3 2004, 10:17 PM)
The menu in foobar2000 is generated dynamically, no matter what UI you use.
*



Exactly that's why I am asking for a plugin. =p Does this mean a plugin can't be made that has the commands for the menu in it?
kode54
You could create a menu yourself, where each item executes:

<path to>\foobar2000.exe "/command:Menu command"

For a full list of switches, give Foobar2000 the /? switch.

For a full list of menu commands, right click within the main menu item tree, select Insert item -> Command...

Sure, it's not the most convenient thing. As an alternative, you could ask Stardock about supporting dynamically generated menus, or toolbar menus, which aren't really root menus in the traditional sense, and would probably be hard to support at all.
smoketetsu
QUOTE(kode54 @ Aug 4 2004, 06:58 AM)
You could create a menu yourself, where each item executes:

<path to>\foobar2000.exe "/command:Menu command"

For a full list of switches, give Foobar2000 the /? switch.

For a full list of menu commands, right click within the main menu item tree, select Insert item -> Command...

Sure, it's not the most convenient thing. As an alternative, you could ask Stardock about supporting dynamically generated menus, or toolbar menus, which aren't really root menus in the traditional sense, and would probably be hard to support at all.
*



The thing is that it works with K-meleon which loads the menubar from a text file rather than the programs executable file which I was also able to easily edit with a text editor.
kode54
Is your current Foobar2000 UI using a real menubar, or a toolbar menubar? The latter is not really a menubar, but a toolbar which mimics a standard menu. Plus, since there's no common system control for doing this, there's also no easy generic way for a program to detect and track such a menu.
smoketetsu
QUOTE(kode54 @ Aug 7 2004, 02:08 PM)
Is your current Foobar2000 UI using a real menubar, or a toolbar menubar? The latter is not really a menubar, but a toolbar which mimics a standard menu. Plus, since there's no common system control for doing this, there's also no easy generic way for a program to detect and track such a menu.
*



I can turn on the regular menubar and it shows the entries in my objectbar, but when I click on one it just shows blank menus. The problem with foobar's standard UI is that the menu entries aren't in the .dll's menu resources rather there is placeholders for them which get loaded into in a way that I guess objectbar wasn't written to see. Other plugins seem to follow this example too.

Actually there is a standard way to do a menubar that can be tracked which is to put the menubar in the programs resources. If you can view "menus" in reshacker you can view them from another program. I have noticed that (from the itunes multiplugin) it is even possible to have the menubar just in the .exe or .dll's resources and not have it in the window and a program like objectbar can see and display it. From the chat program "The Manor" I have also noticed it is possible to have different menus for different windows that can be displayed in objectbar. That program has a main window menubar and one for it's avatar importer\editor.

Notepad, calc, sndvol32, etc are examples of programs using the most standard menubars in windows. Which is to embed it in the files resources.

To me it seems the easiest way to have menus that can be redirected is to put them into the dll or exe's resources but K-meleon and even internet explorer have shown me that it is possible to also load entries from other places such as links out of a folder or out of a text file.

I have also used a special text editor that loads up and you can close all it's windows and it stays resident in memory and if you bring that task into focus objectbar can still see it's menubar and you can open a window, etc.
smoketetsu
Is anyone at all interested in adding this? I'm sure it shoudln't be too hard.
smoketetsu
I have an idea of how I can do this myself but I need a list of numbers for the functions to edit into the menubar resource. Could someone give me a list or tell me where I can find it please?
kode54
Since this software seems to have a problem with dynamically generated menus, you would have to create a static menu template that replicates the standard menus. You would also have to fill it with entries to represent the default settings.

You can say goodbye to dynamic and/or configurable menus, unless the only problem this software has is with the base menus being dynamic, and not the contents or submenus.

Or, you could report the problem to Stardock.
smoketetsu
I've seen it work with other programs that have menubars that are loaded out of xml\html files (the jabber instant message client pandion is an example of that), text files (k-meleon and it's menus.cfg), as well as the resource (lot's of other programs). In fact Miranda IM is getting dynamic menus with it's new plugins and those work in objectbar.

However with foobar2000 it's different as it's coming from some unknown place. I have edited the standard UI to fill in the entries with dummy entries but I don't have actions assigned to them because I don't know the integer numbers for said actions. I tried filling in the actions by putting the regular names as seen in the foobar2000.cfg but those don't work in a resource file because a resource file requires an integer (number).

I actually don't care too much about them being "dynamic" as long as they show up in the bar I'm happy so all I need are the integer numbers for the actions and I can fill it in myself I don't mind editing it manually at all. Especially since there seems to be no interest around here in making it work in the program it'self out of the box the real way.
smoketetsu
An update. I got the playback menu working, I plugged in the integer numbers from the ascii menu resource and it works pretty good. Now all I need are the integer numbers for everything else. I tried looking practically everywhere for them but I could not find them. And the numbers go into the thousands so I can't sit here and guess thousands of numbers just go get the functions.

In case anyone has the information I need but is holding it back I am only modifying the UI dll's for personal use. I'm not about to distribute and step on anyones toes.
kode54
I just realized something. The menus are generated when they are opened, which may be a problem if anything needs to know the contents at any time while they are closed, outside of the program itself.

Oh, and the ID numbers are allocated dynamically, so they will change if you ever reconfigure the menus.
smoketetsu
I guess the ascii menus aren't "generated as they are opened" because they continue to work even now? What if I only "reconfigure the menus" by editing them in the resources? Are you telling me the numbers are different on everyone's foobar2000 what is the benefit to that? Miranda IM's current nightly has menus configurable from the preferences and has no such "problems" so I know it can be done without those problems. Also, I told you I'm prepared to lose some dynamics if I have to are you trying to discourage me?

Are there any default foobar2000 numbers and if they are could someone please give them to me?
foosion
QUOTE(smoketetsu @ Oct 8 2004, 05:03 PM)
Are there any default foobar2000 numbers and if they are could someone please give them to me?

There are no default command IDs. That's what kode54 has been trying to tell you:
QUOTE(kode54)
Oh, and the ID numbers are allocated dynamically, so they will change if you ever reconfigure the menus.
kode54
QUOTE(smoketetsu @ Oct 8 2004, 08:03 AM)
I guess the ascii menus aren't "generated as they are opened" because they continue to work even now? What if I only "reconfigure the menus" by editing them in the resources? Are you telling me the numbers are different on everyone's foobar2000 what is the benefit to that? Miranda IM's current nightly has menus configurable from the preferences and has no such "problems" so I know it can be done without those problems. Also, I told you I'm prepared to lose some dynamics if I have to are you trying to discourage me?

Are there any default foobar2000 numbers and if they are could someone please give them to me?
*



The Foobar2000 menus are fully dynamic. Does Miranda allow you to configure the menu items without restarting? Can any plug-in expose its own menu items which it can decide to show or hide any time a menu which contains its options is popped up?

Foobar2000 menu items are registered through a service. The core allows users to add or remove any of these menu items within any of the root menus. The menu item IDs depend on which items are configured to appear in the menu and what order they are in.

If this system is too powerful and/or too much of a pain for Objectbar's current menu handling system, you should report the problem to Stardock. After all, you are a registered user of their software. Of course, it may prove too much of a daunting task for them, and you'll have to live with your dirty hack.

As for your hacking, it's okay, if you keep it to yourself as you say you plan to.
smoketetsu
I don't know about the second question but for the first, yes miranda IM's menu system does allow you to change the menus without restarting the program and it works. Wait, if you meant can a plugin add menus to the menubar and have it show up in the dynamic menubar and it still work with objectbar, yes it can do that.

And no I can't "live with my dirty hack" because I haven't been supplied with all the default codes for the menubar I only have the playback codes from the asciii menu. Is that what you mean? I'm asking please to give me all the default codes for the menubar I'm not going to be changing them through the options.

I had an idea perhaps a plugin could be made to dump the dynamically generated numbers from the service into a text file rather than the names like it currently does and have that be used for the standard menubar as an option? I think the problem might have to do with the names that are being used instead of integers for the menubar items. I think it could be done but I myself am no programmer so I'm stuck doing it the previous way in this post unless somoene decides to make a plugin.
kode54
There are no default codes. Codes start at 1 for the first item to appear in the menu, and then count upward. This goes for all pop-up menus.
smoketetsu
What I meant by default codes is default command codes that get assigned to a menu item before they are edited by the preferences UI which thus changes them according to you.

For example:

MENUITEM "Stop\Z", 40010
MENUITEM "Pause\tX", 40044
MENUITEM "Play\tC", 40009

I got those codes from the ascii menu and plugged them into the main menu and they worked. The numbers at the end are the codes which are assigned to actions. So if there where no default codes then those codes would not work.
kode54
The codes from the ASCII buttons might work, but the rest of the menus won't work that easily.

When you're dealing with the toolbar-style menus:
  • User clicks menu caption button.
  • UI window handler invokes menu_manager, which:
  • Creates a pop-up menu with CreatePopupMenu()
  • Fills it with items, starting with ID 1.
  • Automatically generates keyboard shortcut mnemonics.
  • Displays it with TrackPopupMenu(..., TPM_RIGHTBUTTON|TPM_NONOTIFY|TPM_RETURNCMD,...)
  • Destroys the menu with DestroyMenu()
  • If a command was returned, executes it.
Basically the same for the standard UI equipped with a normal menubar, only a wonderful hackfest to dynamically fill the submenus when the user opens them. "It just works."
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.