|
|
2011-05-17
, 13:00
|
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#11
|
but i dont surrender i ll use wxpython to make something good
| The Following User Says Thank You to santiago For This Useful Post: | ||
|
|
2011-05-17
, 13:06
|
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#12
|
maybe PYQT is too complicated for me. Thanks for your help if you want the source i'm here, i'll try with Wxpython may i can do something of better.. there's not an Italian Faq so i leave itbut i dont surrender i ll use wxpython to make something good
|
|
2011-05-17
, 13:20
|
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#13
|
Lol u cant surrender, you're so close! Zip up and attach your your project files to the post and I'll have a look at the source code when I get home tonight
| The Following User Says Thank You to santiago For This Useful Post: | ||
|
|
2011-05-17
, 19:09
|
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#14
|
good bless you ok
i exclude the wav files are too large (20 mega)
by the way its maefarm code i changed some thing (windows title, icons, sounds and sounds path)
| The Following User Says Thank You to kojacker For This Useful Post: | ||
|
|
2011-05-18
, 09:24
|
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#15
|
Did you attach those files anywhere yet? I had a look though the thread but couldnt see any, you havent forgotten to, have you?
i had too much problems with the connection yesterday, i didnt attach the file becouse connectione was lost all the day. This is the code, can u help me with this? As i told you there's not an italian FAQ nowhere so i copyed MaeFarm code
by the way.. When finished, do you have čermissions to upload on the repo? This utility gotta be there believe me souds works well
i tryed it 5 days ago.. There was a mosquito that was sucking all my blood, i pushed play and the mosquito moved to the N900 LCD.. Maybe it was thinkig "oh my god who is singing? horrible voice i leave.." the case is that Mosquito disappeared.. here's the zip i hope that u can complete that, it's too hard for me as i explained above.
"
| The Following User Says Thank You to santiago For This Useful Post: | ||
|
|
2011-05-18
, 22:40
|
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#16
|

It's nice you took the time to tell me it was helpful to you, though, I appreciate that 

PS: why dont you add you MaeFart to the repos? Its very funny and scary

here's the zip i hope that u can complete that, it's too hard for me as i explained above.
self.soundFile = "start.wav"
def repeatStartSound(self):
self.m_media.setCurrentSource(Phonon.MediaSource(s elf.soundFile))
self.m_media.play()
QtCore.QObject.connect(self.m_media, QtCore.SIGNAL('finished()'), self.repeatStartSound)

def playStopSound(self):
self.soundFile = "ultra.wav"
self.m_media.setCurrentSource(Phonon.MediaSource(s elf.soundFile))
self.m_media.play()
self.ui.stopButton.setStyleSheet("background-color: red; background-image: url(stop.png);")
self.ui.startButton.setStyleSheet("background-color: rgb(20, 20, 20); background-image: url(start.png);")
Im setting the soundFile variable to the correct file, playing it, then using self.ui to reach out to the buttons on the GUI and changing their background colour via the stylesheets. I change the button we clicked to have a red background and the other one to the dark grey background.
|
|
2011-05-19
, 00:47
|
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#17
|
Ive added looping and the button toggle, please see the attached files. If you unzip and click main.py it'll run from your PC. I edited the sound file paths from "/opt/..." to local folder so I didnt need set up the directory structure on my PC, so you might want to change it back before sticking the code on your N900... I didnt have any mosquitos sounds so used some cowbell wavs I had on my PC
The 'about' dialog is a bit more tricky to edit in. Ideally you should create the 'about' info button with the rest of the UI on Qt Creator before generating your PyQt UI code, else your changes would be lost next time you change the GUI.
By the way, there's no need to credit maeFarm in any way. That's the beauty of open source - you're free to take code and build on it, that's why I uploaded it to the forum in the first placeIt's nice you took the time to tell me it was helpful to you, though, I appreciate that
Besides you can have all the blame for unleashing looping mosquito sounds on everyone, I don't want share the blame with you
lol there would be an outrage if suddenly there was a fart app in the maemo repos! Don't you know, the lack of fart apps is what makes us better than the iPhone?
It's so not hard, I made very simple changes i know you can follow! All the changes are in the main.py file
Firstly I added a variable to keep track of the current sound file, and by default it is start.wav
To loop the sound I made a new method called repeatStartSound(). Actually I should have called this repeatSound or something, cos it works for both Start and Stop sounds.. Ive just noticed that mistake and dont want to zip it up again .. Im lazy :PCode:self.soundFile = "start.wav"
So you can work out what it's doing.. it's setting the sound file to whatever is in the soundFile variable and then playing it. All we gotta do now is call this method when we want the sound to loop.
So what this does is connect the finished() signal of the media object (which fires when the sound file gets to the end) to the repeatStartSound method - so it starts playing again! Easy peasy
Ok now for the toggle button backgrounds, I made changes to the playStartSound and playStopSound methods. Let's take one cos they are basically the same
See what Im doing?Im setting the soundFile variable to the correct file, playing it, then using self.ui to reach out to the buttons on the GUI and changing their background colour via the stylesheets. I change the button we clicked to have a red background and the other one to the dark grey background.
Screenshot of start (no mosquito selected)
Classic mosquito selected
Extreme mosquito selected
You can pretty much change everything about the appearance you like, so play around with the stylesheet until you get the effect you prefer
wait here thx thx thx!!!!! u saved my life from the mosquitos
| The Following User Says Thank You to santiago For This Useful Post: | ||
|
|
2011-05-19
, 05:13
|
|
|
Posts: 518 |
Thanked: 334 times |
Joined on Mar 2010
@ italy
|
#18
|
app is finally ready
http://talk.maemo.org/showthread.php...72#post1009672 here is the thread
thank u for ever!
| The Following User Says Thank You to santiago For This Useful Post: | ||