Files
haiku-beta6/headers/os/midi/MidiSynthFile.h
T

78 lines
1.8 KiB
C++
Raw Normal View History

2002-10-26 18:51:58 +00:00
#ifndef _MIDI_SYNTH_FILE_H
#define _MIDI_SYNTH_FILE_H
#include <BeBuild.h>
#include <MidiSynth.h>
#include <Entry.h>
typedef void (*synth_file_hook)(int32 arg);
class BMidiSynthFile : public BMidiSynth
{
public:
2002-11-01 16:11:03 +00:00
BMidiSynthFile();
~BMidiSynthFile();
status_t LoadFile(const entry_ref* midi_entry_ref);
void UnloadFile(void);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual status_t Start(void);
virtual void Stop(void);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
void Fade(void);
void Pause(void);
void Resume(void);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* get ticks in microseconds of length of song */
int32 Duration(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* set the current playback position of song in microseconds */
int32 Position(int32 ticks) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* get the current playback position of a song in microseconds */
int32 Seek();
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* get the patches required to play this song */
status_t GetPatches(int16* pArray768, int16* pReturnedCount) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* Set a call back when song is done */
void SetFileHook(synth_file_hook pSongHook, int32 arg);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* poll to see if song is done */
bool IsFinished(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* set song master tempo. (1.0 uses songs encoded tempo, 2.0 will play */
/* song twice as fast, and 0.5 will play song half as fast */
void ScaleTempoBy(double tempoFactor);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* sets tempo in beats per minute */
void SetTempo(int32 newTempoBPM);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* returns tempo in beats per minute */
int32 Tempo(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* pass true to loop song, false to not loop */
void EnableLooping(bool loop);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* Mute and unmute tracks (0 to 64) */
void MuteTrack(int16 track, bool do_mute);
void GetMuteMap(char* pTracks) const;
void SoloTrack(int16 track, bool do_solo);
void GetSoloMap(char* pTracks) const;
2002-10-26 18:51:58 +00:00
private:
2002-11-01 16:11:03 +00:00
virtual void _ReservedMidiSynthFile1();
virtual void _ReservedMidiSynthFile2();
virtual void _ReservedMidiSynthFile3();
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
friend class BSynth;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
uint32 _reserved[4];
2002-10-26 18:51:58 +00:00
};
2002-11-01 16:11:03 +00:00
#endif // _MIDI_SYNTH_FILE