/* application.c generated by valac 0.56.19, the Vala compiler
 * generated from application.vala, do not modify */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include "config.h"
#include <glib/gi18n-lib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>

#define G4_SORT_MODE_TITLE ((guint) 3)
#define G4_THUMBNAILER_ICON_SIZE 48
#define G4_ACTION_SCHEME "scheme"
#define G4_ACTION_SORT "sort"
#define G4_PAGE_NAME_PLAYING "playing"
#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 G4_TYPE_APPLICATION (g4_application_get_type ())
#define G4_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_APPLICATION, G4Application))
#define G4_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_APPLICATION, G4ApplicationClass))
#define G4_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_APPLICATION))
#define G4_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_APPLICATION))
#define G4_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_APPLICATION, G4ApplicationClass))

typedef struct _G4Application G4Application;
typedef struct _G4ApplicationClass G4ApplicationClass;
typedef struct _G4ApplicationPrivate G4ApplicationPrivate;

#define G4_TYPE_ACTION_HANDLES (g4_action_handles_get_type ())
#define G4_ACTION_HANDLES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_ACTION_HANDLES, G4ActionHandles))
#define G4_ACTION_HANDLES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_ACTION_HANDLES, G4ActionHandlesClass))
#define G4_IS_ACTION_HANDLES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_ACTION_HANDLES))
#define G4_IS_ACTION_HANDLES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_ACTION_HANDLES))
#define G4_ACTION_HANDLES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_ACTION_HANDLES, G4ActionHandlesClass))

typedef struct _G4ActionHandles G4ActionHandles;
typedef struct _G4ActionHandlesClass G4ActionHandlesClass;

#define G4_TYPE_MUSIC (g4_music_get_type ())
#define G4_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC, G4Music))
#define G4_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC, G4MusicClass))
#define G4_IS_MUSIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC))
#define G4_IS_MUSIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC))
#define G4_MUSIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC, G4MusicClass))

typedef struct _G4Music G4Music;
typedef struct _G4MusicClass G4MusicClass;

#define G4_TYPE_MUSIC_LOADER (g4_music_loader_get_type ())
#define G4_MUSIC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC_LOADER, G4MusicLoader))
#define G4_MUSIC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC_LOADER, G4MusicLoaderClass))
#define G4_IS_MUSIC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC_LOADER))
#define G4_IS_MUSIC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC_LOADER))
#define G4_MUSIC_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC_LOADER, G4MusicLoaderClass))

typedef struct _G4MusicLoader G4MusicLoader;
typedef struct _G4MusicLoaderClass G4MusicLoaderClass;

#define G4_TYPE_GST_PLAYER (g4_gst_player_get_type ())
#define G4_GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_GST_PLAYER, G4GstPlayer))
#define G4_GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_GST_PLAYER, G4GstPlayerClass))
#define G4_IS_GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_GST_PLAYER))
#define G4_IS_GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_GST_PLAYER))
#define G4_GST_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_GST_PLAYER, G4GstPlayerClass))

typedef struct _G4GstPlayer G4GstPlayer;
typedef struct _G4GstPlayerClass G4GstPlayerClass;

#define G4_TYPE_THUMBNAILER (g4_thumbnailer_get_type ())
#define G4_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_THUMBNAILER, G4Thumbnailer))
#define G4_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_THUMBNAILER, G4ThumbnailerClass))
#define G4_IS_THUMBNAILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_THUMBNAILER))
#define G4_IS_THUMBNAILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_THUMBNAILER))
#define G4_THUMBNAILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_THUMBNAILER, G4ThumbnailerClass))

typedef struct _G4Thumbnailer G4Thumbnailer;
typedef struct _G4ThumbnailerClass G4ThumbnailerClass;
enum  {
	G4_APPLICATION_0_PROPERTY,
	G4_APPLICATION_COLOR_SCHEME_PROPERTY,
	G4_APPLICATION_CURRENT_COVER_PROPERTY,
	G4_APPLICATION_CURRENT_ITEM_PROPERTY,
	G4_APPLICATION_CURRENT_LIST_PROPERTY,
	G4_APPLICATION_CURRENT_MUSIC_PROPERTY,
	G4_APPLICATION_ICON_PROPERTY,
	G4_APPLICATION_LIST_MODIFIED_PROPERTY,
	G4_APPLICATION_LOADER_PROPERTY,
	G4_APPLICATION_LOADING_PROPERTY,
	G4_APPLICATION_MUSIC_FOLDER_PROPERTY,
	G4_APPLICATION_MUSIC_QUEUE_PROPERTY,
	G4_APPLICATION_NAME_PROPERTY,
	G4_APPLICATION_PLAYER_PROPERTY,
	G4_APPLICATION_SETTINGS_PROPERTY,
	G4_APPLICATION_SINGLE_LOOP_PROPERTY,
	G4_APPLICATION_SORT_MODE_PROPERTY,
	G4_APPLICATION_THUMBNAILER_PROPERTY,
	G4_APPLICATION_NUM_PROPERTIES
};
static GParamSpec* g4_application_properties[G4_APPLICATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gst_sample_unref0(var) ((var == NULL) ? NULL : (var = (gst_sample_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define G4_TYPE_COVER_CACHE (g4_cover_cache_get_type ())
#define G4_COVER_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_COVER_CACHE, G4CoverCache))
#define G4_COVER_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_COVER_CACHE, G4CoverCacheClass))
#define G4_IS_COVER_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_COVER_CACHE))
#define G4_IS_COVER_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_COVER_CACHE))
#define G4_COVER_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_COVER_CACHE, G4CoverCacheClass))

typedef struct _G4CoverCache G4CoverCache;
typedef struct _G4CoverCacheClass G4CoverCacheClass;

#define G4_TYPE_WINDOW (g4_window_get_type ())
#define G4_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_WINDOW, G4Window))
#define G4_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_WINDOW, G4WindowClass))
#define G4_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_WINDOW))
#define G4_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_WINDOW))
#define G4_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_WINDOW, G4WindowClass))

typedef struct _G4Window G4Window;
typedef struct _G4WindowClass G4WindowClass;
typedef struct _Block3Data Block3Data;
typedef struct _G4MusicPrivate G4MusicPrivate;

#define G4_TYPE_MUSIC_LIBRARY (g4_music_library_get_type ())
#define G4_MUSIC_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MUSIC_LIBRARY, G4MusicLibrary))
#define G4_MUSIC_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MUSIC_LIBRARY, G4MusicLibraryClass))
#define G4_IS_MUSIC_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MUSIC_LIBRARY))
#define G4_IS_MUSIC_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MUSIC_LIBRARY))
#define G4_MUSIC_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MUSIC_LIBRARY, G4MusicLibraryClass))

typedef struct _G4MusicLibrary G4MusicLibrary;
typedef struct _G4MusicLibraryClass G4MusicLibraryClass;

#define G4_TYPE_ALBUM (g4_album_get_type ())
#define G4_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_ALBUM, G4Album))
#define G4_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_ALBUM, G4AlbumClass))
#define G4_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_ALBUM))
#define G4_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_ALBUM))
#define G4_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_ALBUM, G4AlbumClass))

typedef struct _G4Album G4Album;
typedef struct _G4AlbumClass G4AlbumClass;

#define G4_TYPE_PLAYLIST (g4_playlist_get_type ())
#define G4_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_PLAYLIST, G4Playlist))
#define G4_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_PLAYLIST, G4PlaylistClass))
#define G4_IS_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_PLAYLIST))
#define G4_IS_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_PLAYLIST))
#define G4_PLAYLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_PLAYLIST, G4PlaylistClass))

typedef struct _G4Playlist G4Playlist;
typedef struct _G4PlaylistClass G4PlaylistClass;
typedef struct _Block4Data Block4Data;
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
typedef struct _G4AlbumPrivate G4AlbumPrivate;
typedef struct _G4PlaylistPrivate G4PlaylistPrivate;
typedef gpointer (*G4TaskFunc) (gpointer user_data);
typedef struct _Block5Data Block5Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _G4ApplicationAddPlaylistToFileAsyncData G4ApplicationAddPlaylistToFileAsyncData;
typedef struct _G4ApplicationLoadMusicFolderAsyncData G4ApplicationLoadMusicFolderAsyncData;
typedef struct _G4ApplicationOpenFilesAsyncData G4ApplicationOpenFilesAsyncData;
typedef struct _Block6Data Block6Data;

#define G4_TYPE_PORTAL (g4_portal_get_type ())
#define G4_PORTAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_PORTAL, G4Portal))
#define G4_PORTAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_PORTAL, G4PortalClass))
#define G4_IS_PORTAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_PORTAL))
#define G4_IS_PORTAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_PORTAL))
#define G4_PORTAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_PORTAL, G4PortalClass))

typedef struct _G4Portal G4Portal;
typedef struct _G4PortalClass G4PortalClass;
typedef struct _Block7Data Block7Data;
#define _g4_portal_unref0(var) ((var == NULL) ? NULL : (var = (g4_portal_unref (var), NULL)))
typedef struct _Block8Data Block8Data;
typedef struct _G4ApplicationRenamePlaylistAsyncData G4ApplicationRenamePlaylistAsyncData;
typedef struct _Block9Data Block9Data;
typedef struct _G4ApplicationSaveQueueToFileData G4ApplicationSaveQueueToFileData;

#define G4_TYPE_ARTIST (g4_artist_get_type ())
#define G4_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_ARTIST, G4Artist))
#define G4_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_ARTIST, G4ArtistClass))
#define G4_IS_ARTIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_ARTIST))
#define G4_IS_ARTIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_ARTIST))
#define G4_ARTIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_ARTIST, G4ArtistClass))

typedef struct _G4Artist G4Artist;
typedef struct _G4ArtistClass G4ArtistClass;
typedef struct _G4ApplicationSaveToPlaylistFileAsyncData G4ApplicationSaveToPlaylistFileAsyncData;

#define G4_TYPE_DIALOG (g4_dialog_get_type ())
#define G4_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_DIALOG, G4Dialog))
#define G4_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_DIALOG, G4DialogClass))
#define G4_IS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_DIALOG))
#define G4_IS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_DIALOG))
#define G4_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_DIALOG, G4DialogClass))

typedef struct _G4Dialog G4Dialog;
typedef struct _G4DialogClass G4DialogClass;

#define G4_TYPE_PLAYLIST_DIALOG (g4_playlist_dialog_get_type ())
#define G4_PLAYLIST_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_PLAYLIST_DIALOG, G4PlaylistDialog))
#define G4_PLAYLIST_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_PLAYLIST_DIALOG, G4PlaylistDialogClass))
#define G4_IS_PLAYLIST_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_PLAYLIST_DIALOG))
#define G4_IS_PLAYLIST_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_PLAYLIST_DIALOG))
#define G4_PLAYLIST_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_PLAYLIST_DIALOG, G4PlaylistDialogClass))

typedef struct _G4PlaylistDialog G4PlaylistDialog;
typedef struct _G4PlaylistDialogClass G4PlaylistDialogClass;
typedef struct _G4ApplicationShowAddPlaylistDialogData G4ApplicationShowAddPlaylistDialogData;
typedef struct _G4ApplicationDeleteCoverTmpFileAsyncData G4ApplicationDeleteCoverTmpFileAsyncData;

#define G4_TYPE_MPRIS_PLAYER (g4_mpris_player_get_type ())
#define G4_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MPRIS_PLAYER, G4MprisPlayer))
#define G4_MPRIS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MPRIS_PLAYER, G4MprisPlayerClass))
#define G4_IS_MPRIS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MPRIS_PLAYER))
#define G4_IS_MPRIS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MPRIS_PLAYER))
#define G4_MPRIS_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MPRIS_PLAYER, G4MprisPlayerClass))

typedef struct _G4MprisPlayer G4MprisPlayer;
typedef struct _G4MprisPlayerClass G4MprisPlayerClass;

#define G4_TYPE_MPRIS_ROOT (g4_mpris_root_get_type ())
#define G4_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G4_TYPE_MPRIS_ROOT, G4MprisRoot))
#define G4_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G4_TYPE_MPRIS_ROOT, G4MprisRootClass))
#define G4_IS_MPRIS_ROOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G4_TYPE_MPRIS_ROOT))
#define G4_IS_MPRIS_ROOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G4_TYPE_MPRIS_ROOT))
#define G4_MPRIS_ROOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G4_TYPE_MPRIS_ROOT, G4MprisRootClass))

typedef struct _G4MprisRoot G4MprisRoot;
typedef struct _G4MprisRootClass G4MprisRootClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef void (*G4VoidFunc) (gpointer user_data);
typedef struct _Block10Data Block10Data;
typedef struct _Block11Data Block11Data;
#define _gst_tag_list_unref0(var) ((var == NULL) ? NULL : (var = (gst_tag_list_unref (var), NULL)))
typedef struct _Block12Data Block12Data;
typedef struct _Block13Data Block13Data;
typedef struct _Block14Data Block14Data;
typedef struct _G4ApplicationOnPlayerTagParsedData G4ApplicationOnPlayerTagParsedData;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
enum  {
	G4_APPLICATION_INDEX_CHANGED_SIGNAL,
	G4_APPLICATION_MUSIC_CHANGED_SIGNAL,
	G4_APPLICATION_MUSIC_COVER_PARSED_SIGNAL,
	G4_APPLICATION_MUSIC_LIBRARY_CHANGED_SIGNAL,
	G4_APPLICATION_PLAYLIST_ADDED_SIGNAL,
	G4_APPLICATION_THUMBNAIL_CHANGED_SIGNAL,
	G4_APPLICATION_NUM_SIGNALS
};
static guint g4_application_signals[G4_APPLICATION_NUM_SIGNALS] = {0};
#define _gst_buffer_unref0(var) ((var == NULL) ? NULL : (var = (gst_buffer_unref (var), NULL)))
typedef struct _G4SaveSampleToFileAsyncData G4SaveSampleToFileAsyncData;
typedef struct _G4SaveTextToFileAsyncData G4SaveTextToFileAsyncData;

struct _G4Application {
	AdwApplication parent_instance;
	G4ApplicationPrivate * priv;
};

struct _G4ApplicationClass {
	AdwApplicationClass parent_class;
};

struct _G4ApplicationPrivate {
	G4ActionHandles* _actions;
	gint _current_index;
	guint _current_list_size;
	G4Music* _current_music;
	gchar* _current_uri;
	GstSample* _current_cover;
	gboolean _list_modified;
	gboolean _loading;
	gchar* _music_folder;
	guint _mpris_id;
	G4MusicLoader* _loader;
	GtkFilterListModel* _current_list;
	GListStore* _music_queue;
	GString* _next_uri;
	GRecMutex __lock__next_uri;
	G4GstPlayer* _player;
	GSettings* _settings;
	guint _sort_mode;
	gboolean _store_external_changed;
	G4Thumbnailer* _thumbnailer;
	GtkIconPaintable* _icon;
	gboolean _single_loop;
	gboolean _reloading;
	GFile* _cover_tmp_file;
	guint _pending_mic_handler;
	guint _pending_msc_handler;
	guint _inhibit_id;
	gint _cover_size;
};

struct _Block3Data {
	int _ref_count_;
	G4Application* self;
	gboolean initial;
	gboolean saved_modified;
	GFile* plist_file;
	gboolean load_plist;
};

struct _G4Music {
	GObject parent_instance;
	G4MusicPrivate * priv;
	gchar* album;
	gchar* artist;
	gchar* title;
	gchar* album_artist;
	guint32 date;
	gchar* genre;
	gint track;
	gint disc;
	gboolean has_cover;
	gint64 modified_time;
	gchar* uri;
	gchar* cover_uri;
	gchar* _album_key;
	gchar* _artist_key;
	gchar* _title_key;
	gint _order;
};

struct _G4MusicClass {
	GObjectClass parent_class;
	gchar* (*get_abbreviation) (G4Music* self);
};

struct _Block4Data {
	int _ref_count_;
	G4Application* self;
	GFile* file;
	GPtrArray* uris;
	G4Playlist* playlist;
	gboolean append;
	gpointer _async_data_;
};

struct _G4Album {
	G4Music parent_instance;
	G4AlbumPrivate * priv;
	GHashTable* _musics;
};

struct _G4AlbumClass {
	G4MusicClass parent_class;
	void (*get_sorted_musics) (G4Album* self, GPtrArray* musics);
	void (*sort) (G4Album* self, GPtrArray* arr);
};

struct _G4Playlist {
	G4Album parent_instance;
	G4PlaylistPrivate * priv;
	GPtrArray* items;
	gchar* list_uri;
};

struct _G4PlaylistClass {
	G4AlbumClass parent_class;
};

struct _Block5Data {
	int _ref_count_;
	Block4Data * _data4_;
	GHashTable* map;
};

struct _G4ApplicationAddPlaylistToFileAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	G4Playlist* playlist;
	gboolean append;
	gboolean result;
	Block4Data* _data4_;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	GPtrArray* _tmp2_;
	gboolean saved;
	gpointer _tmp3_;
	G4MusicLoader* _tmp4_;
	G4MusicLibrary* _tmp5_;
	G4MusicLibrary* _tmp6_;
	G4Playlist* _tmp7_;
	G4Playlist* _tmp8_;
	G4Window* _tmp9_;
	G4Window* _tmp10_;
};

struct _G4ApplicationLoadMusicFolderAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	GFile** files;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFile** _tmp3_;
	gint files_length1;
	gint _files_size_;
	GPtrArray* musics;
	GPtrArray* _tmp4_;
	G4MusicLoader* _tmp5_;
	GFile** _tmp6_;
	gint _tmp6__length1;
	GFile** _tmp7_;
	gint _tmp7__length1;
	GPtrArray* _tmp8_;
	GListStore* _tmp9_;
	GListStore* _tmp10_;
	GListStore* _tmp11_;
	GPtrArray* _tmp12_;
	gpointer* _tmp13_;
	gint _tmp13__length1;
	gboolean _tmp14_;
	G4Music* _tmp15_;
	GtkFilterListModel* _tmp16_;
};

struct _G4ApplicationOpenFilesAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	GFile** files;
	gint files_length1;
	guint position;
	gboolean play_now;
	gboolean result;
	G4Playlist* playlist;
	G4Playlist* _tmp0_;
	G4MusicLoader* _tmp1_;
	GFile** _tmp2_;
	gint _tmp2__length1;
	G4Playlist* _tmp3_;
	GPtrArray* _tmp4_;
	gboolean _tmp5_;
	G4Playlist* _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	gboolean _tmp9_;
	G4Music* _tmp10_;
	G4Playlist* _tmp11_;
};

struct _Block6Data {
	int _ref_count_;
	G4Application* self;
	GFile* file;
};

struct _Block7Data {
	int _ref_count_;
	G4Application* self;
	G4Portal* portal;
};

struct _Block8Data {
	int _ref_count_;
	G4Application* self;
	GFile* file;
	GPtrArray* uris;
	gchar* title;
	gpointer _async_data_;
};

struct _G4ApplicationRenamePlaylistAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	G4Playlist* playlist;
	gchar* title;
	gboolean result;
	Block8Data* _data8_;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	GPtrArray* _tmp4_;
	GPtrArray* _tmp5_;
	gboolean saved;
	gpointer _tmp6_;
	G4MusicLoader* _tmp7_;
	G4MusicLibrary* _tmp8_;
	G4MusicLibrary* _tmp9_;
	G4Playlist* _tmp10_;
	G4Playlist* _tmp11_;
};

struct _Block9Data {
	int _ref_count_;
	G4Application* self;
	GPtrArray* uris;
	GFile* file;
	gpointer _async_data_;
};

struct _G4ApplicationSaveQueueToFileData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	gboolean result;
	Block9Data* _data9_;
	guint count;
	GListStore* _tmp0_;
	GPtrArray* _tmp1_;
	gint i;
	gboolean _tmp2_;
	gint _tmp3_;
	G4Music* music;
	GListStore* _tmp4_;
	GObject* _tmp5_;
	GPtrArray* _tmp6_;
	G4Music* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GFile* _tmp10_;
	gboolean ret;
	gpointer _tmp11_;
};

struct _G4ApplicationSaveToPlaylistFileAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	G4Playlist* playlist;
	gchar* uri;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GFile* file;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	gboolean append;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GtkFileFilter* filter;
	GtkFileFilter* _tmp7_;
	GtkFileFilter* _tmp8_;
	GtkFileFilter* _tmp9_;
	GtkFileFilter* _tmp10_;
	GtkFileFilter* _tmp11_;
	GFile* initial;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GFile* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GFile* _tmp19_;
	GFile* _tmp20_;
	GFile* file_new;
	GtkWindow* _tmp21_;
	GtkWindow* _tmp22_;
	GFile* _tmp23_;
	GtkFileFilter* _tmp24_;
	GtkFileFilter* _tmp25_;
	GtkFileFilter** _tmp26_;
	GtkFileFilter** _tmp27_;
	gint _tmp27__length1;
	GFile* _tmp28_;
	GFile* _tmp29_;
	GFile* _tmp30_;
	GFile* _tmp31_;
	GFile* _tmp32_;
	GFile* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	GFile* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	GSettings* _tmp39_;
	const gchar* _tmp40_;
	gboolean saved;
	gboolean _tmp41_;
	G4Window* _tmp42_;
	G4Window* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
};

struct _G4ApplicationShowAddPlaylistDialogData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	G4Playlist* playlist;
	G4PlaylistDialog* dialog;
	G4PlaylistDialog* _tmp0_;
	G4Playlist* pls;
	G4PlaylistDialog* _tmp1_;
	G4Window* _tmp2_;
	G4Window* _tmp3_;
	G4Playlist* _tmp4_;
	G4Playlist* _tmp5_;
	G4Playlist* _tmp6_;
	gchar* list_uri;
	G4Playlist* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	const gchar* _tmp13_;
};

struct _G4ApplicationDeleteCoverTmpFileAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	GFile* _tmp0_;
	GFile* _tmp1_;
	GError* _inner_error0_;
};

struct _Block10Data {
	int _ref_count_;
	G4Application* self;
	GPtrArray* arr;
};

struct _Block11Data {
	int _ref_count_;
	GHashTable* self;
	GFunc func;
	gpointer func_target;
};

struct _Block12Data {
	int _ref_count_;
	G4Application* self;
	gchar* uri;
	gpointer _async_data_;
};

struct _Block13Data {
	int _ref_count_;
	Block12Data * _data12_;
	GdkPixbuf* pixbuf;
	GstSample* image;
};

struct _Block14Data {
	int _ref_count_;
	Block13Data * _data13_;
	gint size;
};

struct _G4ApplicationOnPlayerTagParsedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	G4Application* self;
	gchar* u;
	GstTagList* tags;
	Block12Data* _data12_;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	G4Music* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	Block13Data* _data13_;
	G4Music* _tmp6_;
	G4MusicLoader* _tmp7_;
	const gchar* _tmp8_;
	G4Music* _tmp9_;
	G4Music* _tmp10_;
	G4Music* _tmp11_;
	G4Music* music;
	G4Music* _tmp12_;
	G4Music* _tmp13_;
	G4Music* _tmp14_;
	G4Music* _tmp15_;
	G4Music* _tmp16_;
	G4Music* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	G4Music* _tmp20_;
	G4Music* _tmp21_;
	G4MusicLoader* _tmp22_;
	G4Music* _tmp23_;
	G4Music* _tmp24_;
	GstSample* _tmp25_;
	GstSample* _tmp26_;
	GstSample* _tmp27_;
	gboolean _tmp28_;
	GstSample* _tmp29_;
	gpointer _tmp30_;
	GstSample* _tmp31_;
	GstSample* _tmp32_;
	const gchar* _tmp33_;
	const gchar* _tmp34_;
	Block14Data* _data14_;
	G4Thumbnailer* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	GstSample* _tmp38_;
	gpointer _tmp39_;
	GdkPixbuf* _tmp40_;
	G4Thumbnailer* _tmp41_;
	G4Music* _tmp42_;
	GdkPixbuf* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	gchar* cover_uri;
	G4Music* _tmp46_;
	const gchar* _tmp47_;
	gchar* _tmp48_;
	const gchar* _tmp49_;
	GFile* dir;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	GFile* _tmp53_;
	gchar* name;
	G4Music* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	gchar* _tmp57_;
	GFile* file;
	GFile* _tmp58_;
	const gchar* _tmp59_;
	GFile* _tmp60_;
	GFile* _tmp61_;
	gchar* _tmp62_;
	GstSample* _tmp63_;
	GFile* _tmp64_;
	GstSample* _tmp65_;
	gchar* svg;
	G4Thumbnailer* _tmp66_;
	G4Music* _tmp67_;
	gchar* _tmp68_;
	GFile* _tmp69_;
	const gchar* _tmp70_;
	GFile* _tmp71_;
	GFile* _tmp72_;
	gchar* _tmp73_;
	gchar* _tmp74_;
	GCompareFunc _tmp75_;
	const gchar* _tmp76_;
	GFile* _tmp77_;
	GFile* _tmp78_;
	const gchar* _tmp79_;
	const gchar* _tmp80_;
	G4Music* _tmp81_;
	GdkPixbuf* _tmp82_;
	const gchar* _tmp83_;
	gboolean _tmp84_;
	GdkPixbuf* _tmp85_;
	G4Thumbnailer* _tmp86_;
	G4Music* _tmp87_;
	GdkPaintable* _tmp88_;
	GdkPaintable* _tmp89_;
	GdkPixbuf* minbuf;
	gpointer _tmp90_;
	GdkPixbuf* _tmp91_;
	GdkTexture* paintable;
	GdkPixbuf* _tmp92_;
	GdkTexture* _tmp93_;
	G4Thumbnailer* _tmp94_;
	G4Music* _tmp95_;
	GdkTexture* _tmp96_;
	G4Music* _tmp97_;
	GdkTexture* _tmp98_;
};

struct _G4SaveSampleToFileAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GFile* file;
	GstSample* sample;
	gboolean result;
	GstBuffer* buffer;
	GstBuffer* _tmp0_;
	GstBuffer* _tmp1_;
	GstMapInfo* info;
	GFileOutputStream* stream;
	GFileOutputStream* _tmp2_;
	GstBuffer* _tmp3_;
	GstBuffer* _tmp4_;
	gboolean* _tmp5_;
	GstMapInfo _tmp6_;
	gboolean _tmp7_;
	GstMapInfo _tmp8_;
	GstMapInfo* _tmp9_;
	gboolean* _tmp10_;
	gboolean* _tmp11_;
	gboolean* _tmp12_;
	gboolean _tmp13_;
	gboolean* _tmp14_;
	GstMapInfo* _tmp15_;
	GstMapInfo* _tmp16_;
	guint8* _tmp17_;
	gint _tmp17__length1;
	gint __tmp17__size_;
	guint8* _tmp18_;
	gint _tmp18__length1;
	gboolean _tmp19_;
	GFileOutputStream* _tmp20_;
	GstMapInfo* _tmp21_;
	GstBuffer* _tmp22_;
	GstBuffer* _tmp23_;
	GstMapInfo* _tmp24_;
	GstMapInfo _tmp25_;
	GError* _inner_error1_;
	GstMapInfo* _tmp26_;
	GstBuffer* _vala1__tmp22_;
	GstBuffer* _tmp27_;
	GstMapInfo* _tmp28_;
	GstMapInfo _tmp29_;
	GError* _inner_error0_;
};

struct _G4SaveTextToFileAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GFile* file;
	gchar* text;
	gboolean result;
	GFileOutputStream* stream;
	GFileOutputStream* _tmp0_;
	guint8* data;
	gint data_length1;
	gint _data_size_;
	gint size;
	gint _tmp1_;
	gint _tmp2_;
	gboolean _tmp3_;
	GFileOutputStream* _tmp4_;
	guint8* _tmp5_;
	gint _tmp5__length1;
	GError* _inner_error0_;
};

static gint G4Application_private_offset;
static gpointer g4_application_parent_class = NULL;

VALA_EXTERN GType g4_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Application, g_object_unref)
VALA_EXTERN GType g4_action_handles_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4ActionHandles, g_object_unref)
VALA_EXTERN GType g4_music_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Music, g_object_unref)
VALA_EXTERN GType g4_music_loader_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MusicLoader, g_object_unref)
VALA_EXTERN GType g4_gst_player_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4GstPlayer, g_object_unref)
VALA_EXTERN GType g4_thumbnailer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Thumbnailer, g_object_unref)
VALA_EXTERN G4MusicLoader* g4_music_loader_new (void);
VALA_EXTERN G4MusicLoader* g4_music_loader_construct (GType object_type);
VALA_EXTERN G4GstPlayer* g4_gst_player_new (void);
VALA_EXTERN G4GstPlayer* g4_gst_player_construct (GType object_type);
VALA_EXTERN G4Thumbnailer* g4_thumbnailer_new (void);
VALA_EXTERN G4Thumbnailer* g4_thumbnailer_construct (GType object_type);
VALA_EXTERN G4Application* g4_application_new (void);
VALA_EXTERN G4Application* g4_application_construct (GType object_type);
static void g4_application_real_startup (GApplication* base);
VALA_EXTERN void g4_music_loader_load_tag_cache (G4MusicLoader* self);
VALA_EXTERN G4ActionHandles* g4_action_handles_new (G4Application* app);
VALA_EXTERN G4ActionHandles* g4_action_handles_construct (GType object_type,
                                              G4Application* app);
static void g4_application_on_music_list_changed (G4Application* self,
                                           guint position,
                                           guint removed,
                                           guint added);
static void _g4_application_on_music_list_changed_g_list_model_items_changed (GListModel* _sender,
                                                                       guint position,
                                                                       guint removed,
                                                                       guint added,
                                                                       gpointer self);
static void g4_application_on_music_library_changed (G4Application* self,
                                              guint position,
                                              guint removed,
                                              guint added);
static void _g4_application_on_music_library_changed_g_list_model_items_changed (GListModel* _sender,
                                                                          guint position,
                                                                          guint removed,
                                                                          guint added,
                                                                          gpointer self);
static void __lambda46_ (G4Application* self,
                  gboolean loading);
static void ___lambda46__g4_music_loader_loading_changed (G4MusicLoader* _sender,
                                                   gboolean loading,
                                                   gpointer self);
static void g4_application_on_music_found (G4Application* self,
                                    GPtrArray* arr);
static void _g4_application_on_music_found_g4_music_loader_music_found (G4MusicLoader* _sender,
                                                                 GPtrArray* arr,
                                                                 gpointer self);
static void g4_application_on_music_lost (G4Application* self,
                                   GHashTable* removed);
static void _g4_application_on_music_lost_g4_music_loader_music_lost (G4MusicLoader* _sender,
                                                               GHashTable* arr,
                                                               gpointer self);
VALA_EXTERN GType g4_cover_cache_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4CoverCache, g_object_unref)
VALA_EXTERN G4CoverCache* g4_music_loader_get_cover_cache (G4MusicLoader* self);
VALA_EXTERN void g4_thumbnailer_set_cover_finder (G4Thumbnailer* self,
                                      G4CoverCache* value);
VALA_EXTERN void g4_music_loader_add_to_cache (G4MusicLoader* self,
                                   G4Music* music);
static void _g4_music_loader_add_to_cache_g4_thumbnailer_tag_updated (G4Thumbnailer* _sender,
                                                               G4Music* music,
                                                               gpointer self);
static void g4_application_on_player_end (G4Application* self);
static void _g4_application_on_player_end_g4_gst_player_end_of_stream (G4GstPlayer* _sender,
                                                                gpointer self);
static void g4_application_on_player_error (G4Application* self,
                                     GError* err);
static void _g4_application_on_player_error_g4_gst_player_error (G4GstPlayer* _sender,
                                                          GError* _error_,
                                                          gpointer self);
static gchar* g4_application_on_player_next_uri_request (G4Application* self);
static gchar* _g4_application_on_player_next_uri_request_g4_gst_player_next_uri_request (G4GstPlayer* _sender,
                                                                                  gpointer self);
static void g4_application_on_player_next_uri_start (G4Application* self);
static void _g4_application_on_player_next_uri_start_g4_gst_player_next_uri_start (G4GstPlayer* _sender,
                                                                            gpointer self);
static void g4_application_on_player_state_changed (G4Application* self,
                                             GstState state);
static void _g4_application_on_player_state_changed_g4_gst_player_state_changed (G4GstPlayer* _sender,
                                                                          GstState state,
                                                                          gpointer self);
static void g4_application_on_player_tag_parsed (G4Application* self,
                                          const gchar* u,
                                          GstTagList* tags,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void g4_application_on_player_tag_parsed_finish (G4Application* self,
                                                 GAsyncResult* _res_);
static void _g4_application_on_player_tag_parsed_g4_gst_player_tag_parsed (G4GstPlayer* _sender,
                                                                    const gchar* uri,
                                                                    GstTagList* tags,
                                                                    gpointer self);
static void g4_application_on_bus_acquired (G4Application* self,
                                     GDBusConnection* connection,
                                     const gchar* name);
static void _g4_application_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                             const gchar* name,
                                                             gpointer self);
static void g4_application_real_activate (GApplication* base);
VALA_EXTERN GType g4_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Window, g_object_unref)
VALA_EXTERN G4Window* g4_window_get_default (void);
static void g4_application_real_open (GApplication* base,
                               GFile** files,
                               gint files_length1,
                               const gchar* hint);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
VALA_EXTERN G4Window* g4_window_new (G4Application* app);
VALA_EXTERN G4Window* g4_window_construct (GType object_type,
                               G4Application* app);
static GFile** _vala_array_dup1 (GFile** self,
                          gssize length);
VALA_EXTERN const gchar* g4_application_get_music_folder (G4Application* self);
VALA_EXTERN G4Music* g4_music_new (const gchar* uri,
                       const gchar* title,
                       gint64 time);
VALA_EXTERN G4Music* g4_music_construct (GType object_type,
                             const gchar* uri,
                             const gchar* title,
                             gint64 time);
VALA_EXTERN void g4_gst_player_set_uri (G4GstPlayer* self,
                            const gchar* value);
VALA_EXTERN void g4_gst_player_set_state (G4GstPlayer* self,
                              GstState value);
VALA_EXTERN GFile* g4_get_playing_list_file (void);
static GFile** _vala_array_dup2 (GFile** self,
                          gssize length);
VALA_EXTERN void g4_application_open_files_async (G4Application* self,
                                      GFile** files,
                                      gint files_length1,
                                      guint position,
                                      gboolean play_now,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN gboolean g4_application_open_files_finish (G4Application* self,
                                           GAsyncResult* _res_);
static void __lambda140_ (Block3Data* _data3_,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN GType g4_music_library_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MusicLibrary, g_object_unref)
VALA_EXTERN G4MusicLibrary* g4_music_loader_get_library (G4MusicLoader* self);
VALA_EXTERN gboolean g4_music_library_remove_playlist (G4MusicLibrary* self,
                                           const gchar* key);
VALA_EXTERN void g4_application_load_music_folder_async (G4Application* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void g4_application_load_music_folder_finish (G4Application* self,
                                              GAsyncResult* _res_);
static void ___lambda141_ (G4Application* self,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda141__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void ___lambda140__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void g4_application_real_shutdown (GApplication* base);
VALA_EXTERN void g4_music_loader_save_tag_cache (G4MusicLoader* self);
static void g4_application_delete_cover_tmp_file_async (G4Application* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static void g4_application_delete_cover_tmp_file_finish (G4Application* self,
                                                  GAsyncResult* _res_);
static void __lambda142_ (G4Application* self,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda142__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void g4_application_add_playlist_to_file_async_data_free (gpointer _data);
VALA_EXTERN GType g4_album_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Album, g_object_unref)
VALA_EXTERN GType g4_playlist_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Playlist, g_object_unref)
VALA_EXTERN void g4_application_add_playlist_to_file_async (G4Application* self,
                                                G4Playlist* playlist,
                                                gboolean append,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN gboolean g4_application_add_playlist_to_file_finish (G4Application* self,
                                                     GAsyncResult* _res_);
static gboolean g4_application_add_playlist_to_file_async_co (G4ApplicationAddPlaylistToFileAsyncData* _data_);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void _g_free0_ (gpointer var);
VALA_EXTERN void g4_run_async (GType v_type,
                   GBoxedCopyFunc v_dup_func,
                   GDestroyNotify v_destroy_func,
                   G4TaskFunc task,
                   gpointer task_target,
                   gboolean front,
                   gboolean in_single_pool,
                   GAsyncReadyCallback _callback_,
                   gpointer _user_data_);
VALA_EXTERN gpointer g4_run_finish (GAsyncResult* _res_);
static gboolean __lambda71_ (Block4Data* _data4_);
static Block5Data* block5_data_ref (Block5Data* _data5_);
static void block5_data_unref (void * _userdata_);
VALA_EXTERN gchar* g4_load_playlist_file (GFile* file,
                              GPtrArray* uris);
static void ___lambda72_ (Block5Data* _data5_,
                   const gchar* uri);
static void ____lambda72__gfunc (gconstpointer data,
                          gpointer self);
VALA_EXTERN gboolean g4_save_playlist_file (GFile* file,
                                GPtrArray* uris,
                                const gchar* title,
                                gboolean with_titles);
VALA_EXTERN void g4_playlist_clear (G4Playlist* self);
VALA_EXTERN G4Music* g4_music_loader_find_cache (G4MusicLoader* self,
                                     const gchar* uri);
VALA_EXTERN gboolean g4_playlist_add_music (G4Playlist* self,
                                G4Music* music);
VALA_EXTERN void g4_playlist_set_cover_uri (G4Playlist* self);
VALA_EXTERN void g4_playlist_set_title (G4Playlist* self,
                            const gchar* title);
static gpointer ___lambda71__g4_task_func (gpointer self);
static void g4_application_add_playlist_to_file_async_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
VALA_EXTERN G4Playlist* g4_music_library_add_playlist (G4MusicLibrary* self,
                                           G4Playlist* playlist);
VALA_EXTERN void g4_window_show_toast (G4Window* self,
                           const gchar* message,
                           const gchar* uri);
VALA_EXTERN gint g4_application_insert_after_current (G4Application* self,
                                          G4Playlist* playlist);
VALA_EXTERN gboolean g4_merge_items_to_store (GListStore* store,
                                  GPtrArray* arr,
                                  guint* position);
VALA_EXTERN gboolean g4_application_get_list_modified (G4Application* self);
VALA_EXTERN void g4_application_set_list_modified (G4Application* self,
                                       gboolean value);
static void g4_application_update_current_item (G4Application* self);
VALA_EXTERN gboolean g4_application_insert_to_queue (G4Application* self,
                                         G4Playlist* playlist,
                                         guint position,
                                         gboolean play_now);
VALA_EXTERN void g4_application_set_current_item (G4Application* self,
                                      gint value);
VALA_EXTERN void g4_gst_player_play (G4GstPlayer* self);
static void g4_application_load_music_folder_async_data_free (gpointer _data);
static gboolean g4_application_load_music_folder_async_co (G4ApplicationLoadMusicFolderAsyncData* _data_);
static void _g_object_unref0_ (gpointer var);
VALA_EXTERN void g4_music_loader_load_files_async (G4MusicLoader* self,
                                       GFile** files,
                                       gint files_length1,
                                       GPtrArray* musics,
                                       gboolean ignore_exists,
                                       gboolean merge_lists,
                                       guint sort_mode,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN void g4_music_loader_load_files_finish (G4MusicLoader* self,
                                        GAsyncResult* _res_);
static GFile** _vala_array_dup3 (GFile** self,
                          gssize length);
static void g4_application_load_music_folder_async_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void g4_application_open_files_async_data_free (gpointer _data);
static gboolean g4_application_open_files_async_co (G4ApplicationOpenFilesAsyncData* _data_);
VALA_EXTERN G4Playlist* g4_playlist_new (const gchar* name,
                             const gchar* uri);
VALA_EXTERN G4Playlist* g4_playlist_construct (GType object_type,
                                   const gchar* name,
                                   const gchar* uri);
static GFile** _vala_array_dup4 (GFile** self,
                          gssize length);
static void g4_application_open_files_async_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN guint g4_playlist_get_length (G4Playlist* self);
VALA_EXTERN void g4_application_play_next (G4Application* self);
VALA_EXTERN gint g4_application_get_current_item (G4Application* self);
VALA_EXTERN void g4_application_play_pause (G4Application* self);
VALA_EXTERN gboolean g4_gst_player_get_playing (G4GstPlayer* self);
VALA_EXTERN void g4_gst_player_set_playing (G4GstPlayer* self,
                                gboolean value);
VALA_EXTERN void g4_application_play_previous (G4Application* self);
VALA_EXTERN void g4_application_reload_library (G4Application* self);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void ___lambda80_ (Block6Data* _data6_,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN void g4_music_loader_remove_all (G4MusicLoader* self);
static void __lambda81_ (G4Application* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda81__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ____lambda80__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN void g4_application_request_background (G4Application* self);
VALA_EXTERN gpointer g4_portal_ref (gpointer instance);
VALA_EXTERN void g4_portal_unref (gpointer instance);
VALA_EXTERN GParamSpec* g4_param_spec_portal (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void g4_value_set_portal (GValue* value,
                          gpointer v_object);
VALA_EXTERN void g4_value_take_portal (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer g4_value_get_portal (const GValue* value);
VALA_EXTERN GType g4_portal_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Portal, g4_portal_unref)
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
VALA_EXTERN G4Portal* g4_action_handles_get_portal (G4ActionHandles* self);
VALA_EXTERN G4Portal* g4_portal_new (const gchar* parent);
VALA_EXTERN G4Portal* g4_portal_construct (GType object_type,
                               const gchar* parent);
VALA_EXTERN void g4_portal_request_background_async (G4Portal* self,
                                         const gchar* reason,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN void g4_portal_request_background_finish (G4Portal* self,
                                          GAsyncResult* _res_);
static void __lambda129_ (Block7Data* _data7_,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda129__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void g4_application_rename_playlist_async_data_free (gpointer _data);
VALA_EXTERN void g4_application_rename_playlist_async (G4Application* self,
                                           G4Playlist* playlist,
                                           const gchar* title,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN gboolean g4_application_rename_playlist_finish (G4Application* self,
                                                GAsyncResult* _res_);
static gboolean g4_application_rename_playlist_async_co (G4ApplicationRenamePlaylistAsyncData* _data_);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
static void __lambda111_ (Block8Data* _data8_,
                   G4Music* music);
static void ___lambda111__gfunc (gconstpointer data,
                          gpointer self);
static gboolean __lambda112_ (Block8Data* _data8_);
static gpointer ___lambda112__g4_task_func (gpointer self);
static void g4_application_rename_playlist_async_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void g4_application_save_queue_to_file_data_free (gpointer _data);
VALA_EXTERN void g4_application_save_queue_to_file (G4Application* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN gboolean g4_application_save_queue_to_file_finish (G4Application* self,
                                                   GAsyncResult* _res_);
static gboolean g4_application_save_queue_to_file_co (G4ApplicationSaveQueueToFileData* _data_);
static Block9Data* block9_data_ref (Block9Data* _data9_);
static void block9_data_unref (void * _userdata_);
static gboolean __lambda102_ (Block9Data* _data9_);
static gpointer ___lambda102__g4_task_func (gpointer self);
static void g4_application_save_queue_to_file_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void g4_application_save_to_playlist_file_async_data_free (gpointer _data);
VALA_EXTERN void g4_application_save_to_playlist_file_async (G4Application* self,
                                                 G4Playlist* playlist,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
VALA_EXTERN void g4_application_save_to_playlist_file_finish (G4Application* self,
                                                  GAsyncResult* _res_);
static gboolean g4_application_save_to_playlist_file_async_co (G4ApplicationSaveToPlaylistFileAsyncData* _data_);
VALA_EXTERN void g4_show_save_file_dialog (GtkWindow* parent,
                               GFile* initial,
                               GtkFileFilter** filters,
                               gint filters_length1,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN GFile* g4_show_save_file_dialog_finish (GAsyncResult* _res_);
static void g4_application_save_to_playlist_file_async_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
VALA_EXTERN void g4_playlist_set_list_uri (G4Playlist* self,
                               const gchar* uri);
VALA_EXTERN gchar* g4_get_file_display_name (GFile* file);
VALA_EXTERN GType g4_artist_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Artist, g_object_unref)
VALA_EXTERN gchar* g4_build_library_uri (G4Artist* artist,
                             G4Album* album);
static void g4_application_show_add_playlist_dialog_data_free (gpointer _data);
VALA_EXTERN void g4_application_show_add_playlist_dialog (G4Application* self,
                                              G4Playlist* playlist,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
VALA_EXTERN void g4_application_show_add_playlist_dialog_finish (G4Application* self,
                                                     GAsyncResult* _res_);
static gboolean g4_application_show_add_playlist_dialog_co (G4ApplicationShowAddPlaylistDialogData* _data_);
VALA_EXTERN GType g4_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4Dialog, g_object_unref)
VALA_EXTERN GType g4_playlist_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4PlaylistDialog, g_object_unref)
VALA_EXTERN G4PlaylistDialog* g4_playlist_dialog_new (G4Application* app);
VALA_EXTERN G4PlaylistDialog* g4_playlist_dialog_construct (GType object_type,
                                                G4Application* app);
VALA_EXTERN void g4_playlist_dialog_choose (G4PlaylistDialog* self,
                                GtkWindow* parent,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN G4Playlist* g4_playlist_dialog_choose_finish (G4PlaylistDialog* self,
                                              GAsyncResult* _res_);
static void g4_application_show_add_playlist_dialog_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void g4_application_delete_cover_tmp_file_async_data_free (gpointer _data);
static gboolean g4_application_delete_cover_tmp_file_async_co (G4ApplicationDeleteCoverTmpFileAsyncData* _data_);
static void g4_application_delete_cover_tmp_file_async_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static gint g4_application_find_music_item_by_uri (G4Application* self,
                                            const gchar* uri);
VALA_EXTERN gint g4_find_item_in_model (GListModel* model,
                            GObject* obj,
                            gint start_pos);
VALA_EXTERN G4MprisPlayer* g4_mpris_player_new (G4Application* app,
                                    GDBusConnection* connection);
VALA_EXTERN G4MprisPlayer* g4_mpris_player_construct (GType object_type,
                                          G4Application* app,
                                          GDBusConnection* connection);
VALA_EXTERN GType g4_mpris_player_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MprisPlayer, g_object_unref)
VALA_EXTERN guint g4_mpris_player_register_object (void* object,
                                       GDBusConnection* connection,
                                       const gchar* path,
                                       GError** error);
VALA_EXTERN G4MprisRoot* g4_mpris_root_new (G4Application* app);
VALA_EXTERN G4MprisRoot* g4_mpris_root_construct (GType object_type,
                                      G4Application* app);
VALA_EXTERN GType g4_mpris_root_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (G4MprisRoot, g_object_unref)
VALA_EXTERN guint g4_mpris_root_register_object (void* object,
                                     GDBusConnection* connection,
                                     const gchar* path,
                                     GError** error);
VALA_EXTERN guint g4_run_idle_once (G4VoidFunc func,
                        gpointer func_target,
                        GDestroyNotify func_target_destroy_notify,
                        gint priority);
static void ___lambda44_ (G4Application* self);
static void ____lambda44__g4_void_func (gpointer self);
static void ___lambda45_ (G4Application* self);
static void ____lambda45__g4_void_func (gpointer self);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static void ___lambda2__gh_func (gconstpointer key,
                          gconstpointer value,
                          gpointer self);
static void ___lambda47_ (Block10Data* _data10_,
                   G4Music* music);
static void ____lambda47__gfunc (gconstpointer data,
                          gpointer self);
VALA_EXTERN gint g4_remove_items_from_store (GListStore* store,
                                 GPtrArray* arr,
                                 gint* first_pos);
VALA_EXTERN void g4_gst_player_seek (G4GstPlayer* self,
                         GstClockTime position);
VALA_EXTERN gboolean g4_gst_player_get_gapless (G4GstPlayer* self);
static void g4_application_on_player_tag_parsed_data_free (gpointer _data);
static gboolean g4_application_on_player_tag_parsed_co (G4ApplicationOnPlayerTagParsedData* _data_);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
VALA_EXTERN gboolean g4_music_has_unknown (G4Music* self);
VALA_EXTERN gboolean g4_music_from_gst_tags (G4Music* self,
                                 GstTagList* tags);
VALA_EXTERN GstSample* g4_parse_image_from_tag_list (GstTagList* tags);
static GstSample* ____lambda137_ (Block13Data* _data13_);
VALA_EXTERN GstTagList* g4_parse_gst_tags (GFile* file);
static gpointer _____lambda137__g4_task_func (gpointer self);
static void g4_application_on_player_tag_parsed_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
VALA_EXTERN gint g4_thumbnailer_get_scale_factor (G4Thumbnailer* self);
static GdkPixbuf* _____lambda138_ (Block14Data* _data14_);
VALA_EXTERN GdkPixbuf* g4_load_clamp_pixbuf_from_sample (GstSample* sample,
                                             gint size);
static gpointer ______lambda138__g4_task_func (gpointer self);
VALA_EXTERN void g4_thumbnailer_load_directly_async (G4Thumbnailer* self,
                                         G4Music* music,
                                         gint size,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN GdkPixbuf* g4_thumbnailer_load_directly_finish (G4Thumbnailer* self,
                                                GAsyncResult* _res_);
VALA_EXTERN const gchar* g4_music_get_cover_key (G4Music* self);
VALA_EXTERN void g4_save_sample_to_file_async (GFile* file,
                                   GstSample* sample,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gboolean g4_save_sample_to_file_finish (GAsyncResult* _res_);
VALA_EXTERN gchar* g4_thumbnailer_create_music_text_svg (G4Thumbnailer* self,
                                             G4Music* music);
VALA_EXTERN void g4_save_text_to_file_async (GFile* file,
                                 const gchar* text,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN gboolean g4_save_text_to_file_finish (GAsyncResult* _res_);
VALA_EXTERN GdkPaintable* g4_thumbnailer_find (G4Thumbnailer* self,
                                   G4Music* music,
                                   gint size);
static GdkPixbuf* ____lambda139_ (Block13Data* _data13_);
VALA_EXTERN GdkPixbuf* g4_create_clamp_pixbuf (GdkPixbuf* pixbuf,
                                   gint size);
static gpointer _____lambda139__g4_task_func (gpointer self);
VALA_EXTERN void g4_thumbnailer_put (G4Thumbnailer* self,
                         G4Music* music,
                         GdkPaintable* paintable,
                         gboolean replace,
                         gint size);
VALA_EXTERN void g4_application_set_current_music (G4Application* self,
                                       G4Music* value);
static void g4_application_update_next_item (G4Application* self);
VALA_EXTERN guint g4_application_get_color_scheme (G4Application* self);
VALA_EXTERN void g4_application_set_color_scheme (G4Application* self,
                                      guint value);
static GVariant* _variant_new1 (gchar* value);
VALA_EXTERN GstSample* g4_application_get_current_cover (G4Application* self);
VALA_EXTERN gint g4_window_open_next_playable_page (G4Window* self);
static gint* _int_dup (gint* self);
VALA_EXTERN GtkFilterListModel* g4_application_get_current_list (G4Application* self);
VALA_EXTERN void g4_application_set_current_list (G4Application* self,
                                      GtkFilterListModel* value);
VALA_EXTERN G4Music* g4_application_get_current_music (G4Application* self);
VALA_EXTERN GstState g4_gst_player_get_state (G4GstPlayer* self);
VALA_EXTERN GtkIconPaintable* g4_application_get_icon (G4Application* self);
VALA_EXTERN G4MusicLoader* g4_application_get_loader (G4Application* self);
VALA_EXTERN gboolean g4_application_get_loading (G4Application* self);
VALA_EXTERN void g4_application_set_music_folder (G4Application* self,
                                      const gchar* value);
VALA_EXTERN GListStore* g4_application_get_music_queue (G4Application* self);
VALA_EXTERN const gchar* g4_application_get_name (G4Application* self);
VALA_EXTERN G4GstPlayer* g4_application_get_player (G4Application* self);
VALA_EXTERN GSettings* g4_application_get_settings (G4Application* self);
VALA_EXTERN gboolean g4_application_get_single_loop (G4Application* self);
VALA_EXTERN void g4_application_set_single_loop (G4Application* self,
                                     gboolean value);
VALA_EXTERN guint g4_application_get_sort_mode (G4Application* self);
VALA_EXTERN void g4_application_set_sort_mode (G4Application* self,
                                   guint value);
VALA_EXTERN void g4_sort_music_store (GListStore* store,
                          guint sort_mode);
VALA_EXTERN G4Thumbnailer* g4_application_get_thumbnailer (G4Application* self);
static void g_cclosure_user_marshal_VOID__INT_UINT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING (GClosure * closure,
                                                         GValue * return_value,
                                                         guint n_param_values,
                                                         const GValue * param_values,
                                                         gpointer invocation_hint,
                                                         gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                                  GValue * return_value,
                                                  guint n_param_values,
                                                  const GValue * param_values,
                                                  gpointer invocation_hint,
                                                  gpointer marshal_data);
static void g4_application_finalize (GObject * obj);
static GType g4_application_get_type_once (void);
static void _vala_g4_application_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_g4_application_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void g4_save_sample_to_file_async_data_free (gpointer _data);
static gboolean g4_save_sample_to_file_async_co (G4SaveSampleToFileAsyncData* _data_);
static void g4_save_sample_to_file_async_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static GstMapInfo* _gst_map_info_dup (GstMapInfo* self);
static gboolean* _bool_dup (gboolean* self);
static void g4_save_text_to_file_async_data_free (gpointer _data);
static gboolean g4_save_text_to_file_async_co (G4SaveTextToFileAsyncData* _data_);
static void g4_save_text_to_file_async_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
g4_application_get_instance_private (G4Application* self)
{
	return G_STRUCT_MEMBER_P (self, G4Application_private_offset);
}

G4Application*
g4_application_construct (GType object_type)
{
	G4Application * self = NULL;
	self = (G4Application*) g_object_new (object_type, "application-id", APP_ID, "flags", G_APPLICATION_HANDLES_OPEN, NULL);
	return self;
}

G4Application*
g4_application_new (void)
{
	return g4_application_construct (G4_TYPE_APPLICATION);
}

static void
_g4_application_on_music_list_changed_g_list_model_items_changed (GListModel* _sender,
                                                                  guint position,
                                                                  guint removed,
                                                                  guint added,
                                                                  gpointer self)
{
	g4_application_on_music_list_changed ((G4Application*) self, position, removed, added);
}

static void
_g4_application_on_music_library_changed_g_list_model_items_changed (GListModel* _sender,
                                                                     guint position,
                                                                     guint removed,
                                                                     guint added,
                                                                     gpointer self)
{
	g4_application_on_music_library_changed ((G4Application*) self, position, removed, added);
}

static void
__lambda46_ (G4Application* self,
             gboolean loading)
{
	self->priv->_loading = loading;
}

static void
___lambda46__g4_music_loader_loading_changed (G4MusicLoader* _sender,
                                              gboolean loading,
                                              gpointer self)
{
	__lambda46_ ((G4Application*) self, loading);
}

static void
_g4_application_on_music_found_g4_music_loader_music_found (G4MusicLoader* _sender,
                                                            GPtrArray* arr,
                                                            gpointer self)
{
	g4_application_on_music_found ((G4Application*) self, arr);
}

static void
_g4_application_on_music_lost_g4_music_loader_music_lost (G4MusicLoader* _sender,
                                                          GHashTable* arr,
                                                          gpointer self)
{
	g4_application_on_music_lost ((G4Application*) self, arr);
}

static void
_g4_music_loader_add_to_cache_g4_thumbnailer_tag_updated (G4Thumbnailer* _sender,
                                                          G4Music* music,
                                                          gpointer self)
{
	g4_music_loader_add_to_cache ((G4MusicLoader*) self, music);
}

static void
_g4_application_on_player_end_g4_gst_player_end_of_stream (G4GstPlayer* _sender,
                                                           gpointer self)
{
	g4_application_on_player_end ((G4Application*) self);
}

static void
_g4_application_on_player_error_g4_gst_player_error (G4GstPlayer* _sender,
                                                     GError* _error_,
                                                     gpointer self)
{
	g4_application_on_player_error ((G4Application*) self, _error_);
}

static gchar*
_g4_application_on_player_next_uri_request_g4_gst_player_next_uri_request (G4GstPlayer* _sender,
                                                                           gpointer self)
{
	gchar* result;
	result = g4_application_on_player_next_uri_request ((G4Application*) self);
	return result;
}

static void
_g4_application_on_player_next_uri_start_g4_gst_player_next_uri_start (G4GstPlayer* _sender,
                                                                       gpointer self)
{
	g4_application_on_player_next_uri_start ((G4Application*) self);
}

static void
_g4_application_on_player_state_changed_g4_gst_player_state_changed (G4GstPlayer* _sender,
                                                                     GstState state,
                                                                     gpointer self)
{
	g4_application_on_player_state_changed ((G4Application*) self, state);
}

static void
_g4_application_on_player_tag_parsed_g4_gst_player_tag_parsed (G4GstPlayer* _sender,
                                                               const gchar* uri,
                                                               GstTagList* tags,
                                                               gpointer self)
{
	g4_application_on_player_tag_parsed ((G4Application*) self, uri, tags, NULL, NULL);
}

static void
_g4_application_on_bus_acquired_gbus_acquired_callback (GDBusConnection* connection,
                                                        const gchar* name,
                                                        gpointer self)
{
	g4_application_on_bus_acquired ((G4Application*) self, connection, name);
}

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

static void
g4_application_real_startup (GApplication* base)
{
	G4Application * self;
	G4MusicLoader* _tmp0_;
	G4ActionHandles* _tmp1_;
	GtkFilterListModel* _tmp2_;
	GListStore* _tmp3_;
	GtkFilterListModel* _tmp4_;
	GListStore* _tmp5_;
	G4MusicLoader* _tmp6_;
	G4MusicLoader* _tmp7_;
	G4MusicLoader* _tmp8_;
	G4Thumbnailer* _tmp9_;
	G4MusicLoader* _tmp10_;
	G4CoverCache* _tmp11_;
	G4CoverCache* _tmp12_;
	G4Thumbnailer* _tmp13_;
	G4MusicLoader* _tmp14_;
	G4GstPlayer* _tmp15_;
	G4GstPlayer* _tmp16_;
	G4GstPlayer* _tmp17_;
	G4GstPlayer* _tmp18_;
	G4GstPlayer* _tmp19_;
	G4GstPlayer* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GSettings* settings = NULL;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GSettings* _tmp27_;
	GSettings* _tmp28_;
	GSettings* _tmp29_;
	G4MusicLoader* _tmp30_;
	G4Thumbnailer* _tmp31_;
	G4GstPlayer* _tmp32_;
	G4GstPlayer* _tmp33_;
	G4GstPlayer* _tmp34_;
	G4GstPlayer* _tmp35_;
	self = (G4Application*) base;
	G_APPLICATION_CLASS (g4_application_parent_class)->startup ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_tmp0_ = self->priv->_loader;
	g4_music_loader_load_tag_cache (_tmp0_);
	_tmp1_ = g4_action_handles_new (self);
	_g_object_unref0 (self->priv->_actions);
	self->priv->_actions = _tmp1_;
	_tmp2_ = self->priv->_current_list;
	_tmp3_ = self->priv->_music_queue;
	gtk_filter_list_model_set_model (_tmp2_, (GListModel*) _tmp3_);
	_tmp4_ = self->priv->_current_list;
	g_signal_connect_object ((GListModel*) _tmp4_, "items-changed", (GCallback) _g4_application_on_music_list_changed_g_list_model_items_changed, self, 0);
	_tmp5_ = self->priv->_music_queue;
	g_signal_connect_object ((GListModel*) _tmp5_, "items-changed", (GCallback) _g4_application_on_music_library_changed_g_list_model_items_changed, self, 0);
	_tmp6_ = self->priv->_loader;
	g_signal_connect_object (_tmp6_, "loading-changed", (GCallback) ___lambda46__g4_music_loader_loading_changed, self, 0);
	_tmp7_ = self->priv->_loader;
	g_signal_connect_object (_tmp7_, "music-found", (GCallback) _g4_application_on_music_found_g4_music_loader_music_found, self, 0);
	_tmp8_ = self->priv->_loader;
	g_signal_connect_object (_tmp8_, "music-lost", (GCallback) _g4_application_on_music_lost_g4_music_loader_music_lost, self, 0);
	_tmp9_ = self->priv->_thumbnailer;
	_tmp10_ = self->priv->_loader;
	_tmp11_ = g4_music_loader_get_cover_cache (_tmp10_);
	_tmp12_ = _tmp11_;
	g4_thumbnailer_set_cover_finder (_tmp9_, _tmp12_);
	_tmp13_ = self->priv->_thumbnailer;
	_tmp14_ = self->priv->_loader;
	g_signal_connect_object (_tmp13_, "tag-updated", (GCallback) _g4_music_loader_add_to_cache_g4_thumbnailer_tag_updated, _tmp14_, 0);
	_tmp15_ = self->priv->_player;
	g_signal_connect_object (_tmp15_, "end-of-stream", (GCallback) _g4_application_on_player_end_g4_gst_player_end_of_stream, self, 0);
	_tmp16_ = self->priv->_player;
	g_signal_connect_object (_tmp16_, "error", (GCallback) _g4_application_on_player_error_g4_gst_player_error, self, 0);
	_tmp17_ = self->priv->_player;
	g_signal_connect_object (_tmp17_, "next-uri-request", (GCallback) _g4_application_on_player_next_uri_request_g4_gst_player_next_uri_request, self, 0);
	_tmp18_ = self->priv->_player;
	g_signal_connect_object (_tmp18_, "next-uri-start", (GCallback) _g4_application_on_player_next_uri_start_g4_gst_player_next_uri_start, self, 0);
	_tmp19_ = self->priv->_player;
	g_signal_connect_object (_tmp19_, "state-changed", (GCallback) _g4_application_on_player_state_changed_g4_gst_player_state_changed, self, 0);
	_tmp20_ = self->priv->_player;
	g_signal_connect_object (_tmp20_, "tag-parsed", (GCallback) _g4_application_on_player_tag_parsed_g4_gst_player_tag_parsed, self, 0);
	_tmp21_ = g_application_get_application_id ((GApplication*) self);
	_tmp22_ = _tmp21_;
	_tmp23_ = g_strconcat ("org.mpris.MediaPlayer2.", _tmp22_, NULL);
	_tmp24_ = _tmp23_;
	self->priv->_mpris_id = g_bus_own_name_with_closures (G_BUS_TYPE_SESSION, _tmp24_, G_BUS_NAME_OWNER_FLAGS_NONE, (GClosure*) ((_g4_application_on_bus_acquired_gbus_acquired_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _g4_application_on_bus_acquired_gbus_acquired_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_g_free0 (_tmp24_);
	if (self->priv->_mpris_id == ((guint) 0)) {
		g_warning ("application.vala:67: Initialize MPRIS session failed\n");
	}
	_tmp25_ = g_application_get_application_id ((GApplication*) self);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_settings_new (_tmp26_);
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp27_;
	_tmp28_ = self->priv->_settings;
	_tmp29_ = _g_object_ref0 (_tmp28_);
	settings = _tmp29_;
	g_settings_bind (settings, "color-scheme", (GObject*) self, "color-scheme", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "music-dir", (GObject*) self, "music-folder", G_SETTINGS_BIND_DEFAULT);
	g_settings_bind (settings, "sort-mode", (GObject*) self, "sort-mode", G_SETTINGS_BIND_DEFAULT);
	_tmp30_ = self->priv->_loader;
	g_settings_bind (settings, "monitor-changes", (GObject*) _tmp30_, "monitor-changes", G_SETTINGS_BIND_DEFAULT);
	_tmp31_ = self->priv->_thumbnailer;
	g_settings_bind (settings, "remote-thumbnail", (GObject*) _tmp31_, "remote-thumbnail", G_SETTINGS_BIND_DEFAULT);
	_tmp32_ = self->priv->_player;
	g_settings_bind (settings, "gapless-playback", (GObject*) _tmp32_, "gapless", G_SETTINGS_BIND_DEFAULT);
	_tmp33_ = self->priv->_player;
	g_settings_bind (settings, "replay-gain", (GObject*) _tmp33_, "replay-gain", G_SETTINGS_BIND_DEFAULT);
	_tmp34_ = self->priv->_player;
	g_settings_bind (settings, "audio-sink", (GObject*) _tmp34_, "audio-sink", G_SETTINGS_BIND_DEFAULT);
	_tmp35_ = self->priv->_player;
	g_settings_bind (settings, "volume", (GObject*) _tmp35_, "volume", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (settings);
}

static void
g4_application_real_activate (GApplication* base)
{
	G4Application * self;
	G4Window* window = NULL;
	G4Window* _tmp0_;
	G4Window* _tmp1_;
	self = (G4Application*) base;
	G_APPLICATION_CLASS (g4_application_parent_class)->activate ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
	_tmp0_ = g4_window_get_default ();
	window = _tmp0_;
	_tmp1_ = window;
	if (_tmp1_ != NULL) {
		G4Window* _tmp2_;
		_tmp2_ = window;
		gtk_window_present ((GtkWindow*) G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, G4_TYPE_WINDOW, G4Window));
	} else {
		GFile** _tmp3_;
		GFile** _tmp4_;
		gint _tmp4__length1;
		_tmp3_ = g_new0 (GFile*, 0 + 1);
		_tmp4_ = _tmp3_;
		_tmp4__length1 = 0;
		g_application_open ((GApplication*) self, _tmp4_, (gint) 0, "");
		_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_g_object_unref0 (window);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		G4Application* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->plist_file);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static GFile**
_vala_array_dup1 (GFile** self,
                  gssize length)
{
	if (length >= 0) {
		GFile** result;
		gssize i;
		result = g_new0 (GFile*, length + 1);
		for (i = 0; i < length; i++) {
			GFile* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static GFile**
_vala_array_dup2 (GFile** self,
                  gssize length)
{
	if (length >= 0) {
		GFile** result;
		gssize i;
		result = g_new0 (GFile*, length + 1);
		for (i = 0; i < length; i++) {
			GFile* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
___lambda141_ (G4Application* self,
               GObject* obj,
               GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	g4_application_load_music_folder_finish (self, res);
}

static void
____lambda141__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda141_ ((G4Application*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda140_ (Block3Data* _data3_,
              GObject* obj,
              GAsyncResult* res)
{
	G4Application* self;
	gboolean ret = FALSE;
	self = _data3_->self;
	g_return_if_fail (res != NULL);
	ret = g4_application_open_files_finish (self, res);
	if (ret) {
		self->priv->_list_modified = _data3_->saved_modified;
		if (_data3_->load_plist) {
			G4MusicLoader* _tmp0_;
			G4MusicLibrary* _tmp1_;
			G4MusicLibrary* _tmp2_;
			GFile* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			_tmp0_ = self->priv->_loader;
			_tmp1_ = g4_music_loader_get_library (_tmp0_);
			_tmp2_ = _tmp1_;
			_tmp3_ = _data3_->plist_file;
			_tmp4_ = g_file_get_uri (_tmp3_);
			_tmp5_ = _tmp4_;
			g4_music_library_remove_playlist (_tmp2_, _tmp5_);
			_g_free0 (_tmp5_);
		}
	}
	if (_data3_->initial) {
		g4_application_load_music_folder_async (self, ____lambda141__gasync_ready_callback, g_object_ref (self));
	}
}

static void
___lambda140__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda140_ (self, source_object, res);
	block3_data_unref (self);
}

static void
g4_application_real_open (GApplication* base,
                          GFile** files,
                          gint files_length1,
                          const gchar* hint)
{
	G4Application * self;
	Block3Data* _data3_;
	G4Window* window = NULL;
	G4Window* _tmp0_;
	G4Window* _tmp1_;
	G4Window* _tmp2_ = NULL;
	G4Window* _tmp3_;
	G4Window* _tmp4_;
	G4Window* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	GFile* _tmp40_;
	gboolean _tmp41_ = FALSE;
	GFile** _tmp42_ = NULL;
	gint _tmp42__length1 = 0;
	gint __tmp42__size_ = 0;
	GFile** files_ref = NULL;
	GFile** _tmp47_;
	gint _tmp47__length1;
	gint files_ref_length1;
	gint _files_ref_size_;
	self = (G4Application*) base;
	g_return_if_fail (hint != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = g4_window_get_default ();
	window = _tmp0_;
	_tmp1_ = window;
	_data3_->initial = _tmp1_ == NULL;
	_tmp3_ = window;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp2_ = _tmp4_;
	if (_tmp2_ == NULL) {
		G4Window* _tmp5_;
		_tmp5_ = g4_window_new (self);
		g_object_ref_sink (_tmp5_);
		_g_object_unref0 (_tmp2_);
		_tmp2_ = _tmp5_;
	}
	_tmp6_ = _tmp2_;
	if (_tmp6_ != NULL) {
		gtk_window_present ((GtkWindow*) G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, G4_TYPE_WINDOW, G4Window));
	}
	if (_data3_->initial) {
		G4Music* _tmp8_;
		_tmp8_ = self->priv->_current_music;
		_tmp7_ = _tmp8_ == NULL;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		GFile** folders = NULL;
		GFile** _tmp9_;
		gint _tmp9__length1;
		gint folders_length1;
		gint _folders_size_;
		GFile** _tmp10_;
		gint _tmp10__length1;
		gint _tmp11_;
		GFile** _tmp12_;
		gint _tmp12__length1;
		GFile** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		GFile* _tmp16_;
		G4Music* _tmp17_ = NULL;
		G4Music* _tmp18_;
		const gchar* _tmp19_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_;
		gchar* recent_uri = NULL;
		gchar* _tmp25_;
		GFile** _tmp26_;
		gint _tmp26__length1;
		_tmp9_ = (files != NULL) ? _vala_array_dup1 (files, files_length1) : files;
		_tmp9__length1 = files_length1;
		folders = _tmp9_;
		folders_length1 = _tmp9__length1;
		_folders_size_ = folders_length1;
		_tmp10_ = folders;
		_tmp10__length1 = folders_length1;
		_tmp11_ = _tmp10__length1 + 1;
		folders = g_renew (GFile*, folders, _tmp10__length1 + 1);
		(_tmp11_ > folders_length1) ? memset (folders + folders_length1, 0, sizeof (GFile*) * (_tmp11_ - folders_length1)) : NULL;
		folders_length1 = _tmp11_;
		_folders_size_ = _tmp11_;
		_tmp12_ = folders;
		_tmp12__length1 = folders_length1;
		_tmp13_ = folders;
		_tmp13__length1 = folders_length1;
		_tmp14_ = g4_application_get_music_folder (self);
		_tmp15_ = _tmp14_;
		_tmp16_ = g_file_new_for_uri (_tmp15_);
		_g_object_unref0 (_tmp12_[_tmp13__length1 - 1]);
		_tmp12_[_tmp13__length1 - 1] = _tmp16_;
		_tmp18_ = self->priv->_current_music;
		_tmp17_ = _tmp18_;
		_tmp19_ = NULL;
		if (_tmp17_ != NULL) {
			const gchar* _tmp20_;
			_tmp20_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, G4_TYPE_MUSIC, G4Music)->uri;
			_tmp19_ = _tmp20_;
		}
		_tmp22_ = g_strdup (_tmp19_);
		_tmp21_ = _tmp22_;
		if (_tmp21_ == NULL) {
			GSettings* _tmp23_;
			gchar* _tmp24_;
			_tmp23_ = self->priv->_settings;
			_tmp24_ = g_settings_get_string (_tmp23_, "recent-music");
			_g_free0 (_tmp21_);
			_tmp21_ = _tmp24_;
		}
		_tmp25_ = _tmp21_;
		_tmp21_ = NULL;
		recent_uri = (gchar*) _tmp25_;
		_tmp26_ = folders;
		_tmp26__length1 = folders_length1;
		{
			GFile** file_collection = NULL;
			gint file_collection_length1 = 0;
			gint _file_collection_size_ = 0;
			gint file_it = 0;
			file_collection = _tmp26_;
			file_collection_length1 = _tmp26__length1;
			for (file_it = 0; file_it < file_collection_length1; file_it = file_it + 1) {
				GFile* _tmp27_;
				GFile* file = NULL;
				_tmp27_ = _g_object_ref0 (file_collection[file_it]);
				file = _tmp27_;
				{
					const gchar* _tmp28_;
					GFile* _tmp29_;
					gchar* _tmp30_;
					gchar* _tmp31_;
					gboolean _tmp32_;
					_tmp28_ = recent_uri;
					_tmp29_ = file;
					_tmp30_ = g_file_get_uri (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = g_str_has_prefix (_tmp28_, _tmp31_);
					_g_free0 (_tmp31_);
					if (_tmp32_) {
						const gchar* _tmp33_;
						G4Music* _tmp34_;
						G4GstPlayer* _tmp35_;
						const gchar* _tmp36_;
						gchar* _tmp37_;
						const gchar* _tmp38_;
						G4GstPlayer* _tmp39_;
						_tmp33_ = recent_uri;
						_tmp34_ = g4_music_new (_tmp33_, "", (gint64) 0);
						_g_object_unref0 (self->priv->_current_music);
						self->priv->_current_music = _tmp34_;
						_tmp35_ = self->priv->_player;
						_tmp36_ = recent_uri;
						_tmp37_ = g_strdup (_tmp36_);
						_g_free0 (self->priv->_current_uri);
						self->priv->_current_uri = _tmp37_;
						_tmp38_ = self->priv->_current_uri;
						g4_gst_player_set_uri (_tmp35_, _tmp38_);
						_tmp39_ = self->priv->_player;
						g4_gst_player_set_state (_tmp39_, GST_STATE_PAUSED);
						_g_object_unref0 (file);
						break;
					}
					_g_object_unref0 (file);
				}
			}
		}
		_g_free0 (recent_uri);
		_g_free0 (_tmp21_);
		folders = (_vala_array_free (folders, folders_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_data3_->saved_modified = self->priv->_list_modified;
	_tmp40_ = g4_get_playing_list_file ();
	_data3_->plist_file = _tmp40_;
	if (_data3_->initial) {
		_tmp41_ = files_length1 == 0;
	} else {
		_tmp41_ = FALSE;
	}
	_data3_->load_plist = _tmp41_;
	if (_data3_->load_plist) {
		GFile* _tmp43_;
		GFile* _tmp44_;
		GFile** _tmp45_;
		_tmp43_ = _data3_->plist_file;
		_tmp44_ = _g_object_ref0 (_tmp43_);
		_tmp45_ = g_new0 (GFile*, 1 + 1);
		_tmp45_[0] = _tmp44_;
		_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_object_unref), NULL);
		_tmp42_ = _tmp45_;
		_tmp42__length1 = 1;
		__tmp42__size_ = _tmp42__length1;
	} else {
		GFile** _tmp46_;
		gint _tmp46__length1;
		_tmp46_ = (files != NULL) ? _vala_array_dup2 (files, files_length1) : files;
		_tmp46__length1 = files_length1;
		_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_object_unref), NULL);
		_tmp42_ = _tmp46_;
		_tmp42__length1 = _tmp46__length1;
		__tmp42__size_ = _tmp42__length1;
	}
	_tmp47_ = _tmp42_;
	_tmp47__length1 = _tmp42__length1;
	_tmp42_ = NULL;
	_tmp42__length1 = 0;
	files_ref = _tmp47_;
	files_ref_length1 = _tmp47__length1;
	_files_ref_size_ = files_ref_length1;
	g4_application_open_files_async (self, files_ref, (gint) files_ref_length1, (guint) -1, files_length1 > 0, ___lambda140__gasync_ready_callback, block3_data_ref (_data3_));
	files_ref = (_vala_array_free (files_ref, files_ref_length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (window);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}

static void
__lambda142_ (G4Application* self,
              GObject* obj,
              GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	g4_application_delete_cover_tmp_file_finish (self, res);
}

static void
___lambda142__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda142_ ((G4Application*) self, source_object, res);
	g_object_unref (self);
}

static void
g4_application_real_shutdown (GApplication* base)
{
	G4Application * self;
	G4MusicLoader* _tmp0_;
	self = (G4Application*) base;
	_g_object_unref0 (self->priv->_actions);
	self->priv->_actions = NULL;
	_tmp0_ = self->priv->_loader;
	g4_music_loader_save_tag_cache (_tmp0_);
	g4_application_delete_cover_tmp_file_async (self, ___lambda142__gasync_ready_callback, g_object_ref (self));
	if (self->priv->_mpris_id != ((guint) 0)) {
		g_bus_unown_name (self->priv->_mpris_id);
		self->priv->_mpris_id = (guint) 0;
	}
	G_APPLICATION_CLASS (g4_application_parent_class)->shutdown ((GApplication*) G_TYPE_CHECK_INSTANCE_CAST (self, adw_application_get_type (), AdwApplication));
}

static void
g4_application_add_playlist_to_file_async_data_free (gpointer _data)
{
	G4ApplicationAddPlaylistToFileAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationAddPlaylistToFileAsyncData, _data_);
}

void
g4_application_add_playlist_to_file_async (G4Application* self,
                                           G4Playlist* playlist,
                                           gboolean append,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	G4ApplicationAddPlaylistToFileAsyncData* _data_;
	G4Application* _tmp0_;
	G4Playlist* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (playlist != NULL);
	_data_ = g_slice_new0 (G4ApplicationAddPlaylistToFileAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_add_playlist_to_file_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (playlist);
	_g_object_unref0 (_data_->playlist);
	_data_->playlist = _tmp1_;
	_data_->append = append;
	g4_application_add_playlist_to_file_async_co (_data_);
}

gboolean
g4_application_add_playlist_to_file_finish (G4Application* self,
                                            GAsyncResult* _res_)
{
	gboolean result;
	G4ApplicationAddPlaylistToFileAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		G4Application* self;
		self = _data4_->self;
		_g_ptr_array_unref0 (_data4_->uris);
		_g_object_unref0 (_data4_->file);
		_g_object_unref0 (_data4_->playlist);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

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_)) {
		G4Application* self;
		self = _data5_->_data4_->self;
		_g_hash_table_unref0 (_data5_->map);
		block4_data_unref (_data5_->_data4_);
		_data5_->_data4_ = NULL;
		g_slice_free (Block5Data, _data5_);
	}
}

static void
___lambda72_ (Block5Data* _data5_,
              const gchar* uri)
{
	Block4Data* _data4_;
	G4Application* self;
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	_data4_ = _data5_->_data4_;
	self = _data4_->self;
	g_return_if_fail (uri != NULL);
	_tmp0_ = _data5_->map;
	_tmp1_ = g_strdup (uri);
	g_hash_table_add (_tmp0_, _tmp1_);
}

static void
____lambda72__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda72_ (self, (const gchar*) data);
}

static gboolean
__lambda71_ (Block4Data* _data4_)
{
	G4Application* self;
	Block5Data* _data5_;
	gchar* title = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GPtrArray* _tmp7_;
	const gchar* _tmp17_ = NULL;
	const gchar* _tmp18_;
	gboolean ret = FALSE;
	GFile* _tmp20_;
	GPtrArray* _tmp21_;
	gboolean result;
	self = _data4_->self;
	_data5_ = g_slice_new0 (Block5Data);
	_data5_->_ref_count_ = 1;
	_data5_->_data4_ = block4_data_ref (_data4_);
	title = NULL;
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, NULL, _g_free0_);
	_data5_->map = _tmp2_;
	if (_data4_->append) {
		GFile* _tmp3_;
		GPtrArray* _tmp4_;
		gchar* _tmp5_;
		GPtrArray* _tmp6_;
		_tmp3_ = _data4_->file;
		_tmp4_ = _data4_->uris;
		_tmp5_ = g4_load_playlist_file (_tmp3_, _tmp4_);
		_g_free0 (title);
		title = _tmp5_;
		_tmp6_ = _data4_->uris;
		g_ptr_array_foreach (_tmp6_, ____lambda72__gfunc, _data5_);
	}
	_tmp7_ = _data4_->playlist->items;
	{
		GPtrArray* music_collection = NULL;
		guint music_index = 0U;
		music_collection = _tmp7_;
		for (music_index = 0; music_index < music_collection->len; music_index = music_index + 1) {
			G4Music* _tmp8_;
			G4Music* music = NULL;
			_tmp8_ = _g_object_ref0 ((G4Music*) g_ptr_array_index (music_collection, music_index));
			music = _tmp8_;
			{
				gchar* uri = NULL;
				G4Music* _tmp9_;
				const gchar* _tmp10_;
				gchar* _tmp11_;
				GHashTable* _tmp12_;
				const gchar* _tmp13_;
				_tmp9_ = music;
				_tmp10_ = _tmp9_->uri;
				_tmp11_ = g_strdup (_tmp10_);
				uri = _tmp11_;
				_tmp12_ = _data5_->map;
				_tmp13_ = uri;
				if (!g_hash_table_contains (_tmp12_, _tmp13_)) {
					GPtrArray* _tmp14_;
					const gchar* _tmp15_;
					gchar* _tmp16_;
					_tmp14_ = _data4_->uris;
					_tmp15_ = uri;
					_tmp16_ = g_strdup (_tmp15_);
					g_ptr_array_add (_tmp14_, _tmp16_);
				}
				_g_free0 (uri);
				_g_object_unref0 (music);
			}
		}
	}
	_tmp18_ = title;
	_tmp17_ = _tmp18_;
	if (_tmp17_ == NULL) {
		const gchar* _tmp19_;
		_tmp19_ = ((G4Music*) _data4_->playlist)->title;
		_tmp17_ = _tmp19_;
	}
	_tmp20_ = _data4_->file;
	_tmp21_ = _data4_->uris;
	ret = g4_save_playlist_file (_tmp20_, _tmp21_, (const gchar*) _tmp17_, TRUE);
	if (ret) {
		GPtrArray* _tmp22_;
		const gchar* _tmp29_;
		g4_playlist_clear (_data4_->playlist);
		_tmp22_ = _data4_->uris;
		{
			GPtrArray* uri_collection = NULL;
			guint uri_index = 0U;
			uri_collection = _tmp22_;
			for (uri_index = 0; uri_index < uri_collection->len; uri_index = uri_index + 1) {
				gchar* _tmp23_;
				gchar* uri = NULL;
				_tmp23_ = g_strdup ((gchar*) g_ptr_array_index (uri_collection, uri_index));
				uri = _tmp23_;
				{
					G4Music* music = NULL;
					G4MusicLoader* _tmp24_;
					const gchar* _tmp25_;
					G4Music* _tmp26_;
					G4Music* _tmp27_;
					_tmp24_ = self->priv->_loader;
					_tmp25_ = uri;
					_tmp26_ = g4_music_loader_find_cache (_tmp24_, _tmp25_);
					music = _tmp26_;
					_tmp27_ = music;
					if (_tmp27_ != NULL) {
						G4Music* _tmp28_;
						_tmp28_ = music;
						g4_playlist_add_music (_data4_->playlist, G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, G4_TYPE_MUSIC, G4Music));
					}
					_g_object_unref0 (music);
					_g_free0 (uri);
				}
			}
		}
		g4_playlist_set_cover_uri (_data4_->playlist);
		_tmp29_ = title;
		if (_tmp29_ != NULL) {
			const gchar* _tmp30_;
			_tmp30_ = title;
			g4_playlist_set_title (_data4_->playlist, (const gchar*) _tmp30_);
		}
	}
	result = ret;
	_g_free0 (title);
	block5_data_unref (_data5_);
	_data5_ = NULL;
	return result;
}

static gpointer
___lambda71__g4_task_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) __lambda71_ (self));
	return result;
}

static void
g4_application_add_playlist_to_file_async_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	G4ApplicationAddPlaylistToFileAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_add_playlist_to_file_async_co (_data_);
}

static gboolean
g4_application_add_playlist_to_file_async_co (G4ApplicationAddPlaylistToFileAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data4_ = g_slice_new0 (Block4Data);
	_data_->_data4_->_ref_count_ = 1;
	_data_->_data4_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data4_->playlist);
	_data_->_data4_->playlist = _data_->playlist;
	_data_->_data4_->append = _data_->append;
	_data_->_data4_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->_data4_->playlist->list_uri;
	_data_->_tmp1_ = g_file_new_for_uri (_data_->_tmp0_);
	_data_->_data4_->file = _data_->_tmp1_;
	_data_->_tmp2_ = g_ptr_array_new_full ((guint) 1024, _g_free0_);
	_data_->_data4_->uris = _data_->_tmp2_;
	_data_->_state_ = 1;
	g4_run_async (G_TYPE_BOOLEAN, NULL, NULL, ___lambda71__g4_task_func, _data_->_data4_, FALSE, FALSE, g4_application_add_playlist_to_file_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = g4_run_finish (_data_->_res_);
	_data_->saved = (gboolean) ((gintptr) _data_->_tmp3_);
	if (_data_->saved) {
		_data_->_tmp4_ = _data_->self->priv->_loader;
		_data_->_tmp5_ = g4_music_loader_get_library (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = g4_music_library_add_playlist (_data_->_tmp6_, _data_->_data4_->playlist);
		_data_->_tmp8_ = _data_->_tmp7_;
		g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_PLAYLIST_ADDED_SIGNAL], 0, _data_->_tmp8_);
		_g_object_unref0 (_data_->_tmp8_);
	} else {
		_data_->_tmp10_ = g4_window_get_default ();
		_data_->_tmp9_ = _data_->_tmp10_;
		if (_data_->_tmp9_ != NULL) {
			g4_window_show_toast (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp9_, G4_TYPE_WINDOW, G4Window), _ ("Save playlist failed"), NULL);
		}
		_g_object_unref0 (_data_->_tmp9_);
	}
	_data_->result = _data_->saved;
	block4_data_unref (_data_->_data4_);
	_data_->_data4_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gint
g4_application_insert_after_current (G4Application* self,
                                     G4Playlist* playlist)
{
	guint position = 0U;
	gboolean _tmp0_ = FALSE;
	G4Music* _tmp1_;
	gboolean changed = FALSE;
	GListStore* _tmp7_;
	GPtrArray* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (playlist != NULL, -1);
	position = (guint) self->priv->_current_index;
	_tmp1_ = self->priv->_current_music;
	if (_tmp1_ != NULL) {
		GListStore* _tmp2_;
		G4Music* _tmp3_;
		guint _tmp4_ = 0U;
		gboolean _tmp5_;
		_tmp2_ = self->priv->_music_queue;
		_tmp3_ = self->priv->_current_music;
		_tmp5_ = g_list_store_find (_tmp2_, (GObject*) G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, G4_TYPE_MUSIC, G4Music), &_tmp4_);
		position = _tmp4_;
		_tmp0_ = _tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		guint _tmp6_;
		_tmp6_ = position;
		position = _tmp6_ + 1;
	}
	_tmp7_ = self->priv->_music_queue;
	_tmp8_ = playlist->items;
	_tmp9_ = g4_merge_items_to_store (_tmp7_, _tmp8_, &position);
	changed = _tmp9_;
	_tmp10_ = g4_application_get_list_modified (self);
	_tmp11_ = _tmp10_;
	g4_application_set_list_modified (self, _tmp11_ | changed);
	if (changed) {
		g4_application_update_current_item (self);
	}
	result = (gint) position;
	return result;
}

gboolean
g4_application_insert_to_queue (G4Application* self,
                                G4Playlist* playlist,
                                guint position,
                                gboolean play_now)
{
	gboolean changed = FALSE;
	GListStore* _tmp0_;
	GPtrArray* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (playlist != NULL, FALSE);
	_tmp0_ = self->priv->_music_queue;
	_tmp1_ = playlist->items;
	_tmp2_ = g4_merge_items_to_store (_tmp0_, _tmp1_, &position);
	changed = _tmp2_;
	_tmp3_ = g4_application_get_list_modified (self);
	_tmp4_ = _tmp3_;
	g4_application_set_list_modified (self, _tmp4_ | changed);
	if (play_now) {
		G4GstPlayer* _tmp5_;
		g4_application_set_current_item (self, (gint) position);
		_tmp5_ = self->priv->_player;
		g4_gst_player_play (_tmp5_);
	} else {
		if (changed) {
			g4_application_update_current_item (self);
		}
	}
	result = changed;
	return result;
}

static void
g4_application_load_music_folder_async_data_free (gpointer _data)
{
	G4ApplicationLoadMusicFolderAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationLoadMusicFolderAsyncData, _data_);
}

void
g4_application_load_music_folder_async (G4Application* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	G4ApplicationLoadMusicFolderAsyncData* _data_;
	G4Application* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (G4ApplicationLoadMusicFolderAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_load_music_folder_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	g4_application_load_music_folder_async_co (_data_);
}

void
g4_application_load_music_folder_finish (G4Application* self,
                                         GAsyncResult* _res_)
{
	G4ApplicationLoadMusicFolderAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static GFile**
_vala_array_dup3 (GFile** self,
                  gssize length)
{
	if (length >= 0) {
		GFile** result;
		gssize i;
		result = g_new0 (GFile*, length + 1);
		for (i = 0; i < length; i++) {
			GFile* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
g4_application_load_music_folder_async_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	G4ApplicationLoadMusicFolderAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_load_music_folder_async_co (_data_);
}

static gboolean
g4_application_load_music_folder_async_co (G4ApplicationLoadMusicFolderAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g4_application_get_music_folder (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = g_file_new_for_uri (_data_->_tmp1_);
	_data_->_tmp3_ = g_new0 (GFile*, 1 + 1);
	_data_->_tmp3_[0] = _data_->_tmp2_;
	_data_->files = _data_->_tmp3_;
	_data_->files_length1 = 1;
	_data_->_files_size_ = _data_->files_length1;
	_data_->_tmp4_ = g_ptr_array_new_full ((guint) 4096, _g_object_unref0_);
	_data_->musics = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->self->priv->_loader;
	_data_->_tmp6_ = _data_->files;
	_data_->_tmp6__length1 = _data_->files_length1;
	_data_->_tmp7_ = (_data_->_tmp6_ != NULL) ? _vala_array_dup3 (_data_->_tmp6_, _data_->_tmp6__length1) : _data_->_tmp6_;
	_data_->_tmp7__length1 = _data_->_tmp6__length1;
	_data_->_tmp8_ = _data_->musics;
	_data_->_state_ = 1;
	g4_music_loader_load_files_async (_data_->_tmp5_, _data_->_tmp7_, (gint) _data_->_tmp7__length1, _data_->_tmp8_, FALSE, FALSE, _data_->self->priv->_sort_mode, g4_application_load_music_folder_async_ready, _data_);
	return FALSE;
	_state_1:
	g4_music_loader_load_files_finish (_data_->_tmp5_, _data_->_res_);
	_data_->self->priv->_store_external_changed = TRUE;
	_data_->_tmp9_ = _data_->self->priv->_music_queue;
	if (g_list_model_get_n_items ((GListModel*) _data_->_tmp9_) == ((guint) 0)) {
		_data_->_tmp10_ = _data_->self->priv->_music_queue;
		_data_->_tmp11_ = _data_->self->priv->_music_queue;
		_data_->_tmp12_ = _data_->musics;
		_data_->_tmp13_ = _data_->_tmp12_->pdata;
		_data_->_tmp13__length1 = _data_->_tmp12_->len;
		g_list_store_splice (_data_->_tmp10_, (guint) 0, g_list_model_get_n_items ((GListModel*) _data_->_tmp11_), (GObject**) _data_->_tmp13_, (guint) ((_data_->_tmp13__length1 * sizeof (G4Music*)) / sizeof (GObject*)));
	} else {
		g4_application_on_music_library_changed (_data_->self, (guint) 0, (guint) 1, (guint) 1);
	}
	_data_->_tmp15_ = _data_->self->priv->_current_music;
	if (_data_->_tmp15_ == NULL) {
		_data_->_tmp16_ = _data_->self->priv->_current_list;
		_data_->_tmp14_ = g_list_model_get_n_items ((GListModel*) _data_->_tmp16_) > ((guint) 0);
	} else {
		_data_->_tmp14_ = FALSE;
	}
	if (_data_->_tmp14_) {
		g4_application_set_current_item (_data_->self, 0);
	} else {
		g4_application_update_current_item (_data_->self);
	}
	_g_ptr_array_unref0 (_data_->musics);
	_data_->files = (_vala_array_free (_data_->files, _data_->files_length1, (GDestroyNotify) g_object_unref), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_open_files_async_data_free (gpointer _data)
{
	G4ApplicationOpenFilesAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationOpenFilesAsyncData, _data_);
}

void
g4_application_open_files_async (G4Application* self,
                                 GFile** files,
                                 gint files_length1,
                                 guint position,
                                 gboolean play_now,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	G4ApplicationOpenFilesAsyncData* _data_;
	G4Application* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (G4ApplicationOpenFilesAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_open_files_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->files = files;
	_data_->files_length1 = files_length1;
	_data_->position = position;
	_data_->play_now = play_now;
	g4_application_open_files_async_co (_data_);
}

gboolean
g4_application_open_files_finish (G4Application* self,
                                  GAsyncResult* _res_)
{
	gboolean result;
	G4ApplicationOpenFilesAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static GFile**
_vala_array_dup4 (GFile** self,
                  gssize length)
{
	if (length >= 0) {
		GFile** result;
		gssize i;
		result = g_new0 (GFile*, length + 1);
		for (i = 0; i < length; i++) {
			GFile* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
g4_application_open_files_async_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	G4ApplicationOpenFilesAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_open_files_async_co (_data_);
}

static gboolean
g4_application_open_files_async_co (G4ApplicationOpenFilesAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g4_playlist_new ("", "");
	_data_->playlist = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->self->priv->_loader;
	_data_->_tmp2_ = (_data_->files != NULL) ? _vala_array_dup4 (_data_->files, _data_->files_length1) : _data_->files;
	_data_->_tmp2__length1 = _data_->files_length1;
	_data_->_tmp3_ = _data_->playlist;
	_data_->_tmp4_ = _data_->_tmp3_->items;
	_data_->_state_ = 1;
	g4_music_loader_load_files_async (_data_->_tmp1_, _data_->_tmp2_, (gint) _data_->_tmp2__length1, _data_->_tmp4_, FALSE, TRUE, (guint) -1, g4_application_open_files_async_ready, _data_);
	return FALSE;
	_state_1:
	g4_music_loader_load_files_finish (_data_->_tmp1_, _data_->_res_);
	_data_->_tmp6_ = _data_->playlist;
	_data_->_tmp7_ = g4_playlist_get_length (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	if (_data_->_tmp8_ > ((guint) 0)) {
		if (_data_->play_now) {
			_data_->_tmp9_ = TRUE;
		} else {
			_data_->_tmp10_ = _data_->self->priv->_current_music;
			_data_->_tmp9_ = _data_->_tmp10_ == NULL;
		}
		_data_->_tmp11_ = _data_->playlist;
		_data_->_tmp5_ = g4_application_insert_to_queue (_data_->self, _data_->_tmp11_, _data_->position, _data_->_tmp9_);
	} else {
		_data_->_tmp5_ = FALSE;
	}
	_data_->result = _data_->_tmp5_;
	_g_object_unref0 (_data_->playlist);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
g4_application_play_next (G4Application* self)
{
	gint _tmp0_;
	gint _tmp1_;
	G4GstPlayer* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g4_application_get_current_item (self);
	_tmp1_ = _tmp0_;
	g4_application_set_current_item (self, _tmp1_ + 1);
	_tmp2_ = self->priv->_player;
	g4_gst_player_play (_tmp2_);
}

void
g4_application_play_pause (G4Application* self)
{
	G4GstPlayer* _tmp0_;
	G4GstPlayer* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_player;
	_tmp1_ = self->priv->_player;
	_tmp2_ = g4_gst_player_get_playing (_tmp1_);
	_tmp3_ = _tmp2_;
	g4_gst_player_set_playing (_tmp0_, !_tmp3_);
}

void
g4_application_play_previous (G4Application* self)
{
	gint _tmp0_;
	gint _tmp1_;
	G4GstPlayer* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g4_application_get_current_item (self);
	_tmp1_ = _tmp0_;
	g4_application_set_current_item (self, _tmp1_ - 1);
	_tmp2_ = self->priv->_player;
	g4_gst_player_play (_tmp2_);
}

static Block6Data*
block6_data_ref (Block6Data* _data6_)
{
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}

static void
block6_data_unref (void * _userdata_)
{
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		G4Application* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->file);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}

static void
__lambda81_ (G4Application* self,
             GObject* obj,
             GAsyncResult* res)
{
	g_return_if_fail (res != NULL);
	g4_application_load_music_folder_finish (self, res);
	self->priv->_reloading = FALSE;
}

static void
___lambda81__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda81_ ((G4Application*) self, source_object, res);
	g_object_unref (self);
}

static void
___lambda80_ (Block6Data* _data6_,
              GObject* obj,
              GAsyncResult* res)
{
	G4Application* self;
	G4MusicLoader* _tmp1_;
	GError* _inner_error0_ = NULL;
	self = _data6_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* _tmp0_;
		_tmp0_ = _data6_->file;
		g_file_delete_finish (_tmp0_, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp1_ = self->priv->_loader;
	g4_music_loader_remove_all (_tmp1_);
	g4_application_load_music_folder_async (self, ___lambda81__gasync_ready_callback, g_object_ref (self));
}

static void
____lambda80__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda80_ (self, source_object, res);
	block6_data_unref (self);
}

void
g4_application_reload_library (G4Application* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (!self->priv->_loading) {
		_tmp0_ = !self->priv->_reloading;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		Block6Data* _data6_;
		GFile* _tmp1_;
		GFile* _tmp2_;
		_data6_ = g_slice_new0 (Block6Data);
		_data6_->_ref_count_ = 1;
		_data6_->self = g_object_ref (self);
		self->priv->_reloading = TRUE;
		_tmp1_ = g4_get_playing_list_file ();
		_data6_->file = _tmp1_;
		_tmp2_ = _data6_->file;
		g_file_delete_async (_tmp2_, G_PRIORITY_DEFAULT, NULL, ____lambda80__gasync_ready_callback, block6_data_ref (_data6_));
		block6_data_unref (_data6_);
		_data6_ = NULL;
	}
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		G4Application* self;
		self = _data7_->self;
		_g4_portal_unref0 (_data7_->portal);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gpointer
_g4_portal_ref0 (gpointer self)
{
	return self ? g4_portal_ref (self) : NULL;
}

static void
__lambda129_ (Block7Data* _data7_,
              GObject* obj,
              GAsyncResult* res)
{
	G4Application* self;
	self = _data7_->self;
	g_return_if_fail (res != NULL);
	g4_portal_request_background_finish (_data7_->portal, res);
}

static void
___lambda129__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda129_ (self, source_object, res);
	block7_data_unref (self);
}

void
g4_application_request_background (G4Application* self)
{
	Block7Data* _data7_;
	G4ActionHandles* _tmp0_ = NULL;
	G4ActionHandles* _tmp1_;
	G4Portal* _tmp2_ = NULL;
	G4Portal* _tmp5_ = NULL;
	G4Portal* _tmp6_;
	G4Portal* _tmp8_;
	g_return_if_fail (self != NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp1_ = self->priv->_actions;
	_tmp0_ = _tmp1_;
	_tmp2_ = NULL;
	if (_tmp0_ != NULL) {
		G4Portal* _tmp3_;
		G4Portal* _tmp4_;
		_tmp3_ = g4_action_handles_get_portal (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G4_TYPE_ACTION_HANDLES, G4ActionHandles));
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	}
	_tmp6_ = _g4_portal_ref0 (_tmp2_);
	_tmp5_ = _tmp6_;
	if (_tmp5_ == NULL) {
		G4Portal* _tmp7_;
		_tmp7_ = g4_portal_new (NULL);
		_g4_portal_unref0 (_tmp5_);
		_tmp5_ = _tmp7_;
	}
	_tmp8_ = _tmp5_;
	_tmp5_ = NULL;
	_data7_->portal = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, G4_TYPE_PORTAL, G4Portal);
	g4_portal_request_background_async (_data7_->portal, _ ("Keep playing after window closed"), ___lambda129__gasync_ready_callback, block7_data_ref (_data7_));
	_g4_portal_unref0 (_tmp5_);
	block7_data_unref (_data7_);
	_data7_ = NULL;
}

static void
g4_application_rename_playlist_async_data_free (gpointer _data)
{
	G4ApplicationRenamePlaylistAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->playlist);
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationRenamePlaylistAsyncData, _data_);
}

void
g4_application_rename_playlist_async (G4Application* self,
                                      G4Playlist* playlist,
                                      const gchar* title,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	G4ApplicationRenamePlaylistAsyncData* _data_;
	G4Application* _tmp0_;
	G4Playlist* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (playlist != NULL);
	g_return_if_fail (title != NULL);
	_data_ = g_slice_new0 (G4ApplicationRenamePlaylistAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_rename_playlist_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (playlist);
	_g_object_unref0 (_data_->playlist);
	_data_->playlist = _tmp1_;
	_tmp2_ = g_strdup (title);
	_g_free0 (_data_->title);
	_data_->title = _tmp2_;
	g4_application_rename_playlist_async_co (_data_);
}

gboolean
g4_application_rename_playlist_finish (G4Application* self,
                                       GAsyncResult* _res_)
{
	gboolean result;
	G4ApplicationRenamePlaylistAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static Block8Data*
block8_data_ref (Block8Data* _data8_)
{
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}

static void
block8_data_unref (void * _userdata_)
{
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		G4Application* self;
		self = _data8_->self;
		_g_ptr_array_unref0 (_data8_->uris);
		_g_object_unref0 (_data8_->file);
		_g_free0 (_data8_->title);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}

static void
__lambda111_ (Block8Data* _data8_,
              G4Music* music)
{
	G4Application* self;
	GPtrArray* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	self = _data8_->self;
	g_return_if_fail (music != NULL);
	_tmp0_ = _data8_->uris;
	_tmp1_ = music->uri;
	_tmp2_ = g_strdup (_tmp1_);
	g_ptr_array_add (_tmp0_, _tmp2_);
}

static void
___lambda111__gfunc (gconstpointer data,
                     gpointer self)
{
	__lambda111_ (self, (G4Music*) data);
}

static gboolean
__lambda112_ (Block8Data* _data8_)
{
	G4Application* self;
	GFile* _tmp0_;
	GPtrArray* _tmp1_;
	gboolean result;
	self = _data8_->self;
	_tmp0_ = _data8_->file;
	_tmp1_ = _data8_->uris;
	result = g4_save_playlist_file (_tmp0_, _tmp1_, _data8_->title, TRUE);
	return result;
}

static gpointer
___lambda112__g4_task_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) __lambda112_ (self));
	return result;
}

static void
g4_application_rename_playlist_async_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	G4ApplicationRenamePlaylistAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_rename_playlist_async_co (_data_);
}

static gboolean
g4_application_rename_playlist_async_co (G4ApplicationRenamePlaylistAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data8_ = g_slice_new0 (Block8Data);
	_data_->_data8_->_ref_count_ = 1;
	_data_->_data8_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data8_->title);
	_data_->_data8_->title = _data_->title;
	_data_->_data8_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->playlist->list_uri;
	_data_->_tmp1_ = g_file_new_for_uri (_data_->_tmp0_);
	_data_->_data8_->file = _data_->_tmp1_;
	_data_->_tmp2_ = g4_playlist_get_length (_data_->playlist);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = g_ptr_array_new_full (_data_->_tmp3_, _g_free0_);
	_data_->_data8_->uris = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->playlist->items;
	g_ptr_array_foreach (_data_->_tmp5_, ___lambda111__gfunc, _data_->_data8_);
	_data_->_state_ = 1;
	g4_run_async (G_TYPE_BOOLEAN, NULL, NULL, ___lambda112__g4_task_func, _data_->_data8_, FALSE, FALSE, g4_application_rename_playlist_async_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = g4_run_finish (_data_->_res_);
	_data_->saved = (gboolean) ((gintptr) _data_->_tmp6_);
	if (_data_->saved) {
		g4_playlist_set_title (_data_->playlist, _data_->_data8_->title);
		_data_->_tmp7_ = _data_->self->priv->_loader;
		_data_->_tmp8_ = g4_music_loader_get_library (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = g4_music_library_add_playlist (_data_->_tmp9_, _data_->playlist);
		_data_->_tmp11_ = _data_->_tmp10_;
		g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_PLAYLIST_ADDED_SIGNAL], 0, _data_->_tmp11_);
		_g_object_unref0 (_data_->_tmp11_);
	}
	_data_->result = _data_->saved;
	block8_data_unref (_data_->_data8_);
	_data_->_data8_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_save_queue_to_file_data_free (gpointer _data)
{
	G4ApplicationSaveQueueToFileData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationSaveQueueToFileData, _data_);
}

void
g4_application_save_queue_to_file (G4Application* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	G4ApplicationSaveQueueToFileData* _data_;
	G4Application* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (G4ApplicationSaveQueueToFileData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_save_queue_to_file_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	g4_application_save_queue_to_file_co (_data_);
}

gboolean
g4_application_save_queue_to_file_finish (G4Application* self,
                                          GAsyncResult* _res_)
{
	gboolean result;
	G4ApplicationSaveQueueToFileData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static Block9Data*
block9_data_ref (Block9Data* _data9_)
{
	g_atomic_int_inc (&_data9_->_ref_count_);
	return _data9_;
}

static void
block9_data_unref (void * _userdata_)
{
	Block9Data* _data9_;
	_data9_ = (Block9Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
		G4Application* self;
		self = _data9_->self;
		_g_object_unref0 (_data9_->file);
		_g_ptr_array_unref0 (_data9_->uris);
		_g_object_unref0 (self);
		g_slice_free (Block9Data, _data9_);
	}
}

static gboolean
__lambda102_ (Block9Data* _data9_)
{
	G4Application* self;
	GFile* _tmp0_;
	GPtrArray* _tmp1_;
	gboolean result;
	self = _data9_->self;
	_tmp0_ = _data9_->file;
	_tmp1_ = _data9_->uris;
	result = g4_save_playlist_file (_tmp0_, _tmp1_, NULL, FALSE);
	return result;
}

static gpointer
___lambda102__g4_task_func (gpointer self)
{
	gpointer result;
	result = (gpointer) ((gintptr) __lambda102_ (self));
	return result;
}

static void
g4_application_save_queue_to_file_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	G4ApplicationSaveQueueToFileData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_save_queue_to_file_co (_data_);
}

static gboolean
g4_application_save_queue_to_file_co (G4ApplicationSaveQueueToFileData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data9_ = g_slice_new0 (Block9Data);
	_data_->_data9_->_ref_count_ = 1;
	_data_->_data9_->self = g_object_ref (_data_->self);
	_data_->_data9_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->_music_queue;
	_data_->count = g_list_model_get_n_items ((GListModel*) _data_->_tmp0_);
	_data_->_tmp1_ = g_ptr_array_new_full (_data_->count, _g_free0_);
	_data_->_data9_->uris = _data_->_tmp1_;
	{
		_data_->i = 0;
		{
			_data_->_tmp2_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp2_) {
					_data_->_tmp3_ = _data_->i;
					_data_->i = _data_->_tmp3_ + 1;
				}
				_data_->_tmp2_ = FALSE;
				if (!(((guint) _data_->i) < _data_->count)) {
					break;
				}
				_data_->_tmp4_ = _data_->self->priv->_music_queue;
				_data_->_tmp5_ = g_list_model_get_item ((GListModel*) _data_->_tmp4_, (guint) _data_->i);
				_data_->music = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp5_, G4_TYPE_MUSIC, G4Music);
				_data_->_tmp6_ = _data_->_data9_->uris;
				_data_->_tmp7_ = _data_->music;
				_data_->_tmp8_ = _data_->_tmp7_->uri;
				_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
				g_ptr_array_add (_data_->_tmp6_, _data_->_tmp9_);
				_g_object_unref0 (_data_->music);
			}
		}
	}
	_data_->_tmp10_ = g4_get_playing_list_file ();
	_data_->_data9_->file = _data_->_tmp10_;
	_data_->_state_ = 1;
	g4_run_async (G_TYPE_BOOLEAN, NULL, NULL, ___lambda102__g4_task_func, _data_->_data9_, FALSE, TRUE, g4_application_save_queue_to_file_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = g4_run_finish (_data_->_res_);
	_data_->ret = (gboolean) ((gintptr) _data_->_tmp11_);
	if (_data_->ret) {
		_data_->self->priv->_list_modified = FALSE;
	}
	_data_->result = _data_->ret;
	block9_data_unref (_data_->_data9_);
	_data_->_data9_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_save_to_playlist_file_async_data_free (gpointer _data)
{
	G4ApplicationSaveToPlaylistFileAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->playlist);
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationSaveToPlaylistFileAsyncData, _data_);
}

void
g4_application_save_to_playlist_file_async (G4Application* self,
                                            G4Playlist* playlist,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	G4ApplicationSaveToPlaylistFileAsyncData* _data_;
	G4Application* _tmp0_;
	G4Playlist* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (playlist != NULL);
	_data_ = g_slice_new0 (G4ApplicationSaveToPlaylistFileAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_save_to_playlist_file_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (playlist);
	_g_object_unref0 (_data_->playlist);
	_data_->playlist = _tmp1_;
	g4_application_save_to_playlist_file_async_co (_data_);
}

void
g4_application_save_to_playlist_file_finish (G4Application* self,
                                             GAsyncResult* _res_)
{
	G4ApplicationSaveToPlaylistFileAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
g4_application_save_to_playlist_file_async_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	G4ApplicationSaveToPlaylistFileAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_save_to_playlist_file_async_co (_data_);
}

static gboolean
g4_application_save_to_playlist_file_async_co (G4ApplicationSaveToPlaylistFileAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->playlist->list_uri;
	_data_->_tmp1_ = g_strdup (_data_->_tmp0_);
	_data_->uri = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->uri;
	_data_->_tmp3_ = g_file_new_for_uri (_data_->_tmp2_);
	_data_->file = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->uri;
	_data_->_tmp5_ = strlen (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->append = _data_->_tmp6_ == 0;
	if (_data_->append) {
		_data_->_tmp7_ = gtk_file_filter_new ();
		_data_->filter = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->filter;
		g_object_set (_data_->_tmp8_, "name", _ ("Playlist Files"), NULL);
		_data_->_tmp9_ = _data_->filter;
		gtk_file_filter_add_mime_type (_data_->_tmp9_, "audio/x-mpegurl");
		_data_->_tmp10_ = _data_->filter;
		gtk_file_filter_add_mime_type (_data_->_tmp10_, "audio/x-scpls");
		_data_->_tmp11_ = _data_->filter;
		gtk_file_filter_add_mime_type (_data_->_tmp11_, "public.m3u-playlist");
		_data_->_tmp12_ = g4_application_get_music_folder (_data_->self);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = g_file_new_for_uri (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = ((G4Music*) _data_->playlist)->title;
		_data_->_tmp17_ = g_strconcat (_data_->_tmp16_, ".m3u", NULL);
		_data_->_tmp18_ = _data_->_tmp17_;
		_data_->_tmp19_ = g_file_get_child (_data_->_tmp15_, _data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_g_free0 (_data_->_tmp18_);
		_g_object_unref0 (_data_->_tmp15_);
		_data_->initial = _data_->_tmp20_;
		_data_->_tmp21_ = gtk_application_get_active_window ((GtkApplication*) _data_->self);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = _data_->initial;
		_data_->_tmp24_ = _data_->filter;
		_data_->_tmp25_ = _g_object_ref0 (_data_->_tmp24_);
		_data_->_tmp26_ = g_new0 (GtkFileFilter*, 1 + 1);
		_data_->_tmp26_[0] = _data_->_tmp25_;
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp27__length1 = 1;
		_data_->_state_ = 1;
		g4_show_save_file_dialog (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp27_, (gint) 1, g4_application_save_to_playlist_file_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp28_ = g4_show_save_file_dialog_finish (_data_->_res_);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_tmp27_ = (_vala_array_free (_data_->_tmp27_, _data_->_tmp27__length1, (GDestroyNotify) g_object_unref), NULL);
		_data_->file_new = _data_->_tmp29_;
		_data_->_tmp30_ = _data_->file_new;
		if (_data_->_tmp30_ == NULL) {
			_g_object_unref0 (_data_->file_new);
			_g_object_unref0 (_data_->initial);
			_g_object_unref0 (_data_->filter);
			_g_object_unref0 (_data_->file);
			_g_free0 (_data_->uri);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp31_ = _data_->file_new;
		_data_->_tmp32_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp31_, g_file_get_type (), GFile));
		_g_object_unref0 (_data_->file);
		_data_->file = _data_->_tmp32_;
		_data_->_tmp33_ = _data_->file;
		_data_->_tmp34_ = g_file_get_uri (_data_->_tmp33_);
		_data_->_tmp35_ = _data_->_tmp34_;
		g4_playlist_set_list_uri (_data_->playlist, _data_->_tmp35_);
		_g_free0 (_data_->_tmp35_);
		_data_->_tmp36_ = _data_->file;
		_data_->_tmp37_ = g4_get_file_display_name (_data_->_tmp36_);
		_data_->_tmp38_ = _data_->_tmp37_;
		g4_playlist_set_title (_data_->playlist, _data_->_tmp38_);
		_g_free0 (_data_->_tmp38_);
		_data_->_tmp39_ = _data_->self->priv->_settings;
		_data_->_tmp40_ = _data_->playlist->list_uri;
		g_settings_set_string (_data_->_tmp39_, "recent-playlist", _data_->_tmp40_);
		_g_object_unref0 (_data_->file_new);
		_g_object_unref0 (_data_->initial);
		_g_object_unref0 (_data_->filter);
	}
	_data_->_state_ = 2;
	g4_application_add_playlist_to_file_async (_data_->self, _data_->playlist, _data_->append, g4_application_save_to_playlist_file_async_ready, _data_);
	return FALSE;
	_state_2:
	_data_->saved = g4_application_add_playlist_to_file_finish (_data_->self, _data_->_res_);
	if (_data_->saved) {
		_data_->_tmp41_ = _data_->append;
	} else {
		_data_->_tmp41_ = FALSE;
	}
	if (_data_->_tmp41_) {
		_data_->_tmp43_ = g4_window_get_default ();
		_data_->_tmp42_ = _data_->_tmp43_;
		if (_data_->_tmp42_ != NULL) {
			_data_->_tmp44_ = g4_build_library_uri (NULL, (G4Album*) _data_->playlist);
			_data_->_tmp45_ = _data_->_tmp44_;
			g4_window_show_toast (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp42_, G4_TYPE_WINDOW, G4Window), _ ("Save playlist successfully"), _data_->_tmp45_);
			_g_free0 (_data_->_tmp45_);
		}
		_g_object_unref0 (_data_->_tmp42_);
	}
	_g_object_unref0 (_data_->file);
	_g_free0 (_data_->uri);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_show_add_playlist_dialog_data_free (gpointer _data)
{
	G4ApplicationShowAddPlaylistDialogData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->playlist);
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationShowAddPlaylistDialogData, _data_);
}

void
g4_application_show_add_playlist_dialog (G4Application* self,
                                         G4Playlist* playlist,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	G4ApplicationShowAddPlaylistDialogData* _data_;
	G4Application* _tmp0_;
	G4Playlist* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (playlist != NULL);
	_data_ = g_slice_new0 (G4ApplicationShowAddPlaylistDialogData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_show_add_playlist_dialog_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (playlist);
	_g_object_unref0 (_data_->playlist);
	_data_->playlist = _tmp1_;
	g4_application_show_add_playlist_dialog_co (_data_);
}

void
g4_application_show_add_playlist_dialog_finish (G4Application* self,
                                                GAsyncResult* _res_)
{
	G4ApplicationShowAddPlaylistDialogData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
g4_application_show_add_playlist_dialog_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	G4ApplicationShowAddPlaylistDialogData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_show_add_playlist_dialog_co (_data_);
}

static gboolean
g4_application_show_add_playlist_dialog_co (G4ApplicationShowAddPlaylistDialogData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g4_playlist_dialog_new (_data_->self);
	g_object_ref_sink (_data_->_tmp0_);
	_data_->dialog = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->dialog;
	_data_->_tmp2_ = g4_window_get_default ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	g4_playlist_dialog_choose (_data_->_tmp1_, (GtkWindow*) _data_->_tmp3_, g4_application_show_add_playlist_dialog_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = g4_playlist_dialog_choose_finish (_data_->_tmp1_, _data_->_res_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_g_object_unref0 (_data_->_tmp3_);
	_data_->pls = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->pls;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp7_ = _data_->pls;
		_data_->_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp7_, G4_TYPE_PLAYLIST, G4Playlist)->list_uri;
		_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
		_data_->list_uri = _data_->_tmp9_;
		_data_->_tmp10_ = _data_->list_uri;
		_data_->_tmp11_ = strlen (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		if (_data_->_tmp12_ > 0) {
			_data_->_tmp13_ = _data_->list_uri;
			g4_playlist_set_list_uri (_data_->playlist, _data_->_tmp13_);
			_data_->_state_ = 2;
			g4_application_add_playlist_to_file_async (_data_->self, _data_->playlist, TRUE, g4_application_show_add_playlist_dialog_ready, _data_);
			return FALSE;
			_state_2:
			g4_application_add_playlist_to_file_finish (_data_->self, _data_->_res_);
		} else {
			_data_->_state_ = 3;
			g4_application_save_to_playlist_file_async (_data_->self, _data_->playlist, g4_application_show_add_playlist_dialog_ready, _data_);
			return FALSE;
			_state_3:
			g4_application_save_to_playlist_file_finish (_data_->self, _data_->_res_);
		}
		_g_free0 (_data_->list_uri);
	}
	_g_object_unref0 (_data_->pls);
	_g_object_unref0 (_data_->dialog);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_delete_cover_tmp_file_async_data_free (gpointer _data)
{
	G4ApplicationDeleteCoverTmpFileAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationDeleteCoverTmpFileAsyncData, _data_);
}

static void
g4_application_delete_cover_tmp_file_async (G4Application* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	G4ApplicationDeleteCoverTmpFileAsyncData* _data_;
	G4Application* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (G4ApplicationDeleteCoverTmpFileAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_delete_cover_tmp_file_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	g4_application_delete_cover_tmp_file_async_co (_data_);
}

static void
g4_application_delete_cover_tmp_file_finish (G4Application* self,
                                             GAsyncResult* _res_)
{
	G4ApplicationDeleteCoverTmpFileAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
g4_application_delete_cover_tmp_file_async_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	G4ApplicationDeleteCoverTmpFileAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_delete_cover_tmp_file_async_co (_data_);
}

static gboolean
g4_application_delete_cover_tmp_file_async_co (G4ApplicationDeleteCoverTmpFileAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = _data_->self->priv->_cover_tmp_file;
		if (_data_->_tmp0_ != NULL) {
			_data_->_tmp1_ = _data_->self->priv->_cover_tmp_file;
			_data_->_state_ = 1;
			g_file_delete_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, g_file_get_type (), GFile), G_PRIORITY_DEFAULT, NULL, g4_application_delete_cover_tmp_file_async_ready, _data_);
			return FALSE;
			_state_1:
			g_file_delete_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp1_, g_file_get_type (), GFile), _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_g_object_unref0 (_data_->self->priv->_cover_tmp_file);
			_data_->self->priv->_cover_tmp_file = NULL;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gint
g4_application_find_music_item_by_uri (G4Application* self,
                                       const gchar* uri)
{
	G4Music* music = NULL;
	G4MusicLoader* _tmp0_;
	G4Music* _tmp1_;
	G4Music* _tmp2_;
	guint count = 0U;
	GtkFilterListModel* _tmp5_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (uri != NULL, -1);
	_tmp0_ = self->priv->_loader;
	_tmp1_ = g4_music_loader_find_cache (_tmp0_, uri);
	music = _tmp1_;
	_tmp2_ = music;
	if (_tmp2_ != NULL) {
		gint index = 0;
		GtkFilterListModel* _tmp3_;
		G4Music* _tmp4_;
		_tmp3_ = self->priv->_current_list;
		_tmp4_ = music;
		index = g4_find_item_in_model ((GListModel*) _tmp3_, (GObject*) _tmp4_, self->priv->_current_index);
		if (index != -1) {
			result = index;
			_g_object_unref0 (music);
			return result;
		}
	}
	_tmp5_ = self->priv->_current_list;
	count = g_list_model_get_n_items ((GListModel*) _tmp5_);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				G4Music* m = NULL;
				GtkFilterListModel* _tmp8_;
				GObject* _tmp9_;
				G4Music* _tmp10_;
				const gchar* _tmp11_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				if (!(((guint) i) < count)) {
					break;
				}
				_tmp8_ = self->priv->_current_list;
				_tmp9_ = g_list_model_get_item ((GListModel*) _tmp8_, (guint) i);
				m = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, G4_TYPE_MUSIC, G4Music);
				_tmp10_ = m;
				_tmp11_ = _tmp10_->uri;
				if (g_strcmp0 (_tmp11_, uri) == 0) {
					result = (gint) i;
					_g_object_unref0 (m);
					_g_object_unref0 (music);
					return result;
				}
				_g_object_unref0 (m);
			}
		}
	}
	result = -1;
	_g_object_unref0 (music);
	return result;
}

static void
g4_application_on_bus_acquired (G4Application* self,
                                GDBusConnection* connection,
                                const gchar* name)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	{
		G4MprisPlayer* _tmp0_;
		G4MprisPlayer* _tmp1_;
		G4MprisRoot* _tmp2_;
		G4MprisRoot* _tmp3_;
		_tmp0_ = g4_mpris_player_new (self, connection);
		_tmp1_ = _tmp0_;
		g4_mpris_player_register_object (_tmp1_, connection, "/org/mpris/MediaPlayer2", &_inner_error0_);
		_g_object_unref0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = g4_mpris_root_new (self);
		_tmp3_ = _tmp2_;
		g4_mpris_root_register_object (_tmp3_, connection, "/org/mpris/MediaPlayer2", &_inner_error0_);
		_g_object_unref0 (_tmp3_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_warning ("application.vala:535: Register MPRIS failed: %s\n", _tmp5_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->len;
	return result;
}

static void
g4_application_on_music_found (G4Application* self,
                               GPtrArray* arr)
{
	gint _tmp0_;
	gint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (arr != NULL);
	self->priv->_store_external_changed = TRUE;
	_tmp0_ = vala_g_ptr_array_get_length (arr);
	_tmp1_ = _tmp0_;
	if (_tmp1_ > 0) {
		GListStore* _tmp2_;
		GListStore* _tmp3_;
		gpointer* _tmp4_;
		gint _tmp4__length1;
		_tmp2_ = self->priv->_music_queue;
		_tmp3_ = self->priv->_music_queue;
		_tmp4_ = arr->pdata;
		_tmp4__length1 = arr->len;
		g_list_store_splice (_tmp2_, g_list_model_get_n_items ((GListModel*) _tmp3_), (guint) 0, (GObject**) _tmp4_, (guint) ((_tmp4__length1 * sizeof (G4Music*)) / sizeof (GObject*)));
	} else {
		g4_application_on_music_library_changed (self, (guint) 0, (guint) 1, (guint) 1);
	}
}

static void
___lambda44_ (G4Application* self)
{
	self->priv->_pending_mic_handler = (guint) 0;
	g4_application_update_current_item (self);
}

static void
____lambda44__g4_void_func (gpointer self)
{
	___lambda44_ ((G4Application*) self);
}

static void
g4_application_on_music_list_changed (G4Application* self,
                                      guint position,
                                      guint removed,
                                      guint added)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (removed != ((guint) 0)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = added != ((guint) 0);
	}
	if (_tmp0_) {
		if (self->priv->_pending_mic_handler != ((guint) 0)) {
			g_source_remove (self->priv->_pending_mic_handler);
		}
		self->priv->_pending_mic_handler = g4_run_idle_once (____lambda44__g4_void_func, g_object_ref (self), g_object_unref, G_PRIORITY_LOW);
	}
}

static void
___lambda45_ (G4Application* self)
{
	self->priv->_pending_msc_handler = (guint) 0;
	g_signal_emit (self, g4_application_signals[G4_APPLICATION_MUSIC_LIBRARY_CHANGED_SIGNAL], 0, self->priv->_store_external_changed);
	self->priv->_store_external_changed = FALSE;
}

static void
____lambda45__g4_void_func (gpointer self)
{
	___lambda45_ ((G4Application*) self);
}

static void
g4_application_on_music_library_changed (G4Application* self,
                                         guint position,
                                         guint removed,
                                         guint added)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (removed != ((guint) 0)) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = added != ((guint) 0);
	}
	if (_tmp0_) {
		if (self->priv->_pending_msc_handler != ((guint) 0)) {
			g_source_remove (self->priv->_pending_msc_handler);
		}
		self->priv->_pending_msc_handler = g4_run_idle_once (____lambda45__g4_void_func, g_object_ref (self), g_object_unref, G_PRIORITY_LOW);
	}
}

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		G4Application* self;
		self = _data10_->self;
		_g_ptr_array_unref0 (_data10_->arr);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		GHashTable* self;
		self = _data11_->self;
		_g_hash_table_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static void
__lambda2_ (Block11Data* _data11_,
            gconstpointer k,
            gconstpointer v)
{
	GHashTable* self;
	self = _data11_->self;
	_data11_->func (v, _data11_->func_target);
}

static void
___lambda2__gh_func (gconstpointer key,
                     gconstpointer value,
                     gpointer self)
{
	__lambda2_ (self, key, value);
}

static void
_vala_g_hash_set_foreach (GHashTable* self,
                          GFunc func,
                          gpointer func_target)
{
	Block11Data* _data11_;
	g_return_if_fail (self != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_hash_table_ref (self);
	_data11_->func = func;
	_data11_->func_target = func_target;
	g_hash_table_foreach ((GHashTable*) self, ___lambda2__gh_func, _data11_);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}

static void
___lambda47_ (Block10Data* _data10_,
              G4Music* music)
{
	G4Application* self;
	GPtrArray* _tmp0_;
	G4Music* _tmp1_;
	self = _data10_->self;
	g_return_if_fail (music != NULL);
	_tmp0_ = _data10_->arr;
	_tmp1_ = _g_object_ref0 (music);
	g_ptr_array_add (_tmp0_, _tmp1_);
}

static void
____lambda47__gfunc (gconstpointer data,
                     gpointer self)
{
	___lambda47_ (self, (G4Music*) data);
}

static void
g4_application_on_music_lost (G4Application* self,
                              GHashTable* removed)
{
	guint _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (removed != NULL);
	self->priv->_store_external_changed = TRUE;
	_tmp0_ = g_hash_table_size (removed);
	_tmp1_ = _tmp0_;
	if (_tmp1_ > ((guint) 0)) {
		Block10Data* _data10_;
		guint _tmp2_;
		guint _tmp3_;
		GPtrArray* _tmp4_;
		GListStore* _tmp5_;
		GPtrArray* _tmp6_;
		_data10_ = g_slice_new0 (Block10Data);
		_data10_->_ref_count_ = 1;
		_data10_->self = g_object_ref (self);
		_tmp2_ = g_hash_table_size (removed);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_ptr_array_new_full (_tmp3_, _g_object_unref0_);
		_data10_->arr = _tmp4_;
		_vala_g_hash_set_foreach (removed, ____lambda47__gfunc, _data10_);
		_tmp5_ = self->priv->_music_queue;
		_tmp6_ = _data10_->arr;
		g4_remove_items_from_store (_tmp5_, _tmp6_, NULL);
		block10_data_unref (_data10_);
		_data10_ = NULL;
	} else {
		g4_application_on_music_library_changed (self, (guint) 0, (guint) 1, (guint) 1);
	}
}

static void
g4_application_on_player_end (G4Application* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_single_loop) {
		G4GstPlayer* _tmp0_;
		G4GstPlayer* _tmp1_;
		_tmp0_ = self->priv->_player;
		g4_gst_player_seek (_tmp0_, (GstClockTime) 0);
		_tmp1_ = self->priv->_player;
		g4_gst_player_play (_tmp1_);
	} else {
		gint _tmp2_;
		gint _tmp3_;
		_tmp2_ = g4_application_get_current_item (self);
		_tmp3_ = _tmp2_;
		g4_application_set_current_item (self, _tmp3_ + 1);
	}
}

static void
g4_application_on_player_error (G4Application* self,
                                GError* err)
{
	G4Window* _tmp0_ = NULL;
	G4Window* _tmp1_;
	G4GstPlayer* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (err != NULL);
	_tmp1_ = g4_window_get_default ();
	_tmp0_ = _tmp1_;
	if (_tmp0_ != NULL) {
		const gchar* _tmp2_;
		_tmp2_ = err->message;
		g4_window_show_toast (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G4_TYPE_WINDOW, G4Window), _tmp2_, NULL);
	}
	_tmp3_ = self->priv->_player;
	_tmp4_ = g4_gst_player_get_gapless (_tmp3_);
	_tmp5_ = _tmp4_;
	if (!_tmp5_) {
		g4_application_on_player_end (self);
	}
	_g_object_unref0 (_tmp0_);
}

static gchar*
g4_application_on_player_next_uri_request (G4Application* self)
{
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		GString* _tmp0_;
		_tmp0_ = self->priv->_next_uri;
		g_rec_mutex_lock (&self->priv->__lock__next_uri);
		{
			const gchar* _tmp4_;
			gchar* _tmp5_;
			if (!self->priv->_single_loop) {
				GString* _tmp1_;
				const gchar* _tmp2_;
				gchar* _tmp3_;
				_tmp1_ = self->priv->_next_uri;
				_tmp2_ = _tmp1_->str;
				_tmp3_ = g_strdup (_tmp2_);
				_g_free0 (self->priv->_current_uri);
				self->priv->_current_uri = _tmp3_;
			}
			_tmp4_ = self->priv->_current_uri;
			_tmp5_ = g_strdup (_tmp4_);
			result = _tmp5_;
			{
				GString* _tmp6_;
				_tmp6_ = self->priv->_next_uri;
				g_rec_mutex_unlock (&self->priv->__lock__next_uri);
			}
			return result;
		}
		__finally0:
		{
			GString* _tmp7_;
			_tmp7_ = self->priv->_next_uri;
			g_rec_mutex_unlock (&self->priv->__lock__next_uri);
		}
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

static void
g4_application_on_player_next_uri_start (G4Application* self)
{
	g_return_if_fail (self != NULL);
	g4_application_on_player_end (self);
}

static void
g4_application_on_player_state_changed (G4Application* self,
                                        GstState state)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (state == GST_STATE_PLAYING) {
		_tmp0_ = self->priv->_inhibit_id == ((guint) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		G4Window* _tmp1_;
		G4Window* _tmp2_;
		_tmp1_ = g4_window_get_default ();
		_tmp2_ = _tmp1_;
		self->priv->_inhibit_id = gtk_application_inhibit ((GtkApplication*) self, (GtkWindow*) _tmp2_, GTK_APPLICATION_INHIBIT_SUSPEND, _ ("Keep playing"));
		_g_object_unref0 (_tmp2_);
	} else {
		gboolean _tmp3_ = FALSE;
		if (state != GST_STATE_PLAYING) {
			_tmp3_ = self->priv->_inhibit_id != ((guint) 0);
		} else {
			_tmp3_ = FALSE;
		}
		if (_tmp3_) {
			gtk_application_uninhibit ((GtkApplication*) self, self->priv->_inhibit_id);
			self->priv->_inhibit_id = (guint) 0;
		}
	}
}

static void
g4_application_on_player_tag_parsed_data_free (gpointer _data)
{
	G4ApplicationOnPlayerTagParsedData* _data_;
	_data_ = _data;
	_g_free0 (_data_->u);
	_gst_tag_list_unref0 (_data_->tags);
	_g_object_unref0 (_data_->self);
	g_slice_free (G4ApplicationOnPlayerTagParsedData, _data_);
}

static gpointer
_gst_tag_list_ref0 (gpointer self)
{
	return self ? gst_tag_list_ref (self) : NULL;
}

static void
g4_application_on_player_tag_parsed (G4Application* self,
                                     const gchar* u,
                                     GstTagList* tags,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	G4ApplicationOnPlayerTagParsedData* _data_;
	G4Application* _tmp0_;
	gchar* _tmp1_;
	GstTagList* _tmp2_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (G4ApplicationOnPlayerTagParsedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_application_on_player_tag_parsed_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (u);
	_g_free0 (_data_->u);
	_data_->u = _tmp1_;
	_tmp2_ = _gst_tag_list_ref0 (tags);
	_gst_tag_list_unref0 (_data_->tags);
	_data_->tags = _tmp2_;
	g4_application_on_player_tag_parsed_co (_data_);
}

static void
g4_application_on_player_tag_parsed_finish (G4Application* self,
                                            GAsyncResult* _res_)
{
	G4ApplicationOnPlayerTagParsedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		G4Application* self;
		self = _data12_->self;
		_g_free0 (_data12_->uri);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		G4Application* self;
		self = _data13_->_data12_->self;
		_gst_sample_unref0 (_data13_->image);
		_g_object_unref0 (_data13_->pixbuf);
		block12_data_unref (_data13_->_data12_);
		_data13_->_data12_ = NULL;
		g_slice_free (Block13Data, _data13_);
	}
}

static GstSample*
____lambda137_ (Block13Data* _data13_)
{
	Block12Data* _data12_;
	G4Application* self;
	GFile* file = NULL;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	GstTagList* t = NULL;
	GFile* _tmp2_;
	GstTagList* _tmp3_;
	GstSample* _tmp4_ = NULL;
	GstTagList* _tmp5_;
	GstSample* _tmp8_;
	GstSample* result;
	_data12_ = _data13_->_data12_;
	self = _data12_->self;
	_tmp0_ = _data12_->uri;
	_tmp1_ = g_file_new_for_uri ((const gchar*) _tmp0_);
	file = _tmp1_;
	_tmp2_ = file;
	_tmp3_ = g4_parse_gst_tags (_tmp2_);
	t = _tmp3_;
	_tmp5_ = t;
	if (_tmp5_ != NULL) {
		GstTagList* _tmp6_;
		GstSample* _tmp7_;
		_tmp6_ = t;
		_tmp7_ = g4_parse_image_from_tag_list ((GstTagList*) _tmp6_);
		_gst_sample_unref0 (_tmp4_);
		_tmp4_ = _tmp7_;
	} else {
		_gst_sample_unref0 (_tmp4_);
		_tmp4_ = NULL;
	}
	_tmp8_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp8_;
	_gst_sample_unref0 (_tmp4_);
	_gst_tag_list_unref0 (t);
	_g_object_unref0 (file);
	return result;
}

static gpointer
_____lambda137__g4_task_func (gpointer self)
{
	gpointer result;
	result = ____lambda137_ (self);
	return result;
}

static void
g4_application_on_player_tag_parsed_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	G4ApplicationOnPlayerTagParsedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_application_on_player_tag_parsed_co (_data_);
}

static gpointer
_gst_sample_ref0 (gpointer self)
{
	return self ? gst_sample_ref (self) : NULL;
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		G4Application* self;
		self = _data14_->_data13_->_data12_->self;
		block13_data_unref (_data14_->_data13_);
		_data14_->_data13_ = NULL;
		g_slice_free (Block14Data, _data14_);
	}
}

static GdkPixbuf*
_____lambda138_ (Block14Data* _data14_)
{
	Block13Data* _data13_;
	Block12Data* _data12_;
	G4Application* self;
	GstSample* _tmp0_;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* result;
	_data13_ = _data14_->_data13_;
	_data12_ = _data13_->_data12_;
	self = _data12_->self;
	_tmp0_ = _data13_->image;
	_tmp1_ = g4_load_clamp_pixbuf_from_sample ((GstSample*) _tmp0_, _data14_->size);
	result = _tmp1_;
	return result;
}

static gpointer
______lambda138__g4_task_func (gpointer self)
{
	gpointer result;
	result = _____lambda138_ (self);
	return result;
}

static GdkPixbuf*
____lambda139_ (Block13Data* _data13_)
{
	Block12Data* _data12_;
	G4Application* self;
	GdkPixbuf* _tmp0_;
	G4Thumbnailer* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	GdkPixbuf* _tmp4_;
	GdkPixbuf* result;
	_data12_ = _data13_->_data12_;
	self = _data12_->self;
	_tmp0_ = _data13_->pixbuf;
	_tmp1_ = self->priv->_thumbnailer;
	_tmp2_ = g4_thumbnailer_get_scale_factor (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g4_create_clamp_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gdk_pixbuf_get_type (), GdkPixbuf), G4_THUMBNAILER_ICON_SIZE * _tmp3_);
	result = _tmp4_;
	return result;
}

static gpointer
_____lambda139__g4_task_func (gpointer self)
{
	gpointer result;
	result = ____lambda139_ (self);
	return result;
}

static gboolean
g4_application_on_player_tag_parsed_co (G4ApplicationOnPlayerTagParsedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data12_ = g_slice_new0 (Block12Data);
	_data_->_data12_->_ref_count_ = 1;
	_data_->_data12_->self = g_object_ref (_data_->self);
	_data_->_data12_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->u;
	if (_data_->_tmp0_ == NULL) {
		_data_->_tmp0_ = "";
	}
	_data_->_tmp1_ = g_strdup ((const gchar*) _data_->_tmp0_);
	_data_->_data12_->uri = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->self->priv->_current_music;
	if (_data_->_tmp3_ != NULL) {
		_data_->_tmp4_ = _data_->self->priv->_current_uri;
		_data_->_tmp5_ = _data_->_data12_->uri;
		_data_->_tmp2_ = g_strcmp0 (_data_->_tmp4_, _data_->_tmp5_) == 0;
	} else {
		_data_->_tmp2_ = FALSE;
	}
	if (_data_->_tmp2_) {
		_data_->_data13_ = g_slice_new0 (Block13Data);
		_data_->_data13_->_ref_count_ = 1;
		_data_->_data13_->_data12_ = block12_data_ref (_data_->_data12_);
		_data_->_tmp7_ = _data_->self->priv->_loader;
		_data_->_tmp8_ = _data_->self->priv->_current_uri;
		_data_->_tmp9_ = g4_music_loader_find_cache (_data_->_tmp7_, _data_->_tmp8_);
		_data_->_tmp6_ = _data_->_tmp9_;
		if (_data_->_tmp6_ == NULL) {
			_data_->_tmp10_ = _data_->self->priv->_current_music;
			_data_->_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp10_, G4_TYPE_MUSIC, G4Music));
			_g_object_unref0 (_data_->_tmp6_);
			_data_->_tmp6_ = _data_->_tmp11_;
		}
		_data_->_tmp12_ = _data_->_tmp6_;
		_data_->_tmp6_ = NULL;
		_data_->music = G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, G4_TYPE_MUSIC, G4Music);
		_data_->_tmp13_ = _data_->music;
		_data_->_tmp14_ = _data_->self->priv->_current_music;
		if (_data_->_tmp13_ != _data_->_tmp14_) {
			_data_->_tmp15_ = _data_->music;
			_data_->_tmp16_ = _g_object_ref0 (_data_->_tmp15_);
			_g_object_unref0 (_data_->self->priv->_current_music);
			_data_->self->priv->_current_music = _data_->_tmp16_;
			_data_->_tmp17_ = _data_->music;
			g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_MUSIC_CHANGED_SIGNAL], 0, _data_->_tmp17_);
		} else {
			_data_->_tmp20_ = _data_->music;
			if (g4_music_has_unknown (_data_->_tmp20_)) {
				_data_->_tmp19_ = _data_->tags != NULL;
			} else {
				_data_->_tmp19_ = FALSE;
			}
			if (_data_->_tmp19_) {
				_data_->_tmp21_ = _data_->music;
				_data_->_tmp18_ = g4_music_from_gst_tags (_data_->_tmp21_, (GstTagList*) _data_->tags);
			} else {
				_data_->_tmp18_ = FALSE;
			}
			if (_data_->_tmp18_) {
				_data_->_tmp22_ = _data_->self->priv->_loader;
				_data_->_tmp23_ = _data_->music;
				g4_music_loader_add_to_cache (_data_->_tmp22_, _data_->_tmp23_);
				_data_->_tmp24_ = _data_->music;
				g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_MUSIC_CHANGED_SIGNAL], 0, _data_->_tmp24_);
			}
		}
		if (_data_->tags != NULL) {
			_data_->_tmp26_ = g4_parse_image_from_tag_list ((GstTagList*) _data_->tags);
			_gst_sample_unref0 (_data_->_tmp25_);
			_data_->_tmp25_ = _data_->_tmp26_;
		} else {
			_gst_sample_unref0 (_data_->_tmp25_);
			_data_->_tmp25_ = NULL;
		}
		_data_->_tmp27_ = _data_->_tmp25_;
		_data_->_tmp25_ = NULL;
		_gst_sample_unref0 (_data_->self->priv->_current_cover);
		_data_->self->priv->_current_cover = _data_->_tmp27_;
		_data_->_tmp29_ = _data_->self->priv->_current_cover;
		if (_data_->_tmp29_ == NULL) {
			_data_->_tmp28_ = _data_->u != NULL;
		} else {
			_data_->_tmp28_ = FALSE;
		}
		if (_data_->_tmp28_) {
			_data_->_state_ = 1;
			g4_run_async (gst_sample_get_type (), (GBoxedCopyFunc) gst_sample_ref, (GDestroyNotify) gst_sample_unref, _____lambda137__g4_task_func, _data_->_data13_, FALSE, FALSE, g4_application_on_player_tag_parsed_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp30_ = g4_run_finish (_data_->_res_);
			_gst_sample_unref0 (_data_->self->priv->_current_cover);
			_data_->self->priv->_current_cover = (GstSample*) _data_->_tmp30_;
		}
		_data_->_data13_->pixbuf = NULL;
		_data_->_tmp31_ = _data_->self->priv->_current_cover;
		_data_->_tmp32_ = _gst_sample_ref0 (_data_->_tmp31_);
		_data_->_data13_->image = _data_->_tmp32_;
		_data_->_tmp33_ = _data_->self->priv->_current_uri;
		_data_->_tmp34_ = _data_->_data12_->uri;
		if (g_strcmp0 (_data_->_tmp33_, _data_->_tmp34_) == 0) {
			_data_->_data14_ = g_slice_new0 (Block14Data);
			_data_->_data14_->_ref_count_ = 1;
			_data_->_data14_->_data13_ = block13_data_ref (_data_->_data13_);
			_data_->_tmp35_ = _data_->self->priv->_thumbnailer;
			_data_->_tmp36_ = g4_thumbnailer_get_scale_factor (_data_->_tmp35_);
			_data_->_tmp37_ = _data_->_tmp36_;
			_data_->_data14_->size = _data_->self->priv->_cover_size * _data_->_tmp37_;
			_data_->_tmp38_ = _data_->_data13_->image;
			if (_data_->_tmp38_ != NULL) {
				_data_->_state_ = 2;
				g4_run_async (gdk_pixbuf_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, ______lambda138__g4_task_func, _data_->_data14_, TRUE, FALSE, g4_application_on_player_tag_parsed_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp39_ = g4_run_finish (_data_->_res_);
				_g_object_unref0 (_data_->_data13_->pixbuf);
				_data_->_data13_->pixbuf = (GdkPixbuf*) _data_->_tmp39_;
			}
			_data_->_tmp40_ = _data_->_data13_->pixbuf;
			if (_data_->_tmp40_ == NULL) {
				_data_->_tmp41_ = _data_->self->priv->_thumbnailer;
				_data_->_tmp42_ = _data_->music;
				_data_->_state_ = 3;
				g4_thumbnailer_load_directly_async (_data_->_tmp41_, _data_->_tmp42_, _data_->_data14_->size, g4_application_on_player_tag_parsed_ready, _data_);
				return FALSE;
				_state_3:
				_data_->_tmp43_ = g4_thumbnailer_load_directly_finish (_data_->_tmp41_, _data_->_res_);
				_g_object_unref0 (_data_->_data13_->pixbuf);
				_data_->_data13_->pixbuf = _data_->_tmp43_;
			}
			block14_data_unref (_data_->_data14_);
			_data_->_data14_ = NULL;
		}
		_data_->_tmp44_ = _data_->self->priv->_current_uri;
		_data_->_tmp45_ = _data_->_data12_->uri;
		if (g_strcmp0 (_data_->_tmp44_, _data_->_tmp45_) == 0) {
			_data_->_tmp46_ = _data_->music;
			_data_->_tmp47_ = _data_->_tmp46_->cover_uri;
			_data_->_tmp48_ = g_strdup (_data_->_tmp47_);
			_data_->cover_uri = _data_->_tmp48_;
			_data_->_tmp49_ = _data_->cover_uri;
			if (_data_->_tmp49_ == NULL) {
				_data_->_tmp50_ = g_get_user_cache_dir ();
				_data_->_tmp51_ = g_application_get_application_id ((GApplication*) _data_->self);
				_data_->_tmp52_ = _data_->_tmp51_;
				_data_->_tmp53_ = g_file_new_build_filename (_data_->_tmp50_, _data_->_tmp52_, NULL);
				_data_->dir = _data_->_tmp53_;
				_data_->_tmp54_ = _data_->music;
				_data_->_tmp55_ = g4_music_get_cover_key (_data_->_tmp54_);
				_data_->_tmp56_ = _data_->_tmp55_;
				_data_->_tmp57_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _data_->_tmp56_, (gsize) -1);
				_data_->name = _data_->_tmp57_;
				_data_->_tmp58_ = _data_->dir;
				_data_->_tmp59_ = _data_->name;
				_data_->_tmp60_ = g_file_get_child (_data_->_tmp58_, _data_->_tmp59_);
				_data_->file = _data_->_tmp60_;
				_data_->_tmp61_ = _data_->file;
				_data_->_tmp62_ = g_file_get_uri (_data_->_tmp61_);
				_g_free0 (_data_->cover_uri);
				_data_->cover_uri = _data_->_tmp62_;
				_data_->_tmp63_ = _data_->_data13_->image;
				if (_data_->_tmp63_ != NULL) {
					_data_->_tmp64_ = _data_->file;
					_data_->_tmp65_ = _data_->_data13_->image;
					_data_->_state_ = 4;
					g4_save_sample_to_file_async (_data_->_tmp64_, (GstSample*) _data_->_tmp65_, g4_application_on_player_tag_parsed_ready, _data_);
					return FALSE;
					_state_4:
					g4_save_sample_to_file_finish (_data_->_res_);
				} else {
					_data_->_tmp66_ = _data_->self->priv->_thumbnailer;
					_data_->_tmp67_ = _data_->music;
					_data_->_tmp68_ = g4_thumbnailer_create_music_text_svg (_data_->_tmp66_, _data_->_tmp67_);
					_data_->svg = _data_->_tmp68_;
					_data_->_tmp69_ = _data_->file;
					_data_->_tmp70_ = _data_->svg;
					_data_->_state_ = 5;
					g4_save_text_to_file_async (_data_->_tmp69_, _data_->_tmp70_, g4_application_on_player_tag_parsed_ready, _data_);
					return FALSE;
					_state_5:
					g4_save_text_to_file_finish (_data_->_res_);
					_g_free0 (_data_->svg);
				}
				_data_->_tmp72_ = _data_->self->priv->_cover_tmp_file;
				_data_->_tmp71_ = _data_->_tmp72_;
				_data_->_tmp73_ = NULL;
				if (_data_->_tmp71_ != NULL) {
					_data_->_tmp74_ = g_file_get_uri (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp71_, g_file_get_type (), GFile));
					_g_free0 (_data_->_tmp73_);
					_data_->_tmp73_ = _data_->_tmp74_;
				}
				_data_->_tmp75_ = ((GCompareFunc) g_strcmp0);
				_data_->_tmp76_ = _data_->cover_uri;
				if (_data_->_tmp75_ (_data_->_tmp76_, _data_->_tmp73_) != 0) {
					_data_->_state_ = 6;
					g4_application_delete_cover_tmp_file_async (_data_->self, g4_application_on_player_tag_parsed_ready, _data_);
					return FALSE;
					_state_6:
					g4_application_delete_cover_tmp_file_finish (_data_->self, _data_->_res_);
					_data_->_tmp77_ = _data_->file;
					_data_->_tmp78_ = _g_object_ref0 (_data_->_tmp77_);
					_g_object_unref0 (_data_->self->priv->_cover_tmp_file);
					_data_->self->priv->_cover_tmp_file = _data_->_tmp78_;
				}
				_g_free0 (_data_->_tmp73_);
				_g_object_unref0 (_data_->file);
				_g_free0 (_data_->name);
				_g_object_unref0 (_data_->dir);
			}
			_data_->_tmp79_ = _data_->self->priv->_current_uri;
			_data_->_tmp80_ = _data_->_data12_->uri;
			if (g_strcmp0 (_data_->_tmp79_, _data_->_tmp80_) == 0) {
				_data_->_tmp81_ = _data_->music;
				_data_->_tmp82_ = _data_->_data13_->pixbuf;
				_data_->_tmp83_ = _data_->cover_uri;
				g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_MUSIC_COVER_PARSED_SIGNAL], 0, _data_->_tmp81_, _data_->_tmp82_, _data_->_tmp83_);
			}
			_g_free0 (_data_->cover_uri);
		}
		_data_->_tmp85_ = _data_->_data13_->pixbuf;
		if (_data_->_tmp85_ != NULL) {
			_data_->_tmp86_ = _data_->self->priv->_thumbnailer;
			_data_->_tmp87_ = _data_->music;
			_data_->_tmp88_ = g4_thumbnailer_find (_data_->_tmp86_, _data_->_tmp87_, G4_THUMBNAILER_ICON_SIZE);
			_data_->_tmp89_ = _data_->_tmp88_;
			_data_->_tmp84_ = !G_TYPE_CHECK_INSTANCE_TYPE (_data_->_tmp89_, gdk_texture_get_type ());
			_g_object_unref0 (_data_->_tmp89_);
		} else {
			_data_->_tmp84_ = FALSE;
		}
		if (_data_->_tmp84_) {
			_data_->_state_ = 7;
			g4_run_async (gdk_pixbuf_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _____lambda139__g4_task_func, _data_->_data13_, FALSE, FALSE, g4_application_on_player_tag_parsed_ready, _data_);
			return FALSE;
			_state_7:
			_data_->_tmp90_ = g4_run_finish (_data_->_res_);
			_data_->minbuf = (GdkPixbuf*) _data_->_tmp90_;
			_data_->_tmp91_ = _data_->minbuf;
			if (_data_->_tmp91_ != NULL) {
				_data_->_tmp92_ = _data_->minbuf;
				_data_->_tmp93_ = gdk_texture_new_for_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp92_, gdk_pixbuf_get_type (), GdkPixbuf));
				_data_->paintable = _data_->_tmp93_;
				_data_->_tmp94_ = _data_->self->priv->_thumbnailer;
				_data_->_tmp95_ = _data_->music;
				_data_->_tmp96_ = _data_->paintable;
				g4_thumbnailer_put (_data_->_tmp94_, _data_->_tmp95_, (GdkPaintable*) _data_->_tmp96_, TRUE, G4_THUMBNAILER_ICON_SIZE);
				_data_->_tmp97_ = _data_->music;
				_data_->_tmp98_ = _data_->paintable;
				g_signal_emit (_data_->self, g4_application_signals[G4_APPLICATION_THUMBNAIL_CHANGED_SIGNAL], 0, _data_->_tmp97_, (GdkPaintable*) _data_->_tmp98_);
				_g_object_unref0 (_data_->paintable);
			}
			_g_object_unref0 (_data_->minbuf);
		}
		_gst_sample_unref0 (_data_->_tmp25_);
		_g_object_unref0 (_data_->music);
		_g_object_unref0 (_data_->_tmp6_);
		block13_data_unref (_data_->_data13_);
		_data_->_data13_ = NULL;
	}
	block12_data_unref (_data_->_data12_);
	_data_->_data12_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_application_update_current_item (G4Application* self)
{
	gint index = 0;
	GtkFilterListModel* _tmp0_;
	G4Music* _tmp1_;
	gboolean _tmp2_ = FALSE;
	guint size = 0U;
	GtkFilterListModel* _tmp14_;
	gboolean _tmp15_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_list;
	_tmp1_ = self->priv->_current_music;
	index = g4_find_item_in_model ((GListModel*) _tmp0_, (GObject*) _tmp1_, self->priv->_current_index);
	if (index == -1) {
		G4Music* _tmp3_;
		_tmp3_ = self->priv->_current_music;
		_tmp2_ = _tmp3_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		const gchar* uri = NULL;
		G4Music* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		G4Music* _tmp7_ = NULL;
		_tmp4_ = self->priv->_current_music;
		_tmp5_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, G4_TYPE_MUSIC, G4Music)->uri;
		uri = _tmp5_;
		_tmp6_ = uri;
		index = g4_application_find_music_item_by_uri (self, _tmp6_);
		if (index != -1) {
			GtkFilterListModel* _tmp8_;
			GObject* _tmp9_;
			G4Music* _tmp10_;
			_tmp8_ = self->priv->_current_list;
			_tmp9_ = g_list_model_get_item ((GListModel*) _tmp8_, (guint) index);
			_tmp10_ = G4_IS_MUSIC (_tmp9_) ? ((G4Music*) _tmp9_) : NULL;
			if (_tmp10_ == NULL) {
				_g_object_unref0 (_tmp9_);
			}
			_g_object_unref0 (_tmp7_);
			_tmp7_ = _tmp10_;
		} else {
			G4MusicLoader* _tmp11_;
			const gchar* _tmp12_;
			G4Music* _tmp13_;
			_tmp11_ = self->priv->_loader;
			_tmp12_ = uri;
			_tmp13_ = g4_music_loader_find_cache (_tmp11_, _tmp12_);
			_g_object_unref0 (_tmp7_);
			_tmp7_ = _tmp13_;
		}
		g4_application_set_current_music (self, _tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	_tmp14_ = self->priv->_current_list;
	size = g_list_model_get_n_items ((GListModel*) _tmp14_);
	if (self->priv->_current_index != index) {
		_tmp15_ = TRUE;
	} else {
		_tmp15_ = self->priv->_current_list_size != size;
	}
	if (_tmp15_) {
		self->priv->_current_index = index;
		self->priv->_current_list_size = size;
		g_signal_emit (self, g4_application_signals[G4_APPLICATION_INDEX_CHANGED_SIGNAL], 0, index, size);
	}
	g4_application_update_next_item (self);
}

static void
g4_application_update_next_item (G4Application* self)
{
	G4Music* next_music = NULL;
	GtkFilterListModel* _tmp0_;
	GObject* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_list;
	_tmp1_ = g_list_model_get_item ((GListModel*) _tmp0_, (guint) (self->priv->_current_index + 1));
	next_music = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G4_TYPE_MUSIC, G4Music);
	{
		GString* _tmp2_;
		_tmp2_ = self->priv->_next_uri;
		g_rec_mutex_lock (&self->priv->__lock__next_uri);
		{
			G4Music* _tmp3_ = NULL;
			G4Music* _tmp4_;
			const gchar* _tmp5_ = NULL;
			const gchar* _tmp7_ = NULL;
			GString* _tmp8_;
			_tmp4_ = next_music;
			_tmp3_ = _tmp4_;
			_tmp5_ = NULL;
			if (_tmp3_ != NULL) {
				const gchar* _tmp6_;
				_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, G4_TYPE_MUSIC, G4Music)->uri;
				_tmp5_ = _tmp6_;
			}
			_tmp7_ = _tmp5_;
			if (_tmp7_ == NULL) {
				_tmp7_ = "";
			}
			_tmp8_ = self->priv->_next_uri;
			g_string_assign (_tmp8_, (const gchar*) _tmp7_);
		}
		__finally0:
		{
			GString* _tmp9_;
			_tmp9_ = self->priv->_next_uri;
			g_rec_mutex_unlock (&self->priv->__lock__next_uri);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (next_music);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_g_object_unref0 (next_music);
}

guint
g4_application_get_color_scheme (G4Application* self)
{
	guint result;
	AdwStyleManager* _tmp0_;
	AdwStyleManager* _tmp1_;
	AdwColorScheme _tmp2_;
	AdwColorScheme _tmp3_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = adw_application_get_style_manager ((AdwApplication*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = adw_style_manager_get_color_scheme (_tmp1_);
	_tmp3_ = _tmp2_;
	result = (guint) _tmp3_;
	return result;
}

static GVariant*
_variant_new1 (gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

void
g4_application_set_color_scheme (G4Application* self,
                                 guint value)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	GSimpleAction* _tmp2_ = NULL;
	GAction* _tmp3_;
	AdwStyleManager* _tmp7_;
	AdwStyleManager* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_action_map_lookup_action ((GActionMap*) self, G4_ACTION_SCHEME);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	action = _tmp1_;
	_tmp3_ = action;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp3_) : NULL;
	if (_tmp2_ != NULL) {
		gchar* _tmp4_;
		gchar* _tmp5_;
		GVariant* _tmp6_;
		_tmp4_ = g_strdup_printf ("%u", value);
		_tmp5_ = _tmp4_;
		_tmp6_ = _variant_new1 (_tmp5_);
		g_simple_action_set_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_simple_action_get_type (), GSimpleAction), _tmp6_);
		_g_variant_unref0 (_tmp6_);
		_g_free0 (_tmp5_);
	}
	_tmp7_ = adw_application_get_style_manager ((AdwApplication*) self);
	_tmp8_ = _tmp7_;
	adw_style_manager_set_color_scheme (_tmp8_, (AdwColorScheme) value);
	_g_object_unref0 (action);
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_COLOR_SCHEME_PROPERTY]);
}

GstSample*
g4_application_get_current_cover (G4Application* self)
{
	GstSample* result;
	GstSample* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_cover;
	result = _tmp0_;
	return result;
}

gint
g4_application_get_current_item (G4Application* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_current_index;
	return result;
}

static gint*
_int_dup (gint* self)
{
	gint* dup;
	dup = g_new0 (gint, 1);
	memcpy (dup, self, sizeof (gint));
	return dup;
}

static gpointer
__int_dup0 (gpointer self)
{
	return self ? _int_dup (self) : NULL;
}

void
g4_application_set_current_item (G4Application* self,
                                 gint value)
{
	GtkFilterListModel* _tmp0_;
	GtkFilterListModel* _tmp9_;
	GObject* _tmp10_;
	G4Music* _tmp11_;
	G4Music* _tmp12_;
	GtkFilterListModel* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_list;
	if (value >= ((gint) g_list_model_get_n_items ((GListModel*) _tmp0_))) {
		G4Window* _tmp1_ = NULL;
		G4Window* _tmp2_;
		gint* _tmp3_ = NULL;
		gint* _tmp6_ = NULL;
		gint* _tmp7_;
		_tmp2_ = g4_window_get_default ();
		_tmp1_ = _tmp2_;
		_tmp3_ = NULL;
		if (_tmp1_ != NULL) {
			gint _tmp4_;
			gint* _tmp5_;
			_tmp4_ = g4_window_open_next_playable_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, G4_TYPE_WINDOW, G4Window));
			_tmp5_ = __int_dup0 (&_tmp4_);
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp5_;
		}
		_tmp7_ = __int_dup0 (_tmp3_);
		_tmp6_ = _tmp7_;
		if (_tmp6_ == NULL) {
			gint* _tmp8_;
			_tmp8_ = __int_dup0 (&value);
			_g_free0 (_tmp6_);
			_tmp6_ = _tmp8_;
		}
		value = (gint) (*_tmp6_);
		_g_free0 (_tmp6_);
		_g_free0 (_tmp3_);
		_g_object_unref0 (_tmp1_);
	}
	_tmp9_ = self->priv->_current_list;
	_tmp10_ = g_list_model_get_item ((GListModel*) _tmp9_, (guint) value);
	_tmp11_ = G4_IS_MUSIC (_tmp10_) ? ((G4Music*) _tmp10_) : NULL;
	if (_tmp11_ == NULL) {
		_g_object_unref0 (_tmp10_);
	}
	_tmp12_ = _tmp11_;
	g4_application_set_current_music (self, _tmp12_);
	_g_object_unref0 (_tmp12_);
	self->priv->_current_index = value;
	_tmp13_ = self->priv->_current_list;
	self->priv->_current_list_size = g_list_model_get_n_items ((GListModel*) _tmp13_);
	g_signal_emit (self, g4_application_signals[G4_APPLICATION_INDEX_CHANGED_SIGNAL], 0, value, self->priv->_current_list_size);
	g4_application_update_next_item (self);
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_CURRENT_ITEM_PROPERTY]);
}

GtkFilterListModel*
g4_application_get_current_list (G4Application* self)
{
	GtkFilterListModel* result;
	GtkFilterListModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_list;
	result = _tmp0_;
	return result;
}

void
g4_application_set_current_list (G4Application* self,
                                 GtkFilterListModel* value)
{
	GtkFilterListModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_list;
	if (_tmp0_ != value) {
		GtkFilterListModel* _tmp1_;
		guint _tmp2_;
		GtkFilterListModel* _tmp3_;
		GtkFilterListModel* _tmp4_;
		_tmp1_ = self->priv->_current_list;
		g_signal_parse_name ("items-changed", g_list_model_get_type (), &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched ((GListModel*) _tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _g4_application_on_music_list_changed_g_list_model_items_changed, self);
		_tmp3_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_current_list);
		self->priv->_current_list = _tmp3_;
		_tmp4_ = self->priv->_current_list;
		g_signal_connect_object ((GListModel*) _tmp4_, "items-changed", (GCallback) _g4_application_on_music_list_changed_g_list_model_items_changed, self, 0);
		g4_application_update_current_item (self);
	}
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_CURRENT_LIST_PROPERTY]);
}

G4Music*
g4_application_get_current_music (G4Application* self)
{
	G4Music* result;
	G4Music* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_music;
	result = _tmp0_;
	return result;
}

void
g4_application_set_current_music (G4Application* self,
                                  G4Music* value)
{
	gboolean _tmp0_ = FALSE;
	G4Music* _tmp1_;
	gboolean playing = FALSE;
	gboolean _tmp5_ = FALSE;
	G4Music* _tmp6_;
	G4Music* _tmp8_ = NULL;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp11_ = NULL;
	gchar* uri = NULL;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GSettings* _tmp25_;
	const gchar* _tmp26_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_current_music;
	if (_tmp1_ != NULL) {
		_tmp0_ = TRUE;
	} else {
		G4GstPlayer* _tmp2_;
		GstState _tmp3_;
		GstState _tmp4_;
		_tmp2_ = self->priv->_player;
		_tmp3_ = g4_gst_player_get_state (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == GST_STATE_PLAYING;
	}
	playing = _tmp0_;
	_tmp6_ = self->priv->_current_music;
	if (_tmp6_ != value) {
		_tmp5_ = TRUE;
	} else {
		_tmp5_ = value == NULL;
	}
	if (_tmp5_) {
		G4Music* _tmp7_;
		_tmp7_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_current_music);
		self->priv->_current_music = _tmp7_;
		g_signal_emit (self, g4_application_signals[G4_APPLICATION_MUSIC_CHANGED_SIGNAL], 0, value);
	}
	_tmp8_ = value;
	_tmp9_ = NULL;
	if (_tmp8_ != NULL) {
		const gchar* _tmp10_;
		_tmp10_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, G4_TYPE_MUSIC, G4Music)->uri;
		_tmp9_ = _tmp10_;
	}
	_tmp11_ = _tmp9_;
	if (_tmp11_ == NULL) {
		_tmp11_ = "";
	}
	_tmp12_ = g_strdup ((const gchar*) _tmp11_);
	uri = _tmp12_;
	_tmp13_ = self->priv->_current_uri;
	_tmp14_ = uri;
	if (g_strcmp0 (_tmp13_, _tmp14_) != 0) {
		G4GstPlayer* _tmp15_;
		G4GstPlayer* _tmp16_;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		gint _tmp21_;
		gint _tmp22_;
		_gst_sample_unref0 (self->priv->_current_cover);
		self->priv->_current_cover = NULL;
		_tmp15_ = self->priv->_player;
		g4_gst_player_set_state (_tmp15_, GST_STATE_READY);
		_tmp16_ = self->priv->_player;
		_tmp17_ = uri;
		_tmp18_ = g_strdup (_tmp17_);
		_g_free0 (self->priv->_current_uri);
		self->priv->_current_uri = _tmp18_;
		_tmp19_ = self->priv->_current_uri;
		g4_gst_player_set_uri (_tmp16_, _tmp19_);
		_tmp20_ = uri;
		_tmp21_ = strlen (_tmp20_);
		_tmp22_ = _tmp21_;
		if (_tmp22_ > 0) {
			GstState _tmp23_ = 0;
			G4GstPlayer* _tmp24_;
			if (playing) {
				_tmp23_ = GST_STATE_PLAYING;
			} else {
				_tmp23_ = GST_STATE_PAUSED;
			}
			_tmp24_ = self->priv->_player;
			g4_gst_player_set_state (_tmp24_, _tmp23_);
		}
	}
	_tmp25_ = self->priv->_settings;
	_tmp26_ = uri;
	g_settings_set_string (_tmp25_, "recent-music", _tmp26_);
	_g_free0 (uri);
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_CURRENT_MUSIC_PROPERTY]);
}

GtkIconPaintable*
g4_application_get_icon (G4Application* self)
{
	GtkIconPaintable* result;
	GtkIconPaintable* _tmp0_;
	GtkIconPaintable* _tmp17_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	if (_tmp0_ == NULL) {
		GtkIconTheme* theme = NULL;
		GtkWindow* _tmp1_;
		GtkWindow* _tmp2_;
		GdkDisplay* _tmp3_;
		GdkDisplay* _tmp4_;
		GdkDisplay* _tmp5_;
		GtkIconTheme* _tmp6_;
		GtkIconTheme* _tmp7_;
		GtkIconTheme* _tmp8_;
		GtkIconTheme* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		GtkWindow* _tmp12_;
		GtkWindow* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		GtkIconPaintable* _tmp16_;
		_tmp1_ = gtk_application_get_active_window ((GtkApplication*) self);
		_tmp2_ = _tmp1_;
		g_object_get (_tmp2_, "display", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gtk_icon_theme_get_for_display (_tmp5_);
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp5_);
		theme = _tmp8_;
		_tmp9_ = theme;
		_tmp10_ = g_application_get_application_id ((GApplication*) self);
		_tmp11_ = _tmp10_;
		_tmp12_ = gtk_application_get_active_window ((GtkApplication*) self);
		_tmp13_ = _tmp12_;
		_tmp14_ = gtk_widget_get_scale_factor ((GtkWidget*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = gtk_icon_theme_lookup_icon (_tmp9_, _tmp11_, NULL, self->priv->_cover_size, _tmp15_, GTK_TEXT_DIR_NONE, GTK_ICON_LOOKUP_FORCE_REGULAR);
		_g_object_unref0 (self->priv->_icon);
		self->priv->_icon = _tmp16_;
		_g_object_unref0 (theme);
	}
	_tmp17_ = self->priv->_icon;
	result = _tmp17_;
	return result;
}

gboolean
g4_application_get_list_modified (G4Application* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_list_modified;
	return result;
}

void
g4_application_set_list_modified (G4Application* self,
                                  gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_list_modified = value;
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_LIST_MODIFIED_PROPERTY]);
}

G4MusicLoader*
g4_application_get_loader (G4Application* self)
{
	G4MusicLoader* result;
	G4MusicLoader* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_loader;
	result = _tmp0_;
	return result;
}

gboolean
g4_application_get_loading (G4Application* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_loading;
	return result;
}

const gchar*
g4_application_get_music_folder (G4Application* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	const gchar* _tmp10_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_music_folder;
	_tmp1_ = strlen (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == 0) {
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_;
		gchar* path = NULL;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		GFile* _tmp7_;
		GFile* _tmp8_;
		gchar* _tmp9_;
		_tmp4_ = g_get_user_special_dir (G_USER_DIRECTORY_MUSIC);
		_tmp3_ = (const gchar*) _tmp4_;
		if (_tmp3_ == NULL) {
			_tmp3_ = "Music";
		}
		_tmp5_ = g_strdup ((const gchar*) _tmp3_);
		path = _tmp5_;
		_tmp6_ = path;
		_tmp7_ = g_file_new_build_filename (_tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_file_get_uri (_tmp8_);
		_g_free0 (self->priv->_music_folder);
		self->priv->_music_folder = _tmp9_;
		_g_object_unref0 (_tmp8_);
		_g_free0 (path);
	}
	_tmp10_ = self->priv->_music_folder;
	result = _tmp10_;
	return result;
}

void
g4_application_set_music_folder (G4Application* self,
                                 const gchar* value)
{
	const gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_music_folder;
	if (g_strcmp0 (_tmp0_, value) != 0) {
		gchar* _tmp1_;
		G4Window* _tmp2_;
		G4Window* _tmp3_;
		gboolean _tmp4_;
		_tmp1_ = g_strdup (value);
		_g_free0 (self->priv->_music_folder);
		self->priv->_music_folder = _tmp1_;
		_tmp2_ = g4_window_get_default ();
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_ != NULL;
		_g_object_unref0 (_tmp3_);
		if (_tmp4_) {
			g4_application_reload_library (self);
		}
	}
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_MUSIC_FOLDER_PROPERTY]);
}

GListStore*
g4_application_get_music_queue (G4Application* self)
{
	GListStore* result;
	GListStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_music_queue;
	result = _tmp0_;
	return result;
}

const gchar*
g4_application_get_name (G4Application* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = _ ("Gapless");
	return result;
}

G4GstPlayer*
g4_application_get_player (G4Application* self)
{
	G4GstPlayer* result;
	G4GstPlayer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_player;
	result = _tmp0_;
	return result;
}

GSettings*
g4_application_get_settings (G4Application* self)
{
	GSettings* result;
	GSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	result = _tmp0_;
	return result;
}

gboolean
g4_application_get_single_loop (G4Application* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_single_loop;
	return result;
}

void
g4_application_set_single_loop (G4Application* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = g4_application_get_single_loop (self);
	if (old_value != value) {
		self->priv->_single_loop = value;
		g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_SINGLE_LOOP_PROPERTY]);
	}
}

guint
g4_application_get_sort_mode (G4Application* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_sort_mode;
	return result;
}

void
g4_application_set_sort_mode (G4Application* self,
                              guint value)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	GVariant* state = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GSimpleAction* _tmp6_ = NULL;
	GAction* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_action_map_lookup_action ((GActionMap*) self, G4_ACTION_SORT);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	action = _tmp1_;
	_tmp2_ = g_strdup_printf ("%u", value);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_new_string (_tmp3_);
	g_variant_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	state = _tmp5_;
	_tmp7_ = action;
	_tmp6_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp7_) : NULL;
	if (_tmp6_ != NULL) {
		GVariant* _tmp8_;
		_tmp8_ = state;
		g_simple_action_set_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, g_simple_action_get_type (), GSimpleAction), _tmp8_);
	}
	if (self->priv->_sort_mode != value) {
		GListStore* _tmp9_;
		self->priv->_sort_mode = value;
		_tmp9_ = self->priv->_music_queue;
		g4_sort_music_store (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, g_list_store_get_type (), GListStore), value);
	}
	_g_variant_unref0 (state);
	_g_object_unref0 (action);
	g_object_notify_by_pspec ((GObject *) self, g4_application_properties[G4_APPLICATION_SORT_MODE_PROPERTY]);
}

G4Thumbnailer*
g4_application_get_thumbnailer (G4Application* self)
{
	G4Thumbnailer* result;
	G4Thumbnailer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_thumbnailer;
	result = _tmp0_;
	return result;
}

static void
g_cclosure_user_marshal_VOID__INT_UINT (GClosure * closure,
                                        GValue * return_value,
                                        guint n_param_values,
                                        const GValue * param_values,
                                        gpointer invocation_hint,
                                        gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_UINT) (gpointer data1, gint arg_1, guint arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_UINT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__INT_UINT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_uint (param_values + 2), data2);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING (GClosure * closure,
                                                    GValue * return_value,
                                                    guint n_param_values,
                                                    const GValue * param_values,
                                                    gpointer invocation_hint,
                                                    gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_STRING) (gpointer data1, gpointer arg_1, gpointer arg_2, const char* arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_STRING callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 4);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_STRING) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_string (param_values + 3), data2);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), data2);
}

static void
g4_application_class_init (G4ApplicationClass * klass,
                           gpointer klass_data)
{
	g4_application_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &G4Application_private_offset);
	((GApplicationClass *) klass)->startup = (void (*) (GApplication*)) g4_application_real_startup;
	((GApplicationClass *) klass)->activate = (void (*) (GApplication*)) g4_application_real_activate;
	((GApplicationClass *) klass)->open = (void (*) (GApplication*, GFile**, gint, const gchar*)) g4_application_real_open;
	((GApplicationClass *) klass)->shutdown = (void (*) (GApplication*)) g4_application_real_shutdown;
	G_OBJECT_CLASS (klass)->get_property = _vala_g4_application_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_g4_application_set_property;
	G_OBJECT_CLASS (klass)->finalize = g4_application_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_COLOR_SCHEME_PROPERTY, g4_application_properties[G4_APPLICATION_COLOR_SCHEME_PROPERTY] = g_param_spec_uint ("color-scheme", "color-scheme", "color-scheme", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_CURRENT_COVER_PROPERTY, g4_application_properties[G4_APPLICATION_CURRENT_COVER_PROPERTY] = g_param_spec_boxed ("current-cover", "current-cover", "current-cover", gst_sample_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_CURRENT_ITEM_PROPERTY, g4_application_properties[G4_APPLICATION_CURRENT_ITEM_PROPERTY] = g_param_spec_int ("current-item", "current-item", "current-item", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_CURRENT_LIST_PROPERTY, g4_application_properties[G4_APPLICATION_CURRENT_LIST_PROPERTY] = g_param_spec_object ("current-list", "current-list", "current-list", gtk_filter_list_model_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_CURRENT_MUSIC_PROPERTY, g4_application_properties[G4_APPLICATION_CURRENT_MUSIC_PROPERTY] = g_param_spec_object ("current-music", "current-music", "current-music", G4_TYPE_MUSIC, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_ICON_PROPERTY, g4_application_properties[G4_APPLICATION_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", gtk_icon_paintable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_LIST_MODIFIED_PROPERTY, g4_application_properties[G4_APPLICATION_LIST_MODIFIED_PROPERTY] = g_param_spec_boolean ("list-modified", "list-modified", "list-modified", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_LOADER_PROPERTY, g4_application_properties[G4_APPLICATION_LOADER_PROPERTY] = g_param_spec_object ("loader", "loader", "loader", G4_TYPE_MUSIC_LOADER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_LOADING_PROPERTY, g4_application_properties[G4_APPLICATION_LOADING_PROPERTY] = g_param_spec_boolean ("loading", "loading", "loading", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_MUSIC_FOLDER_PROPERTY, g4_application_properties[G4_APPLICATION_MUSIC_FOLDER_PROPERTY] = g_param_spec_string ("music-folder", "music-folder", "music-folder", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_MUSIC_QUEUE_PROPERTY, g4_application_properties[G4_APPLICATION_MUSIC_QUEUE_PROPERTY] = g_param_spec_object ("music-queue", "music-queue", "music-queue", g_list_store_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_NAME_PROPERTY, g4_application_properties[G4_APPLICATION_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_PLAYER_PROPERTY, g4_application_properties[G4_APPLICATION_PLAYER_PROPERTY] = g_param_spec_object ("player", "player", "player", G4_TYPE_GST_PLAYER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_SETTINGS_PROPERTY, g4_application_properties[G4_APPLICATION_SETTINGS_PROPERTY] = g_param_spec_object ("settings", "settings", "settings", g_settings_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_SINGLE_LOOP_PROPERTY, g4_application_properties[G4_APPLICATION_SINGLE_LOOP_PROPERTY] = g_param_spec_boolean ("single-loop", "single-loop", "single-loop", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_SORT_MODE_PROPERTY, g4_application_properties[G4_APPLICATION_SORT_MODE_PROPERTY] = g_param_spec_uint ("sort-mode", "sort-mode", "sort-mode", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), G4_APPLICATION_THUMBNAILER_PROPERTY, g4_application_properties[G4_APPLICATION_THUMBNAILER_PROPERTY] = g_param_spec_object ("thumbnailer", "thumbnailer", "thumbnailer", G4_TYPE_THUMBNAILER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g4_application_signals[G4_APPLICATION_INDEX_CHANGED_SIGNAL] = g_signal_new ("index-changed", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_UINT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT);
	g4_application_signals[G4_APPLICATION_MUSIC_CHANGED_SIGNAL] = g_signal_new ("music-changed", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G4_TYPE_MUSIC);
	g4_application_signals[G4_APPLICATION_MUSIC_COVER_PARSED_SIGNAL] = g_signal_new ("music-cover-parsed", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING, G_TYPE_NONE, 3, G4_TYPE_MUSIC, gdk_pixbuf_get_type (), G_TYPE_STRING);
	g4_application_signals[G4_APPLICATION_MUSIC_LIBRARY_CHANGED_SIGNAL] = g_signal_new ("music-library-changed", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
	g4_application_signals[G4_APPLICATION_PLAYLIST_ADDED_SIGNAL] = g_signal_new ("playlist-added", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G4_TYPE_PLAYLIST);
	g4_application_signals[G4_APPLICATION_THUMBNAIL_CHANGED_SIGNAL] = g_signal_new ("thumbnail-changed", G4_TYPE_APPLICATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, G4_TYPE_MUSIC, gdk_paintable_get_type ());
}

static void
g4_application_instance_init (G4Application * self,
                              gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	G4MusicLoader* _tmp2_;
	GtkFilterListModel* _tmp3_;
	GListStore* _tmp4_;
	GString* _tmp5_;
	G4GstPlayer* _tmp6_;
	G4Thumbnailer* _tmp7_;
	self->priv = g4_application_get_instance_private (self);
	self->priv->_actions = NULL;
	self->priv->_current_index = -1;
	self->priv->_current_list_size = (guint) 0;
	self->priv->_current_music = NULL;
	_tmp0_ = g_strdup ("");
	self->priv->_current_uri = _tmp0_;
	self->priv->_current_cover = NULL;
	self->priv->_list_modified = FALSE;
	self->priv->_loading = FALSE;
	_tmp1_ = g_strdup ("");
	self->priv->_music_folder = _tmp1_;
	self->priv->_mpris_id = (guint) 0;
	_tmp2_ = g4_music_loader_new ();
	self->priv->_loader = _tmp2_;
	_tmp3_ = gtk_filter_list_model_new (NULL, NULL);
	self->priv->_current_list = _tmp3_;
	_tmp4_ = g_list_store_new (G4_TYPE_MUSIC);
	self->priv->_music_queue = _tmp4_;
	g_rec_mutex_init (&self->priv->__lock__next_uri);
	_tmp5_ = g_string_new ("");
	self->priv->_next_uri = _tmp5_;
	_tmp6_ = g4_gst_player_new ();
	self->priv->_player = _tmp6_;
	self->priv->_sort_mode = G4_SORT_MODE_TITLE;
	self->priv->_store_external_changed = FALSE;
	_tmp7_ = g4_thumbnailer_new ();
	self->priv->_thumbnailer = _tmp7_;
	self->priv->_icon = NULL;
	self->priv->_reloading = FALSE;
	self->priv->_cover_tmp_file = NULL;
	self->priv->_pending_mic_handler = (guint) 0;
	self->priv->_pending_msc_handler = (guint) 0;
	self->priv->_inhibit_id = (guint) 0;
	self->priv->_cover_size = 360;
}

static void
g4_application_finalize (GObject * obj)
{
	G4Application * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, G4_TYPE_APPLICATION, G4Application);
	_g_object_unref0 (self->priv->_actions);
	_g_object_unref0 (self->priv->_current_music);
	_g_free0 (self->priv->_current_uri);
	_gst_sample_unref0 (self->priv->_current_cover);
	_g_free0 (self->priv->_music_folder);
	_g_object_unref0 (self->priv->_loader);
	_g_object_unref0 (self->priv->_current_list);
	_g_object_unref0 (self->priv->_music_queue);
	g_rec_mutex_clear (&self->priv->__lock__next_uri);
	_g_string_free0 (self->priv->_next_uri);
	_g_object_unref0 (self->priv->_player);
	_g_object_unref0 (self->priv->_settings);
	_g_object_unref0 (self->priv->_thumbnailer);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->_cover_tmp_file);
	G_OBJECT_CLASS (g4_application_parent_class)->finalize (obj);
}

static GType
g4_application_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (G4ApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) g4_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (G4Application), 0, (GInstanceInitFunc) g4_application_instance_init, NULL };
	GType g4_application_type_id;
	g4_application_type_id = g_type_register_static (adw_application_get_type (), "G4Application", &g_define_type_info, 0);
	G4Application_private_offset = g_type_add_instance_private (g4_application_type_id, sizeof (G4ApplicationPrivate));
	return g4_application_type_id;
}

GType
g4_application_get_type (void)
{
	static volatile gsize g4_application_type_id__once = 0;
	if (g_once_init_enter (&g4_application_type_id__once)) {
		GType g4_application_type_id;
		g4_application_type_id = g4_application_get_type_once ();
		g_once_init_leave (&g4_application_type_id__once, g4_application_type_id);
	}
	return g4_application_type_id__once;
}

static void
_vala_g4_application_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	G4Application * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, G4_TYPE_APPLICATION, G4Application);
	switch (property_id) {
		case G4_APPLICATION_COLOR_SCHEME_PROPERTY:
		g_value_set_uint (value, g4_application_get_color_scheme (self));
		break;
		case G4_APPLICATION_CURRENT_COVER_PROPERTY:
		g_value_set_boxed (value, g4_application_get_current_cover (self));
		break;
		case G4_APPLICATION_CURRENT_ITEM_PROPERTY:
		g_value_set_int (value, g4_application_get_current_item (self));
		break;
		case G4_APPLICATION_CURRENT_LIST_PROPERTY:
		g_value_set_object (value, g4_application_get_current_list (self));
		break;
		case G4_APPLICATION_CURRENT_MUSIC_PROPERTY:
		g_value_set_object (value, g4_application_get_current_music (self));
		break;
		case G4_APPLICATION_ICON_PROPERTY:
		g_value_set_object (value, g4_application_get_icon (self));
		break;
		case G4_APPLICATION_LIST_MODIFIED_PROPERTY:
		g_value_set_boolean (value, g4_application_get_list_modified (self));
		break;
		case G4_APPLICATION_LOADER_PROPERTY:
		g_value_set_object (value, g4_application_get_loader (self));
		break;
		case G4_APPLICATION_LOADING_PROPERTY:
		g_value_set_boolean (value, g4_application_get_loading (self));
		break;
		case G4_APPLICATION_MUSIC_FOLDER_PROPERTY:
		g_value_set_string (value, g4_application_get_music_folder (self));
		break;
		case G4_APPLICATION_MUSIC_QUEUE_PROPERTY:
		g_value_set_object (value, g4_application_get_music_queue (self));
		break;
		case G4_APPLICATION_NAME_PROPERTY:
		g_value_set_string (value, g4_application_get_name (self));
		break;
		case G4_APPLICATION_PLAYER_PROPERTY:
		g_value_set_object (value, g4_application_get_player (self));
		break;
		case G4_APPLICATION_SETTINGS_PROPERTY:
		g_value_set_object (value, g4_application_get_settings (self));
		break;
		case G4_APPLICATION_SINGLE_LOOP_PROPERTY:
		g_value_set_boolean (value, g4_application_get_single_loop (self));
		break;
		case G4_APPLICATION_SORT_MODE_PROPERTY:
		g_value_set_uint (value, g4_application_get_sort_mode (self));
		break;
		case G4_APPLICATION_THUMBNAILER_PROPERTY:
		g_value_set_object (value, g4_application_get_thumbnailer (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_g4_application_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	G4Application * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, G4_TYPE_APPLICATION, G4Application);
	switch (property_id) {
		case G4_APPLICATION_COLOR_SCHEME_PROPERTY:
		g4_application_set_color_scheme (self, g_value_get_uint (value));
		break;
		case G4_APPLICATION_CURRENT_ITEM_PROPERTY:
		g4_application_set_current_item (self, g_value_get_int (value));
		break;
		case G4_APPLICATION_CURRENT_LIST_PROPERTY:
		g4_application_set_current_list (self, g_value_get_object (value));
		break;
		case G4_APPLICATION_CURRENT_MUSIC_PROPERTY:
		g4_application_set_current_music (self, g_value_get_object (value));
		break;
		case G4_APPLICATION_LIST_MODIFIED_PROPERTY:
		g4_application_set_list_modified (self, g_value_get_boolean (value));
		break;
		case G4_APPLICATION_MUSIC_FOLDER_PROPERTY:
		g4_application_set_music_folder (self, g_value_get_string (value));
		break;
		case G4_APPLICATION_SINGLE_LOOP_PROPERTY:
		g4_application_set_single_loop (self, g_value_get_boolean (value));
		break;
		case G4_APPLICATION_SORT_MODE_PROPERTY:
		g4_application_set_sort_mode (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GFile*
g4_get_playing_list_file (void)
{
	gchar* cache_dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GFile* _tmp2_;
	GFile* result;
	_tmp0_ = g_get_user_cache_dir ();
	_tmp1_ = g_strdup (_tmp0_);
	cache_dir = _tmp1_;
	_tmp2_ = g_file_new_build_filename (cache_dir, APP_ID, G4_PAGE_NAME_PLAYING ".m3u", NULL);
	result = _tmp2_;
	_g_free0 (cache_dir);
	return result;
}

static void
g4_save_sample_to_file_async_data_free (gpointer _data)
{
	G4SaveSampleToFileAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_gst_sample_unref0 (_data_->sample);
	g_slice_free (G4SaveSampleToFileAsyncData, _data_);
}

void
g4_save_sample_to_file_async (GFile* file,
                              GstSample* sample,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	G4SaveSampleToFileAsyncData* _data_;
	GFile* _tmp0_;
	GstSample* _tmp1_;
	g_return_if_fail (file != NULL);
	g_return_if_fail (sample != NULL);
	_data_ = g_slice_new0 (G4SaveSampleToFileAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_save_sample_to_file_async_data_free);
	_tmp0_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp0_;
	_tmp1_ = _gst_sample_ref0 (sample);
	_gst_sample_unref0 (_data_->sample);
	_data_->sample = _tmp1_;
	g4_save_sample_to_file_async_co (_data_);
}

gboolean
g4_save_sample_to_file_finish (GAsyncResult* _res_)
{
	gboolean result;
	G4SaveSampleToFileAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static gpointer
_gst_buffer_ref0 (gpointer self)
{
	return self ? gst_buffer_ref (self) : NULL;
}

static void
g4_save_sample_to_file_async_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	G4SaveSampleToFileAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_save_sample_to_file_async_co (_data_);
}

static GstMapInfo*
_gst_map_info_dup (GstMapInfo* self)
{
	GstMapInfo* dup;
	dup = g_new0 (GstMapInfo, 1);
	memcpy (dup, self, sizeof (GstMapInfo));
	return dup;
}

static gpointer
__gst_map_info_dup0 (gpointer self)
{
	return self ? _gst_map_info_dup (self) : NULL;
}

static gboolean*
_bool_dup (gboolean* self)
{
	gboolean* dup;
	dup = g_new0 (gboolean, 1);
	memcpy (dup, self, sizeof (gboolean));
	return dup;
}

static gpointer
__bool_dup0 (gpointer self)
{
	return self ? _bool_dup (self) : NULL;
}

static gboolean
g4_save_sample_to_file_async_co (G4SaveSampleToFileAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gst_sample_get_buffer (_data_->sample);
	_data_->_tmp1_ = _gst_buffer_ref0 (_data_->_tmp0_);
	_data_->buffer = _data_->_tmp1_;
	_data_->info = NULL;
	{
		_data_->_state_ = 1;
		g_file_replace_async (_data_->file, NULL, FALSE, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, g4_save_sample_to_file_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = g_file_replace_finish (_data_->file, _data_->_res_, &_data_->_inner_error0_);
		_data_->stream = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp4_ = _data_->buffer;
		_data_->_tmp3_ = _data_->_tmp4_;
		_data_->_tmp5_ = NULL;
		if (_data_->_tmp3_ != NULL) {
			memset (&_data_->_tmp6_, 0, sizeof (GstMapInfo));
			_data_->_tmp7_ = gst_buffer_map ((GstBuffer*) _data_->_tmp3_, &_data_->_tmp6_, GST_MAP_READ);
			_g_free0 (_data_->info);
			_data_->_tmp8_ = _data_->_tmp6_;
			_data_->_tmp9_ = __gst_map_info_dup0 (&_data_->_tmp8_);
			_data_->info = _data_->_tmp9_;
			_data_->_tmp10_ = __bool_dup0 (&_data_->_tmp7_);
			_g_free0 (_data_->_tmp5_);
			_data_->_tmp5_ = _data_->_tmp10_;
		}
		_data_->_tmp12_ = __bool_dup0 (_data_->_tmp5_);
		_data_->_tmp11_ = _data_->_tmp12_;
		if (_data_->_tmp11_ == NULL) {
			_data_->_tmp13_ = FALSE;
			_data_->_tmp14_ = __bool_dup0 (&_data_->_tmp13_);
			_g_free0 (_data_->_tmp11_);
			_data_->_tmp11_ = _data_->_tmp14_;
		}
		if ((gboolean) (*_data_->_tmp11_)) {
			_data_->_tmp16_ = _data_->info;
			_data_->_tmp15_ = _data_->_tmp16_;
			_data_->_tmp17_ = NULL;
			_data_->_tmp17__length1 = 0;
			_data_->__tmp17__size_ = _data_->_tmp17__length1;
			if (_data_->_tmp15_ != NULL) {
				_data_->_tmp18_ = ((GstMapInfo) (*_data_->_tmp15_)).data;
				_data_->_tmp18__length1 = ((GstMapInfo) (*_data_->_tmp15_)).size;
				_data_->_tmp17_ = _data_->_tmp18_;
				_data_->_tmp17__length1 = _data_->_tmp18__length1;
				_data_->__tmp17__size_ = _data_->_tmp17__length1;
			}
			_data_->_tmp20_ = _data_->stream;
			_data_->_state_ = 2;
			g_output_stream_write_all_async ((GOutputStream*) _data_->_tmp20_, _data_->_tmp17_, (gsize) _data_->_tmp17__length1, G_PRIORITY_DEFAULT, NULL, g4_save_sample_to_file_async_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp19_ = g_output_stream_write_all_finish ((GOutputStream*) _data_->_tmp20_, _data_->_res_, NULL, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->_tmp11_);
				_g_free0 (_data_->_tmp5_);
				_g_object_unref0 (_data_->stream);
				goto __catch0_g_error;
			}
			_data_->result = _data_->_tmp19_;
			_g_free0 (_data_->_tmp11_);
			_g_free0 (_data_->_tmp5_);
			_g_object_unref0 (_data_->stream);
			{
				_data_->_tmp21_ = _data_->info;
				if (_data_->_tmp21_ != NULL) {
					_data_->_tmp23_ = _data_->buffer;
					_data_->_tmp22_ = _data_->_tmp23_;
					if (_data_->_tmp22_ != NULL) {
						_data_->_tmp24_ = _data_->info;
						_data_->_tmp25_ = (GstMapInfo) (*_data_->_tmp24_);
						gst_buffer_unmap ((GstBuffer*) _data_->_tmp22_, &_data_->_tmp25_);
					}
				}
			}
			_g_free0 (_data_->info);
			_gst_buffer_unref0 (_data_->buffer);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_free0 (_data_->_tmp11_);
		_g_free0 (_data_->_tmp5_);
		_g_object_unref0 (_data_->stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	{
		_data_->_tmp26_ = _data_->info;
		if (_data_->_tmp26_ != NULL) {
			_data_->_tmp27_ = _data_->buffer;
			_data_->_vala1__tmp22_ = _data_->_tmp27_;
			if (_data_->_vala1__tmp22_ != NULL) {
				_data_->_tmp28_ = _data_->info;
				_data_->_tmp29_ = (GstMapInfo) (*_data_->_tmp28_);
				gst_buffer_unmap ((GstBuffer*) _data_->_vala1__tmp22_, &_data_->_tmp29_);
			}
		}
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->info);
		_gst_buffer_unref0 (_data_->buffer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = FALSE;
	_g_free0 (_data_->info);
	_gst_buffer_unref0 (_data_->buffer);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g4_save_text_to_file_async_data_free (gpointer _data)
{
	G4SaveTextToFileAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->file);
	_g_free0 (_data_->text);
	g_slice_free (G4SaveTextToFileAsyncData, _data_);
}

void
g4_save_text_to_file_async (GFile* file,
                            const gchar* text,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	G4SaveTextToFileAsyncData* _data_;
	GFile* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (file != NULL);
	g_return_if_fail (text != NULL);
	_data_ = g_slice_new0 (G4SaveTextToFileAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, g4_save_text_to_file_async_data_free);
	_tmp0_ = _g_object_ref0 (file);
	_g_object_unref0 (_data_->file);
	_data_->file = _tmp0_;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	g4_save_text_to_file_async_co (_data_);
}

gboolean
g4_save_text_to_file_finish (GAsyncResult* _res_)
{
	gboolean result;
	G4SaveTextToFileAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
g4_save_text_to_file_async_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	G4SaveTextToFileAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	g4_save_text_to_file_async_co (_data_);
}

static gboolean
g4_save_text_to_file_async_co (G4SaveTextToFileAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		g_file_replace_async (_data_->file, NULL, FALSE, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, g4_save_text_to_file_async_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = g_file_replace_finish (_data_->file, _data_->_res_, &_data_->_inner_error0_);
		_data_->stream = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->data = (guint8*) _data_->text;
		_data_->data_length1 = -1;
		_data_->_data_size_ = _data_->data_length1;
		_data_->_tmp1_ = strlen (_data_->text);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->size = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->stream;
		_data_->_tmp5_ = _data_->data;
		_data_->_tmp5__length1 = _data_->data_length1;
		_data_->_state_ = 2;
		g_output_stream_write_all_async ((GOutputStream*) _data_->_tmp4_, _data_->_tmp5_ + 0, (gsize) (_data_->size - 0), G_PRIORITY_DEFAULT, NULL, g4_save_text_to_file_async_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp3_ = g_output_stream_write_all_finish ((GOutputStream*) _data_->_tmp4_, _data_->_res_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			goto __catch0_g_error;
		}
		_data_->result = _data_->_tmp3_;
		_g_object_unref0 (_data_->stream);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

