Re: [Musicpd-dev-team] [PATCH] ncmpc: Adjustable seek time
On Fri, Aug 14, 2009 at 07:49:29AM +0200, Max Kellermann wrote: On 2009/08/14 02:24, Fredrik Lanker fredrik.lan...@gmail.com wrote: This patch for ncmpc makes it possible to adjust the seek time, in steps of 5 seconds, in runtime with 'F' and 'B'. The current seek time is displayed top right, next to the volume. Do you think this information is important enough to justify reserving permanent screen space? I'd suggest using screen_status_printf() for displaying it shortly on the status line. ... Max Well, yes and no. I agree it's not important enough to justify cluttering the ui with it. On the other hand, you probably want to see beforehand what the time is set to so that you know how far it will jump when you seek. But I guess you could rely on your memory for that... ;) Anyway, here is a modifed patch that uses screen_status_printf(), have no leading whitespace and makes the string translatable. I leave it to you to decide which version you want to use. --- diff --git a/src/command.c b/src/command.c index 3fe825c..e311254 100644 --- a/src/command.c +++ b/src/command.c @@ -130,6 +130,10 @@ static command_definition_t cmds[] = { N_(Seek forward) }, { { 'b', 0, 0 }, 0, CMD_SEEK_BACKWARD, seek-backward, N_(Seek backward) }, + { { 'F', 0, 0 }, 0, CMD_SEEK_TIME_INC, seek-time-increase, + N_(Increase seek time) }, + { { 'B', 0, 0 }, 0, CMD_SEEK_TIME_DEC, seek-time-decrease, + N_(Decrease seek time) }, { { '+', RGHT, 0 }, 0, CMD_VOLUME_UP, volume-up, N_(Increase volume) }, { { '-', LEFT, 0 }, 0, CMD_VOLUME_DOWN, volume-down, diff --git a/src/command.h b/src/command.h index b3222c5..94ba37e 100644 --- a/src/command.h +++ b/src/command.h @@ -43,6 +43,8 @@ typedef enum { CMD_TRACK_PREVIOUS, CMD_SEEK_FORWARD, CMD_SEEK_BACKWARD, + CMD_SEEK_TIME_INC, + CMD_SEEK_TIME_DEC, CMD_SHUFFLE, CMD_RANDOM, CMD_CLEAR, diff --git a/src/screen.c b/src/screen.c index e540fec..1e1ec4b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -796,7 +796,14 @@ screen_client_cmd(mpdclient_t *c, command_t cmd) /* seek_target_time=0; */ } break; - /* fall through... */ + case CMD_SEEK_TIME_INC: + options.seek_time += (options.seek_time == 1) ? 4 : 5; + screen_status_printf(_(Seek time: %d s), options.seek_time); + break; + case CMD_SEEK_TIME_DEC: + options.seek_time = (options.seek_time 6) ? 1 : options.seek_time - 5; + screen_status_printf(_(Seek time: %d s), options.seek_time); + break; case CMD_TRACK_NEXT: if (!IS_STOPPED(c-status-state)) mpdclient_cmd_next(c); diff --git a/src/screen_help.c b/src/screen_help.c index 81b479f..567e396 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -86,6 +86,8 @@ static help_text_row_t help_text[] = { { 0, CMD_TRACK_PREVIOUS, NULL }, { 0, CMD_SEEK_FORWARD, NULL }, { 0, CMD_SEEK_BACKWARD, NULL }, + { 0, CMD_SEEK_TIME_INC, NULL }, + { 0, CMD_SEEK_TIME_DEC, NULL }, { 0, CMD_VOLUME_DOWN, NULL }, { 0, CMD_VOLUME_UP, NULL }, { 0, CMD_NONE, NULL }, --- Fredrik -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] [PATCH] ncmpc: Adjustable seek time
On 2009/08/14 14:33, Fredrik Lanker fredrik.lan...@gmail.com wrote: Anyway, here is a modifed patch that uses screen_status_printf(), have no leading whitespace and makes the string translatable. I leave it to you to decide which version you want to use. I'll take this one. Did you notice that your default hot key 'B' is duplicate? (scroll-up-half) Have you got a suggestion which key to use instead? Max -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] [PATCH] ncmpc: Adjustable seek time
On Fri, Aug 14, 2009 at 02:43:44PM +0200, Max Kellermann wrote: On 2009/08/14 14:33, Fredrik Lanker fredrik.lan...@gmail.com wrote: Anyway, here is a modifed patch that uses screen_status_printf(), have no leading whitespace and makes the string translatable. I leave it to you to decide which version you want to use. I'll take this one. Did you notice that your default hot key 'B' is duplicate? (scroll-up-half) Have you got a suggestion which key to use instead? Max Ah, no, I've disabled the keys for scroll-up/down-half, so I missed that, sorry. May I suggest changing the hot keys for scroll-*-half instead? For two reasons: 1) having F/B for adjusting the seek time seems pretty obvious to me considering that seeking have keys f/b. 2) in my opinion, the default hot key for scroll-down-half, N, should instead be used for rfind-next, like it's used in Vim (and probably a bounce of other apps). And N/B don't seem to have any connection to scrolling, as far as I can see, so changing them should be fine. O/I seems to be available in that case. Fredrik -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] [PATCH] ncmpc: Adjustable seek time
On 2009/08/14 15:42, Fredrik Lanker fredrik.lan...@gmail.com wrote: 1) having F/B for adjusting the seek time seems pretty obvious to me considering that seeking have keys f/b. 2) in my opinion, the default hot key for scroll-down-half, N, should instead be used for rfind-next, like it's used in Vim (and probably a bounce of other apps). And N/B don't seem to have any connection to scrolling, as far as I can see, so changing them should be fine. O/I seems to be available in that case. It's a good idea if ncmpc shares hot keys with common applications like vi. Many existing hot keys were already borrowed. Can you please make sure what these are, and send a patch? Max -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team
Re: [Musicpd-dev-team] [PATCH] ncmpc: Adjustable seek time
I'm the one who set the scrolling keys. I agree that they are not ideal, but I was having a lot of trouble finding any pairs available with a mnemonic. (I didn't want one to use control and the other use shift.) I would have preferred to set them the same as Vim (ctrl-d/u) but one was already taken in the defaults: ctrl-u means music database update. My own keys are remapped to be as Vimlike as possible; for example N is rfind-next for me, as you suggest. Personally, I would be in favor of rearranging some of the defaults, but I assumed they'd been around long enough that we wouldn't want to change them. It's worth noting, when thinking about changing default keys, that due to the way the settings are stored, other users may not notice the change for a while, then get caught off guard. For example, if you have added an extra key for a command, ncmpc saves all of the keys for that command to the file. The default is now hard-coded in the keys file. The user will not notice a change until they for one reason or another start fresh. One possibility I'd thought of before would be to start distributing sample keys files with ncmpc. If we remap keys to parallel Vim as closely as possible, then we could include a keys.classic file. If we keep the old keys for compatibility, we could include keys.vimlike. Jeffrey On Fri, Aug 14, 2009 at 8:55 AM, Max Kellermann m...@duempel.org wrote: On 2009/08/14 15:42, Fredrik Lanker fredrik.lan...@gmail.com wrote: 1) having F/B for adjusting the seek time seems pretty obvious to me considering that seeking have keys f/b. 2) in my opinion, the default hot key for scroll-down-half, N, should instead be used for rfind-next, like it's used in Vim (and probably a bounce of other apps). And N/B don't seem to have any connection to scrolling, as far as I can see, so changing them should be fine. O/I seems to be available in that case. It's a good idea if ncmpc shares hot keys with common applications like vi. Many existing hot keys were already borrowed. Can you please make sure what these are, and send a patch? Max -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team