added config.h.in so users don't have to rerun autoconf
[jackctlmmc.git] / common.h
blobe8402c58f5f9b4c6b6f1fc8b89987b024e58f33d
1 /*
2 * Control JACK transport using MMC (MIDI)
4 * Copyright (c) 2006,2007,2008 Nedko Arnaudov <nedko@arnaudov.name>
5 * Copyright (c) 2008 Alex Montgomery <apmontgomery@gmail.com>
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free Software
9 * Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef COMMON_H
21 #define COMMON_H
23 #include <jack/jack.h>
24 #include <alsa/asoundlib.h>
25 #include "config.h"
27 typedef struct
29 uint32_t frameRate;
30 uint32_t jitterTolerance;
31 int verbose;
32 uint8_t deviceID;
33 } MidiSettings;
35 // globals
36 extern int g_quit;
37 extern snd_seq_t* g_seq_ptr;
38 extern jack_client_t* g_jack_client;
39 extern int g_isListening;
41 // functions implemented differently by cli and qt frontends
42 extern void printMMCMessage(const char* message, ...);
44 // common functions
45 int init_alsa_sequencer(const char* appName);
46 int init_jack(const char* appName);
47 int activate_jack();
48 void listen_loop (MidiSettings* settings);
49 void cleanup_globals();
50 void handle_midi(uint8_t* midiBuff, MidiSettings* settings);
52 #if LASH_SUPPORT
53 #include <lash/lash.h>
54 extern lash_client_t* g_lashc;
55 void init_lash(int argc, char* argv[]);
56 void process_lash_event(lash_event_t * event_ptr);
57 void process_lash_config(lash_config_t * config_ptr);
58 #endif // LASH_SUPPORT
60 #if JACK_MIDI_SUPPORT
61 #include <jack/midiport.h>
62 int init_jack_midi(MidiSettings* settings); //< returns true when successful
63 #endif // JACK_MIDI_SUPPORT
65 #endif // COMMON_H