xref: /haiku/headers/os/midi/MidiSynthFile.h (revision c34e5f4dd555c3f27d12ca84095239ec8392470d)
14b867062Sbeveloper 
24b867062Sbeveloper #ifndef _MIDI_SYNTH_FILE_H
34b867062Sbeveloper #define _MIDI_SYNTH_FILE_H
44b867062Sbeveloper 
54b867062Sbeveloper #include <BeBuild.h>
64b867062Sbeveloper #include <MidiSynth.h>
74b867062Sbeveloper #include <Entry.h>
84b867062Sbeveloper 
94b867062Sbeveloper typedef void (*synth_file_hook)(int32 arg);
104b867062Sbeveloper 
11b178e190Smahlzeit class BMidiStore;
12b178e190Smahlzeit 
13*c34e5f4dSStefano Ceccherini class BMidiSynthFile : public BMidiSynth {
144b867062Sbeveloper public:
1538c7401eSmahlzeit 
164b867062Sbeveloper 	BMidiSynthFile();
174b867062Sbeveloper 	~BMidiSynthFile();
184b867062Sbeveloper 
194b867062Sbeveloper 	status_t LoadFile(const entry_ref* midi_entry_ref);
204b867062Sbeveloper 	void UnloadFile(void);
214b867062Sbeveloper 
224b867062Sbeveloper 	virtual status_t Start(void);
234b867062Sbeveloper 	virtual void Stop(void);
244b867062Sbeveloper 
254b867062Sbeveloper 	void Fade(void);
264b867062Sbeveloper 	void Pause(void);
274b867062Sbeveloper 	void Resume(void);
284b867062Sbeveloper 
294b867062Sbeveloper 	int32 Duration(void) const;
304b867062Sbeveloper 	int32 Position(int32 ticks) const;
314b867062Sbeveloper 	int32 Seek();
324b867062Sbeveloper 
334b867062Sbeveloper 	status_t GetPatches(int16* pArray768, int16* pReturnedCount) const;
344b867062Sbeveloper 
354b867062Sbeveloper 	void SetFileHook(synth_file_hook pSongHook, int32 arg);
36173d0cd7Smahlzeit 
374b867062Sbeveloper 	bool IsFinished(void) const;
384b867062Sbeveloper 
394b867062Sbeveloper 	void ScaleTempoBy(double tempoFactor);
404b867062Sbeveloper 	void SetTempo(int32 newTempoBPM);
414b867062Sbeveloper 	int32 Tempo(void) const;
424b867062Sbeveloper 
434b867062Sbeveloper 	void EnableLooping(bool loop);
444b867062Sbeveloper 
454b867062Sbeveloper 	void MuteTrack(int16 track, bool do_mute);
464b867062Sbeveloper 	void GetMuteMap(char* pTracks) const;
474b867062Sbeveloper 
484b867062Sbeveloper 	void SoloTrack(int16 track, bool do_solo);
494b867062Sbeveloper 	void GetSoloMap(char* pTracks) const;
504b867062Sbeveloper 
514b867062Sbeveloper private:
524b867062Sbeveloper 
5338c7401eSmahlzeit 	friend class BSynth;
5438c7401eSmahlzeit 
554b867062Sbeveloper 	virtual void _ReservedMidiSynthFile1();
564b867062Sbeveloper 	virtual void _ReservedMidiSynthFile2();
574b867062Sbeveloper 	virtual void _ReservedMidiSynthFile3();
584b867062Sbeveloper 
594810cdcdSJérôme Duval 	BMidiStore* fStore;
60b178e190Smahlzeit 
61b178e190Smahlzeit 	int32 _reserved[3];
624b867062Sbeveloper };
634b867062Sbeveloper 
64173d0cd7Smahlzeit #endif // _MIDI_SYNTH_FILE
65