示例#1
0
        public MetroAudioForm(String[] args)
        {
            InitializeComponent();
            m_KeyboardHook.KeyPressed += m_KeyboardHook_KeyPressed;
            RadioButtonKeysBound.Checked = m_Register_Hotkeys();

            audioPlayer = new AudioPlayer(this.Handle);
            ListBoxPlayList.DataSource = audioPlayListItems;
            ListBoxPlayList.DisplayMember = "Name";
            ListBoxPlayList.ValueMember = "Location";

            // Support Drag & Drop
            this.AllowDrop = true;
            this.DragEnter += MetroAudioForm_DragEnter;
            this.DragDrop += MetroAudioForm_DragDrop;

            // Fill our options
            this.ComboBoxOptionsTheme.DataSource = Enum.GetValues(typeof(MetroFramework.MetroColorStyle)).Cast<MetroFramework.MetroColorStyle>().ToList();
            this.ComboBoxOptionsTheme.SelectedItem = MetroColorStyle.Red;

            this.ListBoxPlayList.MouseDoubleClick += MetroAudioForm_MouseDoubleClickListBox;

            this.TrackBarProgress.MouseUp += TrackBarProgress_MouseUp;

            this.GotFocus += MetroAudioForm_GotFocus;

            // Support the Open With Context menu
            if (args != null && args.Length > 0)
            {
                m_Logger.Info("Loading {0} items into player...", args.Length);
                for (int i = 0; i < args.Length; i++)
                {
                    m_Logger.Info("Adding media: {0}", args[i]);
                    audioPlayListItems.Add(new AudioPlayListItem(audioPlayer) { Location = args[i] });
                }
            }
        }
示例#2
0
 public AudioPlayListItem(AudioPlayer player)
 {
     this.player = player;
 }