mp3splt-gtk

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

player_tab.h
1 /**********************************************************
2 *
3 * mp3splt-gtk -- utility based on mp3splt,
4 * for mp3/ogg splitting without decoding
5 *
6 * Copyright (c) 2005-2012 Alexandru Munteanu - io_fx@yahoo.fr
7 *
8 * http://mp3splt.sourceforge.net/
9 *
10 *********************************************************/
11
12 /**********************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 * USA.
28 *
29 *********************************************************/
30
31 /**********************************************************
32 * Filename: player_tab.h
33 *
34 * header of player_tab.c
35 *
36 *********************************************************/
37
38 #ifndef _PLAYER_TAB_H
39 #define _PLAYER_TAB_H
40
41 #define ICON_EXT ".svg"
42
43 #define DEFAULT_TIMEOUT_VALUE 200
44
46 typedef struct
47 {
48 long time;
49 float level;
50 } silence_wave;
51
52 //float comparison
53 #define DELTA 5
54
55 //for the browse dir
56 #define BROWSE_SONG 1
57 #define BROWSE_CDDB_FILE 2
58 #define BROWSE_CUE_FILE 3
59
60 void player_quick_preview(gint splitpoint_to_preview);
61 void check_update_down_progress_bar();
62 void set_preview_active_if_needed();
63 void cancel_quick_preview_all();
64 void cancel_quick_preview();
65 void check_cancel_quick_preview(gint i);
66 void get_splitpoint_time_left_right(gint *time_left,
67 gint *time_right,
68 gint *splitpoint_left);
69 gint mytimer(gpointer data);
70 void reset_inactive_progress_bar();
71 void reset_inactive_volume_button();
72 void reset_label_time();
73 void reset_song_infos();
74 void reset_song_name_label();
75 void clear_data_player();
76 void enable_player_buttons();
77 void disable_player_buttons();
78 void connect_change_buttons();
79 void disconnect_change_buttons();
80 void connect_with_song(const gchar *fname, gint i);
81 void connect_to_player_with_song(gint i);
82 void connect_button_event (GtkWidget *widget,
83 gpointer data);
84 void check_stream();
85 void disconnect_button_event (GtkWidget *widget,
86 gpointer data);
87 void play_event (GtkWidget *widget, gpointer data);
88 void stop_event (GtkWidget *widget, gpointer data);
89 void pause_event (GtkWidget *widget, gpointer data);
90 void prev_button_event (GtkWidget *widget, gpointer data);
91 void next_button_event (GtkWidget *widget, gpointer data);
92 void change_song_position();
93 GtkWidget *create_player_buttons_hbox(GtkTreeView *tree_view);
94 GtkWidget *create_song_informations_hbox();
95 gboolean progress_bar_unclick_event (GtkWidget *widget,
96 GdkEventCrossing *event,
97 gpointer user_data);
98 gboolean progress_bar_click_event (GtkWidget *widget,
99 GdkEventCrossing *event,
100 gpointer user_data);
101 gfloat get_total_time();
102 gfloat get_elapsed_time();
103 void refresh_drawing_area();
104 void progress_bar_value_changed_event (GtkRange *range,
105 gpointer user_data);
106 gboolean progress_bar_scroll_event (GtkWidget *widget,
107 GdkEventScroll *event,
108 gpointer user_data);
109 gboolean progress_bar_enter_event (GtkWidget *widget,
110 GdkEventCrossing *event,
111 gpointer user_data);
112 gboolean progress_bar_leave_event (GtkWidget *widget,
113 GdkEventCrossing *event,
114 gpointer user_data);
115 GtkWidget *create_song_bar_hbox();
116 void print_about_the_song();
117 void print_player_filename();
118 void print_all_song_infos();
119 void print_song_time_elapsed();
120 void change_volume_button();
121 void change_progress_bar();
122 GtkWidget *create_filename_player_hbox();
123 void change_volume_event(GtkScaleButton *volume_button, gdouble value, gpointer data);
124
125 gboolean volume_button_unclick_event (GtkWidget *widget,
126 GdkEventCrossing *event,
127 gpointer user_data);
128 gboolean volume_button_click_event (GtkWidget *widget,
129 GdkEventCrossing *event,
130 gpointer user_data);
131 gboolean volume_button_enter_event (GtkWidget *widget,
132 GdkEventCrossing *event,
133 gpointer user_data);
134 gboolean volume_button_leave_event (GtkWidget *widget,
135 GdkEventCrossing *event,
136 gpointer user_data);
137 gboolean volume_button_scroll_event (GtkWidget *widget,
138 GdkEventScroll *event,
139 gpointer user_data);
140 GtkWidget *create_volume_control_box();
141 void close_player_popup_window_event( GtkWidget *window,
142 gpointer data );
143 void handle_player_detached_event (GtkHandleBox *handlebox,
144 GtkWidget *widget,
145 gpointer data);
146 gfloat get_right_drawing_time();
147 gfloat get_left_drawing_time();
148 gint get_time_hundrsecs(gint time);
149 gint get_time_secs(gint time);
150 gint get_time_mins(gint time);
151 gchar *get_time_for_drawing(gchar *str,
152 gint time,
153 gboolean hundr_or_not,
154 gint *number_of_chars);
155 gint time_to_pixels(gint width,
156 gfloat time);
157 gfloat pixels_to_time(gfloat width,
158 gint pixels);
159 gint get_draw_line_position(gint width,
160 gfloat time);
161 void draw_motif(GtkWidget *da,cairo_t *gc,
162 gint ylimit,gint x,gint model);
163 void draw_marks(gint time_interval,
164 gint left_mark,gint right_mark,
165 gint ylimit, GtkWidget *da, cairo_t *gc);
166 //motif for splitpoints
167 //draw is false if we draw the splitpoint we move
168 void draw_motif_splitpoints(GtkWidget *da, cairo_t *gc,
169 gint x,gint draw,
170 gint current_point_hundr_secs,
171 gboolean move,
172 gint number_splitpoint);
173 void draw_splitpoints(gint left_mark,
174 gint right_mark,
175 GtkWidget *da,
176 cairo_t *gc);
177 gboolean da_expose_event (GtkWidget *da,
178 GdkEventExpose *event,
179 gpointer data);
180 gboolean da_press_event (GtkWidget *da,
181 GdkEventButton *event,
182 gpointer data);
183 gboolean da_unpress_event (GtkWidget *da,
184 GdkEventButton *event,
185 gpointer data);
186 gboolean da_notify_event (GtkWidget *da,
187 GdkEventMotion *event,
188 gpointer data);
189 GtkWidget *create_drawing_area();
190 GtkWidget *create_player_control_frame(GtkTreeView *tree_view);
191
192 //moved from the file_tab
193 void file_chooser_cancel_event();
194 void file_chooser_ok_event(gchar *fname);
195 void browse_button_event( GtkWidget *widget,
196 gpointer data );
197 void close_file_popup_window_event( GtkWidget *window,
198 gpointer data );
199 void handle_file_detached_event (GtkHandleBox *handlebox,
200 GtkWidget *widget,
201 gpointer data);
202 GtkWidget *create_choose_file_frame();
203
204 void change_current_filename(const gchar *fname);
205 GtkWidget *create_player_playlist_frame();
206
207 void hide_connect_button();
208 void show_connect_button();
209 void hide_disconnect_button();
210 void show_disconnect_button();
211
212 void inputfilename_set(const gchar *filename);
213 gchar *inputfilename_get();
214
215 void build_path(GString *path, const gchar *dir, const gchar *filename);
216
217 void close_playlist_popup_window_event(GtkWidget *window, gpointer data);
218 void restart_player_timer();
219
220 #endif
221