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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Spellbreaker

Pages: [1]
1
Audio / Synchronized playing of multiple ogg files
« on: April 12, 2011, 08:11:31 pm »
Hey there!

For a couple of time, I am trying to write a small program that does nothing than playing three .ogg files 100 % synchronized. Since it seems it is not possible, I wonder if I can use a multichannel ogg ( three active channels ), and change the volume of the channels to fade between the actual songs?

I want to use this to make it possible to fade in / out additional instrument tracks.

I tried the following simple code :
Code: [Select]
   music1.OpenFromFile("mansion-present-hihat.ogg");
     music2.OpenFromFile("mansion-present-hihat.ogg");
     music3.OpenFromFile("mansion-present-hihat.ogg");
     music1.Play();
     music2.Play();
     music3.Play();


I also tried to add the folowing :
Code: [Select]

     music1.SetPlayingOffset(0);
     music2.SetPlayingOffset(music1.GetPlayingOffset());
     music3.SetPlayingOffset(music2.GetPlayingOffset());


Any Ideas?

Sincerly,

Spellbreaker.
[/code]

2
Network / response.GetField("Content-Length") returns 0
« on: November 19, 2010, 03:31:47 pm »
Hello!

I have a question, I have the following code :

Code: [Select]

    sf::Http http;
    http.SetHost(host);
    sf::Http::Request request(page);
    sf::Http::Response response = http.SendRequest(request);
    sf::Http::Response::Status status = response.GetStatus();
    std::string str;
    if (status == sf::Http::Response::Ok) {
        str = response.GetField("Content-Length");
    } else {
        str = "Request Error.";
    }
    return str.length();


Why does str always contains 0 ?

Sincerly,

Spellbreaker

3
General / SFML2 Library Filenames
« on: November 11, 2010, 08:43:54 am »
Hi there.

I just updated my SFML2 Version by SVN, and wondered why the Libraries are called "libsfml-xxx-s.a" instead of "libsfml2-xxx-s.a" again? Just an error, or another Change?

Sincerly,

Spellbreaker

4
Network / selector.Wait() behavior
« on: September 22, 2010, 11:13:27 am »
Hi again .

I have a strange behavior regarding the selector.Wait() behavior :


Code: [Select]

#include "server.hpp"

cClient::cClient(sf::TcpSocket *socket, sf::Uint32 UID) {
    this->socket = socket;
    this->UID = UID;
}

cClient::~cClient() {
    this->socket->Disconnect();
    delete this->socket;
}

sf::Uint32 cClient::getUID() {
    return this->UID;
}

int main() {
    unsigned short Port = 1337;
    sf::SocketSelector selector;
    sf::TcpListener listener;
    //std::list<sf::TcpSocket*> clients;
    std::list<cClient> clientList;
    listener.Listen(Port);
    selector.Add(listener);
    sf::Uint32 UID;
    std::cout << "Server is listening to Port " << Port << ", waiting for connections..." << std::endl;
    while (true) {
        if (selector.Wait()) {
        std::cout << "#" << std::endl;
            if (selector.IsReady(listener)) {
                std::cout << "b" << std::endl;
                UID++;
                sf::TcpSocket* client = new sf::TcpSocket;
                if (listener.Accept(*client) == sf::Socket::Done) {
                    cClient newClient(client, UID);
                   // clients.push_back(client);
                    clientList.push_back(newClient);
                    selector.Add(*client);
                    std::cout << "New Client connected!" << std::endl;
                }
            } else {
                std::cout << "or what?" << std::endl;
                for ( tClientList::iterator it = clientList.begin(); it != clientList.end(); ++it ) {
                    sf::TcpSocket& client = *it->socket;
                    if ( selector.IsReady(client) ) {
                        sf::Packet packet;
                        if (client.Receive(packet) == sf::Socket::Done) {
                            std::string Message;
                            packet >> Message;
                            if ( Message == "qq" ) {
                                selector.Remove(client);
                                client.Disconnect();
                                std::cout << "Socket closed." << std::endl;
                            } else {
                                std::cout << "A client says : \"" << Message << "\"" << std::endl;
                            }
                        } else {
                            std::cout << "Socket Killed" << std::endl;
                            selector.Remove(client);
                        }
                    }
                }
            }
        }
    }
}


For some reason, the Wait() only waits until the first client is connected, after that the cout "#" never appears again, and the loop is looping endlessly (of course ).

What am I doing wrong?

Usign SFML 2 rev 1570


greets,

Spellbreajer[/code]

5
Network / [SOLVED] undefined reference to `socket@12'|
« on: September 22, 2010, 09:18:05 am »
Hi there!

I just downloaded SFML 2 SVN, built the libs, and when I want to compile my little network test, the following Error appears:

...undefined reference to `socket@12'|


and a bunch of other undefined references.

I am linking statically to system, network and wsock32, using mingw/gcc 4.5

Thanks in Advance.


Spellbreaker

6
Window / Question
« on: August 19, 2010, 11:17:22 pm »
Hey there!

I have a question about SetSize: Does it only "strech" the window, or does it really create a new render region?

I am developing a little game, and there are left-right scrolling levels, and up/down scrolling, so I have to change the window from 407x594 to 594x407 while the game is running.

Is that done with SetSize() ?


Sincerly,

Spellbreaker.

7
General / Sleep(float) in Window.cpp
« on: August 06, 2010, 04:46:27 pm »
Hey there.

I really don't know why, but for some reason, I keep getting the following Error since a few days, when Linking the Project:

Window/Window.cpp Line 360:

extlibs\SFML\lib\win32\libsfml-window-s-d.a(Window.o)||In function `ZN2sf6Window7DisplayEv':|
C:\Users\Spellbreaker\Documents\C++ Projects\SFML-1.6\src\SFML\Window\Window.cpp|360|undefined reference to `sf::Sleep(float)'|
||=== Build finished: 1 errors, 0 warnings ===|


I really have no Idea why that happens suddenly, the project kept linking perfectly few days Ago. No matter if I try to link Linux or Win32 Executable.

I am using Code::Blocks 10.05 with MingW 3.4.5 on Windows,
and Code::Blocks 10.05 with GCC 4.4 on Linux.

Using SFML 1.6.

Thanks in advance,

Spellbreaker

Pages: [1]