| 1 |
/** |
| 2 |
* Furnace Tracker - multi-system chiptune tracker |
| 3 |
* Copyright (C) 2021-2025 tildearrow and contributors |
| 4 |
* |
| 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. |
| 9 |
* |
| 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. |
| 14 |
* |
| 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef _FUR_CLI_H |
| 21 |
#define _FUR_CLI_H |
| 22 |
|
| 23 |
|
| 24 |
#include "../engine/engine.h" |
| 25 |
|
| 26 |
#include <stdio.h> |
| 27 |
#ifdef _WIN32 |
| 28 |
#include <windows.h> |
| 29 |
#else |
| 30 |
#include <signal.h> |
| 31 |
#include <unistd.h> |
| 32 |
#include <termios.h> |
| 33 |
#include <sys/ioctl.h> |
| 34 |
#endif |
| 35 |
|
| 36 |
class FurnaceCLI { |
| 37 |
DivEngine* e; |
| 38 |
bool disableStatus; |
| 39 |
bool disableControls; |
| 40 |
|
| 41 |
#ifdef _WIN32 |
| 42 |
HANDLE winin; |
| 43 |
HANDLE winout; |
| 44 |
#else |
| 45 |
struct sigaction intsa; |
| 46 |
struct termios termprop; |
| 47 |
struct termios termpropold; |
| 48 |
#endif |
| 49 |
|
| 50 |
public: |
| 51 |
void noStatus(); |
| 52 |
void noControls(); |
| 53 |
void bindEngine(DivEngine* eng); |
| 54 |
bool loop(); |
| 55 |
bool finish(); |
| 56 |
bool init(); |
| 57 |
FurnaceCLI(); |
| 58 |
}; |
| 59 |
|
| 60 |
#endif |