///////////////////////////////////////////////////////
| 110 | |
| 111 | //////////////////////////////////////////////////////////// |
| 112 | bool Music::openFromFile(const std::filesystem::path& filename) |
| 113 | { |
| 114 | // First stop the music if it was already running |
| 115 | stop(); |
| 116 | |
| 117 | // Open the underlying sound file |
| 118 | if (!m_impl->file.openFromFile(filename)) |
| 119 | { |
| 120 | err() << "Failed to open music from file" << std::endl; |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | // Perform common initializations |
| 125 | m_impl->initialize(); |
| 126 | |
| 127 | // Initialize the stream |
| 128 | SoundStream::initialize(m_impl->file.getChannelCount(), m_impl->file.getSampleRate(), m_impl->file.getChannelMap()); |
| 129 | |
| 130 | return true; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | //////////////////////////////////////////////////////////// |
no test coverage detected