1 | //roarmixer.c: |
---|
2 | /* GStreamer |
---|
3 | * Copyright (C) <2005> Arwed v. Merkatz <v.merkatz@gmx.net> |
---|
4 | * Copyright (C) <2008> Philipp 'ph3-der-loewe' Schafft |
---|
5 | * Copyright (C) <2009> Philipp 'ph3-der-loewe' Schafft |
---|
6 | * <lion@lion.leolix.org> |
---|
7 | * |
---|
8 | * roarmixer.h: an RoarAudio audio mixer |
---|
9 | * |
---|
10 | * This library is free software; you can redistribute it and/or |
---|
11 | * modify it under the terms of the GNU Library General Public |
---|
12 | * License as published by the Free Software Foundation; either |
---|
13 | * version 2 of the License, or (at your option) any later version. |
---|
14 | * |
---|
15 | * This library is distributed in the hope that it will be useful, |
---|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
18 | * Library General Public License for more details. |
---|
19 | * |
---|
20 | * You should have received a copy of the GNU Library General Public |
---|
21 | * License along with this library; if not, write to the |
---|
22 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
23 | * Boston, MA 02111-1307, USA. |
---|
24 | */ |
---|
25 | |
---|
26 | |
---|
27 | #include "roarmixer.h" |
---|
28 | |
---|
29 | GstRoarMixer* gst_roarmixer_new (const gchar *device, |
---|
30 | GstRoarMixerDirection dir) { |
---|
31 | GstRoarMixer *ret = NULL; |
---|
32 | |
---|
33 | g_return_val_if_fail(device != NULL, NULL); |
---|
34 | |
---|
35 | ret = g_new0(GstRoarMixer, 1); |
---|
36 | |
---|
37 | ret->device = g_strdup(device); |
---|
38 | ret->dir = dir; |
---|
39 | |
---|
40 | /* |
---|
41 | if (!gst_ossmixer_open (ret)) |
---|
42 | goto error; |
---|
43 | */ |
---|
44 | |
---|
45 | if ( roar_simple_connect(&(ret->con), NULL, "gstroarmixer") == -1 ) |
---|
46 | goto error; |
---|
47 | |
---|
48 | return ret; |
---|
49 | |
---|
50 | error: |
---|
51 | if (ret) |
---|
52 | gst_roarmixer_free (ret); |
---|
53 | |
---|
54 | return NULL; |
---|
55 | } |
---|
56 | |
---|
57 | void gst_roarmixer_free (GstRoarMixer *mixer) { |
---|
58 | g_return_if_fail(mixer != NULL); |
---|
59 | |
---|
60 | if (mixer->device) { |
---|
61 | g_free(mixer->device); |
---|
62 | mixer->device = NULL; |
---|
63 | } |
---|
64 | |
---|
65 | if (mixer->cardname) { |
---|
66 | g_free(mixer->cardname); |
---|
67 | mixer->cardname = NULL; |
---|
68 | } |
---|
69 | |
---|
70 | if (mixer->tracklist) { |
---|
71 | g_list_foreach(mixer->tracklist, (GFunc) g_object_unref, NULL); |
---|
72 | g_list_free(mixer->tracklist); |
---|
73 | mixer->tracklist = NULL; |
---|
74 | } |
---|
75 | |
---|
76 | roar_disconnect(&(mixer->con)); |
---|
77 | |
---|
78 | g_free (mixer); |
---|
79 | } |
---|
80 | |
---|
81 | /* unused with G_DISABLE_* */ |
---|
82 | static G_GNUC_UNUSED gboolean gst_roarmixer_contains_track (GstRoarMixer * mixer, |
---|
83 | GstRoarMixerTrack * roartrack) { |
---|
84 | const GList *item; |
---|
85 | |
---|
86 | for (item = mixer->tracklist; item != NULL; item = item->next) |
---|
87 | if (item->data == roartrack) |
---|
88 | return TRUE; |
---|
89 | |
---|
90 | return FALSE; |
---|
91 | } |
---|
92 | |
---|
93 | const GList* gst_roarmixer_list_tracks (GstRoarMixer * mixer) { |
---|
94 | return (const GList *) mixer->tracklist; |
---|
95 | } |
---|
96 | |
---|
97 | void gst_roarmixer_set_volume (GstRoarMixer * mixer, |
---|
98 | GstMixerTrack * track, |
---|
99 | gint * volumes) { |
---|
100 | } |
---|
101 | void gst_roarmixer_get_volume (GstRoarMixer * mixer, |
---|
102 | GstMixerTrack * track, |
---|
103 | gint * volumes) { |
---|
104 | } |
---|
105 | void gst_roarmixer_set_record (GstRoarMixer * mixer, |
---|
106 | GstMixerTrack * track, |
---|
107 | gboolean record) { |
---|
108 | } |
---|
109 | void gst_roarmixer_set_mute (GstRoarMixer * mixer, |
---|
110 | GstMixerTrack * track, |
---|
111 | gboolean mute) { |
---|
112 | } |
---|
113 | |
---|
114 | //ll |
---|