Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/gcompris
diff options
context:
space:
mode:
authorBruno Coudoin <bcoudoin@src.gnome.org>2008-03-15 22:49:39 (GMT)
committer Bruno Coudoin <bcoudoin@src.gnome.org>2008-03-15 22:49:39 (GMT)
commit70abd76ecda0ca643fb46a383c69ae76b3d7acd7 (patch)
treed76b92daec8f9fd19fddac925ab1478ffbc3c3fc /src/gcompris
parent782db1890b80e7e7cb780d04ff458fcabebcfdcd (diff)
- 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 * src/boards/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=/trunk/; revision=3309
Diffstat (limited to 'src/gcompris')
-rw-r--r--src/gcompris/about.c2
-rw-r--r--src/gcompris/board.c2
-rw-r--r--src/gcompris/bonus.c8
-rw-r--r--src/gcompris/gameutil.c22
-rw-r--r--src/gcompris/gameutil.h5
-rw-r--r--src/gcompris/gcompris.c15
-rw-r--r--src/gcompris/help.c6
7 files changed, 39 insertions, 21 deletions
diff --git a/src/gcompris/about.c b/src/gcompris/about.c
index 28082ed..5fb55a2 100644
--- a/src/gcompris/about.c
+++ b/src/gcompris/about.c
@@ -237,7 +237,7 @@ void gc_about_start ()
// Copyright
item = gnome_canvas_item_new (GNOME_CANVAS_GROUP(rootitem),
gnome_canvas_text_get_type (),
- "text", "Copyright 2000-2007 Bruno Coudoin and Others",
+ "text", "Copyright 2000-2008 Bruno Coudoin and Others",
"font", gc_skin_font_content,
"x", (double) BOARDWIDTH/2,
"y", (double) y - 95,
diff --git a/src/gcompris/board.c b/src/gcompris/board.c
index 05f23bf..5a0a4e2 100644
--- a/src/gcompris/board.c
+++ b/src/gcompris/board.c
@@ -366,6 +366,8 @@ gc_board_play(GcomprisBoard *gcomprisBoard)
bp->start_board(gcomprisBoard);
bp_data->playing = TRUE;
+ gc_activity_intro_play(gcomprisBoard);
+
return;
}
diff --git a/src/gcompris/bonus.c b/src/gcompris/bonus.c
index db2f83f..966a136 100644
--- a/src/gcompris/bonus.c
+++ b/src/gcompris/bonus.c
@@ -216,9 +216,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 !");
@@ -253,9 +251,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);
@@ -290,14 +286,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;
diff --git a/src/gcompris/gameutil.c b/src/gcompris/gameutil.c
index 1b8d976..f0e2842 100644
--- a/src/gcompris/gameutil.c
+++ b/src/gcompris/gameutil.c
@@ -1,8 +1,6 @@
/* gcompris - gameutil.c
*
- * Time-stamp: <2007-08-22 01:21:20 bruno>
- *
- * 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
@@ -657,3 +655,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);
+}
diff --git a/src/gcompris/gameutil.h b/src/gcompris/gameutil.h
index 9f5a1d0..aba9822 100644
--- a/src/gcompris/gameutil.h
+++ b/src/gcompris/gameutil.h
@@ -1,8 +1,6 @@
/* gcompris - gameutil.h
*
- * Time-stamp: <2007-08-22 01:21:17 bruno>
- *
- * 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
@@ -66,4 +64,5 @@ GnomeCanvasGroup *gc_difficulty_display(GnomeCanvasGroup *parent, double x, doub
gchar *gc_file_find_absolute(const gchar *filename, ...);
int gc_util_create_rootdir (gchar *rootdir);
+void gc_activity_intro_play (GcomprisBoard *gcomprisBoard);
#endif
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index cc65bcb..31d36de 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -51,7 +51,6 @@
#define DEFAULT_DATABASE "gcompris_sqlite.db"
/* Multiple instance check */
-static gchar *lock_file;
#define GC_LOCK_FILE "gcompris.lock"
#define GC_LOCK_LIMIT 30 /* seconds */
@@ -68,6 +67,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
@@ -1050,6 +1050,7 @@ static void cleanup()
signal(SIGINT, NULL);
signal(SIGSEGV, NULL);
+ single_instance_release(); /* Must be done before property destroy */
gc_board_stop();
gc_db_exit();
#ifdef XF86_VIDMODE
@@ -1057,7 +1058,6 @@ static void cleanup()
#endif
gc_menu_destroy();
gc_prop_destroy(gc_prop_get());
- g_unlink(lock_file);
}
void gc_exit()
@@ -1428,9 +1428,18 @@ 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;
diff --git a/src/gcompris/help.c b/src/gcompris/help.c
index 2f4c390..e82aaac 100644
--- a/src/gcompris/help.c
+++ b/src/gcompris/help.c
@@ -1,8 +1,6 @@
/* gcompris - help.c
*
- * Time-stamp: <2007-08-22 01:21:30 bruno>
- *
- * 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
@@ -101,6 +99,8 @@ void gc_help_start (GcomprisBoard *gcomprisBoard)
gc_board_pause(TRUE);
+ gc_activity_intro_play(gcomprisBoard);
+
item_selected = NULL;
item_selected_text = NULL;