/[svn]/linuxsampler/trunk/src/alsaio.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/alsaio.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (show annotations) (download) (as text)
Mon Feb 16 19:30:42 2004 UTC (20 years, 2 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3062 byte(s)
* implemented bidirectional voice state transition, means voice state can
  switch arbitrary times between 'Sustained'<-->'Released' within it's life
  time, thus the release process of a voice can be cancelled
* src/eg_vca.cpp: extended envelope generator by additional states
  ('Attack_Hold', 'Decay_1' and 'Decay_2')
* applied patch from Vladimir Senkov which adds new command line parameters
  ('--jackout', '--alsaout' and '--samplerate')
* configure.in: fixed compiler warning

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003 by Benno Senoner and Christian Schoenebeck *
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 *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 #ifndef __ALSAIO_H__
24 #define __ALSAIO_H__
25
26 #include <string.h>
27 #include <alsa/asoundlib.h>
28
29 #include "global.h"
30 #include "audioio.h"
31 #include "thread.h"
32 #include "audiothread.h"
33
34 class AlsaIO : public AudioIO, protected Thread {
35 public:
36 AlsaIO();
37 int Initialize(uint Channels, uint Samplerate, uint Fragments, uint FragmentSize, String Card);
38 void Activate();
39 void Close();
40 void* GetInterleavedOutputBuffer();
41 void* GetChannelOutputBufer(uint Channel);
42 protected:
43 int Main(); ///< Implementation of virtual method from class Thread
44 private:
45 int16_t* pOutputBuffer; ///< This is the buffer where the final mix will be copied to and send to the sound card
46 String pcm_name; ///< Name of the PCM device, like plughw:0,0 the first number is the number of the soundcard, the second number is the number of the device.
47 snd_pcm_t* pcm_handle; ///< Handle for the PCM device
48 snd_pcm_stream_t stream;
49 snd_pcm_hw_params_t* hwparams; ///< This structure contains information about the hardware and can be used to specify the configuration to be used for the PCM stream.
50 snd_pcm_sw_params_t* swparams;
51
52 int Output();
53 bool HardwareParametersSupported(uint channels, int samplerate, uint numfragments, uint fragmentsize);
54 };
55
56 #endif // __ALSAIO_H__

  ViewVC Help
Powered by ViewVC