NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 85 86 87 88 89 … 93 Next »
JukeBox Plugin

 
  • 0 Vote(s) - 0 Average
JukeBox Plugin
joecru
Offline

Member

Posts: 135
Threads: 26
Joined: Aug 2004
#21
2004-09-16, 08:22 AM
Thankyou Guys for your excellent instructions.

I have the PGN UP/DOWN Functions working with the PC Jukebox. But it dosen't seem to be working with the MVP.
I noticed in the code CASE KEYS can I use these so that the MVP has the PGN functions. Say asign RED button PGN/up,and
YELLOW button PGN/down,on the MVP remote?

Regards
Joe
Regards

[COLOR="black"][COLOR="Blue"]4 X MVPs
Win Vista
Hauppauge PVR 350
Dell Inspirion - 531[/COLOR][/COLOR]
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#22
2004-09-16, 08:49 AM
Joe,

I was wondering exactly the same thing,

but I dont know what the coloured keys would be called in the code.

if you look at the logs when you press them they send the following

red 36,green 37,yellow 38 and blue 39

elsewhere in the code there is a bit where Keys.G is used to automatically skip to the whats playing screen and it does seem to work, so I thought that the keys might be called

Keys.R  = red, Keys.Y = yellow Keys.B = Blue and Keys.G = green

but if you also notice these keys are also used in the searching code presumably they are the keyboard keys when you are searching from the keyboard when running on the PC

So I'm not sure if it would work as the case statement would encounter these values before page up / down code

can anyone tell us how to code for these inside plugins

are all the buttons, what they return and what their name is defined as inside plugin code defined anywhere.

I have had a look at the source of most of the plugins but none seem to use the coloured remote keys

Tkgafs
joecru
Offline

Member

Posts: 135
Threads: 26
Joined: Aug 2004
#23
2004-09-16, 09:17 AM
Hi Tkgafs ,

If you look at the following code it relates to CASE KEYS etc I wonder is it here we can add the PGNKeys.

/// <summary>
/// Is called by GBPVR in response to a key being pressed while this
/// task is active. The task should return true if it has performed some action
/// as a result of the key press - which will inturn cause the task to be render()'d
/// </summary>
public bool OnKeyDown(System.Windows.Forms.KeyEventArgs e)
{
// Green key skips to now playing list immediately.
Keys.G )if ( e.Control && e.KeyCode ==
{
mode = 1;
return true;
}

// Don't use Control or Alt keys..
if ( e.Control || e.Alt ) return false;

slideDelay = DateTime.Now.AddSeconds(10);

// Shuttle Remote:
// Keys.MediaNextTrack;
// Keys.MediaPreviousTrack;
// Keys.MediaPlayPause;
// Keys.MediaStop;
// Keys.Prior; --- PG +
// Keys.Next; --- PG -
// Keys.VolumeUp;
// Keys.VolumeDown;
// Keys.LWin; --- "windows key button between Vol+/- & PG+/-
// Keys.Menu; --- "double window icon above volume key"

switch (e.KeyCode)
{
case Keys.Menu: // Shuttle Remote: double window icon above Vol+ key
case Keys.Escape:
// return to main menu
PluginHelperFactory.getPluginHelper().ReturnToMainMenu();
return true;
};

if ( mode != 0 )
{
mode = 0;
return true;
}
else
{
// Pass event to File List also..
return FileList.OnKeyDown( e );
}
}[QUOTE]

Its hard to make out but if you look at the above code, as you suggested Keys.G he has controlling the now play list which is the Green key on the MVP Remote.

Regards
Joe
Regards

[COLOR="black"][COLOR="Blue"]4 X MVPs
Win Vista
Hauppauge PVR 350
Dell Inspirion - 531[/COLOR][/COLOR]
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#24
2004-09-16, 10:28 AM
Joe,

I have to admit I'm not really sure how the plugin all hangs together.

the code you display above is from the function onkeydown in the class JukeboxTask

but the function onkeydown also exists in the class FileSelection

where the function uses far more Key.? codes in the case statements

it is also in this version of the function that the page up and down code is invoked so I thought that we would need to put the Keys.R and Keys.Y in at the same point as the Keys.PageUp and Keys.PageDown

but as I said within the same switch block these definition [Keys.R and Keys.Y ] are already used before the page up down case is encountered, I'm guessing that they are actually the alphabetic keys on the keyboard when you are running on the PC rather than on the MVP

I have never programmed anything like this before and have to admit I cant understand how we can have two functions with the same name in different areas of the code, when and how does each function get called ?

I'm doing this from work just now so cant actually test anything but will try and test a couple of things tonight

tkgafs
colin
Offline

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#25
2004-09-16, 01:33 PM
[b Wrote:Quote[/b] ]I have never programmed anything like this before and have to admit I cant understand how we can have two functions with the same name in different areas of the code, when and how does each function get called ?

What it looks like is an interface has been defined and in two different classes there is key handling code. depending on what the jukebox is doing will determine what is happening. Remember this is OO design so if the you a C programmer (or any other sequential language) its difficult to get your head around this.

In the Fileselection buttons do one thing, in the jukebox buttons do other things. If you are having trouble visualising it, try drawing it on paper,

cheers,
Colin.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,707
Threads: 767
Joined: Nov 2003
#26
2004-09-16, 04:34 PM
Red : Ctrl-R
Green : Ctrl-G
Blue : Ctrl-B
Yellow : Ctrl-Y

When you're checking for these keys, you should also check control has been press...
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
case System.Windows.Forms.Keys.R:
if (e.Control)
{
// do something
}
...[/QUOTE]
colin
Offline

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#27
2004-09-16, 06:42 PM
I actually only got around to trying this plugin today. It is very good. Kudos tot he author.

Colin.
colin
Offline

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#28
2004-09-16, 08:08 PM
I'm looking into adding a screen saver of sorts for this plugin, unless someone has done it or is doing it?

Colin.
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#29
2004-09-16, 09:35 PM
[b Wrote:Quote[/b] (colin @ Sep. 16 2004,21:08)]I'm looking into adding a screen saver of sorts for this plugin, unless someone has done it or is doing it?

Colin.
Colin,

I'd be very grateful for a screen saver for this plugin, and yes I agree this plugin is very good.

Tkgafs
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#30
2004-09-16, 11:42 PM
Ok I now have through a process of trial and error got the red and yellow buttons on the mvp remote acting as page up and page down respectivly

I'm sure there is a better way of doing it but this works

in the function OnKeydown in the class JukeBoxTask [ which all key + button presses go through ]

add the following code after the code for the green button but before the comment // Don't use Control or Alt keys..
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// red button used for page up
if ( e.Control &amp;&amp; e.KeyCode == Keys.R )
{
return FileList.OnKeyDown( e );
}
// yellow button used for page down
if ( e.Control &amp;&amp; e.KeyCode == Keys.Y )
{
return FileList.OnKeyDown( e );
}
[/QUOTE]
in the function OnKeyDown in the class FileSelectionTask

encase the large switch block with the following code
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// yellow button used for page down
if ( e.Control &amp;&amp; e.KeyCode == Keys.Y)
{
userTopIdx += MAX_ITEMS;
if (userTopIdx >= userTracks.Count - MAX_ITEMS)
{
userTopIdx = userTracks.Count - MAX_ITEMS;
userSelIdx = userTracks.Count - 1;
}
else
{
userSelIdx = userTopIdx;
}
}
// red button used for page up
else if ( e.Control &amp;&amp; e.KeyCode == Keys.R )
{
userTopIdx -= MAX_ITEMS;
if (userTopIdx < 0)
{
userTopIdx = 0;
}
userSelIdx = userTopIdx;
}
else
{
switch (e.KeyCode)
[/QUOTE]

and remember to add a closing } after the switch block

hope that helps Joe

tkgafs
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,864 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,376 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,482 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,914 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,781 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,121 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,959 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 5,005 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,255 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,439 2012-01-15, 08:33 PM
Last Post: imilne

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

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

Linear Mode
Threaded Mode