delphi queries

nelson c

Well-known member
Hi, Dmitry need help with the following:
I am developing an application for the station announcer, I want to read the xml file generated RB api in Delphi XE2, and then pour it into a panel.
Unfortunately I can not find anything on the internet.

Any information is welcome.

Thanks, Nelson.
 

Attachments

  • Sin t?tulo.png
    Sin t?tulo.png
    66.1 KB · Views: 590
Nelson, there are several XML libraries you can use in Delphi to parse an XML file. For example OmniXML: http://code.google.com/p/omnixml/

You can look for other libraries by searching "delphi XML library".

What Delphi version you're using? If it's D2009 and up, you can use the built-in TXMLDocument Class: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/XMLDoc_TXMLDocument.html
 
Thank you very much for your reply.

I watched the library OmniXML and is a bit complex.
On the other hand I found an example of an RSS reader that works very well (http://delphi.about.com/od/internetintranet/ss/xml_rss_read.htm) . but when I change the xml file by RB, the program gives a memory read error and aborted.

I own Embarcadero RAD Studio XE2 Version 16 2011

Source code released: http://musiccarhue.com.ar/Borrar/BlogXMLTest.rar

Sorry if it is not the place located couple talking these things :(
 
nelson c said:
Sorry if it is not the place located couple talking these things :(
I think the place is right as we're talking about RadioBOSS API here :)

An example on how to use the TXMLDocument to parse RB's playback info XML, based on your source code:

//after you've downloaded an XML and set XMLDoc.Active := True

    ANode := XMLDoc.DocumentElement; //get root node - "Info" in case of RB's XML
    ANode := ANode.ChildNodes.FindNode('CurrentTrack'); //get the current track info, change it to 'NextTrack' to get the next track info
    ANode := ANode.ChildNodes.FindNode('TRACK'); //the track info node
    STitle := ANode.GetAttributeNS('TITLE', ''); //get the title attribute, same for ARTIST, GENRE, etc.

It's a good idea to check if Assigned(ANode) on each step, just in case and also check ANode.HasAttribute when retrieving attribute values.
 
Great, It worked perfect.
Thank you :)

I would like in a future annex of the following commands to the api:
-Enable and disable microphone.
- In the command playback info: also return time crossfader (which RadioBOSS shown as a red line), and the time of intro and outro. (current track)

-Delete the track number "X" in the list.
-Change two tracks on the list: the example track 2 instead of 4 and vice versa, Ej:
  cmd=move2-4
-Get the data displayed in the command playback info, but any track, eg
  cmd=trackinfo-5
returns data from track 5 from the list:
  <TRACK ARTIST = "David Guetta Ft Akon" TITLE = "Sexy Bitch"...

With these things could rebuild the list in a TListView and to have a very interesting remote control.  :D
 

Attachments

  • remote.png
    remote.png
    68.5 KB · Views: 538
Nelson you're welcome!

I've added your requests and they will be implemented in RB 5.0. Except for the microphone - MIC is a feature for live broadcasting, I don't think controlling it over the remote control API makes much sense.
 
Perfect. this will be fantastic! :D
mic idea was to:
using skype to talk to air (which contains the audio output of skype) remotely.

But maybe not the high-priority, or very useful for all users
 
nelson c said:
mic idea was to:
using skype to talk to air (which contains the audio output of skype) remotely.
Interesting. I've added it to the list too, the mic feature will be in 5.0 as well :)
 
Hello, I am working on a remote control for RB.
I have a problem with the count down: sometimes my countdown app is several seconds behind.
After reviewing the algorithm several times, I think I found the cause:
The RB APIs send the information of the length of the track is in the air, without discounting the seconds are eliminated in the "remover of silence".
Also another problem:
When the air track has no tags: the file name is advertised as "", maybe it would be good to report the file name (without the extension) the same way as is done in the air playlist.
Thanks.
 

Attachments

  • contador.png
    contador.png
    186.2 KB · Views: 576
nelson c said:
Hello, I am working on a remote control for RB.
I have a problem with the count down: sometimes my countdown app is several seconds behind.
After reviewing the algorithm several times, I think I found the cause:
The RB APIs send the information of the length of the track is in the air, without discounting the seconds are eliminated in the "remover of silence".
OK, this will be fixed.

nelson c said:
Also another problem:
When the air track has no tags: the file name is advertised as "", maybe it would be good to report the file name (without the extension) the same way as is done in the air playlist.
Thanks.
It will have the FILENAME= filled, so you can check if ARTIST/TITLE fields are empty and use file name instead to display the title.
 
Hi I have a problem with the command api "trackinfo"

the problem occurs when data'm asking for a track that is not on the list.
Example There are 50 songs on the playlist and I'm wondering data number 51 song

The problem is that radioboss returns nothing when the track is not
Code:
 XMLDoc.FileName := ADPLocalFile;
  XMLDoc.Active:=True;
      ANode := XMLDoc.DocumentElement; //Here is the conflict

And this error (in debug version of Delphi):
raised exception class EDOMParse Error with message 'El documento XML debe tener un elemento en el nivel superior. Line: 0'

Forgiveness does not correspond to radioboss, but appreciate any help.
 
You can simply check if XML is zero sized, or, better, catch an EDOMParse exception in a try...except block.
 
Back
Top