Exemplo n.º 1
0
void MIDAS_CALL UpdateInfo(void) {   
    static MIDASplayStatus status;

    /* Get playback status: */
    if ( !MIDASgetPlayStatus(playHandle, &status) )
        MIDASerror();

    /* Store interesting information in easy-to-access variables: */
    position = status.position;
    pattern = status.pattern;
    row = status.row;
    syncInfo = status.syncInfo;
}
Exemplo n.º 2
0
Arquivo: musa.cpp Projeto: visy/turha
void MIDAS_CALL UpdateInfo(void)
{
    /* MIDAS_CALL is cdecl for Watcom, empty for DJGPP. Helps calling this
       from assembler, otherwise unnecessary */
    
    static MIDASplayStatus status;

    /* Get playback status: */
    if ( !MIDASgetPlayStatus(playHandle, &status) )
        MIDASerror();

    /* Store interesting information in easy-to-access variables: */
    position = status.position;
    pattern = status.pattern;
    row = status.row;
    syncInfo = status.syncInfo;
}
Exemplo n.º 3
0
static int soundGetStatus(struct Sound *s)
{
    int result=0;
    if (s->playhandle)
    switch (s->type)
    {
        case Module:
            {
            MIDASplayStatus status;
            MIDASgetPlayStatus((MIDASmodulePlayHandle)s->playhandle,&status);
            result=s->loop?1:1-status.songLoopCount;
            }
            break;
        case Sample:
            result=MIDASgetSamplePlayStatus((MIDASsamplePlayHandle)s->playhandle);
            break;
        case Stream:
            {
            int buffered=MIDASgetStreamBytesBuffered((MIDASstreamHandle)s->playhandle);
            result=1;
            #define BUFLEN 4608
            if ( buffered+2*BUFLEN<=s->bufferbytes )
            {
                unsigned char buf[BUFLEN];
                int decoded=MP3read((void *)s->datahandle,s->loop,buf,BUFLEN);
                if ( !decoded ) result=buffered/8;
                MIDASfeedStreamData((MIDASstreamHandle)s->playhandle,buf,decoded,1/*feedAll*/);
            }
            }
            break;
#ifdef DEBUG
        default:
            errAdd(" Get status: Unknown type.");
#endif
    }
    MIDASreportErr();
    return result;
}