Active Topics

 



Notices


Reply
Thread Tools
Posts: 1,283 | Thanked: 370 times | Joined on Sep 2009 @ South Florida
#31
Originally Posted by fatalsaint View Post
Well.. not really.. it replaced pianobar for you . Pianobar is no longer used.
Thanx! ... crawls off into corner...

 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,356 times | Joined on Sep 2007 @ Looking at y'all and sighing
#32
Originally Posted by fatalsaint View Post
Did you manage to see This??

I was using that in-tandem with the lib_pulseaudio source to work with it. I would expect (though haven't tried it) that if properly imported:

Code:
    self.pa_proplist_p = pa_proplist_new()
    self.set_proplist({
        "window.name":          self.client_name,
        "media.name":           self.client_name,
        "application.name":     self.client_name
    })

    #self.pa_context_p = pa_context_new_with_proplist(
    #                            self.pa_mainloop_api_p,
    #                            self.client_name)
    self.pa_context_p = pa_context_new_with_proplist(
                                self.pa_mainloop_api_p,
                                self.client_name,
                                self.pa_proplist_p)
The self.pa_context_p would be a proper type to what the set_properties needs? Is this not the case?
Figured it out...

Grab http://gnome-pulse-applet.googlecode...inloop_glib.py

In your program:

Code:
import ctypes
import libpulse_mainloop_glib

gobject_lib = CDLL("libgobject-2.0.so.0")

self.pulsesink = gst.element_factory_make("pulsesink", "someshit")
self.player = gst.element_factory_make("playbin2", "player")

proplist = libpulse_mainloop_glib.pa_proplist_new()
libpulse_mainloop_glib.pa_proplist_sets (proplist, "event.id", "ringtone-preview")
gobject_lib.g_object_set(ctypes.c_void_p(ctypes.hash(self.pulsesink)), "proplist", proplist, None)
self.player.set_property("audio-sink", self.pulsesink)
 

The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 3,428 | Thanked: 2,855 times | Joined on Jul 2008
#33
Im getting an AttributeError "module" object has no attribute "hash"
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,356 times | Joined on Sep 2007 @ Looking at y'all and sighing
#34
Originally Posted by fatalsaint View Post
Im getting an AttributeError "module" object has no attribute "hash"
Sorry, that was a quick rip - look at my attachment here: https://bugs.maemo.org/show_bug.cgi?id=6694#c35

Oh, I forgot to use the pa_proplist_free function that I defined

Please do so after calling g_object_set

Last edited by qwerty12; 2010-06-15 at 17:21.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#35
Originally Posted by fatalsaint View Post
I mean.. I do have to agree that I find it a bit silly that people expect sound to play when the phone is on "Silent"... to me "Silent" means just that.. Silence. I find it odd that even the built-in player gets around the Silent profile.
I think the discussion early in that bug report gives the most reasonable interpretation of "Silent" profile: it suppresses communications event notifications i.e. makes the phone into a PDA for a while. This is the most useful interpretation to me, and i suspect many others. If i want an app i'm running to be quiet, i'll turn down the volume down, but if i want to get sound and not be interrupted at any point by an SMS or ringer, the silent profile is what i'd use.

I personally don't care what approach you take; a one-line fix that has a few disadvantages (but no side effects) to a 5+ hour approach is fine by me.

Thanks for addressing this.
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful
 

The Following 2 Users Say Thank You to Flandry For This Useful Post:
Posts: 3,428 | Thanked: 2,855 times | Joined on Jul 2008
#36
Originally Posted by qwerty12 View Post
Sorry, that was a quick rip - look at my attachment here: https://bugs.maemo.org/show_bug.cgi?id=6694#c35

Oh, I forgot to use the pa_proplist_free function that I defined

Please do so after calling g_object_set
Ok, just didn't need the "ctypes.hash" in your snippet.. just hash().

Sometimes... I still have the problem of audio blips when locking the screen with the lock slider on the right though (far less though..)

Thanks for the help qwerty! I'll add your attachment code to my radio player.. currently I had built my own pulse.py with just the functions we needed like you did and was importing that.

Soo ugly though... why can't they make this easier.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
Posts: 3,428 | Thanked: 2,855 times | Joined on Jul 2008
#37
Ok, I got home and fired this up to actually code it properly into my app (instead of the hack job I did on my N900 at work).. and this had me busting out laughing:

Code:
#**** to appease Maemo's stupid-*** Policy system added by Faheem Pervez
qwerty, you are awesome. lol.

ETA: Just letting you know, I'm keeping that in my code!
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-06-15 at 22:42.
 

The Following User Says Thank You to fatalsaint For This Useful Post:
Posts: 3,428 | Thanked: 2,855 times | Joined on Jul 2008
#38
Originally Posted by qwerty12 View Post
Oh, I forgot to use the pa_proplist_free function that I defined

Please do so after calling g_object_set
I have a problem.... if I add the pa_proplist_free(proplist).. I get a segfault.

Is this why you struck it out? Works fine if I don't add that.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,356 times | Joined on Sep 2007 @ Looking at y'all and sighing
#39
Originally Posted by fatalsaint View Post
I have a problem.... if I add the pa_proplist_free(proplist).. I get a segfault.

Is this why you struck it out? Works fine if I don't add that.
Yeah, I was working from memory and thought it was making a copy, but I looked again and... it doesn't. It'll get freed anyway when pulsesink's ref count gets dropped to 0 as pa_proplist_free is invoked in the finalize function.
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 3,428 | Thanked: 2,855 times | Joined on Jul 2008
#40
Originally Posted by Flandry View Post
Thanks for addressing this.
OK, Merry Christmas Flandry. PR1.3 in the repo's (I suddenly like my apps initials..)
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
Reply

Tags
bad tags, good tags, pyradio

Thread Tools

 
Forum Jump


All times are GMT. The time now is 21:09.