/* PlayerPage.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from PlayerPage.vala, do not modify */

/*
 * Copyright 2013-2019 elementary, Inc. (https://elementary.io)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>

#define AUDIENCE_APP_ACTION_NEXT "action-next"
#define AUDIENCE_APP_ACTION_PLAY_PAUSE "action-play-pause"
#define AUDIENCE_APP_ACTION_PREVIOUS "action-previous"
#define AUDIENCE_WINDOW_ACTION_GROUP_PREFIX "win"
#define AUDIENCE_WINDOW_ACTION_PREFIX AUDIENCE_WINDOW_ACTION_GROUP_PREFIX "."
#define AUDIENCE_WINDOW_ACTION_FULLSCREEN "action-fullscreen"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define AUDIENCE_TYPE_PLAYER_PAGE (audience_player_page_get_type ())
#define AUDIENCE_PLAYER_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_TYPE_PLAYER_PAGE, AudiencePlayerPage))
#define AUDIENCE_PLAYER_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AUDIENCE_TYPE_PLAYER_PAGE, AudiencePlayerPageClass))
#define AUDIENCE_IS_PLAYER_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_TYPE_PLAYER_PAGE))
#define AUDIENCE_IS_PLAYER_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AUDIENCE_TYPE_PLAYER_PAGE))
#define AUDIENCE_PLAYER_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AUDIENCE_TYPE_PLAYER_PAGE, AudiencePlayerPageClass))

typedef struct _AudiencePlayerPage AudiencePlayerPage;
typedef struct _AudiencePlayerPageClass AudiencePlayerPageClass;
typedef struct _AudiencePlayerPagePrivate AudiencePlayerPagePrivate;

#define AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR (audience_widgets_bottom_bar_get_type ())
#define AUDIENCE_WIDGETS_BOTTOM_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR, AudienceWidgetsBottomBar))
#define AUDIENCE_WIDGETS_BOTTOM_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR, AudienceWidgetsBottomBarClass))
#define AUDIENCE_WIDGETS_IS_BOTTOM_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR))
#define AUDIENCE_WIDGETS_IS_BOTTOM_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR))
#define AUDIENCE_WIDGETS_BOTTOM_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AUDIENCE_WIDGETS_TYPE_BOTTOM_BAR, AudienceWidgetsBottomBarClass))

typedef struct _AudienceWidgetsBottomBar AudienceWidgetsBottomBar;
typedef struct _AudienceWidgetsBottomBarClass AudienceWidgetsBottomBarClass;
enum  {
	AUDIENCE_PLAYER_PAGE_0_PROPERTY,
	AUDIENCE_PLAYER_PAGE_NUM_PROPERTIES
};
static GParamSpec* audience_player_page_properties[AUDIENCE_PLAYER_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define AUDIENCE_TYPE_PLAYBACK_MANAGER (audience_playback_manager_get_type ())
#define AUDIENCE_PLAYBACK_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_TYPE_PLAYBACK_MANAGER, AudiencePlaybackManager))
#define AUDIENCE_PLAYBACK_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AUDIENCE_TYPE_PLAYBACK_MANAGER, AudiencePlaybackManagerClass))
#define AUDIENCE_IS_PLAYBACK_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_TYPE_PLAYBACK_MANAGER))
#define AUDIENCE_IS_PLAYBACK_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AUDIENCE_TYPE_PLAYBACK_MANAGER))
#define AUDIENCE_PLAYBACK_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AUDIENCE_TYPE_PLAYBACK_MANAGER, AudiencePlaybackManagerClass))

typedef struct _AudiencePlaybackManager AudiencePlaybackManager;
typedef struct _AudiencePlaybackManagerClass AudiencePlaybackManagerClass;
typedef struct _Block16Data Block16Data;

#define AUDIENCE_TYPE_HEADER_BAR (audience_header_bar_get_type ())
#define AUDIENCE_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AUDIENCE_TYPE_HEADER_BAR, AudienceHeaderBar))
#define AUDIENCE_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), AUDIENCE_TYPE_HEADER_BAR, AudienceHeaderBarClass))
#define AUDIENCE_IS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AUDIENCE_TYPE_HEADER_BAR))
#define AUDIENCE_IS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), AUDIENCE_TYPE_HEADER_BAR))
#define AUDIENCE_HEADER_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), AUDIENCE_TYPE_HEADER_BAR, AudienceHeaderBarClass))

typedef struct _AudienceHeaderBar AudienceHeaderBar;
typedef struct _AudienceHeaderBarClass AudienceHeaderBarClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _AudiencePlayerPage {
	AdwNavigationPage parent_instance;
	AudiencePlayerPagePrivate * priv;
};

struct _AudiencePlayerPageClass {
	AdwNavigationPageClass parent_class;
};

struct _AudiencePlayerPagePrivate {
	AudienceWidgetsBottomBar* bottom_bar;
	AdwToolbarView* toolbarview;
	guint hiding_timer;
};

struct _Block16Data {
	int _ref_count_;
	AudiencePlayerPage* self;
	gdouble prev_x;
	gdouble prev_y;
};

static gint AudiencePlayerPage_private_offset;
static gpointer audience_player_page_parent_class = NULL;

VALA_EXTERN GType audience_player_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudiencePlayerPage, g_object_unref)
VALA_EXTERN GType audience_widgets_bottom_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudienceWidgetsBottomBar, g_object_unref)
static void audience_player_page_update_actions_enabled (AudiencePlayerPage* self,
                                                  gboolean enabled);
VALA_EXTERN void audience_player_page_seek_jump_seconds (AudiencePlayerPage* self,
                                             gint seconds);
VALA_EXTERN GType audience_playback_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudiencePlaybackManager, g_object_unref)
VALA_EXTERN AudiencePlaybackManager* audience_playback_manager_get_default (void);
VALA_EXTERN gint64 audience_playback_manager_get_position (AudiencePlaybackManager* self);
VALA_EXTERN void audience_playback_manager_seek (AudiencePlaybackManager* self,
                                     gint64 position);
static void audience_player_page_reveal_control (AudiencePlayerPage* self);
VALA_EXTERN void audience_player_page_hide_popovers (AudiencePlayerPage* self);
VALA_EXTERN void audience_widgets_bottom_bar_hide_popovers (AudienceWidgetsBottomBar* self);
VALA_EXTERN gboolean audience_widgets_bottom_bar_get_should_stay_revealed (AudienceWidgetsBottomBar* self);
static gboolean __lambda56_ (AudiencePlayerPage* self);
static gboolean ___lambda56__gsource_func (gpointer self);
VALA_EXTERN AudiencePlayerPage* audience_player_page_new (void);
VALA_EXTERN AudiencePlayerPage* audience_player_page_construct (GType object_type);
static GObject * audience_player_page_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
VALA_EXTERN GType audience_header_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AudienceHeaderBar, g_object_unref)
VALA_EXTERN AudienceHeaderBar* audience_header_bar_new (void);
VALA_EXTERN AudienceHeaderBar* audience_header_bar_construct (GType object_type);
VALA_EXTERN AudienceWidgetsBottomBar* audience_widgets_bottom_bar_new (void);
VALA_EXTERN AudienceWidgetsBottomBar* audience_widgets_bottom_bar_construct (GType object_type);
VALA_EXTERN GdkPaintable* audience_playback_manager_get_gst_video_widget (AudiencePlaybackManager* self);
static void _audience_player_page___lambda57_ (AudiencePlayerPage* self);
static void __audience_player_page___lambda57__gtk_widget_map (GtkWidget* _sender,
                                                        gpointer self);
static void _audience_player_page___lambda58_ (AudiencePlayerPage* self);
static void __audience_player_page___lambda58__gtk_widget_unmap (GtkWidget* _sender,
                                                          gpointer self);
static void _audience_player_page___lambda59_ (Block16Data* _data16_,
                                        gdouble x,
                                        gdouble y);
static void __audience_player_page___lambda59__gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                                            gdouble x,
                                                                            gdouble y,
                                                                            gpointer self);
static void _audience_player_page_reveal_control_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self);
static void _audience_player_page___lambda60_ (AudiencePlayerPage* self,
                                        gint n_press);
static void __audience_player_page___lambda60__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                   gint n_press,
                                                                   gdouble x,
                                                                   gdouble y,
                                                                   gpointer self);
static void _audience_player_page___lambda61_ (AudiencePlayerPage* self);
static void __audience_player_page___lambda61__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                   gint n_press,
                                                                   gdouble x,
                                                                   gdouble y,
                                                                   gpointer self);
static void _audience_player_page___lambda62_ (AudiencePlayerPage* self,
                                        const gchar* uri);
VALA_EXTERN gchar* audience_get_title (const gchar* filename);
static void __audience_player_page___lambda62__audience_playback_manager_uri_changed (AudiencePlaybackManager* _sender,
                                                                               const gchar* uri,
                                                                               gpointer self);
static void audience_player_page_finalize (GObject * obj);
static GType audience_player_page_get_type_once (void);

const gchar* AUDIENCE_SUBTITLE_EXTENSIONS[6] = {"sub", "srt", "smi", "ssa", "ass", "asc"};

static inline gpointer
audience_player_page_get_instance_private (AudiencePlayerPage* self)
{
	return G_STRUCT_MEMBER_P (self, AudiencePlayerPage_private_offset);
}

static void
audience_player_page_update_actions_enabled (AudiencePlayerPage* self,
                                             gboolean enabled)
{
	GApplication* application = NULL;
	GApplication* _tmp0_;
	GAction* _tmp1_;
	GAction* _tmp2_;
	GAction* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_application_get_default ();
	application = _tmp0_;
	_tmp1_ = g_action_map_lookup_action ((GActionMap*) application, AUDIENCE_APP_ACTION_NEXT);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, g_simple_action_get_type (), GSimpleAction), enabled);
	_tmp2_ = g_action_map_lookup_action ((GActionMap*) application, AUDIENCE_APP_ACTION_PLAY_PAUSE);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_simple_action_get_type (), GSimpleAction), enabled);
	_tmp3_ = g_action_map_lookup_action ((GActionMap*) application, AUDIENCE_APP_ACTION_PREVIOUS);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, g_simple_action_get_type (), GSimpleAction), enabled);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
audience_player_page_seek_jump_seconds (AudiencePlayerPage* self,
                                        gint seconds)
{
	AudiencePlaybackManager* playback_manager = NULL;
	AudiencePlaybackManager* _tmp0_;
	AudiencePlaybackManager* _tmp1_;
	gint64 new_position = 0LL;
	AudiencePlaybackManager* _tmp2_;
	gint64 _tmp3_;
	gint64 _tmp4_;
	AudiencePlaybackManager* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = audience_playback_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	playback_manager = _tmp1_;
	_tmp2_ = playback_manager;
	_tmp3_ = audience_playback_manager_get_position (_tmp2_);
	_tmp4_ = _tmp3_;
	new_position = _tmp4_ + (((gint64) seconds) * ((gint64) 1000000000));
	if (new_position < ((gint64) 0)) {
		new_position = (gint64) 0;
	}
	_tmp5_ = playback_manager;
	audience_playback_manager_seek (_tmp5_, new_position);
	audience_player_page_reveal_control (self);
	_g_object_unref0 (playback_manager);
}

void
audience_player_page_hide_popovers (AudiencePlayerPage* self)
{
	AudienceWidgetsBottomBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->bottom_bar;
	audience_widgets_bottom_bar_hide_popovers (_tmp0_);
}

static gboolean
__lambda56_ (AudiencePlayerPage* self)
{
	AdwToolbarView* _tmp0_;
	AdwToolbarView* _tmp1_;
	GdkCursor* _tmp2_;
	GdkCursor* _tmp3_;
	gboolean result;
	self->priv->hiding_timer = (guint) 0;
	_tmp0_ = self->priv->toolbarview;
	adw_toolbar_view_set_reveal_top_bars (_tmp0_, FALSE);
	_tmp1_ = self->priv->toolbarview;
	adw_toolbar_view_set_reveal_bottom_bars (_tmp1_, FALSE);
	_tmp2_ = gdk_cursor_new_from_name ("none", NULL);
	_tmp3_ = _tmp2_;
	gtk_widget_set_cursor ((GtkWidget*) self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda56__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda56_ ((AudiencePlayerPage*) self);
	return result;
}

static void
audience_player_page_reveal_control (AudiencePlayerPage* self)
{
	AdwToolbarView* _tmp0_;
	AdwToolbarView* _tmp1_;
	AudienceWidgetsBottomBar* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	if (self->priv->hiding_timer != ((guint) 0)) {
		g_source_remove (self->priv->hiding_timer);
		self->priv->hiding_timer = (guint) 0;
	}
	_tmp0_ = self->priv->toolbarview;
	adw_toolbar_view_set_reveal_bottom_bars (_tmp0_, TRUE);
	_tmp1_ = self->priv->toolbarview;
	adw_toolbar_view_set_reveal_top_bars (_tmp1_, TRUE);
	gtk_widget_set_cursor ((GtkWidget*) self, NULL);
	_tmp2_ = self->priv->bottom_bar;
	_tmp3_ = audience_widgets_bottom_bar_get_should_stay_revealed (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		return;
	}
	self->priv->hiding_timer = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 2000, ___lambda56__gsource_func, g_object_ref (self), g_object_unref);
}

AudiencePlayerPage*
audience_player_page_construct (GType object_type)
{
	AudiencePlayerPage * self = NULL;
	self = (AudiencePlayerPage*) g_object_new (object_type, NULL);
	return self;
}

AudiencePlayerPage*
audience_player_page_new (void)
{
	return audience_player_page_construct (AUDIENCE_TYPE_PLAYER_PAGE);
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		AudiencePlayerPage* self;
		self = _data16_->self;
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}

static void
_audience_player_page___lambda57_ (AudiencePlayerPage* self)
{
	audience_player_page_update_actions_enabled (self, TRUE);
}

static void
__audience_player_page___lambda57__gtk_widget_map (GtkWidget* _sender,
                                                   gpointer self)
{
	_audience_player_page___lambda57_ ((AudiencePlayerPage*) self);
}

static void
_audience_player_page___lambda58_ (AudiencePlayerPage* self)
{
	audience_player_page_update_actions_enabled (self, FALSE);
}

static void
__audience_player_page___lambda58__gtk_widget_unmap (GtkWidget* _sender,
                                                     gpointer self)
{
	_audience_player_page___lambda58_ ((AudiencePlayerPage*) self);
}

static void
_audience_player_page___lambda59_ (Block16Data* _data16_,
                                   gdouble x,
                                   gdouble y)
{
	AudiencePlayerPage* self;
	gboolean _tmp0_ = FALSE;
	self = _data16_->self;
	if (x != _data16_->prev_x) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = y != _data16_->prev_y;
	}
	if (_tmp0_) {
		_data16_->prev_x = x;
		_data16_->prev_y = y;
		audience_player_page_reveal_control (self);
	}
}

static void
__audience_player_page___lambda59__gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                                       gdouble x,
                                                                       gdouble y,
                                                                       gpointer self)
{
	_audience_player_page___lambda59_ (self, x, y);
}

static void
_audience_player_page_reveal_control_g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self)
{
	audience_player_page_reveal_control ((AudiencePlayerPage*) self);
}

static void
_audience_player_page___lambda60_ (AudiencePlayerPage* self,
                                   gint n_press)
{
	if (n_press == 2) {
		gtk_widget_activate_action ((GtkWidget*) self, AUDIENCE_WINDOW_ACTION_PREFIX AUDIENCE_WINDOW_ACTION_FULLSCREEN, NULL, NULL);
	}
}

static void
__audience_player_page___lambda60__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                              gint n_press,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self)
{
	_audience_player_page___lambda60_ ((AudiencePlayerPage*) self, n_press);
}

static void
_audience_player_page___lambda61_ (AudiencePlayerPage* self)
{
	GAction* play_pause_action = NULL;
	GApplication* _tmp0_;
	GAction* _tmp1_;
	GAction* _tmp2_;
	GAction* _tmp3_;
	_tmp0_ = g_application_get_default ();
	_tmp1_ = g_action_map_lookup_action ((GActionMap*) _tmp0_, AUDIENCE_APP_ACTION_PLAY_PAUSE);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	play_pause_action = _tmp2_;
	_tmp3_ = play_pause_action;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, g_simple_action_get_type (), GSimpleAction), "activate", NULL);
	_g_object_unref0 (play_pause_action);
}

static void
__audience_player_page___lambda61__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                              gint n_press,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self)
{
	_audience_player_page___lambda61_ ((AudiencePlayerPage*) self);
}

static void
_audience_player_page___lambda62_ (AudiencePlayerPage* self,
                                   const gchar* uri)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (uri != NULL);
	_tmp0_ = audience_get_title (uri);
	_tmp1_ = _tmp0_;
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _tmp1_);
	_g_free0 (_tmp1_);
}

static void
__audience_player_page___lambda62__audience_playback_manager_uri_changed (AudiencePlaybackManager* _sender,
                                                                          const gchar* uri,
                                                                          gpointer self)
{
	_audience_player_page___lambda62_ ((AudiencePlayerPage*) self, uri);
}

static GObject *
audience_player_page_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	AudiencePlayerPage * self;
	Block16Data* _data16_;
	AudiencePlaybackManager* playback_manager = NULL;
	AudiencePlaybackManager* _tmp0_;
	AudiencePlaybackManager* _tmp1_;
	AudienceHeaderBar* header_bar = NULL;
	AudienceHeaderBar* _tmp2_;
	AudienceWidgetsBottomBar* _tmp3_;
	GtkPicture* picture = NULL;
	AudiencePlaybackManager* _tmp4_;
	GdkPaintable* _tmp5_;
	GdkPaintable* _tmp6_;
	GtkPicture* _tmp7_ = NULL;
	GtkPicture* _tmp8_;
	GtkWidget* _tmp9_;
	AdwToolbarView* _tmp10_ = NULL;
	AdwToolbarView* _tmp11_;
	AudienceHeaderBar* _tmp12_;
	AdwToolbarView* _tmp13_;
	AudienceWidgetsBottomBar* _tmp14_;
	AdwToolbarView* _tmp15_;
	GtkEventControllerMotion* motion_controller = NULL;
	GtkEventControllerMotion* _tmp16_;
	GtkEventControllerMotion* _tmp17_;
	GtkEventController* _tmp18_;
	GtkEventControllerMotion* _tmp19_;
	AudienceWidgetsBottomBar* _tmp20_;
	GtkGestureClick* primary_gesture_click = NULL;
	GtkGestureClick* _tmp21_ = NULL;
	GtkGestureClick* _tmp22_;
	GtkEventController* _tmp23_;
	GtkGestureClick* _tmp24_;
	GtkGestureClick* secondary_gesture_click = NULL;
	GtkGestureClick* _tmp25_ = NULL;
	GtkGestureClick* _tmp26_;
	GtkEventController* _tmp27_;
	GtkGestureClick* _tmp28_;
	AudiencePlaybackManager* _tmp29_;
	parent_class = G_OBJECT_CLASS (audience_player_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, AUDIENCE_TYPE_PLAYER_PAGE, AudiencePlayerPage);
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_tmp0_ = audience_playback_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	playback_manager = _tmp1_;
	_tmp2_ = audience_header_bar_new ();
	g_object_ref_sink (_tmp2_);
	header_bar = _tmp2_;
	_tmp3_ = audience_widgets_bottom_bar_new ();
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->bottom_bar);
	self->priv->bottom_bar = _tmp3_;
	_tmp4_ = playback_manager;
	_tmp5_ = audience_playback_manager_get_gst_video_widget (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkPicture*) gtk_picture_new_for_paintable (_tmp6_);
	gtk_picture_set_content_fit (_tmp7_, GTK_CONTENT_FIT_CONTAIN);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp7_, TRUE);
	g_object_ref_sink (_tmp7_);
	picture = _tmp7_;
	_tmp8_ = picture;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
	_tmp10_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_extend_content_to_bottom_edge (_tmp10_, TRUE);
	adw_toolbar_view_set_extend_content_to_top_edge (_tmp10_, TRUE);
	adw_toolbar_view_set_content (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	adw_toolbar_view_set_top_bar_style (_tmp10_, ADW_TOOLBAR_RAISED);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->toolbarview);
	self->priv->toolbarview = _tmp10_;
	_tmp11_ = self->priv->toolbarview;
	_tmp12_ = header_bar;
	adw_toolbar_view_add_top_bar (_tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = self->priv->toolbarview;
	_tmp14_ = self->priv->bottom_bar;
	adw_toolbar_view_add_bottom_bar (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = self->priv->toolbarview;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp15_);
	g_signal_connect_object ((GtkWidget*) self, "map", (GCallback) __audience_player_page___lambda57__gtk_widget_map, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "unmap", (GCallback) __audience_player_page___lambda58__gtk_widget_unmap, self, 0);
	_tmp16_ = (GtkEventControllerMotion*) gtk_event_controller_motion_new ();
	motion_controller = _tmp16_;
	_tmp17_ = motion_controller;
	_tmp18_ = _g_object_ref0 ((GtkEventController*) _tmp17_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp18_);
	_tmp19_ = motion_controller;
	g_signal_connect_data (_tmp19_, "motion", (GCallback) __audience_player_page___lambda59__gtk_event_controller_motion_motion, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
	_tmp20_ = self->priv->bottom_bar;
	g_signal_connect_object ((GObject*) _tmp20_, "notify::should-stay-revealed", (GCallback) _audience_player_page_reveal_control_g_object_notify, self, 0);
	_tmp21_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp21_, (guint) GDK_BUTTON_PRIMARY);
	primary_gesture_click = _tmp21_;
	_tmp22_ = primary_gesture_click;
	_tmp23_ = _g_object_ref0 ((GtkEventController*) _tmp22_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp23_);
	_tmp24_ = primary_gesture_click;
	g_signal_connect_object (_tmp24_, "pressed", (GCallback) __audience_player_page___lambda60__gtk_gesture_click_pressed, self, 0);
	_tmp25_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp25_, (guint) GDK_BUTTON_SECONDARY);
	secondary_gesture_click = _tmp25_;
	_tmp26_ = secondary_gesture_click;
	_tmp27_ = _g_object_ref0 ((GtkEventController*) _tmp26_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp27_);
	_tmp28_ = secondary_gesture_click;
	g_signal_connect_object (_tmp28_, "pressed", (GCallback) __audience_player_page___lambda61__gtk_gesture_click_pressed, self, 0);
	_tmp29_ = playback_manager;
	g_signal_connect_object (_tmp29_, "uri-changed", (GCallback) __audience_player_page___lambda62__audience_playback_manager_uri_changed, self, 0);
	_g_object_unref0 (secondary_gesture_click);
	_g_object_unref0 (primary_gesture_click);
	_g_object_unref0 (motion_controller);
	_g_object_unref0 (picture);
	_g_object_unref0 (header_bar);
	_g_object_unref0 (playback_manager);
	block16_data_unref (_data16_);
	_data16_ = NULL;
	return obj;
}

static void
audience_player_page_base_init (AudiencePlayerPageClass * klass)
{
	gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (klass), "player-page");
}

static void
audience_player_page_class_init (AudiencePlayerPageClass * klass,
                                 gpointer klass_data)
{
	audience_player_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &AudiencePlayerPage_private_offset);
	G_OBJECT_CLASS (klass)->constructor = audience_player_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = audience_player_page_finalize;
}

static void
audience_player_page_instance_init (AudiencePlayerPage * self,
                                    gpointer klass)
{
	self->priv = audience_player_page_get_instance_private (self);
	self->priv->hiding_timer = (guint) 0;
}

static void
audience_player_page_finalize (GObject * obj)
{
	AudiencePlayerPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, AUDIENCE_TYPE_PLAYER_PAGE, AudiencePlayerPage);
	_g_object_unref0 (self->priv->bottom_bar);
	_g_object_unref0 (self->priv->toolbarview);
	G_OBJECT_CLASS (audience_player_page_parent_class)->finalize (obj);
}

static GType
audience_player_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (AudiencePlayerPageClass), (GBaseInitFunc) audience_player_page_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) audience_player_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AudiencePlayerPage), 0, (GInstanceInitFunc) audience_player_page_instance_init, NULL };
	GType audience_player_page_type_id;
	audience_player_page_type_id = g_type_register_static (adw_navigation_page_get_type (), "AudiencePlayerPage", &g_define_type_info, 0);
	AudiencePlayerPage_private_offset = g_type_add_instance_private (audience_player_page_type_id, sizeof (AudiencePlayerPagePrivate));
	return audience_player_page_type_id;
}

GType
audience_player_page_get_type (void)
{
	static volatile gsize audience_player_page_type_id__once = 0;
	if (g_once_init_enter (&audience_player_page_type_id__once)) {
		GType audience_player_page_type_id;
		audience_player_page_type_id = audience_player_page_get_type_once ();
		g_once_init_leave (&audience_player_page_type_id__once, audience_player_page_type_id);
	}
	return audience_player_page_type_id__once;
}

