[xiph-commits] r11086 - in trunk/maemo/OggPlay: . src

mgrimme at svn.xiph.org mgrimme at svn.xiph.org
Sun Apr 2 10:39:12 PDT 2006


Author: mgrimme
Date: 2006-04-02 10:39:07 -0700 (Sun, 02 Apr 2006)
New Revision: 11086

Modified:
   trunk/maemo/OggPlay/ChangeLog
   trunk/maemo/OggPlay/src/gui.c
   trunk/maemo/OggPlay/src/main.c
   trunk/maemo/OggPlay/src/playlist.c
   trunk/maemo/OggPlay/src/playlist.h
Log:
start playing when loading the first title into the playlist

Modified: trunk/maemo/OggPlay/ChangeLog
===================================================================
--- trunk/maemo/OggPlay/ChangeLog	2006-04-02 17:17:20 UTC (rev 11085)
+++ trunk/maemo/OggPlay/ChangeLog	2006-04-02 17:39:07 UTC (rev 11086)
@@ -1,5 +1,8 @@
 2006-04-02  Martin Grimme  <martin.grimme at lintegra.de>
 
+	* src/main.c: Start playing when loading the first title into the
+	playlist.
+
 	* src/gui.c: Added button for clearing the playlist.
 
 2006-04-02  Martin Grimme  <martin.grimme at lintegra.de>

Modified: trunk/maemo/OggPlay/src/gui.c
===================================================================
--- trunk/maemo/OggPlay/src/gui.c	2006-04-02 17:17:20 UTC (rev 11085)
+++ trunk/maemo/OggPlay/src/gui.c	2006-04-02 17:39:07 UTC (rev 11086)
@@ -185,6 +185,7 @@
   GtkWidget *toolbar;
   GtkToolItem *tb_open;
   GtkToolItem *tb_clear;
+  GtkToolItem *tb_sep;
   GtkToolItem *tb_prev;
   GtkToolItem *tb_next;
   GtkToolItem *tb_play;
@@ -192,6 +193,7 @@
   GtkToolItem *tb_seekbar;
   GtkToolItem *tb_timelabel;
 
+
   gui->coverpath = g_strdup("");
 
   gui->appwindow = HILDON_APP(hildon_app_new());
@@ -246,12 +248,13 @@
 
   tb_open = gtk_tool_button_new_from_stock(GTK_STOCK_ADD);
   tb_clear = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR);
+  tb_sep = gtk_separator_tool_item_new();
   gui->tb_play = gtk_tool_button_new_from_stock(GTK_STOCK_MEDIA_PLAY);
   tb_stop = gtk_tool_button_new_from_stock(GTK_STOCK_MEDIA_STOP);
 
   gui->seekbar = hildon_seekbar_new();
-  gtk_widget_set_size_request(gui->seekbar, 210, -1);
   tb_seekbar = gtk_tool_item_new();
+  gtk_tool_item_set_expand(tb_seekbar, TRUE);
   gtk_container_add(GTK_CONTAINER(tb_seekbar), gui->seekbar);
 
   gui->timelabel = gtk_label_new("");
@@ -260,6 +263,7 @@
 
   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tb_open, -1);
   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tb_clear, -1);
+  gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tb_sep, -1);
   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tb_prev, -1);
   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), gui->tb_play, -1);
   gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tb_stop, -1);
@@ -402,8 +406,8 @@
   total /= 60;
   tmins = total;
 
-  time = g_strdup_printf("   %2d:%02d / %2d:%02d", mins, secs, tmins, tsecs);
-  gtk_label_set_text(GTK_LABEL(gui->timelabel), time);
+  time = g_strdup_printf("<tt> %2d:%02d / %2d:%02d</tt>", mins, secs, tmins, tsecs);
+  gtk_label_set_markup(GTK_LABEL(gui->timelabel), time);
   g_free(time);
 
 }

Modified: trunk/maemo/OggPlay/src/main.c
===================================================================
--- trunk/maemo/OggPlay/src/main.c	2006-04-02 17:17:20 UTC (rev 11085)
+++ trunk/maemo/OggPlay/src/main.c	2006-04-02 17:39:07 UTC (rev 11086)
@@ -180,9 +180,10 @@
   for (iter = filenames; iter != NULL; iter = iter->next) {
     playlist_append(appdata->playlist, (char *) iter->data);
   }
-  
-  //open_uri(appdata, uri);
 
+  if (playlist_get_length(appdata->playlist) == 1)
+    playlist_jump_to(appdata->playlist, 0);
+
 }
 
 

Modified: trunk/maemo/OggPlay/src/playlist.c
===================================================================
--- trunk/maemo/OggPlay/src/playlist.c	2006-04-02 17:17:20 UTC (rev 11085)
+++ trunk/maemo/OggPlay/src/playlist.c	2006-04-02 17:39:07 UTC (rev 11086)
@@ -45,6 +45,13 @@
 }
 
 
+int
+playlist_get_length(Playlist *pl) {
+
+  return pl->list->len;
+
+}
+
 void
 playlist_clear(Playlist *pl) {
 

Modified: trunk/maemo/OggPlay/src/playlist.h
===================================================================
--- trunk/maemo/OggPlay/src/playlist.h	2006-04-02 17:17:20 UTC (rev 11085)
+++ trunk/maemo/OggPlay/src/playlist.h	2006-04-02 17:39:07 UTC (rev 11086)
@@ -46,6 +46,7 @@
 Playlist *playlist_new();
 void playlist_free(Playlist *pl);
 void playlist_clear(Playlist *pl);
+int playlist_get_length(Playlist *pl);
 void playlist_append(Playlist *pl, const char *uri);
 void playlist_previous(Playlist *pl);
 void playlist_next(Playlist *pl);



More information about the commits mailing list