From 70660afca437740faf9d42ea857f3293596d5527 Mon Sep 17 00:00:00 2001 From: angel Date: Wed, 23 Nov 2005 14:57:02 +0000 Subject: [PATCH] Added the option to play a track in a solo (Closes: #1101). git-svn-id: file:///home/angel/tmp/svn-triptico/ahxm/trunk@746 c87de0a0-a11c-0410-a1e5-866214bc28b2 --- TODO | 3 ++- VERSION | 2 +- annhell.h | 2 +- main.c | 10 +++++++++- song.c | 12 ++++++++++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index e4c44aa..9904509 100644 --- a/TODO +++ b/TODO @@ -7,7 +7,6 @@ Release Critical Bugs * 1092: Release 1.0.0 right now and make it a stable CVS branch. * 1097: Dotted notes are broken when more than one is used. * 1100: Add command-line options to mute a track. - * 1101: Add command-line options to 'solo' a track. Open Bugs --------- @@ -237,5 +236,7 @@ Closed #1098; Thu, 13 Oct 2005 17:36:56 +0200). * 1099: Add command-line options to mute and/or solo tracks (closed by #1100 and #1101; Wed, 23 Nov 2005 13:27:15 +0100). + * 1101: Add command-line options to 'solo' a track + (Wed, 23 Nov 2005 15:54:28 +0100). Email bugs to angel@triptico.com diff --git a/VERSION b/VERSION index 2a8794a..4d9337d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -#define VERSION "1.0.0-rc3b" +#define VERSION "1.0.0-rc4" diff --git a/annhell.h b/annhell.h index 06ddc62..6081fcc 100644 --- a/annhell.h +++ b/annhell.h @@ -344,7 +344,7 @@ extern sample_t ss_optimal_volume; extern union song_ev * song; extern int n_song_ev; - +extern int solo_track; /* MACROS */ diff --git a/main.c b/main.c index 2e86df8..557f499 100644 --- a/main.c +++ b/main.c @@ -67,13 +67,14 @@ static int main_usage(void) printf("-v {master volume} Set master volume [default: 0.5]\n"); printf("-s {seconds to skip} Seconds to skip from the start of the song.\n"); printf(" [default: 0, start from the beginning]\n"); + printf("-z {track number} Play track number in a solo\n"); printf("-i {interpolation} Set interpolation algorithm\n"); printf(" (0, none; 1, linear; 2, cubic spline,\n"); printf(" 3, Lagrange) [default: 3]\n"); printf("-D Show debugging information.\n"); printf("-M Output song to MIDI device instead of softsynth.\n"); printf("-I Interactive; read from MIDI device and\n"); - printf(" use {script} as instrument.\n"); + printf(" use {script} as instrument (UNIMPLEMENTED).\n"); printf("\n"); printf("Internal sample size: %d bits (floating point)\n", sizeof(sample_t) * 8); @@ -210,10 +211,17 @@ static int annhell_main(int argc, char * argv[]) midi=1; } else + if(strcmp(opt, "-z") == 0) + { + /* set solo track */ + solo_track = atoi(argv[n++]); + } + else if(strcmp(opt, "-D") == 0) debug=1; else return(main_usage()); + } script=argv[argc - 1]; diff --git a/song.c b/song.c index db172e9..c2be21e 100644 --- a/song.c +++ b/song.c @@ -37,10 +37,13 @@ ********************/ /* the song event stream */ -union song_ev * song=NULL; +union song_ev * song = NULL; /* number of song events */ -int n_song_ev=0; +int n_song_ev = 0; + +/* solo track (-1, no solo) */ +int solo_track = -1; /******************* Code @@ -71,6 +74,11 @@ void song_clear(void) */ void add_song_ev(union song_ev * ev) { + /* skip tracks if a solo is requested */ + if(solo_track != -1 && ev->generic.trk_id >= 0 && + ev->generic.trk_id != solo_track) + return; + /* reallocs */ song=(union song_ev *)realloc(song, (n_song_ev + 1) * sizeof(union song_ev)); -- 2.11.4.GIT