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 - 2013 Christian Schoenebeck * |
* Copyright (C) 2005 - 2014 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 * |
65 |
class ParameterName : public AudioChannel::ParameterName { |
class ParameterName : public AudioChannel::ParameterName { |
66 |
public: |
public: |
67 |
ParameterName(AudioChannelJack* pChannel); |
ParameterName(AudioChannelJack* pChannel); |
68 |
virtual void OnSetValue(String s); |
virtual void OnSetValue(String s) OVERRIDE; |
69 |
protected: |
protected: |
70 |
AudioChannelJack* pChannel; |
AudioChannelJack* pChannel; |
71 |
}; |
}; |
77 |
class ParameterJackBindings : public DeviceRuntimeParameterStrings { |
class ParameterJackBindings : public DeviceRuntimeParameterStrings { |
78 |
public: |
public: |
79 |
ParameterJackBindings(AudioChannelJack* pChannel); |
ParameterJackBindings(AudioChannelJack* pChannel); |
80 |
virtual String Description(); |
virtual String Description() OVERRIDE; |
81 |
virtual bool Fix(); |
virtual bool Fix() OVERRIDE; |
82 |
virtual std::vector<String> PossibilitiesAsString(); |
virtual std::vector<String> PossibilitiesAsString() OVERRIDE; |
83 |
virtual void OnSetValue(std::vector<String> vS); |
virtual void OnSetValue(std::vector<String> vS) OVERRIDE; |
84 |
static String Name(); |
static String Name(); |
85 |
protected: |
protected: |
86 |
AudioChannelJack* pChannel; |
AudioChannelJack* pChannel; |
108 |
public: |
public: |
109 |
ParameterName(); |
ParameterName(); |
110 |
ParameterName(String s) throw (Exception); |
ParameterName(String s) throw (Exception); |
111 |
virtual String Description(); |
virtual String Description() OVERRIDE; |
112 |
virtual bool Fix(); |
virtual bool Fix() OVERRIDE; |
113 |
virtual bool Mandatory(); |
virtual bool Mandatory() OVERRIDE; |
114 |
virtual std::map<String,DeviceCreationParameter*> DependsAsParameters(); |
virtual std::map<String,DeviceCreationParameter*> DependsAsParameters() OVERRIDE; |
115 |
virtual std::vector<String> PossibilitiesAsString(std::map<String,String> Parameters); |
virtual std::vector<String> PossibilitiesAsString(std::map<String,String> Parameters) OVERRIDE; |
116 |
virtual optional<String> DefaultAsString(std::map<String,String> Parameters); |
virtual optional<String> DefaultAsString(std::map<String,String> Parameters) OVERRIDE; |
117 |
virtual void OnSetValue(String s) throw (Exception); |
virtual void OnSetValue(String s) throw (Exception) OVERRIDE; |
118 |
static String Name(); |
static String Name(); |
119 |
}; |
}; |
120 |
|
|
121 |
// derived abstract methods from class 'AudioOutputDevice' |
/** Audio Device Parameter 'SAMPLERATE' |
122 |
virtual void Play(); |
* |
123 |
virtual bool IsPlaying(); |
* Used to retrieve the sample rate of the JACK audio output |
124 |
virtual void Stop(); |
* device. Even though the sample rate of the JACK server might |
125 |
virtual uint MaxSamplesPerCycle(); |
* change during runtime, the JACK API currently however does not |
126 |
virtual uint SampleRate(); |
* allow clients to change the sample rate. So this parameter is |
127 |
virtual AudioChannel* CreateChannel(uint ChannelNr); |
* read only. |
128 |
virtual float latency(); |
* |
129 |
|
* This base parameter class has just been overridden for this JACK |
130 |
|
* driver to implement a valid default value for sample rate. The |
131 |
|
* default value will simply return the sample rate of the currently |
132 |
|
* running JACK server. It will return "nothing" if the JACK server |
133 |
|
* is not running at that point. |
134 |
|
*/ |
135 |
|
class ParameterSampleRate : public AudioOutputDevice::ParameterSampleRate { |
136 |
|
public: |
137 |
|
ParameterSampleRate(); |
138 |
|
ParameterSampleRate(String s); |
139 |
|
virtual optional<int> DefaultAsInt(std::map<String,String> Parameters) OVERRIDE; |
140 |
|
virtual void OnSetValue(int i) throw (Exception) OVERRIDE; |
141 |
|
}; |
142 |
|
|
143 |
|
// derived abstract methods from class 'AudioOutputDevice' |
144 |
|
virtual void Play() OVERRIDE; |
145 |
|
virtual bool IsPlaying() OVERRIDE; |
146 |
|
virtual void Stop() OVERRIDE; |
147 |
|
virtual uint MaxSamplesPerCycle() OVERRIDE; |
148 |
|
virtual uint SampleRate() OVERRIDE; |
149 |
|
virtual AudioChannel* CreateChannel(uint ChannelNr) OVERRIDE; |
150 |
|
virtual String Driver() OVERRIDE; |
151 |
|
virtual float latency() OVERRIDE; |
152 |
|
|
153 |
static String Name(); |
static String Name(); |
154 |
|
|
|
virtual String Driver(); |
|
|
|
|
155 |
static String Description(); |
static String Description(); |
156 |
static String Version(); |
static String Version(); |
157 |
|
|
213 |
~JackClient(); |
~JackClient(); |
214 |
|
|
215 |
// Callback functions for the libjack API |
// Callback functions for the libjack API |
216 |
static void libjackShutdownCallback(void* arg); |
#if HAVE_JACK_ON_INFO_SHUTDOWN |
217 |
|
static void libjackShutdownCallback(jack_status_t code, const char* reason, void *arg); |
218 |
|
#else |
219 |
|
static void libjackShutdownCallback(void *arg); |
220 |
|
#endif |
221 |
static int libjackSampleRateCallback(jack_nframes_t nframes, void *arg); |
static int libjackSampleRateCallback(jack_nframes_t nframes, void *arg); |
222 |
static int libjackBufferSizeCallback(jack_nframes_t nframes, void *arg); |
static int libjackBufferSizeCallback(jack_nframes_t nframes, void *arg); |
223 |
}; |
}; |
232 |
*/ |
*/ |
233 |
class JackListener { |
class JackListener { |
234 |
public: |
public: |
235 |
virtual void onJackShutdown() = 0; |
virtual void onJackShutdown(jack_status_t code, const char* reason) = 0; |
236 |
}; |
}; |
237 |
} |
} |
238 |
|
|