Mercurial > audlegacy-plugins
annotate src/aosd/aosd_osd.c @ 780:985d000c343c trunk
[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
author | giacomo |
---|---|
date | Sun, 04 Mar 2007 16:45:52 -0800 |
parents | 443de962d0a0 |
children | 87bd9a74ca4f |
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 <pthread.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 <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
|
32 #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
|
33 #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
|
34 |
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
|
35 |
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
|
36 #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
|
37 #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
|
38 #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
|
39 #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
|
40 #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
|
41 /* 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
|
42 #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
|
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 |
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 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
|
46 { |
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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 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
|
52 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
|
53 } |
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 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
|
55 |
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
|
56 |
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
|
57 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
|
58 { |
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 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
|
60 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
|
61 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
|
62 |
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 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
|
64 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
|
65 |
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 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
|
67 |
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 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
|
69 } |
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 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
|
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 |
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_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
|
74 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
|
75 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
|
76 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
|
77 |
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
|
78 |
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
|
79 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
|
80 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
|
81 { |
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 = 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
|
83 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
|
84 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
|
85 { |
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_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
|
87 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
|
88 } |
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 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
|
90 { |
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_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
|
92 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
|
93 } |
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 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
|
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 |
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 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
|
99 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
|
100 { |
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 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
|
102 { |
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 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
|
104 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
|
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 |
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 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
|
108 { |
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 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
|
110 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
|
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 |
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 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
|
114 { |
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 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
|
116 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
|
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 |
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 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
|
120 { |
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 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
|
122 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
|
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 |
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 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
|
126 { |
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 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
|
128 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
|
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 |
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 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
|
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 |
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 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
|
136 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
|
137 { |
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 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
|
139 { |
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_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
|
141 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
|
142 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
|
143 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
|
144 } |
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 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
|
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 |
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 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
|
150 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
|
151 { |
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 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
|
153 |
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 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
|
155 { |
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 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
|
157 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
|
158 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
|
159 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
|
160 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
|
161 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
|
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 |
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_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
|
165 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
|
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 |
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
|
168 |
592
546e779aba64
[svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents:
591
diff
changeset
|
169 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
|
170 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
|
171 { |
546e779aba64
[svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents:
591
diff
changeset
|
172 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
|
173 { |
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
|
174 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
|
175 } |
546e779aba64
[svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents:
591
diff
changeset
|
176 return; |
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 |
546e779aba64
[svn] - aosd: immediately hide osd window by single clicking (with mouse button 1) on it
giacomo
parents:
591
diff
changeset
|
179 |
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
|
180 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
|
181 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
|
182 { |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
183 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
|
184 GdkScreen *screen = gdk_screen_get_default(); |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
185 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
|
186 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
|
187 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
|
188 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
|
189 |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
190 /* 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
|
191 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
|
192 { |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
193 /* 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
|
194 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
|
195 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
|
196 pos_x = rect.x; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
197 pos_y = rect.y; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
198 screen_width = rect.width; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
199 screen_height = rect.height; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
200 } |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
201 else |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
202 { |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
203 /* 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
|
204 screen_width = gdk_screen_get_width( screen ); |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
205 screen_height = gdk_screen_get_height( screen ); |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
206 pos_x = 0; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
207 pos_y = 0; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
208 } |
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
|
209 |
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
|
210 /* 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
|
211 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
|
212 &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
|
213 |
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
|
214 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
|
215 { |
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
|
216 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
|
217 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
|
218 /* ignore user-defined max_width if it is too small or too large */ |
588 | 219 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
|
220 max_width = max_width_default; |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
221 } |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
222 else |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
223 { |
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
|
224 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
|
225 } |
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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 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
|
234 |
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 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
|
236 |
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
|
237 /* 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
|
238 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
|
239 { |
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
|
240 case AOSD_POSITION_PLACEMENT_TOP: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
241 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
|
242 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
|
243 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
|
244 case AOSD_POSITION_PLACEMENT_TOPRIGHT: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
245 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
|
246 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
|
247 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
|
248 case AOSD_POSITION_PLACEMENT_MIDDLELEFT: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
249 pos_x += 0; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
250 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
|
251 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
|
252 case AOSD_POSITION_PLACEMENT_MIDDLE: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
253 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
|
254 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
|
255 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
|
256 case AOSD_POSITION_PLACEMENT_MIDDLERIGHT: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
257 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
|
258 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
|
259 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
|
260 case AOSD_POSITION_PLACEMENT_BOTTOMLEFT: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
261 pos_x += 0; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
262 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
|
263 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
|
264 case AOSD_POSITION_PLACEMENT_BOTTOM: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
265 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
|
266 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
|
267 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
|
268 case AOSD_POSITION_PLACEMENT_BOTTOMRIGHT: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
269 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
|
270 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
|
271 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
|
272 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
|
273 default: |
586
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
274 pos_x += 0; |
26519231a4f4
[svn] - aosd: added experimental multiple monitor support, plus max_width setting
giacomo
parents:
569
diff
changeset
|
275 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
|
276 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
|
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 |
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
|
279 /* 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
|
280 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
|
281 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
|
282 |
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 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
|
284 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
|
285 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
|
286 |
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
|
287 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
|
288 |
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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 |
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 /* 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
|
304 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
|
305 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
|
306 } |
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
|
307 |
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
|
308 |
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 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
|
310 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
|
311 { |
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 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
|
313 |
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
|
314 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
|
315 { |
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
|
316 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
|
317 { |
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 /* 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
|
319 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
|
320 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
|
321 { |
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_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
|
323 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
|
324 } |
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 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
|
326 { |
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 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
|
328 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
|
329 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
|
330 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
|
331 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
|
332 } |
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 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
|
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 |
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
|
336 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
|
337 { |
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
|
338 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
|
339 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
|
340 { |
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 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
|
342 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
|
343 } |
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 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
|
345 { |
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 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
|
347 } |
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 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
|
349 } |
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
|
350 |
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
|
351 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
|
352 { |
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 /* 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
|
354 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
|
355 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
|
356 { |
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_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
|
358 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
|
359 } |
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 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
|
361 { |
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_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
|
363 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
|
364 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
|
365 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
|
366 } |
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 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
|
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 |
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 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
|
371 { |
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_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
|
373 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
|
374 |
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_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
|
376 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
|
377 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
|
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 } |
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
|
380 |
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
|
381 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
|
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 |
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 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
|
386 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
|
387 { |
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
|
388 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
|
389 { |
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
|
390 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
|
391 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
|
392 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
|
393 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
|
394 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
|
395 } |
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 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
|
397 { |
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
|
398 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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 /* 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
|
404 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
|
405 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
|
406 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
|
407 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
|
408 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
|
409 } |
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 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
|
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 |
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 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 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
|
416 { |
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
|
417 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
|
418 { |
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
|
419 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
|
420 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
|
421 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
|
422 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
|
423 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
|
424 } |
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 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
|
426 } |