Debian Codegraph @

src/engine/platform/bifurcator.h

raw
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 _BIFURCATOR_H
21 #define _BIFURCATOR_H
22
23 #include "../dispatch.h"
24 #include "../waveSynth.h"
25
26 class DivPlatformBifurcator: public DivDispatch {
27 struct Channel: public SharedChannel<int> {
28 int param, curx;
29 int audSub;
30 bool volChangedL, volChangedR;
31 int chPanL, chPanR;
32 int chVolL, chVolR;
33 Channel():
34 SharedChannel<int>(255),
35 param(47360),
36 curx(1),
37 audSub(0),
38 volChangedL(false),
39 volChangedR(false),
40 chPanL(255),
41 chPanR(255),
42 chVolL(0),
43 chVolR(0) {}
44 };
45 Channel chan[4];
46 DivDispatchOscBuffer* oscBuf[4];
47 bool isMuted[4];
48 unsigned char regPool[8*4];
49
50 friend void putDispatchChip(void*,int);
51 friend void putDispatchChan(void*,int,int);
52
53 public:
54 void acquire(short** buf, size_t len);
55 int dispatch(DivCommand c);
56 void* getChanState(int chan);
57 DivDispatchOscBuffer* getOscBuffer(int chan);
58 unsigned char* getRegisterPool();
59 int getRegisterPoolSize();
60 void reset();
61 void forceIns();
62 void tick(bool sysTick=true);
63 void muteChannel(int ch, bool mute);
64 int getOutputCount();
65 DivMacroInt* getChanMacroInt(int ch);
66 unsigned short getPan(int chan);
67 void setFlags(const DivConfig& flags);
68 void notifyInsChange(int ins);
69 void notifyInsDeletion(void* ins);
70 void poke(unsigned int addr, unsigned short val);
71 void poke(std::vector<DivRegWrite>& wlist);
72 const char** getRegisterSheet();
73 int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
74 void quit();
75 };
76
77 #endif