History

Add public function sf_get_channels(). Suggested by Max Flax.

Erik de Castro Lopo committed 13 years ago

Commit 28afc791 parent c3b66182 files · +22 −1Browse files

Unified · Split

2 files
  1. src/samplerate.c +15 −1
  2. src/samplerate.h +7 −0
src/samplerate.c+15−1
@@ -1,5 +1,5 @@
11 /*
2−** Copyright (C) 2002-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
2+** Copyright (C) 2002-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
33 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
@@ -289,6 +289,20 @@ src_set_ratio (SRC_STATE *state, double new_ratio) · 283 unmodified lines
289289 return SRC_ERR_NO_ERROR ;
290290 } /* src_set_ratio */
291291
292+int
293+src_get_channels (SRC_STATE *state)
294+{ SRC_PRIVATE *psrc ;
295+
296+ psrc = (SRC_PRIVATE*) state ;
297+
298+ if (psrc == NULL)
299+ return SRC_ERR_BAD_STATE ;
300+ if (psrc->vari_process == NULL || psrc->const_process == NULL)
301+ return SRC_ERR_BAD_PROC_PTR ;
302+
303+ return psrc->channels ;
304+} /* src_get_channels */
305+
292306 int
293307 src_reset (SRC_STATE *state)
294308 { SRC_PRIVATE *psrc ;
src/samplerate.h+7−0
@@ -131,6 +131,13 @@ const char *src_get_version (void) ; · 130 unmodified lines
131131
132132 int src_set_ratio (SRC_STATE *state, double new_ratio) ;
133133
134+/*
135+** Get the current channel count.
136+** Returns negative on error, positive channel count otherwise
137+*/
138+
139+int src_get_channels (SRC_STATE *state) ;
140+
134141 /*
135142 ** Reset the internal SRC state.
136143 ** Does not modify the quality settings.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t