OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionCode& ec) | 112 void DefaultAudioDestinationNode::setChannelCount(unsigned long channelCount, Ex
ceptionCode& ec) |
113 { | 113 { |
114 // The channelCount for the input to this node controls the actual number of
channels we | 114 // The channelCount for the input to this node controls the actual number of
channels we |
115 // send to the audio hardware. It can only be set depending on the maximum n
umber of | 115 // send to the audio hardware. It can only be set depending on the maximum n
umber of |
116 // channels supported by the hardware. | 116 // channels supported by the hardware. |
117 | 117 |
118 ASSERT(isMainThread()); | 118 ASSERT(isMainThread()); |
119 | 119 |
120 if (!maxChannelCount() || channelCount > maxChannelCount()) { | 120 if (!maxChannelCount() || channelCount > maxChannelCount()) { |
121 ec = INVALID_STATE_ERR; | 121 ec = InvalidStateError; |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 unsigned long oldChannelCount = this->channelCount(); | 125 unsigned long oldChannelCount = this->channelCount(); |
126 AudioNode::setChannelCount(channelCount, ec); | 126 AudioNode::setChannelCount(channelCount, ec); |
127 | 127 |
128 if (!ec && this->channelCount() != oldChannelCount && isInitialized()) { | 128 if (!ec && this->channelCount() != oldChannelCount && isInitialized()) { |
129 // Re-create destination. | 129 // Re-create destination. |
130 m_destination->stop(); | 130 m_destination->stop(); |
131 createDestination(); | 131 createDestination(); |
132 m_destination->start(); | 132 m_destination->start(); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 } // namespace WebCore | 136 } // namespace WebCore |
137 | 137 |
138 #endif // ENABLE(WEB_AUDIO) | 138 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |