From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Nov 19 03:50:02 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C2B91065673 for ; Wed, 19 Nov 2008 03:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 212E48FC18 for ; Wed, 19 Nov 2008 03:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJ3o1dN053122 for ; Wed, 19 Nov 2008 03:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mAJ3o1hE053121; Wed, 19 Nov 2008 03:50:01 GMT (envelope-from gnats) Resent-Date: Wed, 19 Nov 2008 03:50:01 GMT Resent-Message-Id: <200811190350.mAJ3o1hE053121@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Germain Le Chapelain Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9478106564A for ; Wed, 19 Nov 2008 03:40:01 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A034A8FC08 for ; Wed, 19 Nov 2008 03:40:01 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJ3e06D015820 for ; Wed, 19 Nov 2008 03:40:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id mAJ3e0Ct015819; Wed, 19 Nov 2008 03:40:00 GMT (envelope-from nobody) Message-Id: <200811190340.mAJ3e0Ct015819@www.freebsd.org> Date: Wed, 19 Nov 2008 03:40:00 GMT From: Germain Le Chapelain To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/128984: xmms fade out on shift-V X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 03:50:02 -0000 >Number: 128984 >Category: ports >Synopsis: xmms fade out on shift-V >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Nov 19 03:50:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Germain Le Chapelain >Release: cvs >Organization: bcg >Environment: FreeBSD germ 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sun Oct 12 20:23:49 EDT 2008 german@germ:/usr/obj/usr/src/sys/germ i386 >Description: I am not sure if it fits here, but I have put something in to have the shift-V (stop-fade out) feature working in XMMS as it does in winamp. >How-To-Repeat: push shift-v to stop a track, doesn't do anything. Push v, everyone yells at you. >Fix: Apply the enclosed patch. Patch attached with submission follows: --- xmms/main.c.orig 2006-07-16 09:40:04.000000000 -0400 +++ xmms/main.c 2008-11-16 19:35:56.000000000 -0500 @@ -93,6 +93,10 @@ gboolean pposition_broken = FALSE; static pthread_mutex_t title_mutex = PTHREAD_MUTEX_INITIALIZER; +gboolean g_stop_fadeout_pressed = FALSE; +GTimeVal g_stop_fadeout_pressed_date; +int g_stop_fadeout_volumel, g_stop_fadeout_volumer; + extern gchar *plugin_dir_list[]; enum @@ -288,7 +292,7 @@ {N_("/Playback/Stop"), "V", mainwin_general_menu_callback, MAINWIN_GENERAL_STOP, ""}, {N_("/Playback/Next"), "B", mainwin_general_menu_callback, MAINWIN_GENERAL_NEXT, ""}, {N_("/Playback/-"), NULL, NULL, 0, ""}, -/* {N_("/Playback/Stop with Fadeout"),"V",mainwin_general_menu_callback,MAINWIN_GENERAL_STOPFADE,""}, */ + {N_("/Playback/Stop with Fadeout"),"V",mainwin_general_menu_callback,MAINWIN_GENERAL_STOPFADE,""}, {N_("/Playback/Back 5 Seconds"), NULL, mainwin_general_menu_callback, MAINWIN_GENERAL_BACK5SEC, ""}, {N_("/Playback/Fwd 5 Seconds"), NULL, mainwin_general_menu_callback, MAINWIN_GENERAL_FWD5SEC, ""}, {N_("/Playback/Start of List"), "Z", mainwin_general_menu_callback, MAINWIN_GENERAL_START, ""}, @@ -2538,6 +2542,14 @@ input_stop(); } +void mainwin_stopfade_pushed(void) +{ + + input_get_volume( &g_stop_fadeout_volumel, &g_stop_fadeout_volumer ); + g_stop_fadeout_pressed = TRUE; + g_get_current_time( &g_stop_fadeout_pressed_date ); +} + void mainwin_shuffle_pushed(gboolean toggled) { GtkWidget *widget; @@ -3035,6 +3047,7 @@ playlist_next(); break; case MAINWIN_GENERAL_STOPFADE: + mainwin_stopfade_pushed(); break; case MAINWIN_GENERAL_BACK5SEC: if (get_input_playing() && playlist_get_current_length() != -1) @@ -4176,6 +4189,34 @@ #endif } +gint stop_fadeout_idle(gpointer data) +{ + GTimeVal time, delta; + static const gfloat s_fade_time = 3.0f; + + g_get_current_time( &time ); + + delta.tv_sec = time.tv_sec - g_stop_fadeout_pressed_date.tv_sec; + delta.tv_usec = time.tv_usec - g_stop_fadeout_pressed_date.tv_usec; + + if( g_stop_fadeout_pressed ) + { + if( (int)s_fade_time != delta.tv_sec ) + { + const gfloat fading = 1.0f - ( 1.0f * delta.tv_sec + 1.0e-6f * delta.tv_usec ) / s_fade_time; + //printf( "%f\n", fading ); + input_set_volume( g_stop_fadeout_volumel * fading, g_stop_fadeout_volumer * fading ); + } else + { + g_stop_fadeout_pressed = FALSE; + mainwin_clear_song_info(); + input_stop(); + input_set_volume( g_stop_fadeout_volumel , g_stop_fadeout_volumer ); + } + } + return TRUE; +} + int main(int argc, char **argv) { char *filename; @@ -4312,8 +4353,9 @@ mainwin_timeout_tag = gtk_timeout_add(10, idle_func, NULL); playlist_start_get_info_thread(); - + g_idle_add( stop_fadeout_idle, NULL ); enable_x11r5_session_management(argc, argv); + gtk_main(); GDK_THREADS_LEAVE(); >Release-Note: >Audit-Trail: >Unformatted: