1
0
mirror of http://mpg123.de/trunk/.git synced 2025-08-07 21:02:55 +03:00

Manual bookmarking, as a start. Conplay does not yet really work with this.

git-svn-id: svn://scm.orgis.org/mpg123/trunk@3237 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2012-08-28 06:26:35 +00:00
parent 10fb151a96
commit 52f055ba2f
5 changed files with 19 additions and 1 deletions

View File

@@ -86,6 +86,12 @@ while(<MPG123>)
$entry = $1;
$frame = $2;
}
if(/^\[BOOKMARK\]\s+track\s+(\d+)\s+frame\s+(\d+)/)
{
print STDERR "\nGot bookmark at track $1, frame $2; not yet doing anything with that, besides storing.\n";
$entry = $1;
$frame = $2;
}
}
close(MPG123);

View File

@@ -1222,7 +1222,7 @@ int main(int sys_argc, char ** sys_argv)
if(APPFLAG(MPG123APP_CONTINUE))
{
fprintf(aux_out, "\n[CONTINUE] track %"SIZE_P" frame %"OFF_P"\n", (size_p)pl.pos, (off_p)framenum);
continue_msg("CONTINUE");
}
/* Free up memory used by playlist */
@@ -1430,3 +1430,8 @@ static void give_version(char* arg)
fprintf(stdout, PACKAGE_NAME" "PACKAGE_VERSION"\n");
safe_exit(0);
}
void continue_msg(const char *name)
{
fprintf(aux_out, "\n[%s] track %"SIZE_P" frame %"OFF_P"\n", name, (size_p)pl.pos, (off_p)framenum);
}

View File

@@ -169,4 +169,6 @@ void set_intflag(void);
/* equalizer... success is 0, failure -1 */
int load_equalizer(mpg123_handle *mh);
void continue_msg(const char *name);
#endif

View File

@@ -59,6 +59,7 @@ struct keydef term_help[] =
,{ MPG123_PITCH_UP_KEY, MPG123_PITCH_BUP_KEY, "pitch up (small step, big step)" }
,{ MPG123_PITCH_DOWN_KEY, MPG123_PITCH_BDOWN_KEY, "pitch down (small step, big step)" }
,{ MPG123_PITCH_ZERO_KEY, 0, "reset pitch to zero" }
,{ MPG123_BOOKMARK_KEY, 0, "print out current position in playlist and track, for the benefit of some external tool to store bookmarks" }
};
void term_sigcont(int sig);
@@ -476,6 +477,9 @@ static void term_handle_key(mpg123_handle *fr, audio_output_t *ao, char val)
}
break;
case MPG123_BOOKMARK_KEY:
continue_msg("BOOKMARK");
break;
default:
;
}

View File

@@ -56,6 +56,7 @@
#define MPG123_PITCH_DOWN_KEY 'x'
#define MPG123_PITCH_BDOWN_KEY 'X'
#define MPG123_PITCH_ZERO_KEY 'w'
#define MPG123_BOOKMARK_KEY 'k'
/* This counts as "undocumented" and can disappear */
#define MPG123_FRAME_INDEX_KEY 'i'
#define MPG123_VARIOUS_INFO_KEY 'I'