r3208 - in trunk/src/target/OM-2007.2: applications/openmoko-mediaplayer2 applications/openmoko-mediaplayer2/src artwork/themes/openmoko-standard-2/gtk-2.0 artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer
abraxa at sita.openmoko.org
abraxa at sita.openmoko.org
Wed Oct 17 16:46:35 CEST 2007
Author: abraxa
Date: 2007-10-17 16:46:20 +0200 (Wed, 17 Oct 2007)
New Revision: 3208
Added:
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand_placeholder.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white_down.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/button_box.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame_placeholder.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_expand.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_ffwd_next.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_pause.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_play.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_preferences.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_all.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_current.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_off.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_once.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_rew_prev.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_off.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_on.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_time.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_track.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_00.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_01.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_02.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_03.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_04.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_05.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_06.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_07.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_08.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_09.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_10.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/no_cover.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_background.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_bar.png
trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/openmoko-mediaplayer
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/README
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/TODO
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/files_page.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.h
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.c
trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.h
Log:
Remove remainders of the EQ (won't be implemented for a while, if ever)
Fix memory leak revolving around omp_session_get_file_chooser_path()
Introduce new main UI
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/README
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/README 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/README 2007-10-17 14:46:20 UTC (rev 3208)
@@ -1,3 +1,5 @@
+-- General
+
This is the OpenMoko media player for OM2007.2, enabling you to playback audio
(and eventually video) on your smartphone.
@@ -5,4 +7,30 @@
by default. Please be aware that there are issues still - especially when it
comes to the user interface. They'll be fixed however, so bear with me :)
+-- Theming
+
+I tried to keep things as flexible as possible while not making structures
+too nested to keep performance up. As GTK's theming abilities however are
+crude at best, the following should be noted:
+
+Button pixmap overlays are the size of the button background with one or
+two pixel(s) shaved off on all four sides. I don't know why GTK requires it
+but if both pixmaps have the same size it scales the background.
+
+Also, the white button backgrounds are not symmetrical which means that the
+pixmaps they contain must not be centered - which however is what GTK+ would
+do. To remedy this I could either have used the button's xalign/yalign proper-
+ties (which would be hard-coded in the app) or used customized pixmaps that
+align with the button neatly.
+I decided to use the latter option, even if it means that this prevents me
+from using the stock icons from the openmoko-standard theme. I think being
+more flexible is the higher good compared to having all app icons in a common
+place.
+
+
+If you happen to run into a bug, please use the OpenMoko bugtracker to notify
+me: http://bugzilla.openmoko.org - I'll get back to you as soon as I can.
+
+Enjoy! :)
+
-Soeren
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/TODO
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/TODO 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/TODO 2007-10-17 14:46:20 UTC (rev 3208)
@@ -3,17 +3,18 @@
Make FFWD/REW buttons trigger repeatedly
Make Prev/Next buttons sensitive depending on playlist state
m3u import
- QVGA support through external style definitions
+ QVGA theme
+ Screen aspect ratio awareness to re-adjust UI on rotation
+ Preferences page
Backend:
Use GConf
Use GST_MESSAGE_DURATION and use saved value
Use GST_MESSAGE_BUFFERING
Check for unicode compliance
+ Cover art fetching/caching
Issues:
- Use EQ presets only or allow individual band adjustment?
- How to adjust equalizer?
Reduce call frequency of omp_playback_get_track_length()
Documentation:
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/files_page.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/files_page.c 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/files_page.c 2007-10-17 14:46:20 UTC (rev 3208)
@@ -178,7 +178,6 @@
g_free(temp);
g_error_free(error);
- g_free(path);
return;
}
@@ -220,7 +219,6 @@
} while (TRUE);
g_dir_close(dir);
- g_free(path);
}
/**
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.c 2007-10-17 14:46:20 UTC (rev 3208)
@@ -34,35 +34,6 @@
/**
- * Loads an image from a file into a pixel buffer
- * @return Pixbuf with the image, must be unref'd after use
- */
-GdkPixbuf*
-pixbuf_new_from_file(const gchar *file_name)
-{
- gchar *image_file_name;
- GdkPixbuf *pixbuf = NULL;
- GError *error = NULL;
-
- image_file_name = g_strdup_printf("%s/%s", omp_ui_image_path, file_name);
-
- if(g_file_test(image_file_name, G_FILE_TEST_EXISTS))
- {
- pixbuf = gdk_pixbuf_new_from_file(image_file_name, &error);
- if(!pixbuf)
- {
- g_printerr("File found but failed to load: %s\n", image_file_name);
- g_error_free(error);
- }
- } else {
- g_printerr("Can't find %s\n", image_file_name);
- }
-
- g_free(image_file_name);
- return pixbuf;
-}
-
-/**
* Creates a label with default properties, wraps it up in a GtkAlignment and returns the latter for direct use
* @param label Will be filled with a GtkLabel
* @param font_info The desired font to be used (e.g. "Times 10")
@@ -104,27 +75,55 @@
}
/**
- * Creates a button containing an image
- * @param image_name Path and file name of the image to use
+ * Loads an image from a file into a pixel buffer
+ * @return Pixbuf with the image, must be unref'd after use
+ */
+GdkPixbuf*
+pixbuf_new_from_file(const gchar *file_name)
+{
+ gchar *image_file_name;
+ GdkPixbuf *pixbuf = NULL;
+ GError *error = NULL;
+
+ image_file_name = g_strdup_printf("%s/%s", omp_ui_image_path, file_name);
+
+ if(g_file_test(image_file_name, G_FILE_TEST_EXISTS))
+ {
+ pixbuf = gdk_pixbuf_new_from_file(image_file_name, &error);
+ if(!pixbuf)
+ {
+ g_printerr("File found but failed to load: %s\n", image_file_name);
+ g_error_free(error);
+ }
+ } else {
+ g_printerr("Can't find %s\n", image_file_name);
+ }
+
+ g_free(image_file_name);
+ return pixbuf;
+}
+
+/**
+ * Creates a button containing a stock image
+ * @param widget_name Name to set for the button and image widgets
+ * @param image_name Name of the stock image to use
* @param image Destination for the image's handle (can be NULL)
* @param callback Callback to set
* @return The button
*/
GtkWidget *
-button_create_with_image(gchar *image_name, GtkWidget **image, GCallback callback)
+button_create_with_image(gchar *widget_name, gchar *image_name, GtkWidget **image, GCallback callback)
{
GtkWidget *btn_image, *button;
- gchar *image_file_name;
button = gtk_button_new();
+ gtk_widget_set_name(GTK_WIDGET(button), widget_name);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(callback), NULL);
GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_CAN_FOCUS);
-// g_object_set(G_OBJECT(*button), "xalign", (gfloat)0.37, "yalign", (gfloat)0.37, NULL);
-
- image_file_name = g_build_path("/", omp_ui_image_path, image_name, NULL);
- btn_image = gtk_image_new_from_file(image_file_name);
- g_free(image_file_name);
+ btn_image = gtk_image_new();
+ gtk_widget_set_name(GTK_WIDGET(btn_image), widget_name);
+ gtk_image_set_from_stock(GTK_IMAGE(btn_image), image_name, -1);
gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(btn_image));
if (image) *image = btn_image;
@@ -133,6 +132,25 @@
}
/**
+ * Wraps a widget in an invisible GtkFrame so the widget can be padded using x/ythickness in the frame's style
+ * @param widget Widget to be put inside the frame
+ * @param name Name to assign to the frame, uses the widget's name if NULL
+ * @return Frame containing the widget
+ */
+GtkWidget *
+widget_wrap(GtkWidget *widget, gchar *name)
+{
+ GtkWidget *frame;
+
+ frame = gtk_frame_new(NULL);
+ gtk_widget_set_name(GTK_WIDGET(frame), (name) ? name : gtk_widget_get_name(widget));
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
+ gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(widget));
+
+ return frame;
+}
+
+/**
* Presents a simple non-modal error dialog to the user
*/
void
@@ -166,7 +184,7 @@
// We don't want a title of "<unnamed>"
gtk_window_set_title(GTK_WINDOW(dialog), " ");
- gtk_dialog_run(dialog);
+ gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/guitools.h 2007-10-17 14:46:20 UTC (rev 3208)
@@ -37,8 +37,11 @@
GtkWidget *label_create(GtkWidget **label, gchar *font_info, gchar *color_desc,
gfloat xalign, gfloat yalign, gfloat xscale, gfloat yscale, PangoEllipsizeMode ellipsize_mode);
-GtkWidget *button_create_with_image(gchar *image_name, GtkWidget **image, GCallback callback);
+GtkWidget *button_create_with_image(gchar *widget_name, gchar *image_name, GtkWidget **image, GCallback callback);
+
+GtkWidget *widget_wrap(GtkWidget *widget, gchar *name);
+
void error_dialog(gchar *message);
void error_dialog_modal(gchar *message);
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main.c 2007-10-17 14:46:20 UTC (rev 3208)
@@ -208,6 +208,31 @@
}
/**
+ * Determines theme to be used, uses this app's theme file and sets up related UI properties
+ */
+void
+omp_init_theme()
+{
+ gchar *theme_dir, *theme_name, *theme_rc;
+
+ moko_stock_register();
+ omp_ui_image_path = g_build_path("/", DATA_DIR, OMP_RELATIVE_UI_IMAGE_PATH, NULL);
+
+ g_set_application_name(_("Media Player"));
+ gtk_window_set_default_icon_name("openmoko-soundandvideo");
+
+ theme_dir = gtk_rc_get_theme_dir();
+ g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-theme-name", &theme_name, NULL);
+ theme_rc = g_build_filename(theme_dir, "/", theme_name, "/gtk-2.0/openmoko-mediaplayer", NULL);
+
+ gtk_rc_parse(theme_rc);
+
+ g_free(theme_rc);
+ g_free(theme_name);
+ g_free(theme_dir);
+}
+
+/**
* Program termination event triggered by main window
*/
void
@@ -388,13 +413,9 @@
exit(EXIT_FAILURE);
}
- // Initialize various things necessary for the full player UI
- moko_stock_register();
- omp_ui_image_path = g_build_path("/", DATA_DIR, OMP_RELATIVE_UI_IMAGE_PATH, NULL);
-
- g_set_application_name(_("Media Player"));
- gtk_window_set_default_icon_name("openmoko-soundandvideo");
-
+ // Initialize UI theme
+ omp_init_theme();
+
// Set up signal handlers
signal(SIGSEGV, handler_sigsegfault);
signal(SIGUSR1, handler_sigusr1);
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.c 2007-10-17 14:46:20 UTC (rev 3208)
@@ -29,6 +29,7 @@
#endif
#include <glib.h>
+#include <glib/gprintf.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -40,33 +41,30 @@
#include "playback.h"
#include "persistent.h"
+
+
/// Contains all main window widgets that need to be changeable
struct _main_widgets
{
- GtkWidget *title_label;
- GtkWidget *artist_label;
+ GtkWidget *cover_image;
+ GtkWidget *cover_frame;
+ GtkWidget *label1;
+ GtkWidget *label2;
+ GtkWidget *label3;
GtkWidget *track_number_label;
GtkWidget *time_label;
- GtkWidget *time_hscale;
- GtkWidget *band_image[12];
+ GtkWidget *time_bar;
+ GtkWidget *extended_controls;
GtkWidget *volume_image;
- GtkWidget *volume_label;
- GtkWidget *balance_image;
GtkWidget *play_pause_button_image;
GtkWidget *shuffle_button_image;
GtkWidget *repeat_button_image;
- GtkWidget *volume_hscale;
} main_widgets;
GtkWidget *omp_main_window = NULL;
-/// Determines whether the time slider can be updated or not
-gboolean omp_main_time_slider_can_update = TRUE;
-
-/// Is toggled after the user finished dragging the time slider's button
-gboolean omp_main_time_slider_was_dragged = FALSE;
-
// Forward declarations for internal use
+void omp_main_set_label(omp_main_label_type label_type, gchar *caption);
void omp_main_playlist_loaded(gpointer instance, gchar *title, gpointer user_data);
void omp_main_update_track_change(gpointer instance, gpointer user_data);
void omp_main_update_track_info_changed(gpointer instance, guint track_id, gpointer user_data);
@@ -79,98 +77,53 @@
/**
- * Creates a button with a stock pixmap and returns it
- * @param image_name The name of the image resource to use, not a file name
- * @return The button
+ * Event handler for the expand button
*/
-GtkWidget *
-omp_stock_button_create(gchar *image_name, GtkWidget **image, GCallback callback)
+void
+omp_main_expand_clicked(GtkWidget *widget, gpointer data)
{
- GtkWidget *button;
-
- button = gtk_button_new();
- gtk_widget_set_size_request(GTK_WIDGET(button), 66, 66);
- g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(callback), NULL);
- GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_CAN_FOCUS);
-
- g_object_set(G_OBJECT(button), "xalign", (gfloat)0.37, "yalign", (gfloat)0.37, NULL);
-
- *image = gtk_image_new_from_icon_name(image_name, GTK_ICON_SIZE_BUTTON);
- gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(*image));
-
- return button;
+ // Toggle visibility of extended controls
+ if (GTK_WIDGET_VISIBLE(main_widgets.extended_controls))
+ gtk_widget_hide(main_widgets.extended_controls);
+ else
+ gtk_widget_show(main_widgets.extended_controls);
}
/**
- * Gets called when the time slider's value got changed (yes, that means it gets called at least once per second)
+ * Event handler for the Fast Forward button
*/
void
-omp_main_time_slider_changed(GtkRange *range, gpointer data)
+omp_main_fast_forward_clicked(GtkWidget *widget, gpointer data)
{
- if (omp_main_time_slider_was_dragged)
- {
- omp_main_time_slider_was_dragged = FALSE;
-
- // Set new position and resume playback that was paused when dragging started
- omp_playback_set_track_position(gtk_range_get_value(GTK_RANGE(range)));
-
- // Update UI right away
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), omp_playback_get_track_position());
- }
+ omp_playback_set_track_position(omp_playback_get_track_position()+BUTTON_SEEK_DISTANCE);
}
/**
- * Gets called when the user starts dragging the time slider
+ * Event handler for the Rewind button
*/
-gboolean
-omp_main_time_slider_drag_start(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+void
+omp_main_rewind_clicked(GtkWidget *widget, gpointer data)
{
- while (gtk_events_pending()) gtk_main_iteration();
-
- // Prevent UI callbacks from messing with the slider position
- omp_main_time_slider_can_update = FALSE;
-
- return FALSE;
+ omp_playback_set_track_position(omp_playback_get_track_position()-BUTTON_SEEK_DISTANCE);
}
/**
- * Gets called when the user stops dragging the time slider
+ * Event handler for the Play/Pause button
*/
-gboolean
-omp_main_time_slider_drag_stop(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+void
+omp_main_play_pause_clicked(GtkWidget *widget, gpointer data)
{
- while (gtk_events_pending()) gtk_main_iteration();
+ if (omp_playback_get_state() != OMP_PLAYBACK_STATE_PLAYING)
+ {
+ omp_playback_play();
- // Allow UI callbacks to alter the the slider position again
- omp_main_time_slider_can_update = TRUE;
+ } else {
- // Notify the slider change callback that this time we indeed want to change position
- omp_main_time_slider_was_dragged = TRUE;
-
- return FALSE;
+ omp_playback_pause();
+ }
}
/**
- * Event handler for the "balance left" button
- * @todo Figure out how to set balance with gstreamer
- */
-void
-omp_main_balance_left_clicked(GtkWidget *widget, gpointer data)
-{
- // ...
-}
-
-/**
- * Event handler for the "balance right" button
- * @todo Figure out how to set balance with gstreamer
- */
-void
-omp_main_balance_right_clicked(GtkWidget *widget, gpointer data)
-{
- // ...
-}
-
-/**
* Event handler for the Shuffle button
*/
void
@@ -199,67 +152,50 @@
}
/**
- * Event handler for the Fast Forward button
+ * Event handler for the preferences button
*/
void
-omp_main_fast_forward_clicked(GtkWidget *widget, gpointer data)
+omp_main_preferences_clicked(GtkWidget *widget, gpointer data)
{
- // Set new position and resume playback that was paused when dragging started
- omp_playback_set_track_position(omp_playback_get_track_position()+BUTTON_SEEK_DISTANCE);
-
- // Update UI right away
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), omp_playback_get_track_position());
+ error_dialog("Not implemented yet, sorry :)");
}
/**
- * Event handler for the Rewind button
+ * Resets the UI to a "no track loaded" state
*/
void
-omp_main_rewind_clicked(GtkWidget *widget, gpointer data)
+omp_main_reset_ui(gpointer instance, gpointer user_data)
{
- // Set new position and resume playback that was paused when dragging started
- omp_playback_set_track_position(omp_playback_get_track_position()-BUTTON_SEEK_DISTANCE);
+ gchar *caption;
- // Update UI right away
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), omp_playback_get_track_position());
-}
+ if (omp_config_get_main_ui_show_cover())
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.cover_image), "no_cover", -1);
-/**
- * Event handler for the Play/Pause button
- */
-void
-omp_main_play_pause_clicked(GtkWidget *widget, gpointer data)
-{
- if (omp_playback_get_state() != OMP_PLAYBACK_STATE_PLAYING)
+ // Determine which label we can use for showing the "No track information" line
+ // #2 is preferred, followed by #1 and #3
+ // Of course we could set all labels to NULL first and then assign the notice,
+ // however not doing this saves us a couple cycles on the cost of readability :)
+ if (omp_config_get_main_ui_label2() != OMP_MAIN_LABEL_HIDDEN)
{
- omp_playback_play();
+ gtk_label_set_text(GTK_LABEL(main_widgets.label1), NULL);
+ gtk_label_set_text(GTK_LABEL(main_widgets.label2), _("No track information"));
+ gtk_label_set_text(GTK_LABEL(main_widgets.label3), NULL);
} else {
- omp_playback_pause();
+ if (omp_config_get_main_ui_label1() != OMP_MAIN_LABEL_HIDDEN)
+ {
+ gtk_label_set_text(GTK_LABEL(main_widgets.label1), NULL);
+ gtk_label_set_text(GTK_LABEL(main_widgets.label2), NULL);
+ gtk_label_set_text(GTK_LABEL(main_widgets.label3), _("No track information"));
+ } else {
+ gtk_label_set_text(GTK_LABEL(main_widgets.label1), _("No track information"));
+ gtk_label_set_text(GTK_LABEL(main_widgets.label2), NULL);
+ gtk_label_set_text(GTK_LABEL(main_widgets.label3), NULL);
+ }
+
}
-}
-/**
- * Gets called when the volume slider's value got changed
- */
-void
-omp_main_volume_slider_changed(GtkRange *range, gpointer data)
-{
- omp_playback_set_volume(gtk_range_get_value(GTK_RANGE(range)));
-}
-
-/**
- * Resets the UI to a "no track loaded" state
- */
-void
-omp_main_reset_ui(gpointer instance, gpointer user_data)
-{
- gchar *caption;
-
- gtk_label_set_text(GTK_LABEL(main_widgets.title_label), "No track info available");
- gtk_label_set_text(GTK_LABEL(main_widgets.artist_label), "");
-
caption = g_strdup_printf(OMP_WIDGET_CAPTION_TRACK_NUM, 0, 0);
gtk_label_set_text(GTK_LABEL(main_widgets.track_number_label), caption);
g_free(caption);
@@ -268,240 +204,227 @@
gtk_label_set_text(GTK_LABEL(main_widgets.time_label), caption);
g_free(caption);
- gtk_range_set_range(GTK_RANGE(main_widgets.time_hscale), 0, 1);
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), 0.0);
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.time_bar), 0);
}
/**
- * Creates the main UI
+ * Creates the widgets at the top of the interface (cover, title label, artist label)
+ * @todo Add RTL/LTR support
*/
void
-omp_main_widgets_create(GtkContainer *destination)
+omp_main_top_widgets_create(GtkBox *parent)
{
- GtkWidget *alignment;
- GtkWidget *mainvbox;
- GtkWidget *upper_hbox, *middle_hbox, *lower_hbox;
- GtkWidget *middle_right_vbox;
- GtkWidget *button;
+ GtkWidget *frame, *hbox, *image, *alignment, *vbox, *label, *label3;
- gchar *image_file_name, *caption;
- gint i;
+ // Pack everything into a frame to allow using x/ythickness in the theme
+ frame = gtk_frame_new(NULL);
+ gtk_widget_set_name(frame, "omp-main-top-cover-padding");
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE);
+ gtk_box_pack_start(parent, frame, FALSE, FALSE, 0);
- // Add mainvbox to destination container
- mainvbox = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(destination), GTK_WIDGET(mainvbox));
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(frame), hbox);
- // Title label
- alignment = label_create(&main_widgets.title_label, "Sans 8", "black", 0, 0, 1, 0, PANGO_ELLIPSIZE_END);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 30);
- gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+ // Pack the image itself into another frame to give it a black border
+ main_widgets.cover_image = gtk_image_new();
+ gtk_widget_set_name(GTK_WIDGET(main_widgets.cover_image), "omp-main-top-cover");
+ main_widgets.cover_frame = widget_wrap(main_widgets.cover_image, NULL);
+ gtk_frame_set_shadow_type(GTK_FRAME(main_widgets.cover_frame), GTK_SHADOW_IN);
+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(main_widgets.cover_frame), FALSE, FALSE, 0);
- // Artist label
- alignment = label_create(&main_widgets.artist_label, "Sans 6", "black", 0, 0, 1, 0, PANGO_ELLIPSIZE_END);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 35, 30);
- gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+ // Add the placeholder that makes sure the vbox retains its height even when the cover image is hidden
+ image = gtk_image_new();
+ gtk_widget_set_name(GTK_WIDGET(image), "omp-main-top-cover-placeholder");
+ gtk_image_set_from_stock(GTK_IMAGE(image), "image", -1);
+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(image), FALSE, FALSE, 0);
- // --- --- --- --- --- Upper hbox --- --- --- --- ---
- // Add upper_hbox to mainvbox for track number and time display
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 30);
- gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+ // Vertical centering made easy: we fill a vbox with
+ // "alignment - label - label - alignment" and make it homogeneous
+ // while leaving the alignments empty
+ vbox = gtk_vbox_new(TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
- upper_hbox = gtk_hbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(upper_hbox));
+ alignment = gtk_alignment_new(0, 0, 1, 1);
+ gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
- // Track number icon
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 14, 15);
- gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- container_add_image(GTK_CONTAINER(alignment), "ico-track.png");
+ main_widgets.label1 = gtk_label_new(NULL);
+ gtk_widget_set_name(GTK_WIDGET(main_widgets.label1), "omp-main-top-label1");
+ gtk_label_set_ellipsize(GTK_LABEL(main_widgets.label1), PANGO_ELLIPSIZE_END);
+ gtk_misc_set_alignment(GTK_MISC(main_widgets.label1), 0, 0);
+ label = widget_wrap(main_widgets.label1, NULL);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- // Track number
- alignment = label_create(&main_widgets.track_number_label, "Sans 5", "black", 0, 0, 0, 0, PANGO_ELLIPSIZE_NONE);
- gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+ main_widgets.label2 = gtk_label_new(NULL);
+ gtk_widget_set_name(GTK_WIDGET(main_widgets.label2), "omp-main-top-label2");
+ gtk_label_set_ellipsize(GTK_LABEL(main_widgets.label2), PANGO_ELLIPSIZE_END);
+ gtk_misc_set_alignment(GTK_MISC(main_widgets.label2), 0, 0);
+ label = widget_wrap(main_widgets.label2, NULL);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- // Time icon
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 86, 15);
- gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- container_add_image(GTK_CONTAINER(alignment), "ico-time.png");
+ alignment = gtk_alignment_new(0, 0, 1, 1);
+ gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
- // Time
- alignment = label_create(&main_widgets.time_label, "Sans 5", "black", 0, 0, 0, 0, PANGO_ELLIPSIZE_NONE);
- gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- // --- --- --- --- --- Slider --- --- --- --- ---
+ // Title label
+ main_widgets.label3 = gtk_label_new(NULL);
+ gtk_widget_set_name(GTK_WIDGET(main_widgets.label3), "omp-main-top-label3");
+ gtk_label_set_ellipsize(GTK_LABEL(main_widgets.label3), PANGO_ELLIPSIZE_END);
+ label3 = widget_wrap(main_widgets.label3, NULL);
+ gtk_box_pack_start(GTK_BOX(parent), label3, FALSE, FALSE, 0);
- // Time hscale
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 48, 0);
- gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- main_widgets.time_hscale = gtk_hscale_new_with_range(0.0, 338.0, 1.0);
- gtk_scale_set_draw_value(GTK_SCALE(main_widgets.time_hscale), FALSE);
- GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(main_widgets.time_hscale), GTK_CAN_FOCUS);
- gtk_widget_set_size_request(GTK_WIDGET(main_widgets.time_hscale), 338, 35);
- gtk_range_set_update_policy(GTK_RANGE(main_widgets.time_hscale), GTK_UPDATE_DISCONTINUOUS);
+ // Show all widgets, then hide the ones we don't want visible
+ gtk_widget_show_all(GTK_WIDGET(frame));
- g_signal_connect(G_OBJECT(main_widgets.time_hscale), "value_changed",
- G_CALLBACK(omp_main_time_slider_changed), NULL);
- g_signal_connect(G_OBJECT(main_widgets.time_hscale), "button-press-event",
- G_CALLBACK(omp_main_time_slider_drag_start), NULL);
- g_signal_connect(G_OBJECT(main_widgets.time_hscale), "button-release-event",
- G_CALLBACK(omp_main_time_slider_drag_stop), NULL);
+ if (omp_config_get_main_ui_label1() == OMP_MAIN_LABEL_HIDDEN) gtk_widget_hide(main_widgets.label1);
+ if (omp_config_get_main_ui_label2() == OMP_MAIN_LABEL_HIDDEN) gtk_widget_hide(main_widgets.label2);
- gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(main_widgets.time_hscale));
+ if (omp_config_get_main_ui_label3() != OMP_MAIN_LABEL_HIDDEN) gtk_widget_show_all(label3);
- // --- --- --- --- --- Middle hbox --- --- --- --- ---
+ if (!omp_config_get_main_ui_show_cover())
+ gtk_widget_hide(main_widgets.cover_frame);
+}
- // Add middle_hbox to mainvbox for the EQ/volume/balance widgets
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 42, 0, 65, 0);
- gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+/**
+ * Creates the widgets at the bottom of the interface (playlist counter, track time, player controls, etc.)
+ */
+void
+omp_main_bottom_widgets_create(GtkBox *parent)
+{
+ GtkWidget *main_vbox, *hbox, *label, *btn_box, *icon, *eventbox, *button, *image;
- middle_hbox = gtk_hbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(middle_hbox));
+ main_vbox = gtk_vbox_new(FALSE, 0);
+ gtk_box_pack_end(GTK_BOX(parent), main_vbox, FALSE, FALSE, 0);
- // EQ/Visualization bands
- image_file_name = g_build_path("/", omp_ui_image_path, "ind-music-eq-12.png", NULL);
+ hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
- for (i=0; i<12; i++)
- {
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 0, 0);
- gtk_box_pack_start(GTK_BOX(middle_hbox), alignment, TRUE, TRUE, 0);
- main_widgets.band_image[i] = gtk_image_new_from_file(image_file_name);
- gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(main_widgets.band_image[i]));
- }
+ // Playlist counter icon
+ icon = gtk_image_new();
+ gtk_widget_set_name(icon, "omp-main-btm-info-bar");
+ gtk_image_set_from_stock(GTK_IMAGE(icon), "track", -1);
+ icon = widget_wrap(icon, NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
- g_free(image_file_name);
+ // Playlist counter label
+ main_widgets.track_number_label = gtk_label_new(NULL);
+ gtk_widget_set_name(main_widgets.track_number_label, "omp-main-btm-info-bar");
+ label = widget_wrap(main_widgets.track_number_label, NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- // Add vbox containing volume and balance controls
- middle_right_vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(middle_hbox), GTK_WIDGET(middle_right_vbox), TRUE, TRUE, 0);
+ // Track time label
+ main_widgets.time_label = gtk_label_new(NULL);
+ gtk_widget_set_name(main_widgets.time_label, "omp-main-btm-info-bar");
+ label = widget_wrap(main_widgets.time_label, NULL);
+ gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 0);
- // Volume hbox
- GtkWidget* volume_box = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(middle_right_vbox), volume_box, TRUE, TRUE, 0);
+ // Track time icon
+ icon = gtk_image_new();
+ gtk_widget_set_name(icon, "omp-main-btm-info-bar");
+ gtk_image_set_from_stock(GTK_IMAGE(icon), "time", -1);
+ icon = widget_wrap(icon, NULL);
+ gtk_box_pack_end(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
- // Volume image
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 7, 0, 20, 0);
- gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-volume-00.png", &main_widgets.volume_image);
- // Volume label
- alignment = label_create(&main_widgets.volume_label, "Sans 5", "darkorange", 0, 0, 1, 0, PANGO_ELLIPSIZE_NONE);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 6, 0, 10, 0);
- gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- caption = g_strdup_printf(OMP_WIDGET_CAPTION_VOLUME, 0);
- gtk_label_set_text(GTK_LABEL(main_widgets.volume_label), caption);
- g_free(caption);
+ // Progress bar
+ main_widgets.time_bar = gtk_progress_bar_new();
+ gtk_widget_set_name(main_widgets.time_bar, "omp-main-btm-progressbar");
+ gtk_box_pack_start(GTK_BOX(main_vbox), main_widgets.time_bar, FALSE, FALSE, 0);
- // Balance image
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 35, 0);
- gtk_box_pack_start(GTK_BOX(middle_right_vbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
- container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-pan-0.png", &main_widgets.balance_image);
- // --- --- --- --- --- Lower hbox --- --- --- --- ---
+ // Button container - the event box is only used to paint the background
+ eventbox = gtk_event_box_new();
+ gtk_widget_set_name(eventbox, "omp-main-btm-button-box");
+ gtk_box_pack_start(GTK_BOX(main_vbox), eventbox, FALSE, FALSE, 0);
- // Add lower hbox containing the shuffle/repeat/balance buttons
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 25, 0, 25, 0);
- gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
+ hbox = gtk_hbox_new(FALSE, 0);
+ btn_box = widget_wrap(hbox, "omp-main-btm-button-box");
+ gtk_container_add(GTK_CONTAINER(eventbox), btn_box);
- lower_hbox = gtk_hbutton_box_new();
- gtk_box_set_spacing(GTK_BOX(lower_hbox), 4);
- gtk_container_add(GTK_CONTAINER(alignment), lower_hbox);
+ // Expand button
+ button = button_create_with_image("omp-main-btm-button-expand", "image",
+ NULL,
+ G_CALLBACK(omp_main_expand_clicked));
+ button = widget_wrap(button, "omp-main-btm-button-padding-y");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // "balance left" button
- button = button_create_with_image("ico-balance-left.png", NULL,
- G_CALLBACK(omp_main_balance_left_clicked));
- gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
+ // Rewind/previous track button
+ button = button_create_with_image("omp-main-btm-buttons", "rew_prev",
+ NULL,
+ G_CALLBACK(omp_playlist_set_prev_track));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // Shuffle toggle button
- button = button_create_with_image("ico-shuffle-off.png",
- &main_widgets.shuffle_button_image, G_CALLBACK(omp_main_shuffle_clicked));
- gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
+ // Play/pause button
+ button = button_create_with_image("omp-main-btm-buttons", "play",
+ &main_widgets.play_pause_button_image,
+ G_CALLBACK(omp_main_play_pause_clicked));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // Repeat toggle button
- button = button_create_with_image("ico-repeat-off.png",
- &main_widgets.repeat_button_image, G_CALLBACK(omp_main_repeat_clicked));
- gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
+ // Fast forward/next track button
+ button = button_create_with_image("omp-main-btm-buttons", "ffwd_next",
+ NULL,
+ G_CALLBACK(omp_playlist_set_next_track));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // "balance right" button
- button = button_create_with_image("ico-balance-right.png", NULL,
- G_CALLBACK(omp_main_balance_right_clicked));
- gtk_box_pack_start(GTK_BOX(lower_hbox), button, TRUE, TRUE, 0);
-}
+ // Volume indicator
+ main_widgets.volume_image = gtk_image_new();
+ gtk_widget_set_name(main_widgets.volume_image, "omp-main-btm-volume");
+ icon = widget_wrap(main_widgets.volume_image, NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
-/**
- * Creates the widgets below the UI background image
- */
-void
-omp_main_secondary_widgets_create(GtkContainer *destination)
-{
- GtkWidget *alignment;
- GtkWidget *mainvbox;
- GtkWidget *hbox;
- GtkWidget *image, *button, *vol_scale;
- // Add mainvbox to destination container
- mainvbox = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(destination), GTK_WIDGET(mainvbox));
+ // Button container - second row
+ main_widgets.extended_controls = gtk_event_box_new();
+ gtk_widget_set_name(main_widgets.extended_controls, "omp-main-btm-button-box2");
+ gtk_box_pack_start(GTK_BOX(main_vbox), main_widgets.extended_controls, FALSE, FALSE, 0);
- // --- --- --- --- --- Player controls --- --- --- --- --- ---
+ hbox = gtk_hbox_new(FALSE, 0);
+ btn_box = widget_wrap(hbox, "omp-main-btm-button-box2");
+ gtk_container_add(GTK_CONTAINER(main_widgets.extended_controls), btn_box);
- alignment = gtk_alignment_new(0, 0, 1, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 25, 0);
- gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
+ // Expand button placeholder
+ image = gtk_image_new();
+ gtk_widget_set_name(image, "omp-main-btm-button-expand-placeholder");
+ gtk_image_set_from_stock(GTK_IMAGE(image), "image", -1);
+ image = widget_wrap(image, "omp-main-btm-button-padding-y");
+ gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
- hbox = gtk_hbutton_box_new();
- gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_SPREAD);
- gtk_container_add(GTK_CONTAINER(alignment), hbox);
+ // Shuffle button
+ button = button_create_with_image("omp-main-btm-buttons", "shuffle_off",
+ &main_widgets.shuffle_button_image,
+ G_CALLBACK(omp_main_shuffle_clicked));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // Previous Track button
- button = omp_stock_button_create("gtk-media-previous-ltr", &image,
- G_CALLBACK(omp_playlist_set_prev_track));
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ // Play/pause button
+ button = button_create_with_image("omp-main-btm-buttons", "repeat_off",
+ &main_widgets.repeat_button_image,
+ G_CALLBACK(omp_main_repeat_clicked));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // Rewind button
- button = omp_stock_button_create("gtk-media-rewind-ltr", &image,
- G_CALLBACK(omp_main_rewind_clicked));
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ // Preferences button
+ button = button_create_with_image("omp-main-btm-buttons", "preferences",
+ NULL,
+ G_CALLBACK(omp_main_preferences_clicked));
+ button = widget_wrap(button, "omp-main-btm-button-padding-xy");
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
- // Play/Pause button
- button = omp_stock_button_create("gtk-media-play-ltr", &main_widgets.play_pause_button_image,
- G_CALLBACK(omp_main_play_pause_clicked));
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
- // Fast Forward button
- button = omp_stock_button_create("gtk-media-forward-ltr", &image,
- G_CALLBACK(omp_main_fast_forward_clicked));
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ // Spacer between button box and UI page tabs
+ eventbox = gtk_event_box_new();
+ gtk_widget_set_name(eventbox, "omp-main-btm-spacer");
+ eventbox = widget_wrap(eventbox, NULL);
+ gtk_box_pack_end(GTK_BOX(main_vbox), eventbox, FALSE, FALSE, 0);
- // Next Track button
- button = omp_stock_button_create("gtk-media-next-ltr", &image,
- G_CALLBACK(omp_playlist_set_next_track));
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
- // --- --- --- --- --- Volume control --- --- --- --- --- ---
-
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 71, 0);
- gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
-
- // Volume hscale
- vol_scale = gtk_hscale_new_with_range(0.0, 100.1, 1.0);
- gtk_scale_set_draw_value(GTK_SCALE(vol_scale), FALSE);
- GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(vol_scale), GTK_CAN_FOCUS);
- gtk_widget_set_size_request(GTK_WIDGET(vol_scale), 338, 35);
- gtk_range_set_update_policy(GTK_RANGE(vol_scale), GTK_UPDATE_CONTINUOUS);
- g_signal_connect(G_OBJECT(vol_scale), "value_changed", G_CALLBACK(omp_main_volume_slider_changed), NULL);
- gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(vol_scale));
- main_widgets.volume_hscale = vol_scale;
+ // Show all widgets except the extended controls
+ gtk_widget_show_all(main_vbox);
+ gtk_widget_hide(main_widgets.extended_controls);
}
/**
@@ -510,27 +433,20 @@
GtkWidget *
omp_main_page_create()
{
- GtkWidget *alignment, *bg_muxer;
+ GtkWidget *eventbox, *vbox;
- bg_muxer = gtk_fixed_new();
+ eventbox = gtk_event_box_new();
+ gtk_widget_set_name(eventbox, "omp-main-background");
- // Background image
- alignment = gtk_alignment_new(0, 0, 0, 0);
- container_add_image(GTK_CONTAINER(alignment), "background.png");
- gtk_fixed_put(GTK_FIXED(bg_muxer), GTK_WIDGET(alignment), 15, 10);
-
- // Create all widgets
- alignment = gtk_alignment_new(0, 0, 0, 0);
- omp_main_widgets_create(GTK_CONTAINER(alignment));
- gtk_fixed_put(GTK_FIXED(bg_muxer), GTK_WIDGET(alignment), 20, 26);
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(eventbox), vbox);
- alignment = gtk_alignment_new(0, 0, 0, 0);
- omp_main_secondary_widgets_create(GTK_CONTAINER(alignment));
- gtk_fixed_put(GTK_FIXED(bg_muxer), GTK_WIDGET(alignment), 0, 420);
+ // Create UI widgets
+ omp_main_top_widgets_create(GTK_BOX(vbox));
+ omp_main_bottom_widgets_create(GTK_BOX(vbox));
omp_main_reset_ui(NULL, NULL);
-
// Set up playlist signal handlers
g_signal_connect(G_OBJECT(omp_window), OMP_EVENT_PLAYLIST_LOADED,
G_CALLBACK(omp_main_playlist_loaded), NULL);
@@ -564,13 +480,32 @@
g_signal_connect(G_OBJECT(omp_window), OMP_EVENT_PLAYBACK_VOLUME_CHANGED,
G_CALLBACK(omp_main_update_volume), NULL);
- // Make all widgets visible
- gtk_widget_show_all(bg_muxer);
+ // Make widgets visible - can't use gtk_widget_show_all() here as some widgets should stay hidden
+ gtk_widget_show(vbox);
+ gtk_widget_show(eventbox);
- return bg_muxer;
+ return eventbox;
}
/**
+ * Fills one of the dynamic labels with a new caption
+ * @param label_type Content to set
+ * @param caption Text to assign to the label containing selected type
+ */
+void
+omp_main_set_label(omp_main_label_type label_type, gchar *caption)
+{
+ if (omp_config_get_main_ui_label1() == label_type)
+ gtk_label_set_text(GTK_LABEL(main_widgets.label1), caption);
+
+ if (omp_config_get_main_ui_label2() == label_type)
+ gtk_label_set_text(GTK_LABEL(main_widgets.label2), caption);
+
+ if (omp_config_get_main_ui_label3() == label_type)
+ gtk_label_set_text(GTK_LABEL(main_widgets.label3), caption);
+}
+
+/**
* Callback for the "playlist loaded" event
*/
void
@@ -600,8 +535,8 @@
// Set preliminary artist/title strings (updated on incoming metadata)
omp_playlist_get_track_info(omp_playlist_current_track_id, &artist, &title, &track_length);
- gtk_label_set_text(GTK_LABEL(main_widgets.artist_label), artist);
- gtk_label_set_text(GTK_LABEL(main_widgets.title_label), title);
+ omp_main_set_label(OMP_MAIN_LABEL_ARTIST, artist);
+ omp_main_set_label(OMP_MAIN_LABEL_TITLE, title);
if (artist) g_free(artist);
if (title) g_free(title);
@@ -634,16 +569,7 @@
gtk_label_set_text(GTK_LABEL(main_widgets.time_label), text);
g_free(text);
- if (omp_main_time_slider_can_update)
- {
- // We don't want to set both min/max to 0 as this triggers a
- // critial GTK warning, so we set 0/1 instead in that case
- gtk_range_set_range(GTK_RANGE(main_widgets.time_hscale), 0, track_length ? track_length : 1);
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), track_position);
-
- // Set new time slider increments: one tap is 10% of the track's playing time
- gtk_range_set_increments(GTK_RANGE(main_widgets.time_hscale), track_length/10, track_length/10);
- }
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.time_bar), (gdouble)track_position/(gdouble)track_length);
}
}
@@ -662,17 +588,12 @@
void
omp_main_update_shuffle_state(gpointer instance, gboolean state, gpointer user_data)
{
- gchar *image_file_name;
-
if (state)
{
- image_file_name = g_build_filename(omp_ui_image_path, "ico-shuffle-on.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.shuffle_button_image), "shuffle_on", -1);
} else {
- image_file_name = g_build_filename(omp_ui_image_path, "ico-shuffle-off.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.shuffle_button_image), "shuffle_off", -1);
}
-
- gtk_image_set_from_file(GTK_IMAGE(main_widgets.shuffle_button_image), image_file_name);
- g_free(image_file_name);
}
/**
@@ -681,28 +602,23 @@
void
omp_main_update_repeat_mode(gpointer instance, guint mode, gpointer user_data)
{
- gchar *image_file_name = NULL;
-
switch (mode)
{
case OMP_REPEAT_OFF:
- image_file_name = g_build_filename(omp_ui_image_path, "ico-repeat-off.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.repeat_button_image), "repeat_off", -1);
break;
case OMP_REPEAT_ONCE:
- image_file_name = g_build_filename(omp_ui_image_path, "ico-repeat-once.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.repeat_button_image), "repeat_once", -1);
break;
case OMP_REPEAT_CURRENT:
- image_file_name = g_build_filename(omp_ui_image_path, "ico-repeat-current.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.repeat_button_image), "repeat_current", -1);
break;
case OMP_REPEAT_ALL:
- image_file_name = g_build_filename(omp_ui_image_path, "ico-repeat-all.png", NULL);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.repeat_button_image), "repeat_all", -1);
}
-
- gtk_image_set_from_file(GTK_IMAGE(main_widgets.repeat_button_image), image_file_name);
- g_free(image_file_name);
}
/**
@@ -714,13 +630,9 @@
// Update Play/Pause button pixmap
if (omp_playback_get_state() == OMP_PLAYBACK_STATE_PAUSED)
{
- gtk_image_set_from_icon_name(GTK_IMAGE(main_widgets.play_pause_button_image),
- "gtk-media-play-ltr", GTK_ICON_SIZE_BUTTON);
-
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.play_pause_button_image), "play", -1);
} else {
-
- gtk_image_set_from_icon_name(GTK_IMAGE(main_widgets.play_pause_button_image),
- "gtk-media-pause", GTK_ICON_SIZE_BUTTON);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.play_pause_button_image), "pause", -1);
}
}
@@ -750,16 +662,7 @@
gtk_label_set_text(GTK_LABEL(main_widgets.time_label), text);
g_free(text);
- if (omp_main_time_slider_can_update)
- {
- // We don't want to set both min/max to 0 as this triggers a
- // critial GTK warning, so we set 0/1 instead in that case
- gtk_range_set_range(GTK_RANGE(main_widgets.time_hscale), 0, track_length ? track_length : 1);
- gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), track_position);
-
- // Set new time slider increments: one tap is 10% of the track's playing time
- gtk_range_set_increments(GTK_RANGE(main_widgets.time_hscale), track_length/10, track_length/10);
- }
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.time_bar), (gdouble)track_position/(gdouble)track_length);
}
}
@@ -770,18 +673,12 @@
void
omp_main_update_volume(gpointer instance, gpointer user_data)
{
- gchar *text, *image_file_name;
+ gchar *image;
guint volume;
volume = omp_playback_get_volume();
- image_file_name = g_strdup_printf("%s/ind-music-volume-%02d.png", omp_ui_image_path, volume/10);
- gtk_image_set_from_file(GTK_IMAGE(main_widgets.volume_image), image_file_name);
- g_free(image_file_name);
-
- text = g_strdup_printf(OMP_WIDGET_CAPTION_VOLUME, volume);
- gtk_label_set_text(GTK_LABEL(main_widgets.volume_label), text);
- g_free(text);
-
- gtk_range_set_value(GTK_RANGE(main_widgets.volume_hscale), volume);
+ image = g_strdup_printf("volume%02d", volume/10);
+ gtk_image_set_from_stock(GTK_IMAGE(main_widgets.volume_image), image, -1);
+ g_free(image);
}
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.h 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/main_page.h 2007-10-17 14:46:20 UTC (rev 3208)
@@ -36,6 +36,18 @@
// Determines how many milliseconds the engine will seek if the FFWD/REW buttons are clicked
#define BUTTON_SEEK_DISTANCE 10000
+
+
+/// Content types that can be assigned to the labels
+typedef enum
+{
+ OMP_MAIN_LABEL_HIDDEN,
+ OMP_MAIN_LABEL_EMPTY, // Visible but empty - only makes sense for label #1 as it affects UI layout
+ OMP_MAIN_LABEL_ARTIST,
+ OMP_MAIN_LABEL_TITLE,
+ OMP_MAIN_LABEL_ALBUM
+} omp_main_label_type;
+
GtkWidget *omp_main_page_create();
#endif
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.c 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.c 2007-10-17 14:46:20 UTC (rev 3208)
@@ -37,6 +37,7 @@
#include "files_page.h"
#include "main.h"
+#include "main_page.h"
#include "persistent.h"
#include "playlist.h"
#include "playback.h"
@@ -48,12 +49,13 @@
OMP_REPEAT_OFF, // repeat_mode
TRUE, // resume_playback
10000, // prev_track_treshold
-// FALSE, // auto_scroll
- 0.0, // equalizer_gain
- {0,0,0,0,0,0,0,0,0,0,0}, // EQ bands
TRUE, // show_numbers_in_pl
500000, // pulsesink_buffer_time
- 100000 // pulsesink_latency_time
+ 100000, // pulsesink_latency_time
+ TRUE, // main_ui_show_cover
+ OMP_MAIN_LABEL_HIDDEN, // main_ui_label1
+ OMP_MAIN_LABEL_ARTIST, // main_ui_label2
+ OMP_MAIN_LABEL_TITLE // main_ui_label3
};
struct _omp_config *omp_config = NULL; ///< Global and persistent configuration data
@@ -181,6 +183,42 @@
}
/**
+ * Returns the flag that determines whether the album cover is shown on the main UI
+ */
+gboolean
+omp_config_get_main_ui_show_cover()
+{
+ return omp_config->main_ui_show_cover;
+}
+
+/**
+ * Returns the content type to be used for main UI's label #1
+ */
+guint
+omp_config_get_main_ui_label1()
+{
+ return omp_config->main_ui_label1;
+}
+
+/**
+ * Returns the content type to be used for main UI's label #2
+ */
+guint
+omp_config_get_main_ui_label2()
+{
+ return omp_config->main_ui_label2;
+}
+
+/**
+ * Returns the content type to be used for main UI's label #3
+ */
+guint
+omp_config_get_main_ui_label3()
+{
+ return omp_config->main_ui_label3;
+}
+
+/**
* Fills the session data with sane default values
*/
void
@@ -429,18 +467,19 @@
}
/**
- * Returns the path used for the file chooser UI; must be freed after use
+ * Returns the path used for the file chooser UI; must not be freed
*/
gchar *
omp_session_get_file_chooser_path()
{
g_return_val_if_fail(omp_session, NULL);
+ // Set the default value if not set
if (omp_session->file_chooser_path[0] == 0)
{
g_snprintf(omp_session->file_chooser_path, sizeof(omp_session->file_chooser_path),
"%s", OMP_DEFAULT_FILE_CHOOSER_PATH);
}
- return g_strdup((gchar *)&omp_session->file_chooser_path);
+ return (gchar *)&omp_session->file_chooser_path;
}
Modified: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.h 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer2/src/persistent.h 2007-10-17 14:46:20 UTC (rev 3208)
@@ -58,12 +58,13 @@
guint repeat_mode; ///< Repeat mode @see omp_repeat_modes
gboolean resume_playback; ///< Resume playback on startup where it left off?
guint prev_track_treshold; ///< Amount of milliseconds a track must have been playing to jump back to track beginning on "prev track" event
-// gboolean auto_scroll; ///< Scroll title if it's too long?
- gdouble equalizer_gain; ///< Pre-amplification value before audio stream is fed to equalizer [0.0..1.0]
- gdouble equalizer_bands[11]; ///< The gains for each of the equalizer bands [-1.0..1.0]
gboolean show_numbers_in_pl; ///< Show numbers in playlist?
gulong pulsesink_buffer_time; ///< Value to set pulsesink's buffer-time property to
gulong pulsesink_latency_time; ///< Value to set pulsesink's latency-time property to
+ gboolean main_ui_show_cover; ///< Flag determining whether cover is shown or not
+ guint main_ui_label1; ///< Contents of main UI's label #1
+ guint main_ui_label2; ///< Contents of main UI's label #2
+ guint main_ui_label3; ///< Contents of main UI's label #3
};
/// Session-persistent data
@@ -95,6 +96,10 @@
guint omp_config_get_prev_track_treshold();
gulong omp_config_get_pulsesink_buffer_time();
gulong omp_config_get_pulsesink_latency_time();
+gboolean omp_config_get_main_ui_show_cover();
+guint omp_config_get_main_ui_label1();
+guint omp_config_get_main_ui_label2();
+guint omp_config_get_main_ui_label3();
void omp_session_init();
void omp_session_free();
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand_placeholder.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_expand_placeholder.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white_down.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/btn_white_down.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/button_box.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/button_box.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame_placeholder.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/frame_placeholder.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_expand.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_expand.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_ffwd_next.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_ffwd_next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_pause.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_pause.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_play.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_play.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_preferences.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_preferences.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_all.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_all.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_current.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_current.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_off.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_off.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_once.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_repeat_once.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_rew_prev.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_rew_prev.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_off.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_off.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_on.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_shuffle_on.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_time.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_time.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_track.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_track.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_00.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_00.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_01.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_01.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_02.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_02.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_03.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_03.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_04.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_04.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_05.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_05.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_06.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_06.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_07.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_07.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_08.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_08.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_09.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_09.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_10.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/ico_volume_10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/no_cover.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/no_cover.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_background.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_background.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_bar.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/mokomediaplayer/pgbar_bar.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/openmoko-mediaplayer
===================================================================
--- trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/openmoko-mediaplayer 2007-10-17 12:26:27 UTC (rev 3207)
+++ trunk/src/target/OM-2007.2/artwork/themes/openmoko-standard-2/gtk-2.0/openmoko-mediaplayer 2007-10-17 14:46:20 UTC (rev 3208)
@@ -0,0 +1,281 @@
+style "omp-main-background"
+{
+ bg_pixmap[NORMAL] = "mokomediaplayer/background.png"
+}
+widget "*omp-main-background" style "omp-main-background"
+
+
+#####
+# Top widgets (album cover, track title & Co)
+#####
+
+
+style "omp-main-top-cover-placeholder"
+{
+ stock["image"] = {{ "mokomediaplayer/frame_placeholder.png" }}
+}
+widget "*omp-main-top-cover-placeholder" style "omp-main-top-cover-placeholder"
+
+
+style "omp-main-top-cover-padding"
+{
+ xthickness = 11
+ ythickness = 11
+}
+widget "*omp-main-top-cover-padding" style "omp-main-top-cover-padding"
+
+
+style "omp-main-top-cover"
+{
+ stock["no_cover"] = {{ "mokomediaplayer/no_cover.png" }}
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = SHADOW
+ shadow = IN
+ file = "mokomediaplayer/frame.png"
+ border = { 2, 2, 2, 2 }
+ stretch = TRUE
+ }
+ }
+}
+widget "*omp-main-top-cover" style "omp-main-top-cover"
+
+
+style "omp-main-top-label1"
+{
+ fg[NORMAL] = "white"
+ font_name = "Sans 5"
+ xthickness = 7
+}
+widget "*omp-main-top-label1" style "omp-main-top-label1"
+
+
+style "omp-main-top-label2"
+{
+ fg[NORMAL] = "white"
+ font_name = "Sans 5"
+ xthickness = 7
+}
+widget "*omp-main-top-label2" style "omp-main-top-label2"
+
+
+style "omp-main-top-label3"
+{
+ fg[NORMAL] = "#000000"
+ font_name = "Sans 6"
+ ythickness = 2
+}
+widget "*omp-main-top-label3" style "omp-main-top-label3"
+
+
+#####
+# Bottom widgets (playlist pos, track time, control buttons, etc.)
+#####
+
+
+style "omp-main-btm-info-bar"
+{
+ stock["track"] = {{ "mokomediaplayer/ico_track.png" }}
+ stock["time"] = {{ "mokomediaplayer/ico_time.png" }}
+ fg[NORMAL] = "black"
+ font_name = "Sans 6"
+ xthickness = 6
+ ythickness = 3
+}
+widget "*omp-main-btm-info-bar" style "omp-main-btm-info-bar"
+
+
+style "omp-main-btm-progressbar"
+{
+ bg[NORMAL] = "#181818"
+ bg[PRELIGHT] = "#d66900"
+
+ xthickness = 5
+ ythickness = 5
+# GtkProgressBar::xspacing = 1
+# GtkProgressBar::yspacing = 1
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = SHADOW
+ shadow = IN
+ file = "mokomediaplayer/frame.png"
+ border = { 2, 2, 2, 2 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = SHADOW
+ shadow = OUT
+ file = "mokomediaplayer/frame.png"
+ border = { 0, 0, 0, 0 }
+ stretch = TRUE
+ }
+ }
+}
+widget "*omp-main-btm-progressbar" style "omp-main-btm-progressbar"
+
+
+style "omp-main-btm-button-box"
+{
+ bg_pixmap[NORMAL] = "mokomediaplayer/button_box.png"
+ xthickness = 0
+ ythickness = 6
+}
+widget "*omp-main-btm-button-box" style "omp-main-btm-button-box"
+
+
+style "omp-main-btm-button-box2"
+{
+ # This is the second (extended) row
+ bg[NORMAL] = "#000000"
+ xthickness = 0
+ ythickness = 6
+}
+widget "*omp-main-btm-button-box2" style "omp-main-btm-button-box2"
+
+
+style "omp-main-btm-button-expand"
+{
+ stock["image"] = {{ "mokomediaplayer/ico_expand.png" }}
+ xthickness = 0 # Override global GtkButton theming
+ ythickness = 0
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ state = NORMAL
+ file = "mokomediaplayer/btn_expand.png"
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ state = PRELIGHT
+ file = "mokomediaplayer/btn_expand.png"
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ state = ACTIVE
+ file = "mokomediaplayer/btn_expand.png"
+ stretch = TRUE
+ }
+ }
+
+
+}
+widget "*omp-main-btm-button-expand" style "omp-main-btm-button-expand"
+
+
+style "omp-main-btm-button-expand-placeholder"
+{
+ stock["image"] = {{ "mokomediaplayer/btn_expand_placeholder.png" }}
+}
+widget "*omp-main-btm-button-expand-placeholder" style "omp-main-btm-button-expand-placeholder"
+
+
+style "omp-main-btm-buttons"
+{
+ stock["rew_prev"] = {{ "mokomediaplayer/ico_rew_prev.png" }}
+ stock["ffwd_next"] = {{ "mokomediaplayer/ico_ffwd_next.png" }}
+ stock["play"] = {{ "mokomediaplayer/ico_play.png" }}
+ stock["pause"] = {{ "mokomediaplayer/ico_pause.png" }}
+ stock["repeat_off"] = {{ "mokomediaplayer/ico_repeat_off.png" }}
+ stock["repeat_once"] = {{ "mokomediaplayer/ico_repeat_once.png" }}
+ stock["repeat_current"] = {{ "mokomediaplayer/ico_repeat_current.png" }}
+ stock["repeat_all"] = {{ "mokomediaplayer/ico_repeat_all.png" }}
+ stock["shuffle_off"] = {{ "mokomediaplayer/ico_shuffle_off.png" }}
+ stock["shuffle_on"] = {{ "mokomediaplayer/ico_shuffle_on.png" }}
+ stock["preferences"] = {{ "mokomediaplayer/ico_preferences.png" }}
+
+ xthickness = 0 # Override global GtkButton theming
+ ythickness = 0
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ state = NORMAL
+ file = "mokomediaplayer/btn_white.png"
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ state = PRELIGHT
+ file = "mokomediaplayer/btn_white.png"
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ state = ACTIVE
+ file = "mokomediaplayer/btn_white_down.png"
+ stretch = TRUE
+ }
+ }
+
+
+}
+widget "*omp-main-btm-buttons" style "omp-main-btm-buttons"
+
+
+style "omp-main-btm-button-padding-y"
+{
+ # We have two outer button paddings: one for the expand button which
+ # must not have padding on the x axis and one for all others
+ xthickness = 0
+ ythickness = 5
+}
+widget "*omp-main-btm-button-padding-y" style "omp-main-btm-button-padding-y"
+
+
+style "omp-main-btm-button-padding-xy"
+{
+ # We have two outer button paddings: one for the expand button which
+ # must not have padding on the x axis and one for all others
+ xthickness = 12
+ ythickness = 6
+}
+widget "*omp-main-btm-button-padding-xy" style "omp-main-btm-button-padding-xy"
+
+
+style "omp-main-btm-volume"
+{
+ stock["volume00"] = {{ "mokomediaplayer/ico_volume_00.png" }}
+ stock["volume01"] = {{ "mokomediaplayer/ico_volume_01.png" }}
+ stock["volume02"] = {{ "mokomediaplayer/ico_volume_02.png" }}
+ stock["volume03"] = {{ "mokomediaplayer/ico_volume_03.png" }}
+ stock["volume04"] = {{ "mokomediaplayer/ico_volume_04.png" }}
+ stock["volume05"] = {{ "mokomediaplayer/ico_volume_05.png" }}
+ stock["volume06"] = {{ "mokomediaplayer/ico_volume_06.png" }}
+ stock["volume07"] = {{ "mokomediaplayer/ico_volume_07.png" }}
+ stock["volume08"] = {{ "mokomediaplayer/ico_volume_08.png" }}
+ stock["volume09"] = {{ "mokomediaplayer/ico_volume_09.png" }}
+ stock["volume10"] = {{ "mokomediaplayer/ico_volume_10.png" }}
+
+ fg[NORMAL] = "#d66900"
+ xthickness = 20
+ ythickness = 0
+}
+widget "*omp-main-btm-volume" style "omp-main-btm-volume"
+
+
+style "omp-main-btm-spacer"
+{
+ # Normally, the spacer is left blank but you can assign a
+ # background image if you want as it's an event box
+ ythickness = 13
+}
+widget "*omp-main-btm-spacer" style "omp-main-btm-spacer"
+
More information about the commitlog
mailing list