private bool initialized; // flag set once the project is properly initialized /// <summary> /// Create a new empty project. /// </summary> public Project() : base() { this.path = null; this.changes = 0; setDataModelFactory(new DataModelFactory()); setPresentation(getDataModelFactory().createPresentation(), 0); urakawa.property.channel.Channel audioChannel = getPresentation(0).getChannelFactory().createChannel(); audioChannel.setName("bobi.audio"); getPresentation(0).getChannelsManager().addChannel(audioChannel); SetUndoRedoEvents(); this.initialized = true; }
// Find a channel by name and return it. Return null when not found. public urakawa.property.channel.Channel FindChannel(string name) { urakawa.property.channel.Channel channel = null; foreach (urakawa.property.channel.Channel ch in getPresentation(0).getChannelsManager().getListOfChannels()) { if (ch.getName() == name) { channel = ch; break; } } return(channel); }