Mercurial > pidgin.yaz
annotate finch/gntmedia.c @ 25720:551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sat, 09 Aug 2008 03:51:42 +0000 |
parents | eb8c8a926589 |
children | 1d9a2296d5d2 |
rev | line source |
---|---|
25639
128f6cb57829
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" |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
36 #include "gntlabel.h" |
25639
128f6cb57829
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 */ |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25650
diff
changeset
|
43 #ifdef USE_VV |
25639
128f6cb57829
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 GstElement *send_level; |
128f6cb57829
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 GstElement *recv_level; |
128f6cb57829
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 |
128f6cb57829
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 *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
|
54 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
|
55 GntWidget *hangup; |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
56 GntWidget *calling; |
25639
128f6cb57829
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 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
|
59 }; |
128f6cb57829
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 #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
|
62 |
128f6cb57829
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_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
|
64 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
|
65 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
|
66 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
|
67 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
|
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 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
|
70 |
128f6cb57829
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 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
|
72 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
|
73 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
|
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 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
|
76 |
128f6cb57829
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 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
|
78 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
|
79 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
|
80 PROP_SEND_LEVEL, |
128f6cb57829
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 PROP_RECV_LEVEL |
128f6cb57829
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 |
128f6cb57829
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 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
|
85 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
|
86 { |
128f6cb57829
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 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
|
88 |
128f6cb57829
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 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
|
90 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
|
91 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
|
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 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
|
94 (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
|
95 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
|
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 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
|
98 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 (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
|
100 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
|
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 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
|
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 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
|
105 } |
128f6cb57829
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 |
128f6cb57829
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 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
|
109 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
|
110 { |
128f6cb57829
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 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
|
112 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
|
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 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
|
115 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
|
116 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
|
117 |
128f6cb57829
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 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
|
119 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
|
120 "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
|
121 "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
|
122 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
|
123 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
|
124 g_object_class_install_property(gobject_class, PROP_SEND_LEVEL, |
128f6cb57829
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 g_param_spec_object("send-level", |
128f6cb57829
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 "Send level", |
128f6cb57829
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 "The GstElement of this media's send 'level'", |
128f6cb57829
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 GST_TYPE_ELEMENT, |
25671
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:
25654
diff
changeset
|
129 G_PARAM_READWRITE)); |
25639
128f6cb57829
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 g_object_class_install_property(gobject_class, PROP_RECV_LEVEL, |
128f6cb57829
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 g_param_spec_object("recv-level", |
128f6cb57829
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 "Receive level", |
128f6cb57829
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 "The GstElement of this media's recv 'level'", |
128f6cb57829
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 GST_TYPE_ELEMENT, |
25671
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:
25654
diff
changeset
|
135 G_PARAM_READWRITE)); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
136 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
137 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
|
138 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
|
139 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
|
140 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
|
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 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
|
143 } |
128f6cb57829
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_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
|
148 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
149 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
|
150 |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
151 media->priv->calling = gnt_label_new(_("Calling ... ")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
152 media->priv->hangup = gnt_button_new(_("Hangup")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
153 media->priv->accept = gnt_button_new(_("Accept")); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
154 media->priv->reject = gnt_button_new(_("Reject")); |
25639
128f6cb57829
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 |
128f6cb57829
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 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
|
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 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
|
159 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
|
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 |
128f6cb57829
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 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
|
163 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
|
164 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
165 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
166 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
167 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
|
168 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
|
169 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
170 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
|
171 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
172 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
173 static gboolean |
128f6cb57829
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 level_message_cb(GstBus *bus, GstMessage *message, 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
|
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 /* XXX: I am hesitant to just remove this function altogether, because I don't |
128f6cb57829
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 * know how necessary it is to have a callback to 'message'. If it isn't essential, |
128f6cb57829
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 * I suppose this should be removed. |
128f6cb57829
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 */ |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
180 return TRUE; |
128f6cb57829
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 #if 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
|
182 const GstStructure *s; |
128f6cb57829
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 const gchar *name; |
128f6cb57829
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 |
128f6cb57829
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 int channels; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
186 gdouble rms_db, peak_db, decay_db; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
187 gdouble rms; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
188 const GValue *list; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
189 const GValue *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
|
190 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
191 GstElement *src = GST_ELEMENT(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
|
192 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
193 if (message->type != GST_MESSAGE_ELEMENT) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
194 return TRUE; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
195 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
196 s = gst_message_get_structure(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
|
197 name = gst_structure_get_name(s); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
198 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
199 if (strcmp(name, "level")) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
200 return TRUE; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
201 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
202 list = gst_structure_get_value(s, "rms"); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
203 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
204 /* Only bother with the first channel. */ |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
205 value = gst_value_list_get_value(list, 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
|
206 rms_db = g_value_get_double(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
|
207 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
208 if (!strcmp(gst_element_get_name(src), "sendlevel")) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
209 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(gntmedia->priv->send_progress), pow(10, rms_db / 20) * 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
|
210 else |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
211 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(gntmedia->priv->recv_progress), pow(10, rms_db / 20) * 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
|
212 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
213 return TRUE; |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
214 #endif |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
215 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
216 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
217 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
|
218 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
|
219 { |
25671
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:
25654
diff
changeset
|
220 GstElement *element = purple_media_get_pipeline(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:
25654
diff
changeset
|
221 |
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:
25654
diff
changeset
|
222 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:
25654
diff
changeset
|
223 GstElement *recvbin, *recvlevel; |
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:
25654
diff
changeset
|
224 |
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:
25654
diff
changeset
|
225 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:
25654
diff
changeset
|
226 |
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:
25654
diff
changeset
|
227 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:
25654
diff
changeset
|
228 purple_media_audio_init_recv(&recvbin, &recvlevel); |
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:
25654
diff
changeset
|
229 |
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:
25654
diff
changeset
|
230 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:
25654
diff
changeset
|
231 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:
25654
diff
changeset
|
232 purple_media_set_sink(media, sessions->data, recvbin); |
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:
25654
diff
changeset
|
233 } |
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:
25654
diff
changeset
|
234 g_list_free(sessions); |
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:
25654
diff
changeset
|
235 |
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:
25654
diff
changeset
|
236 g_object_set(gntmedia, "send-level", &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:
25654
diff
changeset
|
237 "recv-level", &recvlevel, |
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:
25654
diff
changeset
|
238 NULL); |
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:
25654
diff
changeset
|
239 |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
240 gst_bus_add_signal_watch(GST_BUS(gst_pipeline_get_bus(GST_PIPELINE(element)))); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
241 g_signal_connect(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))), "message", G_CALLBACK(level_message_cb), 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
|
242 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
243 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
244 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
|
245 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
|
246 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
247 GntWidget *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
|
248 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
249 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
|
250 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
251 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
|
252 gnt_box_remove(GNT_BOX(gntmedia), gntmedia->priv->reject); |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
253 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:
25643
diff
changeset
|
254 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:
25643
diff
changeset
|
255 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
256 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:
25643
diff
changeset
|
257 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
258 gnt_widget_destroy(gntmedia->priv->accept); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
259 gnt_widget_destroy(gntmedia->priv->reject); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
260 gnt_widget_destroy(gntmedia->priv->calling); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
261 gntmedia->priv->accept = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
262 gntmedia->priv->reject = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
263 gntmedia->priv->calling = NULL; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
264 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
265 parent = GNT_WIDGET(gntmedia); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
266 while (parent->parent) |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
267 parent = parent->parent; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
268 gnt_box_readjust(GNT_BOX(parent)); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
269 gnt_widget_draw(parent); |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
270 } |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
271 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
272 static void |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
273 finch_media_wait_cb(PurpleMedia *media, FinchMedia *gntmedia) |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
274 { |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
275 GntWidget *parent; |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
276 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
277 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:
25643
diff
changeset
|
278 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:
25643
diff
changeset
|
279 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:
25643
diff
changeset
|
280 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:
25643
diff
changeset
|
281 |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
282 gnt_box_add_widget(GNT_BOX(gntmedia), gntmedia->priv->calling); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
283 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
|
284 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
285 gnt_widget_destroy(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
|
286 gnt_widget_destroy(gntmedia->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
|
287 gntmedia->priv->accept = 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
|
288 gntmedia->priv->reject = 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
|
289 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
290 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
|
291 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
|
292 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
|
293 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
|
294 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
|
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_hangup_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
|
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 finch_media_emit_message(gntmedia, _("You have ended the call.")); |
128f6cb57829
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 finch_conversation_set_info_widget(gntmedia->priv->conv, 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
|
302 gnt_widget_destroy(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
|
303 } |
128f6cb57829
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 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
|
306 finch_media_got_hangup_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
|
307 { |
128f6cb57829
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 finch_media_emit_message(gntmedia, _("The call has been terminated.")); |
128f6cb57829
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 finch_conversation_set_info_widget(gntmedia->priv->conv, 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
|
310 gnt_widget_destroy(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
|
311 } |
128f6cb57829
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 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
|
314 finch_media_reject_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
|
315 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
316 finch_media_emit_message(gntmedia, _("You have rejected the call.")); |
128f6cb57829
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 finch_conversation_set_info_widget(gntmedia->priv->conv, 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
|
318 gnt_widget_destroy(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
|
319 } |
128f6cb57829
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 |
128f6cb57829
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 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
|
322 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
|
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 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
|
325 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
|
326 |
128f6cb57829
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 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
|
328 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
|
329 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
|
330 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
|
331 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
|
332 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
|
333 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
|
334 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
|
335 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
|
336 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
|
337 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
|
338 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
|
339 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
|
340 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
341 g_signal_connect(G_OBJECT(media->priv->media), "accepted", |
128f6cb57829
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 G_CALLBACK(finch_media_accept_cb), 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
|
343 g_signal_connect(G_OBJECT(media->priv->media) ,"ready", |
128f6cb57829
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_CALLBACK(finch_media_ready_cb), media); |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
345 g_signal_connect(G_OBJECT(media->priv->media), "wait", |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
346 G_CALLBACK(finch_media_wait_cb), media); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
347 g_signal_connect(G_OBJECT(media->priv->media), "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
|
348 G_CALLBACK(finch_media_hangup_cb), 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
|
349 g_signal_connect(G_OBJECT(media->priv->media), "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
|
350 G_CALLBACK(finch_media_reject_cb), 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
|
351 g_signal_connect(G_OBJECT(media->priv->media), "got-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
|
352 G_CALLBACK(finch_media_got_hangup_cb), media); |
25644
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
353 g_signal_connect(G_OBJECT(media->priv->media), "got-accept", |
52a753b67ebb
Fine tune the media (audio) widget in finch.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25643
diff
changeset
|
354 G_CALLBACK(finch_media_accept_cb), media); |
25639
128f6cb57829
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 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
|
356 case PROP_SEND_LEVEL: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
357 if (media->priv->send_level) |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
358 gst_object_unref(media->priv->send_level); |
128f6cb57829
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 media->priv->send_level = 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
|
360 g_object_ref(media->priv->send_level); |
128f6cb57829
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 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
|
362 case PROP_RECV_LEVEL: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
363 if (media->priv->recv_level) |
128f6cb57829
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 gst_object_unref(media->priv->recv_level); |
128f6cb57829
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 media->priv->recv_level = 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
|
366 g_object_ref(media->priv->recv_level); |
128f6cb57829
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 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
|
368 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
|
369 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
|
370 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
|
371 } |
128f6cb57829
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 } |
128f6cb57829
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 |
128f6cb57829
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 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
|
375 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
|
376 { |
128f6cb57829
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 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
|
378 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
|
379 |
128f6cb57829
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 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
|
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 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
|
383 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
|
384 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
|
385 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
|
386 case PROP_SEND_LEVEL: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
387 g_value_set_object(value, media->priv->send_level); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
388 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
|
389 case PROP_RECV_LEVEL: |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
390 g_value_set_object(value, media->priv->recv_level); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
391 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
|
392 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
|
393 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
|
394 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
|
395 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
396 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
397 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
398 GntWidget * |
25671
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:
25654
diff
changeset
|
399 finch_media_new(PurpleMedia *media) |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
400 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
401 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
|
402 "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
|
403 "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
|
404 "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
|
405 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
|
406 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
407 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
408 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
|
409 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
|
410 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
411 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
|
412 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
|
413 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
414 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
415 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
416 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
|
417 finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, gpointer 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
|
418 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
419 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
|
420 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
|
421 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
422 conv = purple_conversation_new(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
|
423 purple_connection_get_account(purple_media_get_connection(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
|
424 purple_media_get_screenname(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
|
425 |
25671
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:
25654
diff
changeset
|
426 gntmedia = finch_media_new(media); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
427 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
|
428 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
|
429 finch_conversation_set_info_widget(conv, 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
|
430 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
431 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
432 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
|
433 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
|
434 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
|
435 { |
25709
eb8c8a926589
Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
436 PurpleAccount *account = purple_conversation_get_account(conv); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
437 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
438 PurpleMedia *media = |
25709
eb8c8a926589
Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25671
diff
changeset
|
439 purple_prpl_initiate_media(account, |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
440 purple_conversation_get_name(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
|
441 PURPLE_MEDIA_RECV_AUDIO & PURPLE_MEDIA_SEND_AUDIO); |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
442 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
443 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
|
444 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
|
445 |
25643
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25639
diff
changeset
|
446 purple_media_wait(media); |
25639
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
447 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
|
448 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
449 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
450 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
|
451 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
452 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
|
453 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
|
454 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
|
455 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
|
456 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
|
457 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
458 |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
459 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
|
460 { |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
461 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
|
462 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
|
463 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
|
464 } |
128f6cb57829
Some media support in finch. This needs to be updated for the got-accept signal.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
465 |
25654
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25650
diff
changeset
|
466 #endif /* USE_VV */ |
25650
4b9b265a8100
Fix compiling with the --disable-vv switch.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25647
diff
changeset
|
467 |