private bool[] GetDefaultActiveChannels() { // Find all channels used by the project. var anyChannelActive = false; var channelActives = new bool[project.GetActiveChannelCount()]; foreach (var song in project.Songs) { for (int i = 0; i < song.Channels.Length; i++) { var channel = song.Channels[i]; if (channel.Patterns.Count > 0) { anyChannelActive = true; channelActives[i] = true; } } } if (!anyChannelActive) { return(null); } return(channelActives); }
public ChannelState[] CreateChannelStates(Project project, int apuIdx, int expNumChannels, bool pal) { var channelCount = project.GetActiveChannelCount(); var states = new ChannelState[channelCount]; int idx = 0; for (int i = 0; i < Channel.Count; i++) { if (project.IsChannelActive(i)) { states[idx++] = CreateChannelState(apuIdx, i, expNumChannels, pal); } } return(states); }
protected ChannelState[] CreateChannelStates(IPlayerInterface player, Project project, int apuIdx, int expNumChannels, bool pal) { var channelCount = project.GetActiveChannelCount(); var states = new ChannelState[channelCount]; int idx = 0; for (int i = 0; i < ChannelType.Count; i++) { if (project.IsChannelActive(i)) { var state = CreateChannelState(apuIdx, i, expNumChannels, pal); states[idx++] = state; } } return(states); }
public ChannelState[] CreateChannelStates(Project project, int apuIdx, int expNumChannels, bool pal, IRegisterListener listener) { var channelCount = project.GetActiveChannelCount(); var states = new ChannelState[channelCount]; int idx = 0; for (int i = 0; i < Channel.Count; i++) { if (project.IsChannelActive(i)) { var state = CreateChannelState(apuIdx, i, expNumChannels, pal); if (listener != null) { state.SetRegisterListener(listener); } states[idx++] = state; } } return(states); }