Monday, December 28, 2009

Import and Lua Classes

New in 0.9.0.0, which will be released any day now, will include the new Import() function. Import() loads a script into the global space. I know what you're thinking: we already have LoadScript() and the "exec" prefix why on Earth do we need yet another way to load and execute scripts? Well I'll tell you why Jimmy: when you use LoadScript() or "exec" you change the internal script name into the script that was just loaded or executed. That's a good thing if you want to shift focus away from your script to another one but it's a bad thing if you do not. This is where Import() comes in, it does not change the internal script name so Get and SetScriptOption() behave as though your script made the call and not as the loaded script, which is a game changer. Adding Import() will also future proof us in the event that other such functions are added.

After adding this new function I went looking for some info on Lua Classes. Unfortunately I'm not the smartest bulb in tackle box and it all went straight over my head. But I did manage to come up with a simple Lua Class which can be seen by downloading libSearch. Hopefully others can find it useful as I'll be using it exclusively from now on when I add search.

Friday, December 25, 2009

Website forums

As I wait for my daughter to wake up on this Christmas morn I decided to add the ability for us to edit our posts on the forums. Merry Christmas!!! ;)

Monday, December 21, 2009

Debug notifications and complete Alias list

I've written a small console application that, if present in the plugins directory, will pop up and notify us that there was an error, and what the error contained. Probably useful for developers only and probably not that useful except that it'll save us time looking at the log. I added a function available from Lua to access the debug notifier DebuggerLog(string s);

Expect to find the application in the Dev Center once 0.9.0.0 comes out. Also speaking of the Dev Center I've updated the Lua Specific Functions file so it should be easier to browse, out with 0.9.0.0 as well.

Full List of Aliases

_guc() = GetURLCached()
_gu() = GetURL()
_gur() = GetURLxR()
_gux() = GetURLX()
_guxr() = GetURLXxR()
_sr() = str_replace()
_sp() = str_split()
_sf() = str_find()
_sfl() = str_findlast()
_se() = str_escape()
_su() = str_unescape()
_she() = str_html_encode()
_shd() = str_html_decode()
_sst() = str_strip_tags()
_sgb() = str_get_between()
_sgba() = str_get_between_a()
_st() = str_trim()
_vr() = VideoResource()
_vrx() = VideoResourceX()
_ar() = AudioResource()
_ir() = ImageResource()
_ct() = ConvertTime()
_vf() = VirtualFolder()
_dvf() = DynamicVirtualFolder()
_rx() = ResolveXML()
_srx() = SpecialResolveXML()
_v() = Version()
_l() = Log()
_dl() = DebuggerLog()
_sm() = ShowMsg()

Sunday, December 20, 2009

What are PlayOn Scripts?

PlayOn Scripts are plugins for the DLNA software PlayOn that add a large amount video content.

Friday, December 18, 2009

VideoResourceX

Table structure:
local vrTable = {
title = "Tile of Video",
path = "URL, Local Path, or code",
description = "Video Description",
thumbnail = "URL to image",
date = "11/22/2009 12:33:00 PM",
duration = ConvertTime("1:00:00"),
bitrate = 0,
resolution = "1920x1080",
genre = "Funny",
rating = "G",
index = 1;
}
VideoResourceX(vrTable);
All parameter's are optional and have a default value that will be supplied if any are missing. Mistyping the date will result in a error being logged but, if everything else is fine, it shouldn't cause the video to break.

Also I've added some short aliases for function names:
_l() = Log()

_vf() = VirtualFolder()
_dvf() = DynamicVirtualFolder()

_vr() = VideoResource()
_vrx() = VideoResourceX()
_ar() = AudioResource()
_ir() = ImageResource()

_ct() = ConvertTime()

_guc() = GetURLCached()
_gu() = GetURL()
_gux() = GetURLX()

Thursday, December 17, 2009

Thoughts

First up, the next update probably won't come out until after the holidays. I've gotten a request to expand VideoResource() and instead of stupidly trying to cram more xml into the description I'm just going to add a function called VideoResourceX() (which, by the way, I spent several agonizing hours thinking of the name). It'll look like this:

VideoResourceX(string title, string path, string description, string thumbnail, string datetime, long duration, int bitrate, string resolution, string genre, string rating, int sortIndex)

The new function will accept a table containing the data it needs.

VideoResourceX(table data)

I'm also probably going to add a FormatRTMP() function seeing as we do format the rtmp string a lot in our scripts. Keep an eye on the Dev Center for explanations for the new code.

There has been some confusion with the Script Options window, so I'm going to rework that to make it less confusing.

Finally, we're coming up to a 1.0.0.0 release which will be a milestone release. Hopefully it will also represent a feature freeze, where no more features will be added. After the 1.0 release future version will come out a lot more slowly as I'll be mainly focusing on bug fixes and code tweaks. I don't want the plugin getting any bigger and to be honest I feel as if it is very mature in its current state. I'm seeing some amazing stuff coming out and I'm seriously impressed in both the creativity shown by script writers and that I was able to make something so versatile.

Sunday, December 13, 2009

0.8.1.0

A new release went out, hereto called the hottamale release. It was basically a code push to allow hottamale to release some of his hard work for everyone to enjoy. I am glad to do and everyone should check out what he's been doing, it's pretty amazing stuff.

Friday, December 4, 2009

Version 0.8.0.0

Today's release is mainly a bug fix with code and performance improvements.

Notes:
Fixed a bug in deflate decompression
Fixed a bug where Lua errors weren't being reported
VideoRestartServer(); now uses the official video
Thanks to hottamale for his dilengence in getting GetURLX() to be as good as it is now, it's very powerful
GetURLX(); and GetURLXxR(); now accept a special header in the headerParse parameter: ExpectContinue<value>true|false

Get it now!