VocalEasel/Sources/VLSoundOut.h

69 lines
1.6 KiB
C
Raw Normal View History

2007-04-27 06:41:34 +00:00
//
// File: VLSoundOut.h - Sound output and file conversion
//
// Author(s):
//
// (MN) Matthias Neeracher
//
2011-09-04 19:48:57 +00:00
// Copyright <20> 2005-2011 Matthias Neeracher
2007-04-27 06:41:34 +00:00
//
2006-09-11 02:49:56 +00:00
#include "VLModel.h"
2006-11-13 04:26:09 +00:00
#import <CoreFoundation/CoreFoundation.h>
2008-05-29 18:54:30 +00:00
#include <AudioToolbox/AudioToolbox.h>
2006-09-11 02:49:56 +00:00
2011-09-04 19:48:57 +00:00
extern CFStringRef kVLSoundStartedNotification;
extern CFStringRef kVLSoundStoppedNotification;
class VLSoundEvent {
protected:
VLSoundEvent() {}
public:
virtual ~VLSoundEvent();
virtual void Perform() {}
};
class VLSoundScheduler {
public:
virtual void Schedule(VLSoundEvent * what, float when);
virtual ~VLSoundScheduler() {}
};
2006-09-11 02:49:56 +00:00
class VLSoundOut {
public:
static VLSoundOut * Instance();
2006-11-27 07:01:38 +00:00
static VLSoundOut * FileWriter(CFURLRef file, OSType dataFormat);
static void SetScheduler(VLSoundScheduler * scheduler);
2006-09-11 02:49:56 +00:00
virtual void PlayNote(const VLNote & note) = 0;
virtual void PlayChord(const VLChord & chord) = 0;
2008-05-29 18:54:30 +00:00
void PlayFile(CFDataRef file);
virtual void PlaySequence(MusicSequence music) = 0;
2011-09-11 21:27:53 +00:00
virtual void SetStart(MusicTimeStamp start) = 0;
virtual void SetEnd(MusicTimeStamp end) = 0;
2008-07-05 13:56:51 +00:00
virtual void Stop(bool pause=true) = 0;
virtual bool Playing() = 0;
2008-07-06 11:07:57 +00:00
virtual bool AtEnd() = 0;
2011-09-11 21:27:53 +00:00
virtual bool AtBeginning() = 0;
2011-09-11 21:43:13 +00:00
virtual void ResetSelection() = 0;
2008-05-29 18:54:30 +00:00
virtual void SetPlayRate(float rate) = 0;
2011-08-29 00:41:04 +00:00
virtual void Fwd() = 0;
virtual void Bck() = 0;
2011-09-11 17:20:34 +00:00
virtual void Slow(float rate) = 0;
2011-09-04 23:38:01 +00:00
enum MelodyState {
kMelodyMute,
kMelodyRegular,
kMelodySolo
};
virtual void SetMelodyState(MelodyState state) = 0;
2006-09-11 02:49:56 +00:00
virtual ~VLSoundOut();
};
// Local Variables:
// mode:C++
// End: