コード例 #1
0
void IPhoneSoundDevice::Enable(bool fEnable)
{
    base::CritScope cs(&m_crit);

    if (fEnable) {
        if (!m_fEnable) {
            memset(m_achnl, 0, sizeof(m_achnl));
            m_tSilence = 0;
            m_fEnable = true;
            for (int i = 0; i < kcBuffers; i++) {
                InitAudioBuffer(m_apaqb[i]);
            }
            AudioQueuePrime(m_haq, 0, NULL);
            AudioQueueStart(m_haq, NULL);
            SetSoundServiceDevice(this);
        }
    } else {
        if (m_fEnable) {
            m_fEnable = false;
            memset(m_achnl, 0, sizeof(m_achnl));
            m_tSilence = 0;
            AudioQueueStop(m_haq, false);
            SetSoundServiceDevice(NULL);
        }
    }
}
コード例 #2
0
ファイル: common_stacks.c プロジェクト: DmitrySigaev/DSMedia
void SR_NodeInit(SceneRenderer *sr, SFNode *node)
{
	switch (Node_GetTag(node)) {
	case TAG_MPEG4_AnimationStream: InitAnimationStream(sr, node); break;
	case TAG_MPEG4_AudioBuffer: InitAudioBuffer(sr, node); break;
	case TAG_MPEG4_AudioSource: InitAudioSource(sr, node); break;
	case TAG_MPEG4_AudioClip: case TAG_X3D_AudioClip: InitAudioClip(sr, node); break;
	case TAG_MPEG4_TimeSensor: case TAG_X3D_TimeSensor: InitTimeSensor(sr, node); break;
	case TAG_MPEG4_ImageTexture: case TAG_X3D_ImageTexture: InitImageTexture(sr, node); break;
	case TAG_MPEG4_PixelTexture: case TAG_X3D_PixelTexture: InitPixelTexture(sr, node); break;
	case TAG_MPEG4_MovieTexture: case TAG_X3D_MovieTexture: InitMovieTexture(sr, node); break;
	default:
		sr->visual_renderer->NodeInit(sr->visual_renderer, node);
		break;
	}
}
コード例 #3
0
void gf_sr_on_node_init(GF_Renderer *sr, GF_Node *node)
{
    switch (gf_node_get_tag(node)) {
    case TAG_MPEG4_AnimationStream:
        InitAnimationStream(sr, node);
        break;
    case TAG_MPEG4_AudioBuffer:
        InitAudioBuffer(sr, node);
        break;
    case TAG_MPEG4_AudioSource:
        InitAudioSource(sr, node);
        break;
    case TAG_MPEG4_AudioClip:
    case TAG_X3D_AudioClip:
        InitAudioClip(sr, node);
        break;
    case TAG_MPEG4_TimeSensor:
    case TAG_X3D_TimeSensor:
        InitTimeSensor(sr, node);
        break;
    case TAG_MPEG4_ImageTexture:
    case TAG_X3D_ImageTexture:
        InitImageTexture(sr, node);
        break;
    case TAG_MPEG4_PixelTexture:
    case TAG_X3D_PixelTexture:
        InitPixelTexture(sr, node);
        break;
    case TAG_MPEG4_MovieTexture:
    case TAG_X3D_MovieTexture:
        InitMovieTexture(sr, node);
        break;
    default:
        sr->visual_renderer->NodeInit(sr->visual_renderer, node);
        break;
    }
}