summaryrefslogtreecommitdiffstats
path: root/libmpv/wxwidgets/main.h
blob: db5fa550d78931493da6789b144432a30e7f44a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include <mpv/client.h>

class MpvApp : public wxApp
{
public:
    bool OnInit() override;
};

class MpvFrame : public wxFrame
{
public:
    MpvFrame();
    
    bool Destroy() override;
    bool Autofit(int percent, bool larger = true, bool smaller = true);

private:
    void MpvCreate(int64_t wid);
    void MpvDestroy();

    void OnKeyDown(wxKeyEvent &event);
    void OnDropFiles(wxDropFilesEvent &event);

    void OnMpvEvent(mpv_event &event);
    void OnMpvWakeupEvent(wxThreadEvent &event);

    mpv_handle *mpv = nullptr;
    
    wxDECLARE_EVENT_TABLE();
};