annotate Plugins/Output/crossfade/monitor.c @ 395:0923a41170bb trunk

[svn] Add S3M support back after receiving a convincing testcase.
author chainsaw
date Sat, 07 Jan 2006 06:18:13 -0800
parents 8528a27ada8f
children 5b81b0f310e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
259
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
1 /*
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
2 * XMMS Crossfade Plugin
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
3 * Copyright (C) 2000-2004 Peter Eisenlohr <peter@eisenlohr.org>
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
4 *
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
5 * based on the original OSS Output Plugin
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
6 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
7 *
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
11 * (at your option) any later version.
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
12 *
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
16 * GNU General Public License for more details.
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
17 *
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
21 * USA.
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
22 */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
23
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
25 # include "config.h"
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
26 #endif
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
27
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
28 #include <string.h>
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
29 #include <gtk/gtk.h>
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
30
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
31 #include "monitor.h"
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
32 #include "crossfade.h"
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
33
338
8528a27ada8f [svn] Stop last few desperate attempts to hold on to GTK1+ includes.
chainsaw
parents: 265
diff changeset
34 #include "interface-2.0.h"
259
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
35 #include "support.h"
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
36
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
37
265
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
38 GtkWidget *monitor_win;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
39 GtkWidget *monitor_display_drawingarea;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
40 GtkProgress *monitor_output_progress;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
41 GtkLabel *monitor_position_label;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
42 GtkLabel *monitor_total_label;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
43 GtkLabel *monitor_left_label;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
44 GtkLabel *monitor_output_time_label;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
45 GtkLabel *monitor_output_time_sep;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
46 GtkLabel *monitor_written_time_label;
259
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
47
265
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
48 gchar *default_position_str = NULL;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
49 gchar *default_total_str = NULL;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
50 gchar *default_left_str = NULL;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
51 gchar *default_output_time_str = NULL;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
52 gchar *default_written_time_str = NULL;
259
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
53
265
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
54 gboolean monitor_active = FALSE;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
55 guint monitor_tag;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
56 gint monitor_output_max;
118aab0618f1 [svn] fix breakage
nenolod
parents: 261
diff changeset
57 gint monitor_closing;
259
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
58
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
59 #define RUNNING 0
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
60 #define CLOSING 1
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
61 #define CLOSED 2
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
62
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
63 #define SMOD(x,n) (((x)<0)?((n)-(x))%(n):((x)%(n)))
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
64
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
65
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
66 static void draw_wrapped(GtkWidget *widget, gint pos, gint width, GdkGC *gc)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
67 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
68 GdkDrawable *win = widget->window;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
69
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
70 gint ww = widget->allocation.width;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
71 gint wh = widget->allocation.height;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
72
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
73 if(width <= 0) return;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
74 if(width < ww) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
75 gint x = SMOD(pos, ww);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
76 if((x+width) >= ww) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
77 gdk_draw_rectangle(win, gc, TRUE, x, 0, ww-x, wh);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
78 gdk_draw_rectangle(win, gc, TRUE, 0, 0, width-(ww-x), wh);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
79 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
80 else gdk_draw_rectangle(win, gc, TRUE, x, 0, width, wh);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
81 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
82 else gdk_draw_rectangle(win, gc, TRUE, 0, 0, ww, wh);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
83 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
84
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
85 gboolean on_monitor_display_drawingarea_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
86 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
87 if(buffer && buffer->size && output_opened) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
88 gint ww = widget->allocation.width;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
89
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
90 gint x1 = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
91 gint x2 = buffer->used;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
92 gint x3 = buffer->used + buffer->mix;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
93 gint x4 = buffer->size;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
94
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
95 x1 = (gint64)(x1 + buffer->rd_index) * ww / buffer->size;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
96 x2 = (gint64)(x2 + buffer->rd_index) * ww / buffer->size;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
97 x3 = (gint64)(x3 + buffer->rd_index) * ww / buffer->size;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
98 x4 = (gint64)(x4 + buffer->rd_index) * ww / buffer->size;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
99
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
100 draw_wrapped(widget, x1, x2-x1, widget->style->fg_gc[GTK_STATE_NORMAL]);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
101 draw_wrapped(widget, x2, x3-x2, widget->style->white_gc);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
102 draw_wrapped(widget, x3, x4-x3, widget->style->bg_gc[GTK_STATE_NORMAL]);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
103 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
104 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
105 gdk_window_clear_area(widget->window,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
106 event->area.x, event->area.y,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
107 event->area.width, event->area.height);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
108 return TRUE;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
109 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
110
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
111 gboolean on_monitor_win_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
112 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
113 /* V0.1.1 20000618: removed, didn't make much sense since it wasn't saved */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
114 /* if(config) config->enable_monitor = FALSE; */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
115 if(default_position_str) { g_free(default_position_str); default_position_str = NULL; }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
116 if(default_total_str) { g_free(default_total_str); default_total_str = NULL; }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
117 if(default_left_str) { g_free(default_left_str); default_left_str = NULL; }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
118 if(default_output_time_str) { g_free(default_output_time_str); default_output_time_str = NULL; }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
119 if(default_written_time_str) { g_free(default_written_time_str); default_written_time_str = NULL; }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
120 return(FALSE); /* FALSE: destroy window */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
121 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
122
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
123 extern GtkWindow *mainwin;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
124
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
125 void xfade_check_monitor_win()
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
126 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
127 gchar *str;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
128
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
129 if(config->enable_monitor) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
130 if(!monitor_win && !(monitor_win = create_monitor_win())) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
131 DEBUG(("[crossfade] check_monitor_win: error creating window!\n"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
132 return;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
133 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
134
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
135 /* automatically set config_win to NULL when window is destroyed */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
136 gtk_signal_connect(GTK_OBJECT(monitor_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &monitor_win);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
137
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
138 /* show window */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
139 gtk_widget_show(monitor_win);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
140
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
141 /* get pointers to widgets (used by crossfade.c to update the monitor) */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
142 monitor_display_drawingarea = lookup_widget(monitor_win, "monitor_display_drawingarea");
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
143 monitor_output_progress = GTK_PROGRESS(lookup_widget(monitor_win, "monitor_output_progress"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
144 monitor_position_label = GTK_LABEL (lookup_widget(monitor_win, "monpos_position_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
145 monitor_total_label = GTK_LABEL (lookup_widget(monitor_win, "monpos_total_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
146 monitor_left_label = GTK_LABEL (lookup_widget(monitor_win, "monpos_left_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
147 monitor_output_time_label = GTK_LABEL (lookup_widget(monitor_win, "monpos_output_time_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
148 monitor_output_time_sep = GTK_LABEL (lookup_widget(monitor_win, "monpos_output_time_separator_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
149 monitor_written_time_label = GTK_LABEL (lookup_widget(monitor_win, "monpos_written_time_label"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
150
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
151 /* get default strings (displayed when monitor is stopped) */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
152 if(!default_position_str) { gtk_label_get(monitor_position_label, &str); default_position_str = g_strdup(str); }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
153 if(!default_total_str) { gtk_label_get(monitor_total_label, &str); default_total_str = g_strdup(str); }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
154 if(!default_left_str) { gtk_label_get(monitor_left_label, &str); default_left_str = g_strdup(str); }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
155 if(!default_output_time_str) { gtk_label_get(monitor_output_time_label, &str); default_output_time_str = g_strdup(str); }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
156 if(!default_written_time_str) { gtk_label_get(monitor_written_time_label, &str); default_written_time_str = g_strdup(str); }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
157
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
158 /* force gtk_progress_configure */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
159 monitor_output_max = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
160 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
161 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
162 if(monitor_win) gtk_widget_destroy(monitor_win);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
163 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
164
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
165 void label_set_text(GtkLabel *label, gchar *text)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
166 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
167 gchar *old_text;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
168 gtk_label_get(label, &old_text);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
169 if(strcmp(old_text, text) == 0) return;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
170 gtk_label_set_text(label, text);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
171 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
172
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
173 gint xfade_update_monitor(gpointer userdata)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
174 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
175 /* HACK: (see xfade_stop_monitor() below) */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
176 if(monitor_closing == CLOSED)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
177 return TRUE;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
178
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
179 if(monitor_closing == CLOSING)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
180 monitor_closing = CLOSED;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
181
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
182 if(!monitor_win)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
183 return TRUE;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
184
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
185 /* lock buffer (only if we need to) */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
186 if(monitor_closing != CLOSED)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
187 g_static_mutex_lock(&buffer_mutex);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
188
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
189 if(1 || monitor_win) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
190 gint output_time = the_op->output_time();
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
191 gint written_time = the_op->written_time();
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
192 gint output_used = written_time - output_time;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
193
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
194 /*** Mixing Buffer ***/
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
195 if(1 || monitor_display_drawingarea) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
196 GdkRectangle update_rect;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
197
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
198 update_rect.x = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
199 update_rect.y = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
200 update_rect.width = monitor_display_drawingarea->allocation.width;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
201 update_rect.height = monitor_display_drawingarea->allocation.height;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
202
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
203 if(monitor_closing == CLOSED)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
204 gdk_window_clear_area(monitor_display_drawingarea->window,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
205 update_rect.x, update_rect.y,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
206 update_rect.width, update_rect.height);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
207 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
208 gtk_widget_draw(monitor_display_drawingarea, &update_rect);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
209 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
210
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
211 /*** Output Buffer ***/
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
212 if(1 || monitor_output_progress) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
213 if(monitor_closing == CLOSED) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
214 gtk_progress_configure(monitor_output_progress, 0, 0, 0);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
215 monitor_output_max = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
216 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
217 else {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
218 if(output_opened && the_op->buffer_playing()) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
219 if(output_used < 0) output_used = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
220 if(output_used > monitor_output_max) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
221 monitor_output_max = output_used;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
222 gtk_progress_configure(monitor_output_progress,
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
223 output_used, 0, monitor_output_max);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
224 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
225 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
226 gtk_progress_set_value(monitor_output_progress, output_used);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
227 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
228 else {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
229 gtk_progress_configure(monitor_output_progress, 0, 0, 0);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
230 monitor_output_max = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
231 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
232 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
233 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
234
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
235 /*** Position ***/
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
236 if(1 || (monitor_position_label && monitor_total_label && monitor_left_label)) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
237 if(!bmp_playback_get_playing() || (monitor_closing == CLOSED)) { /* XMMS */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
238 gtk_label_set_text(monitor_position_label, default_position_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
239 gtk_label_set_text(monitor_total_label, default_total_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
240 gtk_label_set_text(monitor_left_label, default_left_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
241 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
242 else {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
243 gchar buffer[32];
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
244 gint position = output_time - output_offset;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
245 gint total = playlist_get_current_length(); /* XMMS */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
246 gint left = total - position;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
247
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
248 /* position */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
249 g_snprintf(buffer, sizeof(buffer),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
250 position < 0 ? "-%d:%02d.%01d" : "%d:%02d.%01d",
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
251 ABS((position/60000)),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
252 ABS((position/1000) % 60),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
253 ABS((position/100) % 10));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
254 gtk_label_set_text(monitor_position_label, buffer);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
255
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
256 /* total */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
257 if(total > 0) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
258 g_snprintf(buffer, sizeof(buffer), "%d:%02d", total/60000, (total/1000)%60);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
259 gtk_label_set_text(monitor_total_label, buffer);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
260 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
261 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
262 label_set_text(monitor_total_label, default_total_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
263
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
264
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
265 /* left */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
266 if(total > 0) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
267 g_snprintf(buffer, sizeof(buffer), "%d:%02d", left/60000, (left/1000)%60);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
268 gtk_label_set_text(monitor_left_label, buffer);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
269 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
270 else
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
271 label_set_text(monitor_left_label, default_left_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
272 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
273 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
274
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
275 /*** Output Plugin position */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
276 if(1 || (monitor_written_time_label && monitor_output_time_label)) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
277 if(monitor_closing == CLOSED) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
278 gtk_widget_hide(GTK_WIDGET(monitor_output_time_label));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
279 gtk_widget_hide(GTK_WIDGET(monitor_output_time_sep));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
280 gtk_label_set_text(monitor_written_time_label, default_written_time_str);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
281 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
282 else {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
283 gchar buffer[32];
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
284
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
285 /* check for output plugin bug -- diff should always be 0 */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
286 gint diff = written_time - (gint)(output_streampos * 1000 / OUTPUT_BPS);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
287 if(diff) {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
288 gtk_widget_show(GTK_WIDGET(monitor_output_time_label));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
289 gtk_widget_show(GTK_WIDGET(monitor_output_time_sep));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
290
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
291 g_snprintf(buffer, sizeof(buffer),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
292 output_time < 0 ? "-%d:%02d.%03d" : "%d:%02d.%03d",
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
293 ABS((diff/60000)),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
294 ABS((diff/1000) % 60),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
295 ABS((diff) % 1000));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
296 gtk_label_set_text(monitor_output_time_label, buffer);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
297 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
298 else {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
299 gtk_widget_hide(GTK_WIDGET(monitor_output_time_label));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
300 gtk_widget_hide(GTK_WIDGET(monitor_output_time_sep));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
301 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
302
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
303 /* written_time */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
304 g_snprintf(buffer, sizeof(buffer),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
305 written_time < 0 ? "-%d:%02d:%02d.%01d" : "%d:%02d:%02d.%01d",
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
306 ABS((written_time/3600000)),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
307 ABS((written_time/60000) % 60),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
308 ABS((written_time/1000) % 60),
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
309 ABS((written_time/100) % 10));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
310 gtk_label_set_text(monitor_written_time_label, buffer);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
311 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
312 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
313 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
314
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
315 /* unlock buffer */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
316 if(monitor_closing != CLOSED)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
317 g_static_mutex_unlock(&buffer_mutex);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
318
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
319 return TRUE; /* continue calling this function */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
320 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
321
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
322 void xfade_start_monitor()
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
323 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
324 if(monitor_active) return;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
325 monitor_output_max = 0;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
326 monitor_closing = RUNNING;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
327 monitor_active = TRUE;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
328 monitor_tag = gtk_timeout_add(UPDATE_INTERVAL, xfade_update_monitor, NULL);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
329 }
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
330
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
331 void xfade_stop_monitor()
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
332 {
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
333 gint max_wait = UPDATE_INTERVAL/10+1+1; /* round up / add safety */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
334
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
335 if(!monitor_active) return;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
336
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
337 /* HACK, ugly HACK: force a final call of xfade_update_monitor */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
338 monitor_closing = CLOSING;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
339 while((monitor_closing == CLOSING) && (max_wait-- > 0))
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
340 xmms_usleep(10000);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
341
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
342 if(max_wait <= 0)
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
343 DEBUG(("[crossfade] stop_monitor: timeout!\n"));
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
344
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
345 /* stop calling xfade_update_monitor() */
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
346 gtk_timeout_remove(monitor_tag);
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
347 monitor_active = FALSE;
88b38e2414a1 [svn] First attempt at porting the crossfade plugin; patches from bug #363 applied, GThreadified, includes fixed. Will most probably not compile as of yet.
chainsaw
parents:
diff changeset
348 }