bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=423e26cb8e3a1de30f603f6c854a988e030bd002

commit 423e26cb8e3a1de30f603f6c854a988e030bd002
Author: Marcel Hollerbach <mar...@osg.samsung.com>
Date:   Wed Sep 2 16:08:55 2020 +0200

    music-player: also support constant play and constant pause
    
    this is usefull if you have the buttons for it.
---
 src/modules/music-control/e_mod_main.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/modules/music-control/e_mod_main.c 
b/src/modules/music-control/e_mod_main.c
index ba9ea22db..201a31c90 100644
--- a/src/modules/music-control/e_mod_main.c
+++ b/src/modules/music-control/e_mod_main.c
@@ -62,18 +62,26 @@ _music_control(E_Object *obj EINA_UNUSED, const char 
*params)
    EINA_SAFETY_ON_NULL_RETURN(music_control_mod->data);
    EINA_SAFETY_ON_NULL_RETURN(params);
 
-   if (!strcmp(params, "play"))
+   if (!strcmp(params, "play")) //legacy compatibility - this should probebly 
be called playpause
      media_player2_player_play_pause_call(ctxt->mpris2_player);
    else if (!strcmp(params, "next"))
      media_player2_player_next_call(ctxt->mpris2_player);
    else if (!strcmp(params, "previous"))
      media_player2_player_previous_call(ctxt->mpris2_player);
+   else if (!strcmp(params, "pause"))
+     media_player2_player_pause_call(ctxt->mpris2_player);
+   else if (!strcmp(params, "play_music")) //the name play was already taken 
by play pause, see above
+     media_player2_player_play_call(ctxt->mpris2_player);
 }
 
 #define ACTION_NEXT "next_music"
 #define ACTION_NEXT_NAME "Next Music"
 #define ACTION_PLAY_PAUSE "playpause_music"
 #define ACTION_PLAY_PAUSE_NAME "Play/Pause Music"
+#define ACTION_PAUSE "pause_music"
+#define ACTION_PAUSE_NAME "Pause Music"
+#define ACTION_PLAY "play_music"
+#define ACTION_PLAY_NAME "Play Music"
 #define ACTION_PREVIOUS "previous_music"
 #define ACTION_PREVIOUS_NAME "Previous Music"
 
@@ -91,6 +99,14 @@ _actions_register(E_Music_Control_Module_Context *ctxt)
    action->func.go = _music_control;
    e_action_predef_name_set(_e_music_control_Name, ACTION_PLAY_PAUSE_NAME,
                             ACTION_PLAY_PAUSE, "play", NULL, 0);
+   action = e_action_add(ACTION_PAUSE);
+   action->func.go = _music_control;
+   e_action_predef_name_set(_e_music_control_Name, ACTION_PAUSE_NAME,
+                            ACTION_PAUSE, "pause", NULL, 0);
+   action = e_action_add(ACTION_PLAY);
+   action->func.go = _music_control;
+   e_action_predef_name_set(_e_music_control_Name, ACTION_PLAY_NAME,
+                            ACTION_PLAY, "play_music", NULL, 0);
    action = e_action_add(ACTION_PREVIOUS);
    action->func.go = _music_control;
    e_action_predef_name_set(_e_music_control_Name, ACTION_PREVIOUS_NAME,

-- 


Reply via email to