コード例 #1
0
static void destroy_cb (GtkWidget * widget)
{
    g_return_if_fail (area);

    ui_infoarea_show_vis (FALSE);

    hook_dissociate ("playlist update", (HookFunction) ui_infoarea_set_title);
    hook_dissociate ("playback begin", (HookFunction) ui_infoarea_playback_start);
    hook_dissociate ("playback stop", (HookFunction) ui_infoarea_playback_stop);
    hook_dissociate ("current art ready", (HookFunction) album_art_ready);

    if (area->fade_timeout)
    {
        g_source_remove (area->fade_timeout);
        area->fade_timeout = 0;
    }

    str_unref (area->title);
    str_unref (area->artist);
    str_unref (area->album);
    str_unref (area->last_title);
    str_unref (area->last_artist);
    str_unref (area->last_album);

    if (area->pb)
        g_object_unref (area->pb);
    if (area->last_pb)
        g_object_unref (area->last_pb);

    g_slice_free (UIInfoArea, area);
    area = NULL;
}
コード例 #2
0
static void cleanup(void)
{
    hook_dissociate("playback begin", songchange_playback_begin);
    hook_dissociate("playback end", songchange_playback_end);
    hook_dissociate("playlist end reached", songchange_playlist_eof);
    // hook_dissociate( "playlist set info" , songchange_playback_ttc);

    if ( ttc_prevs != NULL )
    {
        if ( ttc_prevs->title != NULL ) g_free( ttc_prevs->title );
        if ( ttc_prevs->filename != NULL ) g_free( ttc_prevs->filename );
        g_free( ttc_prevs );
        ttc_prevs = NULL;
    }

    g_free(cmd_line);
    g_free(cmd_line_after);
    g_free(cmd_line_end);
    g_free(cmd_line_ttc);
    cmd_line = NULL;
    cmd_line_after = NULL;
    cmd_line_end = NULL;
    cmd_line_ttc = NULL;
    signal(SIGCHLD, SIG_DFL);
}
コード例 #3
0
static void destroy_cb (void)
{
    hook_dissociate ("playlist activate", update_hook);
    hook_dissociate ("playlist update", update_hook);

    qm_win = NULL;
    qm_list = NULL;
}
コード例 #4
0
static void si_enable(gboolean enable)
{
    static GtkStatusIcon *si_applet = NULL;

    if (enable && ! si_applet)
    {
        GtkWidget *si_smenu;

        si_applet = si_create();

        if (si_applet == NULL)
        {
            g_warning("StatusIcon plugin: unable to create a status icon.\n");
            return;
        }

        g_object_set_data(G_OBJECT(si_applet), "timer_id", GINT_TO_POINTER(0));
        g_object_set_data(G_OBJECT(si_applet), "timer_active", GINT_TO_POINTER(0));
        g_object_set_data(G_OBJECT(si_applet), "popup_active", GINT_TO_POINTER(0));

        g_signal_connect(G_OBJECT(si_applet), "button-press-event", G_CALLBACK(si_cb_btpress), NULL);
        g_signal_connect(G_OBJECT(si_applet), "scroll-event", G_CALLBACK(si_cb_btscroll), NULL);
        g_signal_connect(G_OBJECT(si_applet), "query-tooltip", G_CALLBACK(si_cb_tooltip), NULL);

        gtk_status_icon_set_has_tooltip(si_applet, TRUE);
        gtk_status_icon_set_visible(si_applet, TRUE);

        /* small menu that can be used in place of the audacious standard one */
        si_smenu = si_smallmenu_create();
        g_object_set_data(G_OBJECT(si_applet), "smenu", si_smenu);

        hook_associate("title change", si_popup_reshow, si_applet);
        hook_associate("window close", si_window_close, NULL);
    }

    if (! enable && si_applet)
    {
        /* Prevent accidentally hiding of the interface
         * by disabling the plugin while Audacious is closed to the tray. */
        extern GeneralPlugin _aud_plugin_self;
        PluginHandle *si = aud_plugin_by_header(&_aud_plugin_self);
        if (! aud_plugin_get_enabled(si) && ! aud_interface_is_shown())
            aud_interface_show(TRUE);

        GtkWidget *si_smenu = g_object_get_data(G_OBJECT(si_applet), "smenu");
        si_popup_timer_stop(si_applet);   /* just in case the timer is active */
        gtk_widget_destroy(si_smenu);
        g_object_unref(si_applet);
        si_applet = NULL;

        hook_dissociate("title change", si_popup_reshow);
        hook_dissociate("window close", si_window_close);
    }
}
コード例 #5
0
ファイル: equalizer.c プロジェクト: suaff/audacious
void audgui_hide_equalizer_window (void)
{
    if (! equalizer_window)
        return;

    hook_dissociate ("set equalizer_active", (HookFunction) on_off_update);
    hook_dissociate ("set equalizer_bands", (HookFunction) slider_update);
    hook_dissociate ("set equalizer_preamp", (HookFunction) slider_update);

    gtk_widget_destroy (equalizer_window);
    equalizer_window = NULL;
}
コード例 #6
0
static void equalizerwin_destroyed (void)
{
    hook_dissociate ("set equalizer_active", (HookFunction) update_from_config);
    hook_dissociate ("set equalizer_bands", (HookFunction) update_from_config);
    hook_dissociate ("set equalizer_preamp", (HookFunction) update_from_config);

    hook_dissociate ("playlist position", position_cb);

    free_presets (equalizer_presets);
    free_presets (equalizer_auto_presets);
    equalizer_presets = NULL;
    equalizer_auto_presets = NULL;
}
コード例 #7
0
ファイル: ui_playlist_manager.c プロジェクト: i-tek/audacious
void audgui_playlist_manager_cleanup (void)
{
    if (! playman_win)
        return;

    hook_dissociate ("playlist update", update_hook);
    hook_dissociate ("playlist activate", activate_hook);
    hook_dissociate ("playlist set playing", position_hook);
    hook_dissociate ("config save", save_config_cb);

    gtk_widget_destroy (playman_win);
    playman_win = NULL;
}
コード例 #8
0
static void equalizerwin_destroyed (void)
{
    hook_dissociate ("set equalizer_active", (HookFunction) update_from_config);
    hook_dissociate ("set equalizer_bands", (HookFunction) update_from_config);
    hook_dissociate ("set equalizer_preamp", (HookFunction) update_from_config);

    hook_dissociate ("playlist position", position_cb);

    index_free_full (equalizer_presets, (IndexFreeFunc) aud_equalizer_preset_free);
    index_free_full (equalizer_auto_presets, (IndexFreeFunc) aud_equalizer_preset_free);
    equalizer_presets = NULL;
    equalizer_auto_presets = NULL;
}
コード例 #9
0
ファイル: playback.c プロジェクト: i-tek/audacious
static void playback_cleanup (void)
{
    g_return_if_fail (playing);

    pthread_join (playback_thread_handle, NULL);
    playing = FALSE;

    event_queue_cancel ("playback ready", NULL);
    event_queue_cancel ("playback seek", NULL);
    event_queue_cancel ("info change", NULL);
    event_queue_cancel ("title change", NULL);

    if (end_source)
    {
        g_source_remove (end_source);
        end_source = 0;
    }

    str_unref (current_filename);
    current_filename = NULL;
    str_unref (current_title);
    current_title = NULL;

    hook_dissociate ("playlist update", update_cb);
}
コード例 #10
0
ファイル: plugin.c プロジェクト: Falcon-peregrinus/mlplayer
void stop(void) {
	if (!sc_going && !ge_going)
		return;
	g_mutex_lock(m_scrobbler);

	if (sc_going)
		sc_cleaner();
	sc_going = 0;
	ge_going = 0;
	g_mutex_unlock(m_scrobbler);

	g_mutex_free(m_scrobbler);

	hook_dissociate("playback begin", mlp_hook_playback_begin);
	hook_dissociate("playback stop", mlp_hook_playback_end);
}
コード例 #11
0
static void
aosd_trigger_func_pb_titlechange_onoff ( gboolean turn_on )
{
  static aosd_pb_titlechange_prevs_t *prevs = NULL;

  if ( turn_on == TRUE )
  {
    prevs = g_malloc0(sizeof(aosd_pb_titlechange_prevs_t));
    prevs->title = NULL;
    prevs->filename = NULL;
    hook_associate( "title change" , aosd_trigger_func_pb_titlechange_cb , prevs );
  }
  else
  {
    hook_dissociate( "title change" , aosd_trigger_func_pb_titlechange_cb );
    if ( prevs != NULL )
    {
      if ( prevs->title != NULL ) g_free( prevs->title );
      if ( prevs->filename != NULL ) g_free( prevs->filename );
      g_free( prevs );
      prevs = NULL;
    }
  }
  return;
}
コード例 #12
0
static void
aosd_trigger_func_pb_start_onoff(gboolean turn_on)
{
  if (turn_on == TRUE)
    hook_associate("playback begin", aosd_trigger_func_pb_start_cb, NULL);
  else
    hook_dissociate("playback begin", aosd_trigger_func_pb_start_cb);
  return;
}
コード例 #13
0
ファイル: lyricwiki.c プロジェクト: CBke/audacious-plugins
static void cleanup(void)
{
	str_unref(state.filename);
	str_unref(state.title);
	str_unref(state.artist);
	str_unref(state.uri);
	state.filename = NULL;
	state.title = NULL;
	state.artist = NULL;
	state.uri = NULL;

	hook_dissociate("title change", (HookFunction) lyricwiki_playback_began);
	hook_dissociate("playback ready", (HookFunction) lyricwiki_playback_began);

	if (vbox)
		gtk_widget_destroy (vbox);
	textbuffer = NULL;
}
コード例 #14
0
static void
aosd_trigger_func_vol_change_onoff ( gboolean turn_on )
{
  if ( turn_on == TRUE )
    hook_associate( "volume set" , aosd_trigger_func_vol_change_cb , NULL );
  else
    hook_dissociate( "volume set" , aosd_trigger_func_vol_change_cb );
  return;
}
コード例 #15
0
static void
aosd_trigger_func_pb_pauseoff_onoff ( gboolean turn_on )
{
  if ( turn_on == TRUE )
    hook_associate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb , NULL );
  else
    hook_dissociate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb );
  return;
}
コード例 #16
0
ファイル: playlist-utils.c プロジェクト: suaff/audacious
void save_playlists (bool_t exiting)
{
    save_playlists_real ();

    /* on exit, save resume time if resume feature is enabled */
    if (state_changed || (exiting && get_bool (NULL, "resume_playback_on_startup")))
    {
        playlist_save_state ();
        state_changed = FALSE;
    }

    if (exiting && hooks_added)
    {
        hook_dissociate ("playlist update", update_cb);
        hook_dissociate ("playlist activate", state_cb);
        hook_dissociate ("playlist position", state_cb);

        hooks_added = FALSE;
    }
}
コード例 #17
0
void
aosd_trigger_stop ( aosd_cfg_osd_trigger_t * cfg_trigger )
{
  gint i = 0;
  hook_dissociate( "aosd toggle" , aosd_trigger_func_hook_cb );
  for ( i = 0 ; i < cfg_trigger->active->len ; i++ )
  {
    gint trig_code = g_array_index( cfg_trigger->active , gint , i );
    aosd_triggers[trig_code].onoff_func( FALSE );
  }
  return;
}
コード例 #18
0
EXPORT void
mlpgui_jump_to_track_hide(void)
{
    if (watching)
    {
        hook_dissociate ("playlist update", update_cb);
        hook_dissociate ("playlist activate", activate_cb);
        watching = FALSE;
    }

    if (jump_to_track_win != NULL)
        gtk_widget_hide (jump_to_track_win);

    if (cache != NULL)
    {
        ui_jump_to_track_cache_free (cache);
        cache = NULL;
    }

    search_matches = NULL;
}
コード例 #19
0
ファイル: plugin.c プロジェクト: i-tek/audacious-plugins
void mpris2_cleanup (void)
{
    hook_dissociate ("playback begin", (HookFunction) update_playback_status);
    hook_dissociate ("playback pause", (HookFunction) update_playback_status);
    hook_dissociate ("playback stop", (HookFunction) update_playback_status);
    hook_dissociate ("playback unpause", (HookFunction) update_playback_status);

    hook_dissociate ("playlist set playing", (HookFunction) update_metadata);
    hook_dissociate ("playlist position", (HookFunction) update_metadata);
    hook_dissociate ("playlist update", (HookFunction) update_metadata);

    hook_dissociate ("playback ready", (HookFunction) emit_seek);
    hook_dissociate ("playback seek", (HookFunction) emit_seek);

    if (update_timer)
    {
        g_source_remove (update_timer);
        update_timer = 0;
    }

    g_dbus_connection_close_sync (bus, NULL, NULL);
    g_object_unref (object_core);
    g_object_unref (object_player);

    if (image_file)
    {
        aud_art_unref (last_file);
        image_file = NULL;
    }

    str_unref (last_title);
    str_unref (last_artist);
    str_unref (last_album);
    str_unref (last_file);
    last_title = last_artist = last_album = last_file = NULL;
    last_length = 0;

    if (metadata_type)
    {
        g_variant_type_free (metadata_type);
        metadata_type = NULL;
    }
}
コード例 #20
0
static void search_cleanup (void)
{
    hook_dissociate ("playlist add complete", add_complete_cb);
    hook_dissociate ("playlist scan complete", scan_complete_cb);
    hook_dissociate ("playlist update", playlist_update_cb);

    if (search_source)
    {
        g_source_remove (search_source);
        search_source = 0;
    }

    index_free_full (search_terms, (IndexFreeFunc) str_unref);
    search_terms = NULL;

    index_free (items);
    items = NULL;
    g_array_free (selection, TRUE);
    selection = NULL;

    destroy_added_table ();
    destroy_database ();
}
コード例 #21
0
void mpris_signals_cleanup (void)
{
#ifdef USE_DBUS
    hook_dissociate ("playback begin", mpris_status_cb);
    hook_dissociate ("playback pause", mpris_status_cb);
    hook_dissociate ("playback unpause", mpris_status_cb);
    hook_dissociate ("playback stop", mpris_status_cb);

    hook_dissociate ("set shuffle", mpris_status_cb);
    hook_dissociate ("set repeat", mpris_status_cb);
    hook_dissociate ("set no_playlist_advance", mpris_status_cb);
#endif
}
コード例 #22
0
void
ui_main_evlistener_dissociate(void)
{
    hook_dissociate("hide seekbar", ui_main_evlistener_hide_seekbar);
    hook_dissociate("playback begin", ui_main_evlistener_playback_begin);
    hook_dissociate("playback ready", ui_main_evlistener_playback_begin);
    hook_dissociate("playback stop", ui_main_evlistener_playback_stop);
    hook_dissociate("playback pause", ui_main_evlistener_playback_pause);
    hook_dissociate("playback unpause", ui_main_evlistener_playback_unpause);
    hook_dissociate ("title change", (HookFunction) title_change);
    hook_dissociate ("info change", (HookFunction) info_change);

    hook_dissociate("playback seek", (HookFunction) mainwin_update_song_info);

    hook_dissociate ("set repeat", repeat_toggled);
    hook_dissociate ("set shuffle", shuffle_toggled);
    hook_dissociate ("set no_playlist_advance", no_advance_toggled);
    hook_dissociate ("set stop_after_current_song", stop_after_song_toggled);
}
コード例 #23
0
ファイル: ui_gtk.c プロジェクト: viking/audacious-plugins
static void ui_hooks_disassociate(void)
{
    hook_dissociate ("title change", (HookFunction) title_change_cb);
    hook_dissociate ("playback begin", (HookFunction) ui_playback_begin);
    hook_dissociate ("playback ready", (HookFunction) ui_playback_ready);
    hook_dissociate ("playback pause", (HookFunction) pause_cb);
    hook_dissociate ("playback unpause", (HookFunction) pause_cb);
    hook_dissociate ("playback stop", (HookFunction) ui_playback_stop);
    hook_dissociate("playlist update", ui_playlist_notebook_update);
    hook_dissociate ("playlist activate", ui_playlist_notebook_activate);
    hook_dissociate ("playlist set playing", ui_playlist_notebook_set_playing);
    hook_dissociate ("playlist position", ui_playlist_notebook_position);
    hook_dissociate ("set shuffle", update_toggles);
    hook_dissociate ("set repeat", update_toggles);
    hook_dissociate ("config save", (HookFunction) config_save);
}
コード例 #24
0
static void destroy_cb (GtkWidget * window)
{
    hook_dissociate ("playlist update", update_hook);
    hook_dissociate ("playlist activate", activate_hook);
    hook_dissociate ("playlist set playing", position_hook);
}
コード例 #25
0
ファイル: equalizer.c プロジェクト: danielcmccarthy/audacious
static void destroy_cb (void)
{
    hook_dissociate ("set equalizer_active", (HookFunction) on_off_update);
    hook_dissociate ("set equalizer_bands", (HookFunction) update_sliders);
    hook_dissociate ("set equalizer_preamp", (HookFunction) update_sliders);
}