maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] ProfilesX (more profiles) (https://talk.maemo.org/showthread.php?t=50266)

nicolai 2010-04-17 12:01

[Announce] ProfilesX (more profiles)
 
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

F2thaK 2010-04-17 12:23

Re: [Announce] ProfilesX (more profiles)
 
thanks !!!!! testing

edit: for me youve made tweakr obsolete and brought powatool back from obsolesence

only thing id like is to be able to change profile order

thanks
great app!!!!!!

raverpol 2010-04-17 13:00

Re: [Announce] ProfilesX (more profiles)
 
nice appl but for me usless until it could cooperate with time scheduling of created profiles.

F2thaK 2010-04-17 13:02

Re: [Announce] ProfilesX (more profiles)
 
you can already schedule profiles with tweakr and alarmed.. this will work with alarmed and maybe silencer

raverpol 2010-04-17 13:05

Re: [Announce] ProfilesX (more profiles)
 
with alrmed I can see only profiles I created with tweakr. would be nice not to have tweakr profiles and "original" profiles and could manage them with alarmed f.e.

F2thaK 2010-04-17 13:20

Re: [Announce] ProfilesX (more profiles)
 
well ses and silencer dont work with these profiles, so im switching back to the good ol' tweakr and alarmed (which works even with alarmed not fully installed)

and you can only see profiles made by tweakr because theres no other way to make them! and anyway, 2 of the 3 default profiles that show in tweakr are original nokia ones...

F2thaK 2010-04-17 13:24

Re: [Announce] ProfilesX (more profiles)
 
i will use it when i can use the alarmed GUI again, i love the icon part of this app!!

qwerty12 2010-04-17 13:25

Re: [Announce] ProfilesX (more profiles)
 
It doesn't need a D-Bus interface. From the first post:

Quote:

Originally Posted by nicolai (Post 614638)
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.

http://wiki.maemo.org/Phone_control#Set_General

@nicolai

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...

F2thaK 2010-04-17 13:32

Re: [Announce] ProfilesX (more profiles)
 
not sure what youre getting at but I dont have a use for this app atm as I already have a working setup, being scheduled timed custom profiles with tweakr and alarmed.

but ATM alarmed wont install due to pr1.2 dependency issues.. but even without it installed, my already set timed profile setup works!!

:D

once we get pr1.2 I can install alarmed and this and change my profiles to profilesx ones..

zimon 2010-04-17 13:42

Re: [Announce] ProfilesX (more profiles)
 
What are the correct dbus commands to change profile for example if the profile name is "mytest"?

efekt 2010-04-17 13:48

Re: [Announce] ProfilesX (more profiles)
 
Holy moly! Thanks a bunch man! this is awesome - I can finally arrange my profiles like I'm used to :)

DaSilva 2010-04-17 13:58

Re: [Announce] ProfilesX (more profiles)
 
Quote:

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 2010-04-17 16:40

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by qwerty12 (Post 614728)
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

rooted 2010-04-17 17:20

Re: [Announce] ProfilesX (more profiles)
 
To all of you that have problem with not being able to schedule profilex's profiles. It is possible with fcron.

nicolai 2010-04-17 21:37

Re: [Announce] ProfilesX (more profiles)
 
@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 2010-04-17 22:53

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by nicolai (Post 615270)
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":
Quote:

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:
Quote:

[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 :)

Quote:

Originally Posted by nicolai (Post 615270)
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 :)

Foxer 2010-04-18 00:39

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by nicolai (Post 614638)
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

saxen 2010-04-18 13:00

Re: [Announce] ProfilesX (more profiles)
 
when i try to add new profile which name has a " "(blank space) it doen't work :(

Foxer 2010-04-18 13:42

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by saxen (Post 616043)
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?

saxen 2010-04-18 14:24

Re: [Announce] ProfilesX (more profiles)
 
yep, that's what i meant! ;)

rooted 2010-04-18 14:43

Re: [Announce] ProfilesX (more profiles)
 
Oh, come on. :) You have a Linux device. Use underscores (_). :D

saxen 2010-04-18 15:47

Re: [Announce] ProfilesX (more profiles)
 
ahahah u are right! to be honest, i think i'll never use a two words name!!
i used "new profile" to make some screenshots, that's how i've found it! :P

msand83 2010-04-20 12:19

Re: [Announce] ProfilesX (more profiles)
 
Thank you!
When I click the task bar I have two Profile buttons, one with the standards silent and general and one with silent, general and my custom profiles.
Can I hide the standard profile button?

Foxer 2010-04-20 13:44

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by msand83 (Post 619251)
Thank you!
When I click the task bar I have two Profile buttons, one with the standards silent and general and one with silent, general and my custom profiles.
Can I hide the standard profile button?

What u need to do, i think, is uninstall "tweakr". That solved it for me.

I also have a question: in control pannel, did the ProfileX icon replace the standard profiles icon? Or are they both there?

zimon 2010-04-20 13:47

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by zimon (Post 614750)
What are the correct dbus commands to change profile for example if the profile name is "mytest"?

No answer to this yet.

So is ProfileX profiles changable by DBUS or other CLI commands, so alarmd could change profiles?

nicolai 2010-04-20 13:59

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by zimon (Post 619385)
No answer to this yet.

So is ProfileX profiles changable by DBUS or other CLI commands, so alarmd could change profiles?

http://wiki.maemo.org/Phone_control#Profiles

New profiles created with profilesx can be used just like
"silent" and "general".

nicolai

nicolai 2010-04-20 14:07

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by msand83 (Post 619251)
Thank you!
When I click the task bar I have two Profile buttons, one with the standards silent and general and one with silent, general and my custom profiles.
Can I hide the standard profile button?

You can (if you know what you do) move
/usr/share/applications/hildon-status-menu/status-area-profiles.desktop
away, for example move it to your MyDocs folder.
Than the built-in profiles button disappears.

Quote:

Originally Posted by Foxer (Post 619380)
What u need to do, i think, is uninstall "tweakr". That solved it for me.

I also have a question: in control pannel, did the ProfileX icon replace the standard profiles icon? Or are they both there?

No, ProfilesX does not replace the default icon. If you wish to
get rid off it, do the same like above with
/usr/share/applications/hildon-control-panel/cpprofiles.desktop

nicolai

ffarber 2010-04-20 14:54

Re: [Announce] ProfilesX (more profiles)
 
If you want to remove the standard profiles section on the task bar wouldn't it just be better to comment out (or remove) the section of

/etc/hildon-desktop/status-menu.plugins

that starts with

[status-area-applet-profiles.desktop]

there are a total of five lines that would need to be removed/commented out.

You will have to be root to do this.

Fred

P.S. Now I am going to try profilesx.

tzsm98 2010-04-20 17:31

Re: [Announce] ProfilesX (more profiles)
 
I can create a new profile and save it but I do not see the method for activating it. When I click the task bar and use Profile utility the newly saved profile is not listed. When I access profiles from settings I again do not see the newly saved profile. I've rebooted since saving the new profile, which does show in profilesx.

So, how do I make the new profile the active profile?

Foxer 2010-04-20 18:16

Re: [Announce] ProfilesX (more profiles)
 
P.S. @nicolai, Please make profileX suport .aac audio files..
My favorite message tone is a .aac file, and i can't select it :(

ffarber 2010-04-20 18:27

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by tzsm98 (Post 619725)
I can create a new profile and save it but I do not see the method for activating it. When I click the task bar and use Profile utility the newly saved profile is not listed. When I access profiles from settings I again do not see the newly saved profile. I've rebooted since saving the new profile, which does show in profilesx.

So, how do I make the new profile the active profile?

There should be second profiles button on your task bar (you may have to scroll down to see it). The new profile should be there, I have not tried this yet but this is how I understand the program to work.

What I want to know is where the profiles are stored.

Fred

nicolai 2010-04-20 20:20

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by ffarber (Post 619797)
What I want to know is where the profiles are stored.

Fred

There are default values, defined in one of those files in
/etc/profiled/

The user defined settings (or those values which differ from the default) are stored in
/home/user/.profiled/custom.ini

nicolai 2010-04-21 07:27

Re: [Announce] ProfilesX (more profiles)
 
Thank you qwerty12 for this most valuable post
Quote:

Originally Posted by qwerty12 (Post 615336)
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":


So it sets the group to player:


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

nifty


Quote:

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 :)
funny :-)


New Version 0.4.

Can now play sound preview while active profile is "silent"

@Foxer: now you should be able to select aac files as well.
AFAIK mid files aren't supported at all.

@saxen: If you still want to :-), you can name your profile
"new profile". Whitespaces in profile names do work now.
Thank you for finding this bug.

For those who do not know, you can customize the statusbar icon for every single profile.
In the profile editor, push the button beneath the "statusbar icon" label. There, you can choose between
leftmost button -> no icon
next filve buttons show some predefined icons
rightmost button with the folder icon (in the previous version,
this looks like a "image not found" icon), lets you select your own icon.

nicolai

viraptor 2010-04-23 20:18

Re: [Announce] ProfilesX (more profiles)
 
Is there a way to activate vibration only for a specific event? If you added that option to profilex, I would love you forever :D

I want to have the general profile with sound and vibration on everything apart from emails.

Soap77 2010-04-25 11:36

Re: [Announce] ProfilesX (more profiles)
 
[bumb!]
Already thanked you in the first post, but I cannot thank you enough!
This makes other profile tools obsolete.
I used powatools to hide the original profiles icon in the status bar.

I think this was mentioned in the thread; will coming releases have ability to select order of the profiles?


Now I only miss one major thing, and my N900 would be more or less complete:
ability to set ringtones to individual contacts ( or group would do just fine)

Thanx for a GREAT job!

Foxer 2010-04-25 11:42

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by nicolai (Post 620549)
@foxer: Now you should be able to select aac files as well.
Afaik mid files aren't supported at all.

thank you!!!!!!! :D :D :D

Foxer 2010-04-25 11:48

Re: [Announce] ProfilesX (more profiles)
 
P.S. is there any way (at least in the future) that we could have support for .mid ringtones on the N900?

Foxer 2010-04-25 12:20

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by Soap77 (Post 626883)
Now I only miss one major thing, and my N900 would be more or less complete:
ability to set ringtones to individual contacts ( or group would do just fine)

that would be totally sweet!
(that; and the ability to save SMS as "Draft" (+ a propper inbox & outbox) :rolleyes: ) dreaming.. dreaming..

rajil.s 2010-05-12 18:03

Re: [Announce] ProfilesX (more profiles)
 
I have the 0.4 version installed but the status icon do not show up in the status area. This probably because I am able to select the icon in the control panel, but the icon settings are not saved. The profiles reverts back to blank icon.

any idea what could be wrong:

bainsidhe 2010-05-13 06:18

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by rajil.s (Post 655539)
I have the 0.4 version installed but the status icon do not show up in the status area. This probably because I am able to select the icon in the control panel, but the icon settings are not saved. The profiles reverts back to blank icon.

any idea what could be wrong:


I have the same problem as well... at first I thought I was just forgetting to hit Save but I've tried numerous times and all the icons are still blank. Would love an answer to this issue...

But overall, good job on the software!


All times are GMT. The time now is 01:08.

vBulletin® Version 3.8.8