///////////////////////////////////////////////////////
| 156 | |
| 157 | //////////////////////////////////////////////////////////// |
| 158 | bool Music::openFromStream(InputStream& stream) |
| 159 | { |
| 160 | // First stop the music if it was already running |
| 161 | stop(); |
| 162 | |
| 163 | // Open the underlying sound file |
| 164 | if (!m_impl->file.openFromStream(stream)) |
| 165 | { |
| 166 | err() << "Failed to open music from stream" << std::endl; |
| 167 | return false; |
| 168 | } |
| 169 | |
| 170 | // Perform common initializations |
| 171 | m_impl->initialize(); |
| 172 | |
| 173 | // Initialize the stream |
| 174 | SoundStream::initialize(m_impl->file.getChannelCount(), m_impl->file.getSampleRate(), m_impl->file.getChannelMap()); |
| 175 | |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | |
| 180 | //////////////////////////////////////////////////////////// |
no test coverage detected