mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
#ifndef NETWORKSOURCE_H
|
|
#define NETWORKSOURCE_H
|
|
|
|
#include "NetworkToolkit.h"
|
|
#include "StreamSource.h"
|
|
|
|
class NetworkStream : public Stream
|
|
{
|
|
public:
|
|
|
|
NetworkStream();
|
|
void open(NetworkToolkit::Protocol protocol, const std::string &address, uint port );
|
|
|
|
glm::ivec2 resolution();
|
|
|
|
inline NetworkToolkit::Protocol protocol() const { return protocol_; }
|
|
inline std::string address() const { return address_; }
|
|
inline uint port() const { return port_; }
|
|
|
|
private:
|
|
NetworkToolkit::Protocol protocol_;
|
|
std::string address_;
|
|
uint port_;
|
|
};
|
|
|
|
class NetworkSource : public StreamSource
|
|
{
|
|
public:
|
|
NetworkSource();
|
|
|
|
// Source interface
|
|
void accept (Visitor& v) override;
|
|
|
|
// StreamSource interface
|
|
Stream *stream() const override { return stream_; }
|
|
|
|
// specific interface
|
|
NetworkStream *networkstream() const;
|
|
void connect(NetworkToolkit::Protocol protocol, const std::string &address, uint port);
|
|
|
|
glm::ivec2 icon() const override { return glm::ivec2(11, 8); }
|
|
|
|
};
|
|
|
|
#endif // NETWORKSOURCE_H
|