/[svn]/linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceJack.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceJack.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 374 by schoenebeck, Sat Feb 12 00:36:08 2005 UTC revision 1651 by persson, Sun Jan 27 15:07:11 2008 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6     *   Copyright (C) 2005 - 2008 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 23  Line 24 
24  #ifndef __LS_AUDIOOUTPUTDEVICEJACK_H__  #ifndef __LS_AUDIOOUTPUTDEVICEJACK_H__
25  #define __LS_AUDIOOUTPUTDEVICEJACK_H__  #define __LS_AUDIOOUTPUTDEVICEJACK_H__
26    
27  #include "../../common/global.h"  #include "../../common/global_private.h"
28    
29  #if HAVE_JACK  #if HAVE_JACK
30    
# Line 33  Line 34 
34    
35  #include "AudioOutputDevice.h"  #include "AudioOutputDevice.h"
36  #include "../../common/ConditionServer.h"  #include "../../common/ConditionServer.h"
37    #include "../midi/MidiInputDeviceJack.h"
38    
39  namespace LinuxSampler {  namespace LinuxSampler {
40    
# Line 75  namespace LinuxSampler { Line 77  namespace LinuxSampler {
77                              virtual void                OnSetValue(std::vector<String> vS);                              virtual void                OnSetValue(std::vector<String> vS);
78                              static String Name();                              static String Name();
79                          protected:                          protected:
80                              AudioChannelJack* pChannel;                              AudioChannelJack*   pChannel;
81                                std::vector<String> Bindings;
82                      };                      };
83                  protected:                  protected:
84                      AudioChannelJack(uint ChannelNr, AudioOutputDeviceJack* pDevice) throw (AudioOutputException);                      AudioChannelJack(uint ChannelNr, AudioOutputDeviceJack* pDevice) throw (AudioOutputException);
# Line 97  namespace LinuxSampler { Line 100  namespace LinuxSampler {
100              class ParameterName : public DeviceCreationParameterString {              class ParameterName : public DeviceCreationParameterString {
101                  public:                  public:
102                      ParameterName();                      ParameterName();
103                      ParameterName(String s) throw (LinuxSamplerException);                      ParameterName(String s) throw (Exception);
104                      virtual String              Description();                      virtual String              Description();
105                      virtual bool                Fix();                      virtual bool                Fix();
106                      virtual bool                Mandatory();                      virtual bool                Mandatory();
107                      virtual std::map<String,DeviceCreationParameter*> DependsAsParameters();                      virtual std::map<String,DeviceCreationParameter*> DependsAsParameters();
108                      virtual std::vector<String> PossibilitiesAsString(std::map<String,String> Parameters);                      virtual std::vector<String> PossibilitiesAsString(std::map<String,String> Parameters);
109                      virtual optional<String>    DefaultAsString(std::map<String,String> Parameters);                      virtual optional<String>    DefaultAsString(std::map<String,String> Parameters);
110                      virtual void                OnSetValue(String s) throw (LinuxSamplerException);                      virtual void                OnSetValue(String s) throw (Exception);
111                      static String Name();                      static String Name();
112              };              };
113    
# Line 117  namespace LinuxSampler { Line 120  namespace LinuxSampler {
120              virtual AudioChannel* CreateChannel(uint ChannelNr);              virtual AudioChannel* CreateChannel(uint ChannelNr);
121    
122    
123              static String Name();              static String Name();
124    
125              virtual String Driver();              virtual String Driver();
126    
# Line 134  namespace LinuxSampler { Line 137  namespace LinuxSampler {
137      };      };
138    
139      // Callback functions for the libjack API      // Callback functions for the libjack API
140      int  __libjack_process_callback(jack_nframes_t nframes, void* arg);      int  linuxsampler_libjack_process_callback(jack_nframes_t nframes, void* arg);
141      void __libjack_shutdown_callback(void* arg);      void linuxsampler_libjack_shutdown_callback(void* arg);
142    
143    
144        /** JACK client
145         *
146         * Represents a jack client. This class is shared by
147         * AudioOutputDeviceJack and MidiInputDeviceJack. The jack server
148         * calls JackClient::Process, which in turn calls
149         * AudioOutputDeviceJack::Process and/or
150         * MidiInputDeviceJack::Process.
151         */
152        class JackClient {
153            public:
154                static JackClient* CreateAudio(String Name);
155                static JackClient* CreateMidi(String Name);
156                static void ReleaseAudio(String Name);
157                static void ReleaseMidi(String Name);
158                int Process(uint Samples);
159                void Stop();
160                void SetAudioOutputDevice(AudioOutputDeviceJack* device);
161                void SetMidiInputDevice(MidiInputDeviceJack* device);
162    
163                jack_client_t* hJackClient;
164    
165            private:
166                static std::map<String, JackClient*> Clients;
167                struct config_t {
168                    AudioOutputDeviceJack* AudioDevice;
169                    MidiInputDeviceJack* MidiDevice;
170                };
171                SynchronizedConfig<config_t> Config;
172                SynchronizedConfig<config_t>::Reader ConfigReader;
173                bool audio;
174                bool midi;
175    
176                JackClient(String Name);
177                ~JackClient();
178        };
179  }  }
180    
181  #endif // HAVE_JACK  #endif // HAVE_JACK

Legend:
Removed from v.374  
changed lines
  Added in v.1651

  ViewVC Help
Powered by ViewVC