Reply
Thread Tools
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#11
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 it but i dont surrender i ll use wxpython to make something good
 

The Following User Says Thank You to santiago For This Useful Post:
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#12
Originally Posted by santiago View Post
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 it but i dont surrender i ll use wxpython to make something good
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
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun
 
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#13
Originally Posted by kojacker View Post
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
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 santiago For This Useful Post:
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#14
Originally Posted by santiago View Post
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)
Did you attach those files anywhere yet? I had a look though the thread but couldnt see any, you havent forgotten to, have you?
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun
 

The Following User Says Thank You to kojacker For This Useful Post:
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#15
Originally Posted by kojacker View Post
Did you attach those files anywhere yet? I had a look though the thread but couldnt see any, you havent forgotten to, have you?
Sorry my friend 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

PS: why dont you add you MaeFart to the repos? Its very funny and scary 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.

2PS: u know that mine is just the concept can you add a button like "About" with a description? It has to be like "All the code comes from MaeFarm (i will check the autor later), please dont use this software with dogs, cats, horses etc it can disturb those animals. Use it just with the Mosquitos
Code designer:YouName and Youemail
Icons and Concept: Santiago (my mail that i will leave you after)
Special thanks to the Mosquitos Insects to help us working well with this tool "
Attached Files
File Type: zip mosquitos-hunter.zip (206.0 KB, 68 views)
 

The Following User Says Thank You to santiago For This Useful Post:
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#16
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 place It'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

Originally Posted by santiago View Post
PS: why dont you add you MaeFart to the repos? Its very funny and scary
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?

here's the zip i hope that u can complete that, it's too hard for me as i explained above.
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
Code:
self.soundFile = "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 :P
def repeatStartSound(self):
self.m_media.setCurrentSource(Phonon.MediaSource(s elf.soundFile))
self.m_media.play()
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.

QtCore.QObject.connect(self.m_media, QtCore.SIGNAL('finished()'), self.repeatStartSound)
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
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);")
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
Attached Files
File Type: zip mosquitos-hunter.zip (437.4 KB, 66 views)
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun

Last edited by kojacker; 2011-05-18 at 22:52.
 

The Following 2 Users Say Thank You to kojacker For This Useful Post:
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#17
Originally Posted by kojacker View Post
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 place It'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
Code:
self.soundFile = "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 :P

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
u r the best from the himalaya to the everest! i ll make a deb and i will add the sounds check it i'm working wait here thx thx thx!!!!! u saved my life from the mosquitos
 

The Following User Says Thank You to santiago For This Useful Post:
santiago's Avatar
Posts: 518 | Thanked: 334 times | Joined on Mar 2010 @ italy
#18
Friend 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:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:38.