MCPcopy Create free account
hub / github.com/SFML/SFML / openFromFile

Method openFromFile

src/SFML/Audio/Music.cpp:112–131  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

110
111////////////////////////////////////////////////////////////
112bool 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////////////////////////////////////////////////////////////

Callers 10

Font.test.cppFile · 0.45
Music.test.cppFile · 0.45
loadFromFileMethod · 0.45
saveToFileMethod · 0.45
SurroundMethod · 0.45
PitchVolumeMethod · 0.45
AttenuationMethod · 0.45
ProcessingMethod · 0.45

Calls 4

initializeFunction · 0.85
initializeMethod · 0.45
getChannelCountMethod · 0.45
getSampleRateMethod · 0.45

Tested by

no test coverage detected