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

/*
 * SPDX-License-Identifier: LGPL-3.0-or-later
 * SPDX-FileCopyrightText: 2021 elementary, Inc. (https://elementary.io)
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.h>
#include <granite-7.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>

#define MUSIC_APPLICATION_ACTION_PREFIX "app."
#define MUSIC_APPLICATION_ACTION_PREVIOUS "action-previous"
#define MUSIC_APPLICATION_ACTION_PLAY_PAUSE "action-play-pause"
#define MUSIC_APPLICATION_ACTION_NEXT "action-next"
#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 MUSIC_TYPE_NOW_PLAYING_VIEW (music_now_playing_view_get_type ())
#define MUSIC_NOW_PLAYING_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_NOW_PLAYING_VIEW, MusicNowPlayingView))
#define MUSIC_NOW_PLAYING_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_NOW_PLAYING_VIEW, MusicNowPlayingViewClass))
#define MUSIC_IS_NOW_PLAYING_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_NOW_PLAYING_VIEW))
#define MUSIC_IS_NOW_PLAYING_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_NOW_PLAYING_VIEW))
#define MUSIC_NOW_PLAYING_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_NOW_PLAYING_VIEW, MusicNowPlayingViewClass))

typedef struct _MusicNowPlayingView MusicNowPlayingView;
typedef struct _MusicNowPlayingViewClass MusicNowPlayingViewClass;
typedef struct _MusicNowPlayingViewPrivate MusicNowPlayingViewPrivate;
enum  {
	MUSIC_NOW_PLAYING_VIEW_0_PROPERTY,
	MUSIC_NOW_PLAYING_VIEW_NUM_PROPERTIES
};
static GParamSpec* music_now_playing_view_properties[MUSIC_NOW_PLAYING_VIEW_NUM_PROPERTIES];

#define MUSIC_TYPE_ALBUM_IMAGE (music_album_image_get_type ())
#define MUSIC_ALBUM_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_ALBUM_IMAGE, MusicAlbumImage))
#define MUSIC_ALBUM_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_ALBUM_IMAGE, MusicAlbumImageClass))
#define MUSIC_IS_ALBUM_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_ALBUM_IMAGE))
#define MUSIC_IS_ALBUM_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_ALBUM_IMAGE))
#define MUSIC_ALBUM_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_ALBUM_IMAGE, MusicAlbumImageClass))

typedef struct _MusicAlbumImage MusicAlbumImage;
typedef struct _MusicAlbumImageClass MusicAlbumImageClass;

#define MUSIC_TYPE_SEEK_BAR (music_seek_bar_get_type ())
#define MUSIC_SEEK_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_SEEK_BAR, MusicSeekBar))
#define MUSIC_SEEK_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_SEEK_BAR, MusicSeekBarClass))
#define MUSIC_IS_SEEK_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_SEEK_BAR))
#define MUSIC_IS_SEEK_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_SEEK_BAR))
#define MUSIC_SEEK_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_SEEK_BAR, MusicSeekBarClass))

typedef struct _MusicSeekBar MusicSeekBar;
typedef struct _MusicSeekBarClass MusicSeekBarClass;

#define MUSIC_TYPE_PLAYBACK_MANAGER (music_playback_manager_get_type ())
#define MUSIC_PLAYBACK_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_PLAYBACK_MANAGER, MusicPlaybackManager))
#define MUSIC_PLAYBACK_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_PLAYBACK_MANAGER, MusicPlaybackManagerClass))
#define MUSIC_IS_PLAYBACK_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_PLAYBACK_MANAGER))
#define MUSIC_IS_PLAYBACK_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_PLAYBACK_MANAGER))
#define MUSIC_PLAYBACK_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_PLAYBACK_MANAGER, MusicPlaybackManagerClass))

typedef struct _MusicPlaybackManager MusicPlaybackManager;
typedef struct _MusicPlaybackManagerClass MusicPlaybackManagerClass;
typedef struct _Block5Data Block5Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MusicAlbumImagePrivate MusicAlbumImagePrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define MUSIC_TYPE_AUDIO_OBJECT (music_audio_object_get_type ())
#define MUSIC_AUDIO_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObject))
#define MUSIC_AUDIO_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObjectClass))
#define MUSIC_IS_AUDIO_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MUSIC_TYPE_AUDIO_OBJECT))
#define MUSIC_IS_AUDIO_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MUSIC_TYPE_AUDIO_OBJECT))
#define MUSIC_AUDIO_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MUSIC_TYPE_AUDIO_OBJECT, MusicAudioObjectClass))

typedef struct _MusicAudioObject MusicAudioObject;
typedef struct _MusicAudioObjectClass MusicAudioObjectClass;

struct _MusicNowPlayingView {
	GtkBox parent_instance;
	MusicNowPlayingViewPrivate * priv;
};

struct _MusicNowPlayingViewClass {
	GtkBoxClass parent_class;
};

struct _Block5Data {
	int _ref_count_;
	MusicNowPlayingView* self;
	MusicAlbumImage* album_image;
	GtkLabel* title_label;
	GtkLabel* artist_label;
	GtkRevealer* artist_revealer;
	MusicSeekBar* seekbar;
	GtkImage* play_pause_image;
	GtkButton* play_button;
	MusicPlaybackManager* playback_manager;
};

struct _MusicAlbumImage {
	GtkGrid parent_instance;
	MusicAlbumImagePrivate * priv;
	GtkImage* image;
};

struct _MusicAlbumImageClass {
	GtkGridClass parent_class;
};

static gpointer music_now_playing_view_parent_class = NULL;

VALA_EXTERN GType music_now_playing_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicNowPlayingView, g_object_unref)
VALA_EXTERN MusicNowPlayingView* music_now_playing_view_new (void);
VALA_EXTERN MusicNowPlayingView* music_now_playing_view_construct (GType object_type);
static GObject * music_now_playing_view_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties);
VALA_EXTERN GType music_album_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicAlbumImage, g_object_unref)
VALA_EXTERN GType music_seek_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicSeekBar, g_object_unref)
VALA_EXTERN GType music_playback_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicPlaybackManager, g_object_unref)
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
VALA_EXTERN MusicAlbumImage* music_album_image_new (void);
VALA_EXTERN MusicAlbumImage* music_album_image_construct (GType object_type);
VALA_EXTERN MusicSeekBar* music_seek_bar_new (void);
VALA_EXTERN MusicSeekBar* music_seek_bar_construct (GType object_type);
static void _music_now_playing_view___lambda13_ (Block5Data* _data5_,
                                          const gchar* name,
                                          GVariant* new_state);
static void __music_now_playing_view___lambda13__g_action_group_action_state_changed (GActionGroup* _sender,
                                                                               const gchar* action_name,
                                                                               GVariant* state,
                                                                               gpointer self);
VALA_EXTERN MusicPlaybackManager* music_playback_manager_get_default (void);
static void _music_now_playing_view___lambda14_ (Block5Data* _data5_);
VALA_EXTERN GType music_audio_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MusicAudioObject, g_object_unref)
VALA_EXTERN MusicAudioObject* music_playback_manager_get_current_audio (MusicPlaybackManager* self);
VALA_EXTERN void music_seek_bar_set_playback_duration (MusicSeekBar* self,
                                           gint64 value);
VALA_EXTERN void music_seek_bar_set_playback_position (MusicSeekBar* self,
                                           gint64 value);
static void __music_now_playing_view___lambda14__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self);
static void _music_now_playing_view___lambda15_ (Block5Data* _data5_);
static void __music_now_playing_view___lambda15__g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self);
static GType music_now_playing_view_get_type_once (void);

MusicNowPlayingView*
music_now_playing_view_construct (GType object_type)
{
	MusicNowPlayingView * self = NULL;
	self = (MusicNowPlayingView*) g_object_new (object_type, NULL);
	return self;
}

MusicNowPlayingView*
music_now_playing_view_new (void)
{
	return music_now_playing_view_construct (MUSIC_TYPE_NOW_PLAYING_VIEW);
}

static Block5Data*
block5_data_ref (Block5Data* _data5_)
{
	g_atomic_int_inc (&_data5_->_ref_count_);
	return _data5_;
}

static void
block5_data_unref (void * _userdata_)
{
	Block5Data* _data5_;
	_data5_ = (Block5Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
		MusicNowPlayingView* self;
		self = _data5_->self;
		_g_object_unref0 (_data5_->playback_manager);
		_g_object_unref0 (_data5_->play_button);
		_g_object_unref0 (_data5_->play_pause_image);
		_g_object_unref0 (_data5_->seekbar);
		_g_object_unref0 (_data5_->artist_revealer);
		_g_object_unref0 (_data5_->artist_label);
		_g_object_unref0 (_data5_->title_label);
		_g_object_unref0 (_data5_->album_image);
		_g_object_unref0 (self);
		g_slice_free (Block5Data, _data5_);
	}
}

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

static void
_music_now_playing_view___lambda13_ (Block5Data* _data5_,
                                     const gchar* name,
                                     GVariant* new_state)
{
	MusicNowPlayingView* self;
	self = _data5_->self;
	g_return_if_fail (name != NULL);
	g_return_if_fail (new_state != NULL);
	if (g_strcmp0 (name, MUSIC_APPLICATION_ACTION_PLAY_PAUSE) == 0) {
		if (g_variant_get_boolean (new_state) == FALSE) {
			GtkImage* _tmp0_;
			GtkButton* _tmp1_;
			_tmp0_ = _data5_->play_pause_image;
			g_object_set (_tmp0_, "icon-name", "media-playback-start-symbolic", NULL);
			_tmp1_ = _data5_->play_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, _ ("Play"));
		} else {
			GtkImage* _tmp2_;
			GtkButton* _tmp3_;
			_tmp2_ = _data5_->play_pause_image;
			g_object_set (_tmp2_, "icon-name", "media-playback-pause-symbolic", NULL);
			_tmp3_ = _data5_->play_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, _ ("Pause"));
		}
	}
}

static void
__music_now_playing_view___lambda13__g_action_group_action_state_changed (GActionGroup* _sender,
                                                                          const gchar* action_name,
                                                                          GVariant* state,
                                                                          gpointer self)
{
	_music_now_playing_view___lambda13_ (self, action_name, state);
}

static void
_music_now_playing_view___lambda14_ (Block5Data* _data5_)
{
	MusicNowPlayingView* self;
	MusicPlaybackManager* _tmp0_;
	MusicAudioObject* _tmp1_;
	MusicAudioObject* _tmp2_;
	self = _data5_->self;
	_tmp0_ = _data5_->playback_manager;
	_tmp1_ = music_playback_manager_get_current_audio (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		MusicPlaybackManager* _tmp3_;
		MusicAudioObject* _tmp4_;
		MusicAudioObject* _tmp5_;
		GtkLabel* _tmp6_;
		MusicPlaybackManager* _tmp7_;
		MusicAudioObject* _tmp8_;
		MusicAudioObject* _tmp9_;
		GtkLabel* _tmp10_;
		MusicPlaybackManager* _tmp11_;
		MusicAudioObject* _tmp12_;
		MusicAudioObject* _tmp13_;
		MusicSeekBar* _tmp14_;
		MusicPlaybackManager* _tmp15_;
		MusicAudioObject* _tmp16_;
		MusicAudioObject* _tmp17_;
		MusicAlbumImage* _tmp18_;
		GtkImage* _tmp19_;
		_tmp3_ = _data5_->playback_manager;
		_tmp4_ = music_playback_manager_get_current_audio (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _data5_->artist_label;
		g_object_bind_property_with_closures ((GObject*) _tmp5_, "artist", (GObject*) _tmp6_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp7_ = _data5_->playback_manager;
		_tmp8_ = music_playback_manager_get_current_audio (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _data5_->title_label;
		g_object_bind_property_with_closures ((GObject*) _tmp9_, "title", (GObject*) _tmp10_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp11_ = _data5_->playback_manager;
		_tmp12_ = music_playback_manager_get_current_audio (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _data5_->seekbar;
		g_object_bind_property_with_closures ((GObject*) _tmp13_, "duration", (GObject*) _tmp14_, "playback-duration", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp15_ = _data5_->playback_manager;
		_tmp16_ = music_playback_manager_get_current_audio (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = _data5_->album_image;
		_tmp19_ = _tmp18_->image;
		g_object_bind_property_with_closures ((GObject*) _tmp17_, "texture", (GObject*) _tmp19_, "paintable", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	} else {
		MusicAlbumImage* _tmp20_;
		GtkImage* _tmp21_;
		GtkLabel* _tmp22_;
		GtkLabel* _tmp23_;
		MusicSeekBar* _tmp24_;
		MusicSeekBar* _tmp25_;
		_tmp20_ = _data5_->album_image;
		_tmp21_ = _tmp20_->image;
		gtk_image_clear (_tmp21_);
		_tmp22_ = _data5_->artist_label;
		gtk_label_set_label (_tmp22_, _ ("Not playing"));
		_tmp23_ = _data5_->title_label;
		gtk_label_set_label (_tmp23_, _ ("Music"));
		_tmp24_ = _data5_->seekbar;
		music_seek_bar_set_playback_duration (_tmp24_, (gint64) 0);
		_tmp25_ = _data5_->seekbar;
		music_seek_bar_set_playback_position (_tmp25_, (gint64) 0);
	}
}

static void
__music_now_playing_view___lambda14__g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self)
{
	_music_now_playing_view___lambda14_ (self);
}

static void
_music_now_playing_view___lambda15_ (Block5Data* _data5_)
{
	MusicNowPlayingView* self;
	GtkRevealer* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	self = _data5_->self;
	_tmp0_ = _data5_->artist_revealer;
	_tmp1_ = _data5_->artist_label;
	_tmp2_ = gtk_label_get_label (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, g_strcmp0 (_tmp3_, "") != 0);
}

static void
__music_now_playing_view___lambda15__g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self)
{
	_music_now_playing_view___lambda15_ (self);
}

static GObject *
music_now_playing_view_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	MusicNowPlayingView * self;
	Block5Data* _data5_;
	MusicAlbumImage* _tmp0_;
	MusicAlbumImage* _tmp1_;
	GtkImage* _tmp2_;
	MusicAlbumImage* _tmp3_;
	GtkImage* _tmp4_;
	MusicAlbumImage* _tmp5_;
	GtkImage* _tmp6_;
	MusicAlbumImage* _tmp7_;
	GtkImage* _tmp8_;
	GtkAspectFrame* aspect_frame = NULL;
	MusicAlbumImage* _tmp9_;
	GtkWidget* _tmp10_;
	GtkAspectFrame* _tmp11_ = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkLabel* _tmp13_;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_;
	GtkWidget* _tmp16_;
	GtkRevealer* _tmp17_ = NULL;
	GtkGrid* info_grid = NULL;
	GtkGrid* _tmp18_ = NULL;
	GtkGrid* _tmp19_;
	GtkLabel* _tmp20_;
	GtkGrid* _tmp21_;
	GtkRevealer* _tmp22_;
	MusicSeekBar* _tmp23_;
	GtkImage* previous_image = NULL;
	GtkImage* _tmp24_ = NULL;
	GtkButton* previous_button = NULL;
	gchar* _tmp25_;
	GtkImage* _tmp26_;
	GtkWidget* _tmp27_;
	gchar* _tmp28_;
	GtkButton* _tmp29_ = NULL;
	GtkButton* _tmp30_;
	GtkImage* _tmp31_ = NULL;
	gchar* _tmp32_;
	GtkImage* _tmp33_;
	GtkWidget* _tmp34_;
	GtkButton* _tmp35_ = NULL;
	GtkButton* _tmp36_;
	GtkImage* next_image = NULL;
	GtkImage* _tmp37_ = NULL;
	GtkButton* next_button = NULL;
	gchar* _tmp38_;
	GtkImage* _tmp39_;
	GtkWidget* _tmp40_;
	gchar* _tmp41_;
	GtkButton* _tmp42_ = NULL;
	GtkButton* _tmp43_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp44_ = NULL;
	GtkGrid* _tmp45_;
	GtkGrid* _tmp46_;
	GtkGrid* _tmp47_;
	MusicSeekBar* _tmp48_;
	GtkGrid* _tmp49_;
	GtkButton* _tmp50_;
	GtkGrid* _tmp51_;
	GtkButton* _tmp52_;
	GtkGrid* _tmp53_;
	GtkButton* _tmp54_;
	GtkAspectFrame* _tmp55_;
	GtkGrid* _tmp56_;
	GApplication* _tmp57_;
	GAction* play_pause_action = NULL;
	GApplication* _tmp58_;
	GAction* _tmp59_;
	GAction* _tmp60_;
	GAction* _tmp61_;
	MusicSeekBar* _tmp62_;
	MusicPlaybackManager* _tmp63_;
	MusicPlaybackManager* _tmp64_;
	MusicPlaybackManager* _tmp65_;
	MusicSeekBar* _tmp66_;
	MusicPlaybackManager* _tmp67_;
	GtkLabel* _tmp68_;
	parent_class = G_OBJECT_CLASS (music_now_playing_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MUSIC_TYPE_NOW_PLAYING_VIEW, MusicNowPlayingView);
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->self = g_object_ref (self);
	_tmp0_ = music_album_image_new ();
	g_object_ref_sink (_tmp0_);
	_data5_->album_image = _tmp0_;
	_tmp1_ = _data5_->album_image;
	_tmp2_ = _tmp1_->image;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	_tmp3_ = _data5_->album_image;
	_tmp4_ = _tmp3_->image;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp4_, TRUE);
	_tmp5_ = _data5_->album_image;
	_tmp6_ = _tmp5_->image;
	g_object_set ((GtkWidget*) _tmp6_, "height-request", 128, NULL);
	_tmp7_ = _data5_->album_image;
	_tmp8_ = _tmp7_->image;
	g_object_set ((GtkWidget*) _tmp8_, "width-request", 128, NULL);
	_tmp9_ = _data5_->album_image;
	_tmp10_ = _g_object_ref0 ((GtkWidget*) _tmp9_);
	_tmp11_ = (GtkAspectFrame*) gtk_aspect_frame_new (0.5f, 1.0f, (gfloat) 1, FALSE);
	gtk_aspect_frame_set_child (_tmp11_, _tmp10_);
	_g_object_unref0 (_tmp10_);
	g_object_ref_sink (_tmp11_);
	aspect_frame = _tmp11_;
	_tmp12_ = (GtkLabel*) gtk_label_new (_ ("Music"));
	gtk_label_set_ellipsize (_tmp12_, PANGO_ELLIPSIZE_MIDDLE);
	g_object_ref_sink (_tmp12_);
	_data5_->title_label = _tmp12_;
	_tmp13_ = _data5_->title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp13_, GRANITE_STYLE_CLASS_H3_LABEL);
	_tmp14_ = (GtkLabel*) gtk_label_new (_ ("Not playing"));
	gtk_label_set_ellipsize (_tmp14_, PANGO_ELLIPSIZE_MIDDLE);
	g_object_ref_sink (_tmp14_);
	_data5_->artist_label = _tmp14_;
	_tmp15_ = _data5_->artist_label;
	_tmp16_ = _g_object_ref0 ((GtkWidget*) _tmp15_);
	_tmp17_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp17_, _tmp16_);
	_g_object_unref0 (_tmp16_);
	g_object_ref_sink (_tmp17_);
	_data5_->artist_revealer = _tmp17_;
	_tmp18_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp18_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp18_);
	info_grid = _tmp18_;
	_tmp19_ = info_grid;
	_tmp20_ = _data5_->title_label;
	gtk_grid_attach (_tmp19_, (GtkWidget*) _tmp20_, 0, 0, 1, 1);
	_tmp21_ = info_grid;
	_tmp22_ = _data5_->artist_revealer;
	gtk_grid_attach (_tmp21_, (GtkWidget*) _tmp22_, 0, 1, 1, 1);
	_tmp23_ = music_seek_bar_new ();
	g_object_ref_sink (_tmp23_);
	_data5_->seekbar = _tmp23_;
	_tmp24_ = (GtkImage*) gtk_image_new_from_icon_name ("media-skip-backward-symbolic");
	gtk_image_set_pixel_size (_tmp24_, 24);
	g_object_ref_sink (_tmp24_);
	previous_image = _tmp24_;
	_tmp25_ = g_strdup (MUSIC_APPLICATION_ACTION_PREFIX MUSIC_APPLICATION_ACTION_PREVIOUS);
	_tmp26_ = previous_image;
	_tmp27_ = _g_object_ref0 ((GtkWidget*) _tmp26_);
	_tmp28_ = g_strdup (_ ("Previous"));
	_tmp29_ = (GtkButton*) gtk_button_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp29_, _tmp25_);
	_g_free0 (_tmp25_);
	gtk_button_set_child (_tmp29_, _tmp27_);
	_g_object_unref0 (_tmp27_);
	gtk_widget_set_halign ((GtkWidget*) _tmp29_, GTK_ALIGN_END);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp29_, _tmp28_);
	_g_free0 (_tmp28_);
	g_object_ref_sink (_tmp29_);
	previous_button = _tmp29_;
	_tmp30_ = previous_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp30_, "image-button");
	_tmp31_ = (GtkImage*) gtk_image_new_from_icon_name ("media-playback-start-symbolic");
	gtk_image_set_pixel_size (_tmp31_, 24);
	g_object_ref_sink (_tmp31_);
	_data5_->play_pause_image = _tmp31_;
	_tmp32_ = g_strdup (MUSIC_APPLICATION_ACTION_PREFIX MUSIC_APPLICATION_ACTION_PLAY_PAUSE);
	_tmp33_ = _data5_->play_pause_image;
	_tmp34_ = _g_object_ref0 ((GtkWidget*) _tmp33_);
	_tmp35_ = (GtkButton*) gtk_button_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp35_, _tmp32_);
	_g_free0 (_tmp32_);
	gtk_button_set_child (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	gtk_widget_set_halign ((GtkWidget*) _tmp35_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp35_);
	_data5_->play_button = _tmp35_;
	_tmp36_ = _data5_->play_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp36_, "image-button");
	_tmp37_ = (GtkImage*) gtk_image_new_from_icon_name ("media-skip-forward-symbolic");
	gtk_image_set_pixel_size (_tmp37_, 24);
	g_object_ref_sink (_tmp37_);
	next_image = _tmp37_;
	_tmp38_ = g_strdup (MUSIC_APPLICATION_ACTION_PREFIX MUSIC_APPLICATION_ACTION_NEXT);
	_tmp39_ = next_image;
	_tmp40_ = _g_object_ref0 ((GtkWidget*) _tmp39_);
	_tmp41_ = g_strdup (_ ("Next"));
	_tmp42_ = (GtkButton*) gtk_button_new ();
	gtk_actionable_set_action_name ((GtkActionable*) _tmp42_, _tmp38_);
	_g_free0 (_tmp38_);
	gtk_button_set_child (_tmp42_, _tmp40_);
	_g_object_unref0 (_tmp40_);
	gtk_widget_set_halign ((GtkWidget*) _tmp42_, GTK_ALIGN_START);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp42_, _tmp41_);
	_g_free0 (_tmp41_);
	g_object_ref_sink (_tmp42_);
	next_button = _tmp42_;
	_tmp43_ = next_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp43_, "image-button");
	_tmp44_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp44_, 12);
	gtk_grid_set_row_spacing (_tmp44_, 24);
	gtk_widget_set_valign ((GtkWidget*) _tmp44_, GTK_ALIGN_START);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp44_, TRUE);
	g_object_ref_sink (_tmp44_);
	grid = _tmp44_;
	_tmp45_ = grid;
	_tmp46_ = info_grid;
	gtk_grid_attach (_tmp45_, (GtkWidget*) _tmp46_, 0, 1, 3, 1);
	_tmp47_ = grid;
	_tmp48_ = _data5_->seekbar;
	gtk_grid_attach (_tmp47_, (GtkWidget*) _tmp48_, 0, 2, 3, 1);
	_tmp49_ = grid;
	_tmp50_ = previous_button;
	gtk_grid_attach (_tmp49_, (GtkWidget*) _tmp50_, 0, 3, 1, 1);
	_tmp51_ = grid;
	_tmp52_ = _data5_->play_button;
	gtk_grid_attach (_tmp51_, (GtkWidget*) _tmp52_, 1, 3, 1, 1);
	_tmp53_ = grid;
	_tmp54_ = next_button;
	gtk_grid_attach (_tmp53_, (GtkWidget*) _tmp54_, 2, 3, 1, 1);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	gtk_box_set_spacing ((GtkBox*) self, 24);
	_tmp55_ = aspect_frame;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp55_);
	_tmp56_ = grid;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp56_);
	_tmp57_ = g_application_get_default ();
	g_signal_connect_data ((GActionGroup*) _tmp57_, "action-state-changed", (GCallback) __music_now_playing_view___lambda13__g_action_group_action_state_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_tmp58_ = g_application_get_default ();
	_tmp59_ = g_action_map_lookup_action ((GActionMap*) _tmp58_, MUSIC_APPLICATION_ACTION_PLAY_PAUSE);
	_tmp60_ = _g_object_ref0 (_tmp59_);
	play_pause_action = _tmp60_;
	_tmp61_ = play_pause_action;
	_tmp62_ = _data5_->seekbar;
	g_object_bind_property_with_closures ((GObject*) _tmp61_, "enabled", (GObject*) _tmp62_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp63_ = music_playback_manager_get_default ();
	_tmp64_ = _g_object_ref0 (_tmp63_);
	_data5_->playback_manager = _tmp64_;
	_tmp65_ = _data5_->playback_manager;
	_tmp66_ = _data5_->seekbar;
	g_object_bind_property_with_closures ((GObject*) _tmp65_, "playback-position", (GObject*) _tmp66_, "playback-position", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp67_ = _data5_->playback_manager;
	g_signal_connect_data ((GObject*) _tmp67_, "notify::current-audio", (GCallback) __music_now_playing_view___lambda14__g_object_notify, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_tmp68_ = _data5_->artist_label;
	g_signal_connect_data ((GObject*) _tmp68_, "notify::label", (GCallback) __music_now_playing_view___lambda15__g_object_notify, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
	_g_object_unref0 (play_pause_action);
	_g_object_unref0 (grid);
	_g_object_unref0 (next_button);
	_g_object_unref0 (next_image);
	_g_object_unref0 (previous_button);
	_g_object_unref0 (previous_image);
	_g_object_unref0 (info_grid);
	_g_object_unref0 (aspect_frame);
	block5_data_unref (_data5_);
	_data5_ = NULL;
	return obj;
}

static void
music_now_playing_view_class_init (MusicNowPlayingViewClass * klass,
                                   gpointer klass_data)
{
	music_now_playing_view_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = music_now_playing_view_constructor;
}

static void
music_now_playing_view_instance_init (MusicNowPlayingView * self,
                                      gpointer klass)
{
}

static GType
music_now_playing_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MusicNowPlayingViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) music_now_playing_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MusicNowPlayingView), 0, (GInstanceInitFunc) music_now_playing_view_instance_init, NULL };
	GType music_now_playing_view_type_id;
	music_now_playing_view_type_id = g_type_register_static (gtk_box_get_type (), "MusicNowPlayingView", &g_define_type_info, 0);
	return music_now_playing_view_type_id;
}

GType
music_now_playing_view_get_type (void)
{
	static volatile gsize music_now_playing_view_type_id__once = 0;
	if (g_once_init_enter (&music_now_playing_view_type_id__once)) {
		GType music_now_playing_view_type_id;
		music_now_playing_view_type_id = music_now_playing_view_get_type_once ();
		g_once_init_leave (&music_now_playing_view_type_id__once, music_now_playing_view_type_id);
	}
	return music_now_playing_view_type_id__once;
}

