Sun, 28 Aug 2022 01:17:08 -0500
Remove redundant gtk_widget_show
These widgets were just created, or never hidden. I did leave the show on the video widgets, as I don't know where they eventually originate.
Testing Done:
Compiled only.
Reviewed at https://reviews.imfreedom.org/r/1668/
| 35454 | 1 | /* pidgin |
| 19886 | 2 | * |
| 3 | * Pidgin is the legal property of its developers, whose names are too numerous | |
| 4 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28278
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19886 | 20 | */ |
| 21 | ||
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
22 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
23 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
24 | #endif |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
25 | |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
26 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40360
diff
changeset
|
27 | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
28 | #include <gtk/gtk.h> |
|
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
29 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40264
diff
changeset
|
30 | #include <purple.h> |
|
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40264
diff
changeset
|
31 | |
| 19886 | 32 | #include "gtkmedia.h" |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
33 | #include "gtkutils.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
34 | #include "pidgincore.h" |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
35 | #include "pidginkeypad.h" |
| 19886 | 36 | |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
37 | #define PIDGIN_TYPE_MEDIA (pidgin_media_get_type()) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
38 | #define PIDGIN_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PIDGIN_TYPE_MEDIA, PidginMedia)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
39 | #define PIDGIN_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PIDGIN_TYPE_MEDIA, PidginMediaClass)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
40 | #define PIDGIN_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PIDGIN_TYPE_MEDIA)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
41 | #define PIDGIN_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PIDGIN_TYPE_MEDIA)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
42 | #define PIDGIN_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PIDGIN_TYPE_MEDIA, PidginMediaClass)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
43 | |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
44 | typedef struct _PidginMedia PidginMedia; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
45 | typedef struct _PidginMediaClass PidginMediaClass; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
46 | typedef struct _PidginMediaPrivate PidginMediaPrivate; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
47 | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
48 | typedef enum |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
49 | { |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
50 | /* Waiting for response */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
51 | PIDGIN_MEDIA_WAITING = 1, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
52 | /* Got request */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
53 | PIDGIN_MEDIA_REQUESTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
54 | /* Accepted call */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
55 | PIDGIN_MEDIA_ACCEPTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
56 | /* Rejected call */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
57 | PIDGIN_MEDIA_REJECTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
58 | } PidginMediaState; |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
59 | |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
60 | struct _PidginMediaClass |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
61 | { |
|
38587
7a36a36f66b7
gtkmedia: Use GtkApplicationWindow as base class
Mike Ruprecht <cmaiku@gmail.com>
parents:
38027
diff
changeset
|
62 | GtkApplicationWindowClass parent_class; |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
63 | }; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
64 | |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
65 | struct _PidginMedia |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
66 | { |
|
38587
7a36a36f66b7
gtkmedia: Use GtkApplicationWindow as base class
Mike Ruprecht <cmaiku@gmail.com>
parents:
38027
diff
changeset
|
67 | GtkApplicationWindow parent; |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
68 | PidginMediaPrivate *priv; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
69 | }; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
70 | |
| 19886 | 71 | struct _PidginMediaPrivate |
| 72 | { | |
| 73 | PurpleMedia *media; | |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
74 | gchar *screenname; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
75 | gulong level_handler_id; |
| 19886 | 76 | |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
77 | GtkBuilder *ui; |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
78 | GtkWidget *menubar; |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
79 | GtkWidget *statusbar; |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
80 | |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
81 | GtkWidget *hold; |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
82 | GtkWidget *mute; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
83 | GtkWidget *pause; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
84 | |
| 19886 | 85 | GtkWidget *send_progress; |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
86 | GHashTable *recv_progressbars; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
87 | |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
88 | PidginMediaState state; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
89 | |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
90 | GtkWidget *display; |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
91 | GtkWidget *send_widget; |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
92 | GtkWidget *recv_widget; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
93 | GtkWidget *button_widget; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
94 | GtkWidget *local_video; |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
95 | GHashTable *remote_videos; |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
96 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
97 | guint timeout_id; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
98 | PurpleMediaSessionType request_type; |
| 19886 | 99 | }; |
| 100 | ||
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
101 | static GType pidgin_media_get_type(void); |
| 19886 | 102 | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
103 | G_DEFINE_TYPE_WITH_PRIVATE(PidginMedia, pidgin_media, |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
104 | GTK_TYPE_APPLICATION_WINDOW); |
|
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
105 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
106 | static void pidgin_media_dispose (GObject *object); |
| 19886 | 107 | static void pidgin_media_finalize (GObject *object); |
| 108 | static void pidgin_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 109 | static void pidgin_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
110 | static void pidgin_media_set_state(PidginMedia *gtkmedia, PidginMediaState state); |
| 19886 | 111 | |
| 112 | enum { | |
| 113 | PROP_0, | |
| 114 | PROP_MEDIA, | |
|
28126
6b4a7ccec66f
Remove send_level and recv_level from PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
115 | PROP_SCREENNAME |
| 19886 | 116 | }; |
| 117 | ||
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
118 | static gboolean |
|
41597
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
119 | pidgin_media_close_request_cb(GtkWindow *window, gpointer data) { |
|
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
120 | PidginMedia *media = data; |
|
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
121 | |
|
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
122 | if(media->priv->media) { |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
123 | g_action_group_activate_action(G_ACTION_GROUP(media), |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
124 | "Hangup", NULL); |
|
41597
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
125 | } |
|
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
126 | |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
127 | return FALSE; |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
128 | } |
| 19886 | 129 | |
| 130 | static void | |
| 131 | pidgin_media_class_init (PidginMediaClass *klass) | |
| 132 | { | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
133 | GObjectClass *gobject_class = G_OBJECT_CLASS(klass); |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
134 | GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
135 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
136 | gobject_class->dispose = pidgin_media_dispose; |
| 19886 | 137 | gobject_class->finalize = pidgin_media_finalize; |
| 138 | gobject_class->set_property = pidgin_media_set_property; | |
| 139 | gobject_class->get_property = pidgin_media_get_property; | |
| 140 | ||
| 141 | g_object_class_install_property(gobject_class, PROP_MEDIA, | |
| 142 | g_param_spec_object("media", | |
| 143 | "PurpleMedia", | |
| 144 | "The PurpleMedia associated with this media.", | |
| 145 | PURPLE_TYPE_MEDIA, | |
|
35060
195dbb3b6432
pidgin: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
146 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
147 | g_object_class_install_property(gobject_class, PROP_SCREENNAME, |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
148 | g_param_spec_string("screenname", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
149 | "Screenname", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
150 | "The screenname of the user this session is with.", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
151 | NULL, |
|
35060
195dbb3b6432
pidgin: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
152 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
153 | |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
154 | gtk_widget_class_set_template_from_resource( |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
155 | widget_class, |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
156 | "/im/pidgin/Pidgin3/Media/window.ui" |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
157 | ); |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
158 | |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
159 | gtk_widget_class_bind_template_child_private(widget_class, PidginMedia, |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
160 | display); |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
161 | gtk_widget_class_bind_template_child_private(widget_class, PidginMedia, |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
162 | statusbar); |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
163 | |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
164 | gtk_widget_class_bind_template_callback(widget_class, |
|
41597
46a6267a35e6
Port the media window to GTK4
Gary Kramlich <grim@reaperworld.com>
parents:
41560
diff
changeset
|
165 | pidgin_media_close_request_cb); |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
166 | |
| 19886 | 167 | } |
| 168 | ||
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
169 | static void |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
170 | pidgin_media_hangup_activate_cb(GSimpleAction *action, GVariant *parameter, |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
171 | gpointer user_data) |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
172 | { |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
173 | PidginMedia *media = PIDGIN_MEDIA(user_data); |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
174 | |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
175 | purple_media_stream_info(media->priv->media, |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
176 | PURPLE_MEDIA_INFO_HANGUP, NULL, NULL, TRUE); |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
177 | } |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
178 | |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
179 | static void |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
180 | pidgin_media_hold_change_state_cb(GSimpleAction *action, GVariant *value, |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
181 | gpointer user_data) |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
182 | { |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
183 | PidginMedia *media = PIDGIN_MEDIA(user_data); |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
184 | |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
185 | purple_media_stream_info(media->priv->media, |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
186 | g_variant_get_boolean(value) ? |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
187 | PURPLE_MEDIA_INFO_HOLD : PURPLE_MEDIA_INFO_UNHOLD, |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
188 | NULL, NULL, TRUE); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
189 | |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
190 | g_simple_action_set_state(action, value); |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
191 | } |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
192 | |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
193 | static void |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
194 | pidgin_media_mute_change_state_cb(GSimpleAction *action, GVariant *value, |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
195 | gpointer user_data) |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
196 | { |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
197 | PidginMedia *media = PIDGIN_MEDIA(user_data); |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
198 | |
|
26502
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
199 | purple_media_stream_info(media->priv->media, |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
200 | g_variant_get_boolean(value) ? |
|
26502
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
201 | PURPLE_MEDIA_INFO_MUTE : PURPLE_MEDIA_INFO_UNMUTE, |
|
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
202 | NULL, NULL, TRUE); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
203 | |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
204 | g_simple_action_set_state(action, value); |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
205 | } |
| 19886 | 206 | |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
207 | static void |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
208 | pidgin_media_pause_change_state_cb(GSimpleAction *action, GVariant *value, |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
209 | gpointer user_data) |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
210 | { |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
211 | PidginMedia *media = PIDGIN_MEDIA(user_data); |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
212 | |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
213 | purple_media_stream_info(media->priv->media, |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
214 | g_variant_get_boolean(value) ? |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
215 | PURPLE_MEDIA_INFO_PAUSE : PURPLE_MEDIA_INFO_UNPAUSE, |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
216 | NULL, NULL, TRUE); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
217 | |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
218 | g_simple_action_set_state(action, value); |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
219 | } |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
220 | |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
221 | static const GActionEntry media_action_entries[] = { |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
222 | { "Hangup", pidgin_media_hangup_activate_cb }, |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
223 | { "Hold", NULL, NULL, "false", pidgin_media_hold_change_state_cb }, |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
224 | { "Mute", NULL, NULL, "false", pidgin_media_mute_change_state_cb }, |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
225 | { "Pause", NULL, NULL, "false", pidgin_media_pause_change_state_cb }, |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
226 | }; |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
227 | |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
228 | static void |
| 19886 | 229 | pidgin_media_init (PidginMedia *media) |
| 230 | { | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
231 | media->priv = pidgin_media_get_instance_private(media); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
232 | |
|
41481
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
233 | gtk_widget_init_template(GTK_WIDGET(media)); |
|
09b500dd62e7
Very simple approach to converting PidginMedia to GtkBuilder
Gary Kramlich <grim@reaperworld.com>
parents:
41478
diff
changeset
|
234 | |
|
38588
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
235 | g_action_map_add_action_entries(G_ACTION_MAP(media), |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
236 | media_action_entries, |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
237 | G_N_ELEMENTS(media_action_entries), media); |
|
258e213d1325
gtkmedia: Replace GtkUIManager usage with GtkBuilder
Mike Ruprecht <cmaiku@gmail.com>
parents:
38587
diff
changeset
|
238 | |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
239 | gtk_statusbar_push(GTK_STATUSBAR(media->priv->statusbar), |
|
26299
e7a85461e2a7
Remove unnecessary buttons and change statusbar to say "Calling..."
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
240 | 0, _("Calling...")); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
241 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
242 | media->priv->recv_progressbars = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
243 | g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
244 | media->priv->remote_videos = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
245 | g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
246 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
247 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
248 | static gchar * |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
249 | create_key(const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
250 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
251 | return g_strdup_printf("%s_%s", session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
252 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
253 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
254 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
255 | pidgin_media_insert_widget(PidginMedia *gtkmedia, GtkWidget *widget, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
256 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
257 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
258 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
259 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
260 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
261 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
262 | if (type & PURPLE_MEDIA_AUDIO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
263 | g_hash_table_insert(gtkmedia->priv->recv_progressbars, key, widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
264 | else if (type & PURPLE_MEDIA_VIDEO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
265 | g_hash_table_insert(gtkmedia->priv->remote_videos, key, widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
266 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
267 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
268 | static GtkWidget * |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
269 | pidgin_media_get_widget(PidginMedia *gtkmedia, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
270 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
271 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
272 | GtkWidget *widget = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
273 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
274 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
275 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
276 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
277 | if (type & PURPLE_MEDIA_AUDIO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
278 | widget = g_hash_table_lookup(gtkmedia->priv->recv_progressbars, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
279 | else if (type & PURPLE_MEDIA_VIDEO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
280 | widget = g_hash_table_lookup(gtkmedia->priv->remote_videos, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
281 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
282 | g_free(key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
283 | return widget; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
284 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
285 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
286 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
287 | pidgin_media_remove_widget(PidginMedia *gtkmedia, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
288 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
289 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
290 | GtkWidget *widget = pidgin_media_get_widget(gtkmedia, session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
291 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
292 | if (widget) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
293 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
294 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
295 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
296 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
297 | if (type & PURPLE_MEDIA_AUDIO) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
298 | g_hash_table_remove(gtkmedia->priv->recv_progressbars, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
299 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
300 | if (g_hash_table_size(gtkmedia->priv->recv_progressbars) == 0 && |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
301 | gtkmedia->priv->send_progress) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
302 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
303 | gtk_widget_unparent(gtkmedia->priv->send_progress); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
304 | gtkmedia->priv->send_progress = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
305 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
306 | gtk_widget_unparent(gtkmedia->priv->mute); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
307 | gtkmedia->priv->mute = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
308 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
309 | } else if (type & PURPLE_MEDIA_VIDEO) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
310 | g_hash_table_remove(gtkmedia->priv->remote_videos, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
311 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
312 | if (g_hash_table_size(gtkmedia->priv->remote_videos) == 0 && |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
313 | gtkmedia->priv->local_video) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
314 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
315 | gtk_widget_unparent(gtkmedia->priv->local_video); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
316 | gtkmedia->priv->local_video = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
317 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
318 | gtk_widget_unparent(gtkmedia->priv->pause); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
319 | gtkmedia->priv->pause = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
320 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
321 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
322 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
323 | g_free(key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
324 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
325 | gtk_widget_unparent(widget); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
326 | } |
| 19886 | 327 | } |
| 328 | ||
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
329 | static void |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
330 | level_message_cb(PurpleMedia *media, gchar *session_id, gchar *participant, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
331 | double level, PidginMedia *gtkmedia) |
| 19886 | 332 | { |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
333 | GtkWidget *progress = NULL; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
334 | if (participant == NULL) |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26275
diff
changeset
|
335 | progress = gtkmedia->priv->send_progress; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
336 | else |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
337 | progress = pidgin_media_get_widget(gtkmedia, session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
338 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
339 | if (progress) |
|
32751
24798e6f3c3a
The function gst_msg_db_to_percent already retyrns a number between
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32711
diff
changeset
|
340 | gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), level); |
| 19886 | 341 | } |
| 342 | ||
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
343 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
344 | static void |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
345 | pidgin_media_disconnect_levels(PurpleMedia *media, PidginMedia *gtkmedia) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
346 | { |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
347 | PurpleMediaManager *manager = purple_media_get_manager(media); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
348 | GstElement *element = purple_media_manager_get_pipeline(manager); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
349 | gulong handler_id = g_signal_handler_find(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))), |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
350 | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
351 | NULL, G_CALLBACK(level_message_cb), gtkmedia); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
352 | if (handler_id) |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
353 | g_signal_handler_disconnect(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))), |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
354 | handler_id); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
355 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
356 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
357 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
358 | pidgin_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
359 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
360 | PidginMedia *gtkmedia = PIDGIN_MEDIA(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
361 | purple_debug_info("gtkmedia", "pidgin_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
362 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
363 | if (gtkmedia->priv->media) { |
|
26300
02de47d1a94c
Close the request dialog if the remote user hung up.
Michael Ruprecht <maiku@pidgin.im>
parents:
26299
diff
changeset
|
364 | purple_request_close_with_handle(gtkmedia); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
365 | purple_media_remove_output_windows(gtkmedia->priv->media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
366 | pidgin_media_disconnect_levels(gtkmedia->priv->media, gtkmedia); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
367 | g_object_unref(gtkmedia->priv->media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
368 | gtkmedia->priv->media = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
369 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
370 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
371 | if (gtkmedia->priv->ui) { |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
372 | g_object_unref(gtkmedia->priv->ui); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
373 | gtkmedia->priv->ui = NULL; |
|
26305
04b0dd0fd8cb
Properly free item factory. Should fix a crash on close.
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
374 | } |
|
04b0dd0fd8cb
Properly free item factory. Should fix a crash on close.
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
375 | |
|
31151
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
376 | if (gtkmedia->priv->timeout_id != 0) |
|
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
377 | g_source_remove(gtkmedia->priv->timeout_id); |
|
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
378 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
379 | if (gtkmedia->priv->recv_progressbars) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
380 | g_hash_table_destroy(gtkmedia->priv->recv_progressbars); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
381 | g_hash_table_destroy(gtkmedia->priv->remote_videos); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
382 | gtkmedia->priv->recv_progressbars = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
383 | gtkmedia->priv->remote_videos = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
384 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
385 | |
|
40264
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
386 | if (gtkmedia->priv->screenname) { |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
387 | g_free(gtkmedia->priv->screenname); |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
388 | gtkmedia->priv->screenname = NULL; |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
389 | } |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
390 | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
391 | G_OBJECT_CLASS(pidgin_media_parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
392 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
393 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
394 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
395 | pidgin_media_finalize(GObject *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
396 | { |
|
26255
3b0da2f49570
Remove unneeded pidgin_media_get_display_widget function.
Michael Ruprecht <maiku@pidgin.im>
parents:
26254
diff
changeset
|
397 | /* PidginMedia *gtkmedia = PIDGIN_MEDIA(media); */ |
|
26143
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
26137
diff
changeset
|
398 | purple_debug_info("gtkmedia", "pidgin_media_finalize\n"); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
399 | |
|
39238
53cfb9400de8
Port Pidgin away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39129
diff
changeset
|
400 | G_OBJECT_CLASS(pidgin_media_parent_class)->finalize(media); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
401 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
402 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
403 | static void |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
404 | pidgin_media_emit_message(PidginMedia *gtkmedia, const char *msg) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
405 | { |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
406 | PurpleConversation *conv; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
407 | PurpleConversationManager *manager; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
408 | PurpleAccount *account; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
409 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
410 | account = purple_media_get_account(gtkmedia->priv->media); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
411 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
412 | conv = purple_conversation_manager_find(manager, account, |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
413 | gtkmedia->priv->screenname); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
414 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
415 | if(PURPLE_IS_CONVERSATION(conv)) { |
|
36089
c035b9a63457
Use purple_conversation_write_system_message where appropriate
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
416 | purple_conversation_write_system_message(conv, msg, 0); |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
417 | } |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
418 | |
|
40264
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
419 | g_object_unref(account); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
420 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
421 | |
|
26177
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
422 | static void |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
423 | pidgin_media_error_cb(PidginMedia *media, const gchar *error, |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
424 | PidginMedia *gtkmedia) |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
425 | { |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
426 | PurpleConversation *conv; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
427 | PurpleConversationManager *manager; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
428 | PurpleAccount *account; |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
429 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
430 | account = purple_media_get_account(gtkmedia->priv->media); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
431 | manager = purple_conversation_manager_get_default(); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
432 | conv = purple_conversation_manager_find(manager, account, |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
433 | gtkmedia->priv->screenname); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
434 | |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
435 | if(PURPLE_IS_CONVERSATION(conv)) { |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
436 | purple_conversation_write_system_message(conv, error, |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
437 | PURPLE_MESSAGE_ERROR); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
438 | } else { |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
439 | purple_notify_error(NULL, NULL, _("Media error"), error, |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
440 | purple_request_cpar_from_conversation(conv)); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
441 | } |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
442 | |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
443 | gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), |
|
40952
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
444 | 0, error); |
|
53fa03701534
Port Pidgin to the new PurpleConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40547
diff
changeset
|
445 | |
|
40264
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
446 | g_object_unref(account); |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
447 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
448 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26259
diff
changeset
|
449 | static void |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
450 | pidgin_media_accept_cb(PurpleMedia *media, int index) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
451 | { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
452 | purple_media_stream_info(media, PURPLE_MEDIA_INFO_ACCEPT, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
453 | NULL, NULL, TRUE); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
454 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
455 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
456 | static void |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
457 | pidgin_media_reject_cb(PurpleMedia *media, int index) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
458 | { |
|
31620
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
459 | GList *iter = purple_media_get_session_ids(media); |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
460 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
461 | const gchar *sessionid = iter->data; |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
462 | if (!purple_media_accepted(media, sessionid, NULL)) |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
463 | purple_media_stream_info(media, PURPLE_MEDIA_INFO_REJECT, |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
464 | sessionid, NULL, TRUE); |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
465 | } |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
466 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
467 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
468 | static gboolean |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
469 | pidgin_request_timeout_cb(PidginMedia *gtkmedia) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
470 | { |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
471 | PurpleAccount *account; |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
472 | PurpleBuddy *buddy; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
473 | const gchar *alias; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
474 | PurpleMediaSessionType type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
475 | gchar *message = NULL; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
476 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
477 | account = purple_media_get_account(gtkmedia->priv->media); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
478 | buddy = purple_blist_find_buddy(account, gtkmedia->priv->screenname); |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
479 | alias = buddy ? purple_buddy_get_contact_alias(buddy) : |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
480 | gtkmedia->priv->screenname; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
481 | type = gtkmedia->priv->request_type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
482 | gtkmedia->priv->timeout_id = 0; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
483 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
484 | if (type & PURPLE_MEDIA_AUDIO && type & PURPLE_MEDIA_VIDEO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
485 | message = g_strdup_printf(_("%s wishes to start an audio/video session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
486 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
487 | } else if (type & PURPLE_MEDIA_AUDIO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
488 | message = g_strdup_printf(_("%s wishes to start an audio session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
489 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
490 | } else if (type & PURPLE_MEDIA_VIDEO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
491 | message = g_strdup_printf(_("%s wishes to start a video session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
492 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
493 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
494 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
495 | gtkmedia->priv->request_type = PURPLE_MEDIA_NONE; |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
496 | if (!purple_media_accepted(gtkmedia->priv->media, NULL, NULL)) { |
|
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
497 | purple_request_accept_cancel(gtkmedia, _("Incoming Call"), |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
498 | message, NULL, PURPLE_DEFAULT_ACTION_NONE, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
499 | purple_request_cpar_from_account(account), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
500 | gtkmedia->priv->media, pidgin_media_accept_cb, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
501 | pidgin_media_reject_cb); |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
502 | } |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
503 | pidgin_media_emit_message(gtkmedia, message); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
504 | g_free(message); |
|
40264
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40197
diff
changeset
|
505 | g_object_unref(account); |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
506 | return FALSE; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
507 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
508 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
509 | static void |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
510 | pidgin_media_input_volume_changed(GtkScaleButton *range, double value, |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
511 | PurpleMedia *media) |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
512 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
513 | double val = (double)value * 100.0; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
514 | purple_media_set_input_volume(media, NULL, val); |
|
26622
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
515 | } |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
516 | |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
517 | static void |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
518 | pidgin_media_output_volume_changed(GtkScaleButton *range, double value, |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
519 | PurpleMedia *media) |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
520 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
521 | double val = (double)value * 100.0; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
522 | purple_media_set_output_volume(media, NULL, NULL, val); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
523 | } |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
524 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
525 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
526 | destroy_parent_widget_cb(GtkWidget *widget, GtkWidget *parent) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
527 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
528 | g_return_if_fail(GTK_IS_WIDGET(parent)); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
529 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
530 | gtk_widget_unparent(parent); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
531 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
532 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
533 | static GtkWidget * |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
534 | pidgin_media_add_audio_widget(PidginMedia *gtkmedia, |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
535 | PurpleMediaSessionType type, const gchar *sid) |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
536 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
537 | GtkWidget *volume_widget, *progress_parent, *volume, *progress; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
538 | double value; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
539 | |
|
37918
41c93b7fecce
gtkmedia: fix -Wdiscarded-qualifiers
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37911
diff
changeset
|
540 | static const gchar * input_volume_icons[] = { |
|
37652
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
541 | "microphone-sensitivity-muted-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
542 | "microphone-sensitivity-high-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
543 | "microphone-sensitivity-low-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
544 | "microphone-sensitivity-medium-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
545 | NULL |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
546 | }; |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
547 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
548 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
549 | value = purple_prefs_get_int( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
550 | "/purple/media/audio/volume/input"); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
551 | } else if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
552 | value = purple_prefs_get_int( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
553 | "/purple/media/audio/volume/output"); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
554 | } else |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
555 | g_return_val_if_reached(NULL); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
556 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
557 | /* Setup widget structure */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
558 | volume_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
559 | progress_parent = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
560 | gtk_widget_set_hexpand(progress_parent, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
561 | gtk_widget_set_halign(progress_parent, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
562 | gtk_box_append(GTK_BOX(volume_widget), progress_parent); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
563 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
564 | /* Volume button */ |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
565 | volume = gtk_volume_button_new(); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
566 | gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), value/100.0); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
567 | gtk_box_append(GTK_BOX(volume_widget), volume); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
568 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
569 | /* Volume level indicator */ |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
570 | progress = gtk_progress_bar_new(); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
571 | gtk_widget_set_size_request(progress, 250, 10); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
572 | gtk_widget_set_vexpand(progress, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
573 | gtk_box_append(GTK_BOX(progress_parent), progress); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
574 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
575 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
576 | g_signal_connect (G_OBJECT(volume), "value-changed", |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
577 | G_CALLBACK(pidgin_media_input_volume_changed), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
578 | gtkmedia->priv->media); |
|
37652
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
579 | gtk_scale_button_set_icons(GTK_SCALE_BUTTON(volume), |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
580 | input_volume_icons); |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
581 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
582 | gtkmedia->priv->send_progress = progress; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
583 | } else if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
584 | g_signal_connect (G_OBJECT(volume), "value-changed", |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
585 | G_CALLBACK(pidgin_media_output_volume_changed), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
586 | gtkmedia->priv->media); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
587 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
588 | pidgin_media_insert_widget(gtkmedia, progress, sid, gtkmedia->priv->screenname); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
589 | } |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
590 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
591 | g_signal_connect(G_OBJECT(progress), "destroy", |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
592 | G_CALLBACK(destroy_parent_widget_cb), |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
593 | volume_widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
594 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
595 | return volume_widget; |
|
26622
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
596 | } |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
597 | |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
598 | static void |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
599 | pidgin_media_keypad_pressed_cb(PidginKeypad *keypad, guint key, gpointer data) |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
600 | { |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
601 | PidginMedia *gtkmedia = data; |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
602 | gchar *sid; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
603 | |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
604 | sid = g_object_get_data(G_OBJECT(gtkmedia), "session-id"); |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
605 | |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
606 | purple_media_send_dtmf(gtkmedia->priv->media, sid, key, 25, 50); |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
607 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
608 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
609 | static GtkWidget * |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
610 | pidgin_media_add_dtmf_widget(PidginMedia *gtkmedia, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
611 | PurpleMediaSessionType type, const gchar *_sid) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
612 | { |
|
41263
7443edb37ec6
Port GtkMedia to GtkEventControllers
Gary Kramlich <grim@reaperworld.com>
parents:
41159
diff
changeset
|
613 | GtkApplicationWindow *win = GTK_APPLICATION_WINDOW(gtkmedia); |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
614 | GtkWidget *keypad = NULL; |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
615 | |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
616 | keypad = pidgin_keypad_new(); |
|
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
617 | pidgin_keypad_set_key_capture_widget(PIDGIN_KEYPAD(keypad), |
|
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
618 | GTK_WIDGET(win)); |
|
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
619 | g_signal_connect(keypad, "pressed", |
|
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
620 | G_CALLBACK(pidgin_media_keypad_pressed_cb), gtkmedia); |
|
41263
7443edb37ec6
Port GtkMedia to GtkEventControllers
Gary Kramlich <grim@reaperworld.com>
parents:
41159
diff
changeset
|
621 | |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
622 | g_object_set_data_full(G_OBJECT(win), "session-id", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
623 | g_strdup(_sid), g_free); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
624 | |
|
41478
27d70d93355d
Split keypad into its own widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41279
diff
changeset
|
625 | return keypad; |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
626 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
627 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
628 | static void |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
629 | pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia, const gchar *sid) |
| 19886 | 630 | { |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
631 | GtkWidget *send_widget = NULL, *recv_widget = NULL, *button_widget = NULL; |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
632 | PurpleMediaSessionType type = |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
633 | purple_media_get_session_type(media, sid); |
|
23721
15285d082f6c
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.
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
634 | |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
635 | if (gtkmedia->priv->recv_widget == NULL |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
636 | && type & (PURPLE_MEDIA_RECV_VIDEO | |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
637 | PURPLE_MEDIA_RECV_AUDIO)) { |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
638 | recv_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
639 | gtk_widget_set_hexpand(recv_widget, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
640 | gtk_widget_set_halign(recv_widget, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
641 | gtk_widget_set_vexpand(recv_widget, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
642 | gtk_widget_set_valign(recv_widget, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
643 | gtk_box_append(GTK_BOX(gtkmedia->priv->display), recv_widget); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
644 | } else { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
645 | recv_widget = gtkmedia->priv->recv_widget; |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
646 | } |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
647 | if (gtkmedia->priv->send_widget == NULL |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
648 | && type & (PURPLE_MEDIA_SEND_VIDEO | |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
649 | PURPLE_MEDIA_SEND_AUDIO)) { |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
650 | send_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
651 | gtk_widget_set_halign(send_widget, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
652 | gtk_widget_set_valign(send_widget, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
653 | gtk_box_prepend(GTK_BOX(gtkmedia->priv->display), send_widget); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
654 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40474
diff
changeset
|
655 | button_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
656 | gtk_widget_set_valign(button_widget, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
657 | gtk_box_append(GTK_BOX(send_widget), button_widget); |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
658 | |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
659 | /* Hold button */ |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
660 | gtkmedia->priv->hold = |
|
32056
5ecbc7cf4ee1
Mark the "hold" and "mute" menu items for translation in the media dialog.
Mark Doliner <markdoliner@pidgin.im>
parents:
32055
diff
changeset
|
661 | gtk_toggle_button_new_with_mnemonic(_("_Hold")); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
662 | gtk_box_prepend(GTK_BOX(button_widget), gtkmedia->priv->hold); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
663 | gtk_actionable_set_action_name( |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
664 | GTK_ACTIONABLE(gtkmedia->priv->hold), |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
665 | "win.Hold"); |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
666 | } else { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
667 | send_widget = gtkmedia->priv->send_widget; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
668 | button_widget = gtkmedia->priv->button_widget; |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
669 | } |
|
23738
2188a1d89a3a
Move the audio progress bar widgets to be beside the video displays.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
670 | |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
671 | if (type & PURPLE_MEDIA_RECV_VIDEO) { |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
672 | PidginMediaPrivate *priv = gtkmedia->priv; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
673 | PurpleMediaManager *manager = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
674 | GstElement *pipeline = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
675 | GstElement *sink = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
676 | GtkWidget *remote_video = NULL; |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
677 | |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
678 | purple_media_set_output_window(priv->media, sid, priv->screenname); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
679 | manager = purple_media_get_manager(priv->media); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
680 | pipeline = purple_media_manager_get_pipeline(manager); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
681 | sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtkglsink"); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
682 | if (sink == NULL) { |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
683 | sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtksink"); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
684 | } |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
685 | g_object_get(G_OBJECT(sink), "widget", &remote_video, NULL); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
686 | gtk_widget_show(remote_video); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
687 | gtk_widget_set_valign(remote_video, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
688 | gtk_widget_set_vexpand(remote_video, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
689 | gtk_box_append(GTK_BOX(recv_widget), remote_video); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
690 | |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
691 | pidgin_media_insert_widget(gtkmedia, remote_video, sid, priv->screenname); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
692 | } |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
693 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
694 | if (type & PURPLE_MEDIA_SEND_VIDEO && !gtkmedia->priv->local_video) { |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
695 | PidginMediaPrivate *priv = gtkmedia->priv; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
696 | PurpleMediaManager *manager = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
697 | GstElement *pipeline = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
698 | GstElement *sink = NULL; |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
699 | GtkWidget *local_video = NULL; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
700 | |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
701 | purple_media_set_output_window(priv->media, sid, NULL); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
702 | manager = purple_media_get_manager(priv->media); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
703 | pipeline = purple_media_manager_get_pipeline(manager); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
704 | sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtkglsink"); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
705 | if (sink == NULL) { |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
706 | sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtksink"); |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
707 | } |
|
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40496
diff
changeset
|
708 | g_object_get(G_OBJECT(sink), "widget", &local_video, NULL); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
709 | gtk_widget_show(local_video); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
710 | gtk_widget_set_valign(local_video, GTK_ALIGN_FILL); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
711 | gtk_widget_set_vexpand(local_video, TRUE); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
712 | gtk_box_append(GTK_BOX(send_widget), local_video); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
713 | |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
714 | gtkmedia->priv->pause = |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
715 | gtk_toggle_button_new_with_mnemonic(_("_Pause")); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
716 | gtk_box_prepend(GTK_BOX(button_widget), gtkmedia->priv->pause); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
717 | gtk_actionable_set_action_name( |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
718 | GTK_ACTIONABLE(gtkmedia->priv->pause), |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
719 | "win.Pause"); |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
720 | |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
721 | gtkmedia->priv->local_video = local_video; |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
722 | } |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
723 | if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
724 | GtkWidget *audio = NULL; |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
725 | |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
726 | audio = pidgin_media_add_audio_widget(gtkmedia, PURPLE_MEDIA_RECV_AUDIO, |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
727 | sid); |
|
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
728 | gtk_box_prepend(GTK_BOX(recv_widget), audio); |
|
23738
2188a1d89a3a
Move the audio progress bar widgets to be beside the video displays.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
729 | } |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
730 | |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
731 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
26624
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
732 | gtkmedia->priv->mute = |
|
32056
5ecbc7cf4ee1
Mark the "hold" and "mute" menu items for translation in the media dialog.
Mark Doliner <markdoliner@pidgin.im>
parents:
32055
diff
changeset
|
733 | gtk_toggle_button_new_with_mnemonic(_("_Mute")); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
734 | gtk_box_prepend(GTK_BOX(button_widget), gtkmedia->priv->mute); |
|
38590
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
735 | gtk_actionable_set_action_name( |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
736 | GTK_ACTIONABLE(gtkmedia->priv->mute), |
|
2a46ccba53cb
gtkmedia: Port Hold, Mute, & Pause buttons to use GActions
Mike Ruprecht <cmaiku@gmail.com>
parents:
38589
diff
changeset
|
737 | "win.Mute"); |
|
26624
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
738 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
739 | gtk_box_prepend(GTK_BOX(recv_widget), |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
740 | pidgin_media_add_audio_widget(gtkmedia, |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
741 | PURPLE_MEDIA_SEND_AUDIO, sid)); |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
742 | |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
743 | gtk_box_prepend(GTK_BOX(recv_widget), |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
744 | pidgin_media_add_dtmf_widget(gtkmedia, |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
745 | PURPLE_MEDIA_SEND_AUDIO, sid)); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
746 | } |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
747 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
748 | if (type & PURPLE_MEDIA_AUDIO && |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
749 | gtkmedia->priv->level_handler_id == 0) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
750 | gtkmedia->priv->level_handler_id = g_signal_connect( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
751 | media, "level", G_CALLBACK(level_message_cb), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
752 | gtkmedia); |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
753 | } |
|
26151
218a4f61cf0d
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
754 | |
|
41610
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
755 | if (send_widget != NULL) { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
756 | gtkmedia->priv->send_widget = send_widget; |
|
41610
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
757 | } |
|
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
758 | if (recv_widget != NULL) { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
759 | gtkmedia->priv->recv_widget = recv_widget; |
|
41610
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
760 | } |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
761 | if (button_widget != NULL) { |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
762 | gtkmedia->priv->button_widget = button_widget; |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
763 | } |
|
26151
218a4f61cf0d
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
764 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
765 | if (purple_media_is_initiator(media, sid, NULL) == FALSE) { |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
766 | if (gtkmedia->priv->timeout_id != 0) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
767 | g_source_remove(gtkmedia->priv->timeout_id); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
768 | gtkmedia->priv->request_type |= type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
769 | gtkmedia->priv->timeout_id = g_timeout_add(500, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
770 | (GSourceFunc)pidgin_request_timeout_cb, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
771 | gtkmedia); |
|
23737
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
772 | } |
|
26284
5d36c99b8f2d
Make the sinks better default sizes and display them immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26283
diff
changeset
|
773 | |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
774 | /* set the window icon according to the type */ |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
775 | if (type & PURPLE_MEDIA_VIDEO) { |
|
39129
70843401e6e7
gtkmedia: Replace usage of deprecated gtk_widget_render_icon()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38929
diff
changeset
|
776 | gtk_window_set_icon_name(GTK_WINDOW(gtkmedia), "video-call"); |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
777 | } else if (type & PURPLE_MEDIA_AUDIO) { |
|
39129
70843401e6e7
gtkmedia: Replace usage of deprecated gtk_widget_render_icon()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38929
diff
changeset
|
778 | gtk_window_set_icon_name(GTK_WINDOW(gtkmedia), "audio-call"); |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
779 | } |
|
23737
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
780 | } |
|
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
781 | |
|
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
782 | static void |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
783 | pidgin_media_state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
784 | gchar *sid, gchar *name, PidginMedia *gtkmedia) |
|
22400
3762d64b1f58
Show a message when the remote end terminates a session.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22072
diff
changeset
|
785 | { |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
786 | purple_debug_info("gtkmedia", "state: %d sid: %s name: %s\n", |
|
27974
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27972
diff
changeset
|
787 | state, sid ? sid : "(null)", name ? name : "(null)"); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
788 | if (state == PURPLE_MEDIA_STATE_END) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
789 | if (sid != NULL && name != NULL) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
790 | pidgin_media_remove_widget(gtkmedia, sid, name); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
791 | } else if (sid == NULL && name == NULL) { |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
792 | pidgin_media_emit_message(gtkmedia, |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
793 | _("The call has been terminated.")); |
|
41560
2579a5138f0c
A bunch of random fixes for the the gtk4 branch
Gary Kramlich <grim@reaperworld.com>
parents:
41490
diff
changeset
|
794 | gtk_window_destroy(GTK_WINDOW(gtkmedia)); |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
795 | } |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
796 | } else if (state == PURPLE_MEDIA_STATE_NEW && |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
797 | sid != NULL && name != NULL) { |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
798 | pidgin_media_ready_cb(media, gtkmedia, sid); |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
799 | } |
| 19886 | 800 | } |
| 801 | ||
| 802 | static void | |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
803 | pidgin_media_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type, |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26494
diff
changeset
|
804 | gchar *sid, gchar *name, gboolean local, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26494
diff
changeset
|
805 | PidginMedia *gtkmedia) |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
806 | { |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
807 | if (type == PURPLE_MEDIA_INFO_REJECT) { |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
808 | pidgin_media_emit_message(gtkmedia, |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
809 | _("You have rejected the call.")); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
810 | } else if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
811 | if (local == TRUE) |
|
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
812 | purple_request_close_with_handle(gtkmedia); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
813 | pidgin_media_set_state(gtkmedia, PIDGIN_MEDIA_ACCEPTED); |
|
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
814 | pidgin_media_emit_message(gtkmedia, _("Call in progress.")); |
|
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
815 | gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), |
|
32695
f86582a6bc5b
Remove a period from a phrase that appears in the status bar of active calls
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
816 | 0, _("Call in progress")); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
817 | gtk_widget_show(GTK_WIDGET(gtkmedia)); |
|
38818
87ae8821ef63
Pidgin: Indicate mute/unmute status when changed remotely.
David Woodhouse <dwmw@amazon.co.uk>
parents:
37650
diff
changeset
|
818 | } else if (type == PURPLE_MEDIA_INFO_MUTE && !local) { |
|
87ae8821ef63
Pidgin: Indicate mute/unmute status when changed remotely.
David Woodhouse <dwmw@amazon.co.uk>
parents:
37650
diff
changeset
|
819 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkmedia->priv->mute), TRUE); |
|
87ae8821ef63
Pidgin: Indicate mute/unmute status when changed remotely.
David Woodhouse <dwmw@amazon.co.uk>
parents:
37650
diff
changeset
|
820 | } else if (type == PURPLE_MEDIA_INFO_UNMUTE && !local) { |
|
87ae8821ef63
Pidgin: Indicate mute/unmute status when changed remotely.
David Woodhouse <dwmw@amazon.co.uk>
parents:
37650
diff
changeset
|
821 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkmedia->priv->mute), FALSE); |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
822 | } |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
823 | } |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
824 | |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
825 | static void |
| 19886 | 826 | pidgin_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
| 827 | { | |
| 828 | PidginMedia *media; | |
| 829 | g_return_if_fail(PIDGIN_IS_MEDIA(object)); | |
|
22400
3762d64b1f58
Show a message when the remote end terminates a session.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22072
diff
changeset
|
830 | |
| 19886 | 831 | media = PIDGIN_MEDIA(object); |
| 832 | switch (prop_id) { | |
| 833 | case PROP_MEDIA: | |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
834 | { |
| 19886 | 835 | if (media->priv->media) |
| 836 | g_object_unref(media->priv->media); | |
|
39424
793f7d43e2f0
Use g_value_dup_object where needed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39374
diff
changeset
|
837 | media->priv->media = g_value_dup_object(value); |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
838 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
839 | if (purple_media_is_initiator(media->priv->media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
840 | NULL, NULL) == TRUE) |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
841 | pidgin_media_set_state(media, PIDGIN_MEDIA_WAITING); |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
842 | else |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
843 | pidgin_media_set_state(media, PIDGIN_MEDIA_REQUESTED); |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
844 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
845 | g_signal_connect(G_OBJECT(media->priv->media), "error", |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
846 | G_CALLBACK(pidgin_media_error_cb), media); |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
847 | g_signal_connect(G_OBJECT(media->priv->media), "state-changed", |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
848 | G_CALLBACK(pidgin_media_state_changed_cb), media); |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
849 | g_signal_connect(G_OBJECT(media->priv->media), "stream-info", |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
850 | G_CALLBACK(pidgin_media_stream_info_cb), media); |
| 19886 | 851 | break; |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
852 | } |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
853 | case PROP_SCREENNAME: |
|
37424
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
854 | g_free(media->priv->screenname); |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
855 | media->priv->screenname = g_value_dup_string(value); |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
856 | break; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
857 | default: |
| 19886 | 858 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 859 | break; | |
| 860 | } | |
| 861 | } | |
| 862 | ||
| 863 | static void | |
| 864 | pidgin_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 865 | { | |
| 866 | PidginMedia *media; | |
| 867 | g_return_if_fail(PIDGIN_IS_MEDIA(object)); | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
868 | |
| 19886 | 869 | media = PIDGIN_MEDIA(object); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
870 | |
| 19886 | 871 | switch (prop_id) { |
| 872 | case PROP_MEDIA: | |
| 873 | g_value_set_object(value, media->priv->media); | |
| 874 | break; | |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
875 | case PROP_SCREENNAME: |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
876 | g_value_set_string(value, media->priv->screenname); |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
877 | break; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
878 | default: |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
879 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 19886 | 880 | break; |
| 881 | } | |
| 882 | } | |
| 883 | ||
|
26494
829997fe9c23
No reason for this to be public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26488
diff
changeset
|
884 | static GtkWidget * |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
885 | pidgin_media_new(PurpleMedia *media, const gchar *screenname) |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
886 | { |
|
23721
15285d082f6c
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.
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
887 | PidginMedia *gtkmedia = g_object_new(pidgin_media_get_type(), |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
888 | "media", media, |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
889 | "screenname", screenname, NULL); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
890 | return GTK_WIDGET(gtkmedia); |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
891 | } |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
892 | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
893 | static void |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
894 | pidgin_media_set_state(PidginMedia *gtkmedia, PidginMediaState state) |
| 19886 | 895 | { |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
896 | gtkmedia->priv->state = state; |
| 19886 | 897 | } |
| 898 | ||
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
899 | static gboolean |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
900 | pidgin_media_new_cb(PurpleMediaManager *manager, PurpleMedia *media, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
901 | PurpleAccount *account, gchar *screenname, gpointer nul) |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
902 | { |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
903 | PidginMedia *gtkmedia = PIDGIN_MEDIA( |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
904 | pidgin_media_new(media, screenname)); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
905 | PurpleBuddy *buddy = purple_blist_find_buddy(account, screenname); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
906 | const gchar *alias = buddy ? |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
907 | purple_buddy_get_contact_alias(buddy) : screenname; |
|
26275
69951c5ca44f
Use aliases for the media window title and the request window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26273
diff
changeset
|
908 | gtk_window_set_title(GTK_WINDOW(gtkmedia), alias); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
909 | |
|
41610
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
910 | gtk_widget_set_visible(GTK_WIDGET(gtkmedia), |
|
412ebdf7158c
Remove redundant gtk_widget_show
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41597
diff
changeset
|
911 | purple_media_is_initiator(media, NULL, NULL)); |
|
26273
34eb5919488a
Use request API for a media invitation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26272
diff
changeset
|
912 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
913 | return TRUE; |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
914 | } |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
915 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
916 | void |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
917 | pidgin_medias_init(void) |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
918 | { |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
919 | PurpleMediaManager *manager = purple_media_manager_get(); |
|
38027
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
920 | PurpleMediaElementInfo *video_src = NULL; |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
921 | PurpleMediaElementInfo *video_sink = NULL; |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
922 | PurpleMediaElementInfo *audio_src = NULL; |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
923 | PurpleMediaElementInfo *audio_sink = NULL; |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
924 | const char *pref; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
925 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
926 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
927 | PIDGIN_PREFS_ROOT "/vvconfig/video/src/device"); |
|
38027
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
928 | if (pref) |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
929 | video_src = purple_media_manager_get_element_info(manager, pref); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
930 | if (!video_src) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
931 | pref = "autovideosrc"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
932 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
933 | PIDGIN_PREFS_ROOT "/vvconfig/video/src/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
934 | video_src = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
935 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
936 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
937 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
938 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
939 | PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device"); |
|
38027
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
940 | if (pref) |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
941 | video_sink = purple_media_manager_get_element_info(manager, pref); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
942 | if (!video_sink) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
943 | pref = "autovideosink"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
944 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
945 | PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
946 | video_sink = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
947 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
948 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
949 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
950 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
951 | PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device"); |
|
38027
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
952 | if (pref) |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
953 | audio_src = purple_media_manager_get_element_info(manager, pref); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
954 | if (!audio_src) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
955 | pref = "autoaudiosrc"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
956 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
957 | PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
958 | audio_src = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
959 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
960 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
961 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
962 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
963 | PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device"); |
|
38027
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
964 | if (pref) |
|
bd088b2700cd
Fix crash if VV config device prefs are unset.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
965 | audio_sink = purple_media_manager_get_element_info(manager, pref); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
966 | if (!audio_sink) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
967 | pref = "autoaudiosink"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
968 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
969 | PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
970 | audio_sink = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
971 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
972 | } |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
973 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
974 | g_signal_connect(G_OBJECT(manager), "init-media", |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
975 | G_CALLBACK(pidgin_media_new_cb), NULL); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
976 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
977 | purple_media_manager_set_ui_caps(manager, |
|
26521
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
978 | PURPLE_MEDIA_CAPS_AUDIO | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
979 | PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
980 | PURPLE_MEDIA_CAPS_VIDEO | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
981 | PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
982 | PURPLE_MEDIA_CAPS_AUDIO_VIDEO); |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
983 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
984 | purple_debug_info("gtkmedia", "Registering media element types\n"); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
985 | purple_media_manager_set_active_element(manager, video_src); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
986 | purple_media_manager_set_active_element(manager, video_sink); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
987 | purple_media_manager_set_active_element(manager, audio_src); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
988 | purple_media_manager_set_active_element(manager, audio_sink); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
989 | } |