//This code is copyright Andrew Story (Kaslai/Aslai) All rights reserved.
//This and derivative works can be distributed as seen fit,
//so long as this notice remains unchanged and present

#pragma once
#include "global/stdinc.h"
#include "engine/media.h"
#include "engine/types.h"
#include "global/classes.h"
#include "engine/chiptune.h"

struct KAU{
    QUEUE data;
    char* id;
    Context* parent;
    Chiptunes* chip;
    int pos;
    void play( );
    void play( int vol );
    void volume( int vol );
    void stop();
    void pause();
    KAU( char* fname, Context* prnt, Chiptunes* chi, char* ID );
    KAU( void* f, int len, Context* prnt, Chiptunes* chi, char* ID );

    ~KAU();
};

extern std::vector<KAU*> kaus;
extern std::map<const char*, int, map_char> kau_map;

KAU* kau_add( char* fname, Context* prnt, Chiptunes* chi, char* ID );
KAU* kau_add( void* f, int len, Context* prnt, Chiptunes* chi, char* ID );

void kau_rem( KAU* );
KAU* kau_get_by_id( char* ID );