0
|
1 /* BMP - Cross-platform multimedia player
|
|
2 * Copyright (C) 2003-2004 BMP development team.
|
|
3 *
|
|
4 * Based on XMMS:
|
|
5 * Copyright (C) 1998-2003 XMMS development team.
|
|
6 *
|
|
7 * This program is free software; you can redistribute it and/or modify
|
|
8 * it under the terms of the GNU General Public License as published by
|
|
9 * the Free Software Foundation; either version 2 of the License, or
|
|
10 * (at your option) any later version.
|
|
11 *
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 * GNU General Public License for more details.
|
|
16 *
|
|
17 * You should have received a copy of the GNU General Public License
|
|
18 * along with this program; if not, write to the Free Software
|
|
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
20 */
|
|
21
|
|
22 #ifndef MAINWIN_H
|
|
23 #define MAINWIN_H
|
|
24
|
|
25 #include <gtk/gtk.h>
|
|
26
|
|
27 #include "number.h"
|
|
28 #include "pbutton.h"
|
|
29 #include "playstatus.h"
|
|
30 #include "tbutton.h"
|
|
31 #include "textbox.h"
|
|
32 #include "svis.h"
|
|
33 #include "vis.h"
|
|
34
|
|
35 /* yes, main window size is fixed */
|
|
36 #define MAINWIN_WIDTH (gint)275
|
|
37 #define MAINWIN_HEIGHT (gint)116
|
|
38 #define MAINWIN_TITLEBAR_HEIGHT (gint)14
|
|
39 #define MAINWIN_SHADED_HEIGHT MAINWIN_TITLEBAR_HEIGHT
|
|
40
|
|
41 #define MAINWIN_UPDATE_INTERVAL 10
|
|
42
|
|
43 #define MAINWIN_DEFAULT_POS_X 20
|
|
44 #define MAINWIN_DEFAULT_POS_Y 20
|
|
45
|
|
46 #define MAINWIN_DEFAULT_FONT "Sans Bold 9"
|
|
47
|
|
48
|
|
49 typedef enum {
|
|
50 TIMER_ELAPSED,
|
|
51 TIMER_REMAINING
|
|
52 } TimerMode;
|
|
53
|
|
54 enum {
|
|
55 MAINWIN_GENERAL_ABOUT,
|
|
56
|
|
57 MAINWIN_GENERAL_PLAYFILE,
|
|
58 MAINWIN_GENERAL_PLAYDIRECTORY,
|
|
59 MAINWIN_GENERAL_PLAYLOCATION,
|
|
60
|
|
61 MAINWIN_GENERAL_FILEINFO,
|
|
62 MAINWIN_GENERAL_PREFS,
|
|
63
|
|
64 MAINWIN_GENERAL_SHOWMWIN,
|
|
65 MAINWIN_GENERAL_SHOWPLWIN,
|
|
66
|
|
67 MAINWIN_GENERAL_FOCUSMWIN,
|
|
68 MAINWIN_GENERAL_FOCUSPLWIN,
|
|
69
|
|
70 MAINWIN_GENERAL_SHOWEQWIN,
|
|
71 MAINWIN_GENERAL_PLAYCD,
|
|
72 MAINWIN_GENERAL_EXIT,
|
|
73
|
|
74 MAINWIN_GENERAL_ADDCD,
|
|
75
|
|
76 MAINWIN_GENERAL_PREV,
|
|
77 MAINWIN_GENERAL_PLAY,
|
|
78 MAINWIN_GENERAL_PAUSE,
|
|
79 MAINWIN_GENERAL_STOP,
|
|
80 MAINWIN_GENERAL_NEXT,
|
|
81 MAINWIN_GENERAL_STOPFADE,
|
|
82 MAINWIN_GENERAL_BACK5SEC,
|
|
83 MAINWIN_GENERAL_FWD5SEC,
|
|
84 MAINWIN_GENERAL_START,
|
|
85 MAINWIN_GENERAL_BACK10,
|
|
86 MAINWIN_GENERAL_FWD10,
|
|
87 MAINWIN_GENERAL_JTT,
|
|
88 MAINWIN_GENERAL_JTF,
|
|
89 MAINWIN_GENERAL_QUEUE,
|
|
90 MAINWIN_GENERAL_CQUEUE,
|
|
91 MAINWIN_GENERAL_VOLUP,
|
|
92 MAINWIN_GENERAL_VOLDOWN
|
|
93 };
|
|
94
|
|
95 extern GtkWidget *mainwin;
|
|
96 extern GdkGC *mainwin_gc;
|
|
97
|
|
98 extern GtkAccelGroup *mainwin_accel;
|
|
99
|
|
100 extern gboolean mainwin_moving;
|
|
101 extern gboolean mainwin_focus;
|
|
102
|
|
103 extern GtkWidget *mainwin_jtf;
|
|
104
|
|
105 extern GtkItemFactory *mainwin_general_menu;
|
|
106 extern GtkItemFactory *mainwin_vis_menu;
|
|
107 extern GtkItemFactory *mainwin_play_menu, *mainwin_view_menu;
|
|
108
|
|
109 extern TextBox *mainwin_info;
|
|
110 extern TButton *mainwin_shuffle, *mainwin_repeat, *mainwin_eq, *mainwin_pl;
|
|
111
|
|
112 extern Vis *active_vis;
|
|
113 extern Vis *mainwin_vis;
|
|
114 extern SVis *mainwin_svis;
|
|
115
|
|
116 extern PlayStatus *mainwin_playstatus;
|
|
117
|
|
118
|
|
119 void mainwin_create(void);
|
|
120 void read_volume(gint when);
|
|
121 void play_medium(void);
|
|
122 void add_medium(void);
|
|
123
|
|
124 void draw_main_window(gboolean);
|
|
125
|
|
126 void mainwin_quit_cb(void);
|
|
127 void mainwin_lock_info_text(const gchar * text);
|
|
128 void mainwin_release_info_text(void);
|
|
129 void mainwin_play_pushed(void);
|
|
130 void mainwin_stop_pushed(void);
|
|
131 void mainwin_eject_pushed(void);
|
|
132
|
|
133 void mainwin_set_back_pixmap(void);
|
|
134
|
|
135 void mainwin_adjust_volume_motion(gint v);
|
|
136 void mainwin_adjust_volume_release(void);
|
|
137 void mainwin_adjust_balance_motion(gint b);
|
|
138 void mainwin_adjust_balance_release(void);
|
|
139 void mainwin_set_volume_slider(gint percent);
|
|
140 void mainwin_set_balance_slider(gint percent);
|
|
141
|
|
142 void mainwin_vis_set_type(VisType mode);
|
|
143
|
|
144 void mainwin_set_info_text(void);
|
|
145 void mainwin_set_song_info(gint rate, gint freq, gint nch);
|
|
146 void mainwin_clear_song_info(void);
|
|
147
|
|
148 void mainwin_set_always_on_top(gboolean always);
|
|
149 void mainwin_set_volume_diff(gint diff);
|
|
150 void mainwin_set_balance_diff(gint diff);
|
|
151
|
|
152 void mainwin_show(gboolean);
|
|
153 void mainwin_real_show(void);
|
|
154 void mainwin_real_hide(void);
|
|
155 void mainwin_move(gint x, gint y);
|
|
156 void mainwin_shuffle_pushed(gboolean toggled);
|
|
157 void mainwin_repeat_pushed(gboolean toggled);
|
|
158 void mainwin_disable_seekbar(void);
|
|
159 void mainwin_set_title(const gchar * text);
|
|
160 void mainwin_run_dirbrowser(void);
|
|
161 void mainwin_show_add_url_window(void);
|
|
162 void mainwin_minimize_cb(void);
|
|
163 void mainwin_general_menu_callback(gpointer cb_data,
|
|
164 guint action,
|
|
165 GtkWidget * widget);
|
|
166
|
|
167 void mainwin_attach_idle_func(void);
|
|
168 void mainwin_drag_data_received(GtkWidget * widget,
|
|
169 GdkDragContext * context,
|
|
170 gint x,
|
|
171 gint y,
|
|
172 GtkSelectionData * selection_data,
|
|
173 guint info,
|
|
174 guint time,
|
|
175 gpointer user_data);
|
|
176
|
|
177 void mainwin_setup_menus(void);
|
|
178
|
|
179 void mainwin_jump_to_file(void);
|
|
180 void mainwin_jump_to_time(void);
|
|
181
|
|
182 void mainwin_ewmh_activate(void);
|
|
183
|
|
184 /* FIXME: placed here for now */
|
|
185 void playback_get_sample_params(gint * bitrate,
|
|
186 gint * frequency,
|
|
187 gint * numchannels);
|
|
188
|
|
189 #endif
|