xboxscene.org forums

Pages: [1] 2

Author Topic: Xpowerhour  (Read 368 times)

lclagett

  • Archived User
  • Newbie
  • *
  • Posts: 14
Xpowerhour
« on: February 05, 2007, 06:03:00 PM »

I have been debating whether to start this as a new thread but as I think there will be might be some interest in the script I have written, so I decided why not start a new thread.

Basic Info
xPowerHour is a python script written for Xbox Media Center that allows you to play power hour on the xbox without having to edit your songs, burn cds or even create playlists in advance on your computer. This also has proved interesting for just playing music for a limited set of time, to keep tracks moving along.

How to Download
Go to xPowerHour on Google Code Projects and head to the download section. At that location there is also a lot of information on the program and how to use it, as well as some minor issues.

Features
  • Add Songs to the Playlist in the xPowerHour GUI
  • Edit the Playlist from inside the xPowerHour GUI
  • Drinking Mode that locks out all buttons on controller but X and A
  • Starts 45 seconds into every song (no waiting through intros!)
  • Automatically switches songs after 60 seconds
  • Any number of songs can be used for Power Hour (with the exception of 0)
  • On-Screen labels show seconds until next drink, and number of drinks left while visualizer is running
  • Pausing music playback Pauses power hour countdown
  • Stopping music playback provides option for resuming countdown - which will resume at the exact song and spot in the song it left off
  • Automatically checks for 60 tracks in the playlist before starting, and gives you option to play anyway
  • Automatically checks that each song is 105 seconds in length (since it starts 45 seconds into the song). Gives you option to ignore (will not crash the program if you ignore, but will mess up the counters).

Reliability
This script has been run through some decent testing, and is pretty reliable. You will have to work hard at crashing it in its current form but as always there may be something I missed. Let me know if there is a bug you have found, and how to reproduce the bug.

Future Features
Any number of future features are possible. Some ideas that have come up are.
  • Extend capabilities to video playback
  • User option for setting location of start point in songs
  • User option for length of countdown before switching tracks
  • Vary the length of the countdown throughout the power hour
  • Set a transition song between tracks

Even without a large interest in this there is a chance I will continue working on this script. Hopefully some people will provide feedback so ideas can be generated on how to improve the script.
Logged

stanley87

  • Archived User
  • Newbie
  • *
  • Posts: 32
Xpowerhour
« Reply #1 on: February 06, 2007, 09:40:00 PM »

HEY!

You need help with this script? I have coded XinBox and ResumeX and looking for a new project :-D
I could help implement video play list and also would like to add in a better timer etc.
Also, we could put our heads together and start a XBMC Drinking Games script with many different
party games etc :-D

If you keen, i have a google code username and you could add me and we could start the "thinking"!

Let me know :-D

Cheers
Stanley87

PS: Love your coding!
Logged

bjs1400

  • Archived User
  • Jr. Member
  • *
  • Posts: 74
Xpowerhour
« Reply #2 on: February 07, 2007, 07:13:00 AM »

Niiiice....   Its been a while since doing a power-hour, but maybe I will have to do some "testing" of your script.
Logged

CHI3f

  • Archived User
  • Hero Member
  • *
  • Posts: 607
Xpowerhour
« Reply #3 on: February 07, 2007, 12:24:00 PM »

I am definately gonna have to do some "testing" of my own. I think this one may need to be "tested" extensively.
Logged

timdog82001

  • Archived User
  • Sr. Member
  • *
  • Posts: 446
Xpowerhour
« Reply #4 on: February 07, 2007, 04:30:00 PM »

QUOTE(stanley87 @ Feb 6 2007, 08:40 PM) *

Also, we could put our heads together and start a XBMC Drinking Games script with many different
party games etc :-D


heh, that would actually be pretty cool
Logged

lclagett

  • Archived User
  • Newbie
  • *
  • Posts: 14
Xpowerhour
« Reply #5 on: February 08, 2007, 08:24:00 PM »

QUOTE(stanley87 @ Feb 6 2007, 11:40 PM) View Post

HEY!

You need help with this script? I have coded XinBox and ResumeX and looking for a new project :-D
I could help implement video play list and also would like to add in a better timer etc.
Also, we could put our heads together and start a XBMC Drinking Games script with many different
party games etc :-D

If you keen, i have a google code username and you could add me and we could start the "thinking"!

Let me know :-D

Cheers
Stanley87

PS: Love your coding!


I honestly had thought the need for other coders, didn't think there was too much more work to be done on this ... but if we are going to make other games ...

Let me clean up the code up a bit, break it into two different files. Would also like to organize it better such as overriding the playlist class and have the length checks in their where it should be rather than the main window class. Also setting things up for a settings area to be implemented. Stuff like that. Guess I get to put cvs into action err subversion.

So I will most likely add you to the google project, your other work seemed very good to say the least. We will see where this takes us. Unfortunately it seems that XBMC does not report which controller port hit a button so a game may be out of the question ...  but surely something good can be created.

Anyone with any ideas for something do post, credit for the idea will certainly be left in the code and documents for your thoughts.
Logged

CHI3f

  • Archived User
  • Hero Member
  • *
  • Posts: 607
Xpowerhour
« Reply #6 on: February 08, 2007, 10:06:00 PM »

Can a script deal out cards at random? If so I have a good drinking game to suggest but I am not gonna take the time to explain it if it can't.
Logged

stanley87

  • Archived User
  • Newbie
  • *
  • Posts: 32
Xpowerhour
« Reply #7 on: February 09, 2007, 12:03:00 AM »

QUOTE(CHI3f @ Feb 9 2007, 06:06 PM) *

Can a script deal out cards at random? If so I have a good drinking game to suggest but I am not gonna take the time to explain it if it can't.

Yup! can do :-D
Logged

CHI3f

  • Archived User
  • Hero Member
  • *
  • Posts: 607
Xpowerhour
« Reply #8 on: February 09, 2007, 05:19:00 AM »

OK, I am not too good at explaining things so bear with me. The game is called up the river down the river.

Everyone gets 4 cards that are faced up. The dealer flips cards over one at a time and gives a drinking command. He starts at drink 1, so anyone who has the card he flipped over has to drink 1 gulp of beer or one shot of liquor. he then flips another one over and says drink 2, then drink 3, then drink 4, and same applies for those cards. After drink 4 he says give 4 so anyone who has that card has to give 4 drinks to someone else. If for example he lays a jack down on drinks 4 and you have 2 jacks, you can either give someone all 8 or split it between two people. But you can not split one cards worth of drinks between two people. He continues till he gets down to give 1, then he starts with drink 1 again, and you repeat the whole process until the cards are all gone.

I hope I have explained well enough. This may sound simple but it is a great drinking game that can lead you to getting very drunk. I have made many people puke playing this game. I would love to see this become a reality.
Logged

stanley87

  • Archived User
  • Newbie
  • *
  • Posts: 32
Xpowerhour
« Reply #9 on: February 02, 2020, 07:07:00 PM »

QUOTE(lclagett @ Feb 9 2007, 04:31 PM) *

I honestly had thought the need for other coders, didn't think there was too much more work to be done on this ... but if we are going to make other games ...

Let me clean up the code up a bit, break it into two different files. Would also like to organize it better such as overriding the playlist class and have the length checks in their where it should be rather than the main window class. Also setting things up for a settings area to be implemented. Stuff like that. Guess I get to put cvs into action err subversion.

So I will most likely add you to the google project, your other work seemed very good to say the least. We will see where this takes us. Unfortunately it seems that XBMC does not report which controller port hit a button so a game may be out of the question ...  but surely something good can be created.

Anyone with any ideas for something do post, credit for the idea will certainly be left in the code and documents for your thoughts.


Actually, i think you shift shift your script to XBMC-Scripting.
http://code.google.com/p/xbmc-scripting/

http://xbmc-scripting.googlecode.com/svn/trunk/

You will see there are quite a few great scripts there, and they are growing. You just have 2 get in touch with darkdonno and he will add you. He is always in the #xbmc-scripting channel on FreeNode? on mirc. Also, i have made a few changes to the script to make it more XBMC script friendly (renamed to default.py and added a little default logo) If you join this svn, i can show you this etc. I have also been trying to get the multi-controller support for xbmc so we can all start coding some 2player games :-D
Let me know :-D
Logged

stanley87

  • Archived User
  • Newbie
  • *
  • Posts: 32
Xpowerhour
« Reply #10 on: February 02, 2020, 07:40:00 PM »

Hey, found a little bug for it.

Line 304 needs to be changed:
Original:
self.currentCountLabel = xbmcgui.ControlLabel( 1027, 600, 150, 15,  "Next Drink In: 60", 'font13', '0xFFFFFFFF')

New:
self.currentCountLabel = xbmcgui.ControlLabel( 1027, 600, 300, 15,  "Next Drink In: 60", 'font13', '0xFFFFFFFF')

Doesnt need to be 300, but bigger is better :-p. I needed to change this as the label was showing Next Drink In:.....   etc etc, which means the label isn't big enough for the text. It might be only for my setup that this shows but still, it doesnt hurt to make it bigger :-D
Logged

kernel610

  • Archived User
  • Newbie
  • *
  • Posts: 5
Xpowerhour
« Reply #11 on: February 03, 2020, 02:31:00 PM »

can someone please explain HOW to install this.  i figured i would just put it in the Python/Lib folder and restart, but that doesn't seem to work.  sorry, but i'm kind of new to this.  and were exactly do i use it?  is it a new button on the playlists once its installed properly?  thanks for any help
Logged

stanley87

  • Archived User
  • Newbie
  • *
  • Posts: 32
Xpowerhour
« Reply #12 on: February 10, 2007, 04:15:00 PM »

QUOTE(kernel610 @ Feb 11 2007, 10:31 AM) View Post

can someone please explain HOW to install this.  i figured i would just put it in the Python/Lib folder and restart, but that doesn't seem to work.  sorry, but i'm kind of new to this.  and were exactly do i use it?  is it a new button on the playlists once its installed properly?  thanks for any help


K, first off, rename the Xpowerhour.py file to default.py. Next transfer the XpowerHour folder into your XBMC/SCRIPTS folder. Then run xbmc. Once it is running, go into the scripts menu and you will see XpowerHour (won't have an icon). And run it!

Hope this helps!
Logged

kernel610

  • Archived User
  • Newbie
  • *
  • Posts: 5
Xpowerhour
« Reply #13 on: February 10, 2007, 06:33:00 PM »

QUOTE(stanley87 @ Feb 11 2007, 12:22 AM) View Post

K, first off, rename the Xpowerhour.py file to default.py. Next transfer the XpowerHour folder into your XBMC/SCRIPTS folder. Then run xbmc. Once it is running, go into the scripts menu and you will see XpowerHour (won't have an icon). And run it!

Hope this helps!


ok thanks.  i've got all of it loaded now but where is the "scripts menu" and how is it accessed.  like i said, i'm a noob at this
Logged

lclagett

  • Archived User
  • Newbie
  • *
  • Posts: 14
Xpowerhour
« Reply #14 on: February 10, 2007, 08:44:00 PM »

QUOTE(CHI3f @ Feb 9 2007, 07:19 AM) View Post

Everyone gets 4 cards that are faced up. The dealer flips cards over one at a time and gives a drinking command. He starts at drink 1, so anyone who has the card he flipped over has to drink 1 gulp of beer or one shot of liquor. he then flips another one over and says drink 2, then drink 3, then drink 4, and same applies for those cards. After drink 4 he says give 4 so anyone who has that card has to give 4 drinks to someone else. If for example he lays a jack down on drinks 4 and you have 2 jacks, you can either give someone all 8 or split it between two people. But you can not split one cards worth of drinks between two people. He continues till he gets down to give 1, then he starts with drink 1 again, and you repeat the whole process until the cards are all gone.

I had been thinking more along the lines of doing a game that would be new and unique, but doing a card game does sound interesting.


QUOTE

Line 304 needs to be changed:
Original:
self.currentCountLabel = xbmcgui.ControlLabel( 1027, 600, 150, 15, "Next Drink In: 60", 'font13', '0xFFFFFFFF')

New:
self.currentCountLabel = xbmcgui.ControlLabel( 1027, 600, 300, 15, "Next Drink In: 60", 'font13', '0xFFFFFFFF')

This was because I have been developing this on a 720P screen. So to me the text appears fine, but my guess is that in 480P, the text uses more pixels, and in turn also gets cut off. I changed it to 300 in the version that is now in the Sources section of the google project.

QUOTE

ok thanks. i've got all of it loaded now but where is the "scripts menu" and how is it accessed. like i said, i'm a noob at this

Assuming you are using the default skin, click on the upward arrow in the bottom right hand corner. From there click on the first option, "Scripts". This will bring up the folder displaying the contents of the Scripts folder that you should have uploaded to. Find the folder where you uploaded the script, and click on it to execute. It will start automatically for you.


Stanley for the time being at least I would rather have the code at the current project space, maybe move it to the new one at a later time. Anyway, my guess was that your google username is the one from xbmc-scripting. I have added you to the project group so you can checkout the code, and commit it again adding any changes.

I have done no real visible changes to the code (that can be seen to the average user anyway). But I have overriden the playlist class. The check for 60 songs, and song length is now done by that class. This class also has a way of changing the playlist being used on the fly, and since before power hour starts the playlist automatically updates, adding the functionality for the video power hour should not be too difficult at all. It will most likely make more sense to you when you look at the code. I also added a settings class for reading in a settings file, and giving out the information to the parts of the code that needed it. OH, and I changed the name to default.py, and moved PowerPlaylist, PowerPlayer, and Settings class to that.

Still slowly working on it ... now that stanley is involved maybe he will add some more things ? The lastest code I have is under the Sources section, waiting to be checked out using subversion ...
Logged
Pages: [1] 2