maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [WIP] Simpsons sound app (https://talk.maemo.org/showthread.php?t=73953)

robin92 2011-06-12 22:59

[WIP] Simpsons sound app
 
Hi!
I have worked on an easy simpson sound app :) You find it in extras-devel.
Some bugs but this is my first pyqt :) I have only made some themes and icon pack before.

Hope you like it :D

btw I need some help with the sound so it work with hardware buttons. Now I onlye write set volume 0.3 in pyqt :/ You cant change the volume ;(

kojacker 2011-06-13 00:54

Re: [WIP] Simpsons sound app
 
Ah so that's what you're working on :) I just noticed your pm, but let's try and answer it here so we can get everyone's input.

Well it should be quite simple to fix this as you've been following the maeFart tutorial. To help pinpoint the problem could you do us a favor, and run your Simpsons sound app from XTerm? If you're not sure how, open XTerm and navigate to the correct folder then type in:

Code:

python your_simpsons_main_filename.py
This should run your app. When it runs, any errors and output will appear on the XTerm window so please check the XTerm output for the following message:

Code:

"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
Is it there? If so, it's a simple fix and by setting the application name within your app you'll find that pressing the hardware volume rocker switch will change the loudness of Homer's 'D'Oh!'s and Bart's "Eat my shorts" up and down automagically :cool:

So try adding that in your main.py file so it looks like below, and let me know if it works:

Code:

if __name__ == "__main__":
    app = QApplication(sys.argv)
    QApplication.setApplicationName("Simpsons Sounds")

... rest of the file... etc


robin92 2011-06-13 03:25

Re: [WIP] Simpsons sound app
 
Hi!
I get this after your command, It stand

Code:

Traceback (most recent call last):
  File "main.py", line 40, in <module>
    QApplication.setApplicationName("Simpsons sounds")
NameError: name 'QApplication' is not defined

And before I get
Code:

"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
btw how i fix porttrait?:p

kojacker 2011-06-13 09:08

Re: [WIP] Simpsons sound app
 
Quote:

Originally Posted by robin92 (Post 1027919)
Hi!
I get this after your command, It stand

Code:

Traceback (most recent call last):
  File "main.py", line 40, in <module>
    QApplication.setApplicationName("Simpsons sounds")
NameError: name 'QApplication' is not defined

And before I get
Code:

"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
btw how i fix porttrait?:p

Try adding this import to the top of the same (main py) file
Code:

from PyQt4.QtGui import QApplication
I think that's right (trying to recall from the top of my head, it's been months - someone pls correct if wrong..).

When you say how to fix portrait, what do you mean exactly? You want your app to always be fixed in portrait mode, or you want to be able to switch between portrait and landscape? The first is slightly easier as you can design your UI form in Qt Creator to be vertically designed and then fix the orientation of the application so the UI is always displayed in portrait. The other way, being able to move between the two depending on how the phone is held, will probably require some extra work with layouts etc.

marxian 2011-06-13 17:40

Re: [WIP] Simpsons sound app
 
I downloaded the source code and I'm having a play with it atm. I noticed a few typos in the farts dictionary. ;) I'll post some changes here later. :)

marxian 2011-06-13 19:08

Re: [WIP] Simpsons sound app
 
1 Attachment(s)
OK. I made a few changes to the source code:

1. Changed the .wav file paths to relative paths, e.g sounds/example.wav.
2. Corrected some typos in the 'sounds' dictionary (renamed from 'farts').
3. Removed status bar (not needed).
4. Added a Homer Simpson icon to the push button.
5. Implemented auto-rotation.
6. Set application name to 'Simpson Sounds'. Volume can now be changed using the hardware volume controls.

http://img38.imageshack.us/img38/3042/screenshot96w.png

http://img808.imageshack.us/img808/1...eenshot87t.png

I have attached the modified source code and icon. :)

robin92 2011-06-13 21:25

Re: [WIP] Simpsons sound app
 
Quote:

Originally Posted by marxian (Post 1028415)
OK. I made a few changes to the source code:

1. Changed the .wav file paths to relative paths, e.g sounds/example.wav.
2. Corrected some typos in the 'sounds' dictionary (renamed from 'farts').
3. Removed status bar (not needed).
4. Added a Homer Simpson icon to the push button.
5. Implemented auto-rotation.
6. Set application name to 'Simpson Sounds'. Volume can now be changed using the hardware volume controls.

http://img38.imageshack.us/img38/3042/screenshot96w.png

http://img808.imageshack.us/img808/1...eenshot87t.png

I have attached the modified source code and icon. :)

Thanks you are best :) Can you learn my little about pyqt or you have some good guide? :D
You can contact me at R.lundgren92@gmail.com
Cheer :D

marxian 2011-06-13 21:41

Re: [WIP] Simpsons sound app
 
I learned PyQt from this book: http://www.qtrac.eu/pyqtbook.html

However, I would probably recommend learning QML for coding user interfaces, at least for mobile platforms. You can still use PyQt for the backend stuff, although for something like Simpson Sounds, it would be just as easy to do everything in QtQuick using JavaScript. I can port your Simpsons Sounds using QtQuick, and post the code here, so you can observe the differences. :)

robin92 2011-06-13 22:02

Re: [WIP] Simpsons sound app
 
Quote:

Originally Posted by marxian (Post 1028471)
I learned PyQt from this book: http://www.qtrac.eu/pyqtbook.html

However, I would probably recommend learning QML for coding user interfaces, at least for mobile platforms. You can still use PyQt for the backend stuff, although for something like Simpson Sounds, it would be just as easy to do everything in QtQuick using JavaScript. I can port your Simpsons Sounds using QtQuick, and post the code here, so you can observe the differences. :)

yea it should be nice:D

Update!
version 0.1-4 in extras-devel

Kevstacey 2011-06-13 22:21

Re: [WIP] Simpsons sound app
 
Quote:

Originally Posted by marxian (Post 1028415)
OK. I made a few changes to the source code:

1. Changed the .wav file paths to relative paths, e.g sounds/example.wav.
2. Corrected some typos in the 'sounds' dictionary (renamed from 'farts').
3. Removed status bar (not needed).
4. Added a Homer Simpson icon to the push button.
5. Implemented auto-rotation.
6. Set application name to 'Simpson Sounds'. Volume can now be changed using the hardware volume controls.

http://img38.imageshack.us/img38/3042/screenshot96w.png

http://img808.imageshack.us/img808/1...eenshot87t.png

I have attached the modified source code and icon. :)

is this now in extras? cheers :D


All times are GMT. The time now is 00:22.

vBulletin® Version 3.8.8