Notices


Reply
Thread Tools
efekt's Avatar
Posts: 422 | Thanked: 320 times | Joined on Oct 2009 @ Israel
#11
Holy moly! Thanks a bunch man! this is awesome - I can finally arrange my profiles like I'm used to
 
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#12
You can not use the power button menu two change between the
profiles if the current profile is not one of the two predefined
Is it possible to fix this in the future?
I always change the profile with the power button...
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#13
Originally Posted by qwerty12 View Post
Sounds playing in Silent profile (w/out modifying policy file which won't work in this case) require voodoo with PulseAudio and properties... If I figure it out, I'll post something up...
Oh, yeah, baby!

PHP Code:
#include <gst/gst.h>
#include <pulse/pulseaudio.h>
#include <pulse/glib-mainloop.h>

#define FDFDFDF "/home/user/MyDocs/.sounds/three 6 mafia - sippin on syrup pt 2 + camron, bun b, diplomats (hosted by bubba sparxxx).mp3"

static GMainLoop *loop;
static 
GstElement *sound_player, *pulsesink;

int main (void)
{
  
gst_init(NULLNULL);

  
loop g_main_loop_new (NULLFALSE);
  
//pa_glib_mainloop *pa_mainloop = pa_glib_mainloop_new (g_main_context_default ());
  //pa_mainloop_api  *pa_api = pa_glib_mainloop_get_api (pa_mainloop);
  
pa_proplist     *proplist pa_proplist_new ();
        
/* pa_proplist_sets (proplist,
                          PA_PROP_APPLICATION_NAME,
                          "maemo-applet-profiles");
        pa_proplist_sets (proplist,
                          PA_PROP_APPLICATION_ID,
                          "org.maemo.HildonNotify");
        pa_proplist_sets (proplist,
                          PA_PROP_APPLICATION_VERSION,
                          "0.50"); */
        
pa_proplist_sets (proplist,
                          
PA_PROP_EVENT_ID,
                          
"ringtone-preview");
        
pa_proplist_sets (proplist,
                          
"module-stream-restore.id",
                          
"x-maemo-applet-profiles");
  
//pa_context *pa_context = pa_context_new_with_proplist (pa_api, NULL, proplist);

  //pa_context_connect (pa_context, NULL, (pa_context_flags_t) PA_CONTEXT_NOFAIL, NULL);


  
sound_player gst_element_factory_make("playbin2""Media Player");
  
pulsesink gst_element_factory_make ("pulsesink"NULL);
  
g_object_set (G_OBJECT (pulsesink), "proplist"proplistNULL);
  
g_printerr ("%s\n"G_STRLOC);
  
//pa_proplist_free (proplist);

  
g_object_set(sound_player"audio-sink"pulsesink"uri"g_filename_to_uri(FDFDFDFNULLNULL), NULL);
  
gst_element_set_state(sound_playerGST_STATE_NULL);
  
gst_element_set_state(sound_playerGST_STATE_PLAYING);

  
g_timeout_add_seconds (10, (GSourceFuncg_main_loop_quitloop);
  
g_main_loop_run (loop);

  return 
0;

This is shitty, shitty code but the things to take care of from here:
* Set the event.id and module-stream-restore.id properties
* Create a "pulsesink"
* Set the "proplist" property of the pulsesink to property list created
* Set the "audio-sink" property of your playbin2 sink to the newly created pulsesink
 

The Following 7 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 156 | Thanked: 90 times | Joined on Jan 2010
#14
To all of you that have problem with not being able to schedule profilex's profiles. It is possible with fcron.
 

The Following 3 Users Say Thank You to rooted For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#15
@qwerty12
This is great, qwerty12. Any chance you can explain what are
these properties and why do you know this :-)

btw, I just realized the status-menu icons aren't there until
you reboot your device.
I call gtk-update-iconcache in the install script, but it doesn't work.
Is there another way to make new icons visible without reboot?

nicolai
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#16
Originally Posted by nicolai View Post
This is great, qwerty12. Any chance you can explain what are
these properties and why do you know this :-)
What are the properties? Well...

Event.id: http://0pointer.de/lennart/projects/...c10c01426a4fec

The reason why this one is special is because the Policy system will react to the event.id being set to "ringtone-preview":
Originally Posted by /usr/share/policy/etc/current/pulse/xpolicy.conf
[stream]
property = event.id@equals:"ringtone-preview"
group = player
So it sets the group to player:
[group]
name = player
flags = limit_volume, cork_stream
sink = sink.music
source = source.voice.raw
The player group is special because it lets you play sounds in the Silent profile. The Media Player also uses this group (search "mafw-dbus-wrapper" in the policy conf).

The media-stream-restore one? NFI. It's not needed to play sounds in Silent mode as is evidenced by the policy config. I also suspect it's rather useless without pa_ext_stream_restore2_write ()

How did I find out about the playbin2 stuff?

It was libcanberra that introduced me to properties. I found out that hildon_play_system_sound () (http://maemo.org/api_refs/5.0/5.0-fi...y-system-sound) would play sounds in Silent mode. Grabbed the libhildon source and the libcanberra source and looked at libcanberra's set of Maemo patches.

Heh, all that said, it finally came down to: strings, IDA Pro, http://meego.gitorious.org/maemo-mul...ode=sidebyside and /usr/lib/hildon-control-panel/libcpprofiles.so

https://bugs.maemo.org/show_bug.cgi?id=6694 is a fun read with me adding some entertainment by getting pissed off at Nokia's lack of communication

Originally Posted by nicolai View Post
btw, I just realized the status-menu icons aren't there until
you reboot your device.
I call gtk-update-iconcache in the install script, but it doesn't work.
Is there another way to make new icons visible without reboot?
gtk-update-icon-cache is a NOOP in PR 1.1. I have no possible solutions to your problem but I hear PR 1.2 won't have this problem...

Best regards,
Faheem

P.S. This [ProfilesX] really is wonderful stuff. Thanks for adding a feature Nokia wouldn't. I consider it to be a sign of laziness on Nokia's part when they add support for multiple profiles to their backend but not their frontend
 

The Following 6 Users Say Thank You to qwerty12 For This Useful Post:
Posts: 18 | Thanked: 1 time | Joined on Apr 2010 @ Romania
#17
Originally Posted by nicolai View Post
Hello,

I made a replacement for the built-in profile control panel and status menu plugin.
This one let you add and manage more than two profiles.
Unlike tweaker these additional profiles are "real" profiles and not only different settings for the general profile.
That means this profiles are handled by the libprofile and profiled-dbus (com.nokia.profiled) just like the silent and general
profile. For example, they can be selected and changed from other applications through dbus-calls.

It is called profilesx and you can find in in extras-devel.
It is in beta state, all planned features are working, but I have
to cleanup the code.
I am not a gtk-programmer, some parts realy took an amount of time.
I struggled with the ui-design to let it look like the built-in profiles ui.
Feel free to laugh about my silly status menu icons :-)
Any improvements are welcome.
As I am not a native english speaker, maybe someone can help me with the program /package
description.

Some notes:

You can not use the power button menu two change between the
profiles if the current profile is not one of the two predefined.

Sound preview doesn't work if the active profile is the silent profile,
don't know how the built-in settings dialog plays the preview.

regards nicolai

First, I want to THANK YOU for the grate application you made! this was very needed on the N900!
The only problem is that, while being in the Profiles menu, when i browse for a song to select as ring-tone or sms-tone, i discovered that the application can see only .mp3 files. (no .aac , no .mid ,etc..)

Please, can you fix this?
The normal ringtone browser can even see .mid files , even tho they are not supported
 
Posts: 124 | Thanked: 10 times | Joined on Jan 2007 @ Italy
#18
when i try to add new profile which name has a " "(blank space) it doen't work
 
Posts: 18 | Thanked: 1 time | Joined on Apr 2010 @ Romania
#19
Originally Posted by saxen View Post
when i try to add new profile which name has a " "(blank space) it doen't work
i think you mean "with a name made up of two words, with a space between them"... something like "My Profile" or "Profile 1".
Is this correct?
 

The Following User Says Thank You to Foxer For This Useful Post:
Posts: 124 | Thanked: 10 times | Joined on Jan 2007 @ Italy
#20
yep, that's what i meant!
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:24.