OSDN Git Service

[EMU][OSD][WIP] Add MIDI feature; this still be skelton.
[csp-qt/common_source_project-fm7.git] / source / src / qt / osd_midi.cpp
1 /*
2         Skelton for retropc emulator
3
4         Author : K.Ohta <whatisthis.sowhat _at_ gmail.com>
5         Date   : 202301.18-
6
7         [Qt/libPortMidi MIDI ]
8 */
9 #include "../emu.h"
10 #include "../fifo.h"
11 #include "../types/util_sound.h"
12 #include "../types/util_endians.h"
13
14 #include "qt_main.h"
15 #include "gui/menu_flags.h"
16
17 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
18 #include <QApplication>
19 #endif
20
21 #include <cstdint>
22
23 // Note: Will implement real body.
24 void OSD_BASE::initialize_midi()
25 {
26 }
27
28 void OSD_BASE::release_midi()
29 {
30 }
31
32 void OSD_BASE::send_to_midi(uint8_t data, int ch, double timestamp_usec)
33 {
34         // Need to convert timestamp_usec to relative mSec.
35 }
36
37 bool OSD_BASE::recv_from_midi(uint8_t* data, int ch, double timestamp_usec)
38 {
39         // Need to convert timestamp_usec to relative mSec.
40         return false;
41 }
42
43 bool OSD_BASE::send_to_midi_timeout(uint8_t data, int ch, uint64_t timeout_ms, double timestamp_usec)
44 {
45         // Need to convert timestamp_usec to relative mSec.
46         return false;
47 }
48
49 bool OSD_BASE::recv_from_midi_timeout(uint8_t* data, int ch, uint64_t timeout_ms, double timestamp_usec)
50 {
51         // Need to convert timestamp_usec to relative mSec.
52         return false;
53 }
54
55 void OSD_BASE::notify_timeout_sending_to_midi(int ch)
56 {
57         if(vm != nullptr) {
58                 vm->notify_timeout_sending_to_midi(ch);
59         }
60 }
61
62 void OSD_BASE::notify_timeout_receiving_from_midi(int ch)
63 {
64         if(vm != nullptr) {
65                 vm->notify_timeout_receiving_from_midi(ch);
66         }
67 }
68
69 void OSD_BASE::reset_to_midi(int ch, double timestamp_usec)
70 {
71         //ToDo: Will implement.
72 }
73
74 void OSD_BASE::initialize_midi_device(bool handshake_from_midi, bool handshake_to_midi, int ch)
75 {
76         //ToDo: Will implement.
77 }
78
79 void OSD_BASE::ready_receive_from_midi(int ch, double timestamp_usec)
80 {
81         if(vm != nullptr) {
82                 vm->ready_receive_from_midi(ch, timestamp_usec);
83         }
84 }
85
86 void OSD_BASE::ready_send_to_midi(int ch, double timestamp_usec)
87 {
88         // ToDo: Will Implement.
89 }
90
91 void OSD_BASE::request_stop_to_receive_from_midi(int ch, double timestamp_usec)
92 {
93         // ToDo: Will Implement.
94 }
95
96 void OSD_BASE::request_stop_to_send_to_midi(int ch, double timestamp_usec)
97 {
98         if(vm != nullptr) {
99                 vm->request_stop_to_send_to_midi(ch, timestamp_usec);
100         }
101 }
102