Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Removed "m" prefix from MoviePlugin class names
Browse files Browse the repository at this point in the history
  • Loading branch information
cstawarz committed Jun 4, 2010
1 parent f789733 commit 960a90c
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 59 deletions.
6 changes: 3 additions & 3 deletions MoviePlugin/MovieFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
using namespace mw;


mMovieFrame::mMovieFrame(const shared_ptr<StimulusNode> frame,
MovieFrame::MovieFrame(const shared_ptr<StimulusNode> frame,
const MWorksTime next_frame_time) :
frame_node(frame),
next_frame_at(next_frame_time)
{}

shared_ptr<StimulusNode> mMovieFrame::stimNode() {
shared_ptr<StimulusNode> MovieFrame::stimNode() {
return frame_node;
}

MWorksTime mMovieFrame::nextFrameTime() const {
MWorksTime MovieFrame::nextFrameTime() const {
return next_frame_at;
}

Expand Down
4 changes: 2 additions & 2 deletions MoviePlugin/MovieFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#include "MWorksCore/StimulusNode.h"
using namespace mw;

class mMovieFrame {
class MovieFrame {
private:
shared_ptr <StimulusNode> frame_node;
MWorksTime next_frame_at;
std::string stim_tag;
public:
mMovieFrame(const shared_ptr<StimulusNode> frame,
MovieFrame(const shared_ptr<StimulusNode> frame,
const MWorksTime next_frame_time);
shared_ptr<StimulusNode> stimNode();
MWorksTime nextFrameTime() const;
Expand Down
42 changes: 21 additions & 21 deletions MoviePlugin/MovieStimulus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#include "boost/bind.hpp"
#include "MovieStimulusFrameNotification.h"

void *nextUpdate(const shared_ptr<mMovieStimulus> &movie);
void *finalFrame(const shared_ptr<mMovieStimulus> &movie);
void *nextUpdate(const shared_ptr<MovieStimulus> &movie);
void *finalFrame(const shared_ptr<MovieStimulus> &movie);

#define STIM_TYPE_MOVIE "movie"
#define STIM_MOVIE_PLAYING "playing"
#define STIM_MOVIE_CURRENT_FRAME "current_frame"

mMovieStimulus::mMovieStimulus(const shared_ptr<Scheduler> &a_scheduler,
MovieStimulus::MovieStimulus(const shared_ptr<Scheduler> &a_scheduler,
const shared_ptr<StimulusDisplay> &a_display,
const std::string &new_tag,
const shared_ptr<StimulusGroup> new_stimulus_group,
Expand All @@ -43,14 +43,14 @@ mMovieStimulus::mMovieStimulus(const shared_ptr<Scheduler> &a_scheduler,
updates_scheduled = 0;

// connect this to #stimDisplayUpdate
stimDisplayUpdateNotificationObject = shared_ptr<mMovieStimulusFrameNotification>(new mMovieStimulusFrameNotification(this));
stimDisplayUpdateNotificationObject = shared_ptr<MovieStimulusFrameNotification>(new MovieStimulusFrameNotification(this));
stimDisplayUpdate->addNotification(stimDisplayUpdateNotificationObject);

current_stimulus_group_index = -1;
}

// what's a frozen movie stim? I don't know either...return a copy of the existing movie
Stimulus * mMovieStimulus::frozenClone() {
Stimulus * MovieStimulus::frozenClone() {
boost::mutex::scoped_lock locker(movie_lock);

shared_ptr<Variable> frozen_frames_per_second(frames_per_second->frozenClone());
Expand All @@ -64,7 +64,7 @@ Stimulus * mMovieStimulus::frozenClone() {
//
// x << frozen_counter;
//
return new mMovieStimulus(scheduler,
return new MovieStimulus(scheduler,
display,
tag,
stimulus_group,
Expand All @@ -75,17 +75,17 @@ Stimulus * mMovieStimulus::frozenClone() {
frozen_end_frame_index);
}

int mMovieStimulus::getNFramesToShow() {
int MovieStimulus::getNFramesToShow() {
boost::mutex::scoped_lock locker(movie_lock);
return (end_frame_index->getValue().getInteger()-start_frame_index->getValue().getInteger()) + 1;
}

int mMovieStimulus::getNFramesShown() {
int MovieStimulus::getNFramesShown() {
boost::mutex::scoped_lock locker(movie_lock);
return updates_scheduled;
}

void mMovieStimulus::play() {
void MovieStimulus::play() {
boost::mutex::scoped_lock locker(movie_lock);

if (!movie_started) {
Expand Down Expand Up @@ -118,7 +118,7 @@ void mMovieStimulus::play() {
times_shown.push_back(times);
}

shared_ptr <mMovieStimulus> shared_ptr_to_this = shared_from_this();
shared_ptr <MovieStimulus> shared_ptr_to_this = shared_from_this();

schedule_node = scheduler->scheduleUS(FILELINE,
0,
Expand All @@ -132,7 +132,7 @@ void mMovieStimulus::play() {
}
}

void mMovieStimulus::stopAndRewind() {
void MovieStimulus::stopAndRewind() {
boost::mutex::scoped_lock locker(movie_lock);

// If movie is already stopped, do nothing
Expand All @@ -149,7 +149,7 @@ void mMovieStimulus::stopAndRewind() {
//schedule_node->kill();
}

void mMovieStimulus::draw(shared_ptr<StimulusDisplay> display) {
void MovieStimulus::draw(shared_ptr<StimulusDisplay> display) {
boost::mutex::scoped_lock locker(movie_lock);

// this is the first draw that the movie has recieved...schedule the display updates accordingly
Expand All @@ -170,7 +170,7 @@ void mMovieStimulus::draw(shared_ptr<StimulusDisplay> display) {
// schedule the time to hide the last frame
const MWorksTime time_to_hide_final_frame = start_time + (1/frames_per_us)*number_of_frames_to_show;

shared_ptr <mMovieStimulus> shared_ptr_to_this = shared_from_this();
shared_ptr <MovieStimulus> shared_ptr_to_this = shared_from_this();

schedule_node = scheduler->scheduleUS(FILELINE,
time_to_hide_final_frame - scheduler->getClock()->getCurrentTimeUS(),
Expand All @@ -186,7 +186,7 @@ void mMovieStimulus::draw(shared_ptr<StimulusDisplay> display) {
}
}

void mMovieStimulus::endMovie() {
void MovieStimulus::endMovie() {
{
boost::mutex::scoped_lock locker(movie_lock);

Expand Down Expand Up @@ -231,7 +231,7 @@ void mMovieStimulus::endMovie() {



void mMovieStimulus::callUpdateDisplay() {
void MovieStimulus::callUpdateDisplay() {
{
boost::mutex::scoped_lock locker(movie_lock);
++updates_scheduled;
Expand All @@ -240,7 +240,7 @@ void mMovieStimulus::callUpdateDisplay() {
display->asynchronousUpdateDisplay();
}

void mMovieStimulus::stimDisplayUpdateNotification(const Datum &data, const MWorksTime time_us) {
void MovieStimulus::stimDisplayUpdateNotification(const Datum &data, const MWorksTime time_us) {
boost::mutex::scoped_lock locker(movie_lock);

if(movie_started && !movie_ended) {
Expand Down Expand Up @@ -272,7 +272,7 @@ void mMovieStimulus::stimDisplayUpdateNotification(const Datum &data, const MWor
}
}

Datum mMovieStimulus::getCurrentAnnounceDrawData() {
Datum MovieStimulus::getCurrentAnnounceDrawData() {
boost::mutex::scoped_lock locker(movie_lock);
// mprintf("%s, announcing: %d", tag.c_str(), current_stimulus_group_index);
//
Expand All @@ -286,17 +286,17 @@ Datum mMovieStimulus::getCurrentAnnounceDrawData() {
return (announceData);
}

void *nextUpdate(const shared_ptr<mMovieStimulus> &movie){
void *nextUpdate(const shared_ptr<MovieStimulus> &movie){
movie->callUpdateDisplay();
return 0;
}

void *finalFrame(const shared_ptr<mMovieStimulus> &movie){
void *finalFrame(const shared_ptr<MovieStimulus> &movie){
movie->endMovie();
return 0;
}

shared_ptr<mw::Component> mMovieStimulusFactory::createObject(std::map<std::string, std::string> parameters,
shared_ptr<mw::Component> MovieStimulusFactory::createObject(std::map<std::string, std::string> parameters,
ComponentRegistry *reg) {
const char *TAG = "tag";
const char *STIMULUS_GROUP = "stimulus_group";
Expand Down Expand Up @@ -359,7 +359,7 @@ shared_ptr<mw::Component> mMovieStimulusFactory::createObject(std::map<std::stri
throw SimpleException("Attempt to create movie stimulus without a valid stimulus display");
}

shared_ptr <mMovieStimulus> new_movie = shared_ptr<mMovieStimulus>(new mMovieStimulus(scheduler,
shared_ptr <MovieStimulus> new_movie = shared_ptr<MovieStimulus>(new MovieStimulus(scheduler,
display,
tagname,
the_group,
Expand Down
10 changes: 5 additions & 5 deletions MoviePlugin/MovieStimulus.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
using namespace mw;


class mMovieStimulusFrameNotification;
class MovieStimulusFrameNotification;

class mMovieStimulus : public Stimulus, public boost::enable_shared_from_this<mMovieStimulus> {
class MovieStimulus : public Stimulus, public boost::enable_shared_from_this<MovieStimulus> {

protected:
boost::shared_ptr<Scheduler> scheduler;
Expand All @@ -37,7 +37,7 @@ class mMovieStimulus : public Stimulus, public boost::enable_shared_from_this<mM
boost::shared_ptr<Variable> error_reporting;
boost::shared_ptr<Variable> start_frame_index;
boost::shared_ptr<Variable> end_frame_index;
boost::shared_ptr<mMovieStimulusFrameNotification> stimDisplayUpdateNotificationObject;
boost::shared_ptr<MovieStimulusFrameNotification> stimDisplayUpdateNotificationObject;

unsigned int current_stimulus_group_index;
unsigned int updates_scheduled;
Expand All @@ -53,7 +53,7 @@ class mMovieStimulus : public Stimulus, public boost::enable_shared_from_this<mM

public:

mMovieStimulus(const boost::shared_ptr<Scheduler> &a_scheduler,
MovieStimulus(const boost::shared_ptr<Scheduler> &a_scheduler,
const boost::shared_ptr<StimulusDisplay> &a_display,
const std::string &new_tag,
const boost::shared_ptr<StimulusGroup> stimulus_group,
Expand Down Expand Up @@ -81,7 +81,7 @@ class mMovieStimulus : public Stimulus, public boost::enable_shared_from_this<mM
const MWorksTime time_us);
};

class mMovieStimulusFactory : public ComponentFactory {
class MovieStimulusFactory : public ComponentFactory {
virtual boost::shared_ptr<mw::Component> createObject(std::map<std::string, std::string> parameters,
ComponentRegistry *reg);
};
Expand Down
6 changes: 3 additions & 3 deletions MoviePlugin/MovieStimulusFrameNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

#include "MovieStimulusFrameNotification.h"

mMovieStimulusFrameNotification::mMovieStimulusFrameNotification(mMovieStimulus *the_ms){
MovieStimulusFrameNotification::MovieStimulusFrameNotification(MovieStimulus *the_ms){
movie_stimulus = the_ms;
}

void mMovieStimulusFrameNotification::notify(const Datum &data) {
void MovieStimulusFrameNotification::notify(const Datum &data) {
shared_ptr<Clock> clock = Clock::instance();
this->notify(data, clock->getCurrentTimeUS());
}

void mMovieStimulusFrameNotification::notify(const Datum &data, MWorksTime time_us) {
void MovieStimulusFrameNotification::notify(const Datum &data, MWorksTime time_us) {
movie_stimulus->stimDisplayUpdateNotification(data, time_us);
}
8 changes: 4 additions & 4 deletions MoviePlugin/MovieStimulusFrameNotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
#include "MovieStimulus.h"
#include "MWorksCore/GenericVariable.h"

class mMovieStimulus;
class MovieStimulus;

class mMovieStimulusFrameNotification : public VariableNotification {
class MovieStimulusFrameNotification : public VariableNotification {
protected:

mMovieStimulus *movie_stimulus;
MovieStimulus *movie_stimulus;

public:

mMovieStimulusFrameNotification(mMovieStimulus *the_ms);
MovieStimulusFrameNotification(MovieStimulus *the_ms);
virtual void notify(const Datum& data);
virtual void notify(const Datum& data, MWorksTime timeUS);

Expand Down
6 changes: 3 additions & 3 deletions MoviePlugin/MovieStimulusPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Plugin *getPlugin(){

void MovieStimulusPlugin::registerComponents(shared_ptr<ComponentRegistry> registry) {
registry->registerFactory(std::string("stimulus/movie"),
(ComponentFactory *)(new mMovieStimulusFactory()));
(ComponentFactory *)(new MovieStimulusFactory()));

registry->registerFactory(std::string("action/play_movie"),
(ComponentFactory *)(new mPlayMovieFactory()));
(ComponentFactory *)(new PlayMovieFactory()));

registry->registerFactory(std::string("action/stop_movie"),
(ComponentFactory *)(new mStopMovieFactory()));
(ComponentFactory *)(new StopMovieFactory()));
}
10 changes: 5 additions & 5 deletions MoviePlugin/PlayMovie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@

#include "PlayMovie.h"

mPlayMovie::mPlayMovie(shared_ptr<mMovieStimulus> the_movie) :
PlayMovie::PlayMovie(shared_ptr<MovieStimulus> the_movie) :
Action()
{
setName("PlayMovie");
movie=the_movie;
}

bool mPlayMovie::execute() {
bool PlayMovie::execute() {
movie->play();
return true;
}

shared_ptr<mw::Component> mPlayMovieFactory::createObject(std::map<std::string, std::string> parameters,
shared_ptr<mw::Component> PlayMovieFactory::createObject(std::map<std::string, std::string> parameters,
ComponentRegistry *reg) {

const char *MOVIE = "movie";

REQUIRE_ATTRIBUTES(parameters, MOVIE);

shared_ptr <mMovieStimulus> the_movie = reg->getObject<mMovieStimulus>(parameters.find(MOVIE)->second);
shared_ptr <MovieStimulus> the_movie = reg->getObject<MovieStimulus>(parameters.find(MOVIE)->second);

if(the_movie == 0) {
throw MissingReferenceException(parameters.find("reference_id")->second, MOVIE, parameters.find(MOVIE)->second);
}

shared_ptr <mPlayMovie> new_play_movie_action = shared_ptr<mPlayMovie>(new mPlayMovie(the_movie));
shared_ptr <PlayMovie> new_play_movie_action = shared_ptr<PlayMovie>(new PlayMovie(the_movie));
return new_play_movie_action;
}

Expand Down
8 changes: 4 additions & 4 deletions MoviePlugin/PlayMovie.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
using namespace mw;


class mPlayMovie : public Action {
class PlayMovie : public Action {
protected:
shared_ptr<mMovieStimulus> movie;
shared_ptr<MovieStimulus> movie;

public:

mPlayMovie(shared_ptr<mMovieStimulus> the_movie);
PlayMovie(shared_ptr<MovieStimulus> the_movie);
virtual bool execute();
};

class mPlayMovieFactory : public ComponentFactory {
class PlayMovieFactory : public ComponentFactory {
virtual boost::shared_ptr<mw::Component> createObject(std::map<std::string, std::string> parameters,
ComponentRegistry *reg);
};
Expand Down
10 changes: 5 additions & 5 deletions MoviePlugin/StopMovie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@

#include "StopMovie.h"

mStopMovie::mStopMovie(shared_ptr<mMovieStimulus> the_movie) :
StopMovie::StopMovie(shared_ptr<MovieStimulus> the_movie) :
Action()
{
setName("StopAndRewindMovie");
movie=the_movie;
}

bool mStopMovie::execute() {
bool StopMovie::execute() {
movie->stopAndRewind();
return true;
}


shared_ptr<mw::Component> mStopMovieFactory::createObject(std::map<std::string, std::string> parameters,
shared_ptr<mw::Component> StopMovieFactory::createObject(std::map<std::string, std::string> parameters,
ComponentRegistry *reg) {

const char *MOVIE = "movie";

REQUIRE_ATTRIBUTES(parameters, MOVIE);

shared_ptr <mMovieStimulus> the_movie = reg->getObject<mMovieStimulus>(parameters.find(MOVIE)->second);
shared_ptr <MovieStimulus> the_movie = reg->getObject<MovieStimulus>(parameters.find(MOVIE)->second);

if(the_movie == 0) {
throw MissingReferenceException(parameters.find("reference_id")->second, MOVIE, parameters.find(MOVIE)->second);
}

shared_ptr <mStopMovie> new_stop_movie_action = shared_ptr<mStopMovie>(new mStopMovie(the_movie));
shared_ptr <StopMovie> new_stop_movie_action = shared_ptr<StopMovie>(new StopMovie(the_movie));
return new_stop_movie_action;
}
Loading

0 comments on commit 960a90c

Please sign in to comment.