Enlightenment CVS committal

Author  : lok
Project : e17
Module  : apps/emphasis

Dir     : e17/apps/emphasis/src/bin


Modified Files:
        emphasis_callbacks.c 


Log Message:
Callback added on Ctrl-R to select a random row in the mlib tree.
Callback added on Reurn to add the selection in the playlist.

===================================================================
RCS file: /cvs/e/e17/apps/emphasis/src/bin/emphasis_callbacks.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- emphasis_callbacks.c        30 Dec 2006 13:46:38 -0000      1.14
+++ emphasis_callbacks.c        10 Jan 2007 01:12:53 -0000      1.15
@@ -1,6 +1,7 @@
 #include "emphasis.h"
 #include "emphasis_callbacks.h"
 #include <ctype.h>
+#define xrand(min, max) (rand() % (max - min)) + min + 1
 
 /* TODO : update doc */
 /**
@@ -672,6 +673,20 @@
 
       return;
     }
+  if (!strcmp(event->key, "r")
+      && event->modifiers == ETK_MODIFIER_CTRL)
+    {
+      int i, r;
+      r = xrand(0, etk_tree_num_rows_get(tree));
+      row = etk_tree_first_row_get(tree);
+      for (i=0; i<r; i++)
+        {
+          row = etk_tree_next_row_get(row, ETK_FALSE, ETK_FALSE);
+        }
+      etk_tree_row_select(row);
+      etk_tree_row_scroll_to(row, ETK_TRUE);
+      return;
+    }
 
   if (!strcmp(event->key, "Tab")
       || event->modifiers == ETK_MODIFIER_CTRL)
@@ -724,6 +739,12 @@
         }
       else if (!strcmp("Return", event->keyname))
         {
+          Emphasis_Type et;
+
+          et = (Emphasis_Type)etk_object_data_get(object, "Emphasis_Type");
+          emphasis_playlist_append_selected(tree, et);
+          mpc_play_if_stopped();
+          emphasis_tree_mlib_init(player, type);
           etk_tree_col_title_set(col, base_title);
           return;
         }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to