Audacity 3.2.0
RunLoop.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file RunLoop.h
6
7 @author Vitaly Sverchinsky
8
9 @brief Part of Audacity VST3 module
10
11**********************************************************************/
12
13#pragma once
14
15#include <vector>
16#include <memory>
17#include <gtk/gtk.h>
18#include <gdk/gdkx.h>
19#include <gdk/gdk.h>
20
21#include <pluginterfaces/gui/iplugview.h>
22
23namespace internal
24{
25
26namespace x11
27{
28
29class RunLoop : public Steinberg::Linux::IRunLoop
30{
31 struct EventHandler;
32 struct TimerHandler;
33
34 std::vector<std::unique_ptr<EventHandler>> mEventHandlers;
35 std::vector<std::unique_ptr<TimerHandler>> mTimerHandlers;
36
37 Display* mDisplay { nullptr };
38
39 static gboolean OnEvent(GIOChannel *source, GIOCondition condition, gpointer data);
40
41 static gboolean OnTimer(gpointer data);
42
43public:
44 RunLoop(::Display* display);
45 virtual ~RunLoop();
46
47 Steinberg::tresult PLUGIN_API registerEventHandler(
48 Steinberg::Linux::IEventHandler* handler,
49 Steinberg::Linux::FileDescriptor fd) override;
50
51 Steinberg::tresult PLUGIN_API unregisterEventHandler(
52 Steinberg::Linux::IEventHandler* handler) override;
53
54 Steinberg::tresult PLUGIN_API registerTimer (Steinberg::Linux::ITimerHandler* handler,
55 Steinberg::Linux::TimerInterval milliseconds) override;
56
57 Steinberg::tresult PLUGIN_API unregisterTimer (Steinberg::Linux::ITimerHandler* handler) override;
58
59 DECLARE_FUNKNOWN_METHODS
60};
61
62}
63
64}
Steinberg::tresult PLUGIN_API registerEventHandler(Steinberg::Linux::IEventHandler *handler, Steinberg::Linux::FileDescriptor fd) override
Definition: RunLoop.cpp:71
Display * mDisplay
Definition: RunLoop.h:37
Steinberg::tresult PLUGIN_API unregisterEventHandler(Steinberg::Linux::IEventHandler *handler) override
Definition: RunLoop.cpp:101
RunLoop(::Display *display)
Definition: RunLoop.cpp:60
std::vector< std::unique_ptr< EventHandler > > mEventHandlers
Definition: RunLoop.h:32
static gboolean OnEvent(GIOChannel *source, GIOCondition condition, gpointer data)
Definition: RunLoop.cpp:46
std::vector< std::unique_ptr< TimerHandler > > mTimerHandlers
Definition: RunLoop.h:35
Steinberg::tresult PLUGIN_API registerTimer(Steinberg::Linux::ITimerHandler *handler, Steinberg::Linux::TimerInterval milliseconds) override
Definition: RunLoop.cpp:117
Steinberg::tresult PLUGIN_API unregisterTimer(Steinberg::Linux::ITimerHandler *handler) override
Definition: RunLoop.cpp:134
static gboolean OnTimer(gpointer data)
Definition: RunLoop.cpp:53