Jump to content

New Menu Creator Plugin


Griga

Recommended Posts

As announced in this thread - here it is: The new menu creator plugin for the DVBViewer (full version only, sorry).

 

It allows to create your own menu structure in the Plugins Menu, with menu items that launch programs, open files or folders, switch over to channels... with submenus and sub-submenus (up to 9 levels)... maybe you'll find even more possibilties.

 

What you have to do: Put the MenuCreator.dll into the DVBViewer\Plugins folder and create a little textfile there (can be done with any text editor), that defines the menu structure. The file must be stored under the name MenuList.ini in the Plugins folder and may look like this:

ITEM

 

Item without any paramter creates a separator line in the menu

This line and the line above are regarded as comments and do nothing

 

ITEM Open DVBViewer Folder|C:\Programme\DVBViewer

ITEM MPEG2Cut|C:\Programme\MPEG2Cut\MPEG2CUT.exe

 

SUBMENU Radio Favorites

ITEM Rock Antenne|DVBViewer.exe|-cROCK ANTENNE:160

ITEM Paris Jazz|DVBViewer.exe|-cParis Jazz:8535

ITEM RTL Francais|DVBViewer.exe|-cRTL:8528

END

 

SUBMENU Video Favorites

ITEM Stadtgespräch|E:\Videos\Stadtgespräch.mpg

ITEM Dick und Doof|E:\Videos\Dick und Doof.avi

END

 

ITEM

 

The menu items have the following format:

 

ITEM Caption|Command|Parameters

 

where "Caption" is what you see in the menu. "Command" specifies the command to be executed, or file to be opened, and "Parameters" any command line parameters that are passed to the called program (may be left out). Well, it's quite simple - just have a try, and you will see how it works. I will upload the DLL in the following posting (Delphi source included). The screenshot shows the result of the menu script above:

Zwischenablage01.png

Link to comment

...and here is the uploaded ZIP, containing the DLL and the Delphi 6 source.

 

Some additional hints:

 

- Caption, Command and Parameters have to be separated by the "|" character (pipe).

 

- If you do not specify a path for the program/file to be executed/opened, the plugin assumes that it is in the DVBViewer folder.

 

- If you specify no command at all, the plugin assumes DVBViewer.exe. The following line creates a menu item that switches the DVBViewer to standby mode (no channel tuned):

 

ITEM DVBViewer Standby||-c

 

Please don't blame me if there are bugs - the MenuCreator plugin is just a quick and dirty hack :radscorpion: If you encounter a bug, report it here, and it will be fixed. And if there are questions, ask.

 

Enjoy!

 

Griga

MenuCreator.zip

Link to comment

Two additional hint for creating your own menus:

 

- You can make a menu item selectable via keyboard by using the ampersand character '&': Example:

 

ITEM Open &DVBViewer Folder|C:\Programme\DVBViewer

 

After this, the letter 'D' appears underlined in the menu, and the item can be selected by pressing [D] on your keyboard (after the menu has been opened, of course).

 

- If you use several plugins, you can change the menu order by renaming the DLLs in the Plugins folder. E.g. if you want the entries created via the MenuCreator.dll to appear topmost in the Plugins menu, just rename it to AAMenuCreator.dll, so it becomes first in alphabetical order.

 

That won't work with plugin-DLLs that rely on their name, but usually there should be no reason for that (the ones I have written don't), and the DVBViewer doesn't mind...

 

Griga

Link to comment

Well, here we go again... I've spent some more time hacking the DVBViewer menus, and I suggest, that you first have a look at the attached picture. You'll see the DVBViewer context menu there - but wait: If you have a closer look, you'll see something that should not be there: A Radio Favorites submenu. How did it get there?

 

Actually, it is *not* the DVBViewer context menu - though it functions almost in the same way. It's an imitation that replaced the original.

 

OK, I think you already know what's going on: There is a new version 1.5 of the MenuCreator Plugin (download link see above, Delphi source included). Some tricky things had to be done in the plugin (e.g. installing a message hook to catch Windows messages before the DVBViewer sees them), in order to provide the following features:

 

icon11.gif In the menu script you may define your own popup menu, that appears after clicking the DVBViewer window with the middle mouse button.

 

icon11.gif You may define your own context menu, that appears after right-clicking the DVBViewer window. It replaces the original context menu. However, the original still can be accessed via the tray icon or by holding down the shift key while right-clicking.

 

icon11.gif In the menu script you may use all DVBViewer functions that are listed under Options/Control.

 

Now let's see how it is done. In the menu script some more identifiers can be used:

 

icon11.gif All items/submenus between a PLUGINS and PLUGINS END statement appear in the DVBViewer's Plugins Menu.

 

In order to keep compatibility with the former version, PLUGINS is by default switched on at the beginning of the script. Thus the script has to begin with PLUGINS END, if you don't want your menu items to appear in the Plugins Menu.

 

icon11.gif All items/submenus between POPUP and POPUP END appear in the "middle mouse button" popup menu.

 

icon11.gif All items/submenus between CONTEXT and CONTEXT END appear in a new context menu. that replaces the original.

 

In the new ZIP you'll find a sample script (see ContextMenu.ini), that contains a fairly complete imitation of the original DVBViewer context menu. You may use it as a base for own scripts

 

icon11.gif Commands, that perform one of the DVBViewer's control functions are identified by numbers.

 

The new ZIP download contains the text file DVBCommands.inc, that lists all numbers for all available DVBViewer functions. The file is "designed" for Delphi programmers, which may use these numbers for remote-controlling the DVBViewer.

 

Now have a look at the following sample script, and you will know...

ITEM

 

// The line above creates a separator line in the menu

// The following lines call two DVBViewer functions by numbers

// The second one is included in the popup menu

 

ITEM Videotext|135

POPUP

ITEM EPG Window|137

POPUP END

 

SUBMENU Radio Favorites

 

POPUP

 

// Now the channels by using the -cName:Service-PID format

ITEM Rock Antenne|DVBViewer.exe|-cROCK ANTENNE:160

ITEM Paris Jazz|DVBViewer.exe|-cParis Jazz:8535

ITEM RTL Francais|DVBViewer.exe|-cRTL:8528

 

POPUP END

 

END

 

ITEM

 

The whole stuff will appear in the Plugins Menu, as usual. Additionally the Radio Favorites will appear in the "middle mouse button" popup menu, but - please note - not as a submenu, because the submenu statement is not included in the POPUP... POPUP END part. The CONTEXT... CONTEXT END statements may be used in the same way.

 

OK, that's most of it - the rest is up to your creativity. The plugin has become more sophisticated, the menu scripting too... I hope you don't mind. If you want to have a list of 20 favorite channels in a menu, accessible in full screen mode - now you can have it!

 

Let's see how it works on your computer (especially the tricky techniques I had to use). If you encounter any problems, post them here, and we will solve them...

 

Griga

Demo.jpg

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...