1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-19 15:11:23 +01:00
Files
audacity/src/DeviceChange.h
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00

64 lines
1.2 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
DeviceChange.h
Leland Lucius
**********************************************************************/
#ifndef __AUDACITY_DEVICECHANGE_H__
#define __AUDACITY_DEVICECHANGE_H__
#include "Audacity.h" // for HAVE_LIBUDEV_H
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
#include "MemoryX.h"
#if defined(__WXMSW__) || defined(__WXMAC__) || defined(HAVE_LIBUDEV_H)
#define HAVE_DEVICE_CHANGE
#endif
#if defined(HAVE_DEVICE_CHANGE)
#include <wx/timer.h> // member variable
class DeviceChangeInterface /* not final */
{
public:
virtual ~DeviceChangeInterface() {};
virtual bool SetHandler(wxEvtHandler *handler) = 0;
virtual void Enable(bool enable = true) = 0;
};
class DeviceChangeHandler : public wxEvtHandler
{
public:
DeviceChangeHandler();
virtual ~DeviceChangeHandler();
void Enable(bool enable = true);
virtual void DeviceChangeNotification() = 0;
private:
void OnChange(wxCommandEvent & evt);
void OnTimer(wxTimerEvent & evt);
std::unique_ptr<DeviceChangeInterface> mListener;
wxTimer mTimer;
DECLARE_EVENT_TABLE()
};
#endif
#endif
#endif