ft2-clone

Fasttracker 2 clone
Log | Files | Refs | README | LICENSE

ft2_structs.h (3112B)


      1 #pragma once
      2 
      3 #include <stdint.h>
      4 #include <stdbool.h>
      5 #include "ft2_header.h"
      6 
      7 typedef struct cpu_t
      8 {
      9 	bool hasSSE, hasSSE2;
     10 } cpu_t;
     11 
     12 typedef struct editor_t
     13 {
     14 	UNICHAR *binaryPathU, *tmpFilenameU, *tmpInstrFilenameU; // used by saving/loading threads
     15 	UNICHAR *configFileLocationU, *audioDevConfigFileLocationU;
     16 #ifdef HAS_MIDI
     17 	UNICHAR *midiConfigFileLocationU;
     18 #endif
     19 
     20 	volatile bool mainLoopOngoing;
     21 	volatile bool busy, scopeThreadBusy, programRunning, wavIsRendering, wavReachedEndFlag;
     22 	volatile bool updateCurSmp, updateCurInstr, diskOpReadDir, diskOpReadDone, updateWindowTitle;
     23 	volatile uint8_t loadMusicEvent;
     24 	volatile FILE *wavRendererFileHandle;
     25 
     26 	bool autoPlayOnDrop, trimThreadWasDone, throwExit, editTextFlag;
     27 	bool copyMaskEnable, diskOpReadOnOpen, samplingAudioFlag, editSampleFlag;
     28 	bool instrBankSwapped, channelMuted[MAX_CHANNELS], NI_Play;
     29 
     30 	uint8_t curPlayInstr, curPlaySmp, curSmpChannel, currPanEnvPoint, currVolEnvPoint;
     31 	uint8_t copyMask[5], pasteMask[5], transpMask[5], smpEd_NoteNr, instrBankOffset, sampleBankOffset;
     32 	uint8_t srcInstr, curInstr, srcSmp, curSmp, currHelpScreen, currConfigScreen, textCursorBlinkCounter;
     33 	uint8_t keyOnTab[MAX_CHANNELS], editRowSkip, curOctave;
     34 	uint8_t sampleSaveMode, moduleSaveMode, ptnJumpPos[4];
     35 	int16_t globalVolume, songPos, row;
     36 	uint16_t tmpPattern, editPattern, BPM, speed, tick, ptnCursorY;
     37 	int32_t keyOffNr, keyOffTime[MAX_CHANNELS];
     38 	uint32_t framesPassed, wavRendererTime;
     39 	double dPerfFreq, dPerfFreqMulMicro, dPerfFreqMulMs;
     40 } editor_t;
     41 
     42 typedef struct ui_t
     43 {
     44 	volatile bool setMouseBusy, setMouseIdle;
     45 	bool sysReqEnterPressed;
     46 
     47 	// all screens
     48 	bool extendedPatternEditor, sysReqShown;
     49 
     50 	// top screens
     51 	bool instrSwitcherShown, aboutScreenShown, helpScreenShown, configScreenShown;
     52 	bool scopesShown, diskOpShown, nibblesShown, transposeShown, instEditorExtShown;
     53 	bool sampleEditorExtShown, advEditShown, wavRendererShown, trimScreenShown;
     54 	bool drawBPMFlag, drawSpeedFlag, drawGlobVolFlag, drawPosEdFlag, drawPattNumLenFlag;
     55 	bool updatePosSections, updatePosEdScrollBar;
     56 	uint8_t oldTopLeftScreen;
     57 
     58 	// bottom screens
     59 	bool patternEditorShown, instEditorShown, sampleEditorShown, sampleEditorEffectsShown, pattChanScrollShown;
     60 	bool leftLoopPinMoving, rightLoopPinMoving;
     61 	bool drawReplayerPianoFlag, drawPianoFlag, updatePatternEditor;
     62 	uint8_t channelOffset, numChannelsShown, maxVisibleChannels;
     63 	uint16_t patternChannelWidth;
     64 	int32_t sampleDataOrLoopDrag;
     65 
     66 	// backup flag for when entering/exiting extended pattern editor (TODO: this is lame and shouldn't be hardcoded)
     67 	bool _aboutScreenShown, _helpScreenShown, _configScreenShown, _diskOpShown;
     68 	bool _nibblesShown, _transposeShown, _instEditorShown;
     69 	bool _instEditorExtShown, _sampleEditorExtShown, _sampleEditorEffectsShown, _patternEditorShown;
     70 	bool _sampleEditorShown, _advEditShown, _wavRendererShown, _trimScreenShown;
     71 	// -------------------------------------------------------------------------
     72 } ui_t;
     73 
     74 typedef struct cursor_t
     75 {
     76 	uint8_t ch;
     77 	int8_t object;
     78 } cursor_t;
     79 
     80 extern cpu_t cpu;
     81 extern editor_t editor;
     82 extern ui_t ui;
     83 extern cursor_t cursor;