NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 50 51 52 53 54 … 93 Next »
render only called for mouse and keyboard event

 
  • 0 Vote(s) - 0 Average
render only called for mouse and keyboard event
rshaw
Offline

Junior Member

Posts: 11
Threads: 3
Joined: May 2006
#1
2006-06-22, 08:00 PM
I am creating a plugin and need to update on screen the current track position so I implmented needsRendering as so:

bool IMenuTask.needsRendering()
{
return true;
}

yet render is only called when a keyboard event occurs. I thought since I am returning true render would be called about once a second.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#2
2006-06-22, 08:06 PM
That should be enough. Maybe try logging a message to make sure your needsRendering() method is being called.
rshaw
Offline

Junior Member

Posts: 11
Threads: 3
Joined: May 2006
#3
2006-06-22, 08:20 PM
I added

Logger.Verbose("needsRendering called");

inside of needsRendering and here is the relevant part of the log file. It seems that while music is being played back needsRendering isn't being called.


6/22/2006 4:17:53 PM.234 VERBOSE [1] Activate called
6/22/2006 4:17:54 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:55 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:56 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:57 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:58 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:59 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:17:59 PM.453 VERBOSE [1] About to start playback of F:\test\J 01-Bad Day.mp3
6/22/2006 4:18:02 PM.171 VERBOSE [1] HideMouse ref=-1
6/22/2006 4:18:29 PM.828 VERBOSE [1] MusicPlaybackManager.stop()
6/22/2006 4:18:29 PM.828 VERBOSE [1] ...about to stop music
6/22/2006 4:18:30 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:18:31 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:18:32 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:18:33 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:18:34 PM.171 VERBOSE [1] needsRendering called
6/22/2006 4:18:34 PM.593 VERBOSE [1] Deactivate called
6/22/2006 4:18:36 PM.421 VERBOSE [1] getValue() loading new key/value into cache: /settings/NetRadioBufferSize
6/22/2006 4:18:36 PM.421 VERBOSE [1] getValue: /settings/NetRadioBufferSize : 96000
6/22/2006 4:18:36 PM.421 INFO [1] NetRadio buffer size is: 96000
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#4
2006-06-22, 08:30 PM
Out of curiosity, what skin are you using?
rshaw
Offline

Junior Member

Posts: 11
Threads: 3
Joined: May 2006
#5
2006-06-22, 08:56 PM
Maybe this is where I am going wrong.

I am only attempting to get the funcationallity right and planned to work on skins later.

For the time being I had created a folder called gbpvr\skin\blue\MediaPlayer and copied all of the files from gbpvr\skin\blue\musicalbums to my new folder. I also added the following method:

public string getSkinSubdirectory()
{
return "MediaPlayer";
}

As far as skin data I am only using the following

skinHelper = new SkinHelper(document, SkinUtilities.FullActiveSkinPath + getSkinSubdirectory());

Font font = skinHelper.getNamedFont("GeneralText");
Brush brush = skinHelper.getNamedFontBrush("GeneralText");

which seems to work ok.

I must be doing something else wrong. I might start a new plugin from scratch and make sure that needsRendering works ok when PlayAudioFile is called. Then slowly add code until it stops working.

Thanks.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#6
2006-06-22, 08:59 PM
The reason I ask, is because I wanted to know if you were using a skin with the horizontal menu. The menu class is responsible for calling the needsRendering() method on the active plugin. I only really use the vertical menu, so was curious if something was going wrong in the horizontal menu.
rshaw
Offline

Junior Member

Posts: 11
Threads: 3
Joined: May 2006
#7
2006-06-22, 10:14 PM
I wrote a minimal test plugin to check if needsRendering gets called while music is playing. Pressing any key will play the song fn. Be sure to change fn to a valid song on your system. When I check the log file on my system it appears that needsRendering doesn't get called while the song is playing.

Here is the code:

using System;
using System.Drawing;
using GBPVR.Public;
using CommonGBPVRUtilities;

namespace MediaPlayer
{
public class MediaPlayerTask : IMenuTask
{
private Image canvas;
private bool once=false;
private string fn="f:\\test\\J 01-Bad Day.mp3";

string IMenuTask.getName()
{
return "Media Player";
}

string IMenuTask.getDescription()
{
return "Music and video Player";
}

public string getSkinSubdirectory()
{
return "MediaPlayer";
}

public System.Drawing.Image getTaskImage()
{
return null;
}

System.Windows.Forms.Form IMenuTask.GetConfigFormInstance(System.Xml.XmlDocument document)
{
return null;
}

void IMenuTask.Activate()
{
Logger.Verbose("Activate called");

if (!once)
{
once=true;

canvas = new Bitmap(720, 480);
}
}

void IMenuTask.Deactivate()
{
Logger.Verbose("Deactivate called");
}

bool IMenuTask.needsRendering()
{
Logger.Verbose("needsRendering called");

return true;
}

System.Drawing.Image IMenuTask.render(out bool requiresMoreRendering)
{
requiresMoreRendering = false;

Logger.Verbose("render called");

return canvas;
}

void IMenuTask.OnClick(System.Drawing.Point location)
{
}

void IMenuTask.OnDoubleClick(System.Drawing.Point location)
{
}

void IMenuTask.OnMouseWheel(System.Windows.Forms.MouseEventArgs e)
{
}

bool IMenuTask.OnKeyDown(System.Windows.Forms.KeyEventArgs e)
{
PluginHelperFactory.getPluginHelper().AddAudioFileToQueue(fn);

return false;
}
}
}
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#8
2006-06-22, 10:25 PM
Sorry, I dont really know. I'm using the same approach from my Net Radio and it seems to successfully manage to return true from needsRendering() when the song name changes.
rshaw
Offline

Junior Member

Posts: 11
Threads: 3
Joined: May 2006
#9
2006-06-23, 12:39 AM
I was expecting needsRendering to continue being called every 1 second while a song is playing.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#10
2006-06-23, 12:41 AM
Yes me too. I did check with my net radio plugin, and continues to call needsRendering() for me - even while a song is playing. I cant think of any difference it would behave differently in your case.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Recording Event jrockow 10 4,672 2014-07-28, 02:51 PM
Last Post: jrockow
  GetRenderList() always called with "block-extras..." element in renderlist alibert 1 1,609 2012-06-18, 10:24 AM
Last Post: sub
  Render order in Videos Jaggy 13 4,344 2011-10-12, 11:20 AM
Last Post: mvallevand
  Timeline mouse navigation Jaggy 2 1,847 2011-09-18, 01:53 AM
Last Post: Jaggy
  IScreenPlugin.Activate() being called twice ACTCMS 0 1,325 2011-06-03, 03:16 PM
Last Post: ACTCMS
  Event codes mvallevand 10 3,769 2011-04-06, 04:26 AM
Last Post: mvallevand
  "Rating" in cached event details xml alibert 74 16,611 2011-03-28, 01:06 AM
Last Post: zehd
  STARTUP_COMPLETE event on NMT alibert 6 2,317 2011-02-12, 05:15 PM
Last Post: sub
  How to render a graphical volume display in nPVR McBainUK 3 2,016 2010-12-13, 03:25 PM
Last Post: imilne
  TV Guide Element Render order Northpole 0 1,283 2010-10-24, 04:11 PM
Last Post: Northpole

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode