cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

beep.h (2148B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef GUAC_RDP_BEEP_H
     21#define GUAC_RDP_BEEP_H
     22
     23#include <freerdp/freerdp.h>
     24#include <winpr/wtypes.h>
     25
     26/**
     27 * The sample rate of the each generated beep, in samples per second.
     28 */
     29#define GUAC_RDP_BEEP_SAMPLE_RATE 8000
     30
     31/**
     32 * The amplitude (volume) of each beep. As the beep is generated as 8-bit
     33 * signed PCM, this should be kept between 0 and 127 inclusive.
     34 */
     35#define GUAC_RDP_BEEP_AMPLITUDE 64
     36
     37/**
     38 * The maximum duration of each beep, in milliseconds. This value should be
     39 * kept relatively small to ensure the amount of data sent for each beep is
     40 * minimal.
     41 */
     42#define GUAC_RDP_BEEP_MAX_DURATION 500
     43
     44/**
     45 * Processes a Play Sound PDU received from the RDP server, beeping for the
     46 * requested duration and at the requested frequency. If audio has been
     47 * disabled for the connection, the Play Sound PDU will be silently ignored,
     48 * and this function has no effect. Beeps in excess of the maximum specified
     49 * by GUAC_RDP_BEEP_MAX_DURATION will be truncated.
     50 *
     51 * @param context
     52 *     The rdpContext associated with the current RDP session.
     53 *
     54 * @param play_sound
     55 *     The PLAY_SOUND_UPDATE structure representing the received Play Sound
     56 *     PDU.
     57 *
     58 * @return
     59 *     TRUE if successful, FALSE otherwise.
     60 */
     61BOOL guac_rdp_beep_play_sound(rdpContext* context,
     62        const PLAY_SOUND_UPDATE* play_sound);
     63
     64#endif
     65