annotate src/aosd/aosd_osd.c @ 805:1ba5f86aeac9 trunk

[svn] - should check data != NULL before clear data->playing.
author yaz
date Mon, 12 Mar 2007 09:12:26 -0700
parents 87bd9a74ca4f
children 623eca8326e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
1 /*
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
2 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
4 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify it
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
6 * under the terms of the GNU General Public License as published by the
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
7 * Free Software Foundation; either version 2 of the License, or (at your
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
8 * option) any later version.
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
9 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful, but
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
13 * General Public License for more details.
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
14 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License along
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
16 * with this program; if not, write to the Free Software Foundation, Inc.,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
18 *
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
19 */
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
20
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
21 #include "aosd_osd.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
22 #include "aosd_style.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
23 #include "aosd_style_private.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
24 #include "aosd_cfg.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
25 #include <glib.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
26 #include <X11/Xlib.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
27 #include <cairo/cairo.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
28 #include <pango/pangocairo.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
29 #include <gdk/gdk.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
30 #include <stdlib.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
31 #include <sys/time.h>
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
32 #include "ghosd.h"
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
33
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
34
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
35 #define AOSD_STATUS_HIDDEN 0
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
36 #define AOSD_STATUS_FADEIN 1
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
37 #define AOSD_STATUS_SHOW 2
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
38 #define AOSD_STATUS_FADEOUT 3
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
39 #define AOSD_STATUS_DESTROY 4
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
40 /* updating OSD every 50 msec */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
41 #define AOSD_TIMING 50
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
42
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
43
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
44 typedef struct
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
45 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
46 cairo_surface_t * surface;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
47 gfloat alpha;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
48 gpointer user_data;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
49 gint width;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
50 gint height;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
51 gint deco_code;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
52 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
53 GhosdFadeData;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
54
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
55
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
56 typedef struct
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
57 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
58 gchar * markup_message;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
59 gboolean cfg_is_copied;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
60 gfloat dalpha_in, dalpha_out, ddisplay_stay;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
61
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
62 PangoContext *pango_context;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
63 PangoLayout *pango_layout;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
64
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
65 aosd_cfg_osd_t * cfg_osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
66
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
67 GhosdFadeData fade_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
68 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
69 GhosdData;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
70
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
71
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
72 static gint osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
73 static gint osd_status = AOSD_STATUS_HIDDEN;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
74 static Ghosd *osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
75 static GhosdData *osd_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
76
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
77
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
78 static void
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
79 aosd_osd_data_alloc ( gchar * markup_string , aosd_cfg_osd_t * cfg_osd , gboolean copy_cfg )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
80 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
81 osd_data = g_malloc0(sizeof(GhosdData));
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
82 osd_data->markup_message = g_strdup( markup_string );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
83 if ( copy_cfg == TRUE )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
84 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
85 osd_data->cfg_osd = aosd_cfg_osd_copy( cfg_osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
86 osd_data->cfg_is_copied = TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
87 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
88 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
89 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
90 osd_data->cfg_osd = cfg_osd;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
91 osd_data->cfg_is_copied = FALSE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
92 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
93 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
94 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
95
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
96
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
97 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
98 aosd_osd_data_free ( void )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
99 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
100 if ( osd_data->fade_data.surface != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
101 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
102 cairo_surface_destroy( osd_data->fade_data.surface );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
103 osd_data->fade_data.surface = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
104 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
105
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
106 if ( osd_data->markup_message != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
107 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
108 g_free( osd_data->markup_message );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
109 osd_data->markup_message = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
110 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
111
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
112 if ( osd_data->cfg_is_copied == TRUE )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
113 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
114 aosd_cfg_osd_delete( osd_data->cfg_osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
115 osd_data->cfg_osd = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
116 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
117
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
118 if ( osd_data->pango_layout != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
119 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
120 g_object_unref( osd_data->pango_layout );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
121 osd_data->pango_layout = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
122 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
123
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
124 if ( osd_data->pango_context != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
125 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
126 g_object_unref( osd_data->pango_context );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
127 osd_data->pango_context = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
128 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
129
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
130 g_free( osd_data );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
131 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
132
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
133
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
134 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
135 aosd_osd_hideanddestroy ( void )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
136 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
137 if ( osd != NULL )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
138 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
139 ghosd_hide( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
140 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
141 ghosd_destroy( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
142 osd = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
143 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
144 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
145 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
146
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
147
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
148 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
149 aosd_fade_func ( Ghosd * gosd , cairo_t * cr , void * user_data )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
150 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
151 GhosdFadeData *fade_data = user_data;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
152
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
153 if ( fade_data->surface == NULL )
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
154 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
155 cairo_t *rendered_cr;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
156 fade_data->surface = cairo_surface_create_similar( cairo_get_target( cr ) ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
157 CAIRO_CONTENT_COLOR_ALPHA , fade_data->width , fade_data->height );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
158 rendered_cr = cairo_create( fade_data->surface );
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
159 aosd_deco_style_render( fade_data->deco_code , gosd , rendered_cr , fade_data->user_data );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
160 cairo_destroy( rendered_cr );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
161 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
162
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
163 cairo_set_source_surface( cr , fade_data->surface , 0 , 0 );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
164 cairo_paint_with_alpha( cr , fade_data->alpha );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
165 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
166
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
167
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
168 static void
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
169 aosd_button_func ( Ghosd * gosd , GhosdEventButton * ev , void * user_data )
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
170 {
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
171 if ( ev->button == 1 )
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
172 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
173 osd_status = AOSD_STATUS_DESTROY; /* move to status destroy */
592
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
174 }
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
175 return;
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
176 }
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
177
546e779aba64 [svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents: 591
diff changeset
178
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
179 static void
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
180 aosd_osd_create ( void )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
181 {
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
182 gint max_width, layout_width, layout_height;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
183 GdkScreen *screen = gdk_screen_get_default();
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
184 gint pos_x = 0, pos_y = 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
185 gint pad_left = 0 , pad_right = 0 , pad_top = 0 , pad_bottom = 0;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
186 gint screen_width, screen_height;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
187 aosd_deco_style_data_t style_data;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
188
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
189 /* calculate screen_width and screen_height */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
190 if ( osd_data->cfg_osd->position.multimon_id > -1 )
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
191 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
192 /* adjust coordinates and size according to selected monitor */
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
193 GdkRectangle rect;
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
194 gdk_screen_get_monitor_geometry( screen , osd_data->cfg_osd->position.multimon_id , &rect );
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
195 pos_x = rect.x;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
196 pos_y = rect.y;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
197 screen_width = rect.width;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
198 screen_height = rect.height;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
199 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
200 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
201 {
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
202 /* use total space available, even when composed by multiple monitor */
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
203 screen_width = gdk_screen_get_width( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
204 screen_height = gdk_screen_get_height( screen );
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
205 pos_x = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
206 pos_y = 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
207 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
208
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
209 /* pick padding from selected decoration style */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
210 aosd_deco_style_get_padding( osd_data->cfg_osd->decoration.code ,
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
211 &pad_top , &pad_bottom , &pad_left , &pad_right );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
212
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
213 if ( osd_data->cfg_osd->position.maxsize_width > 0 )
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
214 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
215 gint max_width_default = screen_width - pad_left - pad_right - abs(osd_data->cfg_osd->position.offset_x);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
216 max_width = osd_data->cfg_osd->position.maxsize_width - pad_left - pad_right;
587
289c08270c7b [svn] - aosd: prevent user from setting an excessively large max_width
giacomo
parents: 586
diff changeset
217 /* ignore user-defined max_width if it is too small or too large */
588
1e2792ece36b [svn] - aosd: fix typo
giacomo
parents: 587
diff changeset
218 if (( max_width < 1 ) || ( max_width > max_width_default ))
587
289c08270c7b [svn] - aosd: prevent user from setting an excessively large max_width
giacomo
parents: 586
diff changeset
219 max_width = max_width_default;
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
220 }
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
221 else
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
222 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
223 max_width = screen_width - pad_left - pad_right - abs(osd_data->cfg_osd->position.offset_x);
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
224 }
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
225 osd_data->pango_context = pango_cairo_font_map_create_context(
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
226 PANGO_CAIRO_FONT_MAP(pango_cairo_font_map_get_default()));
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
227 osd_data->pango_layout = pango_layout_new(osd_data->pango_context);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
228 pango_layout_set_markup( osd_data->pango_layout, osd_data->markup_message , -1 );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
229 pango_layout_set_ellipsize( osd_data->pango_layout , PANGO_ELLIPSIZE_NONE );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
230 pango_layout_set_justify( osd_data->pango_layout , FALSE );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
231 pango_layout_set_width( osd_data->pango_layout , PANGO_SCALE * max_width );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
232 pango_layout_get_pixel_size( osd_data->pango_layout , &layout_width , &layout_height );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
233
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
234 osd = ghosd_new();
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
235
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
236 /* osd position */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
237 switch ( osd_data->cfg_osd->position.placement )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
238 {
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
239 case AOSD_POSITION_PLACEMENT_TOP:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
240 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
241 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
242 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
243 case AOSD_POSITION_PLACEMENT_TOPRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
244 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
245 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
246 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
247 case AOSD_POSITION_PLACEMENT_MIDDLELEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
248 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
249 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
250 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
251 case AOSD_POSITION_PLACEMENT_MIDDLE:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
252 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
253 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
254 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
255 case AOSD_POSITION_PLACEMENT_MIDDLERIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
256 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
257 pos_y += (screen_height - (layout_height + pad_top + pad_bottom)) / 2;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
258 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
259 case AOSD_POSITION_PLACEMENT_BOTTOMLEFT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
260 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
261 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
262 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
263 case AOSD_POSITION_PLACEMENT_BOTTOM:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
264 pos_x += (screen_width - (layout_width + pad_left + pad_right)) / 2;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
265 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
266 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
267 case AOSD_POSITION_PLACEMENT_BOTTOMRIGHT:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
268 pos_x += screen_width - (layout_width + pad_left + pad_right);
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
269 pos_y += screen_height - (layout_height + pad_top + pad_bottom);
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
270 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
271 case AOSD_POSITION_PLACEMENT_TOPLEFT:
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
272 default:
586
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
273 pos_x += 0;
26519231a4f4 [svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents: 569
diff changeset
274 pos_y += 0;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
275 break;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
276 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
277
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
278 /* add offset to position */
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
279 pos_x += osd_data->cfg_osd->position.offset_x;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
280 pos_y += osd_data->cfg_osd->position.offset_y;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
281
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
282 ghosd_set_position( osd , pos_x , pos_y ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
283 layout_width + pad_left + pad_right ,
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
284 layout_height + pad_top + pad_bottom );
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
285
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
286 ghosd_set_event_button_cb( osd , aosd_button_func , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
287
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
288 style_data.layout = osd_data->pango_layout;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
289 style_data.text = &(osd_data->cfg_osd->text);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
290 style_data.decoration = &(osd_data->cfg_osd->decoration);
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
291 osd_data->fade_data.surface = NULL;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
292 osd_data->fade_data.user_data = &style_data;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
293 osd_data->fade_data.width = layout_width + pad_left + pad_right;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
294 osd_data->fade_data.height = layout_height + pad_top + pad_bottom;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
295 osd_data->fade_data.alpha = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
296 osd_data->fade_data.deco_code = osd_data->cfg_osd->decoration.code;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
297 osd_data->dalpha_in = 1.0 / ( osd_data->cfg_osd->animation.timing_fadein / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
298 osd_data->dalpha_out = 1.0 / ( osd_data->cfg_osd->animation.timing_fadeout / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
299 osd_data->ddisplay_stay = 1.0 / ( osd_data->cfg_osd->animation.timing_display / (gfloat)AOSD_TIMING );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
300 ghosd_set_render( osd , (GhosdRenderFunc)aosd_fade_func , &(osd_data->fade_data) , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
301
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
302 /* show the osd (with alpha 0, invisible) */
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
303 ghosd_show( osd );
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
304 return;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
305 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
306
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
307
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
308 static gboolean
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
309 aosd_timer_func ( gpointer none )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
310 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
311 static gfloat display_time = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
312
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
313 switch ( osd_status )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
314 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
315 case AOSD_STATUS_FADEIN:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
316 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
317 /* fade in */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
318 osd_data->fade_data.alpha += osd_data->dalpha_in;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
319 if ( osd_data->fade_data.alpha < 1.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
320 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
321 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
322 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
323 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
324 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
325 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
326 osd_data->fade_data.alpha = 1.0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
327 display_time = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
328 osd_status = AOSD_STATUS_SHOW; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
329 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
330 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
331 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
332 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
333 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
334
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
335 case AOSD_STATUS_SHOW:
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
336 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
337 display_time += osd_data->ddisplay_stay;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
338 if ( display_time >= 1.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
339 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
340 osd_status = AOSD_STATUS_FADEOUT; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
341 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
342 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
343 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
344 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
345 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
346 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
347 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
348 }
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
349
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
350 case AOSD_STATUS_FADEOUT:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
351 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
352 /* fade out */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
353 osd_data->fade_data.alpha -= osd_data->dalpha_out;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
354 if ( osd_data->fade_data.alpha > 0.0 )
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
355 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
356 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
357 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
358 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
359 else
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
360 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
361 osd_data->fade_data.alpha = 0.0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
362 osd_status = AOSD_STATUS_DESTROY; /* move to next phase */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
363 ghosd_render( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
364 ghosd_main_iterations( osd );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
365 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
366 return TRUE;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
367 }
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
368
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
369 case AOSD_STATUS_DESTROY:
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
370 {
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
371 aosd_osd_hideanddestroy();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
372 aosd_osd_data_free();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
373
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
374 osd_status = AOSD_STATUS_HIDDEN; /* reset status */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
375 osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
376 return FALSE;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
377 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
378 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
379
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
380 return TRUE;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
381 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
382
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
383
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
384 gint
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
385 aosd_display ( gchar * markup_string , aosd_cfg_osd_t * cfg_osd , gboolean copy_cfg )
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
386 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
387 if ( osd_status == AOSD_STATUS_HIDDEN )
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
388 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
389 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
390 aosd_osd_create();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
391 osd_status = AOSD_STATUS_FADEIN;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
392 osd_source_id = g_timeout_add_full( G_PRIORITY_DEFAULT_IDLE , AOSD_TIMING ,
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
393 aosd_timer_func , NULL , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
394 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
395 else
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
396 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
397 g_source_remove( osd_source_id ); /* remove timer */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
398 osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
399 aosd_osd_hideanddestroy();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
400 aosd_osd_data_free();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
401 osd_status = AOSD_STATUS_HIDDEN;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
402 /* now display new OSD */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
403 aosd_osd_data_alloc( markup_string , cfg_osd , copy_cfg );
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
404 aosd_osd_create();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
405 osd_status = AOSD_STATUS_FADEIN;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
406 osd_source_id = g_timeout_add_full( G_PRIORITY_DEFAULT_IDLE , AOSD_TIMING ,
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
407 aosd_timer_func , NULL , NULL );
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
408 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
409 return 0;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
410 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
411
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
412
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
413 void
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
414 aosd_shutdown ( void )
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
415 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
416 if ( osd_status != AOSD_STATUS_HIDDEN ) /* osd is being displayed */
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
417 {
780
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
418 g_source_remove( osd_source_id ); /* remove timer */
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
419 osd_source_id = 0;
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
420 aosd_osd_hideanddestroy();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
421 aosd_osd_data_free();
985d000c343c [svn] - aosd: experimental single-threaded osd; now the osd works in the same thread of the player, thus issues related to cairo and pango hopefully should go away; further testing on different system is required
giacomo
parents: 623
diff changeset
422 osd_status = AOSD_STATUS_HIDDEN;
569
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
423 }
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
424 return;
d401f87f89f7 [svn] - added Audacious OSD, yet-another-written-from-scratch plugin to display OSD, based on Ghosd library; currently untied from configure, to compile it you have to run make in its directory; will be added to configure after some testing
giacomo
parents:
diff changeset
425 }