gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
CrossoverAudio.H
Go to the documentation of this file.
1 #ifndef CROSSOVERAUDIO_H_
2 #define CROSSOVERAUDIO_H_
3 
4 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
5  This file is part of GTK+ IOStream class set
6 
7  GTK+ IOStream 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  GTK+ IOStream 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 have received a copy of the GNU General Public License
18  along with GTK+ IOStream
19  */
20 
21 /*
22 Author: Matt Flax <flatmax@flatmax.org>
23 Date: 2014.11.09
24 */
25 
26 #include "JackClient.H"
27 #include "Thread.H"
28 #include <Eigen/Dense>
29 //using namespace Eigen;
30 
35 class CrossoverAudio : public JackClient {
36 
37  virtual int processAudio(jack_nframes_t nframes);
38 
46  virtual int startClient(int inCnt, int outCnt, bool doConnect);
47 protected:
48  // variables setup globally
49  float gain;
51  unsigned int zeroSampleCnt;
52 
53  // variables used in each test
57 public:
58  Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> audio;
59 
60  CrossoverAudio();
61  virtual ~CrossoverAudio();
62 
66  void setGain(float g) {
67  gain=g;
68  }
69 
73  float getGain(void) {
74  return gain;
75  }
76 
81  int setDuration(float d);
82 
86  float getDuration(void) {
87  return (float)audio.rows()*(float)getSampleRate();
88  }
89 
96  int setChannels(int outCnt, int inCnt, int testInCnt);
97 
102  void getChannels(int &inCnt, int &outCnt);
103 
107  int recordNextChannelSet();
108 
111  void nextCrossover();
112 
116  virtual int reset();
117 
122 
126  int isRecording();
127 };
128 
129 #endif // CROSSOVERAUDIO_H_
virtual int reset()
virtual ~CrossoverAudio()
Destructor.
int currentInputChannel
The current input channel to test.
int setDuration(float d)
unsigned int zeroSampleCnt
The number of samples to train with zeros.
Definition: Thread.H:271
virtual int startClient()
Definition: JackClient.H:159
float gain
The gain for the output.
Mutex recordLock
The lock for when the audio is being played/recorded.
float getGain(void)
int samplesProcessed
The number of samples already processed.
void getChannels(int &inCnt, int &outCnt)
virtual int getNumberOfRecordedChannels()
CrossoverAudio()
Constructor : starts connecting to Jack audio.
int setChannels(int outCnt, int inCnt, int testInCnt)
int getSampleRate(void) const
Definition: JackBase.H:266
int samplesToProcess
The number of samples to process, matching the duration.
virtual int processAudio(jack_nframes_t nframes)
The Jack client callback.
void setGain(float g)
int recordNextChannelSet()
float getDuration(void)
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic > audio
The first channel is the same data sent over each output channel, then the output channels...
gtkIOStream: /tmp/gtkiostream/include/DSP/CrossoverAudio.H Source File
GTK+ IOStream  Beta