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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Document notification | 96 // Document notification |
97 virtual void stop(); | 97 virtual void stop(); |
98 | 98 |
99 Document* document() const; // ASSERTs if document no longer exists. | 99 Document* document() const; // ASSERTs if document no longer exists. |
100 bool hasDocument(); | 100 bool hasDocument(); |
101 | 101 |
102 AudioDestinationNode* destination() { return m_destinationNode.get(); } | 102 AudioDestinationNode* destination() { return m_destinationNode.get(); } |
103 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF
rame(); } | 103 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF
rame(); } |
104 double currentTime() const { return m_destinationNode->currentTime(); } | 104 double currentTime() const { return m_destinationNode->currentTime(); } |
105 float sampleRate() const { return m_destinationNode->sampleRate(); } | 105 float sampleRate() const { return m_destinationNode->sampleRate(); } |
106 unsigned long activeSourceCount() const { return static_cast<unsigned long>(
m_activeSourceCount); } | 106 // FIXME: Is this cast safe (what if m_activeSourceCount is negative...) |
| 107 unsigned activeSourceCount() const { return static_cast<unsigned>(m_activeSo
urceCount); } |
107 | 108 |
108 void incrementActiveSourceCount(); | 109 void incrementActiveSourceCount(); |
109 void decrementActiveSourceCount(); | 110 void decrementActiveSourceCount(); |
110 | 111 |
111 PassRefPtr<AudioBuffer> createBuffer(unsigned numberOfChannels, size_t numbe
rOfFrames, float sampleRate, ExceptionState&); | 112 PassRefPtr<AudioBuffer> createBuffer(unsigned numberOfChannels, size_t numbe
rOfFrames, float sampleRate, ExceptionState&); |
112 PassRefPtr<AudioBuffer> createBuffer(ArrayBuffer*, bool mixToMono, Exception
State&); | 113 PassRefPtr<AudioBuffer> createBuffer(ArrayBuffer*, bool mixToMono, Exception
State&); |
113 | 114 |
114 // Asynchronous audio file data decoding. | 115 // Asynchronous audio file data decoding. |
115 void decodeAudioData(ArrayBuffer*, PassRefPtr<AudioBufferCallback>, PassRefP
tr<AudioBufferCallback>, ExceptionState&); | 116 void decodeAudioData(ArrayBuffer*, PassRefPtr<AudioBufferCallback>, PassRefP
tr<AudioBufferCallback>, ExceptionState&); |
116 | 117 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // It is somewhat arbitrary and could be increased if necessary. | 347 // It is somewhat arbitrary and could be increased if necessary. |
347 enum { MaxNumberOfChannels = 32 }; | 348 enum { MaxNumberOfChannels = 32 }; |
348 | 349 |
349 // Number of AudioBufferSourceNodes that are active (playing). | 350 // Number of AudioBufferSourceNodes that are active (playing). |
350 int m_activeSourceCount; | 351 int m_activeSourceCount; |
351 }; | 352 }; |
352 | 353 |
353 } // WebCore | 354 } // WebCore |
354 | 355 |
355 #endif // AudioContext_h | 356 #endif // AudioContext_h |
OLD | NEW |