From 6c22c971030f7ac344d0cd1c5d403b4596614dc4 Mon Sep 17 00:00:00 2001 From: vspader Date: Sat, 20 Oct 2007 16:18:44 +0000 Subject: [PATCH] Removed commented code. Fixed bug which may cause tracks to not end. --- Cog.xcodeproj/project.pbxproj | 43 ++++++++++++ Plugins/APL/APL.xcodeproj/vspader.mode1 | 46 +++---------- Plugins/APL/APL.xcodeproj/vspader.pbxuser | 80 +++++++++++++++++++++-- Plugins/APL/APLDecoder.m | 44 ++----------- 4 files changed, 132 insertions(+), 81 deletions(-) diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index d58e36613..bdc9ceed1 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 171B57DE0C091F2B00F6AFAF /* m4a.icns in Resources */ = {isa = PBXBuildFile; fileRef = 171B57DA0C091F2B00F6AFAF /* m4a.icns */; }; 171B57DF0C091F2B00F6AFAF /* mp3.icns in Resources */ = {isa = PBXBuildFile; fileRef = 171B57DB0C091F2B00F6AFAF /* mp3.icns */; }; 171B57E00C091F2B00F6AFAF /* ogg.icns in Resources */ = {isa = PBXBuildFile; fileRef = 171B57DC0C091F2B00F6AFAF /* ogg.icns */; }; + 171D09280CCA5FF0009FF3AB /* APL.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 171D09270CCA5FE1009FF3AB /* APL.bundle */; }; 1755E1F90BA0D2B600CA3560 /* PlaylistLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 1755E1F70BA0D2B600CA3560 /* PlaylistLoader.m */; }; 1766C6930B911DF1004A7AE4 /* AudioScrobbler.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C68F0B911DF1004A7AE4 /* AudioScrobbler.m */; }; 1766C6950B911DF1004A7AE4 /* AudioScrobblerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C6910B911DF1004A7AE4 /* AudioScrobblerClient.m */; }; @@ -131,6 +132,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 171D09260CCA5FE1009FF3AB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 171D09220CCA5FE1009FF3AB /* APL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 99B989F40CC7E10400C256E9 /* APL.bundle */; + remoteInfo = "APL Plugin"; + }; + 171D09410CCA6027009FF3AB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 171D09220CCA5FE1009FF3AB /* APL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 99B989F30CC7E10400C256E9 /* APL Plugin */; + remoteInfo = "APL Plugin"; + }; 17C808780C3BD167005707C4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 17C808710C3BD167005707C4 /* FileSource.xcodeproj */; @@ -392,6 +407,7 @@ dstPath = ""; dstSubfolderSpec = 13; files = ( + 171D09280CCA5FF0009FF3AB /* APL.bundle in CopyFiles */, 17C8F7D80CBEF3EF008D969D /* Dumb.bundle in CopyFiles */, 17C8F3CF0CBED66C008D969D /* GME.bundle in CopyFiles */, 17F3BB890CBC565900864489 /* CueSheet.bundle in CopyFiles */, @@ -440,6 +456,7 @@ 171B57DA0C091F2B00F6AFAF /* m4a.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = m4a.icns; sourceTree = ""; }; 171B57DB0C091F2B00F6AFAF /* mp3.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = mp3.icns; sourceTree = ""; }; 171B57DC0C091F2B00F6AFAF /* ogg.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ogg.icns; sourceTree = ""; }; + 171D09220CCA5FE1009FF3AB /* APL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = APL.xcodeproj; path = Plugins/Apl/APL.xcodeproj; sourceTree = ""; }; 1743945B0C3DA58A00A52DE9 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/OpenURLPanel.nib; sourceTree = ""; }; 1743945C0C3DA59000A52DE9 /* German */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = German; path = German.lproj/OpenURLPanel.nib; sourceTree = ""; }; 1743945D0C3DA59700A52DE9 /* Hebrew */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Hebrew; path = Hebrew.lproj/OpenURLPanel.nib; sourceTree = ""; }; @@ -687,6 +704,14 @@ name = "Other Frameworks"; sourceTree = ""; }; + 171D09230CCA5FE1009FF3AB /* Products */ = { + isa = PBXGroup; + children = ( + 171D09270CCA5FE1009FF3AB /* APL.bundle */, + ); + name = Products; + sourceTree = ""; + }; 1766C68D0B911DF1004A7AE4 /* AudioScrobbler */ = { isa = PBXGroup; children = ( @@ -850,6 +875,7 @@ 17B619FF0B909ED400BC003F /* PlugIns */ = { isa = PBXGroup; children = ( + 171D09220CCA5FE1009FF3AB /* APL.xcodeproj */, 17C8F7D20CBEF3E8008D969D /* Dumb.xcodeproj */, 17C8F3C80CBED663008D969D /* GME.xcodeproj */, 17F3BB830CBC565100864489 /* CueSheet.xcodeproj */, @@ -1206,6 +1232,7 @@ 17F3BB8B0CBC566200864489 /* PBXTargetDependency */, 17C8F44C0CBEDD37008D969D /* PBXTargetDependency */, 17C8F7DA0CBEF3F9008D969D /* PBXTargetDependency */, + 171D09420CCA6027009FF3AB /* PBXTargetDependency */, ); name = Cog; productInstallPath = "$(HOME)/Applications"; @@ -1233,6 +1260,10 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* Cog */; projectDirPath = ""; projectReferences = ( + { + ProductGroup = 171D09230CCA5FE1009FF3AB /* Products */; + ProjectRef = 171D09220CCA5FE1009FF3AB /* APL.xcodeproj */; + }, { ProductGroup = 17F5612B0C3BD4DC0019975C /* Products */; ProjectRef = 17F5612A0C3BD4DC0019975C /* CogAudio.xcodeproj */; @@ -1313,6 +1344,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 171D09270CCA5FE1009FF3AB /* APL.bundle */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = APL.bundle; + remoteRef = 171D09260CCA5FE1009FF3AB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 17C808790C3BD167005707C4 /* FileSource.bundle */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -1551,6 +1589,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 171D09420CCA6027009FF3AB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "APL Plugin"; + targetProxy = 171D09410CCA6027009FF3AB /* PBXContainerItemProxy */; + }; 17C8097E0C3BD1F5005707C4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Musepack; diff --git a/Plugins/APL/APL.xcodeproj/vspader.mode1 b/Plugins/APL/APL.xcodeproj/vspader.mode1 index 7a39f82a1..958c8c4aa 100644 --- a/Plugins/APL/APL.xcodeproj/vspader.mode1 +++ b/Plugins/APL/APL.xcodeproj/vspader.mode1 @@ -263,6 +263,8 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey + 4 + 1 0 @@ -304,7 +306,7 @@ PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel - Info.plist + APLDecoder.m PBXSplitModuleInNavigatorKey Split0 @@ -312,23 +314,23 @@ PBXProjectModuleGUID 1CE0B20406471E060097A5F4 PBXProjectModuleLabel - Info.plist + APLDecoder.m _historyCapacity 0 bookmark - 171D098A0CCA608C009FF3AB + 171D09A90CCA61C5009FF3AB history 171D095A0CCA608C009FF3AB 171D095B0CCA608C009FF3AB 171D095C0CCA608C009FF3AB 171D095D0CCA608C009FF3AB - 171D095E0CCA608C009FF3AB 171D095F0CCA608C009FF3AB 171D09600CCA608C009FF3AB 171D09610CCA608C009FF3AB 171D09620CCA608C009FF3AB - 171D09630CCA608C009FF3AB + 171D099E0CCA616C009FF3AB + 171D099F0CCA616C009FF3AB prevStack @@ -336,40 +338,13 @@ 171D09650CCA608C009FF3AB 171D09660CCA608C009FF3AB 171D09670CCA608C009FF3AB - 171D09680CCA608C009FF3AB 171D09690CCA608C009FF3AB - 171D096A0CCA608C009FF3AB 171D096B0CCA608C009FF3AB 171D096C0CCA608C009FF3AB - 171D096D0CCA608C009FF3AB - 171D096E0CCA608C009FF3AB 171D096F0CCA608C009FF3AB - 171D09700CCA608C009FF3AB - 171D09710CCA608C009FF3AB 171D09720CCA608C009FF3AB 171D09730CCA608C009FF3AB - 171D09740CCA608C009FF3AB - 171D09750CCA608C009FF3AB - 171D09760CCA608C009FF3AB - 171D09770CCA608C009FF3AB - 171D09780CCA608C009FF3AB - 171D09790CCA608C009FF3AB - 171D097A0CCA608C009FF3AB - 171D097B0CCA608C009FF3AB - 171D097C0CCA608C009FF3AB - 171D097D0CCA608C009FF3AB - 171D097E0CCA608C009FF3AB - 171D097F0CCA608C009FF3AB - 171D09800CCA608C009FF3AB - 171D09810CCA608C009FF3AB - 171D09820CCA608C009FF3AB - 171D09830CCA608C009FF3AB - 171D09840CCA608C009FF3AB - 171D09850CCA608C009FF3AB - 171D09860CCA608C009FF3AB - 171D09870CCA608C009FF3AB - 171D09880CCA608C009FF3AB - 171D09890CCA608C009FF3AB + 171D09A00CCA616C009FF3AB SplitCount @@ -427,9 +402,9 @@ TableOfContents - 171D098B0CCA608C009FF3AB + 171D09A20CCA616C009FF3AB 1CE0B1FE06471DED0097A5F4 - 171D098C0CCA608C009FF3AB + 171D09A30CCA616C009FF3AB 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 @@ -563,7 +538,6 @@ 5 WindowOrderList - 171D094F0CCA606A009FF3AB /Users/vspader/Projects/Cog/Plugins/Apl/APL.xcodeproj WindowString diff --git a/Plugins/APL/APL.xcodeproj/vspader.pbxuser b/Plugins/APL/APL.xcodeproj/vspader.pbxuser index a812c200c..f4f87c1ed 100644 --- a/Plugins/APL/APL.xcodeproj/vspader.pbxuser +++ b/Plugins/APL/APL.xcodeproj/vspader.pbxuser @@ -49,8 +49,8 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 214588999; - PBXWorkspaceStateSaveDate = 214588999; + PBXPerProjectTemplateStateSaveDate = 214589787; + PBXWorkspaceStateSaveDate = 214589787; }; perUserProjectItems = { 171D095A0CCA608C009FF3AB /* PBXTextBookmark */ = 171D095A0CCA608C009FF3AB /* PBXTextBookmark */; @@ -102,6 +102,12 @@ 171D09880CCA608C009FF3AB /* PBXTextBookmark */ = 171D09880CCA608C009FF3AB /* PBXTextBookmark */; 171D09890CCA608C009FF3AB /* PBXTextBookmark */ = 171D09890CCA608C009FF3AB /* PBXTextBookmark */; 171D098A0CCA608C009FF3AB /* PBXTextBookmark */ = 171D098A0CCA608C009FF3AB /* PBXTextBookmark */; + 171D099E0CCA616C009FF3AB /* PBXTextBookmark */ = 171D099E0CCA616C009FF3AB /* PBXTextBookmark */; + 171D099F0CCA616C009FF3AB /* PBXTextBookmark */ = 171D099F0CCA616C009FF3AB /* PBXTextBookmark */; + 171D09A00CCA616C009FF3AB /* PBXTextBookmark */ = 171D09A00CCA616C009FF3AB /* PBXTextBookmark */; + 171D09A10CCA616C009FF3AB /* PBXTextBookmark */ = 171D09A10CCA616C009FF3AB /* PBXTextBookmark */; + 171D09A60CCA619C009FF3AB /* PBXTextBookmark */ = 171D09A60CCA619C009FF3AB /* PBXTextBookmark */; + 171D09A90CCA61C5009FF3AB /* PBXTextBookmark */ = 171D09A90CCA61C5009FF3AB /* PBXTextBookmark */; }; sourceControlManager = 171D08F60CCA5E71009FF3AB /* Source Control */; userBuildSettings = { @@ -164,7 +170,7 @@ fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; name = "APLDecoder.m: 76"; rLen = 0; - rLoc = 2147; + rLoc = 2145; rType = 0; vrLen = 1611; vrLoc = 829; @@ -484,7 +490,7 @@ fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; name = "APLDecoder.m: 76"; rLen = 0; - rLoc = 2147; + rLoc = 2145; rType = 0; vrLen = 1611; vrLoc = 829; @@ -609,6 +615,66 @@ vrLen = 774; vrLoc = 0; }; + 171D099E0CCA616C009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8D5B49B7048680CD000E48DA /* Info.plist */; + name = "Info.plist: 15"; + rLen = 0; + rLoc = 528; + rType = 0; + vrLen = 774; + vrLoc = 0; + }; + 171D099F0CCA616C009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; + name = "APLDecoder.m: 76"; + rLen = 0; + rLoc = 2145; + rType = 0; + vrLen = 1611; + vrLoc = 829; + }; + 171D09A00CCA616C009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8D5B49B7048680CD000E48DA /* Info.plist */; + name = "Info.plist: 15"; + rLen = 0; + rLoc = 528; + rType = 0; + vrLen = 774; + vrLoc = 0; + }; + 171D09A10CCA616C009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; + name = "APLDecoder.m: 97"; + rLen = 1; + rLoc = 2357; + rType = 0; + vrLen = 1327; + vrLoc = 2545; + }; + 171D09A60CCA619C009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; + name = "APLDecoder.m: 100"; + rLen = 0; + rLoc = 2357; + rType = 0; + vrLen = 1224; + vrLoc = 2254; + }; + 171D09A90CCA61C5009FF3AB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 8E8D42360CBB0F9800135C1B /* APLDecoder.m */; + name = "APLDecoder.m: 99"; + rLen = 0; + rLoc = 2357; + rType = 0; + vrLen = 998; + vrLoc = 2102; + }; 17DA346C0CC04FCD0003F6B2 /* APLMetadataReader.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1431, 815}}"; @@ -639,9 +705,9 @@ }; 8E8D42360CBB0F9800135C1B /* APLDecoder.m */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1431, 2366}}"; - sepNavSelRange = "{2147, 0}"; - sepNavVisRect = "{{0, 581}, {1431, 815}}"; + sepNavIntBoundsRect = "{{0, 0}, {1431, 1918}}"; + sepNavSelRange = "{2357, 0}"; + sepNavVisRect = "{{0, 1103}, {1431, 815}}"; }; }; 8E8D423C0CBB0FF600135C1B /* Plugin.h */ = { diff --git a/Plugins/APL/APLDecoder.m b/Plugins/APL/APLDecoder.m index 21373b5aa..3f52bacaf 100644 --- a/Plugins/APL/APLDecoder.m +++ b/Plugins/APL/APLDecoder.m @@ -64,12 +64,15 @@ bytesPerFrame = (bitsPerSample/8) * channels; bytesPerSecond = (int)(bytesPerFrame * sampleRate); - if ([apl endBlock] > [apl startBlock]) trackEnd = ([apl endBlock] / sampleRate) * 1000.0; - else trackEnd = [[properties objectForKey:@"length"] doubleValue]; + if ([apl endBlock] > [apl startBlock]) + trackEnd = ([apl endBlock] / sampleRate) * 1000.0; + else + trackEnd = [[properties objectForKey:@"length"] doubleValue]; + trackStart = ([apl startBlock]/sampleRate) * 1000.0; trackLength = trackEnd - trackStart; - [decoder seekToTime: trackStart]; + [self seekToTime: 0.0]; //Note: Should register for observations of the decoder, but laziness consumes all. [self willChangeValueForKey:@"properties"]; @@ -94,41 +97,6 @@ } } -#if 0 -- (BOOL)setTrack_1111:(NSURL *)url -{ - // see if next apl is next track... - if ([[url fragment] intValue] == [[track track] intValue] + 1) { - NSArray *tracks = [cuesheet tracks]; - - int i; - for (i = 0; i < [tracks count]; i++) { - if ([[[tracks objectAtIndex:i] track] isEqualToString:[url fragment]]){ - [track release]; - track = [tracks objectAtIndex:i]; - [track retain]; - - CueSheetTrack *nextTrack = nil; - if (i + 1 < [tracks count]) { - nextTrack = [tracks objectAtIndex:i + 1]; - } - - if (nextTrack && [[[nextTrack url] absoluteString] isEqualToString:[[track url] absoluteString]]) { - trackEnd = [nextTrack time]; - } - else { - trackEnd = [[[decoder properties] objectForKey:@"length"] doubleValue]/1000.0; - } - - NSLog(@"CHANGING TRACK!"); - return YES; - } - } - } - - return NO; -} -#endif - (double)seekToTime:(double)time //milliseconds {