Commit 6b74aa91 authored by alexandre burton's avatar alexandre burton
Browse files

ClientPlayer: ménage et ajout d'un offset x/y

parent 3410c33c
......@@ -8,20 +8,10 @@
namespace ofxCloudLib
{
class ClientsManager;
class ClientPlayer : public AbstractClient
{
public:
ClientPlayer(std::string client_name, int index) : AbstractClient(client_name, index){};
ofxTextField recording_path_;
ofxButton load_recording_;
ofParameter<float> speed_;
ofParameter<bool> looping_;
ofParameter<bool> playing_;
ofParameter<bool> drawing_;
ofParameter<int> index_;
ofxCloudLib::CloudPlayerThread cloud_player_;
void load_recording()
{
......@@ -42,8 +32,14 @@ class ClientPlayer : public AbstractClient
}
}
ofMesh &get_mesh() override { return cloud_player_.get_mesh(); };
void offset(float &b)
{
cloud_player_.offset_x_ = offset_x_;
cloud_player_.offset_z_ = offset_z_;
;
}
ofMesh &get_mesh() override { return cloud_player_.get_mesh(); };
void update() override
{
......@@ -51,21 +47,38 @@ class ClientPlayer : public AbstractClient
cloud_player_.update_mesh();
index_.set(cloud_player_.get_current_frame());
}
void setup() override
{
AbstractClient::setup();
gui_.add(recording_path_.setup("path", "/to/recording/directory"));
gui_.add(recording_path_.setup("path", "/home/artificiel/recordings"));
gui_.add(load_recording_.setup("load recording"));
gui_.add(drawing_.set("drawing", 0));
gui_.add(playing_.set("playing", 0));
gui_.add(speed_.set("speed", 1, .1, 10));
gui_.add(looping_.set("looping", true));
gui_.add(index_.set("frame", 0, 0, 1000));
gui_.add(offset_x_.set("offset x", 2, -10, 10));
gui_.add(offset_z_.set("offset z", 2, -10, 10));
load_recording_.addListener(this, &ClientPlayer::load_recording);
playing_.addListener(this, &ClientPlayer::control_playback);
offset_x_.addListener(this, &ClientPlayer::offset);
offset_z_.addListener(this, &ClientPlayer::offset);
}
ofxTextField recording_path_;
ofxButton load_recording_;
ofParameter<float> speed_;
ofParameter<bool> looping_;
ofParameter<bool> playing_;
ofParameter<float> offset_x_;
ofParameter<float> offset_z_;
ofParameter<bool> drawing_;
ofParameter<int> index_;
ofxCloudLib::CloudPlayerThread cloud_player_;
};
}
} // namespace ofxCloudLib
#endif // CLIENTPLAYER_HPP
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment