A few questions from new guy :)
#1
Hey all,

Just have a few questions about development, and where things might be.

First a bit about me - I started using Plex on an old (2009) Mac mini I had lying around, but once my wife had issues getting a DVD to play I decided to look for something a bit better. Then I found XBMC and it seemed to tick all the boxes.

Then while testing on my Macbook - I had stumbled across a (non reproducible yet) issue where I couldn't eject a DVD at all - but for the life of me couldn't figure out why this may be. Not having the internet at home I started grabbing the source at work while writing up a thread explaining the problem, but then edited it after I couldn't replicate it.

But I did have some other 'issues' with XBMC that just seemed a bit off to me - the big one after coming from Plex was being able to select my applications and launch them from inside the application. This lead me to two plugins - Launcher and Advanced Launcher - but both still fail to allow me to select any applications (not counting navigating into the package etc, thinking a more native approach). So back into the source I went.

Which leads me to my questions - first being rather simple.

1) Is it be up to the plugin to determine what is a file, or is that handled internally by XBMC. If it is internal - would I be looking at the CFileItem and CFileItemList classes? After some investigating (as I'm relatively new to OS X as well) I found that the applications were simply folders with the .app extenstion, and it looks to be safe to assume that OS X sees all folders with extensions as files.

2) What is the programs screen for? I've tried adding sources on both Mac and Windows - but nothing ever seems to show up. Is it a feature in progress?

I'm keen to get back into some C++ coding to keep me on my toes, forgot how much I really missed it (but that's another story). I'd love to be able to help out where I can, just need to know where to start Big Grin
Reply
#2
Welcome and enjoy the community..

2: for addons, which will include binary addons once that is a completed feature.

For starting coding, check out the tickets on trac.xbmc.org, there might be something you can submit a patch for.
Reply
#3
Regarding a plugin for picking up osx apps, essentially all you have to do is:

1. Get a list of the apps installed by whatever means is available to you from python.

2. Create a listing and feed that to XBMC via the xbmcplugin module.

That gets you the listing side of it. XBMC just displays the objects your plugin provides.

For the actual "what to do when I click on this" issue, you set it up so that XBMC calls back into your addon, by providing a plugin:// URL. You then decide what it is you want to do from there.

Alternatively you could look to do it from the C++ side, though I'm not sure how well received that would be in terms of a patch - the goal of XBMC is to be a good media center, primarily used via a remote control. Launching of other applications which typically can't be used with a remote is therefore usually thought of as "addon" functionality rather than core. There is, however, a SystemExec builtin function I believe for running apps.

The latter would certainly be a way to get into the code - let us know any other questions you have - there's usually someone around in #xbmc on IRC if you want a hand.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
Thanks for the reply guys - has cleared up a bit, but I'm thinking I wasn't clear on the initial question.

For an example, I'll use the Launcher plug in. for me to select an app package at the moment, I have to go into the app and find the executable file - but for some in my case there are none in there.

The problem I think is that the apps are actually folders (as seen in linux and windows) but should be treated as executable files by OS X. For anyone following this and wants a working example - download Boxer and try add a game made with it (basically a nice wrapper for DOSBox). From what I've been able to find it looks that OS X treats any folder with a period in it's name as a package, which can then be opened like any other file.

So what I'm wondering is who does the actual directory call - is it the python script/plug in, or does that query XBMC for the listing? This would be the first thing I would be looking at fixing/doing as it just doesn't seem right or easy to add Mac applications in XBMC plugins since they aren't seen as files.

As for the question about the Programs screen - was just curious what was planned for it, as for my personal setup I would like to have all my general application (such as Web Browsers and other things that aren't games or handled by XBMC) in one place and then use Launcher or Advanced Launcher for my games library - since it's already there and does an excellent job with scraping game info etc.

I hope that all made sense - will be checking out Trac and the IRC channel in my lunch break too Big Grin Thanks again for the help
Reply
#5
The plugin reads the filesystem, so the plugin would have to identify that Foo.app (for instance) is an application. There's various Cocoa calls available for identification I believe - whether or not there's a suitable python module available for this I'm not sure.

You could always browse the Plex sources and rip out whatever they're using and clean it up as needed, thus doing it via C++ as a starting point. This could be done in 2 ways:

1. A layer on top of the filesystem retrieval in GUIWindowPrograms.cpp that parses the CFileItemList and replaces any Foo.app with an item that allows the direct launching, sets the icon and any other metadata you can grab. You may also need to do some work in OnClick to do the actual click behaviour.

2. A virtual filesystem layer that does the filtering, then alter OnClick as required.

The latter is more closely aligned with the plugin, just in C++ instead of python. The difference is the python can set a plugin:// URL so that it gets the callback in OnClick to do it's thing.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
Thanks jmarshall - that helped quite a bit Smile

After some help from the IRC channel and some more digging around, I think I found where it determines a FileItem to be a directory or not. Looking at CFileItemHandler::FillFileItemList in FileItemHandler.cpp (line 178 in my export)

It looks to determine something is a folder first by seeing if there's a trailing slash. And thanks to garbear I've found some ObjC that can determine if a path is a package that can be executed by the system.

With these two, I should be able to work backwards and add something that will determine if a path is a folder that should be a file (kinda the reverse that zips and other files have).

Will keep you guys posted with what I can find
Reply
#7
Hey guys - just to give an update.

I'd be interested to do some work towards #6324 if that's still on the table. Looks that the work I've been messing around with so far lines up quite nicely already.

I've currently got package support up and running, and have added support for the System.Exec/Wait functions to be called on OS X.

I've limited the package support to 10.6 and above, as the open command needed to run them with arguments was included in that build. Otherwise it will function as normal.

The command line stuff seems to work great, but I don't have any machines under 10.6 to test on.

As for submitting a patch - how does that work? I found that I grabbed the wrong repository and am running the read only version - can I do a switch in git? Used to SVN :S

I can upload a patch of my current branch if required
Reply
#8
best way is a) attach a patch onto the trac or b) pull request via github
Reply
#9
Sweet as - I'll do a bit more testing, and I've come across something strange when the launcher plug in calls xbmc.executehttpapi("Action(199)") twice around a system.exec.

Not sure if it's something I might have introduced but I get a BAD_ACCESS when exiting after running that combination of command.
Reply
#10
httpapi is deprecated and is slated to be removed. JSONRPC replaces it. I think there's a XBMC python library you can import that exposes this API (if not, a generic json api would work). Alternatively, if you modify the c++ python interface you can add native functions that do what you're trying to do.

Disclaimer, I'm just trying to look like I know what I"m talking about. Correct me if I'm wrong!
Reply
#11
ok - won't spend too much time on it then Smile I'm not wanting it for anything I'm doing, as it's already in the launcher plug in script already. Just noticed removing them makes the badness go away.
Reply

Logout Mark Read Team Forum Stats Members Help
A few questions from new guy :)0