LinuxMCE Forums

General => Developers => Topic started by: tschak909 on June 29, 2009, 08:33:08 pm

Title: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on June 29, 2009, 08:33:08 pm
Here's something for those of you wishing to dig more into the system:

The result must be a new DCE Plugin, "Torrent PlugIn", written in C++, which uses LibTorrent-Rasterbar as its back-end.

It must implement the following DCE Commands:

Add Torrent to Queue
Remove Torrent from Queue
Report Queue Entry Status

* It must implement the following DCE Events (these will need to be created):

Download Starting
Download Finished


THERE WILL BE NO FURTHER DISCUSSION OF FEATURES FOR THIS DEVICE AT THIS TIME. THIS IS A PROGRAMMING EXERCISE INTENDED TO FACILITATE LEARNING OF THE SYSTEM, AND TO PROVIDE A BASE ON WHICH FURTHER DEVELOPMENT WILL BE BASED.


* It must place its status items on the Task List (the same task list that is used to display orbiter regeneration status, and disc ripping status)

* This is all the device itself needs to do. There is no UI. This will be handled by the web admin, and the Orbiter.

* This must use the LinuxMCE-0810 branch of code. The 0710 branch must not be used.

* Use the web admin to create the appropriate device template. Use the Climate Plugin as a template.

* Use DCEGen to create the appropriate C++ source code stubs to implement.

* Use sql2cpp to generate the necessary defines for the rest of the system.

* Test the device using the web admin, add the device to the router as a child, then reload router, and use the Send Command to Device link to send commands to the device to test it.

Developers will be on hand to answer questions. The more specific the questions, the more specific the answers. I would suggest reading the Programmers Guide pages category in the wiki.

Good luck, Gentlemen.

-------------------------------------------

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: Marie.O on June 29, 2009, 08:39:36 pm
Good luck, Gentlemen.

Chauvinist!

what about the ladies? Don't you think, they can take on a challenge like that as well?

.

.

.

 ;D
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: wierdbeard65 on June 29, 2009, 08:43:17 pm
what about the ladies? Don't you think, they can take on a challenge like that as well?

Beta testers! You need a tough audience for a thorough test  ;)
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on June 29, 2009, 08:46:46 pm
Not there yet fellas, this needs to be developed first. There is no user interface to test. Please read the initial requirements again.

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: hari on June 29, 2009, 09:22:49 pm
what about the ladies? Don't you think, they can take on a challenge like that as well?

Beta testers! You need a tough audience for a thorough test  ;)
hehe, no code yet and you already call for beta :-p

now as you post in the dev section, may I kindy ask you to modify your footer? Maybe you want to move your avatar and any other network/im/maill related info to the left. That footer banner wastes space and distracts (in my opinion). We try hard to keep this forum banner free. Possible thanks to donations from e.g. abaton.at
So I would really appreciate if you could rethink your "profile" :-)

br, Hari
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: wierdbeard65 on June 29, 2009, 09:37:07 pm
hehe, no code yet and you already call for beta :-p

That comment was meant as a tongue-in-cheek response to posde's comment about involving the ladies (which is why I quoted him ;) ) I wasn't calling for a Beta, I was suggesting that Thom wasn't being a chauvinist....

now as you post in the dev section, may I kindy ask you to modify your footer? Maybe you want to move your avatar and any other network/im/maill related info to the left. That footer banner wastes space and distracts (in my opinion). We try hard to keep this forum banner free. Possible thanks to donations from e.g. abaton.at
So I would really appreciate if you could rethink your "profile" :-)

Have done, sorry to cause problems! I got carried away playing with FaceBook ;D
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: hari on June 29, 2009, 09:47:52 pm
Have done, sorry to cause problems! I got carried away playing with FaceBook ;D
no need to be sorry, thanks for rethinking. But you might want to continue using the picture as avatar :-p

We have no clear policy regarding them but readability of the forums is much higher if ppl tend to use short footers..

uups, I'm off topic..

br, Hari
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: Techstyle on July 01, 2009, 04:21:33 am
Who (hopefully from the 'community' page of the wiki) is taking a crack at this project?

It is beyond me but it would be good to know who is trying this?
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: darrenmason on July 01, 2009, 04:38:29 am
I think I might. It is a good excuse for me to get off of a$% and 'make' some time for doing this.
Started the dev setup last night with a few problems but will post those to another thread....
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: WhateverFits on July 01, 2009, 05:21:15 pm
I'm in. I started setting up the 8.10 build environment a few days ago. I'm almost done with that. It looks like there are a few simple examples of both a DCE plugin and the torrent handling available.
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on July 01, 2009, 06:21:32 pm
As I said before, the best approach is to use libtorrent-rasterbar. As it is:

(1) a modern torrent implementation, with all current extesions
(2) written in C++
(3) nicely abstractable to a thread

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: WhateverFits on July 01, 2009, 06:42:59 pm
(4) Sample code on their website
:D

I already read their sample code and touched on their docs. The docs are big. The sample code is small. It looks really simple to include basic torrent functionality in a plugin. The more complex features look more complex, of course.

This is also a nice way of upping my C++ coding skills. I haven't done any C++ since last year and that was just for one project.
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on July 15, 2009, 09:24:18 am
Bump this to top, is anyone working on this?

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: darrenmason on July 16, 2009, 12:17:04 am
I am, but only get one night a week to spend time on it. (on average)

Have generated device, and put the shells of code together for the job classes. Got stuck on getting DCERouter rebuilt and installed as per the build instructions. I wrote some details in another thread.
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on August 18, 2009, 05:33:48 am
is anyone still working on this?

-thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: darrenmason on August 18, 2009, 05:52:29 am
I have it about half working but have not looked at it for the last three weeks (or anything linuxmce really). Was hoping to get a few hours this week to have a play with it.
Long hours at work and family commitments mean it is always going to be down on the priorities for me.
Will post an update when I get a bit further.

Couple of questions from when I last looked at it. I was trying to work out what the best behaviour should be with the download. Should it complete the download in its own storage and then rely on different commands to move the content into the appropriate part of the repository or shoudl it attempt to do this itself and let updatemedia pick it up.
With the latter it will require a certain amount of metadata being sent either with the request or after the download is finished.
I will have a further look at the model for ripping a disc as this should probably work the same way.

Thom, I don't know that anyone else is working on it but happy to work with them if we want to move it a bit quicker.

Darren
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on August 18, 2009, 05:59:24 am
look at the SCREEN_FileSave stuff, as well as the Copy Disc button in designer, note that these pass their parameters to the target command, so the download command should be able to extract a parameter for where to put the final file. The file should also be suffixed with something like .download, so that the system can determine if a file is being downloaded.

This can be used to show in orbiter's file list for example, if a file is being downloaded, and take them to the status screen.

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: darrenmason on August 18, 2009, 06:03:46 am
Will do , thanks
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on October 16, 2009, 05:31:14 pm
Darren? any progress?

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on November 04, 2009, 03:26:17 pm
I'm bumping this up to try and generate more interest.

-Thom
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: fastie81 on November 04, 2009, 09:19:25 pm
Hi Thom

Is this only going to be a torrent client?
This would be nice but a download client will also be cool..
So I can just put in a url and username and password if required and then let the system download it.
Just want to know.
Chris
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: darrenmason on November 04, 2009, 10:37:19 pm
Yeah sorry, happy for someone to look at it. To be quite honest - I havn't had a chance to even turn the dev computer on in the last few months...

Contact me if someone wants the stuff I had done to date.

Bub is starting to sleep more now so who knows I might have some time soon - but can't promise much.

Regards
Darren

Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: PlatypusPedersen on January 10, 2010, 08:36:52 am
Bumping this... maybe something for GSoC?
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: david_a_dawson on January 26, 2010, 11:44:05 pm
is anyone still working on this?

-thom

How do all.

I've been developing a java implementation of the DCE protocol.

It's mostly functional, and covers the most used features of DCE.

Using this library, I've developed a bittorrent DCE device.

I've put together a device template, as suggested, with the addition of a download failed event.

The bittorrent functionality is built using the snark (http://www.threerings.net/code/snark/) library.

Seems ok, but quite flaky, so I think I'll swap it out at some point.


The only thing not yet implemented is adding status items to the Task List.  I'll look at this next.

Also, the java DCE lib isn't making use of any command/ ... other ref data, they are all magic numbers at the moment, so I'm going to write a script to generate a java enum for each class of reference data.

I can upload this code to somewhere after a little bit more polishing, where would be best? 

Cheerio.

David.
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: Aviator on December 15, 2010, 04:13:52 pm
Did this ever get finished? I'm looking for a simple programming exercise to learn more about DCE.
Title: Re: Programming Challenge: DCE Device: Torrent Downloader PlugIn
Post by: tschak909 on December 15, 2010, 04:21:25 pm
No. Nobody took it.

But, dude, there are almost a hundred example DCE drivers all over our source tree that you can look at for examples in C++.

-Thom