summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.h
blob: a5ee3b4c0d094bddda2dca62121f466c72d8ecae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 *
 * Copyright (C) 2003 by Benjamin Metzler
 *
 * All files in this archive are subject to the GNU General Public License.
 * See the file COPYING in the source tree root for full license agreement.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/

#ifndef __BOOKMARK_H__
#define __BOOKMARK_H__

#include <stdbool.h>

#if CONFIG_KEYPAD == ONDIO_PAD
#define BOOKMARK_SELECT_PRE BUTTON_RIGHT
#define BOOKMARK_SELECT (BUTTON_RIGHT | BUTTON_REL)
#define BOOKMARK_DELETE (BUTTON_RIGHT | BUTTON_REPEAT)
#define BOOKMARK_DOWN BUTTON_DOWN

#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
      (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define BOOKMARK_SELECT BUTTON_SELECT
#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_SELECT)
#define BOOKMARK_DOWN BUTTON_DOWN
#define BOOKMARK_RC_SELECT BUTTON_RC_MENU
#define BOOKMARK_RC_DELETE (BUTTON_RC_ON | BUTTON_RC_MENU)
#define BOOKMARK_RC_DOWN BUTTON_RC_FF
#define BOOKMARK_RC_EXIT BUTTON_RC_STOP

#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
#define BOOKMARK_SELECT BUTTON_SELECT
#define BOOKMARK_DELETE (BUTTON_RIGHT | BUTTON_REPEAT)
#define BOOKMARK_DOWN BUTTON_SCROLL_FWD

#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define BOOKMARK_SELECT BUTTON_SELECT
#define BOOKMARK_DELETE (BUTTON_PLAY | BUTTON_SELECT)
#define BOOKMARK_DOWN BUTTON_DOWN

#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define BOOKMARK_SELECT BUTTON_SELECT
#define BOOKMARK_DELETE BUTTON_REC | BUTTON_REPEAT
#define BOOKMARK_DOWN BUTTON_DOWN

#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define BOOKMARK_SELECT BUTTON_MENU
#define BOOKMARK_DELETE BUTTON_POWER
#define BOOKMARK_DOWN BUTTON_A

#else /* player, recorder, gmini */
#define BOOKMARK_SELECT BUTTON_PLAY
#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_PLAY)
#define BOOKMARK_DOWN BUTTON_DOWN

#endif

bool bookmark_load_menu(void);
bool bookmark_autobookmark(void);
bool bookmark_create_menu(void);
bool bookmark_mrb_load(void);
bool bookmark_autoload(const char* file);
bool bookmark_load(const char* file, bool autoload);
void bookmark_play(char* resume_file, int index, int offset, int seed,
                   char *filename);
bool bookmark_exist(void);

#endif /* __BOOKMARK_H__ */