578 |
// Client registration protocol functions. |
// Client registration protocol functions. |
579 |
|
|
580 |
/** |
/** |
581 |
* Register frontend for receiving event messages: |
* Register frontend for receiving event messages. |
582 |
|
* @e Caution: since liblscp v0.5.5.4 you have to call lscp_client_subscribe() |
583 |
|
* for @e each event you want to subscribe. That is the old bitflag approach |
584 |
|
* was abondoned at this point. You can however still register all older |
585 |
|
* events with one lscp_client_subscribe() call at once. Thus, the old |
586 |
|
* behavior of this functions was not broken. Those older events are namely: |
587 |
|
* @code |
588 |
* SUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT |
* SUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT |
589 |
* | BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT |
* | BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT |
590 |
* | AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO |
* | AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO |
592 |
* | MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO |
* | MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO |
593 |
* | MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO |
* | MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO |
594 |
* | MISCELLANEOUS |
* | MISCELLANEOUS |
595 |
|
* @endcode |
596 |
|
* The old events occupy the lower 16 bits (as bit flags), and all younger |
597 |
|
* events enumerate the whole upper 16 bits range. The new, enumerated |
598 |
|
* events are namely: |
599 |
|
* @code |
600 |
|
* SUBSCRIBE CHANNEL_MIDI |
601 |
|
* @endcode |
602 |
* |
* |
603 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
604 |
* @param events Bit-wise OR'ed event flags to subscribe. |
* @param events Bit-wise OR'ed event flags to subscribe. |
650 |
ret = _lscp_client_evt_request(pClient, 1, LSCP_EVENT_MIDI_INSTRUMENT_INFO); |
ret = _lscp_client_evt_request(pClient, 1, LSCP_EVENT_MIDI_INSTRUMENT_INFO); |
651 |
if (ret == LSCP_OK && (events & LSCP_EVENT_MISCELLANEOUS)) |
if (ret == LSCP_OK && (events & LSCP_EVENT_MISCELLANEOUS)) |
652 |
ret = _lscp_client_evt_request(pClient, 1, LSCP_EVENT_MISCELLANEOUS); |
ret = _lscp_client_evt_request(pClient, 1, LSCP_EVENT_MISCELLANEOUS); |
653 |
|
// Caution: for the upper 16 bits, we don't use bit flags anymore ... |
654 |
|
if (ret == LSCP_OK && ((events & 0xffff0000) == LSCP_EVENT_CHANNEL_MIDI)) |
655 |
|
ret = _lscp_client_evt_request(pClient, 1, LSCP_EVENT_CHANNEL_MIDI); |
656 |
|
|
657 |
// Unlock this section down. |
// Unlock this section down. |
658 |
lscp_mutex_unlock(pClient->mutex); |
lscp_mutex_unlock(pClient->mutex); |
663 |
|
|
664 |
/** |
/** |
665 |
* Deregister frontend from receiving UDP event messages anymore: |
* Deregister frontend from receiving UDP event messages anymore: |
666 |
|
* @e Caution: since liblscp v0.5.5.4 you have to call |
667 |
|
* lscp_client_unsubscribe() for @e each event you want to unsubscribe. |
668 |
|
* That is the old bitflag approach was abondoned at this point. You can |
669 |
|
* however still register all older events with one lscp_client_subscribe() |
670 |
|
* call at once. Thus, the old behavior of this functions was not broken. |
671 |
|
* Those older events are namely: |
672 |
|
* @code |
673 |
* UNSUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT |
* UNSUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT |
674 |
* | BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT |
* | BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT |
675 |
* | AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO |
* | AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO |
677 |
* | MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO |
* | MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO |
678 |
* | MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO |
* | MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO |
679 |
* | MISCELLANEOUS |
* | MISCELLANEOUS |
680 |
|
* @endcode |
681 |
|
* The old events occupy the lower 16 bits (as bit flags), and all younger |
682 |
|
* events enumerate the whole upper 16 bits range. The new, enumerated |
683 |
|
* events are namely: |
684 |
|
* @code |
685 |
|
* UNSUBSCRIBE CHANNEL_MIDI |
686 |
|
* @endcode |
687 |
* |
* |
688 |
* @param pClient Pointer to client instance structure. |
* @param pClient Pointer to client instance structure. |
689 |
* @param events Bit-wise OR'ed event flags to unsubscribe. |
* @param events Bit-wise OR'ed event flags to unsubscribe. |
731 |
ret = _lscp_client_evt_request(pClient, 0, LSCP_EVENT_MIDI_INSTRUMENT_INFO); |
ret = _lscp_client_evt_request(pClient, 0, LSCP_EVENT_MIDI_INSTRUMENT_INFO); |
732 |
if (ret == LSCP_OK && (events & LSCP_EVENT_MISCELLANEOUS)) |
if (ret == LSCP_OK && (events & LSCP_EVENT_MISCELLANEOUS)) |
733 |
ret = _lscp_client_evt_request(pClient, 0, LSCP_EVENT_MISCELLANEOUS); |
ret = _lscp_client_evt_request(pClient, 0, LSCP_EVENT_MISCELLANEOUS); |
734 |
|
// Caution: for the upper 16 bits, we don't use bit flags anymore ... |
735 |
|
if (ret == LSCP_OK && ((events & 0xffff0000) == LSCP_EVENT_CHANNEL_MIDI)) |
736 |
|
ret = _lscp_client_evt_request(pClient, 0, LSCP_EVENT_CHANNEL_MIDI); |
737 |
|
|
738 |
// If necessary, close the alternate connection... |
// If necessary, close the alternate connection... |
739 |
if (pClient->events == LSCP_EVENT_NONE) |
if (pClient->events == LSCP_EVENT_NONE) |