View Full Version : Xm script
Del_Usion
2005-08-26, 23:17
i've tried the new xm web radio script, which is working beautifully even if it doesn't have much eye candy yet, but i have one complaint. it doesn't seem to be pulling the high bandwidth streams, and the low bandwidth streams don't sound nearly as good. does anyone know of a way that i might be able to set this up? i tried looking through the script, but not being very good with code i didn't see anything that looked like i could change for this.
NewNole2001
2005-09-12, 22:17
i've been working with this script over the weekend, and i'm fairly sure it is pulling in the high speed streams. the url it creates to request the stream tells xm that it would like the high bandwidth feed. i've tried playing the feed in winamp, but it doesn't say the bandwidth of the stream. but yeah, it does seem to be pulling the high bandwidth streams.
if anyone can prove me wrong, please do and we can work to fix it.
NewNole2001
2005-09-17, 05:12
i just uploaded my xm radio script to xbmc scripts (http://www.xbmcscripts.com). it will be available as soon as they get around to posting it. check it out when you get a chance. the script looks much better now and has many more features.
edit:
the script can currently be downloaded from the xm411 forums: link (http://www.xm411.com/phpbb/download.php?id=7445).
Del_Usion
2005-09-17, 17:29
excellent! :bowdown: i'll give it a look. unfortunately, i'm using one of the extremely buggy builds from august (i have to run it in 480p instead of 1080i because half of xbmc doesn't work if i do), so i may not spot any bugs. if i do, i'll pass them on.
NewNole2001
2005-09-17, 18:32
unfortunately, i don't have an hdtv, so i can only guarantee that this script will look right at sd resolutions. if you can fix the code ui placement code to work with hd then please do. the problem is that one of the images i use onscreen has to be precisely placed to make sense. the only thing i can think of that would work for all resolutions is this: if you could figure out all the placements for the various different resolutions, i can write a function that will handle ui placement for all of this.
Nuka1195
2005-09-17, 19:58
did you try these?
hdtv_1080i = 0 # (1920x1080, 16:9, pixels are 1:1)
hdtv_720p = 1 # (1280x720, 16:9, pixels are 1:1)
hdtv_480p_4x3 = 2 # (720x480, 4:3, pixels are 4320:4739)
hdtv_480p_16x9 = 3 # (720x480, 16:9, pixels are 5760:4739)
ntsc_4x3 = 4 # (720x480, 4:3, pixels are 4320:4739)
ntsc_16x9 = 5 # (720x480, 16:9, pixels are 5760:4739)
pal_4x3 = 6 # (720x576, 4:3, pixels are 128:117)
pal_16x9 = 7 # (720x576, 16:9, pixels are 512:351)
pal60_4x3 = 8 # (720x480, 4:3, pixels are 4320:4739)
pal60_16x9 = 9 # (720x480, 16:9, pixels are 5760:4739)
self.setcoordinateresolution(ntsc_4x3)
resolution = self.getresolution()
NewNole2001
2005-09-17, 20:46
i will look into this and post an updated version in a few days that uses this. i will have to rely on you guys with hd and python skills do any fine tuning
Del_Usion
2005-09-18, 22:52
maybe i'm being stupid, but i can't get the version of the xm script posted to run. i noticed a new line in the script in the config area called emulation, but i'm not sure what it means. would this keep it from running?
NewNole2001
2005-09-19, 07:52
maybe i'm being stupid, but i can't get the version of the xm script posted to run. i noticed a new line in the script in the config area called emulation, but i'm not sure what it means. would this keep it from running?
nope, you aren't being stupid. it was my lack of triple checking the archive. here is a link (http://www.xmfan.com/viewtopic.php?p=466824) to the xmfan topic that contains and updated version of the script that i know works. just download it and do the following:
***delete all both the clientcookie and xmlib (them being capitalized was the main problem [i didn't do this, but have now fix ed it])
set your username/password in the settings.txt file
upload all of the files in the zip file.
re-upload the background.png file to the xmlib\xmimages directory.
if it doesn't work now, reply to this topic and pm me and i will try to help you figure it out. it helps to use the newest (2005-09-12) cvs build, since that is what i used during development.
just some new notes. there are currently some bugs in the threading code. the threads work fine, but they are not always killed on exit. i will be updating this soon, but in the meantime the script may lockup your xbox every once in a while after you exit it.
Del_Usion
2005-09-28, 04:40
i apologize for taking so long to get back on this (life got away from me and i haven't had time to test it), but i still can't get it to run. i upgraded to the 9/26 cvs, and i configured runxm.py and settings.txt (i'm a little fuzzy on which one actually is handling the login in your version). unfortunately, every time i try to run it i get an error, "configure settings file. exiting." i have tried it both with that emulating line in the config section of runxm.py and with it commented out, since i still don't know if that needs something done, but neither seems to be making a difference. ideas? have you made a new build in the time that i've been away?
mjcother
2005-09-28, 06:05
i am running "9-25 proper" xbmc using hd 1080i and the script works. i wiped my xbmc directory and just added the few changes in the xml file to load.
notes -
a bit slow to cache enough to play, but i haven't modified it like it says in the readme.
i did get it to lock up when i got impatient trying to shut it down or change channels, that is somewhat my own fault.
the text is kinda small, but that is expected for first run code viewed in hd, and it is mainly to listen to, not watch, so i am extremely happy for now...
-mike
NewNole2001
2005-09-28, 09:34
del unison, could you do me a big favor and do this: after the script errors out, hit the white button and post the text from the debug window. that might help me shed some light on your issues. the script prints info about the exception that has occured to the debug screen. since the script is saying to check the settings file, there an exception is being raised. i know it's a pain in the butt to type whatever is on the screen but it'll help.
as far as the font being small in hd, i can't help this, i don't have an hdtv, so i have hard coded the script for my sdtv. if anyone wants to take my presentation code and make it work for hd, please do so, but i am not since i have no way to test this.
NewNole2001
2005-09-28, 21:56
if you are having trouble getting the script to run, make sure that you are installing the script to the scripts directory, and not to a directory within the scripts directory:
xbmc\
|->scripts\
|
-->runxm.py
-->cachedhttp.py
-->clientcookie\
-->xmlib\
where xbmc is the root directory for xbmc. this is how this script must be installed to work properly. if you have trouble after doing this, then i am not sure what is wrong. i triple tested this program to make sure it ran.
solexalex
2005-09-29, 20:56
this is how this script must be installed to work properly
hello !
i made some little changes to make your script working in every folder. you can get it and try it : http://xbmc-scripts.gueux.be/documen....lex.zip (http://xbmc-scripts.gueux.be/documents/scripts/xmroforxbmcv0.9.1_any_folder_install_alexsolex.zip )
i only added os library import,
import os
then a variable to store the current localisation path of the script :
home=os.getcwd()[:-1]+\\
then i replaced everywhere the string :
"q:\\scripts\\
with
home+"
not tested in your script but it should work fine.
try it and tell me
NewNole2001
2005-09-29, 22:19
thanks man. i will test it in a bit, i'm preoccupied with some other projects right now. everyone should feel free work on this. i have some updated code that i have worked on, but i do not feel like it is ready for release. i got a new computer this weekend, so i have been in the process of setting it up how i like (it's a compaq, so this takes a lot of time.)
Del_Usion
2005-10-03, 01:33
sorry for looking so irresponsible again. i was waiting for an email from the topic tracker saying you'd responded, and since it had been a while i decided to check up. looks like my subscription expired or got deleted somehow.
anyway, thanks for the response. i was putting it in a sub-folder, so that was the problem. thanks to solexalex i was able to run it from that folder now. it looks like a nice improvement of the original script. good work!
now, for some notes. as i have mentioned before i am incredibly inept when it comes to coding, so i hope with the information i provide you can make whatever improvements you will. i can't see any visible difference in load time between the original xm script, like some have noted.
[standard definition]
-i noticed that the page indication and arrows in the lower right are not aligned with the bottom of the text on the lower left, which would improve the interface look because where they are currently placed is on top of the background bar at the bottom.
-i don't know where it would be possible to fit it in, but one thing i liked about the original script was that it displayed album art from the currently playing artist. this might be a good enhancement for the future.
-on both the old script and this one, the track display (most visible when on a visualization) shows the address audio is being streamed from. i don't know if it would be possible to fake it out and pass it the currently playing track information, but that would also be an excellent enhancement.
-you probably have no way of dealing with this, but i was able to repeat a crash several times by attempting to change resolution while the script was running.
[1080i]
-the background stretches, so it appears to be in exactly the same position as it was in sd. as mjcother noted, the text is small, and aligned into the upper left, due to the display code. theoretically, knowing this and using the resolution chart nuka posted earlier you could scale the text placement fairly predictibly since the background scales. it might not be perfect because you'd be doing it blind, but unfortunately i can't code it for you with my limited knowledge.
--------
everything is looking great so far. with just a little more development i think this could very well become a staple script for many people. i am more than happy to check things for you at 1080i, but for some reason my tv doesn't do 720p (didn't know that when i bought it) so i can't check that resolution. it is, however, 16x9, and i can confirm that other than a little clipping from overscan the script works great at 480p 16x9.
NewNole2001
2005-10-03, 10:24
i am going to do away with the paging arrows for the "currently playing" listbox, so that should do away with that issue.
as far as the album art, i actually did away with that because so often it didn't work. the code should still be in there, and it could easily be added back into the script. maybe that's another thing i should add to the settings.txt file.
many thanks to solealex for providing the code for making the script work from any directory, i shall add this code to my script very soon.
as far as getting the currently playing artist and song title to show, it literally will take begging one of the xbmc devs to add the ability for python scripts to set this. i explored the code, and even wrote code that i thought would do it, but i was never able to actually get the function exposed to python, even though i thought i had done all the steps. if someone could write me a short tutorial of the various steps necessary in exposing a new function to python, i would be very grateful. i am quite willing to write this code myself and post it to be added to cvs. i'm sorry i haven't done any work on this, but i have been preoccupied with other stuff lately, plus my roommate just got burnout revenge and so he's pretty much commandeered the xbox for the time being. it is my xbox, but it's hard to wrench it from his hands. i'm hoping the price on the xbox1 drops enough after the 360 comes out that i'll be able to pick one up just for dev work, but until then, the box is constantly being moved up and downstairs.
i must confess that i really don't see myself working on the hd probs with the script. don't hate, but i'm more interested in adding functionality to the script than worry about the ui. i can make the font size a global variable if you want me to, and then you could just set it in one place. please don't hate on me for this, but i'm not a ui person, i love the lowdown stuff. ask my boss at work, i would much rather work on data access or optimizing an xml parser than web design or windows forms stuff. i'm not a very visually artistic person.
it would take a night or so, but i could probably abstract out all ui placement to a function. then i could take you guys recommendations on the placement of the various elements and have things set based on that.
i basically shut down my life for about three nights to write this script, and i think my friends will beat me if i do that again. this is gpled, and i will not be offended in any way if someone takes this, cleans up the filthiness of the code and makes this into one of the great xbmc scripts. it's got the potential guys.
one of you truly great scripters please take this and make it into all that it can be. show me how this stuff is really done. :bowdown:
UPEngineer
2005-12-25, 09:12
newnole2001,
i have tried your script every which way i can...i have used the code from solexalex and it still does not work.
i have tried it within the scripts directory and its own directory. i have hardcoded the username and password and that doesn't work either.
i keep getting the settings error message. i cannot get to the debug screen with the white button cause when i click ok on the dialog box it then says logging in and just sits there.
is there anything else you can think of for me to try?
thanks,
scott