Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Massive C++11 update. Changed all instances of NULL to nullptr, and u…

…pdated copyright for 2012.
  • Loading branch information...
commit 7190a1506fe1241233305e1ebd79f7f4afa26928 1 parent ff2f4aa
Stephen F. Booth authored February 24, 2012

Showing 66 changed files with 1,078 additions and 1,078 deletions. Show diff stats Hide diff stats

  1. 4  AllocateABL.cpp
  2. 2  AllocateABL.h
  3. 4  ChannelLayoutsAreEqual.cpp
  4. 2  ChannelLayoutsAreEqual.h
  5. 2  Converter/AudioConverter.cpp
  6. 2  Converter/AudioConverter.h
  7. 6  Converter/DeinterleavingFloatConverter.cpp
  8. 2  Converter/DeinterleavingFloatConverter.h
  9. 4  Converter/PCMConverter.cpp
  10. 2  Converter/PCMConverter.h
  11. 10  CreateChannelLayout.cpp
  12. 2  CreateChannelLayout.h
  13. 10  CreateDisplayNameForURL.cpp
  14. 2  CreateDisplayNameForURL.h
  15. 4  CreateStringForOSType.cpp
  16. 2  CreateStringForOSType.h
  17. 10  DeallocateABL.cpp
  18. 2  DeallocateABL.h
  19. 398  Decoders/AudioDecoder.cpp
  20. 38  Decoders/AudioDecoder.h
  21. 102  Decoders/CoreAudioDecoder.cpp
  22. 6  Decoders/CoreAudioDecoder.h
  23. 94  Decoders/FLACDecoder.cpp
  24. 6  Decoders/FLACDecoder.h
  25. 54  Decoders/LibsndfileDecoder.cpp
  26. 6  Decoders/LibsndfileDecoder.h
  27. 22  Decoders/LoopableRegionDecoder.cpp
  28. 4  Decoders/LoopableRegionDecoder.h
  29. 68  Decoders/MODDecoder.cpp
  30. 6  Decoders/MODDecoder.h
  31. 88  Decoders/MPEGDecoder.cpp
  32. 6  Decoders/MPEGDecoder.h
  33. 30  Decoders/MonkeysAudioDecoder.cpp
  34. 6  Decoders/MonkeysAudioDecoder.h
  35. 42  Decoders/MusepackDecoder.cpp
  36. 6  Decoders/MusepackDecoder.h
  37. 106  Decoders/OggSpeexDecoder.cpp
  38. 6  Decoders/OggSpeexDecoder.h
  39. 34  Decoders/OggVorbisDecoder.cpp
  40. 6  Decoders/OggVorbisDecoder.h
  41. 48  Decoders/WavPackDecoder.cpp
  42. 6  Decoders/WavPackDecoder.h
  43. 4  Guard.cpp
  44. 2  Guard.h
  45. 22  Input/FileInputSource.cpp
  46. 6  Input/FileInputSource.h
  47. 48  Input/HTTPInputSource.cpp
  48. 6  Input/HTTPInputSource.h
  49. 28  Input/InMemoryFileInputSource.cpp
  50. 8  Input/InMemoryFileInputSource.h
  51. 28  Input/InputSource.cpp
  52. 10  Input/InputSource.h
  53. 26  Input/MemoryMappedFileInputSource.cpp
  54. 8  Input/MemoryMappedFileInputSource.h
  55. 28  Logger.cpp
  56. 20  Logger.h
  57. 4  Mutex.cpp
  58. 2  Mutex.h
  59. 326  Player/AudioPlayer.cpp
  60. 4  Player/AudioPlayer.h
  61. 290  Player/BasicAudioPlayer.cpp
  62. 4  Player/BasicAudioPlayer.h
  63. 16  Player/DecoderStateData.cpp
  64. 2  Player/DecoderStateData.h
  65. 2  Semaphore.cpp
  66. 2  Semaphore.h
4  AllocateABL.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@ AllocateABL(const AudioStreamBasicDescription& format, UInt32 capacityFrames)
43 43
 AudioBufferList *
44 44
 AllocateABL(UInt32 channelsPerFrame, UInt32 bytesPerFrame, bool interleaved, UInt32 capacityFrames)
45 45
 {
46  
-	AudioBufferList *bufferList = NULL;
  46
+	AudioBufferList *bufferList = nullptr;
47 47
 	
48 48
 	UInt32 numBuffers = interleaved ? 1 : channelsPerFrame;
49 49
 	UInt32 channelsPerBuffer = interleaved ? channelsPerFrame : 1;
2  AllocateABL.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
4  ChannelLayoutsAreEqual.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@ ChannelLayoutsAreEqual(const AudioChannelLayout *lhs, const AudioChannelLayout *
36 36
 	if(lhs == rhs)
37 37
 		return true;
38 38
 
39  
-	if((NULL == lhs && NULL != rhs) || (NULL != lhs && NULL == rhs))
  39
+	if((nullptr == lhs && nullptr != rhs) || (nullptr != lhs && nullptr == rhs))
40 40
 		return false;
41 41
 
42 42
 	// First check if the tags are equal
2  ChannelLayoutsAreEqual.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
2  Converter/AudioConverter.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
2  Converter/AudioConverter.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
6  Converter/DeinterleavingFloatConverter.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -70,8 +70,8 @@ DeinterleavingFloatConverter::~DeinterleavingFloatConverter()
70 70
 UInt32
71 71
 DeinterleavingFloatConverter::Convert(const AudioBufferList *inputBuffer, AudioBufferList *outputBuffer, UInt32 frameCount)
72 72
 {
73  
-	assert(NULL != inputBuffer);
74  
-	assert(NULL != outputBuffer);
  73
+	assert(nullptr != inputBuffer);
  74
+	assert(nullptr != outputBuffer);
75 75
 	
76 76
 	// Nothing to do
77 77
 	if(0 == frameCount) {
2  Converter/DeinterleavingFloatConverter.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
4  Converter/PCMConverter.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -74,7 +74,7 @@ PCMConverter::~PCMConverter()
74 74
 
75 75
 UInt32 PCMConverter::Convert(const AudioBufferList *inputBuffer, AudioBufferList *outputBuffer, UInt32 frameCount)
76 76
 {
77  
-	if(NULL == inputBuffer || NULL == outputBuffer)
  77
+	if(nullptr == inputBuffer || nullptr == outputBuffer)
78 78
 		return 0;
79 79
 	
80 80
 	// Nothing to do
2  Converter/PCMConverter.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
10  CreateChannelLayout.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@ static size_t GetChannelLayoutSize(UInt32 numberChannelDescriptions)
41 41
 
42 42
 size_t GetChannelLayoutSize(const AudioChannelLayout *layout)
43 43
 {
44  
-	assert(NULL != layout);
  44
+	assert(nullptr != layout);
45 45
 	return GetChannelLayoutSize(layout->mNumberChannelDescriptions);
46 46
 }
47 47
 
@@ -70,8 +70,8 @@ AudioChannelLayout * CreateChannelLayoutWithBitmap(UInt32 channelBitmap)
70 70
 
71 71
 AudioChannelLayout * CopyChannelLayout(const AudioChannelLayout *rhs)
72 72
 {
73  
-	if(NULL == rhs)
74  
-		return NULL;
  73
+	if(nullptr == rhs)
  74
+		return nullptr;
75 75
 
76 76
 	size_t layoutSize = GetChannelLayoutSize(rhs->mNumberChannelDescriptions);
77 77
 	AudioChannelLayout *channelLayout = static_cast<AudioChannelLayout *>(malloc(layoutSize));
@@ -84,7 +84,7 @@ AudioChannelLayout * CreateDefaultAudioChannelLayout(UInt32 channelsPerFrame)
84 84
 {
85 85
 	assert(0 < channelsPerFrame);
86 86
 
87  
-	AudioChannelLayout *channelLayout = NULL;
  87
+	AudioChannelLayout *channelLayout = nullptr;
88 88
 
89 89
 	switch(channelsPerFrame) {
90 90
 		case 1:		channelLayout = CreateChannelLayoutWithTag(kAudioChannelLayoutTag_Mono);			break;
2  CreateChannelLayout.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
10  CreateDisplayNameForURL.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -39,15 +39,15 @@
39 39
 CFStringRef
40 40
 CreateDisplayNameForURL(CFURLRef url)
41 41
 {
42  
-	assert(NULL != url);
  42
+	assert(nullptr != url);
43 43
 
44  
-	CFStringRef displayName = NULL;
  44
+	CFStringRef displayName = nullptr;
45 45
 
46 46
 #if !TARGET_OS_IPHONE
47 47
 	CFStringRef scheme = CFURLCopyScheme(url);
48 48
 	if(scheme) {
49 49
 		bool isFileURL = (kCFCompareEqualTo == CFStringCompare(CFSTR("file"), scheme, kCFCompareCaseInsensitive));
50  
-		CFRelease(scheme), scheme = NULL;
  50
+		CFRelease(scheme), scheme = nullptr;
51 51
 
52 52
 		if(isFileURL) {
53 53
 			OSStatus result = LSCopyDisplayNameForURL(url, &displayName);
@@ -62,7 +62,7 @@ CreateDisplayNameForURL(CFURLRef url)
62 62
 			CFRetain(displayName);
63 63
 		}
64 64
 	}
65  
-	// If scheme is NULL the URL is probably invalid, but can still be logged
  65
+	// If scheme is nullptr the URL is probably invalid, but can still be logged
66 66
 	else {
67 67
 		displayName = CFURLGetString(url);
68 68
 		CFRetain(displayName);
2  CreateDisplayNameForURL.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
4  CreateStringForOSType.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -35,5 +35,5 @@ CFStringRef CreateStringForOSType(OSType osType)
35 35
 	unsigned char formatID [4];
36 36
 	*(UInt32 *)formatID = OSSwapHostToBigInt32(osType);
37 37
 
38  
-    return CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%.4s"), formatID);
  38
+    return CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%.4s"), formatID);
39 39
 }
2  CreateStringForOSType.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
10  DeallocateABL.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -36,12 +36,12 @@
36 36
 AudioBufferList *
37 37
 DeallocateABL(AudioBufferList *bufferList)
38 38
 {
39  
-	assert(NULL != bufferList);
  39
+	assert(nullptr != bufferList);
40 40
 	
41 41
 	for(UInt32 bufferIndex = 0; bufferIndex < bufferList->mNumberBuffers; ++bufferIndex)
42  
-		free(bufferList->mBuffers[bufferIndex].mData), bufferList->mBuffers[bufferIndex].mData = NULL;
  42
+		free(bufferList->mBuffers[bufferIndex].mData), bufferList->mBuffers[bufferIndex].mData = nullptr;
43 43
 	
44  
-	free(bufferList), bufferList = NULL;
  44
+	free(bufferList), bufferList = nullptr;
45 45
 	
46  
-	return NULL;
  46
+	return nullptr;
47 47
 }
2  DeallocateABL.h
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
398  Decoders/AudioDecoder.cpp
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
- *  Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Stephen F. Booth <me@sbooth.org>
  2
+ *  Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Stephen F. Booth <me@sbooth.org>
3 3
  *  All Rights Reserved.
4 4
  *
5 5
  *  Redistribution and use in source and binary forms, with or without
@@ -69,59 +69,59 @@ CFArrayRef AudioDecoder::CreateSupportedFileExtensions()
69 69
 {
70 70
 	CFMutableArrayRef supportedExtensions = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
71 71
 	
72  
-	CFArrayRef decoderExtensions = NULL;
  72
+	CFArrayRef decoderExtensions = nullptr;
73 73
 
74 74
 	decoderExtensions = FLACDecoder::CreateSupportedFileExtensions();
75 75
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
76  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  76
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
77 77
 
78 78
 	decoderExtensions = WavPackDecoder::CreateSupportedFileExtensions();
79 79
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
80  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  80
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
81 81
 
82 82
 	decoderExtensions = MPEGDecoder::CreateSupportedFileExtensions();
83 83
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
84  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  84
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
85 85
 
86 86
 	decoderExtensions = OggVorbisDecoder::CreateSupportedFileExtensions();
87 87
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
88  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  88
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
89 89
 
90 90
 #if !TARGET_OS_IPHONE
91 91
 	decoderExtensions = MusepackDecoder::CreateSupportedFileExtensions();
92 92
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
93  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  93
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
94 94
 
95 95
 	decoderExtensions = MonkeysAudioDecoder::CreateSupportedFileExtensions();
96 96
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
97  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  97
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
98 98
 #endif
99 99
 
100 100
 	decoderExtensions = OggSpeexDecoder::CreateSupportedFileExtensions();
101 101
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
102  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  102
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
103 103
 
104 104
 #if !TARGET_OS_IPHONE
105 105
 	decoderExtensions = MODDecoder::CreateSupportedFileExtensions();
106 106
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
107  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  107
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
108 108
 
109 109
 	decoderExtensions = TrueAudioDecoder::CreateSupportedFileExtensions();
110 110
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
111  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  111
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
112 112
 #endif
113 113
 
114 114
 	decoderExtensions = LibsndfileDecoder::CreateSupportedFileExtensions();
115 115
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
116  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  116
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
117 117
 
118 118
 	decoderExtensions = CoreAudioDecoder::CreateSupportedFileExtensions();
119 119
 	CFArrayAppendArray(supportedExtensions, decoderExtensions, CFRangeMake(0, CFArrayGetCount(decoderExtensions)));
120  
-	CFRelease(decoderExtensions), decoderExtensions = NULL;
  120
+	CFRelease(decoderExtensions), decoderExtensions = nullptr;
121 121
 	
122 122
 	CFArrayRef result = CFArrayCreateCopy(kCFAllocatorDefault, supportedExtensions);
123 123
 	
124  
-	CFRelease(supportedExtensions), supportedExtensions = NULL;
  124
+	CFRelease(supportedExtensions), supportedExtensions = nullptr;
125 125
 	
126 126
 	return result;
127 127
 }
@@ -130,70 +130,70 @@ CFArrayRef AudioDecoder::CreateSupportedMIMETypes()
130 130
 {
131 131
 	CFMutableArrayRef supportedMIMETypes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
132 132
 	
133  
-	CFArrayRef decoderMIMETypes = NULL;
  133
+	CFArrayRef decoderMIMETypes = nullptr;
134 134
 
135 135
 	decoderMIMETypes = FLACDecoder::CreateSupportedMIMETypes();
136 136
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
137  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  137
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
138 138
 	
139 139
 	decoderMIMETypes = WavPackDecoder::CreateSupportedMIMETypes();
140 140
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
141  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  141
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
142 142
 	
143 143
 	decoderMIMETypes = MPEGDecoder::CreateSupportedMIMETypes();
144 144
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
145  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  145
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
146 146
 	
147 147
 	decoderMIMETypes = OggVorbisDecoder::CreateSupportedMIMETypes();
148 148
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
149  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  149
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
150 150
 	
151 151
 #if !TARGET_OS_IPHONE
152 152
 	decoderMIMETypes = MusepackDecoder::CreateSupportedMIMETypes();
153 153
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
154  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  154
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
155 155
 	
156 156
 	decoderMIMETypes = MonkeysAudioDecoder::CreateSupportedMIMETypes();
157 157
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
158  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  158
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
159 159
 #endif
160 160
 
161 161
 	decoderMIMETypes = OggSpeexDecoder::CreateSupportedMIMETypes();
162 162
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
163  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  163
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
164 164
 
165 165
 #if !TARGET_OS_IPHONE
166 166
 	decoderMIMETypes = MODDecoder::CreateSupportedMIMETypes();
167 167
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
168  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  168
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
169 169
 
170 170
 	decoderMIMETypes = TrueAudioDecoder::CreateSupportedMIMETypes();
171 171
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
172  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  172
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
173 173
 #endif
174 174
 
175 175
 	decoderMIMETypes = LibsndfileDecoder::CreateSupportedMIMETypes();
176 176
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
177  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  177
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
178 178
 
179 179
 	decoderMIMETypes = CoreAudioDecoder::CreateSupportedMIMETypes();
180 180
 	CFArrayAppendArray(supportedMIMETypes, decoderMIMETypes, CFRangeMake(0, CFArrayGetCount(decoderMIMETypes)));
181  
-	CFRelease(decoderMIMETypes), decoderMIMETypes = NULL;
  181
+	CFRelease(decoderMIMETypes), decoderMIMETypes = nullptr;
182 182
 	
183 183
 	CFArrayRef result = CFArrayCreateCopy(kCFAllocatorDefault, supportedMIMETypes);
184 184
 	
185  
-	CFRelease(supportedMIMETypes), supportedMIMETypes = NULL;
  185
+	CFRelease(supportedMIMETypes), supportedMIMETypes = nullptr;
186 186
 	
187 187
 	return result;
188 188
 }
189 189
 
190 190
 bool AudioDecoder::HandlesFilesWithExtension(CFStringRef extension)
191 191
 {
192  
-	if(NULL == extension)
  192
+	if(nullptr == extension)
193 193
 		return false;
194 194
 	
195 195
 	CFArrayRef supportedExtensions = CreateSupportedFileExtensions();
196  
-	if(NULL == supportedExtensions)
  196
+	if(nullptr == supportedExtensions)
197 197
 		return false;
198 198
 	
199 199
 	bool extensionIsSupported = false;
@@ -207,18 +207,18 @@ bool AudioDecoder::HandlesFilesWithExtension(CFStringRef extension)
207 207
 		}
208 208
 	}
209 209
 	
210  
-	CFRelease(supportedExtensions), supportedExtensions = NULL;
  210
+	CFRelease(supportedExtensions), supportedExtensions = nullptr;
211 211
 
212 212
 	return extensionIsSupported;
213 213
 }
214 214
 
215 215
 bool AudioDecoder::HandlesMIMEType(CFStringRef mimeType)
216 216
 {
217  
-	if(NULL == mimeType)
  217
+	if(nullptr == mimeType)
218 218
 		return false;
219 219
 
220 220
 	CFArrayRef supportedMIMETypes = CreateSupportedMIMETypes();
221  
-	if(NULL == supportedMIMETypes)
  221
+	if(nullptr == supportedMIMETypes)
222 222
 		return false;
223 223
 	
224 224
 	bool mimeTypeIsSupported = false;
@@ -232,52 +232,52 @@ bool AudioDecoder::HandlesMIMEType(CFStringRef mimeType)
232 232
 		}
233 233
 	}
234 234
 
235  
-	CFRelease(supportedMIMETypes), supportedMIMETypes = NULL;
  235
+	CFRelease(supportedMIMETypes), supportedMIMETypes = nullptr;
236 236
 	
237 237
 	return mimeTypeIsSupported;
238 238
 }
239 239
 
240 240
 AudioDecoder * AudioDecoder::CreateDecoderForURL(CFURLRef url, CFErrorRef *error)
241 241
 {
242  
-	return CreateDecoderForURL(url, NULL, error);
  242
+	return CreateDecoderForURL(url, nullptr, error);
243 243
 }
244 244
 
245 245
 AudioDecoder * AudioDecoder::CreateDecoderForURL(CFURLRef url, CFStringRef mimeType, CFErrorRef *error)
246 246
 {
247  
-	if(NULL == url)
248  
-		return NULL;
  247
+	if(nullptr == url)
  248
+		return nullptr;
249 249
 
250 250
 	// Create the input source which will feed the decoder
251 251
 	InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error);
252 252
 	
253  
-	if(NULL == inputSource)
254  
-		return NULL;
  253
+	if(nullptr == inputSource)
  254
+		return nullptr;
255 255
 
256 256
 	AudioDecoder *decoder = CreateDecoderForInputSource(inputSource, mimeType, error);
257 257
 	
258  
-	if(NULL == decoder)
259  
-		delete inputSource, inputSource = NULL;
  258
+	if(nullptr == decoder)
  259
+		delete inputSource, inputSource = nullptr;
260 260
 	
261 261
 	return decoder;
262 262
 }
263 263
 
264  
-// If this returns NULL, the caller is responsible for deleting inputSource
  264
+// If this returns nullptr, the caller is responsible for deleting inputSource
265 265
 // If this returns an AudioDecoder instance, the instance takes ownership of inputSource
266 266
 AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSource, CFErrorRef *error)
267 267
 {
268  
-	return CreateDecoderForInputSource(inputSource, NULL, error);
  268
+	return CreateDecoderForInputSource(inputSource, nullptr, error);
269 269
 }
270 270
 
271 271
 AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSource, CFStringRef mimeType, CFErrorRef *error)
272 272
 {
273  
-	if(NULL == inputSource)
274  
-		return NULL;
  273
+	if(nullptr == inputSource)
  274
+		return nullptr;
275 275
 
276  
-	AudioDecoder *decoder = NULL;
  276
+	AudioDecoder *decoder = nullptr;
277 277
 
278 278
 	// Open the input source if it isn't already
279 279
 	if(AutomaticallyOpenDecoders() && !inputSource->IsOpen() && !inputSource->Open(error))
280  
-		return NULL;
  280
+		return nullptr;
281 281
 
282 282
 	// As a factory this class has knowledge of its subclasses
283 283
 	// It would be possible (and perhaps preferable) to switch to a generic
@@ -300,88 +300,88 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSourc
300 300
 		if(FLACDecoder::HandlesMIMEType(mimeType)) {
301 301
 			decoder = new FLACDecoder(inputSource);
302 302
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
303  
-				decoder->mInputSource = NULL;
304  
-				delete decoder, decoder = NULL;
  303
+				decoder->mInputSource = nullptr;
  304
+				delete decoder, decoder = nullptr;
305 305
 			}
306 306
 		}
307  
-		if(NULL == decoder && WavPackDecoder::HandlesMIMEType(mimeType)) {
  307
+		if(nullptr == decoder && WavPackDecoder::HandlesMIMEType(mimeType)) {
308 308
 			decoder = new WavPackDecoder(inputSource);
309 309
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
310  
-				decoder->mInputSource = NULL;
311  
-				delete decoder, decoder = NULL;
  310
+				decoder->mInputSource = nullptr;
  311
+				delete decoder, decoder = nullptr;
312 312
 			}
313 313
 		}
314  
-		if(NULL == decoder && MPEGDecoder::HandlesMIMEType(mimeType)) {
  314
+		if(nullptr == decoder && MPEGDecoder::HandlesMIMEType(mimeType)) {
315 315
 			decoder = new MPEGDecoder(inputSource);
316 316
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
317  
-				decoder->mInputSource = NULL;
318  
-				delete decoder, decoder = NULL;
  317
+				decoder->mInputSource = nullptr;
  318
+				delete decoder, decoder = nullptr;
319 319
 			}
320 320
 		}
321  
-		if(NULL == decoder && OggVorbisDecoder::HandlesMIMEType(mimeType)) {
  321
+		if(nullptr == decoder && OggVorbisDecoder::HandlesMIMEType(mimeType)) {
322 322
 			decoder = new OggVorbisDecoder(inputSource);
323 323
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
324  
-				decoder->mInputSource = NULL;
325  
-				delete decoder, decoder = NULL;
  324
+				decoder->mInputSource = nullptr;
  325
+				delete decoder, decoder = nullptr;
326 326
 			}
327 327
 		}
328 328
 #if !TARGET_OS_IPHONE
329  
-		if(NULL == decoder && MusepackDecoder::HandlesMIMEType(mimeType)) {
  329
+		if(nullptr == decoder && MusepackDecoder::HandlesMIMEType(mimeType)) {
330 330
 			decoder = new MusepackDecoder(inputSource);
331 331
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
332  
-				decoder->mInputSource = NULL;
333  
-				delete decoder, decoder = NULL;
  332
+				decoder->mInputSource = nullptr;
  333
+				delete decoder, decoder = nullptr;
334 334
 			}
335 335
 		}
336  
-		if(NULL == decoder && MonkeysAudioDecoder::HandlesMIMEType(mimeType)) {
  336
+		if(nullptr == decoder && MonkeysAudioDecoder::HandlesMIMEType(mimeType)) {
337 337
 			decoder = new MonkeysAudioDecoder(inputSource);
338 338
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
339  
-				decoder->mInputSource = NULL;
340  
-				delete decoder, decoder = NULL;
  339
+				decoder->mInputSource = nullptr;
  340
+				delete decoder, decoder = nullptr;
341 341
 			}
342 342
 		}
343 343
 #endif
344  
-		if(NULL == decoder && OggSpeexDecoder::HandlesMIMEType(mimeType)) {
  344
+		if(nullptr == decoder && OggSpeexDecoder::HandlesMIMEType(mimeType)) {
345 345
 			decoder = new OggSpeexDecoder(inputSource);
346 346
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
347  
-				decoder->mInputSource = NULL;
348  
-				delete decoder, decoder = NULL;
  347
+				decoder->mInputSource = nullptr;
  348
+				delete decoder, decoder = nullptr;
349 349
 			}
350 350
 		}
351 351
 #if !TARGET_OS_IPHONE
352  
-		if(NULL == decoder && MODDecoder::HandlesMIMEType(mimeType)) {
  352
+		if(nullptr == decoder && MODDecoder::HandlesMIMEType(mimeType)) {
353 353
 			decoder = new MODDecoder(inputSource);
354 354
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
355  
-				decoder->mInputSource = NULL;
356  
-				delete decoder, decoder = NULL;
  355
+				decoder->mInputSource = nullptr;
  356
+				delete decoder, decoder = nullptr;
357 357
 			}
358 358
 		}
359  
-		if(NULL == decoder && TrueAudioDecoder::HandlesMIMEType(mimeType)) {
  359
+		if(nullptr == decoder && TrueAudioDecoder::HandlesMIMEType(mimeType)) {
360 360
 			decoder = new TrueAudioDecoder(inputSource);
361 361
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
362  
-				decoder->mInputSource = NULL;
363  
-				delete decoder, decoder = NULL;
  362
+				decoder->mInputSource = nullptr;
  363
+				delete decoder, decoder = nullptr;
364 364
 			}
365 365
 		}
366 366
 #endif
367  
-		if(NULL == decoder && LibsndfileDecoder::HandlesMIMEType(mimeType)) {
  367
+		if(nullptr == decoder && LibsndfileDecoder::HandlesMIMEType(mimeType)) {
368 368
 			decoder = new LibsndfileDecoder(inputSource);
369 369
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
370  
-				decoder->mInputSource = NULL;
371  
-				delete decoder, decoder = NULL;
  370
+				decoder->mInputSource = nullptr;
  371
+				delete decoder, decoder = nullptr;
372 372
 			}
373 373
 		}
374  
-		if(NULL == decoder && CoreAudioDecoder::HandlesMIMEType(mimeType)) {
  374
+		if(nullptr == decoder && CoreAudioDecoder::HandlesMIMEType(mimeType)) {
375 375
 			decoder = new CoreAudioDecoder(inputSource);
376 376
 			if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
377  
-				decoder->mInputSource = NULL;
378  
-				delete decoder, decoder = NULL;
  377
+				decoder->mInputSource = nullptr;
  378
+				delete decoder, decoder = nullptr;
379 379
 			}
380 380
 		}
381 381
 
382 382
 #if 0
383 383
 		if(releaseMIMEType)
384  
-			CFRelease(mimeType), mimeType = NULL;
  384
+			CFRelease(mimeType), mimeType = nullptr;
385 385
 #endif
386 386
 
387 387
 		if(decoder)
@@ -392,17 +392,17 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSourc
392 392
 
393 393
 	CFURLRef inputURL = inputSource->GetURL();
394 394
 	if(!inputURL)
395  
-		return NULL;
  395
+		return nullptr;
396 396
 
397 397
 	// Determining the extension isn't as simple as using CFURLCopyPathExtension (wouldn't that be nice?),
398 398
 	// because although the behavior on Lion works like one would expect, on Snow Leopard it returns
399 399
 	// a number that I believe is part of the inode number, but is definitely NOT the extension
400  
-	CFStringRef pathExtension = NULL;
  400
+	CFStringRef pathExtension = nullptr;
401 401
 #if !TARGET_OS_IPHONE
402  
-	CFURLRef filePathURL = CFURLCreateFilePathURL(kCFAllocatorDefault, inputURL, NULL);
  402
+	CFURLRef filePathURL = CFURLCreateFilePathURL(kCFAllocatorDefault, inputURL, nullptr);
403 403
 	if(filePathURL) {
404 404
 		pathExtension = CFURLCopyPathExtension(filePathURL);
405  
-		CFRelease(filePathURL), filePathURL = NULL;
  405
+		CFRelease(filePathURL), filePathURL = nullptr;
406 406
 	}
407 407
 	else
408 408
 #endif
@@ -417,7 +417,7 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSourc
417 417
 
418 418
 			CFStringRef displayName = CFURLCopyLastPathComponent(inputURL);
419 419
 			CFStringRef errorString = CFStringCreateWithFormat(kCFAllocatorDefault, 
420  
-															   NULL, 
  420
+															   nullptr, 
421 421
 															   CFCopyLocalizedString(CFSTR("The type of the file “%@” could not be determined."), ""), 
422 422
 															   displayName);
423 423
 
@@ -433,18 +433,18 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSourc
433 433
 								 kCFErrorLocalizedRecoverySuggestionKey, 
434 434
 								 CFCopyLocalizedString(CFSTR("The file's extension may be missing or may not match the file's type."), ""));
435 435
 
436  
-			CFRelease(errorString), errorString = NULL;
437  
-			CFRelease(displayName), displayName = NULL;
  436
+			CFRelease(errorString), errorString = nullptr;
  437
+			CFRelease(displayName), displayName = nullptr;
438 438
 
439 439
 			*error = CFErrorCreate(kCFAllocatorDefault, 
440 440
 								   InputSourceErrorDomain, 
441 441
 								   InputSourceFileNotFoundError,
442 442
 								   errorDictionary);
443 443
 			
444  
-			CFRelease(errorDictionary), errorDictionary = NULL;				
  444
+			CFRelease(errorDictionary), errorDictionary = nullptr;				
445 445
 		}
446 446
 
447  
-		return NULL;
  447
+		return nullptr;
448 448
 	}
449 449
 
450 450
 	// TODO: Some extensions (.oga for example) support multiple audio codecs (Vorbis, FLAC, Speex)
@@ -454,167 +454,167 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSource(InputSource *inputSourc
454 454
 	if(FLACDecoder::HandlesFilesWithExtension(pathExtension)) {
455 455
 		decoder = new FLACDecoder(inputSource);
456 456
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
457  
-			decoder->mInputSource = NULL;
458  
-			delete decoder, decoder = NULL;
  457
+			decoder->mInputSource = nullptr;
  458
+			delete decoder, decoder = nullptr;
459 459
 		}
460 460
 	}
461  
-	if(NULL == decoder && WavPackDecoder::HandlesFilesWithExtension(pathExtension)) {
  461
+	if(nullptr == decoder && WavPackDecoder::HandlesFilesWithExtension(pathExtension)) {
462 462
 		decoder = new WavPackDecoder(inputSource);
463 463
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
464  
-			decoder->mInputSource = NULL;
465  
-			delete decoder, decoder = NULL;
  464
+			decoder->mInputSource = nullptr;
  465
+			delete decoder, decoder = nullptr;
466 466
 		}
467 467
 	}
468  
-	if(NULL == decoder && MPEGDecoder::HandlesFilesWithExtension(pathExtension)) {
  468
+	if(nullptr == decoder && MPEGDecoder::HandlesFilesWithExtension(pathExtension)) {
469 469
 		decoder = new MPEGDecoder(inputSource);
470 470
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
471  
-			decoder->mInputSource = NULL;
472  
-			delete decoder, decoder = NULL;
  471
+			decoder->mInputSource = nullptr;
  472
+			delete decoder, decoder = nullptr;
473 473
 		}
474 474
 	}
475  
-	if(NULL == decoder && OggVorbisDecoder::HandlesFilesWithExtension(pathExtension)) {
  475
+	if(nullptr == decoder && OggVorbisDecoder::HandlesFilesWithExtension(pathExtension)) {
476 476
 		decoder = new OggVorbisDecoder(inputSource);
477 477
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
478  
-			decoder->mInputSource = NULL;
479  
-			delete decoder, decoder = NULL;
  478
+			decoder->mInputSource = nullptr;
  479
+			delete decoder, decoder = nullptr;
480 480
 		}
481 481
 	}
482 482
 #if !TARGET_OS_IPHONE
483  
-	if(NULL == decoder && MusepackDecoder::HandlesFilesWithExtension(pathExtension)) {
  483
+	if(nullptr == decoder && MusepackDecoder::HandlesFilesWithExtension(pathExtension)) {
484 484
 		decoder = new MusepackDecoder(inputSource);
485 485
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
486  
-			decoder->mInputSource = NULL;
487  
-			delete decoder, decoder = NULL;
  486
+			decoder->mInputSource = nullptr;
  487
+			delete decoder, decoder = nullptr;
488 488
 		}
489 489
 	}
490  
-	if(NULL == decoder && MonkeysAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
  490
+	if(nullptr == decoder && MonkeysAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
491 491
 		decoder = new MonkeysAudioDecoder(inputSource);
492 492
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
493  
-			decoder->mInputSource = NULL;
494  
-			delete decoder, decoder = NULL;
  493
+			decoder->mInputSource = nullptr;
  494
+			delete decoder, decoder = nullptr;
495 495
 		}
496 496
 	}
497 497
 #endif
498  
-	if(NULL == decoder && OggSpeexDecoder::HandlesFilesWithExtension(pathExtension)) {
  498
+	if(nullptr == decoder && OggSpeexDecoder::HandlesFilesWithExtension(pathExtension)) {
499 499
 		decoder = new OggSpeexDecoder(inputSource);
500 500
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
501  
-			decoder->mInputSource = NULL;
502  
-			delete decoder, decoder = NULL;
  501
+			decoder->mInputSource = nullptr;
  502
+			delete decoder, decoder = nullptr;
503 503
 		}
504 504
 	}
505 505
 #if !TARGET_OS_IPHONE
506  
-	if(NULL == decoder && MODDecoder::HandlesFilesWithExtension(pathExtension)) {
  506
+	if(nullptr == decoder && MODDecoder::HandlesFilesWithExtension(pathExtension)) {
507 507
 		decoder = new MODDecoder(inputSource);
508 508
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
509  
-			decoder->mInputSource = NULL;
510  
-			delete decoder, decoder = NULL;
  509
+			decoder->mInputSource = nullptr;
  510
+			delete decoder, decoder = nullptr;
511 511
 		}
512 512
 	}
513  
-	if(NULL == decoder && TrueAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
  513
+	if(nullptr == decoder && TrueAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
514 514
 		decoder = new TrueAudioDecoder(inputSource);
515 515
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
516  
-			decoder->mInputSource = NULL;
517  
-			delete decoder, decoder = NULL;
  516
+			decoder->mInputSource = nullptr;
  517
+			delete decoder, decoder = nullptr;
518 518
 		}
519 519
 	}
520 520
 #endif
521  
-	if(NULL == decoder && LibsndfileDecoder::HandlesFilesWithExtension(pathExtension)) {
  521
+	if(nullptr == decoder && LibsndfileDecoder::HandlesFilesWithExtension(pathExtension)) {
522 522
 		decoder = new LibsndfileDecoder(inputSource);
523 523
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
524  
-			decoder->mInputSource = NULL;
525  
-			delete decoder, decoder = NULL;
  524
+			decoder->mInputSource = nullptr;
  525
+			delete decoder, decoder = nullptr;
526 526
 		}
527 527
 	}
528  
-	if(NULL == decoder && CoreAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
  528
+	if(nullptr == decoder && CoreAudioDecoder::HandlesFilesWithExtension(pathExtension)) {
529 529
 		decoder = new CoreAudioDecoder(inputSource);
530 530
 		if(AutomaticallyOpenDecoders() && !decoder->Open(error)) {
531  
-			decoder->mInputSource = NULL;
532  
-			delete decoder, decoder = NULL;
  531
+			decoder->mInputSource = nullptr;
  532
+			delete decoder, decoder = nullptr;
533 533
 		}
534 534
 	}
535 535
 
536  
-	CFRelease(pathExtension), pathExtension = NULL;
  536
+	CFRelease(pathExtension), pathExtension = nullptr;
537 537
 
538 538
 	return decoder;
539 539
 }
540 540
 
541 541
 AudioDecoder * AudioDecoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, CFErrorRef *error)
542 542
 {
543  
-	if(NULL == url)
544  
-		return NULL;
  543
+	if(nullptr == url)
  544
+		return nullptr;
545 545
 
546 546
 	InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error);
547 547
 
548  
-	if(NULL == inputSource)
549  
-		return NULL;
  548
+	if(nullptr == inputSource)
  549
+		return nullptr;
550 550
 
551 551
 	AudioDecoder *decoder = CreateDecoderForInputSourceRegion(inputSource, startingFrame, error);
552 552
 
553  
-	if(NULL == decoder)
554  
-		delete inputSource, inputSource = NULL;
  553
+	if(nullptr == decoder)
  554
+		delete inputSource, inputSource = nullptr;
555 555
 
556 556
 	return decoder;
557 557
 }
558 558
 
559 559
 AudioDecoder * AudioDecoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, UInt32 frameCount, CFErrorRef *error)
560 560
 {
561  
-	if(NULL == url)
562  
-		return NULL;
  561
+	if(nullptr == url)
  562
+		return nullptr;
563 563
 
564 564
 	InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error);
565 565
 
566  
-	if(NULL == inputSource)
567  
-		return NULL;
  566
+	if(nullptr == inputSource)
  567
+		return nullptr;
568 568
 
569 569
 	AudioDecoder *decoder = CreateDecoderForInputSourceRegion(inputSource, startingFrame, frameCount, error);
570 570
 
571  
-	if(NULL == decoder)
572  
-		delete inputSource, inputSource = NULL;
  571
+	if(nullptr == decoder)
  572
+		delete inputSource, inputSource = nullptr;
573 573
 
574 574
 	return decoder;
575 575
 }
576 576
 
577 577
 AudioDecoder * AudioDecoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, UInt32 frameCount, UInt32 repeatCount, CFErrorRef *error)
578 578
 {
579  
-	if(NULL == url)
580  
-		return NULL;
  579
+	if(nullptr == url)
  580
+		return nullptr;
581 581
 
582 582
 	InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error);
583 583
 
584  
-	if(NULL == inputSource)
585  
-		return NULL;
  584
+	if(nullptr == inputSource)
  585
+		return nullptr;
586 586
 
587 587
 	AudioDecoder *decoder = CreateDecoderForInputSourceRegion(inputSource, startingFrame, frameCount, repeatCount, error);
588 588
 
589  
-	if(NULL == decoder)
590  
-		delete inputSource, inputSource = NULL;
  589
+	if(nullptr == decoder)
  590
+		delete inputSource, inputSource = nullptr;
591 591
 
592 592
 	return decoder;
593 593
 }
594 594
 
595 595
 AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inputSource, SInt64 startingFrame, CFErrorRef *error)
596 596
 {
597  
-	if(NULL == inputSource)
598  
-		return NULL;
  597
+	if(nullptr == inputSource)
  598
+		return nullptr;
599 599
 
600 600
 	if(!inputSource->SupportsSeeking())
601  
-		return NULL;
  601
+		return nullptr;
602 602
 
603 603
 	AudioDecoder *decoder = CreateDecoderForInputSource(inputSource, error);
604 604
 
605  
-	if(NULL == decoder)
606  
-		return NULL;
  605
+	if(nullptr == decoder)
  606
+		return nullptr;
607 607
 
608 608
 	if(!decoder->SupportsSeeking()) {
609  
-		delete decoder, decoder = NULL;
610  
-		return NULL;
  609
+		delete decoder, decoder = nullptr;
  610
+		return nullptr;
611 611
 	}
612 612
 
613 613
 	AudioDecoder *regionDecoder = CreateDecoderForDecoderRegion(decoder, startingFrame, error);
614 614
 
615  
-	if(NULL == regionDecoder) {
616  
-		delete decoder, decoder = NULL;
617  
-		return NULL;
  615
+	if(nullptr == regionDecoder) {
  616
+		delete decoder, decoder = nullptr;
  617
+		return nullptr;
618 618
 	}
619 619
 
620 620
 	return regionDecoder;
@@ -622,27 +622,27 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inpu
622 622
 
623 623
 AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inputSource, SInt64 startingFrame, UInt32 frameCount, CFErrorRef *error)
624 624
 {
625  
-	if(NULL == inputSource)
626  
-		return NULL;
  625
+	if(nullptr == inputSource)
  626
+		return nullptr;
627 627
 
628 628
 	if(!inputSource->SupportsSeeking())
629  
-		return NULL;
  629
+		return nullptr;
630 630
 
631 631
 	AudioDecoder *decoder = CreateDecoderForInputSource(inputSource, error);
632 632
 
633  
-	if(NULL == decoder)
634  
-		return NULL;
  633
+	if(nullptr == decoder)
  634
+		return nullptr;
635 635
 
636 636
 	if(!decoder->SupportsSeeking()) {
637  
-		delete decoder, decoder = NULL;
638  
-		return NULL;
  637
+		delete decoder, decoder = nullptr;
  638
+		return nullptr;
639 639
 	}
640 640
 
641 641
 	AudioDecoder *regionDecoder = CreateDecoderForDecoderRegion(decoder, startingFrame, frameCount, error);
642 642
 
643  
-	if(NULL == regionDecoder) {
644  
-		delete decoder, decoder = NULL;
645  
-		return NULL;
  643
+	if(nullptr == regionDecoder) {
  644
+		delete decoder, decoder = nullptr;
  645
+		return nullptr;
646 646
 	}
647 647
 
648 648
 	return regionDecoder;
@@ -650,27 +650,27 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inpu
650 650
 
651 651
 AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inputSource, SInt64 startingFrame, UInt32 frameCount, UInt32 repeatCount, CFErrorRef *error)
652 652
 {
653  
-	if(NULL == inputSource)
654  
-		return NULL;
  653
+	if(nullptr == inputSource)
  654
+		return nullptr;
655 655
 
656 656
 	if(!inputSource->SupportsSeeking())
657  
-		return NULL;
  657
+		return nullptr;
658 658
 
659 659
 	AudioDecoder *decoder = CreateDecoderForInputSource(inputSource, error);
660 660
 
661  
-	if(NULL == decoder)
662  
-		return NULL;
  661
+	if(nullptr == decoder)
  662
+		return nullptr;
663 663
 
664 664
 	if(!decoder->SupportsSeeking()) {
665  
-		delete decoder, decoder = NULL;
666  
-		return NULL;
  665
+		delete decoder, decoder = nullptr;
  666
+		return nullptr;
667 667
 	}
668 668
 
669 669
 	AudioDecoder *regionDecoder = CreateDecoderForDecoderRegion(decoder, startingFrame, frameCount, repeatCount, error);
670 670
 
671  
-	if(NULL == regionDecoder) {
672  
-		delete decoder, decoder = NULL;
673  
-		return NULL;
  671
+	if(nullptr == regionDecoder) {
  672
+		delete decoder, decoder = nullptr;
  673
+		return nullptr;
674 674
 	}
675 675
 
676 676
 	return regionDecoder;
@@ -678,33 +678,33 @@ AudioDecoder * AudioDecoder::CreateDecoderForInputSourceRegion(InputSource *inpu
678 678
 
679 679
 AudioDecoder * AudioDecoder::CreateDecoderForDecoderRegion(AudioDecoder *decoder, SInt64 startingFrame, CFErrorRef */*error*/)
680 680
 {
681  
-	if(NULL == decoder)
682  
-		return NULL;
  681
+	if(nullptr == decoder)
  682
+		return nullptr;
683 683
 	
684 684
 	if(!decoder->SupportsSeeking())
685  
-		return NULL;
  685
+		return nullptr;
686 686
 	
687 687
 	return new LoopableRegionDecoder(decoder, startingFrame);
688 688
 }
689 689
 
690 690
 AudioDecoder * AudioDecoder::CreateDecoderForDecoderRegion(AudioDecoder *decoder, SInt64 startingFrame, UInt32 frameCount, CFErrorRef */*error*/)
691 691
 {
692  
-	if(NULL == decoder)
693  
-		return NULL;
  692
+	if(nullptr == decoder)
  693
+		return nullptr;
694 694
 	
695 695
 	if(!decoder->SupportsSeeking())
696  
-		return NULL;
  696
+		return nullptr;
697 697
 	
698 698
 	return new LoopableRegionDecoder(decoder, startingFrame, frameCount);
699 699
 }
700 700
 
701 701
 AudioDecoder * AudioDecoder::CreateDecoderForDecoderRegion(AudioDecoder *decoder, SInt64 startingFrame, UInt32 frameCount, UInt32 repeatCount, CFErrorRef *)
702 702
 {
703  
-	if(NULL == decoder)
704  
-		return NULL;
  703
+	if(nullptr == decoder)
  704
+		return nullptr;
705 705
 	
706 706
 	if(!decoder->SupportsSeeking())
707  
-		return NULL;
  707
+		return nullptr;
708 708
 	
709 709
 	return new LoopableRegionDecoder(decoder, startingFrame, frameCount, repeatCount);
710 710
 }
@@ -712,16 +712,16 @@ AudioDecoder * AudioDecoder::CreateDecoderForDecoderRegion(AudioDecoder *decoder
712 712
 #pragma mark Creation and Destruction
713 713
 
714 714
 AudioDecoder::AudioDecoder()
715  
-	: mInputSource(NULL), mChannelLayout(NULL), mIsOpen(false)
  715
+	: mInputSource(nullptr), mChannelLayout(nullptr), mIsOpen(false)
716 716
 {
717 717
 	memset(&mCallbacks, 0, sizeof(mCallbacks));
718 718
 	memset(&mSourceFormat, 0, sizeof(mSourceFormat));
719 719
 }
720 720
 
721 721
 AudioDecoder::AudioDecoder(InputSource *inputSource)
722  
-	: mInputSource(inputSource), mChannelLayout(NULL), mIsOpen(false)
  722
+	: mInputSource(inputSource), mChannelLayout(nullptr), mIsOpen(false)
723 723
 {
724  
-	assert(NULL != inputSource);
  724
+	assert(nullptr != inputSource);
725 725
 
726 726
 	memset(&mCallbacks, 0, sizeof(mCallbacks));
727 727
 	memset(&mFormat, 0, sizeof(mSourceFormat));
@@ -729,7 +729,7 @@ AudioDecoder::AudioDecoder(InputSource *inputSource)
729 729
 }
730 730
 
731 731
 AudioDecoder::AudioDecoder(const AudioDecoder& rhs)
732  
-	: mInputSource(NULL), mChannelLayout(NULL), mIsOpen(false)
  732
+	: mInputSource(nullptr), mChannelLayout(nullptr), mIsOpen(false)
733 733
 {
734 734
 	*this = rhs;
735 735
 }
@@ -737,10 +737,10 @@ AudioDecoder::AudioDecoder(const AudioDecoder& rhs)
737 737
 AudioDecoder::~AudioDecoder()
738 738
 {
739 739
 	if(mInputSource)
740  
-		delete mInputSource, mInputSource = NULL;
  740
+		delete mInputSource, mInputSource = nullptr;
741 741