Skip to content

Instantly share code, notes, and snippets.

@RichardHum
Created June 11, 2014 20:20
Show Gist options
  • Save RichardHum/a38037d4b33d98776962 to your computer and use it in GitHub Desktop.
Save RichardHum/a38037d4b33d98776962 to your computer and use it in GitHub Desktop.
moc diff to add seek beginning
Index: interface.c
===================================================================
--- interface.c (revision 2652)
+++ interface.c (working copy)
@@ -1841,6 +1841,7 @@
plist_free (&plist);
free (file);
+ save_playlist_in_moc ();
}
/* To avoid lots of locks and unlocks, this assumes a lock is sent before
@@ -1954,6 +1955,7 @@
iface_menu_key (KEY_CMD_MENU_DOWN);
free (file);
+ save_playlist_in_moc ();
}
static void queue_toggle_file ()
@@ -3228,6 +3230,9 @@
case KEY_CMD_SEEK_FORWARD:
seek (options_get_int ("SeekTime"));
break;
+ case KEY_CMD_SEEK_BEGINNING:
+ jump_to(0);
+ break;
case KEY_CMD_HELP:
iface_switch_to_help ();
break;
Index: interface.h
===================================================================
--- interface.h (revision 2652)
+++ interface.h (working copy)
@@ -58,6 +58,7 @@
void interface_cmdline_set (int server_sock, char *arg, const int val);
void interface_cmdline_formatted_info (const int server_sock, const char *format_str);
void interface_cmdline_enqueue (int server_sock, struct lists_s_strs *args);
+static void save_playlist_in_moc ();
#ifdef __cplusplus
}
Index: keys.c
===================================================================
--- keys.c (revision 2652)
+++ keys.c (working copy)
@@ -298,6 +298,14 @@
1
},
{
+ KEY_CMD_SEEK_BEGINNING,
+ "seek_beginning",
+ "Seek to beginning of file",
+ CON_MENU,
+ { KEY_BACKSPACE, -1},
+ 1
+ },
+ {
KEY_CMD_HELP,
"help",
"Show the help screen",
Index: keys.h
===================================================================
--- keys.h (revision 2652)
+++ keys.h (working copy)
@@ -36,6 +36,7 @@
KEY_CMD_MIXER_INC_5,
KEY_CMD_SEEK_FORWARD,
KEY_CMD_SEEK_BACKWARD,
+ KEY_CMD_SEEK_BEGINNING,
KEY_CMD_SEEK_FORWARD_5,
KEY_CMD_SEEK_BACKWARD_5,
KEY_CMD_HELP,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment