xref: /haiku/headers/os/midi/MidiSynthFile.h (revision 1d9d47fc72028bb71b5f232a877231e59cfe2438)
1 
2 #ifndef _MIDI_SYNTH_FILE_H
3 #define _MIDI_SYNTH_FILE_H
4 
5 #include <BeBuild.h>
6 #include <MidiSynth.h>
7 #include <Entry.h>
8 
9 typedef void (*synth_file_hook)(int32 arg);
10 
11 class BMidiStore;
12 
13 class BMidiSynthFile : public BMidiSynth
14 {
15 public:
16 
17 	BMidiSynthFile();
18 	~BMidiSynthFile();
19 
20 	status_t LoadFile(const entry_ref* midi_entry_ref);
21 	void UnloadFile(void);
22 
23 	virtual status_t Start(void);
24 	virtual void Stop(void);
25 
26 	void Fade(void);
27 	void Pause(void);
28 	void Resume(void);
29 
30 	int32 Duration(void) const;
31 	int32 Position(int32 ticks) const;
32 	int32 Seek();
33 
34 	status_t GetPatches(int16* pArray768, int16* pReturnedCount) const;
35 
36 	void SetFileHook(synth_file_hook pSongHook, int32 arg);
37 
38 	bool IsFinished(void) const;
39 
40 	void ScaleTempoBy(double tempoFactor);
41 	void SetTempo(int32 newTempoBPM);
42 	int32 Tempo(void) const;
43 
44 	void EnableLooping(bool loop);
45 
46 	void MuteTrack(int16 track, bool do_mute);
47 	void GetMuteMap(char* pTracks) const;
48 
49 	void SoloTrack(int16 track, bool do_solo);
50 	void GetSoloMap(char* pTracks) const;
51 
52 private:
53 
54 	friend class BSynth;
55 
56 	virtual void _ReservedMidiSynthFile1();
57 	virtual void _ReservedMidiSynthFile2();
58 	virtual void _ReservedMidiSynthFile3();
59 
60 	BMidiStore* fStore;
61 
62 	int32 _reserved[3];
63 };
64 
65 #endif // _MIDI_SYNTH_FILE
66