// ---------------------------------------------------------------------------- // SceneColorFader* VenueReader::read( TiXmlElement* self, SceneColorFader* animation ) { animation = new SceneColorFader(); animation->m_uid = (UID)read_dword_attribute( self, "uid" ); animation->m_fader_effect = (FaderEffect)read_unsigned_attribute( self, "fader_effect", FaderEffect::FADER_EFFECT_ALL ); animation->m_strobe_neg_color = read_rgbw_attribute( self, "strobe_neg_color" ); animation->m_strobe_pos_ms = read_unsigned_attribute( self, "strobe_pos_ms" ); animation->m_strobe_neg_ms = read_unsigned_attribute( self, "strobe_neg_ms" ); animation->m_strobe_flashes = read_unsigned_attribute(self, "strobe_flashes", 1 ); animation->m_name = read_text_element( self, "name" ); animation->m_description = read_text_element( self, "description" ); TiXmlElement* signal_element = self->FirstChildElement( "signal" ); if ( signal_element ) { AnimationSignal* signal = read( signal_element, (AnimationSignal*)NULL ); animation->m_signal = *signal; delete signal; } read_uids( self, "pfuids", animation->m_actors ); read_colors( self, "custom_colors", animation->m_custom_colors ); return animation; }
// ---------------------------------------------------------------------------- // ScenePixelAnimator* VenueReader::read( TiXmlElement* self, ScenePixelAnimator* animation ) { animation = new ScenePixelAnimator(); animation->m_uid = (UID)read_dword_attribute( self, "uid" ); animation->m_name = read_text_element( self, "name" ); animation->m_description = read_text_element( self, "description" ); animation->m_effect = (PixelEffect)read_unsigned_attribute( self, "pixel_effect", 1 ); animation->m_generations = read_unsigned_attribute( self, "generations", 1 ); animation->m_num_pixels = read_unsigned_attribute( self, "pixels", 1 ); animation->m_increment = read_unsigned_attribute( self, "increment", 1 ); animation->m_color_fade = read_bool_attribute( self, "fade", 1 ); animation->m_combine_fixtures = read_bool_attribute( self, "combine", 1 ); animation->m_empty_color = read_rgbw_attribute( self, "pixel_off_color" ); TiXmlElement* signal_element = self->FirstChildElement( "signal" ); if ( signal_element ) { AnimationSignal* signal = read( signal_element, (AnimationSignal*)NULL ); animation->m_signal = *signal; delete signal; } read_uids( self, "pfuids", animation->m_actors ); read_colors( self, "custom_colors", animation->m_custom_colors ); return animation; }
// ---------------------------------------------------------------------------- // SceneStrobeAnimator* VenueReader::read( TiXmlElement* self, SceneStrobeAnimator* animation ) { animation = new SceneStrobeAnimator(); animation->m_uid = (UID)read_dword_attribute( self, "uid" ); animation->m_strobe_neg_color = read_rgbw_attribute( self, "strobe_neg_color" ); animation->m_strobe_pos_ms = read_unsigned_attribute( self, "strobe_pos_ms" ); animation->m_strobe_neg_ms = read_unsigned_attribute( self, "strobe_neg_ms" ); animation->m_name = read_text_element( self, "name" ); animation->m_description = read_text_element( self, "description" ); TiXmlElement* signal_element = self->FirstChildElement( "signal" ); if ( signal_element ) { AnimationSignal* signal = read( signal_element, (AnimationSignal*)NULL ); animation->m_signal = *signal; delete signal; } read_uids( self, "pfuids", animation->m_actors ); return animation; }
// ---------------------------------------------------------------------------- // Venue * VenueReader::read( TiXmlElement* self, Venue* venue ) { venue = new Venue(); venue->m_scenes.clear(); // Kill the auto generated default scene venue->m_uid_pool = read_dword_attribute( self, "next_uid" ); venue->m_current_scene = (UID)read_dword_attribute( self, "current_scene" ); venue->m_name = read_text_element( self, "name" ); venue->m_description = read_text_element( self, "description" ); // Add all universes (up to the max, must be in correct order) std::vector<Universe *> universes = read_xml_list<Universe>( self->FirstChildElement( "dmx_universes" ), "universe" ); for ( std::vector<Universe *>::iterator it=universes.begin(); it != universes.end(); ++it ) { venue->addUniverse( (*it) ); } TiXmlElement *dimmer = self->FirstChildElement( "dimmer" ); if ( dimmer ) { venue->m_master_dimmer = (BYTE)read_int_attribute( dimmer, "master_dimmer" ); venue->m_auto_backout_ms = read_dword_attribute( dimmer, "auto_blackout" ); venue->m_whiteout_strobe_ms = read_unsigned_attribute( dimmer, "whiteout_strobe", venue->getWhiteoutStrobeMS() ); venue->m_whiteout_color = read_rgbw_attribute( dimmer, "whiteout_color", RGBWA::WHITE ); } TiXmlElement *audio = self->FirstChildElement( "audio" ); if ( audio ) { venue->m_audio_capture_device = read_text_element( audio, "capture_device" ); venue->m_audio_boost = (float)read_double_attribute( audio, "scale" ); venue->m_audio_boost_floor = (float)read_double_attribute( audio, "floor" ); venue->m_audio_sample_size = (UINT)read_unsigned_attribute( audio, "sample_size", 1024 ); } venue->m_venue_layout = read_text_element( self, "venue_layout" ); // Add all fixtures std::vector<Fixture *> fixtures = read_xml_list<Fixture>( self->FirstChildElement( "fixtures" ), "fixture" ); for ( std::vector<Fixture *>::iterator it=fixtures.begin(); it != fixtures.end(); ++it ) { venue->addFixture( *(*it) ); delete (*it); } // Add scenes std::vector<Scene *> scenes = read_xml_list<Scene>( self->FirstChildElement( "scenes" ), "scene" ); for ( std::vector<Scene *>::iterator it=scenes.begin(); it != scenes.end(); ++it ) { venue->addScene( *(*it), (*it)->getNumber() == DEFAULT_SCENE_NUMBER); delete (*it); } // Add fixture groups std::vector<FixtureGroup *> fixture_groups = read_xml_list<FixtureGroup>( self->FirstChildElement( "fixture_groups" ), "fixture_group" ); for ( std::vector<FixtureGroup *>::iterator it=fixture_groups.begin(); it != fixture_groups.end(); ++it ) { venue->addFixtureGroup( *(*it) ); delete (*it); } // Add chases std::vector<Chase *> chases = read_xml_list<Chase>( self->FirstChildElement( "chases" ), "chase" ); for ( std::vector<Chase *>::iterator it=chases.begin(); it != chases.end(); ++it ) { venue->addChase( *(*it) ); delete (*it); } // Add music mappings TiXmlElement *music_scenes_element = self->FirstChildElement( "music_scenes" ); if ( music_scenes_element ) { venue->m_music_scene_select_enabled = read_bool_attribute( music_scenes_element, "enabled" ); std::vector<MusicSceneSelector *> music_scenes = read_xml_list<MusicSceneSelector>( self->FirstChildElement( "music_scenes" ), "music_mapping" ); for ( std::vector<MusicSceneSelector *>::iterator it=music_scenes.begin(); it != music_scenes.end(); ++it ) { venue->addMusicMapping( *(*it) ); delete (*it); } } return venue; }