// rdevent_player.cpp // // Execute a list of RML commands asynchronously. // // (C) Copyright 2002-2006,2016 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // #include RDEventPlayer::RDEventPlayer(RDRipc *ripc,QObject *parent) : QObject(parent) { player_ripc=ripc; for(unsigned i=0;isetMapping(player_events[i],i); connect(player_events[i],SIGNAL(finished()), player_mapper,SLOT(map())); if(player_events[i]->load(rml)) { player_events[i]->exec(); ret=true; } i=RDEVENT_PLAYER_MAX_EVENTS; } } return ret; } bool RDEventPlayer::exec(unsigned cartnum) { if(cartnum==0) { return false; } return exec(QString().sprintf("EX %u!",cartnum)); } void RDEventPlayer::macroFinishedData(int id) { player_state[id]=false; player_timer->start(1,true); } void RDEventPlayer::macroTimerData() { for(int i=0;i