Jump to content

Change timeout from within Plugin


amontillado

Recommended Posts

Hello,

 

I'm playing around with different methods of changing the timeout for a specific window (in this case for the scrobbler window).

I've tried a couple of things:

 

1. Use the IDVBViewer .SetSetupvalue (osd, menutimeout) and then .applyconfig.

This does work, but obviously changes the global value. Changing it when the window is visible and back when its not sort of work but is not really a nice way (and also triggers a rebuild of the osd).

 

2. Use the IOSDPlgWindow .Set_Timeout

Havent got this to work (probably doing something wrong)

 

3. Set the timeout in the windowdef.xml

If I add an entry for the plugin window, the window won't be activated at all anymore.

 

4. Prevent timeout with an timely action (like sending an ACTION_KEY_PRESSED every now and then).

This does work without any notable problems, but just doesnt feel as the way to go :rolleyes:

 

If someone please could advise me what the best way is it would be greatly appreciated.

 

 

Another, different question.

I (and some users) have experienced some problems with plugins that use the sqlite3.dll when insert/update queries are executed (they just dont get executed). It has allready been suggested that this is probably due to:

•Add: Added a new manifest to prevent windows from using the virtual store for the configuration data of the DVBViewer Pro and it's plugins.

Allthough my knowledge on the subject is insufficient to explain why it effects the plugins the way it does.

A workaround could be to have a copy of sqlite3.dll in the main configuration folder, i quickly tested this and it seems to work fine. But i was wondering if there was another way.

 

thanks,

ger

Link to comment
A workaround could be to have a copy of sqlite3.dll in the main configuration folder, i quickly tested this and it seems to work fine. But i was wondering if there was another way.

The correct way would be: use the sqlite.dll from the DVBViewer folder, query the DVBViewer for the configuration folder und put any data which needs to be saved there (including databases -> database folder). NEVER EVER use the application folder to save data. I noticed this behaviour at least with the myseries plugin.

 

And as a fallback: if you can't get the configuration folder from the DVBViewer, use the usermode.ini in the application folder and calculate the configuration folder on your own following this: http://en.DVBViewer.tv/wiki/Multiuser_mode .

 

2. Use the IOSDPlgWindow .Set_Timeout

What do you enter there? this is normally the way to go. Or you use the newwindow function of the IOSDWindowmanager defining the timeout when registering the plugin window.

Link to comment

Thanks for quick reply Lars.

The correct way would be: use the sqlite.dll from the DVBViewer folder, query the DVBViewer for the configuration folder und put any data which needs to be saved there (including databases -> database folder). NEVER EVER use the application folder to save data. I noticed this behaviour at least with the myseries plugin.

 

And as a fallback: if you can't get the configuration folder from the DVBViewer, use the usermode.ini in the application folder and create the configuration folder on your own following this: http://en.DVBViewer.tv/wiki/Multiuser_mode .

What myseries does (or at least should do), is query DVBViewer for the config and application folder, look for the sqlite3.dll (normally in the application folder), then set the sqlpath accordingly. The db is obviously stored in the configuration \ database folder. Next to that, as a fallback it stores the location of the database and sqlite3.dll in myseries.ini (stored in in the configutarion \ plugins folder). For as far as I know current versions of myseries/mymovies/myscrobbler should not save anything in the application folder. Please let me know what you noticed so i can eliminate the error asap.

 

But in the way that I wrote above, I shouldn't get any problems with the insert/update queries right ?

 

What do you enter there? this is normally the way to go. Or you use the newwindow function of the IOSDWindowmanager defining the timeout when registering the plugin window.

Thanks! .. I figured at least one thing out that I did wrong

If I created the window like this:

WindowManager.NewWindow(WINDOW_ID, 'myscrobbler.xml', self, iWindow, '', '', '', PLUG_NAME,'', '', '', 30, true, punk);

The timeout being set to 30, but then it still uses the default timeout. As soon as I set the Allowtimeout to False it works like I expected. I overlooked the fact that the allowtimeout value determines if DVBViewer should use its standard timeout settings.

ps.. iWindow is the window id of the parent window of course.

 

The .set_timeout still doesnt seem to work, but now that the above works it isnt really that important anymore.

For you info the code that I use for this is:

function TBasePlugin.OnInit(const Window: IOSDPlgWindow): HRESULT;
begin
 Window.SetID(WINDOW_ID_MYSCROBBLER);
 result := S_OK;
 try
   FWindow := Window;
   FWindow.Set_Timeout(60);
 except
   result := E_FAIL;
 end;
 FMSGID := -1;
end;

Link to comment
But in the way that I wrote above, I shouldn't get any problems with the insert/update queries right ?

No normally not. Is this a a constant failure (would indicate a access problem) or does it only happen sometimes and then it works again?

Is there any concurrency? The recording service reads from the database when updating the video library, maybe this might be the cause?

Link to comment

Thanks,

It's look now that it is only occuring with myseries, but does seem to constantly there.

I'll do some more extensive testing on a win7 machine to figure out what is going on soon (unfortunally the development pc is an xp machine and my wife has commandeered the win7 one because of some weird dance show :whistle: )

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...