#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnotify/notify.h>
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-static int Open ( vlc_object_t * );
-static void Close ( vlc_object_t * );
-
-static int ItemChange( vlc_object_t *, const char *,
- vlc_value_t, vlc_value_t, void * );
-static int Notify( vlc_object_t *, const char *, GdkPixbuf *, intf_thread_t * );
-#define MAX_LENGTH 256
-
-struct intf_sys_t
-{
- NotifyNotification *notification;
- vlc_mutex_t lock;
-};
-
/*****************************************************************************
* Module descriptor
****************************************************************************/
+static int Open ( vlc_object_t * );
+static void Close ( vlc_object_t * );
#define APPLICATION_NAME "VLC media player"
set_callbacks( Open, Close )
vlc_module_end ()
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int ItemChange( vlc_object_t *, const char *,
+ vlc_value_t, vlc_value_t, void * );
+static int Notify( vlc_object_t *, const char *, GdkPixbuf *, intf_thread_t * );
+#define MAX_LENGTH 256
+
+struct intf_sys_t
+{
+ NotifyNotification *notification;
+ vlc_mutex_t lock;
+};
+
/*****************************************************************************
* Open: initialize and create stuff
*****************************************************************************/
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
playlist_t *p_playlist;
- intf_sys_t *p_sys = malloc( sizeof( intf_sys_t ) );
+ intf_sys_t *p_sys = malloc( sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
msg_Err( p_intf, "can't find notification daemon" );
return VLC_EGENERIC;
}
-
- vlc_mutex_init( &p_sys->lock );
-
p_intf->p_sys = p_sys;
- p_intf->p_sys->notification = NULL;
+ vlc_mutex_init( &p_sys->lock );
+ p_sys->notification = NULL;
p_playlist = pl_Hold( p_intf );
var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
pl_Release( p_this );
- if( p_intf->p_sys->notification )
- g_object_unref( p_intf->p_sys->notification );
+ if( p_sys->notification )
+ g_object_unref( p_sys->notification );
vlc_mutex_destroy( &p_sys->lock );
free( p_sys );
char *psz_arturl = NULL;
input_thread_t *p_input = playlist_CurrentInput(
(playlist_t*) p_this );
- intf_thread_t *p_intf = ( intf_thread_t* ) param;
+ intf_thread_t *p_intf = param;
intf_sys_t *p_sys = p_intf->p_sys;
if( !p_input ) return VLC_SUCCESS;