| 614 | } |
| 615 | |
| 616 | error_code cellVoiceSetNotifyEventQueue(u64 key, u64 source) |
| 617 | { |
| 618 | cellVoice.warning("cellVoiceSetNotifyEventQueue(key=0x%llx, source=0x%llx)", key, source); |
| 619 | |
| 620 | auto& manager = g_fxo->get<voice_manager>(); |
| 621 | |
| 622 | std::scoped_lock lock(manager.mtx); |
| 623 | |
| 624 | if (!manager.is_init) |
| 625 | return CELL_VOICE_ERROR_LIBVOICE_NOT_INIT; |
| 626 | |
| 627 | // Note: it is allowed to enqueue the key twice (another source is enqueued with FIFO ordering) |
| 628 | // It is not allowed to enqueue an invalid key |
| 629 | |
| 630 | if (!lv2_event_queue::find(key)) |
| 631 | return CELL_VOICE_ERROR_EVENT_QUEUE; |
| 632 | |
| 633 | if (!source) |
| 634 | { |
| 635 | // same thing as sys_event_port_send with port.name == 0 |
| 636 | // Try to give different port id everytime |
| 637 | source = ((process_getpid() + 1ull) << 32) | (lv2_event_port::id_base + manager.port_source * lv2_event_port::id_step); |
| 638 | manager.port_source = (manager.port_source + 1) % lv2_event_port::id_count; |
| 639 | } |
| 640 | |
| 641 | manager.queue_keys[key].push_back(source); |
| 642 | return CELL_OK; |
| 643 | } |
| 644 | |
| 645 | error_code cellVoiceSetPortAttr(u32 portId, u32 attr, vm::ptr<void> attrValue) |
| 646 | { |
nothing calls this directly
no test coverage detected