/***************************************************************************
 * strumlib.h: implementation of Strummer struct
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-2006 the KTabEdit development team <mrgwen@gmail.com>
 * copyright (C) 2002-2003 the KGuitar development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

// Strumming library defines and headers

#ifndef STRUMLIB_H
#define STRUMLIB_H

#include <qstring.h>

#define MAX_STRUM_LENGTH	10

// Treble order

#define TR1			1
#define TR2			2
#define TR3			4
#define TR4			8
#define TR5			16
#define TR6			32

// Bass order

#define BS1			-1
#define BS2			-2
#define BS3			-4
#define BS4			-8
#define BS5			-16
#define BS6			-32

/*!
		TODO
*/
typedef struct {
	/*!
		First field of record should be an array with bitmasked strum
		pattern. Please add up TR and BS macros with "+" operator to get
		the proper results. See the examples below.
		
		TR macros reference strings from highest to lowest, i.e. TR1
		references the top tab line with standard 6-string guitar.
		
		BS macros reference strings vice versa, from lowest to highest,
		i.e. BS1 references the bottom tab line with guitar.
		
		You can give just 0 in this field. This will mean no strings to be
		strummed (pause) or all strings to be strummed (full chord),
		depending on second field.

		Example: { BS1, TR4, TR3, TR2, TR1, TR2, TR3 }

	*/
	int mask[MAX_STRUM_LENGTH];
	
	/*!
		Second field should be with durations of notes of corresponding
		bitmasked patterns in the first array, all in MIDI note length
		notation. If such a duration is given with minus sign, then all
		strings that are to be strummed due to instructions in the first
		field are inverted. So, if this field's negative, first field
		specifies what strings should _not_ be strummed (all others
		should).

		Example:  { 60,  30,  30,  60,  60,  60,  60, 0 }

	*/
	int len[MAX_STRUM_LENGTH];
	
	/*!
		Third field should be a human-readable name of given strumming
		scheme.

		Example: I18N_NOOP("3/4 Smooth Arpegio With Return")
	*/
	QString name;
	
	/*!
		Fourth field should describe the pattern a little, including it's
		pros and cons, complexity, what songs it sounds best in and
		possibly a well-known song where it is used or originated from.

		Example: 18N_NOOP("Smooth accelerating and decelarating arpegio. Played mostly "
	       "with a pick, strumming relatively slow through the strings. "
	       "Well-known from a song \"House of the Rising Sun\", performed "
	       "by Animals and many others.")
	*/
	QString description;
} strummer;

#endif
