| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 : m_length(0) | 66 : m_length(0) |
| 67 , m_rawPointer(nullptr) | 67 , m_rawPointer(nullptr) |
| 68 , m_silent(true) | 68 , m_silent(true) |
| 69 { | 69 { |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Redefine the memory for this channel. | 72 // Redefine the memory for this channel. |
| 73 // storage represents external memory not managed by this object. | 73 // storage represents external memory not managed by this object. |
| 74 void set(float* storage, size_t length) | 74 void set(float* storage, size_t length) |
| 75 { | 75 { |
| 76 m_memBuffer.clear(); // cleanup managed storage | 76 m_memBuffer.reset(); // cleanup managed storage |
| 77 m_rawPointer = storage; | 77 m_rawPointer = storage; |
| 78 m_length = length; | 78 m_length = length; |
| 79 m_silent = false; | 79 m_silent = false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // How many sample-frames do we contain? | 82 // How many sample-frames do we contain? |
| 83 size_t length() const { return m_length; } | 83 size_t length() const { return m_length; } |
| 84 | 84 |
| 85 // resizeSmaller() can only be called with a new length <= the current lengt
h. | 85 // resizeSmaller() can only be called with a new length <= the current lengt
h. |
| 86 // The data stored in the bus will remain undisturbed. | 86 // The data stored in the bus will remain undisturbed. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 size_t m_length; | 133 size_t m_length; |
| 134 | 134 |
| 135 float* m_rawPointer; | 135 float* m_rawPointer; |
| 136 OwnPtr<AudioFloatArray> m_memBuffer; | 136 OwnPtr<AudioFloatArray> m_memBuffer; |
| 137 bool m_silent; | 137 bool m_silent; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace blink | 140 } // namespace blink |
| 141 | 141 |
| 142 #endif // AudioChannel_h | 142 #endif // AudioChannel_h |
| OLD | NEW |