Esempio n. 1
0
        private object[,] GetDefaultChannelsGridData()
        {
            // 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;
                    }
                }
            }

            var channelTypes = project.GetActiveChannelList();
            var data         = new object[channelTypes.Length, 3];

            for (int i = 0; i < channelTypes.Length; i++)
            {
                data[i, 0] = !anyChannelActive || channelActives[i];
                data[i, 1] = ChannelType.GetNameWithExpansion(channelTypes[i]);
                data[i, 2] = 50;
            }

            return(data);
        }
Esempio n. 2
0
        private void OnChannel()
        {
            if (CheckNeedsClosing((int)ButtonType.Channel))
            {
                return;
            }

            var channelTypes = App.Project.GetActiveChannelList();
            var items        = new ListItem[channelTypes.Length];

            for (int i = 0; i < channelTypes.Length; i++)
            {
                var item = new ListItem();
                item.Color                = Theme.LightGreyFillColor1;
                item.ImageIndex           = Array.IndexOf(ButtonImageNames, ChannelType.Icons[channelTypes[i]]);
                item.GetImageOpacity      = (l) => { return(App.IsChannelActive((int)l.Data) ? 1.0f : 0.2f); };
                item.ExtraImageIndex      = (int)ButtonImageIndices.GhostSmall;
                item.GetExtraImageOpacity = (l) => { return(App.IsChannelForceDisplay((int)l.Data) ? 1.0f : 0.2f); };
                item.Text = ChannelType.GetNameWithExpansion(channelTypes[i]);
                item.Data = i;
                items[i]  = item;
            }

            popupSelectedIdx = App.SelectedChannelIndex;

            StartExpandingList((int)ButtonType.Channel, items);
        }
Esempio n. 3
0
        private string[] GetChannelNames()
        {
            var channelTypes = project.GetActiveChannelList();
            var channelNames = new string[channelTypes.Length];

            for (int i = 0; i < channelTypes.Length; i++)
            {
                channelNames[i] = ChannelType.GetNameWithExpansion(channelTypes[i]);
            }

            return(channelNames);
        }