【问题标题】:Compiler error on Stopped enum value using GetStatus使用 GetStatus 停止枚举值的编译器错误
【发布时间】:2011-08-04 02:36:03
【问题描述】:

我正在尝试获取音效的状态,但我不知道如何实际找出状态。我对 C++ 很陌生。我试图阅读有关枚举并应用我所看到的内容,但它不起作用。 这是我的代码

sf::Sound::Status BeepStatus = Beep.GetStatus();
cout << BeepStatus;
if (BeepStatus == Stopped)
{
    Beep.SetPitch(float((rand()%15)-1)/10);
    Beep.Play();
}

该代码不起作用。在编译期间它会说 Stopped 没有定义。我该怎么办?

【问题讨论】:

    标签: c++ audio enums sfml status


    【解决方案1】:

    您需要对 Stopped 变量使用范围运算符。

    可能是这样的:

    sf::Sound::Stopped
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-26
      • 1970-01-01
      • 2013-02-18
      • 1970-01-01
      相关资源
      最近更新 更多