Author: akv
Date: 2013-06-07 23:11:43 +0200 (Fri, 07 Jun 2013)
New Revision: 4408

Modified:
   trunk/src/application.c
   trunk/src/application.h
   trunk/src/rs-actions.c
   trunk/src/ui.xml
Log:
Added very basic slideshow functionality...

Modified: trunk/src/application.c
===================================================================
--- trunk/src/application.c     2013-06-04 19:20:16 UTC (rev 4407)
+++ trunk/src/application.c     2013-06-07 21:11:43 UTC (rev 4408)
@@ -213,6 +213,7 @@
        rs->current_setting = 0;
        rs->signal = MAIN_SIGNAL_NONE;
        rs->enfuse_cache = NULL;
+       rs->slideshow_running = FALSE;
 
        /* Build basic filter chain */
        rs->filter_input = rs_filter_new("RSInputImage16", NULL);

Modified: trunk/src/application.h
===================================================================
--- trunk/src/application.h     2013-06-04 19:20:16 UTC (rev 4407)
+++ trunk/src/application.h     2013-06-07 21:11:43 UTC (rev 4408)
@@ -83,6 +83,7 @@
        RS_MAIN_SIGNAL signal; 
        gchar *post_open_event;
        GHashTable *enfuse_cache;
+       gboolean slideshow_running;
 
        /* These should be moved to a future RS_WINDOW */
        GtkWidget *window;

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c      2013-06-04 19:20:16 UTC (rev 4407)
+++ trunk/src/rs-actions.c      2013-06-07 21:11:43 UTC (rev 4408)
@@ -1074,6 +1074,36 @@
        rs_store_select_prevnext(rs->store, current_filename, 2);
 }
 
+gboolean slideshow_play(RS_BLOB *rs)
+{
+       gchar *current_filename = NULL;
+       
+       if (rs->slideshow_running == FALSE)
+               return FALSE;
+
+       /* Get current filename if a photo is loaded */
+       if (RS_IS_PHOTO(rs->photo))
+               current_filename = rs->photo->filename;
+
+       rs_store_select_prevnext(rs->store, current_filename, 2);
+
+       if (rs_store_get_prevnext(rs->store, current_filename, 2))
+               return TRUE;
+       else
+               return FALSE;
+}
+
+ACTION(play)
+{
+       if (rs->slideshow_running == FALSE)
+               rs->slideshow_running = TRUE;
+       else
+               rs->slideshow_running = FALSE;
+
+       if (rs->slideshow_running)
+               g_timeout_add(5000, (GSourceFunc) slideshow_play, rs);
+}
+
 TOGGLEACTION(zoom_to_fit)
 {
        rs_preview_widget_set_zoom_to_fit(RS_PREVIEW_WIDGET(rs->preview), 
gtk_toggle_action_get_active(toggleaction));
@@ -1839,6 +1869,7 @@
        /* View menu */
        { "PreviousPhoto", GTK_STOCK_GO_BACK, _("_Previous Photo"), 
"<control>Left", NULL, ACTION_CB(previous_photo) },
        { "NextPhoto", GTK_STOCK_GO_FORWARD, _("_Next Photo"), 
"<control>Right", NULL, ACTION_CB(next_photo) },
+       { "Play", GTK_STOCK_MEDIA_PLAY, _("_Play/Stop"), "<control>P", NULL, 
ACTION_CB(play) },
        { "LensDbEditor", NULL, _("_Lens Library"), "<control>L", NULL, 
ACTION_CB(lens_db_editor) },
        { "TetheredShooting", NULL, _("_Tethered Shooting"), "F9", NULL, 
ACTION_CB(tethered_shooting) },
        

Modified: trunk/src/ui.xml
===================================================================
--- trunk/src/ui.xml    2013-06-04 19:20:16 UTC (rev 4407)
+++ trunk/src/ui.xml    2013-06-07 21:11:43 UTC (rev 4408)
@@ -49,6 +49,7 @@
   <menu action="ViewMenu">
    <menuitem action="PreviousPhoto" />
    <menuitem action="NextPhoto" />
+   <menuitem action="Play" />
    <menu action="SortByMenu">
     <menuitem action="SortByName" />
     <menuitem action="SortByTimestamp" />


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to