Commit c4b0f22f authored by Bruno Coudoin's avatar Bruno Coudoin

merge from trunk r3309

	- It is now possible to add activity introduction voices.
	  If provided, it will be played when the activity starts and when
	  it's help is requested.
	  To provide an activity intro, you must put it under:
	  boards/voices/<locale>/activity/<activity name>-intro.ogg

	* configure.in: removed reference to cairo as goocanvas detects it
	* src/erase-activty/erase.c: (start_board), (end_board),
	(erase_one_item): moved the audio mode PLAY_AND_INTERRUPT only on
	the last item to avoid an intro voice to be cut.
	* src/gcompris/about.c: (gc_about_start): copyright is 2008 now.
	* src/gcompris/board.c: (gc_board_play): added support to play an
	optional intro voice a the start of an activity
	* src/gcompris/help.c: (gc_board_play): added support to play an
	optional intro voice when the help is lanched.
	* src/gcompris/bonus.c: (gc_bonus_display), (bonus_image):
	cleanup, removed extra warnings.
	* src/gcompris/gcompris.c: (cleanup), (single_instance_release),
	(single_instance_check): fixed the release of the lock when GC is exited.
	* src/gcompris/gameutil.c: (gc_activity_intro_play) created this function


svn path=/branches/gcomprixogoo/; revision=3312
parent 01637ce1
2008-03-15 Bruno coudoin <bruno.coudoin@free.fr>
merge from trunk r3309
- It is now possible to add activity introduction voices.
If provided, it will be played when the activity starts and when
it's help is requested.
To provide an activity intro, you must put it under:
boards/voices/<locale>/activity/<activity name>-intro.ogg
* configure.in: removed reference to cairo as goocanvas detects it
* src/erase-activty/erase.c: (start_board), (end_board),
(erase_one_item): moved the audio mode PLAY_AND_INTERRUPT only on
the last item to avoid an intro voice to be cut.
* src/gcompris/about.c: (gc_about_start): copyright is 2008 now.
* src/gcompris/board.c: (gc_board_play): added support to play an
optional intro voice a the start of an activity
* src/gcompris/help.c: (gc_board_play): added support to play an
optional intro voice when the help is lanched.
* src/gcompris/bonus.c: (gc_bonus_display), (bonus_image):
cleanup, removed extra warnings.
* src/gcompris/gcompris.c: (cleanup), (single_instance_release),
(single_instance_check): fixed the release of the lock when GC is exited.
* src/gcompris/gameutil.c: (gc_activity_intro_play) created this function
2008-03-14 Bruno coudoin <bruno.coudoin@free.fr>
* src/runit.sh: added support for bin/gcompris case
......
......@@ -16,14 +16,6 @@ sqlite_ldflags =
sqlite_cflags =
endif
if USE_CAIRO
cairo_ldflags = $(CAIRO_LIBS)
cairo_cflags = $(CAIRO_CFLAGS)
else
cairo_ldflags =
cairo_cflags =
endif
if PLATFORM_WIN32
shared = -shared
no_undefined = -no-undefined
......@@ -52,7 +44,6 @@ INCLUDES = \
$(PYTHON_CFLAGS) \
$(PYGTK_CFLAGS) \
$(sqlite_cflags) \
$(cairo_cflags) \
$(dll_export)
libmenu_la_LDFLAGS = $(shared) $(no_undefined) -module -avoid-version $(gc_libs)
......
/* gcompris - erase.c
*
* Copyright (C) 2001 Bruno Coudoin
* Copyright (C) 2001, 2008 Bruno Coudoin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -27,7 +27,6 @@ typedef struct {gint count; gint max;} counter;
static GcomprisBoard *gcomprisBoard = NULL;
static gboolean board_paused = TRUE;
static SoundPolicy sound_policy;
static RsvgHandle *CoverPixmap[MAX_LAYERS];
static gulong event_handle_id;
......@@ -209,10 +208,6 @@ static void start_board (GcomprisBoard *agcomprisBoard)
gamewon = FALSE;
pause_board(FALSE);
/* initial state to restore */
sound_policy = gc_sound_policy_get();
gc_sound_policy_set(PLAY_AND_INTERRUPT);
GcomprisProperties *properties = gc_prop_get ();
if(properties->defaultcursor == GCOMPRIS_DEFAULT_CURSOR)
{
......@@ -250,7 +245,6 @@ static void end_board ()
erase_destroy_all_items();
}
gcomprisBoard = NULL;
gc_sound_policy_set(sound_policy);
}
/* ======================================= */
......@@ -465,6 +459,7 @@ erase_one_item (GooCanvasItem *item)
{
gdouble screen_x, screen_y;
int x,y;
SoundPolicy sound_policy = gc_sound_policy_get();
goo_canvas_convert_from_item_space(goo_canvas_item_get_canvas(item),
item, &screen_x, &screen_y);
......@@ -476,17 +471,26 @@ erase_one_item (GooCanvasItem *item)
goo_canvas_item_remove(item);
if(number_of_items%2)
gc_sound_play_ogg ("sounds/eraser1.wav", NULL);
else
gc_sound_play_ogg ("sounds/eraser2.wav", NULL);
if(--number_of_items == 0)
{
gamewon = TRUE;
erase_destroy_all_items();
timer_id = gtk_timeout_add (4000, (GtkFunction) bonus, NULL);
}
/* force a cleanup of the sound queue */
if(number_of_items == 0)
gc_sound_policy_set(PLAY_AND_INTERRUPT);
if(number_of_items%2)
gc_sound_play_ogg ("sounds/eraser1.wav", NULL);
else
gc_sound_play_ogg ("sounds/eraser2.wav", NULL);
if(number_of_items == 0)
gc_sound_policy_set(sound_policy);
normal_delay_id = 0;
return FALSE;
}
......
......@@ -218,7 +218,7 @@ void gc_about_start ()
// Copyright
item = goo_canvas_text_new (rootitem,
"Copyright 2000-2007 Bruno Coudoin and Others",
"Copyright 2000-2008 Bruno Coudoin and Others",
(gdouble) BOARDWIDTH/2,
(gdouble) y - 95,
-1,
......
......@@ -369,6 +369,8 @@ gc_board_play(GcomprisBoard *gcomprisBoard)
/* Force the bar to go on top of the activities canvas items */
gc_bar_hide (FALSE);
gc_activity_intro_play(gcomprisBoard);
return;
}
......
......@@ -199,9 +199,7 @@ gc_bonus_display(GCBonusStatusList gamewon, GCBonusList bonus_id)
g_assert(bonus_id < GC_BONUS_LAST);
g_warning("bar_hide...");
gc_bar_hide(TRUE);
g_warning("bar_hide... ok");
if (bonus_display_running) {
g_warning("error bonus_display_running !");
......@@ -236,9 +234,7 @@ gc_bonus_display(GCBonusStatusList gamewon, GCBonusList bonus_id)
}
/* First pause the board */
g_warning("Pausing board ...");
gc_board_pause(TRUE);
g_warning("Pausing board ...ok");
if(bonus_id==GC_BONUS_RANDOM)
bonus_id = RAND(1, GC_BONUS_LAST);
......@@ -273,14 +269,10 @@ bonus_image(char *image, GCBonusStatusList gamewon)
int x,y;
GdkPixbuf *pixmap = NULL;
g_warning("Bonus_image: gc_board_get_current...");
GcomprisBoard *gcomprisBoard = gc_board_get_current();
g_assert(gcomprisBoard);
g_warning("Bonus_image: gc_board_get_current... ok");
/* check that bonus_group is a singleton */
if (bonus_group != NULL) {
bonus_display_running = FALSE;
......
/* gcompris - gameutil.c
*
* Copyright (C) 2000-2006 Bruno Coudoin
* Copyright (C) 2000, 2008 Bruno Coudoin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -661,3 +661,21 @@ gc_util_create_rootdir (gchar *rootdir)
return(g_mkdir(rootdir, 0755));
}
/** Play the activity intro voice
*
* \param gcomprisboard
*
* return void
*/
void
gc_activity_intro_play (GcomprisBoard *gcomprisBoard)
{
gchar *str;
str = gc_file_find_absolute("voices/$LOCALE/activity/%s-intro.ogg",
gcomprisBoard->name, NULL);
gc_sound_play_ogg(str, NULL);
g_free(str);
}
/* gcompris - gameutil.h
*
* Copyright (C) 2000 Bruno Coudoin
* Copyright (C) 2000, 2008 Bruno Coudoin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -62,4 +62,5 @@ GooCanvasItem *gc_difficulty_display(GooCanvasItem *parent, double x, double y,
gchar *gc_file_find_absolute(const gchar *filename, ...);
int gc_util_create_rootdir (gchar *rootdir);
void gc_activity_intro_play (GcomprisBoard *gcomprisBoard);
#endif
......@@ -52,7 +52,6 @@
static double zoom_factor = 1.0;
/* Multiple instance check */
static gchar *lock_file;
#define GC_LOCK_FILE "gcompris.lock"
#define GC_LOCK_LIMIT 30 /* seconds */
......@@ -77,6 +76,7 @@ static gint board_widget_key_press_callback (GtkWidget *widget,
GdkEventKey *event,
gpointer client_data);
void gc_terminate(int signum);
static void single_instance_release();
/*
* For the Activation dialog
......@@ -1011,12 +1011,12 @@ static void cleanup()
signal(SIGINT, NULL);
signal(SIGSEGV, NULL);
single_instance_release(); /* Must be done before property destroy */
gc_board_stop();
gc_db_exit();
gc_fullscreen_set(FALSE);
gc_menu_destroy();
gc_prop_destroy(gc_prop_get());
g_unlink(lock_file);
}
void gc_exit()
......@@ -1231,10 +1231,19 @@ start_bg_music (gchar *file)
}
/* Single instance Check */
static void
single_instance_release()
{
gchar *lock_file = g_strdup_printf("%s/%s", properties->config_dir, GC_LOCK_FILE);
g_unlink(lock_file);
g_free(lock_file);
}
static void
single_instance_check()
{
lock_file = g_strdup_printf("%s/%s", properties->config_dir, GC_LOCK_FILE);
gchar *lock_file = g_strdup_printf("%s/%s", properties->config_dir, GC_LOCK_FILE);
if(!popt_nolockcheck)
{
GTimeVal current_time;
......
/* gcompris - help.c
*
* Copyright (C) 2000 Bruno Coudoin
* Copyright (C) 2000, 2008 Bruno Coudoin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -103,6 +103,8 @@ void gc_help_start (GcomprisBoard *gcomprisBoard)
gc_board_pause(TRUE);
gc_activity_intro_play(gcomprisBoard);
item_selected = NULL;
item_selected_text = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment