Author Topic: Announcing tracks in radio like manner...  (Read 15280 times)

0 Members and 1 Guest are viewing this topic.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Announcing tracks in radio like manner...
« on: May 28, 2012, 11:08:26 PM »
Hi I love the "XBMC announce songs" function in the XMLBin...  Just wondering though, how would I go about doing the following.  

Instead of announcing the current song as it begins..  Can we have it announce the 'last song' then the 'current song' every second track.  Like as they do on the radio.  

For instance.   "That was Nine Inch Nails - with Teeth.  Now for some Nick Cave - Got Some."

I've all ready got it randomising the responses of each artist and track which is a nice little touch but it would be much cooler and less repetitive this way.  To do this would I require some sort of logicgate...

Thanks all... ;D ;D ;D

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #1 on: June 02, 2012, 05:38:18 AM »
Really no one???  I will work it out..  It's one of those IF THEN arguments in the logic block I imagine... 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #2 on: June 02, 2012, 06:10:04 AM »
Really no one???  I will work it out..  It's one of those IF THEN arguments in the logic block I imagine... 
Haha, thats your part  ;)
I will give you a start point ( I hope so)
I think you can use a logic block with AcontainsB or A==B with parameter {LastEvent}, see attach pictures.
You can find a "XBMC announce songs" command in the editor, if you click on the "earth-button" for a mega.xml

I hope it help  ;)

Kalle
***********  get excited and make things  **********

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #3 on: June 02, 2012, 07:02:15 AM »
Of course... Just leave the second block empty LOL....

Ok so what I'm trying to do is gather information such as Title, Album, Artist via the "getcurrentlyplaying" command.  I want to then place individual components of this info into {Match.1}, {Match.2} and {Match.3} respectively so I can source this information as desired..  Don't know how to do this yet..

The other thing is that I need to find out how to get info recording either previous or next artist info.  It's all fine and dandy having the 'currentlyplaying' info but for this to work we need to source the 'next' or 'previous' info. 

Thanks a lot.  You have been great support...

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #4 on: June 02, 2012, 07:15:44 AM »
Ok my brain is officially not working...  I really just want it to skip the command every second time.  Random won't work, just need to tick over to the next command if a command is successful..


thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #5 on: June 02, 2012, 07:27:35 AM »
If I am unable to access previous track played..  I could possibly use the Resaults.Storelast command.. Hmmm

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #6 on: June 02, 2012, 08:07:57 AM »
If I am unable to access previous track played..  I could possibly use the Resaults.Storelast command.. Hmmm
What I'm said, "I'm not really firm with the XBMC API" so I can't help with that   ::)
I think member "bp_pbs" is a good partner to help you figured it out  ;)
Perhaps it is possible to can use an event timer with a "get current playing command"

Kalle
***********  get excited and make things  **********

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #7 on: June 02, 2012, 04:15:36 PM »
Umm ::hmm I'll work on it and see what I can come up with

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Announcing tracks in radio like manner...
« Reply #8 on: June 02, 2012, 09:19:33 PM »
this is an interesting idea.  :bignod

If I understand you correctly, you want to announce the current song as it starts, but then on the next song don't announce it until the end (actually the beginning of the song that follows it).  So actually, you will be announcing two songs at once (the last song and the new song) every two songs.

This should be possible, but the solution is not obvious or trivial.  As far as I know the http api for xbmc does not offer any method to get information about the previous song.  Take a look at the list of methods for yourself to see if there is anything that might be useful: http://wiki.xbmc.org/index.php?title=Web_Server_HTTP_API

Probably what you would need to do is to store the information for the current song when it starts, and then when the next song plays you can retrieve this information.  To do this you can use Results.SetVar to store the value(s) in a variable and later you can use {Var.VariableName} to retrieve the value(s).

In order to announce only at the beginning of every second song you can use another variable that toggles back and forth between true and false.  When you announce a song you can set this variable to "true" and then at the beginning of the next song, if this variable is "true" then you will know that you just announced and want to skip the announcement (but still store info for later).  If that is the case you can store the data and then set this toggle variable to false so that on the next song it will know to make an announcement.

I'm afraid I don't have the time right now to actually put this together for you but if I get a chance before someone else manages it, I'll give it a shot.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #9 on: June 02, 2012, 10:46:23 PM »
JitterJames.  That is exactly how I thought it would work.. as I've tried to explain.  You have hit the nail on the head as you have the technical know-how on how to make this happen.    Thanks..  My next challenge for you crazy cats...   ;D

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #10 on: June 03, 2012, 05:48:49 AM »
This is the best I can do so far. Hope this helps  ;D

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #11 on: June 03, 2012, 07:06:39 AM »
Interesting... Well done....  Just need it to not repeat every second time....

Good start....  Does not always work though as for instance when you skip a track.  Oh and for some very strange reason I'm getting double ups on the second event MediaChange for some odd reason...

Thanks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Announcing tracks in radio like manner...
« Reply #12 on: June 03, 2012, 12:56:09 PM »
Try this.  It is not perfect but it is getting there...

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #13 on: June 03, 2012, 08:50:08 PM »
WOW... That is some complex stuff...  Impressive... Testing..

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Announcing tracks in radio like manner...
« Reply #14 on: June 04, 2012, 12:51:10 AM »
Try this.  It is not perfect but it is getting there...
Good Job, it working  :clap
I've insert a xbmc.softmute/unmute action while TTS speak.
I don't really use this command in xbmc, it has a touch of an radio station  ;)
But respect for figured out the parameter  ::bow

Kalle
***********  get excited and make things  **********