2 terminatorX - realtime audio scratching software
3 Copyright (C) 1999-2020 Alexander König
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Description: Header to tX_engine.cc
27 #include "tX_audiodevice.h"
28 #include "tX_midiin.h"
29 #include <sys/types.h>
36 #define ENG_FINISHED 3
37 #define ENG_ERR_XOPEN 4
38 #define ENG_ERR_XINPUT 5
40 #define ENG_ERR_SOUND 7
41 #define ENG_ERR_THREAD 8
42 /* #define ENG_ERR_GRABMOUSE 9
43 #define ENG_ERR_GRABKEY 10 */
44 #define ENG_ERR_BUSY 11
47 enum tX_engine_error {
55 enum tX_engine_status {
62 static tX_engine *engine;
65 pthread_mutex_t start;
66 bool thread_terminate;
67 tX_audiodevice *device;
70 bool recording_request;
79 #ifdef USE_ALSA_MIDI_IN
80 private: tX_midiin *midi;
81 public: tX_midiin *get_midi() { return midi; }
85 pthread_t get_thread_id() { return thread; }
86 bool check_error() { return runtime_error || overload_error; }
87 bool get_runtime_error() { return runtime_error; }
88 bool get_overload_error() { return overload_error; }
89 void reset_cycles_ctr() { /*tX_msg("cycles reset at %i.", cycles_ctr);*/ cycles_ctr=0; } // locking?
90 static tX_engine *get_instance();
94 tX_engine_error run();
98 void set_recording_request(bool recording);
99 bool get_recording_request() { return recording_request; }
100 bool is_recording() { return recording; }
101 int16_t* render_cycle();
103 /* void set_grab_request(); */
104 bool is_stopped() { return stop_flag; }