maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Is it that simple??? media player control, with d-bus scripts on QBW (https://talk.maemo.org/showthread.php?t=54481)

neboja 2010-05-29 22:57

Is it that simple??? media player control, with d-bus scripts on QBW
 
when I reviewed some d-bus script, I found this one: http://wiki.maemo.org/Phone_control#...rently_playing

dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause

and then I thought that would be helpful if you could with similar scripts to control the music through QBW ...

then only i replaced "pause", with appropriate command ... AND ITWORKS! : D
here's the script:
PLAY:
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.play
PAUSE:
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.pause
STOP:
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop
PREVIOUS:
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.previous
NEXT:
dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.next

and you could rearrange it on your desktop in a manner so it would you be comfortable if you using it with your one hand! :D
great, isn't it?? :)

but now..... it would be cool if i knew a script for Fast Forward.... Rewind.... or best thing it would be if it could skip or go back 5-10 sec.... (if you press a widget for a longer time, it will be shown a "desktop menu"...)
and another thing....: Pause cmd only pauses the song... it won't continue... (play cmd starts from beginning of the song....)

SO PEOPLE... if you could help me with finding a proper scripts (for missing ones), i would be grateful! :)

P.S. and i found a way to make a PHONE APP icon (widget in this case) bigger! ;)
THX No!No!No!Yes! for QBW ;)

neboja 2010-05-30 10:36

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
mmmmm??? any ideas?? :)

qwerty12 2010-05-30 10:47

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by neboja (Post 688890)
but now..... it would be cool if i knew a script for Fast Forward.... Rewind.... or best thing it would be if it could skip or go back 5-10 sec....

Sure.

Code:

dbus-send --print-reply --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.set_position int32:1 int32:5
^ skips by 5 seconds

Code:

dbus-send --print-reply --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.set_position int32:1 int32:-5
^ goes back by 5 seconds

http://maemo.org/api_refs/5.0/5.0-fi...r-set-position explains the meaning of the first int32 argument.

Code:

dbus-send --print-reply --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.get_position
gets the current elapsed time.

neboja 2010-05-30 10:48

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx :) :) :) :) :)

qwerty12 2010-05-30 10:54

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by neboja (Post 688890)
[...]Pause cmd only pauses the song... it won't continue... (play cmd starts from beginning of the song....)

Oh, you want:
Code:

dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.resume
Get current state:
Code:

#!/bin/sh

#Thanks http://www.gossamer-threads.com/lists/maemo/developers/60881
mode=$(dbus-send --print-reply=literal --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.get_status | tr '\n' ' ' | awk '{print $6}')

case $mode in
        0)
        echo "Stopped"
        ;;

        1)
        echo "Playing"
        ;;

        2)
        echo "Paused"
        ;;

        3)
        echo "Transitioning"
        ;;
esac


neboja 2010-05-30 11:52

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
oh.... i found a "resume....
but then i have 2 buttons (widgets) for pause, and resume... could i implement all in one?
and tell me... for what do i need a current state that you provide me above??? THX ;)

hellnick 2010-05-30 13:04

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
This looks good. Would it be possible to rotate the queenbeecon widgets by 90 degrees so that we could have a portrait desktop containing info on various system states, and music controls?

neboja 2010-05-30 13:18

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by hellnick (Post 689762)
This looks good. Would it be possible to rotate the queenbeecon widgets by 90 degrees so that we could have a portrait desktop containing info on various system states, and music controls?

well.... as far as music controls: you can add a image to widget, but only it won't rotate,.... but, you can make her rotate (that is what i am about to do) ;)
and hey... there's a some brainstorming for QBW developers: can they make a rotate output function???? O_o :)

No!No!No!Yes! 2010-05-30 21:55

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by neboja (Post 689782)
well.... as far as music controls: you can add a image to widget, but only it won't rotate,.... but, you can make her rotate (that is what i am about to do) ;)
and hey... there's a some brainstorming for QBW developers: can they make a rotate output function???? O_o :)

Uhm... official QBW thread or relevant WIKI section page could be the right place to ask :D ;)

I'll give it a thought!!!

neboja 2010-05-30 22:42

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Thanks man! ;)

Mike Fr 2010-06-04 23:26

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
@neboja: you mentioned in your first post that you found a way to make a PHONE APP icon (widget in this case) bigger. Could you please advise how? This relates to a brainstorm session I opened

http://talk.maemo.org/showthread.php?t=54919

Thanks in advance.

neboja 2010-06-07 10:40

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by Mike Fr (Post 700327)
@neboja: you mentioned in your first post that you found a way to make a PHONE APP icon (widget in this case) bigger. Could you please advise how? This relates to a brainstorm session I opened

http://talk.maemo.org/showthread.php?t=54919

Thanks in advance.

well it is possible in the way, that you can set a size for QBW...
and that you just put a cmd that lunches a phone. AND you just put a image into it, and there it is...
but check the QBW thread for instructions of how to do that ;)

and the cmd for bringing a phone app you can find on wiki ;)

No!No!No!Yes! 2010-06-07 11:05

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by neboja (Post 703283)
well it is possible in the way, that you can set a size for QBW...
and that you just put a cmd that lunches a phone. AND you just put a image into it, and there it is...
but check the QBW thread for instructions of how to do that ;)

and the cmd for bringing a phone app you can find on wiki ;)

You can run every desktop application with a script like this and just replace the image of the beecon with one of your choice/size:

Code:

dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:"<application name here>"
where <application name here> is application name that you can find in /usr/share/applications/hildon directory w/o trailing .desktop

Example for launching the image viewer:

Code:

/usr/bin/dbus-send --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:image-viewer
some applications might accept extra parameters by adding extra "string:<parameter here>" to the command

Mike Fr 2010-06-07 20:37

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Thanks for all the replies!

IzzehO 2010-06-24 03:20

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Been tweaking around with this a lot and trying to get an all-in-one type thing set up for FM transmitter. Just wondering if anyone knows dbus command to get current song name (if that's at all possible.. and if not.. an alternative way to do it?)

msand83 2010-10-19 10:06

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by IzzehO (Post 727141)
Been tweaking around with this a lot and trying to get an all-in-one type thing set up for FM transmitter. Just wondering if anyone knows dbus command to get current song name (if that's at all possible.. and if not.. an alternative way to do it?)

Did you find out how to do this? I'm also interested in getting the song name for my qbw!

No!No!No!Yes! 2010-10-19 12:03

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by IzzehO (Post 727141)
Been tweaking around with this a lot and trying to get an all-in-one type thing set up for FM transmitter. Just wondering if anyone knows dbus command to get current song name (if that's at all possible.. and if not.. an alternative way to do it?)

Following signal is posted on session DBUS on song change.
Code:

signal sender=:1.44 -> dest=(null destination) serial=562 path=/com/nokia/mafw/renderer/gstrenderer; interface=com.nokia.mafw.renderer; member=media_changed
  int32 0
  string "localtagfs::music/albums/Venezia%2520è%2520un%2520pesce.%2520Una%2520guida./%2Fmedia%2Fmmc1%2Fmusic%2FScarpa%20Tiziano%20-%20Venezia%20è%20un%20pesce%20-%20Una%20guida%2FScarpa%20Tiziano%20-%20Venezia%20è%20un%20pesce%20-%20Una%20guida%20-%2001%20-%20Presentazione.mp3"

You can experiment a bit with QBW DBUS monitor

Not tried myself, though!
Let me know how/if you managed.

kitwalker 2011-02-01 11:21

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Hi, is there a mafw dbus call to just add a new song in the media player? I went though http://wiki.maemo.org/Phone_control but the dbus call mentioned there for "Open file in media player" opens the media player app and plays it as well.
Is there a way to only add a certain song and not invoke the media player and play it?

kitwalker 2011-02-01 11:43

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Ok, I monitored the dbus commands sent by MediaBox.

Apparently there's a play_uri member in the com.nokia.mafw.renderer interface that takes the file path as the argument. Using this, even if the song still plays, the media player doesn't get invoked.

karimko 2011-02-01 12:13

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Sticking to the subject, is there a way to catch (via Dbus) when a phone call ends and a song will resume?

That way we can substitute Headphone Daemon feature. Not that the application is bad or anything but it would be nice to have it in QWB as well (on this occasion thanks to Thomas Perl & No!No!No!Yes! for their apps).

Thanks!

GigaByte 2011-03-31 17:34

Re: Is it that simple??? media player control, with d-bus scripts on QBW
 
Quote:

Originally Posted by msand83 (Post 844900)
Did you find out how to do this? I'm also interested in getting the song name for my qbw!

I want to get the song name too!


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

vBulletin® Version 3.8.8