Commit 9c64fb89 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

main.cpp: Move some parts around

parent 42275c9b
...@@ -34,24 +34,13 @@ int main(int ac, char** av) ...@@ -34,24 +34,13 @@ int main(int ac, char** av)
} }
auto instance = VLC::Instance(0, nullptr); auto instance = VLC::Instance(0, nullptr);
auto audioFilters = instance.audioFilterList();
for (const auto& f : audioFilters)
{
std::cout << f.name() << std::endl;
}
auto media = VLC::Media(instance, av[1], VLC::Media::FromPath); auto media = VLC::Media(instance, av[1], VLC::Media::FromPath);
auto mp = VLC::MediaPlayer(media); auto mp = VLC::MediaPlayer(media);
auto eventManager = mp.eventManager(); auto eventManager = mp.eventManager();
eventManager.onPlaying([&media]() { eventManager.onPlaying([&media]() {
std::cout << media.mrl() << " is playing" << std::endl; std::cout << media.mrl() << " is playing" << std::endl;
}); });
/*
* Should trigger static_assert:
*
* eventManager->onPlaying([](std::string){});
* eventManager->onPlaying([] { return 0;} );
*/
mp.play(); mp.play();
bool expected = true; bool expected = true;
...@@ -115,4 +104,11 @@ int main(int ac, char** av) ...@@ -115,4 +104,11 @@ int main(int ac, char** av)
// by leaving the scope, it won't be unregistered from mp2's eventManager. // by leaving the scope, it won't be unregistered from mp2's eventManager.
// If it did, libvlc would assert as the event has been unregistered already. // If it did, libvlc would assert as the event has been unregistered already.
mp.eventManager().unregister(h3); mp.eventManager().unregister(h3);
// List audio filters
auto audioFilters = instance.audioFilterList();
for (const auto& f : audioFilters)
{
std::cout << f.name() << std::endl;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment