Commit f8fe2178 authored by Bruno Coudoin's avatar Bruno Coudoin

many small improvements. now the focus api is reentrant to support

size changing items.


svn path=/branches/gcomprixogoo/; revision=3269
parent 7562d573
......@@ -111,7 +111,7 @@ static gdouble get_ratio(GdkPixbuf *pixmap, gdouble size);
#define D_INT_Y 5
#define I_X 140
#define I_Y 400
#define I_Y 410
#define I_W 600
#define I_H 125
......@@ -209,8 +209,6 @@ static void menu_start (GcomprisBoard *agcomprisBoard)
icon_size_panel = ICON_SIZE_PANEL;
icon_size_top = ICON_SIZE_TOP;
g_warning ("menu2 : start board");
if(agcomprisBoard != NULL)
{
gchar *img;
......@@ -460,9 +458,6 @@ static void menu_create_item(GooCanvasItem *parent, MenuItems *menuitems, Gcompr
ratio = get_ratio (menu_pixmap, icon_size);
if (ratio < 1.0)
g_warning("Resize %s", board->icon_name);
pixmap_w = gdk_pixbuf_get_width(menu_pixmap) * ratio;
pixmap_h = gdk_pixbuf_get_height(menu_pixmap) * ratio;
......@@ -493,7 +488,6 @@ static void menu_create_item(GooCanvasItem *parent, MenuItems *menuitems, Gcompr
/* We search a fixed path sound file */
soundfile = gc_file_find_absolute(board->mandatory_sound_file);
g_warning("Checking mandatory_sound_file %s\n", board->mandatory_sound_file);
if (!soundfile || !gc_prop_get()->fx)
{
......
......@@ -50,6 +50,7 @@ static void bar_reset_sound_id (void);
static void setup_item_signals (GooCanvasItem *item, gchar* name);
static gboolean _bar_down(void *ignore);
static void _bar_up();
static void _force_bar_down();
static gint current_level = -1;
static gint current_flags = -1;
......@@ -66,6 +67,7 @@ static GooCanvasItem *rootitem = NULL;
static gint sound_play_id = 0;
static gint bar_down_id = 0;
static gboolean _hidden;
static void confirm_quit(gboolean answer);
......@@ -238,7 +240,8 @@ void gc_bar_start (GooCanvas *theCanvas)
"visibility", GOO_CANVAS_ITEM_INVISIBLE,
NULL);
_bar_down(NULL);
_hidden = FALSE;
_force_bar_down(NULL);
}
......@@ -403,6 +406,26 @@ _bar_down(void *ignore)
return(FALSE);
}
static void
_force_bar_down()
{
if(bar_down_id)
g_source_remove (bar_down_id);
bar_down_id=0;
/* Hide it faster than normal */
goo_canvas_item_animate(rootitem,
0,
BOARDHEIGHT - 20,
1,
0,
TRUE,
100,
10,
GOO_CANVAS_ANIMATE_FREEZE);
}
static void
_bar_up()
{
......@@ -427,6 +450,8 @@ gc_bar_hide (gboolean hide)
/* Non yet initialized : Something Wrong */
g_assert(level_item);
_hidden = hide;
if(hide)
{
if(exit_item)
......@@ -456,6 +481,8 @@ gc_bar_hide (gboolean hide)
gc_bar_set(current_flags);
}
_force_bar_down();
}
/*-------------------------------------------------------------------------------*/
......@@ -523,6 +550,9 @@ on_enter_notify (GooCanvasItem *item,
GdkEventCrossing *event,
char *data)
{
if(_hidden)
return FALSE;
bar_reset_sound_id();
sound_play_id = g_timeout_add (1000, (GtkFunction) bar_play_sound, data);
_bar_up();
......
......@@ -234,7 +234,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
if(bp->is_our_board(gcomprisBoard)) {
/* Great, we found our plugin */
g_warning("We found the correct plugin for board %s (type=%s)\n",
g_message("We found the correct plugin for board %s (type=%s)\n",
gcomprisBoard->name, gcomprisBoard->type);
gcomprisBoard->plugin = bp;
......@@ -252,7 +252,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
if(bp->is_our_board(gcomprisBoard)) {
/* Great, we found our plugin */
g_warning("We found the correct plugin for board %s (type=%s)\n",
g_message("We found the correct plugin for board %s (type=%s)\n",
gcomprisBoard->name, gcomprisBoard->type);
gcomprisBoard->plugin = bp;
......@@ -262,7 +262,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
}
}
g_warning("No plugin library found for board type '%s', requested by '%s'",
g_message("No plugin library found for board type '%s', requested by '%s'",
gcomprisBoard->type, gcomprisBoard->filename);
return FALSE;
......@@ -295,7 +295,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
gmodule = g_module_open (gmodule_file, 0);
if(gmodule) {
g_warning("opened module %s with name %s\n", gmodule_file, type);
g_message("opened module %s with name %s\n", gmodule_file, type);
} else {
g_warning("Failed to open module %s with name %s (error=%s)\n", gmodule_file,
type, g_module_error());
......@@ -320,7 +320,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
if(bp->is_our_board(gcomprisBoard)) {
/* Great, we found our plugin */
g_warning("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
g_message("We found the correct plugin for board %s (type=%s)\n", gcomprisBoard->name, gcomprisBoard->type);
/* done in is_our_board gcomprisBoard->plugin = bp; */
......@@ -330,7 +330,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
return TRUE;
} else {
g_warning("We found a plugin with the name %s but is_our_board() returned FALSE (type=%s)\n",
g_message("We found a plugin with the name %s but is_our_board() returned FALSE (type=%s)\n",
gcomprisBoard->name,
gcomprisBoard->type);
}
......@@ -339,7 +339,7 @@ gc_board_check_file(GcomprisBoard *gcomprisBoard)
gcomprisBoard->filename);
}
}
g_warning("No plugin library found for board type '%s', requested by '%s'",
g_message("No plugin library found for board type '%s', requested by '%s'",
gcomprisBoard->type, gcomprisBoard->filename);
return FALSE;
......@@ -382,7 +382,7 @@ gc_board_pause(int pause)
if(gc_board_get_current_board_plugin()->pause_board)
gc_board_get_current_board_plugin()->pause_board(pause);
}
else g_warning ("No boards to pause ?");
else g_message ("No boards to pause ?");
}
void
......
......@@ -743,6 +743,7 @@ item_event_ok(GooCanvasItem *item,
"pixbuf", (properties->fullscreen ? pixmap_checked : pixmap_unchecked),
NULL);
gc_item_focus_init(item, NULL);
}
else if(!strcmp((char *)data, "music"))
{
......@@ -758,6 +759,7 @@ item_event_ok(GooCanvasItem *item,
{
gc_sound_bg_reopen();
}
gc_item_focus_init(item, NULL);
}
else if(!strcmp((char *)data, "effect"))
{
......@@ -765,6 +767,7 @@ item_event_ok(GooCanvasItem *item,
g_object_set (item,
"pixbuf", (properties->fx ? pixmap_checked : pixmap_unchecked),
NULL);
gc_item_focus_init(item, NULL);
}
else if(!strcmp((char *)data, "locale_previous"))
{
......
......@@ -238,6 +238,9 @@ gc_item_focus_event(GooCanvasItem *item, GooCanvasItem *target,
* Optionnaly, provide a target_item that will be focused
* by events on source_item.
*
* Warning: You must call it each time the size of the focused
* item size changes.
*
*/
#define GAP 4
void gc_item_focus_init(GooCanvasItem *source_item,
......@@ -245,6 +248,7 @@ void gc_item_focus_init(GooCanvasItem *source_item,
{
GooCanvasItem *highlight_item;
GooCanvasBounds bounds;
gboolean already_created = FALSE;
if(!target_item)
target_item = source_item;
......@@ -259,20 +263,25 @@ void gc_item_focus_init(GooCanvasItem *source_item,
highlight_item = g_object_get_data (G_OBJECT(target_item),
"highlight_item");
if(highlight_item)
{
already_created = TRUE;
goo_canvas_item_remove(highlight_item);
}
/* Create the highlight_item */
if(!highlight_item)
highlight_item =
goo_canvas_rect_new (goo_canvas_item_get_parent(target_item),
bounds.x1 - GAP,
bounds.y1 - GAP,
bounds.x2 - bounds.x1 + GAP*2,
bounds.y2 - bounds.y1 + GAP*2,
"stroke_color_rgba", 0xFFFFFFFFL,
"fill_color_rgba", 0xFF000090L,
"line-width", (double) 2,
"radius-x", (double) 10,
"radius-y", (double) 10,
NULL);
highlight_item =
goo_canvas_rect_new (goo_canvas_item_get_parent(target_item),
bounds.x1 - GAP,
bounds.y1 - GAP,
bounds.x2 - bounds.x1 + GAP*2,
bounds.y2 - bounds.y1 + GAP*2,
"stroke_color_rgba", 0xFFFFFFFFL,
"fill_color_rgba", 0xFF000090L,
"line-width", (double) 2,
"radius-x", (double) 10,
"radius-y", (double) 10,
NULL);
g_object_set_data (G_OBJECT(target_item), "highlight_item",
highlight_item);
......@@ -281,12 +290,15 @@ void gc_item_focus_init(GooCanvasItem *source_item,
"visibility", GOO_CANVAS_ITEM_INVISIBLE,
NULL);
g_signal_connect(source_item, "enter_notify_event",
(GtkSignalFunc) gc_item_focus_event,
target_item);
g_signal_connect(source_item, "leave_notify_event",
(GtkSignalFunc) gc_item_focus_event,
target_item);
if(!already_created)
{
g_signal_connect(source_item, "enter_notify_event",
(GtkSignalFunc) gc_item_focus_event,
target_item);
g_signal_connect(source_item, "leave_notify_event",
(GtkSignalFunc) gc_item_focus_event,
target_item);
}
}
/*
......
......@@ -376,12 +376,12 @@ board_widget_key_press_callback (GtkWidget *widget,
{
if (gtk_im_context_filter_keypress (properties->context, event))
{
g_warning("%d key is handled by context", kv);
g_message("%d key is handled by context", kv);
return TRUE;
}
}
g_warning("%d key is NOT handled by context", kv);
g_message("%d key is NOT handled by context", kv);
/* If the board needs to receive key pressed */
/* NOTE: If a board receives key press, it must bind the ENTER Keys to OK
* whenever possible
......@@ -637,14 +637,14 @@ static void setup_window ()
}
if(!icon_file)
g_warning ("Couldn't find file %s !", icon_file);
g_message ("Couldn't find file %s !", icon_file);
else
{
icon_pixbuf = gc_net_load_pixmap(icon_file);
if (!icon_pixbuf)
{
g_warning ("Failed to load pixbuf file: %s\n",
g_message ("Failed to load pixbuf file: %s\n",
icon_file);
}
g_free(icon_file);
......@@ -781,7 +781,7 @@ static void setup_window ()
gc_dialog(tmpstr, NULL);
g_free(tmpstr);
} else {
g_warning("Fine, we got the gcomprisBoardMenu, xml boards parsing went fine");
g_message("Fine, we got the gcomprisBoardMenu, xml boards parsing went fine");
gc_board_play(board_to_start);
}
......@@ -1047,7 +1047,7 @@ static void map_cb (GtkWidget *widget, gpointer data)
gc_fullscreen_set(properties->fullscreen);
is_mapped = TRUE;
}
g_warning("gcompris window is now mapped");
g_message("gcompris window is now mapped");
}
/*
......@@ -1057,7 +1057,7 @@ static void map_cb (GtkWidget *widget, gpointer data)
void gc_terminate(int signum)
{
g_warning("GCompris got the %d signal, starting exit procedure", signum);
g_message("GCompris got the %d signal, starting exit procedure", signum);
gc_exit();
......@@ -1065,55 +1065,30 @@ void gc_terminate(int signum)
static void load_properties ()
{
gchar *prefix_dir;
gchar *tmpstr;
properties = gc_prop_new ();
/* Initialize the binary relocation API
* http://autopackage.org/docs/binreloc/
*/
if(gbr_init (NULL))
g_warning("Binary relocation enabled");
g_message("Binary relocation enabled");
else
g_warning("Binary relocation disabled");
prefix_dir = gbr_find_prefix(NULL);
g_warning("prefix_dir=%s\n", prefix_dir);
/* Check if we are in the source code (developper usage) */
tmpstr = g_strconcat(prefix_dir, "/gcompris/gcompris.c", NULL);
if(g_file_test(tmpstr, G_FILE_TEST_EXISTS))
{
/* Set all directory to get data from the source code we are run in */
properties->package_data_dir = g_strconcat(prefix_dir, "/../boards", NULL);
/* In source code, locale mo files are not generated, use the installed one */
properties->package_locale_dir = g_strdup(PACKAGE_LOCALE_DIR);
g_message("Binary relocation disabled");
properties->package_plugin_dir = g_strconcat(prefix_dir, "/boards/.libs", NULL);
properties->package_python_plugin_dir = g_strconcat(prefix_dir, "/boards/python",
NULL);
properties->system_icon_dir = g_strconcat(prefix_dir, "/..", NULL);
properties->menu_dir = g_strdup(prefix_dir);
}
else
{
gchar *pkg_data_dir = gbr_find_data_dir(PACKAGE_DATA_DIR);
gchar *pkg_clib_dir = gbr_find_lib_dir(PACKAGE_CLIB_DIR);
properties->package_data_dir = g_strconcat(pkg_data_dir, "/gcompris/boards", NULL);
properties->package_locale_dir = gbr_find_locale_dir(PACKAGE_LOCALE_DIR);
properties->package_plugin_dir = g_strconcat(pkg_clib_dir, "/gcompris", NULL);
properties->package_python_plugin_dir = g_strconcat(pkg_data_dir, "/gcompris/python",
NULL);
properties->system_icon_dir = g_strconcat(pkg_data_dir, "/pixmaps", NULL);
properties->menu_dir = g_strdup(properties->package_data_dir);
g_free(pkg_data_dir);
g_free(pkg_clib_dir);
}
g_free(tmpstr);
g_free(prefix_dir);
{
gchar *pkg_data_dir = gbr_find_data_dir(PACKAGE_DATA_DIR);
gchar *pkg_clib_dir = gbr_find_lib_dir(PACKAGE_CLIB_DIR);
properties->package_data_dir = g_strconcat(pkg_data_dir, "/gcompris/boards", NULL);
properties->package_locale_dir = gbr_find_locale_dir(PACKAGE_LOCALE_DIR);
properties->package_plugin_dir = g_strconcat(pkg_clib_dir, "/gcompris", NULL);
properties->package_python_plugin_dir = g_strconcat(pkg_data_dir, "/gcompris/python",
NULL);
properties->system_icon_dir = g_strconcat(pkg_data_dir, "/pixmaps", NULL);
properties->menu_dir = g_strdup(properties->package_data_dir);
g_free(pkg_data_dir);
g_free(pkg_clib_dir);
}
/* Display the directory value we have */
printf("package_data_dir = %s\n", properties->package_data_dir);
......@@ -1199,10 +1174,10 @@ gc_locale_set(gchar *locale)
#endif
if(gc_locale!=NULL && strcmp(locale, gc_locale))
g_warning("Requested locale '%s' got '%s'", locale, gc_locale);
g_message("Requested locale '%s' got '%s'", locale, gc_locale);
if(gc_locale==NULL)
g_warning("Failed to set requested locale %s got %s", locale, gc_locale);
g_message("Failed to set requested locale %s got %s", locale, gc_locale);
/* Override the env locale to what the user requested */
/* This makes gettext to give us the new locale text */
......@@ -1238,7 +1213,7 @@ void gc_log_handler (const gchar *log_domain,
static void
start_bg_music (gchar *file)
{
g_warning ("start_bg_music %s", file);
g_message ("start_bg_music %s", file);
gc_sound_bg_reopen();
}
......@@ -1357,7 +1332,7 @@ main (int argc, char *argv[])
}
else
{
g_warning("Using %s as config directory.", popt_config_dir);
g_message("Using %s as config directory.", popt_config_dir);
g_free(properties->config_dir);
properties->config_dir = g_strdup(popt_config_dir);
}
......@@ -1409,21 +1384,21 @@ main (int argc, char *argv[])
if (popt_mute)
{
g_warning("Sound disabled");
g_message("Sound disabled");
properties->music = FALSE;
properties->fx = FALSE;
}
if (popt_sound)
{
g_warning("Sound enabled");
g_message("Sound enabled");
properties->music = TRUE;
properties->fx = TRUE;
}
if (popt_cursor)
{
g_warning("Default gnome cursor enabled");
g_message("Default gnome cursor enabled");
properties->defaultcursor = GDK_LEFT_PTR;
}
#ifdef WIN32
......@@ -1432,26 +1407,26 @@ main (int argc, char *argv[])
if (popt_experimental)
{
g_warning("Experimental boards allowed");
g_message("Experimental boards allowed");
properties->experimental = TRUE;
}
if (popt_no_quit)
{
g_warning("Disable quit button");
g_message("Disable quit button");
properties->disable_quit = TRUE;
}
if (popt_no_config)
{
g_warning("Disable config button");
g_message("Disable config button");
properties->disable_config = TRUE;
}
if (popt_difficulty_filter>=0)
{
/* This option provide less capacity than the GUI since we cannot set the filter_style */
g_warning("Display only activities of level %d", popt_difficulty_filter);
g_message("Display only activities of level %d", popt_difficulty_filter);
properties->difficulty_filter = popt_difficulty_filter;
properties->filter_style = GCOMPRIS_FILTER_EQUAL;
}
......@@ -1529,7 +1504,7 @@ main (int argc, char *argv[])
exit(0);
}
else {
g_warning("Using menu %s as root.", popt_root_menu);
g_message("Using menu %s as root.", popt_root_menu);
g_free(properties->root_menu);
properties->root_menu = g_strdup(popt_root_menu);
}
......@@ -1540,13 +1515,13 @@ main (int argc, char *argv[])
if ((!g_file_test(popt_user_dir, G_FILE_TEST_IS_DIR)) ||
(g_access(popt_user_dir, popt_administration? R_OK : W_OK ) == -1))
{
g_warning("%s does not exists or is not %s ", popt_user_dir,
g_message("%s does not exists or is not %s ", popt_user_dir,
popt_administration? "readable" : "writable");
exit(0);
}
else
{
g_warning("Using %s as user directory.", popt_user_dir);
g_message("Using %s as user directory.", popt_user_dir);
g_free(properties->user_dir);
properties->user_dir = g_strdup(popt_user_dir);
}
......@@ -1577,7 +1552,7 @@ main (int argc, char *argv[])
properties->config_dir,
properties->user_dir);
#ifdef USE_SQLITE
printf(" Database '%s'\n",properties->database);
printf(" Database '%s'\n", properties->database);
#endif
if (popt_create_db)
......@@ -1585,35 +1560,35 @@ main (int argc, char *argv[])
gchar *dirname = g_path_get_dirname (properties->database);
if (g_access(dirname, W_OK)==-1)
{
g_warning("Cannot create %s : %s is not writable !", properties->database, dirname);
g_message("Cannot create %s : %s is not writable !", properties->database, dirname);
exit (0);
}
/* We really want to recreate it, erase the old one */
g_warning("Removing %s database.", properties->database);
g_message("Removing %s database.", properties->database);
unlink(properties->database);
}
if (popt_administration){
if (popt_database){
if (g_access(popt_database,R_OK|W_OK)==-1){
g_warning("%s exists but is not writable", popt_database);
g_message("%s exists but is not writable", popt_database);
exit(0);
}
}
g_warning("Running in administration mode");
g_message("Running in administration mode");
properties->administration = TRUE;
g_warning("Music disabled");
g_message("Music disabled");
properties->music = FALSE;
properties->fx = FALSE;
g_warning("Fullscreen and cursor is disabled");
g_message("Fullscreen and cursor is disabled");
properties->fullscreen = FALSE;
properties->defaultcursor = GDK_LEFT_PTR;
}
if (popt_reread_menu){
g_warning("Rebuild db from xml files");
g_message("Rebuild db from xml files");
if (g_access(properties->database, W_OK)==-1)
g_warning("Cannot reread menu when database is read-only !");
g_message("Cannot reread menu when database is read-only !");
else
properties->reread_menu = TRUE;
}
......@@ -1648,7 +1623,7 @@ main (int argc, char *argv[])
else {
if (strcmp(popt_drag_mode, "both") == 0)
properties->drag_mode = GC_DRAG_MODE_BOTH;
else g_warning("Unknown drag mode ! Valids modes are \"normal\", \"2clicks\" and \"both\"");
else g_message("Unknown drag mode ! Valids modes are \"normal\", \"2clicks\" and \"both\"");
}
}
}
......
......@@ -209,7 +209,7 @@ _add_xml_to_data(xmlDocPtr doc, xmlNodePtr xmlnode, GNode * child,
credit
);
g_warning("db board written %d in %d %s/%s",
g_message("db board written %d in %d %s/%s",
gcomprisBoard->board_id, gcomprisBoard->section_id,
gcomprisBoard->section, gcomprisBoard->name);
......@@ -270,8 +270,8 @@ _read_xml_file(GcomprisBoard *gcomprisBoard,
if(!g_file_test ((filename), G_FILE_TEST_EXISTS))
{
g_warning("Couldn't find file %s !", fname);
g_warning("Couldn't find file %s !", filename);
g_message("Couldn't find file %s !", fname);
g_message("Couldn't find file %s !", filename);
g_free(filename);
g_free(gcomprisBoard);
return NULL;
......@@ -494,7 +494,6 @@ static GList *suppress_int_from_list(GList *list, int value)
}
cell = cell->next;
}
g_warning("suppress_int_from_list value %d not found", value);
return list;
}
......@@ -522,14 +521,14 @@ void gc_menu_load_dir(char *dirname, gboolean db){
GList *list_old_boards_id = NULL;
if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) {
g_warning("Failed to parse board in '%s' because it's not a directory\n", dirname);
g_message("Failed to parse board in '%s' because it's not a directory\n", dirname);
return;
}
dir = g_dir_open(dirname, 0, NULL);
if (!dir) {
g_warning("gc_menu_load : no menu found in %s", dirname);
g_message("gc_menu_load : no menu found in %s", dirname);
return;
} else {
if (db)
......
......@@ -46,7 +46,7 @@ gc_profile_set_current_user(GcomprisUser *user)
if (user)
properties->logged_user = user;
else {
g_warning("No user, getting one from system.");
g_message("No user, getting one from system.");
GcomprisUser *sys_user = g_malloc0(sizeof(GcomprisUser));
const gchar *user_name = g_get_user_name ();
......
......@@ -357,7 +357,7 @@ gc_prop_load (GcomprisProperties *props, GCPropSourceConf source_conf)
&length,
NULL)) {
g_warning("Loading config file '%s'", config_file);
g_message("Loading config file '%s'", config_file);
/* create a new scanner */
scanner = g_scanner_new(NULL);
......@@ -534,7 +534,6 @@ gc_prop_destroy (GcomprisProperties *props)
g_free(props->server);
g_free(props->root_menu);
g_free(props);
g_warning("properties free");
}
void
......
......@@ -79,11 +79,11 @@ fx_bus(GstBus* bus, GstMessage* msg, gpointer data)
switch( GST_MESSAGE_TYPE( msg ) )
{
case GST_MESSAGE_EOS:
g_warning("fx_bus: EOS START");
g_message("fx_bus: EOS START");
gc_sound_fx_close();
gc_sound_callback((gchar *)data);
fx_play();
g_warning("fx_bus: EOS END");
g_message("fx_bus: EOS END");
break;
default:
break;
......@@ -97,7 +97,7 @@ bg_bus(GstBus* bus, GstMessage* msg, gpointer data)
{
switch( GST_MESSAGE_TYPE( msg ) ) {
case GST_MESSAGE_EOS:
g_warning("bg_bus: EOS");
g_message("bg_bus: EOS");
gc_sound_bg_close();
bg_play(NULL);
break;
......@@ -129,7 +129,7 @@ gc_sound_bg_close()
void
gc_sound_fx_close()
{
g_warning("gc_sound_fx_close");
g_message("gc_sound_fx_close");
if (fx_pipeline)
{
gst_element_set_state(fx_pipeline, GST_STATE_NULL);
......@@ -242,7 +242,7 @@ bg_build_music_list()
dir = g_dir_open(music_dir, 0, NULL);
if (!dir) {
g_warning ("Couldn't open music dir: %s", music_dir);
g_message ("Couldn't open music dir: %s", music_dir);
g_free(music_dir);
return NULL;
}
......@@ -293,7 +293,7 @@ bg_play(gpointer dummy)
if(!bg_pipeline)
{
g_warning("Failed to build the gstreamer pipeline (for background music)");
g_message("Failed to build the gstreamer pipeline (for background music)");
gc_prop_get()->music = 0;
return NULL;
}
......@@ -304,7 +304,7 @@ bg_play(gpointer dummy)
gchar *uri = g_strconcat("file://", absolute_file, NULL);
g_free(absolute_file);
g_warning(" bg_play %s", uri);
g_message(" bg_play %s", uri);
g_object_set (G_OBJECT (bg_pipeline), "uri", uri, NULL);
......@@ -312,7 +312,7 @@ bg_play(gpointer dummy)
GST_STATE_PLAYING);
gst_element_get_state(bg_pipeline, NULL, NULL, 1000*GST_MSECOND);
if( statechanged == GST_STATE_CHANGE_SUCCESS) {
g_warning("%s : bg_playing\n",__FUNCTION__);
g_message("%s : bg_playing\n",__FUNCTION__);
}
g_free(uri);
......@@ -338,7 +338,7 @@ fx_play()
if(!file)
return;
g_warning(" fx_play %s", file);
g_message(" fx_play %s", file);
absolute_file = gc_file_find_absolute(file);
......@@ -350,14 +350,14 @@ fx_play()
if (!fx_pipeline)
{
g_warning("Failed to build the gstreamer pipeline");
g_message("Failed to build the gstreamer pipeline");
gc_prop_get()->fx = 0;
return;
}
gchar *uri = g_strconcat("file://", absolute_file, NULL);
g_free(absolute_file);
g_warning(" uri '%s'", uri);
g_message(" uri '%s'", uri);
g_object_set (G_OBJECT (fx_pipeline), "uri", uri, NULL);
gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (fx_pipeline)),
......@@ -367,7 +367,7 @@ fx_play()
GST_STATE_PLAYING);
gst_element_get_state(fx_pipeline, NULL, NULL, 1000*GST_MSECOND);
if( statechanged == GST_STATE_CHANGE_SUCCESS) {
g_warning("%s : fx_playing\n",__FUNCTION__);
g_message("%s : fx_playing\n",__FUNCTION__);
}
g_free(uri);
......@@ -387,7 +387,7 @@ get_next_sound_to_play( )
{
tmpSound = g_list_nth_data( pending_queue, 0 );
<