Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [solved]getStatus function give's error  (Read 4446 times)

0 Members and 1 Guest are viewing this topic.

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
[solved]getStatus function give's error
« on: December 27, 2013, 06:26:17 am »
hi,
i'm writing a game engine for blinds and visually impaired users using SFML and some other libraries
this is my function:
Code: [Select]
bool is_paused()
{
    if(snd.getStatus()==STATUS.Paused)
    {
        return true;
    }
    else
    {
        return false;
    }
}
the compiler says:
F:\projects\cpp\AGK\AGK.cpp: In member function 'bool sound::is_paused()':
F:\projects\cpp\AGK\AGK.cpp:179:25: error: 'STATUS' was not declared in this scope
if(snd.getStatus()==STATUS.Paused)
^
I've tried removing status and compiled but say pause was not declared in this scope
now what is the error?
« Last Edit: January 02, 2014, 08:56:52 pm by amir ramezani »
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: getStatus function give's error
« Reply #1 on: December 27, 2013, 06:36:28 am »
It's not STATUS, it's Status.
(and it's in the sf namespace)

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
Re: getStatus function give's error
« Reply #2 on: December 27, 2013, 07:38:22 am »
this is the error:
F:\projects\cpp\AGK\AGK.cpp: In member function 'bool sound::is_paused()':
F:\projects\cpp\AGK\AGK.cpp:179:29: error: invalid use of 'enum sf::SoundSource::Status'
if(snd.getStatus()==snd.Status.Paused)
^
this is the function that I've modified:
Code: [Select]
bool is_paused()
{
    if(snd.getStatus()==snd.Status.Paused)
    {
        return true;
    }
    else
    {
        return false;
    }
}
I'm using sf namespace:
Code: [Select]
using namespace sf;
now what is the problem?
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

the_mean_marine

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: getStatus function give's error
« Reply #3 on: December 27, 2013, 12:59:52 pm »
if(snd.getStatus()==snd.Status.Paused)
Should be:
if(snd.getStatus() == Sound::Status::Paused)

You might also want to take a look at SFML's included Sound example.
« Last Edit: December 27, 2013, 01:01:58 pm by the_mean_marine »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11044
    • View Profile
    • development blog
    • Email
AW: getStatus function give's error
« Reply #4 on: December 27, 2013, 06:34:25 pm »
...and documentation and tutorials. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/