/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDeviceAlsa.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/drivers/midi/MidiInputDeviceAlsa.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 221 - (hide annotations) (download) (as text)
Fri Aug 20 17:25:19 2004 UTC (19 years, 9 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 4689 byte(s)
* src/drivers/midi/MidiInputDeviceAlsa.cpp: implemented port parameter
 "NAME" which now updates the registered ALSA seq port name as well, fixed
  port parameter "ALSA_SEQ_BINDINGS" to allow more than one binding
* src/network/lscp.y: fixed symbol STRINGVAL (that is strings encapsulated
  into apostrophes) which didn't allow space characters
* changed all driver names and driver paramaters to upper case
* fixed typo in LSCP documentation
  (section 5.3.12, was: "SET MIDI_INPUT_PORT PARAMETER",
   should be: "SET MIDI_INPUT_PORT_PARAMETER")

1 schoenebeck 201 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5     * Copyright (C) 2003, 2004 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 __LS_MIDIINPUTDEVICEALSA_H__
24     #define __LS_MIDIINPUTDEVICEALSA_H__
25    
26     #include <alsa/asoundlib.h>
27    
28     #include "../../common/global.h"
29     #include "../../common/Thread.h"
30     #include "../../common/RingBuffer.h"
31     #include "MidiInputDevice.h"
32    
33     namespace LinuxSampler {
34    
35     /** ALSA MIDI input driver
36     *
37     * Implements MIDI input for the Advanced Linux Sound Architecture
38     * (ALSA).
39     */
40     class MidiInputDeviceAlsa : public MidiInputDevice, public Thread {
41     public:
42 schoenebeck 221
43     /**
44     * MIDI Port implementation for the ALSA MIDI input driver.
45     */
46     class MidiInputPortAlsa : public MidiInputPort {
47     public:
48     /** MIDI Port Parameter 'NAME'
49     *
50     * Used to assign an arbitrary name to the MIDI port.
51     */
52     class ParameterName : public MidiInputPort::ParameterName {
53     public:
54     ParameterName(MidiInputPort* pPort) throw (LinuxSamplerException);
55     virtual void OnSetValue(String s) throw (LinuxSamplerException);
56     };
57    
58     /** MIDI Port Parameter 'ALSA_SEQ_BINDINGS'
59     *
60     * Used to connect to other Alsa sequencer clients.
61     */
62     class ParameterAlsaSeqBindings : public DeviceRuntimeParameterStrings {
63     public:
64     ParameterAlsaSeqBindings(MidiInputPortAlsa* pPort);
65     virtual String Description();
66     virtual bool Fix();
67     virtual std::vector<String> PossibilitiesAsString();
68     virtual void OnSetValue(std::vector<String> vS) throw (LinuxSamplerException);
69     protected:
70     MidiInputPortAlsa* pPort;
71     };
72    
73     void ConnectToAlsaMidiSource(const char* MidiSource);
74     protected:
75     MidiInputPortAlsa(MidiInputDeviceAlsa* pDevice) throw (MidiInputException);
76     ~MidiInputPortAlsa();
77     friend class MidiInputDeviceAlsa;
78     private:
79     MidiInputDeviceAlsa* pDevice;
80     };
81    
82 schoenebeck 201 MidiInputDeviceAlsa(std::map<String,DeviceCreationParameter*> Parameters);
83     ~MidiInputDeviceAlsa();
84    
85     // derived abstract methods from class 'MidiInputDevice'
86     void Listen();
87     void StopListen();
88 schoenebeck 221 virtual String Driver();
89     static String Name();
90     static String Description();
91     static String Version();
92 schoenebeck 201
93 schoenebeck 221 MidiInputPortAlsa* CreateMidiPort();
94 schoenebeck 201 protected:
95     int Main(); ///< Implementation of virtual method from class Thread
96     private:
97     snd_seq_t* hAlsaSeq;
98     int hAlsaSeqClient; ///< Alsa Sequencer client ID
99     };
100     }
101    
102     #endif // __LS_MIDIINPUTDEVICEALSA_H__

  ViewVC Help
Powered by ViewVC