# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_meta.h>
#define PORT_TEXT N_("UDP port")
#define PORT_LONGTEXT N_("Growl UDP port on the Growl server.")
-vlc_module_begin();
- set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_CONTROL );
- set_shortname( "Growl-UDP" );
- set_description( _("Growl UDP Notification Plugin") );
+vlc_module_begin ()
+ set_category( CAT_INTERFACE )
+ set_subcategory( SUBCAT_INTERFACE_CONTROL )
+ set_shortname( "Growl-UDP" )
+ set_description( N_("Growl UDP Notification Plugin") )
add_string( "growl-server", SERVER_DEFAULT, NULL,
- SERVER_TEXT, SERVER_LONGTEXT, VLC_FALSE );
+ SERVER_TEXT, SERVER_LONGTEXT, false )
add_password( "growl-password", PASS_DEFAULT, NULL,
- PASS_TEXT, PASS_LONGTEXT, VLC_FALSE );
+ PASS_TEXT, PASS_LONGTEXT, false )
add_integer( "growl-port", 9887, NULL,
- PORT_TEXT, PORT_LONGTEXT, VLC_TRUE );
+ PORT_TEXT, PORT_LONGTEXT, true )
- set_capability( "interface", 0 );
- set_callbacks( Open, Close );
-vlc_module_end();
+ set_capability( "interface", 0 )
+ set_callbacks( Open, Close )
+vlc_module_end ()
/*****************************************************************************
* Open: initialize and create stuff
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
- playlist_t *p_playlist = pl_Yield( p_intf );
- var_AddCallback( p_playlist, "playlist-current", ItemChange, p_intf );
+ playlist_t *p_playlist = pl_Hold( p_intf );
+ var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
pl_Release( p_intf );
RegisterToGrowl( p_this );
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
- playlist_t *p_playlist = pl_Yield( p_this );
- var_DelCallback( p_playlist, "playlist-current", ItemChange, p_this );
+ playlist_t *p_playlist = pl_Hold( p_this );
+ var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
pl_Release( p_this );
}
char *psz_artist = NULL;
char *psz_album = NULL;
input_thread_t *p_input;
- playlist_t *p_playlist = pl_Yield( p_this );
+ playlist_t *p_playlist = pl_Hold( p_this );
p_input = p_playlist->p_input;
- vlc_object_release( p_playlist );
+ pl_Release( p_this );
if( !p_input ) return VLC_SUCCESS;
- vlc_object_yield( p_input );
+ vlc_object_hold( p_input );
char *psz_name = input_item_GetName( input_GetItem( p_input ) );
if( p_input->b_dead || !psz_name )
uint8_t *psz_encoded = malloc(100);
uint8_t i_defaults = 0;
static const char *psz_notifications[] = {"Now Playing", NULL};
- vlc_bool_t pb_defaults[] = {VLC_TRUE, VLC_FALSE};
+ bool pb_defaults[] = {true, false};
int i = 0, j;
if( psz_encoded == NULL )
- return VLC_FALSE;
+ return false;
memset( psz_encoded, 0, sizeof(psz_encoded) );
psz_encoded[i++] = GROWL_PROTOCOL_VERSION;
}
psz_encoded[4] = j;
for( j = 0 ; psz_notifications[j] != NULL ; j++)
- if(pb_defaults[j] == VLC_TRUE)
+ if(pb_defaults[j] == true)
{
psz_encoded[i++] = (uint8_t)j;
i_defaults++;
uint16_t flags;
int i = 0;
if( psz_encoded == NULL )
- return VLC_FALSE;
+ return false;
memset( psz_encoded, 0, sizeof(psz_encoded) );
psz_encoded[i++] = GROWL_PROTOCOL_VERSION;
p_data[i_offset++] = (md5.p_digest[i]>>24)&0xFF;
}
- i_handle = net_ConnectUDP( p_this, psz_server, i_port, 0 );
+ i_handle = net_ConnectUDP( p_this, psz_server, i_port, -1 );
if( i_handle == -1 )
{
msg_Err( p_this, "failed to open a connection (udp)" );