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
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#11
2004-09-14, 08:05 PM
yes the skip buttons seem to be working I think in the code they are called Keys.Right and Keys.Left and certainly they work on the remote.

I moving on from this to another small amendment to the jukebox code

I want to skip indexing a folder or its subfolders if a file called noindex.txt exists in the folder.

I have added the following code

string NoIndexName = curDir + "\\noindex.txt";
if ( System.IO.File.Exists(NoIndexName))
{
return;
}

to the function PopulateDB at about line 586 of the code

this works fine but with one small problem although the folder has not been indexed, it is still listed in the display although if you enter it there are no tracks to select from.

Would you have any idea how to supress it from the display

As I have never written C# in my life before I am really struggling

throughout the code there are bits like dbDirs.Enqueue and dbDirs.Dequeue is this some form of pushing array elements on and off a stack ?

is there any C# language reference manuals that are available for download ?

thanks in advance

Tkgafs
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#12
2004-09-14, 08:57 PM
Where can I find out what each button on the mvp remote equates to in coding terms.

so that I can add the page up/down remote buttons to the jukebox plugin using something like the yellow + blue buttons

tkgafs
Tobias
Offline

Junior Member

Posts: 37
Threads: 5
Joined: Sep 2004
#13
2004-09-14, 10:47 PM
Did you add your code in the very top of the method? But still, I think that the PopulateDB method only adds MP3Confused to the JukeBox queue and is not responsible för the file listing (may be wrong here)...

Im having a hunch that the referenced FileList (FileListSelectionTask) has got something to do with this. Maybe this code in the method "render" ?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// Render the file listing..
FileList.Render( g );
NowPlaying.Render( g );[/QUOTE]
colin
Offline

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#14
2004-09-14, 11:20 PM
Hey tkgafs,

dbDirs.Enqueue and dbDirs.Dequeue are functions to interact with a Queue (FIFO - first in first out). What appears to be happening is the code scans the music directories defined in the config section. It adds these to its queue which is processes in chunks. Sub added a helper function Logger.Verbose(&quot;enter string&quotWink which you could use to put into functions to print out information.

Just like you would do in C, except you would use printf(); Logger.Verbose puts information into one of the logs files.

Use this to trace functions to track down where you need to put you test so as not to list that directory,

cheers,
Colin.
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#15
2004-09-14, 11:37 PM
I tried the logger.verbose but couldn't find anything in any of the logfiles which puzzled me.

Is there something like a #define which needs turned on get logging to write stuff to the logfiles ?


the code certainly seems a bit cryptic in how it works,

I tried adding my little bit of code to the addmusicdir function originally as I assumed that that would be were the directories were originally added as the enqueue facilty is called then,
but it didnt seem to work so then I tried populatedb function which certainly works but as I said I cant fathom out where the dirs are held in an array for displaying on the screen

All this effort just because my wife hates &quot;Henry Cow&quot; and doesn't want them popping up unannounced as it were

[Image: wink.gif]

thanks for all your help so far
colin
Offline

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#16
2004-09-14, 11:57 PM
Actually now that you mention it i'm not sure where the Logger.Verbose messages are going. I'll ask Sub about that.

So the path i see so far is

public JukeboxTask()
--> FileList.AddMusicDir( strs[i] ); - this adds the top level music dirs defined in config app.
----> dbDirs.Enqueue( name ); - this adds the top levels to the Queue for processing.

I think you are looking in the correct place you are just going to need to figure out what it is doing. To me this area looks interesting from PopulateDB

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
foreach (string dir in dirs)
{
allTracks.Add( new Track( dir, true ) );
dbDirs.Enqueue( dir );
}[/QUOTE]

To me it looks like, for example, the directory &quot;C:\Music&quot; is passed to PopulateDB. This then looks for all tracks in this directory plus all sub directories. The code i have highlighted I suspect adds directories like &quot;C:\Music\Unwanted Album&quot;

Colin.
tkgafs
Offline

Senior Member

Posts: 594
Threads: 61
Joined: Jun 2004
#17
2004-09-15, 08:18 PM
ok I have worked it out I think

to skip a folder in the jukebox create a file called noindex.txt in the folder you wish to omit from indexing. If this file is present then no files from this folder or any sub folders will be indexed, so they will not play in the jukbox


and change the following two functions in jukeboxtask.cs

change UpDateDirlist to the following

public void UpdateDirList()
{
Logger.Verbose(&quot;UpdateDirList:&quotWink;
userTracks.Clear();

string userPath = userDir;

foreach ( Track track in allTracks )
{
string NoIndexName = track.Path + &quot;\\&quot; + track.Name + &quot;\\noindex.txt&quot;;

if ( System.IO.File.Exists(NoIndexName))
{
Logger.Verbose(&quot;UpdateDirList: found &quot; + NoIndexName);
}
else
{
if ( track.Path == userPath &amp;&amp;
track.Name != &quot;&quot; )
{
userTracks.Add( track );
}
}
}
}


and add the following few lines into the function PopulateDB straight after the follwing two lines

string[] files = System.IO.Directory.GetFiles( curDir, &quot;*&quot; ); string[] dirs = System.IO.Directory.GetDirectories( curDir, &quot;*&quotWink;

/*
* new code follows
*/

string NoIndexName = curDir + &quot;\\noindex.txt&quot;;
if ( System.IO.File.Exists(NoIndexName))
{
return;
}


hope this helps some of you

tkgafs
joecru
Offline

Member

Posts: 135
Threads: 26
Joined: Aug 2004
#18
2004-09-15, 09:47 PM
Hi Colin,

I followed your instructions and I now have a set of files in a dir called Newjukebox. In the dir there are a number of files.
ie:- GBPVRPublic.dll, jukeboxconfigform.cs, but I don't have a jukebox.dll file.The GBPVRPublic seems smaller than the one thats in the \GBPVR\Plugins\. I am not sure what to do with the recompiled files.Do I need to rename extensions to .dll?

Regards
Joe
Regards

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

Senior Member

Posts: 683
Threads: 39
Joined: Nov 2003
#19
2004-09-15, 09:59 PM
Need to check with Sub which GBPVRPublic.dll to link to.

Anyway, you will not have a jukebox.dll listed in the project window..

If you go to the menu bar and &quot;Project | Project Options&quot;

you should get a Project options dialog window. Click on configurations and have a look a the &quot;Output&quot; section for both debug and release configurations. there is a section on the right where you can choose the location for your newly created library.

- You want the compile target to be library
- set the assembly name to the name of your .dll (do not add the .dll extension)
- set the output path to the location where you want to create the new .dll

Do that for both debug and release. and ok out of all that. Now you can eith er build this as debug or release - the choice is yours.

HTH,

Colin.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,705
Threads: 767
Joined: Nov 2003
#20
2004-09-16, 07:16 AM
[b Wrote:Quote[/b] ]I followed your instructions and I now have a set of files in a dir called Newjukebox. In the dir there are a number of files.
ie:- GBPVRPublic.dll, jukeboxconfigform.cs, but I don't have a jukebox.dll file.The GBPVRPublic seems smaller than the one thats in the \GBPVR\Plugins\.
The safest bet is to copy the GBPVRPublic.dll from c:\program files\devnz\gbpvr into the plugins directory. The older one is likely there because it was included in one of the plugin zip files you downloaded.
« 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,850 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,365 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,470 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,911 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,777 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,114 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,955 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 4,999 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,254 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,436 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