1
/* GCompris -- This files comes from XMMS
3
* XMMS - Cross-platform multimedia player
4
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
struct BoardPluginData *bp_data;
25
BoardPlugin *get_current_board_plugin(void)
27
return bp_data->current_board_plugin;
30
void set_current_board_plugin(BoardPlugin * bp)
32
bp_data->current_board_plugin = bp;
35
GcomprisBoard *get_current_gcompris_board(void)
37
return bp_data->current_gcompris_board;
40
void set_current_gcompris_board(GcomprisBoard * gcomprisBoard)
42
bp_data->current_gcompris_board = gcomprisBoard;
45
GList *get_board_list(void)
47
return bp_data->board_list;
50
gboolean board_check_file(GcomprisBoard *gcomprisBoard)
55
node = get_board_list();
58
bp = (BoardPlugin *) node->data;
59
if (bp && bp->is_our_board(gcomprisBoard))
68
void board_play(GcomprisBoard *gcomprisBoard)
73
node = get_board_list();
76
bp = (BoardPlugin *) node->data;
77
if (bp && bp->is_our_board(gcomprisBoard))
79
set_current_board_plugin(bp);
80
set_current_gcompris_board(gcomprisBoard);
81
bp->start_board(gcomprisBoard);
82
bp_data->playing = TRUE;
88
/* We set the playing flag even if no boardplugin
89
recognizes the board. This way we are sure it will be skipped. */
90
bp_data->playing = TRUE;
91
set_current_board_plugin(NULL);
94
void board_pause(void)
96
if (get_board_playing() && get_current_board_plugin())
98
bp_data->paused = !bp_data->paused;
99
get_current_board_plugin()->pause_board(bp_data->paused);
103
void board_stop(void)
105
if (bp_data->playing && get_current_board_plugin())
107
bp_data->playing = FALSE;
111
if (get_current_board_plugin()->end_board)
112
get_current_board_plugin()->end_board();
114
bp_data->paused = FALSE;
115
gcompris_end_board();
118
bp_data->playing = FALSE;
121
gboolean get_board_playing(void)
123
return bp_data->playing;
126
gboolean get_board_paused(void)
128
return bp_data->paused;
131
void board_about(gint index)
135
bp = g_list_nth(bp_data->board_list, index)->data;
140
void board_configure(gint index)
144
bp = g_list_nth(bp_data->board_list, index)->data;
145
if (bp && bp->configure)
150
/* Local Variables: */
152
/* eval:(load-library "time-stamp") */
153
/* eval:(make-local-variable 'write-file-hooks) */
154
/* eval:(add-hook 'write-file-hooks 'time-stamp) */
155
/* eval:(setq time-stamp-format '(time-stamp-yyyy/mm/dd time-stamp-hh:mm:ss user-login-name)) */