Esempio n. 1
0
/*
    Adjust the 'src' cue by 'adj' amount and return the result in 'dst'.
    That is, If you get called with "DIPImpCueAdjust( ii, src, 1, dst )",
    the 'dst' handle should be filled in with implementation cue handle
    representing the source cue immediately following the 'src' cue.
    Passing in an 'adj' of -1 will get the immediately preceeding source
    cue. The list of source cues for each file are considered a ring,
    so if 'src' is the first cue in a file, an 'adj' of -1 will return
    the last source cue FOR THAT FILE. The cue adjust never crosses a
    file boundry. Also, if 'src' is the last cue in a file, and 'adj' of
    1 will get the first source cue FOR THAT FILE. If an adjustment
    causes a wrap from begining to end or vice versa, you should return
    DS_WRAPPED status (NOTE: DS_ERR should *not* be or'd in, nor should
    DCStatus be called in this case). Otherwise DS_OK should be returned
    unless an error occurred.
*/
dip_status      DIPENTRY DIPImpCueAdjust( imp_image_handle *ii,
                imp_cue_handle *src, int adj, imp_cue_handle *dst )
/*****************************************************************/
{
    dr_handle       stmts;
    dfline_search   start_state;
    dfline_find     find;
    dip_status      ret;
    imp_mod_handle  imx;
    cue_item        cue;
    cue_list        *cue_map;
    address         map_addr;

    imx = src->imx;
    DRSetDebug( ii->dwarf->handle );    /* must do at each call into DWARF */
    stmts  =  ii->mod_map[imx].stmts;
    if( stmts == 0 ) {
        DCStatus( DS_FAIL );
        return( DS_ERR|DS_FAIL  );
    }
    cue_map= ii->cue_map;
    if( cue_map->imx != imx ) {
        ResetCueInfo( cue_map );
        cue_map->imx = imx;
        map_addr = NilAddr;
        LoadCueMap( stmts, &map_addr, cue_map );
    }
    if( adj < 0 ) {
        start_state = LOOK_LOW;
        adj = -adj;
    } else {
        start_state = LOOK_HIGH;
    }
    cue.fno = src->fno;
    cue.line = src->line;
    cue.col = src->col;
    while( 0 != adj ) {
        find =  FindCue( cue_map, &cue, start_state );
        if( find == LINE_NOT ) break;
        --adj;
    }
    dst->imx = imx;
    dst->fno  =  cue.fno;
    dst->line =  cue.line;
    dst->col  =  cue.col;
    dst->a.mach = cue.mach;
    switch( find ) {
    case LINE_NOT:
        DCStatus( DS_FAIL );
        ret = DS_ERR | DS_FAIL;
        break;
    case LINE_WRAPPED:
        ret = DS_WRAPPED;
        break;
    case LINE_FOUND:
        ret = DS_OK;
        break;
    }
    return( ret );
}
Esempio n. 2
0
bool CSoundComponent::IsCuePlaying(const char* cueName)
{
	XACTINDEX cueIdx=FindCue(cueName);
	if (cueIdx==XACTINDEX_INVALID)
		FAIL(cueName,"No such XACT cue name");
	XACT_CUE_PROPERTIES prop;
	mpSoundBank->GetCueProperties(cueIdx,&prop);
	return (prop.currentInstances>0);
}
Esempio n. 3
0
void CSoundComponent::StopCue(const char* cueName)
{
	XACTINDEX cueIdx=FindCue(cueName);
	if (cueIdx==XACTINDEX_INVALID)
		FAIL(cueName,"No such XACT cue name");
	//TODO(Stop the cue);
	cueIdx=mpSoundBank->GetCueIndex(cueName);
	mpSoundBank->Stop(cueIdx,0);
}
Esempio n. 4
0
IXACT3Cue* CSoundComponent::Play3DCue(const char* cueName)
{
	XACTINDEX cueIdx=FindCue(cueName);
	if (cueIdx==XACTINDEX_INVALID)
		FAIL(cueName,"No such XACT cue name");
	//TODO(Play the cue);
	mpSoundBank->Play(cueIdx, 0,0,&pCue);
	return pCue;
}
Esempio n. 5
0
void CSoundComponent::PlayCue(const char* cueName)
{
	XACTINDEX cueIdx=FindCue(cueName);
	if (cueIdx==XACTINDEX_INVALID)
		FAIL(cueName,"No such XACT cue name");
	//TODO(Play the cue);
	cueIdx=mpSoundBank->GetCueIndex(cueName);
	mpSoundBank->Play(cueIdx, 0,0,NULL);
}
Esempio n. 6
0
search_result DIPIMPENTRY( LineCue )( imp_image_handle *ii,
                imp_mod_handle im, cue_fileid file, unsigned long line,
                unsigned column, imp_cue_handle *ic )
/**********************************************************************/
{
    search_result   ret;
    dfline_find     find;
    dfline_search   what;
    drmem_hdl       stmts;
    cue_list        *cue_map;
    address         map_addr;
    cue_item        cue;

    if( im == IMH_NOMOD ) {
        DCStatus( DS_FAIL );
        return( SR_NONE );
    }
    DRSetDebug( ii->dwarf->handle );    /* must do at each call into DWARF */
    stmts = IMH2MODI( ii, im )->stmts;
    if( stmts == DRMEM_HDL_NULL ) {
        return( SR_NONE );
    }
    cue_map= ii->cue_map;
    if( cue_map->im != im ) {
        ResetCueInfo( cue_map );
        cue_map->im = im;
        map_addr = NilAddr;
        LoadCueMap( stmts, &map_addr, cue_map );
    }
    if( file == 0 ) {   // primary file
        cue.fno = 1;
    } else {
        cue.fno = (uint_16)file;
    }
    cue.line = line;
    cue.col = (uint_16)column;
    cue.mach.offset = 0;
    cue.mach.segment = 0;
    ic->a = NilAddr;
    if( line == 0 ) {
        what = LOOK_FILE;
    } else {
        what = LOOK_CLOSEST;
    }
    find = FindCue( cue_map, &cue, what );
    ic->im = im;
    ic->fno = cue.fno;
    ic->line = cue.line;
    ic->col = cue.col;
    ic->a.mach = cue.mach;
    ret = SR_NONE;
    switch( find ) {
    case LINE_CLOSEST:
        ret = SR_CLOSEST;
        break;
    case LINE_FOUND:
        ret = SR_EXACT;
        break;
    case LINE_NOT:
        ret = SR_NONE;
        break;
    }
    return( ret );
}
Esempio n. 7
0
/*
    Adjust the 'src' cue by 'adj' amount and return the result in 'dst'.
    That is, If you get called with "DIPImpCueAdjust( ii, src, 1, dst )",
    the 'dst' handle should be filled in with implementation cue handle
    representing the source cue immediately following the 'src' cue.
    Passing in an 'adj' of -1 will get the immediately preceeding source
    cue. The list of source cues for each file are considered a ring,
    so if 'src' is the first cue in a file, an 'adj' of -1 will return
    the last source cue FOR THAT FILE. The cue adjust never crosses a
    file boundry. Also, if 'src' is the last cue in a file, and 'adj' of
    1 will get the first source cue FOR THAT FILE. If an adjustment
    causes a wrap from begining to end or vice versa, you should return
    DS_WRAPPED status (NOTE: DS_ERR should *not* be or'd in, nor should
    DCStatus be called in this case). Otherwise DS_OK should be returned
    unless an error occurred.
*/
dip_status DIPIMPENTRY( CueAdjust )( imp_image_handle *ii,
                imp_cue_handle *src, int adj, imp_cue_handle *dst )
/*****************************************************************/
{
    drmem_hdl       stmts;
    dfline_search   start_state;
    dfline_find     find;
    dip_status      ret;
    cue_item        cue;
    cue_list        *cue_map;
    address         map_addr;

    DRSetDebug( ii->dwarf->handle );    /* must do at each call into DWARF */
    stmts = IMH2MODI( ii, src->im )->stmts;
    if( stmts == DRMEM_HDL_NULL ) {
        DCStatus( DS_FAIL );
        return( DS_ERR|DS_FAIL  );
    }
    cue_map = ii->cue_map;
    if( cue_map->im != src->im ) {
        ResetCueInfo( cue_map );
        cue_map->im = src->im;
        map_addr = NilAddr;
        LoadCueMap( stmts, &map_addr, cue_map );
    }
    if( adj < 0 ) {
        start_state = LOOK_LOW;
        adj = -adj;
    } else {
        start_state = LOOK_HIGH;
    }
    cue.fno = src->fno;
    cue.line = src->line;
    cue.col = src->col;
    cue.mach = src->a.mach;
    find = LINE_NOT;
    while( 0 != adj ) {
        find = FindCue( cue_map, &cue, start_state );
        if( find == LINE_NOT ) break;
        --adj;
    }
    dst->im = src->im;
    dst->fno = cue.fno;
    dst->line = cue.line;
    dst->col = cue.col;
    dst->a.mach = cue.mach;
    ret = DS_FAIL;
    switch( find ) {
    case LINE_NOT:
        DCStatus( DS_FAIL );
        ret = DS_ERR | DS_FAIL;
        break;
    case LINE_WRAPPED:
        ret = DS_WRAPPED;
        break;
    case LINE_FOUND:
        ret = DS_OK;
        break;
    }
    return( ret );
}
Esempio n. 8
0
search_result   DIPENTRY DIPImpLineCue( imp_image_handle *ii,
                imp_mod_handle im, cue_file_id file, unsigned long line,
                unsigned column, imp_cue_handle *ic )
/**********************************************************************/
{
    search_result   ret;
    dfline_find     find;
    dfline_search   what;
    dr_handle       stmts;
    im_idx          imx;
    cue_list        *cue_map;
    address         map_addr;
    cue_item        cue;

    if( im == 0 ) {
        DCStatus( DS_FAIL );
        return( SR_NONE );
    }
    DRSetDebug( ii->dwarf->handle );    /* must do at each call into DWARF */
    imx = IM2IMX( im );
    stmts  = ii->mod_map[imx].stmts;
    if( stmts == 0 ) {
        return( SR_NONE );
    }
    cue_map= ii->cue_map;
    if( cue_map->imx != imx ) {
        ResetCueInfo( cue_map );
        cue_map->imx = imx;
        map_addr = NilAddr;
        LoadCueMap( stmts, &map_addr, cue_map );
    }
    if( file == 0 ) {   // primary file
        cue.fno = 1;
    } else {
        cue.fno = file;
    }
    cue.line = line;
    cue.col = column;
    ic->a = NilAddr;
    if( line == 0 ) {
        what = LOOK_FILE;
    } else {
        what =  LOOK_CLOSEST;
    }
    find = FindCue( cue_map, &cue, what );
    ic->imx  = imx;
    ic->fno  = cue.fno;
    ic->line = cue.line;
    ic->col  = cue.col;
    ic->a.mach = cue.mach;
    switch( find ) {
    case LINE_CLOSEST:
        ret = SR_CLOSEST;
        break;
    case LINE_FOUND:
        ret = SR_EXACT;
        break;
    case LINE_NOT:
        ret = SR_NONE;
        break;
    }
    return( ret );
}