Example #1
0
        public GridViewRip(Main main)
        {
            _main = main;

            // Setup message queue for receiving Messages
            IMessageQueue queueMessage = ServiceScope.Get <IMessageBroker>().GetOrCreate("message");

            queueMessage.OnMessageReceive += OnMessageReceive;

            InitializeComponent();

            dataGridViewRip.CurrentCellDirtyStateChanged += dataGridViewRip_CurrentCellDirtyStateChanged;

            // Listen to Messages
            IMessageQueue queueMessageEncoding = ServiceScope.Get <IMessageBroker>().GetOrCreate("encoding");

            queueMessageEncoding.OnMessageReceive += OnMessageReceiveEncoding;

            audioEncoder       = ServiceScope.Get <IAudioEncoder>();
            mediaChangeMonitor = ServiceScope.Get <IMediaChangeMonitor>();
            mediaChangeMonitor.MediaInserted += mediaChangeMonitor_MediaInserted;
            mediaChangeMonitor.MediaRemoved  += mediaChangeMonitor_MediaRemoved;

            // Get number of CD Drives found and initialise a Bindinglist for every drove
            int driveCount = BassCd.BASS_CD_GetDriveCount();

            if (driveCount == 0)
            {
                bindingList.Add(new SortableBindingList <CDTrackDetail>()); // In case of no CD, we want a Dummy List
            }
            _main.RipButtonsEnabled = false;

            for (int i = 0; i < driveCount; i++)
            {
                bindingList.Add(new SortableBindingList <CDTrackDetail>());
                if (BassCd.BASS_CD_IsReady(i))
                {
                    _main.RipButtonsEnabled = true;
                }
            }

            // Prepare the Gridview
            gridColumns = new GridViewColumnsRip();
            dataGridViewRip.AutoGenerateColumns = false;
            dataGridViewRip.DataSource          = bindingList[0];

            // Now Setup the columns, we want to display
            CreateColumns();

            SetStatusLabel("");
        }
Example #2
0
        public GridViewRip(Main main)
        {
            _main = main;

              // Setup message queue for receiving Messages
              IMessageQueue queueMessage = ServiceScope.Get<IMessageBroker>().GetOrCreate("message");
              queueMessage.OnMessageReceive += OnMessageReceive;

              InitializeComponent();

              dataGridViewRip.CurrentCellDirtyStateChanged += dataGridViewRip_CurrentCellDirtyStateChanged;

              // Listen to Messages
              IMessageQueue queueMessageEncoding = ServiceScope.Get<IMessageBroker>().GetOrCreate("encoding");
              queueMessageEncoding.OnMessageReceive += OnMessageReceiveEncoding;

              audioEncoder = ServiceScope.Get<IAudioEncoder>();
              mediaChangeMonitor = ServiceScope.Get<IMediaChangeMonitor>();
              mediaChangeMonitor.MediaInserted += mediaChangeMonitor_MediaInserted;
              mediaChangeMonitor.MediaRemoved += mediaChangeMonitor_MediaRemoved;

              // Get number of CD Drives found and initialise a Bindinglist for every drove
              int driveCount = BassCd.BASS_CD_GetDriveCount();
              if (driveCount == 0)
            bindingList.Add(new SortableBindingList<CDTrackDetail>()); // In case of no CD, we want a Dummy List

              _main.RipButtonsEnabled = false;

              for (int i = 0; i < driveCount; i++)
              {
            bindingList.Add(new SortableBindingList<CDTrackDetail>());
            if (BassCd.BASS_CD_IsReady(i))
            {
              _main.RipButtonsEnabled = true;
            }
              }

              // Prepare the Gridview
              gridColumns = new GridViewColumnsRip();
              dataGridViewRip.AutoGenerateColumns = false;
              dataGridViewRip.DataSource = bindingList[0];

              // Now Setup the columns, we want to display
              CreateColumns();

              SetStatusLabel("");
        }