3 #include <nsIObserverService.h>
4 #include <nsServiceManagerUtils.h>
19 UnityPlaybackState playbackState = unity_music_player_get_playback_state (
musicPlayer);
51 const gchar *title = gtk_window_get_title ((GtkWindow*) data);
62 g_message(
"Unity Integration: loading");
74 g_message(
"Unity Integration: checking for unity components");
77 g_message(
"Unity Integration: found them!");
80 if (!desktopFileName || !windowTitle)
return NS_ERROR_INVALID_ARG;
82 GList* wlist = gtk_window_list_toplevels ();
88 GKeyFile *keyFile = g_key_file_new ();
89 gchar *desktopFilePath = g_build_filename (
"/usr/share/applications", desktopFileName, NULL);
90 if (g_key_file_load_from_file (keyFile, desktopFilePath, G_KEY_FILE_NONE, NULL))
92 playerName = g_key_file_get_string (keyFile,
"Desktop Entry",
"Name", NULL);
93 playerIcon = g_key_file_get_string (keyFile,
"Desktop Entry",
"Icon", NULL);
95 g_key_file_free (keyFile);
99 musicPlayer = unity_music_player_new (desktopFileName);
105 unity_music_player_set_can_go_next (
musicPlayer,
false);
106 unity_music_player_set_can_play (
musicPlayer,
true);
124 GFile *coverFile = g_file_new_for_path (coverFilePath);
125 unity_track_metadata_set_art_location (
trackMetadata, coverFile);
129 g_object_unref (coverFile);
140 unity_music_player_set_current_track (
musicPlayer, NULL);
142 else if (!!playing) {
static GtkWindow * playerGtkWindow
static nsCOMPtr< nsIObserverService > observerService
void SoundMenuSetPlayingState(in PRInt16 playing)
static gboolean enableNotify
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
void onNext(GtkWidget *window, gpointer data)
void InitializeFor(in string desktopFileName, in string windowTitle)
static gboolean lockedFromSoundMenu
var getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('Songbird SBProperties artist
static gchar * playerName
void onPlayPause(GtkWidget *window, gpointer data)
void onPrevious(GtkWidget *window, gpointer data)
static gchar * playerIcon
static UnityTrackMetadata * trackMetadata
void SoundMenuSetTrackInfo(in string title, in string artist, in string album, in string coverFilePath)
static UnityMusicPlayer * musicPlayer
void onRaise(GtkWidget *window, gpointer data)
NS_DECL_ISUPPORTS NS_DECL_IUNITYPROXY bool isUnityRunning()
void checkWindowTitle(gpointer data, gpointer user_data)