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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Document notification | 119 // Document notification |
120 void contextDestroyed(ExecutionContext*) final; | 120 void contextDestroyed(ExecutionContext*) final; |
121 bool hasPendingActivity() const final; | 121 bool hasPendingActivity() const final; |
122 | 122 |
123 // Cannnot be called from the audio thread. | 123 // Cannnot be called from the audio thread. |
124 AudioDestinationNode* destination() const; | 124 AudioDestinationNode* destination() const; |
125 | 125 |
126 size_t currentSampleFrame() const { | 126 size_t currentSampleFrame() const { |
127 // TODO: What is the correct value for the current frame if the destination | 127 // TODO: What is the correct value for the current frame if the destination |
128 // node has gone away? 0 is a valid frame. | 128 // node has gone away? 0 is a valid frame. |
129 return m_destinationNode | 129 return m_destinationNode ? m_destinationNode->audioDestinationHandler() |
130 ? m_destinationNode->audioDestinationHandler() | 130 .currentSampleFrame() |
131 .currentSampleFrame() | 131 : 0; |
132 : 0; | |
133 } | 132 } |
134 | 133 |
135 double currentTime() const { | 134 double currentTime() const { |
136 // TODO: What is the correct value for the current time if the destination | 135 // TODO: What is the correct value for the current time if the destination |
137 // node has gone away? 0 is a valid time. | 136 // node has gone away? 0 is a valid time. |
138 return m_destinationNode | 137 return m_destinationNode |
139 ? m_destinationNode->audioDestinationHandler().currentTime() | 138 ? m_destinationNode->audioDestinationHandler().currentTime() |
140 : 0; | 139 : 0; |
141 } | 140 } |
142 | 141 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // It is somewhat arbitrary and could be increased if necessary. | 475 // It is somewhat arbitrary and could be increased if necessary. |
477 enum { MaxNumberOfChannels = 32 }; | 476 enum { MaxNumberOfChannels = 32 }; |
478 | 477 |
479 Optional<AutoplayStatus> m_autoplayStatus; | 478 Optional<AutoplayStatus> m_autoplayStatus; |
480 AudioIOPosition m_outputPosition; | 479 AudioIOPosition m_outputPosition; |
481 }; | 480 }; |
482 | 481 |
483 } // namespace blink | 482 } // namespace blink |
484 | 483 |
485 #endif // BaseAudioContext_h | 484 #endif // BaseAudioContext_h |
OLD | NEW |