2
** Copyright (C) 2006 Paul Davis <paul@linuxaudiosystems.com>
3
** Copyright (C) 2006 Erik de Castro Lopo <erikd@mega-nerd.com>
5
** This program is free software; you can redistribute it and/or modify
6
** it under the terms of the GNU Lesser General Public License as published by
7
** the Free Software Foundation; either version 2.1 of the License, or
8
** (at your option) any later version.
10
** This program is distributed in the hope that it will be useful,
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
** GNU Lesser General Public License for more details.
15
** You should have received a copy of the GNU Lesser General Public License
16
** along with this program; if not, write to the Free Software
17
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
** Allocate and initialize a broadcast info structure.
30
broadcast_info_alloc (void)
31
{ SF_BROADCAST_INFO* bext ;
33
if ((bext = calloc (1, sizeof (SF_BROADCAST_INFO))) == NULL)
37
} /* broadcast_info_alloc */
40
broadcast_info_copy (SF_BROADCAST_INFO* dst, SF_BROADCAST_INFO* src)
41
{ memcpy (dst, src, sizeof (SF_BROADCAST_INFO)) ;
43
/* Currently writing this version. */
47
} /* broadcast_info_copy */
50
broadcast_add_coding_history (SF_BROADCAST_INFO* bext, unsigned int channels, unsigned int samplerate)
59
strncpy (chnstr, "mono", sizeof (chnstr)) ;
63
strncpy (chnstr, "stereo", sizeof (chnstr)) ;
67
LSF_SNPRINTF (chnstr, sizeof (chnstr), "%uchn", channels) ;
71
count = LSF_SNPRINTF (bext->coding_history, sizeof (bext->coding_history), "F=%u,A=PCM,M=%s,W=24,T=%s-%s", samplerate, chnstr, PACKAGE, VERSION) ;
73
if (count >= SIGNED_SIZEOF (bext->coding_history))
74
bext->coding_history_size = sizeof (bext->coding_history) ;
76
{ count += count & 1 ;
77
bext->coding_history_size = count ;
81
} /* broadcast_add_coding_history */
84
** Do not edit or modify anything in this comment block.
85
** The following line is a file identity tag for the GNU Arch
86
** revision control system.
88
** arch-tag: 4b3b69c7-d710-4424-9da0-5048534a0beb