//--------------------------------------------------------------------------------------
// 音楽の全ch分の処理
//--------------------------------------------------------------------------------------

#include "mml.h"
#import "Music1ch.h"

@interface Music8ch : NSObject
{
	// チェンネル管理
	Music1ch	*channel[MML_CHANNELS];
	// 音色管理
	MusicTones	*tones;
	// トラック
	__strong	NSMutableString *track[MML_TRACKS];
	BOOL	fcompiled[MML_TRACKS];
	char	*btrack[MML_TRACKS];
	
	// チャンネル〜トラック割り当て表
	int		ch_trk[MML_CHANNELS]; // [ch:0〜MML_CHANNNELS-1]=trk:0〜MML_TRACKS-1,NO_TRACK=未割りあて
}
@property (nonatomic) int tempo;	// テンポ

#define NO_TRACK	(-1)	// トラックが未割り当ての印

-(instancetype)init;

// 主にBASICインターフェース
-(void)m_init;
-(MML_RESULT)play:(int)bch;
-(void)pause:(int)bch;
-(void)cont:(int)bch;
-(void)stop:(int)bch;
-(void)mute:(int)bch onoff:(BOOL)onoff;
-(void)solo:(int)ch;
-(void)panpot:(int)ch panpot:(int)pan;
-(int)panpot:(int)ch;
-(void)volume:(int)ch volume:(int)vol;
-(int)volume:(int)ch;
-(int)stat:(int)ch;
-(NSString *)comment:(int)ch;
-(int)count:(int)ch;

-(void)track:(int)trk mmlSource:(NSString *)mmlSource;
-(MML_RESULT)compile:(int)trk;
-(void)free:(int)trk;
-(void)assign:(int)ch trk:(int)trk;
-(int)tone:(int)sno path:(NSString *)path rate:(int)rate octave:(int)octave scale:(int)scale floop:(BOOL)floop;
-(NSString *)trackString:(int)trk;
-(void)terminate;

@end

//--------------------------------------------------------------------------------------
