Mercurial > pidgin
annotate finch/gntmedia.c @ 26037:000affb017d1
Remove levels since they aren't used.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Tue, 13 Jan 2009 12:28:51 +0000 |
parents | bc22d0a449dd |
children | 2736b6ca3f5c |
rev | line source |
---|---|
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 /** |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 * @file gntmedia.c GNT Media API |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 * @ingroup finch |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 */ |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 /* finch |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 * |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 * Finch is the legal property of its developers, whose names are too numerous |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 * |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 * |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 * |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 */ |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 #include "finch.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 #include "mediamanager.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 #include "gntconv.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 #include "gntmedia.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 #include "gnt.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 #include "gntbutton.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 #include "gntbox.h" |
23794
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
36 #include "gntlabel.h" |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 #include "cmds.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
39 #include "conversation.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 #include "debug.h" |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 /* An incredibly large part of the following is from gtkmedia.c */ |
23804
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23800
diff
changeset
|
43 #ifdef USE_VV |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 #undef hangup |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 struct _FinchMediaPrivate |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 PurpleMedia *media; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 GntWidget *accept; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 GntWidget *reject; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 GntWidget *hangup; |
23794
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
54 GntWidget *calling; |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 PurpleConversation *conv; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 }; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 #define FINCH_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), FINCH_TYPE_MEDIA, FinchMediaPrivate)) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 static void finch_media_class_init (FinchMediaClass *klass); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 static void finch_media_init (FinchMedia *media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 static void finch_media_finalize (GObject *object); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 static void finch_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 static void finch_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 static GntBoxClass *parent_class = NULL; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 enum { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 MESSAGE, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 LAST_SIGNAL |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 }; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 static guint finch_media_signals[LAST_SIGNAL] = {0}; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 enum { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 PROP_0, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 PROP_MEDIA, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 }; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 GType |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 finch_media_get_type(void) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 static GType type = 0; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 if (type == 0) { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 static const GTypeInfo info = { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 sizeof(FinchMediaClass), |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
90 (GClassInitFunc) finch_media_class_init, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 sizeof(FinchMedia), |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 0, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 (GInstanceInitFunc) finch_media_init, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 NULL |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 }; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 type = g_type_register_static(GNT_TYPE_BOX, "FinchMedia", &info, 0); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 return type; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
103 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
104 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
105 finch_media_class_init (FinchMediaClass *klass) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
106 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
107 GObjectClass *gobject_class = (GObjectClass*)klass; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
108 parent_class = g_type_class_peek_parent(klass); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
109 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
110 gobject_class->finalize = finch_media_finalize; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
111 gobject_class->set_property = finch_media_set_property; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
112 gobject_class->get_property = finch_media_get_property; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 g_object_class_install_property(gobject_class, PROP_MEDIA, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 g_param_spec_object("media", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 "PurpleMedia", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
117 "The PurpleMedia associated with this media.", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
118 PURPLE_TYPE_MEDIA, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 finch_media_signals[MESSAGE] = g_signal_new("message", G_TYPE_FROM_CLASS(klass), |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 g_cclosure_marshal_VOID__STRING, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
124 G_TYPE_NONE, 1, G_TYPE_STRING); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
126 g_type_class_add_private(klass, sizeof(FinchMediaPrivate)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
127 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 finch_media_init (FinchMedia *media) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
132 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 media->priv = FINCH_MEDIA_GET_PRIVATE(media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 |
23794
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
135 media->priv->calling = gnt_label_new(_("Calling ... ")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
136 media->priv->hangup = gnt_button_new(_("Hangup")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
137 media->priv->accept = gnt_button_new(_("Accept")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
138 media->priv->reject = gnt_button_new(_("Reject")); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
139 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
140 gnt_box_set_alignment(GNT_BOX(media), GNT_ALIGN_MID); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
141 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
142 gnt_box_add_widget(GNT_BOX(media), media->priv->accept); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
143 gnt_box_add_widget(GNT_BOX(media), media->priv->reject); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
144 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
145 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
146 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
147 finch_media_finalize (GObject *media) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
148 { |
23917
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
149 FinchMedia *gntmedia = FINCH_MEDIA(media); |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
150 purple_debug_info("gntmedia", "finch_media_finalize\n"); |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
151 if (gntmedia->priv->media) |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
152 g_object_unref(gntmedia->priv->media); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
153 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
154 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
155 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
156 finch_media_emit_message(FinchMedia *gntmedia, const char *msg) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
157 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
158 g_signal_emit(gntmedia, finch_media_signals[MESSAGE], 0, msg); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
159 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
160 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
161 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
162 finch_media_ready_cb(PurpleMedia *media, FinchMedia *gntmedia) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
163 { |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
164 GstElement *sendbin, *sendlevel; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
165 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
166 GList *sessions = purple_media_get_session_names(media); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
167 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
168 purple_media_audio_init_src(&sendbin, &sendlevel); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
169 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
170 for (; sessions; sessions = sessions->next) { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
171 purple_media_set_src(media, sessions->data, sendbin); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
172 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
173 g_list_free(sessions); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
174 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
175 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
176 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
177 finch_media_accept_cb(PurpleMedia *media, FinchMedia *gntmedia) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
178 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
179 GntWidget *parent; |
23917
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
180 GstElement *sendbin = NULL, *recvbin = NULL; |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
181 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
182 finch_media_emit_message(gntmedia, _("Call in progress.")); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
183 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
184 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->accept); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
185 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->reject); |
23794
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
186 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->hangup); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
187 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->calling); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
188 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
189 gnt_box_add_widget(GNT_BOX(gntmedia), gntmedia->priv->hangup); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
190 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
191 gnt_widget_destroy(gntmedia->priv->accept); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
192 gnt_widget_destroy(gntmedia->priv->reject); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
193 gnt_widget_destroy(gntmedia->priv->calling); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
194 gntmedia->priv->accept = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
195 gntmedia->priv->reject = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
196 gntmedia->priv->calling = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
197 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
198 parent = GNT_WIDGET(gntmedia); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
199 while (parent->parent) |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
200 parent = parent->parent; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
201 gnt_box_readjust(GNT_BOX(parent)); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
202 gnt_widget_draw(parent); |
23917
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
203 |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
204 purple_media_get_elements(media, &sendbin, &recvbin, NULL, NULL); |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
205 gst_element_set_state(GST_ELEMENT(sendbin), GST_STATE_PLAYING); |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
206 gst_element_set_state(GST_ELEMENT(recvbin), GST_STATE_PLAYING); |
23794
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
207 } |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
208 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
209 static void |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
210 finch_media_wait_cb(PurpleMedia *media, FinchMedia *gntmedia) |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
211 { |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
212 GntWidget *parent; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
213 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
214 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->accept); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
215 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->reject); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
216 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->hangup); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
217 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->calling); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
218 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23793
diff
changeset
|
219 gnt_box_add_widget(GNT_BOX(gntmedia), gntmedia->priv->calling); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
220 gnt_box_add_widget(GNT_BOX(gntmedia), gntmedia->priv->hangup); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
221 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
222 parent = GNT_WIDGET(gntmedia); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
223 while (parent->parent) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
224 parent = parent->parent; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
225 gnt_box_readjust(GNT_BOX(parent)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
226 gnt_widget_draw(parent); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
227 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
228 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
229 static void |
26036
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
230 finch_media_state_changed_cb(PurpleMedia *media, |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
231 PurpleMediaStateChangedType type, |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
232 gchar *sid, gchar *name, FinchMedia *gntmedia) |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
233 { |
26036
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
234 purple_debug_info("gntmedia", "type: %d sid: %s name: %s\n", |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
235 type, sid, name); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
236 if (sid == NULL && name == NULL) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
237 if (type == PURPLE_MEDIA_STATE_CHANGED_END) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
238 finch_media_emit_message(gntmedia, |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
239 _("The call has been terminated.")); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
240 finch_conversation_set_info_widget( |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
241 gntmedia->priv->conv, NULL); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
242 gnt_widget_destroy(GNT_WIDGET(gntmedia)); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
243 /* |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
244 * XXX: This shouldn't have to be here |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
245 * to free the FinchMedia widget. |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
246 */ |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
247 g_object_unref(gntmedia); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
248 } else if (type == PURPLE_MEDIA_STATE_CHANGED_REJECTED) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
249 finch_media_emit_message(gntmedia, |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
250 _("You have rejected the call.")); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
251 } |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
252 } else if (type == PURPLE_MEDIA_STATE_CHANGED_NEW |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
253 && sid != NULL && name != NULL) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
254 finch_media_ready_cb(media, gntmedia); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
255 } else if (type == PURPLE_MEDIA_STATE_CHANGED_CONNECTED) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
256 finch_media_accept_cb(media, gntmedia); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
257 } |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
258 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
259 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
260 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
261 finch_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
262 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
263 FinchMedia *media; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
264 g_return_if_fail(FINCH_IS_MEDIA(object)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
265 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
266 media = FINCH_MEDIA(object); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
267 switch (prop_id) { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
268 case PROP_MEDIA: |
26036
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
269 { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
270 gboolean is_initiator; |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
271 if (media->priv->media) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
272 g_object_unref(media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
273 media->priv->media = g_value_get_object(value); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
274 g_object_ref(media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
275 g_signal_connect_swapped(G_OBJECT(media->priv->accept), "activate", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
276 G_CALLBACK(purple_media_accept), media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
277 g_signal_connect_swapped(G_OBJECT(media->priv->reject), "activate", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
278 G_CALLBACK(purple_media_reject), media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
279 g_signal_connect_swapped(G_OBJECT(media->priv->hangup), "activate", |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
280 G_CALLBACK(purple_media_hangup), media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
281 |
26036
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
282 g_object_get(G_OBJECT(media->priv->media), "initiator", |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
283 &is_initiator, NULL); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
284 if (is_initiator == TRUE) { |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
285 finch_media_wait_cb(media->priv->media, media); |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
286 } |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
287 g_signal_connect(G_OBJECT(media->priv->media), "state-changed", |
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
288 G_CALLBACK(finch_media_state_changed_cb), media); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
289 break; |
26036
bc22d0a449dd
Update Finch to new media API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24983
diff
changeset
|
290 } |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
291 default: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
292 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
293 break; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
294 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
295 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
296 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
297 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
298 finch_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
299 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
300 FinchMedia *media; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
301 g_return_if_fail(FINCH_IS_MEDIA(object)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
302 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
303 media = FINCH_MEDIA(object); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
304 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
305 switch (prop_id) { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
306 case PROP_MEDIA: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
307 g_value_set_object(value, media->priv->media); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
308 break; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
309 default: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
310 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
311 break; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
312 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
313 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
314 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
315 GntWidget * |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
316 finch_media_new(PurpleMedia *media) |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
317 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
318 return GNT_WIDGET(g_object_new(finch_media_get_type(), |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
319 "media", media, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
320 "vertical", FALSE, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
321 "homogeneous", FALSE, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
322 NULL)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
323 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
324 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
325 static void |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
326 gntmedia_message_cb(FinchMedia *gntmedia, const char *msg, PurpleConversation *conv) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
327 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
328 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
329 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
330 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
331 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
332 |
23872
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23859
diff
changeset
|
333 static gboolean |
24983
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24976
diff
changeset
|
334 finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, |
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24976
diff
changeset
|
335 PurpleConnection *gc, gchar *name, gpointer null) |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
336 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
337 GntWidget *gntmedia; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
338 PurpleConversation *conv; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
339 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
340 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, |
24983
18b71033ea6e
Remove connection attribute from PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24976
diff
changeset
|
341 purple_connection_get_account(gc), name); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
342 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
343 gntmedia = finch_media_new(media); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
344 g_signal_connect(G_OBJECT(gntmedia), "message", G_CALLBACK(gntmedia_message_cb), conv); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
345 FINCH_MEDIA(gntmedia)->priv->conv = conv; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
346 finch_conversation_set_info_widget(conv, gntmedia); |
23872
1d9a2296d5d2
Stop additional media sessions within a single conversation for grouped contacts.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23859
diff
changeset
|
347 return TRUE; |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
348 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
349 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
350 static PurpleCmdRet |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
351 call_cmd_cb(PurpleConversation *conv, const char *cmd, char **args, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
352 char **eror, gpointer data) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
353 { |
23859
eb8c8a926589
Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
354 PurpleAccount *account = purple_conversation_get_account(conv); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
355 |
23917
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
356 PurpleMedia *media = purple_prpl_initiate_media(account, |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
357 purple_conversation_get_name(conv), |
4a208844bb63
Make voice calls work with Finch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23872
diff
changeset
|
358 PURPLE_MEDIA_AUDIO); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
359 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
360 if (!media) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
361 return PURPLE_CMD_STATUS_FAILED; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
362 |
23793
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23789
diff
changeset
|
363 purple_media_wait(media); |
23789
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
364 return PURPLE_CMD_STATUS_OK; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
365 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
366 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
367 void finch_media_manager_init(void) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
368 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
369 PurpleMediaManager *manager = purple_media_manager_get(); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
370 g_signal_connect(G_OBJECT(manager), "init-media", G_CALLBACK(finch_new_media), NULL); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
371 purple_cmd_register("call", "", PURPLE_CMD_P_DEFAULT, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
372 PURPLE_CMD_FLAG_IM, NULL, |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
373 call_cmd_cb, _("call: Make an audio call."), NULL); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
374 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
375 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
376 void finch_media_manager_uninit(void) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
377 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
378 PurpleMediaManager *manager = purple_media_manager_get(); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
379 g_signal_handlers_disconnect_by_func(G_OBJECT(manager), |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
380 G_CALLBACK(finch_new_media), NULL); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
381 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
382 |
23804
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23800
diff
changeset
|
383 #endif /* USE_VV */ |
23800
4b9b265a8100
Fix compiling with the --disable-vv switch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23797
diff
changeset
|
384 |