aboutsummaryrefslogtreecommitdiff
path: root/src/midi_sequencer.hpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-07-11 02:37:22 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-07-11 02:37:22 +0300
commit64cf77dd2e516af0f1b47285a39f5031e3cee86f (patch)
tree274764b01c97863e3fdab8133f762163842fff9f /src/midi_sequencer.hpp
parent988a55880c0634020b01c8c7942b2aa29b732196 (diff)
downloadlibADLMIDI-64cf77dd2e516af0f1b47285a39f5031e3cee86f.tar.gz
libADLMIDI-64cf77dd2e516af0f1b47285a39f5031e3cee86f.tar.bz2
libADLMIDI-64cf77dd2e516af0f1b47285a39f5031e3cee86f.zip
MIDI Sequencer: Split the loadMIDI function
Diffstat (limited to 'src/midi_sequencer.hpp')
-rw-r--r--src/midi_sequencer.hpp80
1 files changed, 79 insertions, 1 deletions
diff --git a/src/midi_sequencer.hpp b/src/midi_sequencer.hpp
index 2c75da4..b49c536 100644
--- a/src/midi_sequencer.hpp
+++ b/src/midi_sequencer.hpp
@@ -230,10 +230,26 @@ class BW_MidiSequencer
const BW_MidiRtInterface *m_interface;
/**
+ * @brief Prepare internal events storage for track data building
+ * @param trackCount Count of tracks
+ */
+ void buildSmfSetupReset(size_t trackCount);
+
+ /**
* @brief Build MIDI track data from the raw track data storage
* @return true if everything successfully processed, or false on any error
*/
- bool buildTrackData(const std::vector<std::vector<uint8_t> > &trackData);
+ bool buildSmfTrackData(const std::vector<std::vector<uint8_t> > &trackData);
+
+ /**
+ * @brief Build the time line from off loaded events
+ * @param tempos Pre-collected list of tempo events
+ * @param loopStartTicks Global loop start tick (give zero if no global loop presented)
+ * @param loopEndTicks Global loop end tick (give zero if no global loop presented)
+ */
+ void buildTimeLine(const std::vector<MidiEvent> &tempos,
+ uint64_t loopStartTicks = 0,
+ uint64_t loopEndTicks = 0);
/**
* @brief Parse one event from raw MIDI track stream
@@ -648,6 +664,68 @@ public:
* @param tempo Tempo multiplier: 1.0 - original tempo. >1 - faster, <1 - slower
*/
void setTempo(double tempo);
+
+private:
+ /**
+ * @brief Load file as Id-software-Music-File (Wolfenstein)
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseIMF(FileAndMemReader &fr);
+
+ /**
+ * @brief Load file as EA MUS
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseRSXX(FileAndMemReader &fr);
+
+ /**
+ * @brief Load file as Creative Music Format
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseCMF(FileAndMemReader &fr);
+
+ /**
+ * @brief Load file as GMF (ScummVM)
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseGMF(FileAndMemReader &fr);
+
+ /**
+ * @brief Load file as Standard MIDI file
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseSMF(FileAndMemReader &fr);
+
+ /**
+ * @brief Load file as RIFF MIDI
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseRMI(FileAndMemReader &fr);
+
+#ifndef BWMIDI_DISABLE_MUS_SUPPORT
+ /**
+ * @brief Load file as DMX MUS file (Doom)
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseMUS(FileAndMemReader &fr);
+#endif
+
+#ifndef BWMIDI_DISABLE_XMI_SUPPORT
+ /**
+ * @brief Load file as AIL eXtended MIdi
+ * @param fr Context with opened file
+ * @return true on successful load
+ */
+ bool parseXMI(FileAndMemReader &fr);
+#endif
+
};
#endif /* BISQUIT_AND_WOHLSTANDS_MIDI_SEQUENCER_HHHHPPP */