|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
HOWTO: Integrate VB or C# .NET Components Using the SageTV Studio
I wrote up an article on how to Integrate VB or C# .NET Components into SageTV using the Studio.
Thanks to deria for providing the VB example source for this. I'm sure many of you will find this useful...and the example can be done using all FREELY available compilers. Enjoy! Comments are welcome. http://www.sagetv.com/IntegrateVBDot...udio_Curr.html This example also shows how you would integrate C or C++ code since that's the bridge used to tie in the VB/C# code. So now we've shown you how to do Java, C, C++, VB and C# integrations. Let's see what y'all can do.
__________________
Jeffrey Kardatzke Founder of SageTV |
#2
|
||||
|
||||
wow..no comments on this yet!??! I cannot wait till i get some free time to start screwing around with all kinds of hair brain ideas
thx for the recent dump of information! I.
__________________
If you're not cheating, your not trying... My sage rigs: Server - Windows 2003, Intel 865 PERLL w/ P4 3.2g 1gb ram, 3-PVR250, 3-PVRUSB's, 1 Skystar2, 1 twinhan 102g, 1 starbox DVB-S Cards. Evo network QAM encoder. 1.2TB storage 6.x server + MTSAGE for DVB Client 1/Master BR - MediaMVP running a 30" Olevia LCD TV. Client 2/Front Room - Shuttle ST61G4 XPC 1gig ram, 60gb HD, BTC9019 wireless keyboard/mouse & Harmony 880. 6.x client. GF6600GT driving a Sony WEGA 55" rear projection tv. |
#3
|
|||
|
|||
Quote:
I've pretty much finished porting my disk monitor to Sage TV (the example uses the code for the disk monitor). It is slow going, but that is because there is just so much information to absorb. The actual porting is not that difficult. The only real difficulty is learning how to work within the studio environment -- its a very complex and powerful environment, and it takes a little getting used to. I think that would be true of any complex environment though. I'm still not too sure how I'm going to actually release the plugin when its finished. I know what files I need to distribute, but creating an STVI doesn't sound particularly easy at all. I'm hoping that if I stick with the standard STV and don't make any references to it other than using the MainMenuTheme that I can then just export the tree where all my stuff is (the main display and the configuration popups) and then import it again in another STV. I'll have to play around with it. I've also been playing around with STV editing in general as a learning tool, which is kind of fun. It gives you a feeling of empowerment. I wanted SageMC 169 to display hours left and GB left on the recordings screen, so I added that. I wanted it to go directly to the show details of whatever I'm watching when I press stop instead of bringing up that "x is stopped" popup, so I changed that. The recording details screen doesn't show which tuner recorded the show or the file size of the recording, so I added that (but I added it in the wrong part of the menu, so it looks dumb right this second). It's really kind of a blast to be able to do this type of thing so easily. Anyway, off to finish that module. |
#4
|
||||
|
||||
JNI.NET
I ran across JNI.NET today and am posting the link in case anybody is interested.
http://caffeine.berlios.de/site/deve...net-guide.html
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun. Extender: STP-HD300, Harmony 550 Remote, Netgear MCA1001 Ethernet over Coax. SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client, Java 1.6. Plugins: Jetty, Nielm's Web Server, Mobile Web Interface. |
#5
|
||||
|
||||
It is API's like this that attract those who are interested in the journey more than the destination.
I haven't explored this yet, but I think that the fact that it exists is fantastic. I think more and more companies will be making API's available for their products and will notice that the effort is definitely worth while. Check out this API for the Roomba Vacuum Robot |
#6
|
||||
|
||||
Questions about the example...
Hi all,
I am going through this example trying to implement some native code I have written, and am a bit confused about a couple of points. I have not gotten to the STV example to look at what was done with it -- but am focusing now on modifiying my existing .net source ala the examples. Then I will move on to making the Java code, creating the c++ wrapper DLL -- if you will -- and then onto the sage environment. Correct steps?? The question I have is that the example provides a little base code for sending messages from java through to the .net code, but does not really ever demonstrate this correct? I see the definitions for the two functions, and trace them through to the .net VB sample -- where they return existing values. I have this working in my own code now. The sample for the sending messages into the queue -- or for triggering events are never used correct? Am I missing those examples by not pouring over the STV sample? Or does this example not really send messages or receive events. I will want to do both with my application... are there other examples by someone that does utilize the queue infrastructure and trigger events back to the sage level? Am I just lost? |
#7
|
||||
|
||||
There are no built-in queuing/event mechanisms other than the predefined hooks and listeners for predefined events.
However, you could create your own event/queuing system in the native code, and provide JNI functions such as: my_jni_queue_class_AddEventToQueue(q,msg) event=my_jni_queue_class_WaitForNextEvent(q,timeout) These functions can then be called from the STV -- eg Fork a thread, then loop calling event=my_jni_queue_class_WaitForNextEvent(q,timeout), handling the event accordingly. For a trivial example, the Sage IMDB code reads several IMDB web pages in the background, and triggers the STV to refresh the results page when more data is available... (search for 'net_sf_sageplugins_sageimdb_DbObject_waitUpdates')
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#8
|
||||
|
||||
Much thanks! I will take a look...
|
#9
|
|||
|
|||
Linking errors with listed example....
I went through the example of building a .NET java DLL, and have some linking errors that the example doesn't talk about. Specifically:
c:\Documents and Settings\Rob\My Documents\Visual Studio Projects\SystemMonitorJNI\SystemMonitorJNI.cpp(20): fatal error C1191: 'mscorlib.dll' can only be imported at global scope C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\stdio.h(191): error C2624: '(HANDLE,DWORD,LPVOID)DllMain::_iobuf' : local classes cannot be used to declare 'extern' variables Any help would be appreciated...I may just have a configuration error, although I followed the steps in the tutorial. Also, I'd like to make sure this isn't all a pointless effort, so here is my goal: I'm trying to write a driver for the CQC home automation software. This driver will allow a user to query the EPG, find out what is next to record or is already recording, what shows have been recorded, and will allow the user to choose a show to watch (on the Sage host computer, not as in "client"). So in other words, I'm going to want a lot of info, and have a little bit of control. Is the java plugin the route I would want to take to do this? I have lots of C++ experience, but no java....so it's a little slow goin. Just want to make sure I'm not heading the wrong way. Thanks for any help. |
#10
|
|||
|
|||
Has anyone looked into using JNBridge or J-Integra to generate the cross-platform calls? We use those tools at my work to let the Java and C# groups share code, and they do all the heavy-lifting for you. You set your classpath, push a button, and get a C# class w/ no effort.
|
#11
|
||||
|
||||
beelzerob - any progress on this? Wondering how it's going.
|
#12
|
|||
|
|||
Quote:
I'd like to get to a simple "Hello world" type of java plugin to work, to get my feet wet. But I can't even seem to compile the example they gave, so it's a tad frustrating. My next goal is going to be to try and use the free compilers they mention instead....since no one here seems to know what problem it is I'm experiencing. Maybe there's just too much obsfucation with Visual Studio .NET. |
#13
|
||||
|
||||
any help that anyone can provide beelzerob on how to integrate SageTV with CQC would be greatly appreciated. I personally know of 3-5 professional installers that would LOVE to include SageTV as part of their custom designed Home Automation/Home Theater automation solution, but that means much tighter integration than just kicking off SageTV from within CQC. They're waiting on this driver to get done before formally approaching anyone here about it.
Thanks, - Vivek |
#14
|
|||
|
|||
Well, for now I've forsaken anything Visual .NET related, and am embracing java wholeheartedly. I'm well versed in C++, so it seems pretty familiar. Enough anyway....hopefully the learning will go fast.
What I really need is some good examples of hooking up plugins into Sage, and communicating via ports, and all that. I understand that Neilm's webserver code is considered the standard for this, and I keep reading that it's freely available...but I have yet to be able to find out how to get ahold of a copy for myself. That would be the biggest help. |
#15
|
||||
|
||||
digging up an old thread - just wondering if Sage has some sort of .NET interop, so I can play around w/ the API from within VS C#?
Thanks, Ryan |
#16
|
|||
|
|||
Delphi?
Anyone use these methods with Delphi to do the same? I'm using version 6.
|
#17
|
|||
|
|||
Good to hear someone else is still on D6. I'll be curious to hear if anyone answers. I hadn't even thought of doing any Sage stuff in Delphi, but it's my most proficient language.
- Jeff |
#18
|
||||
|
||||
I also would like to know if it is possible to call certain functions from the SageTV API from within a C# program.
__________________
Oliver Kötter ------------ Check this thread for importing German TV Data into SageTV Using SageTV 7.1.9, Java 1.6.0_24 Win7 Home Premium on an Asus M4N78-AM Mainboard, AMD Athlon II X2 215, 4 GB RAM, 500 GB HDD, 2xTechnoTrend S-2400 as Network Encoder (LM DVB Smart Recorder), ATI Radeon HD 3450 with analog TV-Out on good old CRT TV (100Hz) My avatar shows the world's best composer!!! |
#19
|
|||
|
|||
Sort of, if you install the remote APIs plugin and call your API calls in C# via that then you could, but there is no way to directly call the Sage API outside of a Java program running in an active SageTV embedded JVM process.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#20
|
||||
|
||||
Well I guess that brings up the question, what do you really want to do? As you may have noticed, the Sage API is really designed for writing code to be called from inside Sage, not so much for external apps to call into Sage from the outside.
Not directly, but with a JNI wrapper, you should be able to call into Sage from any language code. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|