PDA

View Full Version : Example of MultiLevel GAC's (Album Cover Art!)



danward79
January 29th, 2005, 06:04 AM
Hi,

Here is a demo of multilevel GAC's which remembers were you were for each level. So each level you go in to the Cover art, it will always return to the place that you were. That way you do not have to start from the begining of the list again.

In theory you should be able to go as deep as you like, with this stack.

You can apply this to what ever you like. Playlists, etc.

Thanks to Rob for helping me with it.

Also for history see this thread and details on the Syntax of GAC's also see this thread.

http://www.promixis.com/phpBB2/viewtopic.php?t=9413

You can download an example ccf from here:-

http://www.promixis.com/download.php?ID=710

danward79
January 30th, 2005, 04:08 AM
To use this you need to add the following lua to you NR lua file.


Stack = {}
stackMT = { __index = Stack}

function Stack:New()
return setmetatable( {theStack = {}, top = 0}, stackMT)
end

function Stack:Top()
if self.top > 0 then
return self.theStack[self.top]
else
return nil
end
end

function Stack:Push(item)
self.top = self.top + 1
self.theStack[self.top] = item
end

function Stack:Pop()
if self.top == 0 then
return nil
else
local value = self:Top()
self.top = self.top - 1
return value
end
end

also


function OnCCFLoad()
GACStack = Stack:New();
end;

In your ccf, you need to use the following lines for the GAC buttons, for the album cover art add the following line.

IR Action Name
GACStack:Push(NetRemote.GetVariable('MP.GACStart') )IR Code

5001 0000 0000 0002 fc19 0007 0000 0000

IR Action Name
MP.GACScheme,&#123;MP.GACAlbumPath_<LoopIndex>&#125;;Set GAC ParentIR Code

5001 0000 0000 0002 fc19 0005 0001 0000

IR Action Name
GAC &#123;MP.GACScheme&#125; &#123;MP.GACStart&#125; &#123;MP.GACCount&#125; &#123;MP.GACSize&#125;IR Code

5001 0000 0000 0002 fff6 0002 00ff 0000

in your back button use the following ir actions

IR Action Name
NetRemote.SetVariable&#40;'MP.GACStart',GACStack&#58;Pop&#40;&#41; &#41;IR Code

5001 0000 0000 0002 fc19 0007 0000 0000

IR Action Name
MP.GACScheme,&#123;MP.GACParentScheme&#125;;Set GAC ParentIR Code

5001 0000 0000 0002 fc19 0005 0001 0000

IR Action Name
NetRemote.ExecuteAction&#40;-10,2,255,'GAC "&#123;MP.GACScheme&#125;" &#123;MP.GACStart&#125; &#123;MP.GACCount&#125; &#123;MP.GACSize&#125;',1&#41;;IR Code

5001 0000 0000 0002 fc19 0007 0000 0000

peegee
January 30th, 2005, 04:30 AM
Thank you for this post.

Very helpful!

danward79
January 30th, 2005, 04:41 AM
no worries, let me know if you have any probs

wavemaster
February 3rd, 2005, 01:03 PM
I have some problems, initially this works fine, however. If left for a few minutes (ie when a song is playing) the controls become inactive and don't work, also the back button dissapears.

You have to then go into another level to get the back button back, and pressing the back button more than the number of levels deep you are will get you to a blank screen and no way of getting out of it.

danward79
February 4th, 2005, 09:21 AM
Sounds interesting let me try recreate it, is this with the example ccf or with your own?

Anyone else having probs?

danward79
February 6th, 2005, 06:19 AM
Ok need some help here I am unable to recreate your problem, is this with your own or the sample ccf?

wavemaster
February 7th, 2005, 03:26 AM
Sorry, this was with the sample CCF.