OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #include "wtf/ArrayBuffer.h" | 71 #include "wtf/ArrayBuffer.h" |
72 #include "wtf/Atomics.h" | 72 #include "wtf/Atomics.h" |
73 #include "wtf/PassOwnPtr.h" | 73 #include "wtf/PassOwnPtr.h" |
74 #include "wtf/text/WTFString.h" | 74 #include "wtf/text/WTFString.h" |
75 | 75 |
76 // FIXME: check the proper way to reference an undefined thread ID | 76 // FIXME: check the proper way to reference an undefined thread ID |
77 const WTF::ThreadIdentifier UndefinedThreadIdentifier = 0xffffffff; | 77 const WTF::ThreadIdentifier UndefinedThreadIdentifier = 0xffffffff; |
78 | 78 |
79 namespace blink { | 79 namespace blink { |
80 | 80 |
81 bool AudioContext::isSampleRateRangeGood(float sampleRate) | |
82 { | |
83 return sampleRate >= AudioBuffer::minAllowedSampleRate() && sampleRate <= Au
dioBuffer::maxAllowedSampleRate(); | |
84 } | |
85 | |
86 // Don't allow more than this number of simultaneous AudioContexts talking to ha
rdware. | 81 // Don't allow more than this number of simultaneous AudioContexts talking to ha
rdware. |
87 const unsigned MaxHardwareContexts = 6; | 82 const unsigned MaxHardwareContexts = 6; |
88 unsigned AudioContext::s_hardwareContextCount = 0; | 83 unsigned AudioContext::s_hardwareContextCount = 0; |
89 | 84 |
90 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) | 85 AudioContext* AudioContext::create(Document& document, ExceptionState& exception
State) |
91 { | 86 { |
92 ASSERT(isMainThread()); | 87 ASSERT(isMainThread()); |
93 if (s_hardwareContextCount >= MaxHardwareContexts) { | 88 if (s_hardwareContextCount >= MaxHardwareContexts) { |
94 exceptionState.throwDOMException( | 89 exceptionState.throwDOMException( |
95 SyntaxError, | 90 SyntaxError, |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 909 |
915 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) | 910 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) |
916 (*k)->updateChannelCountMode(); | 911 (*k)->updateChannelCountMode(); |
917 | 912 |
918 m_deferredCountModeChange.clear(); | 913 m_deferredCountModeChange.clear(); |
919 } | 914 } |
920 | 915 |
921 } // namespace blink | 916 } // namespace blink |
922 | 917 |
923 #endif // ENABLE(WEB_AUDIO) | 918 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |