LV2 Config Service Listener
| 141 | |
| 142 | // LV2 Config Service Listener |
| 143 | bool lv2_config_service_listener::check_service( |
| 144 | const lv2_config_service &service) const { |
| 145 | // Filter by type |
| 146 | if (type == SYS_CONFIG_SERVICE_LISTENER_ONCE && !service_events.empty()) { |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | // Filter by service ID or verbosity |
| 151 | if (service_id != service.id || min_verbosity > service.verbosity) { |
| 152 | return false; |
| 153 | } |
| 154 | |
| 155 | // realhw only seems to send the pad connected events to the listeners that |
| 156 | // provided 0x01 as the first byte of their data buffer |
| 157 | // TODO: Figure out how this filter works more properly |
| 158 | if (service_id == SYS_CONFIG_SERVICE_PADMANAGER && |
| 159 | (data.empty() || data[0] != 0x01)) { |
| 160 | return false; |
| 161 | } |
| 162 | |
| 163 | // Event applies to this listener! |
| 164 | return true; |
| 165 | } |
| 166 | |
| 167 | bool lv2_config_service_listener::notify( |
| 168 | const shared_ptr<lv2_config_service_event> &event) { |