PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

MikMod Looping problems!

Hi All, I'm trying to set the loop var in mikmod but I can, I assume I doing somthing stupid:

here the def:

Code:

typedef struct MODULE {
/* general module information */
CHAR* songname; /* name of the song */
CHAR* modtype; /* string type of module loaded */
CHAR* comment; /* module comments */

UWORD flags; /* See module flags above */
UBYTE numchn; /* number of module channels */
UBYTE numvoices; /* max # voices used for full NNA playback */
UWORD numpos; /* number of positions in this song */
UWORD numpat; /* number of patterns in this song */
UWORD numins; /* number of instruments */
UWORD numsmp; /* number of samples */
struct INSTRUMENT* instruments; /* all instruments */
struct SAMPLE* samples; /* all samples */
UBYTE realchn; /* real number of channels used */
UBYTE totalchn; /* total number of channels used (incl NNAs) */

/* playback settings */
UWORD reppos; /* restart position */
UBYTE initspeed; /* initial song speed */
UWORD inittempo; /* initial song tempo */
UBYTE initvolume; /* initial global volume (0 - 128) */
UWORD panning[64]; /* 64 panning positions */
UBYTE chanvol[64]; /* 64 channel positions */
UWORD bpm; /* current beats-per-minute speed */
UWORD sngspd; /* current song speed */
SWORD volume; /* song volume (0-128) (or user volume) */

BOOL extspd; /* extended speed flag (default enabled) */
BOOL panflag; /* panning flag (default enabled) */
BOOL wrap; /* wrap module ? (default disabled) */
BOOL loop; /* allow module to loop ? (default enabled) */
BOOL fadeout; /* volume fade out during last pattern */

UWORD patpos; /* current row number */
SWORD sngpos; /* current song position */
ULONG sngtime; /* current song time in 2^-10 seconds */

SWORD relspd; /* relative speed factor */

/* internal module representation */
UWORD numtrk; /* number of tracks */
UBYTE** tracks; /* array of numtrk pointers to tracks */
UWORD* patterns; /* array of Patterns */
UWORD* pattrows; /* array of number of rows for each pattern */
UWORD* positions; /* all positions */

BOOL forbid; /* if true, no player update! */
UWORD numrow; /* number of rows on current pattern */
UWORD vbtick; /* tick counter (counts from 0 to sngspd) */
UWORD sngremainder;/* used for song time computation */

struct MP_CONTROL* control; /* Effects Channel info (size pf->numchn) */
struct MP_VOICE* voice; /* Audio Voice information (size md_numchn) */

UBYTE globalslide; /* global volume slide rate */
UBYTE pat_repcrazy;/* module has just looped to position -1 */
UWORD patbrk; /* position where to start a new pattern */
UBYTE patdly; /* patterndelay counter (command memory) */
UBYTE patdly2; /* patterndelay counter (real one) */
SWORD posjmp; /* flag to indicate a jump is needed... */
} MODULE;


MODULE *music;


and heres the "setting of it"?

Code:

music = Player_Load(fullpath(SONGT),8,0); //main menu
if (music == 0) alert(45,100,"Music Error",MikMod_strerror(MikMod_errno),"");
music.wrap = 1; //SET TO WRAP


comes back with:

left of '.wrap' must have class/struct/union type

ehh? anyhow if anyone has been able to loop mikmod, can they please let me know how!, thanks
music is a pointer:

music->wrap=1;
or
(*music).wrap=1;
etc

Dan East
F*, I knew that!, lol! (wake up australia)....


p.s thats a true australian saying....

-Thanks Dan
Actually I think this one needs to be added to the "stupid programmers tricks" topic.... lol