1 /*
2  * Copyright (C) 2008 Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __KSHELPERS_H__
21 #define __KSHELPERS_H__
22 
23 #include <glib.h>
24 #include <windows.h>
25 #include <mmsystem.h>
26 #include <ks.h>
27 
28 G_BEGIN_DECLS
29 
30 typedef struct _KsDeviceEntry KsDeviceEntry;
31 
32 struct _KsDeviceEntry
33 {
34   guint index;
35   gchar * name;
36   gchar * path;
37 };
38 
39 gboolean ks_is_valid_handle (HANDLE h);
40 
41 GList * ks_enumerate_devices (const GUID * devtype, const GUID * direction_category);
42 void ks_device_entry_free (KsDeviceEntry * entry);
43 void ks_device_list_free (GList * devices);
44 
45 gboolean ks_filter_get_pin_property (HANDLE filter_handle, gulong pin_id, GUID prop_set, gulong prop_id, gpointer value, gulong value_size, gulong * error);
46 gboolean ks_filter_get_pin_property_multi (HANDLE filter_handle, gulong pin_id, GUID prop_set, gulong prop_id, KSMULTIPLE_ITEM ** items, gulong * error);
47 
48 gboolean ks_object_query_property (HANDLE handle, GUID prop_set, gulong prop_id, gulong prop_flags, gpointer * value, gulong * value_size, gulong * error);
49 gboolean ks_object_get_property (HANDLE handle, GUID prop_set, gulong prop_id, gpointer * value, gulong * value_size, gulong * error);
50 gboolean ks_object_set_property (HANDLE handle, GUID prop_set, gulong prop_id, gpointer value, gulong value_size, gulong * error);
51 
52 gboolean ks_object_get_supported_property_sets (HANDLE handle, GUID ** propsets, gulong * len);
53 
54 gboolean ks_object_set_connection_state (HANDLE handle, KSSTATE state, gulong * error);
55 
56 gchar * ks_guid_to_string (const GUID * guid);
57 const gchar * ks_state_to_string (KSSTATE state);
58 gchar * ks_options_flags_to_string (gulong flags);
59 gchar * ks_property_set_to_string (const GUID * guid);
60 
61 G_END_DECLS
62 
63 #endif /* __KSHELPERS_H__ */
64