added: bitvis (WIP)
This commit is contained in:
parent
8eb8117da3
commit
4d4f7c585c
22 changed files with 2060 additions and 4 deletions
79
src/jackclient.h
Normal file
79
src/jackclient.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* bobdsp
|
||||
* Copyright (C) Bob 2012
|
||||
*
|
||||
* bobdsp is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* bobdsp is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef JACKCLIENT_H
|
||||
#define JACKCLIENT_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <jack/jack.h>
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "fft.h"
|
||||
#include "clientmessage.h"
|
||||
#include "util/condition.h"
|
||||
|
||||
class CJackClient
|
||||
{
|
||||
public:
|
||||
CJackClient();
|
||||
~CJackClient();
|
||||
|
||||
bool Connect();
|
||||
void Disconnect();
|
||||
bool IsConnected() { return m_connected; }
|
||||
int MsgPipe() { return m_pipe[0]; }
|
||||
ClientMessage GetMessage();
|
||||
|
||||
jack_status_t ExitStatus() { return m_exitstatus; }
|
||||
const std::string& ExitReason() { return m_exitreason; }
|
||||
|
||||
int Samplerate() { return m_samplerate; }
|
||||
int GetAudio(float*& buf, int& bufsize, int& samplerate);
|
||||
|
||||
private:
|
||||
bool m_connected;
|
||||
bool m_wasconnected;
|
||||
jack_client_t* m_client;
|
||||
jack_port_t* m_jackport;
|
||||
std::string m_name;
|
||||
int m_samplerate;
|
||||
int m_outsamplerate;
|
||||
jack_status_t m_exitstatus;
|
||||
std::string m_exitreason;
|
||||
int m_portevents;
|
||||
int m_pipe[2];
|
||||
CCondition m_condition;
|
||||
float* m_buf;
|
||||
unsigned int m_bufsize;
|
||||
bool m_bufupdated;
|
||||
SRC_STATE* m_srcstate;
|
||||
int m_outsamples;
|
||||
|
||||
bool ConnectInternal();
|
||||
void CheckMessages();
|
||||
bool WriteMessage(uint8_t message);
|
||||
|
||||
static int SJackProcessCallback(jack_nframes_t nframes, void *arg);
|
||||
void PJackProcessCallback(jack_nframes_t nframes);
|
||||
|
||||
static void SJackInfoShutdownCallback(jack_status_t code, const char *reason, void *arg);
|
||||
void PJackInfoShutdownCallback(jack_status_t code, const char *reason);
|
||||
};
|
||||
|
||||
#endif //JACKCLIENT_H
|
Loading…
Add table
Add a link
Reference in a new issue