From 810ff2ee2fa61fe7060c15ceea7948306d9f7fc1 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Mon, 2 Oct 2006 06:07:44 +0000 Subject: [PATCH] Rename instance variables of VLSheetView --- English.lproj/VLDocument.nib/classes.nib | 2 +- English.lproj/VLDocument.nib/keyedobjects.nib | Bin 14493 -> 14526 bytes Sources/VLSheetView.h | 48 ++- Sources/VLSheetView.mm | 102 +++---- Sources/VLSheetViewChords.mm | 4 +- Sources/VLSheetViewNotes.mm | 64 ++-- Vocalese.xcodeproj/neeri.mode1v3 | 277 +++++++++--------- Vocalese.xcodeproj/neeri.pbxuser | 53 +--- 8 files changed, 253 insertions(+), 297 deletions(-) diff --git a/English.lproj/VLDocument.nib/classes.nib b/English.lproj/VLDocument.nib/classes.nib index 0f561ee..b7d3ec6 100644 --- a/English.lproj/VLDocument.nib/classes.nib +++ b/English.lproj/VLDocument.nib/classes.nib @@ -7,7 +7,7 @@ ACTIONS = {hideFieldEditor = id; setDivisions = id; setKey = id; setTime = id; }; CLASS = VLSheetView; LANGUAGE = ObjC; - OUTLETS = {chords = id; fieldEditor = id; }; + OUTLETS = {fChords = id; fFieldBeingEdited = id; fFieldEditor = id; }; SUPERCLASS = NSView; } ); diff --git a/English.lproj/VLDocument.nib/keyedobjects.nib b/English.lproj/VLDocument.nib/keyedobjects.nib index ce23cee7f1ce153dbd63b5fc764c3c7de09f0da9..346099aeeed20ddd79c231de45eebec58927495c 100644 GIT binary patch delta 4992 zcmZWq2bk1U*G^_~GntZ^WJ)Hrib&w0;zZ^Y&ivlt_T zduMam=(yD#jE3X@?0KvR8;A|UhG4_6kytS{78|F}BsLM7guRZ<#NNPWVe_#0*jw0p z*!$Qa>WOcoB$`mDR3H`NuM^b?Txd+Rqzw21V4jo;5zsP+yFPh zui!Uu3*1Kbf#1O$@CUdH?t%N@Pw)Wzg(EnM8*n3z;Q+^R6HXvEaWihgNu0u6YnvGd zqlvL8lueFk=o;{#a1cQ_Si<$hYHvPT~k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9g&VnC!|wS zrF2gEQTkQ7A$OCz%P+}2<=*lua$osXxxYL>9w-;ch4N5&xI980DZeFa@+f(XJWie< zPm-s|Q{^IghCEZAEx#krmEV^?ls}T^r{o3lB6+dAL|!U?F0YVR$!p|w@&&i$arHoR>Dif5+%2Z{#GEH_ssb&0xE{ajt4u2R>i>(mYEMs<_AMJ-jgt2@K=8UdO$5# z535JiW9kX@lv=5Nt$w3^tA4MZS1+hPsz0e$)T`<*>UH&o`n!5ty`%oA-cR5OV{zsa z!Biv>OGt^DiHyYh#Ky$tL}_A2Vpn2s;y|K2QIR;7IGLzSoJo9}IG4DPxRkh(xR$t{ zxS6<}xSP0-3WsReZm0+9iE>k@FY1Q|ph2h*4MQW)Nc0xc&?qzpjYAXABs2w0MMY=^nu%tkchFq) zKKc-Sgyy3KXc1bBmY}8RbF>1jLTk`Ev;l2Io6r_iingPjXcyXp_Mro)3>`uh=qNgl zPNLJO3Y|e`(Rb(^`T<=;mr%3I=x1~d-9~rN-6TwsNpsSf^d#A&n2aUsB%e$+Ot!|V RKZD_6Pxv18kN(M={{k-=|9$`f diff --git a/Sources/VLSheetView.h b/Sources/VLSheetView.h index f6d4af3..7284012 100644 --- a/Sources/VLSheetView.h +++ b/Sources/VLSheetView.h @@ -34,31 +34,29 @@ enum VLMusicElement { }; @interface VLSheetView : NSView { - BOOL needsRecalc; - BOOL showFieldEditor; - float clefKeyW; - float measureW; - float lineH; - int groups; - int quarterBeats; - int divPerGroup; - int firstMeasure; - int lastMeasure; - int measuresPerSystem; - int numSystems; - float displayScale; - NSImageRep * noteCursorCache; - NSPoint noteCursorLocation; - NSPoint lastNoteCenter; - NSRect noteRect; - NSTrackingRectTag noteRectTracker; - int noteCursorMeasure; - VLFract noteCursorAt; - int noteCursorPitch; - id fieldBeingEdited; + BOOL fNeedsRecalc; + float fClefKeyW; + float fMeasureW; + float fLineH; + int fGroups; + int fQuarterBeats; + int fDivPerGroup; + int fMeasPerSystem; + int fNumSystems; + float fDisplayScale; + NSImageRep * fNoteCursorCache; + NSPoint fNoteCursorLocation; + NSPoint fLastNoteCenter; + NSRect fNoteRect; + NSTrackingRectTag fNoteRectTracker; + int fNoteCursorMeasure; + VLFract fNoteCursorAt; + int fNoteCursorPitch; + id fFieldBeingEdited; - IBOutlet id chords; - IBOutlet id fieldEditor; + BOOL fShowFieldEditor; + IBOutlet id fChords; + IBOutlet id fFieldEditor; } - (IBAction) setKey:(id)sender; @@ -67,8 +65,6 @@ enum VLMusicElement { - (IBAction) showFieldEditor:(id)sender withAction:(SEL)selector; - (IBAction) hideFieldEditor:(id)sender; -- (void) setFirstMeasure: (NSNumber *)measure; - - (VLDocument *) document; - (VLSong *) song; - (NSImage *) musicElement:(VLMusicElement)elt; diff --git a/Sources/VLSheetView.mm b/Sources/VLSheetView.mm index 63910b6..e640a56 100644 --- a/Sources/VLSheetView.mm +++ b/Sources/VLSheetView.mm @@ -78,13 +78,12 @@ static float sFlatPos[] = { [sMusic[i] setSize:sz]; } } - needsRecalc = YES; - showFieldEditor = NO; - displayScale = 1.0f; - firstMeasure = 0; - noteRectTracker = 0; - noteCursorCache = nil; - noteCursorMeasure = -1; + fNeedsRecalc = YES; + fShowFieldEditor = NO; + fDisplayScale = 1.0f; + fNoteRectTracker = 0; + fNoteCursorCache = nil; + fNoteCursorMeasure = -1; } return self; } @@ -152,38 +151,37 @@ static float sFlatPos[] = { - (float) noteXInMeasure:(int)measure at:(VLFraction)at { const VLProperties & prop = [self song]->fProperties.front(); - const float mx = clefKeyW+(measure-firstMeasure)*measureW; + const float mx = fClefKeyW+(measure%fMeasPerSystem)*fMeasureW; at /= prop.fTime / (4 * prop.fDivisions); int div = at.fNum / at.fDenom; - return mx + (div + (div / divPerGroup) + 1)*kNoteW; + return mx + (div + (div / fDivPerGroup) + 1)*kNoteW; } - (void) recalculateDimensions { - needsRecalc = NO; + fNeedsRecalc = NO; - NSSize contentSz = [[self enclosingScrollView] contentSize]; - contentSz.width /= displayScale; - contentSz.height/= displayScale; + NSSize sz = [[self enclosingScrollView] contentSize]; + sz.width /= fDisplayScale; + sz.height/= fDisplayScale; const VLSong * song = [self song]; const VLProperties & prop = song->fProperties.front(); - groups = prop.fTime.fNum / std::max(prop.fTime.fDenom / 4, 1); - quarterBeats = (prop.fTime.fNum*4) / prop.fTime.fDenom; - divPerGroup = prop.fDivisions * (quarterBeats / groups); - clefKeyW = kClefX+kClefW+(std::labs(prop.fKey)+1)*kKeyW; - measureW = groups*(divPerGroup+1)*kNoteW; - measuresPerSystem = - (int)std::floor((contentSz.width - clefKeyW) / measureW); - numSystems = (song->CountMeasures()+measuresPerSystem-1)/measuresPerSystem; - contentSz.height = numSystems*kSystemH; + fGroups = prop.fTime.fNum / std::max(prop.fTime.fDenom / 4, 1); + fQuarterBeats = (prop.fTime.fNum*4) / prop.fTime.fDenom; + fDivPerGroup = prop.fDivisions * (fQuarterBeats / fGroups); + fClefKeyW = kClefX+kClefW+(std::labs(prop.fKey)+1)*kKeyW; + fMeasureW = fGroups*(fDivPerGroup+1)*kNoteW; + fMeasPerSystem = (int)std::floor((sz.width-fClefKeyW) / fMeasureW); + fNumSystems = (song->CountMeasures()+fMeasPerSystem-1)/fMeasPerSystem; + sz.height = fNumSystems*kSystemH; #if 0 noteRect = NSMakeRect(clefKeyW, kLineY-kMaxLedgers*kLineH, - visibleMeasures*measureW, + visibleMeasures*fMeasureW, (4.0f+2.0f*kMaxLedgers)*kLineH); NSPoint mouse = [self convertPoint:[[self window] mouseLocationOutsideOfEventStream] @@ -198,10 +196,10 @@ static float sFlatPos[] = { [[self window] makeFirstResponder:self]; - NSSize frameSz = {contentSz.width * displayScale, contentSz.height * displayScale}; + NSSize frameSz = {sz.width * fDisplayScale, sz.height * fDisplayScale}; [self setFrameSize:frameSz]; - [self setBoundsSize:contentSz]; + [self setBoundsSize:sz]; [self setNeedsDisplay:YES]; } @@ -224,13 +222,13 @@ static float sFlatPos[] = { // Draw lines // [bz setLineWidth:0.0]; - if (needsRecalc) + if (fNeedsRecalc) [self recalculateDimensions]; - for (int system = 0; system> 8 denom: time & 0xFF]; - needsRecalc = YES; + fNeedsRecalc = YES; [self setNeedsDisplay: YES]; } @@ -340,32 +338,24 @@ static float sFlatPos[] = { int div = [[sender selectedItem] tag]; [[self document] setDivisions: div]; - needsRecalc = YES; - [self setNeedsDisplay: YES]; -} - -- (void) setFirstMeasure: (NSNumber *)measure -{ - firstMeasure = [measure intValue]; - - [self setupChords]; + fNeedsRecalc = YES; [self setNeedsDisplay: YES]; } - (IBAction)showFieldEditor:(id)sender withAction:(SEL)selector { - fieldBeingEdited = sender; - [fieldEditor setObjectValue:[sender title]]; - [fieldEditor setAction:selector]; + fFieldBeingEdited = sender; + [fFieldEditor setObjectValue:[sender title]]; + [fFieldEditor setAction:selector]; [self setValue: [NSNumber numberWithBool:YES] - forKey: @"showFieldEditor"]; + forKey: @"fShowFieldEditor"]; } - (IBAction)hideFieldEditor:(id)sender { - [fieldEditor setAction:nil]; + [fFieldEditor setAction:nil]; [self setValue: [NSNumber numberWithBool:NO] - forKey: @"showFieldEditor"]; + forKey: @"fShowFieldEditor"]; } @end diff --git a/Sources/VLSheetViewChords.mm b/Sources/VLSheetViewChords.mm index 2fa53e5..b4bf8bb 100644 --- a/Sources/VLSheetViewChords.mm +++ b/Sources/VLSheetViewChords.mm @@ -164,10 +164,10 @@ } else { NSAttributedString * s = [self stringWithChord:chord]; [sender setAttributedStringValue: s]; - [fieldBeingEdited setTitle: s]; + [fFieldBeingEdited setTitle: s]; [sender setTextColor: [NSColor blackColor]]; VLSoundOut::Instance()->PlayChord(chord); - int tag = [fieldBeingEdited tag]; + int tag = [fFieldBeingEdited tag]; song->AddChord(chord, tag >> 8, VLFraction(tag & 0xFF, 4)); } } diff --git a/Sources/VLSheetViewNotes.mm b/Sources/VLSheetViewNotes.mm index 7724ef0..9ef57fc 100644 --- a/Sources/VLSheetViewNotes.mm +++ b/Sources/VLSheetViewNotes.mm @@ -37,16 +37,16 @@ static int sSemiToPitch[] = { NSPoint loc = [event locationInWindow]; loc = [self convertPoint:loc fromView:nil]; - loc.x -= noteRect.origin.x; - int measure = static_cast(loc.x / measureW)+firstMeasure; - loc.x -= (measure-firstMeasure)*measureW; - int group = static_cast(loc.x / ((divPerGroup+1)*kNoteW)); - loc.x -= group*(divPerGroup+1)*kNoteW; + loc.x -= fNoteRect.origin.x; + int measure = static_cast(loc.x / fMeasureW); + loc.x -= measure*fMeasureW; + int group = static_cast(loc.x / ((fDivPerGroup+1)*kNoteW)); + loc.x -= group*(fDivPerGroup+1)*kNoteW; int div = static_cast(roundf(loc.x / kNoteW))-1; - div = std::min(std::max(div, 0), divPerGroup-1); - VLFraction at(div+group*divPerGroup, 4*prop.fDivisions); + div = std::min(std::max(div, 0), fDivPerGroup-1); + VLFraction at(div+group*fDivPerGroup, 4*prop.fDivisions); - loc.y -= noteRect.origin.y; + loc.y -= fNoteRect.origin.y; int semi = static_cast(roundf(loc.y / (0.5f*kLineH))); int pitch = sSemiToPitch[semi]; @@ -55,10 +55,10 @@ static int sSemiToPitch[] = { - (void) addNoteAtCursor:(BOOL)isRest { - if (noteCursorMeasure > -1) { - VLNote newNote(1, !isRest ? noteCursorPitch : VLNote::kNoPitch); + if (fNoteCursorMeasure > -1) { + VLNote newNote(1, !isRest ? fNoteCursorPitch : VLNote::kNoPitch); - [self song]->AddNote(newNote, noteCursorMeasure, noteCursorAt); + [self song]->AddNote(newNote, fNoteCursorMeasure, fNoteCursorAt); [self setNeedsDisplay:YES]; @@ -87,10 +87,10 @@ static int sSemiToPitch[] = { - (void) startKeyboardCursor { - if (noteCursorMeasure < 0) { - noteCursorMeasure = firstMeasure; - noteCursorPitch = VLNote::kMiddleC; - noteCursorAt = VLFraction(0); + if (fNoteCursorMeasure < 0) { + fNoteCursorMeasure = 0; + fNoteCursorPitch = VLNote::kMiddleC; + fNoteCursorAt = VLFraction(0); } } @@ -105,22 +105,22 @@ static int sSemiToPitch[] = { break; case ' ': [self startKeyboardCursor]; - VLSoundOut::Instance()->PlayNote(VLNote(1, noteCursorPitch)); + VLSoundOut::Instance()->PlayNote(VLNote(1, fNoteCursorPitch)); break; } } - (void) hideNoteCursor { - noteCursorMeasure = -1; + fNoteCursorMeasure = -1; [self setNeedsDisplay:YES]; } - (void) drawNoteCursor { NSPoint note = - NSMakePoint([self noteXInMeasure:noteCursorMeasure at:noteCursorAt], - [self noteYWithPitch:noteCursorPitch]); + NSMakePoint([self noteXInMeasure:fNoteCursorMeasure at:fNoteCursorAt], + [self noteYWithPitch:fNoteCursorPitch]); NSRect noteCursorRect = NSMakeRect(note.x-kNoteX, note.y-kNoteY, 2.0f*kNoteX, 2.0f*kNoteY); [[self musicElement:kMusicNoteCursor] @@ -191,22 +191,22 @@ static int sSemiToPitch[] = { // if (tied) { NSPoint mid = - NSMakePoint(0.5f*(lastNoteCenter.x+c.x), - 0.5f*(lastNoteCenter.y+c.y)); + NSMakePoint(0.5f*(fLastNoteCenter.x+c.x), + 0.5f*(fLastNoteCenter.y+c.y)); NSPoint dir = NSMakePoint(c.y-mid.y, c.x-mid.x); float n = dir.x*dir.x+dir.y*dir.y; float r = (kTieDepth*kTieDepth+n) / (2.0f*kTieDepth); float l = (r-kTieDepth) / sqrtf(n); mid.x += dir.x*l; mid.y += dir.y*l; - float a1 = atan2(lastNoteCenter.y-mid.y, lastNoteCenter.x-mid.x); + float a1 = atan2(fLastNoteCenter.y-mid.y, fLastNoteCenter.x-mid.x); float a2 = atan2(c.y-mid.y, c.x-mid.x); NSBezierPath * bz = [NSBezierPath bezierPath]; [bz appendBezierPathWithArcWithCenter:mid radius:r startAngle:a1*180.0f/M_PI endAngle:a2*180.0f/M_PI]; [bz stroke]; } - lastNoteCenter = c; + fLastNoteCenter = c; } - (void) drawRest:(VLFraction)dur at:(NSPoint)p @@ -253,10 +253,10 @@ static int sSemiToPitch[] = { VLFraction swung(3, prop.fDivisions*8, true); // Which notes to swing VLFraction swingGrid(2*swung); // Alignment of swing notes - for (int system = 0; system= song->CountMeasures()) break; const VLMeasure measure = song->fMeasures[measIdx]; @@ -311,18 +311,18 @@ static int sSemiToPitch[] = { } } } - if (noteCursorMeasure > -1) + if (fNoteCursorMeasure > -1) [self drawNoteCursor]; } - (void) setNoteCursorMeasure:(int)measure at:(VLFraction)at pitch:(int)pitch { - if (measure != noteCursorMeasure || at != noteCursorAt - || pitch != noteCursorPitch + if (measure != fNoteCursorMeasure || at != fNoteCursorAt + || pitch != fNoteCursorPitch ) { - noteCursorMeasure = measure; - noteCursorAt = at; - noteCursorPitch = pitch; + fNoteCursorMeasure = measure; + fNoteCursorAt = at; + fNoteCursorPitch = pitch; [self setNeedsDisplay:YES]; } diff --git a/Vocalese.xcodeproj/neeri.mode1v3 b/Vocalese.xcodeproj/neeri.mode1v3 index 20fb974..6ae65b8 100644 --- a/Vocalese.xcodeproj/neeri.mode1v3 +++ b/Vocalese.xcodeproj/neeri.mode1v3 @@ -200,7 +200,7 @@ Content PBXProjectModuleGUID - 95D1F82E0AB694EC00EE6AC8 + 95B042FC0ACE431A00236B52 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey @@ -222,117 +222,7 @@ Content PBXProjectModuleGUID - 95D1F7FE0AB68C8C00EE6AC8 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {763, 552}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 242 153 763 593 0 0 1024 746 - - - - Content - - PBXProjectModuleGUID - 95D1F8130AB6908400EE6AC8 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {763, 552}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 186 75 763 593 0 0 1024 746 - - - - Content - - PBXProjectModuleGUID - 95D1F8850AB69B6700EE6AC8 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {763, 552}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 168 116 763 593 0 0 1024 746 - - - - Content - - PBXProjectModuleGUID - 95D1F8660AB6970400EE6AC8 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {763, 552}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 15 148 763 593 0 0 1024 746 - - - - Content - - PBXProjectModuleGUID - 95D1F8310AB694EC00EE6AC8 - PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - StatusBarVisibility - - - Geometry - - Frame - {{0, 20}, {763, 552}} - PBXModuleWindowStatusBarHidden2 - - RubberWindowFrame - 164 91 763 593 0 0 1024 746 - - - - Content - - PBXProjectModuleGUID - 95B042FA0ACE431A00236B52 + 95B042FB0ACE431A00236B52 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey @@ -376,7 +266,7 @@ Content PBXProjectModuleGUID - 95B042FB0ACE431A00236B52 + 95B042FA0ACE431A00236B52 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey @@ -398,7 +288,117 @@ Content PBXProjectModuleGUID - 95B042FC0ACE431A00236B52 + 95D1F8310AB694EC00EE6AC8 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {763, 552}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 164 91 763 593 0 0 1024 746 + + + + Content + + PBXProjectModuleGUID + 95D1F8660AB6970400EE6AC8 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {763, 552}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 15 148 763 593 0 0 1024 746 + + + + Content + + PBXProjectModuleGUID + 95D1F8850AB69B6700EE6AC8 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {763, 552}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 168 116 763 593 0 0 1024 746 + + + + Content + + PBXProjectModuleGUID + 95D1F8130AB6908400EE6AC8 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {763, 552}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 186 75 763 593 0 0 1024 746 + + + + Content + + PBXProjectModuleGUID + 95D1F7FE0AB68C8C00EE6AC8 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {763, 552}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 242 153 763 593 0 0 1024 746 + + + + Content + + PBXProjectModuleGUID + 95D1F82E0AB694EC00EE6AC8 PBXProjectModuleLabel <No Editor> PBXSplitModuleInNavigatorKey @@ -603,9 +603,9 @@ TableOfContents - 95B042DA0ACE37CB00236B52 + 9529DCA60AD0E18200C9D67E 1CE0B1FE06471DED0097A5F4 - 95B042DB0ACE37CB00236B52 + 9529DCA70AD0E18200C9D67E 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 @@ -739,24 +739,23 @@ 5 WindowOrderList - 95B043090ACE46F000236B52 - 95B042FC0ACE431A00236B52 - 95B042FB0ACE431A00236B52 - 95B042F70ACE431A00236B52 - 95B042FA0ACE431A00236B52 - 95B042E40ACE37CB00236B52 - 95B042E50ACE37CB00236B52 - 95B042E60ACE37CB00236B52 + 9529DCB30AD0E40700C9D67E + 9529DCB40AD0E40700C9D67E + 9529DCB50AD0E40700C9D67E 95D7BFC80AA6C1A500D5E02C - 95D1F8310AB694EC00EE6AC8 - 95D1F8660AB6970400EE6AC8 - 95D1F8850AB69B6700EE6AC8 - 95D1F8130AB6908400EE6AC8 - 95D1F7FE0AB68C8C00EE6AC8 95D1F82E0AB694EC00EE6AC8 + 95D1F7FE0AB68C8C00EE6AC8 + 95D1F8130AB6908400EE6AC8 + 95D1F8850AB69B6700EE6AC8 + 95D1F8660AB6970400EE6AC8 + 95D1F8310AB694EC00EE6AC8 + 95B042FA0ACE431A00236B52 + 95B042F70ACE431A00236B52 + 95B042FB0ACE431A00236B52 + 95B042FC0ACE431A00236B52 + 1CD10A99069EF8BA00B06720 95D7BFC00AA6C1A500D5E02C /Development/Vocalese/Vocalese.xcodeproj - 1CD10A99069EF8BA00B06720 WindowString 167 326 690 397 0 0 1024 746 @@ -782,7 +781,7 @@ PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel - new_allocator.h + VLSheetViewNotes.mm StatusBarVisibility @@ -838,7 +837,7 @@ TableOfContents 95D7BFC00AA6C1A500D5E02C - 95B042DC0ACE37CB00236B52 + 9529DCA80AD0E18200C9D67E 1CD0528F0623707200166675 XCMainBuildResultsModuleGUID @@ -958,13 +957,13 @@ TableOfContents 1CD10A99069EF8BA00B06720 - 95B042DD0ACE37CB00236B52 + 9529DCA90AD0E18200C9D67E 1C162984064C10D400B95A72 - 95B042DE0ACE37CB00236B52 - 95B042DF0ACE37CB00236B52 - 95B042E00ACE37CB00236B52 - 95B042E10ACE37CB00236B52 - 95B042E20ACE37CB00236B52 + 9529DCAA0AD0E18200C9D67E + 9529DCAB0AD0E18200C9D67E + 9529DCAC0AD0E18200C9D67E + 9529DCAD0AD0E18200C9D67E + 9529DCAE0AD0E18200C9D67E ToolbarConfiguration xcode.toolbar.config.debugV3 @@ -1126,7 +1125,7 @@ TableOfContents 95D7BFC80AA6C1A500D5E02C - 95B042E30ACE37CB00236B52 + 9529DCB20AD0E40700C9D67E 1C78EAAC065D492600B07095 WindowString diff --git a/Vocalese.xcodeproj/neeri.pbxuser b/Vocalese.xcodeproj/neeri.pbxuser index 64ec5ca..76df6a7 100644 --- a/Vocalese.xcodeproj/neeri.pbxuser +++ b/Vocalese.xcodeproj/neeri.pbxuser @@ -62,13 +62,8 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 181286523; - PBXWorkspaceStateSaveDate = 181286523; - }; - perUserProjectItems = { - 95B042F40ACE42E800236B52 /* PBXBookmark */ = 95B042F40ACE42E800236B52 /* PBXBookmark */; - 95B042F90ACE431A00236B52 /* PBXTextBookmark */ = 95B042F90ACE431A00236B52 /* PBXTextBookmark */; - 95B043000ACE435E00236B52 /* PBXTextBookmark */ = 95B043000ACE435E00236B52 /* PBXTextBookmark */; + PBXPerProjectTemplateStateSaveDate = 181460906; + PBXWorkspaceStateSaveDate = 181460906; }; sourceControlManager = 954D7413095406B2007D9571 /* Source Control */; userBuildSettings = { @@ -160,9 +155,9 @@ }; 952DCD77096BBB11001C2316 /* VLSheetViewChords.mm */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {703, 2268}}"; - sepNavSelRange = "{3383, 0}"; - sepNavVisRect = "{{0, 1151}, {703, 261}}"; + sepNavIntBoundsRect = "{{0, 0}, {703, 2114}}"; + sepNavSelRange = "{4746, 0}"; + sepNavVisRect = "{{0, 1851}, {703, 261}}"; sepNavWindowFrame = "{{15, 92}, {763, 649}}"; }; }; @@ -300,30 +295,6 @@ sepNavWindowFrame = "{{120, 85}, {763, 649}}"; }; }; - 95B042F40ACE42E800236B52 /* PBXBookmark */ = { - isa = PBXBookmark; - fRef = 95BDA15809540BF1009F9D65 /* VLSheetView.mm */; - }; - 95B042F90ACE431A00236B52 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 95BDA15809540BF1009F9D65 /* VLSheetView.mm */; - name = "VLSheetView.mm: 244"; - rLen = 0; - rLoc = 5713; - rType = 0; - vrLen = 966; - vrLoc = 5150; - }; - 95B043000ACE435E00236B52 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 95BDA15809540BF1009F9D65 /* VLSheetView.mm */; - name = "VLSheetView.mm: 181"; - rLen = 0; - rLoc = 3996; - rType = 0; - vrLen = 1309; - vrLoc = 3259; - }; 95B66653096BC6A100FE18C9 /* VLSheetViewInternal.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {704, 497}}"; @@ -342,9 +313,9 @@ }; 95B66657096BCA1F00FE18C9 /* VLSheetViewNotes.mm */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {703, 2660}}"; - sepNavSelRange = "{8068, 0}"; - sepNavVisRect = "{{0, 1965}, {703, 238}}"; + sepNavIntBoundsRect = "{{0, 0}, {703, 4130}}"; + sepNavSelRange = "{1225, 0}"; + sepNavVisRect = "{{0, 479}, {703, 261}}"; sepNavWindowFrame = "{{38, 71}, {763, 649}}"; }; }; @@ -361,7 +332,7 @@ hitCount = 0; ignoreCount = 0; lineNumber = 21; - modificationTime = 181290725.024457; + modificationTime = 181461973.028078; state = 2; }; 95BDA15709540BF1009F9D65 /* VLSheetView.h */ = { @@ -374,9 +345,9 @@ }; 95BDA15809540BF1009F9D65 /* VLSheetView.mm */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {704, 5208}}"; - sepNavSelRange = "{3996, 0}"; - sepNavVisRect = "{{0, 2269}, {704, 497}}"; + sepNavIntBoundsRect = "{{0, 0}, {703, 2814}}"; + sepNavSelRange = "{8722, 0}"; + sepNavVisRect = "{{0, 2553}, {703, 261}}"; sepNavWindowFrame = "{{164, 35}, {763, 649}}"; }; };