Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CentralMedia

Pages: 1 ... 5 6 [7] 8 9 ... 11
91
Users / Re: Best Approach to Controlling a Network Device
« on: November 30, 2013, 01:11:07 am »
Na XBMC not running on a MD, its totally other hardware.

I was thinking to use the mount in Device data, to send the configure share as at present I access LNMCE shares through SMB, NFS did not work, maybe this may changes, NFS may work, just wanted to have the option if required. This has to be manually entered, as there is currently no command in my understanding to get the mount points from XBMC or even set any.

Thanks for the pointers.

92
Users / Re: Best Approach to Controlling a Network Device
« on: November 29, 2013, 10:31:00 am »
Thanks, forgot to attach a print out of the template also.

How off or close am I?

93
Users / Re: Best Approach to Controlling a Network Device
« on: November 29, 2013, 12:09:13 am »
Thanks

See attached, screen shot of template for device.

I get the menu navigation and media ctrl.

Is there a command group which can be chosen for playing a video file or audio file from LNMCE as below, thus I pass the file as below, well not the SMB stuff, but /home/public/videos/....mkv, and which can be sent.

"{\"jsonrpc\": \"2.0\", \"method\": \"Player.Open\", \"params\": { \"item\": { \"file\": \"smb://DCEROUTER/public/videos/2.73 TB (sdb1) WDC_WD30EFRX-68 [71]/Transformers Dark of the Moon (2011).mkv\"} , \"options\":{ \"resume\":true } }, \"id\": 1}"


94
Users / Re: Best Approach to Controlling a Network Device
« on: November 27, 2013, 11:50:58 pm »
I was looking to start creating the device, so read the Developing a DCE Device and looking to proceed.

Hi tschak909

What is the device template number for the ROKU STREAMER, wanted to check it out for a guide or any similar device.

Trying to sort out some stuff, like control by, etc, want to look at a similar example.

95
Users / Re: Best Approach to Controlling a Network Device
« on: November 26, 2013, 02:05:06 am »
Ok, did some changes, got it creating in a heap and tried in main to log information.

Only basic functionality tested, navigation left, right, up, down, back, select, home. Additional pausing, playing a file from LNMCE, changing speed and tested also seeking, calling addons, and sending text to a search, command line but its do able otherwise.

Have not tested playlist etc, but I believe its time to create the device and all that entails.

After this, would move to the WD live

See code attached

96
Users / Re: Best Approach to Controlling a Network Device
« on: November 18, 2013, 01:47:24 am »
Ok got some time today, made an attempt to get the data I believe is required, especially for controlling playback.

Tested with checking the response, then actually getting a player ID, was able to pause a movie and stop that movie. Decided to use and search a string, as I was only interested in getting the output for some value, eg, in testing the response, which was OK, in getting a player ID, the ID, which I had to cast from string to int, works thus far.

Need to put in speed and send input for searches, lets say in add on youtube, also how to play a file or URL.

see attached my progress.


97
Users / Re: Best Approach to Controlling a Network Device
« on: November 07, 2013, 01:44:48 pm »
Ok thanks

Well did some testing with calling the function, just navigation, see code attached.

Now, its what is maybe the hardest part, not clear in my head yet that why, getting the json output, checking it and doing something with it, fun times, looking at what you suggested, but they indicated a demo.c but it was not there when I did the hg clone, found another example, but have to wrap my head around it.

Suggestions from anyone is also welcomed.




98
Users / Re: Best Approach to Controlling a Network Device
« on: November 07, 2013, 01:52:29 am »
Hi tschak909

This worked, I have a question though, is it acceptable to include in main.cpp the xbmc.cpp?

99
Users / Re: Best Approach to Controlling a Network Device
« on: November 06, 2013, 11:37:41 pm »
Hi tschak909

I tried it and getting the following error

Quote
g++ main.cpp -o test
/tmp/cchrNCNr.o: In function `main':
main.cpp:(.text+0x81): undefined reference to `xbmc::xbmc(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
main.cpp:(.text+0xb1): undefined reference to `xbmc::~xbmc()'
main.cpp:(.text+0xc3): undefined reference to `xbmc::~xbmc()'
collect2: ld returned 1 exit status

I even tried but no luck, same error
Quote
xbmc m_xbmc(xbmc_url);

Would this be the linker not getting the code for the xbmc.h from xbmc.cpp?

100
Users / Re: Best Approach to Controlling a Network Device
« on: November 06, 2013, 05:14:19 pm »
I am failing at the following, bit stumped, see attached

Quote
g++ main.cpp -o test
main.cpp: In function ‘int main()’:
main.cpp:9: error: no matching function for call to ‘xbmc::xbmc()’
xbmc.h:10: note: candidates are: xbmc::xbmc(std::string)
xbmc.h:5: note:                 xbmc::xbmc(const xbmc&)
main.cpp:11: error: conflicting declaration ‘xbmc xbmc_url’
main.cpp:8: error: ‘xbmc_url’ has a previous declaration as ‘std::string xbmc_url’


101
Users / Re: Best Approach to Controlling a Network Device
« on: November 06, 2013, 03:58:19 pm »
Ok found this, which I think clears up some stuff for me

Quote
http://www.learncpp.com/cpp-tutorial/19-header-files/

102
Users / Re: Best Approach to Controlling a Network Device
« on: November 06, 2013, 02:40:31 am »
Silly question

Ok, I created an xbmc.h and xbmc.cpp.

For the time I made it extremely basic, but my question comes, examples I am seeing online, create the class and the initialize it in main in the same .cpp file, I was wondering, if I have .h (hearder) and .cpp (code) files below, would need a separate .cpp file, lets say for testing, runXBMC.cpp, where I include the xbmc.h and then instantiate the object and call the function or I have this totally off?

xbmc.h
Quote
#include <string>
class xbmc
{
   private:
      string m_url;
   protected:
   public:
      xbmc(string url);
      SendToXBMC();
   
};

xbmc.cpp
Quote
#define _FILE_OFFSET_BITS 64
#include <curl/curl.h>
#include <xbmc.h>
/*Lets try this again, hopefully nicer*/
xbmc::SendToXBMC()
{
   CURL *curl;
   CURLcode res;
   struct curl_slist *headers=NULL;
   if (0 != curl_global_init(CURL_GLOBAL_ALL))
    {
      fprintf(stderr, "Global Call Failed: %s\n", "Some error");
      return false;
    }
   else
   {
      curl=curl_easy_init();
      if (curl)
      {
         /*Ok curl initialized, let first set the URL for XBMC */
         curl_easy_setopt(curl, CURLOPT_URL, m_url);
         /*Set header here as CURLOPT_HTTPHEADER requires this variable type*/
         headers = curl_slist_append(headers, "Content-Type: application/json");
         curl_easy_setopt(curl, CURLOPT_HTTPHEADER, m_headers);
         curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"jsonrpc\": \"2.0\", \"method\": \"Input.Left\", \"id\": 1}"); /*need to create a json object to pass here*/
         curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)-1);
         curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
         res = curl_easy_perform(curl);
         if(res != CURLE_OK)
         {
            fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
         }
         curl_easy_cleanup(curl);
         
      }
   }
   
   curl_global_cleanup();
}
/*Constructor URL for the XBMC PI to pass here*/
xbmc::xbmc(string url)
{
   m_url=url;
}

Have not compiled this as yet

Should add, this is from the perspective that when creating the device in LNMCE, it would give the ability to instantiate.

103
Users / Re: Best Approach to Controlling a Network Device
« on: November 05, 2013, 04:40:37 pm »
Thanks

Well I believe I have made some steps, got basic function under c++, as I was able to get a one off command to work, move right, have not handled getting the response as suggested, working on.

Have not done an LNMCE specific stuff yet, just trying to understand the process, that is coding in c++ and how all works, attempt shown  below
Quote
/**********************************
Testing the use of libcurl to send JSON
to XBMC

Put together from findings on google

************************************/
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
#include <curl/curl.h>

int main()
{
   CURL *curl;
   CURLcode res;
   struct curl_slist *headers=NULL;
   char jsonObj[80];
   int a=1;
   float b=2.0;
   if (0 != curl_global_init(CURL_GLOBAL_ALL))
    {
      fprintf(stderr, "Global Call Failed: %s\n", "Some error");
      return false;
    }
   else
   {
      curl = curl_easy_init();
      if (curl)
      {
         sprintf(jsonObj, "\"jsonrpc\": \"%.1f\", \"method\": \"%s\", \"id\": \"%d\"", b, "Input.Right", a);
         /*Ok curl initialized, let first set the URL for XBMC */
         curl_easy_setopt(curl, CURLOPT_URL, "http://192.168.80.150:80/jsonrpc");
         /*Set header here as CURLOPT_HTTPHEADER requires this variable type*/
         headers = curl_slist_append(headers, "Content-Type: application/json");
         curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
         /* Now specify the POST data */
         /*fprintf(stderr, jsonObj); to check what the object was doing, realized it converts everything to string, which fails for the    ID
         curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonObj);*/
         curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"jsonrpc\": \"2.0\", \"method\": \"Input.Left\", \"id\": 1}");
         curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)-1);
         curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
         res = curl_easy_perform(curl); /*So I segment faulting here */
         
         if(res != CURLE_OK)
         {
            fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
         }
         /* always cleanup */
         
         curl_easy_cleanup(curl);
      }
      fprintf(stderr, "Clean global: %s\n", " ");
      curl_global_cleanup();
      return 0;
   }
}

What was helpful also, was curl at the command prompt, has an option to build the code, though it did not work when compiled, was nice
Quote
curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"Input.Right\", \"id\": 1}" http://192.168.80.150:80/jsonrpc --libcurl mytest.txt

Yes not nice, but seeing the light, currently testing options, as pass right, left, etc, then realized c++ does not support case statement with strings, so did with an if and else if, using compare.

 Now its time to start properly working on what can be the base, a xbmc_control.h and xbmc_control.cpp.

Any advice is welcomed, as c++ is totally new to me, google is truly a friend, wish I had more time, LOL.



104
Users / Re: Best Approach to Controlling a Network Device
« on: November 03, 2013, 07:28:00 pm »
Ok, so the send function under sys/socket.h, is what is transmitting similar to what the curl will do or its what curl is based on?

Honestly I did not know that struct addrinfo *m_pServerInfo, was a definition of a pointer.

Additional, I googled all the includes, to understand what they provide and an understanding of the processes with the code, got links similar to below.
Quote
http://pubs.opengroup.org/onlinepubs/009604499/basedefs/sys/socket.h.html

Is there any other site, which defines the options you can include?


105
Users / Re: Best Approach to Controlling a Network Device
« on: November 01, 2013, 09:28:43 pm »
Ok

Went through the code, forgive me but I am strickly green, lets see if I have the logic correct
The RokuDevice.h sets up the ground work, defining what should happen to initiate a connection, while the RokuDevice.cpp, implements the the constructure and the two functions
defined in RokuDevice.h. The Roku_LTHDXDXS_Streaming_Pla.cpp, implements what is defined in its corresponding Roku_LTHDXDXS_Streaming_Pla.h.

I actually see where the commands are coded

Quote
void Roku_LTHDXDXS_Streaming_Pla::CMD_EnterGo(int iStreamID,string &sCMD_Result,Message *pMessage)
   //<-dceag-c190-e->
   {
      cout << "Need to implement command #190 - Enter/Go" << endl;
      cout << "Parm #41 - StreamID=" << iStreamID << endl;
      PLUTO_SAFETY_LOCK(rm, m_RokuMutex);
      m_pRokuDevice->SendToRoku("POST /keypress/Select HTTP/1.1\r\n\r\n");

   }

The question comes, is it at this point, see below, that libcurl is being used or I have completely missed the boat?

Quote
m_pRokuDevice->SendToRoku("POST /keypress/Select HTTP/1.1\r\n\r\n");


Pages: 1 ... 5 6 [7] 8 9 ... 11