mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Play individual parts / implement count in for 4/4 and 3/4
This commit is contained in:
parent
6908273ff2
commit
b7b1f96f93
1945
English.lproj/MainMenu.nib/designable.nib
generated
1945
English.lproj/MainMenu.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
3541
English.lproj/VLDocument.nib/designable.nib
generated
3541
English.lproj/VLDocument.nib/designable.nib
generated
File diff suppressed because it is too large
Load Diff
BIN
English.lproj/VLDocument.nib/keyedobjects.nib
generated
BIN
English.lproj/VLDocument.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -17,6 +17,13 @@
|
|||
@class VLLogWindow;
|
||||
@class PDFDocument;
|
||||
|
||||
enum {
|
||||
kVLPlayAccompaniment = 1,
|
||||
kVLPlayMelody = 2,
|
||||
kVLPlayMetronome = 4,
|
||||
kVLPlayCountIn = 8
|
||||
};
|
||||
|
||||
@interface VLDocument : NSDocument
|
||||
{
|
||||
VLSong * song;
|
||||
|
@ -27,6 +34,7 @@
|
|||
NSString * songArranger;
|
||||
NSString * songGroove;
|
||||
NSNumber * songTempo;
|
||||
int playElements;
|
||||
NSString * tmpPath;
|
||||
NSFileWrapper * vcsWrapper;
|
||||
NSMutableArray* observers;
|
||||
|
@ -56,6 +64,9 @@
|
|||
- (IBAction) showLog:(id)sender;
|
||||
- (IBAction) play:(id)sender;
|
||||
- (IBAction) stop:(id)sender;
|
||||
- (IBAction) playStop:(id)sender;
|
||||
- (IBAction) togglePlayElements:(id)sender;
|
||||
- (IBAction) playStop:(id)sender;
|
||||
|
||||
- (NSString *) tmpPath;
|
||||
- (NSString *) workPath;
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
songArranger = @"";
|
||||
songGroove = @"Swing";
|
||||
songTempo = [[NSNumber numberWithInt:120] retain];
|
||||
playElements = kVLPlayAccompaniment|kVLPlayMelody|kVLPlayCountIn;
|
||||
sheetWin = nil;
|
||||
pdfWin = nil;
|
||||
logWin = nil;
|
||||
|
@ -249,6 +250,21 @@
|
|||
return repeatVolta;
|
||||
}
|
||||
|
||||
- (IBAction) togglePlayElements:(id)sender
|
||||
{
|
||||
playElements ^= [sender tag];
|
||||
[validTmpFiles removeObjectForKey:@"mma"];
|
||||
[validTmpFiles removeObjectForKey:@"mid"];
|
||||
}
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem
|
||||
{
|
||||
if (int tag = [menuItem tag])
|
||||
[menuItem setState:(playElements & tag) != 0];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (bool) brandNew
|
||||
{
|
||||
return brandNew && ![self isDocumentEdited];
|
||||
|
@ -435,6 +451,17 @@
|
|||
VLSoundOut::Instance()->Stop();
|
||||
}
|
||||
|
||||
- (IBAction) playStop:(id)sender
|
||||
{
|
||||
if (VLSoundOut::Instance()->Playing()) {
|
||||
[self stop:sender];
|
||||
[sender setTitle:@"Play"];
|
||||
} else {
|
||||
[self play:sender];
|
||||
[sender setTitle:@"Stop"];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction) showOutput:(id)sender
|
||||
{
|
||||
[self createTmpFileWithExtension:@"pdf" ofType:@"VLPDFType"];
|
||||
|
|
|
@ -29,10 +29,27 @@
|
|||
+ "Solo Volume fff\n";
|
||||
sprintf(buf, "Tempo %d\n", [songTempo intValue]);
|
||||
mmaFile += buf;
|
||||
if (playElements & kVLPlayCountIn)
|
||||
switch ([[self songTime] intValue]) {
|
||||
case 0x404:
|
||||
mmaFile += "Groove Metronome2-4\nz\nz\n";
|
||||
break;
|
||||
case 0x304:
|
||||
case 0x608:
|
||||
mmaFile += "Groove Metronome3\nz\nz\n";
|
||||
break;
|
||||
default:
|
||||
// Can't handle these yet
|
||||
break;
|
||||
}
|
||||
sprintf(buf, "Groove %s\n", [songGroove UTF8String]);
|
||||
mmaFile += buf;
|
||||
sprintf(buf, "KeySig %d%c\n", labs(prop.fKey), prop.fKey>=0 ? '#' : '&');
|
||||
mmaFile += buf;
|
||||
if (!(playElements & kVLPlayAccompaniment))
|
||||
mmaFile += "AllTracks Off\nSolo On\n";
|
||||
if (!(playElements & kVLPlayMelody))
|
||||
mmaFile += "Solo Off\n";
|
||||
mmaFile += '\n'+writer.Measures();
|
||||
|
||||
return [[NSString stringWithUTF8String:mmaFile.c_str()]
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
virtual void PlayChord(const VLChord & chord);
|
||||
virtual void PlayFile(CFDataRef file);
|
||||
virtual void Stop();
|
||||
virtual bool Playing();
|
||||
|
||||
virtual ~VLAUSoundOut();
|
||||
protected:
|
||||
|
@ -200,6 +201,11 @@ void VLAUSoundOut::Stop()
|
|||
}
|
||||
}
|
||||
|
||||
bool VLAUSoundOut::Playing()
|
||||
{
|
||||
return fRunning;
|
||||
}
|
||||
|
||||
void VLAUSoundOut::PlayNote(const VLNote & note)
|
||||
{
|
||||
Play(¬e.fPitch);
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
virtual void PlayChord(const VLChord & chord) = 0;
|
||||
virtual void PlayFile(CFDataRef file) = 0;
|
||||
virtual void Stop() = 0;
|
||||
virtual bool Playing() = 0;
|
||||
|
||||
virtual ~VLSoundOut();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user