/* Generated by wayland-scanner 1.24.0 */

#ifndef WPE_AUDIO_CLIENT_PROTOCOL_H
#define WPE_AUDIO_CLIENT_PROTOCOL_H

#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"

#ifdef  __cplusplus
extern "C" {
#endif

/**
 * @page page_wpe_audio The wpe_audio protocol
 * @section page_ifaces_wpe_audio Interfaces
 * - @subpage page_iface_wpe_audio - 
 * - @subpage page_iface_wpe_audio_packet_export - 
 * @section page_copyright_wpe_audio Copyright
 * <pre>
 *
 * Copyright © 2020 Igalia S.L.
 *
 * Permission to use, copy, modify, distribute, and sell this
 * software and its documentation for any purpose is hereby granted
 * without fee, provided that the above copyright notice appear in
 * all copies and that both that copyright notice and this permission
 * notice appear in supporting documentation, and that the name of
 * the copyright holders not be used in advertising or publicity
 * pertaining to distribution of the software without specific,
 * written prior permission.  The copyright holders make no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied
 * warranty.
 *
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 * THIS SOFTWARE.
 * </pre>
 */
struct wpe_audio;
struct wpe_audio_packet_export;

#ifndef WPE_AUDIO_INTERFACE
#define WPE_AUDIO_INTERFACE
/**
 * @page page_iface_wpe_audio wpe_audio
 * @section page_iface_wpe_audio_api API
 * See @ref iface_wpe_audio.
 */
/**
 * @defgroup iface_wpe_audio The wpe_audio interface
 */
extern const struct wl_interface wpe_audio_interface;
#endif
#ifndef WPE_AUDIO_PACKET_EXPORT_INTERFACE
#define WPE_AUDIO_PACKET_EXPORT_INTERFACE
/**
 * @page page_iface_wpe_audio_packet_export wpe_audio_packet_export
 * @section page_iface_wpe_audio_packet_export_api API
 * See @ref iface_wpe_audio_packet_export.
 */
/**
 * @defgroup iface_wpe_audio_packet_export The wpe_audio_packet_export interface
 */
extern const struct wl_interface wpe_audio_packet_export_interface;
#endif

#define WPE_AUDIO_STREAM_STARTED 0
#define WPE_AUDIO_STREAM_PACKET 1
#define WPE_AUDIO_STREAM_STOPPED 2
#define WPE_AUDIO_STREAM_PAUSED 3
#define WPE_AUDIO_STREAM_RESUMED 4


/**
 * @ingroup iface_wpe_audio
 */
#define WPE_AUDIO_STREAM_STARTED_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_audio
 */
#define WPE_AUDIO_STREAM_PACKET_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_audio
 */
#define WPE_AUDIO_STREAM_STOPPED_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_audio
 */
#define WPE_AUDIO_STREAM_PAUSED_SINCE_VERSION 1
/**
 * @ingroup iface_wpe_audio
 */
#define WPE_AUDIO_STREAM_RESUMED_SINCE_VERSION 1

/** @ingroup iface_wpe_audio */
static inline void
wpe_audio_set_user_data(struct wpe_audio *wpe_audio, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_audio, user_data);
}

/** @ingroup iface_wpe_audio */
static inline void *
wpe_audio_get_user_data(struct wpe_audio *wpe_audio)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_audio);
}

static inline uint32_t
wpe_audio_get_version(struct wpe_audio *wpe_audio)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_audio);
}

/** @ingroup iface_wpe_audio */
static inline void
wpe_audio_destroy(struct wpe_audio *wpe_audio)
{
	wl_proxy_destroy((struct wl_proxy *) wpe_audio);
}

/**
 * @ingroup iface_wpe_audio
 */
static inline void
wpe_audio_stream_started(struct wpe_audio *wpe_audio, uint32_t id, int32_t channels, const char *layout, int32_t samplerate)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio,
			 WPE_AUDIO_STREAM_STARTED, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_audio), 0, id, channels, layout, samplerate);
}

/**
 * @ingroup iface_wpe_audio
 */
static inline struct wpe_audio_packet_export *
wpe_audio_stream_packet(struct wpe_audio *wpe_audio, uint32_t audio_stream_id, int32_t fd, uint32_t size)
{
	struct wl_proxy *id;

	id = wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio,
			 WPE_AUDIO_STREAM_PACKET, &wpe_audio_packet_export_interface, wl_proxy_get_version((struct wl_proxy *) wpe_audio), 0, NULL, audio_stream_id, fd, size);

	return (struct wpe_audio_packet_export *) id;
}

/**
 * @ingroup iface_wpe_audio
 */
static inline void
wpe_audio_stream_stopped(struct wpe_audio *wpe_audio, uint32_t id)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio,
			 WPE_AUDIO_STREAM_STOPPED, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_audio), 0, id);
}

/**
 * @ingroup iface_wpe_audio
 */
static inline void
wpe_audio_stream_paused(struct wpe_audio *wpe_audio, uint32_t id)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio,
			 WPE_AUDIO_STREAM_PAUSED, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_audio), 0, id);
}

/**
 * @ingroup iface_wpe_audio
 */
static inline void
wpe_audio_stream_resumed(struct wpe_audio *wpe_audio, uint32_t id)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio,
			 WPE_AUDIO_STREAM_RESUMED, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_audio), 0, id);
}

/**
 * @ingroup iface_wpe_audio_packet_export
 * @struct wpe_audio_packet_export_listener
 */
struct wpe_audio_packet_export_listener {
	/**
	 */
	void (*release)(void *data,
			struct wpe_audio_packet_export *wpe_audio_packet_export);
};

/**
 * @ingroup iface_wpe_audio_packet_export
 */
static inline int
wpe_audio_packet_export_add_listener(struct wpe_audio_packet_export *wpe_audio_packet_export,
				     const struct wpe_audio_packet_export_listener *listener, void *data)
{
	return wl_proxy_add_listener((struct wl_proxy *) wpe_audio_packet_export,
				     (void (**)(void)) listener, data);
}

#define WPE_AUDIO_PACKET_EXPORT_DESTROY 0

/**
 * @ingroup iface_wpe_audio_packet_export
 */
#define WPE_AUDIO_PACKET_EXPORT_RELEASE_SINCE_VERSION 1

/**
 * @ingroup iface_wpe_audio_packet_export
 */
#define WPE_AUDIO_PACKET_EXPORT_DESTROY_SINCE_VERSION 1

/** @ingroup iface_wpe_audio_packet_export */
static inline void
wpe_audio_packet_export_set_user_data(struct wpe_audio_packet_export *wpe_audio_packet_export, void *user_data)
{
	wl_proxy_set_user_data((struct wl_proxy *) wpe_audio_packet_export, user_data);
}

/** @ingroup iface_wpe_audio_packet_export */
static inline void *
wpe_audio_packet_export_get_user_data(struct wpe_audio_packet_export *wpe_audio_packet_export)
{
	return wl_proxy_get_user_data((struct wl_proxy *) wpe_audio_packet_export);
}

static inline uint32_t
wpe_audio_packet_export_get_version(struct wpe_audio_packet_export *wpe_audio_packet_export)
{
	return wl_proxy_get_version((struct wl_proxy *) wpe_audio_packet_export);
}

/**
 * @ingroup iface_wpe_audio_packet_export
 */
static inline void
wpe_audio_packet_export_destroy(struct wpe_audio_packet_export *wpe_audio_packet_export)
{
	wl_proxy_marshal_flags((struct wl_proxy *) wpe_audio_packet_export,
			 WPE_AUDIO_PACKET_EXPORT_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wpe_audio_packet_export), WL_MARSHAL_FLAG_DESTROY);
}

#ifdef  __cplusplus
}
#endif

#endif
