]> git.sesse.net Git - bmusb/blobdiff - bmusb/bmusb.h
Make FakeCapture capable of outputting audio (a simple sine tone).
[bmusb] / bmusb / bmusb.h
index 506685dc4c6a7401d17143cdb611315981c7b187..f4af6aa14b2a1399168d3f75673b1d2215846770 100644 (file)
@@ -175,6 +175,10 @@ class BMUSBCapture : public CaptureInterface {
 
        ~BMUSBCapture() {}
 
+       // Note: Cards could be unplugged and replugged between this call and
+       // actually opening the card (in configure_card()).
+       static unsigned num_cards();
+
        std::map<uint32_t, VideoMode> get_available_video_modes() const override;
        uint32_t get_current_video_mode() const override;
        void set_video_mode(uint32_t video_mode_id) override;
@@ -251,9 +255,11 @@ class BMUSBCapture : public CaptureInterface {
        // The callback function transfers ownership. If you don't want to hold
        // on to the device given to you in the callback, you need to call
        // libusb_unref_device().
-       static void set_card_connected_callback(card_connected_callback_t callback)
+       static void set_card_connected_callback(card_connected_callback_t callback,
+                                               bool hotplug_existing_devices_arg = false)
        {
                card_connected_callback = callback;
+               hotplug_existing_devices = hotplug_existing_devices_arg;
        }
 
        // Similar to set_card_connected_callback(), with the same caveats.
@@ -299,6 +305,7 @@ class BMUSBCapture : public CaptureInterface {
        std::unique_ptr<FrameAllocator> owned_audio_frame_allocator;
        frame_callback_t frame_callback = nullptr;
        static card_connected_callback_t card_connected_callback;
+       static bool hotplug_existing_devices;
        card_disconnected_callback_t card_disconnected_callback = nullptr;
 
        std::thread dequeue_thread;