SnapStream Forums

Go Back   SnapStream Forums > SnapStream Developer Network > Development Discussion
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-21-2004, 01:17 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Help with Simple "List" plugin

I have been working on this simple plugin. It looks at a particular folder and then will list the files that exist in it.

I am having trouble even getting the menu option to even appear on the main menu....

I have attached my plugin and the its source code.

Here are my questions:

  • What am I doing wrong that the menu selection won't even appear?
  • I also see that the plugin is not loading from the logs. Can I use the logging features you implement in the snapstream.dll. How do I write to your log file in the logs directory?
Thanks,

Eric
Reply With Quote
  #2 (permalink)  
Old 11-21-2004, 04:03 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Your code within the skin file looks correct.
Your code within the cs file looks correct.

My guess is its a namespace issue. Since, I am not at my desktop I am unable to load the code. I did see a lot of "extra" files though, did you run through my existing documentation. That should get you to the blank tablet, and then you could copy and paste the skin & cs file.

Be careful not to confiuse newmedia, newmediamodule, newmediascreen, etc.

But yeah, it should be working. If that doesn't help I'll take a look at the code early in the week.

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #3 (permalink)  
Old 11-21-2004, 08:13 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

I read the tutorial. I went back and simplified the namespaces. I am still getting the same error. This is what I am getting:

11/21/2004 09:50:56 *****Beyond Media Started (Version: 1.0.0 Build: 544) *****
11/21/2004 09:50:56 BMMainForm.InitializeDeviceObjects initializing texture caches.
11/21/2004 09:50:57 Loading the Hotbar defaults
11/21/2004 09:50:57 BMMainForm.InitializeDeviceObjects initializing font manager.
11/21/2004 09:51:00 ************************************
Sunday, November 21, 2004 9:51:00 PM
LoadSinglePlugin failed to load: C:\Documents and Settings\All Users\Application Data\SnapStream\Beyond Media\Plugins\NewMedia\SnapStream.Plugins.NewMedia .dll.
System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at SnapStream.BeyondMedia.PluginsLoader.LoadSinglePlu gin(ParserContext context, PluginInfo plugin)
at SnapStream.BeyondMedia.PluginsLoader.LoadDynamicPl ugins(ParserContext context, PluginInfoList pluginList)


This is not telling me what line of code to look at. Any help would be appreciated!

Thanks,

Eric
Reply With Quote
  #4 (permalink)  
Old 11-21-2004, 09:35 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Quote:
Users\Application Data\SnapStream\Beyond Media\Plugins\NewMedia\SnapStream.Plugins.NewMedia .dll.
System.ArgumentNullException: Value cannot be null.
This problem almost is definitely related to the namespace. I believe, it means it is unable to load the plugin because it thinks it is not defined. Eitherway, I have had the problem in the past, and was always due to a name somewhere.

Your *.zipped compiled version has two dlls. This could be a sign of concern, it should only have 1 dll. Make sure it is looking at the new & a not the old named dll.

I will offer to take a look at it in a day or two, when I get some free time. But, that is definitely what is going on.

Once you do get the plugin loading, a helpful debug trick is (*I believe*):
SnapStream.Logging.WriteLog("here") Although, I will have to doublecheck the exact path, but that will be helpful once it does start to load.

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #5 (permalink)  
Old 11-22-2004, 06:27 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

Okay. I am not receiving errors now! But, I still cannot see the New Media item on the Main Menu.

  • Should I be seeing this on the Main Menu?
  • What am I missing?
I have attached the newest plugin files.

Thanks,

Eric
Attached Files
File Type: zip NewMedia.zip (6.2 KB, 56 views)
Reply With Quote
  #6 (permalink)  
Old 11-22-2004, 06:37 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Quote:
Originally Posted by ericfaris
Okay. I am not receiving errors now! But, I still cannot see the New Media item on the Main Menu.
Source code?

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #7 (permalink)  
Old 11-22-2004, 07:04 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

Here's the source again... Thanks again for any help!

- Eric
Attached Files
File Type: zip NewMediaSourceCode.zip (738.5 KB, 53 views)
Reply With Quote
  #8 (permalink)  
Old 11-22-2004, 07:44 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Heres the working version...

(well sort of... I am not sure the heck your trying to accomplish with NewScreenUpdater so I just moved it and commented it out) I put a few dummy "items" in your list just to fill it.

You had some issues with your namespace (as I suspected) I have dual monitors so I had my tutorial on the left and your code on the right and was able to fix it up real quickly.

Part of the issue was your plugin.xml had:

Class="SnapStream.Plugins.NewMedia.NewMediaListScr een"

IT SHOULD HAVE HAD...

Class="SnapStream.Plugins.NewMedia.NewMediaScreen"

That is why it compiled but was giving you "null" results, I suspect. Eitherway attached is a start.

You also should look at the tutorial and configure it for pre/post build events so you don't have to manually copy & paste the files each time.

-Brett
Attached Files
File Type: zip NewMedia.zip (740.1 KB, 49 views)
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #9 (permalink)  
Old 11-22-2004, 09:16 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

Brett,

Thanks. It is now working. I now have my bearings. I want to start playing the video that I select in the Beyond Video player. Can you show me some code that fires a file to the proper "player" from a list? I can't find an instance of that in the plugins out there. I have tried to look through the object browser, no luck!

-Eric
Reply With Quote
  #10 (permalink)  
Old 11-22-2004, 10:57 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Quote:
Originally Posted by ericfaris
Brett,

Thanks. It is now working. I now have my bearings. I want to start playing the video that I select in the Beyond Video player. Can you show me some code that fires a file to the proper "player" from a list? I can't find an instance of that in the plugins out there. I have tried to look through the object browser, no luck!

-Eric
There are three ways to do it. Each have their advantages:

Code:
ShowScreen ss = new ShowScreen("VideoPlayer");
ss.Execute();
SnapStream.Commands.StandardCommands.Player.PlayVideo.Fire(new SnapStream.Commands.CommandExecuteArgs(pathName));
This method will launch the VideoPlayer module and automatically play the file. The benefit here is that you get the hud. The cost here is that when you hit "exit" it will return to video folders file view.

Code:
//up in constructor
_previewWindow = new VideoPlayer();
add(_previewWindow);

//in playback function
_previewWindow.CloseFile();
_previewWindow.Visible = true;
_previewWindow.Focus();
_previewWindow.Visible = false;
_previewWindow.OpenFile(pathName);
_previewWinodw.Visible = true;
The 3 visibles was done on purpose. Its a "known" hack that made the final build that will auto-start playback of the file. There is no HUD going this way, yes this part sucks. I am *hopeful* this will change for v1.1.

The third way would be write a new class that extends VideoPlayer. You could then define the HUD, and other features (such as closed caption) without having it return to the video folder module. This would be the best implementation, but for the first person to attempt it would probably be the hardest.

I would go with the second method for the time being. I am *hopeful* this will change real quick with v1.1. It was mentioned way to late in the game.

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #11 (permalink)  
Old 11-23-2004, 06:16 AM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

Brett,

I went with your suggestion. One thing I noticed in the code below though is that you didn't specify that I need to "hide" the current screen, like:

this.Visible = false;

Code:
 //up in constructor
 _previewWindow = new VideoPlayer();
 add(_previewWindow);
 
 //in playback function
 _previewWindow.CloseFile();
 _previewWindow.Visible = true;
 _previewWindow.Focus();
 _previewWindow.Visible = false;
 _previewWindow.OpenFile(pathName);
 _previewWinodw.Visible = true;
So, I have this working now. I don't know if there is an example any where that I can use to apply the appropriate settings to the "_previewWindow". I think I need to set the "keys" for my Firefly remote to work. I would like to be able to return to the New Media screen, when I hit exit.

I hate to keep bugging you about the little details, but I can't find anything out there. Maybe I'm a pioneer in BeyondMedia plugin development....

-Eric
Reply With Quote
  #12 (permalink)  
Old 11-23-2004, 12:25 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Quote:
Originally Posted by ericfaris
I hate to keep bugging you about the little details, but I can't find anything out there.
Absolutely, no problem. These forums are searchable, so by you asking here, others can find responses later on.

So ask away.

Your code should look something like this to handle escaping from the playing video...

Code:
public override void OnKeyDown( object sender, System.Windows.Forms.KeyEventArgs e ) 
{
      base.OnKeyDown(sender, e);

     //ADD code to handle escaping back to main menu

     //this is code to return back to your module if video is playing
     if(_previewWindow.visible && e.KeyCode == System.Windows.Forms.Keys.Escape)
     {
           //play DefaultSoundList sound
           //hide preview window, unhide other widgets
           _previewWindow.closeFile();
      }
 }
That is not exact, nor tested, but it is something to that tune.

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #13 (permalink)  
Old 11-23-2004, 01:45 PM
Registered User
 
Join Date: Sep 2004
Location: Florence, KY
Posts: 27
Send a message via AIM to ericfaris
Re: Help with Simple "List" plugin

Would this also be how we handle FFWD and REW events? We should just check the "e.KeyCode == System.Windows.Forms.Keys.FastForward", or something like that?

- Eric
Reply With Quote
  #14 (permalink)  
Old 11-23-2004, 02:09 PM
Brett's Avatar
l33t Beta Tester
 
Join Date: Feb 2003
Posts: 3,919
Send a message via AIM to Brett
Re: Help with Simple "List" plugin

Quote:
Originally Posted by ericfaris
Would this also be how we handle FFWD and REW events? We should just check the "e.KeyCode == System.Windows.Forms.Keys.FastForward", or something like that?
See thats where I think you may have to override the events. I will ask that Lonnie looks at that, but he is busy guy, so he may not have time.

-Brett
__________________
A Sample of My Beyond Media Projects:
Game Library: Browse and play your ROMS, Arcade Games, and PC Games within BM!

MSN Messenger for BM: Add MSN Messenger to BM. Includes MSN notifications over any module, and a chat client!

PIN Plugin for BM: Add PIN protection to any module in BM, including the settings!

BTV Recorded Shows: Brings the BTV Recording Library into BM with full show details.
Reply With Quote
  #15 (permalink)  
Old 11-24-2004, 03:58 PM
Administrator
 
Join Date: Mar 2001
Posts: 56
Re: Help with Simple "List" plugin

Gentlemen,

I have a quick solution to the original problem. I have not delved into the specific problem of where to override certain behaviors.

After we released the RC, we noted that having the VideoBrowserScreen and the VideoPlayerScreen tied together was problematic. So we split those screens up. Here is the code we use to launch the VideoPlayerScreen and have it play a certain file.

Code:
		private void OpenPlayer( string filename ) {

			ShowScreen	screenLauncher;

			screenLauncher = new ShowScreen( "VideoPlayerScreen", filename );
			screenLauncher.Execute();
			return;
		}
This should allow you to open the existing VideoPlayerScreen (including the HUD) and use the current settings for the remote.

More later on overriding key presses...
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgraded/lost list in "recorded shows" lanceluck Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum 5 08-30-2006 11:47 PM
THE SIMPLE SOLUTION for "Failed to Build Live TV Graph" - BTV4 m4ng0 Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum 1 02-12-2006 12:08 PM
Interested in doing a NEW plugin? I have a "partial" start... Brett Development Discussion 4 02-15-2005 07:43 PM
Simple and highest picture quality "Live TV" setup onion SnapStream Discussion 7 01-21-2005 06:11 PM
Is there a "what's new" list for each build? turbodb Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum 5 11-27-2004 01:27 PM


All times are GMT -6. The time now is 05:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0 RC1
©2004-2009 Snapstream Media